reverting tinymce changes, updating smarty to 3.1.19
This commit is contained in:
parent
5633e88aad
commit
0e1f8f6486
155 changed files with 13663 additions and 10784 deletions
File diff suppressed because one or more lines are too long
|
@ -1,53 +1,88 @@
|
|||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||
init : function(ed, url) {
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').toLowerCase();
|
||||
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
});
|
||||
|
||||
ed.onPostProcess.add(function(ed, o) {
|
||||
if (o.set)
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
|
||||
if (o.get)
|
||||
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'BBCode Plugin',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
});
|
||||
|
||||
ed.onPostProcess.add(function(ed, o) {
|
||||
if (o.set)
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
|
||||
if (o.get)
|
||||
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'BBCode Plugin',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
// HTML -> BBCode in DFRN dialect
|
||||
_dfrn_html2bbcode : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
|
||||
|
||||
s = s.replace(re,str);
|
||||
|
||||
//modify code to keep stuff intact within [code][/code] blocks
|
||||
//Waitman Gobble NO WARRANTY
|
||||
|
||||
/* This doesn't seem to work well with
|
||||
[code]line1
|
||||
line2[/code]
|
||||
commenting out for now
|
||||
*/
|
||||
|
||||
/*
|
||||
var o = new Array();
|
||||
var x = s.split("[code]");
|
||||
var i = 0;
|
||||
|
||||
var si = "";
|
||||
si = x.shift();
|
||||
si = si.replace(re,str);
|
||||
o.push(si);
|
||||
|
||||
for (i = 0; i < x.length; i++) {
|
||||
var no = new Array();
|
||||
var j = x.shift();
|
||||
var g = j.split("[/code]");
|
||||
no.push(g.shift());
|
||||
si = g.shift();
|
||||
si = si.replace(re,str);
|
||||
no.push(si);
|
||||
o.push(no.join("[/code]"));
|
||||
}
|
||||
|
||||
s = o.join("[code]");
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
function get(re) {
|
||||
return s.match(re);
|
||||
|
@ -100,12 +135,12 @@
|
|||
var codes = get(/<code>(.*?)<\/code>/gi);
|
||||
rep(/<code>(.*?)<\/code>/gi,"[$!$!CODEBLOCK!$!$]");
|
||||
|
||||
// example: <strong> to [b]
|
||||
// example: <strong> to [b]
|
||||
rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");
|
||||
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
||||
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
||||
rep(/<span style=\"color:(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<font>(.*?)<\/font>/gi,"$1");
|
||||
rep(/<font>(.*?)<\/font>/gi,"$1");
|
||||
|
||||
// Use [^>]* instead of .* to prevent a match against two separate <img> tags
|
||||
rep(/<img[^>]*?width=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$1x$2]$3[/img]");
|
||||
|
@ -124,27 +159,27 @@
|
|||
rep(/<li>(.*?)<\/li>/gi,'[li]$1[/li]');
|
||||
|
||||
//rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
|
||||
rep(/<\/(strong|b)>/gi,"[/b]");
|
||||
rep(/<(strong|b)>/gi,"[b]");
|
||||
rep(/<\/(em|i)>/gi,"[/i]");
|
||||
rep(/<(em|i)>/gi,"[i]");
|
||||
rep(/<\/u>/gi,"[/u]");
|
||||
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
||||
rep(/<u>/gi,"[u]");
|
||||
rep(/<blockquote[^>]*>/gi,"[quote]");
|
||||
rep(/<\/blockquote>/gi,"[/quote]");
|
||||
rep(/<\/(strong|b)>/gi,"[/b]");
|
||||
rep(/<(strong|b)>/gi,"[b]");
|
||||
rep(/<\/(em|i)>/gi,"[/i]");
|
||||
rep(/<(em|i)>/gi,"[i]");
|
||||
rep(/<\/u>/gi,"[/u]");
|
||||
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
||||
rep(/<u>/gi,"[u]");
|
||||
rep(/<blockquote[^>]*>/gi,"[quote]");
|
||||
rep(/<\/blockquote>/gi,"[/quote]");
|
||||
rep(/<hr \/>/gi,"[hr]");
|
||||
rep(/<br (.*?)\/>/gi,"\n");
|
||||
rep(/<br \/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ |\u00a0/gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ |\u00a0/gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
|
||||
// Hack to fix an annoying bug of TinyMCE where block formats don't
|
||||
// work when forced_root_block = ''. So set forced_root_block = 'div'
|
||||
// and then strip out the divs manually
|
||||
|
@ -159,17 +194,47 @@
|
|||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from DFRN dialect
|
||||
_dfrn_bbcode2html : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
s = tinymce.trim(s);
|
||||
|
||||
|
||||
function rep(re, str) {
|
||||
|
||||
|
||||
/*//modify code to keep stuff intact within [code][/code] blocks
|
||||
//Waitman Gobble NO WARRANTY
|
||||
|
||||
|
||||
var o = new Array();
|
||||
var x = s.split("[code]");
|
||||
var i = 0;
|
||||
|
||||
var si = "";
|
||||
si = x.shift();
|
||||
si = si.replace(re,str);
|
||||
o.push(si);
|
||||
|
||||
for (i = 0; i < x.length; i++) {
|
||||
var no = new Array();
|
||||
var j = x.shift();
|
||||
var g = j.split("[/code]");
|
||||
no.push(g.shift());
|
||||
si = g.shift();
|
||||
si = si.replace(re,str);
|
||||
no.push(si);
|
||||
o.push(no.join("[/code]"));
|
||||
}
|
||||
|
||||
s = o.join("[code]");*/
|
||||
|
||||
s = s.replace(re, str);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
function get(re) {
|
||||
|
@ -182,21 +247,21 @@
|
|||
var codes = get(/\[code\](.*?)\[\/code\]/gi);
|
||||
rep(/\[code\](.*?)\[\/code\]/gi,"[$!$!CODEBLOCK!$!$]");
|
||||
|
||||
// example: [b] to <strong>
|
||||
rep(/\n/gi,"<br />");
|
||||
rep(/\[b\]/gi,"<strong>");
|
||||
rep(/\[\/b\]/gi,"</strong>");
|
||||
rep(/\[i\]/gi,"<em>");
|
||||
rep(/\[\/i\]/gi,"</em>");
|
||||
rep(/\[u\]/gi,"<u>");
|
||||
rep(/\[\/u\]/gi,"</u>");
|
||||
// example: [b] to <strong>
|
||||
rep(/\n/gi,"<br />");
|
||||
rep(/\[b\]/gi,"<strong>");
|
||||
rep(/\[\/b\]/gi,"</strong>");
|
||||
rep(/\[i\]/gi,"<em>");
|
||||
rep(/\[\/i\]/gi,"</em>");
|
||||
rep(/\[u\]/gi,"<u>");
|
||||
rep(/\[\/u\]/gi,"</u>");
|
||||
rep(/\[hr\]/gi,"<hr />");
|
||||
rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");
|
||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
||||
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");
|
||||
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
|
||||
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
|
||||
rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');
|
||||
rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');
|
||||
rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');
|
||||
|
@ -237,10 +302,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
},
|
||||
|
||||
/**
|
||||
* Creates control instances based in the incoming name. This method is normally not
|
||||
* Creates control instances based in the incomming name. This method is normally not
|
||||
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
||||
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
||||
* method can be used to create those.
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(){var b=tinymce.DOM;var a=function(d,f,e){var c=function(g){var i=d.controlManager.get(g);var h=f.controlManager.get(g);if(i&&h){h.displayColor(i.value)}};c("forecolor");c("backcolor");f.setContent(d.getContent({format:"raw"}),{format:"raw"});f.selection.moveToBookmark(e);if(d.plugins.spellchecker&&f.plugins.spellchecker){f.plugins.spellchecker.setLanguage(d.plugins.spellchecker.selectedLang)}};tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(i,c){var l=this,m={},k=b.doc.documentElement,d,o,h,g,f,e,j;i.addCommand("mceFullScreen",function(){var q,r;if(i.getParam("fullscreen_is_enabled")){if(i.getParam("fullscreen_new_window")){closeFullscreen()}else{b.win.setTimeout(function(){var t=i;var s=tinyMCE.get(t.getParam("fullscreen_editor_id"));s.plugins.fullscreen.saveState(t);tinyMCE.remove(t)},10)}return}if(i.getParam("fullscreen_new_window")){l.fullscreenSettings={bookmark:i.selection.getBookmark()};q=b.win.open(c+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{q.resizeTo(screen.availWidth,screen.availHeight)}catch(p){}}else{o=b.getStyle(b.doc.body,"overflow",1)||"auto";h=b.getStyle(k,"overflow",1);d=b.getViewPort();g=d.x;f=d.y;if(tinymce.isOpera&&o=="visible"){o="auto"}if(tinymce.isIE&&o=="scroll"){o="auto"}if(tinymce.isIE&&(h=="visible"||h=="scroll")){h="auto"}if(o=="0px"){o=""}b.setStyle(b.doc.body,"overflow","hidden");k.style.overflow="hidden";d=b.getViewPort();b.win.scrollTo(0,0);if(tinymce.isIE){d.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){e="absolute;top:"+d.y}else{e="fixed;top:0"}n=b.add(b.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+e+";left:0;width:"+d.w+"px;height:"+d.h+"px;z-index:200000;"});b.add(n,"div",{id:"mce_fullscreen"});tinymce.each(i.settings,function(s,t){m[t]=s});m.id="mce_fullscreen";m.width=n.clientWidth;m.height=n.clientHeight-15;m.fullscreen_is_enabled=true;m.fullscreen_editor_id=i.id;m.theme_advanced_resizing=false;m.save_onsavecallback=function(){i.setContent(tinyMCE.get(m.id).getContent());i.execCommand("mceSave")};tinymce.each(i.getParam("fullscreen_settings"),function(t,s){m[s]=t});l.fullscreenSettings={bookmark:i.selection.getBookmark(),fullscreen_overflow:o,fullscreen_html_overflow:h,fullscreen_scrollx:g,fullscreen_scrolly:f};if(m.theme_advanced_toolbar_location==="external"){m.theme_advanced_toolbar_location="top"}tinyMCE.oldSettings=tinyMCE.settings;l.fullscreenEditor=new tinymce.Editor("mce_fullscreen",m);l.fullscreenEditor.onInit.add(function(){l.loadState(l.fullscreenEditor)});l.fullscreenEditor.render();l.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");l.fullscreenElement.update();l.resizeFunc=tinymce.dom.Event.add(b.win,"resize",function(){var v=tinymce.DOM.getViewPort(),t=l.fullscreenEditor,s,u;s=t.dom.getSize(t.getContainer().getElementsByTagName("table")[0]);u=t.dom.getSize(t.getContainer().getElementsByTagName("iframe")[0]);t.theme.resizeTo(v.w-s.w+u.w,v.h-s.h+u.h)})}});i.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});i.onNodeChange.add(function(q,p){p.setActive("fullscreen",q.getParam("fullscreen_is_enabled"))});l.loadState=function(p){if(!(p&&l.fullscreenSettings)){throw"No fullscreen editor to load to"}a(i,p,l.fullscreenSettings.bookmark);p.focus()};l.saveState=function(q){if(!(q&&l.fullscreenSettings)){throw"No fullscreen editor to restore from"}var p=l.fullscreenSettings;a(q,i,q.selection.getBookmark());if(!i.getParam("fullscreen_new_window")){tinymce.dom.Event.remove(b.win,"resize",l.resizeFunc);delete l.resizeFunc;b.remove("mce_fullscreen_container");b.doc.documentElement.style.overflow=p.fullscreen_html_overflow;b.setStyle(b.doc.body,"overflow",p.fullscreen_overflow);b.win.scrollTo(p.fullscreen_scrollx,p.fullscreen_scrolly)}tinyMCE.settings=tinyMCE.oldSettings;delete tinyMCE.oldSettings;delete l.fullscreenEditor;delete l.fullscreenElement;delete l.fullscreenSettings;b.win.setTimeout(function(){i.selection.moveToBookmark(j);i.focus()},10)}},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)})();
|
||||
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().getElementsByTagName("table")[0]);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.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)})();
|
|
@ -11,48 +11,29 @@
|
|||
(function() {
|
||||
var DOM = tinymce.DOM;
|
||||
|
||||
// State Transfer function
|
||||
var transferState = function(oldEditor, newEditor, bookmark) {
|
||||
var transferColorButtonState = function(swapme) {
|
||||
var c = oldEditor.controlManager.get(swapme);
|
||||
var newC = newEditor.controlManager.get(swapme);
|
||||
|
||||
if (c && newC) {
|
||||
newC.displayColor(c.value);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
transferColorButtonState('forecolor');
|
||||
transferColorButtonState('backcolor');
|
||||
newEditor.setContent(oldEditor.getContent({format : 'raw'}), {format : 'raw'});
|
||||
newEditor.selection.moveToBookmark(bookmark);
|
||||
|
||||
if (oldEditor.plugins.spellchecker && newEditor.plugins.spellchecker) {
|
||||
newEditor.plugins.spellchecker.setLanguage(oldEditor.plugins.spellchecker.selectedLang);
|
||||
}
|
||||
};
|
||||
|
||||
tinymce.create('tinymce.plugins.FullScreenPlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, s = {}, de = DOM.doc.documentElement, vp, fullscreen_overflow, fullscreen_html_overflow, fullscreen_scrollx, fullscreen_scrolly, posCss, bookmark;
|
||||
var t = this, s = {}, vp, posCss;
|
||||
|
||||
t.editor = ed;
|
||||
|
||||
// Register commands
|
||||
ed.addCommand('mceFullScreen', function() {
|
||||
var win, oed;
|
||||
var win, de = DOM.doc.documentElement;
|
||||
|
||||
if (ed.getParam('fullscreen_is_enabled')) {
|
||||
if (ed.getParam('fullscreen_new_window'))
|
||||
closeFullscreen(); // Call to close in fullscreen.htm
|
||||
closeFullscreen(); // Call to close in new window
|
||||
else {
|
||||
DOM.win.setTimeout(function() {
|
||||
var fullscreenEditor = ed;
|
||||
|
||||
// find the editor that opened this one, execute restore function there
|
||||
var originalEditor = tinyMCE.get(fullscreenEditor.getParam('fullscreen_editor_id'));
|
||||
originalEditor.plugins.fullscreen.saveState(fullscreenEditor);
|
||||
|
||||
tinyMCE.remove(fullscreenEditor);
|
||||
tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
|
||||
tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent());
|
||||
tinyMCE.remove(ed);
|
||||
DOM.remove('mce_fullscreen_container');
|
||||
de.style.overflow = ed.getParam('fullscreen_html_overflow');
|
||||
DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
|
||||
DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
|
||||
tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
|
||||
}, 10);
|
||||
}
|
||||
|
||||
|
@ -60,9 +41,6 @@
|
|||
}
|
||||
|
||||
if (ed.getParam('fullscreen_new_window')) {
|
||||
t.fullscreenSettings = {
|
||||
bookmark: ed.selection.getBookmark()
|
||||
};
|
||||
win = DOM.win.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);
|
||||
|
@ -70,26 +48,27 @@
|
|||
// Ignore
|
||||
}
|
||||
} else {
|
||||
fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
|
||||
fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
|
||||
tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
|
||||
s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
|
||||
s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
|
||||
vp = DOM.getViewPort();
|
||||
fullscreen_scrollx = vp.x;
|
||||
fullscreen_scrolly = vp.y;
|
||||
s.fullscreen_scrollx = vp.x;
|
||||
s.fullscreen_scrolly = vp.y;
|
||||
|
||||
// Fixes an Opera bug where the scrollbars doesn't reappear
|
||||
if (tinymce.isOpera && fullscreen_overflow == 'visible')
|
||||
fullscreen_overflow = 'auto';
|
||||
if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
|
||||
s.fullscreen_overflow = 'auto';
|
||||
|
||||
// Fixes an IE bug where horizontal scrollbars would appear
|
||||
if (tinymce.isIE && fullscreen_overflow == 'scroll')
|
||||
fullscreen_overflow = 'auto';
|
||||
if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
|
||||
s.fullscreen_overflow = 'auto';
|
||||
|
||||
// Fixes an IE bug where the scrollbars doesn't reappear
|
||||
if (tinymce.isIE && (fullscreen_html_overflow == 'visible' || fullscreen_html_overflow == 'scroll'))
|
||||
fullscreen_html_overflow = 'auto';
|
||||
if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
|
||||
s.fullscreen_html_overflow = 'auto';
|
||||
|
||||
if (fullscreen_overflow == '0px')
|
||||
fullscreen_overflow = '';
|
||||
if (s.fullscreen_overflow == '0px')
|
||||
s.fullscreen_overflow = '';
|
||||
|
||||
DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
|
||||
de.style.overflow = 'hidden'; //Fix for IE6/7
|
||||
|
@ -129,21 +108,13 @@
|
|||
s[k] = v;
|
||||
});
|
||||
|
||||
t.fullscreenSettings = {
|
||||
bookmark: ed.selection.getBookmark(),
|
||||
fullscreen_overflow: fullscreen_overflow,
|
||||
fullscreen_html_overflow: fullscreen_html_overflow,
|
||||
fullscreen_scrollx: fullscreen_scrollx,
|
||||
fullscreen_scrolly: fullscreen_scrolly
|
||||
};
|
||||
|
||||
if (s.theme_advanced_toolbar_location === 'external')
|
||||
s.theme_advanced_toolbar_location = 'top';
|
||||
|
||||
tinyMCE.oldSettings = tinyMCE.settings; // Store old settings, the Editor constructor overwrites them
|
||||
t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
|
||||
t.fullscreenEditor.onInit.add(function() {
|
||||
t.loadState(t.fullscreenEditor);
|
||||
t.fullscreenEditor.setContent(ed.getContent());
|
||||
t.fullscreenEditor.focus();
|
||||
});
|
||||
|
||||
t.fullscreenEditor.render();
|
||||
|
@ -170,52 +141,6 @@
|
|||
ed.onNodeChange.add(function(ed, cm) {
|
||||
cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
|
||||
});
|
||||
|
||||
// fullscreenEditor is a param here because in window mode we don't create it
|
||||
t.loadState = function(fullscreenEditor) {
|
||||
if (!(fullscreenEditor && t.fullscreenSettings)) {
|
||||
throw "No fullscreen editor to load to";
|
||||
}
|
||||
|
||||
transferState(ed, fullscreenEditor, t.fullscreenSettings.bookmark);
|
||||
fullscreenEditor.focus();
|
||||
|
||||
};
|
||||
|
||||
// fullscreenEditor is a param here because in window mode we don't create it
|
||||
t.saveState = function(fullscreenEditor) {
|
||||
if (!(fullscreenEditor && t.fullscreenSettings)) {
|
||||
throw "No fullscreen editor to restore from";
|
||||
}
|
||||
var settings = t.fullscreenSettings;
|
||||
|
||||
transferState(fullscreenEditor, ed, fullscreenEditor.selection.getBookmark());
|
||||
|
||||
// cleanup only required if window mode isn't used
|
||||
if (!ed.getParam('fullscreen_new_window')) {
|
||||
tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
|
||||
delete t.resizeFunc;
|
||||
|
||||
DOM.remove('mce_fullscreen_container');
|
||||
|
||||
DOM.doc.documentElement.style.overflow = settings.fullscreen_html_overflow;
|
||||
DOM.setStyle(DOM.doc.body, 'overflow', settings.fullscreen_overflow);
|
||||
DOM.win.scrollTo(settings.fullscreen_scrollx, settings.fullscreen_scrolly);
|
||||
}
|
||||
tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
|
||||
|
||||
// clear variables
|
||||
delete tinyMCE.oldSettings;
|
||||
delete t.fullscreenEditor;
|
||||
delete t.fullscreenElement;
|
||||
delete t.fullscreenSettings;
|
||||
|
||||
// allow the fullscreen editor to be removed before restoring focus and selection
|
||||
DOM.win.setTimeout(function() {
|
||||
ed.selection.moveToBookmark(bookmark);
|
||||
ed.focus();
|
||||
}, 10);
|
||||
};
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
settings['strict_loading_mode'] = true;
|
||||
|
||||
settings.save_onsavecallback = function() {
|
||||
moveContent();
|
||||
window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
|
||||
window.opener.tinyMCE.get(oeID).execCommand('mceSave');
|
||||
window.close();
|
||||
};
|
||||
|
@ -56,15 +56,11 @@
|
|||
}
|
||||
|
||||
function moveContent() {
|
||||
// find the original editor, execute restore state in it's plugin instance
|
||||
window.opener.tinyMCE.get(oeID).plugins.fullscreen.saveState(tinyMCE.activeEditor);
|
||||
|
||||
// prevent moveContent from being called twice - e.g. if the unloadHandler runs after moveContent()
|
||||
tinymce.dom.Event.remove(window, "beforeunload", unloadHandler);
|
||||
window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
|
||||
}
|
||||
|
||||
function closeFullscreen() {
|
||||
// moveContent() will be called by the unload handler
|
||||
moveContent();
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
@ -82,20 +78,17 @@
|
|||
function render() {
|
||||
var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
|
||||
|
||||
e.value = window.opener.tinyMCE.get(oeID).getContent();
|
||||
|
||||
vp = dom.getViewPort();
|
||||
settings.width = vp.w;
|
||||
settings.height = vp.h - 15;
|
||||
|
||||
settings.oninit = function() {
|
||||
var ed = tinyMCE.activeEditor;
|
||||
window.opener.tinyMCE.get(oeID).plugins.fullscreen.loadState(ed);
|
||||
tinymce.dom.Event.add(window, 'resize', function() {
|
||||
var vp = dom.getViewPort();
|
||||
|
||||
tinymce.dom.Event.add(window, 'resize', function() {
|
||||
var vp = dom.getViewPort();
|
||||
|
||||
tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
|
||||
});
|
||||
}
|
||||
tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
|
||||
});
|
||||
|
||||
tinyMCE.init(settings);
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -55,12 +55,12 @@
|
|||
if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {
|
||||
parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
|
||||
}
|
||||
|
||||
|
||||
// Only store selection if the type is a normal window
|
||||
if (!f.type)
|
||||
t.bookmark = ed.selection.getBookmark(1);
|
||||
|
||||
id = DOM.uniqueId("mce_inlinepopups_"); // Use a prefix so this can't conflict with other ids
|
||||
id = DOM.uniqueId();
|
||||
vp = DOM.getViewPort();
|
||||
f.width = parseInt(f.width || 320);
|
||||
f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
|
||||
|
@ -111,17 +111,17 @@
|
|||
opt += ' mceMovable';
|
||||
|
||||
// Create DOM objects
|
||||
t._addAll(DOM.doc.body,
|
||||
['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
|
||||
t._addAll(DOM.doc.body,
|
||||
['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
|
||||
['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
|
||||
['div', {id : id + '_top', 'class' : 'mceTop'},
|
||||
['div', {id : id + '_top', 'class' : 'mceTop'},
|
||||
['div', {'class' : 'mceLeft'}],
|
||||
['div', {'class' : 'mceCenter'}],
|
||||
['div', {'class' : 'mceRight'}],
|
||||
['span', {id : id + '_title'}, f.title || '']
|
||||
],
|
||||
|
||||
['div', {id : id + '_middle', 'class' : 'mceMiddle'},
|
||||
['div', {id : id + '_middle', 'class' : 'mceMiddle'},
|
||||
['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],
|
||||
['span', {id : id + '_content'}],
|
||||
['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
|
||||
|
@ -188,7 +188,7 @@
|
|||
|
||||
DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
|
||||
DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
|
||||
|
||||
|
||||
Event.add(id, 'keyup', function(evt) {
|
||||
var VK_ESCAPE = 27;
|
||||
if (evt.keyCode === VK_ESCAPE) {
|
||||
|
@ -268,7 +268,7 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Make sure the tab order loops within the dialog.
|
||||
Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
|
||||
var iframe = DOM.get(id + '_ifr');
|
||||
|
@ -284,7 +284,7 @@
|
|||
DOM.get(id + '_ok').focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Add window
|
||||
w = t.windows[id] = {
|
||||
id : id,
|
||||
|
@ -341,7 +341,7 @@
|
|||
DOM.removeClass(t.lastId, 'mceFocus');
|
||||
DOM.addClass(id, 'mceFocus');
|
||||
t.lastId = id;
|
||||
|
||||
|
||||
if (w.focussedElement) {
|
||||
w.focussedElement.focus();
|
||||
} else if (DOM.get(id + '_ok')) {
|
||||
|
@ -486,7 +486,7 @@
|
|||
|
||||
dw = v;
|
||||
}
|
||||
|
||||
|
||||
if (dh < (v = w.features.min_height - sz.h)) {
|
||||
if (dy !== 0)
|
||||
dy += dh - v;
|
||||
|
@ -505,7 +505,7 @@
|
|||
if (dx + dy !== 0) {
|
||||
if (sx + dx < 0)
|
||||
dx = 0;
|
||||
|
||||
|
||||
if (sy + dy < 0)
|
||||
dy = 0;
|
||||
|
||||
|
@ -567,7 +567,7 @@
|
|||
t.focus(fw.id);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// Find front most window
|
||||
_frontWindow : function() {
|
||||
var fw, ix = 0;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -291,7 +291,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Check if we should use the new auto process method
|
||||
// Check if we should use the new auto process method
|
||||
if (getParam(ed, "paste_auto_cleanup_on_paste")) {
|
||||
// Is it's Opera or older FF use key handler
|
||||
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
|
||||
|
@ -354,7 +354,7 @@
|
|||
h = h.replace(v[0], v[1]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (ed.settings.paste_enable_default_filters == false) {
|
||||
return;
|
||||
}
|
||||
|
@ -413,9 +413,7 @@
|
|||
// If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.
|
||||
do {
|
||||
len = h.length;
|
||||
// Don't remove the type attribute for lists so that non-default list types display correctly.
|
||||
h = h.replace(/(<?!(ol|ul)[^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
|
||||
h = h.replace(/(<(ol|ul)[^>]*\s)(?:id|name|language|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
|
||||
h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
|
||||
} while (len != h.length);
|
||||
|
||||
// Remove all spans if no styles is to be retained
|
||||
|
@ -591,7 +589,7 @@
|
|||
if (ed.settings.paste_enable_default_filters == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (o.wordContent) {
|
||||
// Remove named anchors or TOC links
|
||||
each(dom.select('a', o.node), function(a) {
|
||||
|
@ -719,7 +717,7 @@
|
|||
if (type == 'ul')
|
||||
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, '');
|
||||
else
|
||||
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*[\w|'<'|'>']+\.( |\u00a0)+\s*/, '');;
|
||||
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, '');
|
||||
|
||||
// Create li and add paragraph data into the new li
|
||||
li = listElm.appendChild(dom.create('li', 0, html));
|
||||
|
|
|
@ -14,7 +14,6 @@ var SearchReplaceDialog = {
|
|||
mcTabs.onChange.add(function(tab_id, panel_id) {
|
||||
t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
switchMode : function(m) {
|
||||
|
@ -40,11 +39,6 @@ var SearchReplaceDialog = {
|
|||
searchNext : function(a) {
|
||||
var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
|
||||
|
||||
if (tinymce.isIE11 && !window.find) {
|
||||
ed.windowManager.alert("This feature is not available in IE 11+. Upgrade TinyMCE to 4.x to get this functionallity back.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get input
|
||||
f = document.forms[0];
|
||||
s = f[m + '_panel_searchstring'].value;
|
||||
|
@ -93,10 +87,6 @@ var SearchReplaceDialog = {
|
|||
|
||||
if (b) {
|
||||
r.moveEnd("character", -(rs.length)); // Otherwise will loop forever
|
||||
} else {
|
||||
// to avoid looping for ever in MSIE 9/10 when just
|
||||
// changing the case
|
||||
r.moveStart("character", rs.length);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -126,7 +126,6 @@
|
|||
|
||||
c.onRenderMenu.add(function(c, m) {
|
||||
m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
|
||||
t.menuItems = {};
|
||||
each(t.languages, function(v, k) {
|
||||
var o = {icon : 1}, mi;
|
||||
|
||||
|
@ -134,60 +133,27 @@
|
|||
if (v == t.selectedLang) {
|
||||
return;
|
||||
}
|
||||
t._updateMenu(mi);
|
||||
mi.setSelected(1);
|
||||
t.selectedItem.setSelected(0);
|
||||
t.selectedItem = mi;
|
||||
t.selectedLang = v;
|
||||
};
|
||||
|
||||
o.title = k;
|
||||
mi = m.add(o);
|
||||
mi.setSelected(v == t.selectedLang);
|
||||
t.menuItems[v] = mi;
|
||||
|
||||
if (v == t.selectedLang)
|
||||
t.selectedItem = mi;
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
return c;
|
||||
}
|
||||
},
|
||||
|
||||
setLanguage: function(lang) {
|
||||
var t = this;
|
||||
|
||||
if (lang == t.selectedLang) {
|
||||
// allowed
|
||||
return;
|
||||
}
|
||||
|
||||
if (tinymce.grep(t.languages, function(v) { return v === lang; }).length === 0) {
|
||||
throw "Unknown language: " + lang;
|
||||
}
|
||||
|
||||
t.selectedLang = lang;
|
||||
|
||||
// if the menu has been shown, update it as well
|
||||
if (t.menuItems) {
|
||||
t._updateMenu(t.menuItems[lang]);
|
||||
}
|
||||
|
||||
if (t.active) {
|
||||
// clear error in the old language.
|
||||
t._done();
|
||||
|
||||
// Don't immediately block the UI to check spelling in the new language, this is an API not a user action.
|
||||
}
|
||||
},
|
||||
|
||||
// Internal functions
|
||||
|
||||
_updateMenu: function(mi) {
|
||||
mi.setSelected(1);
|
||||
this.selectedItem.setSelected(0);
|
||||
this.selectedItem = mi;
|
||||
},
|
||||
|
||||
_walk : function(n, f) {
|
||||
var d = this.editor.getDoc(), w;
|
||||
|
||||
|
@ -269,7 +235,6 @@
|
|||
each(nl, function(n) {
|
||||
var node, elem, txt, pos, v = n.nodeValue;
|
||||
|
||||
rx.lastIndex = 0;
|
||||
if (rx.test(v)) {
|
||||
// Encode the content
|
||||
v = dom.encode(v);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -166,7 +166,7 @@
|
|||
|
||||
// Add something to the inner node
|
||||
if (curNode)
|
||||
curNode.innerHTML = tinymce.isIE && !tinymce.isIE11 ? ' ' : '<br data-mce-bogus="1" />';
|
||||
curNode.innerHTML = tinymce.isIE ? ' ' : '<br data-mce-bogus="1" />';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -179,7 +179,7 @@
|
|||
if (formatNode) {
|
||||
cell.appendChild(formatNode);
|
||||
} else {
|
||||
if (!tinymce.isIE || tinymce.isIE11)
|
||||
if (!tinymce.isIE)
|
||||
cell.innerHTML = '<br data-mce-bogus="1" />';
|
||||
}
|
||||
|
||||
|
@ -1249,7 +1249,7 @@
|
|||
|
||||
if (last && last.nodeName == 'TABLE') {
|
||||
if (ed.settings.forced_root_block)
|
||||
ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE && !tinymce.isIE11 ? ' ' : '<br data-mce-bogus="1" />');
|
||||
ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '<br data-mce-bogus="1" />');
|
||||
else
|
||||
ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ function insertTable() {
|
|||
if (!capEl && caption) {
|
||||
capEl = elm.ownerDocument.createElement('caption');
|
||||
|
||||
if (!tinymce.isIE || tinymce.isIE11)
|
||||
if (!tinymce.isIE)
|
||||
capEl.innerHTML = '<br data-mce-bogus="1"/>';
|
||||
|
||||
elm.insertBefore(capEl, elm.firstChild);
|
||||
|
@ -199,7 +199,7 @@ function insertTable() {
|
|||
html += '>';
|
||||
|
||||
if (caption) {
|
||||
if (!tinymce.isIE || tinymce.isIE11)
|
||||
if (!tinymce.isIE)
|
||||
html += '<caption><br data-mce-bogus="1"/></caption>';
|
||||
else
|
||||
html += '<caption></caption>';
|
||||
|
@ -209,7 +209,7 @@ function insertTable() {
|
|||
html += "<tr>";
|
||||
|
||||
for (var x=0; x<cols; x++) {
|
||||
if (!tinymce.isIE || tinymce.isIE11)
|
||||
if (!tinymce.isIE)
|
||||
html += '<td><br data-mce-bogus="1"/></td>';
|
||||
else
|
||||
html += '<td></td>';
|
||||
|
@ -242,16 +242,16 @@ function insertTable() {
|
|||
} else
|
||||
inst.execCommand('mceInsertContent', false, html);
|
||||
|
||||
tinymce.each(dom.select('table[data-mce-new]'), function(node) {
|
||||
tinymce.each(dom.select('table[data-mce-new]'), function(node) {
|
||||
var tdorth = dom.select('td,th', node);
|
||||
|
||||
|
||||
// Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
|
||||
if (tinymce.isIE && !tinymce.isIE11 && node.nextSibling == null) {
|
||||
if (tinymce.isIE && node.nextSibling == null) {
|
||||
if (inst.settings.forced_root_block)
|
||||
dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
|
||||
else
|
||||
dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// IE9 might fail to do this selection
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\u00co-\u00ff^\uc397^u00f7\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'<span id="'+e.id+'">0</span>')}}else{tinymce.DOM.add(k,"span",{},'<span id="'+e.id+'">0</span>')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();
|
||||
(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'<span id="'+e.id+'">0</span>')}}else{tinymce.DOM.add(k,"span",{},'<span id="'+e.id+'">0</span>')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();
|
|
@ -18,7 +18,7 @@
|
|||
init : function(ed, url) {
|
||||
var t = this, last = 0, VK = tinymce.VK;
|
||||
|
||||
t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\u00co-\u00ff^\uc397^u00f7\'-]+/g); // u2019 == ’ u00c0-u00ff extended latin chars with diacritical marks. exclude uc397 multiplication & u00f7 division
|
||||
t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’
|
||||
t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);
|
||||
t.update_rate = ed.getParam('wordcount_update_rate', 2000);
|
||||
t.update_on_delete = ed.getParam('wordcount_update_on_delete', false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue