(function(exports,undefined){"use strict";var modules={};function require(ids,callback){var module,defs=[];for(var i=0;i0){style=doc.createElement("style");style.textContent='@import "'+url+'"';waitForGeckoLinkLoaded();appendToHead(style);return}else{waitForWebKitLinkLoaded()}}appendToHead(link)}};return Loader});define(__moxman_Env,[],function(){return{apiPageName:"api.php",ie7:document.all&&!window.opera&&!document.documentMode}});define(__moxman_util_I18n,[],function(){"use strict";function resolve(id){var target=window;var fragments=id.split(/\//);for(var fi=0;fi1048576){return Math.round(value/1048576,1)+" MB"}if(value>1024){return Math.round(value/1024,1)+" KB"}return value+" b"}})}var zIndex=editor.windowManager.zIndex;if(tinymce.ui.FloatPanel){zIndex=tinymce.ui.FloatPanel.currentZIndex}Loader.browse(tinymce.extend({zIndex:zIndex,document_base_url:editorSettings.document_base_url,oninsert:function(args){var html="";tinymce.each(args.files,function(file,i){var isImage=/\.(gif|jpe?g|png)$/i.test(file.name);selection.setRng(lastRng);if(!isImage&&!selection.isCollapsed()){editor.execCommand("mceInsertLink",file.meta.url);return false}if(i>0){html+=" "}if(isImage){html+=processTemplate(editor.getParam("moxiemanager_image_template",''),file)}else{html+=processTemplate(editor.getParam("moxiemanager_file_template",'{$name}'),file)}});selection.setRng(lastRng);editor.execCommand("mceInsertContent",false,html)}},getBrowseSettings()))});if(tinymce.Env){editor.addButton("insertfile",{icon:"browse",title:"Insert file",cmd:"mceInsertFile"})}else{editor.addButton("insertfile",{image:url+"/skins/lightgray/img/insertfile.gif",title:editor.getLang("moxiemanager_insert","Insert file"),cmd:"mceInsertFile"})}});var langCode=tinymce.settings?tinymce.settings.language:"auto";if(langCode&&langCode!="en"){tinymce.ScriptLoader.load((tinymce.PluginManager.urls.moxiemanager||tinymce.baseURL+"/plugins/moxiemanager")+"/"+Env.apiPageName+"?action=language&tinymce=true&code="+langCode)}});expose([__moxman_util_Loader,__moxman_Env,__moxman_util_I18n,__moxman_Loader,__moxman_interop_TinyMcePlugin])})(this);