tinymce-editor/copy_this/modules/hdi/hdi-tinymce/tinymce/plugins/spellchecker/plugin.min.js

1 line
8.1 KiB
JavaScript
Raw Normal View History

2014-03-24 01:27:32 +01:00
!function(e,t){"use strict";function n(e,t){for(var n,o=[],r=0;r<e.length;++r){if(n=l[e[r]]||i(e[r]),!n)throw"module definition dependecy not found: "+e[r];o.push(n)}t.apply(null,o)}function o(e,o,r){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(r===t)throw"invalid module definition, definition function must be specified";n(o,function(){l[e]=r.apply(null,arguments)})}function r(e){return!!l[e]}function i(t){for(var n=e,o=t.split(/[.\/]/),r=0;r<o.length;++r){if(!n[o[r]])return;n=n[o[r]]}return n}function a(n){for(var o=0;o<n.length;o++){for(var r=e,i=n[o],a=i.split(/[.\/]/),s=0;s<a.length-1;++s)r[a[s]]===t&&(r[a[s]]={}),r=r[a[s]];r[a[a.length-1]]=l[i]}}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){function n(e,t){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function o(e){var t;if(3===e.nodeType)return e.data;if(S[e.nodeName]&&!N[e.nodeName])return"";if(t="",(N[e.nodeName]||k[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=o(e);while(e=e.nextSibling);return t}function r(e,t,n){var o,r,i,a,l=[],s=0,c=e,d,u=0;t=t.slice(0),t.sort(function(e,t){return e.start-t.start}),d=t.shift();e:for(;;){if((N[c.nodeName]||k[c.nodeName])&&s++,3===c.nodeType&&(!r&&c.length+s>=d.end?(r=c,a=d.end-s):o&&l.push(c),!o&&c.length+s>d.start&&(o=c,i=d.start-s),s+=c.length),o&&r){if(c=n({startNode:o,startNodeIndex:i,endNode:r,endNodeIndex:a,innerNodes:l,match:d.text,matchIndex:u}),s-=r.length-a,o=null,r=null,l=[],d=t.shift(),u++,!d)break}else{if((!S[c.nodeName]||N[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 i(e){function t(t,n){var o=w[n];o.stencil||(o.stencil=e(o));var r=o.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",n),t&&r.appendChild(P.doc.createTextNode(t)),r}return function(e){var n,o,r,i=e.startNode,a=e.endNode,l=e.matchIndex,s=P.doc;if(i===a){var c=i;r=c.parentNode,e.startNodeIndex>0&&(n=s.createTextNode(c.data.substring(0,e.startNodeIndex)),r.insertBefore(n,c));var d=t(e.match,l);return r.insertBefore(d,c),e.endNodeIndex<c.length&&(o=s.createTextNode(c.data.substring(e.endNodeIndex)),r.insertBefore(o,c)),c.parentNode.removeChild(c),d}n=s.createTextNode(i.data.substring(0,e.startNodeIndex)),o=s.createTextNode(a.data.substring(e.endNodeIndex));for(var u=t(i.data.substring(e.startNodeIndex),l),f=[],m=0,p=e.innerNodes.length;p>m;++m){var g=e.innerNodes[m],h=t(g.data,l);g.parentNode.replaceChild(h,g),f.push(h)}var v=t(a.data.substring(0,e.endNodeIndex),l);return r=i.parentNode,r.insertBefore(n,i),r.insertBefore(u,i),r.removeChild(i),r=a.parentNode,r.insertBefore(v,a),r.insertBefore(o,a),r.removeChild(a),v}}function a(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function l(t){var n=e.getElementsByTagName("*"),o=[];t="number"==typeof t?""+t:null;for(var r=0;r<n.length;r++){var i=n[r],a=i.getAttribute("data-mce-index");null!==a&&a.length&&(a===t||null===t)&&o.push(i)}return o}function s(e){for(var t=w.length;t--;)if(w[t]===e)return t;return-1}function c(e){var t=[];return d(function(n,o){e(n,o)&&t.push(n)}),w=t,this}function d(e){for(var t=0,n=w.length;n>t&&e(w[t],t)!==!1;t++);return this}function u(t){return w.length&&r(e,w,i(t)),this}function f(e,t){if(C&&e.global)for(;x=e.exec(C);)w.push(n(x,t));return this}function m(e){var t,n=l(e?s(e):null);for(t=n.length;t--;)a(n[t]);return this}function p(e){return w[e.getAttribute("data-mce-index")]}function g(e){return l(s(e))[0]}function h(e,t,n){return w.push({start:e,end:e+t,text:C.substr(e,t),data:n}),this}function v(e){var n=l(s(e)),o=t.dom.createRng();return o.