# HG changeset patch
# User Dan
# Date 1204854431 18000
# Node ID f26a69c40431a1ba0c9a7db51bb64ebd0bd64157
# Parent 51386f1852b87b8eab06924d4e3e04db547415b9
Upgraded to TinyMCE 3.0.3; made editor auto-init again but only on Safari
diff -r 51386f1852b8 -r f26a69c40431 includes/clientside/static/editor.js
--- a/includes/clientside/static/editor.js Thu Mar 06 20:45:46 2008 -0500
+++ b/includes/clientside/static/editor.js Thu Mar 06 20:47:11 2008 -0500
@@ -63,7 +63,11 @@
}
}
}
-// addOnloadHook(initTinyMCE);
+// Safari doesn't fire the init on demand so call it on page load
+if ( is_Safari )
+{
+ addOnloadHook(initTinyMCE);
+}
var editor_open = false;
diff -r 51386f1852b8 -r f26a69c40431 includes/clientside/tinymce/plugins/advimage/js/image.js
--- a/includes/clientside/tinymce/plugins/advimage/js/image.js Thu Mar 06 20:45:46 2008 -0500
+++ b/includes/clientside/tinymce/plugins/advimage/js/image.js Thu Mar 06 20:47:11 2008 -0500
@@ -117,6 +117,8 @@
insertAndClose : function() {
var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
+ tinyMCEPopup.restoreSelection();
+
// Fixes crash in Safari
if (tinymce.isWebKit)
ed.getWin().focus();
diff -r 51386f1852b8 -r f26a69c40431 includes/clientside/tinymce/plugins/advlink/js/advlink.js
--- a/includes/clientside/tinymce/plugins/advlink/js/advlink.js Thu Mar 06 20:45:46 2008 -0500
+++ b/includes/clientside/tinymce/plugins/advlink/js/advlink.js Thu Mar 06 20:47:11 2008 -0500
@@ -344,6 +344,7 @@
function setAttrib(elm, attrib, value) {
var formObj = document.forms[0];
var valueElm = formObj.elements[attrib.toLowerCase()];
+ var dom = tinyMCEPopup.editor.dom;
if (typeof(value) == "undefined" || value == null) {
value = "";
@@ -352,21 +353,11 @@
value = valueElm.value;
}
- if (value != "") {
- elm.setAttribute(attrib.toLowerCase(), value);
-
- if (attrib == "style")
- attrib = "style.cssText";
+ // Clean up the style
+ if (attrib == 'style')
+ value = dom.serializeStyle(dom.parseStyle(value));
-// if (attrib.substring(0, 2) == 'on')
-// value = 'return true;' + value;
-
- if (attrib == "class")
- attrib = "className";
-
- elm[attrib] = value;
- } else
- elm.removeAttribute(attrib);
+ dom.setAttrib(elm, attrib, value);
}
function getAnchorListHTML(id, target) {
diff -r 51386f1852b8 -r f26a69c40431 includes/clientside/tinymce/plugins/fullscreen/editor_plugin.js
--- a/includes/clientside/tinymce/plugins/fullscreen/editor_plugin.js Thu Mar 06 20:45:46 2008 -0500
+++ b/includes/clientside/tinymce/plugins/fullscreen/editor_plugin.js Thu Mar 06 20:47:11 2008 -0500
@@ -1,1 +1,1 @@
-(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=document.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{window.setTimeout(function(){tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(document.body,'overflow',ed.getParam('fullscreen_overflow'));window.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));},10);}return;}if(ed.getParam('fullscreen_new_window')){win=window.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{s.fullscreen_overflow=DOM.getStyle(document.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(document.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();window.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(document.body,'div',{id:'mce_fullscreen_container',style:'position:absolute;top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:150;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent({format:'raw'}),{format:'raw'});ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent());});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})();
\ No newline at end of file
+(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=document.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{window.setTimeout(function(){tinymce.dom.Event.remove(window,'resize',t.resizeFunc);tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(document.body,'overflow',ed.getParam('fullscreen_overflow'));window.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));},10);}return;}if(ed.getParam('fullscreen_new_window')){win=window.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{s.fullscreen_overflow=DOM.getStyle(document.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(document.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();window.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(document.body,'div',{id:'mce_fullscreen_container',style:'position:absolute;top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:150;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent({format:'raw'}),{format:'raw'});ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent());});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();t.resizeFunc=tinymce.dom.Event.add(window,'resize',function(){var vp=tinymce.DOM.getViewPort();t.fullscreenEditor.theme.resizeTo(vp.w,vp.h);});}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})();
\ No newline at end of file
diff -r 51386f1852b8 -r f26a69c40431 includes/clientside/tinymce/plugins/fullscreen/editor_plugin_src.js
--- a/includes/clientside/tinymce/plugins/fullscreen/editor_plugin_src.js Thu Mar 06 20:45:46 2008 -0500
+++ b/includes/clientside/tinymce/plugins/fullscreen/editor_plugin_src.js Thu Mar 06 20:47:11 2008 -0500
@@ -1,5 +1,5 @@
/**
- * $Id: editor_plugin_src.js 609 2008-02-18 16:19:27Z spocke $
+ * $Id: editor_plugin_src.js 636 2008-02-25 13:38:28Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@@ -23,6 +23,7 @@
closeFullscreen(); // Call to close in new window
else {
window.setTimeout(function() {
+ tinymce.dom.Event.remove(window, 'resize', t.resizeFunc);
tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
tinyMCE.remove(ed);
DOM.remove('mce_fullscreen_container');
@@ -36,7 +37,7 @@
}
if (ed.getParam('fullscreen_new_window')) {
- win = window.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
+ win = window.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
try {
win.resizeTo(screen.availWidth, screen.availHeight);
} catch (e) {
@@ -104,6 +105,12 @@
t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
t.fullscreenElement.update();
//document.body.overflow = 'hidden';
+
+ t.resizeFunc = tinymce.dom.Event.add(window, 'resize', function() {
+ var vp = tinymce.DOM.getViewPort();
+
+ t.fullscreenEditor.theme.resizeTo(vp.w, vp.h);
+ });
}
});
diff -r 51386f1852b8 -r f26a69c40431 includes/clientside/tinymce/plugins/fullscreen/fullscreen.htm
--- a/includes/clientside/tinymce/plugins/fullscreen/fullscreen.htm Thu Mar 06 20:45:46 2008 -0500
+++ b/includes/clientside/tinymce/plugins/fullscreen/fullscreen.htm Thu Mar 06 20:47:11 2008 -0500
@@ -64,9 +64,6 @@
window.close();
}
- // Add onunload
- tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
-
function doParentSubmit() {
moveContent();
@@ -77,6 +74,27 @@
return false;
}
+
+ function render() {
+ var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
+
+ e.value = window.opener.tinyMCE.activeEditor.getContent();
+
+ vp = dom.getViewPort();
+ settings.width = vp.w;
+ settings.height = vp.h - 15;
+
+ tinymce.dom.Event.add(window, 'resize', function() {
+ var vp = dom.getViewPort();
+
+ tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
+ });
+
+ tinyMCE.init(settings);
+ }
+
+ // Add onunload
+ tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
@@ -86,11 +104,7 @@