tinymce-rails4 4.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/app/assets/javascripts/langs/readme.md +3 -0
- data/app/assets/javascripts/license.txt +504 -0
- data/app/assets/javascripts/plugins/advlist/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/anchor/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/autolink/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/autoresize/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/autosave/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/bbcode/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/charmap/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/code/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/contextmenu/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/directionality/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/app/assets/javascripts/plugins/emoticons/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/example/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/example_dependency/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/fullpage/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/fullscreen/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/hr/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/image/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/importcss/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/insertdatetime/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/layer/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/legacyoutput/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/link/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/lists/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/media/moxieplayer.swf +0 -0
- data/app/assets/javascripts/plugins/media/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/nonbreaking/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/noneditable/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/pagebreak/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/paste/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/preview/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/print/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/save/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/searchreplace/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/spellchecker/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/tabfocus/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/table/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/template/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/textcolor/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/visualblocks/css/visualblocks.css +128 -0
- data/app/assets/javascripts/plugins/visualblocks/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/visualchars/plugin.min.js +1 -0
- data/app/assets/javascripts/plugins/wordcount/plugin.min.js +1 -0
- data/app/assets/javascripts/skins/lightgray/content.inline.min.css +1 -0
- data/app/assets/javascripts/skins/lightgray/content.min.css +1 -0
- data/app/assets/javascripts/skins/lightgray/fonts/icomoon-small.eot +0 -0
- data/app/assets/javascripts/skins/lightgray/fonts/icomoon-small.svg +175 -0
- data/app/assets/javascripts/skins/lightgray/fonts/icomoon-small.ttf +0 -0
- data/app/assets/javascripts/skins/lightgray/fonts/icomoon-small.woff +0 -0
- data/app/assets/javascripts/skins/lightgray/fonts/icomoon.eot +0 -0
- data/app/assets/javascripts/skins/lightgray/fonts/icomoon.svg +153 -0
- data/app/assets/javascripts/skins/lightgray/fonts/icomoon.ttf +0 -0
- data/app/assets/javascripts/skins/lightgray/fonts/icomoon.woff +0 -0
- data/app/assets/javascripts/skins/lightgray/fonts/readme.md +1 -0
- data/app/assets/javascripts/skins/lightgray/img/anchor.gif +0 -0
- data/app/assets/javascripts/skins/lightgray/img/loader.gif +0 -0
- data/app/assets/javascripts/skins/lightgray/img/object.gif +0 -0
- data/app/assets/javascripts/skins/lightgray/img/trans.gif +0 -0
- data/app/assets/javascripts/skins/lightgray/img/wline.gif +0 -0
- data/app/assets/javascripts/skins/lightgray/skin.ie7.min.css +1 -0
- data/app/assets/javascripts/skins/lightgray/skin.min.css +1 -0
- data/app/assets/javascripts/themes/modern/theme.min.js +1 -0
- data/app/assets/javascripts/tinymce.min.js +10 -0
- data/lib/generators/tinymce/install/install_generator.rb +13 -0
- data/lib/tinymce/rails4/version.rb +5 -0
- data/lib/tinymce/rails4.rb +8 -0
- data/tinymce-rails4.gemspec +24 -0
- metadata +187 -0
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("charmap",function(e){function t(){function t(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var i,a,r,o;i='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var s=25;for(r=0;10>r;r++){for(i+="<tr>",a=0;s>a;a++){var l=n[r*s+a],c="g"+(r*s+a);i+='<td title="'+l[1]+'"><div id="'+c+'" tabIndex="-1">'+(l?String.fromCharCode(parseInt(l[0],10)):" ")+"</div></td>"}i+="</tr>"}i+="</tbody></table>";var u={type:"container",html:i,onclick:function(t){var n=t.target;"DIV"==n.nodeName&&e.execCommand("mceInsertContent",!1,n.firstChild.nodeValue)},onmouseover:function(e){var n=t(e.target);n&&o.find("#preview").text(n.firstChild.firstChild.data)}};o=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[u,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){o.close()}}]})}var n=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["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","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];e.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:t}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:t,context:"insert"})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("code",function(e){function o(){e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e.getParam("code_dialog_width",600),minHeight:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),value:e.getContent({source_view:!0}),spellcheck:!1},onSubmit:function(o){e.undoManager.transact(function(){e.setContent(o.data.code)}),e.nodeChanged()}})}e.addCommand("mceCodeEditor",o),e.addButton("code",{icon:"code",tooltip:"Source code",onclick:o}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:o})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("contextmenu",function(e){var t;e.on("contextmenu",function(n){var i;if(n.preventDefault(),i=e.settings.contextmenu||"link image inserttable | cell row column deletetable",t)t.show();else{var o=[];tinymce.each(i.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"==t&&(n={text:t}),n&&(n.shortcut="",o.push(n))});for(var a=0;a<o.length;a++)"|"==o[a].text&&(0===a||a==o.length-1)&&o.splice(a,1);t=new tinymce.ui.Menu({items:o,context:"contextmenu"}),t.renderTo(document.body)}var r={x:n.pageX,y:n.pageY};e.inline||(r=tinymce.DOM.getPos(e.getContentAreaContainer()),r.x+=n.clientX,r.y+=n.clientY),t.moveTo(r.x,r.y),e.on("remove",function(){t.remove(),t=null})})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("directionality",function(e){function t(t){var n,i=e.dom,a=e.selection.getSelectedBlocks();a.length&&(n=i.getAttrib(a[0],"dir"),tinymce.each(a,function(e){i.getParent(e.parentNode,"*[dir='"+t+"']",i.getRoot())||(n!=t?i.setAttrib(e,"dir",t):i.setAttrib(e,"dir",null))}),e.nodeChanged())}function n(e){var t=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(n){t.push(n+"[dir="+e+"]")}),t.join(",")}e.addCommand("mceDirectionLTR",function(){t("ltr")}),e.addCommand("mceDirectionRTL",function(){t("rtl")}),e.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),e.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})});
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("emoticons",function(e,t){function n(){var e;return e='<table role="presentation" class="mce-grid">',tinymce.each(i,function(n){e+="<tr>",tinymce.each(n,function(n){var i=t+"/img/smiley-"+n+".gif";e+='<td><a href="#" data-mce-url="'+i+'" tabindex="-1"><img src="'+i+'" style="width: 18px; height: 18px"></a></td>'}),e+="</tr>"}),e+="</table>"}var i=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];e.addButton("emoticons",{type:"panelbutton",popoverAlign:"bc-tl",panel:{autohide:!0,html:n,onclick:function(t){var n=e.dom.getParent(t.target,"a");n&&(e.insertContent('<img src="'+n.getAttribute("data-mce-url")+'" />'),this.hide())}},tooltip:"Emoticons"})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("example",function(t){t.addButton("example",{text:"My button",icon:!1,onclick:function(){t.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(e){t.insertContent("Title: "+e.data.title)}})}}),t.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){t.windowManager.open({title:"TinyMCE site",url:"http://www.tinymce.com",width:800,height:600,buttons:[{text:"Close",onclick:"close"}]})}})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("example_dependency",function(){},["example"]);
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("fullpage",function(e){function t(){var t=n();e.windowManager.open({title:"Document properties",data:t,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(e){i(tinymce.extend(t,e.data))}})}function n(){function t(e,t){var n=e.attr(t);return n||""}var n,i,r=a(),o={};return o.fontface=e.getParam("fullpage_default_fontface",""),o.fontsize=e.getParam("fullpage_default_fontsize",""),n=r.firstChild,7==n.type&&(o.xml_pi=!0,i=/encoding="([^"]+)"/.exec(n.value),i&&(o.docencoding=i[1])),n=r.getAll("#doctype")[0],n&&(o.doctype="<!DOCTYPE"+n.value+">"),n=r.getAll("title")[0],n&&n.firstChild&&(o.title=n.firstChild.value),u(r.getAll("meta"),function(e){var t,n=e.attr("name"),i=e.attr("http-equiv");n?o[n.toLowerCase()]=e.attr("content"):"Content-Type"==i&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")),t&&(o.docencoding=t[1]))}),n=r.getAll("html")[0],n&&(o.langcode=t(n,"lang")||t(n,"xml:lang")),n=r.getAll("link")[0],n&&"stylesheet"==n.attr("rel")&&(o.stylesheet=n.attr("href")),n=r.getAll("body")[0],n&&(o.langdir=t(n,"dir"),o.style=t(n,"style"),o.visited_color=t(n,"vlink"),o.link_color=t(n,"link"),o.active_color=t(n,"alink")),o}function i(t){function n(e,t,n){e.attr(t,n?n:void 0)}function i(e){o.firstChild?o.insert(e,o.firstChild):o.append(e)}var r,o,l,c,m,f=e.dom;r=a(),o=r.getAll("head")[0],o||(c=r.getAll("html")[0],o=new d("head",1),c.firstChild?c.insert(o,c.firstChild,!0):c.append(o)),c=r.firstChild,t.xml_pi?(m='version="1.0"',t.docencoding&&(m+=' encoding="'+t.docencoding+'"'),7!=c.type&&(c=new d("xml",7),r.insert(c,r.firstChild,!0)),c.value=m):c&&7==c.type&&c.remove(),c=r.getAll("#doctype")[0],t.doctype?(c||(c=new d("#doctype",10),t.xml_pi?r.insert(c,r.firstChild):i(c)),c.value=t.doctype.substring(9,t.doctype.length-1)):c&&c.remove(),t.docencoding&&(c=null,u(r.getAll("meta"),function(e){"Content-Type"==e.attr("http-equiv")&&(c=e)}),c||(c=new d("meta",1),c.attr("http-equiv","Content-Type"),c.shortEnded=!0,i(c)),c.attr("content","text/html; charset="+t.docencoding)),c=r.getAll("title")[0],t.title?c||(c=new d("title",1),c.append(new d("#text",3)).value=t.title,i(c)):c&&c.remove(),u("keywords,description,author,copyright,robots".split(","),function(e){var n,a,o=r.getAll("meta"),l=t[e];for(n=0;n<o.length;n++)if(a=o[n],a.attr("name")==e)return l?a.attr("content",l):a.remove(),void 0;l&&(c=new d("meta",1),c.attr("name",e),c.attr("content",l),c.shortEnded=!0,i(c))}),c=r.getAll("link")[0],c&&"stylesheet"==c.attr("rel")?t.stylesheet?c.attr("href",t.stylesheet):c.remove():t.stylesheet&&(c=new d("link",1),c.attr({rel:"stylesheet",text:"text/css",href:t.stylesheet}),c.shortEnded=!0,i(c)),c=r.getAll("body")[0],c&&(n(c,"dir",t.langdir),n(c,"style",t.style),n(c,"vlink",t.visited_color),n(c,"link",t.link_color),n(c,"alink",t.active_color),f.setAttribs(e.getBody(),{style:t.style,dir:t.dir,vLink:t.visited_color,link:t.link_color,aLink:t.active_color})),c=r.getAll("html")[0],c&&(n(c,"lang",t.langcode),n(c,"xml:lang",t.langcode)),o.firstChild||o.remove(),l=new tinymce.html.Serializer({validate:!1,indent:!0,apply_source_formatting:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(r),s=l.substring(0,l.indexOf("</body>"))}function a(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(s)}function r(t){function n(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})}var i,r,l,d,m=t.content,f="",g=e.dom;t.selection||"raw"==t.format&&s||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(m=m.replace(/<(\/?)BODY/gi,"<$1body"),i=m.indexOf("<body"),-1!=i?(i=m.indexOf(">",i),s=n(m.substring(0,i+1)),r=m.indexOf("</body",i),-1==r&&(r=m.length),t.content=m.substring(i+1,r),c=n(m.substring(r))):(s=o(),c="\n</body>\n</html>"),l=a(),u(l.getAll("style"),function(e){e.firstChild&&(f+=e.firstChild.value)}),d=l.getAll("body")[0],d&&g.setAttribs(e.getBody(),{style:d.attr("style")||"",dir:d.attr("dir")||"",vLink:d.attr("vlink")||"",link:d.attr("link")||"",aLink:d.attr("alink")||""}),g.remove("fullpage_styles"),f&&(g.add(e.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},f),d=g.get("fullpage_styles"),d.styleSheet&&(d.styleSheet.cssText=f)))}function o(){var t,n="",i="";return e.getParam("fullpage_default_xml_pi")&&(n+='<?xml version="1.0" encoding="'+e.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'),n+=e.getParam("fullpage_default_doctype","<!DOCTYPE html>"),n+="\n<html>\n<head>\n",(t=e.getParam("fullpage_default_title"))&&(n+="<title>"+t+"</title>\n"),(t=e.getParam("fullpage_default_encoding"))&&(n+='<meta http-equiv="Content-Type" content="text/html; charset='+t+'" />\n'),(t=e.getParam("fullpage_default_font_family"))&&(i+="font-family: "+t+";"),(t=e.getParam("fullpage_default_font_size"))&&(i+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(i+="color: "+t+";"),n+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n"}function l(t){t.selection||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(t.content=tinymce.trim(s)+"\n"+tinymce.trim(t.content)+"\n"+tinymce.trim(c))}var s,c,u=tinymce.each,d=tinymce.html.Node;e.addCommand("mceFullPageProperties",t),e.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),e.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),e.on("BeforeSetContent",r),e.on("GetContent",l)});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,i=document,a=i.body;return a.offsetWidth&&(e=a.offsetWidth,t=a.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){l.setStyle(c,"height",t().h-(s.clientHeight-c.clientHeight))}var s,c,u,d=document.body,m=document.documentElement;o=!o,s=e.getContainer().firstChild,c=e.getContentAreaContainer().firstChild,u=c.style,o?(i=u.width,a=u.height,u.width=u.height="100%",l.addClass(d,"mce-fullscreen"),l.addClass(m,"mce-fullscreen"),l.addClass(s,"mce-fullscreen"),l.bind(window,"resize",n),n(),r=n):(u.width=i,u.height=a,l.removeClass(d,"mce-fullscreen"),l.removeClass(m,"mce-fullscreen"),l.removeClass(s,"mce-fullscreen"),l.unbind(window,"resize",r)),e.fire("FullscreenStateChanged",{state:o})}var i,a,r,o=!1,l=tinymce.DOM;if(!e.settings.inline)return e.on("init",function(){e.addShortcut("Ctrl+Alt+F","",n)}),e.on("remove",function(){r&&l.unbind(window,"resize",r)}),e.addCommand("mceFullScreen",n),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return o}}});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("hr",function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1,"<hr />")}),e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("image",function(t){function e(t,e){function n(t,n){i.parentNode.removeChild(i),e({width:t,height:n})}var i=document.createElement("img");i.onload=function(){n(i.clientWidth,i.clientHeight)},i.onerror=function(){n()},i.src=t;var a=i.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left=0,a.width=a.height="auto",document.body.appendChild(i)}function n(e){return function(){var n=t.settings.image_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(t){e(tinymce.util.JSON.parse(t))}}):e(n)}}function i(n){function i(){var t=[{text:"None",value:""}];return tinymce.each(n,function(e){t.push({text:e.text||e.title,value:e.value||e.url,menu:e.menu})}),t}function a(t){var e,n,i,a;e=s.find("#width")[0],n=s.find("#height")[0],i=e.value(),a=n.value(),s.find("#constrain")[0].checked()&&h&&u&&i&&a&&(t.control==e?(a=Math.round(i/h*a),n.value(a)):(i=Math.round(a/u*i),e.value(i))),h=i,u=a}function o(){function e(e){function i(){e.onload=e.onerror=null,t.selection.select(e),t.nodeChanged()}e.onload=function(){n.width||n.height||m.setAttribs(e,{width:e.clientWidth,height:e.clientHeight}),i()},e.onerror=i}var n=s.toJSON();""===n.width&&(n.width=null),""===n.height&&(n.height=null),""===n.style&&(n.style=null),n={src:n.src,alt:n.alt,width:n.width,height:n.height,style:n.style},t.undoManager.transact(function(){return n.src?(p?m.setAttribs(p,n):(n.id="__mcenew",t.selection.setContent(m.createHTML("img",n)),p=m.get("__mcenew"),m.setAttrib(p,"id",null)),e(p),void 0):(p&&(m.remove(p),t.nodeChanged()),void 0)})}function l(t){return t&&(t=t.replace(/px$/,"")),t}function r(){e(this.value(),function(t){t.width&&t.height&&(h=t.width,u=t.height,s.find("#width").value(h),s.find("#height").value(u))})}function c(){function t(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t}var e=s.toJSON(),n=m.parseStyle(e.style);m.setAttrib(p,"style",""),delete n.margin,n["margin-top"]=n["margin-bottom"]=t(e.vspace),n["margin-left"]=n["margin-right"]=t(e.hspace),n["border-width"]=t(e.border),s.find("#style").value(m.serializeStyle(m.parseStyle(m.serializeStyle(n))))}var s,d,h,u,g,m=t.dom,p=t.selection.getNode();h=m.getAttrib(p,"width"),u=m.getAttrib(p,"height"),"IMG"!=p.nodeName||p.getAttribute("data-mce-object")?p=null:d={src:m.getAttrib(p,"src"),alt:m.getAttrib(p,"alt"),width:h,height:u},n&&(g={name:"target",type:"listbox",label:"Image list",values:i(),onselect:function(t){var e=s.find("#alt");(!e.value()||t.lastControl&&e.value()==t.lastControl.text())&&e.value(t.control.text()),s.find("#src").value(t.control.value())}});var y=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:r},g,{name:"alt",type:"textbox",label:"Image description"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:a},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:a},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}];t.settings.image_advtab?(p&&(d.hspace=l(p.style.marginLeft||p.style.marginRight),d.vspace=l(p.style.marginTop||p.style.marginBottom),d.border=l(p.style.borderWidth),d.style=t.dom.serializeStyle(t.dom.parseStyle(t.dom.getAttrib(p,"style")))),s=t.windowManager.open({title:"Insert/edit image",data:d,bodyType:"tabpanel",body:[{title:"General",type:"form",items:y},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox"},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:c},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:o})):s=t.windowManager.open({title:"Insert/edit image",data:d,body:y,onSubmit:o})}t.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:n(i),stateSelector:"img:not([data-mce-object])"}),t.addMenuItem("image",{icon:"image",text:"Insert image",onclick:n(i),context:"insert",prependToContext:!0})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("importcss",function(t){function e(e,s){function i(t,e){var o=t.href;if(e||c[o]){if(s){if(s instanceof RegExp&&!s.test(o))return;if("string"==typeof s&&-1===o.indexOf(s))return}n(t.imports,function(t){i(t,!0)}),n(t.cssRules||t.rules,function(t){t.styleSheet?i(t.styleSheet,!0):t.selectorText&&n(t.selectorText.split(","),function(t){r.push(tinymce.trim(t))})})}}var r=[],c={};n(t.contentCSS,function(t){c[t]=!0});try{n(e.styleSheets,i)}catch(o){}return r}function s(e){var s,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var i=n[1],r=n[2].substr(1).split(".").join(" ");return n[1]?(s={title:e},t.schema.getTextBlockElements()[i]?s.block=i:t.schema.getBlockElements()[i]?s.selector=i:s.inline=i):n[2]&&(s={inline:"span",title:e.substr(1),classes:r}),t.settings.importcss_merge_classes!==!1?s.classes=r:s.attributes={"class":r},s}}var n=tinymce.each;t.settings.style_formats||t.on("renderFormatsMenu",function(i){var r=t.settings.importcss_selector_converter||s,c={},o=t.settings.importcss_file_filter;t.settings.importcss_append||i.control.items().remove(),n(e(t.getDoc(),o),function(e){if(-1===e.indexOf(".mce-")&&!c[e]){var s=r(e);if(s){var n=s.name||tinymce.DOM.uniqueId();t.formatter.register(n,s),i.control.add(tinymce.extend({},i.control.settings.itemDefaults,{text:s.title,format:n}))}c[e]=!0}}),i.control.renderNew()})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("insertdatetime",function(e){function t(t,n){function i(e,t){if(e=""+e,e.length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}return n=n||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+n.getFullYear()),t=t.replace("%y",""+n.getYear()),t=t.replace("%m",i(n.getMonth()+1,2)),t=t.replace("%d",i(n.getDate(),2)),t=t.replace("%H",""+i(n.getHours(),2)),t=t.replace("%M",""+i(n.getMinutes(),2)),t=t.replace("%S",""+i(n.getSeconds(),2)),t=t.replace("%I",""+((n.getHours()+11)%12+1)),t=t.replace("%p",""+(n.getHours()<12?"AM":"PM")),t=t.replace("%B",""+e.translate(s[n.getMonth()])),t=t.replace("%b",""+e.translate(o[n.getMonth()])),t=t.replace("%A",""+e.translate(r[n.getDay()])),t=t.replace("%a",""+e.translate(a[n.getDay()])),t=t.replace("%%","%")}function n(n){var i=t(n);if(e.settings.insertdatetime_element){var a;a=/%[HMSIp]/.test(n)?t("%Y-%m-%dT%H:%M"):t("%Y-%m-%d"),i='<time datetime="'+a+'">'+i+"</time>";var r=e.dom.getParent(e.selection.getStart(),"time");if(r)return e.dom.setOuterHTML(r,i),void 0}e.insertContent(i)}var i,a="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),s="January February March April May June July August September October November December".split(" "),l=[];e.addCommand("mceInsertDate",function(){n(e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),e.addCommand("mceInsertTime",function(){n(e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S")))}),e.addButton("inserttime",{type:"splitbutton",title:"Insert time",onclick:function(){n(i||"%H:%M:%S")},menu:l}),tinymce.each(e.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(e){l.push({text:t(e),onclick:function(){i=e,n(e)}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:l,context:"insert"})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("layer",function(e){function t(e){do if(e.className&&-1!=e.className.indexOf("mceItemLayer"))return e;while(e=e.parentNode)}function n(t){var n=e.dom;tinymce.each(n.select("div,p",t),function(e){/^(absolute|relative|fixed)$/i.test(e.style.position)&&(e.hasVisual?n.addClass(e,"mceItemVisualAid"):n.removeClass(e,"mceItemVisualAid"),n.addClass(e,"mceItemLayer"))})}function i(n){var i,o,a=[],r=t(e.selection.getNode()),l=-1,s=-1;for(o=[],tinymce.walk(e.getBody(),function(e){1==e.nodeType&&/^(absolute|relative|static)$/i.test(e.style.position)&&o.push(e)},"childNodes"),i=0;i<o.length;i++)a[i]=o[i].style.zIndex?parseInt(o[i].style.zIndex,10):0,0>l&&o[i]==r&&(l=i);if(0>n){for(i=0;i<a.length;i++)if(a[i]<a[l]){s=i;break}s>-1?(o[l].style.zIndex=a[s],o[s].style.zIndex=a[l]):a[l]>0&&(o[l].style.zIndex=a[l]-1)}else{for(i=0;i<a.length;i++)if(a[i]>a[l]){s=i;break}s>-1?(o[l].style.zIndex=a[s],o[s].style.zIndex=a[l]):o[l].style.zIndex=a[l]+1}e.execCommand("mceRepaint")}function o(){var t=e.dom,n=t.getPos(t.getParent(e.selection.getNode(),"*")),i=e.getBody();e.dom.add(i,"div",{style:{position:"absolute",left:n.x,top:n.y>20?n.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content")),tinymce.Env.ie&&t.setHTML(i,i.innerHTML)}function a(){var n=t(e.selection.getNode());n||(n=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")),n&&("absolute"==n.style.position.toLowerCase()?(e.dom.setStyles(n,{position:"",left:"",top:"",width:"",height:""}),e.dom.removeClass(n,"mceItemVisualAid"),e.dom.removeClass(n,"mceItemLayer")):(n.style.left||(n.style.left="20px"),n.style.top||(n.style.top="20px"),n.style.width||(n.style.width=n.width?n.width+"px":"100px"),n.style.height||(n.style.height=n.height?n.height+"px":"100px"),n.style.position="absolute",e.dom.setAttrib(n,"data-mce-style",""),e.addVisual(e.getBody())),e.execCommand("mceRepaint"),e.nodeChanged())}e.addCommand("mceInsertLayer",o),e.addCommand("mceMoveForward",function(){i(1)}),e.addCommand("mceMoveBackward",function(){i(-1)}),e.addCommand("mceMakeAbsolute",function(){a()}),e.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),e.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),e.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),e.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),e.on("init",function(){tinymce.Env.ie&&e.getDoc().execCommand("2D-Position",!1,!0)}),e.on("mouseup",function(n){var i=t(n.target);i&&e.dom.setAttrib(i,"data-mce-style","")}),e.on("mousedown",function(n){var i,o=n.target,a=e.getDoc();tinymce.Env.gecko&&(t(o)?"on"!==a.designMode&&(a.designMode="on",o=a.body,i=o.parentNode,i.removeChild(o),i.appendChild(o)):"on"==a.designMode&&(a.designMode="off"))}),e.on("NodeChange",n)});
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e){e.on("AddEditor",function(e){e.editor.settings.inline_styles=!1}),e.PluginManager.add("legacyoutput",function(t){t.on("init",function(){var n="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",i=e.explode(t.settings.font_size_style_values),o=t.schema;t.formatter.register({alignleft:{selector:n,attributes:{align:"left"}},aligncenter:{selector:n,attributes:{align:"center"}},alignright:{selector:n,attributes:{align:"right"}},alignjustify:{selector:n,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(t){return e.inArray(i,t.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),e.each("b,i,u,strike".split(","),function(e){o.addValidElements(e+"[*]")}),o.getElementRule("font")||o.addValidElements("font[face|size|color|style]"),e.each(n.split(","),function(e){var t=o.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}(tinymce);
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("link",function(e){function t(t){return function(){var n=e.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(n)}}function n(t){function n(e){var t=d.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),d.find("#href").value(e.control.value())}function i(){var e=[{text:"None",value:""}];return tinymce.each(t,function(t){e.push({text:t.text||t.title,value:t.value||t.url,menu:t.menu})}),e}function a(t){var n=[{text:"None",value:""}];return tinymce.each(e.settings.rel_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function o(t){var n=[{text:"None",value:""}];return e.settings.target_list||n.push({text:"New window",value:"_blank"}),tinymce.each(e.settings.target_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function r(t){var i=[];return tinymce.each(e.dom.select("a:not([href])"),function(e){var n=e.name||e.id;n&&i.push({text:n,value:"#"+n,selected:-1!=t.indexOf("#"+n)})}),i.length?(i.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:i,onselect:n}):void 0}function s(){c||0!==g.text.length||this.parent().parent().find("#text")[0].value(this.value())}var l,u,c,d,m,f,h,g={},p=e.selection,v=e.dom;l=p.getNode(),u=v.getParent(l,"a[href]"),g.text=c=u?u.innerText||u.textContent:p.getContent({format:"text"}),g.href=u?v.getAttrib(u,"href"):"",g.target=u?v.getAttrib(u,"target"):"",g.rel=u?v.getAttrib(u,"rel"):"","IMG"==l.nodeName&&(g.text=c=" "),t&&(m={type:"listbox",label:"Link list",values:i(),onselect:n}),e.settings.target_list!==!1&&(h={name:"target",type:"listbox",label:"Target",values:o(g.target)}),e.settings.rel_list&&(f={name:"rel",type:"listbox",label:"Rel",values:a(g.rel)}),d=e.windowManager.open({title:"Insert link",data:g,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:s,onkeyup:s},{name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){g.text=this.value()}},r(g.href),m,f,h],onSubmit:function(t){function n(t,n){window.setTimeout(function(){e.windowManager.confirm(t,n)},0)}function i(){a.text!=c?u?(e.focus(),u.innerHTML=a.text,v.setAttribs(u,{href:o,target:a.target?a.target:null,rel:a.rel?a.rel:null}),p.select(u)):e.insertContent(v.createHTML("a",{href:o,target:a.target?a.target:null,rel:a.rel?a.rel:null},a.text)):e.execCommand("mceInsertLink",!1,{href:o,target:a.target,rel:a.rel?a.rel:null})}var a=t.data,o=a.href;return o?o.indexOf("@")>0&&-1==o.indexOf("//")&&-1==o.indexOf("mailto:")?(n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(e){e&&(o="mailto:"+o),i()}),void 0):/^\s*www\./i.test(o)?(n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(e){e&&(o="http://"+o),i()}),void 0):(i(),void 0):(e.execCommand("unlink"),void 0)}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t(n)),this.showDialog=n,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]",context:"insert",prependToContext:!0})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("lists",function(e){var n=this;e.on("init",function(){function t(e){function n(n){var r,i,o;i=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"],1==i.nodeType&&(r=L.create("span",{"data-mce-type":"bookmark"}),i.hasChildNodes()?(o=Math.min(o,i.childNodes.length-1),n?i.insertBefore(r,i.childNodes[o]):L.insertAfter(r,i.childNodes[o])):i.appendChild(r),i=r,o=0),t[n?"startContainer":"endContainer"]=i,t[n?"startOffset":"endOffset"]=o}var t={};return n(!0),e.collapsed||n(),t}function r(e){function n(n){function t(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n==e)return t;(1!=n.nodeType||"bookmark"!=n.getAttribute("data-mce-type"))&&t++,n=n.nextSibling}return-1}var r,i,o;r=o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"],r&&(1==r.nodeType&&(i=t(r),r=r.parentNode,L.remove(o)),e[n?"startContainer":"endContainer"]=r,e[n?"startOffset":"endOffset"]=i)}n(!0),n();var t=L.createRng();t.setStart(e.startContainer,e.startOffset),e.endContainer&&t.setEnd(e.endContainer,e.endOffset),b.setRng(t)}function i(e){return e&&/^(OL|UL)$/.test(e.nodeName)}function o(e){return e.parentNode.firstChild==e}function a(e){return e.parentNode.lastChild==e}function d(n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]}function f(e){return e&&"SPAN"===e.nodeName&&"bookmark"===e.getAttribute("data-mce-type")}function s(n,t){var r,i,o;if(e.settings.forced_root_block&&(t=t||e.settings.forced_root_block),i=t?L.create(t):L.createFragment(),n)for(;r=n.firstChild;)o||"SPAN"==r.nodeName&&"bookmark"==r.getAttribute("data-mce-type")||(o=!0),i.appendChild(r);return e.settings.forced_root_block?o||tinymce.Env.ie&&!(tinymce.Env.ie>10)||i.appendChild(L.create("br",{"data-mce-bogus":"1"})):i.appendChild(L.create("br")),i}function c(){return tinymce.grep(b.getSelectedBlocks(),function(e){return"LI"==e.nodeName})}function l(e,n,t){var r,i,o=L.select('span[data-mce-type="bookmark"]',e);t=t||s(n),r=L.createRng(),r.setStartAfter(n),r.setEndAfter(e),i=r.extractContents(),L.isEmpty(i)||L.insertAfter(i,e),L.insertAfter(t,e),L.isEmpty(n.parentNode)&&(tinymce.each(o,function(e){n.parentNode.parentNode.insertBefore(e,n.parentNode)}),L.remove(n.parentNode)),L.remove(n)}function u(e){var n,t;if(n=e.nextSibling,n&&i(n)&&n.nodeName==e.nodeName){for(;t=n.firstChild;)e.appendChild(t);L.remove(n)}if(n=e.previousSibling,n&&i(n)&&n.nodeName==e.nodeName){for(;t=n.firstChild;)e.insertBefore(t,e.firstChild);L.remove(n)}}function p(e){tinymce.each(tinymce.grep(L.select("ol,ul",e)),function(e){var n,t=e.parentNode;"LI"==t.nodeName&&t.firstChild==e&&(n=t.previousSibling,n&&"LI"==n.nodeName&&(n.appendChild(e),L.isEmpty(t)&&L.remove(t))),i(t)&&(n=t.previousSibling,n&&"LI"==n.nodeName&&n.appendChild(e))})}function m(e){function n(e){L.isEmpty(e)&&L.remove(e)}var t,r=e.parentNode,d=r.parentNode;if(o(e)&&a(e))if("LI"==d.nodeName)L.insertAfter(e,d),n(d),L.remove(r);else{if(!i(d))return d.insertBefore(s(e),r),L.remove(r),void 0;L.remove(r,!0)}else if(o(e))if("LI"==d.nodeName)L.insertAfter(e,d),t=L.create("LI"),t.appendChild(r),L.insertAfter(t,e),n(d);else{if(!i(d))return d.insertBefore(s(e),r),L.remove(e),void 0;d.insertBefore(e,r)}else if(a(e))if("LI"==d.nodeName)L.insertAfter(e,d);else{if(!i(d))return L.insertAfter(s(e),r),L.remove(e),void 0;L.insertAfter(e,r)}else"LI"==d.nodeName?(r=d,t=s(e,"LI")):t=i(d)?s(e,"LI"):s(e),l(r,e,t),p(r.parentNode);return!0}function v(e){var n,t;return n=e.previousSibling,n&&"UL"==n.nodeName?(n.appendChild(e),void 0):n&&"LI"==n.nodeName&&i(n.lastChild)?(n.lastChild.appendChild(e),void 0):(n=e.nextSibling,n&&"UL"==n.nodeName?(n.insertBefore(e,n.firstChild),void 0):n&&"LI"==n.nodeName&&i(e.lastChild)?void 0:(n=e.previousSibling,n&&"LI"==n.nodeName&&(t=L.create(e.parentNode.nodeName),n.appendChild(t),t.appendChild(e)),!0))}function N(){var e,n=t(b.getRng(!0));return tinymce.each(c(),function(n){v(n)&&(e=!0)}),r(n),e}function h(){var e,n=t(b.getRng(!0));return tinymce.each(c(),function(n){m(n)&&(e=!0)}),r(n),e}function C(n){function o(){function n(e){var n,t;for(n=a[e?"startContainer":"endContainer"],t=a[e?"startOffset":"endOffset"],1==n.nodeType&&(n=n.childNodes[Math.min(t,n.childNodes.length-1)]||n);n.parentNode!=i;){if(d(n))return n;if(/^(TD|TH)$/.test(n.parentNode.nodeName))return n;n=n.parentNode}return n}for(var t,r=[],i=e.getBody(),o=n(!0),s=n(),c=[],l=o;l&&(c.push(l),l!=s);l=l.nextSibling);return tinymce.each(c,function(e){if(d(e))return r.push(e),t=null,void 0;if(L.isBlock(e)||"BR"==e.nodeName)return"BR"==e.nodeName&&L.remove(e),t=null,void 0;var n=e.nextSibling;return f(e)&&(d(n)||!n&&e.parentNode==i)?(t=null,void 0):(t||(t=L.create("p"),e.parentNode.insertBefore(t,e),r.push(t)),t.appendChild(e),void 0)}),r}var a=b.getRng(!0),s=t(a),c=o();tinymce.each(c,function(e){var t,r;r=e.previousSibling,r&&i(r)&&r.nodeName==n?(t=r,e=L.rename(e,"LI"),r.appendChild(e)):(t=L.create(n),e.parentNode.insertBefore(t,e),t.appendChild(e),e=L.rename(e,"LI")),u(t)}),r(s)}function g(){var e=t(b.getRng(!0));tinymce.each(c(),function(e){var n,t;if(L.isEmpty(e))return m(e),void 0;for(n=e;n;n=n.parentNode)i(n)&&(t=n);l(t,e)}),r(e)}function y(e){var n=L.getParent(b.getStart(),"OL,UL");if(n)if(n.nodeName==e)g(e);else{var i=t(b.getRng(!0));u(L.rename(n,e)),r(i)}else C(e)}var L=e.dom,b=e.selection;n.backspaceDelete=function(e){function n(e,n){var t=e.startContainer,r=e.startOffset;if(3==t.nodeType&&(n?r<t.data.length:r>0))return t;for(var i=new tinymce.dom.TreeWalker(e.startContainer);t=i[n?"next":"prev"]();)if(3==t.nodeType&&t.data.length>0)return t}function o(e,n){var t,r,o=e.parentNode;for(i(n.lastChild)&&(r=n.lastChild),t=n.lastChild,t&&"BR"==t.nodeName&&e.hasChildNodes()&&L.remove(t);t=e.firstChild;)n.appendChild(t);r&&n.appendChild(r),L.remove(e),L.isEmpty(o)&&L.remove(o)}if(b.isCollapsed()){var a=L.getParent(b.getStart(),"LI");if(a){var d=b.getRng(!0),f=L.getParent(n(d,e),"LI");if(f&&f!=a){var s=t(d);return e?o(f,a):o(a,f),r(s),!0}if(!f&&!e&&g(a.parentNode.nodeName))return!0}}},e.addCommand("Indent",function(){return N()?void 0:!0}),e.addCommand("Outdent",function(){return h()?void 0:!0}),e.addCommand("InsertUnorderedList",function(){y("UL")}),e.addCommand("InsertOrderedList",function(){y("OL")})}),e.on("keydown",function(e){e.keyCode==tinymce.util.VK.BACKSPACE?n.backspaceDelete()&&e.preventDefault():e.keyCode==tinymce.util.VK.DELETE&&n.backspaceDelete(!0)&&e.preventDefault()})});
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("media",function(e,t){function n(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":-1!=e.indexOf(".swf")?"application/x-shockwave-flash":""}function i(){function t(e){var t,r,a,o;t=n.find("#width")[0],r=n.find("#height")[0],a=t.value(),o=r.value(),n.find("#constrain")[0].checked()&&i&&c&&a&&o&&(e.control==t?(o=Math.round(a/i*o),r.value(o)):(a=Math.round(o/c*a),t.value(a))),i=a,c=o}var n,i,c,l;l=s(e.selection.getNode()),i=l.width,c=l.height,n=e.windowManager.open({title:"Insert/edit video",data:l,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){this.fromJSON(o(this.next().find("#embed").value()))},items:[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source"},{name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"},{name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:t},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:t},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}]},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(a(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:"},{type:"textbox",flex:1,name:"embed",value:r(),multiline:!0,label:"Source"}]}],onSubmit:function(){e.insertContent(a(this.toJSON()))}})}function r(){var t=e.selection.getNode();return t.getAttribute("data-mce-object")?e.selection.getContent():void 0}function a(i){var r="";return i.source1||(tinymce.extend(i,o(i.embed)),i.source1)?(i.source1=e.convertURL(i.source1,"source"),i.source2=e.convertURL(i.source2,"source"),i.source1mime=n(i.source1),i.source2mime=n(i.source2),i.poster=e.convertURL(i.poster,"poster"),i.flashPlayerUrl=e.convertURL(t+"/moxieplayer.swf","movie"),i.embed?r=c(i.embed,i,!0):(tinymce.each(l,function(e){var t,n,r;if(t=e.regex.exec(i.source1)){for(r=e.url,n=0;t[n];n++)r=r.replace("$"+n,function(){return t[n]});i.source1=r,i.type=e.type,i.width=e.w,i.height=e.h}}),i.width=i.width||300,i.height=i.height||150,tinymce.each(i,function(t,n){i[n]=e.dom.encode(t)}),"iframe"==i.type?r+='<iframe src="'+i.source1+'" width="'+i.width+'" height="'+i.height+'"></iframe>':"application/x-shockwave-flash"==i.source1mime?(r+='<object data="'+i.source1+'" width="'+i.width+'" height="'+i.height+'" type="application/x-shockwave-flash">',i.poster&&(r+='<img src="'+i.poster+'" width="'+i.width+'" height="'+i.height+'" />'),r+="</object>"):-1!=i.source1mime.indexOf("audio")?e.settings.audio_template_callback?r=e.settings.audio_template_callback(i):r+='<audio controls="controls" src="'+i.source1+'">'+(i.source2?'\n<source src="'+i.source2+'"'+(i.source2mime?' type="'+i.source2mime+'"':"")+" />\n":"")+"</audio>":r=e.settings.video_template_callback?e.settings.video_template_callback(i):'<video width="'+i.width+'" height="'+i.height+'"'+(i.poster?' poster="'+i.poster+'"':"")+' controls="controls">\n'+'<source src="'+i.source1+'"'+(i.source1mime?' type="'+i.source1mime+'"':"")+" />\n"+(i.source2?'<source src="'+i.source2+'"'+(i.source2mime?' type="'+i.source2mime+'"':"")+" />\n":"")+"</video>"),r):""}function o(e){var t={};return new tinymce.html.SaxParser({validate:!1,special:"script,noscript",start:function(e,n){t.source1||"param"!=e||(t.source1=n.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t=tinymce.extend(n.map,t)),"source"==e&&(t.source1?t.source2||(t.source2=n.map.src):t.source1=n.map.src),"img"!=e||t.poster||(t.poster=n.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function s(t){return t.getAttribute("data-mce-object")?o(e.serializer.serialize(t,{selection:!0})):{}}function c(e,t,n){function i(e,t){var n,i,r,a;for(n in t)if(r=""+t[n],e.map[n])for(i=e.length;i--;)a=e[i],a.name==n&&(r?(e.map[n]=r,a.value=r):(delete e.map[n],e.splice(i,1)));else r&&(e.push({name:n,value:r}),e.map[n]=r)}var r,a=new tinymce.html.Writer,o=0;return new tinymce.html.SaxParser({validate:!1,special:"script,noscript",comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,s,c){switch(e){case"video":case"object":case"img":case"iframe":i(s,{width:t.width,height:t.height})}if(n)switch(e){case"video":i(s,{poster:t.poster,src:""}),t.source2&&i(s,{src:""});break;case"iframe":i(s,{src:t.source1});break;case"source":if(o++,2>=o&&(i(s,{src:t["source"+o],type:t["source"+o+"mime"]}),!t["source"+o]))return;break;case"img":if(!t.poster)return;r=!0}a.start(e,s,c)},end:function(e){if("video"==e&&n)for(var s=1;2>=s;s++)if(t["source"+s]){var c=[];c.map={},s>o&&(i(c,{src:t["source"+s],type:t["source"+s+"mime"]}),a.start("source",c,!0))}if(t.poster&&"object"==e&&n&&!r){var l=[];l.map={},i(l,{src:t.poster,width:t.width,height:t.height}),a.start("img",l,!0)}a.end(e)}},new tinymce.html.Schema({})).parse(e),a.getContent()}var l=[{regex:/youtu\.be\/([a-z1-9.-_]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"http://player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'http://maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.schema.addValidElements("object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]");var n=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){n[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed",function(t,n){for(var i,r,a,o,s,c,l,d=t.length;d--;){for(r=t[d],a=new tinymce.html.Node("img",1),a.shortEnded=!0,c=r.attributes,i=c.length;i--;)o=c[i].name,s=c[i].value,"width"!==o&&"height"!==o&&"style"!==o&&(("data"==o||"src"==o)&&(s=e.convertURL(s,o)),a.attr("data-mce-p-"+o,s));l=r.firstChild&&r.firstChild.value,l&&(a.attr("data-mce-html",escape(l)),a.firstChild=null),a.attr({width:r.attr("width")||"300",height:r.attr("height")||("audio"==n?"30":"150"),style:r.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":n,"class":"mce-object mce-object-"+n}),r.replace(a)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var n,i,r,a,o,s,c=e.length;c--;){for(n=e[c],i=new tinymce.html.Node(n.attr(t),1),"audio"!=n.attr(t)&&i.attr({width:n.attr("width"),height:n.attr("height")}),i.attr({style:n.attr("style")}),a=n.attributes,r=a.length;r--;){var l=a[r].name;0===l.indexOf("data-mce-p-")&&i.attr(l.substr(11),a[r].value)}o=n.attr("data-mce-html"),o&&(s=new tinymce.html.Node("#text",3),s.raw=!0,s.value=unescape(o),i.append(s)),n.replace(i)}})}),e.on("ObjectSelected",function(e){"audio"==e.target.getAttribute("data-mce-object")&&e.preventDefault()}),e.on("objectResized",function(e){var t,n=e.target;n.getAttribute("data-mce-object")&&(t=n.getAttribute("data-mce-html"),t&&(t=unescape(t),n.setAttribute("data-mce-html",escape(c(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:i,stateSelector:"img[data-mce-object=video]"}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:i,context:"insert",prependToContext:!0})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("nonbreaking",function(e){var t=e.getParam("nonbreaking_force_tab");if(e.addCommand("mceNonBreaking",function(){e.insertContent(e.plugins.visualchars&&e.plugins.visualchars.state?'<span data-mce-bogus="1" class="mce-nbsp"> </span>':" ")}),e.addButton("nonbreaking",{title:"Insert nonbreaking space",cmd:"mceNonBreaking"}),e.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),t){var n=+t>1?+t:3;e.on("keydown",function(t){if(9==t.keyCode){if(t.shiftKey)return;t.preventDefault();for(var i=0;n>i;i++)e.execCommand("mceNonBreaking")}})}});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("noneditable",function(e){function t(){function t(e){var t;if(1===e.nodeType){if(t=e.getAttribute(s),t&&"inherit"!==t)return t;if(t=e.contentEditable,"inherit"!==t)return t}return null}function n(e){for(var n;e;){if(n=t(e))return"false"===n?e:null;e=e.parentNode}}function i(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function o(e){var t;if(e)for(t=new r(e,e),e=t.current();e;e=t.next())if(3===e.nodeType)return e}function a(n,i){var o,a;return"false"===t(n)&&m.isBlock(n)?(f.select(n),void 0):(a=m.createRng(),"true"===t(n)&&(n.firstChild||n.appendChild(e.getDoc().createTextNode(" ")),n=n.firstChild,i=!0),o=m.create("span",{id:g,"data-mce-bogus":!0},p),i?n.parentNode.insertBefore(o,n):m.insertAfter(o,n),a.setStart(o.firstChild,1),a.collapse(!0),f.setRng(a),o)}function l(e){var t,n,a,r;if(e)t=f.getRng(!0),t.setStartBefore(e),t.setEndBefore(e),n=o(e),n&&n.nodeValue.charAt(0)==p&&(n=n.deleteData(0,1)),m.remove(e,!0),f.setRng(t);else for(a=i(f.getStart());(e=m.get(g))&&e!==r;)a!==e&&(n=o(e),n&&n.nodeValue.charAt(0)==p&&(n=n.deleteData(0,1)),m.remove(e,!0)),r=e}function d(){function e(e,n){var i,o,a,l,s;if(i=c.startContainer,o=c.startOffset,3==i.nodeType){if(s=i.nodeValue.length,o>0&&s>o||(n?o==s:0===o))return}else{if(!(o<i.childNodes.length))return n?null:e;var d=!n&&o>0?o-1:o;i=i.childNodes[d],i.hasChildNodes()&&(i=i.firstChild)}for(a=new r(i,e);l=a[n?"prev":"next"]();){if(3===l.nodeType&&l.nodeValue.length>0)return;if("true"===t(l))return l}return e}var i,o,s,c,d;l(),s=f.isCollapsed(),i=n(f.getStart()),o=n(f.getEnd()),(i||o)&&(c=f.getRng(!0),s?(i=i||o,(d=e(i,!0))?a(d,!0):(d=e(i,!1))?a(d,!1):f.select(i)):(c=f.getRng(!0),i&&c.setStartBefore(i),o&&c.setEndAfter(o),f.setRng(c)))}function u(o){function a(e,t){for(;e=e[t?"previousSibling":"nextSibling"];)if(3!==e.nodeType||e.nodeValue.length>0)return e}function s(e,t){f.select(e),f.collapse(t)}function u(o){function a(e){for(var t=s;t;){if(t===e)return;t=t.parentNode}m.remove(e),d()}function r(){var i,r,l=e.schema.getNonEmptyElements();for(r=new tinymce.dom.TreeWalker(s,e.getBody());(i=o?r.prev():r.next())&&!l[i.nodeName.toLowerCase()]&&!(3===i.nodeType&&tinymce.trim(i.nodeValue).length>0);)if("false"===t(i))return a(i),!0;return n(i)?!0:!1}var l,s,c,u;if(f.isCollapsed()){if(l=f.getRng(!0),s=l.startContainer,c=l.startOffset,s=i(s)||s,u=n(s))return a(u),!1;if(3==s.nodeType&&(o?c>0:c<s.nodeValue.length))return!0;if(1==s.nodeType&&(s=s.childNodes[c]||s),r())return!1}return!0}var g,p,h,y,v=o.keyCode;if(h=f.getStart(),y=f.getEnd(),g=n(h)||n(y),g&&(112>v||v>124)&&v!=c.DELETE&&v!=c.BACKSPACE){if((tinymce.isMac?o.metaKey:o.ctrlKey)&&(67==v||88==v||86==v))return;if(o.preventDefault(),v==c.LEFT||v==c.RIGHT){var b=v==c.LEFT;if(e.dom.isBlock(g)){var x=b?g.previousSibling:g.nextSibling,w=new r(x,x),C=b?w.prev():w.next();s(C,!b)}else s(g,b)}}else if(v==c.LEFT||v==c.RIGHT||v==c.BACKSPACE||v==c.DELETE){if(p=i(h)){if(v==c.LEFT||v==c.BACKSPACE)if(g=a(p,!0),g&&"false"===t(g)){if(o.preventDefault(),v!=c.LEFT)return m.remove(g),void 0;s(g,!0)}else l(p);if(v==c.RIGHT||v==c.DELETE)if(g=a(p),g&&"false"===t(g)){if(o.preventDefault(),v!=c.RIGHT)return m.remove(g),void 0;s(g,!1)}else l(p)}if((v==c.BACKSPACE||v==c.DELETE)&&!u(v==c.BACKSPACE))return o.preventDefault(),!1}}var m=e.dom,f=e.selection,g="mce_noneditablecaret",p="";e.on("mousedown",function(n){var i=e.selection.getNode();"false"===t(i)&&i==n.target&&d()}),e.on("mouseup keyup",d),e.on("keydown",u)}function n(t){var n=a.length,i=t.content,r=tinymce.trim(o);if("raw"!=t.format){for(;n--;)i=i.replace(a[n],function(t){var n=arguments,o=n[n.length-2];return o>0&&'"'==i.charAt(o-1)?t:'<span class="'+r+'" data-mce-content="'+e.dom.encode(n[0])+'">'+e.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"});t.content=i}}var i,o,a,r=tinymce.dom.TreeWalker,l="contenteditable",s="data-mce-"+l,c=tinymce.util.VK;i=" "+tinymce.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",o=" "+tinymce.trim(e.getParam("noneditable_noneditable_class","mceNonEditable"))+" ",a=e.getParam("noneditable_regexp"),a&&!a.length&&(a=[a]),e.on("PreInit",function(){t(),a&&e.on("BeforeSetContent",n),e.parser.addAttributeFilter("class",function(e){for(var t,n,a=e.length;a--;)n=e[a],t=" "+n.attr("class")+" ",-1!==t.indexOf(i)?n.attr(s,"true"):-1!==t.indexOf(o)&&n.attr(s,"false")}),e.serializer.addAttributeFilter(s,function(e){for(var t,n=e.length;n--;)t=e[n],a&&t.attr("data-mce-content")?(t.name="#text",t.type=3,t.raw=!0,t.value=t.attr("data-mce-content")):(t.attr(l,null),t.attr(s,null))}),e.parser.addAttributeFilter(l,function(e){for(var t,n=e.length;n--;)t=e[n],t.attr(s,t.attr(l)),t.attr(l,null)})})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("pagebreak",function(e){var t,n="mce-pagebreak",i=e.getParam("pagebreak_separator","<!-- pagebreak -->"),a='<img src="'+tinymce.Env.transparentSrc+'" class="'+n+'" data-mce-resize="false" />';t=new RegExp(i.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),e.addCommand("mcePageBreak",function(){e.execCommand("mceInsertContent",0,a)}),e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),e.on("ResolveName",function(t){"IMG"==t.target.nodeName&&e.dom.hasClass(t.target,n)&&(t.name="pagebreak")}),e.on("click",function(t){t=t.target,"IMG"===t.nodeName&&e.dom.hasClass(t,n)&&e.selection.select(t)}),e.on("BeforeSetContent",function(e){e.content=e.content.replace(t,a)}),e.on("PreInit",function(){e.serializer.addNodeFilter("img",function(e){for(var t,n,a=e.length;a--;)t=e[a],n=t.attr("class"),n&&-1!==n.indexOf("mce-pagebreak")&&(t.type=3,t.value=i,t.raw=!0)})})});
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/pasteplugin/Clipboard",c="tinymce/Env",u="tinymce/util/Tools",d="tinymce/util/VK",f="tinymce/pasteplugin/WordFilter",p="tinymce/html/DomParser",m="tinymce/html/Schema",h="tinymce/html/Serializer",g="tinymce/html/Node",v="tinymce/pasteplugin/Quirks",y="tinymce/pasteplugin/Plugin",b="tinymce/PluginManager";r(l,[c,u,d],function(e,t,n){function r(){return!e.gecko&&("ClipboardEvent"in window||e.webkit&&"FocusEvent"in window)}return function(i){function o(){return(new Date).getTime()}function a(e){return n.metaKeyPressed(e)&&86==e.keyCode||e.shiftKey&&45==e.keyCode}function s(e){return e.innerText||e.textContent}function l(){return o()-h<100||"text"==m.pasteFormat}function c(e,n){return t.each(n,function(t){e=t.constructor==RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}function u(t){var n=i.fire("PastePreProcess",{content:t});t=n.content,i.settings.paste_data_images||(t=t.replace(/<img src=\"data:image[^>]+>/g,"")),(i.settings.paste_remove_styles||i.settings.paste_remove_styles_if_webkit!==!1&&e.webkit)&&(t=t.replace(/ style=\"[^\"]+\"/g,"")),n.isDefaultPrevented()||i.insertContent(t)}function d(e){e=i.dom.encode(e).replace(/\r\n/g,"\n");var t=i.dom.getParent(i.selection.getStart(),i.dom.isBlock);e=t&&/^(PRE|DIV)$/.test(t.nodeName)||!i.settings.forced_root_block?c(e,[[/\n/g,"<br>"]]):c(e,[[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]]);var n=i.fire("PastePreProcess",{content:e});n.isDefaultPrevented()||i.insertContent(n.content)}function f(){var e=i.dom.getViewPort().y,t=i.dom.add(i.getBody(),"div",{contentEditable:!1,"data-mce-bogus":"1",style:"position: absolute; top: "+e+"px; left: 0; width: 1px; height: 1px; overflow: hidden"},'<div contentEditable="true" data-mce-bogus="1">X</div>');return i.dom.bind(t,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),t}function p(e){i.dom.unbind(e),i.dom.remove(e)}var m=this,h;if(i.on("keydown",function(e){n.metaKeyPressed(e)&&e.shiftKey&&86==e.keyCode&&(h=o())}),r())i.on("paste",function(e){function t(e,t){for(var r=0;r<n.types.length;r++)if(n.types[r]==e)return t(n.getData(e)),!0}var n=e.clipboardData;n&&(e.preventDefault(),l()?t("text/plain",d)||t("text/html",u):t("text/html",u)||t("text/plain",d))});else{if(e.ie){var g=0;i.on("keydown",function(e){if(a(e)&&!e.isDefaultPrevented()){e.stopImmediatePropagation();var t=f();g=o(),i.dom.bind(t,"paste",function(){setTimeout(function(){i.selection.setRng(n),p(t),l()?d(s(t.firstChild)):u(t.firstChild.innerHTML)},0)});var n=i.selection.getRng();t.firstChild.focus(),t.firstChild.innerText=""}}),i.on("init",function(){var e=i.dom;i.dom.bind(i.getBody(),"paste",function(t){if(o()-g>100){var n,r=f();t.preventDefault(),e.bind(r,"paste",function(e){e.stopPropagation(),n=!0});var a=i.selection.getRng(),c=e.doc.body.createTextRange();if(c.moveToElementText(r.firstChild),c.execCommand("Paste"),p(r),!n)return i.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."),void 0;i.selection.setRng(a),l()?d(s(r.firstChild)):u(r.firstChild.innerHTML)}})})}else i.on("init",function(){i.dom.bind(i.getBody(),"paste",function(e){var t=i.getDoc();return e.preventDefault(),e.clipboardData||t.dataTransfer?(d((e.clipboardData||t.dataTransfer).getData("Text")),void 0):(e.preventDefault(),i.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."),void 0)})}),i.on("keydown",function(t){if(a(t)&&!t.isDefaultPrevented()){t.stopImmediatePropagation();var n=f(),r=i.selection.getRng();e.webkit&&i.inline&&(n.contentEditable=!0),i.selection.select(n,!0),i.dom.bind(n,"paste",function(e){e.stopPropagation(),setTimeout(function(){p(n),i.lastRng=r,i.selection.setRng(r);var e=n.firstChild;e.lastChild&&"BR"==e.lastChild.nodeName&&e.removeChild(e.lastChild),l()?d(s(e)):u(e.innerHTML)},0)})}});i.settings.paste_data_images||i.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()})}i.paste_block_drop&&i.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),this.paste=u,this.pasteText=d}}),r(f,[u,p,m,h,g],function(e,t,n,r,i){return function(o){var a=e.each;o.on("PastePreProcess",function(s){function l(e){a(e,function(e){d=e.constructor==RegExp?d.replace(e,""):d.replace(e[0],e[1])})}function c(e){function t(e,t,a,s){var l=e._listLevel||o;l!=o&&(o>l?n&&(n=n.parent.parent):(r=n,n=null)),n&&n.name==a?n.append(e):(r=r||n,n=new i(a,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>o&&r&&r.lastChild.append(n),o=l}for(var n,r,o=1,a=e.getAll("p"),s=0;s<a.length;s++)if(e=a[s],"p"==e.name&&e.firstChild){for(var l="",c=e.firstChild;c&&!(l=c.value);)c=c.firstChild;if(/^\s*[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*$/.test(l)){t(e,c,"ul");continue}if(/^\s*\w+\./.test(l)){var u=/([0-9])\./.exec(l),d=1;u&&(d=parseInt(u[1],10)),t(e,c,"ol",d);continue}n=null}}function u(t,n){if("p"===t.name){var r=/mso-list:\w+ \w+([0-9]+)/.exec(n);r&&(t._listLevel=parseInt(r[1],10))}if(o.getParam("paste_retain_style_properties","none")){var i="";if(e.each(o.dom.parseStyle(n),function(e,t){switch(t){case"horiz-align":return t="text-align",void 0;case"vert-align":return t="vertical-align",void 0;case"font-color":case"mso-foreground":return t="color",void 0;case"mso-background":case"mso-highlight":t="background"}("all"==f||p&&p[t])&&(i+=t+":"+e+";")}),i)return i}return null}var d=s.content,f,p;if(f=o.settings.paste_retain_style_properties,f&&(p=e.makeMap(f)),o.settings.paste_enable_default_filters!==!1&&/class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(s.content)){s.wordContent=!0,l([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var m=new n({valid_elements:"@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[!href],sub,sup,strike"}),h=new t({},m);h.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",u(n,n.attr("style"))),"span"!=n.name||n.attributes.length||n.unwrap()});var g=h.parse(d);c(g),s.content=new r({},m).serialize(g)}})}}),r(v,[c,u],function(e,t){return function(n){function r(e){n.on("PastePreProcess",function(t){t.content=e(t.content)})}function i(e,n){return t.each(n,function(t){e=t.constructor==RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}function o(e){return e=i(e,[/^[\s\S]*<!--StartFragment-->|<!--EndFragment-->[\s\S]*$/g,[/<span class="Apple-converted-space">\u00a0<\/span>/g,"\xa0"],/<br>$/])}function a(e){if(!s){var r=[];t.each(n.schema.getBlockElements(),function(e,t){r.push(t)}),s=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+r.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g")}return e=i(e,[[s,"$1"]]),e=i(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}var s;e.webkit&&r(o),e.ie&&r(a)}}),r(y,[b,l,f,v],function(e,t,n,r){var i;e.add("paste",function(e){function o(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),i||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),i=!0))}var a=this,s;a.clipboard=s=new t(e),a.quirks=new r(e),a.wordFilter=new n(e),e.settings.paste_as_text&&(a.clipboard.pasteFormat="text"),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&a.clipboard.paste(t.content),t.text&&a.clipboard.pasteText(t.text)}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:o,active:"text"==a.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:o})})}),a([l,f,v,y])}(this);
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("preview",function(e){var t=e.settings;e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"></iframe>',buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var n,i=this.getEl("body").firstChild.contentWindow.document,a="";tinymce.each(e.contentCSS,function(t){a+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'});var r=t.body_id||"tinymce";-1!=r.indexOf("=")&&(r=e.getParam("body_id","","hash"),r=r[e.id]||r);var o=t.body_class||"";-1!=o.indexOf("=")&&(o=e.getParam("body_class","","hash"),o=o[e.id]||""),n="<!DOCTYPE html><html><head>"+a+"</head>"+'<body id="'+r+'" class="mce-content-body '+o+'">'+e.getContent()+"</body>"+"</html>",i.open(),i.write(n),i.close()}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("print",function(t){t.addCommand("mcePrint",function(){t.getWin().print()}),t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addShortcut("Ctrl+P","","mcePrint"),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Ctrl+P",context:"file"})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("save",function(e){function t(){var t,n;return t=tinymce.DOM.getParent(e.id,"form"),!e.getParam("save_enablewhendirty",!0)||e.isDirty()?(tinymce.triggerSave(),(n=e.getParam("save_onsavecallback"))?(e.execCallback("save_onsavecallback",e)&&(e.startContent=tinymce.trim(e.getContent({format:"raw"})),e.nodeChanged()),void 0):(t?(e.isNotDirty=!0,(!t.onsubmit||t.onsubmit())&&("function"==typeof t.submit?t.submit():e.windowManager.alert("Error: Form submit field collision.")),e.nodeChanged()):e.windowManager.alert("Error: No form element found."),void 0)):void 0}function n(){var t,n=tinymce.trim(e.startContent);return(t=e.getParam("save_oncancelcallback"))?(e.execCallback("save_oncancelcallback",e),void 0):(e.setContent(n),e.undoManager.clear(),e.nodeChanged(),void 0)}function i(){var t=this;e.on("nodeChange",function(){t.disabled(e.getParam("save_enablewhendirty",!0)&&!e.isDirty())})}e.addCommand("mceSave",t),e.addCommand("mceCancel",n),e.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:i}),e.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:i}),e.addShortcut("ctrl+s","","mceSave")});
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(){function e(e,t,n,i,a){function r(e,t){if(t=t||0,!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var n=e.index;if(t>0){var i=e[t];if(!i)throw"Invalid capture group";n+=e[0].indexOf(i),e[0]=i}return[n,n+e[0].length,[e[0]]]}function o(e){var t;if(3===e.nodeType)return e.data;if(f[e.nodeName])return"";if(t="",(m[e.nodeName]||h[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=o(e);while(e=e.nextSibling);return t}function c(e,t,n){var i,a,r,o,c=[],s=0,d=e,l=t.shift(),u=0;e:for(;;){if((m[d.nodeName]||h[d.nodeName])&&s++,3===d.nodeType&&(!a&&d.length+s>=l[1]?(a=d,o=l[1]-s):i&&c.push(d),!i&&d.length+s>l[0]&&(i=d,r=l[0]-s),s+=d.length),i&&a){if(d=n({startNode:i,startNodeIndex:r,endNode:a,endNodeIndex:o,innerNodes:c,match:l[2],matchIndex:u}),s-=a.length-o,i=null,a=null,c=[],l=t.shift(),u++,!l)break}else{if(!f[d.nodeName]&&d.firstChild){d=d.firstChild;continue}if(d.nextSibling){d=d.nextSibling;continue}}for(;;){if(d.nextSibling){d=d.nextSibling;break}if(d.parentNode===e)break e;d=d.parentNode}}}function s(e){var t;if("function"!=typeof e){var n=e.nodeType?e:u.createElement(e);t=function(e,t){var i=n.cloneNode(!1);return i.setAttribute("data-mce-index",t),e&&i.appendChild(u.createTextNode(e)),i}}else t=e;return function(e){var n,i,a,r=e.startNode,o=e.endNode,c=e.matchIndex;if(r===o){var s=r;a=s.parentNode,e.startNodeIndex>0&&(n=u.createTextNode(s.data.substring(0,e.startNodeIndex)),a.insertBefore(n,s));var d=t(e.match[0],c);return a.insertBefore(d,s),e.endNodeIndex<s.length&&(i=u.createTextNode(s.data.substring(e.endNodeIndex)),a.insertBefore(i,s)),s.parentNode.removeChild(s),d}n=u.createTextNode(r.data.substring(0,e.startNodeIndex)),i=u.createTextNode(o.data.substring(e.endNodeIndex));for(var l=t(r.data.substring(e.startNodeIndex),c),m=[],f=0,h=e.innerNodes.length;h>f;++f){var p=e.innerNodes[f],g=t(p.data,c);p.parentNode.replaceChild(g,p),m.push(g)}var v=t(o.data.substring(0,e.endNodeIndex),c);return a=r.parentNode,a.insertBefore(n,r),a.insertBefore(l,r),a.removeChild(r),a=o.parentNode,a.insertBefore(v,o),a.insertBefore(i,o),a.removeChild(o),v}}var d,l,u,m,f,h,p=[],g=0;if(u=t.ownerDocument,m=a.getBlockElements(),f=a.getWhiteSpaceElements(),h=a.getShortEndedElements(),l=o(t)){if(e.global)for(;d=e.exec(l);)p.push(r(d,i));else d=l.match(e),p.push(r(d,i));return p.length&&(g=p.length,c(t,p,s(n))),g}}function t(t){function n(){var e=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){t.focus(),o=!1,c.unmarkAllMatches()},buttons:[{text:"Find",onclick:function(){e.find("form")[0].submit()}},{text:"Replace",disabled:!0,onclick:function(){c.replace(e.find("#replace").value())||e.statusbar.items().slice(1).disabled(!0)}},{text:"Replace all",disabled:!0,onclick:function(){c.replaceAll(e.find("#replace").value()),e.statusbar.items().slice(1).disabled(!0)}},{type:"spacer",flex:1},{text:"Prev",disabled:!0,onclick:function(){c.prev()}},{text:"Next",disabled:!0,onclick:function(){c.next()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,onsubmit:function(t){var n,i,a,r,o;return t.preventDefault(),a=e.find("#case").checked(),o=e.find("#words").checked(),r=e.find("#find").value(),r.length?(r=r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),r=o?"\\b"+r+"\\b":r,i=new RegExp(r,a?"g":"gi"),n=c.markAllMatches(i),n?c.first():tinymce.ui.MessageBox.alert("Could not find the specified string."),e.statusbar.items().slice(1).disabled(0===n),void 0):(c.unmarkAllMatches(),e.statusbar.items().slice(1).disabled(!0),void 0)},items:[{type:"textbox",name:"find",size:40,label:"Find",value:t.selection.getNode().src},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}}).renderTo().reflow();o=!0}function i(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function a(e,n){function i(){var i,o;for(i=n?t.getBody()[e?"firstChild":"lastChild"]:c[e?"endContainer":"startContainer"],o=new tinymce.dom.TreeWalker(i,t.getBody());i=o.current();){if(1==i.nodeType&&"SPAN"==i.nodeName&&null!==i.getAttribute("data-mce-index"))for(s=i.getAttribute("data-mce-index"),a=i.firstChild;i=o.current();){if(1==i.nodeType&&"SPAN"==i.nodeName&&null!==i.getAttribute("data-mce-index")){if(i.getAttribute("data-mce-index")!==s)return;r=i.firstChild}o[e?"next":"prev"]()}o[e?"next":"prev"]()}}var a,r,o=t.selection,c=o.getRng(!0),s=-1;return e=e!==!1,i(),a&&r&&(t.focus(),e?(c.setStart(a,0),c.setEnd(r,r.length)):(c.setStart(r,0),c.setEnd(a,a.length)),o.scrollIntoView(a.parentNode),o.setRng(c)),s}function r(e){e.parentNode.removeChild(e)}var o,c=this,s=-1;c.init=function(e){e.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Ctrl+F",onclick:n,separator:"before",context:"edit"}),e.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Ctrl+F",onclick:n}),e.addCommand("SearchReplace",n),e.shortcuts.add("Ctrl+F","",n)},c.markAllMatches=function(n){var i,a;return a=t.dom.create("span",{"class":"mce-match-marker","data-mce-bogus":1}),i=t.getBody(),c.unmarkAllMatches(i),e(n,i,a,!1,t.schema)},c.first=function(){return s=a(!0,!0),-1!==s},c.next=function(){return s=a(!0),-1!==s},c.prev=function(){return s=a(!1),-1!==s},c.replace=function(e,n,o){var c,d,l,u,m,f;if(-1===s&&(s=a(n)),f=a(n),l=t.getBody(),d=tinymce.toArray(l.getElementsByTagName("span")),d.length)for(c=0;c<d.length;c++){var h=d[c].getAttribute("data-mce-index");if(null!==h&&h.length&&(u=m=d[c].getAttribute("data-mce-index"),o||u===s))for(e.length?(d[c].firstChild.nodeValue=e,i(d[c])):r(d[c]);d[++c];)if(u=d[c].getAttribute("data-mce-index"),null!==h&&h.length){if(u!==m){c--;break}r(d[c])}}return-1==f&&(f=a(n,!0)),s=f,o&&t.selection.setCursorLocation(t.getBody(),0),t.undoManager.add(),-1!==s},c.replaceAll=function(e){c.replace(e,!0,!0)},c.unmarkAllMatches=function(){var e,n,a;for(a=t.getBody(),n=a.getElementsByTagName("span"),e=n.length;e--;)a=n[e],a.getAttribute("data-mce-index")&&i(a)},t.on("beforeaddundo keydown",function(e){return o?(e.preventDefault(),!1):void 0})}tinymce.PluginManager.add("searchreplace",t)}();
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e,t){"use strict";function n(e,t){for(var n,r=[],o=0;o<e.length;++o){if(n=s[e[o]]||i(e[o]),!n)throw"module definition dependecy not found: "+e[o];r.push(n)}t.apply(null,r)}function r(e,r,o){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(o===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=o.apply(null,arguments)})}function o(e){return!!s[e]}function i(t){for(var n=e,r=t.split(/[.\/]/),o=0;o<r.length;++o){if(!n[r[o]])return;n=n[r[o]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var o=e,i=n[r],a=i.split(/[.\/]/),l=0;l<a.length-1;++l)o[a[l]]===t&&(o[a[l]]={}),o=o[a[l]];o[a[a.length-1]]=s[i]}}var s={},l="tinymce/spellcheckerplugin/DomTextMatcher",c="tinymce/spellcheckerplugin/Plugin",d="tinymce/PluginManager",u="tinymce/util/Tools",f="tinymce/ui/Menu",p="tinymce/dom/DOMUtils",m="tinymce/util/JSONRequest",h="tinymce/util/URI";r(l,[],function(){return function(e,t,n){function r(e){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var t=e.index;return[t,t+e[0].length,[e[0]]]}function o(e){var t;if(3===e.nodeType)return e.data;if(g[e.nodeName])return"";if(t="",(h[e.nodeName]||v[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=o(e);while(e=e.nextSibling);return t}function i(e,t,n){var r,o,i,a,s=[],l=0,c=e,d=t.shift(),u=0;e:for(;;){if((h[c.nodeName]||v[c.nodeName])&&l++,3===c.nodeType&&(!o&&c.length+l>=d[1]?(o=c,a=d[1]-l):r&&s.push(c),!r&&c.length+l>d[0]&&(r=c,i=d[0]-l),l+=c.length),r&&o){if(c=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:s,match:d[2],matchIndex:u}),l-=o.length-a,r=null,o=null,s=[],d=t.shift(),u++,!d)break}else{if(!g[c.nodeName]&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function a(e){var t;if("function"!=typeof e){var n=e.nodeType?e:m.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(m.createTextNode(e)),r}}else t=e;return function r(e){var n,r,o,i=e.startNode,a=e.endNode,s=e.matchIndex;if(i===a){var l=i;o=l.parentNode,e.startNodeIndex>0&&(n=m.createTextNode(l.data.substring(0,e.startNodeIndex)),o.insertBefore(n,l));var c=t(e.match[0],s);return o.insertBefore(c,l),e.endNodeIndex<l.length&&(r=m.createTextNode(l.data.substring(e.endNodeIndex)),o.insertBefore(r,l)),l.parentNode.removeChild(l),c}n=m.createTextNode(i.data.substring(0,e.startNodeIndex)),r=m.createTextNode(a.data.substring(e.endNodeIndex));for(var d=t(i.data.substring(e.startNodeIndex),s),u=[],f=0,p=e.innerNodes.length;p>f;++f){var h=e.innerNodes[f],g=t(h.data,s);h.parentNode.replaceChild(g,h),u.push(g)}var v=t(a.data.substring(0,e.endNodeIndex),s);return o=i.parentNode,o.insertBefore(n,i),o.insertBefore(d,i),o.removeChild(i),o=a.parentNode,o.insertBefore(v,a),o.insertBefore(r,a),o.removeChild(a),v}}function s(e){var t=[];return l(function(n,r){e(n,r)&&t.push(n)}),u=t,this}function l(e){for(var t=0,n=u.length;n>t&&e(u[t],t)!==!1;t++);return this}function c(e){return u.length&&(p=u.length,i(t,u,a(e))),this}var d,u=[],f,p=0,m,h,g,v;if(m=t.ownerDocument,h=n.getBlockElements(),g=n.getWhiteSpaceElements(),v=n.getShortEndedElements(),f=o(t),f&&e.global)for(;d=e.exec(f);)u.push(r(d));return{text:f,count:p,matches:u,each:l,filter:s,mark:c}}}),r(c,[l,d,u,f,p,m,h],function(e,t,n,r,o,i,a){t.add("spellchecker",function(t,s){function l(e){for(var t in e)return!1;return!0}function c(e,i){var a=[],s=g[i];n.each(s,function(e){a.push({text:e,onclick:function(){t.insertContent(e),u()}})}),a.push.apply(a,[{text:"-"},{text:"Ignore",onclick:function(){p(e,i)}},{text:"Ignore all",onclick:function(){p(e,i,!0)}},{text:"Finish",onclick:m}]),y=new r({items:a,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){y.remove(),y=null}}),y.renderTo(document.body);var l=o.DOM.getPos(t.getContentAreaContainer()),c=t.dom.getPos(e);l.x+=c.x,l.y+=c.y,y.moveTo(l.x,l.y+e.offsetHeight)}function d(){function n(e){return t.setProgressState(!1),l(e)?(t.windowManager.alert("No misspellings found"),v=!1,void 0):(g=e,o.filter(function(t){return!!e[t[2][0]]}).mark(t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1})),o=null,t.fire("SpellcheckStart"),void 0)}function r(e,n,r){i.sendRPC({url:new a(s).toAbsolute(b.spellchecker_rpc_url),method:e,params:{lang:b.spellchecker_language||"en",words:n},success:function(e){r(e)},error:function(e,n){e="JSON Parse error."==e?"Non JSON response:"+n.responseText:"Error: "+e,t.windowManager.alert(e),t.setProgressState(!1),o=null,v=!1}})}var o,c=[],d={};if(v)return m(),void 0;v=!0;var u=t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e]+',"g");o=new e(u,t.getBody(),t.schema).each(function(e){var t=e[2][0];if(!d[t]){if(/^\d+$/.test(t)||1==t.length)return;c.push(t),d[t]=!0}}),t.setProgressState(!0);var f=b.spellchecker_callback||r;f("spellcheck",c,n)}function u(){t.dom.select("span.mce-spellchecker-word").length||m()}function f(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function p(e,r,o){o?n.each(t.dom.select("span.mce-spellchecker-word"),function(e){var t=e.innerText||e.textContent;t==r&&f(e)}):f(e),u()}function m(){var e,n,r;for(v=!1,r=t.getBody(),n=r.getElementsByTagName("span"),e=n.length;e--;)r=n[e],r.getAttribute("data-mce-index")&&f(r);t.fire("SpellcheckEnd")}function h(e){var n,r,o,i=-1,a,s;for(e=""+e,n=t.getBody().getElementsByTagName("span"),r=0;r<n.length&&(o=n[r],"mce-spellchecker-word"!=o.className||(i=o.getAttribute("data-mce-index"),i===e&&(i=e,a||(a=o.firstChild),s=o.firstChild),i===e||!s));r++);var l=t.dom.createRng();return l.setStart(a,0),l.setEnd(s,s.length),t.selection.setRng(l),l}var g,v,y,b=t.settings;t.on("click",function(e){if("mce-spellchecker-word"==e.target.className){e.preventDefault();var t=h(e.target.getAttribute("data-mce-index"));c(e.target,t.toString())}}),t.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:d,selectable:!0,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(v)})}}),t.addButton("spellchecker",{tooltip:"Spellcheck",onclick:d,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(v)})}}),t.on("remove",function(){y&&(y.remove(),y=null)})})}),a([l,c])}(this);
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("tabfocus",function(e){function n(e){9===e.keyCode&&e.preventDefault()}function t(n){function t(n){function t(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&t(e.parentNode)}function r(e){return e.tabIndex||"INPUT"==e.nodeName||"TEXTAREA"==e.nodeName}function a(e){return!r(e)&&"-1"!=e.getAttribute("tabindex")&&t(e)}if(d=i.select(":input:enabled,*[tabindex]:not(iframe)"),o(d,function(n,t){return n.id==e.id?(u=t,!1):void 0}),n>0){for(c=u+1;c<d.length;c++)if(a(d[c]))return d[c]}else for(c=u-1;c>=0;c--)if(a(d[c]))return d[c];return null}var u,d,a,c;if(9===n.keyCode&&(a=r(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==a.length&&(a[1]=a[0],a[0]=":prev"),d=n.shiftKey?":prev"==a[0]?t(-1):i.get(a[0]):":next"==a[1]?t(1):i.get(a[1]))){var f=tinymce.get(d.id||d.name);d.id&&f?f.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),d.focus()},10),n.preventDefault()}}var i=tinymce.DOM,o=tinymce.each,r=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null)}),e.on("keyup",n),tinymce.Env.gecko?e.on("keypress keydown",t):e.on("keydown",t)});
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e,t){"use strict";function n(e,t){for(var n,o=[],i=0;i<e.length;++i){if(n=a[e[i]]||r(e[i]),!n)throw"module definition dependecy not found: "+e[i];o.push(n)}t.apply(null,o)}function o(e,o,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(o===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(o,function(){a[e]=i.apply(null,arguments)})}function i(e){return!!a[e]}function r(t){for(var n=e,o=t.split(/[.\/]/),i=0;i<o.length;++i){if(!n[o[i]])return;n=n[o[i]]}return n}function l(n){for(var o=0;o<n.length;o++){for(var i=e,r=n[o],l=r.split(/[.\/]/),s=0;s<l.length-1;++s)i[l[s]]===t&&(i[l[s]]={}),i=i[l[s]];i[l[l.length-1]]=a[r]}}var a={},s="tinymce/tableplugin/TableGrid",c="tinymce/util/Tools",d="tinymce/Env",u="tinymce/tableplugin/Quirks",m="tinymce/util/VK",f="tinymce/tableplugin/CellSelection",h="tinymce/dom/TreeWalker",p="tinymce/tableplugin/Plugin",g="tinymce/PluginManager";o(s,[c,d],function(e,t){function n(e,t){return parseInt(e.getAttribute(t)||1,10)}var o=e.each;return function(i,r){function l(){var e=0;k=[],o(["thead","tbody","tfoot"],function(t){var i=_.select("> "+t+" tr",r);o(i,function(i,r){r+=e,o(_.select("> td, > th",i),function(e,o){var i,l,a,s;if(k[r])for(;k[r][o];)o++;for(a=n(e,"rowspan"),s=n(e,"colspan"),l=r;r+a>l;l++)for(k[l]||(k[l]=[]),i=o;o+s>i;i++)k[l][i]={part:t,real:l==r&&i==o,elm:e,rowspan:a,colspan:s}})}),e+=i.length})}function a(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function s(e,t){var n;return n=k[t],n?n[e]:void 0}function c(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function d(e){return e&&(_.hasClass(e.elm,"mce-item-selected")||e==I)}function u(){var e=[];return o(r.rows,function(t){o(t.cells,function(n){return _.hasClass(n,"mce-item-selected")||n==I.elm?(e.push(t),!1):void 0})}),e}function m(){var e=_.createRng();e.setStartAfter(r),e.setEndAfter(r),D.setRng(e),_.remove(r)}function f(n){var r,l={};return i.settings.table_clone_elements!==!1&&(l=e.makeMap((i.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),e.walk(n,function(e){var i;return 3==e.nodeType?(o(_.getParents(e.parentNode,null,n).reverse(),function(e){l[e.nodeName]&&(e=a(e,!1),r?i&&i.appendChild(e):r=i=e,i=e)}),i&&(i.innerHTML=t.ie?" ":'<br data-mce-bogus="1" />'),!1):void 0},"childNodes"),n=a(n,!1),c(n,"rowSpan",1),c(n,"colSpan",1),r?n.appendChild(r):t.ie||(n.innerHTML='<br data-mce-bogus="1" />'),n}function h(){var e=_.createRng(),t;return o(_.select("tr",r),function(e){0===e.cells.length&&_.remove(e)}),0===_.select("tr",r).length?(e.setStartBefore(r),e.setEndBefore(r),D.setRng(e),_.remove(r),void 0):(o(_.select("thead,tbody,tfoot",r),function(e){0===e.rows.length&&_.remove(e)}),l(),t=k[Math.min(k.length-1,B.y)],t&&(D.select(t[Math.min(t.length-1,B.x)].elm,!0),D.collapse(!0)),void 0)}function p(e,t,n,o){var i,r,l,a,s;for(i=k[t][e].elm.parentNode,l=1;n>=l;l++)if(i=_.getNext(i,"tr")){for(r=e;r>=0;r--)if(s=k[t+l][r].elm,s.parentNode==i){for(a=1;o>=a;a++)_.insertAfter(f(s),s);break}if(-1==r)for(a=1;o>=a;a++)i.insertBefore(f(i.cells[0]),i.cells[0])}}function g(){o(k,function(e,t){o(e,function(e,o){var i,r,l;if(d(e)&&(e=e.elm,i=n(e,"colspan"),r=n(e,"rowspan"),i>1||r>1)){for(c(e,"rowSpan",1),c(e,"colSpan",1),l=0;i-1>l;l++)_.insertAfter(f(e),e);p(o,t,r-1,i)}})})}function b(t,n,i){var r,a,u,m,f,p,b,v,y,w,x;if(t?(r=T(t),a=r.x,u=r.y,m=a+(n-1),f=u+(i-1)):(B=M=null,o(k,function(e,t){o(e,function(e,n){d(e)&&(B||(B={x:n,y:t}),M={x:n,y:t})})}),a=B.x,u=B.y,m=M.x,f=M.y),v=s(a,u),y=s(m,f),v&&y&&v.part==y.part){for(g(),l(),v=s(a,u).elm,c(v,"colSpan",m-a+1),c(v,"rowSpan",f-u+1),b=u;f>=b;b++)for(p=a;m>=p;p++)k[b]&&k[b][p]&&(t=k[b][p].elm,t!=v&&(w=e.grep(t.childNodes),o(w,function(e){v.appendChild(e)}),w.length&&(w=e.grep(v.childNodes),x=0,o(w,function(e){"BR"==e.nodeName&&_.getAttrib(e,"data-mce-bogus")&&x++<w.length-1&&v.removeChild(e)})),_.remove(t)));h()}}function v(e){var t,i,r,l,s,u,m,h,p;for(o(k,function(n,i){return o(n,function(n){return d(n)&&(n=n.elm,s=n.parentNode,u=a(s,!1),t=i,e)?!1:void 0}),e?!t:void 0}),l=0;l<k[0].length;l++)if(k[t][l]&&(i=k[t][l].elm,i!=r)){if(e){if(t>0&&k[t-1][l]&&(h=k[t-1][l].elm,p=n(h,"rowSpan"),p>1)){c(h,"rowSpan",p+1);continue}}else if(p=n(i,"rowspan"),p>1){c(i,"rowSpan",p+1);continue}m=f(i),c(m,"colSpan",i.colSpan),u.appendChild(m),r=i}u.hasChildNodes()&&(e?s.parentNode.insertBefore(u,s):_.insertAfter(u,s))}function y(e){var t,i;o(k,function(n){return o(n,function(n,o){return d(n)&&(t=o,e)?!1:void 0}),e?!t:void 0}),o(k,function(o,r){var l,a,s;o[t]&&(l=o[t].elm,l!=i&&(s=n(l,"colspan"),a=n(l,"rowspan"),1==s?e?(l.parentNode.insertBefore(f(l),l),p(t,r,a-1,s)):(_.insertAfter(f(l),l),p(t,r,a-1,s)):c(l,"colSpan",l.colSpan+1),i=l))})}function w(){var t=[];o(k,function(i){o(i,function(i,r){d(i)&&-1===e.inArray(t,r)&&(o(k,function(e){var t=e[r].elm,o;o=n(t,"colSpan"),o>1?c(t,"colSpan",o-1):_.remove(t)}),t.push(r))})}),h()}function x(){function e(e){var t,i,r;t=_.getNext(e,"tr"),o(e.cells,function(e){var t=n(e,"rowSpan");t>1&&(c(e,"rowSpan",t-1),i=T(e),p(i.x,i.y,1,1))}),i=T(e.cells[0]),o(k[i.y],function(e){var t;e=e.elm,e!=r&&(t=n(e,"rowSpan"),1>=t?_.remove(e):c(e,"rowSpan",t-1),r=e)})}var t;t=u(),o(t.reverse(),function(t){e(t)}),h()}function C(){var e=u();return _.remove(e),h(),e}function S(){var e=u();return o(e,function(t,n){e[n]=a(t,!0)}),e}function R(e,t){var n=u(),i=n[t?0:n.length-1],r=i.cells.length;e&&(o(k,function(e){var t;return r=0,o(e,function(e){e.real&&(r+=e.colspan),e.elm.parentNode==i&&(t=1)}),t?!1:void 0}),t||e.reverse(),o(e,function(e){var n,o=e.cells.length,l;for(n=0;o>n;n++)l=e.cells[n],c(l,"colSpan",1),c(l,"rowSpan",1);for(n=o;r>n;n++)e.appendChild(f(e.cells[o-1]));for(n=r;o>n;n++)_.remove(e.cells[n]);t?i.parentNode.insertBefore(e,i):_.insertAfter(e,i)}),_.removeClass(_.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function T(e){var t;return o(k,function(n,i){return o(n,function(n,o){return n.elm==e?(t={x:o,y:i},!1):void 0}),!t}),t}function N(e){B=T(e)}function P(){var e,t;return e=t=0,o(k,function(n,i){o(n,function(n,o){var r,l;d(n)&&(n=k[i][o],o>e&&(e=o),i>t&&(t=i),n.real&&(r=n.colspan-1,l=n.rowspan-1,r&&o+r>e&&(e=o+r),l&&i+l>t&&(t=i+l)))})}),{x:e,y:t}}function A(e){var t,n,o,i,r,l,a,s,c,d;if(M=T(e),B&&M){for(t=Math.min(B.x,M.x),n=Math.min(B.y,M.y),o=Math.max(B.x,M.x),i=Math.max(B.y,M.y),r=o,l=i,d=n;l>=d;d++)e=k[d][t],e.real||t-(e.colspan-1)<t&&(t-=e.colspan-1);for(c=t;r>=c;c++)e=k[n][c],e.real||n-(e.rowspan-1)<n&&(n-=e.rowspan-1);for(d=n;i>=d;d++)for(c=t;o>=c;c++)e=k[d][c],e.real&&(a=e.colspan-1,s=e.rowspan-1,a&&c+a>r&&(r=c+a),s&&d+s>l&&(l=d+s));for(_.removeClass(_.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=n;l>=d;d++)for(c=t;r>=c;c++)k[d][c]&&_.addClass(k[d][c].elm,"mce-item-selected")}}var k,B,M,I,D=i.selection,_=D.dom;r=r||_.getParent(D.getStart(),"table"),l(),I=_.getParent(D.getStart(),"th,td"),I&&(B=T(I),M=P(),I=s(B.x,B.y)),e.extend(this,{deleteTable:m,split:g,merge:b,insertRow:v,insertCol:y,deleteCols:w,deleteRows:x,cutRows:C,copyRows:S,pasteRows:R,getPos:T,setStartCell:N,setEndCell:A})}}),o(u,[m,d,c],function(e,t,n){function o(e,t){return parseInt(e.getAttribute(t)||1,10)}var i=n.each;return function(n){function r(){function t(t){function r(e,o){var i=e?"previousSibling":"nextSibling",r=n.dom.getParent(o,"tr"),a=r[i];if(a)return g(n,o,a,e),t.preventDefault(),!0;var d=n.dom.getParent(r,"table"),u=r.parentNode,m=u.nodeName.toLowerCase();if("tbody"===m||m===(e?"tfoot":"thead")){var f=l(e,d,u,"tbody");if(null!==f)return s(e,f,o)}return c(e,r,i,d)}function l(e,t,o,i){var r=n.dom.select(">"+i,t),l=r.indexOf(o);if(e&&0===l||!e&&l===r.length-1)return a(e,t);if(-1===l){var s="thead"===o.tagName.toLowerCase()?0:r.length-1;return r[s]}return r[l+(e?-1:1)]}function a(e,t){var o=e?"thead":"tfoot",i=n.dom.select(">"+o,t);return 0!==i.length?i[0]:null}function s(e,o,i){var r=d(o,e);return r&&g(n,i,r,e),t.preventDefault(),!0}function c(e,o,i,l){var a=l[i];if(a)return u(a),!0;var s=n.dom.getParent(l,"td,th");if(s)return r(e,s,t);var c=d(o,!e);return u(c),t.preventDefault(),!1}function d(e,t){var o=e&&e[t?"lastChild":"firstChild"];return o&&"BR"===o.nodeName?n.dom.getParent(o,"td,th"):o}function u(e){n.selection.setCursorLocation(e,0)}function m(){return y==e.UP||y==e.DOWN}function f(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"tr");return null!==n}function h(e){for(var t=0,n=e;n.previousSibling;)n=n.previousSibling,t+=o(n,"colspan");return t}function p(e,t){var n=0,r=0;return i(e.children,function(e,i){return n+=o(e,"colspan"),r=i,n>t?!1:void 0}),r}function g(e,t,o,i){var r=h(n.dom.getParent(t,"td,th")),l=p(o,r),a=o.childNodes[l],s=d(a,i);u(s||a)}function b(e){var t=n.selection.getNode(),o=n.dom.getParent(t,"td,th"),i=n.dom.getParent(e,"td,th");return o&&o!==i&&v(o,i)}function v(e,t){return n.dom.getParent(e,"TABLE")===n.dom.getParent(t,"TABLE")}var y=t.keyCode;if(m()&&f(n)){var w=n.selection.getNode();setTimeout(function(){b(w)&&r(!t.shiftKey&&y===e.UP,w,t)},0)}}n.on("KeyDown",function(e){t(e)})}function l(){function e(e,t){var n=t.ownerDocument,o=n.createRange(),i;return o.setStartBefore(t),o.setEnd(e.endContainer,e.endOffset),i=n.createElement("body"),i.appendChild(o.cloneContents()),0===i.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}n.on("KeyDown",function(t){var o,i,r=n.dom;(37==t.keyCode||38==t.keyCode)&&(o=n.selection.getRng(),i=r.getParent(o.startContainer,"table"),i&&n.getBody().firstChild==i&&e(o,i)&&(o=r.createRng(),o.setStartBefore(i),o.setEndBefore(i),n.selection.setRng(o),t.preventDefault()))})}function a(){n.on("KeyDown SetContent VisualAid",function(){var e;for(e=n.getBody().lastChild;e;e=e.previousSibling)if(3==e.nodeType){if(e.nodeValue.length>0)break}else if(1==e.nodeType&&!e.getAttribute("data-mce-bogus"))break;e&&"TABLE"==e.nodeName&&(n.settings.forced_root_block?n.dom.add(n.getBody(),n.settings.forced_root_block,null,t.ie?" ":'<br data-mce-bogus="1" />'):n.dom.add(n.getBody(),"br",{"data-mce-bogus":"1"}))}),n.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\xa0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&n.dom.remove(t)})}function s(){function e(e,t,n,o){var i=3,r=e.dom.getParent(t.startContainer,"TABLE"),l,a,s;return r&&(l=r.parentNode),a=t.startContainer.nodeType==i&&0===t.startOffset&&0===t.endOffset&&o&&("TR"==n.nodeName||n==l),s=("TD"==n.nodeName||"TH"==n.nodeName)&&!o,a||s}function t(){var t=n.selection.getRng(),o=n.selection.getNode(),i=n.dom.getParent(t.startContainer,"TD,TH");if(e(n,t,o,i)){i||(i=o);for(var r=i.lastChild;r.lastChild;)r=r.lastChild;t.setEnd(r,r.nodeValue.length),n.selection.setRng(t)}}n.on("KeyDown",function(){t()}),n.on("MouseDown",function(e){2!=e.button&&t()})}t.webkit&&(r(),s()),t.gecko&&(l(),a())}}),o(f,[s,h,c],function(e,t,n){return function(o){function i(){o.getBody().style.webkitUserSelect="",d&&(o.dom.removeClass(o.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=!1)}function r(t){var n,i,r=t.target;if(s&&(a||r!=s)&&("TD"==r.nodeName||"TH"==r.nodeName)){i=l.getParent(r,"table"),i==c&&(a||(a=new e(o,i),a.setStartCell(s),o.getBody().style.webkitUserSelect="none"),a.setEndCell(r),d=!0),n=o.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(u){}t.preventDefault()}}var l=o.dom,a,s,c,d=!0;return o.on("MouseDown",function(e){2!=e.button&&(i(),s=l.getParent(e.target,"td,th"),c=l.getParent(s,"table"))}),l.bind(o.getDoc(),"mouseover",r),o.on("remove",function(){l.unbind(o.getDoc(),"mouseover",r)}),o.on("MouseUp",function(){function e(e,o){var r=new t(e,e);do{if(3==e.nodeType&&0!==n.trim(e.nodeValue).length)return o?i.setStart(e,0):i.setEnd(e,e.nodeValue.length),void 0;if("BR"==e.nodeName)return o?i.setStartBefore(e):i.setEndBefore(e),void 0}while(e=o?r.next():r.prev())}var i,r=o.selection,d,u,m,f,h;if(s){if(a&&(o.getBody().style.webkitUserSelect=""),d=l.select("td.mce-item-selected,th.mce-item-selected"),d.length>0){i=l.createRng(),m=d[0],h=d[d.length-1],i.setStartBefore(m),i.setEndAfter(m),e(m,1),u=new t(m,l.getParent(d[0],"table"));do if("TD"==m.nodeName||"TH"==m.nodeName){if(!l.hasClass(m,"mce-item-selected"))break;f=m}while(m=u.next());e(f),r.setRng(i)}o.nodeChanged(),s=a=c=null}}),o.on("KeyUp",function(){i()}),{clear:i}}}),o(p,[s,u,f,c,h,d,g],function(e,t,n,o,i,r,l){function a(o){function i(e){return e?e.replace(/px$/,""):""}function l(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function a(e){s("left center right".split(" "),function(t){o.formatter.remove("align"+t,{},e)})}function c(){var e=o.dom,t,n,c;t=o.dom.getParent(o.selection.getStart(),"table"),c=!1,n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),cellspacing:e.getAttrib(t,"cellspacing"),cellpadding:e.getAttrib(t,"cellpadding"),border:e.getAttrib(t,"border"),caption:!!e.select("caption",t)[0]},s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),o.windowManager.open({title:"Table properties",items:{type:"form",layout:"grid",columns:2,data:n,defaults:{type:"textbox",maxWidth:50},items:[c?{label:"Cols",name:"cols",disabled:!0}:null,c?{label:"Rows",name:"rows",disabled:!0}:null,{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"},{label:"Alignment",minWidth:90,name:"align",type:"listbox",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var n=this.toJSON(),i;o.undoManager.transact(function(){o.dom.setAttribs(t,{cellspacing:n.cellspacing,cellpadding:n.cellpadding,border:n.border}),o.dom.setStyles(t,{width:l(n.width),height:l(n.height)}),i=e.select("caption",t)[0],i&&!n.caption&&e.remove(i),!i&&n.caption&&(i=e.create("caption"),r.ie||(i.innerHTML='<br data-mce-bogus="1"/>'),t.insertBefore(i,t.firstChild)),a(t),n.align&&o.formatter.apply("align"+n.align,{},t),o.focus(),o.addVisual()})}})}function d(e,t){o.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",size:10},{label:"Rows",name:"rows",type:"textbox",size:10}],onsubmit:function(){var n=this.toJSON();o.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})}function u(){var e=o.dom,t,n,r=[];r=o.dom.select("td.mce-item-selected,th.mce-item-selected"),t=o.dom.getParent(o.selection.getStart(),"td,th"),!r.length&&t&&r.push(t),t=t||r[0],n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),scope:e.getAttrib(t,"scope")},n.type=t.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),o.windowManager.open({title:"Cell properties",items:{type:"form",data:n,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,menu:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,menu:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var t=this.toJSON();o.undoManager.transact(function(){s(r,function(n){o.dom.setAttrib(n,"scope",t.scope),o.dom.setStyles(n,{width:l(t.width),height:l(t.height)}),t.type&&n.nodeName.toLowerCase()!=t.type&&(n=e.rename(n,t.type)),a(n),t.align&&o.formatter.apply("align"+t.align,{},n)}),o.focus()})}})}function m(){var e=o.dom,t,n,r,c,d=[];t=o.dom.getParent(o.selection.getStart(),"table"),n=o.dom.getParent(o.selection.getStart(),"td,th"),s(t.rows,function(t){s(t.cells,function(o){return e.hasClass(o,"mce-item-selected")||o==n?(d.push(t),!1):void 0})}),r=d[0],c={height:i(e.getStyle(r,"height")||e.getAttrib(r,"height")),scope:e.getAttrib(r,"scope")},c.type=r.parentNode.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(r,"align"+e)&&(c.align=e)}),o.windowManager.open({title:"Row properties",items:{type:"form",data:c,columns:2,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,menu:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,menu:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"}]},onsubmit:function(){var t=this.toJSON(),n,i,r;o.undoManager.transact(function(){var c=t.type;s(d,function(s){o.dom.setAttrib(s,"scope",t.scope),o.dom.setStyles(s,{height:l(t.height)}),c!=s.parentNode.nodeName.toLowerCase()&&(n=e.getParent(s,"table"),i=s.parentNode,r=e.select(c,n)[0],r||(r=e.create(c),n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r)),r.appendChild(s),i.hasChildNodes()||e.remove(i)),a(s),t.align&&o.formatter.apply("align"+t.align,{},s)}),o.focus()})}})}function f(e){return function(){o.execCommand(e)}}function h(e,t){var n,i,l;for(l="<table><tbody>",n=0;t>n;n++){for(l+="<tr>",i=0;e>i;i++)l+="<td>"+(r.ie?" ":"<br>")+"</td>";l+="</tr>"}l+="</tbody></table>",o.insertContent(l)}function p(e,t){function n(){e.disabled(!o.dom.getParent(o.selection.getStart(),t)),o.selection.selectorChanged(t,function(t){e.disabled(!t)})}o.initialized?n():o.on("init",n)}function g(){p(this,"table")}function b(){p(this,"td,th")}function v(){var e="";e='<table role="presentation" class="mce-grid mce-grid-border">';for(var t=0;10>t;t++){e+="<tr>";for(var n=0;10>n;n++)e+='<td><a href="#" data-mce-index="'+n+","+t+'"></a></td>';e+="</tr>"}return e+="</table>",e+='<div class="mce-text-center">0 x 0</div>'}var y,w,x=this;o.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onhide:function(){o.dom.removeClass(this.menu.items()[0].getEl().getElementsByTagName("a"),"mce-active")},menu:[{type:"container",html:v(),onmousemove:function(e){var t=e.target;if("A"==t.nodeName){var n=o.dom.getParent(t,"table"),i=t.getAttribute("data-mce-index");if(i!=this.lastPos){i=i.split(","),i[0]=parseInt(i[0],10),i[1]=parseInt(i[1],10);for(var r=0;10>r;r++)for(var l=0;10>l;l++)o.dom.toggleClass(n.rows[r].childNodes[l].firstChild,"mce-active",l<=i[0]&&r<=i[1]);n.nextSibling.innerHTML=i[0]+1+" x "+(i[1]+1),this.lastPos=i}}},onclick:function(e){"A"==e.target.nodeName&&this.lastPos&&(e.preventDefault(),h(this.lastPos[0]+1,this.lastPos[1]+1),this.parent().cancel())}}]}),o.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:g,onclick:c}),o.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:g,cmd:"mceTableDelete"}),o.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:f("mceTableCellProps"),onPostRender:b},{text:"Merge cells",onclick:f("mceTableMergeCells"),onPostRender:b},{text:"Split cell",onclick:f("mceTableSplitCells"),onPostRender:b}]}),o.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:f("mceTableInsertRowBefore"),onPostRender:b},{text:"Insert row after",onclick:f("mceTableInsertRowAfter"),onPostRender:b},{text:"Delete row",onclick:f("mceTableDeleteRow"),onPostRender:b},{text:"Row properties",onclick:f("mceTableRowProps"),onPostRender:b},{text:"-"},{text:"Cut row",onclick:f("mceTableCutRow"),onPostRender:b},{text:"Copy row",onclick:f("mceTableCopyRow"),onPostRender:b},{text:"Paste row before",onclick:f("mceTablePasteRowBefore"),onPostRender:b},{text:"Paste row after",onclick:f("mceTablePasteRowAfter"),onPostRender:b}]}),o.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:f("mceTableInsertColBefore"),onPostRender:b},{text:"Insert column after",onclick:f("mceTableInsertColAfter"),onPostRender:b},{text:"Delete column",onclick:f("mceTableDeleteCol"),onPostRender:b}]});var C=[];s("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"==e?C.push({text:"-"}):C.push(o.menuItems[e])}),o.addButton("table",{type:"menubutton",title:"Table",menu:C}),r.isIE||o.on("click",function(e){e=e.target,"TABLE"===e.nodeName&&(o.selection.select(e),o.nodeChanged())}),x.quirks=new t(o),o.on("Init",function(){y=o.windowManager,x.cellSelection=new n(o)}),s({mceTableSplitCells:function(e){e.split()},mceTableMergeCells:function(e){var t,n,i;i=o.dom.getParent(o.selection.getStart(),"th,td"),i&&(t=i.rowSpan,n=i.colSpan),o.dom.select("td.mce-item-selected,th.mce-item-selected").length?e.merge():d(e,i)},mceTableInsertRowBefore:function(e){e.insertRow(!0)},mceTableInsertRowAfter:function(e){e.insertRow()},mceTableInsertColBefore:function(e){e.insertCol(!0)},mceTableInsertColAfter:function(e){e.insertCol()},mceTableDeleteCol:function(e){e.deleteCols()},mceTableDeleteRow:function(e){e.deleteRows()},mceTableCutRow:function(e){w=e.cutRows()},mceTableCopyRow:function(e){w=e.copyRows()},mceTablePasteRowBefore:function(e){e.pasteRows(w,!0)},mceTablePasteRowAfter:function(e){e.pasteRows(w)},mceTableDelete:function(e){e.deleteTable()}},function(t,n){o.addCommand(n,function(){var n=new e(o);n&&(t(n),o.execCommand("mceRepaint"),x.cellSelection.clear())})}),s({mceInsertTable:function(){c()},mceTableRowProps:m,mceTableCellProps:u},function(e,t){o.addCommand(t,function(t,n){e(n)})})}var s=o.each;l.add("table",a)}),l([s,u,f,p])}(this);
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("template",function(e){function t(){function t(t){function r(t){if(-1==t.indexOf("<html>")){var n="";tinymce.each(e.contentCSS,function(t){n+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'}),t="<!DOCTYPE html><html><head>"+n+"</head>"+"<body>"+t+"</body>"+"</html>"}t=l(t,"template_preview_replace_values");var r=a.find("iframe")[0].getEl().contentWindow.document;r.open(),r.write(t),r.close()}var c=t.control.value();c.url?tinymce.util.XHR.send({url:c.url,success:function(e){n=e,r(n)}}):(n=c.content,r(n)),a.find("#description")[0].text(t.control.value().description)}var a,n,c=[];return e.settings.templates?(tinymce.each(e.settings.templates,function(e){c.push({selected:!c.length,text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),a=e.windowManager.open({title:"Insert template",body:[{type:"container",label:"Templates",items:{type:"listbox",name:"template",values:c,onselect:t}},{type:"label",name:"description",label:"Description",text:" "},{type:"iframe",minWidth:600,minHeight:400,border:1}],onsubmit:function(){r(!1,n)}}),a.find("listbox")[0].fire("select"),void 0):(e.windowManager.alert("No templates defined"),void 0)}function a(t,a){function n(e,t){if(e=""+e,e.length<t)for(var a=0;a<t-e.length;a++)e="0"+e;return e}var l="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),c="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),o="January February March April May June July August September October November December".split(" ");return a=a||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+a.getFullYear()),t=t.replace("%y",""+a.getYear()),t=t.replace("%m",n(a.getMonth()+1,2)),t=t.replace("%d",n(a.getDate(),2)),t=t.replace("%H",""+n(a.getHours(),2)),t=t.replace("%M",""+n(a.getMinutes(),2)),t=t.replace("%S",""+n(a.getSeconds(),2)),t=t.replace("%I",""+((a.getHours()+11)%12+1)),t=t.replace("%p",""+(a.getHours()<12?"AM":"PM")),t=t.replace("%B",""+e.translate(o[a.getMonth()])),t=t.replace("%b",""+e.translate(c[a.getMonth()])),t=t.replace("%A",""+e.translate(r[a.getDay()])),t=t.replace("%a",""+e.translate(l[a.getDay()])),t=t.replace("%%","%")}function n(t){var a=e.dom,n=e.getParam("template_replace_values");c(a.select("*",t),function(e){c(n,function(t,l){a.hasClass(e,l)&&"function"==typeof n[l]&&n[l](e)})})}function l(t,a){return c(e.getParam(a),function(e,a){"function"!=typeof e&&(t=t.replace(new RegExp("\\{\\$"+a+"\\}","g"),e))}),t}function r(t,r){function o(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)}var s,i,m=e.dom,p=e.selection.getContent();r=l(r,"template_replace_values"),s=m.create("div",null,r),i=m.select(".mceTmpl",s),i&&i.length>0&&(s=m.create("div",null),s.appendChild(i[0].cloneNode(!0))),c(m.select("*",s),function(t){o(t,e.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(t.innerHTML=a(e.getParam("template_cdate_format",e.getLang("template.cdate_format")))),o(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=a(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))),o(t,e.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(t.innerHTML=p)}),n(s),e.execCommand("mceInsertContent",!1,s.innerHTML),e.addVisual()}var c=tinymce.each;e.addCommand("mceInsertTemplate",r),e.addButton("template",{title:"Insert template",onclick:t}),e.addMenuItem("template",{text:"Insert template",onclick:t,context:"insert"}),e.on("PreProcess",function(t){var l=e.dom;c(l.select("div",t.node),function(t){l.hasClass(t,"mceTmpl")&&(c(l.select("*",t),function(t){l.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=a(e.getParam("template_mdate_format",e.getLang("template.mdate_format"))))}),n(t))})})});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("textcolor",function(e){function t(){var t,n,i=[];for(n=e.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Brown","C0C0C0","Silver","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum","FFFFFF","White"],t=0;t<n.length;t+=2)i.push({text:n[t+1],color:n[t]});return i}function n(){var n,i,a,o,r,l,c,s,u,d=this;for(n=t(),a='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="presentation" cellspacing="0"><tbody>',o=n.length-1,r=e.settings.textcolor_rows||5,l=e.settings.textcolor_cols||8,s=0;r>s;s++){for(a+="<tr>",c=0;l>c;c++)u=s*l+c,u>o?a+="<td></td>":(i=n[u],a+='<td><div id="'+d._id+"-"+u+'"'+' data-mce-color="'+i.color+'"'+' role="option"'+' tabIndex="-1"'+' style="'+(i?"background-color: #"+i.color:"")+'"'+' title="'+i.text+'">'+"</div>"+"</td>");a+="</tr>"}return a+="</tbody></table>"}function i(t){var n,i=this.parent();(n=t.target.getAttribute("data-mce-color"))&&(i.hidePanel(),n="#"+n,i.color(n),e.execCommand(i.settings.selectcmd,!1,n))}function a(){var t=this;t._color&&e.execCommand(t.settings.selectcmd,!1,t._color)}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",popoverAlign:"bc-tl",selectcmd:"ForeColor",panel:{html:n,onclick:i},onclick:a}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",popoverAlign:"bc-tl",selectcmd:"HiliteColor",panel:{html:n,onclick:i},onclick:a})});
|
@@ -0,0 +1,128 @@
|
|
1
|
+
.mce-visualblocks p {
|
2
|
+
padding-top: 10px;
|
3
|
+
border: 1px dashed #BBB;
|
4
|
+
margin-left: 3px;
|
5
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);
|
6
|
+
}
|
7
|
+
|
8
|
+
.mce-visualblocks h1 {
|
9
|
+
padding-top: 10px;
|
10
|
+
border: 1px dashed #BBB;
|
11
|
+
margin-left: 3px;
|
12
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);
|
13
|
+
}
|
14
|
+
|
15
|
+
.mce-visualblocks h2 {
|
16
|
+
padding-top: 10px;
|
17
|
+
border: 1px dashed #BBB;
|
18
|
+
margin-left: 3px;
|
19
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);
|
20
|
+
}
|
21
|
+
|
22
|
+
.mce-visualblocks h3 {
|
23
|
+
padding-top: 10px;
|
24
|
+
border: 1px dashed #BBB;
|
25
|
+
margin-left: 3px;
|
26
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);
|
27
|
+
}
|
28
|
+
|
29
|
+
.mce-visualblocks h4 {
|
30
|
+
padding-top: 10px;
|
31
|
+
border: 1px dashed #BBB;
|
32
|
+
margin-left: 3px;
|
33
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);
|
34
|
+
}
|
35
|
+
|
36
|
+
.mce-visualblocks h5 {
|
37
|
+
padding-top: 10px;
|
38
|
+
border: 1px dashed #BBB;
|
39
|
+
margin-left: 3px;
|
40
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);
|
41
|
+
}
|
42
|
+
|
43
|
+
.mce-visualblocks h6 {
|
44
|
+
padding-top: 10px;
|
45
|
+
border: 1px dashed #BBB;
|
46
|
+
margin-left: 3px;
|
47
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);
|
48
|
+
}
|
49
|
+
|
50
|
+
.mce-visualblocks div {
|
51
|
+
padding-top: 10px;
|
52
|
+
border: 1px dashed #BBB;
|
53
|
+
margin-left: 3px;
|
54
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);
|
55
|
+
}
|
56
|
+
|
57
|
+
.mce-visualblocks section {
|
58
|
+
padding-top: 10px;
|
59
|
+
border: 1px dashed #BBB;
|
60
|
+
margin: 0 0 1em 3px;
|
61
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);
|
62
|
+
}
|
63
|
+
|
64
|
+
.mce-visualblocks article {
|
65
|
+
padding-top: 10px;
|
66
|
+
border: 1px dashed #BBB;
|
67
|
+
margin: 0 0 1em 3px;
|
68
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);
|
69
|
+
}
|
70
|
+
|
71
|
+
.mce-visualblocks blockquote {
|
72
|
+
padding-top: 10px;
|
73
|
+
border: 1px dashed #BBB;
|
74
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);
|
75
|
+
}
|
76
|
+
|
77
|
+
.mce-visualblocks address {
|
78
|
+
padding-top: 10px;
|
79
|
+
border: 1px dashed #BBB;
|
80
|
+
margin: 0 0 1em 3px;
|
81
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);
|
82
|
+
}
|
83
|
+
|
84
|
+
.mce-visualblocks pre {
|
85
|
+
padding-top: 10px;
|
86
|
+
border: 1px dashed #BBB;
|
87
|
+
margin-left: 3px;
|
88
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);
|
89
|
+
}
|
90
|
+
|
91
|
+
.mce-visualblocks figure {
|
92
|
+
padding-top: 10px;
|
93
|
+
border: 1px dashed #BBB;
|
94
|
+
margin: 0 0 1em 3px;
|
95
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);
|
96
|
+
}
|
97
|
+
|
98
|
+
.mce-visualblocks hgroup {
|
99
|
+
padding-top: 10px;
|
100
|
+
border: 1px dashed #BBB;
|
101
|
+
margin: 0 0 1em 3px;
|
102
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);
|
103
|
+
}
|
104
|
+
|
105
|
+
.mce-visualblocks aside {
|
106
|
+
padding-top: 10px;
|
107
|
+
border: 1px dashed #BBB;
|
108
|
+
margin: 0 0 1em 3px;
|
109
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);
|
110
|
+
}
|
111
|
+
|
112
|
+
.mce-visualblocks figcaption {
|
113
|
+
border: 1px dashed #BBB;
|
114
|
+
}
|
115
|
+
|
116
|
+
.mce-visualblocks ul {
|
117
|
+
padding-top: 10px;
|
118
|
+
border: 1px dashed #BBB;
|
119
|
+
margin: 0 0 1em 3px;
|
120
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)
|
121
|
+
}
|
122
|
+
|
123
|
+
.mce-visualblocks ol {
|
124
|
+
padding-top: 10px;
|
125
|
+
border: 1px dashed #BBB;
|
126
|
+
margin: 0 0 1em 3px;
|
127
|
+
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);
|
128
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("visualblocks",function(e,t){function n(){var t=this;t.active(r),e.on("VisualBlocks",function(){t.active(e.dom.hasClass(e.getBody(),"mce-visualblocks"))})}var i,a,r;window.NodeList&&(e.addCommand("mceVisualBlocks",function(){var n,o=e.dom;i||(i=o.uniqueId(),n=o.create("link",{id:i,rel:"stylesheet",href:t+"/css/visualblocks.css"}),e.getDoc().getElementsByTagName("head")[0].appendChild(n)),e.on("PreviewFormats AfterPreviewFormats",function(t){r&&o.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"==t.type)}),o.toggleClass(e.getBody(),"mce-visualblocks"),r=e.dom.hasClass(e.getBody(),"mce-visualblocks"),a&&a.active(o.hasClass(e.getBody(),"mce-visualblocks")),e.fire("VisualBlocks")}),e.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:n}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:n,selectable:!0,context:"view",prependToContext:!0}),e.on("init",function(){e.settings.visualblocks_default_state&&e.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}),e.on("remove",function(){e.dom.removeClass(e.getBody(),"mce-visualblocks")}))});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("visualchars",function(e){function t(t){var n,a,r,o,l,s,c=e.getBody(),d=e.selection;if(i=!i,e.fire("VisualChars",{state:i}),t&&(s=d.getBookmark()),i)for(a=[],tinymce.walk(c,function(e){3==e.nodeType&&e.nodeValue&&-1!=e.nodeValue.indexOf(" ")&&a.push(e)},"childNodes"),r=0;r<a.length;r++){for(o=a[r].nodeValue,o=o.replace(/(\u00a0)/g,'<span data-mce-bogus="1" class="mce-nbsp">$1</span>'),l=e.dom.create("div",null,o);n=l.lastChild;)e.dom.insertAfter(n,a[r]);e.dom.remove(a[r])}else for(a=e.dom.select("span.mce-nbsp",c),r=a.length-1;r>=0;r--)e.dom.remove(a[r],1);d.moveToBookmark(s)}function n(){var t=this;e.on("VisualChars",function(e){t.active(e.state)})}var i;e.addCommand("mceVisualChars",t),e.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:n}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:n,selectable:!0,context:"view",prependToContext:!0}),e.on("beforegetcontent",function(e){i&&"raw"!=e.format&&!e.draft&&(i=!0,t(!1))})});
|