tinymce-rails 4.9.11.1 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -6
- data/app/assets/source/tinymce/tinymce.js +14735 -15357
- data/lib/tinymce/rails/asset_installer/compile.rb +2 -2
- data/lib/tinymce/rails/asset_installer.rb +1 -1
- data/lib/tinymce/rails/asset_manifest.rb +4 -9
- data/lib/tinymce/rails/configuration.rb +2 -2
- data/lib/tinymce/rails/configuration_file.rb +3 -4
- data/lib/tinymce/rails/engine.rb +1 -5
- data/lib/tinymce/rails/helper.rb +1 -1
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +92 -1
- data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/js/emojis.js +2 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +9 -0
- data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/skins/content/default/content.css +44 -0
- data/vendor/assets/javascripts/tinymce/skins/content/default/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/content/document/content.css +48 -0
- data/vendor/assets/javascripts/tinymce/skins/content/document/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/content/writer/content.css +45 -0
- data/vendor/assets/javascripts/tinymce/skins/content/writer/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.mobile.min.css +2 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +9 -1
- data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +9 -0
- data/vendor/assets/javascripts/tinymce/tinymce.js +9 -2
- metadata +24 -46
- data/vendor/assets/config/tinymce-rails.manifest.js +0 -8
- data/vendor/assets/javascripts/tinymce/plugins/codesample/css/prism.css +0 -138
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/help/img/logo.png +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/css/visualblocks.css +0 -154
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.inline.min.css +0 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.min.css +0 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.svg +0 -63
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.svg +0 -132
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/object.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.min.css +0 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.mobile.min.css +0 -2
- data/vendor/assets/javascripts/tinymce/themes/inlite/theme.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +0 -1
- /data/vendor/assets/javascripts/tinymce/skins/{lightgray → ui/oxide}/content.mobile.min.css +0 -0
- /data/vendor/assets/javascripts/tinymce/skins/{lightgray → ui/oxide}/fonts/tinymce-mobile.woff +0 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var e,n,r,t,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=0,i=function(e,n,r){var t,o,i;e.plugins.table?e.plugins.table.insertTable(n,r):(o=n,i=r,(t=e).undoManager.transact(function(){var e,n;t.insertContent(function(e,n){var r,t,o;for(o='<table data-mce-id="mce" style="width: 100%">',o+="<tbody>",t=0;t<n;t++){for(o+="<tr>",r=0;r<e;r++)o+="<td><br></td>";o+="</tr>"}return o+="</tbody>",o+="</table>"}(o,i)),(e=t.dom.select("*[data-mce-id]")[0]).removeAttribute("data-mce-id"),n=t.dom.select("td,th",e),t.selection.setCursorLocation(n[0],0)}))},u=function(e,n,r){var t,o,i,u;o=(t=e.editorUpload.blobCache).create((i="mceu",u=(new Date).getTime(),i+"_"+Math.floor(1e9*Math.random())+ ++s+String(u)),r,n),t.add(o),e.insertContent(e.dom.createHTML("img",{src:o.blobUri()}))},a="undefined"!=typeof window?window:Function("return this;")(),c=function(e,n){return function(e,n){for(var r=n!==undefined&&null!==n?n:a,t=0;t<e.length&&r!==undefined&&null!==r;++t)r=r[e[t]];return r}(e.split("."),n)},f=function(e,n){var r=c(e,n);if(r===undefined||null===r)throw e+" not available on this browser";return r},d=tinymce.util.Tools.resolve("tinymce.util.Promise"),l=function(t){return new d(function(e){var n=function r(){return new(f("FileReader"))}();n.onloadend=function(){e(n.result.split(",")[1])},n.readAsDataURL(t)})},m=function(){return new d(function(n){var e;(e=document.createElement("input")).type="file",e.style.position="fixed",e.style.left=0,e.style.top=0,e.style.opacity=.001,document.body.appendChild(e),e.onchange=function(e){n(Array.prototype.slice.call(e.target.files))},e.click(),e.parentNode.removeChild(e)})},v=function(r){r.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:function(){m().then(function(e){var n=e[0];l(n).then(function(e){u(r,e,n)})})}}),r.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:function(){i(r,2,2)}})},h=function(e){return function(){return e}},g=h(!1),p=h(!0),b=g,O=p,N=function(){return T},T=(t={fold:function(e,n){return e()},is:b,isSome:b,isNone:O,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:n,map:N,ap:N,each:function(){},bind:N,flatten:N,exists:b,forall:O,filter:N,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:h("none()")},Object.freeze&&Object.freeze(t),t),w=function(r){var e=function(){return r},n=function(){return o},t=function(e){return e(r)},o={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:O,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(r))},ap:function(e){return e.fold(N,function(e){return w(e(r))})},each:function(e){e(r)},bind:t,flatten:e,exists:t,forall:t,filter:function(e){return e(r)?o:T},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(b,function(e){return n(r,e)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return o},E={some:w,none:N,from:function(e){return null===e||e===undefined?T:w(e)}},y=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:h(e)}},S={fromHtml:function(e,n){var r=(n||document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return y(r.childNodes[0])},fromTag:function(e,n){var r=(n||document).createElement(e);return y(r)},fromText:function(e,n){var r=(n||document).createTextNode(e);return y(r)},fromDom:y,fromPoint:function(e,n,r){var t=e.dom();return E.from(t.elementFromPoint(n,r)).map(y)}},x=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE,Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),k=(Node.TEXT_NODE,Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&Array.prototype.isPrototypeOf(e)?"array":"object"===n&&String.prototype.isPrototypeOf(e)?"string":n}(e)===n}}),C=k("string"),D=k("object"),_=k("array"),A=k("boolean"),R=k("undefined"),M=k("function");Array.prototype.slice;function I(e,n,r,t,o){return e(r,t)?E.some(r):M(o)&&o(r)?E.none():n(r,t,o)}M(Array.from)&&Array.from;var q,L,U,F,B=function(e,n){var r=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}return undefined}(e,n);if(!r)return{major:0,minor:0};var t=function(e){return Number(n.replace(r,"$"+e))};return j(t(1),t(2))},P=function(){return j(0,0)},j=function(e,n){return{major:e,minor:n}},H={nu:j,detect:function(e,n){var r=String(n).toLowerCase();return 0===e.length?P():B(e,r)},unknown:P},W="Firefox",X=function(e,n){return function(){return n===e}},z=function(e){var n=e.current;return{current:n,version:e.version,isEdge:X("Edge",n),isChrome:X("Chrome",n),isIE:X("IE",n),isOpera:X("Opera",n),isFirefox:X(W,n),isSafari:X("Safari",n)}},Y={unknown:function(){return z({current:undefined,version:H.unknown()})},nu:z,edge:h("Edge"),chrome:h("Chrome"),ie:h("IE"),opera:h("Opera"),firefox:h(W),safari:h("Safari")},G="Windows",$="Android",V="Solaris",J="FreeBSD",K=function(e,n){return function(){return n===e}},Q=function(e){var n=e.current;return{current:n,version:e.version,isWindows:K(G,n),isiOS:K("iOS",n),isAndroid:K($,n),isOSX:K("OSX",n),isLinux:K("Linux",n),isSolaris:K(V,n),isFreeBSD:K(J,n)}},Z={unknown:function(){return Q({current:undefined,version:H.unknown()})},nu:Q,windows:h(G),ios:h("iOS"),android:h($),linux:h("Linux"),osx:h("OSX"),solaris:h(V),freebsd:h(J)},ee=function(e,n){var r=String(n).toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++){var o=e[r];if(n(o,r,e))return E.some(o)}return E.none()}(e,function(e){return e.search(r)})},ne=function(e,r){return ee(e,r).map(function(e){var n=H.detect(e.versionRegexes,r);return{current:e.name,version:n}})},re=function(e,r){return ee(e,r).map(function(e){var n=H.detect(e.versionRegexes,r);return{current:e.name,version:n}})},te=function(e,n){return-1!==e.indexOf(n)},oe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ie=function(n){return function(e){return te(e,n)}},ue=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return te(e,"edge/")&&te(e,"chrome")&&te(e,"safari")&&te(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,oe],search:function(e){return te(e,"chrome")&&!te(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return te(e,"msie")||te(e,"trident")}},{name:"Opera",versionRegexes:[oe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ie("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ie("firefox")},{name:"Safari",versionRegexes:[oe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(te(e,"safari")||te(e,"mobile/"))&&te(e,"applewebkit")}}],se=[{name:"Windows",search:ie("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return te(e,"iphone")||te(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ie("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ie("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ie("linux"),versionRegexes:[]},{name:"Solaris",search:ie("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ie("freebsd"),versionRegexes:[]}],ae={browsers:h(ue),oses:h(se)},ce=function(e){var n,r,t,o,i,u,s,a,c,f,d,l=ae.browsers(),m=ae.oses(),v=ne(l,e).fold(Y.unknown,Y.nu),g=re(m,e).fold(Z.unknown,Z.nu);return{browser:v,os:g,deviceType:(r=v,t=e,o=(n=g).isiOS()&&!0===/ipad/i.test(t),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,s=n.isAndroid()&&4===n.version.major,a=o||u||s&&!0===/mobile/i.test(t),c=n.isiOS()||n.isAndroid(),f=c&&!a,d=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(t),{isiPad:h(o),isiPhone:h(i),isTablet:h(a),isPhone:h(f),isTouch:h(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:h(d)})}},fe=(U=!(q=function(){var e=navigator.userAgent;return ce(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return U||(U=!0,L=q.apply(null,e)),L}),de=x,le=function(e,n){var r=e.dom();if(r.nodeType!==de)return!1;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},me=(fe().browser.isIE(),function(e,n,r){for(var t=e.dom(),o=M(r)?r:h(!1);t.parentNode;){t=t.parentNode;var i=S.fromDom(t);if(n(i))return E.some(i);if(o(i))break}return E.none()}),ve=function(e,n,r){return me(e,function(e){return le(e,n)},r)},ge={getToolbarItemsOr:(F=C,function(e,n,r){var t=n in e.settings?e.settings[n]:r;return function(e,n){if(!n(e))throw new Error("Default value doesn't match requested type.")}(r,F),function(e,n){if(_(e)||D(e))throw new Error("expected a string but found: "+e);return R(e)?n:A(e)?!1===e?"":n:e}(t,r)})},he=function(e){return ge.getToolbarItemsOr(e,"quickbars_selection_toolbar","bold italic | form:link-form h2 h3 blockquote")},pe=function(e){return ge.getToolbarItemsOr(e,"quickbars_insert_toolbar","quickimage quicktable")},be=function(s){s.ui.registry.addContextToolbar("quickblock",{predicate:function(e){var n,r,t,o=S.fromDom(e),i=s.schema.getTextBlockElements(),u=function(e){return e.dom()===s.getBody()};return(n=o,r="table",t=u,I(le,ve,n,r,t)).fold(function(){return(e=o,n=function(e){return e.dom().nodeName.toLowerCase()in i&&s.dom.isEmpty(e.dom())},r=u,I(function(e){return n(e)},me,e,n,r)).isSome();var e,n,r},function(){return!1})},items:pe(s),position:"line",scope:"editor"})},Oe=(tinymce.util.Tools.resolve("tinymce.util.Tools"),tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),function(e,n){e.execCommand("FormatBlock",!1,n)}),Ne=function(t){for(var e=function(e){var n,r="h"+e;t.ui.registry.addToggleButton(r,{text:r.toUpperCase(),tooltip:"Heading "+e,onSetup:function(e){return t.selection.selectorChangedWithUnbind(r,e.setActive).unbind},onAction:(n=r,function(){Oe(t,n)})})},n=1;n<6;n++)e(n)},Te=function(n){n.ui.registry.addContextToolbar("textselection",{predicate:function(e){return!n.selection.isCollapsed()},items:he(n),position:"selection"})};o.add("quickbars",function(e){v(e),be(e),Ne(e),Te(e)}),function we(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(n){return n.getParam("save_enablewhendirty",!0)},i=function(n){return!!n.getParam("save_onsavecallback")},c=function(n){return!!n.getParam("save_oncancelcallback")},r=function(n,e){n.notificationManager.open({text:e,type:"error"})},e=function(n){var e;if(e=t.DOM.getParent(n.id,"form"),!a(n)||n.isDirty()){if(n.save(),i(n))return n.execCallback("save_onsavecallback",n),void n.nodeChanged();e?(n.setDirty(!1),e.onsubmit&&!e.onsubmit()||("function"==typeof e.submit?e.submit():r(n,"Error: Form submit field collision.")),n.nodeChanged()):r(n,"Error: No form element found.")}},u=function(n){var e=o.trim(n.startContent);c(n)?n.execCallback("save_oncancelcallback",n):(n.setContent(e),n.undoManager.clear(),n.nodeChanged())},l=function(n){n.addCommand("mceSave",function(){e(n)}),n.addCommand("mceCancel",function(){u(n)})},d=function(t){return function(n){var e=function(){n.setDisabled(a(t)&&!t.isDirty())};return t.on("nodeChange dirty",e),function(){return t.off("nodeChange dirty",e)}}},s=function(n){n.ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:d(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:d(n)}),n.addShortcut("Meta+S","","mceSave")};n.add("save",function(n){s(n),l(n)}),function m(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=tinymce.util.Tools.resolve("tinymce.util.Tools");function x(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var t,n,a,o,i,u={findAndReplaceDOMText:function R(e,t,n,r,a){var o,i,m,f,p,g,d=[],c=0;function l(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(0<t){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(m=t.ownerDocument,f=a.getBlockElements(),p=a.getWhiteSpaceElements(),g=a.getShortEndedElements(),i=function s(e){var t;if(3===e.nodeType)return e.data;if(p[e.nodeName]&&!f[e.nodeName])return"";if(t="",x(e))return"\n";if((f[e.nodeName]||g[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=s(e),e=e.nextSibling;);return t}(t)){if(e.global)for(;o=e.exec(i);)d.push(l(o,r));else o=i.match(e),d.push(l(o,r));return d.length&&(c=d.length,function h(e,t,n){var r,a,o,i,d=[],c=0,l=e,s=t.shift(),u=0;e:for(;;){if((f[l.nodeName]||g[l.nodeName]||x(l))&&c++,3===l.nodeType&&(!a&&l.length+c>=s[1]?(a=l,i=s[1]-c):r&&d.push(l),!r&&l.length+c>s[0]&&(r=l,o=s[0]-c),c+=l.length),r&&a){if(l=n({startNode:r,startNodeIndex:o,endNode:a,endNodeIndex:i,innerNodes:d,match:s[2],matchIndex:u}),c-=a.length-i,a=r=null,d=[],u++,!(s=t.shift()))break}else if(p[l.nodeName]&&!f[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!x(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===e)break e;l=l.parentNode}}}(t,d,function u(e){var h;if("function"!=typeof e){var r=e.nodeType?e:m.createElement(e);h=function(e,t){var n=r.cloneNode(!1);return n.setAttribute("data-mce-index",t),e&&n.appendChild(m.createTextNode(e)),n}}else h=e;return function(e){var t,n,r,a=e.startNode,o=e.endNode,i=e.matchIndex;if(a===o){var d=a;r=d.parentNode,0<e.startNodeIndex&&(t=m.createTextNode(d.data.substring(0,e.startNodeIndex)),r.insertBefore(t,d));var c=h(e.match[0],i);return r.insertBefore(c,d),e.endNodeIndex<d.length&&(n=m.createTextNode(d.data.substring(e.endNodeIndex)),r.insertBefore(n,d)),d.parentNode.removeChild(d),c}t=m.createTextNode(a.data.substring(0,e.startNodeIndex)),n=m.createTextNode(o.data.substring(e.endNodeIndex));for(var l=h(a.data.substring(e.startNodeIndex),i),s=0,u=e.innerNodes.length;s<u;++s){var f=e.innerNodes[s],p=h(f.data,i);f.parentNode.replaceChild(p,f)}var g=h(o.data.substring(0,e.endNodeIndex),i);return(r=a.parentNode).insertBefore(t,a),r.insertBefore(l,a),r.removeChild(a),(r=o.parentNode).insertBefore(g,o),r.insertBefore(n,o),r.removeChild(o),g}}(n))),c}}},g=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},h=function(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)},d=function(e,t){var n,r=[];if((n=p.toArray(e.getBody().getElementsByTagName("span"))).length)for(var a=0;a<n.length;a++){var o=g(n[a]);null!==o&&o.length&&o===t.toString()&&r.push(n[a])}return r},f=function(e,t,n){var r=t.get(),a=e.dom;(n=!1!==n)?r++:r--,a.removeClass(d(e,t.get()),"mce-match-marker-selected");var o=d(e,r);return o.length?(a.addClass(d(e,r),"mce-match-marker-selected"),e.selection.scrollIntoView(o[0]),r):-1},m=function(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)},v=function(e,t){var n=f(e,t,!0);-1!==n&&t.set(n)},b=function(e,t){var n=f(e,t,!1);-1!==n&&t.set(n)},N=function(e){var t=g(e);return null!==t&&0<t.length},y=function(e,t,n){var r,a,o,i;for(a=p.toArray(e.getBody().getElementsByTagName("span")),r=0;r<a.length;r++){var d=g(a[r]);null!==d&&d.length&&(d===t.get().toString()&&(o||(o=a[r].firstChild),i=a[r].firstChild),h(a[r]))}if(o&&i){var c=e.dom.createRng();return c.setStart(o,0),c.setEnd(i,i.data.length),!1!==n&&e.selection.setRng(c),c}},w=function(e,t){return 0<d(e,t.get()+1).length},C=function(e,t){return 0<d(e,t.get()-1).length},s={done:y,find:function(e,t,n,r,a){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"[^\\S\\r\\n]"),n=a?"\\b"+n+"\\b":n;var o,i,d,c,l,s=(o=e,i=t,d=new RegExp(n,r?"g":"gi"),(l=o.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",c=o.getBody(),y(o,i,!1),u.findAndReplaceDOMText(d,c,l,!1,o.schema));return s&&(t.set(-1),t.set(f(e,t,!0))),s},next:v,prev:b,replace:function(e,t,n,r,a){var o,i,d,c,l,s,u=t.get();for(r=!1!==r,d=e.getBody(),i=p.grep(p.toArray(d.getElementsByTagName("span")),N),o=0;o<i.length;o++){var f=g(i[o]);if(c=l=parseInt(f,10),a||c===t.get()){for(n.length?(i[o].firstChild.nodeValue=n,h(i[o])):m(e.dom,i[o]);i[++o];){if((c=parseInt(g(i[o]),10))!==l){o--;break}m(e.dom,i[o])}r&&u--}else l>t.get()&&i[o].setAttribute("data-mce-index",l-1)}return t.set(u),r?(s=w(e,t),v(e,t)):(s=C(e,t),b(e,t)),!a&&s},hasNext:w,hasPrev:C},c=function(r,a){return{done:function(e){return s.done(r,a,e)},find:function(e,t,n){return s.find(r,a,e,t,n)},next:function(){return s.next(r,a)},prev:function(){return s.prev(r,a)},replace:function(e,t,n){return s.replace(r,a,e,t,n)}}},l=function(e){return function(){return e}},T=l(!1),A=l(!0),S=function(){return B},B=(o={fold:function(e,t){return e()},is:T,isSome:T,isNone:A,getOr:a=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:a,orThunk:n,map:S,ap:S,each:function(){},bind:S,flatten:S,exists:T,forall:A,filter:S,equals:t=function(e){return e.isNone()},equals_:t,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(o),o),I=(i="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===i}),k=(Array.prototype.slice,I(Array.from)&&Array.from,function(r,a){var e,o={};function i(e){(s.hasNext(r,a)?e.enable:e.disable)("next"),(s.hasPrev(r,a)?e.enable:e.disable)("prev")}r.undoManager.add(),e=p.trim(r.selection.getContent({format:"text"}));var d=function(e,t){!function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)}(["replace","replaceall","prev","next"],t?e.disable:e.enable)};function c(e){r.windowManager.alert("Could not find the specified string.",function(){e.focus("findtext")})}var l=function(e){var t=e.getData();if(!t.findtext.length)return s.done(r,a,!1),d(e,!0),void i(e);if(o.text===t.findtext&&o.caseState===t.matchcase&&o.wholeWord===t.wholewords)return s.hasNext(r,a)?(s.next(r,a),void i(e)):void c(e);var n=s.find(r,a,t.findtext,t.matchcase,t.wholewords);n||c(e),d(e,0===n),i(e),o={text:t.findtext,caseState:t.matchcase,wholeWord:t.wholewords}},t={findtext:e,replacetext:"",matchcase:!1,wholewords:!1};r.windowManager.open({title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"input",name:"findtext",label:"Find"},{type:"input",name:"replacetext",label:"Replace with"},{type:"grid",columns:2,items:[{type:"checkbox",name:"matchcase",label:"Match case"},{type:"checkbox",name:"wholewords",label:"Find whole words only"}]}]},buttons:[{type:"custom",name:"find",text:"Find",align:"start",primary:!0},{type:"custom",name:"replace",text:"Replace",align:"start",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",align:"start",disabled:!0},{type:"custom",name:"prev",text:"Previous",align:"end",icon:"arrow-left",disabled:!0},{type:"custom",name:"next",text:"Next",align:"end",icon:"arrow-right",disabled:!0}],initialData:t,onAction:function(e,t){var n=e.getData();switch(t.name){case"find":l(e);break;case"replace":s.replace(r,a,n.replacetext)||(d(e,!0),a.set(-1),o={});break;case"replaceall":s.replace(r,a,n.replacetext,!0,!0),d(e,!0),o={};break;case"prev":s.prev(r,a),i(e);break;case"next":s.next(r,a),i(e)}},onSubmit:l,onClose:function(){r.focus(),s.done(r,a),r.undoManager.add()}})}),E=function(e,t){e.addCommand("SearchReplace",function(){k(e,t)})},O=function(e,t){return function(){k(e,t)}},M=function(e,t){e.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:O(e,t),icon:"search"}),e.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:O(e,t),icon:"search"}),e.shortcuts.add("Meta+F","",O(e,t))};e.add("searchreplace",function(e){var t=r(-1);return E(e,t),M(e,t),c(e,t)}),function D(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
!function(g){"use strict";var c=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return c(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(e){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(e.settings.plugins)||!t.get("tinymcespellchecker")||("undefined"!=typeof g.window.console&&g.window.console.log&&g.window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),0))},h=function(e){return e.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")},l=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},d=function(e){return e.getParam("spellchecker_rpc_url")},f=function(e){return e.getParam("spellchecker_callback")},s=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)},m=tinymce.util.Tools.resolve("tinymce.util.Tools"),p=tinymce.util.Tools.resolve("tinymce.util.URI"),v=tinymce.util.Tools.resolve("tinymce.util.XHR"),u=function(e){return e.fire("SpellcheckStart")},o=function(e){return e.fire("SpellcheckEnd")};function x(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var k,r=function(c,r){var n,o,f,g,h,i=[],v=r.dom;function a(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function l(e){var t=c.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r<t.length;r++){var o=t[r],i=o.getAttribute("data-mce-index");null!==i&&i.length&&-1!==o.className.indexOf("mce-spellchecker-word")&&(i!==e&&null!==e||n.push(o))}return n}function s(e){for(var t=i.length;t--;)if(i[t]===e)return t;return-1}function t(e){for(var t=0,n=i.length;t<n&&!1!==e(i[t],t);t++);return this}function u(e){var t,n,r=l(e?s(e):null);for(t=r.length;t--;)(n=r[t]).parentNode.insertBefore(n.firstChild,n),n.parentNode.removeChild(n);return this}function d(e){var t=l(s(e)),n=r.dom.createRng();return n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),n}return f=r.schema.getBlockElements(),g=r.schema.getWhiteSpaceElements(),h=r.schema.getShortEndedElements(),{text:o=function e(t){var n;if(3===t.nodeType)return t.data;if(g[t.nodeName]&&!f[t.nodeName])return"";if(x(t))return"\n";if(n="",(f[t.nodeName]||h[t.nodeName])&&(n+="\n"),t=t.firstChild)for(;n+=e(t),t=t.nextSibling;);return n}(c),matches:i,each:t,filter:function(n){var r=[];return t(function(e,t){n(e,t)&&r.push(e)}),i=r,this},reset:function(){return i.splice(0,i.length),u(),this},matchFromElement:function(e){return i[e.getAttribute("data-mce-index")]},elementFromMatch:function(e){return l(s(e))[0]},find:function(e,t){if(o&&e.global)for(;n=e.exec(o);)i.push(a(n,t));return this},add:function(e,t,n){return i.push({start:e,end:e+t,text:o.substr(e,t),data:n}),this},wrap:function(e){return i.length&&function(e,t,n){var r,o,i,c,a,l=[],s=0,u=e,d=0;(t=t.slice(0)).sort(function(e,t){return e.start-t.start}),a=t.shift();e:for(;;){if((f[u.nodeName]||h[u.nodeName]||x(u))&&s++,3===u.nodeType&&(!o&&u.length+s>=a.end?(o=u,c=a.end-s):r&&l.push(u),!r&&u.length+s>a.start&&(r=u,i=a.start-s),s+=u.length),r&&o){if(u=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:c,innerNodes:l,match:a.text,matchIndex:d}),s-=o.length-c,o=r=null,l=[],d++,!(a=t.shift()))break}else if(g[u.nodeName]&&!f[u.nodeName]||!u.firstChild){if(u.nextSibling){u=u.nextSibling;continue}}else if(!x(u)){u=u.firstChild;continue}for(;;){if(u.nextSibling){u=u.nextSibling;break}if(u.parentNode===e)break e;u=u.parentNode}}}(c,i,function(o){function p(e,t){var n=i[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}return function(e){var t,n,r,o=e.startNode,i=e.endNode,c=e.matchIndex,a=v.doc;if(o===i){var l=o;r=l.parentNode,0<e.startNodeIndex&&(t=a.createTextNode(l.data.substring(0,e.startNodeIndex)),r.insertBefore(t,l));var s=p(e.match,c);return r.insertBefore(s,l),e.endNodeIndex<l.length&&(n=a.createTextNode(l.data.substring(e.endNodeIndex)),r.insertBefore(n,l)),l.parentNode.removeChild(l),s}t=a.createTextNode(o.data.substring(0,e.startNodeIndex)),n=a.createTextNode(i.data.substring(e.endNodeIndex));for(var u=p(o.data.substring(e.startNodeIndex),c),d=0,f=e.innerNodes.length;d<f;++d){var g=e.innerNodes[d],h=p(g.data,c);g.parentNode.replaceChild(h,g)}var m=p(i.data.substring(0,e.endNodeIndex),c);return(r=o.parentNode).insertBefore(t,o),r.insertBefore(u,o),r.removeChild(o),(r=i.parentNode).insertBefore(m,i),r.insertBefore(n,i),r.removeChild(i),m}}(e)),this},unwrap:u,replace:function(e,t){var n=d(e);return n.deleteContents(),0<t.length&&n.insertNode(r.dom.doc.createTextNode(t)),n},rangeFromMatch:d,indexOf:s}},N=function(e,t){if(!t.get()){var n=r(e.getBody(),e);t.set(n)}return t.get()},y=function(e,t,n,r,o,i,c){var a,l,s,u=f(e);(u||(a=e,l=t,s=n,function(e,t,n,r){var o={method:e,lang:s.get()},i="";o["addToDictionary"===e?"word":"text"]=t,m.each(o,function(e,t){i&&(i+="&"),i+=t+"="+encodeURIComponent(e)}),v.send({url:new p(l).toAbsolute(d(a)),type:"post",content_type:"application/x-www-form-urlencoded",data:i,success:function(e){if(e=JSON.parse(e))e.error?r(e.error):n(e);else{var t=a.translate("Server response wasn't proper JSON.");r(t)}},error:function(){var e=a.translate("The spelling service was not found: (")+d(a)+a.translate(")");r(e)}})})).call(e.plugins.spellchecker,r,o,i,c)},S=function(e,t,n){e.dom.select("span.mce-spellchecker-word").length||w(e,t,n)},w=function(e,t,n){var r=e.selection.getBookmark();if(N(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),o(e),!0},b=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},T=function(t,e,n,r,o){var i,c;if("string"!=typeof o&&o.words?(c=!!o.dictionary,i=o.words):i=o,t.setProgressState(!1),function(e){for(var t in e)return!1;return!0}(i)){var a=t.translate("No misspellings found.");return t.notificationManager.open({text:a,type:"info"}),void e.set(!1)}r.set({suggestions:i,hasDictionarySupport:c});var l=t.selection.getBookmark();N(t,n).find(s(t)).filter(function(e){return!!i[e.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1,"data-mce-word":e.text})}),t.selection.moveToBookmark(l),e.set(!0),u(t)},B={spellcheck:function(t,e,n,r,o,i){w(t,n,r)||(t.setProgressState(!0),y(t,e,i,"spellcheck",N(t,r).text,function(e){T(t,n,r,o,e)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),w(t,n,r)}),t.focus())},checkIfFinished:S,addToDictionary:function(t,e,n,r,o,i,c){t.setProgressState(!0),y(t,e,o,"addToDictionary",i,function(){t.setProgressState(!1),t.dom.remove(c,!0),S(t,n,r)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)})},ignoreWord:function(t,e,n,r,o,i){t.selection.collapse(),i?m.each(t.dom.select("span.mce-spellchecker-word"),function(e){e.getAttribute("data-mce-word")===r&&t.dom.remove(e,!0)}):t.dom.remove(o,!0),S(t,e,n)},findSpansByIndex:function(e,t){var n,r=[];if((n=m.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var i=b(n[o]);null!==i&&i.length&&i===t.toString()&&r.push(n[o])}return r},getElmIndex:b,markErrors:T},I=function(t,n,r,o,e,i){return{getTextMatcher:function(){return o.get()},getWordCharPattern:function(){return s(t)},markErrors:function(e){B.markErrors(t,n,o,r,e)},getLanguage:function(){return e.get()}}},E=function(e,t,n,r,o,i){e.addCommand("mceSpellCheck",function(){B.spellcheck(e,t,n,r,o,i)})},P=function(n,e,r,t,o,i){var c,a,l,s,u=(l=n,c=m.map(h(l).split(","),function(e){return{name:(e=e.split("="))[0],value:e[1]}}),a=[],m.each(c,function(e){a.push({selectable:!0,text:e.name,data:e.value})}),a),d=function(){B.spellcheck(n,e,r,t,i,o)},f={tooltip:"Spellcheck",onclick:d,onPostRender:function(e){var t=e.control;n.on("SpellcheckStart SpellcheckEnd",function(){t.active(r.get())})}};1<u.length&&(f.type="splitbutton",f.menu=u,f.onshow=(s=o,function(e){var t=s.get();e.control.items().each(function(e){e.active(e.settings.data===t)})}),f.onselect=function(e){o.set(e.control.settings.data)}),n.addButton("spellchecker",f),n.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:d,selectable:!0,onPostRender:function(){var e=this;e.active(r.get()),n.on("SpellcheckStart SpellcheckEnd",function(){e.active(r.get())})}})},C=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),D=tinymce.util.Tools.resolve("tinymce.ui.Factory"),R=function(o,i,c,a,l,s){o.on("click",function(e){var t=e.target;if("mce-spellchecker-word"===t.className){e.preventDefault();var n=B.findSpansByIndex(o,B.getElmIndex(t));if(0<n.length){var r=o.dom.createRng();r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),o.selection.setRng(r),function(t,e,n,r,o,i,c,a){var l=[],s=n.get().suggestions[c];m.each(s,function(e){l.push({text:e,onclick:function(){t.insertContent(t.dom.encode(e)),t.dom.remove(a),B.checkIfFinished(t,r,o)}})}),l.push({text:"-"}),n.get().hasDictionarySupport&&l.push({text:"Add to Dictionary",onclick:function(){B.addToDictionary(t,e,r,o,i,c,a)}}),l.push.apply(l,[{text:"Ignore",onclick:function(){B.ignoreWord(t,r,o,c,a)}},{text:"Ignore all",onclick:function(){B.ignoreWord(t,r,o,c,a,!0)}}]),(k=D.create("menu",{items:l,context:"contextmenu",onautohide:function(e){-1!==e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){k.remove(),k=null}})).renderTo(g.document.body);var u=C.DOM.getPos(t.getContentAreaContainer()),d=t.dom.getPos(a[0]),f=t.dom.getRoot();"BODY"===f.nodeName?(d.x-=f.ownerDocument.documentElement.scrollLeft||f.scrollLeft,d.y-=f.ownerDocument.documentElement.scrollTop||f.scrollTop):(d.x-=f.scrollLeft,d.y-=f.scrollTop),u.x+=d.x,u.y+=d.y,k.moveTo(u.x,u.y+a[0].offsetHeight)}(o,i,c,a,l,s,t.getAttribute("data-mce-word"),n)}}})};t.add("spellchecker",function(e,t){if(!1===a(e)){var n=c(!1),r=c(l(e)),o=c(null),i=c(null);return P(e,t,n,o,r,i),R(e,t,i,n,o,r),E(e,t,n,o,i,r),I(e,n,i,o,r,t)}})}(window);
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var a=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return a(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(e){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(e.settings.plugins)||!t.get("tinymcespellchecker")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),0))},f=function(e){return e.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")},s=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},d=function(e){return e.getParam("spellchecker_rpc_url")},g=function(e){return e.getParam("spellchecker_callback")},l=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)},N=tinymce.util.Tools.resolve("tinymce.util.Tools"),h=tinymce.util.Tools.resolve("tinymce.util.URI"),p=tinymce.util.Tools.resolve("tinymce.util.XHR"),u=function(e){return e.fire("SpellcheckStart")},o=function(e){return e.fire("SpellcheckEnd")};function b(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var m,r=function(a,r){var n,o,g,h,p,i=[],v=r.dom;function c(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function s(e){var t=a.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r<t.length;r++){var o=t[r],i=o.getAttribute("data-mce-index");null!==i&&i.length&&-1!==o.className.indexOf("mce-spellchecker-word")&&(i!==e&&null!==e||n.push(o))}return n}function l(e){for(var t=i.length;t--;)if(i[t]===e)return t;return-1}function e(e){for(var t=0,n=i.length;t<n&&!1!==e(i[t],t);t++);return this}function t(e){var t,n,r=s(e?l(e):null);for(t=r.length;t--;)(n=r[t]).parentNode.insertBefore(n.firstChild,n),n.parentNode.removeChild(n);return this}function u(e){var t=s(l(e)),n=r.dom.createRng();return n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),n}return g=r.schema.getBlockElements(),h=r.schema.getWhiteSpaceElements(),p=r.schema.getShortEndedElements(),{text:o=function d(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!g[e.nodeName])return"";if(b(e))return"\n";if(t="",(g[e.nodeName]||p[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=d(e),e=e.nextSibling;);return t}(a),matches:i,each:e,filter:function f(n){var r=[];return e(function(e,t){n(e,t)&&r.push(e)}),i=r,this},reset:function m(){return i.splice(0,i.length),t(),this},matchFromElement:function x(e){return i[e.getAttribute("data-mce-index")]},elementFromMatch:function k(e){return s(l(e))[0]},find:function N(e,t){if(o&&e.global)for(;n=e.exec(o);)i.push(c(n,t));return this},add:function y(e,t,n){return i.push({start:e,end:e+t,text:o.substr(e,t),data:n}),this},wrap:function S(e){return i.length&&function f(e,t,n){var r,o,i,a,c,s=[],l=0,u=e,d=0;(t=t.slice(0)).sort(function(e,t){return e.start-t.start}),c=t.shift();e:for(;;){if((g[u.nodeName]||p[u.nodeName]||b(u))&&l++,3===u.nodeType&&(!o&&u.length+l>=c.end?(o=u,a=c.end-l):r&&s.push(u),!r&&u.length+l>c.start&&(r=u,i=c.start-l),l+=u.length),r&&o){if(u=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:s,match:c.text,matchIndex:d}),l-=o.length-a,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[u.nodeName]&&!g[u.nodeName]||!u.firstChild){if(u.nextSibling){u=u.nextSibling;continue}}else if(!b(u)){u=u.firstChild;continue}for(;;){if(u.nextSibling){u=u.nextSibling;break}if(u.parentNode===e)break e;u=u.parentNode}}}(a,i,function t(o){function m(e,t){var n=i[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}return function(e){var t,n,r,o=e.startNode,i=e.endNode,a=e.matchIndex,c=v.doc;if(o===i){var s=o;r=s.parentNode,0<e.startNodeIndex&&(t=c.createTextNode(s.data.substring(0,e.startNodeIndex)),r.insertBefore(t,s));var l=m(e.match,a);return r.insertBefore(l,s),e.endNodeIndex<s.length&&(n=c.createTextNode(s.data.substring(e.endNodeIndex)),r.insertBefore(n,s)),s.parentNode.removeChild(s),l}t=c.createTextNode(o.data.substring(0,e.startNodeIndex)),n=c.createTextNode(i.data.substring(e.endNodeIndex));for(var u=m(o.data.substring(e.startNodeIndex),a),d=0,f=e.innerNodes.length;d<f;++d){var g=e.innerNodes[d],h=m(g.data,a);g.parentNode.replaceChild(h,g)}var p=m(i.data.substring(0,e.endNodeIndex),a);return(r=o.parentNode).insertBefore(t,o),r.insertBefore(u,o),r.removeChild(o),(r=i.parentNode).insertBefore(p,i),r.insertBefore(n,i),r.removeChild(i),p}}(e)),this},unwrap:t,replace:function w(e,t){var n=u(e);return n.deleteContents(),0<t.length&&n.insertNode(r.dom.doc.createTextNode(t)),n},rangeFromMatch:u,indexOf:l}},v=function(e,t){if(!t.get()){var n=r(e.getBody(),e);t.set(n)}return t.get()},x=function(e,t,n,r,o,i,a){var c,s,l,u=g(e);(u||(c=e,s=t,l=n,function(e,t,n,r){var o={method:e,lang:l.get()},i="";o["addToDictionary"===e?"word":"text"]=t,N.each(o,function(e,t){i&&(i+="&"),i+=t+"="+encodeURIComponent(e)}),p.send({url:new h(s).toAbsolute(d(c)),type:"post",content_type:"application/x-www-form-urlencoded",data:i,success:function(e){if(e=JSON.parse(e))e.error?r(e.error):n(e);else{var t=c.translate("Server response wasn't proper JSON.");r(t)}},error:function(){var e=c.translate("The spelling service was not found: (")+d(c)+c.translate(")");r(e)}})})).call(e.plugins.spellchecker,r,o,i,a)},k=function(e,t,n){e.dom.select("span.mce-spellchecker-word").length||y(e,t,n)},y=function(e,t,n){var r=e.selection.getBookmark();if(v(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),o(e),!0},S=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},w=function(t,e,n,r,o){var i=!!o.dictionary,a=o.words;if(t.setProgressState(!1),function(e){for(var t in e)return!1;return!0}(a)){var c=t.translate("No misspellings found.");return t.notificationManager.open({text:c,type:"info"}),void e.set(!1)}r.set({suggestions:a,hasDictionarySupport:i});var s=t.selection.getBookmark();v(t,n).find(l(t)).filter(function(e){return!!a[e.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})}),t.selection.moveToBookmark(s),e.set(!0),u(t)},T={spellcheck:function(t,e,n,r,o,i){y(t,n,r)||(t.setProgressState(!0),x(t,e,i,"spellcheck",v(t,r).text,function(e){w(t,n,r,o,e)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),y(t,n,r)}),t.focus())},checkIfFinished:k,addToDictionary:function(t,e,n,r,o,i,a){t.setProgressState(!0),x(t,e,o,"addToDictionary",i,function(){t.setProgressState(!1),t.dom.remove(a,!0),k(t,n,r)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)})},ignoreWord:function(t,e,n,r,o,i){t.selection.collapse(),i?N.each(t.dom.select("span.mce-spellchecker-word"),function(e){e.getAttribute("data-mce-word")===r&&t.dom.remove(e,!0)}):t.dom.remove(o,!0),k(t,e,n)},findSpansByIndex:function(e,t){var n,r=[];if((n=N.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var i=S(n[o]);null!==i&&i.length&&i===t.toString()&&r.push(n[o])}return r},getElmIndex:S,markErrors:w},I=function(t,n,r,o,e,i){return{getTextMatcher:function(){return o.get()},getWordCharPattern:function(){return l(t)},markErrors:function(e){T.markErrors(t,n,o,r,e)},getLanguage:function(){return e.get()}}},A=function(e,t,n,r,o,i){e.addCommand("mceSpellCheck",function(){T.spellcheck(e,t,n,r,o,i)})},B=Object.prototype.hasOwnProperty,E=(m=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)B.call(o,i)&&(n[i]=m(n[i],o[i]))}return n}),C="SpellcheckStart SpellcheckEnd",P=function(n,e,r,t,o,i){var a,c,s,l=(s=n,a=N.map(f(s).split(","),function(e){return{name:(e=e.split("="))[0],value:e[1]}}),c=[],N.each(a,function(e){c.push({selectable:!0,text:e.name,data:e.value})}),c),u=function(){T.spellcheck(n,e,r,t,i,o)},d={tooltip:"Spellcheck",onAction:u,icon:"spell-check",onSetup:function(e){var t=function(){e.setActive(r.get())};return n.on(C,t),function(){n.off(C,t)}}};n.ui.registry.addButton("spellchecker",E(d,1<l.length?{type:"splitbutton",menu:l,select:function(e){return e===o.get()},fetch:function(e){e(N.map(l,function(e){return{type:"choiceitem",value:e.data,text:e.text}}))},onItemAction:function(e,t){o.set(t)}}:{type:"togglebutton"})),n.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",onSetup:function(e){e.setActive(r.get());var t=function(){e.setActive(r.get())};return n.on(C,t),function(){n.off(C,t)}},onAction:u})},R=function(h,p,m,v,x,k){h.ui.registry.addContextMenu("spellchecker",{update:function(e){var t=e;if("mce-spellchecker-word"!==t.className)return[];var n,r,o,i,a,c,s,l,u,d,f=T.findSpansByIndex(h,T.getElmIndex(t));if(0<f.length){var g=h.dom.createRng();return g.setStartBefore(f[0]),g.setEndAfter(f[f.length-1]),h.selection.setRng(g),n=h,r=p,o=m,i=v,a=x,c=k,s=t.getAttribute("data-mce-word"),l=f,u=[],d=o.get().suggestions[s],N.each(d,function(e){u.push({text:e,onAction:function(){n.insertContent(n.dom.encode(e)),n.dom.remove(l),T.checkIfFinished(n,i,a)}})}),o.get().hasDictionarySupport&&(u.push({type:"separator"}),u.push({text:"Add to dictionary",onAction:function(){T.addToDictionary(n,r,i,a,c,s,l)}})),u.push.apply(u,[{type:"separator"},{text:"Ignore",onAction:function(){T.ignoreWord(n,i,a,s,l)}},{text:"Ignore all",onAction:function(){T.ignoreWord(n,i,a,s,l,!0)}}]),u}}})};t.add("spellchecker",function(e,t){if(!1===c(e)){var n=a(!1),r=a(s(e)),o=a(null),i=a(null);return P(e,t,n,o,r,i),R(e,t,i,n,o,r),A(e,t,n,o,i,r),I(e,n,i,o,r,t)}}),function e(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),s=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),d=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==f.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=y.explode(d(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):m.get(e[0]):":next"===e[1]?u(1):m.get(e[1]))){var t=c.get(o.id||o.name);o.id&&t?t.focus():a.setTimeout(function(){s.webkit||window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&c.get(n.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(o=m.select(":input:enabled,*[tabindex]:not(iframe)"),y.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&m.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",n),s.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};e.add("tabfocus",function(e){i(e)}),function o(){}}();
|