-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.min.js
1 lines (1 loc) · 4.67 KB
/
plugin.min.js
1
!function(){var e,n=514,i=534,t={da:"da_DK",de:"de_DE",el:"el_GR",en:"en_US",es:"es_ES",fi:"fi_FI",fr:"fr_FR",it:"it_IT",nb:"nb_NO",nl:"nl_NL",pt:"pt_PT",sv:"sv_SE"};tinymce.settings.language||(tinymce.settings.language="en"),tinymce.settings.language_load||(tinymce.settings.language_load=!0),tinymce.PluginManager.requireLangPack("wsc"),tinymce.create("tinymce.plugins.wsc",{init:function(t,o){var a=this,c={};c.wscCorePath=window.WSCCorePath,c.customerId=t.getParam("wsc_customerId",""),c.customerIdParam=c.customerId?"&customerid="+c.customerId:"",c.lang=t.getParam("wsc_lang",a._getCurrentTinyMCEIntLang(t)),c.ctrl=t.id,c.cmd=t.getParam("wsc_cmd",""),c.intLang=t.getParam("wsc_intLang",a._getCurrentTinyMCEIntLang(t)),c.userDictionaryName=t.getParam("wsc_userDictionaryName",""),c.customDictionaryName=t.getParam("wsc_customDictionaryName",""),e||(e=t.getParam("wsc_schemaIdentifier",18)),c.schemaIdentifier=e,c.width=t.getParam("wsc_width",n),c.height=t.getParam("wsc_height",i),c.top=t.getParam("wsc_top",0),c.left=t.getParam("wsc_left",0),c.title=t.getParam("wsc_popup_title","WebSpellChecker"),c.autoClose=t.getParam("wsc_autoClose",""),c.domainName=t.getParam("wsc_domainName",""),c.schemaURI=t.getParam("wsc_schemaURI",""),c.onCancel=t.getParam("wsc_popup_cancel",function(){}),c.onFinish=t.getParam("wsc_popup_finish",function(){}),c.onClose=t.getParam("wsc_popup_close",function(){}),c.wscCoreURL=c.wscCorePath+"wsc&schema="+c.schemaIdentifier+c.customerIdParam;for(var s in c)""===c[s]&&delete c[s];t.addCommand("mceWSC",function(){a._initializeWSC(t,c,o)}),t.addCommand("wscRunInsideModal",function(e,n){a._runInsideModalWindow(t,c,n)}),t.addCommand("wscResizeWSCWindow",function(e,n){a._resizeWSCWindow(t,c,n)});var d=t.baseURI.source+"/plugins/wsc/img/btn_wsc_tinymce.gif";t.addButton("wsc",{title:"WSC_button_desc",cmd:"mceWSC",image:d})},_initializeWSC:function(e,n,i){var t=this;(new tinymce.dom.ScriptLoader).loadScripts([n.wscCoreURL],function(){t._openWindow(e,n,i)})},_openWindow:function(e,n,i){var t=document.getElementById(e.id),o=n.onFinish,a=n.onCancel;e.wscDialogWindow&&e.wscDialogWindow.close(),n._callbacksChanged||(n._callbacksChanged=!0,n.onFinish=function(n){e.setContent(n.value),e.save(),e.wscDialogWindow&&e.wscDialogWindow.close(),"function"==typeof o&&o(n)},n.onCancel=function(){e.wscDialogWindow&&e.wscDialogWindow.close(),"function"==typeof a&&a()}),t.value=e.getContent(),118==n.schemaIdentifier&&""!==t.value?(window.DragHandler&&(window.DragHandler.attach=function(){},window.DragHandler.updateWindowSize=function(){},window.DragHandler.resetElement=function(){},window.DragHandler.initView=function(){}),e.wscDialogWindow=e.windowManager.open({title:n.title,width:n.width,height:n.height,resizable:!0,maximizable:!1,body:[],buttons:[],onpostrender:function(){setTimeout(function(){e.execCommand("wscRunInsideModal",!1,e.wscDialogWindow),e.execCommand("wscResizeWSCWindow",!1,e.wscDialogWindow)},0)}})):window.WSC.doSpell(n)},_runInsideModalWindow:function(e,n,i){window.WSC.doSpell(n),e.plugins.wsc._wscInfo={},e.plugins.wsc._wscInfo.modalWindowWrapper=document.getElementById("webspellchecker-modal-window-wrapper"),e.plugins.wsc._wscInfo.modalWindowHeader=document.getElementById("webspellchecker-modal-header"),e.plugins.wsc._wscInfo.modalWindow=document.getElementById("webspellchecker-modal-window"),e.plugins.wsc._wscInfo.modalWindowIframe=e.plugins.wsc._wscInfo.modalWindow.children[0],e.plugins.wsc._wscInfo.contentArea=document.getElementById(i._id+"-body"),e.plugins.wsc._wscInfo.contentArea.appendChild(e.plugins.wsc._wscInfo.modalWindowWrapper);var t=document.getElementById("webspellchecker-modal-bg"),o=document.getElementById("webspellchecker-wsc_resize"),a=document.getElementById("webspellchecker-closeButton");t&&tinyMCE.DOM.remove(t),o&&tinyMCE.DOM.remove(o),a&&tinyMCE.DOM.remove(a)},_resizeWSCWindow:function(e,n,i){var t=(parseInt(tinymce.DOM.getStyle(e.plugins.wsc._wscInfo.contentArea,"width",!0),10)||0)-2,o=(parseInt(tinymce.DOM.getStyle(e.plugins.wsc._wscInfo.contentArea,"height",!0),10)||0)-2,a=e.plugins.wsc._wscInfo.modalWindowHeader.clientHeight+(parseInt(tinymce.DOM.getStyle(e.plugins.wsc._wscInfo.modalWindow,"marginTop",!0),10)||0);e.plugins.wsc._wscInfo.modalWindowWrapper.style.width=t+"px",e.plugins.wsc._wscInfo.modalWindowWrapper.style.height=o+"px",e.plugins.wsc._wscInfo.modalWindow.style.marginLeft="0",e.plugins.wsc._wscInfo.modalWindow.style.width="100%",e.plugins.wsc._wscInfo.modalWindow.style.height=o-a+"px",e.plugins.wsc._wscInfo.modalWindowIframe.style.width="100%",e.plugins.wsc._wscInfo.modalWindowIframe.style.height="100%"},_getCurrentTinyMCEIntLang:function(e){var n=e.settings.language;return(n=t[n])||(n="en_US"),n}}),tinymce.PluginManager.add("wsc",tinymce.plugins.wsc)}();