embedbase.js 1.1 KB

12345
  1. /*
  2. Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
  3. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. CKEDITOR.dialog.add("embedBase",function(e){var t=e.lang.embedbase;return{title:t.title,minWidth:350,minHeight:50,onLoad:function(){function t(){n.setState(CKEDITOR.DIALOG_STATE_IDLE),i=null}var n=this,i=null;this.on("ok",function(a){a.data.hide=!1,a.stop(),n.setState(CKEDITOR.DIALOG_STATE_BUSY);var l=n.getValueOf("info","url"),o=n.getModel(e);i=o.loadContent(l,{noNotifications:!0,callback:function(){o.isReady()||e.widgets.finalizeCreation(o.wrapper.getParent(!0)),e.fire("saveSnapshot"),n.hide(),t()},errorCallback:function(e){n.getContentElement("info","url").select(),alert(o.getErrorMessage(e,l,"Given")),t()}})},null,null,15),this.on("cancel",function(e){e.data.hide&&i&&(i.cancel(),t())})},contents:[{id:"info",elements:[{type:"text",id:"url",label:e.lang.common.url,required:!0,setup:function(e){this.setValue(e.data.url)},validate:function(){return this.getDialog().getModel(e).isUrlValid(this.getValue())?!0:t.unsupportedUrlGiven}}]}]}});