upgrade TinyMCE version to latest

release-0.6
svncommit 17 years ago
parent fba1f5ab81
commit deb30262a7

@ -1,6 +1,10 @@
CHANGELOG RoundCube Webmail
---------------------------
2007/12/10 (estadtherr)
----------
- Upgrade to TinyMCE 2.1.3
2007/12/10 (thomasb)
----------
- Delegate user-stuff to new class rcube_user

File diff suppressed because one or more lines are too long

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 275 2007-05-01 15:35:08Z spocke $
* $Id: editor_plugin_src.js 296 2007-08-21 10:36:35Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
@ -200,9 +200,8 @@ var TinyMCE_MediaPlugin = {
break;
}
// Force absolute URL
if (!tinyMCE.getParam("relative_urls"))
pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src);
// Convert the URL
pl.src = tinyMCE.convertURL(pl.src, null, true);
embedHTML = TinyMCE_MediaPlugin._getEmbed(ci, cb, mt, pl, attribs);
} else {
@ -236,10 +235,8 @@ var TinyMCE_MediaPlugin = {
at = at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g, "height:'" + attribs.height + "'");
// Force absolute URL
if (!tinyMCE.getParam("relative_urls")) {
pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src);
at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'");
}
pl.src = tinyMCE.convertURL(pl.src, null, true);
at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'");
embedHTML = '<script type="text/javascript">' + s + '({' + at + '});</script>';
}

@ -280,10 +280,14 @@ function getType(v) {
fo = tinyMCE.getParam("media_types", "flash=swf;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');
// YouTube
if (v.indexOf('http://www.youtube.com/watch?v=') == 0) {
if (v.indexOf('http://www.youtube.com/watch?v=') == 0 || v.indexOf('http://youtube.com/watch?v=') == 0) {
f.width.value = '425';
f.height.value = '350';
f.src.value = 'http://www.youtube.com/v/' + v.substring('http://www.youtube.com/watch?v='.length);
v = v.replace('http://youtube.com/watch?v=', '');
v = v.replace('http://www.youtube.com/watch?v=', '');
f.src.value = 'http://www.youtube.com/v/' + v;
return 'flash';
}

@ -31,7 +31,7 @@
<select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">
<option value="flash">Flash</option>
<option value="qt">Quicktime</option>
<option value="shockwave">Shockware</option>
<option value="shockwave">Shockwave</option>
<option value="wmp">Windows Media</option>
<option value="rmp">Real Media</option>
</select>

@ -62,7 +62,7 @@
</tr>
<tr>
<td class="column1"><label for="caption">{$lang_table_caption}</label></td>
<td><input id="caption" name="caption" type="checkbox" value="true" /></td>
<td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>
</tr>
</table>
</fieldset>

File diff suppressed because one or more lines are too long

@ -1,5 +1,5 @@
/**
* $Id: editor_template_src.js 256 2007-04-24 09:03:20Z spocke $
* $Id: editor_template_src.js 296 2007-08-21 10:36:35Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
@ -114,7 +114,7 @@ var TinyMCE_AdvancedTheme = {
case "fontselect":
var fontHTML = '<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';
var iFonts = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
var nFonts = 'Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';
var nFonts = 'Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';
var fonts = tinyMCE.getParam("theme_advanced_fonts", nFonts).split(';');
for (i=0; i<fonts.length; i++) {
if (fonts[i] != '') {
@ -504,7 +504,7 @@ var TinyMCE_AdvancedTheme = {
return true;
case "mceNewDocument":
if (confirm(tinyMCE.getLang('lang_newdocument')))
if (confirm(tinyMCE.entityDecode(tinyMCE.getLang('lang_newdocument'))))
tinyMCE.execInstanceCommand(editor_id, 'mceSetContent', false, ' ');
return true;

File diff suppressed because one or more lines are too long

@ -116,7 +116,7 @@ TinyMCE_Popup.prototype = {
},
executeOnLoad : function(str) {
if (tinyMCE.isOpera)
if (tinyMCE.isOpera && parseFloat(opera.version()) < 9.5)
this.onLoadEval = str;
else
eval(str);

@ -5,8 +5,8 @@ function TinyMCE_Engine() {
var ua;
this.majorVersion = "2";
this.minorVersion = "1.1.1";
this.releaseDate = "2007-05-14";
this.minorVersion = "1.3";
this.releaseDate = "2007-11-27";
this.instances = [];
this.switchClassCache = [];
@ -205,6 +205,7 @@ TinyMCE_Engine.prototype = {
this._def("hide_selects_on_submit", true);
this._def("forced_root_block", false);
this._def("remove_trailing_nbsp", false);
this._def("save_on_tinymce_forms", false);
// Force strict loading mode to false on non Gecko browsers
if (this.isMSIE && !this.isOpera)
@ -586,7 +587,7 @@ TinyMCE_Engine.prototype = {
},
removeMCEControl : function(editor_id) {
var inst = tinyMCE.getInstanceById(editor_id), h, re, ot, tn;
var inst = tinyMCE.getInstanceById(editor_id), h, re, ot, tn, n;
if (inst) {
inst.switchSettings();
@ -599,6 +600,18 @@ TinyMCE_Engine.prototype = {
tinyMCE.selectedElement = null;
tinyMCE.selectedInstance = null;
tinyMCE.selectedElement = null;
tinyMCE.selectedInstance = null;
// Try finding an instance
for (n in tinyMCE.instances) {
if (!tinyMCE.isInstance(tinyMCE.instances[n]))
continue;
tinyMCE.selectedInstance = tinyMCE.instances[n];
break;
}
// Remove element
re = document.getElementById(editor_id + "_parent");
ot = inst.oldTargetElement;
@ -1069,8 +1082,8 @@ TinyMCE_Engine.prototype = {
// s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
if (!s.match(/(mce_src|mce_href)/gi, s)) {
s = s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'src="$1" mce_src="$1"');
s = s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'href="$1" mce_href="$1"');
s = s.replace(new RegExp('src\\s*=\\s*[\"\']([^ >\"]*)[\"\']', 'gi'), 'src="$1" mce_src="$1"');
s = s.replace(new RegExp('href\\s*=\\s*[\"\']([^ >\"]*)[\"\']', 'gi'), 'href="$1" mce_href="$1"');
}
return s;
@ -1145,19 +1158,15 @@ TinyMCE_Engine.prototype = {
// Workaround for drag drop/copy paste base href bug
case "drop":
case "beforepaste":
if (tinyMCE.selectedInstance)
/* if (tinyMCE.selectedInstance)
tinyMCE.selectedInstance.setBaseHREF(null);
// Fixes odd MSIE bug where drag/droping elements in a iframe with height 100% breaks
// This logic forces the width/height to be in pixels while the user is drag/dropping
// NOTE: This has been disabled for now since it messes up copy/paste that is far more important than image drag
if (tinyMCE.isRealIE) {
var ife = tinyMCE.selectedInstance.iframeElement;
/*if (ife.style.width.indexOf('%') != -1) {
ife._oldWidth = ife.width.height;
ife.style.width = ife.clientWidth;
}*/
if (ife.style.height.indexOf('%') != -1) {
ife._oldHeight = ife.style.height;
ife.style.height = ife.clientHeight;
@ -1165,6 +1174,7 @@ TinyMCE_Engine.prototype = {
}
window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings.base_href);tinyMCE._resetIframeHeight();", 1);
*/
return;
case "submit":
@ -1523,19 +1533,22 @@ TinyMCE_Engine.prototype = {
f = f.form;
// Is it a form that has a TinyMCE instance
for (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
if (tinyMCE.getParam('save_on_tinymce_forms')) {
for (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
if (!tinyMCE.isInstance(inst))
continue;
if (!tinyMCE.isInstance(inst))
continue;
if (inst.formElement) {
if (f == inst.formElement.form) {
found = true;
inst.isNotDirty = true;
if (inst.formElement) {
if (f == inst.formElement.form) {
found = true;
inst.isNotDirty = true;
}
}
}
}
} else
found = true;
// Is valid
if (found) {
@ -1761,7 +1774,7 @@ TinyMCE_Engine.prototype = {
},
triggerNodeChange : function(focus, setup_content) {
var elm, inst, editorId, undoIndex = -1, undoLevels = -1, doc, anySelection = false, st;
var elm, inst, editorId, undoIndex = -1, undoLevels = -1, doc, anySelection, st;
if (tinyMCE.selectedInstance) {
inst = tinyMCE.selectedInstance;
@ -1782,9 +1795,7 @@ TinyMCE_Engine.prototype = {
elm = inst.getBody();
inst.switchSettings();
if (tinyMCE.selectedElement)
anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (st && st.length > 0);
anySelection = !inst.selection.isCollapsed();
if (tinyMCE.settings.custom_undo_redo) {
undoIndex = inst.undoRedo.undoIndex;
@ -1956,7 +1967,7 @@ TinyMCE_Engine.prototype = {
}
// Make it bigger if statusbar is forced
if (tinyMCE.isGecko) {
if (tinyMCE.isGecko && win.document) {
if (win.document.defaultView.statusbar.visible)
win.resizeBy(0, tinyMCE.isMac ? 10 : 24);
}
@ -2420,8 +2431,10 @@ TinyMCE_Engine.prototype = {
add : function(c, m) {
var n;
for (n in m)
c.prototype[n] = m[n];
for (n in m) {
if (m.hasOwnProperty(n))
c.prototype[n] = m[n];
}
},
extend : function(p, np) {
@ -2429,11 +2442,15 @@ TinyMCE_Engine.prototype = {
o.parent = p;
for (n in p)
o[n] = p[n];
for (n in p) {
if (p.hasOwnProperty(n))
o[n] = p[n];
}
for (n in np)
o[n] = np[n];
for (n in np) {
if (np.hasOwnProperty(n))
o[n] = np[n];
}
return o;
},
@ -2786,7 +2803,7 @@ TinyMCE_Control.prototype = {
nx = ne.nextSibling;
// If text node or inline element wrap it in a block element
if (ne.nodeType == 3 || !tinyMCE.blockRegExp.test(ne.nodeName)) {
if ((ne.nodeType == 3 && ne.nodeValue.replace(/\s+/g, '') != '') || (ne.nodeType == 1 && !tinyMCE.blockRegExp.test(ne.nodeName))) {
if (!bm)
bm = this.selection.getBookmark();
@ -2863,9 +2880,10 @@ TinyMCE_Control.prototype = {
switch (command) {
case "JustifyLeft":
if (align == 'left')
if (align == 'left') {
img.setAttribute('align', ''); // Needed for IE
img.removeAttribute('align');
else
} else
img.setAttribute('align', 'left');
// Remove the div
@ -2879,6 +2897,7 @@ TinyMCE_Control.prototype = {
return;
case "JustifyCenter":
img.setAttribute('align', ''); // Needed for IE
img.removeAttribute('align');
// Is centered
@ -2901,9 +2920,10 @@ TinyMCE_Control.prototype = {
return;
case "JustifyRight":
if (align == 'right')
if (align == 'right') {
img.setAttribute('align', ''); // Needed for IE
img.removeAttribute('align');
else
} else
img.setAttribute('align', 'right');
// Remove the div
@ -2959,6 +2979,22 @@ TinyMCE_Control.prototype = {
this.repaint();
return true;
case "JustifyLeft":
case "JustifyCenter":
case "JustifyFull":
case "JustifyRight":
var el = tinyMCE.getParentNode(focusElm, function(n) {return tinyMCE.getAttrib(n, 'align');});
if (el) {
el.setAttribute('align', ''); // Needed for IE
el.removeAttribute('align');
} else
this.getDoc().execCommand(command, user_interface, value);
tinyMCE.triggerNodeChange();
return true;
case "unlink":
// Unlink if caret is inside link
if (tinyMCE.isGecko && this.getSel().isCollapsed) {
@ -3282,7 +3318,7 @@ TinyMCE_Control.prototype = {
value = value.charAt(0) != '#' ? (isNaN('0x' + value) ? value : '#' + value) : value;
this.backColor = value;
if (tinyMCE.isGecko) {
if (tinyMCE.isGecko || tinyMCE.isOpera) {
this._setUseCSS(true);
this.getDoc().execCommand('hilitecolor', false, value);
this._setUseCSS(false);
@ -4107,10 +4143,8 @@ tinyMCE.add(TinyMCE_Engine, {
if (box[i] == null)
return;
for (a=0; a<box.length; a++) {
if (box[a] != box[i])
return;
}
if (i && box[i] != box[i-1])
return;
}
// They are all the same
@ -4387,7 +4421,7 @@ tinyMCE.add(TinyMCE_Engine, {
c.settings.on_save = on_save;
c.idCount = 0;
c.serializationId = new Date().getTime().toString(32); // Unique ID needed for the content duplication bug
c.serializationId++; // Unique ID needed for the content duplication bug
c.serializedNodes = [];
c.sourceIndex = -1;
@ -4519,6 +4553,7 @@ TinyMCE_Cleanup.prototype = {
this.nlAfterRe = this._arrayToRe(s.newline_after_elements.split(','), 'gi', '<(', ')([^>]*)>');
this.nlBeforeAfterRe = this._arrayToRe(s.newline_before_after_elements.split(','), 'gi', '<(\\/?)(', ')([^>]*)>');
this.serializedNodes = [];
this.serializationId = 0;
if (s.invalid_elements !== '')
this.iveRe = this._arrayToRe(s.invalid_elements.toUpperCase().split(','), 'g', '^(', ')$');
@ -6298,7 +6333,7 @@ TinyMCE_Selection.prototype = {
e = document.createElement("body");
if (r.cloneContents)
e.appendChild(r.cloneContents());
e.appendChild(document.importNode(r.cloneContents(), true));
else if (typeof(r.item) != 'undefined' || typeof(r.htmlText) != 'undefined')
e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;
else
@ -6971,6 +7006,7 @@ var TinyMCE_ForceParagraphs = {
endNode = direct ? sel.focusNode : sel.anchorNode;
endOffset = direct ? sel.focusOffset : sel.anchorOffset;
startNode = startNode.nodeName == "HTML" ? doc.body : startNode; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes
startNode = startNode.nodeName == "BODY" ? startNode.firstChild : startNode;
endNode = endNode.nodeName == "BODY" ? endNode.firstChild : endNode;

Loading…
Cancel
Save