includes/clientside/tinymce/tiny_mce_popup.js
changeset 778 57ce13805b6f
parent 543 dffcbfbc4e59
child 1193 e3b94bd055dc
equal deleted inserted replaced
777:488665d49417 778:57ce13805b6f
    19 		w = t.getWin();
    19 		w = t.getWin();
    20 		tinymce = w.tinymce;
    20 		tinymce = w.tinymce;
    21 		tinyMCE = w.tinyMCE;
    21 		tinyMCE = w.tinyMCE;
    22 		t.editor = tinymce.EditorManager.activeEditor;
    22 		t.editor = tinymce.EditorManager.activeEditor;
    23 		t.params = t.editor.windowManager.params;
    23 		t.params = t.editor.windowManager.params;
       
    24 		t.features = t.editor.windowManager.features;
    24 
    25 
    25 		// Setup local DOM
    26 		// Setup local DOM
    26 		t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);
    27 		t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);
    27 		t.dom.loadCSS(t.editor.settings.popup_css);
    28 
       
    29 		// Enables you to skip loading the default css
       
    30 		if (t.features.popup_css !== false)
       
    31 			t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css);
    28 
    32 
    29 		// Setup on init listeners
    33 		// Setup on init listeners
    30 		t.listeners = [];
    34 		t.listeners = [];
    31 		t.onInit = {
    35 		t.onInit = {
    32 			add : function(f, s) {
    36 			add : function(f, s) {
   125 	openBrowser : function(element_id, type, option) {
   129 	openBrowser : function(element_id, type, option) {
   126 		tinyMCEPopup.restoreSelection();
   130 		tinyMCEPopup.restoreSelection();
   127 		this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
   131 		this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
   128 	},
   132 	},
   129 
   133 
       
   134 	confirm : function(t, cb, s) {
       
   135 		this.editor.windowManager.confirm(t, cb, s, window);
       
   136 	},
       
   137 
       
   138 	alert : function(tx, cb, s) {
       
   139 		this.editor.windowManager.alert(tx, cb, s, window);
       
   140 	},
       
   141 
   130 	close : function() {
   142 	close : function() {
   131 		var t = this;
   143 		var t = this;
   132 
   144 
   133 		// To avoid domain relaxing issue in Opera
   145 		// To avoid domain relaxing issue in Opera
   134 		function close() {
   146 		function close() {
   158 		if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
   170 		if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
   159 			tinyMCEPopup.restoreSelection();
   171 			tinyMCEPopup.restoreSelection();
   160 	},*/
   172 	},*/
   161 
   173 
   162 	_onDOMLoaded : function() {
   174 	_onDOMLoaded : function() {
   163 		var t = this, ti = document.title, bm, h;
   175 		var t = this, ti = document.title, bm, h, nv;
   164 
   176 
   165 		// Translate page
   177 		// Translate page
   166 		h = document.body.innerHTML;
   178 		if (t.features.translate_i18n !== false) {
   167 
   179 			h = document.body.innerHTML;
   168 		// Replace a=x with a="x" in IE
   180 
   169 		if (tinymce.isIE)
   181 			// Replace a=x with a="x" in IE
   170 			h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
   182 			if (tinymce.isIE)
   171 
   183 				h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
   172 		document.dir = t.editor.getParam('directionality','');
   184 
   173 		document.body.innerHTML = t.editor.translate(h);
   185 			document.dir = t.editor.getParam('directionality','');
   174 		document.title = ti = t.editor.translate(ti);
   186 
       
   187 			if ((nv = t.editor.translate(h)) && nv != h)
       
   188 				document.body.innerHTML = nv;
       
   189 
       
   190 			if ((nv = t.editor.translate(ti)) && nv != ti)
       
   191 				document.title = ti = nv;
       
   192 		}
       
   193 
   175 		document.body.style.display = '';
   194 		document.body.style.display = '';
   176 
   195 
   177 		// Restore selection in IE when focus is placed on a non textarea or input element of the type text
   196 		// Restore selection in IE when focus is placed on a non textarea or input element of the type text
   178 		if (tinymce.isIE)
   197 		if (tinymce.isIE)
   179 			document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
   198 			document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);