-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.min.js
1 lines (1 loc) · 2.75 KB
/
plugin.min.js
1
tinymce.PluginManager.add("cjfilebrowser",function(b){tinymce.activeEditor.settings.file_browser_callback=a;function a(i,g,f,h){var e=[],d=2,c=new RegExp(",","gim");if(f=="image"){d=1}else{if(f=="media"){d=3}}if(b.settings.plugin_cjfilebrowser_browserUrl){e.push("browserUrl="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_browserUrl))}if(b.settings.plugin_cjfilebrowser_actions){e.push("actions="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_actions))}if(b.settings.plugin_cjfilebrowser_winWidth){e.push("winWidth="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_winWidth))}if(b.settings.plugin_cjfilebrowser_winHeight){e.push("winHeight="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_winHeight))}if(b.settings.plugin_cjfilebrowser_assetsUrl){e.push("assetsUrl="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_assetsUrl))}if(b.settings.plugin_cjfilebrowser_fileExts){e.push("fileExts="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_fileExts))}if(b.settings.plugin_cjfilebrowser_maxSize){e.push("maxSize="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_maxSize))}if(b.settings.plugin_cjfilebrowser_maxWidth){e.push("maxWidth="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_maxWidth))}if(b.settings.plugin_cjfilebrowser_maxHeight){e.push("maxHeight="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_maxHeight))}if(b.settings.plugin_cjfilebrowser_showImgPreview){e.push("showImgPreview="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_showImgPreview))}if(b.settings.plugin_cjfilebrowser_engine){e.push("engine="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_engine))}if(b.settings.plugin_cjfilebrowser_handler){e.push("handler="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_handler))}if(b.settings.plugin_cjfilebrowser_timeOut){e.push("timeOut="+window.encodeURIComponent(b.settings.plugin_cjfilebrowser_timeOut))}e=e.toString().replace(c,"&");if(b.settings.plugin_cjfilebrowser_browserUrl){if(b.settings.plugin_cjfilebrowser_browserUrl.indexOf("?")>-1){e=b.settings.plugin_cjfilebrowser_browserUrl+(e.length?"&"+e:"")}else{if(b.settings.plugin_cjfilebrowser_browserUrl.indexOf("?")===-1){e=b.settings.plugin_cjfilebrowser_browserUrl+(e.length?"?"+e:"")}}}else{e="/"}tinymce.activeEditor.windowManager.open({title:"CJ File Browser",file:e||"/",width:b.settings.plugin_cjfilebrowser_winWidth||720,height:b.settings.plugin_cjfilebrowser_winHeight||500,resizable:true,maximizable:true,inline:1,type:d},{fileSelectCallback:function(k){var l=h.document.getElementById(i);l.value=b.convertURL(k);if(l!==undefined&&l.hasOwnProperty("fireEvent")){l.fireEvent("onchange")}else{var j=document.createEvent("HTMLEvents");j.initEvent("change",false,true);l.dispatchEvent(j)}}})}return false});