Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to TinyMCE 3.5.9

  • Loading branch information...
commit 02d975569e6f00bc6379b05f467bb30deb244e9d 1 parent b79acd1
@spohlenz authored
View
4 Rakefile
@@ -16,8 +16,8 @@ desc "Update TinyMCE to version #{TinyMCE::Rails::TINYMCE_VERSION}"
task :update => [ :fetch, :extract, :process ]
task :fetch do
- download("https://github.com/downloads/tinymce/tinymce/tinymce_#{TinyMCE::Rails::TINYMCE_VERSION}.zip", "tinymce.zip")
- download("https://github.com/downloads/tinymce/tinymce/tinymce_#{TinyMCE::Rails::TINYMCE_VERSION}_jquery.zip", "tinymce.jquery.zip")
+ download("http://download.moxiecode.com/tinymce/tinymce_#{TinyMCE::Rails::TINYMCE_VERSION}.zip", "tinymce.zip")
+ download("http://download.moxiecode.com/tinymce/tinymce_#{TinyMCE::Rails::TINYMCE_VERSION}_jquery.zip", "tinymce.jquery.zip")
end
task :extract do
View
4 lib/tinymce/rails/version.rb
@@ -1,6 +1,6 @@
module TinyMCE
module Rails
- VERSION = "3.5.9.pre2"
- TINYMCE_VERSION = "3.5.9.pre"
+ VERSION = "3.5.9"
+ TINYMCE_VERSION = "3.5.9"
end
end
View
2  vendor/assets/javascripts/tinymce/plugins/fullscreen/fullscreen.htm
@@ -3,7 +3,7 @@
<head>
<title></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <script type="text/javascript" src="../../tiny_mce.js"></script>
+ <script type="text/javascript" src="../../tiny_mce_dev.js"></script>
<script type="text/javascript">
function patchCallback(settings, key) {
if (settings[key])
View
6 vendor/assets/javascripts/tinymce/plugins/searchreplace/js/searchreplace.js
@@ -14,6 +14,7 @@ var SearchReplaceDialog = {
mcTabs.onChange.add(function(tab_id, panel_id) {
t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
});
+
},
switchMode : function(m) {
@@ -39,6 +40,11 @@ var SearchReplaceDialog = {
searchNext : function(a) {
var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
+ if (tinymce.isIE11 && !window.find) {
+ ed.windowManager.alert("This feature is not available in IE 11+. Upgrade TinyMCE to 4.x to get this functionallity back.");
+ return;
+ }
+
// Get input
f = document.forms[0];
s = f[m + '_panel_searchstring'].value;
View
2  vendor/assets/javascripts/tinymce/plugins/table/editor_plugin.js
@@ -1 +1 @@
-(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T<Q+U;T++){if(!g[T]){g[T]=[]}for(S=R;S<R+V;S++){g[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=g[O];if(N){return N[M]}}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return M&&(G.hasClass(M.elm,"mceSelected")||M==o)}function k(){var M=[];e(H.rows,function(N){e(N.cells,function(O){if(G.hasClass(O,"mceSelected")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function f(M){var N;d.walk(M,function(P){var O;if(P.nodeType==3){e(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=d.isIE?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='<br data-mce-bogus="1" />'}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q<S-1;Q++){G.insertAfter(f(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{L=D=null;e(g,function(Z,aa){e(Z,function(ac,ab){if(j(ac)){if(!L){L={x:ab,y:aa}}D={x:ab,y:aa}}})});P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,"colSpan",(X-P)+1);s(T,"rowSpan",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){if(!g[R]||!g[R][U]){continue}V=g[R][U].elm;if(V!=T){N=d.grep(V.childNodes);e(N,function(Z){T.appendChild(Z)});if(N.length){N=d.grep(T.childNodes);Q=0;e(N,function(Z){if(Z.nodeName=="BR"&&G.getAttrib(Z,"data-mce-bogus")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(Q){var M,S,P,R,T,U,N,V,O;e(g,function(W,X){e(W,function(Z,Y){if(j(Z)){Z=Z.elm;T=Z.parentNode;U=A(T,false);M=X;if(Q){return false}}});if(Q){return !M}});for(R=0;R<g[0].length;R++){if(!g[M][R]){continue}S=g[M][R].elm;if(S!=P){if(!Q){O=a(S,"rowspan");if(O>1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){if(!O){return}var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,"colSpan",1);s(R,"rowSpan",1)}for(i=S;i<Q;i++){T.appendChild(f(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}});G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected")}function F(M){var N;e(g,function(O,P){e(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;e(g,function(P,Q){e(P,function(S,R){var U,T;if(j(S)){S=g[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=g[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=g[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){if(r.settings.forced_root_block){r.dom.add(r.getBody(),r.settings.forced_root_block,null,d.isIE?"&nbsp;":'<br data-mce-bogus="1" />')}else{r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"})}}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&(z.nodeName=="BR"||(z.childNodes.length==1&&(z.firstChild.nodeName=="BR"||z.firstChild.nodeValue=="\u00a0")))&&z.previousSibling&&z.previousSibling.nodeName=="TABLE"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce);
+(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T<Q+U;T++){if(!g[T]){g[T]=[]}for(S=R;S<R+V;S++){g[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=g[O];if(N){return N[M]}}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return M&&(G.hasClass(M.elm,"mceSelected")||M==o)}function k(){var M=[];e(H.rows,function(N){e(N.cells,function(O){if(G.hasClass(O,"mceSelected")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function f(M){var N;d.walk(M,function(P){var O;if(P.nodeType==3){e(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=d.isIE&&!d.isIE11?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE||d.isIE11){M.innerHTML='<br data-mce-bogus="1" />'}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q<S-1;Q++){G.insertAfter(f(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{L=D=null;e(g,function(Z,aa){e(Z,function(ac,ab){if(j(ac)){if(!L){L={x:ab,y:aa}}D={x:ab,y:aa}}})});P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,"colSpan",(X-P)+1);s(T,"rowSpan",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){if(!g[R]||!g[R][U]){continue}V=g[R][U].elm;if(V!=T){N=d.grep(V.childNodes);e(N,function(Z){T.appendChild(Z)});if(N.length){N=d.grep(T.childNodes);Q=0;e(N,function(Z){if(Z.nodeName=="BR"&&G.getAttrib(Z,"data-mce-bogus")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(Q){var M,S,P,R,T,U,N,V,O;e(g,function(W,X){e(W,function(Z,Y){if(j(Z)){Z=Z.elm;T=Z.parentNode;U=A(T,false);M=X;if(Q){return false}}});if(Q){return !M}});for(R=0;R<g[0].length;R++){if(!g[M][R]){continue}S=g[M][R].elm;if(S!=P){if(!Q){O=a(S,"rowspan");if(O>1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){if(!O){return}var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,"colSpan",1);s(R,"rowSpan",1)}for(i=S;i<Q;i++){T.appendChild(f(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}});G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected")}function F(M){var N;e(g,function(O,P){e(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;e(g,function(P,Q){e(P,function(S,R){var U,T;if(j(S)){S=g[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=g[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=g[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){if(r.settings.forced_root_block){r.dom.add(r.getBody(),r.settings.forced_root_block,null,d.isIE&&!d.isIE11?"&nbsp;":'<br data-mce-bogus="1" />')}else{r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"})}}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&(z.nodeName=="BR"||(z.childNodes.length==1&&(z.firstChild.nodeName=="BR"||z.firstChild.nodeValue=="\u00a0")))&&z.previousSibling&&z.previousSibling.nodeName=="TABLE"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce);
View
6 vendor/assets/javascripts/tinymce/plugins/table/editor_plugin_src.js
@@ -166,7 +166,7 @@
// Add something to the inner node
if (curNode)
- curNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />';
+ curNode.innerHTML = tinymce.isIE && !tinymce.isIE11 ? '&nbsp;' : '<br data-mce-bogus="1" />';
return false;
}
@@ -179,7 +179,7 @@
if (formatNode) {
cell.appendChild(formatNode);
} else {
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
cell.innerHTML = '<br data-mce-bogus="1" />';
}
@@ -1249,7 +1249,7 @@
if (last && last.nodeName == 'TABLE') {
if (ed.settings.forced_root_block)
- ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />');
+ ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE && !tinymce.isIE11 ? '&nbsp;' : '<br data-mce-bogus="1" />');
else
ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
}
View
14 vendor/assets/javascripts/tinymce/plugins/table/js/table.js
@@ -91,7 +91,7 @@ function insertTable() {
if (!capEl && caption) {
capEl = elm.ownerDocument.createElement('caption');
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
capEl.innerHTML = '<br data-mce-bogus="1"/>';
elm.insertBefore(capEl, elm.firstChild);
@@ -199,7 +199,7 @@ function insertTable() {
html += '>';
if (caption) {
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
html += '<caption><br data-mce-bogus="1"/></caption>';
else
html += '<caption></caption>';
@@ -209,7 +209,7 @@ function insertTable() {
html += "<tr>";
for (var x=0; x<cols; x++) {
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
html += '<td><br data-mce-bogus="1"/></td>';
else
html += '<td></td>';
@@ -242,16 +242,16 @@ function insertTable() {
} else
inst.execCommand('mceInsertContent', false, html);
- tinymce.each(dom.select('table[data-mce-new]'), function(node) {
+ tinymce.each(dom.select('table[data-mce-new]'), function(node) {
var tdorth = dom.select('td,th', node);
-
+
// Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
- if (tinymce.isIE && node.nextSibling == null) {
+ if (tinymce.isIE && !tinymce.isIE11 && node.nextSibling == null) {
if (inst.settings.forced_root_block)
dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
else
dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
- }
+ }
try {
// IE9 might fail to do this selection
View
2  vendor/assets/javascripts/tinymce/tiny_mce.js
1 addition, 1 deletion not shown
View
2  vendor/assets/javascripts/tinymce/tiny_mce_jquery.js
1 addition, 1 deletion not shown
View
188 vendor/assets/javascripts/tinymce/tiny_mce_jquery_src.js
@@ -6,18 +6,20 @@
var tinymce = {
majorVersion : '3',
- minorVersion : '5.9.pre',
+ minorVersion : '5.9',
- releaseDate : '2013-08-11',
+ releaseDate : '2013-10-10',
_init : function() {
var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
+ t.isIE11 = ua.indexOf('Trident/') != -1 && ua.indexOf('rv:') != -1;
+
t.isOpera = win.opera && opera.buildNumber;
t.isWebKit = /WebKit/.test(ua);
- t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName);
+ t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName) || t.isIE11;
t.isIE6 = t.isIE && /MSIE [56]/.test(ua);
@@ -27,7 +29,7 @@
t.isIE9 = t.isIE && /MSIE [9]/.test(ua);
- t.isGecko = !t.isWebKit && /Gecko/.test(ua);
+ t.isGecko = !t.isWebKit && !t.isIE11 && /Gecko/.test(ua);
t.isMac = ua.indexOf('Mac') != -1;
@@ -451,6 +453,7 @@
})(window);
+
(function($, tinymce) {
var is = tinymce.is, attrRegExp = /^(href|src|style)$/i, undef;
@@ -761,6 +764,8 @@
};
})(window.jQuery, tinymce);
+
+
tinymce.create('tinymce.util.Dispatcher', {
scope : null,
listeners : null,
@@ -825,6 +830,7 @@ tinymce.create('tinymce.util.Dispatcher', {
}
});
+
(function() {
var each = tinymce.each;
@@ -1075,6 +1081,7 @@ tinymce.create('tinymce.util.Dispatcher', {
}
});
})();
+
(function() {
var each = tinymce.each;
@@ -1145,6 +1152,7 @@ tinymce.create('tinymce.util.Dispatcher', {
}
});
})();
+
(function() {
function serialize(o, quote) {
var i, v, t, name;
@@ -1210,6 +1218,7 @@ tinymce.create('tinymce.util.Dispatcher', {
};
})();
+
tinymce.create('static tinymce.util.XHR', {
send : function(o) {
var x, t, w = window, c = 0;
@@ -1268,6 +1277,7 @@ tinymce.create('static tinymce.util.XHR', {
}
}
});
+
(function() {
var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR;
@@ -1344,6 +1354,7 @@ tinymce.create('static tinymce.util.XHR', {
}
};
})(tinymce);
+
tinymce.util.Quirks = function(editor) {
var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,
settings = editor.settings, parser = editor.parser, serializer = editor.serializer, each = tinymce.each;
@@ -2189,6 +2200,17 @@ tinymce.util.Quirks = function(editor) {
}
}
+ function bodyHeight() {
+ editor.contentStyles.push('body {min-height: 100px}');
+ editor.onClick.add(function(ed, e) {
+ if (e.target.nodeName == 'HTML') {
+ editor.execCommand('SelectAll');
+ editor.selection.collapse(true);
+ editor.nodeChanged();
+ }
+ });
+ }
+
// All browsers
disableBackspaceIntoATable();
removeBlockQuoteOnBackSpace();
@@ -2212,7 +2234,7 @@ tinymce.util.Quirks = function(editor) {
}
// IE
- if (tinymce.isIE) {
+ if (tinymce.isIE && !tinymce.isIE11) {
removeHrOnBackspace();
ensureBodyHasRoleApplication();
addNewLinesBeforeBrInPre();
@@ -2222,8 +2244,13 @@ tinymce.util.Quirks = function(editor) {
keepNoScriptContents();
}
+ // IE 11+
+ if (tinymce.isIE11) {
+ bodyHeight();
+ }
+
// Gecko
- if (tinymce.isGecko) {
+ if (tinymce.isGecko && !tinymce.isIE11) {
removeHrOnBackspace();
focusBody();
removeStylesWhenDeletingAccrossBlockElements();
@@ -2422,6 +2449,7 @@ tinymce.util.Quirks = function(editor) {
}
};
})(tinymce);
+
tinymce.html.Styles = function(settings, schema) {
var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,
urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,
@@ -2459,6 +2487,12 @@ tinymce.html.Styles = function(settings, schema) {
function compress(prefix, suffix) {
var top, right, bottom, left;
+ // IE 11 will produce a border-image: none when getting the style attribute from <p style="border: 1px solid red"></p>
+ // So lets asume it shouldn't be there
+ if (styles['border-image'] === 'none') {
+ delete styles['border-image'];
+ }
+
// Get values and check it it needs compressing
top = styles[prefix + '-top' + suffix];
if (!top)
@@ -2644,6 +2678,7 @@ tinymce.html.Styles = function(settings, schema) {
}
};
};
+
(function(tinymce) {
var mapCache = {}, makeMap = tinymce.makeMap, each = tinymce.each;
@@ -3364,6 +3399,7 @@ tinymce.html.Styles = function(settings, schema) {
self.elements = elements;
};
})(tinymce);
+
(function(tinymce) {
tinymce.html.SaxParser = function(settings, schema) {
var self = this, noop = function() {};
@@ -3654,6 +3690,7 @@ tinymce.html.Styles = function(settings, schema) {
};
}
})(tinymce);
+
(function(tinymce) {
var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = {
'#text' : 3,
@@ -3986,6 +4023,7 @@ tinymce.html.Styles = function(settings, schema) {
tinymce.html.Node = Node;
})(tinymce);
+
(function(tinymce) {
var Node = tinymce.html.Node;
@@ -4608,6 +4646,7 @@ tinymce.html.Styles = function(settings, schema) {
}
}
})(tinymce);
+
tinymce.html.Writer = function(settings) {
var html = [], indent, indentBefore, indentAfter, encode, htmlOutput;
@@ -4707,6 +4746,7 @@ tinymce.html.Writer = function(settings) {
}
};
};
+
(function(tinymce) {
tinymce.html.Serializer = function(settings, schema) {
var self = this, writer = new tinymce.html.Writer(settings);
@@ -4822,6 +4862,7 @@ tinymce.html.Writer = function(settings) {
};
}
})(tinymce);
+
// JSLint defined globals
/*global tinymce:false, window:false */
@@ -5367,6 +5408,7 @@ tinymce.dom = {};
namespace = 0;
})(tinymce.dom, 'data-mce-expando'); // Namespace and expando
+
tinymce.dom.TreeWalker = function(start_node, root_node) {
var node = start_node;
@@ -5406,6 +5448,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
return (node = findSibling(node, 'lastChild', 'previousSibling', shallow));
};
};
+
(function(tinymce) {
// Shorten names
var each = tinymce.each,
@@ -5493,7 +5536,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
fixDoc: function(doc) {
var settings = this.settings, name;
- if (isIE && settings.schema) {
+ if (isIE && !tinymce.isIE11 && settings.schema) {
// Add missing HTML 4/5 elements to IE
('abbr article aside audio canvas ' +
'details figcaption figure footer ' +
@@ -5514,7 +5557,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
var self = this, clone, doc;
// TODO: Add feature detection here in the future
- if (!isIE || node.nodeType !== 1 || deep) {
+ if (!isIE || tinymce.isIE11 || node.nodeType !== 1 || deep) {
return node.cloneNode(deep);
}
@@ -5754,7 +5797,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
switch (na) {
case 'opacity':
// IE specific opacity
- if (isIE) {
+ if (isIE && ! tinymce.isIE11) {
s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")";
if (!n.currentStyle || !n.currentStyle.hasLayout)
@@ -5766,7 +5809,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
break;
case 'float':
- isIE ? s.styleFloat = v : s.cssFloat = v;
+ (isIE && ! tinymce.isIE11) ? s.styleFloat = v : s.cssFloat = v;
break;
default:
@@ -6132,7 +6175,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug
// This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading
// It's ugly but it seems to work fine.
- if (isIE && d.documentMode && d.recalc) {
+ if (isIE && !tinymce.isIE11 && d.documentMode && d.recalc) {
link.onload = function() {
if (d.recalc)
d.recalc();
@@ -6451,7 +6494,12 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// Import
case 3:
- addClasses(r.styleSheet);
+ try {
+ addClasses(r.styleSheet);
+ } catch (ex) {
+ // Ignore
+ }
+
break;
}
});
@@ -6787,6 +6835,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0});
})(tinymce);
+
(function(ns) {
// Range constructor
function Range(dom) {
@@ -7491,6 +7540,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
return this.toStringIE();
};
})(tinymce.dom);
+
(function() {
function Selection(selection) {
var self = this, dom = selection.dom, TRUE = true, FALSE = false;
@@ -7963,6 +8013,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// Expose the selection object
tinymce.dom.TridentSelection = Selection;
})();
+
+
(function(tinymce) {
tinymce.dom.Element = function(id, settings) {
var t = this, dom, el;
@@ -8071,6 +8123,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
});
};
})(tinymce);
+
(function(tinymce) {
function trimNl(s) {
return s.replace(/[\n\r]+/g, '');
@@ -8105,7 +8158,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
if (!t.win.getSelection)
t.tridentSel = new tinymce.dom.TridentSelection(t);
- if (tinymce.isIE && dom.boxModel)
+ if (tinymce.isIE && ! tinymce.isIE11 && dom.boxModel)
this._fixIESelection();
// Prevent leaks
@@ -8397,8 +8450,20 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
}
// Handle simple range
- if (type)
- return {rng : t.getRng()};
+ if (type) {
+ rng = t.getRng();
+
+ if (rng.setStart) {
+ rng = {
+ startContainer: rng.startContainer,
+ startOffset: rng.startOffset,
+ endContainer: rng.endContainer,
+ endOffset: rng.endOffset
+ };
+ }
+
+ return {rng : rng};
+ }
rng = t.getRng();
id = dom.uniqueId();
@@ -8464,7 +8529,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
},
moveToBookmark : function(bookmark) {
- var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset;
+ var t = this, dom = t.dom, marker1, marker2, rng, rng2, root, startContainer, endContainer, startOffset, endOffset;
function setEndPoint(start) {
var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
@@ -8594,8 +8659,24 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
}
} else if (bookmark.name) {
t.select(dom.select(bookmark.name)[bookmark.index]);
- } else if (bookmark.rng)
- t.setRng(bookmark.rng);
+ } else if (bookmark.rng) {
+ rng = bookmark.rng;
+
+ if (rng.startContainer) {
+ rng2 = t.dom.createRng();
+
+ try {
+ rng2.setStart(rng.startContainer, rng.startOffset);
+ rng2.setEnd(rng.endContainer, rng.endOffset);
+ } catch (e) {
+ // Might fail with index error
+ }
+
+ rng = rng2;
+ }
+
+ t.setRng(rng);
+ }
}
},
@@ -8694,7 +8775,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
}
// We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
- if (tinymce.isIE && rng && rng.setStart && doc.selection.createRange().item) {
+ if (tinymce.isIE && ! tinymce.isIE11 && rng && rng.setStart && doc.selection.createRange().item) {
elm = doc.selection.createRange().item(0);
rng = doc.createRange();
rng.setStartBefore(elm);
@@ -9210,6 +9291,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
}
});
})(tinymce);
+
(function(tinymce) {
tinymce.dom.Serializer = function(settings, dom, schema) {
var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser;
@@ -9558,7 +9640,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// Add onload listener for non IE browsers since IE9
// fires onload event before the script is parsed and executed
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
elm.onload = done;
// Add onerror event will get fired on some browsers but not all of them
@@ -9686,6 +9768,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// Global script loader
tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();
})(tinymce);
+
(function(tinymce) {
tinymce.dom.RangeUtils = function(dom) {
var INVISIBLE_CHAR = '\uFEFF';
@@ -9884,6 +9967,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
return false;
};
})(tinymce);
+
(function(tinymce) {
var Event = tinymce.dom.Event, each = tinymce.each;
@@ -10040,6 +10124,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
}
});
})(tinymce);
+
(function(tinymce) {
// Shorten class names
var DOM = tinymce.DOM, is = tinymce.is;
@@ -10164,6 +10249,7 @@ tinymce.create('tinymce.ui.Container:tinymce.ui.Control', {
}
});
+
tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
Separator : function(id, s) {
this.parent(id, s);
@@ -10175,6 +10261,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
return tinymce.DOM.createHTML('span', {'class' : this.classPrefix, role : 'separator', 'aria-orientation' : 'vertical', tabindex : '-1'});
}
});
+
(function(tinymce) {
var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
@@ -10205,6 +10292,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
@@ -10711,6 +10799,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, undef;
@@ -11006,6 +11095,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, undef;
@@ -11142,6 +11232,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
@@ -11234,6 +11325,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
@@ -11317,6 +11409,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;
@@ -11526,6 +11619,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
// Shorten class names
var dom = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event;
@@ -11585,6 +11679,7 @@ tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', {
}
});
})(tinymce);
+
(function(tinymce) {
// Shorten class names
var dom = tinymce.DOM, each = tinymce.each;
@@ -11651,6 +11746,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
}
});
})(tinymce);
+
(function(tinymce) {
var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;
@@ -12022,7 +12118,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
ed.render();
// Fix IE memory leaks
- if (tinymce.isIE) {
+ if (tinymce.isIE && ! tinymce.isIE11) {
w.attachEvent('onunload', clr);
}
@@ -12420,10 +12516,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Store away the selection when it's changed to it can be restored later with a editor.focus() call
if (isIE) {
t.onInit.add(function(ed) {
- ed.dom.bind(ed.getBody(), 'beforedeactivate keydown', function() {
- ed.lastIERng = ed.selection.getRng();
+ ed.dom.bind(ed.getBody(), 'beforedeactivate keydown keyup', function() {
+ ed.bookmark = ed.selection.getBookmark(1);
});
});
+
+ t.onNodeChange.add(function(ed) {
+ if (document.activeElement.id == ed.id + "_ifr") {
+ ed.bookmark = ed.selection.getBookmark(1);
+ }
+ });
}
}
@@ -12743,8 +12845,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, ieRng, controlElm, doc = self.getDoc(), body;
if (!skip_focus) {
- if (self.lastIERng) {
- selection.setRng(self.lastIERng);
+ if (self.bookmark) {
+ selection.moveToBookmark(self.bookmark);
+ self.bookmark = null;
}
// Get selected control element
@@ -12765,7 +12868,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
body = self.getBody();
// Check for setActive since it doesn't scroll to the element
- if (body.setActive) {
+ if (body.setActive && ! tinymce.isIE11) {
body.setActive();
} else {
body.focus();
@@ -14318,6 +14421,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
});
};
})(tinymce);
+
(function(tinymce) {
var Dispatcher = tinymce.util.Dispatcher;
@@ -14537,6 +14641,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
return self;
};
})(tinymce);
+
tinymce.ForceBlocks = function(editor) {
var settings = editor.settings, dom = editor.dom, selection = editor.selection, blockElements = editor.schema.getBlockElements();
@@ -14642,6 +14747,7 @@ tinymce.ForceBlocks = function(editor) {
editor.onNodeChange.add(addRootBlocks);
}
};
+
(function(tinymce) {
// Shorten names
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;
@@ -15034,6 +15140,7 @@ tinymce.ForceBlocks = function(editor) {
}
});
})(tinymce);
+
(function(tinymce) {
var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera;
@@ -17051,11 +17158,23 @@ tinymce.ForceBlocks = function(editor) {
node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR));
node = node.firstChild;
- // Insert caret container after the formated node
- dom.insertAfter(caretContainer, formatNode);
+ var block = dom.getParent(formatNode, isTextBlock);
+
+ if (block && dom.isEmpty(block)) {
+ // Replace formatNode with caretContainer when removing format from empty block like <p><b>|</b></p>
+ formatNode.parentNode.replaceChild(caretContainer, formatNode);
+ } else {
+ // Insert caret container after the formated node
+ dom.insertAfter(caretContainer, formatNode);
+ }
// Move selection to text node
selection.setCursorLocation(node, 1);
+
+ // If the formatNode is empty, we can remove it safely.
+ if (dom.isEmpty(formatNode)) {
+ dom.remove(formatNode);
+ }
}
};
@@ -17164,6 +17283,7 @@ tinymce.ForceBlocks = function(editor) {
};
};
})(tinymce);
+
tinymce.onAddEditor.add(function(tinymce, ed) {
var filters, fontSizes, dom, settings = ed.settings;
@@ -17220,6 +17340,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
});
}
});
+
(function(tinymce) {
var TreeWalker = tinymce.dom.TreeWalker;
@@ -17243,7 +17364,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
function renderBlockOnIE(block) {
var oldRng;
- if (tinymce.isIE && dom.isBlock(block)) {
+ if (tinymce.isIE && !tinymce.isIE11 && dom.isBlock(block)) {
oldRng = selection.getRng();
block.appendChild(dom.create('span', null, '\u00a0'));
selection.select(block);
@@ -17378,7 +17499,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
}
// BR is needed in empty blocks on non IE browsers
- if (!tinymce.isIE) {
+ if (!tinymce.isIE || tinymce.isIE11) {
caretNode.innerHTML = '<br data-mce-bogus="1">';
}
@@ -17557,7 +17678,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
// Insert extra BR element at the end block elements
- if (!tinymce.isIE && !hasRightSideContent()) {
+ if ((!tinymce.isIE || tinymce.isIE11) && !hasRightSideContent()) {
brElm = dom.create('br');
rng.insertNode(brElm);
rng.setStartAfter(brElm);
@@ -17570,7 +17691,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
rng.insertNode(brElm);
// Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it
- if (tinymce.isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
+ if ((tinymce.isIE && !tinymce.isIE11) && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);
}
@@ -17624,7 +17745,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
var lastChild;
// IE will render the blocks correctly other browsers needs a BR
- if (!tinymce.isIE) {
+ if (!tinymce.isIE || tinymce.isIE11) {
block.normalize(); // Remove empty text nodes that got left behind by the extract
// Check if the block is empty or contains a floated last child
@@ -17789,3 +17910,4 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
});
};
})(tinymce);
+
View
2  vendor/assets/javascripts/tinymce/tiny_mce_popup.js
@@ -2,4 +2,4 @@
// Uncomment and change this document.domain value if you are loading the script cross subdomains
// document.domain = 'moxiecode.com';
-var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
+var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(a){var a=(a&&a.target)||window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE&&!tinymce.isIE11){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}else{if(tinymce.isIE11){document.addEventListener("mouseup",tinyMCEPopup._restoreSelection,false)}}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
View
188 vendor/assets/javascripts/tinymce/tiny_mce_src.js
@@ -6,18 +6,20 @@
var tinymce = {
majorVersion : '3',
- minorVersion : '5.9.pre',
+ minorVersion : '5.9',
- releaseDate : '2013-08-11',
+ releaseDate : '2013-10-10',
_init : function() {
var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
+ t.isIE11 = ua.indexOf('Trident/') != -1 && ua.indexOf('rv:') != -1;
+
t.isOpera = win.opera && opera.buildNumber;
t.isWebKit = /WebKit/.test(ua);
- t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName);
+ t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName) || t.isIE11;
t.isIE6 = t.isIE && /MSIE [56]/.test(ua);
@@ -27,7 +29,7 @@
t.isIE9 = t.isIE && /MSIE [9]/.test(ua);
- t.isGecko = !t.isWebKit && /Gecko/.test(ua);
+ t.isGecko = !t.isWebKit && !t.isIE11 && /Gecko/.test(ua);
t.isMac = ua.indexOf('Mac') != -1;
@@ -504,6 +506,9 @@
// Describe the different namespaces
})(window);
+
+
+
tinymce.create('tinymce.util.Dispatcher', {
scope : null,
listeners : null,
@@ -568,6 +573,7 @@ tinymce.create('tinymce.util.Dispatcher', {
}
});
+
(function() {
var each = tinymce.each;
@@ -818,6 +824,7 @@ tinymce.create('tinymce.util.Dispatcher', {
}
});
})();
+
(function() {
var each = tinymce.each;
@@ -888,6 +895,7 @@ tinymce.create('tinymce.util.Dispatcher', {
}
});
})();
+
(function() {
function serialize(o, quote) {
var i, v, t, name;
@@ -953,6 +961,7 @@ tinymce.create('tinymce.util.Dispatcher', {
};
})();
+
tinymce.create('static tinymce.util.XHR', {
send : function(o) {
var x, t, w = window, c = 0;
@@ -1011,6 +1020,7 @@ tinymce.create('static tinymce.util.XHR', {
}
}
});
+
(function() {
var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR;
@@ -1087,6 +1097,7 @@ tinymce.create('static tinymce.util.XHR', {
}
};
})(tinymce);
+
tinymce.util.Quirks = function(editor) {
var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,
settings = editor.settings, parser = editor.parser, serializer = editor.serializer, each = tinymce.each;
@@ -1932,6 +1943,17 @@ tinymce.util.Quirks = function(editor) {
}
}
+ function bodyHeight() {
+ editor.contentStyles.push('body {min-height: 100px}');
+ editor.onClick.add(function(ed, e) {
+ if (e.target.nodeName == 'HTML') {
+ editor.execCommand('SelectAll');
+ editor.selection.collapse(true);
+ editor.nodeChanged();
+ }
+ });
+ }
+
// All browsers
disableBackspaceIntoATable();
removeBlockQuoteOnBackSpace();
@@ -1955,7 +1977,7 @@ tinymce.util.Quirks = function(editor) {
}
// IE
- if (tinymce.isIE) {
+ if (tinymce.isIE && !tinymce.isIE11) {
removeHrOnBackspace();
ensureBodyHasRoleApplication();
addNewLinesBeforeBrInPre();
@@ -1965,8 +1987,13 @@ tinymce.util.Quirks = function(editor) {
keepNoScriptContents();
}
+ // IE 11+
+ if (tinymce.isIE11) {
+ bodyHeight();
+ }
+
// Gecko
- if (tinymce.isGecko) {
+ if (tinymce.isGecko && !tinymce.isIE11) {
removeHrOnBackspace();
focusBody();
removeStylesWhenDeletingAccrossBlockElements();
@@ -2165,6 +2192,7 @@ tinymce.util.Quirks = function(editor) {
}
};
})(tinymce);
+
tinymce.html.Styles = function(settings, schema) {
var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,
urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,
@@ -2202,6 +2230,12 @@ tinymce.html.Styles = function(settings, schema) {
function compress(prefix, suffix) {
var top, right, bottom, left;
+ // IE 11 will produce a border-image: none when getting the style attribute from <p style="border: 1px solid red"></p>
+ // So lets asume it shouldn't be there
+ if (styles['border-image'] === 'none') {
+ delete styles['border-image'];
+ }
+
// Get values and check it it needs compressing
top = styles[prefix + '-top' + suffix];
if (!top)
@@ -2387,6 +2421,7 @@ tinymce.html.Styles = function(settings, schema) {
}
};
};
+
(function(tinymce) {
var mapCache = {}, makeMap = tinymce.makeMap, each = tinymce.each;
@@ -3107,6 +3142,7 @@ tinymce.html.Styles = function(settings, schema) {
self.elements = elements;
};
})(tinymce);
+
(function(tinymce) {
tinymce.html.SaxParser = function(settings, schema) {
var self = this, noop = function() {};
@@ -3397,6 +3433,7 @@ tinymce.html.Styles = function(settings, schema) {
};
}
})(tinymce);
+
(function(tinymce) {
var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = {
'#text' : 3,
@@ -3729,6 +3766,7 @@ tinymce.html.Styles = function(settings, schema) {
tinymce.html.Node = Node;
})(tinymce);
+
(function(tinymce) {
var Node = tinymce.html.Node;
@@ -4351,6 +4389,7 @@ tinymce.html.Styles = function(settings, schema) {
}
}
})(tinymce);
+
tinymce.html.Writer = function(settings) {
var html = [], indent, indentBefore, indentAfter, encode, htmlOutput;
@@ -4450,6 +4489,7 @@ tinymce.html.Writer = function(settings) {
}
};
};
+
(function(tinymce) {
tinymce.html.Serializer = function(settings, schema) {
var self = this, writer = new tinymce.html.Writer(settings);
@@ -4565,6 +4605,7 @@ tinymce.html.Writer = function(settings) {
};
}
})(tinymce);
+
// JSLint defined globals
/*global tinymce:false, window:false */
@@ -5110,6 +5151,7 @@ tinymce.dom = {};
namespace = 0;
})(tinymce.dom, 'data-mce-expando'); // Namespace and expando
+
tinymce.dom.TreeWalker = function(start_node, root_node) {
var node = start_node;
@@ -5149,6 +5191,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
return (node = findSibling(node, 'lastChild', 'previousSibling', shallow));
};
};
+
(function(tinymce) {
// Shorten names
var each = tinymce.each,
@@ -5236,7 +5279,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
fixDoc: function(doc) {
var settings = this.settings, name;
- if (isIE && settings.schema) {
+ if (isIE && !tinymce.isIE11 && settings.schema) {
// Add missing HTML 4/5 elements to IE
('abbr article aside audio canvas ' +
'details figcaption figure footer ' +
@@ -5257,7 +5300,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
var self = this, clone, doc;
// TODO: Add feature detection here in the future
- if (!isIE || node.nodeType !== 1 || deep) {
+ if (!isIE || tinymce.isIE11 || node.nodeType !== 1 || deep) {
return node.cloneNode(deep);
}
@@ -5530,7 +5573,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
switch (na) {
case 'opacity':
// IE specific opacity
- if (isIE) {
+ if (isIE && ! tinymce.isIE11) {
s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")";
if (!n.currentStyle || !n.currentStyle.hasLayout)
@@ -5542,7 +5585,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
break;
case 'float':
- isIE ? s.styleFloat = v : s.cssFloat = v;
+ (isIE && ! tinymce.isIE11) ? s.styleFloat = v : s.cssFloat = v;
break;
default:
@@ -5908,7 +5951,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug
// This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading
// It's ugly but it seems to work fine.
- if (isIE && d.documentMode && d.recalc) {
+ if (isIE && !tinymce.isIE11 && d.documentMode && d.recalc) {
link.onload = function() {
if (d.recalc)
d.recalc();
@@ -6227,7 +6270,12 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// Import
case 3:
- addClasses(r.styleSheet);
+ try {
+ addClasses(r.styleSheet);
+ } catch (ex) {
+ // Ignore
+ }
+
break;
}
});
@@ -6563,6 +6611,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0});
})(tinymce);
+
(function(ns) {
// Range constructor
function Range(dom) {
@@ -7267,6 +7316,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
return this.toStringIE();
};
})(tinymce.dom);
+
(function() {
function Selection(selection) {
var self = this, dom = selection.dom, TRUE = true, FALSE = false;
@@ -7740,6 +7790,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
tinymce.dom.TridentSelection = Selection;
})();
+
/*
* Sizzle CSS Selector Engine
* Copyright, The Dojo Foundation
@@ -9182,6 +9233,7 @@ window.tinymce.dom.Sizzle = Sizzle;
})();
+
(function(tinymce) {
tinymce.dom.Element = function(id, settings) {
var t = this, dom, el;
@@ -9290,6 +9342,7 @@ window.tinymce.dom.Sizzle = Sizzle;
});
};
})(tinymce);
+
(function(tinymce) {
function trimNl(s) {
return s.replace(/[\n\r]+/g, '');
@@ -9324,7 +9377,7 @@ window.tinymce.dom.Sizzle = Sizzle;
if (!t.win.getSelection)
t.tridentSel = new tinymce.dom.TridentSelection(t);
- if (tinymce.isIE && dom.boxModel)
+ if (tinymce.isIE && ! tinymce.isIE11 && dom.boxModel)
this._fixIESelection();
// Prevent leaks
@@ -9616,8 +9669,20 @@ window.tinymce.dom.Sizzle = Sizzle;
}
// Handle simple range
- if (type)
- return {rng : t.getRng()};
+ if (type) {
+ rng = t.getRng();
+
+ if (rng.setStart) {
+ rng = {
+ startContainer: rng.startContainer,
+ startOffset: rng.startOffset,
+ endContainer: rng.endContainer,
+ endOffset: rng.endOffset
+ };
+ }
+
+ return {rng : rng};
+ }
rng = t.getRng();
id = dom.uniqueId();
@@ -9683,7 +9748,7 @@ window.tinymce.dom.Sizzle = Sizzle;
},
moveToBookmark : function(bookmark) {
- var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset;
+ var t = this, dom = t.dom, marker1, marker2, rng, rng2, root, startContainer, endContainer, startOffset, endOffset;
function setEndPoint(start) {
var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
@@ -9813,8 +9878,24 @@ window.tinymce.dom.Sizzle = Sizzle;
}
} else if (bookmark.name) {
t.select(dom.select(bookmark.name)[bookmark.index]);
- } else if (bookmark.rng)
- t.setRng(bookmark.rng);
+ } else if (bookmark.rng) {
+ rng = bookmark.rng;
+
+ if (rng.startContainer) {
+ rng2 = t.dom.createRng();
+
+ try {
+ rng2.setStart(rng.startContainer, rng.startOffset);
+ rng2.setEnd(rng.endContainer, rng.endOffset);
+ } catch (e) {
+ // Might fail with index error
+ }
+
+ rng = rng2;
+ }
+
+ t.setRng(rng);
+ }
}
},
@@ -9913,7 +9994,7 @@ window.tinymce.dom.Sizzle = Sizzle;
}
// We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
- if (tinymce.isIE && rng && rng.setStart && doc.selection.createRange().item) {
+ if (tinymce.isIE && ! tinymce.isIE11 && rng && rng.setStart && doc.selection.createRange().item) {
elm = doc.selection.createRange().item(0);
rng = doc.createRange();
rng.setStartBefore(elm);
@@ -10429,6 +10510,7 @@ window.tinymce.dom.Sizzle = Sizzle;
}
});
})(tinymce);
+
(function(tinymce) {
tinymce.dom.Serializer = function(settings, dom, schema) {
var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser;
@@ -10777,7 +10859,7 @@ window.tinymce.dom.Sizzle = Sizzle;
// Add onload listener for non IE browsers since IE9
// fires onload event before the script is parsed and executed
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
elm.onload = done;
// Add onerror event will get fired on some browsers but not all of them
@@ -10905,6 +10987,7 @@ window.tinymce.dom.Sizzle = Sizzle;
// Global script loader
tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();
})(tinymce);
+
(function(tinymce) {
tinymce.dom.RangeUtils = function(dom) {
var INVISIBLE_CHAR = '\uFEFF';
@@ -11103,6 +11186,7 @@ window.tinymce.dom.Sizzle = Sizzle;
return false;
};
})(tinymce);
+
(function(tinymce) {
var Event = tinymce.dom.Event, each = tinymce.each;
@@ -11259,6 +11343,7 @@ window.tinymce.dom.Sizzle = Sizzle;
}
});
})(tinymce);
+
(function(tinymce) {
// Shorten class names
var DOM = tinymce.DOM, is = tinymce.is;
@@ -11383,6 +11468,7 @@ tinymce.create('tinymce.ui.Container:tinymce.ui.Control', {
}
});
+
tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
Separator : function(id, s) {
this.parent(id, s);
@@ -11394,6 +11480,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
return tinymce.DOM.createHTML('span', {'class' : this.classPrefix, role : 'separator', 'aria-orientation' : 'vertical', tabindex : '-1'});
}
});
+
(function(tinymce) {
var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
@@ -11424,6 +11511,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
@@ -11930,6 +12018,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, undef;
@@ -12225,6 +12314,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, undef;
@@ -12361,6 +12451,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
@@ -12453,6 +12544,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
@@ -12536,6 +12628,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;
@@ -12745,6 +12838,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
}
});
})(tinymce);
+
(function(tinymce) {
// Shorten class names
var dom = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event;
@@ -12804,6 +12898,7 @@ tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', {
}
});
})(tinymce);
+
(function(tinymce) {
// Shorten class names
var dom = tinymce.DOM, each = tinymce.each;
@@ -12870,6 +12965,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
}
});
})(tinymce);
+
(function(tinymce) {
var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;
@@ -13236,7 +13332,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
ed.render();
// Fix IE memory leaks
- if (tinymce.isIE) {
+ if (tinymce.isIE && ! tinymce.isIE11) {
w.attachEvent('onunload', clr);
}
@@ -13634,10 +13730,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Store away the selection when it's changed to it can be restored later with a editor.focus() call
if (isIE) {
t.onInit.add(function(ed) {
- ed.dom.bind(ed.getBody(), 'beforedeactivate keydown', function() {
- ed.lastIERng = ed.selection.getRng();
+ ed.dom.bind(ed.getBody(), 'beforedeactivate keydown keyup', function() {
+ ed.bookmark = ed.selection.getBookmark(1);
});
});
+
+ t.onNodeChange.add(function(ed) {
+ if (document.activeElement.id == ed.id + "_ifr") {
+ ed.bookmark = ed.selection.getBookmark(1);
+ }
+ });
}
}
@@ -13957,8 +14059,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, ieRng, controlElm, doc = self.getDoc(), body;
if (!skip_focus) {
- if (self.lastIERng) {
- selection.setRng(self.lastIERng);
+ if (self.bookmark) {
+ selection.moveToBookmark(self.bookmark);
+ self.bookmark = null;
}
// Get selected control element
@@ -13979,7 +14082,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
body = self.getBody();
// Check for setActive since it doesn't scroll to the element
- if (body.setActive) {
+ if (body.setActive && ! tinymce.isIE11) {
body.setActive();
} else {
body.focus();
@@ -15532,6 +15635,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
});
};
})(tinymce);
+
(function(tinymce) {
var Dispatcher = tinymce.util.Dispatcher;
@@ -15751,6 +15855,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
return self;
};
})(tinymce);
+
tinymce.ForceBlocks = function(editor) {
var settings = editor.settings, dom = editor.dom, selection = editor.selection, blockElements = editor.schema.getBlockElements();
@@ -15856,6 +15961,7 @@ tinymce.ForceBlocks = function(editor) {
editor.onNodeChange.add(addRootBlocks);
}
};
+
(function(tinymce) {
// Shorten names
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;
@@ -16248,6 +16354,7 @@ tinymce.ForceBlocks = function(editor) {
}
});
})(tinymce);
+
(function(tinymce) {
var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera;
@@ -18265,11 +18372,23 @@ tinymce.ForceBlocks = function(editor) {
node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR));
node = node.firstChild;
- // Insert caret container after the formated node
- dom.insertAfter(caretContainer, formatNode);
+ var block = dom.getParent(formatNode, isTextBlock);
+
+ if (block && dom.isEmpty(block)) {
+ // Replace formatNode with caretContainer when removing format from empty block like <p><b>|</b></p>
+ formatNode.parentNode.replaceChild(caretContainer, formatNode);
+ } else {
+ // Insert caret container after the formated node
+ dom.insertAfter(caretContainer, formatNode);
+ }
// Move selection to text node
selection.setCursorLocation(node, 1);
+
+ // If the formatNode is empty, we can remove it safely.
+ if (dom.isEmpty(formatNode)) {
+ dom.remove(formatNode);
+ }
}
};
@@ -18378,6 +18497,7 @@ tinymce.ForceBlocks = function(editor) {
};
};
})(tinymce);
+
tinymce.onAddEditor.add(function(tinymce, ed) {
var filters, fontSizes, dom, settings = ed.settings;
@@ -18434,6 +18554,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
});
}
});
+
(function(tinymce) {
var TreeWalker = tinymce.dom.TreeWalker;
@@ -18457,7 +18578,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
function renderBlockOnIE(block) {
var oldRng;
- if (tinymce.isIE && dom.isBlock(block)) {
+ if (tinymce.isIE && !tinymce.isIE11 && dom.isBlock(block)) {
oldRng = selection.getRng();
block.appendChild(dom.create('span', null, '\u00a0'));
selection.select(block);
@@ -18592,7 +18713,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
}
// BR is needed in empty blocks on non IE browsers
- if (!tinymce.isIE) {
+ if (!tinymce.isIE || tinymce.isIE11) {
caretNode.innerHTML = '<br data-mce-bogus="1">';
}
@@ -18771,7 +18892,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
// Insert extra BR element at the end block elements
- if (!tinymce.isIE && !hasRightSideContent()) {
+ if ((!tinymce.isIE || tinymce.isIE11) && !hasRightSideContent()) {
brElm = dom.create('br');
rng.insertNode(brElm);
rng.setStartAfter(brElm);
@@ -18784,7 +18905,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
rng.insertNode(brElm);
// Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it
- if (tinymce.isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
+ if ((tinymce.isIE && !tinymce.isIE11) && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);
}
@@ -18838,7 +18959,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
var lastChild;
// IE will render the blocks correctly other browsers needs a BR
- if (!tinymce.isIE) {
+ if (!tinymce.isIE || tinymce.isIE11) {
block.normalize(); // Remove empty text nodes that got left behind by the extract
// Check if the block is empty or contains a floated last child
@@ -19003,3 +19124,4 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
});
};
})(tinymce);
+
Please sign in to comment.
Something went wrong with that request. Please try again.