You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
roundcubemail/program/js/tinymce/plugins/spellchecker/plugin.min.js

1 line
9.1 KiB
JavaScript

!function(e,t){"use strict";function n(e,t){for(var n,r=[],o=0;o<e.length;++o){if(n=c[e[o]]||i(e[o]),!n)throw"module definition dependecy not found: "+e[o];r.push(n)}t.apply(null,r)}function r(e,r,o){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(o===t)throw"invalid module definition, definition function must be specified";n(r,function(){c[e]=o.apply(null,arguments)})}function o(e){return!!c[e]}function i(t){for(var n=e,r=t.split(/[.\/]/),o=0;o<r.length;++o){if(!n[r[o]])return;n=n[r[o]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var o=e,i=n[r],a=i.split(/[.\/]/),l=0;l<a.length-1;++l)o[a[l]]===t&&(o[a[l]]={}),o=o[a[l]];o[a[a.length-1]]=c[i]}}var c={},l="tinymce/spellcheckerplugin/DomTextMatcher",s="tinymce/spellcheckerplugin/Plugin",d="tinymce/PluginManager",u="tinymce/util/Tools",f="tinymce/ui/Menu",h="tinymce/dom/DOMUtils",g="tinymce/util/XHR",m="tinymce/util/URI",p="tinymce/util/JSON";r(l,[],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 r(e){var t;if(3===e.nodeType)return e.data;if(T[e.nodeName]&&!S[e.nodeName])return"";if(t="",(S[e.nodeName]||B[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=r(e);while(e=e.nextSibling);return t}function o(e,t,n){var r,o,i,a,c=[],l=0,s=e,d,u=0;t=t.slice(0),t.sort(function(e,t){return e.start-t.start}),d=t.shift();e:for(;;){if((S[s.nodeName]||B[s.nodeName])&&l++,3===s.nodeType&&(!o&&s.length+l>=d.end?(o=s,a=d.end-l):r&&c.push(s),!r&&s.length+l>d.start&&(r=s,i=d.start-l),l+=s.length),r&&o){if(s=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:c,match:d.text,matchIndex:u}),l-=o.length-a,r=null,o=null,c=[],d=t.shift(),u++,!d)break}else{if((!T[s.nodeName]||S[s.nodeName])&&s.firstChild){s=s.firstChild;continue}if(s.nextSibling){s=s.nextSibling;continue}}for(;;){if(s.nextSibling){s=s.nextSibling;break}if(s.parentNode===e)break e;s=s.parentNode}}}function i(e){function t(t,n){var r=w[n];r.stencil||(r.stencil=e(r));var o=r.stencil.cloneNode(!1);return o.setAttribute("data-mce-index",n),t&&o.appendChild(b.doc.createTextNode(t)),o}return function(e){var n,r,o,i=e.startNode,a=e.endNode,c=e.matchIndex,l=b.doc;if(i===a){var s=i;o=s.parentNode,e.startNodeIndex>0&&(n=l.createTextNode(s.data.substring(0,e.startNodeIndex)),o.insertBefore(n,s));var d=t(e.match,c);return o.insertBefore(d,s),e.endNodeIndex<s.length&&(r=l.createTextNode(s.data.substring(e.endNodeIndex)),o.insertBefore(r,s)),s.parentNode.removeChild(s),d}n=l.createTextNode(i.data.substring(0,e.startNodeIndex)),r=l.createTextNode(a.data.substring(e.endNodeIndex));for(var u=t(i.data.substring(e.startNodeIndex),c),f=[],h=0,g=e.innerNodes.length;g>h;++h){var m=e.innerNodes[h],p=t(m.data,c);m.parentNode.replaceChild(p,m),f.push(p)}var v=t(a.data.substring(0,e.endNodeIndex),c);return o=i.parentNode,o.insertBefore(n,i),o.insertBefore(u,i),o.removeChild(i),o=a.parentNode,o.insertBefore(v,a),o.insertBefore(r,a),o.removeChild(a),v}}function a(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function c(t){var n=e.getElementsByTagName("*"),r=[];t="number"==typeof t?""+t:null;for(var o=0;o<n.length;o++){var i=n[o],a=i.getAttribute("data-mce-index");null!==a&&a.length&&(a===t||null===t)&&r.push(i)}return r}function l(e){for(var t=w.length;t--;)if(w[t]===e)return t;return-1}function s(e){var t=[];return d(function(n,r){e(n,r)&&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&&o(e,w,i(t)),this}function f(e,t){if(y&&e.global)for(;k=e.exec(y);)w.push(n(k,t));return this}function h(e){var t,n=c(e?l(e):null);for(t=n.length;t--;)a(n[t]);return this}function g(e){return w[e.getAttribute("data-mce-index")]}function m(e){return c(l(e))[0]}function p(e,t,n){return w.push({start:e,end:e+t,text:y.substr(e,t),data:n}),this}function v(e){var n=c(l(e)),r=t.dom.createR