X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/76aea3697c6043c1613370f172395b4f65ee71f0..11be8dc178e77d0b46189bbd8e33a216a9b90942:/wp-includes/js/tinymce/tiny_mce_popup.js diff --git a/wp-includes/js/tinymce/tiny_mce_popup.js b/wp-includes/js/tinymce/tiny_mce_popup.js index 6c8f73b6..d5d88e29 100644 --- a/wp-includes/js/tinymce/tiny_mce_popup.js +++ b/wp-includes/js/tinymce/tiny_mce_popup.js @@ -21,10 +21,14 @@ tinyMCEPopup = { tinyMCE = w.tinyMCE; t.editor = tinymce.EditorManager.activeEditor; t.params = t.editor.windowManager.params; + t.features = t.editor.windowManager.features; // Setup local DOM t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document); - t.dom.loadCSS(t.editor.settings.popup_css); + + // Enables you to skip loading the default css + if (t.features.popup_css !== false) + t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css); // Setup on init listeners t.listeners = []; @@ -127,6 +131,14 @@ tinyMCEPopup = { this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); }, + confirm : function(t, cb, s) { + this.editor.windowManager.confirm(t, cb, s, window); + }, + + alert : function(tx, cb, s) { + this.editor.windowManager.alert(tx, cb, s, window); + }, + close : function() { var t = this; @@ -160,18 +172,25 @@ tinyMCEPopup = { },*/ _onDOMLoaded : function() { - var t = this, ti = document.title, bm, h; + var t = this, ti = document.title, bm, h, nv; // Translate page - h = document.body.innerHTML; + if (t.features.translate_i18n !== false) { + h = document.body.innerHTML; - // Replace a=x with a="x" in IE - if (tinymce.isIE) - h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') + // Replace a=x with a="x" in IE + if (tinymce.isIE) + h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') + + document.dir = t.editor.getParam('directionality',''); + + if ((nv = t.editor.translate(h)) && nv != h) + document.body.innerHTML = nv; + + if ((nv = t.editor.translate(ti)) && nv != ti) + document.title = ti = nv; + } - document.dir = t.editor.getParam('directionality',''); - document.body.innerHTML = t.editor.translate(h); - document.title = ti = t.editor.translate(ti); document.body.style.display = ''; // Restore selection in IE when focus is placed on a non textarea or input element of the type text