]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/js/tinymce/plugins/wpdialogs/js/popup.min.js
WordPress 3.7-scripts
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / wpdialogs / js / popup.min.js
1 var tinyMCEPopup={init:function(){var a,b=this;a=b.getWin(),tinymce=a.tinymce,tinyMCE=a.tinyMCE,b.editor=tinymce.EditorManager.activeEditor,b.params=b.editor.windowManager.params,b.features=b.editor.windowManager.features,b.dom=tinymce.dom,b.listeners=[],b.onInit={add:function(a,c){b.listeners.push({func:a,scope:c})}},b.isWindow=!1,b.id=b.features.id,b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return window},getWindowArg:function(a,b){var c=this.params[a];return tinymce.is(c)?c:b},getParam:function(a,b){return this.editor.getParam(a,b)},getLang:function(a,b){return this.editor.getLang(a,b)},execCommand:function(a,b,c,d){return d=d||{},d.skip_focus=1,this.restoreSelection(),this.editor.execCommand(a,b,c,d)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;!a.isWindow&&tinymce.isIE&&a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)},requireLangPack:function(){var a=this,b=a.getWindowArg("plugin_url")||a.getWindowArg("theme_url");b&&a.editor.settings.language&&a.features.translate_i18n!==!1&&(b+="/langs/"+a.editor.settings.language+"_dlg.js",tinymce.ScriptLoader.isDone(b)||(document.write('<script type="text/javascript" src="'+tinymce._addVer(b)+'"></script>'),tinymce.ScriptLoader.markDone(b)))},pickColor:function(a,b){this.execCommand("mceColorPicker",!0,{color:document.getElementById(b).value,func:function(a){document.getElementById(b).value=a;try{document.getElementById(b).onchange()}catch(c){}}})},openBrowser:function(a,b){tinyMCEPopup.restoreSelection(),this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,b,window)},confirm:function(a,b,c){this.editor.windowManager.confirm(a,b,c,window)},alert:function(a,b,c){this.editor.windowManager.alert(a,b,c,window)},close:function(){function a(){b.editor.windowManager.close(window),b.editor=null}var b=this;tinymce.isOpera?b.getWin().setTimeout(a,0):a()},_restoreSelection:function(a){var b=a&&a.target?a.target:window.event.srcElement;"INPUT"!=b.nodeName||"submit"!=b.type&&"button"!=b.type||tinyMCEPopup.restoreSelection()},_onDOMLoaded:function(){var a,b,c=tinyMCEPopup,d=document.title;c.domLoaded||(c.domLoaded=1,tinyMCEPopup.init(),c.features.translate_i18n!==!1&&(a=document.body.innerHTML,tinymce.isIE&&(a=a.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')),document.dir=c.editor.getParam("directionality",""),(b=c.editor.translate(a))&&b!=a&&(document.body.innerHTML=b),(b=c.editor.translate(d))&&b!=d&&(document.title=d=b)),document.body.style.display="",tinymce.isIE&&!tinymce.isIE11?(document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection),c.dom.add(c.dom.select("head")[0],"base",{target:"_self"})):tinymce.isIE11&&document.addEventListener("mouseup",tinyMCEPopup._restoreSelection,!1),c.restoreSelection(),c.isWindow?window.focus():c.editor.windowManager.setTitle(window,d),tinymce.isIE||c.isWindow||tinymce.dom.Event._add(document,"focus",function(){c.editor.windowManager.focus(c.id)}),tinymce.each(c.dom.select("select"),function(a){a.onkeydown=tinyMCEPopup._accessHandler}),tinymce.each(c.listeners,function(a){a.func.call(a.scope,c.editor)}),c.getWindowArg("mce_auto_focus",!0)&&(window.focus(),tinymce.each(document.forms,function(a){tinymce.each(a.elements,function(a){return c.dom.hasClass(a,"mceFocus")&&!a.disabled?(a.focus(),!1):void 0})})),document.onkeyup=tinyMCEPopup._closeWinKeyHandler)},_accessHandler:function(a){return a=a||window.event,13==a.keyCode||32==a.keyCode?(a=a.target||a.srcElement,a.onchange&&a.onchange(),tinymce.dom.Event.cancel(a)):void 0},_closeWinKeyHandler:function(a){a=a||window.event,27==a.keyCode&&tinyMCEPopup.close()},_wait:function(){document.attachEvent?(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",arguments.callee),tinyMCEPopup._onDOMLoaded())}),document.documentElement.doScroll&&window==window.top&&!function(){if(!tinyMCEPopup.domLoaded){try{document.documentElement.doScroll("left")}catch(a){return setTimeout(arguments.callee,0),void 0}tinyMCEPopup._onDOMLoaded()}}(),document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)):document.addEventListener&&(window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,!1),window.addEventListener("load",tinyMCEPopup._onDOMLoaded,!1))}};