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
8.7 KiB
JavaScript

11 years ago
!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",u="tinymce/PluginManager",d="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,u,d=0;t=t.slice(0),t.sort(function(e,t){return e.start-t.start}),u=t.shift();e:for(;;){if((S[s.nodeName]||B[s.nodeName])&&l++,3===s.nodeType&&(!o&&s.length+l>=u.end?(o=s,a=u.end-l):r&&c.push(s),!r&&s.length+l>u.start&&(r=s,i=u.start-l),l+=s.length),r&&o){if(s=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:c,match:u.text,matchIndex:d}),l-=o.length-a,r=null,o=null,c=[],u=t.shift(),d++,!u)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=b[n];r.stencil||(r.stencil=e(r));var o=r.stencil.cloneNode(!1);return o.setAttribute("data-mce-index",n),t&&o.appendChild(y.doc.createTextNode(t)),o}return function(e){var n,r,o,i=e.startNode,a=e.endNode,c=e.matchIndex,l=y.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 u=t(e.match,c);return o.insertBefore(u,s),e.endNodeIndex<s.length&&(r=l.createTextNode(s.data.substring(e.endNodeIndex)),o.insertBefore(r,s)),s.parentNode.removeChild(s),u}n=l.createTextNode(i.data.substring(0,e.startNodeIndex)),r=l.createTextNode(a.data.substring(e.endNodeIndex));for(var d=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(d,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=b.length;t--;)if(b[t]===e)return t;return-1}function s(e){var t=[];return u(function(n,r){e(n,r)&&t.push(n)}),b=t,this}function u(e){for(var t=0,n=b.length;n>t&&e(b[t],t)!==!1;t++);return this}function d(t){return b.length&&o(e,b,i(t)),this}function f(e,t){if(w&&e.global)for(;k=e.exec(w);)b.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 b[e.getAttribute("data-mce-index")]}function m(e){return c(l(e))[0]}function p(e,t,n){return b.push({start:e,end:e+t,text:w.substr(e,t),data:n}),this}function v(e){var n=c(l(e)),r=t.dom.createR