Update tinyMCE to 2.0.6.1. fixes #3003

git-svn-id: http://svn.automattic.com/wordpress/trunk@4080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-08-09 19:39:17 +00:00
parent 7677eca675
commit 7d69993f39
9 changed files with 533 additions and 629 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,83 +1,92 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('directionality', 'en,sv,fr_ca,zh_cn,cs,da,he,no,de,hu,ru,ru_KOI8-R,ru_UTF-8,es,cy,is,pl');
/**
* $RCSfile: editor_plugin_src.js,v $
* $Revision: 1.16 $
* $Date: 2006/02/10 21:34:28 $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
function TinyMCE_directionality_getInfo() {
return {
longname : 'Directionality',
author : 'Moxiecode Systems',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('directionality', 'en,tr,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');
var TinyMCE_DirectionalityPlugin = {
getInfo : function() {
return {
longname : 'Directionality',
author : 'Moxiecode Systems',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
getControlHTML : function(cn) {
switch (cn) {
case "ltr":
return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR');
case "rtl":
return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL');
}
return "";
},
execCommand : function(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceDirectionLTR":
var inst = tinyMCE.getInstanceById(editor_id);
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (elm)
elm.setAttribute("dir", "ltr");
tinyMCE.triggerNodeChange(false);
return true;
case "mceDirectionRTL":
var inst = tinyMCE.getInstanceById(editor_id);
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (elm)
elm.setAttribute("dir", "rtl");
tinyMCE.triggerNodeChange(false);
return true;
}
// Pass to next handler in chain
return false;
},
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
function getAttrib(elm, name) {
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
}
if (node == null)
return;
var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (!elm) {
tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled');
tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled');
return true;
}
tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal');
tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal');
var dir = getAttrib(elm, "dir");
if (dir == "ltr" || dir == "")
tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected');
else
tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected');
return true;
}
};
function TinyMCE_directionality_getControlHTML(control_name) {
switch (control_name) {
case "ltr":
var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\');return false;';
return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_ltr" src="{$pluginurl}/images/ltr.gif" title="{$lang_directionality_ltr_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>'
+ '<div class="zerosize"><input type="button" accesskey="." onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\',false);" /></div>';
case "rtl":
var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\');return false;';
return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_rtl" src="{$pluginurl}/images/rtl.gif" title="{$lang_directionality_rtl_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>'
+ '<div class="zerosize"><input type="button" accesskey="," onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\',false);" /></div>';
}
return "";
}
function TinyMCE_directionality_execCommand(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceDirectionLTR":
var inst = tinyMCE.getInstanceById(editor_id);
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (elm)
elm.setAttribute("dir", "ltr");
tinyMCE.triggerNodeChange(false);
return true;
case "mceDirectionRTL":
var inst = tinyMCE.getInstanceById(editor_id);
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (elm)
elm.setAttribute("dir", "rtl");
tinyMCE.triggerNodeChange(false);
return true;
}
// Pass to next handler in chain
return false;
}
function TinyMCE_directionality_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
function getAttrib(elm, name) {
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
}
tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonNormal', false);
tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonNormal', false);
if (node == null)
return;
var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (!elm) {
tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonDisabled', true);
tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonDisabled', true);
return;
}
var dir = getAttrib(elm, "dir");
if (dir == "ltr" || dir == "")
tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonSelected', false);
else
tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonSelected', false);
return true;
}
tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin);

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
// Pspell shell specific settings
$spellCheckerConfig['tinypspellshell.aspell'] = '/usr/bin/aspell';
$spellCheckerConfig['tinypspellshell.tmp'] = '/tmp';
$spellCheckerConfig['tinypspellshell.tmp'] = '/tmp/tinyspell/0';
// Default settings
$spellCheckerConfig['default.language'] = 'en';

View File

@ -149,12 +149,14 @@ var TinyMCE_wordpressPlugin = {
var altPage = tinyMCE.getLang('lang_wordpress_page_alt');
// Parse all <!--more--> tags and replace them with images
while ((startPos = content.indexOf('<!--more-->', startPos)) != -1) {
while ((startPos = content.indexOf('<!--more', startPos)) != -1) {
var endPos = content.indexOf('-->', startPos) + 3;
// Insert image
var contentAfter = content.substring(startPos + 11);
var moreText = content.substring(startPos + 8, endPos - 3);
var contentAfter = content.substring(endPos);
content = content.substring(0, startPos);
content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';
content += ' width="100%" height="10px" ';
content += ' width="100%" height="10px" moretext="'+moreText+'" ';
content += 'alt="'+altMore+'" title="'+altMore+'" class="mce_plugin_wordpress_more" name="mce_plugin_wordpress_more" />';
content += contentAfter;
@ -200,7 +202,8 @@ var TinyMCE_wordpressPlugin = {
if (attribs['class'] == "mce_plugin_wordpress_more" || attribs['name'] == "mce_plugin_wordpress_more") {
endPos += 2;
var embedHTML = '<!--more-->';
var moreText = attribs['moretext'] ? attribs['moretext'] : '';
var embedHTML = '<!--more'+moreText+'-->';
// Insert embed/object chunk
chunkBefore = content.substring(0, startPos);
@ -342,7 +345,7 @@ var TinyMCE_wordpressPlugin = {
if (pos != -1)
attributeName = attributeName.substring(pos+1);
attributes[attributeName.toLowerCase()] = attributeValue.substring(1).toLowerCase();
attributes[attributeName.toLowerCase()] = attributeValue.substring(1);
attributeName = "";
attributeValue = "";
@ -379,22 +382,3 @@ tinyMCE.execCommand = function (command, user_interface, value) {
}
return re;
};
tinyMCE.orgFixGeckoBaseHREFBug = tinyMCE.fixGeckoBaseHREFBug;
tinyMCE.fixGeckoBaseHREFBug = function(m, e, h) {
if ( tinyMCE.isGecko && m == 1 )
h = h.replace(new RegExp('<((a|img|select|area|iframe|base|input|script|embed|object|link)\\s([^>]*\\s)?)(src|href)\\s*=', 'gi'), '<$1 x$4=');
else
h = tinyMCE.orgFixGeckoBaseHREFBug(m, e, h);
return h;
};
tinyMCE.orgStoreAwayURLs = tinyMCE.storeAwayURLs;
tinyMCE.storeAwayURLs = function(s) {
// Remove all mce_src, mce_href and replace them with new ones
s = s.replace(new RegExp('mce_(href|src)\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
s = s.replace(new RegExp('<((a|img|select|area|iframe|base|input|script|embed|object|link)\\s([^>]*\\s)?)(src|href)\\s*=\\s*"([^"]*)"', 'gi'), '<$1 $4="$5" mce_$4="$5"');
return s;
};

View File

@ -1,7 +1,7 @@
/**
* $RCSfile: editor_template_src.js,v $
* $Revision: 1.93 $
* $Date: 2006/03/14 17:33:50 $
* $Revision: 1.96 $
* $Date: 2006/04/18 13:32:52 $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
@ -81,7 +81,13 @@ var TinyMCE_AdvancedTheme = {
['h3', '{$lang_theme_h3}'],
['h4', '{$lang_theme_h4}'],
['h5', '{$lang_theme_h5}'],
['h6', '{$lang_theme_h6}']
['h6', '{$lang_theme_h6}'],
['div', '{$lang_theme_div}'],
['blockquote', '{$lang_theme_blockquote}'],
['code', '{$lang_theme_code}'],
['dt', '{$lang_theme_dt}'],
['dd', '{$lang_theme_dd}'],
['samp', '{$lang_theme_samp}']
];
html += '<option value="">{$lang_theme_block}</option>';
@ -90,7 +96,7 @@ var TinyMCE_AdvancedTheme = {
for (var i=0; i<formats.length; i++) {
for (var x=0; x<lookup.length; x++) {
if (formats[i] == lookup[x][0])
html += '<option value="<' + lookup[x][0] + '>">' + lookup[x][1] + '</option>';
html += '<option value="&lt;' + lookup[x][0] + '&gt;">' + lookup[x][1] + '</option>';
}
}
@ -117,16 +123,16 @@ var TinyMCE_AdvancedTheme = {
return fontHTML;
case "fontsizeselect":
return '<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">\
<option value="0">{$lang_theme_font_size}</option>\
<option value="1">1 (8 pt)</option>\
<option value="2">2 (10 pt)</option>\
<option value="3">3 (12 pt)</option>\
<option value="4">4 (14 pt)</option>\
<option value="5">5 (18 pt)</option>\
<option value="6">6 (24 pt)</option>\
<option value="7">7 (36 pt)</option>\
</select>';
return '<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+
'<option value="0">{$lang_theme_font_size}</option>'+
'<option value="1">1 (8 pt)</option>'+
'<option value="2">2 (10 pt)</option>'+
'<option value="3">3 (12 pt)</option>'+
'<option value="4">4 (14 pt)</option>'+
'<option value="5">5 (18 pt)</option>'+
'<option value="6">6 (24 pt)</option>'+
'<option value="7">7 (36 pt)</option>'+
'</select>';
case "|":
case "separator":
@ -458,7 +464,7 @@ var TinyMCE_AdvancedTheme = {
var deltaHeight = 0;
var resizing = tinyMCE.getParam("theme_advanced_resizing", false);
var path = tinyMCE.getParam("theme_advanced_path", true);
var statusbarHTML = '<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: ' + (path ? "block" : "none") + '">&nbsp;</div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: ' + (resizing ? "block" : "none") + '" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';
var statusbarHTML = '<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: ' + (path ? "block" : "none") + '">&#160;</div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: ' + (resizing ? "block" : "none") + '" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';
var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout");
// Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY!
@ -583,11 +589,7 @@ var TinyMCE_AdvancedTheme = {
for (var i = 0; i < containers.length; i++)
{
if (containers[i] == "mceEditor") //Exceptions for mceEditor and ...
{
template['html'] += '<tr><td align="center" class="mceEditor_border">\
<span id="{$editor_id}"></span>\
</td></tr>';
}
template['html'] += '<tr><td align="center" class="mceEditor_border"><span id="{$editor_id}"></span></td></tr>';
else if (containers[i] == "mceElementpath" || containers[i] == "mceStatusbar") // ... mceElementpath:
{
var pathClass = "mceStatusbar";
@ -814,7 +816,7 @@ var TinyMCE_AdvancedTheme = {
}
}
pathElm.innerHTML = '<a href="#" accesskey="x"></a>' + tinyMCE.getLang('lang_theme_path') + ": " + html + '&nbsp;';
pathElm.innerHTML = '<a href="#" accesskey="x"></a>' + tinyMCE.getLang('lang_theme_path') + ": " + html + '&#160;';
}
// Reset old states

View File

@ -3,13 +3,15 @@
function TinyMCE_Engine() {
this.majorVersion = "2";
this.minorVersion = "0.5.1";
this.releaseDate = "2006-03-22";
this.minorVersion = "0.6.1";
this.releaseDate = "2006-05-04";
this.instances = new Array();
this.switchClassCache = new Array();
this.windowArgs = new Array();
this.loadedFiles = new Array();
this.pendingFiles = new Array();
this.loadingIndex = 0;
this.configs = new Array();
this.currentConfig = 0;
this.eventHandlers = new Array();
@ -127,7 +129,7 @@ TinyMCE_Engine.prototype = {
this._def("inline_styles", false);
this._def("convert_newlines_to_brs", false);
this._def("auto_reset_designmode", true);
this._def("entities", "160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro", true);
this._def("entities", "39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro", true);
this._def("entity_encoding", "named");
this._def("cleanup_callback", "");
this._def("add_unload_trigger", true);
@ -159,6 +161,13 @@ TinyMCE_Engine.prototype = {
this._def("content_css", '');
this._def("fix_list_elements", false);
this._def("fix_table_elements", false);
this._def("strict_loading_mode", document.contentType == 'application/xhtml+xml');
this._def("hidden_tab_class", '');
this._def("display_tab_class", '');
// Force strict loading mode to false on non Gecko browsers
if (this.isMSIE && !this.isOpera)
this.settings.strict_loading_mode = false;
// Browser check IE
if (this.isMSIE && this.settings['browsers'].indexOf('msie') == -1)
@ -198,9 +207,9 @@ TinyMCE_Engine.prototype = {
this.settings['base_href'] = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/";
theme = this.settings['theme'];
this.blockRegExp = new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dir|fieldset|form|noscript|noframes|menu|isindex)$", "i");
this.blockRegExp = new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dt|dd|dir|fieldset|form|noscript|noframes|menu|isindex|samp)$", "i");
this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40);
this.uniqueURL = 'http://tinymce.moxiecode.cp/mce_temp_url'; // Make unique URL non real URL
this.uniqueURL = 'javascript:TINYMCE_UNIQUEURL();'; // Make unique URL non real URL
this.uniqueTag = '<div id="mceTMPElement" style="display: none">TMP</div>';
this.callbacks = new Array('onInit', 'getInfo', 'getEditorTemplate', 'setupContent', 'onChange', 'onPageLoad', 'handleNodeChange', 'initInstance', 'execCommand', 'getControlHTML', 'handleEvent', 'cleanup');
@ -287,6 +296,9 @@ TinyMCE_Engine.prototype = {
// Save away this config
settings['index'] = this.configs.length;
this.configs[this.configs.length] = settings;
// Start loading first one in chain
this.loadNextScript();
},
_addUnloadEvents : function() {
@ -319,6 +331,8 @@ TinyMCE_Engine.prototype = {
// Use the previous plugin object base URL used when loading external plugins
p.baseURL = op ? op.baseURL : tinyMCE.baseURL + "/plugins/" + n;
this.plugins[n] = p;
this.loadNextScript();
},
setPluginBaseURL : function(n, u) {
@ -343,6 +357,8 @@ TinyMCE_Engine.prototype = {
addTheme : function(n, t) {
this.themes[n] = t;
this.loadNextScript();
},
addMenu : function(n, m) {
@ -354,21 +370,43 @@ TinyMCE_Engine.prototype = {
},
loadScript : function(url) {
for (var i=0; i<this.loadedFiles.length; i++) {
var i;
for (i=0; i<this.loadedFiles.length; i++) {
if (this.loadedFiles[i] == url)
return;
}
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></script>');
if (tinyMCE.settings.strict_loading_mode)
this.pendingFiles[this.pendingFiles.length] = url;
else
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></script>');
this.loadedFiles[this.loadedFiles.length] = url;
},
loadNextScript : function() {
var d = document, se;
if (!tinyMCE.settings.strict_loading_mode)
return;
if (this.loadingIndex < this.pendingFiles.length) {
se = d.createElementNS('http://www.w3.org/1999/xhtml', 'script');
se.setAttribute('language', 'javascript');
se.setAttribute('type', 'text/javascript');
se.setAttribute('src', this.pendingFiles[this.loadingIndex++]);
d.getElementsByTagName("head")[0].appendChild(se);
} else
this.loadingIndex = -1; // Done with loading
},
loadCSS : function(url) {
var ar = url.replace(/\s+/, '').split(',');
var lflen = 0, csslen = 0;
var skip = false;
var x = 0, i = 0;
var x = 0, i = 0, nl, le;
for (x = 0,csslen = ar.length; x<csslen; x++) {
ignore_css = false;
@ -383,7 +421,18 @@ TinyMCE_Engine.prototype = {
}
if (!skip) {
document.write('<link href="' + ar[x] + '" rel="stylesheet" type="text/css" />');
if (tinyMCE.settings.strict_loading_mode) {
nl = document.getElementsByTagName("head");
le = document.createElement('link');
le.setAttribute('href', ar[x]);
le.setAttribute('rel', 'stylesheet');
le.setAttribute('type', 'text/css');
nl[0].appendChild(le);
} else
document.write('<link href="' + ar[x] + '" rel="stylesheet" type="text/css" />');
this.loadedFiles[this.loadedFiles.length] = ar[x];
}
}
@ -658,7 +707,7 @@ TinyMCE_Engine.prototype = {
}
iframe.setAttribute("id", id);
iframe.setAttribute("className", "mceEditorIframe");
iframe.setAttribute("class", "mceEditorIframe");
iframe.setAttribute("border", "0");
iframe.setAttribute("frameBorder", "0");
iframe.setAttribute("marginWidth", "0");
@ -668,6 +717,7 @@ TinyMCE_Engine.prototype = {
iframe.setAttribute("width", aw);
iframe.setAttribute("height", ah);
iframe.setAttribute("allowtransparency", "true");
iframe.className = 'mceEditorIframe';
if (tinyMCE.settings["auto_resize"])
iframe.setAttribute("scrolling", "no");
@ -679,6 +729,10 @@ TinyMCE_Engine.prototype = {
iframe.style.width = aw;
iframe.style.height = ah;
// Ugly hack for Gecko problem in strict mode
if (tinyMCE.settings.strict_loading_mode)
iframe.style.marginBottom = '-5px';
// MSIE 5.0 issue
if (tinyMCE.isMSIE && !tinyMCE.isOpera)
replace_element.outerHTML = iframe.outerHTML;
@ -697,6 +751,14 @@ TinyMCE_Engine.prototype = {
var head = doc.getElementsByTagName('head').item(0);
var content = inst.startContent;
// HTML values get XML encoded in strict mode
if (tinyMCE.settings.strict_loading_mode) {
content = content.replace(/&lt;/g, '<');
content = content.replace(/&gt;/g, '>');
content = content.replace(/&quot;/g, '"');
content = content.replace(/&amp;/g, '&');
}
inst.switchSettings();
// Not loaded correctly hit it again, Mozilla bug #997860
@ -851,6 +913,22 @@ TinyMCE_Engine.prototype = {
inst.startContent = tinyMCE.trim(inst.getBody().innerHTML);
inst.undoRedo.add({ content : inst.startContent });
// Cleanup any mess left from storyAwayURLs
if (tinyMCE.isGecko) {
// Remove mce_src from textnodes and comments
tinyMCE.selectNodes(inst.getBody(), function(n) {
if (n.nodeType == 3 || n.nodeType == 8) {
n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
}
return false;
});
}
// Cleanup any mess left from storyAwayURLs
tinyMCE._removeInternal(inst.getBody());
tinyMCE.selectedInstance = inst;
tinyMCE.triggerNodeChange(false, true);
},
@ -868,6 +946,20 @@ TinyMCE_Engine.prototype = {
return s;
},
_removeInternal : function(n) {
if (tinyMCE.isGecko) {
// Remove mce_src from textnodes and comments
tinyMCE.selectNodes(n, function(n) {
if (n.nodeType == 3 || n.nodeType == 8) {
n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
}
return false;
});
}
},
removeTinyMCEFormElements : function(form_obj) {
// Check if form is valid
if (typeof(form_obj) == "undefined" || form_obj == null)
@ -922,7 +1014,23 @@ TinyMCE_Engine.prototype = {
if (tinyMCE.selectedInstance)
tinyMCE.selectedInstance.setBaseHREF(null);
window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings['base_href']);", 1);
// 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
if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
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;
}
}
window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings['base_href']);tinyMCE._resetIframeHeight();", 1);
return;
case "submit":
@ -1241,6 +1349,12 @@ TinyMCE_Engine.prototype = {
},
onLoad : function() {
// Wait for everything to be loaded first
if (tinyMCE.settings.strict_loading_mode && this.loadingIndex != -1) {
window.setTimeout('tinyMCE.onLoad();', 1);
return;
}
if (tinyMCE.isMSIE && !tinyMCE.isOpera && window.event.type == "readystatechange" && document.readyState != "complete")
return true;
@ -1425,6 +1539,8 @@ TinyMCE_Engine.prototype = {
tinyMCELang[(key.indexOf('lang_') == -1 ? 'lang_' : '') + (prefix != '' ? (prefix + "_") : '') + key] = ar[key];
}
this.loadNextScript();
// for (var key in ar)
// tinyMCELang[(key.indexOf('lang_') == -1 ? 'lang_' : '') + (prefix != '' ? (prefix + "_") : '') + key] = "|" + ar[key] + "|";
},
@ -1671,10 +1787,13 @@ TinyMCE_Engine.prototype = {
return className;
},
handleVisualAid : function(el, deep, state, inst) {
handleVisualAid : function(el, deep, state, inst, skip_dispatch) {
if (!el)
return;
if (!skip_dispatch)
tinyMCE.dispatchCallback(inst, 'handle_visual_aid_callback', 'handleVisualAid', el, deep, state, inst);
var tableElement = null;
switch (el.nodeName) {
@ -1713,7 +1832,7 @@ TinyMCE_Engine.prototype = {
if (deep && el.hasChildNodes()) {
for (var i=0; i<el.childNodes.length; i++)
tinyMCE.handleVisualAid(el.childNodes[i], deep, state, inst);
tinyMCE.handleVisualAid(el.childNodes[i], deep, state, inst, true);
}
},
@ -1751,35 +1870,54 @@ TinyMCE_Engine.prototype = {
*/
fixGeckoBaseHREFBug : function(m, e, h) {
var nl, i;
var nl, i, a, n, xsrc, xhref, el;
if (tinyMCE.isGecko) {
if (m == 1) {
h = h.replace(/\ssrc=/gi, " xsrc=");
h = h.replace(/\shref=/gi, " xhref=");
h = h.replace(/\ssrc=/gi, " mce_tsrc=");
h = h.replace(/\shref=/gi, " mce_thref=");
return h;
} else {
var el = new Array('a','img','select','area','iframe','base','input','script','embed','object','link');
el = new Array('a','img','select','area','iframe','base','input','script','embed','object','link');
for (var a=0; a<el.length; a++) {
var n = e.getElementsByTagName(el[a]);
for (a=0; a<el.length; a++) {
n = e.getElementsByTagName(el[a]);
for (i=0; i<n.length; i++) {
var xsrc = tinyMCE.getAttrib(n[i], "xsrc");
var xhref = tinyMCE.getAttrib(n[i], "xhref");
xsrc = tinyMCE.getAttrib(n[i], "mce_tsrc");
xhref = tinyMCE.getAttrib(n[i], "mce_thref");
if (xsrc != "") {
n[i].src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xsrc);
n[i].removeAttribute("xsrc");
try {
n[i].src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xsrc);
} catch (e) {
// Ignore, Firefox cast exception if local file wasn't found
}
n[i].removeAttribute("mce_tsrc");
}
if (xhref != "") {
n[i].href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xhref);
n[i].removeAttribute("xhref");
try {
n[i].href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xhref);
} catch (e) {
// Ignore, Firefox cast exception if local file wasn't found
}
n[i].removeAttribute("mce_thref");
}
}
}
el = tinyMCE.selectNodes(e, function(n) {
if (n.nodeType == 3 || n.nodeType == 8) {
n.nodeValue = n.nodeValue.replace(/\smce_tsrc=/gi, " src=");
n.nodeValue = n.nodeValue.replace(/\smce_thref=/gi, " href=");
}
return false;
});
}
}
@ -1920,14 +2058,14 @@ TinyMCE_Engine.prototype = {
}
if (doc) {
var styles = tinyMCE.isMSIE ? doc.styleSheets : doc.styleSheets;
var styles = doc.styleSheets;
if (styles && styles.length > 0) {
for (var x=0; x<styles.length; x++) {
var csses = null;
// Just ignore any errors
eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets(" + x + ").rules : doc.styleSheets[" + x + "].cssRules;} catch(e) {}");
eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets(" + x + ").rules : styles[" + x + "].cssRules;} catch(e) {}");
if (!csses)
return new Array();
@ -1938,17 +2076,31 @@ TinyMCE_Engine.prototype = {
if (selectorText) {
var rules = selectorText.split(',');
for (var c=0; c<rules.length; c++) {
var rule = rules[c];
// Strip spaces between selectors
while (rule.indexOf(' ') == 0)
rule = rule.substring(1);
// Invalid rule
if (rules[c].indexOf(' ') != -1 || rules[c].indexOf(':') != -1 || rules[c].indexOf('mceItem') != -1)
if (rule.indexOf(' ') != -1 || rule.indexOf(':') != -1 || rule.indexOf('mceItem') != -1)
continue;
if (rules[c] == "." + tinyMCE.settings['visual_table_class'] || rules[c].indexOf('mceEditable') != -1 || rules[c].indexOf('mceNonEditable') != -1)
if (rule.indexOf(tinyMCE.settings['visual_table_class']) != -1 || rule.indexOf('mceEditable') != -1 || rule.indexOf('mceNonEditable') != -1)
continue;
// Is class rule
if (rules[c].indexOf('.') != -1) {
//alert(rules[c].substring(rules[c].indexOf('.')));
output[output.length] = rules[c].substring(rules[c].indexOf('.')+1);
if (rule.indexOf('.') != -1) {
var cssClass = rule.substring(rule.indexOf('.') + 1);
var addClass = true;
for (var p=0; p<output.length && addClass; p++) {
if (output[p] == cssClass)
addClass = false;
}
if (addClass)
output[output.length] = cssClass;
}
}
}
@ -2100,6 +2252,17 @@ TinyMCE_Engine.prototype = {
tinyMCE.switchClass(e, tinyMCE.lastMenuBtnClass);
tinyMCE.lastSelectedMenuBtn = null;
}
},
explode : function(d, s) {
var ar = s.split(d), oar = new Array(), i;
for (i = 0; i<ar.length; i++) {
if (ar[i] != "")
oar[oar.length] = ar[i];
}
return oar;
}
};
@ -2520,15 +2683,21 @@ TinyMCE_Control.prototype = {
case "FormatBlock":
if (value == null || value == "") {
var elm = tinyMCE.getParentElement(this.getFocusElement(), "p,div,h1,h2,h3,h4,h5,h6,pre,address");
var elm = tinyMCE.getParentElement(this.getFocusElement(), "p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");
if (elm)
this.execCommand("mceRemoveNode", false, elm);
} else {
if (value == '<div>' && tinyMCE.isGecko)
value = 'div';
if (tinyMCE.isGecko && new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>', 'gi').test(value))
value = value.replace(/[^a-z]/gi, '');
this.getDoc().execCommand("FormatBlock", false, value);
if (tinyMCE.isMSIE && new RegExp('blockquote|code|samp', 'gi').test(value)) {
var b = this.selection.getBookmark();
this.getDoc().execCommand("FormatBlock", false, '<p>');
tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()), value);
this.selection.moveToBookmark(b);
} else
this.getDoc().execCommand("FormatBlock", false, value);
}
tinyMCE.triggerNodeChange();
@ -2829,6 +2998,9 @@ TinyMCE_Control.prototype = {
tinyMCE.setInnerHTML(doc.body, tinyMCE._cleanupHTML(this, doc, tinyMCE.settings, doc.body));
tinyMCE.convertAllRelativeURLs(doc.body);
// Cleanup any mess left from storyAwayURLs
tinyMCE._removeInternal(this.getBody());
// When editing always use fonts internaly
if (tinyMCE.getParam("convert_fonts_to_spans"))
tinyMCE.convertSpansToFonts(doc);
@ -3273,7 +3445,7 @@ TinyMCE_Control.prototype = {
if (tinyMCE.settings['debug']) {
hc = '<textarea wrap="off" id="' + form_element_name + '" name="' + form_element_name + '" cols="100" rows="15"></textarea>';
} else {
hc = '<input type="hidden" type="text" id="' + form_element_name + '" name="' + form_element_name + '" />';
hc = '<input type="hidden" id="' + form_element_name + '" name="' + form_element_name + '" />';
this.oldTargetElement.style.display = "none";
}
@ -3318,7 +3490,8 @@ TinyMCE_Control.prototype = {
var tElm = targetDoc.getElementById(this.editorId);
if (!tinyMCE.isMSIE) {
if (tElm && tElm.nodeName == "SPAN") {
// Node case is preserved in XML strict mode
if (tElm && (tElm.nodeName == "SPAN" || tElm.nodeName == "span")) {
tElm = tinyMCE._createIFrame(tElm, targetDoc);
dynamicIFrame = true;
}
@ -3413,7 +3586,27 @@ TinyMCE_Control.prototype = {
},
triggerSave : function(skip_cleanup, skip_callback) {
var e, nl = new Array(), i, s;
this.switchSettings();
s = tinyMCE.settings;
// Force hidden tabs visible while serializing
if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
e = this.iframeElement;
do {
if (e.style && e.style.display == 'none') {
e.style.display = 'block';
nl[nl.length] = {elm : e, type : 'style'};
}
if (e.style && s.hidden_tab_class.length > 0 && e.className.indexOf(s.hidden_tab_class) != -1) {
e.className = s.display_tab_class;
nl[nl.length] = {elm : e, type : 'class'};
}
} while ((e = e.parentNode) != null)
}
tinyMCE.settings['preformatted'] = false;
@ -3456,33 +3649,42 @@ TinyMCE_Control.prototype = {
if (tinyMCE.isSafari && this.formElement)
this.formElement.innerText = htm;
// Hide them again (tabs in MSIE)
for (i=0; i<nl.length; i++) {
if (nl[i].type == 'style')
nl[i].elm.style.display = 'none';
else
nl[i].elm.className = s.hidden_tab_class;
}
}
};
/* file:jscripts/tiny_mce/classes/TinyMCE_Cleanup.class.js */
TinyMCE_Engine.prototype.cleanupHTMLCode = function(s) {
s = s.replace(/<p \/>/gi, '<p>&nbsp;</p>');
s = s.replace(/<p>\s*<\/p>/gi, '<p>&nbsp;</p>');
s = s.replace(new RegExp('<p \\/>', 'gi'), '<p>&nbsp;</p>');
s = s.replace(new RegExp('<p>\\s*<\\/p>', 'gi'), '<p>&nbsp;</p>');
// Fix close BR elements
s = s.replace(new RegExp('<br>\\s*<\\/br>', 'gi'), '<br />');
// Open closed tags like <b/> to <b></b>
// tinyMCE.debug("f:" + s);
s = s.replace(/<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\|>]*?)\/>/gi, '<$1$2$3></$1$2>');
// tinyMCE.debug("e:" + s);
s = s.replace(new RegExp('<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\\\|>]*)\\/>', 'gi'), '<$1$2$3></$1$2>');
// Remove trailing space <b > to <b>
s = s.replace(new RegExp('\\s+></', 'gi'), '></');
// Close tags <img></img> to <img/>
s = s.replace(/<(img|br|hr)(.*?)><\/(img|br|hr)>/gi, '<$1$2 />');
s = s.replace(new RegExp('<(img|br|hr)([^>]*)><\\/(img|br|hr)>', 'gi'), '<$1$2 />');
// Weird MSIE bug, <p><hr /></p> breaks runtime?
if (tinyMCE.isMSIE)
s = s.replace(/<p><hr \/><\/p>/gi, "<hr>");
s = s.replace(new RegExp('<p><hr \\/><\\/p>', 'gi'), "<hr>");
// Convert relative anchors to absolute URLs ex: #something to file.htm#something
if (tinyMCE.getParam('convert_urls'))
s = s.replace(new RegExp('(href=\"?)(\\s*?#)', 'gi'), '$1' + tinyMCE.settings['document_base_url'] + "#");
s = s.replace(new RegExp('(href=\"{0,1})(\\s*#)', 'gi'), '$1' + tinyMCE.settings['document_base_url'] + "#");
return s;
};
@ -3544,6 +3746,9 @@ TinyMCE_Engine.prototype.serializeStyle = function(ar) {
tinyMCE.compressStyle(ar, "border", "", "border");
tinyMCE.compressStyle(ar, "border", "-width", "border-width");
tinyMCE.compressStyle(ar, "border", "-color", "border-color");
tinyMCE.compressStyle(ar, "border", "-style", "border-style");
tinyMCE.compressStyle(ar, "padding", "", "padding");
tinyMCE.compressStyle(ar, "margin", "", "margin");
for (var key in ar) {
var val = ar[key];
@ -3704,7 +3909,8 @@ TinyMCE_Engine.prototype.convertFontsToSpans = function(doc) {
TinyMCE_Engine.prototype.cleanupAnchors = function(doc) {
var i, cn, x, an = doc.getElementsByTagName("a");
for (i=0; i<an.length; i++) {
// Loops backwards due to bug #1467987
for (i=an.length-1; i>=0; i--) {
if (tinyMCE.getAttrib(an[i], "name") != "" && tinyMCE.getAttrib(an[i], "href") == "") {
cn = an[i].childNodes;
@ -3836,7 +4042,7 @@ TinyMCE_Engine.prototype._cleanupHTML = function(inst, doc, config, elm, visual,
h = h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*(&nbsp;|&#160;)\s*<\/p>/g, '<p>&nbsp;</p>');
h = h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*<\/p>/g, '<p>&nbsp;</p>');
h = h.replace(/<p>\s*<br \/>\s*&nbsp;\s*<\/p>/g, '<p>&nbsp;</p>');
h = h.replace(/<a>(.*?)<\/a>/g, '$1');
h = h.replace(new RegExp('<a>(.*?)<\\/a>', 'g'), '$1');
h = h.replace(/<p([^>]*)>\s*<\/p>/g, '<p$1>&nbsp;</p>');
// Clean body
@ -3912,7 +4118,7 @@ function TinyMCE_Cleanup() {
this.vElements = tinyMCE.clearArray(new Array());
this.vElementsRe = '';
this.closeElementsRe = /^(IMG|BR|HR|LINK|META|BASE|INPUT|BUTTON)$/;
this.closeElementsRe = /^(IMG|BR|HR|LINK|META|BASE|INPUT|BUTTON|AREA)$/;
this.codeElementsRe = /^(SCRIPT|STYLE)$/;
this.serializationId = 0;
this.mceAttribs = {
@ -4027,8 +4233,8 @@ TinyMCE_Cleanup.prototype = {
for (i=0; i<a.length; i++) {
t = a[i];
av = /(=|:|<)(.*?)$/.exec(t);
t = t.replace(/(=|:|<).*?$/, '');
av = new RegExp('(=|:|<)(.*?)$').exec(t);
t = t.replace(new RegExp('(=|:|<).*?$'), '');
if (av && av.length > 0) {
if (av[0].charAt(0) == ':') {
if (!r.forceAttribs)
@ -4334,13 +4540,6 @@ TinyMCE_Cleanup.prototype = {
c = s.charCodeAt(i);
e = this.entities[c];
// &apos; is not working in MSIE
// More info: http://www.w3.org/TR/xhtml1/#C_16
if (c == 39) {
o += "&#39;";
continue;
}
if (e && e != '')
o += '&' + e + ';';
else
@ -4378,12 +4577,6 @@ TinyMCE_Cleanup.prototype = {
},
_trimComment : function(s) {
// Make xsrc, xhref as src and href again
if (tinyMCE.isGecko) {
s = s.replace(/\sxsrc=/gi, " src=");
s = s.replace(/\sxhref=/gi, " href=");
}
// Remove mce_src, mce_href
s = s.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
s = s.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
@ -4406,6 +4599,15 @@ TinyMCE_Cleanup.prototype = {
if (this.isMSIE && n == "http-equiv")
v = e.httpEquiv;
if (this.isMSIE && e.nodeName == "FORM" && n == "enctype" && v == "application/x-www-form-urlencoded")
v = "";
if (this.isMSIE && e.nodeName == "INPUT" && n == "size" && v == "20")
v = "";
if (this.isMSIE && e.nodeName == "INPUT" && n == "maxlength" && v == "2147483647")
v = "";
if (n == "style" && !tinyMCE.isOpera)
v = e.style.cssText;
@ -4557,7 +4759,8 @@ TinyMCE_Engine.prototype.setInnerHTML = function(e, h) {
// Since MSIE auto generated emtpy P tags some times we must tell it to keep the real ones
h = h.replace(/<p([^>]*)>\u00A0?<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
h = h.replace(/<p([^>]*)>&nbsp;<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
h = h.replace(/<p([^>]*)>\s*&nbsp;\s*<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
h = h.replace(/<p([^>]*)>\s+<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
// Remove first comment
e.innerHTML = tinyMCE.uniqueTag + h;
@ -4670,6 +4873,17 @@ TinyMCE_Engine.prototype.getParentElement = function(node, names, attrib_name, a
return null;
};
TinyMCE_Engine.prototype.getParentNode = function(n, f) {
while (n) {
if (f(n))
return n;
n = n.parentNode;
}
return null;
};
TinyMCE_Engine.prototype.getAttrib = function(elm, name, default_value) {
if (typeof(default_value) == "undefined")
default_value = "";
@ -4791,6 +5005,62 @@ TinyMCE_Engine.prototype.nextNode = function(e, n) {
return null;
};
TinyMCE_Engine.prototype.selectNodes = function(n, f, a) {
var i;
if (!a)
a = new Array();
if (f(n))
a[a.length] = n;
if (n.hasChildNodes()) {
for (i=0; i<n.childNodes.length; i++)
tinyMCE.selectNodes(n.childNodes[i], f, a);
}
return a;
};
TinyMCE_Engine.prototype.addCSSClass = function(e, c, b) {
var o = this.removeCSSClass(e, c);
return e.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
};
TinyMCE_Engine.prototype.removeCSSClass = function(e, c) {
var a = this.explode(' ', e.className), i;
for (i=0; i<a.length; i++) {
if (a[i] == c)
a[i] = '';
}
return e.className = a.join(' ');
};
TinyMCE_Engine.prototype.renameElement = function(e, n, d) {
var ne, i, ar;
d = typeof(d) == "undefined" ? tinyMCE.selectedInstance.getDoc() : d;
if (e) {
ne = d.createElement(n);
ar = e.attributes;
for (i=ar.length-1; i>-1; i--) {
if (ar[i].specified && ar[i].nodeValue)
ne.setAttribute(ar[i].nodeName.toLowerCase(), ar[i].nodeValue);
}
ar = e.childNodes;
for (i=0; i<ar.length; i++)
ne.appendChild(ar[i].cloneNode(true));
e.parentNode.replaceChild(ne, e);
}
};
/* file:jscripts/tiny_mce/classes/TinyMCE_URL.class.js */
TinyMCE_Engine.prototype.parseURL = function(url_str) {
@ -4950,9 +5220,9 @@ TinyMCE_Engine.prototype.convertAbsoluteURLToRelativeURL = function(base_url, ur
if (fileName == targetURL.path && targetURL.anchor != "")
targetURL.path = "";
// If empty and not local anchor force slash
// If empty and not local anchor force filename or slash
if (targetURL.path == "" && !targetURL.anchor)
targetURL.path = "/";
targetURL.path = fileName != "" ? fileName : "/";
return this.serializeURL(targetURL);
};
@ -5215,6 +5485,7 @@ TinyMCE_Engine.prototype.addEventHandlers = function(inst) {
tinyMCE.addEvent(doc, "keyup", TinyMCE_Engine.prototype._eventPatch);
tinyMCE.addEvent(doc, "keydown", TinyMCE_Engine.prototype._eventPatch);
tinyMCE.addEvent(doc, "mouseup", TinyMCE_Engine.prototype._eventPatch);
tinyMCE.addEvent(doc, "mousedown", TinyMCE_Engine.prototype._eventPatch);
tinyMCE.addEvent(doc, "click", TinyMCE_Engine.prototype._eventPatch);
} else {
tinyMCE.addEvent(doc, "keypress", tinyMCE.handleEvent);
@ -5308,6 +5579,24 @@ TinyMCE_Engine.prototype.accessibleEventHandler = function(e) {
return true;
};
TinyMCE_Engine.prototype._resetIframeHeight = function() {
var ife;
if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
ife = tinyMCE.selectedInstance.iframeElement;
/* if (ife._oldWidth) {
ife.style.width = ife._oldWidth;
ife.width = ife._oldWidth;
}*/
if (ife._oldHeight) {
ife.style.height = ife._oldHeight;
ife.height = ife._oldHeight;
}
}
};
/* file:jscripts/tiny_mce/classes/TinyMCE_Selection.class.js */
function TinyMCE_Selection(inst) {
@ -5328,8 +5617,8 @@ TinyMCE_Selection.prototype = {
if (tinyMCE.isGecko)
e.appendChild(r.cloneContents());
else
e.innerHTML = r.htmlText;
else
e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;
h = tinyMCE._cleanupHTML(inst, inst.contentDocument, inst.settings, e, e, false, true, false);
@ -5490,8 +5779,13 @@ TinyMCE_Selection.prototype = {
nl = doc.getElementsByTagName(bookmark.tag);
if (nl.length > bookmark.index)
rng.addElement(nl[bookmark.index]);
if (nl.length > bookmark.index) {
try {
rng.addElement(nl[bookmark.index]);
} catch (ex) {
// Might be thrown if the node no longer exists
}
}
} else {
rng = inst.getSel().createRange();
rng.moveToElementText(inst.getBody());
@ -5877,6 +6171,13 @@ var TinyMCE_ForceParagraphs = {
var startBlock = tinyMCE.getParentBlockElement(startNode);
var endBlock = tinyMCE.getParentBlockElement(endNode);
// If absolute force paragraph generation within
if (startBlock && new RegExp('absolute|relative|static', 'gi').test(startBlock.style.position))
startBlock = null;
if (endBlock && new RegExp('absolute|relative|static', 'gi').test(endBlock.style.position))
endBlock = null;
// Use current block name
if (startBlock != null) {
blockName = startBlock.nodeName;
@ -6062,13 +6363,21 @@ var TinyMCE_ForceParagraphs = {
},
_handleBackSpace : function(inst) {
var r = inst.getRng();
var sn = r.startContainer;
var r = inst.getRng(), sn = r.startContainer, nv, s = false;
if (sn && sn.nextSibling && sn.nextSibling.nodeName == "BR")
sn.nextSibling.parentNode.removeChild(sn.nextSibling);
if (sn && sn.nextSibling && sn.nextSibling.nodeName == "BR") {
nv = sn.nodeValue;
return false;
// Handle if a backspace is pressed after a space character #bug 1466054
if (nv != null && nv.length >= r.startOffset && nv.charAt(r.startOffset - 1) == ' ')
s = true;
// Only remove BRs if we are at the end of line #bug 1464152
if (nv != null && r.startOffset == nv.length)
sn.nextSibling.parentNode.removeChild(sn.nextSibling);
}
return s;
}
};
@ -6080,6 +6389,7 @@ function TinyMCE_Layer(id, bm) {
this.events = false;
this.element = null;
this.blockMode = typeof(bm) != 'undefined' ? bm : true;
this.doc = document;
};
TinyMCE_Layer.prototype = {
@ -6144,8 +6454,11 @@ TinyMCE_Layer.prototype = {
resizeTo : function(w, h) {
var e = this.getElement();
e.style.width = w + "px";
e.style.height = h + "px";
if (w != null)
e.style.width = w + "px";
if (h != null)
e.style.height = h + "px";
this.updateBlocker();
},
@ -6166,7 +6479,7 @@ TinyMCE_Layer.prototype = {
getElement : function() {
if (!this.element)
this.element = document.getElementById(this.id);
this.element = this.doc.getElementById(this.id);
return this.element;
},
@ -6201,7 +6514,7 @@ TinyMCE_Layer.prototype = {
var d, b;
if (!this.blockerElement && this.blockMode) {
d = document;
d = this.doc;
b = d.createElement("iframe");
b.style.cssText = 'display: none; position: absolute; left: 0; top: 0';
@ -6229,7 +6542,7 @@ TinyMCE_Layer.prototype = {
},
create : function(n, c, p) {
var d = document, e = d.createElement(n);
var d = this.doc, e = d.createElement(n);
e.setAttribute('id', this.id);
@ -6243,37 +6556,6 @@ TinyMCE_Layer.prototype = {
return this.element = e;
},
/*
addCSSClass : function(e, c) {
this.removeCSSClass(e, c);
var a = this.explode(' ', e.className);
a[a.length] = c;
e.className = a.join(' ');
},
removeCSSClass : function(e, c) {
var a = this.explode(' ', e.className), i;
for (i=0; i<a.length; i++) {
if (a[i] == c)
a[i] = '';
}
e.className = a.join(' ');
},
explode : function(d, s) {
var ar = s.split(d);
var oar = new Array();
for (var i = 0; i<ar.length; i++) {
if (ar[i] != "")
oar[oar.length] = ar[i];
}
return oar;
},
*/
parseInt : function(s) {
if (s == null || s == '')
@ -6397,7 +6679,7 @@ TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, {
if (tinyMCE.lastMenu && tinyMCE.lastMenu != this)
tinyMCE.lastMenu.hide();
this.parent.show.call(this);
TinyMCE_Layer.prototype.show.call(this);
if (!tinyMCE.isOpera) {
// Accessibility stuff

View File

@ -43,6 +43,10 @@
$mce_popups_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/popups.css';
$mce_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/wordpress.css';
$mce_css = apply_filters('mce_css', $mce_css);
if ( $_SERVER['HTTPS'] ) {
$mce_css = str_replace('http://', 'https://', $mce_css);
$mce_popups_css = str_replace('http://', 'https://', $mce_popups_css);
}
?>
initArray = {
@ -69,6 +73,7 @@ initArray = {
convert_newlines_to_brs : false,
remove_linebreaks : false,
fix_list_elements : true,
entities : "38,amp,60,lt,62,gt",
content_css : "<?php echo $mce_css; ?>",
valid_elements : "<?php echo $valid_elements; ?>",
save_callback : 'TinyMCE_wordpressPlugin.saveCallback',

View File

@ -263,6 +263,15 @@ TinyMCE_Popup.prototype.openBrowser = function(element_id, type, option) {
eval("tinyMCEPopup.windowOpener." + cb + "(element_id, url, type, window);");
};
TinyMCE_Popup.prototype.importClass = function(c) {
window[c] = function() {};
for (var n in window.opener[c].prototype)
window[c].prototype[n] = window.opener[c].prototype[n];
window[c].constructor = window.opener[c].constructor;
};
// Setup global instance
var tinyMCEPopup = new TinyMCE_Popup();