1 line
6.5 KiB
JavaScript
1 line
6.5 KiB
JavaScript
![]() |
!function(e,t){"use strict";function n(e,t){for(var n,o=[],i=0;i<e.length;++i){if(n=l[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(){l[e]=i.apply(null,arguments)})}function i(e){return!!l[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 a(n){for(var o=0;o<n.length;o++){for(var i=e,r=n[o],a=r.split(/[.\/]/),s=0;s<a.length-1;++s)i[a[s]]===t&&(i[a[s]]={}),i=i[a[s]];i[a[a.length-1]]=l[r]}}var l={},s="tinymce/spellcheckerplugin/DomTextMatcher",c="tinymce/spellcheckerplugin/Plugin",d="tinymce/PluginManager",u="tinymce/util/Tools",f="tinymce/ui/Menu",m="tinymce/dom/DOMUtils",p="tinymce/util/JSONRequest",g="tinymce/util/URI";o(s,[],function(){return function(e,t,n){function o(e){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var t=e.index;return[t,t+e[0].length,[e[0]]]}function i(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!g[e.nodeName])return"";if(t="",(g[e.nodeName]||v[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=i(e);while(e=e.nextSibling);return t}function r(e,t,n){var o,i,r,a,l=[],s=0,c=e,d=t.shift(),u=0;e:for(;;){if((g[c.nodeName]||v[c.nodeName])&&s++,3===c.nodeType&&(!i&&c.length+s>=d[1]?(i=c,a=d[1]-s):o&&l.push(c),!o&&c.length+s>d[0]&&(o=c,r=d[0]-s),s+=c.length),o&&i){if(c=n({startNode:o,startNodeIndex:r,endNode:i,endNodeIndex:a,innerNodes:l,match:d[2],matchIndex:u}),s-=i.length-a,o=null,i=null,l=[],d=t.shift(),u++,!d)break}else{if((!h[c.nodeName]||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:p.createElement(e);t=function(e,t){var o=n.cloneNode(!1);return o.setAttribute("data-mce-index",t),e&&o.appendChild(p.createTextNode(e)),o}}else t=e;return function o(e){var n,o,i,r=e.startNode,a=e.endNode,l=e.matchIndex;if(r===a){var s=r;i=s.parentNode,e.startNodeIndex>0&&(n=p.createTextNode(s.data.substring(0,e.startNodeIndex)),i.insertBefore(n,s));var c=t(e.match[0],l);return i.insertBefore(c,s),e.endNodeIndex<s.length&&(o=p.createTextNode(s.data.substring(e.endNodeIndex)),i.insertBefore(o,s)),s.parentNode.removeChild(s),c}n=p.createTextNode(r.data.substring(0,e.startNodeIndex)),o=p.createTextNode(a.data.substring(e.endNodeIndex));for(var d=t(r.data.substring(e.startNodeIndex),l),u=[],f=0,m=e.innerNodes.length;m>f;++f){var g=e.innerNodes[f],h=t(g.data,l);g.parentNode.replaceChild(h,g),u.push(h)}var v=t(a.data.substring(0,e.endNodeIndex),l);return i=r.parentNode,i.insertBefore(n,r),i.insertBefore(d,r),i.removeChild(r),i=a.parentNode,i.insertBefore(v,a),i.insertBefore(o,a),i.removeChild(a),v}}function l(e){var t=[];return s(function(n,o){e(n,o)&&t.push(n)}),u=t,this}function s(e){for(var t=0,n=u.length;n>t&&e(u[t],t)!==!1;t++);return this}function c(e){return u.length&&(m=u.length,r(t,u,a(e))),this}var d,u=[],f,m=0,p,g,h,v;if(p=t.ownerDocument,g=n.getBlockElements(),h=n.getWhiteSpaceElements(),v=n.getShortEndedElements(),f=i(t),f&&e.global)for(;d=e.exec(f);)u.push(o(d));return{text:f,count:m,matches:u,each:s,filter:l,mark:c}}}),o(c,[s,d,u,f,m,p,g],function(e,t,n,o,i,r,a){t.add("spellchecker",function(t,l){function s(e){for(var t in e)return!1;return!0}function c(e,r){var a=[],l=h[r];n.each(l,function(e){a.push({text:e,onclick:function(){t.insertContent(e),u()}})}),a.push.apply(a,[{text:"-"},{text:"Ignore",onclick:function(){m(e,r)}},{text:"Ignore all",onclick:function(){m(e,r,!0)}},{text:"Finish",onclick:p}]),b=new o({items:a,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){b.remove(),b=null}}),b.renderTo(docum
|