@firestitch/froala
Version:
The next generation Javascript WYSIWYG HTML rich text editor made by devs for devs. High performance and modern design make it easy to use for developers and loved by users.
3 lines (2 loc) • 3.38 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(c){"use strict";(c=c&&c.hasOwnProperty("default")?c.default:c).DEFAULT_SCAYT_OPTIONS={enableOnTouchDevices:!1,disableOptionsStorage:["all"],localization:"en",extraModules:"ui",DefaultSelection:"American English",spellcheckLang:"en_US",contextMenuSections:"suggest|moresuggest",serviceProtocol:"https",servicePort:"80",serviceHost:"svc.webspellchecker.net",servicePath:"spellcheck/script/ssrv.cgi",contextMenuForMisspelledOnly:!0,scriptPath:"https://svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js"},Object.assign(c.DEFAULTS,{scaytAutoload:!1,scaytCustomerId:"1:ldogw1-MSDuT3-slyfO-0YJgB1-Wx7262-HIT741-MAMDv4-10qfb3-A4LDP-c60m3-hSQgd2-az2",scaytOptions:{}}),c.PLUGINS.spellChecker=function(s){var l;function e(e){var t;l&&l.isDisabled&&(t=!l.isDisabled(),e.toggleClass("fr-active",t).attr("aria-pressed",t),s.$el.attr("spellcheck",s.opts.spellcheck&&!t))}function t(e){l&&l.isDisabled&&!l.isDisabled()&&0<=["bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","html"].indexOf(e)&&l.removeMarkupInSelectionNode({removeInside:!0})}function o(e){l&&l.isDisabled&&!l.isDisabled()&&0<=["bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","html"].indexOf(e)&&l.reloadMarkup()}function a(e){l&&l.isDisabled&&!l.isDisabled()&&e.which==c.KEYCODE.ENTER&&setTimeout(l.reloadMarkup,0)}function i(e){if(e&&e.getAttribute&&e.getAttribute("data-scayt-word"))e.outerHTML=e.innerHTML;else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var t=e.querySelectorAll("[data-scayt-word], [data-spelling-word]"),s=0;s<t.length;s++)t[s].outerHTML=t[s].innerHTML}function n(){s.events.on("commands.before",t),s.events.on("commands.after",o),s.events.on("keydown",a,!0),s.events.on("html.processGet",i),e(s.$tb.find('[data-cmd="spellChecker"]'))}function r(){var e=s.opts.scaytOptions;e.customerId=s.opts.scaytCustomerId,e.container=(s.$iframe||s.$el).get(0),e.autoStartup=s.opts.scaytAutoload,e.onLoad=n,null!==s.opts.language&&(s.opts.spellCheckerLanguage=s.opts.language),!0===s.opts.scaytAutoload&&(s.opts.spellcheck=!1),l=new SCAYT.CUSTOMSCAYT(e)}return{_init:function(){if(!s.$wp)return!1;var e;s.opts.scaytOptions=Object.assign({},c.DEFAULT_SCAYT_OPTIONS,s.opts.scaytOptions),"undefined"!=typeof SCAYT?r():(s.shared.spellCheckerLoaded||(s.shared.spellCheckerCallbacks=[]),s.shared.spellCheckerCallbacks.push(r),s.shared.spellCheckerLoaded||(s.shared.spellCheckerLoaded=!0,(e=document.createElement("script")).type="text/javascript",e.src=s.opts.scaytOptions.scriptPath,e.innerText="",e.onload=function(){for(var e=0;e<s.shared.spellCheckerCallbacks.length;e++)s.shared.spellCheckerCallbacks[e]()},document.getElementsByTagName("head")[0].appendChild(e)))},refresh:e,toggle:function(){l&&l.isDisabled&&l.setDisabled(!l.isDisabled())}}},c.DefineIcon("spellChecker",{NAME:"keyboard-o",FA5NAME:"keyboard",SVG_KEY:"spellcheck"}),c.RegisterCommand("spellChecker",{title:"Spell Checker",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,toggle:!0,callback:function(){this.spellChecker.toggle()},refresh:function(e){this.spellChecker.refresh(e)},plugin:"spellChecker"})});
//# sourceMappingURL=spell_checker.min.min.js.map