wysiwyg-rails 2.9.5 → 2.9.6.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +21 -21
- data/README.md +127 -127
- data/Rakefile +5 -5
- data/app/assets/javascripts/froala_editor.min.js +7 -7
- data/app/assets/javascripts/froala_editor.pkgd.min.js +7 -7
- data/app/assets/javascripts/languages/ar.js +336 -336
- data/app/assets/javascripts/languages/bs.js +336 -336
- data/app/assets/javascripts/languages/cs.js +336 -336
- data/app/assets/javascripts/languages/da.js +333 -333
- data/app/assets/javascripts/languages/de.js +336 -336
- data/app/assets/javascripts/languages/el.js +342 -342
- data/app/assets/javascripts/languages/en_ca.js +280 -280
- data/app/assets/javascripts/languages/en_gb.js +280 -280
- data/app/assets/javascripts/languages/es.js +318 -318
- data/app/assets/javascripts/languages/et.js +336 -336
- data/app/assets/javascripts/languages/fa.js +336 -336
- data/app/assets/javascripts/languages/fi.js +336 -336
- data/app/assets/javascripts/languages/fr.js +336 -336
- data/app/assets/javascripts/languages/he.js +336 -336
- data/app/assets/javascripts/languages/hr.js +336 -336
- data/app/assets/javascripts/languages/hu.js +336 -336
- data/app/assets/javascripts/languages/id.js +337 -337
- data/app/assets/javascripts/languages/it.js +336 -336
- data/app/assets/javascripts/languages/ja.js +336 -336
- data/app/assets/javascripts/languages/ko.js +336 -336
- data/app/assets/javascripts/languages/ku.js +329 -329
- data/app/assets/javascripts/languages/me.js +336 -336
- data/app/assets/javascripts/languages/nb.js +336 -336
- data/app/assets/javascripts/languages/nl.js +336 -336
- data/app/assets/javascripts/languages/pl.js +336 -336
- data/app/assets/javascripts/languages/pt_br.js +336 -336
- data/app/assets/javascripts/languages/pt_pt.js +336 -336
- data/app/assets/javascripts/languages/ro.js +336 -336
- data/app/assets/javascripts/languages/ru.js +336 -336
- data/app/assets/javascripts/languages/sk.js +336 -336
- data/app/assets/javascripts/languages/sr.js +336 -336
- data/app/assets/javascripts/languages/sv.js +336 -336
- data/app/assets/javascripts/languages/th.js +336 -336
- data/app/assets/javascripts/languages/tr.js +336 -336
- data/app/assets/javascripts/languages/uk.js +336 -336
- data/app/assets/javascripts/languages/vi.js +276 -276
- data/app/assets/javascripts/languages/zh_cn.js +336 -336
- data/app/assets/javascripts/languages/zh_tw.js +336 -336
- data/app/assets/javascripts/plugins/align.min.js +6 -6
- data/app/assets/javascripts/plugins/char_counter.min.js +6 -6
- data/app/assets/javascripts/plugins/code_beautifier.min.js +6 -6
- data/app/assets/javascripts/plugins/code_view.min.js +7 -7
- data/app/assets/javascripts/plugins/colors.min.js +7 -7
- data/app/assets/javascripts/plugins/draggable.min.js +7 -7
- data/app/assets/javascripts/plugins/emoticons.min.js +6 -6
- data/app/assets/javascripts/plugins/entities.min.js +6 -6
- data/app/assets/javascripts/plugins/file.min.js +6 -6
- data/app/assets/javascripts/plugins/font_family.min.js +6 -6
- data/app/assets/javascripts/plugins/font_size.min.js +6 -6
- data/app/assets/javascripts/plugins/forms.min.js +6 -6
- data/app/assets/javascripts/plugins/fullscreen.min.js +6 -6
- data/app/assets/javascripts/plugins/help.min.js +6 -6
- data/app/assets/javascripts/plugins/image.min.js +7 -7
- data/app/assets/javascripts/plugins/image_manager.min.js +6 -6
- data/app/assets/javascripts/plugins/inline_class.min.js +6 -6
- data/app/assets/javascripts/plugins/inline_style.min.js +6 -6
- data/app/assets/javascripts/plugins/line_breaker.min.js +7 -7
- data/app/assets/javascripts/plugins/line_height.min.js +7 -7
- data/app/assets/javascripts/plugins/link.min.js +7 -7
- data/app/assets/javascripts/plugins/lists.min.js +7 -7
- data/app/assets/javascripts/plugins/paragraph_format.min.js +6 -6
- data/app/assets/javascripts/plugins/paragraph_style.min.js +6 -6
- data/app/assets/javascripts/plugins/print.min.js +6 -6
- data/app/assets/javascripts/plugins/quick_insert.min.js +6 -6
- data/app/assets/javascripts/plugins/quote.min.js +6 -6
- data/app/assets/javascripts/plugins/save.min.js +6 -6
- data/app/assets/javascripts/plugins/special_characters.min.js +6 -6
- data/app/assets/javascripts/plugins/table.min.js +7 -7
- data/app/assets/javascripts/plugins/url.min.js +6 -6
- data/app/assets/javascripts/plugins/video.min.js +7 -7
- data/app/assets/javascripts/plugins/word_paste.min.js +7 -7
- data/app/assets/javascripts/third_party/embedly.min.js +6 -6
- data/app/assets/javascripts/third_party/font_awesome.min.js +6 -6
- data/app/assets/javascripts/third_party/image_aviary.min.js +6 -6
- data/app/assets/javascripts/third_party/image_tui.min.js +6 -6
- data/app/assets/javascripts/third_party/spell_checker.min.js +6 -6
- data/app/assets/stylesheets/froala_editor.css +1334 -1334
- data/app/assets/stylesheets/froala_editor.min.css +7 -7
- data/app/assets/stylesheets/froala_editor.pkgd.css +2983 -2984
- data/app/assets/stylesheets/froala_editor.pkgd.min.css +7 -7
- data/app/assets/stylesheets/froala_style.css +448 -448
- data/app/assets/stylesheets/froala_style.min.css +6 -6
- data/app/assets/stylesheets/plugins/char_counter.css +57 -57
- data/app/assets/stylesheets/plugins/char_counter.min.css +6 -6
- data/app/assets/stylesheets/plugins/code_view.css +112 -113
- data/app/assets/stylesheets/plugins/code_view.min.css +7 -7
- data/app/assets/stylesheets/plugins/colors.css +155 -155
- data/app/assets/stylesheets/plugins/colors.min.css +6 -6
- data/app/assets/stylesheets/plugins/draggable.css +43 -43
- data/app/assets/stylesheets/plugins/draggable.min.css +6 -6
- data/app/assets/stylesheets/plugins/emoticons.css +42 -42
- data/app/assets/stylesheets/plugins/emoticons.min.css +6 -6
- data/app/assets/stylesheets/plugins/file.css +146 -146
- data/app/assets/stylesheets/plugins/file.min.css +6 -6
- data/app/assets/stylesheets/plugins/fullscreen.css +35 -35
- data/app/assets/stylesheets/plugins/fullscreen.min.css +6 -6
- data/app/assets/stylesheets/plugins/help.css +52 -52
- data/app/assets/stylesheets/plugins/help.min.css +6 -6
- data/app/assets/stylesheets/plugins/image.css +244 -244
- data/app/assets/stylesheets/plugins/image.min.css +6 -6
- data/app/assets/stylesheets/plugins/image_manager.css +268 -268
- data/app/assets/stylesheets/plugins/image_manager.min.css +6 -6
- data/app/assets/stylesheets/plugins/line_breaker.css +37 -37
- data/app/assets/stylesheets/plugins/line_breaker.min.css +6 -6
- data/app/assets/stylesheets/plugins/quick_insert.css +70 -70
- data/app/assets/stylesheets/plugins/quick_insert.min.css +6 -6
- data/app/assets/stylesheets/plugins/special_characters.css +51 -51
- data/app/assets/stylesheets/plugins/special_characters.min.css +6 -6
- data/app/assets/stylesheets/plugins/table.css +181 -181
- data/app/assets/stylesheets/plugins/table.min.css +6 -6
- data/app/assets/stylesheets/plugins/video.css +231 -231
- data/app/assets/stylesheets/plugins/video.min.css +6 -6
- data/app/assets/stylesheets/themes/dark.css +1330 -1327
- data/app/assets/stylesheets/themes/dark.min.css +7 -7
- data/app/assets/stylesheets/themes/gray.css +1330 -1327
- data/app/assets/stylesheets/themes/gray.min.css +7 -7
- data/app/assets/stylesheets/themes/red.css +1330 -1327
- data/app/assets/stylesheets/themes/red.min.css +7 -7
- data/app/assets/stylesheets/themes/royal.css +1330 -1327
- data/app/assets/stylesheets/themes/royal.min.css +7 -7
- data/app/assets/stylesheets/third_party/embedly.css +65 -65
- data/app/assets/stylesheets/third_party/embedly.min.css +6 -6
- data/app/assets/stylesheets/third_party/font_awesome.css +50 -50
- data/app/assets/stylesheets/third_party/font_awesome.min.css +6 -6
- data/app/assets/stylesheets/third_party/image_tui.css +42 -42
- data/app/assets/stylesheets/third_party/image_tui.min.css +6 -6
- data/app/assets/stylesheets/third_party/spell_checker.css +72 -72
- data/app/assets/stylesheets/third_party/spell_checker.min.css +6 -6
- data/lib/wysiwyg-rails.rb +1 -1
- data/lib/wysiwyg-rails/engine.rb +16 -16
- data/lib/wysiwyg-rails/version.rb +5 -5
- metadata +7 -8
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,n){return n===undefined&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(n)}:t(window.jQuery)}(function(r){r.FE.PLUGINS.align=function(a){return{apply:function(e){var n=a.selection.element();if(r(n).parents(".fr-img-caption").length)r(n).css("text-align",e);else{a.selection.save(),a.html.wrap(!0,!0,!0,!0),a.selection.restore();for(var t=a.selection.blocks(),i=0;i<t.length;i++)r(t[i]).css("text-align",e).removeClass("fr-temp-div"),""===r(t[i]).attr("class")&&r(t[i]).removeAttr("class"),""===r(t[i]).attr("style")&&r(t[i]).removeAttr("style");a.selection.save(),a.html.unwrap(),a.selection.restore()}},refresh:function(e){var n=a.selection.blocks();if(n.length){var t=a.helpers.getAlignment(r(n[0]));e.find("> *:first").replaceWith(a.icon.create("align-"+t))}},refreshOnShow:function(e,n){var t=a.selection.blocks();if(t.length){var i=a.helpers.getAlignment(r(t[0]));n.find('a.fr-command[data-param1="'+i+'"]').addClass("fr-active").attr("aria-selected",!0)}},refreshForToolbar:function(e){var n=a.selection.blocks();if(n.length){var t=a.helpers.getAlignment(r(n[0]));"align"+(t=t.charAt(0).toUpperCase()+t.slice(1))==e.attr("data-cmd")&&e.addClass("fr-active")}}}},r.FE.DefineIcon("align",{NAME:"align-left"}),r.FE.DefineIcon("align-left",{NAME:"align-left"}),r.FE.DefineIcon("align-right",{NAME:"align-right"}),r.FE.DefineIcon("align-center",{NAME:"align-center"}),r.FE.DefineIcon("align-justify",{NAME:"align-justify"}),r.FE.RegisterCommand("align",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',n=r.FE.COMMANDS.align.options;for(var t in n)n.hasOwnProperty(t)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="align" data-param1="'+t+'" title="'+this.language.translate(n[t])+'">'+this.icon.create("align-"+t)+'<span class="fr-sr-only">'+this.language.translate(n[t])+"</span></a></li>");return e+="</ul>"},callback:function(e,n){this.align.apply(n)},refresh:function(e){this.align.refresh(e)},refreshOnShow:function(e,n){this.align.refreshOnShow(e,n)},plugin:"align"}),r.FE.RegisterCommand("alignLeft",{type:"button",icon:"align-left",callback:function(){this.align.apply("left")},refresh:function(e){this.align.refreshForToolbar(e)}}),r.FE.RegisterCommand("alignRight",{type:"button",icon:"align-right",callback:function(){this.align.apply("right")},refresh:function(e){this.align.refreshForToolbar(e)}}),r.FE.RegisterCommand("alignCenter",{type:"button",icon:"align-center",callback:function(){this.align.apply("center")},refresh:function(e){this.align.refreshForToolbar(e)}}),r.FE.RegisterCommand("alignJustify",{type:"button",icon:"align-justify",callback:function(){this.align.apply("justify")},refresh:function(e){this.align.refreshForToolbar(e)}})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(a){a.extend(a.FE.DEFAULTS,{charCounterMax:-1,charCounterCount:!0}),a.FE.PLUGINS.charCounter=function(n){var r;function o(){return(n.el.textContent||"").replace(/\u200B/g,"").length}function e(e){if(n.opts.charCounterMax<0)return!0;if(o()<n.opts.charCounterMax)return!0;var t=e.which;return!(!n.keys.ctrlKey(e)&&n.keys.isCharacter(t)||t===a.FE.KEYCODE.IME)||(e.preventDefault(),e.stopPropagation(),n.events.trigger("charCounter.exceeded"),!1)}function t(e){return n.opts.charCounterMax<0?e:a("<div>").html(e).text().length+o()<=n.opts.charCounterMax?e:(n.events.trigger("charCounter.exceeded"),"")}function u(){if(n.opts.charCounterCount){var e=o()+(0<n.opts.charCounterMax?"/"+n.opts.charCounterMax:"");r.text(e),n.opts.toolbarBottom&&r.css("margin-bottom",n.$tb.outerHeight(!0));var t=n.$wp.get(0).offsetWidth-n.$wp.get(0).clientWidth;0<=t&&("rtl"==n.opts.direction?r.css("margin-left",t):r.css("margin-right",t))}}return{_init:function(){return!!n.$wp&&!!n.opts.charCounterCount&&((r=a('<span class="fr-counter"></span>')).css("bottom",n.$wp.css("border-bottom-width")),n.$box.append(r),n.events.on("keydown",e,!0),n.events.on("paste.afterCleanup",t),n.events.on("keyup contentChanged input",function(){n.events.trigger("charCounter.update")}),n.events.on("charCounter.update",u),n.events.trigger("charCounter.update"),void n.events.on("destroy",function(){a(n.o_win).off("resize.char"+n.id),r.removeData().remove(),r=null}))},count:o}}});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(e){e.FE.PLUGINS.codeBeautifier=function(){var e,t,n,i,X={};function k(i,e){var t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},n={"@media":!0,"@supports":!0,"@document":!0};e=e||{},i=(i=i||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n");var r=e.indent_size||4,s=e.indent_char||" ",_=e.selector_separator_newline===undefined||e.selector_separator_newline,a=e.end_with_newline!==undefined&&e.end_with_newline,o=e.newline_between_rules===undefined||e.newline_between_rules,l=e.eol?e.eol:"\n";"string"==typeof r&&(r=parseInt(r,10)),e.indent_with_tabs&&(s="\t",r=1),l=l.replace(/\\r/,"\r").replace(/\\n/,"\n");var h,c=/^\s+$/,u=-1,p=0;function d(){return(h=i.charAt(++u))||""}function f(e){var t,n=u;return e&&E(),t=i.charAt(u+1)||"",u=n-1,d(),t}function T(e){for(var t=u;d();)if("\\"===h)d();else{if(-1!==e.indexOf(h))break;if("\n"===h)break}return i.substring(t,u+1)}function E(){for(var e="";c.test(f());)d(),e+=h;return e}function g(){var e="";for(h&&c.test(h)&&(e=h);c.test(d());)e+=h;return e}function x(e){var t=u;for(e="/"===f(),d();d();){if(!e&&"*"===h&&"/"===f()){d();break}if(e&&"\n"===h)return i.substring(t,u)}return i.substring(t,u)+h}function w(e){return i.substring(u-e.length,u).toLowerCase()===e}function K(){for(var e=0,t=u+1;t<i.length;t++){var n=i.charAt(t);if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0==e)return!1;e-=1}else if(";"===n||"}"===n)return!1}return!1}var m=i.match(/^[\t ]*/)[0],R=new Array(r+1).join(s),b=0,v=0;for(var S,A,k={"{":function(e){k.singleSpace(),y.push(e),k.newLine()},"}":function(e){k.newLine(),y.push(e),k.newLine()},_lastCharWhitespace:function(){return c.test(y[y.length-1])},newLine:function(e){y.length&&(e||"\n"===y[y.length-1]||k.trim(),y.push("\n"),m&&y.push(m))},singleSpace:function(){y.length&&!k._lastCharWhitespace()&&y.push(" ")},preserveSingleSpace:function(){V&&k.singleSpace()},trim:function(){for(;k._lastCharWhitespace();)y.pop()}},y=[],O=!1,N=!1,D=!1,C="",L="";;){var I=g(),V=""!==I,P=-1!==I.indexOf("\n");if(L=C,!(C=h))break;if("/"===h&&"*"===f()){var j=0===b;(P||j)&&k.newLine(),y.push(x()),k.newLine(),j&&k.newLine(!0)}else if("/"===h&&"/"===f())P||"{"===L||k.trim(),k.singleSpace(),y.push(x()),k.newLine();else if("@"===h){k.preserveSingleSpace(),y.push(h);var B=(void 0,S=u,A=T(": ,;{}()[]/='\""),u=S-1,d(),A);B.match(/[ :]$/)&&(d(),B=T(": ").replace(/\s$/,""),y.push(B),k.singleSpace()),(B=B.replace(/\s$/,""))in t&&(v+=1,B in n&&(D=!0))}else"#"===h&&"{"===f()?(k.preserveSingleSpace(),y.push(T("}"))):"{"===h?"}"===f(!0)?(E(),d(),k.singleSpace(),y.push("{}"),k.newLine(),o&&0===b&&k.newLine(!0)):(b++,m+=R,k["{"](h),D?(D=!1,O=v<b):O=v<=b):"}"===h?(b--,m=m.slice(0,-r),k["}"](h),N=O=!1,v&&v--,o&&0===b&&k.newLine(!0)):":"===h?(E(),!O&&!D||w("&")||K()?":"===f()?(d(),y.push("::")):y.push(":"):(N=!0,y.push(":"),k.singleSpace())):'"'===h||"'"===h?(k.preserveSingleSpace(),y.push(T(h))):";"===h?(N=!1,y.push(h),k.newLine()):"("===h?w("url")?(y.push(h),E(),d()&&(")"!==h&&'"'!==h&&"'"!==h?y.push(T(")")):u--)):(p++,k.preserveSingleSpace(),y.push(h),E()):")"===h?(y.push(h),p--):","===h?(y.push(h),E(),_&&!N&&p<1?k.newLine():k.singleSpace()):("]"===h||("["===h?k.preserveSingleSpace():"="===h?(E(),h="="):k.preserveSingleSpace()),y.push(h))}var M="";return m&&(M+=m),M+=y.join("").replace(/[\r\n\t ]+$/,""),a&&(M+="\n"),"\n"!=l&&(M=M.replace(/[\n]/g,l)),M}function F(e,t){for(var n=0;n<t.length;n+=1)if(t[n]===e)return!0;return!1}function $(e){return e.replace(/^\s+|\s+$/g,"")}function y(e,t){return new r(e,t).beautify()}e=X,t="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",n=new RegExp("["+t+"]"),i=new RegExp("["+t+"\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&i.test(String.fromCharCode(e))))};var L={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(i,e){var _,r,s,a,o,l,h,c,u,t,n,p,d,f=[],T="";function E(e,t){var n=0;return e&&(n=e.indentation_level,!_.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level)),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:e?e.line_indent_level:n,start_line_index:_.get_line_number(),ternary_depth:0}}for(p={TK_START_EXPR:function(){O();var e=L.Expression;if("["===a.text){if("TK_WORD"===o||")"===c.last_text)return"TK_RESERVED"===o&&F(c.last_text,s.line_starters)&&(_.space_before_token=!0),v(e),R(),b(),void(d.space_in_paren&&(_.space_before_token=!0));e=L.ArrayLiteral,S(c.mode)&&("["!==c.last_text&&(","!==c.last_text||"]"!==l&&"}"!==l)||d.keep_array_indentation||K())}else"TK_RESERVED"===o&&"for"===c.last_text?e=L.ForInitializer:"TK_RESERVED"===o&&F(c.last_text,["if","while"])&&(e=L.Conditional);";"===c.last_text||"TK_START_BLOCK"===o?K():"TK_END_EXPR"===o||"TK_START_EXPR"===o||"TK_END_BLOCK"===o||"."===c.last_text?w(a.wanted_newline):"TK_RESERVED"===o&&"("===a.text||"TK_WORD"===o||"TK_OPERATOR"===o?"TK_RESERVED"===o&&("function"===c.last_word||"typeof"===c.last_word)||"*"===c.last_text&&"function"===l?d.space_after_anon_function&&(_.space_before_token=!0):"TK_RESERVED"!==o||!F(c.last_text,s.line_starters)&&"catch"!==c.last_text||d.space_before_conditional&&(_.space_before_token=!0):_.space_before_token=!0;"("===a.text&&"TK_RESERVED"===o&&"await"===c.last_word&&(_.space_before_token=!0);"("===a.text&&("TK_EQUALS"!==o&&"TK_OPERATOR"!==o||y()||w());v(e),R(),d.space_in_paren&&(_.space_before_token=!0);b()},TK_END_EXPR:function(){for(;c.mode===L.Statement;)k();c.multiline_frame&&w("]"===a.text&&S(c.mode)&&!d.keep_array_indentation);d.space_in_paren&&("TK_START_EXPR"!==o||d.space_in_empty_paren?_.space_before_token=!0:(_.trim(),_.space_before_token=!1));"]"===a.text&&d.keep_array_indentation?(R(),k()):(k(),R());_.remove_redundant_indentation(u),c.do_while&&u.mode===L.Conditional&&(u.mode=L.Expression,c.do_block=!1,c.do_while=!1)},TK_START_BLOCK:function(){var e=D(1),t=D(2);t&&(":"===t.text&&F(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||F(e.text,["get","set"])&&F(t.type,["TK_WORD","TK_RESERVED"]))?F(l,["class","interface"])?v(L.BlockStatement):v(L.ObjectLiteral):v(L.BlockStatement);var n=!e.comments_before.length&&"}"===e.text&&"function"===c.last_word&&"TK_END_EXPR"===o;"expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?"TK_OPERATOR"!==o&&(n||"TK_EQUALS"===o||"TK_RESERVED"===o&&N(c.last_text)&&"else"!==c.last_text)?_.space_before_token=!0:K(!1,!0):"TK_OPERATOR"!==o&&"TK_START_EXPR"!==o?"TK_START_BLOCK"===o?K():_.space_before_token=!0:S(u.mode)&&","===c.last_text&&("}"===l?_.space_before_token=!0:K());R(),b()},TK_END_BLOCK:function(){for(;c.mode===L.Statement;)k();var e="TK_START_BLOCK"===o;"expand"===d.brace_style?e||K():e||(S(c.mode)&&d.keep_array_indentation?(d.keep_array_indentation=!1,K(),d.keep_array_indentation=!0):K());k(),R()},TK_WORD:C,TK_RESERVED:C,TK_SEMICOLON:function(){O()&&(_.space_before_token=!1);for(;c.mode===L.Statement&&!c.if_block&&!c.do_block;)k();R()},TK_STRING:function(){O()?_.space_before_token=!0:"TK_RESERVED"===o||"TK_WORD"===o?_.space_before_token=!0:"TK_COMMA"===o||"TK_START_EXPR"===o||"TK_EQUALS"===o||"TK_OPERATOR"===o?y()||w():K();R()},TK_EQUALS:function(){O();c.declaration_statement&&(c.declaration_assignment=!0);_.space_before_token=!0,R(),_.space_before_token=!0},TK_OPERATOR:function(){O();if("TK_RESERVED"===o&&N(c.last_text))return _.space_before_token=!0,void R();if("*"===a.text&&"TK_DOT"===o)return void R();if(":"===a.text&&c.in_case)return c.case_body=!0,b(),R(),K(),void(c.in_case=!1);if("::"===a.text)return void R();"TK_OPERATOR"===o&&w();var e=!0,t=!0;F(a.text,["--","++","!","~"])||F(a.text,["-","+"])&&(F(o,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||F(c.last_text,s.line_starters)||","===c.last_text)?(t=e=!1,!a.wanted_newline||"--"!==a.text&&"++"!==a.text||K(!1,!0),";"===c.last_text&&A(c.mode)&&(e=!0),"TK_RESERVED"===o?e=!0:"TK_END_EXPR"===o?e=!("]"===c.last_text&&("--"===a.text||"++"===a.text)):"TK_OPERATOR"===o&&(e=F(a.text,["--","-","++","+"])&&F(c.last_text,["--","-","++","+"]),F(a.text,["+","-"])&&F(c.last_text,["--","++"])&&(t=!0)),c.mode!==L.BlockStatement&&c.mode!==L.Statement||"{"!==c.last_text&&";"!==c.last_text||K()):":"===a.text?0===c.ternary_depth?e=!1:c.ternary_depth-=1:"?"===a.text?c.ternary_depth+=1:"*"===a.text&&"TK_RESERVED"===o&&"function"===c.last_text&&(t=e=!1);_.space_before_token=_.space_before_token||e,R(),_.space_before_token=t},TK_COMMA:function(){if(c.declaration_statement)return A(c.parent.mode)&&(c.declaration_assignment=!1),R(),void(c.declaration_assignment?K(c.declaration_assignment=!1,!0):(_.space_before_token=!0,d.comma_first&&w()));R(),c.mode===L.ObjectLiteral||c.mode===L.Statement&&c.parent.mode===L.ObjectLiteral?(c.mode===L.Statement&&k(),K()):(_.space_before_token=!0,d.comma_first&&w())},TK_BLOCK_COMMENT:function(){if(_.raw)return _.add_raw_token(a),void(a.directives&&"end"===a.directives.preserve&&(d.test_output_raw||(_.raw=!1)));if(a.directives)return K(!1,!0),R(),"start"===a.directives.preserve&&(_.raw=!0),void K(!1,!0);if(!X.newline.test(a.text)&&!a.wanted_newline)return _.space_before_token=!0,R(),void(_.space_before_token=!0);var e,t=function(e){e=e.replace(/\x0d/g,"");var t=[],n=e.indexOf("\n");for(;-1!==n;)t.push(e.substring(0,n)),e=e.substring(n+1),n=e.indexOf("\n");e.length&&t.push(e);return t}(a.text),n=!1,i=!1,r=a.whitespace_before,s=r.length;K(!1,!0),1<t.length&&(!function(e,t){for(var n=0;n<e.length;n++){var i=$(e[n]);if(i.charAt(0)!==t)return!1}return!0}(t.slice(1),"*")?function(e,t){for(var n,i=0,r=e.length;i<r;i++)if((n=e[i])&&0!==n.indexOf(t))return!1;return!0}(t.slice(1),r)&&(i=!0):n=!0);for(R(t[0]),e=1;e<t.length;e++)K(!1,!0),n?R(" "+t[e].replace(/^\s+/g,"")):i&&t[e].length>s?R(t[e].substring(s)):_.add_token(t[e]);K(!1,!0)},TK_COMMENT:function(){a.wanted_newline?K(!1,!0):_.trim(!0);_.space_before_token=!0,R(),K(!1,!0)},TK_DOT:function(){O();"TK_RESERVED"===o&&N(c.last_text)?_.space_before_token=!0:w(")"===c.last_text&&d.break_chained_methods);R()},TK_UNKNOWN:function(){R(),"\n"===a.text[a.text.length-1]&&K()},TK_EOF:function(){for(;c.mode===L.Statement;)k()}},d={},(e=e||{}).braces_on_own_line!==undefined&&(d.brace_style=e.braces_on_own_line?"expand":"collapse"),d.brace_style=e.brace_style?e.brace_style:d.brace_style?d.brace_style:"collapse","expand-strict"===d.brace_style&&(d.brace_style="expand"),d.indent_size=e.indent_size?parseInt(e.indent_size,10):4,d.indent_char=e.indent_char?e.indent_char:" ",d.eol=e.eol?e.eol:"\n",d.preserve_newlines=e.preserve_newlines===undefined||e.preserve_newlines,d.break_chained_methods=e.break_chained_methods!==undefined&&e.break_chained_methods,d.max_preserve_newlines=e.max_preserve_newlines===undefined?0:parseInt(e.max_preserve_newlines,10),d.space_in_paren=e.space_in_paren!==undefined&&e.space_in_paren,d.space_in_empty_paren=e.space_in_empty_paren!==undefined&&e.space_in_empty_paren,d.jslint_happy=e.jslint_happy!==undefined&&e.jslint_happy,d.space_after_anon_function=e.space_after_anon_function!==undefined&&e.space_after_anon_function,d.keep_array_indentation=e.keep_array_indentation!==undefined&&e.keep_array_indentation,d.space_before_conditional=e.space_before_conditional===undefined||e.space_before_conditional,d.unescape_strings=e.unescape_strings!==undefined&&e.unescape_strings,d.wrap_line_length=e.wrap_line_length===undefined?0:parseInt(e.wrap_line_length,10),d.e4x=e.e4x!==undefined&&e.e4x,d.end_with_newline=e.end_with_newline!==undefined&&e.end_with_newline,d.comma_first=e.comma_first!==undefined&&e.comma_first,d.test_output_raw=e.test_output_raw!==undefined&&e.test_output_raw,d.jslint_happy&&(d.space_after_anon_function=!0),e.indent_with_tabs&&(d.indent_char="\t",d.indent_size=1),d.eol=d.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),h="";0<d.indent_size;)h+=d.indent_char,d.indent_size-=1;var g=0;if(i&&i.length){for(;" "===i.charAt(g)||"\t"===i.charAt(g);)T+=i.charAt(g),g+=1;i=i.substring(g)}function x(e){var t=e.newlines;if(d.keep_array_indentation&&S(c.mode))for(n=0;n<t;n+=1)K(0<n);else if(d.max_preserve_newlines&&t>d.max_preserve_newlines&&(t=d.max_preserve_newlines),d.preserve_newlines&&1<e.newlines){K();for(var n=1;n<t;n+=1)K(!0)}p[(a=e).type]()}function w(e){if(e=e!==undefined&&e,!_.just_added_newline())if(d.preserve_newlines&&a.wanted_newline||e)K(!1,!0);else if(d.wrap_line_length){_.current_line.get_character_count()+a.text.length+(_.space_before_token?1:0)>=d.wrap_line_length&&K(!1,!0)}}function K(e,t){if(!t&&";"!==c.last_text&&","!==c.last_text&&"="!==c.last_text&&"TK_OPERATOR"!==o)for(;c.mode===L.Statement&&!c.if_block&&!c.do_block;)k();_.add_new_line(e)&&(c.multiline_frame=!0)}function m(){_.just_added_newline()&&(d.keep_array_indentation&&S(c.mode)&&a.wanted_newline?(_.current_line.push(a.whitespace_before),_.space_before_token=!1):_.set_indent(c.indentation_level)&&(c.line_indent_level=c.indentation_level))}function R(e){_.raw?_.add_raw_token(a):(d.comma_first&&"TK_COMMA"===o&&_.just_added_newline()&&","===_.previous_line.last()&&(_.previous_line.pop(),m(),_.add_token(","),_.space_before_token=!0),e=e||a.text,m(),_.add_token(e))}function b(){c.indentation_level+=1}function v(e){c?(t.push(c),u=c):u=E(null,e),c=E(u,e)}function S(e){return e===L.ArrayLiteral}function A(e){return F(e,[L.Expression,L.ForInitializer,L.Conditional])}function k(){0<t.length&&(u=c,c=t.pop(),u.mode===L.Statement&&_.remove_redundant_indentation(u))}function y(){return c.parent.mode===L.ObjectLiteral&&c.mode===L.Statement&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===o&&F(c.last_text,["get","set"]))}function O(){return!!("TK_RESERVED"===o&&F(c.last_text,["var","let","const"])&&"TK_WORD"===a.type||"TK_RESERVED"===o&&"do"===c.last_text||"TK_RESERVED"===o&&"return"===c.last_text&&!a.wanted_newline||"TK_RESERVED"===o&&"else"===c.last_text&&("TK_RESERVED"!==a.type||"if"!==a.text)||"TK_END_EXPR"===o&&(u.mode===L.ForInitializer||u.mode===L.Conditional)||"TK_WORD"===o&&c.mode===L.BlockStatement&&!c.in_case&&"--"!==a.text&&"++"!==a.text&&"function"!==l&&"TK_WORD"!==a.type&&"TK_RESERVED"!==a.type||c.mode===L.ObjectLiteral&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===o&&F(c.last_text,["get","set"])))&&(v(L.Statement),b(),"TK_RESERVED"===o&&F(c.last_text,["var","let","const"])&&"TK_WORD"===a.type&&(c.declaration_statement=!0),y()||w("TK_RESERVED"===a.type&&F(a.text,["do","for","if","while"])),!0)}function N(e){return F(e,["case","return","do","if","throw","else"])}function D(e){var t=r+(e||0);return t<0||t>=f.length?null:f[t]}function C(){("TK_RESERVED"===a.type&&c.mode!==L.ObjectLiteral&&F(a.text,["set","get"])&&(a.type="TK_WORD"),"TK_RESERVED"===a.type&&c.mode===L.ObjectLiteral)&&(":"==D(1).text&&(a.type="TK_WORD"));if(O()||!a.wanted_newline||A(c.mode)||"TK_OPERATOR"===o&&"--"!==c.last_text&&"++"!==c.last_text||"TK_EQUALS"===o||!d.preserve_newlines&&"TK_RESERVED"===o&&F(c.last_text,["var","let","const","set","get"])||K(),c.do_block&&!c.do_while){if("TK_RESERVED"===a.type&&"while"===a.text)return _.space_before_token=!0,R(),_.space_before_token=!0,void(c.do_while=!0);K(),c.do_block=!1}if(c.if_block)if(c.else_block||"TK_RESERVED"!==a.type||"else"!==a.text){for(;c.mode===L.Statement;)k();c.if_block=!1,c.else_block=!1}else c.else_block=!0;if("TK_RESERVED"===a.type&&("case"===a.text||"default"===a.text&&c.in_case_statement))return K(),(c.case_body||d.jslint_happy)&&(0<c.indentation_level&&(!c.parent||c.indentation_level>c.parent.indentation_level)&&(c.indentation_level-=1),c.case_body=!1),R(),c.in_case=!0,void(c.in_case_statement=!0);if("TK_RESERVED"===a.type&&"function"===a.text&&((F(c.last_text,["}",";"])||_.just_added_newline()&&!F(c.last_text,["[","{",":","=",","]))&&(_.just_added_blankline()||a.comments_before.length||(K(),K(!0))),"TK_RESERVED"===o||"TK_WORD"===o?"TK_RESERVED"===o&&F(c.last_text,["get","set","new","return","export","async"])?_.space_before_token=!0:"TK_RESERVED"===o&&"default"===c.last_text&&"export"===l?_.space_before_token=!0:K():"TK_OPERATOR"===o||"="===c.last_text?_.space_before_token=!0:(c.multiline_frame||!A(c.mode)&&!S(c.mode))&&K()),"TK_COMMA"!==o&&"TK_START_EXPR"!==o&&"TK_EQUALS"!==o&&"TK_OPERATOR"!==o||y()||w(),"TK_RESERVED"===a.type&&F(a.text,["function","get","set"]))return R(),void(c.last_word=a.text);(n="NONE","TK_END_BLOCK"===o?"TK_RESERVED"===a.type&&F(a.text,["else","catch","finally"])?"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?n="NEWLINE":(n="SPACE",_.space_before_token=!0):n="NEWLINE":"TK_SEMICOLON"===o&&c.mode===L.BlockStatement?n="NEWLINE":"TK_SEMICOLON"===o&&A(c.mode)?n="SPACE":"TK_STRING"===o?n="NEWLINE":"TK_RESERVED"===o||"TK_WORD"===o||"*"===c.last_text&&"function"===l?n="SPACE":"TK_START_BLOCK"===o?n="NEWLINE":"TK_END_EXPR"===o&&(_.space_before_token=!0,n="NEWLINE"),"TK_RESERVED"===a.type&&F(a.text,s.line_starters)&&")"!==c.last_text&&(n="else"===c.last_text||"export"===c.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===a.type&&F(a.text,["else","catch","finally"]))?"TK_END_BLOCK"!==o||"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?K():(_.trim(!0),"}"!==_.current_line.last()&&K(),_.space_before_token=!0):"NEWLINE"===n?"TK_RESERVED"===o&&N(c.last_text)?_.space_before_token=!0:"TK_END_EXPR"!==o?"TK_START_EXPR"===o&&"TK_RESERVED"===a.type&&F(a.text,["var","let","const"])||":"===c.last_text||("TK_RESERVED"===a.type&&"if"===a.text&&"else"===c.last_text?_.space_before_token=!0:K()):"TK_RESERVED"===a.type&&F(a.text,s.line_starters)&&")"!==c.last_text&&K():c.multiline_frame&&S(c.mode)&&","===c.last_text&&"}"===l?K():"SPACE"===n&&(_.space_before_token=!0);R(),c.last_word=a.text,"TK_RESERVED"===a.type&&"do"===a.text&&(c.do_block=!0),"TK_RESERVED"===a.type&&"if"===a.text&&(c.if_block=!0)}o="TK_START_BLOCK",l="",(_=new I(h,T)).raw=d.test_output_raw,t=[],v(L.BlockStatement),this.beautify=function(){var e,t;for(s=new V(i,d,h),f=s.tokenize(),r=0;e=D();){for(var n=0;n<e.comments_before.length;n++)x(e.comments_before[n]);x(e),l=c.last_text,o=e.type,c.last_text=e.text,r+=1}return t=_.get_code(),d.end_with_newline&&(t+="\n"),"\n"!=d.eol&&(t=t.replace(/[\n]/g,d.eol)),t}}function s(t){var n=0,i=-1,r=[],s=!0;this.set_indent=function(e){n=t.baseIndentLength+e*t.indent_length,i=e},this.get_character_count=function(){return n},this.is_empty=function(){return s},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),n+=e.length,s=!1},this.pop=function(){var e=null;return s||(e=r.pop(),n-=e.length,s=0===r.length),e},this.remove_indent=function(){0<i&&(i-=1,n-=t.indent_length)},this.trim=function(){for(;" "===this.last();){r.pop();n-=1}s=0===r.length},this.toString=function(){var e="";return this._empty||(0<=i&&(e=t.indent_cache[i]),e+=r.join("")),e}}function I(t,n){n=n||"",this.indent_cache=[n],this.baseIndentLength=n.length,this.indent_length=t.length,this.raw=!1;var i=[];this.baseIndentString=n,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new s(this),i.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return i.length},this.add_new_line=function(e){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!e&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){return i.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(e){if(1<i.length){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==L.ForInitializer&&e.mode!==L.Conditional)for(var t=e.start_line_index,n=i.length;t<n;)i[t].remove_indent(),t++},this.trim=function(e){for(e=e!==undefined&&e,this.current_line.trim(t,n);e&&1<i.length&&this.current_line.is_empty();)i.pop(),this.current_line=i[i.length-1],this.current_line.trim();this.previous_line=1<i.length?i[i.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===i.length||i[i.length-2].is_empty())}}var Q=function(e,t,n,i,r,s){this.type=e,this.text=t,this.comments_before=[],this.newlines=n||0,this.wanted_newline=0<n,this.whitespace_before=i||"",this.parent=null,this.directives=null};function V(v,S,e){var A="\n\r\t ".split(""),k=/[0-9]/,y=/[01234567]/,O=/[0123456789abcdefABCDEF]/,N="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" ");this.line_starters="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var D,C,L,I,V,P,j=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),B=/([\s\S]*?)((?:\*\/)|$)/g,M=/([^\n\r\u2028\u2029]*)/g,U=/\/\* beautify( \w+[:]\w+)+ \*\//g,W=/ (\w+)[:](\w+)/g,z=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,G=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function _(){var e,t,n=[];if(D=0,C="",P<=V)return["","TK_EOF"];t=I.length?I[I.length-1]:new Q("TK_START_BLOCK","{");var i=v.charAt(V);for(V+=1;F(i,A);){if(X.newline.test(i)?"\n"===i&&"\r"===v.charAt(V-2)||(D+=1,n=[]):n.push(i),P<=V)return["","TK_EOF"];i=v.charAt(V),V+=1}if(n.length&&(C=n.join("")),k.test(i)){var r=!0,s=!0,_=k;for("0"===i&&V<P&&/[Xxo]/.test(v.charAt(V))?(s=r=!1,i+=v.charAt(V),V+=1,_=/[o]/.test(v.charAt(V))?y:O):(i="",V-=1);V<P&&_.test(v.charAt(V));)i+=v.charAt(V),V+=1,r&&V<P&&"."===v.charAt(V)&&(i+=v.charAt(V),V+=1,r=!1),s&&V<P&&/[Ee]/.test(v.charAt(V))&&(i+=v.charAt(V),(V+=1)<P&&/[+-]/.test(v.charAt(V))&&(i+=v.charAt(V),V+=1),r=s=!1);return[i,"TK_WORD"]}if(X.isIdentifierStart(v.charCodeAt(V-1))){if(V<P)for(;X.isIdentifierChar(v.charCodeAt(V))&&(i+=v.charAt(V),(V+=1)!==P););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&F(t.text,["set","get"])||!F(i,j)?[i,"TK_WORD"]:"in"===i?[i,"TK_OPERATOR"]:[i,"TK_RESERVED"]}if("("===i||"["===i)return[i,"TK_START_EXPR"];if(")"===i||"]"===i)return[i,"TK_END_EXPR"];if("{"===i)return[i,"TK_START_BLOCK"];if("}"===i)return[i,"TK_END_BLOCK"];if(";"===i)return[i,"TK_SEMICOLON"];if("/"===i){var a="";if("*"===v.charAt(V)){var o;V+=1,B.lastIndex=V,a="/*"+(o=B.exec(v))[0],V+=o[0].length;var l=function(e){if(!e.match(U))return null;var t={};W.lastIndex=0;for(var n=W.exec(e);n;)t[n[1]]=n[2],n=W.exec(e);return t}(a);return l&&"start"===l.ignore&&(z.lastIndex=V,a+=(o=z.exec(v))[0],V+=o[0].length),[a=a.replace(X.lineBreak,"\n"),"TK_BLOCK_COMMENT",l]}if("/"===v.charAt(V))return V+=1,M.lastIndex=V,a="//"+(o=M.exec(v))[0],V+=o[0].length,[a,"TK_COMMENT"]}if("`"===i||"'"===i||'"'===i||("/"===i||S.e4x&&"<"===i&&v.slice(V-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&F(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&F(t.parent.text,["if","while","for"])||F(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var h=i,c=!1,u=!1;if(e=i,"/"===h)for(var p=!1;V<P&&(c||p||v.charAt(V)!==h)&&!X.newline.test(v.charAt(V));)e+=v.charAt(V),c?c=!1:(c="\\"===v.charAt(V),"["===v.charAt(V)?p=!0:"]"===v.charAt(V)&&(p=!1)),V+=1;else if(S.e4x&&"<"===h){var d=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,f=v.slice(V-1),T=d.exec(f);if(T&&0===T.index){for(var E=T[2],g=0;T;){var x=!!T[1],w=T[2],K=!!T[T.length-1]||"![CDATA["===w.slice(0,8);if(w!==E||K||(x?--g:++g),g<=0)break;T=d.exec(f)}var m=T?T.index+T[0].length:f.length;return f=f.slice(0,m),V+=m-1,[f=f.replace(X.lineBreak,"\n"),"TK_STRING"]}}else for(;V<P&&(c||v.charAt(V)!==h&&("`"===h||!X.newline.test(v.charAt(V))));)(c||"`"===h)&&X.newline.test(v.charAt(V))?("\r"===v.charAt(V)&&"\n"===v.charAt(V+1)&&(V+=1),e+="\n"):e+=v.charAt(V),c?("x"!==v.charAt(V)&&"u"!==v.charAt(V)||(u=!0),c=!1):c="\\"===v.charAt(V),V+=1;if(u&&S.unescape_strings&&(e=function(e){var t,n=!1,i="",r=0,s="",_=0;for(;n||r<e.length;)if(t=e.charAt(r),r++,n){if(n=!1,"x"===t)s=e.substr(r,2),r+=2;else{if("u"!==t){i+="\\"+t;continue}s=e.substr(r,4),r+=4}if(!s.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(_=parseInt(s,16))&&_<32){i+="x"===t?"\\x"+s:"\\u"+s;continue}if(34===_||39===_||92===_)i+="\\"+String.fromCharCode(_);else{if("x"===t&&126<_&&_<=255)return e;i+=String.fromCharCode(_)}}else"\\"===t?n=!0:i+=t;return i}(e)),V<P&&v.charAt(V)===h&&(e+=h,V+=1,"/"===h))for(;V<P&&X.isIdentifierStart(v.charCodeAt(V));)e+=v.charAt(V),V+=1;return[e,"TK_STRING"]}if("#"===i){if(0===I.length&&"!"===v.charAt(V)){for(e=i;V<P&&"\n"!==i;)e+=i=v.charAt(V),V+=1;return[$(e)+"\n","TK_UNKNOWN"]}var R="#";if(V<P&&k.test(v.charAt(V))){for(;R+=i=v.charAt(V),(V+=1)<P&&"#"!==i&&"="!==i;);return"#"===i||("["===v.charAt(V)&&"]"===v.charAt(V+1)?(R+="[]",V+=2):"{"===v.charAt(V)&&"}"===v.charAt(V+1)&&(R+="{}",V+=2)),[R,"TK_WORD"]}}if("<"===i&&("?"===v.charAt(V)||"%"===v.charAt(V))){G.lastIndex=V-1;var b=G.exec(v);if(b)return i=b[0],V+=i.length-1,[i=i.replace(X.lineBreak,"\n"),"TK_STRING"]}if("<"===i&&"\x3c!--"===v.substring(V-1,V+3)){for(V+=3,i="\x3c!--";!X.newline.test(v.charAt(V))&&V<P;)i+=v.charAt(V),V++;return L=!0,[i,"TK_COMMENT"]}if("-"===i&&L&&"--\x3e"===v.substring(V-1,V+2))return L=!1,V+=2,["--\x3e","TK_COMMENT"];if("."===i)return[i,"TK_DOT"];if(F(i,N)){for(;V<P&&F(i+v.charAt(V),N)&&(i+=v.charAt(V),!(P<=(V+=1))););return","===i?[i,"TK_COMMA"]:"="===i?[i,"TK_EQUALS"]:[i,"TK_OPERATOR"]}return[i,"TK_UNKNOWN"]}this.tokenize=function(){var e,t,n;P=v.length,V=0,L=!1,I=[];for(var i=null,r=[],s=[];!t||"TK_EOF"!==t.type;){for(n=_(),e=new Q(n[1],n[0],D,C);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=n[2]),s.push(e),n=_(),e=new Q(n[1],n[0],D,C);s.length&&(e.comments_before=s,s=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(i),i=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&i&&("]"===e.text&&"["===i.text||")"===e.text&&"("===i.text||"}"===e.text&&"{"===i.text)&&(e.parent=i.parent,i=r.pop()),I.push(e),t=e}return I}}return{run:function(e,t){function _(e){return e.replace(/\s+$/g,"")}var n,i,r,T,s,a,E,o,l,g,x,w,h,c;for((t=t||{}).wrap_line_length!==undefined&&0!==parseInt(t.wrap_line_length,10)||t.max_char===undefined||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),i=t.indent_inner_html!==undefined&&t.indent_inner_html,r=t.indent_size===undefined?4:parseInt(t.indent_size,10),T=t.indent_char===undefined?" ":t.indent_char,a=t.brace_style===undefined?"collapse":t.brace_style,s=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),E=t.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],o=t.preserve_newlines===undefined||t.preserve_newlines,l=o?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,g=t.indent_handlebars!==undefined&&t.indent_handlebars,x=t.wrap_attributes===undefined?"auto":t.wrap_attributes,w=t.wrap_attributes_indent_size===undefined?r:parseInt(t.wrap_attributes_indent_size,10)||r,h=t.end_with_newline!==undefined&&t.end_with_newline,c=Array.isArray(t.extra_liners)?t.extra_liners.concat():"string"==typeof t.extra_liners?t.extra_liners.split(","):"head,body,/html".split(","),t.indent_with_tabs&&(T="\t",r=1),(n=new function(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=i,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:c,in_array:function(e,t){for(var n=0;n<t.length;n++)if(e==t[n])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)o&&"\n"==e&&this.newlines<=l&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var e="",t=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(t);else{if(g){var n=this.input.substr(this.pos,3);if("{{#"==n||"{{/"==n)break;if("{{!"==n)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"==this.input.substr(this.pos,2)&&"{{else}}"==this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos==this.input.length)return["","TK_EOF"];var t="",n=new RegExp("</"+e+"\\s*>","igm");n.lastIndex=this.pos;var i=n.exec(this.input),r=i?i.index:this.input.length;return this.pos<r&&(t=this.input.substring(this.pos,r),this.pos=r),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!=t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1==this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.indent_to_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!=t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]])}},this.get_tag=function(e){var t,n,i="",r=[],s="",_=!1,a=!0,o=this.pos,l=this.line_char_count;e=e!==undefined&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=o,this.line_char_count=l),r.length?r.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))_=!0;else{if("'"!=i&&'"'!=i||(i+=this.get_unformatted(i),_=!0),"="==i&&(_=!1),r.length&&"="!=r[r.length-1]&&">"!=i&&_){if(this.space_or_wrap(r),_=!1,!a&&"force"==x&&"/"!=i){this.print_newline(!0,r),this.print_indentation(r);for(var h=0;h<w;h++)r.push(T)}for(var c=0;c<r.length;c++)if(" "==r[c]){a=!1;break}}if(g&&"<"==n&&i+this.input.charAt(this.pos)=="{{"&&(i+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(i=" "+i),_=!0),"<"!=i||n||(t=this.pos-1,n="<"),g&&!n&&2<=r.length&&"{"==r[r.length-1]&&"{"==r[r.length-2]&&(t="#"==i||"/"==i||"!"==i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,r.push(i),r[1]&&("!"==r[1]||"?"==r[1]||"%"==r[1])){r=[this.get_comment(t)];break}if(g&&r[1]&&"{"==r[1]&&r[2]&&"!"==r[2]){r=[this.get_comment(t)];break}if(g&&"{"==n&&2<r.length&&"}"==r[r.length-2]&&"}"==r[r.length-1])break}}while(">"!=i);var u,p,d=r.join("");u=-1!=d.indexOf(" ")?d.indexOf(" "):"{"==d[0]?d.indexOf("}"):d.indexOf(">"),p="<"!=d[0]&&g?"#"==d[2]?3:2:1;var f=d.substring(p,u).toLowerCase();return"/"==d.charAt(d.length-2)||this.Utils.in_array(f,this.Utils.single_token)?e||(this.tag_type="SINGLE"):g&&"{"==d[0]&&"else"==f?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(f,E)?(s=this.get_unformatted("</"+f+">",d),r.push(s),this.pos,this.tag_type="SINGLE"):"script"==f&&(-1==d.search("type")||-1<d.search("type")&&-1<d.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?e||(this.record_tag(f),this.tag_type="SCRIPT"):"style"==f&&(-1==d.search("type")||-1<d.search("type")&&-1<d.search("text/css"))?e||(this.record_tag(f),this.tag_type="STYLE"):"!"==f.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"==f.charAt(0)?(this.retrieve_tag(f.substring(1)),this.tag_type="END"):(this.record_tag(f),"html"!=f.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(f,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=o,this.line_char_count=l),r.join("")},this.get_comment=function(e){var t="",n=">",i=!1;this.pos=e;var r=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&((t+=r)[t.length-1]!=n[n.length-1]||-1==t.indexOf(n));)!i&&t.length<10&&(0===t.indexOf("<![if")?(n="<![endif]>",i=!0):0===t.indexOf("<![cdata[")?(n="]]>",i=!0):0===t.indexOf("<![")?(n="]>",i=!0):0===t.indexOf("\x3c!--")?(n="--\x3e",i=!0):0===t.indexOf("{{!")?(n="}}",i=!0):0===t.indexOf("<?")?(n="?>",i=!0):0===t.indexOf("<%")&&(n="%>",i=!0)),r=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var n="",i="",r=0,s=!0;do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!s){this.line_char_count--;continue}if("\n"==n||"\r"==n){i+="\n",this.line_char_count=0;continue}}i+=n,this.line_char_count++,s=!0,g&&"{"==n&&i.length&&"{"==i[i.length-2]&&(r=(i+=this.get_unformatted("}}")).length)}while(-1==i.toLowerCase().indexOf(e,r));return i},this.get_token=function(){var e;if("TK_TAG_SCRIPT"==this.last_token||"TK_TAG_STYLE"==this.last_token){var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]}return"CONTENT"==this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"==this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":new Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!=e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var n=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(n&&!this.Utils.in_array(n,t))},this.printer=function(e,t,n,i,r){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i;for(var s=this.line_char_count=0;s<this.indent_size;s++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(e||"\n"!=t[t.length-1])&&("\n"!=t[t.length-1]&&(t[t.length-1]=_(t[t.length-1])),t.push("\n"))},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){this.is_whitespace(e)&&!this.output.length||((e||""!==e)&&this.output.length&&"\n"==this.output[this.output.length-1]&&(this.print_indentation(this.output),e=e.replace(/^\s+/g,"")),this.print_token_raw(e))},this.print_token_raw=function(e){0<this.newlines&&(e=_(e)),e&&""!==e&&(1<e.length&&"\n"==e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(0<t,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,T,r,s,a);;){var u=n.get_token();if(n.token_text=u[0],n.token_type=u[1],"TK_EOF"==n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"==n.last_token&&""===n.last_text){var p=n.token_text.match(/\w+/)[0],d=null;n.output.length&&(d=n.output[n.output.length-1].match(/(?:<|{{#)\/?\s*(\w+)/)),(null==d||d[1]!=p&&!n.Utils.in_array(d[1],E))&&n.print_newline(!1,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var f=n.token_text.match(/^\s*<([a-z-]+)/i);f&&n.Utils.in_array(f[1],E)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==n.token_text){n.print_newline(!1,n.output);var K,m=n.token_text,R=1;"TK_SCRIPT"==n.token_type?K=y:"TK_STYLE"==n.token_type&&(K=k),"keep"==t.indent_scripts?R=0:"separate"==t.indent_scripts&&(R=-n.indent_level);var b=n.get_full_indent(R);if(K)m=K(m.replace(/^\s*/,b),t);else{var v=m.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,S=n.get_full_indent(R-v);m=m.replace(/^\s*/,b).replace(/\r\n|\r|\n/g,"\n"+S).replace(/\s+$/,"")}m&&(n.print_token_raw(m),n.print_newline(!0,n.output))}n.current_mode="TAG";break;default:""!==n.token_text&&n.print_token(n.token_text)}n.last_token=n.token_type,n.last_text=n.token_text}var A=n.output.join("").replace(/[\r\n\t ]+$/,"");return h&&(A+="\n"),A}}}});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
7
|
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(M){M.extend(M.FE.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:"\t",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),M.FE.PLUGINS.codeView=function(l){var d,c;function f(){return l.$box.hasClass("fr-code-view")}function h(){return c?c.getValue():d.val()}function u(){f()&&(c&&c.setSize(null,l.opts.height?l.opts.height:"auto"),l.opts.heightMin||l.opts.height?l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",l.opts.heightMin||l.opts.height):l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}var p,g=!1;function m(){f()&&l.events.trigger("blur")}function b(){f()&&g&&l.events.trigger("focus")}function s(e){d||(!function(){d=M('<textarea class="fr-code" tabIndex="-1">'),l.$wp.append(d),d.attr("dir",l.opts.direction),l.$box.hasClass("fr-basic")||(p=M('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'+(l.helpers.isMobile()?"":" fr-desktop")+'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>'),l.$box.append(p),l.events.bindClick(l.$box,"a.html-switch",function(){l.events.trigger("commands.before",["html"]),v(!1),l.events.trigger("commands.after",["html"])}));var e=function(){return!f()};l.events.on("buttons.refresh",e),l.events.on("copy",e,!0),l.events.on("cut",e,!0),l.events.on("paste",e,!0),l.events.on("destroy",A,!0),l.events.on("html.set",function(){f()&&v(!0)}),l.events.on("codeView.update",u),l.events.on("form.submit",function(){f()&&(l.html.set(h()),l.events.trigger("contentChanged",[],!0))},!0)}(),!c&&l.opts.codeMirror?((c=l.opts.codeMirror.fromTextArea(d.get(0),l.opts.codeMirrorOptions)).on("blur",m),c.on("focus",b)):(l.events.$on(d,"keydown keyup change input",function(){l.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height=this.scrollHeight+"px")}),l.events.$on(d,"blur",m),l.events.$on(d,"focus",b))),l.undo.saveStep(),l.html.cleanEmptyTags(),l.html.cleanWhiteTags(!0),l.core.hasFocus()&&(l.core.isEmpty()||(l.selection.save(),l.$el.find('.fr-marker[data-type="true"]:first').replaceWith('<span class="fr-tmp fr-sm">F</span>'),l.$el.find('.fr-marker[data-type="false"]:last').replaceWith('<span class="fr-tmp fr-em">F</span>')));var t=l.html.get(!1,!0);l.$el.find("span.fr-tmp").remove(),l.$box.toggleClass("fr-code-view",!0);var n,r,s=!1;if(l.core.hasFocus()&&(s=!0,l.events.disableBlur(),l.$el.blur()),t=(t=t.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM")).replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),l.codeBeautifier&&(t=l.codeBeautifier.run(t,l.opts.codeBeautifierOptions)),c){n=t.indexOf("FROALA-SM"),(r=t.indexOf("FROALA-EM"))<n?n=r:r-=9;var i=(t=t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).substring(0,n).length-t.substring(0,n).replace(/\n/g,"").length,o=t.substring(0,r).length-t.substring(0,r).replace(/\n/g,"").length;n=t.substring(0,n).length-t.substring(0,t.substring(0,n).lastIndexOf("\n")+1).length,r=t.substring(0,r).length-t.substring(0,t.substring(0,r).lastIndexOf("\n")+1).length,c.setSize(null,l.opts.height?l.opts.height:"auto"),l.opts.heightMin&&l.$box.find(".CodeMirror-scroll").css("min-height",l.opts.heightMin),c.setValue(t),g=!s,c.focus(),g=!0,c.setSelection({line:i,ch:n},{line:o,ch:r}),c.refresh(),c.clearHistory()}else{n=t.indexOf("FROALA-SM"),r=t.indexOf("FROALA-EM")-9,l.opts.heightMin&&d.css("min-height",l.opts.heightMin),l.opts.height&&d.css("height",l.opts.height),d.val(t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change");var a=M(l.o_doc).scrollTop();g=!s,d.focus(),g=!0,d.get(0).setSelectionRange(n,r),M(l.o_doc).scrollTop(a)}l.$tb.find(" > .fr-command, > .fr-btn-wrap > .fr-command").not(e).filter(function(){return l.opts.codeViewKeepActiveButtons.indexOf(M(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),e.addClass("fr-active").attr("aria-pressed",!0),!l.helpers.isMobile()&&l.opts.toolbarInline&&l.toolbar.hide()}function v(e){void 0===e&&(e=!f());var t,n,r=l.$tb.find('.fr-command[data-cmd="html"]');e?(l.popups.hideAll(),s(r)):(l.$box.toggleClass("fr-code-view",!1),t=r,n=h(),l.html.set(n),l.$el.blur(),l.$tb.find(" > .fr-command, > .fr-btn-wrap > .fr-command").not(t).removeClass("fr-disabled").attr("aria-disabled",!1),t.removeClass("fr-active").attr("aria-pressed",!1),l.selection.setAtStart(l.el),l.selection.restore(),l.placeholder.refresh(),l.undo.saveStep())}function A(){f()&&v(!1),c&&c.toTextArea(),d.val("").removeData().remove(),d=null,p&&(p.remove(),p=null)}return{_init:function(){if(l.events.on("focus",function(){var e;l.opts.toolbarContainer&&(e=l.$tb.find('.fr-command[data-cmd="html"]'),f()?(l.$tb.find(" > .fr-command").not(e).filter(function(){return l.opts.codeViewKeepActiveButtons.indexOf(M(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!1),e.addClass("fr-active").attr("aria-pressed",!1)):(l.$tb.find(" > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active").attr("aria-pressed",!1)))}),!l.$wp)return!1},toggle:v,isActive:f,get:h}},M.FE.RegisterCommand("html",{title:"Code View",undo:!1,focus:!1,forcedRefresh:!0,toggle:!0,callback:function(){this.codeView.toggle()},plugin:"codeView"}),M.FE.DefineIcon("html",{NAME:"code"})});
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(M){M.extend(M.FE.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:"\t",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),M.FE.PLUGINS.codeView=function(l){var d,c;function f(){return l.$box.hasClass("fr-code-view")}function h(){return c?c.getValue():d.val()}function u(){f()&&(c&&c.setSize(null,l.opts.height?l.opts.height:"auto"),l.opts.heightMin||l.opts.height?(l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",l.opts.heightMin||l.opts.height),d.css("height",l.opts.height)):l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}var p,g=!1;function m(){f()&&l.events.trigger("blur")}function b(){f()&&g&&l.events.trigger("focus")}function s(e){d||(!function(){d=M('<textarea class="fr-code" tabIndex="-1">'),l.$wp.append(d),d.attr("dir",l.opts.direction),l.$box.hasClass("fr-basic")||(p=M('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'+(l.helpers.isMobile()?"":" fr-desktop")+'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>'),l.$box.append(p),l.events.bindClick(l.$box,"a.html-switch",function(){l.events.trigger("commands.before",["html"]),v(!1),l.events.trigger("commands.after",["html"])}));var e=function(){return!f()};l.events.on("buttons.refresh",e),l.events.on("copy",e,!0),l.events.on("cut",e,!0),l.events.on("paste",e,!0),l.events.on("destroy",A,!0),l.events.on("html.set",function(){f()&&v(!0)}),l.events.on("codeView.update",u),l.events.on("form.submit",function(){f()&&(l.html.set(h()),l.events.trigger("contentChanged",[],!0))},!0)}(),!c&&l.opts.codeMirror?((c=l.opts.codeMirror.fromTextArea(d.get(0),l.opts.codeMirrorOptions)).on("blur",m),c.on("focus",b)):(l.events.$on(d,"keydown keyup change input",function(){l.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height=this.scrollHeight+"px")}),l.events.$on(d,"blur",m),l.events.$on(d,"focus",b))),l.undo.saveStep(),l.html.cleanEmptyTags(),l.html.cleanWhiteTags(!0),l.core.hasFocus()&&(l.core.isEmpty()||(l.selection.save(),l.$el.find('.fr-marker[data-type="true"]:first').replaceWith('<span class="fr-tmp fr-sm">F</span>'),l.$el.find('.fr-marker[data-type="false"]:last').replaceWith('<span class="fr-tmp fr-em">F</span>')));var t=l.html.get(!1,!0);l.$el.find("span.fr-tmp").remove(),l.$box.toggleClass("fr-code-view",!0);var n,r,s=!1;if(l.core.hasFocus()&&(s=!0,l.events.disableBlur(),l.$el.blur()),t=(t=t.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM")).replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),l.codeBeautifier&&(t=l.codeBeautifier.run(t,l.opts.codeBeautifierOptions)),c){n=t.indexOf("FROALA-SM"),(r=t.indexOf("FROALA-EM"))<n?n=r:r-=9;var i=(t=t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).substring(0,n).length-t.substring(0,n).replace(/\n/g,"").length,o=t.substring(0,r).length-t.substring(0,r).replace(/\n/g,"").length;n=t.substring(0,n).length-t.substring(0,t.substring(0,n).lastIndexOf("\n")+1).length,r=t.substring(0,r).length-t.substring(0,t.substring(0,r).lastIndexOf("\n")+1).length,c.setSize(null,l.opts.height?l.opts.height:"auto"),l.opts.heightMin&&l.$box.find(".CodeMirror-scroll").css("min-height",l.opts.heightMin),c.setValue(t),g=!s,c.focus(),g=!0,c.setSelection({line:i,ch:n},{line:o,ch:r}),c.refresh(),c.clearHistory()}else{n=t.indexOf("FROALA-SM"),r=t.indexOf("FROALA-EM")-9,l.opts.heightMin&&d.css("min-height",l.opts.heightMin),l.opts.height&&d.css("height",l.opts.height),d.val(t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change");var a=M(l.o_doc).scrollTop();g=!s,d.focus(),g=!0,d.get(0).setSelectionRange(n,r),M(l.o_doc).scrollTop(a)}l.$tb.find(" > .fr-command, > .fr-btn-wrap > .fr-command").not(e).filter(function(){return l.opts.codeViewKeepActiveButtons.indexOf(M(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),e.addClass("fr-active").attr("aria-pressed",!0),!l.helpers.isMobile()&&l.opts.toolbarInline&&l.toolbar.hide()}function v(e){void 0===e&&(e=!f());var t,n,r=l.$tb.find('.fr-command[data-cmd="html"]');e?(l.popups.hideAll(),s(r)):(l.$box.toggleClass("fr-code-view",!1),t=r,n=h(),l.html.set(n),l.$el.blur(),l.$tb.find(" > .fr-command, > .fr-btn-wrap > .fr-command").not(t).removeClass("fr-disabled").attr("aria-disabled",!1),t.removeClass("fr-active").attr("aria-pressed",!1),l.selection.setAtStart(l.el),l.selection.restore(),l.placeholder.refresh(),l.undo.saveStep())}function A(){f()&&v(!1),c&&c.toTextArea(),d.val("").removeData().remove(),d=null,p&&(p.remove(),p=null)}return{_init:function(){if(l.events.on("focus",function(){var e;l.opts.toolbarContainer&&(e=l.$tb.find('.fr-command[data-cmd="html"]'),f()?(l.$tb.find(" > .fr-command").not(e).filter(function(){return l.opts.codeViewKeepActiveButtons.indexOf(M(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!1),e.addClass("fr-active").attr("aria-pressed",!1)):(l.$tb.find(" > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active").attr("aria-pressed",!1)))}),!l.$wp)return!1},toggle:v,isActive:f,get:h}},M.FE.RegisterCommand("html",{title:"Code View",undo:!1,focus:!1,forcedRefresh:!0,toggle:!0,callback:function(){this.codeView.toggle()},plugin:"codeView"}),M.FE.DefineIcon("html",{NAME:"code"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
7
|
-
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(o,r){return r===undefined&&(r="undefined"!=typeof window?require("jquery"):require("jquery")(o)),e(r)}:e(window.jQuery)}(function(C){C.extend(C.FE.POPUP_TEMPLATES,{"colors.picker":"[_BUTTONS_][_TEXT_COLORS_][_BACKGROUND_COLORS_][_CUSTOM_COLOR_]"}),C.extend(C.FE.DEFAULTS,{colorsText:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],colorsBackground:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],colorsStep:7,colorsHEXInput:!0,colorsDefaultTab:"text",colorsButtons:["colorsBack","|","-"]});var c=["text","background"];C.FE.PLUGINS.colors=function(E){function r(){E.popups.hide("colors.picker")}function s(o){for(var r="text"==o?E.opts.colorsText:E.opts.colorsBackground,e='<div class="fr-color-set fr-'+o+"-color"+(E.opts.colorsDefaultTab==o||"text"!=E.opts.colorsDefaultTab&&"background"!=E.opts.colorsDefaultTab&&"text"==o?" fr-selected-set":"")+'">',t=0;t<r.length;t++)0!==t&&t%E.opts.colorsStep==0&&(e+="<br>"),"REMOVE"!=r[t]?e+='<span class="fr-command fr-select-color" style="background: '+r[t]+';" tabIndex="-1" aria-selected="false" role="button" data-cmd="'+o+'Color" data-param1="'+r[t]+'"><span class="fr-sr-only">'+E.language.translate("Color")+" "+r[t]+" </span></span>":e+='<span class="fr-command fr-select-color" data-cmd="'+o+'Color" tabIndex="-1" role="button" data-param1="REMOVE" title="'+E.language.translate("Clear Formatting")+'">'+E.icon.create("remove")+'<span class="fr-sr-only">'+E.language.translate("Clear Formatting")+"</span></span>";return e+"</div>"}function l(o){var r=E.popups.get("colors.picker"),e=r.find(".fr-"+o+"-color .fr-active-item").attr("data-param1"),t=r.find(".fr-color-hex-layer input"),a=r.find('.fr-colors-tab[data-param1="'+o+'"]');t.length&&a.hasClass("fr-selected-tab")&&t.val(e).trigger("change")}function t(o){"REMOVE"!=o?E.format.applyStyle("background-color",E.helpers.HEXtoRGB(o)):E.format.removeStyle("background-color"),r()}function a(o){"REMOVE"!=o?E.format.applyStyle("color",E.helpers.HEXtoRGB(o)):E.format.removeStyle("color"),r()}return{showColorsPopup:function(){var o=E.$tb.find('.fr-command[data-cmd="color"]'),r=E.popups.get("colors.picker");if(r||(r=function(){var o,r='<div class="fr-buttons fr-colors-buttons">';E.opts.toolbarInline&&0<E.opts.colorsButtons.length&&(r+=E.button.buildList(E.opts.colorsButtons)),r+=(o='<div class="fr-colors-tabs fr-group">',o+='<span class="fr-colors-tab '+("background"==E.opts.colorsDefaultTab?"":"fr-selected-tab ")+'fr-command" tabIndex="-1" role="button" aria-pressed="'+("background"!=E.opts.colorsDefaultTab)+'" data-param1="text" data-cmd="colorChangeSet" title="'+E.language.translate("Text")+'">'+E.language.translate("Text")+"</span>",(o+='<span class="fr-colors-tab '+("background"==E.opts.colorsDefaultTab?"fr-selected-tab":"")+'fr-command" tabIndex="-1" role="button" aria-pressed="'+("background"==E.opts.colorsDefaultTab)+'" data-param1="background" data-cmd="colorChangeSet" title="'+E.language.translate("Background")+'">'+E.language.translate("Background")+"</span>")+"</div></div>");var e="";E.opts.colorsHEXInput&&(e='<div class="fr-color-hex-layer fr-active fr-layer" id="fr-color-hex-layer-'+E.id+'"><div class="fr-input-line"><input maxlength="7" id="fr-color-hex-layer-text-'+E.id+'" type="text" placeholder="'+E.language.translate("HEX Color")+'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="customColor" tabIndex="2" role="button">'+E.language.translate("OK")+"</button></div></div>");var b,t={buttons:r,text_colors:s("text"),background_colors:s("background"),custom_color:e},a=E.popups.create("colors.picker",t);return b=a,E.events.on("popup.tab",function(o){var r=C(o.currentTarget);if(!E.popups.isVisible("colors.picker")||!r.is("span"))return!0;var e=o.which,t=!0;if(C.FE.KEYCODE.TAB==e){var a=b.find(".fr-buttons");t=!E.accessibility.focusToolbar(a,!!o.shiftKey)}else if(C.FE.KEYCODE.ARROW_UP==e||C.FE.KEYCODE.ARROW_DOWN==e||C.FE.KEYCODE.ARROW_LEFT==e||C.FE.KEYCODE.ARROW_RIGHT==e){if(r.is("span.fr-select-color")){var s=r.parent().find("span.fr-select-color"),l=s.index(r),c=E.opts.colorsStep,n=Math.floor(s.length/c),i=l%c,p=Math.floor(l/c),u=p*c+i,d=n*c;C.FE.KEYCODE.ARROW_UP==e?u=((u-c)%d+d)%d:C.FE.KEYCODE.ARROW_DOWN==e?u=(u+c)%d:C.FE.KEYCODE.ARROW_LEFT==e?u=((u-1)%d+d)%d:C.FE.KEYCODE.ARROW_RIGHT==e&&(u=(u+1)%d);var f=C(s.get(u));E.events.disableBlur(),f.focus(),t=!1}}else C.FE.KEYCODE.ENTER==e&&(E.button.exec(r),t=!1);return!1===t&&(o.preventDefault(),o.stopPropagation()),t},!0),a}()),!r.hasClass("fr-active"))if(E.popups.setContainer("colors.picker",E.$tb),c.map(function(o){!function(o){var r,e=E.popups.get("colors.picker"),t=C(E.selection.element());r="background"==o?"background-color":"color";var a=e.find(".fr-"+o+"-color .fr-select-color");for(a.find(".fr-selected-color").remove(),a.removeClass("fr-active-item"),a.not('[data-param1="REMOVE"]').attr("aria-selected",!1);t.get(0)!=E.el;){if("transparent"!=t.css(r)&&"rgba(0, 0, 0, 0)"!=t.css(r)){var s=e.find(".fr-"+o+'-color .fr-select-color[data-param1="'+E.helpers.RGBToHex(t.css(r))+'"]');s.append('<span class="fr-selected-color" aria-hidden="true">\uf00c</span>'),s.addClass("fr-active-item").attr("aria-selected",!0);break}t=t.parent()}l(o)}(o)}),o.is(":visible")){var e=o.offset().left+o.outerWidth()/2,t=o.offset().top+(E.opts.toolbarBottom?10:o.outerHeight()-10);E.popups.show("colors.picker",e,t,o.outerHeight())}else E.position.forSelection(r),E.popups.show("colors.picker")},hideColorsPopup:r,changeSet:function(o,r){o.hasClass("fr-selected-tab")||(o.siblings().removeClass("fr-selected-tab").attr("aria-pressed",!1),o.addClass("fr-selected-tab").attr("aria-pressed",!0),o.parents(".fr-popup").find(".fr-color-set").removeClass("fr-selected-set"),o.parents(".fr-popup").find(".fr-color-set.fr-"+r+"-color").addClass("fr-selected-set"),l(r)),E.accessibility.focusPopup(o.parents(".fr-popup"))},background:t,customColor:function(){var o=E.popups.get("colors.picker"),r=o.find(".fr-color-hex-layer input");if(r.length){var e=r.val();"background"==o.find(".fr-selected-tab").attr("data-param1")?t(e):a(e)}},text:a,back:function(){E.popups.hide("colors.picker"),E.toolbar.showInline()}}},C.FE.DefineIcon("colors",{NAME:"tint"}),C.FE.RegisterCommand("color",{title:"Colors",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("colors.picker")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("colors.picker")):this.colors.showColorsPopup()},plugin:"colors"}),C.FE.RegisterCommand("textColor",{undo:!0,callback:function(o,r){this.colors.text(r)}}),C.FE.RegisterCommand("backgroundColor",{undo:!0,callback:function(o,r){this.colors.background(r)}}),C.FE.RegisterCommand("colorChangeSet",{undo:!1,focus:!1,callback:function(o,r){var e=this.popups.get("colors.picker").find('.fr-command[data-cmd="'+o+'"][data-param1="'+r+'"]');this.colors.changeSet(e,r)}}),C.FE.DefineIcon("colorsBack",{NAME:"arrow-left"}),C.FE.RegisterCommand("colorsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.colors.back()}}),C.FE.RegisterCommand("customColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor()}}),C.FE.DefineIcon("remove",{NAME:"eraser"})});
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(o,r){return r===undefined&&(r="undefined"!=typeof window?require("jquery"):require("jquery")(o)),e(r)}:e(window.jQuery)}(function(C){C.extend(C.FE.POPUP_TEMPLATES,{"colors.picker":"[_BUTTONS_][_TEXT_COLORS_][_BACKGROUND_COLORS_][_CUSTOM_COLOR_]"}),C.extend(C.FE.DEFAULTS,{colorsText:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],colorsBackground:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],colorsStep:7,colorsHEXInput:!0,colorsDefaultTab:"text",colorsButtons:["colorsBack","|","-"]});var c=["text","background"];C.FE.PLUGINS.colors=function(E){function r(){E.popups.hide("colors.picker")}function s(o){for(var r="text"==o?E.opts.colorsText:E.opts.colorsBackground,e='<div class="fr-color-set fr-'+o+"-color"+(E.opts.colorsDefaultTab==o||"text"!=E.opts.colorsDefaultTab&&"background"!=E.opts.colorsDefaultTab&&"text"==o?" fr-selected-set":"")+'">',t=0;t<r.length;t++)0!==t&&t%E.opts.colorsStep==0&&(e+="<br>"),"REMOVE"!=r[t]?e+='<span class="fr-command fr-select-color" style="background: '+r[t]+';" tabIndex="-1" aria-selected="false" role="button" data-cmd="'+o+'Color" data-param1="'+r[t]+'"><span class="fr-sr-only">'+E.language.translate("Color")+" "+r[t]+" </span></span>":e+='<span class="fr-command fr-select-color" data-cmd="'+o+'Color" tabIndex="-1" role="button" data-param1="REMOVE" title="'+E.language.translate("Clear Formatting")+'">'+E.icon.create("remove")+'<span class="fr-sr-only">'+E.language.translate("Clear Formatting")+"</span></span>";return e+"</div>"}function l(o){var r=E.popups.get("colors.picker"),e=r.find(".fr-"+o+"-color .fr-active-item").attr("data-param1"),t=r.find(".fr-color-hex-layer input"),a=r.find('.fr-colors-tab[data-param1="'+o+'"]');t.length&&a.hasClass("fr-selected-tab")&&t.val(e).trigger("change")}function t(o){"REMOVE"!=o?E.format.applyStyle("background-color",E.helpers.HEXtoRGB(o)):E.format.removeStyle("background-color"),r()}function a(o){"REMOVE"!=o?E.format.applyStyle("color",E.helpers.HEXtoRGB(o)):E.format.removeStyle("color"),r()}return{showColorsPopup:function(){var o=E.$tb.find('.fr-command[data-cmd="color"]'),r=E.popups.get("colors.picker");if(r||(r=function(){var o,r='<div class="fr-buttons fr-colors-buttons">';E.opts.toolbarInline&&0<E.opts.colorsButtons.length&&(r+=E.button.buildList(E.opts.colorsButtons)),r+=(o='<div class="fr-colors-tabs fr-group">',o+='<span class="fr-colors-tab '+("background"==E.opts.colorsDefaultTab?"":"fr-selected-tab ")+'fr-command" tabIndex="-1" role="button" aria-pressed="'+("background"!=E.opts.colorsDefaultTab)+'" data-param1="text" data-cmd="colorChangeSet" title="'+E.language.translate("Text")+'">'+E.language.translate("Text")+"</span>",(o+='<span class="fr-colors-tab '+("background"==E.opts.colorsDefaultTab?"fr-selected-tab ":"")+'fr-command" tabIndex="-1" role="button" aria-pressed="'+("background"==E.opts.colorsDefaultTab)+'" data-param1="background" data-cmd="colorChangeSet" title="'+E.language.translate("Background")+'">'+E.language.translate("Background")+"</span>")+"</div></div>");var e="";E.opts.colorsHEXInput&&(e='<div class="fr-color-hex-layer fr-active fr-layer" id="fr-color-hex-layer-'+E.id+'"><div class="fr-input-line"><input maxlength="7" id="fr-color-hex-layer-text-'+E.id+'" type="text" placeholder="'+E.language.translate("HEX Color")+'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="customColor" tabIndex="2" role="button">'+E.language.translate("OK")+"</button></div></div>");var b,t={buttons:r,text_colors:s("text"),background_colors:s("background"),custom_color:e},a=E.popups.create("colors.picker",t);return b=a,E.events.on("popup.tab",function(o){var r=C(o.currentTarget);if(!E.popups.isVisible("colors.picker")||!r.is("span"))return!0;var e=o.which,t=!0;if(C.FE.KEYCODE.TAB==e){var a=b.find(".fr-buttons");t=!E.accessibility.focusToolbar(a,!!o.shiftKey)}else if(C.FE.KEYCODE.ARROW_UP==e||C.FE.KEYCODE.ARROW_DOWN==e||C.FE.KEYCODE.ARROW_LEFT==e||C.FE.KEYCODE.ARROW_RIGHT==e){if(r.is("span.fr-select-color")){var s=r.parent().find("span.fr-select-color"),l=s.index(r),c=E.opts.colorsStep,n=Math.floor(s.length/c),i=l%c,p=Math.floor(l/c),u=p*c+i,d=n*c;C.FE.KEYCODE.ARROW_UP==e?u=((u-c)%d+d)%d:C.FE.KEYCODE.ARROW_DOWN==e?u=(u+c)%d:C.FE.KEYCODE.ARROW_LEFT==e?u=((u-1)%d+d)%d:C.FE.KEYCODE.ARROW_RIGHT==e&&(u=(u+1)%d);var f=C(s.get(u));E.events.disableBlur(),f.focus(),t=!1}}else C.FE.KEYCODE.ENTER==e&&(E.button.exec(r),t=!1);return!1===t&&(o.preventDefault(),o.stopPropagation()),t},!0),a}()),!r.hasClass("fr-active"))if(E.popups.setContainer("colors.picker",E.$tb),c.map(function(o){!function(o){var r,e=E.popups.get("colors.picker"),t=C(E.selection.element());r="background"==o?"background-color":"color";var a=e.find(".fr-"+o+"-color .fr-select-color");for(a.find(".fr-selected-color").remove(),a.removeClass("fr-active-item"),a.not('[data-param1="REMOVE"]').attr("aria-selected",!1);t.get(0)!=E.el;){if("transparent"!=t.css(r)&&"rgba(0, 0, 0, 0)"!=t.css(r)){var s=e.find(".fr-"+o+'-color .fr-select-color[data-param1="'+E.helpers.RGBToHex(t.css(r))+'"]');s.append('<span class="fr-selected-color" aria-hidden="true">\uf00c</span>'),s.addClass("fr-active-item").attr("aria-selected",!0);break}t=t.parent()}l(o)}(o)}),o.is(":visible")){var e=o.offset().left+o.outerWidth()/2,t=o.offset().top+(E.opts.toolbarBottom?10:o.outerHeight()-10);E.popups.show("colors.picker",e,t,o.outerHeight())}else E.position.forSelection(r),E.popups.show("colors.picker")},hideColorsPopup:r,changeSet:function(o,r){o.hasClass("fr-selected-tab")||(o.siblings().removeClass("fr-selected-tab").attr("aria-pressed",!1),o.addClass("fr-selected-tab").attr("aria-pressed",!0),o.parents(".fr-popup").find(".fr-color-set").removeClass("fr-selected-set"),o.parents(".fr-popup").find(".fr-color-set.fr-"+r+"-color").addClass("fr-selected-set"),l(r)),E.accessibility.focusPopup(o.parents(".fr-popup"))},background:t,customColor:function(){var o=E.popups.get("colors.picker"),r=o.find(".fr-color-hex-layer input");if(r.length){var e=r.val();"background"==o.find(".fr-selected-tab").attr("data-param1")?t(e):a(e)}},text:a,back:function(){E.popups.hide("colors.picker"),E.toolbar.showInline()}}},C.FE.DefineIcon("colors",{NAME:"tint"}),C.FE.RegisterCommand("color",{title:"Colors",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("colors.picker")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("colors.picker")):this.colors.showColorsPopup()},plugin:"colors"}),C.FE.RegisterCommand("textColor",{undo:!0,callback:function(o,r){this.colors.text(r)}}),C.FE.RegisterCommand("backgroundColor",{undo:!0,callback:function(o,r){this.colors.background(r)}}),C.FE.RegisterCommand("colorChangeSet",{undo:!1,focus:!1,callback:function(o,r){var e=this.popups.get("colors.picker").find('.fr-command[data-cmd="'+o+'"][data-param1="'+r+'"]');this.colors.changeSet(e,r)}}),C.FE.DefineIcon("colorsBack",{NAME:"arrow-left"}),C.FE.RegisterCommand("colorsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.colors.back()}}),C.FE.RegisterCommand("customColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor()}}),C.FE.DefineIcon("remove",{NAME:"eraser"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
7
|
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(v){v.extend(v.FE.DEFAULTS,{dragInline:!0}),v.FE.PLUGINS.draggable=function(f){function e(e){return!(!e.originalEvent||!e.originalEvent.target||e.originalEvent.target.nodeType!=Node.TEXT_NODE)||(e.target&&"A"==e.target.tagName&&1==e.target.childNodes.length&&"IMG"==e.target.childNodes[0].tagName&&(e.target=e.target.childNodes[0]),v(e.target).hasClass("fr-draggable")?(f.undo.canDo()||f.undo.saveStep(),f.opts.dragInline?f.$el.attr("contenteditable",!0):f.$el.attr("contenteditable",!1),f.opts.toolbarInline&&f.toolbar.hide(),v(e.target).addClass("fr-dragging"),f.browser.msie||f.browser.edge||f.selection.clear(),void e.originalEvent.dataTransfer.setData("text","Froala")):(f.browser.msie||e.preventDefault(),!1))}function g(e){return!(e&&("HTML"==e.tagName||"BODY"==e.tagName||f.node.isElement(e)))}function d(e,t,n){f.opts.iframe&&(e+=f.$iframe.offset().top,t+=f.$iframe.offset().left),p.offset().top!=e&&p.css("top",e),p.offset().left!=t&&p.css("left",t),p.width()!=n&&p.css("width",n)}function t(e){e.originalEvent.dataTransfer.dropEffect="move",f.opts.dragInline?function(){for(var e=null,t=0;t<v.FE.INSTANCES.length;t++)if((e=v.FE.INSTANCES[t].$el.find(".fr-dragging")).length)return e.get(0)}()
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(v){v.extend(v.FE.DEFAULTS,{dragInline:!0}),v.FE.PLUGINS.draggable=function(f){function e(e){return!(!e.originalEvent||!e.originalEvent.target||e.originalEvent.target.nodeType!=Node.TEXT_NODE)||(e.target&&"A"==e.target.tagName&&1==e.target.childNodes.length&&"IMG"==e.target.childNodes[0].tagName&&(e.target=e.target.childNodes[0]),v(e.target).hasClass("fr-draggable")?(f.undo.canDo()||f.undo.saveStep(),f.opts.dragInline?f.$el.attr("contenteditable",!0):f.$el.attr("contenteditable",!1),f.opts.toolbarInline&&f.toolbar.hide(),v(e.target).addClass("fr-dragging"),f.browser.msie||f.browser.edge||f.selection.clear(),void e.originalEvent.dataTransfer.setData("text","Froala")):(f.browser.msie||e.preventDefault(),!1))}function g(e){return!(e&&("HTML"==e.tagName||"BODY"==e.tagName||f.node.isElement(e)))}function d(e,t,n){f.opts.iframe&&(e+=f.$iframe.offset().top,t+=f.$iframe.offset().left),p.offset().top!=e&&p.css("top",e),p.offset().left!=t&&p.css("left",t),p.width()!=n&&p.css("width",n)}function t(e){e.originalEvent.dataTransfer.dropEffect="move",f.opts.dragInline?(!function(){for(var e=null,t=0;t<v.FE.INSTANCES.length;t++)if((e=v.FE.INSTANCES[t].$el.find(".fr-dragging")).length)return e.get(0)}()||f.browser.msie||f.browser.edge)&&e.preventDefault():(e.preventDefault(),function(e){var t=f.doc.elementFromPoint(e.originalEvent.pageX-f.win.pageXOffset,e.originalEvent.pageY-f.win.pageYOffset);if(!g(t)){for(var n=0,r=t;!g(r)&&r==t&&0<e.originalEvent.pageY-f.win.pageYOffset-n;)n++,r=f.doc.elementFromPoint(e.originalEvent.pageX-f.win.pageXOffset,e.originalEvent.pageY-f.win.pageYOffset-n);(!g(r)||p&&0===f.$el.find(r).length&&r!=p.get(0))&&(r=null);for(var a=0,o=t;!g(o)&&o==t&&e.originalEvent.pageY-f.win.pageYOffset+a<v(f.doc).height();)a++,o=f.doc.elementFromPoint(e.originalEvent.pageX-f.win.pageXOffset,e.originalEvent.pageY-f.win.pageYOffset+a);(!g(o)||p&&0===f.$el.find(o).length&&o!=p.get(0))&&(o=null),t=null==o&&r?r:o&&null==r?o:o&&r?n<a?r:o:null}if(v(t).hasClass("fr-drag-helper"))return;if(t&&!f.node.isBlock(t)&&(t=f.node.blockParent(t)),t&&0<=["TD","TH","TR","THEAD","TBODY"].indexOf(t.tagName)&&(t=v(t).parents("table").get(0)),t&&0<=["LI"].indexOf(t.tagName)&&(t=v(t).parents("UL, OL").get(0)),t&&!v(t).hasClass("fr-drag-helper")){var i;p||(v.FE.$draggable_helper||(v.FE.$draggable_helper=v('<div class="fr-drag-helper"></div>')),p=v.FE.$draggable_helper,f.events.on("shared.destroy",function(){p.html("").removeData().remove(),p=null},!0)),i=e.originalEvent.pageY<v(t).offset().top+v(t).outerHeight()/2;var l=v(t),s=0;i||0!==l.next().length?(i||(l=l.next()),"before"==p.data("fr-position")&&l.is(p.data("fr-tag"))||(0<l.prev().length&&(s=parseFloat(l.prev().css("margin-bottom"))||0),s=Math.max(s,parseFloat(l.css("margin-top"))||0),d(l.offset().top-s/2-f.$box.offset().top,l.offset().left-f.win.pageXOffset-f.$box.offset().left,l.width()),p.data("fr-position","before"))):"after"==p.data("fr-position")&&l.is(p.data("fr-tag"))||(s=parseFloat(l.css("margin-bottom"))||0,d(l.offset().top+v(t).height()+s/2-f.$box.offset().top,l.offset().left-f.win.pageXOffset-f.$box.offset().left,l.width()),p.data("fr-position","after")),p.data("fr-tag",l),p.addClass("fr-visible"),p.appendTo(f.$box)}else p&&0<f.$box.find(p).length&&p.removeClass("fr-visible")}(e))}function n(e){e.originalEvent.dataTransfer.dropEffect="move",f.opts.dragInline||e.preventDefault()}function r(e){f.$el.attr("contenteditable",!0);var t=f.$el.find(".fr-dragging");p&&p.hasClass("fr-visible")&&f.$box.find(p).length?a(e):t.length&&(e.preventDefault(),e.stopPropagation()),p&&f.$box.find(p).length&&p.removeClass("fr-visible"),t.removeClass("fr-dragging")}function a(e){var t,n;"true"!==f.$el.attr("contenteditable")&&f.$el.attr("contenteditable",!0);for(var r=0;r<v.FE.INSTANCES.length;r++)if((t=v.FE.INSTANCES[r].$el.find(".fr-dragging")).length){n=v.FE.INSTANCES[r];break}if(t.length){if(e.preventDefault(),e.stopPropagation(),p&&p.hasClass("fr-visible")&&f.$box.find(p).length)p.data("fr-tag")[p.data("fr-position")]('<span class="fr-marker"></span>'),p.removeClass("fr-visible");else if(!1===f.markers.insertAtPoint(e.originalEvent))return!1;if(t.removeClass("fr-dragging"),!1===(t=f.events.chainTrigger("element.beforeDrop",t)))return!1;var a=t;if(t.parent().is("A")&&1==t.parent().get(0).childNodes.length&&(a=t.parent()),f.core.isEmpty())f.events.focus();else f.$el.find(".fr-marker").replaceWith(v.FE.MARKERS),f.selection.restore();if(n==f||f.undo.canDo()||f.undo.saveStep(),f.core.isEmpty())f.$el.html(a);else{var o=f.markers.insert();0===a.find(o).length?v(o).replaceWith(a):0===t.find(o).length&&v(o).replaceWith(t),t.after(v.FE.MARKERS),f.selection.restore()}return f.popups.hideAll(),f.selection.save(),f.$el.find(f.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").not(f.opts.htmlAllowedEmptyTags.join(",")).remove(),f.html.wrap(),f.html.fillEmptyBlocks(),f.selection.restore(),f.undo.saveStep(),f.opts.iframe&&f.size.syncIframe(),n!=f&&(n.popups.hideAll(),n.$el.find(n.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").remove(),n.html.wrap(),n.html.fillEmptyBlocks(),n.undo.saveStep(),n.events.trigger("element.dropped"),n.opts.iframe&&n.size.syncIframe()),f.events.trigger("element.dropped",[a]),!1}p&&p.removeClass("fr-visible"),f.undo.canDo()||f.undo.saveStep(),setTimeout(function(){f.undo.saveStep()},0)}function o(e){if(e&&"DIV"==e.tagName&&f.node.hasClass(e,"fr-drag-helper"))e.parentNode.removeChild(e);else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var t=e.querySelectorAll("div.fr-drag-helper"),n=0;n<t.length;n++)t[n].parentNode.removeChild(t[n])}var p;return{_init:function(){f.opts.enter==v.FE.ENTER_BR&&(f.opts.dragInline=!0),f.events.on("dragstart",e,!0),f.events.on("dragover",t,!0),f.events.on("dragenter",n,!0),f.events.on("document.dragend",r,!0),f.events.on("document.drop",r,!0),f.events.on("drop",a,!0),f.events.on("html.processGet",o)}}}});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,o){return o===undefined&&(o="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(o)}:t(window.jQuery)}(function(g){g.extend(g.FE.POPUP_TEMPLATES,{emoticons:"[_BUTTONS_][_EMOTICONS_]"}),g.extend(g.FE.DEFAULTS,{emoticonsStep:8,emoticonsSet:[{code:"1f600",desc:"Grinning face"},{code:"1f601",desc:"Grinning face with smiling eyes"},{code:"1f602",desc:"Face with tears of joy"},{code:"1f603",desc:"Smiling face with open mouth"},{code:"1f604",desc:"Smiling face with open mouth and smiling eyes"},{code:"1f605",desc:"Smiling face with open mouth and cold sweat"},{code:"1f606",desc:"Smiling face with open mouth and tightly-closed eyes"},{code:"1f607",desc:"Smiling face with halo"},{code:"1f608",desc:"Smiling face with horns"},{code:"1f609",desc:"Winking face"},{code:"1f60a",desc:"Smiling face with smiling eyes"},{code:"1f60b",desc:"Face savoring delicious food"},{code:"1f60c",desc:"Relieved face"},{code:"1f60d",desc:"Smiling face with heart-shaped eyes"},{code:"1f60e",desc:"Smiling face with sunglasses"},{code:"1f60f",desc:"Smirking face"},{code:"1f610",desc:"Neutral face"},{code:"1f611",desc:"Expressionless face"},{code:"1f612",desc:"Unamused face"},{code:"1f613",desc:"Face with cold sweat"},{code:"1f614",desc:"Pensive face"},{code:"1f615",desc:"Confused face"},{code:"1f616",desc:"Confounded face"},{code:"1f617",desc:"Kissing face"},{code:"1f618",desc:"Face throwing a kiss"},{code:"1f619",desc:"Kissing face with smiling eyes"},{code:"1f61a",desc:"Kissing face with closed eyes"},{code:"1f61b",desc:"Face with stuck out tongue"},{code:"1f61c",desc:"Face with stuck out tongue and winking eye"},{code:"1f61d",desc:"Face with stuck out tongue and tightly-closed eyes"},{code:"1f61e",desc:"Disappointed face"},{code:"1f61f",desc:"Worried face"},{code:"1f620",desc:"Angry face"},{code:"1f621",desc:"Pouting face"},{code:"1f622",desc:"Crying face"},{code:"1f623",desc:"Persevering face"},{code:"1f624",desc:"Face with look of triumph"},{code:"1f625",desc:"Disappointed but relieved face"},{code:"1f626",desc:"Frowning face with open mouth"},{code:"1f627",desc:"Anguished face"},{code:"1f628",desc:"Fearful face"},{code:"1f629",desc:"Weary face"},{code:"1f62a",desc:"Sleepy face"},{code:"1f62b",desc:"Tired face"},{code:"1f62c",desc:"Grimacing face"},{code:"1f62d",desc:"Loudly crying face"},{code:"1f62e",desc:"Face with open mouth"},{code:"1f62f",desc:"Hushed face"},{code:"1f630",desc:"Face with open mouth and cold sweat"},{code:"1f631",desc:"Face screaming in fear"},{code:"1f632",desc:"Astonished face"},{code:"1f633",desc:"Flushed face"},{code:"1f634",desc:"Sleeping face"},{code:"1f635",desc:"Dizzy face"},{code:"1f636",desc:"Face without mouth"},{code:"1f637",desc:"Face with medical mask"}],emoticonsButtons:["emoticonsBack","|"],emoticonsUseImage:!0}),g.FE.PLUGINS.emoticons=function(E){function n(){if(!E.selection.isCollapsed())return!1;var e=E.selection.element(),o=E.selection.endElement();if(e&&E.node.hasClass(e,"fr-emoticon"))return e;if(o&&E.node.hasClass(o,"fr-emoticon"))return o;var t=E.selection.ranges(0),s=t.startContainer;if(s.nodeType==Node.ELEMENT_NODE&&0<s.childNodes.length&&0<t.startOffset){var n=s.childNodes[t.startOffset-1];if(E.node.hasClass(n,"fr-emoticon"))return n}return!1}return{_init:function(){var e=function(){for(var e=E.el.querySelectorAll(".fr-emoticon:not(.fr-deletable)"),o=0;o<e.length;o++)e[o].className+=" fr-deletable"};e(),E.events.on("html.set",e),E.events.on("keydown",function(e){if(E.keys.isCharacter(e.which)&&E.selection.inEditor()){var o=E.selection.ranges(0),t=n();E.node.hasClass(t,"fr-emoticon-img")&&t&&(0===o.startOffset&&E.selection.element()===t?g(t).before(g.FE.MARKERS+g.FE.INVISIBLE_SPACE):g(t).after(g.FE.INVISIBLE_SPACE+g.FE.MARKERS),E.selection.restore())}}),E.events.on("keyup",function(e){for(var o=E.el.querySelectorAll(".fr-emoticon"),t=0;t<o.length;t++)"undefined"!=typeof o[t].textContent&&0===o[t].textContent.replace(/\u200B/gi,"").length&&g(o[t]).remove();if(!(e.which>=g.FE.KEYCODE.ARROW_LEFT&&e.which<=g.FE.KEYCODE.ARROW_DOWN)){var s=n();E.node.hasClass(s,"fr-emoticon-img")&&(g(s).append(g.FE.MARKERS),E.selection.restore())}})},insert:function(e,o){var t=n(),s=E.selection.ranges(0);t?(0===s.startOffset&&E.selection.element()===t?g(t).before(g.FE.MARKERS+g.FE.INVISIBLE_SPACE):0<s.startOffset&&E.selection.element()===t&&s.commonAncestorContainer.parentNode.classList.contains("fr-emoticon")&&g(t).after(g.FE.INVISIBLE_SPACE+g.FE.MARKERS),E.selection.restore(),E.html.insert('<span class="fr-emoticon fr-deletable'+(o?" fr-emoticon-img":"")+'"'+(o?' style="background: url('+o+');"':"")+">"+(o?" ":e)+"</span> "+g.FE.MARKERS,!0)):E.html.insert('<span class="fr-emoticon fr-deletable'+(o?" fr-emoticon-img":"")+'"'+(o?' style="background: url('+o+');"':"")+">"+(o?" ":e)+"</span> ",!0)},showEmoticonsPopup:function(){var e=E.$tb.find('.fr-command[data-cmd="emoticons"]'),o=E.popups.get("emoticons");if(o||(o=function(){var e="";E.opts.toolbarInline&&0<E.opts.emoticonsButtons.length&&(e='<div class="fr-buttons fr-emoticons-buttons">'+E.button.buildList(E.opts.emoticonsButtons)+"</div>");var h,o={buttons:e,emoticons:function(){for(var e='<div style="text-align: center">',o=0;o<E.opts.emoticonsSet.length;o++)0!==o&&o%E.opts.emoticonsStep==0&&(e+="<br>"),e+='<span class="fr-command fr-emoticon" tabIndex="-1" data-cmd="insertEmoticon" title="'+E.language.translate(E.opts.emoticonsSet[o].desc)+'" role="button" data-param1="'+E.opts.emoticonsSet[o].code+'">'+(E.opts.emoticonsUseImage?'<img src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/'+E.opts.emoticonsSet[o].code+'.svg"/>':"&#x"+E.opts.emoticonsSet[o].code+";")+'<span class="fr-sr-only">'+E.language.translate(E.opts.emoticonsSet[o].desc)+" </span></span>";return E.opts.emoticonsUseImage&&(e+='<p style="font-size: 12px; text-align: center; padding: 0 5px;">Emoji free by <a class="fr-link" tabIndex="-1" href="http://emojione.com/" target="_blank" rel="nofollow noopener noreferrer" role="link" aria-label="Open Emoji One website.">Emoji One</a></p>'),e+="</div>"}()},t=E.popups.create("emoticons",o);return E.tooltip.bind(t,".fr-emoticon"),h=t,E.events.on("popup.tab",function(e){var o=g(e.currentTarget);if(!E.popups.isVisible("emoticons")||!o.is("span, a"))return!0;var t,s,n,c=e.which;if(g.FE.KEYCODE.TAB==c){if(o.is("span.fr-emoticon")&&e.shiftKey||o.is("a")&&!e.shiftKey){var i=h.find(".fr-buttons");t=!E.accessibility.focusToolbar(i,!!e.shiftKey)}if(!1!==t){var a=h.find("span.fr-emoticon:focus:first, span.fr-emoticon:visible:first, a");o.is("span.fr-emoticon")&&(a=a.not("span.fr-emoticon:not(:focus)")),s=a.index(o),s=e.shiftKey?((s-1)%a.length+a.length)%a.length:(s+1)%a.length,n=a.get(s),E.events.disableBlur(),n.focus(),t=!1}}else if(g.FE.KEYCODE.ARROW_UP==c||g.FE.KEYCODE.ARROW_DOWN==c||g.FE.KEYCODE.ARROW_LEFT==c||g.FE.KEYCODE.ARROW_RIGHT==c){if(o.is("span.fr-emoticon")){var f=o.parent().find("span.fr-emoticon");s=f.index(o);var d=E.opts.emoticonsStep,r=Math.floor(f.length/d),l=s%d,m=Math.floor(s/d),u=m*d+l,p=r*d;g.FE.KEYCODE.ARROW_UP==c?u=((u-d)%p+p)%p:g.FE.KEYCODE.ARROW_DOWN==c?u=(u+d)%p:g.FE.KEYCODE.ARROW_LEFT==c?u=((u-1)%p+p)%p:g.FE.KEYCODE.ARROW_RIGHT==c&&(u=(u+1)%p),n=g(f.get(u)),E.events.disableBlur(),n.focus(),t=!1}}else g.FE.KEYCODE.ENTER==c&&(o.is("a")?o[0].click():E.button.exec(o),t=!1);return!1===t&&(e.preventDefault(),e.stopPropagation()),t},!0),t}()),!o.hasClass("fr-active")){E.popups.refresh("emoticons"),E.popups.setContainer("emoticons",E.$tb);var t=e.offset().left+e.outerWidth()/2,s=e.offset().top+(E.opts.toolbarBottom?10:e.outerHeight()-10);E.popups.show("emoticons",t,s,e.outerHeight())}},hideEmoticonsPopup:function(){E.popups.hide("emoticons")},back:function(){E.popups.hide("emoticons"),E.toolbar.showInline()}}},g.FE.DefineIcon("emoticons",{NAME:"smile-o",FA5NAME:"smile"}),g.FE.RegisterCommand("emoticons",{title:"Emoticons",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("emoticons")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("emoticons")):this.emoticons.showEmoticonsPopup()},plugin:"emoticons"}),g.FE.RegisterCommand("insertEmoticon",{callback:function(e,o){this.emoticons.insert("&#x"+o+";",this.opts.emoticonsUseImage?"https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/"+o+".svg":null),this.emoticons.hideEmoticonsPopup()}}),g.FE.DefineIcon("emoticonsBack",{NAME:"arrow-left"}),g.FE.RegisterCommand("emoticonsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.emoticons.back()}})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(e,r){return r===undefined&&(r="undefined"!=typeof window?require("jquery"):require("jquery")(e)),a(r)}:a(window.jQuery)}(function(c){c.extend(c.FE.DEFAULTS,{entities:""'¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿŒœŠšŸƒˆ˜ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψωϑϒϖ   ‌‍‎‏–—‘’‚“”„†‡•…‰′″‹›‾⁄€ℑ℘ℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑−∗√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈⌉⌊⌋⟨⟩◊♠♣♥♦"}),c.FE.PLUGINS.entities=function(t){var n,u;function i(e){var r=e.textContent;if(r.match(n)){for(var a="",i=0;i<r.length;i++)u[r[i]]?a+=u[r[i]]:a+=r[i];e.textContent=a}}function o(e){if(e&&0<=["STYLE","SCRIPT","svg","IFRAME"].indexOf(e.tagName))return!0;for(var r=t.node.contents(e),a=0;a<r.length;a++)r[a].nodeType==Node.TEXT_NODE?i(r[a]):o(r[a]);e.nodeType==Node.TEXT_NODE&&i(e)}function l(e){return 0===e.length?"":t.clean.exec(e,o).replace(/\&/g,"&")}return{_init:function(){t.opts.htmlSimpleAmpersand||(t.opts.entities=t.opts.entities+"&");var e=c("<div>").html(t.opts.entities).text(),r=t.opts.entities.split(";");u={},n="";for(var a=0;a<e.length;a++){var i=e.charAt(a);u[i]=r[a]+";",n+="\\"+i+(a<e.length-1?"|":"")}n=new RegExp("("+n+")","g"),t.events.on("html.get",l,!0)}}}});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),i(t)}:i(window.jQuery)}(function(T){T.extend(T.FE.POPUP_TEMPLATES,{"file.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_PROGRESS_BAR_]"}),T.extend(T.FE.DEFAULTS,{fileUpload:!0,fileUploadURL:null,fileUploadParam:"file",fileUploadParams:{},fileUploadToS3:!1,fileUploadMethod:"POST",fileMaxSize:10485760,fileAllowedTypes:["*"],fileInsertButtons:["fileBack","|"],fileUseSelectedText:!1}),T.FE.PLUGINS.file=function(f){var r,p="https://i.froala.com/upload",l=2,d=3,u=4,c=5,v=6,i={};function g(){var e=f.popups.get("file.insert");e||(e=S()),e.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),e.find(".fr-file-progress-bar-layer").addClass("fr-active"),e.find(".fr-buttons").hide(),n(f.language.translate("Uploading"),0)}function o(e){var t=f.popups.get("file.insert");t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-file-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e&&(f.events.focus(),f.popups.hide("file.insert")))}function n(e,t){var i=f.popups.get("file.insert");if(i){var r=i.find(".fr-file-progress-bar-layer");r.find("h3").text(e+(t?" "+t+"%":"")),r.removeClass("fr-error"),t?(r.find("div").removeClass("fr-indeterminate"),r.find("div > span").css("width",t+"%")):r.find("div").addClass("fr-indeterminate")}}function h(e,t,i){f.edit.on(),f.events.focus(!0),f.selection.restore(),f.opts.fileUseSelectedText&&f.selection.text().length&&(t=f.selection.text()),f.html.insert('<a href="'+e+'" target="_blank" id="fr-inserted-file" class="fr-file">'+t+"</a>");var r=f.$el.find("#fr-inserted-file");r.removeAttr("id"),f.popups.hide("file.insert"),f.undo.saveStep(),C(),f.events.trigger("file.inserted",[r,i])}function m(e){var t=this.status,i=this.response,r=this.responseXML,o=this.responseText;try{if(f.opts.fileUploadToS3)if(201==t){var n=function(e){try{var t=T(e).find("Location").text(),i=T(e).find("Key").text();return!1===f.events.trigger("file.uploadedToS3",[t,i,e],!0)?(f.edit.on(),!1):t}catch(r){return U(u,e),!1}}(r);n&&h(n,e,i||r)}else U(u,i||r);else if(200<=t&&t<300){var a=function(e){try{if(!1===f.events.trigger("file.uploaded",[e],!0))return f.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(U(l,e),!1)}catch(i){return U(u,e),!1}}(o);a&&h(a.link,e,i||o)}else U(d,i||o)}catch(s){U(u,i||o)}}function b(){U(u,this.response||this.responseText||this.responseXML)}function y(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;n(f.language.translate("Uploading"),t)}}function U(e,t){f.edit.on(),function(e){g();var t=f.popups.get("file.insert").find(".fr-file-progress-bar-layer");t.addClass("fr-error");var i=t.find("h3");i.text(e),f.events.disableBlur(),i.focus()}(f.language.translate("Something went wrong. Please try again.")),f.events.trigger("file.error",[{code:e,message:i[e]},t])}function w(){f.edit.on(),o(!0)}function a(e){if(void 0!==e&&0<e.length){if(!1===f.events.trigger("file.beforeUpload",[e]))return!1;var t,i=e[0];if((null===f.opts.fileUploadURL||f.opts.fileUploadURL==p)&&!f.opts.fileUploadToS3)return s=i,(l=new FileReader).onload=function(){for(var e=l.result,t=atob(l.result.split(",")[1]),i=[],r=0;r<t.length;r++)i.push(t.charCodeAt(r));e=window.URL.createObjectURL(new Blob([new Uint8Array(i)],{type:s.type})),f.file.insert(e,s.name,null)},g(),l.readAsDataURL(s),!1;if(i.size>f.opts.fileMaxSize)return U(c),!1;if(f.opts.fileAllowedTypes.indexOf("*")<0&&f.opts.fileAllowedTypes.indexOf(i.type.replace(/file\//g,""))<0)return U(v),!1;if(f.drag_support.formdata&&(t=f.drag_support.formdata?new FormData:null),t){var r;if(!1!==f.opts.fileUploadToS3)for(r in t.append("key",f.opts.fileUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",i.type),f.opts.fileUploadToS3.params)f.opts.fileUploadToS3.params.hasOwnProperty(r)&&t.append(r,f.opts.fileUploadToS3.params[r]);for(r in f.opts.fileUploadParams)f.opts.fileUploadParams.hasOwnProperty(r)&&t.append(r,f.opts.fileUploadParams[r]);t.append(f.opts.fileUploadParam,i);var o=f.opts.fileUploadURL;f.opts.fileUploadToS3&&(o=f.opts.fileUploadToS3.uploadURL?f.opts.fileUploadToS3.uploadURL:"https://"+f.opts.fileUploadToS3.region+".amazonaws.com/"+f.opts.fileUploadToS3.bucket);var n=f.core.getXHR(o,f.opts.fileUploadMethod);n.onload=function(){m.call(n,i.name)},n.onerror=b,n.upload.onprogress=y,n.onabort=w,g();var a=f.popups.get("file.insert");a&&a.off("abortUpload").on("abortUpload",function(){4!=n.readyState&&n.abort()}),n.send(t)}}var s,l}function s(){o()}function S(e){if(e)return f.popups.onHide("file.insert",s),!0;var t;f.opts.fileUpload||f.opts.fileInsertButtons.splice(f.opts.fileInsertButtons.indexOf("fileUpload"),1),t='<div class="fr-buttons">'+f.button.buildList(f.opts.fileInsertButtons)+"</div>";var i="";f.opts.fileUpload&&(i='<div class="fr-file-upload-layer fr-layer fr-active" id="fr-file-upload-layer-'+f.id+'"><strong>'+f.language.translate("Drop file")+"</strong><br>("+f.language.translate("or click")+')<div class="fr-form"><input type="file" name="'+f.opts.fileUploadParam+'" accept="'+(0<=f.opts.fileAllowedTypes.indexOf("*")?"/":"")+f.opts.fileAllowedTypes.join(", ").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-file-upload-layer-'+f.id+'" role="button"></div></div>');var r,o={buttons:t,upload_layer:i,progress_bar:'<div class="fr-file-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="fileDismissError" tabIndex="2" role="button">OK</button></div></div>'},n=f.popups.create("file.insert",o);return r=n,f.events.$on(r,"dragover dragenter",".fr-file-upload-layer",function(){return T(this).addClass("fr-drop"),!1},!0),f.events.$on(r,"dragleave dragend",".fr-file-upload-layer",function(){return T(this).removeClass("fr-drop"),!1},!0),f.events.$on(r,"drop",".fr-file-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),T(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;t&&t.files&&(r.data("instance")||f).file.upload(t.files)},!0),f.helpers.isIOS()&&f.events.$on(r,"touchstart",'.fr-file-upload-layer input[type="file"]',function(){T(this).trigger("click")}),f.events.$on(r,"change",'.fr-file-upload-layer input[type="file"]',function(){if(this.files){var e=r.data("instance")||f;e.events.disableBlur(),r.find("input:focus").blur(),e.events.enableBlur(),e.file.upload(this.files)}T(this).val("")},!0),n}function e(e){f.node.hasClass(e,"fr-file")}function t(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var i=t.files[0];if(i&&"undefined"!=typeof i.type){if(i.type.indexOf("image")<0){if(!f.opts.fileUpload)return e.preventDefault(),e.stopPropagation(),!1;f.markers.remove(),f.markers.insertAtPoint(e.originalEvent),f.$el.find(".fr-marker").replaceWith(T.FE.MARKERS),f.popups.hideAll();var r=f.popups.get("file.insert");return r||(r=S()),f.popups.setContainer("file.insert",f.$sc),f.popups.show("file.insert",e.originalEvent.pageX,e.originalEvent.pageY),g(),a(t.files),e.preventDefault(),e.stopPropagation(),!1}}else i.type.indexOf("image")<0&&(e.preventDefault(),e.stopPropagation())}}function C(){var e,t=Array.prototype.slice.call(f.el.querySelectorAll("a.fr-file")),i=[];for(e=0;e<t.length;e++)i.push(t[e].getAttribute("href"));if(r)for(e=0;e<r.length;e++)i.indexOf(r[e].getAttribute("href"))<0&&f.events.trigger("file.unlink",[r[e]]);r=t}return i[1]="File cannot be loaded from the passed link.",i[l]="No link in upload response.",i[d]="Error during file upload.",i[u]="Parsing response failed.",i[c]="File is too large.",i[v]="File file type is invalid.",i[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",{_init:function(){f.events.on("drop",t),f.events.$on(f.$win,"keydown",function(e){var t=e.which,i=f.popups.get("file.insert");i&&t==T.FE.KEYCODE.ESC&&i.trigger("abortUpload")}),f.events.on("destroy",function(){var e=f.popups.get("file.insert");e&&e.trigger("abortUpload")}),f.events.on("link.beforeRemove",e),f.$wp&&(C(),f.events.on("contentChanged",C)),S(!0)},showInsertPopup:function(){var e=f.$tb.find('.fr-command[data-cmd="insertFile"]'),t=f.popups.get("file.insert");if(t||(t=S()),o(),!t.hasClass("fr-active"))if(f.popups.refresh("file.insert"),f.popups.setContainer("file.insert",f.$tb),e.is(":visible")){var i=e.offset().left+e.outerWidth()/2,r=e.offset().top+(f.opts.toolbarBottom?10:e.outerHeight()-10);f.popups.show("file.insert",i,r,e.outerHeight())}else f.position.forSelection(t),f.popups.show("file.insert")},upload:a,insert:h,back:function(){f.events.disableBlur(),f.selection.restore(),f.events.enableBlur(),f.popups.hide("file.insert"),f.toolbar.showInline()},hideProgressBar:o}},T.FE.DefineIcon("insertFile",{NAME:"file-o",FA5NAME:"file"}),T.FE.RegisterCommand("insertFile",{title:"Upload File",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("file.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("file.insert")):this.file.showInsertPopup()},plugin:"file"}),T.FE.DefineIcon("fileBack",{NAME:"arrow-left"}),T.FE.RegisterCommand("fileBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.file.back()},refresh:function(e){this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),T.FE.RegisterCommand("fileDismissError",{title:"OK",callback:function(){this.file.hideProgressBar(!0)}})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(l){l.extend(l.FE.DEFAULTS,{fontFamily:{"Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma","Times New Roman,Times,serif,-webkit-standard":"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},fontFamilySelection:!1,fontFamilyDefaultSelection:"Font Family"}),l.FE.PLUGINS.fontFamily=function(o){function i(e){var t=e.replace(/(sans-serif|serif|monospace|cursive|fantasy)/gi,"").replace(/"|'| /g,"").split(",");return l.grep(t,function(e){return 0<e.length})}function r(e,t){for(var n=0;n<e.length;n++)for(var a=0;a<t.length;a++)if(e[n].toLowerCase()==t[a].toLowerCase())return[n,a];return null}function f(){var e=i(l(o.selection.element()).css("font-family")),t=[];for(var n in o.opts.fontFamily)if(o.opts.fontFamily.hasOwnProperty(n)){var a=r(e,i(n));a&&t.push([n,a])}return 0===t.length?null:(t.sort(function(e,t){var n=e[1][0]-t[1][0];return 0===n?e[1][1]-t[1][1]:n}),t[0][0])}return{apply:function(e){o.format.applyStyle("font-family",e)},refreshOnShow:function(e,t){t.find(".fr-command.fr-active").removeClass("fr-active").attr("aria-selected",!1),t.find('.fr-command[data-param1="'+f()+'"]').addClass("fr-active").attr("aria-selected",!0);var n=t.find(".fr-dropdown-list"),a=t.find(".fr-active").parent();a.length?n.parent().scrollTop(a.offset().top-n.offset().top-(n.parent().outerHeight()/2-a.outerHeight()/2)):n.parent().scrollTop(0)},refresh:function(e){if(o.opts.fontFamilySelection){var t=l(o.selection.element()).css("font-family").replace(/(sans-serif|serif|monospace|cursive|fantasy)/gi,"").replace(/"|'|/g,"").split(",");e.find("> span").text(o.opts.fontFamily[f()]||t[0]||o.language.translate(o.opts.fontFamilyDefaultSelection))}}}},l.FE.RegisterCommand("fontFamily",{type:"dropdown",displaySelection:function(e){return e.opts.fontFamilySelection},defaultSelection:function(e){return e.opts.fontFamilyDefaultSelection},displaySelectionWidth:120,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.fontFamily;for(var n in t)t.hasOwnProperty(n)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="fontFamily" data-param1="'+n+'" style="font-family: '+n+'" title="'+t[n]+'">'+t[n]+"</a></li>");return e+="</ul>"},title:"Font Family",callback:function(e,t){this.fontFamily.apply(t)},refresh:function(e){this.fontFamily.refresh(e)},refreshOnShow:function(e,t){this.fontFamily.refreshOnShow(e,t)},plugin:"fontFamily"}),l.FE.DefineIcon("fontFamily",{NAME:"font"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(f){f.extend(f.FE.DEFAULTS,{fontSize:["8","9","10","11","12","14","18","24","30","36","48","60","72","96"],fontSizeSelection:!1,fontSizeDefaultSelection:"12",fontSizeUnit:"px"}),f.FE.PLUGINS.fontSize=function(r){return{apply:function(e){r.format.applyStyle("font-size",e)},refreshOnShow:function(e,t){var n=f(r.selection.element()).css("font-size");"pt"===r.opts.fontSizeUnit&&(n=Math.round(72*parseFloat(n,10)/96)+"pt"),t.find(".fr-command.fr-active").removeClass("fr-active").attr("aria-selected",!1),t.find('.fr-command[data-param1="'+n+'"]').addClass("fr-active").attr("aria-selected",!0);var o=t.find(".fr-dropdown-list"),i=t.find(".fr-active").parent();i.length?o.parent().scrollTop(i.offset().top-o.offset().top-(o.parent().outerHeight()/2-i.outerHeight()/2)):o.parent().scrollTop(0)},refresh:function(e){if(r.opts.fontSizeSelection){var t=r.helpers.getPX(f(r.selection.element()).css("font-size"));"pt"===r.opts.fontSizeUnit&&(t=Math.round(72*parseFloat(t,10)/96)+"pt"),e.find("> span").text(t)}}}},f.FE.RegisterCommand("fontSize",{type:"dropdown",title:"Font Size",displaySelection:function(e){return e.opts.fontSizeSelection},displaySelectionWidth:30,defaultSelection:function(e){return e.opts.fontSizeDefaultSelection},html:function(){for(var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.fontSize,n=0;n<t.length;n++){var o=t[n];e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="fontSize" data-param1="'+o+this.opts.fontSizeUnit+'" title="'+o+'">'+o+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.fontSize.apply(t)},refresh:function(e){this.fontSize.refresh(e)},refreshOnShow:function(e,t){this.fontSize.refreshOnShow(e,t)},plugin:"fontSize"}),f.FE.DefineIcon("fontSize",{NAME:"text-height"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(o){"function"==typeof define&&define.amd?define(["jquery"],o):"object"==typeof module&&module.exports?module.exports=function(t,e){return e===undefined&&(e="undefined"!=typeof window?require("jquery"):require("jquery")(t)),o(e)}:o(window.jQuery)}(function(l){l.extend(l.FE.POPUP_TEMPLATES,{"forms.edit":"[_BUTTONS_]","forms.update":"[_BUTTONS_][_TEXT_LAYER_]"}),l.extend(l.FE.DEFAULTS,{formEditButtons:["inputStyle","inputEdit"],formStyles:{"fr-rounded":"Rounded","fr-large":"Large"},formMultipleStyles:!0,formUpdateButtons:["inputBack","|"]}),l.FE.PLUGINS.forms=function(s){var r;function t(t){t.preventDefault(),s.selection.clear(),l(this).data("mousedown",!0)}function e(t){l(this).data("mousedown")&&(t.stopPropagation(),l(this).removeData("mousedown"),a(r=this)),t.preventDefault()}function o(){s.$el.find("input, textarea, button").removeData("mousedown")}function n(){l(this).removeData("mousedown")}function i(){return r||null}function a(t){var e=s.popups.get("forms.edit");e||(e=function(){var t="";0<s.opts.formEditButtons.length&&(t='<div class="fr-buttons">'+s.button.buildList(s.opts.formEditButtons)+"</div>");var e={buttons:t},o=s.popups.create("forms.edit",e);return s.$wp&&s.events.$on(s.$wp,"scroll.link-edit",function(){i()&&s.popups.isVisible("forms.edit")&&a(i())}),o}());var o=l(r=t);s.popups.refresh("forms.edit"),s.popups.setContainer("forms.edit",s.$sc);var n=o.offset().left+o.outerWidth()/2,u=o.offset().top+o.outerHeight();s.popups.show("forms.edit",n,u,o.outerHeight())}function p(){var t=s.popups.get("forms.update"),e=i();if(e){var o=l(e);o.is("button")?t.find('input[type="text"][name="text"]').val(o.text()):t.find('input[type="text"][name="text"]').val(o.attr("placeholder"))}t.find('input[type="text"][name="text"]').trigger("change")}function f(){r=null}function d(t){if(t)return s.popups.onRefresh("forms.update",p),s.popups.onHide("forms.update",f),!0;var e="";1<=s.opts.formUpdateButtons.length&&(e='<div class="fr-buttons">'+s.button.buildList(s.opts.formUpdateButtons)+"</div>");var o="",n=0;o='<div class="fr-forms-text-layer fr-layer fr-active">',o+='<div class="fr-input-line"><input name="text" type="text" placeholder="Text" tabIndex="'+ ++n+'"></div>';var u={buttons:e,text_layer:o+='<div class="fr-action-buttons"><button class="fr-command fr-submit" data-cmd="updateInput" href="#" tabIndex="'+ ++n+'" type="button">'+s.language.translate("Update")+"</button></div></div>"};return s.popups.create("forms.update",u)}return{_init:function(){s.events.$on(s.$el,s._mousedown,"input, textarea, button",t),s.events.$on(s.$el,s._mouseup,"input, textarea, button",e),s.events.$on(s.$el,"touchmove","input, textarea, button",n),s.events.$on(s.$el,s._mouseup,o),s.events.$on(s.$win,s._mouseup,o),d(!0),s.events.$on(s.$el,"submit","form",function(t){return t.preventDefault(),!1})},updateInput:function(){var t=s.popups.get("forms.update"),e=i();if(e){var o=l(e),n=t.find('input[type="text"][name="text"]').val()||"";n.length&&(o.is("button")?o.text(n):o.attr("placeholder",n)),s.popups.hide("forms.update"),a(e)}},getInput:i,applyStyle:function(t,e,o){void 0===e&&(e=s.opts.formStyles),void 0===o&&(o=s.opts.formMultipleStyles);var n=i();if(!n)return!1;if(!o){var u=Object.keys(e);u.splice(u.indexOf(t),1),l(n).removeClass(u.join(" "))}l(n).toggleClass(t)},showUpdatePopup:function(){var t=i();if(t){var e=l(t),o=s.popups.get("forms.update");o||(o=d()),s.popups.isVisible("forms.update")||s.popups.refresh("forms.update"),s.popups.setContainer("forms.update",s.$sc);var n=e.offset().left+e.outerWidth()/2,u=e.offset().top+e.outerHeight();s.popups.show("forms.update",n,u,e.outerHeight())}},showEditPopup:a,back:function(){s.events.disableBlur(),s.selection.restore(),s.events.enableBlur();var t=i();t&&s.$wp&&("BUTTON"==t.tagName&&s.selection.restore(),a(t))}}},l.FE.RegisterCommand("updateInput",{undo:!1,focus:!1,title:"Update",callback:function(){this.forms.updateInput()}}),l.FE.DefineIcon("inputStyle",{NAME:"magic"}),l.FE.RegisterCommand("inputStyle",{title:"Style",type:"dropdown",html:function(){var t='<ul class="fr-dropdown-list">',e=this.opts.formStyles;for(var o in e)e.hasOwnProperty(o)&&(t+='<li><a class="fr-command" tabIndex="-1" data-cmd="inputStyle" data-param1="'+o+'">'+this.language.translate(e[o])+"</a></li>");return t+="</ul>"},callback:function(t,e){var o=this.forms.getInput();o&&(this.forms.applyStyle(e),this.forms.showEditPopup(o))},refreshOnShow:function(t,e){var o=this.forms.getInput();if(o){var n=l(o);e.find(".fr-command").each(function(){var t=l(this).data("param1");l(this).toggleClass("fr-active",n.hasClass(t))})}}}),l.FE.DefineIcon("inputEdit",{NAME:"edit"}),l.FE.RegisterCommand("inputEdit",{title:"Edit Button",undo:!1,refreshAfterCallback:!1,callback:function(){this.forms.showUpdatePopup()}}),l.FE.DefineIcon("inputBack",{NAME:"arrow-left"}),l.FE.RegisterCommand("inputBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.forms.back()}}),l.FE.RegisterCommand("updateInput",{undo:!1,focus:!1,title:"Update",callback:function(){this.forms.updateInput()}})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(o){"function"==typeof define&&define.amd?define(["jquery"],o):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),o(t)}:o(window.jQuery)}(function(c){c.FE.PLUGINS.fullscreen=function(o){var t,r,s,n;function i(){return o.$box.hasClass("fr-fullscreen")}function e(){if(o.helpers.isIOS()&&o.core.hasFocus())return o.$el.blur(),setTimeout(f,250),!1;t=o.helpers.scrollTop(),o.$box.toggleClass("fr-fullscreen"),c("body:first").toggleClass("fr-fullscreen"),o.helpers.isMobile()&&(o.$tb.data("parent",o.$tb.parent()),o.$tb.prependTo(o.$box),o.$tb.data("sticky-dummy")&&o.$tb.after(o.$tb.data("sticky-dummy"))),r=o.opts.height,s=o.opts.heightMax,n=o.opts.zIndex,o.position.refresh(),o.opts.height=o.o_win.innerHeight-(o.opts.toolbarInline?0:o.$tb.outerHeight()),o.opts.zIndex=2147483641,o.opts.heightMax=null,o.size.refresh(),o.opts.toolbarInline&&o.toolbar.showInline();for(var e=o.$box.parent();!e.is("body:first");)e.addClass("fr-fullscreen-wrapper"),e=e.parent();o.opts.toolbarContainer&&o.$box.prepend(o.$tb),o.events.trigger("charCounter.update"),o.events.trigger("codeView.update"),o.$win.trigger("scroll")}function l(){if(o.helpers.isIOS()&&o.core.hasFocus())return o.$el.blur(),setTimeout(f,250),!1;o.$box.toggleClass("fr-fullscreen"),c("body:first").toggleClass("fr-fullscreen"),o.$tb.prependTo(o.$tb.data("parent")),o.$tb.data("sticky-dummy")&&o.$tb.after(o.$tb.data("sticky-dummy")),o.opts.height=r,o.opts.heightMax=s,o.opts.zIndex=n,o.size.refresh(),c(o.o_win).scrollTop(t),o.opts.toolbarInline&&o.toolbar.showInline(),o.events.trigger("charCounter.update"),o.opts.toolbarSticky&&o.opts.toolbarStickyOffset&&(o.opts.toolbarBottom?o.$tb.css("bottom",o.opts.toolbarStickyOffset).data("bottom",o.opts.toolbarStickyOffset):o.$tb.css("top",o.opts.toolbarStickyOffset).data("top",o.opts.toolbarStickyOffset));for(var e=o.$box.parent();!e.is("body:first");)e.removeClass("fr-fullscreen-wrapper"),e=e.parent();o.opts.toolbarContainer&&c(o.opts.toolbarContainer).append(o.$tb),c(o.o_win).trigger("scroll"),o.events.trigger("codeView.update")}function f(){i()?l():e(),a(o.$tb.find('.fr-command[data-cmd="fullscreen"]'))}function a(e){var t=i();e.toggleClass("fr-active",t).attr("aria-pressed",t),e.find("> *:not(.fr-sr-only)").replaceWith(t?o.icon.create("fullscreenCompress"):o.icon.create("fullscreen"))}return{_init:function(){if(!o.$wp)return!1;o.events.$on(c(o.o_win),"resize",function(){i()&&(l(),e())}),o.events.on("toolbar.hide",function(){if(i()&&o.helpers.isMobile())return!1}),o.events.on("position.refresh",function(){if(o.helpers.isIOS())return!i()}),o.events.on("destroy",function(){i()&&l()},!0)},toggle:f,refresh:a,isActive:i}},c.FE.RegisterCommand("fullscreen",{title:"Fullscreen",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,toggle:!0,callback:function(){this.fullscreen.toggle()},refresh:function(e){this.fullscreen.refresh(e)},plugin:"fullscreen"}),c.FE.DefineIcon("fullscreen",{NAME:"expand"}),c.FE.DefineIcon("fullscreenCompress",{NAME:"compress"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(l){"function"==typeof define&&define.amd?define(["jquery"],l):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),l(t)}:l(window.jQuery)}(function(n){n.extend(n.FE.DEFAULTS,{helpSets:[{title:"Inline Editor",commands:[{val:"OSkeyE",desc:"Show the editor"}]},{title:"Common actions",commands:[{val:"OSkeyC",desc:"Copy"},{val:"OSkeyX",desc:"Cut"},{val:"OSkeyV",desc:"Paste"},{val:"OSkeyZ",desc:"Undo"},{val:"OSkeyShift+Z",desc:"Redo"},{val:"OSkeyK",desc:"Insert Link"},{val:"OSkeyP",desc:"Insert Image"}]},{title:"Basic Formatting",commands:[{val:"OSkeyA",desc:"Select All"},{val:"OSkeyB",desc:"Bold"},{val:"OSkeyI",desc:"Italic"},{val:"OSkeyU",desc:"Underline"},{val:"OSkeyS",desc:"Strikethrough"},{val:"OSkey]",desc:"Increase Indent"},{val:"OSkey[",desc:"Decrease Indent"}]},{title:"Quote",commands:[{val:"OSkey'",desc:"Increase quote level"},{val:"OSkeyShift+'",desc:"Decrease quote level"}]},{title:"Image / Video",commands:[{val:"OSkey+",desc:"Resize larger"},{val:"OSkey-",desc:"Resize smaller"}]},{title:"Table",commands:[{val:"Alt+Space",desc:"Select table cell"},{val:"Shift+Left/Right arrow",desc:"Extend selection one cell"},{val:"Shift+Up/Down arrow",desc:"Extend selection one row"}]},{title:"Navigation",commands:[{val:"OSkey/",desc:"Shortcuts"},{val:"Alt+F10",desc:"Focus popup / toolbar"},{val:"Esc",desc:"Return focus to previous position"}]}]}),n.FE.PLUGINS.help=function(s){var o,a="help";return{_init:function(){},show:function(){if(!o){var e="<h4>"+s.language.translate("Shortcuts")+"</h4>",t=function(){for(var e='<div class="fr-help-modal">',t=0;t<s.opts.helpSets.length;t++){var l=s.opts.helpSets[t],o="<table>";o+="<thead><tr><th>"+s.language.translate(l.title)+"</th></tr></thead>",o+="<tbody>";for(var a=0;a<l.commands.length;a++){var n=l.commands[a];o+="<tr>",o+="<td>"+s.language.translate(n.desc)+"</td>",o+="<td>"+n.val.replace("OSkey",s.helpers.isMac()?"⌘":"Ctrl+")+"</td>",o+="</tr>"}e+=o+="</tbody></table>"}return e+="</div>"}(),l=s.modals.create(a,e,t);o=l.$modal,l.$head,l.$body,s.events.$on(n(s.o_win),"resize",function(){s.modals.resize(a)})}s.modals.show(a),s.modals.resize(a)},hide:function(){s.modals.hide(a)}}},n.FroalaEditor.DefineIcon("help",{NAME:"question"}),n.FE.RegisterShortcut(n.FE.KEYCODE.SLASH,"help",null,"/"),n.FE.RegisterCommand("help",{title:"Help",icon:"help",undo:!1,focus:!1,modal:!0,callback:function(){this.help.show()},plugin:"help",showOnMobile:!1})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
7
|
-
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),a(t)}:a(window.jQuery)}(function(be){be.extend(be.FE.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),be.extend(be.FE.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","|","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:null,imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif","webp"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5,imageAddNewLine:!1}),be.FE.PLUGINS.image=function(g){var d,l,f,p,o,a,c="https://i.froala.com/upload",t=!1,i=1,u=2,m=3,h=4,v=5,b=6,r={};function y(){var e=g.popups.get("image.insert").find(".fr-image-by-url-layer input");e.val(""),d&&e.val(d.attr("src")),e.trigger("change")}function n(){var e=g.popups.get("image.edit");if(e||(e=U()),e){var t=he();ve()&&(t=t.find(".fr-img-wrap")),g.popups.setContainer("image.edit",g.$sc),g.popups.refresh("image.edit");var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();d.hasClass("fr-uploading")?$():g.popups.show("image.edit",a,i,t.outerHeight())}}function w(){I()}function e(){for(var e,t,a="IMG"==g.el.tagName?[g.el]:g.el.querySelectorAll("img"),i=0;i<a.length;i++){var r=be(a[i]);!g.opts.htmlUntouched&&g.opts.useClasses?((g.opts.imageDefaultAlign||g.opts.imageDefaultDisplay)&&(0<(t=r).parents(".fr-img-caption").length&&(t=t.parents(".fr-img-caption:first")),t.hasClass("fr-dii")||t.hasClass("fr-dib")||(t.addClass("fr-fi"+ge(t)[0]),t.addClass("fr-di"+de(t)[0]),t.css("margin",""),t.css("float",""),t.css("display",""),t.css("z-index",""),t.css("position",""),t.css("overflow",""),t.css("vertical-align",""))),g.opts.imageTextNear||(0<r.parents(".fr-img-caption").length?r.parents(".fr-img-caption:first").removeClass("fr-dii").addClass("fr-dib"):r.removeClass("fr-dii").addClass("fr-dib"))):g.opts.htmlUntouched||g.opts.useClasses||(g.opts.imageDefaultAlign||g.opts.imageDefaultDisplay)&&(0<(e=r).parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption:first")),pe(e,e.hasClass("fr-dib")?"block":e.hasClass("fr-dii")?"inline":null,e.hasClass("fr-fil")?"left":e.hasClass("fr-fir")?"right":ge(e)),e.removeClass("fr-dib fr-dii fr-fir fr-fil")),g.opts.iframe&&r.on("load",g.size.syncIframe)}}function E(e){void 0===e&&(e=!0);var t,a=Array.prototype.slice.call(g.el.querySelectorAll("img")),i=[];for(t=0;t<a.length;t++)if(i.push(a[t].getAttribute("src")),be(a[t]).toggleClass("fr-draggable",g.opts.imageMove),""===a[t].getAttribute("class")&&a[t].removeAttribute("class"),""===a[t].getAttribute("style")&&a[t].removeAttribute("style"),a[t].parentNode&&a[t].parentNode.parentNode&&g.node.hasClass(a[t].parentNode.parentNode,"fr-img-caption")){var r=a[t].parentNode.parentNode;g.browser.mozilla||r.setAttribute("contenteditable",!1),r.setAttribute("draggable",!1),r.classList.add("fr-draggable");var n=a[t].nextSibling;n&&!g.browser.mozilla&&n.setAttribute("contenteditable",!0)}if(o)for(t=0;t<o.length;t++)i.indexOf(o[t].getAttribute("src"))<0&&g.events.trigger("image.removed",[be(o[t])]);if(o&&e){var s=[];for(t=0;t<o.length;t++)s.push(o[t].getAttribute("src"));for(t=0;t<a.length;t++)s.indexOf(a[t].getAttribute("src"))<0&&g.events.trigger("image.loaded",[be(a[t])])}o=a}function C(){if(l||function(){var e;g.shared.$image_resizer?(l=g.shared.$image_resizer,p=g.shared.$img_overlay,g.events.on("destroy",function(){l.removeClass("fr-active").appendTo(be("body:first"))},!0)):(g.shared.$image_resizer=be('<div class="fr-image-resizer"></div>'),l=g.shared.$image_resizer,g.events.$on(l,"mousedown",function(e){e.stopPropagation()},!0),g.opts.imageResize&&(l.append(s("nw")+s("ne")+s("sw")+s("se")),g.shared.$img_overlay=be('<div class="fr-image-overlay"></div>'),p=g.shared.$img_overlay,e=l.get(0).ownerDocument,be(e).find("body:first").append(p)));g.events.on("shared.destroy",function(){l.html("").removeData().remove(),l=null,g.opts.imageResize&&(p.remove(),p=null)},!0),g.helpers.isMobile()||g.events.$on(be(g.o_win),"resize",function(){d&&!d.hasClass("fr-uploading")?se(!0):d&&(C(),ce(),$(!1))});if(g.opts.imageResize){e=l.get(0).ownerDocument,g.events.$on(l,g._mousedown,".fr-handler",R),g.events.$on(be(e),g._mousemove,S),g.events.$on(be(e.defaultView||e.parentWindow),g._mouseup,x),g.events.$on(p,"mouseleave",x);var i=1,r=null,n=0;g.events.on("keydown",function(e){if(d){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-n)&&(i=1),(a==be.FE.KEYCODE.EQUALS||g.browser.mozilla&&a==be.FE.KEYCODE.FF_EQUALS)&&t&&!e.altKey?i=q.call(this,e,1,1,i):(a==be.FE.KEYCODE.HYPHEN||g.browser.mozilla&&a==be.FE.KEYCODE.FF_HYPHEN)&&t&&!e.altKey?i=q.call(this,e,2,-1,i):g.keys.ctrlKey(e)||a!=be.FE.KEYCODE.ENTER||(d.before("<br>"),k(d)),r=a,n=e.timeStamp}},!0),g.events.on("keyup",function(){i=1})}}(),!d)return!1;var e=g.$wp||g.$sc;e.append(l),l.data("instance",g);var t=e.scrollTop()-("static"!=e.css("position")?e.offset().top:0),a=e.scrollLeft()-("static"!=e.css("position")?e.offset().left:0);a-=g.helpers.getPX(e.css("border-left-width")),t-=g.helpers.getPX(e.css("border-top-width")),g.$el.is("img")&&g.$sc.is("body")&&(a=t=0);var i=he();ve()&&(i=i.find(".fr-img-wrap")),l.css("top",(g.opts.iframe?i.offset().top:i.offset().top+t)-1).css("left",(g.opts.iframe?i.offset().left:i.offset().left+a)-1).css("width",i.get(0).getBoundingClientRect().width).css("height",i.get(0).getBoundingClientRect().height).addClass("fr-active")}function s(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function A(e){ve()?d.parents(".fr-img-caption").css("width",e):d.css("width",e)}function R(e){if(!g.core.sameInstance(l))return!0;if(e.preventDefault(),e.stopPropagation(),g.$el.find("img.fr-error").left)return!1;g.undo.canDo()||g.undo.saveStep();var t=e.pageX||e.originalEvent.touches[0].pageX;if("mousedown"==e.type){var a=g.$oel.get(0).ownerDocument,i=a.defaultView||a.parentWindow,r=!1;try{r=i.location!=i.parent.location&&!(i.$&&i.$.FE)}catch(o){}r&&i.frameElement&&(t+=g.helpers.getPX(be(i.frameElement).offset().left)+i.frameElement.clientLeft)}(f=be(this)).data("start-x",t),f.data("start-width",d.width()),f.data("start-height",d.height());var n=d.width();if(g.opts.imageResizeWithPercent){var s=d.parentsUntil(g.$el,g.html.blockTagsQuery()).get(0)||g.el;n=(n/be(s).outerWidth()*100).toFixed(2)+"%"}A(n),p.show(),g.popups.hideAll(),fe()}function S(e){if(!g.core.sameInstance(l))return!0;var t;if(f&&d){if(e.preventDefault(),g.$el.find("img.fr-error").left)return!1;var a=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null);if(!a)return!1;var i=a-f.data("start-x"),r=f.data("start-width");if((f.hasClass("fr-hnw")||f.hasClass("fr-hsw"))&&(i=0-i),g.opts.imageResizeWithPercent){var n=d.parentsUntil(g.$el,g.html.blockTagsQuery()).get(0)||g.el;r=((r+i)/be(n).outerWidth()*100).toFixed(2),g.opts.imageRoundPercent&&(r=Math.round(r)),A(r+"%"),(t=ve()?(g.helpers.getPX(d.parents(".fr-img-caption").css("width"))/be(n).outerWidth()*100).toFixed(2):(g.helpers.getPX(d.css("width"))/be(n).outerWidth()*100).toFixed(2))===r||g.opts.imageRoundPercent||A(t+"%"),d.css("height","").removeAttr("height")}else r+i>=g.opts.imageMinWidth&&(A(r+i),t=ve()?g.helpers.getPX(d.parents(".fr-img-caption").css("width")):g.helpers.getPX(d.css("width"))),t!==r+i&&A(t),((d.attr("style")||"").match(/(^height:)|(; *height:)/)||d.attr("height"))&&(d.css("height",f.data("start-height")*d.width()/f.data("start-width")),d.removeAttr("height"));C(),g.events.trigger("image.resize",[me()])}}function x(e){if(!g.core.sameInstance(l))return!0;if(f&&d){if(e&&e.stopPropagation(),g.$el.find("img.fr-error").left)return!1;f=null,p.hide(),C(),n(),g.undo.saveStep(),g.events.trigger("image.resizeEnd",[me()])}}function D(e,t,a){g.edit.on(),d&&d.addClass("fr-error"),function(e){$();var t=g.popups.get("image.insert").find(".fr-image-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),g.events.disableBlur(),a.focus()}(g.language.translate("Something went wrong. Please try again.")),!d&&a&&Q(a),g.events.trigger("image.error",[{code:e,message:r[e]},t,a])}function U(e){if(e)return g.$wp&&g.events.$on(g.$wp,"scroll.image-edit",function(){d&&g.popups.isVisible("image.edit")&&(g.events.disableBlur(),n())}),!0;var t="";if(0<g.opts.imageEditButtons.length){t+='<div class="fr-buttons">',t+=g.button.buildList(g.opts.imageEditButtons);var a={buttons:t+="</div>"};return g.popups.create("image.edit",a)}return!1}function $(e){var t=g.popups.get("image.insert");if(t||(t=K()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),d){var a=he();g.popups.setContainer("image.insert",g.$sc);var i=a.offset().left+a.width()/2,r=a.offset().top+a.height();g.popups.show("image.insert",i,r,a.outerHeight())}void 0===e&&F(g.language.translate("Uploading"),0)}function I(e){var t=g.popups.get("image.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||g.$el.find("img.fr-error").length)){if(g.events.focus(),g.$el.find("img.fr-error").length&&(g.$el.find("img.fr-error").remove(),g.undo.saveStep(),g.undo.run(),g.undo.dropRedo()),!g.$wp&&d){var a=d;se(!0),g.selection.setAfter(a.get(0)),g.selection.restore()}g.popups.hide("image.insert")}}function F(e,t){var a=g.popups.get("image.insert");if(a){var i=a.find(".fr-image-progress-bar-layer");i.find("h3").text(e+(t?" "+t+"%":"")),i.removeClass("fr-error"),t?(i.find("div").removeClass("fr-indeterminate"),i.find("div > span").css("width",t+"%")):i.find("div").addClass("fr-indeterminate")}}function k(e){ne.call(e.get(0))}function B(){var e=be(this);g.popups.hide("image.insert"),e.removeClass("fr-uploading"),e.next().is("br")&&e.next().remove(),k(e),g.events.trigger("image.loaded",[e])}function N(s,e,o,l,f){g.edit.off(),F(g.language.translate("Loading image")),e&&(s=g.helpers.sanitizeURL(s));var t=new Image;t.onload=function(){var e,t;if(l){g.undo.canDo()||l.hasClass("fr-uploading")||g.undo.saveStep();var a=l.data("fr-old-src");l.data("fr-image-pasted")&&(a=null),g.$wp?((e=l.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted")).off("load"),a&&l.attr("src",a),l.replaceWith(e)):e=l;for(var i=e.get(0).attributes,r=0;r<i.length;r++){var n=i[r];0===n.nodeName.indexOf("data-")&&e.removeAttr(n.nodeName)}if(void 0!==o)for(t in o)o.hasOwnProperty(t)&&"link"!=t&&e.attr("data-"+t,o[t]);e.on("load",B),e.attr("src",s),g.edit.on(),E(!1),g.undo.saveStep(),g.events.disableBlur(),g.$el.blur(),g.events.trigger(a?"image.replaced":"image.inserted",[e,f])}else e=L(s,o,B),E(!1),g.undo.saveStep(),g.events.disableBlur(),g.$el.blur(),g.events.trigger("image.inserted",[e,f])},t.onerror=function(){D(i)},$(g.language.translate("Loading image")),t.src=s}function O(e){F(g.language.translate("Loading image"));var t=this.status,a=this.response,i=this.responseXML,r=this.responseText;try{if(g.opts.imageUploadToS3)if(201==t){var n=function(e){try{var t=be(e).find("Location").text(),a=be(e).find("Key").text();return!1===g.events.trigger("image.uploadedToS3",[t,a,e],!0)?(g.edit.on(),!1):t}catch(i){return D(h,e),!1}}(i);n&&N(n,!1,[],e,a||i)}else D(h,a||i,e);else if(200<=t&&t<300){var s=function(e){try{if(!1===g.events.trigger("image.uploaded",[e],!0))return g.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(D(u,e),!1)}catch(a){return D(h,e),!1}}(r);s&&N(s.link,!1,s,e,a||r)}else D(m,a||r,e)}catch(o){D(h,a||r,e)}}function P(){D(h,this.response||this.responseText||this.responseXML)}function T(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;F(g.language.translate("Uploading"),t)}}function L(e,t,a){var i,r="";if(t&&void 0!==t)for(i in t)t.hasOwnProperty(i)&&"link"!=i&&(r+=" data-"+i+'="'+t[i]+'"');var n=g.opts.imageDefaultWidth;n&&"auto"!=n&&(n=g.opts.imageResizeWithPercent?"100%":n+"px");var s=be('<img src="'+e+'"'+r+(n?' style="width: '+n+';"':"")+">");pe(s,g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign),s.on("load",a),s.on("error",a),g.edit.on(),g.events.focus(!0),g.selection.restore(),g.undo.saveStep(),g.opts.imageSplitHTML?g.markers.split():g.markers.insert(),g.html.wrap();var o=g.$el.find(".fr-marker");return o.length?(o.parent().is("hr")&&o.parent().after(o),g.node.isLastSibling(o)&&o.parent().hasClass("fr-deletable")&&o.insertAfter(o.parent()),o.replaceWith(s)):g.$el.append(s),g.selection.clear(),s}function M(){g.edit.on(),I(!0)}function z(e,t){if(void 0!==e&&0<e.length){if(!1===g.events.trigger("image.beforeUpload",[e,t]))return!1;var a,i=e[0];if((null===g.opts.imageUploadURL||g.opts.imageUploadURL==c)&&!g.opts.imageUploadToS3)return s=i,o=t||d,(l=new FileReader).onload=function(){var e=l.result;if(l.result.indexOf("svg+xml")<0){for(var t=atob(l.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:s.type})),g.image.insert(e,!1,null,o)}},$(),l.readAsDataURL(s),!1;if(i.name||(i.name=(new Date).getTime()+"."+(i.type||"image/jpeg").replace(/image\//g,"")),i.size>g.opts.imageMaxSize)return D(v),!1;if(g.opts.imageAllowedTypes.indexOf(i.type.replace(/image\//g,""))<0)return D(b),!1;if(g.drag_support.formdata&&(a=g.drag_support.formdata?new FormData:null),a){var r;if(!1!==g.opts.imageUploadToS3)for(r in a.append("key",g.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),a.append("success_action_status","201"),a.append("X-Requested-With","xhr"),a.append("Content-Type",i.type),g.opts.imageUploadToS3.params)g.opts.imageUploadToS3.params.hasOwnProperty(r)&&a.append(r,g.opts.imageUploadToS3.params[r]);for(r in g.opts.imageUploadParams)g.opts.imageUploadParams.hasOwnProperty(r)&&a.append(r,g.opts.imageUploadParams[r]);a.append(g.opts.imageUploadParam,i,i.name);var n=g.opts.imageUploadURL;g.opts.imageUploadToS3&&(n=g.opts.imageUploadToS3.uploadURL?g.opts.imageUploadToS3.uploadURL:"https://"+g.opts.imageUploadToS3.region+".amazonaws.com/"+g.opts.imageUploadToS3.bucket),function(t,a,e,r){function n(){var e=be(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),g.placeholder.refresh(),k(e),C(),$(),g.edit.off(),t.onload=function(){O.call(t,e)},t.onerror=P,t.upload.onprogress=T,t.onabort=M,e.off("abortUpload").on("abortUpload",function(){4!=t.readyState&&(t.abort(),r?(r.attr("src",r.data("fr-old-src")),r.removeClass("fr-uploading")):e.remove(),se(!0))}),t.send(a)}var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:"image/jpeg"}))}r?(r.on("load",n),r.one("error",n),g.edit.on(),g.undo.saveStep(),r.data("fr-old-src",r.attr("src")),r.attr("src",e)):L(e,null,n)},s.readAsDataURL(e)}(g.core.getXHR(n,g.opts.imageUploadMethod),a,i,t||d)}}var s,o,l}function _(e){if(e.is("img")&&0<e.parents(".fr-img-caption").length)return e.parents(".fr-img-caption")}function W(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("image")&&0<=g.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))){if(!g.opts.imageUpload)return e.preventDefault(),e.stopPropagation(),!1;g.markers.remove(),g.markers.insertAtPoint(e.originalEvent),g.$el.find(".fr-marker").replaceWith(be.FE.MARKERS),0===g.$el.find(".fr-marker").length&&g.selection.setAtEnd(g.el),g.popups.hideAll();var i=g.popups.get("image.insert");i||(i=K()),g.popups.setContainer("image.insert",g.$sc);var r=e.originalEvent.pageX,n=e.originalEvent.pageY;return g.opts.iframe&&(n+=g.$iframe.offset().top,r+=g.$iframe.offset().left),g.popups.show("image.insert",r,n),$(),0<=g.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))?(se(!0),z(t.files)):D(b),e.preventDefault(),e.stopPropagation(),!1}}}function K(e){if(e)return g.popups.onRefresh("image.insert",y),g.popups.onHide("image.insert",w),!0;var t,a,i="";g.opts.imageUpload||-1===g.opts.imageInsertButtons.indexOf("imageUpload")||g.opts.imageInsertButtons.splice(g.opts.imageInsertButtons.indexOf("imageUpload"),1);var r=g.button.buildList(g.opts.imageInsertButtons);""!==r&&(i='<div class="fr-buttons">'+r+"</div>");var n=g.opts.imageInsertButtons.indexOf("imageUpload"),s=g.opts.imageInsertButtons.indexOf("imageByURL"),o="";0<=n&&(t=" fr-active",0<=s&&s<n&&(t=""),o='<div class="fr-image-upload-layer'+t+' fr-layer" id="fr-image-upload-layer-'+g.id+'"><strong>'+g.language.translate("Drop image")+"</strong><br>("+g.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+g.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+g.id+'" role="button"></div></div>');var l="";0<=s&&(t=" fr-active",0<=n&&n<s&&(t=""),l='<div class="fr-image-by-url-layer'+t+' fr-layer" id="fr-image-by-url-layer-'+g.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+g.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+g.language.translate("Insert")+"</button></div></div>");var f,p={buttons:i,upload_layer:o,by_url_layer:l,progress_bar:'<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>'};return 1<=g.opts.imageInsertButtons.length&&(a=g.popups.create("image.insert",p)),g.$wp&&g.events.$on(g.$wp,"scroll",function(){d&&g.popups.isVisible("image.insert")&&ce()}),f=a,g.events.$on(f,"dragover dragenter",".fr-image-upload-layer",function(){return be(this).addClass("fr-drop"),!1},!0),g.events.$on(f,"dragleave dragend",".fr-image-upload-layer",function(){return be(this).removeClass("fr-drop"),!1},!0),g.events.$on(f,"drop",".fr-image-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),be(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=f.data("instance")||g;a.events.disableBlur(),a.image.upload(t.files),a.events.enableBlur()}},!0),g.helpers.isIOS()&&g.events.$on(f,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){be(this).trigger("click")},!0),g.events.$on(f,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var e=f.data("instance")||g;e.events.disableBlur(),f.find("input:focus").blur(),e.events.enableBlur(),e.image.upload(this.files,d)}be(this).val("")},!0),a}function H(){d&&g.popups.get("image.alt").find("input").val(d.attr("alt")||"").trigger("change")}function Y(){var e=g.popups.get("image.alt");e||(e=X()),I(),g.popups.refresh("image.alt"),g.popups.setContainer("image.alt",g.$sc);var t=he();ve()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.alt",a,i,t.outerHeight())}function X(e){if(e)return g.popups.onRefresh("image.alt",H),!0;var t={buttons:'<div class="fr-buttons">'+g.button.buildList(g.opts.imageAltButtons)+"</div>",alt_layer:'<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+g.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+g.id+'" type="text" placeholder="'+g.language.translate("Alternative Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+g.language.translate("Update")+"</button></div></div>"},a=g.popups.create("image.alt",t);return g.$wp&&g.events.$on(g.$wp,"scroll.image-alt",function(){d&&g.popups.isVisible("image.alt")&&Y()}),a}function j(){var e=g.popups.get("image.size");if(d)if(ve()){var t=d.parent();t.get(0).style.width||(t=d.parent().parent()),e.find('input[name="width"]').val(t.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height).trigger("change")}else e.find('input[name="width"]').val(d.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(d.get(0).style.height).trigger("change")}function G(){var e=g.popups.get("image.size");e||(e=V()),I(),g.popups.refresh("image.size"),g.popups.setContainer("image.size",g.$sc);var t=he();ve()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.size",a,i,t.outerHeight())}function V(e){if(e)return g.popups.onRefresh("image.size",j),!0;var t={buttons:'<div class="fr-buttons">'+g.button.buildList(g.opts.imageSizeButtons)+"</div>",size_layer:'<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+g.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+g.id+'" type="text" name="width" placeholder="'+g.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+g.id+'" type="text" name="height" placeholder="'+g.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+g.language.translate("Update")+"</button></div></div>"},a=g.popups.create("image.size",t);return g.$wp&&g.events.$on(g.$wp,"scroll.image-size",function(){d&&g.popups.isVisible("image.size")&&G()}),a}function q(e,t,a,i){return e.pageX=t,R.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,i)),S.call(this,e),x.call(this,e),++i}function Q(e){(e=e||he())&&!1!==g.events.trigger("image.beforeRemove",[e])&&(g.popups.hideAll(),ue(),se(!0),g.undo.canDo()||g.undo.saveStep(),e.get(0)==g.el?e.removeAttr("src"):(e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?(g.selection.setBefore(e.get(0).parentNode)||g.selection.setAfter(e.get(0).parentNode)||e.parent().after(be.FE.MARKERS),be(e.get(0).parentNode).remove()):(g.selection.setBefore(e.get(0))||g.selection.setAfter(e.get(0))||e.after(be.FE.MARKERS),e.remove()),g.html.fillEmptyBlocks(),g.selection.restore()),g.undo.saveStep())}function J(e){var t=e.which;if(d&&(t==be.FE.KEYCODE.BACKSPACE||t==be.FE.KEYCODE.DELETE))return e.preventDefault(),e.stopPropagation(),Q(),!1;if(d&&t==be.FE.KEYCODE.ESC){var a=d;return se(!0),g.selection.setAfter(a.get(0)),g.selection.restore(),e.preventDefault(),!1}if(d&&(t==be.FE.KEYCODE.ARROW_LEFT||t==be.FE.KEYCODE.ARROW_RIGHT)){var i=d.get(0);return se(!0),t==be.FE.KEYCODE.ARROW_LEFT?g.selection.setBefore(i):g.selection.setAfter(i),g.selection.restore(),e.preventDefault(),!1}return d&&t===be.FE.KEYCODE.TAB?(e.preventDefault(),e.stopPropagation(),se(!0),!1):d&&t!=be.FE.KEYCODE.F10&&!g.keys.isBrowserAction(e)?(e.preventDefault(),e.stopPropagation(),!1):void 0}function Z(e){if(e&&"IMG"==e.tagName){if(g.node.hasClass(e,"fr-uploading")||g.node.hasClass(e,"fr-error")?e.parentNode.removeChild(e):g.node.hasClass(e,"fr-draggable")&&e.classList.remove("fr-draggable"),e.parentNode&&e.parentNode.parentNode&&g.node.hasClass(e.parentNode.parentNode,"fr-img-caption")){var t=e.parentNode.parentNode;t.removeAttribute("contenteditable"),t.removeAttribute("draggable"),t.classList.remove("fr-draggable");var a=e.nextSibling;a&&a.removeAttribute("contenteditable")}}else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var i=e.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),r=0;r<i.length;r++)Z(i[r])}function ee(e){if(!1===g.events.trigger("image.beforePasteUpload",[e]))return!1;d=be(e),C(),n(),ce(),$(),d.one("load",function(){C(),$()});for(var t=be(e).attr("src").split(","),a=atob(t[1]),i=[],r=0;r<a.length;r++)i.push(a.charCodeAt(r));z([new Blob([new Uint8Array(i)],{type:t[0].replace(/data\:/g,"").replace(/;base64/g,"")})],d)}function te(){g.opts.imagePaste?g.$el.find("img[data-fr-image-pasted]").each(function(e,i){if(g.opts.imagePasteProcess){var t=g.opts.imageDefaultWidth;t&&"auto"!=t&&(t+=g.opts.imageResizeWithPercent?"%":"px"),be(i).css("width",t).removeClass("fr-dii fr-dib fr-fir fr-fil"),pe(be(i),g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign)}if(0===i.src.indexOf("data:"))ee(i);else if(0===i.src.indexOf("blob:")||0===i.src.indexOf("http")&&g.opts.imageUploadRemoteUrls&&g.opts.imageCORSProxy){var a=new Image;a.crossOrigin="Anonymous",a.onload=function(){var e,t=g.o_doc.createElement("CANVAS"),a=t.getContext("2d");t.height=this.naturalHeight,t.width=this.naturalWidth,a.drawImage(this,0,0),setTimeout(function(){ee(i)},0),e=2e3<this.naturalWidth||1500<this.naturalHeight?"jpeg":"png",i.src=t.toDataURL("image/"+e)},a.src=(0===i.src.indexOf("blob:")?"":g.opts.imageCORSProxy+"/")+i.src}else 0!==i.src.indexOf("http")||0===i.src.indexOf("https://mail.google.com/mail")?(g.selection.save(),be(i).remove(),g.selection.restore()):be(i).removeAttr("data-fr-image-pasted")}):g.$el.find("img[data-fr-image-pasted]").remove()}function ae(e){var t=e.target.result,a=g.opts.imageDefaultWidth;a&&"auto"!=a&&(a+=g.opts.imageResizeWithPercent?"%":"px"),g.undo.saveStep(),g.html.insert('<img data-fr-image-pasted="true" src="'+t+'"'+(a?' style="width: '+a+';"':"")+">");var i=g.$el.find('img[data-fr-image-pasted="true"]');i&&pe(i,g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign),g.events.trigger("paste.after")}function ie(e){if(e&&e.clipboardData&&e.clipboardData.items){var t=null;if(e.clipboardData.types&&-1!=e.clipboardData.types.indexOf("text/rtf")||e.clipboardData.getData("text/rtf"))t=e.clipboardData.items[0].getAsFile();else for(var a=0;a<e.clipboardData.items.length&&!(t=e.clipboardData.items[a].getAsFile());a++);if(t)return i=t,(r=new FileReader).onload=ae,r.readAsDataURL(i),!1}var i,r}function re(e){return e=e.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function ne(e){if("false"==be(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;if(e&&"touchend"==e.type&&a)return!0;if(e&&g.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;for(var t=0;t<be.FE.INSTANCES.length;t++)be.FE.INSTANCES[t]!=g&&be.FE.INSTANCES[t].events.trigger("image.hideResizer");g.toolbar.disable(),e&&(e.stopPropagation(),e.preventDefault()),g.helpers.isMobile()&&(g.events.disableBlur(),g.$el.blur(),g.events.enableBlur()),g.opts.iframe&&g.size.syncIframe(),d=be(this),ue(),C(),n(),g.browser.msie?(g.popups.areVisible()&&g.events.disableBlur(),g.win.getSelection&&(g.win.getSelection().removeAllRanges(),g.win.getSelection().addRange(g.doc.createRange()))):g.selection.clear(),g.helpers.isIOS()&&(g.events.disableBlur(),g.$el.blur()),g.button.bulkRefresh(),g.events.trigger("video.hideResizer")}function se(e){d&&(oe||!0===e)&&(g.toolbar.enable(),l.removeClass("fr-active"),g.popups.hide("image.edit"),d=null,fe(),f=null,p&&p.hide())}r[i]="Image cannot be loaded from the passed link.",r[u]="No link in upload response.",r[m]="Error during file upload.",r[h]="Parsing response failed.",r[v]="File is too large.",r[b]="Image file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.";var oe=!(r[8]="Image file is corrupted.");function le(){oe=!0}function fe(){oe=!1}function pe(e,t,a){!g.opts.htmlUntouched&&g.opts.useClasses?(e.removeClass("fr-fil fr-fir fr-dib fr-dii"),a&&e.addClass("fr-fi"+a[0]),t&&e.addClass("fr-di"+t[0])):"inline"==t?(e.css({display:"inline-block",verticalAlign:"bottom",margin:g.opts.imageDefaultMargin}),"center"==a?e.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*g.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==a?e.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+g.opts.imageDefaultMargin+"px)",textAlign:"left"}):e.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+g.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==t&&(e.css({display:"block","float":"none",verticalAlign:"top",margin:g.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==a?e.css({marginLeft:0,textAlign:"left"}):"right"==a&&e.css({marginRight:0,textAlign:"right"}))}function ge(e){if(void 0===e&&(e=he()),e){if(e.hasClass("fr-fil"))return"left";if(e.hasClass("fr-fir"))return"right";if(e.hasClass("fr-dib")||e.hasClass("fr-dii"))return"center";var t=e.css("float");if(e.css("float","none"),"block"==e.css("display")){if(e.css("float",""),e.css("float")!=t&&e.css("float",t),0===parseInt(e.css("margin-left"),10))return"left";if(0===parseInt(e.css("margin-right"),10))return"right"}else{if(e.css("float",""),e.css("float")!=t&&e.css("float",t),"left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function de(e){void 0===e&&(e=he());var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function ce(){var e=g.popups.get("image.insert");e||(e=K()),g.popups.isVisible("image.insert")||(I(),g.popups.refresh("image.insert"),g.popups.setContainer("image.insert",g.$sc));var t=he();ve()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.insert",a,i,t.outerHeight(!0))}function ue(){if(d){g.events.disableBlur(),g.selection.clear();var e=g.doc.createRange();e.selectNode(d.get(0)),g.browser.msie&&e.collapse(!0),g.selection.get().addRange(e),g.events.enableBlur()}}function me(){return d}function he(){return ve()?d.parents(".fr-img-caption:first"):d}function ve(){return!!d&&0<d.parents(".fr-img-caption").length}return{_init:function(){var i;g.events.$on(g.$el,g._mousedown,"IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==be(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;g.helpers.isMobile()||g.selection.clear(),t=!0,g.popups.areVisible()&&g.events.disableBlur(),g.browser.msie&&(g.events.disableBlur(),g.$el.attr("contenteditable",!1)),g.draggable||"touchstart"==e.type||e.preventDefault(),e.stopPropagation()}),g.events.$on(g.$el,g._mousedown,".fr-img-caption .fr-inner",function(e){g.core.hasFocus()||g.events.focus(),e.stopPropagation()}),g.events.$on(g.$el,"paste",".fr-img-caption .fr-inner",function(e){g.toolbar.hide(),e.stopPropagation()}),g.events.$on(g.$el,g._mouseup,"IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==be(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;t&&(t=!1,e.stopPropagation(),g.browser.msie&&(g.$el.attr("contenteditable",!0),g.events.enableBlur()))}),g.events.on("keyup",function(e){if(e.shiftKey&&""===g.selection.text().replace(/\n/g,"")&&g.keys.isArrow(e.which)){var t=g.selection.element(),a=g.selection.endElement();t&&"IMG"==t.tagName?k(be(t)):a&&"IMG"==a.tagName&&k(be(a))}},!0),g.events.on("drop",W),g.events.on("element.beforeDrop",_),g.events.on("mousedown window.mousedown",le),g.events.on("window.touchmove",fe),g.events.on("mouseup window.mouseup",function(){if(d)return se(),!1;fe()}),g.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&se()}),g.events.on("image.resizeEnd",function(){g.opts.iframe&&g.size.syncIframe()}),g.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){se(!(t=!1))}),g.events.on("modals.hide",function(){d&&(ue(),g.selection.clear())}),g.events.on("image.resizeEnd",function(){g.win.getSelection&&k(d)}),g.opts.imageAddNewLine&&g.events.on("image.inserted",function(e){var t=e.get(0);for(t.nextSibling&&"BR"===t.nextSibling.tagName&&(t=t.nextSibling);t&&!g.node.isElement(t);)t=g.node.isLastSibling(t)?t.parentNode:null;g.node.isElement(t)&&(g.opts.enter===be.FE.ENTER_BR?e.after("<br>"):be(g.node.blockParent(e.get(0))).after("<"+g.html.defaultTag()+"><br></"+g.html.defaultTag()+">"))}),"IMG"==g.el.tagName&&g.$el.addClass("fr-view"),g.events.$on(g.$el,g.helpers.isMobile()&&!g.helpers.isWindowsPhone()?"touchend":"click","IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',ne),g.helpers.isMobile()&&(g.events.$on(g.$el,"touchstart","IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(){a=!1}),g.events.$on(g.$el,"touchmove",function(){a=!0})),g.$wp?(g.events.on("window.keydown keydown",J,!0),g.events.on("keyup",function(e){if(d&&e.which==be.FE.KEYCODE.ENTER)return!1},!0),g.events.$on(g.$el,"keydown",function(){var e=g.selection.element();e.nodeType===Node.TEXT_NODE&&(e=e.parentNode),g.node.hasClass(e,"fr-inner")||(g.node.hasClass(e,"fr-img-caption")||(e=be(e).parents(".fr-img-caption").get(0)),g.node.hasClass(e,"fr-img-caption")&&(be(e).after(be.FE.INVISIBLE_SPACE+be.FE.MARKERS),g.selection.restore()))})):g.events.$on(g.$win,"keydown",J),g.events.on("toolbar.esc",function(){if(d){if(g.$wp)g.events.disableBlur(),g.events.focus();else{var e=d;se(!0),g.selection.setAfter(e.get(0)),g.selection.restore()}return!1}},!0),g.events.on("toolbar.focusEditor",function(){if(d)return!1},!0),g.events.on("window.cut window.copy",function(e){if(d&&g.popups.isVisible("image.edit")&&!g.popups.get("image.edit").find(":focus").length){var t=he();ve()?(t.before(be.FE.START_MARKER),t.after(be.FE.END_MARKER),g.selection.restore(),g.paste.saveCopiedText(t.get(0).outerHTML,t.text())):(ue(),g.paste.saveCopiedText(d.get(0).outerHTML,d.attr("alt"))),"copy"==e.type?setTimeout(function(){k(d)}):(se(!0),g.undo.saveStep(),setTimeout(function(){g.undo.saveStep()},0))}},!0),g.browser.msie&&g.events.on("keydown",function(e){if(!g.selection.isCollapsed()||!d)return!0;var t=e.which;t==be.FE.KEYCODE.C&&g.keys.ctrlKey(e)?g.events.trigger("window.copy"):t==be.FE.KEYCODE.X&&g.keys.ctrlKey(e)&&g.events.trigger("window.cut")}),g.events.$on(be(g.o_win),"keydown",function(e){var t=e.which;if(d&&t==be.FE.KEYCODE.BACKSPACE)return e.preventDefault(),!1}),g.events.$on(g.$win,"keydown",function(e){var t=e.which;d&&d.hasClass("fr-uploading")&&t==be.FE.KEYCODE.ESC&&d.trigger("abortUpload")}),g.events.on("destroy",function(){d&&d.hasClass("fr-uploading")&&d.trigger("abortUpload")}),g.events.on("paste.before",ie),g.events.on("paste.beforeCleanup",re),g.events.on("paste.after",te),g.events.on("html.set",e),g.events.on("html.inserted",e),e(),g.events.on("destroy",function(){o=[]}),g.events.on("html.processGet",Z),g.opts.imageOutputSize&&g.events.on("html.beforeGet",function(){i=g.el.querySelectorAll("img");for(var e=0;e<i.length;e++){var t=i[e].style.width||be(i[e]).width(),a=i[e].style.height||be(i[e]).height();t&&i[e].setAttribute("width",(""+t).replace(/px/,"")),a&&i[e].setAttribute("height",(""+a).replace(/px/,""))}}),g.opts.iframe&&g.events.on("image.loaded",g.size.syncIframe),g.$wp&&(E(),g.events.on("contentChanged",E)),g.events.$on(be(g.o_win),"orientationchange.image",function(){setTimeout(function(){d&&k(d)},100)}),U(!0),K(!0),V(!0),X(!0),g.events.on("node.remove",function(e){if("IMG"==e.get(0).tagName)return Q(e),!1})},showInsertPopup:function(){var e=g.$tb.find('.fr-command[data-cmd="insertImage"]'),t=g.popups.get("image.insert");if(t||(t=K()),I(),!t.hasClass("fr-active"))if(g.popups.refresh("image.insert"),g.popups.setContainer("image.insert",g.$tb),e.is(":visible")){var a=e.offset().left+e.outerWidth()/2,i=e.offset().top+(g.opts.toolbarBottom?10:e.outerHeight()-10);g.popups.show("image.insert",a,i,e.outerHeight())}else g.position.forSelection(t),g.popups.show("image.insert")},showLayer:function(e){var t,a,i=g.popups.get("image.insert");if(d||g.opts.toolbarInline){if(d){var r=he();ve()&&(r=r.find(".fr-img-wrap")),a=r.offset().top+r.outerHeight(),t=r.offset().left+r.outerWidth()/2}}else{var n=g.$tb.find('.fr-command[data-cmd="insertImage"]');t=n.offset().left+n.outerWidth()/2,a=n.offset().top+(g.opts.toolbarBottom?10:n.outerHeight()-10)}!d&&g.opts.toolbarInline&&(a=i.offset().top-g.helpers.getPX(i.css("margin-top")),i.hasClass("fr-above")&&(a+=i.outerHeight())),i.find(".fr-layer").removeClass("fr-active"),i.find(".fr-"+e+"-layer").addClass("fr-active"),g.popups.show("image.insert",t,a,d?d.outerHeight():0),g.accessibility.focusPopup(i)},refreshUploadButton:function(e){g.popups.get("image.insert").find(".fr-image-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshByURLButton:function(e){g.popups.get("image.insert").find(".fr-image-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:z,insertByURL:function(){var e=g.popups.get("image.insert").find(".fr-image-by-url-layer input");if(0<e.val().length){$(),F(g.language.translate("Loading image"));var t=e.val().trim();if(g.opts.imageUploadRemoteUrls&&g.opts.imageCORSProxy&&g.opts.imageUpload){var a=new XMLHttpRequest;a.onload=function(){200==this.status?z([new Blob([this.response],{type:this.response.type||"image/png"})],d):D(i)},a.onerror=function(){N(t,!0,[],d)},a.open("GET",g.opts.imageCORSProxy+"/"+t,!0),a.responseType="blob",a.send()}else N(t,!0,[],d);e.val(""),e.blur()}},align:function(e){var t=he();t.removeClass("fr-fir fr-fil"),!g.opts.htmlUntouched&&g.opts.useClasses?"left"==e?t.addClass("fr-fil"):"right"==e&&t.addClass("fr-fir"):pe(t,de(),e),ue(),C(),n(),g.selection.clear()},refreshAlign:function(e){d&&e.find("> *:first").replaceWith(g.icon.create("image-align-"+ge()))},refreshAlignOnShow:function(e,t){d&&t.find('.fr-command[data-param1="'+ge()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function(e){var t=he();t.removeClass("fr-dii fr-dib"),!g.opts.htmlUntouched&&g.opts.useClasses?"inline"==e?t.addClass("fr-dii"):"block"==e&&t.addClass("fr-dib"):pe(t,e,ge()),ue(),C(),n(),g.selection.clear()},refreshDisplayOnShow:function(e,t){d&&t.find('.fr-command[data-param1="'+de()+'"]').addClass("fr-active").attr("aria-selected",!0)},replace:ce,back:function(){d?(g.events.disableBlur(),be(".fr-popup input:focus").blur(),k(d)):(g.events.disableBlur(),g.selection.restore(),g.events.enableBlur(),g.popups.hide("image.insert"),g.toolbar.showInline())},get:me,getEl:he,insert:N,showProgressBar:$,remove:Q,hideProgressBar:I,applyStyle:function(e,t,a){if(void 0===t&&(t=g.opts.imageStyles),void 0===a&&(a=g.opts.imageMultipleStyles),!d)return!1;var i=he();if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),i.removeClass(r.join(" "))}"object"==typeof t[e]?(i.removeAttr("style"),i.css(t[e].style)):i.toggleClass(e),k(d)},showAltPopup:Y,showSizePopup:G,setAlt:function(e){if(d){var t=g.popups.get("image.alt");d.attr("alt",e||t.find("input").val()||""),t.find("input:focus").blur(),k(d)}},setSize:function(e,t){if(d){var a=g.popups.get("image.size");e=e||a.find('input[name="width"]').val()||"",t=t||a.find('input[name="height"]').val()||"";var i=/^[\d]+((px)|%)*$/g;d.removeAttr("width").removeAttr("height"),e.match(i)?d.css("width",e):d.css("width",""),t.match(i)?d.css("height",t):d.css("height",""),ve()&&(d.parents(".fr-img-caption").removeAttr("width").removeAttr("height"),e.match(i)?d.parents(".fr-img-caption").css("width",e):d.parents(".fr-img-caption").css("width",""),t.match(i)?d.parents(".fr-img-caption").css("height",t):d.parents(".fr-img-caption").css("height","")),a&&a.find("input:focus").blur(),k(d)}},toggleCaption:function(){var e;if(d&&!ve()){var t,a;(e=d).parent().is("a")&&(e=d.parent()),e.attr("style")&&(a=-1<(t=e.attr("style").split(":")).indexOf("width")?t[t.indexOf("width")+1].replace(";",""):"");var i=g.opts.imageResizeWithPercent?(-1<a.indexOf("px")?null:a)||"100%":d.width()+"px";e.wrap("<span "+(g.browser.mozilla?"":'contenteditable="false"')+'class="fr-img-caption '+d.attr("class")+'" style="'+(g.opts.useClasses?"":e.attr("style"))+'" draggable="false"></span>'),e.wrap('<span class="fr-img-wrap"></span>'),d.after('<span class="fr-inner"'+(g.browser.mozilla?"":' contenteditable="true"')+">"+be.FE.START_MARKER+g.language.translate("Image Caption")+be.FE.END_MARKER+"</span>"),d.removeAttr("class").removeAttr("style").removeAttr("width"),d.parents(".fr-img-caption").css("width",i),se(!0),g.selection.restore()}else e=he(),d.insertAfter(e),d.attr("class",e.attr("class").replace("fr-img-caption","")).attr("style",e.attr("style")),e.remove(),k(d)},hasCaption:ve,exitEdit:se,edit:k}},be.FE.DefineIcon("insertImage",{NAME:"image"}),be.FE.RegisterShortcut(be.FE.KEYCODE.P,"insertImage",null,"P"),be.FE.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),be.FE.DefineIcon("imageUpload",{NAME:"upload"}),be.FE.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(e){this.image.refreshUploadButton(e)}}),be.FE.DefineIcon("imageByURL",{NAME:"link"}),be.FE.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(e){this.image.refreshByURLButton(e)}}),be.FE.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(e){this.image.get()?e.text(this.language.translate("Replace")):e.text(this.language.translate("Insert"))}}),be.FE.DefineIcon("imageDisplay",{NAME:"star"}),be.FE.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.image.display(t)},refresh:function(e){this.opts.imageTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.image.refreshDisplayOnShow(e,t)}}),be.FE.DefineIcon("image-align",{NAME:"align-left"}),be.FE.DefineIcon("image-align-left",{NAME:"align-left"}),be.FE.DefineIcon("image-align-right",{NAME:"align-right"}),be.FE.DefineIcon("image-align-center",{NAME:"align-justify"}),be.FE.DefineIcon("imageAlign",{NAME:"align-justify"}),be.FE.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=be.FE.COMMANDS.imageAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="imageAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("image-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.image.align(t)},refresh:function(e){this.image.refreshAlign(e)},refreshOnShow:function(e,t){this.image.refreshAlignOnShow(e,t)}}),be.FE.DefineIcon("imageReplace",{NAME:"exchange",FA5NAME:"exchange-alt"}),be.FE.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),be.FE.DefineIcon("imageRemove",{NAME:"trash"}),be.FE.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),be.FE.DefineIcon("imageBack",{NAME:"arrow-left"}),be.FE.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(e){this.image.get()||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),be.FE.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),be.FE.DefineIcon("imageStyle",{NAME:"magic"}),be.FE.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.imageStyles;for(var a in t)if(t.hasOwnProperty(a)){var i=t[a];"object"==typeof i&&(i=i.title),e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+a+'">'+this.language.translate(i)+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.image.applyStyle(t)},refreshOnShow:function(e,t){var a=this.image.getEl();a&&t.find(".fr-command").each(function(){var e=be(this).data("param1"),t=a.hasClass(e);be(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),be.FE.DefineIcon("imageAlt",{NAME:"info"}),be.FE.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternative Text",callback:function(){this.image.showAltPopup()}}),be.FE.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),be.FE.DefineIcon("imageSize",{NAME:"arrows-alt"}),be.FE.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),be.FE.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),be.FE.DefineIcon("imageCaption",{NAME:"commenting",FA5NAME:"comment-alt"}),be.FE.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(e){this.image.get()&&e.toggleClass("fr-active",this.image.hasCaption())}})});
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),a(t)}:a(window.jQuery)}(function(ye){ye.extend(ye.FE.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),ye.extend(ye.FE.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","|","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:null,imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif","webp"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5,imageAddNewLine:!1}),ye.FE.PLUGINS.image=function(g){var d,l,f,p,o,a,c="https://i.froala.com/upload",t=!1,i=1,u=2,m=3,h=4,v=5,b=6,r={};function y(){var e=g.popups.get("image.insert").find(".fr-image-by-url-layer input");e.val(""),d&&e.val(d.attr("src")),e.trigger("change")}function n(){var e=g.popups.get("image.edit");if(e||(e=U()),e){var t=ve();be()&&(t=t.find(".fr-img-wrap")),g.popups.setContainer("image.edit",g.$sc),g.popups.refresh("image.edit");var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();d.hasClass("fr-uploading")?$():g.popups.show("image.edit",a,i,t.outerHeight())}}function w(){I()}function e(){for(var e,t,a="IMG"==g.el.tagName?[g.el]:g.el.querySelectorAll("img"),i=0;i<a.length;i++){var r=ye(a[i]);!g.opts.htmlUntouched&&g.opts.useClasses?((g.opts.imageDefaultAlign||g.opts.imageDefaultDisplay)&&(0<(t=r).parents(".fr-img-caption").length&&(t=t.parents(".fr-img-caption:first")),t.hasClass("fr-dii")||t.hasClass("fr-dib")||(t.addClass("fr-fi"+de(t)[0]),t.addClass("fr-di"+ce(t)[0]),t.css("margin",""),t.css("float",""),t.css("display",""),t.css("z-index",""),t.css("position",""),t.css("overflow",""),t.css("vertical-align",""))),g.opts.imageTextNear||(0<r.parents(".fr-img-caption").length?r.parents(".fr-img-caption:first").removeClass("fr-dii").addClass("fr-dib"):r.removeClass("fr-dii").addClass("fr-dib"))):g.opts.htmlUntouched||g.opts.useClasses||(g.opts.imageDefaultAlign||g.opts.imageDefaultDisplay)&&(0<(e=r).parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption:first")),ge(e,e.hasClass("fr-dib")?"block":e.hasClass("fr-dii")?"inline":null,e.hasClass("fr-fil")?"left":e.hasClass("fr-fir")?"right":de(e)),e.removeClass("fr-dib fr-dii fr-fir fr-fil")),g.opts.iframe&&r.on("load",g.size.syncIframe)}}function E(e){void 0===e&&(e=!0);var t,a=Array.prototype.slice.call(g.el.querySelectorAll("img")),i=[];for(t=0;t<a.length;t++)if(i.push(a[t].getAttribute("src")),ye(a[t]).toggleClass("fr-draggable",g.opts.imageMove),""===a[t].getAttribute("class")&&a[t].removeAttribute("class"),""===a[t].getAttribute("style")&&a[t].removeAttribute("style"),a[t].parentNode&&a[t].parentNode.parentNode&&g.node.hasClass(a[t].parentNode.parentNode,"fr-img-caption")){var r=a[t].parentNode.parentNode;g.browser.mozilla||r.setAttribute("contenteditable",!1),r.setAttribute("draggable",!1),r.classList.add("fr-draggable");var n=a[t].nextSibling;n&&!g.browser.mozilla&&n.setAttribute("contenteditable",!0)}if(o)for(t=0;t<o.length;t++)i.indexOf(o[t].getAttribute("src"))<0&&g.events.trigger("image.removed",[ye(o[t])]);if(o&&e){var s=[];for(t=0;t<o.length;t++)s.push(o[t].getAttribute("src"));for(t=0;t<a.length;t++)s.indexOf(a[t].getAttribute("src"))<0&&g.events.trigger("image.loaded",[ye(a[t])])}o=a}function C(){if(l||function(){var e;g.shared.$image_resizer?(l=g.shared.$image_resizer,p=g.shared.$img_overlay,g.events.on("destroy",function(){l.removeClass("fr-active").appendTo(ye("body:first"))},!0)):(g.shared.$image_resizer=ye('<div class="fr-image-resizer"></div>'),l=g.shared.$image_resizer,g.events.$on(l,"mousedown",function(e){e.stopPropagation()},!0),g.opts.imageResize&&(l.append(s("nw")+s("ne")+s("sw")+s("se")),g.shared.$img_overlay=ye('<div class="fr-image-overlay"></div>'),p=g.shared.$img_overlay,e=l.get(0).ownerDocument,ye(e).find("body:first").append(p)));g.events.on("shared.destroy",function(){l.html("").removeData().remove(),l=null,g.opts.imageResize&&(p.remove(),p=null)},!0),g.helpers.isMobile()||g.events.$on(ye(g.o_win),"resize",function(){d&&!d.hasClass("fr-uploading")?oe(!0):d&&(C(),ue(),$(!1))});if(g.opts.imageResize){e=l.get(0).ownerDocument,g.events.$on(l,g._mousedown,".fr-handler",R),g.events.$on(ye(e),g._mousemove,S),g.events.$on(ye(e.defaultView||e.parentWindow),g._mouseup,x),g.events.$on(p,"mouseleave",x);var i=1,r=null,n=0;g.events.on("keydown",function(e){if(d){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-n)&&(i=1),(a==ye.FE.KEYCODE.EQUALS||g.browser.mozilla&&a==ye.FE.KEYCODE.FF_EQUALS)&&t&&!e.altKey?i=Q.call(this,e,1,1,i):(a==ye.FE.KEYCODE.HYPHEN||g.browser.mozilla&&a==ye.FE.KEYCODE.FF_HYPHEN)&&t&&!e.altKey?i=Q.call(this,e,2,-1,i):g.keys.ctrlKey(e)||a!=ye.FE.KEYCODE.ENTER||(d.before("<br>"),N(d)),r=a,n=e.timeStamp}},!0),g.events.on("keyup",function(){i=1})}}(),!d)return!1;var e=g.$wp||g.$sc;e.append(l),l.data("instance",g);var t=e.scrollTop()-("static"!=e.css("position")?e.offset().top:0),a=e.scrollLeft()-("static"!=e.css("position")?e.offset().left:0);a-=g.helpers.getPX(e.css("border-left-width")),t-=g.helpers.getPX(e.css("border-top-width")),g.$el.is("img")&&g.$sc.is("body")&&(a=t=0);var i=ve();be()&&(i=i.find(".fr-img-wrap")),l.css("top",(g.opts.iframe?i.offset().top:i.offset().top+t)-1).css("left",(g.opts.iframe?i.offset().left:i.offset().left+a)-1).css("width",i.get(0).getBoundingClientRect().width).css("height",i.get(0).getBoundingClientRect().height).addClass("fr-active")}function s(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function A(e){be()?d.parents(".fr-img-caption").css("width",e):d.css("width",e)}function R(e){if(!g.core.sameInstance(l))return!0;if(e.preventDefault(),e.stopPropagation(),g.$el.find("img.fr-error").left)return!1;g.undo.canDo()||g.undo.saveStep();var t=e.pageX||e.originalEvent.touches[0].pageX;if("mousedown"==e.type){var a=g.$oel.get(0).ownerDocument,i=a.defaultView||a.parentWindow,r=!1;try{r=i.location!=i.parent.location&&!(i.$&&i.$.FE)}catch(o){}r&&i.frameElement&&(t+=g.helpers.getPX(ye(i.frameElement).offset().left)+i.frameElement.clientLeft)}(f=ye(this)).data("start-x",t),f.data("start-width",d.width()),f.data("start-height",d.height());var n=d.width();if(g.opts.imageResizeWithPercent){var s=d.parentsUntil(g.$el,g.html.blockTagsQuery()).get(0)||g.el;n=(n/ye(s).outerWidth()*100).toFixed(2)+"%"}A(n),p.show(),g.popups.hideAll(),pe()}function S(e){if(!g.core.sameInstance(l))return!0;var t;if(f&&d){if(e.preventDefault(),g.$el.find("img.fr-error").left)return!1;var a=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null);if(!a)return!1;var i=a-f.data("start-x"),r=f.data("start-width");if((f.hasClass("fr-hnw")||f.hasClass("fr-hsw"))&&(i=0-i),g.opts.imageResizeWithPercent){var n=d.parentsUntil(g.$el,g.html.blockTagsQuery()).get(0)||g.el;r=((r+i)/ye(n).outerWidth()*100).toFixed(2),g.opts.imageRoundPercent&&(r=Math.round(r)),A(r+"%"),(t=be()?(g.helpers.getPX(d.parents(".fr-img-caption").css("width"))/ye(n).outerWidth()*100).toFixed(2):(g.helpers.getPX(d.css("width"))/ye(n).outerWidth()*100).toFixed(2))===r||g.opts.imageRoundPercent||A(t+"%"),d.css("height","").removeAttr("height")}else r+i>=g.opts.imageMinWidth&&(A(r+i),t=be()?g.helpers.getPX(d.parents(".fr-img-caption").css("width")):g.helpers.getPX(d.css("width"))),t!==r+i&&A(t),((d.attr("style")||"").match(/(^height:)|(; *height:)/)||d.attr("height"))&&(d.css("height",f.data("start-height")*d.width()/f.data("start-width")),d.removeAttr("height"));C(),g.events.trigger("image.resize",[he()])}}function x(e){if(!g.core.sameInstance(l))return!0;if(f&&d){if(e&&e.stopPropagation(),g.$el.find("img.fr-error").left)return!1;f=null,p.hide(),C(),n(),g.undo.saveStep(),g.events.trigger("image.resizeEnd",[he()])}}function D(e,t,a){g.edit.on(),d&&d.addClass("fr-error"),r[e]?B(r[e]):B(g.language.translate("Something went wrong. Please try again.")),!d&&a&&J(a),g.events.trigger("image.error",[{code:e,message:r[e]},t,a])}function U(e){if(e)return g.$wp&&g.events.$on(g.$wp,"scroll.image-edit",function(){d&&g.popups.isVisible("image.edit")&&(g.events.disableBlur(),n())}),!0;var t="";if(0<g.opts.imageEditButtons.length){t+='<div class="fr-buttons">',t+=g.button.buildList(g.opts.imageEditButtons);var a={buttons:t+="</div>"};return g.popups.create("image.edit",a)}return!1}function $(e){var t=g.popups.get("image.insert");if(t||(t=H()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),d){var a=ve();g.popups.setContainer("image.insert",g.$sc);var i=a.offset().left+a.width()/2,r=a.offset().top+a.height();g.popups.show("image.insert",i,r,a.outerHeight())}void 0===e&&F(g.language.translate("Uploading"),0)}function I(e){var t=g.popups.get("image.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||g.$el.find("img.fr-error").length)){if(g.events.focus(),g.$el.find("img.fr-error").length&&(g.$el.find("img.fr-error").remove(),g.undo.saveStep(),g.undo.run(),g.undo.dropRedo()),!g.$wp&&d){var a=d;oe(!0),g.selection.setAfter(a.get(0)),g.selection.restore()}g.popups.hide("image.insert")}}function F(e,t){var a=g.popups.get("image.insert");if(a){var i=a.find(".fr-image-progress-bar-layer");i.find("h3").text(e+(t?" "+t+"%":"")),i.removeClass("fr-error"),t?(i.find("div").removeClass("fr-indeterminate"),i.find("div > span").css("width",t+"%")):i.find("div").addClass("fr-indeterminate")}}function B(e){$();var t=g.popups.get("image.insert").find(".fr-image-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),g.events.disableBlur(),a.focus()}function N(e){se.call(e.get(0))}function k(){var e=ye(this);g.popups.hide("image.insert"),e.removeClass("fr-uploading"),e.next().is("br")&&e.next().remove(),N(e),g.events.trigger("image.loaded",[e])}function O(s,e,o,l,f){g.edit.off(),F(g.language.translate("Loading image")),e&&(s=g.helpers.sanitizeURL(s));var t=new Image;t.onload=function(){var e,t;if(l){g.undo.canDo()||l.hasClass("fr-uploading")||g.undo.saveStep();var a=l.data("fr-old-src");l.data("fr-image-pasted")&&(a=null),g.$wp?((e=l.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted")).off("load"),a&&l.attr("src",a),l.replaceWith(e)):e=l;for(var i=e.get(0).attributes,r=0;r<i.length;r++){var n=i[r];0===n.nodeName.indexOf("data-")&&e.removeAttr(n.nodeName)}if(void 0!==o)for(t in o)o.hasOwnProperty(t)&&"link"!=t&&e.attr("data-"+t,o[t]);e.on("load",k),e.attr("src",s),g.edit.on(),E(!1),g.undo.saveStep(),g.events.disableBlur(),g.$el.blur(),g.events.trigger(a?"image.replaced":"image.inserted",[e,f])}else e=M(s,o,k),E(!1),g.undo.saveStep(),g.events.disableBlur(),g.$el.blur(),g.events.trigger("image.inserted",[e,f])},t.onerror=function(){D(i)},$(g.language.translate("Loading image")),t.src=s}function P(e){F(g.language.translate("Loading image"));var t=this.status,a=this.response,i=this.responseXML,r=this.responseText;try{if(g.opts.imageUploadToS3)if(201==t){var n=function(e){try{var t=ye(e).find("Location").text(),a=ye(e).find("Key").text();return!1===g.events.trigger("image.uploadedToS3",[t,a,e],!0)?(g.edit.on(),!1):t}catch(i){return D(h,e),!1}}(i);n&&O(n,!1,[],e,a||i)}else D(h,a||i,e);else if(200<=t&&t<300){var s=function(e){try{if(!1===g.events.trigger("image.uploaded",[e],!0))return g.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(D(u,e),!1)}catch(a){return D(h,e),!1}}(r);s&&O(s.link,!1,s,e,a||r)}else D(m,a||r,e)}catch(o){D(h,a||r,e)}}function T(){D(h,this.response||this.responseText||this.responseXML)}function L(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;F(g.language.translate("Uploading"),t)}}function M(e,t,a){var i,r="";if(t&&void 0!==t)for(i in t)t.hasOwnProperty(i)&&"link"!=i&&(r+=" data-"+i+'="'+t[i]+'"');var n=g.opts.imageDefaultWidth;n&&"auto"!=n&&(n=g.opts.imageResizeWithPercent?"100%":n+"px");var s=ye('<img src="'+e+'"'+r+(n?' style="width: '+n+';"':"")+">");ge(s,g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign),s.on("load",a),s.on("error",a),g.edit.on(),g.events.focus(!0),g.selection.restore(),g.undo.saveStep(),g.opts.imageSplitHTML?g.markers.split():g.markers.insert(),g.html.wrap();var o=g.$el.find(".fr-marker");return o.length?(o.parent().is("hr")&&o.parent().after(o),g.node.isLastSibling(o)&&o.parent().hasClass("fr-deletable")&&o.insertAfter(o.parent()),o.replaceWith(s)):g.$el.append(s),g.selection.clear(),s}function z(){g.edit.on(),I(!0)}function _(e,t){if(void 0!==e&&0<e.length){if(!1===g.events.trigger("image.beforeUpload",[e,t]))return!1;var a,i=e[0];if((null===g.opts.imageUploadURL||g.opts.imageUploadURL==c)&&!g.opts.imageUploadToS3)return s=i,o=t||d,(l=new FileReader).onload=function(){var e=l.result;if(l.result.indexOf("svg+xml")<0){for(var t=atob(l.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:s.type})),g.image.insert(e,!1,null,o)}},$(),l.readAsDataURL(s),!1;if(i.name||(i.name=(new Date).getTime()+"."+(i.type||"image/jpeg").replace(/image\//g,"")),i.size>g.opts.imageMaxSize)return D(v),!1;if(g.opts.imageAllowedTypes.indexOf(i.type.replace(/image\//g,""))<0)return D(b),!1;if(g.drag_support.formdata&&(a=g.drag_support.formdata?new FormData:null),a){var r;if(!1!==g.opts.imageUploadToS3)for(r in a.append("key",g.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),a.append("success_action_status","201"),a.append("X-Requested-With","xhr"),a.append("Content-Type",i.type),g.opts.imageUploadToS3.params)g.opts.imageUploadToS3.params.hasOwnProperty(r)&&a.append(r,g.opts.imageUploadToS3.params[r]);for(r in g.opts.imageUploadParams)g.opts.imageUploadParams.hasOwnProperty(r)&&a.append(r,g.opts.imageUploadParams[r]);a.append(g.opts.imageUploadParam,i,i.name);var n=g.opts.imageUploadURL;g.opts.imageUploadToS3&&(n=g.opts.imageUploadToS3.uploadURL?g.opts.imageUploadToS3.uploadURL:"https://"+g.opts.imageUploadToS3.region+".amazonaws.com/"+g.opts.imageUploadToS3.bucket),function(t,a,e,r){function n(){var e=ye(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),g.placeholder.refresh(),N(e),C(),$(),g.edit.off(),t.onload=function(){P.call(t,e)},t.onerror=T,t.upload.onprogress=L,t.onabort=z,e.off("abortUpload").on("abortUpload",function(){4!=t.readyState&&(t.abort(),r?(r.attr("src",r.data("fr-old-src")),r.removeClass("fr-uploading")):e.remove(),oe(!0))}),t.send(a)}var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:"image/jpeg"}))}r?(r.on("load",n),r.one("error",n),g.edit.on(),g.undo.saveStep(),r.data("fr-old-src",r.attr("src")),r.attr("src",e)):M(e,null,n)},s.readAsDataURL(e)}(g.core.getXHR(n,g.opts.imageUploadMethod),a,i,t||d)}}var s,o,l}function W(e){if(e.is("img")&&0<e.parents(".fr-img-caption").length)return e.parents(".fr-img-caption")}function K(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("image")&&0<=g.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))){if(!g.opts.imageUpload)return e.preventDefault(),e.stopPropagation(),!1;g.markers.remove(),g.markers.insertAtPoint(e.originalEvent),g.$el.find(".fr-marker").replaceWith(ye.FE.MARKERS),0===g.$el.find(".fr-marker").length&&g.selection.setAtEnd(g.el),g.popups.hideAll();var i=g.popups.get("image.insert");i||(i=H()),g.popups.setContainer("image.insert",g.$sc);var r=e.originalEvent.pageX,n=e.originalEvent.pageY;return g.opts.iframe&&(n+=g.$iframe.offset().top,r+=g.$iframe.offset().left),g.popups.show("image.insert",r,n),$(),0<=g.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))?(oe(!0),_(t.files)):D(b),e.preventDefault(),e.stopPropagation(),!1}}}function H(e){if(e)return g.popups.onRefresh("image.insert",y),g.popups.onHide("image.insert",w),!0;var t,a,i="";g.opts.imageUpload||-1===g.opts.imageInsertButtons.indexOf("imageUpload")||g.opts.imageInsertButtons.splice(g.opts.imageInsertButtons.indexOf("imageUpload"),1);var r=g.button.buildList(g.opts.imageInsertButtons);""!==r&&(i='<div class="fr-buttons">'+r+"</div>");var n=g.opts.imageInsertButtons.indexOf("imageUpload"),s=g.opts.imageInsertButtons.indexOf("imageByURL"),o="";0<=n&&(t=" fr-active",0<=s&&s<n&&(t=""),o='<div class="fr-image-upload-layer'+t+' fr-layer" id="fr-image-upload-layer-'+g.id+'"><strong>'+g.language.translate("Drop image")+"</strong><br>("+g.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+g.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+g.id+'" role="button"></div></div>');var l="";0<=s&&(t=" fr-active",0<=n&&n<s&&(t=""),l='<div class="fr-image-by-url-layer'+t+' fr-layer" id="fr-image-by-url-layer-'+g.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+g.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+g.language.translate("Insert")+"</button></div></div>");var f,p={buttons:i,upload_layer:o,by_url_layer:l,progress_bar:'<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>'};return 1<=g.opts.imageInsertButtons.length&&(a=g.popups.create("image.insert",p)),g.$wp&&g.events.$on(g.$wp,"scroll",function(){d&&g.popups.isVisible("image.insert")&&ue()}),f=a,g.events.$on(f,"dragover dragenter",".fr-image-upload-layer",function(){return ye(this).addClass("fr-drop"),!1},!0),g.events.$on(f,"dragleave dragend",".fr-image-upload-layer",function(){return ye(this).removeClass("fr-drop"),!1},!0),g.events.$on(f,"drop",".fr-image-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),ye(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=f.data("instance")||g;a.events.disableBlur(),a.image.upload(t.files),a.events.enableBlur()}},!0),g.helpers.isIOS()&&g.events.$on(f,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){ye(this).trigger("click")},!0),g.events.$on(f,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var e=f.data("instance")||g;e.events.disableBlur(),f.find("input:focus").blur(),e.events.enableBlur(),e.image.upload(this.files,d)}ye(this).val("")},!0),a}function Y(){d&&g.popups.get("image.alt").find("input").val(d.attr("alt")||"").trigger("change")}function X(){var e=g.popups.get("image.alt");e||(e=j()),I(),g.popups.refresh("image.alt"),g.popups.setContainer("image.alt",g.$sc);var t=ve();be()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.alt",a,i,t.outerHeight())}function j(e){if(e)return g.popups.onRefresh("image.alt",Y),!0;var t={buttons:'<div class="fr-buttons">'+g.button.buildList(g.opts.imageAltButtons)+"</div>",alt_layer:'<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+g.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+g.id+'" type="text" placeholder="'+g.language.translate("Alternative Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+g.language.translate("Update")+"</button></div></div>"},a=g.popups.create("image.alt",t);return g.$wp&&g.events.$on(g.$wp,"scroll.image-alt",function(){d&&g.popups.isVisible("image.alt")&&X()}),a}function G(){var e=g.popups.get("image.size");if(d)if(be()){var t=d.parent();t.get(0).style.width||(t=d.parent().parent()),e.find('input[name="width"]').val(t.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height).trigger("change")}else e.find('input[name="width"]').val(d.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(d.get(0).style.height).trigger("change")}function V(){var e=g.popups.get("image.size");e||(e=q()),I(),g.popups.refresh("image.size"),g.popups.setContainer("image.size",g.$sc);var t=ve();be()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.size",a,i,t.outerHeight())}function q(e){if(e)return g.popups.onRefresh("image.size",G),!0;var t={buttons:'<div class="fr-buttons">'+g.button.buildList(g.opts.imageSizeButtons)+"</div>",size_layer:'<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+g.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+g.id+'" type="text" name="width" placeholder="'+g.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+g.id+'" type="text" name="height" placeholder="'+g.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+g.language.translate("Update")+"</button></div></div>"},a=g.popups.create("image.size",t);return g.$wp&&g.events.$on(g.$wp,"scroll.image-size",function(){d&&g.popups.isVisible("image.size")&&V()}),a}function Q(e,t,a,i){return e.pageX=t,R.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,i)),S.call(this,e),x.call(this,e),++i}function J(e){(e=e||ve())&&!1!==g.events.trigger("image.beforeRemove",[e])&&(g.popups.hideAll(),me(),oe(!0),g.undo.canDo()||g.undo.saveStep(),e.get(0)==g.el?e.removeAttr("src"):(e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?(g.selection.setBefore(e.get(0).parentNode)||g.selection.setAfter(e.get(0).parentNode)||e.parent().after(ye.FE.MARKERS),ye(e.get(0).parentNode).remove()):(g.selection.setBefore(e.get(0))||g.selection.setAfter(e.get(0))||e.after(ye.FE.MARKERS),e.remove()),g.html.fillEmptyBlocks(),g.selection.restore()),g.undo.saveStep())}function Z(e){var t=e.which;if(d&&(t==ye.FE.KEYCODE.BACKSPACE||t==ye.FE.KEYCODE.DELETE))return e.preventDefault(),e.stopPropagation(),J(),!1;if(d&&t==ye.FE.KEYCODE.ESC){var a=d;return oe(!0),g.selection.setAfter(a.get(0)),g.selection.restore(),e.preventDefault(),!1}if(d&&(t==ye.FE.KEYCODE.ARROW_LEFT||t==ye.FE.KEYCODE.ARROW_RIGHT)){var i=d.get(0);return oe(!0),t==ye.FE.KEYCODE.ARROW_LEFT?g.selection.setBefore(i):g.selection.setAfter(i),g.selection.restore(),e.preventDefault(),!1}return d&&t===ye.FE.KEYCODE.TAB?(e.preventDefault(),e.stopPropagation(),oe(!0),!1):d&&t!=ye.FE.KEYCODE.F10&&!g.keys.isBrowserAction(e)?(e.preventDefault(),e.stopPropagation(),!1):void 0}function ee(e){if(e&&"IMG"==e.tagName){if(g.node.hasClass(e,"fr-uploading")||g.node.hasClass(e,"fr-error")?e.parentNode.removeChild(e):g.node.hasClass(e,"fr-draggable")&&e.classList.remove("fr-draggable"),e.parentNode&&e.parentNode.parentNode&&g.node.hasClass(e.parentNode.parentNode,"fr-img-caption")){var t=e.parentNode.parentNode;t.removeAttribute("contenteditable"),t.removeAttribute("draggable"),t.classList.remove("fr-draggable");var a=e.nextSibling;a&&a.removeAttribute("contenteditable")}}else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var i=e.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),r=0;r<i.length;r++)ee(i[r])}function te(e){if(!1===g.events.trigger("image.beforePasteUpload",[e]))return!1;d=ye(e),C(),n(),ue(),$(),d.one("load",function(){C(),ye(g.popups.get("image.insert").get(0)).find("div.fr-active.fr-error").length<1&&$()});for(var t=ye(e).attr("src").split(","),a=atob(t[1]),i=[],r=0;r<a.length;r++)i.push(a.charCodeAt(r));_([new Blob([new Uint8Array(i)],{type:t[0].replace(/data\:/g,"").replace(/;base64/g,"")})],d)}function ae(){g.opts.imagePaste?g.$el.find("img[data-fr-image-pasted]").each(function(e,i){if(g.opts.imagePasteProcess){var t=g.opts.imageDefaultWidth;t&&"auto"!=t&&(t+=g.opts.imageResizeWithPercent?"%":"px"),ye(i).css("width",t).removeClass("fr-dii fr-dib fr-fir fr-fil"),ge(ye(i),g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign)}if(0===i.src.indexOf("data:"))te(i);else if(0===i.src.indexOf("blob:")||0===i.src.indexOf("http")&&g.opts.imageUploadRemoteUrls&&g.opts.imageCORSProxy){var a=new Image;a.crossOrigin="Anonymous",a.onload=function(){var e,t=g.o_doc.createElement("CANVAS"),a=t.getContext("2d");t.height=this.naturalHeight,t.width=this.naturalWidth,a.drawImage(this,0,0),setTimeout(function(){te(i)},0),e=2e3<this.naturalWidth||1500<this.naturalHeight?"jpeg":"png",i.src=t.toDataURL("image/"+e)},a.src=(0===i.src.indexOf("blob:")?"":g.opts.imageCORSProxy+"/")+i.src}else 0!==i.src.indexOf("http")||0===i.src.indexOf("https://mail.google.com/mail")?(g.selection.save(),ye(i).remove(),g.selection.restore()):ye(i).removeAttr("data-fr-image-pasted")}):g.$el.find("img[data-fr-image-pasted]").remove()}function ie(e){var t=e.target.result,a=g.opts.imageDefaultWidth;a&&"auto"!=a&&(a+=g.opts.imageResizeWithPercent?"%":"px"),g.undo.saveStep(),g.html.insert('<img data-fr-image-pasted="true" src="'+t+'"'+(a?' style="width: '+a+';"':"")+">");var i=g.$el.find('img[data-fr-image-pasted="true"]');i&&ge(i,g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign),g.events.trigger("paste.after")}function re(e){if(e&&e.clipboardData&&e.clipboardData.items){var t=null,a=e.clipboardData;if(a.types&&-1!=[].indexOf.call(a.types,"text/rtf")||a.getData("text/rtf"))t=a.items[0].getAsFile();else for(var i=0;i<a.items.length&&!(t=a.items[i].getAsFile());i++);if(t)return r=t,(n=new FileReader).onload=ie,n.readAsDataURL(r),!1}var r,n}function ne(e){return e=e.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function se(e){if("false"==ye(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;if(e&&"touchend"==e.type&&a)return!0;if(e&&g.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;for(var t=0;t<ye.FE.INSTANCES.length;t++)ye.FE.INSTANCES[t]!=g&&ye.FE.INSTANCES[t].events.trigger("image.hideResizer");g.toolbar.disable(),e&&(e.stopPropagation(),e.preventDefault()),g.helpers.isMobile()&&(g.events.disableBlur(),g.$el.blur(),g.events.enableBlur()),g.opts.iframe&&g.size.syncIframe(),d=ye(this),me(),C(),n(),g.browser.msie?(g.popups.areVisible()&&g.events.disableBlur(),g.win.getSelection&&(g.win.getSelection().removeAllRanges(),g.win.getSelection().addRange(g.doc.createRange()))):g.selection.clear(),g.helpers.isIOS()&&(g.events.disableBlur(),g.$el.blur()),g.button.bulkRefresh(),g.events.trigger("video.hideResizer")}function oe(e){d&&(le||!0===e)&&(g.toolbar.enable(),l.removeClass("fr-active"),g.popups.hide("image.edit"),d=null,pe(),f=null,p&&p.hide())}r[i]="Image cannot be loaded from the passed link.",r[u]="No link in upload response.",r[m]="Error during file upload.",r[h]="Parsing response failed.",r[v]="File is too large.",r[b]="Image file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.";var le=!(r[8]="Image file is corrupted.");function fe(){le=!0}function pe(){le=!1}function ge(e,t,a){!g.opts.htmlUntouched&&g.opts.useClasses?(e.removeClass("fr-fil fr-fir fr-dib fr-dii"),a&&e.addClass("fr-fi"+a[0]),t&&e.addClass("fr-di"+t[0])):"inline"==t?(e.css({display:"inline-block",verticalAlign:"bottom",margin:g.opts.imageDefaultMargin}),"center"==a?e.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*g.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==a?e.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+g.opts.imageDefaultMargin+"px)",textAlign:"left"}):e.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+g.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==t&&(e.css({display:"block","float":"none",verticalAlign:"top",margin:g.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==a?e.css({marginLeft:0,textAlign:"left"}):"right"==a&&e.css({marginRight:0,textAlign:"right"}))}function de(e){if(void 0===e&&(e=ve()),e){if(e.hasClass("fr-fil"))return"left";if(e.hasClass("fr-fir"))return"right";if(e.hasClass("fr-dib")||e.hasClass("fr-dii"))return"center";var t=e.css("float");if(e.css("float","none"),"block"==e.css("display")){if(e.css("float",""),e.css("float")!=t&&e.css("float",t),0===parseInt(e.css("margin-left"),10))return"left";if(0===parseInt(e.css("margin-right"),10))return"right"}else{if(e.css("float",""),e.css("float")!=t&&e.css("float",t),"left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function ce(e){void 0===e&&(e=ve());var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function ue(){var e=g.popups.get("image.insert");e||(e=H()),g.popups.isVisible("image.insert")||(I(),g.popups.refresh("image.insert"),g.popups.setContainer("image.insert",g.$sc));var t=ve();be()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.insert",a,i,t.outerHeight(!0))}function me(){if(d){g.events.disableBlur(),g.selection.clear();var e=g.doc.createRange();e.selectNode(d.get(0)),g.browser.msie&&e.collapse(!0),g.selection.get().addRange(e),g.events.enableBlur()}}function he(){return d}function ve(){return be()?d.parents(".fr-img-caption:first"):d}function be(){return!!d&&0<d.parents(".fr-img-caption").length}return{_init:function(){var i;g.events.$on(g.$el,g._mousedown,"IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==ye(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;g.helpers.isMobile()||g.selection.clear(),t=!0,g.popups.areVisible()&&g.events.disableBlur(),g.browser.msie&&(g.events.disableBlur(),g.$el.attr("contenteditable",!1)),g.draggable||"touchstart"==e.type||e.preventDefault(),e.stopPropagation()}),g.events.$on(g.$el,g._mousedown,".fr-img-caption .fr-inner",function(e){g.core.hasFocus()||g.events.focus(),e.stopPropagation()}),g.events.$on(g.$el,"paste",".fr-img-caption .fr-inner",function(e){g.toolbar.hide(),e.stopPropagation()}),g.events.$on(g.$el,g._mouseup,"IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==ye(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;t&&(t=!1,e.stopPropagation(),g.browser.msie&&(g.$el.attr("contenteditable",!0),g.events.enableBlur()))}),g.events.on("keyup",function(e){if(e.shiftKey&&""===g.selection.text().replace(/\n/g,"")&&g.keys.isArrow(e.which)){var t=g.selection.element(),a=g.selection.endElement();t&&"IMG"==t.tagName?N(ye(t)):a&&"IMG"==a.tagName&&N(ye(a))}},!0),g.events.on("drop",K),g.events.on("element.beforeDrop",W),g.events.on("mousedown window.mousedown",fe),g.events.on("window.touchmove",pe),g.events.on("mouseup window.mouseup",function(){if(d)return oe(),!1;pe()}),g.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&oe()}),g.events.on("image.resizeEnd",function(){g.opts.iframe&&g.size.syncIframe()}),g.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){oe(!(t=!1))}),g.events.on("modals.hide",function(){d&&(me(),g.selection.clear())}),g.events.on("image.resizeEnd",function(){g.win.getSelection&&N(d)}),g.opts.imageAddNewLine&&g.events.on("image.inserted",function(e){var t=e.get(0);for(t.nextSibling&&"BR"===t.nextSibling.tagName&&(t=t.nextSibling);t&&!g.node.isElement(t);)t=g.node.isLastSibling(t)?t.parentNode:null;g.node.isElement(t)&&(g.opts.enter===ye.FE.ENTER_BR?e.after("<br>"):ye(g.node.blockParent(e.get(0))).after("<"+g.html.defaultTag()+"><br></"+g.html.defaultTag()+">"))}),"IMG"==g.el.tagName&&g.$el.addClass("fr-view"),g.events.$on(g.$el,g.helpers.isMobile()&&!g.helpers.isWindowsPhone()?"touchend":"click","IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',se),g.helpers.isMobile()&&(g.events.$on(g.$el,"touchstart","IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(){a=!1}),g.events.$on(g.$el,"touchmove",function(){a=!0})),g.$wp?(g.events.on("window.keydown keydown",Z,!0),g.events.on("keyup",function(e){if(d&&e.which==ye.FE.KEYCODE.ENTER)return!1},!0),g.events.$on(g.$el,"keydown",function(){var e=g.selection.element();(e.nodeType===Node.TEXT_NODE||"BR"==e.tagName&&g.node.isLastSibling(e))&&(e=e.parentNode),g.node.hasClass(e,"fr-inner")||(g.node.hasClass(e,"fr-img-caption")||(e=ye(e).parents(".fr-img-caption").get(0)),g.node.hasClass(e,"fr-img-caption")&&(ye(e).after(ye.FE.INVISIBLE_SPACE+ye.FE.MARKERS),g.selection.restore()))})):g.events.$on(g.$win,"keydown",Z),g.events.on("toolbar.esc",function(){if(d){if(g.$wp)g.events.disableBlur(),g.events.focus();else{var e=d;oe(!0),g.selection.setAfter(e.get(0)),g.selection.restore()}return!1}},!0),g.events.on("toolbar.focusEditor",function(){if(d)return!1},!0),g.events.on("window.cut window.copy",function(e){if(d&&g.popups.isVisible("image.edit")&&!g.popups.get("image.edit").find(":focus").length){var t=ve();be()?(t.before(ye.FE.START_MARKER),t.after(ye.FE.END_MARKER),g.selection.restore(),g.paste.saveCopiedText(t.get(0).outerHTML,t.text())):(me(),g.paste.saveCopiedText(d.get(0).outerHTML,d.attr("alt"))),"copy"==e.type?setTimeout(function(){N(d)}):(oe(!0),g.undo.saveStep(),setTimeout(function(){g.undo.saveStep()},0))}},!0),g.browser.msie&&g.events.on("keydown",function(e){if(!g.selection.isCollapsed()||!d)return!0;var t=e.which;t==ye.FE.KEYCODE.C&&g.keys.ctrlKey(e)?g.events.trigger("window.copy"):t==ye.FE.KEYCODE.X&&g.keys.ctrlKey(e)&&g.events.trigger("window.cut")}),g.events.$on(ye(g.o_win),"keydown",function(e){var t=e.which;if(d&&t==ye.FE.KEYCODE.BACKSPACE)return e.preventDefault(),!1}),g.events.$on(g.$win,"keydown",function(e){var t=e.which;d&&d.hasClass("fr-uploading")&&t==ye.FE.KEYCODE.ESC&&d.trigger("abortUpload")}),g.events.on("destroy",function(){d&&d.hasClass("fr-uploading")&&d.trigger("abortUpload")}),g.events.on("paste.before",re),g.events.on("paste.beforeCleanup",ne),g.events.on("paste.after",ae),g.events.on("html.set",e),g.events.on("html.inserted",e),e(),g.events.on("destroy",function(){o=[]}),g.events.on("html.processGet",ee),g.opts.imageOutputSize&&g.events.on("html.beforeGet",function(){i=g.el.querySelectorAll("img");for(var e=0;e<i.length;e++){var t=i[e].style.width||ye(i[e]).width(),a=i[e].style.height||ye(i[e]).height();t&&i[e].setAttribute("width",(""+t).replace(/px/,"")),a&&i[e].setAttribute("height",(""+a).replace(/px/,""))}}),g.opts.iframe&&g.events.on("image.loaded",g.size.syncIframe),g.$wp&&(E(),g.events.on("contentChanged",E)),g.events.$on(ye(g.o_win),"orientationchange.image",function(){setTimeout(function(){d&&N(d)},100)}),U(!0),H(!0),q(!0),j(!0),g.events.on("node.remove",function(e){if("IMG"==e.get(0).tagName)return J(e),!1})},showInsertPopup:function(){var e=g.$tb.find('.fr-command[data-cmd="insertImage"]'),t=g.popups.get("image.insert");if(t||(t=H()),I(),!t.hasClass("fr-active"))if(g.popups.refresh("image.insert"),g.popups.setContainer("image.insert",g.$tb),e.is(":visible")){var a=e.offset().left+e.outerWidth()/2,i=e.offset().top+(g.opts.toolbarBottom?10:e.outerHeight()-10);g.popups.show("image.insert",a,i,e.outerHeight())}else g.position.forSelection(t),g.popups.show("image.insert")},showLayer:function(e){var t,a,i=g.popups.get("image.insert");if(d||g.opts.toolbarInline){if(d){var r=ve();be()&&(r=r.find(".fr-img-wrap")),a=r.offset().top+r.outerHeight(),t=r.offset().left+r.outerWidth()/2}}else{var n=g.$tb.find('.fr-command[data-cmd="insertImage"]');t=n.offset().left+n.outerWidth()/2,a=n.offset().top+(g.opts.toolbarBottom?10:n.outerHeight()-10)}!d&&g.opts.toolbarInline&&(a=i.offset().top-g.helpers.getPX(i.css("margin-top")),i.hasClass("fr-above")&&(a+=i.outerHeight())),i.find(".fr-layer").removeClass("fr-active"),i.find(".fr-"+e+"-layer").addClass("fr-active"),g.popups.show("image.insert",t,a,d?d.outerHeight():0),g.accessibility.focusPopup(i)},refreshUploadButton:function(e){g.popups.get("image.insert").find(".fr-image-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshByURLButton:function(e){g.popups.get("image.insert").find(".fr-image-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:_,insertByURL:function(){var e=g.popups.get("image.insert").find(".fr-image-by-url-layer input");if(0<e.val().length){$(),F(g.language.translate("Loading image"));var t=e.val().trim();if(g.opts.imageUploadRemoteUrls&&g.opts.imageCORSProxy&&g.opts.imageUpload){var a=new XMLHttpRequest;a.onload=function(){200==this.status?_([new Blob([this.response],{type:this.response.type||"image/png"})],d):D(i)},a.onerror=function(){O(t,!0,[],d)},a.open("GET",g.opts.imageCORSProxy+"/"+t,!0),a.responseType="blob",a.send()}else O(t,!0,[],d);e.val(""),e.blur()}},align:function(e){var t=ve();t.removeClass("fr-fir fr-fil"),!g.opts.htmlUntouched&&g.opts.useClasses?"left"==e?t.addClass("fr-fil"):"right"==e&&t.addClass("fr-fir"):ge(t,ce(),e),me(),C(),n(),g.selection.clear()},refreshAlign:function(e){d&&e.find("> *:first").replaceWith(g.icon.create("image-align-"+de()))},refreshAlignOnShow:function(e,t){d&&t.find('.fr-command[data-param1="'+de()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function(e){var t=ve();t.removeClass("fr-dii fr-dib"),!g.opts.htmlUntouched&&g.opts.useClasses?"inline"==e?t.addClass("fr-dii"):"block"==e&&t.addClass("fr-dib"):ge(t,e,de()),me(),C(),n(),g.selection.clear()},refreshDisplayOnShow:function(e,t){d&&t.find('.fr-command[data-param1="'+ce()+'"]').addClass("fr-active").attr("aria-selected",!0)},replace:ue,back:function(){d?(g.events.disableBlur(),ye(".fr-popup input:focus").blur(),N(d)):(g.events.disableBlur(),g.selection.restore(),g.events.enableBlur(),g.popups.hide("image.insert"),g.toolbar.showInline())},get:he,getEl:ve,insert:O,showProgressBar:$,remove:J,hideProgressBar:I,applyStyle:function(e,t,a){if(void 0===t&&(t=g.opts.imageStyles),void 0===a&&(a=g.opts.imageMultipleStyles),!d)return!1;var i=ve();if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),i.removeClass(r.join(" "))}"object"==typeof t[e]?(i.removeAttr("style"),i.css(t[e].style)):i.toggleClass(e),N(d)},showAltPopup:X,showSizePopup:V,setAlt:function(e){if(d){var t=g.popups.get("image.alt");d.attr("alt",e||t.find("input").val()||""),t.find("input:focus").blur(),N(d)}},setSize:function(e,t){if(d){var a=g.popups.get("image.size");e=e||a.find('input[name="width"]').val()||"",t=t||a.find('input[name="height"]').val()||"";var i=/^[\d]+((px)|%)*$/g;d.removeAttr("width").removeAttr("height"),e.match(i)?d.css("width",e):d.css("width",""),t.match(i)?d.css("height",t):d.css("height",""),be()&&(d.parents(".fr-img-caption").removeAttr("width").removeAttr("height"),e.match(i)?d.parents(".fr-img-caption").css("width",e):d.parents(".fr-img-caption").css("width",""),t.match(i)?d.parents(".fr-img-caption").css("height",t):d.parents(".fr-img-caption").css("height","")),a&&a.find("input:focus").blur(),N(d)}},toggleCaption:function(){var e;if(d&&!be()){var t,a;(e=d).parent().is("a")&&(e=d.parent()),e.attr("style")&&(a=-1<(t=e.attr("style").split(":")).indexOf("width")?t[t.indexOf("width")+1].replace(";",""):"");var i=g.opts.imageResizeWithPercent?(-1<a.indexOf("px")?null:a)||"100%":d.width()+"px";e.wrap("<span "+(g.browser.mozilla?"":'contenteditable="false"')+'class="fr-img-caption '+d.attr("class")+'" style="'+(g.opts.useClasses?"":e.attr("style"))+'" draggable="false"></span>'),e.wrap('<span class="fr-img-wrap"></span>'),d.after('<span class="fr-inner"'+(g.browser.mozilla?"":' contenteditable="true"')+">"+ye.FE.START_MARKER+g.language.translate("Image Caption")+ye.FE.END_MARKER+"</span>"),d.removeAttr("class").removeAttr("style").removeAttr("width"),d.parents(".fr-img-caption").css("width",i),oe(!0),g.selection.restore()}else e=ve(),d.insertAfter(e),d.attr("class",e.attr("class").replace("fr-img-caption","")).attr("style",e.attr("style")),e.remove(),N(d)},hasCaption:be,exitEdit:oe,edit:N}},ye.FE.DefineIcon("insertImage",{NAME:"image"}),ye.FE.RegisterShortcut(ye.FE.KEYCODE.P,"insertImage",null,"P"),ye.FE.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),ye.FE.DefineIcon("imageUpload",{NAME:"upload"}),ye.FE.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(e){this.image.refreshUploadButton(e)}}),ye.FE.DefineIcon("imageByURL",{NAME:"link"}),ye.FE.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(e){this.image.refreshByURLButton(e)}}),ye.FE.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(e){this.image.get()?e.text(this.language.translate("Replace")):e.text(this.language.translate("Insert"))}}),ye.FE.DefineIcon("imageDisplay",{NAME:"star"}),ye.FE.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.image.display(t)},refresh:function(e){this.opts.imageTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.image.refreshDisplayOnShow(e,t)}}),ye.FE.DefineIcon("image-align",{NAME:"align-left"}),ye.FE.DefineIcon("image-align-left",{NAME:"align-left"}),ye.FE.DefineIcon("image-align-right",{NAME:"align-right"}),ye.FE.DefineIcon("image-align-center",{NAME:"align-justify"}),ye.FE.DefineIcon("imageAlign",{NAME:"align-justify"}),ye.FE.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.FE.COMMANDS.imageAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="imageAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("image-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.image.align(t)},refresh:function(e){this.image.refreshAlign(e)},refreshOnShow:function(e,t){this.image.refreshAlignOnShow(e,t)}}),ye.FE.DefineIcon("imageReplace",{NAME:"exchange",FA5NAME:"exchange-alt"}),ye.FE.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),ye.FE.DefineIcon("imageRemove",{NAME:"trash"}),ye.FE.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),ye.FE.DefineIcon("imageBack",{NAME:"arrow-left"}),ye.FE.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(e){this.image.get()||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),ye.FE.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),ye.FE.DefineIcon("imageStyle",{NAME:"magic"}),ye.FE.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.imageStyles;for(var a in t)if(t.hasOwnProperty(a)){var i=t[a];"object"==typeof i&&(i=i.title),e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+a+'">'+this.language.translate(i)+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.image.applyStyle(t)},refreshOnShow:function(e,t){var a=this.image.getEl();a&&t.find(".fr-command").each(function(){var e=ye(this).data("param1"),t=a.hasClass(e);ye(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),ye.FE.DefineIcon("imageAlt",{NAME:"info"}),ye.FE.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternative Text",callback:function(){this.image.showAltPopup()}}),ye.FE.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),ye.FE.DefineIcon("imageSize",{NAME:"arrows-alt"}),ye.FE.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),ye.FE.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),ye.FE.DefineIcon("imageCaption",{NAME:"commenting",FA5NAME:"comment-alt"}),ye.FE.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(e){this.image.get()&&e.toggleClass("fr-active",this.image.hasCaption())}})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,a){return a===undefined&&(a="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(a)}:t(window.jQuery)}(function(O){if(O.extend(O.FE.DEFAULTS,{imageManagerLoadURL:"https://i.froala.com/load-files",imageManagerLoadMethod:"get",imageManagerLoadParams:{},imageManagerPreloader:null,imageManagerDeleteURL:"",imageManagerDeleteMethod:"post",imageManagerDeleteParams:{},imageManagerPageSize:12,imageManagerScrollOffset:20,imageManagerToggleTags:!0}),O.FE.PLUGINS.imageManager=function(o){var g,l,r,i,n,d,s,f,m,u,c,h="image_manager",e=10,p=11,v=12,M=13,w=14,b=15,C=21,L=22,t={};function y(){var e=O(window).outerWidth();return e<768?2:e<1200?3:4}function D(){n.empty();for(var e=0;e<c;e++)n.append('<div class="fr-list-column"></div>')}function I(){if(m<s.length&&(n.outerHeight()<=r.outerHeight()+o.opts.imageManagerScrollOffset||r.scrollTop()+o.opts.imageManagerScrollOffset>n.outerHeight()-r.outerHeight())){f++;for(var e=o.opts.imageManagerPageSize*(f-1);e<Math.min(s.length,o.opts.imageManagerPageSize*f);e++)a(s[e])}}function a(i){var n=new Image,s=O('<div class="fr-image-container fr-empty fr-image-'+u+++'" data-loading="'+o.language.translate("Loading")+'.." data-deleting="'+o.language.translate("Deleting")+'..">');T(!1),n.onload=function(){s.height(Math.floor(s.width()/n.width*n.height));var t=O("<img/>");if(i.thumb)t.attr("src",i.thumb);else{if(U(w,i),!i.url)return U(b,i),!1;t.attr("src",i.url)}if(i.url&&t.attr("data-url",i.url),i.tag)if(l.find(".fr-modal-more.fr-not-available").removeClass("fr-not-available"),l.find(".fr-modal-tags").show(),0<=i.tag.indexOf(",")){for(var e=i.tag.split(","),a=0;a<e.length;a++)e[a]=e[a].trim(),0===d.find('a[title="'+e[a]+'"]').length&&d.append('<a role="button" title="'+e[a]+'">'+e[a]+"</a>");t.attr("data-tag",e.join())}else 0===d.find('a[title="'+i.tag.trim()+'"]').length&&d.append('<a role="button" title="'+i.tag.trim()+'">'+i.tag.trim()+"</a>"),t.attr("data-tag",i.tag.trim());for(var r in i.name&&t.attr("alt",i.name),i)i.hasOwnProperty(r)&&"thumb"!=r&&"url"!=r&&"tag"!=r&&t.attr("data-"+r,i[r]);s.append(t).append(O(o.icon.create("imageManagerDelete")).addClass("fr-delete-img").attr("title",o.language.translate("Delete"))).append(O(o.icon.create("imageManagerInsert")).addClass("fr-insert-img").attr("title",o.language.translate("Insert"))),d.find(".fr-selected-tag").each(function(e,a){k(t,a.text)||s.hide()}),t.on("load",function(){s.removeClass("fr-empty"),s.height("auto"),m++,E(x(parseInt(t.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1)),T(!1),m%o.opts.imageManagerPageSize==0&&I()}),o.events.trigger("imageManager.imageLoaded",[t])},n.onerror=function(){m++,s.remove(),E(x(parseInt(s.attr("class").match(/fr-image-(\d+)/)[1],10)+1)),U(e,i),m%o.opts.imageManagerPageSize==0&&I()},n.src=i.thumb||i.url,P().append(s)}function P(){var r,i;return n.find(".fr-list-column").each(function(e,a){var t=O(a);0===e?(i=t.outerHeight(),r=t):t.outerHeight()<i&&(i=t.outerHeight(),r=t)}),r}function x(e){e===undefined&&(e=0);for(var a=[],t=u-1;e<=t;t--){var r=n.find(".fr-image-"+t);r.length&&(a.push(r),O('<div id="fr-image-hidden-container">').append(r),n.find(".fr-image-"+t).remove())}return a}function E(e){for(var a=e.length-1;0<=a;a--)P().append(e[a])}function T(e){if(e===undefined&&(e=!0),!g.is(":visible"))return!0;var a=y();if(a!=c){c=a;var t=x();D(),E(t)}o.modals.resize(h),e&&I()}function q(e){var a={},t=e.data();for(var r in t)t.hasOwnProperty(r)&&"url"!=r&&"tag"!=r&&(a[r]=t[r]);return a}function S(e){var a=O(e.currentTarget).siblings("img"),t=g.data("instance")||o,r=g.data("current-image");if(o.modals.hide(h),t.image.showProgressBar(),r)r.data("fr-old-src",r.attr("src")),r.trigger("click");else{t.events.focus(!0),t.selection.restore();var i=t.position.getBoundingRect(),n=i.left+i.width/2+O(o.doc).scrollLeft(),s=i.top+i.height+O(o.doc).scrollTop();t.popups.setContainer("image.insert",o.$sc),t.popups.show("image.insert",n,s)}t.image.insert(a.data("url"),!1,q(a),r)}function R(e){var t=O(e.currentTarget).siblings("img"),a=o.language.translate("Are you sure? Image will be deleted.");confirm(a)&&(o.opts.imageManagerDeleteURL?!1!==o.events.trigger("imageManager.beforeDeleteImage",[t])&&(t.parent().addClass("fr-image-deleting"),O.ajax({method:o.opts.imageManagerDeleteMethod,url:o.opts.imageManagerDeleteURL,data:O.extend(O.extend({src:t.attr("src")},q(t)),o.opts.imageManagerDeleteParams),crossDomain:o.opts.requestWithCORS,xhrFields:{withCredentials:o.opts.requestWithCredentials},headers:o.opts.requestHeaders}).done(function(e){o.events.trigger("imageManager.imageDeleted",[e]);var a=x(parseInt(t.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1);t.parent().remove(),E(a),g.find("#fr-modal-tags > a").each(function(){0===g.find('#fr-image-list [data-tag*="'+O(this).text()+'"]').length&&O(this).removeClass("fr-selected-tag").hide()}),H(),T(!0)}).fail(function(e){U(C,e.response||e.responseText)})):U(L))}function U(e,a){10<=e&&e<20?i.hide():20<=e&&e<30&&O(".fr-image-deleting").removeClass("fr-image-deleting"),o.events.trigger("imageManager.error",[{code:e,message:t[e]},a])}function F(){var e=l.find(".fr-modal-head-line").outerHeight(),a=d.outerHeight();l.toggleClass("fr-show-tags"),l.hasClass("fr-show-tags")?(l.css("height",e+a),d.find("a").css("opacity",1)):(l.css("height",e),d.find("a").css("opacity",0))}function H(){var e=d.find(".fr-selected-tag");0<e.length?(n.find("img").parent().show(),e.each(function(e,r){n.find("img").each(function(e,a){var t=O(a);k(t,r.text)||t.parent().hide()})})):n.find("img").parent().show(),E(x()),I()}function j(e){e.preventDefault();var a=O(e.currentTarget);a.toggleClass("fr-selected-tag"),o.opts.imageManagerToggleTags&&a.siblings("a").removeClass("fr-selected-tag"),H()}function k(e,a){for(var t=(e.attr("data-tag")||"").split(","),r=0;r<t.length;r++)if(t[r]==a)return!0;return!1}return t[e]="Image cannot be loaded from the passed link.",t[p]="Error during load images request.",t[v]="Missing imageManagerLoadURL option.",t[M]="Parsing load response failed.",t[w]="Missing image thumb.",t[b]="Missing image URL.",t[C]="Error during delete image request.",t[L]="Missing imageManagerDeleteURL option.",{require:["image"],_init:function(){if(!o.$wp&&"IMG"!=o.el.tagName)return!1},show:function(){if(!g){var e,a='<div class="fr-modal-head-line"><i class="fa fa-bars fr-modal-more fr-not-available" id="fr-modal-more-'+o.sid+'" title="'+o.language.translate("Tags")+'"></i><h4 data-text="true">'+o.language.translate("Manage Images")+"</h4></div>";a+='<div class="fr-modal-tags" id="fr-modal-tags"></div>',e=o.opts.imageManagerPreloader?'<img class="fr-preloader" id="fr-preloader" alt="'+o.language.translate("Loading")+'.." src="'+o.opts.imageManagerPreloader+'" style="display: none;">':'<span class="fr-preloader" id="fr-preloader" style="display: none;">'+o.language.translate("Loading")+"</span>",e+='<div class="fr-image-list" id="fr-image-list"></div>';var t=o.modals.create(h,a,e);g=t.$modal,l=t.$head,r=t.$body}g.data("current-image",o.image.get()),o.modals.show(h),i||(i=g.find("#fr-preloader"),n=g.find("#fr-image-list"),d=g.find("#fr-modal-tags"),c=y(),D(),l.css("height",l.find(".fr-modal-head-line").outerHeight()),o.events.$on(O(o.o_win),"resize",function(){T(!!s)}),o.helpers.isMobile()&&(o.events.bindClick(n,"div.fr-image-container",function(e){g.find(".fr-mobile-selected").removeClass("fr-mobile-selected"),O(e.currentTarget).addClass("fr-mobile-selected")}),g.on(o._mousedown,function(){g.find(".fr-mobile-selected").removeClass("fr-mobile-selected")})),o.events.bindClick(n,".fr-insert-img",S),o.events.bindClick(n,".fr-delete-img",R),g.on(o._mousedown+" "+o._mouseup,function(e){e.stopPropagation()}),g.on(o._mousedown,"*",function(){o.events.disableBlur()}),r.on("scroll",I),o.events.bindClick(g,"#fr-modal-more-"+o.sid,F),o.events.bindClick(d,"a",j)),i.show(),n.find(".fr-list-column").empty(),o.opts.imageManagerLoadURL?O.ajax({url:o.opts.imageManagerLoadURL,method:o.opts.imageManagerLoadMethod,data:o.opts.imageManagerLoadParams,dataType:"json",crossDomain:o.opts.requestWithCORS,xhrFields:{withCredentials:o.opts.requestWithCredentials},headers:o.opts.requestHeaders}).done(function(e,a,t){o.events.trigger("imageManager.imagesLoaded",[e]),function(e,a){try{n.find(".fr-list-column").empty(),u=m=f=0,s=e,I()}catch(t){U(M,a)}}(e,t.response),i.hide()}).fail(function(){var e=this.xhr();U(p,e.response||e.responseText)}):U(v)},hide:function(){o.modals.hide(h)}}},!O.FE.PLUGINS.image)throw new Error("Image manager plugin requires image plugin.");O.FE.DEFAULTS.imageInsertButtons.push("imageManager"),O.FE.RegisterCommand("imageManager",{title:"Browse",undo:!1,focus:!1,modal:!0,callback:function(){this.imageManager.show()},plugin:"imageManager"}),O.FE.DefineIcon("imageManager",{NAME:"folder"}),O.FE.DefineIcon("imageManagerInsert",{NAME:"plus"}),O.FE.DefineIcon("imageManagerDelete",{NAME:"trash"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(n,e){return e===undefined&&(e="undefined"!=typeof window?require("jquery"):require("jquery")(n)),i(e)}:i(window.jQuery)}(function(s){s.extend(s.FE.DEFAULTS,{inlineClasses:{"fr-class-code":"Code","fr-class-highlighted":"Highlighted","fr-class-transparency":"Transparent"}}),s.FE.PLUGINS.inlineClass=function(i){return{apply:function(n){i.format.toggle("span",{"class":n})},refreshOnShow:function(n,e){e.find(".fr-command").each(function(){var n=s(this).data("param1"),e=i.format.is("span",{"class":n});s(this).toggleClass("fr-active",e).attr("aria-selected",e)})}}},s.FE.RegisterCommand("inlineClass",{type:"dropdown",title:"Inline Class",html:function(){var n='<ul class="fr-dropdown-list" role="presentation">',e=this.opts.inlineClasses;for(var i in e)e.hasOwnProperty(i)&&(n+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="inlineClass" data-param1="'+i+'" title="'+e[i]+'">'+e[i]+"</a></li>");return n+="</ul>"},callback:function(n,e){this.inlineClass.apply(e)},refreshOnShow:function(n,e){this.inlineClass.refreshOnShow(n,e)},plugin:"inlineClass"}),s.FE.DefineIcon("inlineClass",{NAME:"tag"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,n){return n===undefined&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(n)}:t(window.jQuery)}(function(o){o.extend(o.FE.DEFAULTS,{inlineStyles:{"Big Red":"font-size: 20px; color: red;","Small Blue":"font-size: 14px; color: blue;"}}),o.FE.PLUGINS.inlineStyle=function(l){return{apply:function(e){if(""!==l.selection.text())for(var n=e.split(";"),t=0;t<n.length;t++){var i=n[t].split(":");n[t].length&&2==i.length&&l.format.applyStyle(i[0].trim(),i[1].trim())}else l.html.insert('<span style="'+e+'">'+o.FE.INVISIBLE_SPACE+o.FE.MARKERS+"</span>")}}},o.FE.RegisterCommand("inlineStyle",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',n=this.opts.inlineStyles;for(var t in n){if(n.hasOwnProperty(t))e+='<li role="presentation"><span style="'+(n[t]+(-1===n[t].indexOf("display:block;")?" display:block;":""))+'" role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="inlineStyle" data-param1="'+n[t]+'" title="'+this.language.translate(t)+'">'+this.language.translate(t)+"</a></span></li>"}return e+="</ul>"},title:"Inline Style",callback:function(e,n){this.inlineStyle.apply(n)},plugin:"inlineStyle"}),o.FE.DefineIcon("inlineStyle",{NAME:"paint-brush"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
7
|
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(v){v.extend(v.FE.DEFAULTS,{lineBreakerTags:["table","hr","form","dl","span.fr-video",".fr-embedly"],lineBreakerOffset:15,lineBreakerHorizontalOffset:10}),v.FE.PLUGINS.lineBreaker=function(d){var g,t,a;function s(e,t){var n,r,a,o,i,s,f,l;if(null==e)i=(o=t.parent()).offset().top,n=(f=t.offset().top)-Math.min((f-i)/2,d.opts.lineBreakerOffset),a=o.outerWidth(),r=o.offset().left;else if(null==t)(s=(o=e.parent()).offset().top+o.outerHeight())<(l=e.offset().top+e.outerHeight())&&(s=(o=v(o).parent()).offset().top+o.outerHeight()),n=l+Math.min(Math.abs(s-l)/2,d.opts.lineBreakerOffset),a=o.outerWidth(),r=o.offset().left;else{o=e.parent();var p=e.offset().top+e.height(),u=t.offset().top;if(u<p)return!1;n=(p+u)/2,a=o.outerWidth(),r=o.offset().left}d.opts.iframe&&(r+=d.$iframe.offset().left-d.helpers.scrollLeft(),n+=d.$iframe.offset().top-d.helpers.scrollTop()),d.$box.append(g),g.css("top",n-d.win.pageYOffset),g.css("left",r-d.win.pageXOffset),g.css("width",a),g.data("tag1",e),g.data("tag2",t),g.addClass("fr-visible").data("instance",d)}function f(e){if(e){var t=v(e);if(0===d.$el.find(t).length)return null;if(e.nodeType!=Node.TEXT_NODE&&t.is(d.opts.lineBreakerTags.join(",")))return t;if(0<t.parents(d.opts.lineBreakerTags.join(",")).length)return e=t.parents(d.opts.lineBreakerTags.join(",")).get(0),0!==d.$el.find(e).length&&v(e).is(d.opts.lineBreakerTags.join(","))?v(e):null}return null}function o(e,t){var n=d.doc.elementFromPoint(e,t);return n&&!v(n).closest(".fr-line-breaker").length&&!d.node.isElement(n)&&n!=d.$wp.get(0)&&function(e){if("undefined"!=typeof e.inFroalaWrapper)return e.inFroalaWrapper;for(var t=e;e.parentNode&&e.parentNode!==d.$wp.get(0);)e=e.parentNode;return t.inFroalaWrapper=e.parentNode==d.$wp.get(0),t.inFroalaWrapper}(n)?n:null}function i(e,t,n){for(var r=n,a=null;r<=d.opts.lineBreakerOffset&&!a;)(a=o(e,t-r))||(a=o(e,t+r)),r+=n;return a}function l(e,t,n){for(var r=null,a=100;!r&&e>d.$box.offset().left&&e<d.$box.offset().left+d.$box.outerWidth()&&0<a;)(r=o(e,t))||(r=i(e,t,5)),"left"==n?e-=d.opts.lineBreakerHorizontalOffset:e+=d.opts.lineBreakerHorizontalOffset,a-=d.opts.lineBreakerHorizontalOffset;return r}function n(e){var t=a=null,n=null,r=d.doc.elementFromPoint(e.pageX-d.win.pageXOffset,e.pageY-d.win.pageYOffset);r&&("HTML"==r.tagName||"BODY"==r.tagName||d.node.isElement(r)||0<=(r.getAttribute("class")||"").indexOf("fr-line-breaker"))?((n=i(e.pageX-d.win.pageXOffset,e.pageY-d.win.pageYOffset,1))||(n=l(e.pageX-d.win.pageXOffset-d.opts.lineBreakerHorizontalOffset,e.pageY-d.win.pageYOffset,"left")),n||(n=l(e.pageX-d.win.pageXOffset+d.opts.lineBreakerHorizontalOffset,e.pageY-d.win.pageYOffset,"right")),t=f(n)):t=f(r),t?function(e,t){var n,r,a=e.offset().top,o=e.offset().top+e.outerHeight();if(Math.abs(o-t)<=d.opts.lineBreakerOffset||Math.abs(t-a)<=d.opts.lineBreakerOffset)if(Math.abs(o-t)<Math.abs(t-a)){for(var i=(r=e.get(0)).nextSibling;i&&i.nodeType==Node.TEXT_NODE&&0===i.textContent.length;)i=i.nextSibling;if(!i)return s(e,null);if(n=f(i))return s(e,n)}else{if(!(r=e.get(0)).previousSibling)return s(null,e);if(n=f(r.previousSibling))return s(n,e)}g.removeClass("fr-visible").removeData("instance")}(t,e.pageY):d.core.sameInstance(g)&&g.removeClass("fr-visible").removeData("instance")}function e(e){return!(g.hasClass("fr-visible")&&!d.core.sameInstance(g))&&(d.popups.areVisible()||d.el.querySelector(".fr-selected-cell")?(g.removeClass("fr-visible"),!0):void(!1!==t||d.edit.isDisabled()||(a&&clearTimeout(a),a=setTimeout(n,30,e))))}function r(){a&&clearTimeout(a),g&&g.hasClass("fr-visible")&&g.removeClass("fr-visible").removeData("instance")}function p(){t=!0,r()}function u(){t=!1}function c(e){e.preventDefault();var t=g.data("instance")||d;g.removeClass("fr-visible").removeData("instance");var n=g.data("tag1"),r=g.data("tag2"),a=d.html.defaultTag();null==n?a&&"TD"!=r.parent().get(0).tagName&&0===r.parents(a).length?r.before("<"+a+">"+v.FE.MARKERS+"<br></"+a+">"):r.before(v.FE.MARKERS+"<br>"):a&&"TD"!=n.parent().get(0).tagName&&0===n.parents(a).length?n.after("<"+a+">"+v.FE.MARKERS+"<br></"+a+">"):n.after(v.FE.MARKERS+"<br>"),t.selection.restore()}return{_init:function(){if(!d.$wp)return!1;d.shared.$line_breaker||(d.shared.$line_breaker=v('<div class="fr-line-breaker"><a class="fr-floating-btn" role="button" tabIndex="-1" title="'+d.language.translate("Break")+'"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect x="21" y="11" width="2" height="8"/><rect x="14" y="17" width="7" height="2"/><path d="M14.000,14.000 L14.000,22.013 L9.000,18.031 L14.000,14.000 Z"/></svg></a></div>')),g=d.shared.$line_breaker,d.events.on("shared.destroy",function(){g.html("").removeData().remove(),g=null},!0),d.events.on("destroy",function(){g.removeData("instance").removeClass("fr-visible").appendTo("body:first"),clearTimeout(a)},!0),d.events.$on(g,"mousemove",function(e){e.stopPropagation()},!0),d.events.bindClick(g,"a",c),t=!1,d.events.$on(d.$win,"mousemove",e),d.events.$on(v(d.win),"scroll",r),d.events.on("popups.show.table.edit",r),d.events.on("commands.after",r),d.events.$on(v(d.win),"mousedown",p),d.events.$on(v(d.win),"mouseup",u)}}}});
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(v){v.extend(v.FE.DEFAULTS,{lineBreakerTags:["table","hr","form","dl","span.fr-video",".fr-embedly","img"],lineBreakerOffset:15,lineBreakerHorizontalOffset:10}),v.FE.PLUGINS.lineBreaker=function(d){var g,t,a;function s(e,t){var n,r,a,o,i,s,f,l;if(null==e)i=(o=t.parent()).offset().top,n=(f=t.offset().top)-Math.min((f-i)/2,d.opts.lineBreakerOffset),a=o.outerWidth(),r=o.offset().left;else if(null==t)(s=(o=e.parent()).offset().top+o.outerHeight())<(l=e.offset().top+e.outerHeight())&&(s=(o=v(o).parent()).offset().top+o.outerHeight()),n=l+Math.min(Math.abs(s-l)/2,d.opts.lineBreakerOffset),a=o.outerWidth(),r=o.offset().left;else{o=e.parent();var p=e.offset().top+e.height(),u=t.offset().top;if(u<p)return!1;n=(p+u)/2,a=o.outerWidth(),r=o.offset().left}d.opts.iframe&&(r+=d.$iframe.offset().left-d.helpers.scrollLeft(),n+=d.$iframe.offset().top-d.helpers.scrollTop()),d.$box.append(g),g.css("top",n-d.win.pageYOffset),g.css("left",r-d.win.pageXOffset),g.css("width",a),g.data("tag1",e),g.data("tag2",t),g.addClass("fr-visible").data("instance",d)}function f(e){if(e){var t=v(e);if(0===d.$el.find(t).length)return null;if(e.nodeType!=Node.TEXT_NODE&&t.is(d.opts.lineBreakerTags.join(",")))return t;if(0<t.parents(d.opts.lineBreakerTags.join(",")).length)return e=t.parents(d.opts.lineBreakerTags.join(",")).get(0),0!==d.$el.find(e).length&&v(e).is(d.opts.lineBreakerTags.join(","))?v(e):null}return null}function o(e,t){var n=d.doc.elementFromPoint(e,t);return n&&!v(n).closest(".fr-line-breaker").length&&!d.node.isElement(n)&&n!=d.$wp.get(0)&&function(e){if("undefined"!=typeof e.inFroalaWrapper)return e.inFroalaWrapper;for(var t=e;e.parentNode&&e.parentNode!==d.$wp.get(0);)e=e.parentNode;return t.inFroalaWrapper=e.parentNode==d.$wp.get(0),t.inFroalaWrapper}(n)?n:null}function i(e,t,n){for(var r=n,a=null;r<=d.opts.lineBreakerOffset&&!a;)(a=o(e,t-r))||(a=o(e,t+r)),r+=n;return a}function l(e,t,n){for(var r=null,a=100;!r&&e>d.$box.offset().left&&e<d.$box.offset().left+d.$box.outerWidth()&&0<a;)(r=o(e,t))||(r=i(e,t,5)),"left"==n?e-=d.opts.lineBreakerHorizontalOffset:e+=d.opts.lineBreakerHorizontalOffset,a-=d.opts.lineBreakerHorizontalOffset;return r}function n(e){var t=a=null,n=null,r=d.doc.elementFromPoint(e.pageX-d.win.pageXOffset,e.pageY-d.win.pageYOffset);r&&("HTML"==r.tagName||"BODY"==r.tagName||d.node.isElement(r)||0<=(r.getAttribute("class")||"").indexOf("fr-line-breaker"))?((n=i(e.pageX-d.win.pageXOffset,e.pageY-d.win.pageYOffset,1))||(n=l(e.pageX-d.win.pageXOffset-d.opts.lineBreakerHorizontalOffset,e.pageY-d.win.pageYOffset,"left")),n||(n=l(e.pageX-d.win.pageXOffset+d.opts.lineBreakerHorizontalOffset,e.pageY-d.win.pageYOffset,"right")),t=f(n)):t=f(r),t?function(e,t){var n,r,a=e.offset().top,o=e.offset().top+e.outerHeight();if(Math.abs(o-t)<=d.opts.lineBreakerOffset||Math.abs(t-a)<=d.opts.lineBreakerOffset)if(Math.abs(o-t)<Math.abs(t-a)){for(var i=(r=e.get(0)).nextSibling;i&&i.nodeType==Node.TEXT_NODE&&0===i.textContent.length;)i=i.nextSibling;if(!i)return s(e,null);if(n=f(i))return s(e,n)}else{if(!(r=e.get(0)).previousSibling)return s(null,e);if(n=f(r.previousSibling))return s(n,e)}g.removeClass("fr-visible").removeData("instance")}(t,e.pageY):d.core.sameInstance(g)&&g.removeClass("fr-visible").removeData("instance")}function e(e){return!(g.hasClass("fr-visible")&&!d.core.sameInstance(g))&&(d.popups.areVisible()||d.el.querySelector(".fr-selected-cell")?(g.removeClass("fr-visible"),!0):void(!1!==t||d.edit.isDisabled()||(a&&clearTimeout(a),a=setTimeout(n,30,e))))}function r(){a&&clearTimeout(a),g&&g.hasClass("fr-visible")&&g.removeClass("fr-visible").removeData("instance")}function p(){t=!0,r()}function u(){t=!1}function c(e){e.preventDefault();var t=g.data("instance")||d;g.removeClass("fr-visible").removeData("instance");var n=g.data("tag1"),r=g.data("tag2"),a=d.html.defaultTag();null==n?a&&"TD"!=r.parent().get(0).tagName&&0===r.parents(a).length?r.before("<"+a+">"+v.FE.MARKERS+"<br></"+a+">"):r.before(v.FE.MARKERS+"<br>"):a&&"TD"!=n.parent().get(0).tagName&&0===n.parents(a).length?n.after("<"+a+">"+v.FE.MARKERS+"<br></"+a+">"):n.after(v.FE.MARKERS+"<br>"),t.selection.restore()}return{_init:function(){if(!d.$wp)return!1;d.shared.$line_breaker||(d.shared.$line_breaker=v('<div class="fr-line-breaker"><a class="fr-floating-btn" role="button" tabIndex="-1" title="'+d.language.translate("Break")+'"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect x="21" y="11" width="2" height="8"/><rect x="14" y="17" width="7" height="2"/><path d="M14.000,14.000 L14.000,22.013 L9.000,18.031 L14.000,14.000 Z"/></svg></a></div>')),g=d.shared.$line_breaker,d.events.on("shared.destroy",function(){g.html("").removeData().remove(),g=null},!0),d.events.on("destroy",function(){g.removeData("instance").removeClass("fr-visible").appendTo("body:first"),clearTimeout(a)},!0),d.events.$on(g,"mousemove",function(e){e.stopPropagation()},!0),d.events.bindClick(g,"a",c),t=!1,d.events.$on(d.$win,"mousemove",e),d.events.$on(v(d.win),"scroll",r),d.events.on("popups.show.table.edit",r),d.events.on("commands.after",r),d.events.$on(v(d.win),"mousedown",p),d.events.$on(v(d.win),"mouseup",u)}}}});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
7
|
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(l){l.extend(l.FE.DEFAULTS,{lineHeights:{Default:"",Single:"1",1.15:"1.15",1.5:"1.5",Double:"2"}}),l.FE.PLUGINS.lineHeight=function(r){return{_init:function(){},apply:function(e){r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore();var t=r.selection.blocks();t.length&&l(t[0]).parent().is("td")&&r.format.applyStyle("line-height",e.toString()),r.selection.save();for(var n=0;n<t.length;n++)l(t[n]).css("line-height",e),""===l(t[n]).attr("style")&&l(t[n]).removeAttr("style");r.html.unwrap(),r.selection.restore()},refreshOnShow:function(e,t){var n=r.selection.blocks();if(n.length){var i=l(n[0]);t.find(".fr-command").each(function(){var e=l(this).data("param1"),t=0<=(i.attr("style")||"").indexOf("line-height: "+e+";");l(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}}},l.FE.RegisterCommand("lineHeight",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.lineHeights;for(var n in t)t.hasOwnProperty(n)&&(e+='<li role="presentation"><a class="fr-command '+n+'" tabIndex="-1" role="option" data-cmd="lineHeight" data-param1="'+t[n]+'" title="'+this.language.translate(n)+'">'+this.language.translate(n)+"</a></li>");return e+="</ul>"},title:"Line Height",callback:function(e,t){this.lineHeight.apply(t)},refreshOnShow:function(e,t){this.lineHeight.refreshOnShow(e,t)},plugin:"lineHeight"}),l.FE.DefineIcon("lineHeight",{NAME:"arrows-v",FA5NAME:"arrows-alt-v"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
7
|
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(m){m.extend(m.FE.POPUP_TEMPLATES,{"link.edit":"[_BUTTONS_]","link.insert":"[_BUTTONS_][_INPUT_LAYER_]"}),m.extend(m.FE.DEFAULTS,{linkEditButtons:["linkOpen","linkStyle","linkEdit","linkRemove"],linkInsertButtons:["linkBack","|","linkList"],linkAttributes:{},linkAutoPrefix:"http://",linkStyles:{"fr-green":"Green","fr-strong":"Thick"},linkMultipleStyles:!0,linkConvertEmailAddress:!0,linkAlwaysBlank:!1,linkAlwaysNoFollow:!1,linkNoOpener:!0,linkNoReferrer:!0,linkList:[{text:"Froala",href:"https://froala.com",target:"_blank"},{text:"Google",href:"https://google.com",target:"_blank"},{displayText:"Facebook",href:"https://facebook.com"}],linkText:!0}),m.FE.PLUGINS.link=function(d){function c(){var e=d.image?d.image.get():null;if(!e&&d.$wp){var t=d.selection.ranges(0).commonAncestorContainer;try{t&&(t.contains&&t.contains(d.el)||!d.el.contains(t)||d.el==t)&&(t=null)}catch(r){t=null}if(t&&"A"===t.tagName)return t;var n=d.selection.element(),i=d.selection.endElement();"A"==n.tagName||d.node.isElement(n)||(n=m(n).parentsUntil(d.$el,"a:first").get(0)),"A"==i.tagName||d.node.isElement(i)||(i=m(i).parentsUntil(d.$el,"a:first").get(0));try{i&&(i.contains&&i.contains(d.el)||!d.el.contains(i)||d.el==i)&&(i=null)}catch(r){i=null}try{n&&(n.contains&&n.contains(d.el)||!d.el.contains(n)||d.el==n)&&(n=null)}catch(r){n=null}return i&&i==n&&"A"==i.tagName?(d.browser.msie||d.helpers.isMobile())&&(d.selection.info(n).atEnd||d.selection.info(n).atStart)?null:n:null}return"A"==d.el.tagName?d.el:e&&e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?e.get(0).parentNode:void 0}function u(){var e,t,n,i,r=d.image?d.image.get():null,l=[];if(r)"A"==r.get(0).parentNode.tagName&&l.push(r.get(0).parentNode);else if(d.win.getSelection){var a=d.win.getSelection();if(a.getRangeAt&&a.rangeCount){i=d.doc.createRange();for(var s=0;s<a.rangeCount;++s)if((t=(e=a.getRangeAt(s)).commonAncestorContainer)&&1!=t.nodeType&&(t=t.parentNode),t&&"a"==t.nodeName.toLowerCase())l.push(t);else{n=t.getElementsByTagName("a");for(var o=0;o<n.length;++o)i.selectNodeContents(n[o]),i.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<i.compareBoundaryPoints(e.START_TO_END,e)&&l.push(n[o])}}}else if(d.doc.selection&&"Control"!=d.doc.selection.type)if("a"==(t=(e=d.doc.selection.createRange()).parentElement()).nodeName.toLowerCase())l.push(t);else{n=t.getElementsByTagName("a"),i=d.doc.body.createTextRange();for(var p=0;p<n.length;++p)i.moveToElementText(n[p]),-1<i.compareEndPoints("StartToEnd",e)&&i.compareEndPoints("EndToStart",e)<1&&l.push(n[p])}return l}function k(r){if(d.core.hasFocus()){if(a(),r&&"keyup"===r.type&&(r.altKey||r.which==m.FE.KEYCODE.ALT))return!0;setTimeout(function(){if(!r||r&&(1==r.which||"mouseup"!=r.type)){var e=c(),t=d.image?d.image.get():null;if(e&&!t){if(d.image){var n=d.node.contents(e);if(1==n.length&&"IMG"==n[0].tagName){var i=d.selection.ranges(0);return 0===i.startOffset&&0===i.endOffset?m(e).before(m.FE.MARKERS):m(e).after(m.FE.MARKERS),d.selection.restore(),!1}}r&&r.stopPropagation(),l(e)}}},d.helpers.isIOS()?100:0)}}function l(e){var t=d.popups.get("link.edit");t||(t=function(){var e="";1<=d.opts.linkEditButtons.length&&("A"==d.el.tagName&&0<=d.opts.linkEditButtons.indexOf("linkRemove")&&d.opts.linkEditButtons.splice(d.opts.linkEditButtons.indexOf("linkRemove"),1),e='<div class="fr-buttons">'+d.button.buildList(d.opts.linkEditButtons)+"</div>");var t={buttons:e},n=d.popups.create("link.edit",t);d.$wp&&d.events.$on(d.$wp,"scroll.link-edit",function(){c()&&d.popups.isVisible("link.edit")&&l(c())});return n}());var n=m(e);d.popups.isVisible("link.edit")||d.popups.refresh("link.edit"),d.popups.setContainer("link.edit",d.$sc);var i=n.offset().left+m(e).outerWidth()/2,r=n.offset().top+n.outerHeight();d.popups.show("link.edit",i,r,n.outerHeight())}function a(){d.popups.hide("link.edit")}function o(){}function p(){var e=d.popups.get("link.insert"),t=c();if(t){var n,i,r=m(t),l=e.find('input.fr-link-attr[type="text"]'),a=e.find('input.fr-link-attr[type="checkbox"]');for(n=0;n<l.length;n++)(i=m(l[n])).val(r.attr(i.attr("name")||""));for(a.prop("checked",!1),n=0;n<a.length;n++)i=m(a[n]),r.attr(i.attr("name"))==i.data("checked")&&i.prop("checked",!0);e.find('input.fr-link-attr[type="text"][name="text"]').val(r.text())}else e.find('input.fr-link-attr[type="text"]').val(""),e.find('input.fr-link-attr[type="checkbox"]').prop("checked",!1),e.find('input.fr-link-attr[type="text"][name="text"]').val(d.selection.text());e.find("input.fr-link-attr").trigger("change"),(d.image?d.image.get():null)?e.find('.fr-link-attr[name="text"]').parent().hide():e.find('.fr-link-attr[name="text"]').parent().show()}function s(e){if(e)return d.popups.onRefresh("link.insert",p),d.popups.onHide("link.insert",o),!0;var t="";1<=d.opts.linkInsertButtons.length&&(t='<div class="fr-buttons">'+d.button.buildList(d.opts.linkInsertButtons)+"</div>");var n="",i=0;for(var r in n='<div class="fr-link-insert-layer fr-layer fr-active" id="fr-link-insert-layer-'+d.id+'">',n+='<div class="fr-input-line"><input id="fr-link-insert-layer-url-'+d.id+'" name="href" type="text" class="fr-link-attr" placeholder="'+d.language.translate("URL")+'" tabIndex="'+ ++i+'"></div>',d.opts.linkText&&(n+='<div class="fr-input-line"><input id="fr-link-insert-layer-text-'+d.id+'" name="text" type="text" class="fr-link-attr" placeholder="'+d.language.translate("Text")+'" tabIndex="'+ ++i+'"></div>'),d.opts.linkAttributes)if(d.opts.linkAttributes.hasOwnProperty(r)){var l=d.opts.linkAttributes[r];n+='<div class="fr-input-line"><input name="'+r+'" type="text" class="fr-link-attr" placeholder="'+d.language.translate(l)+'" tabIndex="'+ ++i+'"></div>'}d.opts.linkAlwaysBlank||(n+='<div class="fr-checkbox-line"><span class="fr-checkbox"><input name="target" class="fr-link-attr" data-checked="_blank" type="checkbox" id="fr-link-target-'+d.id+'" tabIndex="'+ ++i+'"><span><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10" height="10" viewBox="0 0 32 32"><path d="M27 4l-15 15-7-7-5 5 12 12 20-20z" fill="#FFF"></path></svg></span></span><label for="fr-link-target-'+d.id+'">'+d.language.translate("Open in new tab")+"</label></div>");var a={buttons:t,input_layer:n+='<div class="fr-action-buttons"><button class="fr-command fr-submit" role="button" data-cmd="linkInsert" href="#" tabIndex="'+ ++i+'" type="button">'+d.language.translate("Insert")+"</button></div></div>"},s=d.popups.create("link.insert",a);return d.$wp&&d.events.$on(d.$wp,"scroll.link-insert",function(){(d.image?d.image.get():null)&&d.popups.isVisible("link.insert")&&h(),d.popups.isVisible("link.insert")&&g()}),s}function f(e,t,n){if(void 0===n&&(n={}),!1===d.events.trigger("link.beforeInsert",[e,t,n]))return!1;var i=d.image?d.image.get():null;i||"A"==d.el.tagName?"A"==d.el.tagName&&d.$el.focus():(d.selection.restore(),d.popups.hide("link.insert"));var r=e;d.opts.linkConvertEmailAddress&&d.helpers.isEmail(e)&&!/^mailto:.*/i.test(e)&&(e="mailto:"+e);if(""===d.opts.linkAutoPrefix||new RegExp("^("+m.FE.LinkProtocols.join("|")+"):.","i").test(e)||/^data:image.*/i.test(e)||/^(https?:|ftps?:|file:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||["/","{","[","#","(","."].indexOf((e||"")[0])<0&&(e=d.opts.linkAutoPrefix+d.helpers.sanitizeURL(e)),e=d.helpers.sanitizeURL(e),d.opts.linkAlwaysBlank&&(n.target="_blank"),d.opts.linkAlwaysNoFollow&&(n.rel="nofollow"),d.helpers.isEmail(r)&&(n.target=null,n.rel=null),"_blank"==n.target?(d.opts.linkNoOpener&&(n.rel?n.rel+=" noopener":n.rel="noopener"),d.opts.linkNoReferrer&&(n.rel?n.rel+=" noreferrer":n.rel="noreferrer")):null==n.target&&(n.rel?n.rel=n.rel.replace(/noopener/,"").replace(/noreferrer/,""):n.rel=null),t=t||"",e===d.opts.linkAutoPrefix)return d.popups.get("link.insert").find('input[name="href"]').addClass("fr-error"),d.events.trigger("link.bad",[r]),!1;var l,a=c();if(a){if((l=m(a)).attr("href",e),0<t.length&&l.text()!=t&&!i){for(var s=l.get(0);1===s.childNodes.length&&s.childNodes[0].nodeType==Node.ELEMENT_NODE;)s=s.childNodes[0];m(s).text(t)}i||l.prepend(m.FE.START_MARKER).append(m.FE.END_MARKER),l.attr(n),i||d.selection.restore()}else{i?(i.wrap('<a href="'+e+'"></a>'),d.image.hasCaption()&&i.parent().append(i.parents(".fr-img-caption").find(".fr-inner"))):(d.format.remove("a"),d.selection.isCollapsed()?(t=0===t.length?r:t,d.html.insert('<a href="'+e+'">'+m.FE.START_MARKER+t.replace(/&/g,"&").replace(/</,"<",">",">")+m.FE.END_MARKER+"</a>"),d.selection.restore()):0<t.length&&t!=d.selection.text().replace(/\n/g,"")?(d.selection.remove(),d.html.insert('<a href="'+e+'">'+m.FE.START_MARKER+t.replace(/&/g,"&")+m.FE.END_MARKER+"</a>"),d.selection.restore()):(!function(){if(!d.selection.isCollapsed()){d.selection.save();for(var e=d.$el.find(".fr-marker").addClass("fr-unprocessed").toArray();e.length;){var t=m(e.pop());t.removeClass("fr-unprocessed");var n=d.node.deepestParent(t.get(0));if(n){for(var i=t.get(0),r="",l="";i=i.parentNode,d.node.isBlock(i)||(r+=d.node.closeTagString(i),l=d.node.openTagString(i)+l),i!=n;);var a=d.node.openTagString(t.get(0))+t.html()+d.node.closeTagString(t.get(0));t.replaceWith('<span id="fr-break"></span>');var s=n.outerHTML;s=(s=s.replace(/<span id="fr-break"><\/span>/g,r+a+l)).replace(l+r,""),n.outerHTML=s}e=d.$el.find(".fr-marker.fr-unprocessed").toArray()}d.html.cleanEmptyTags(),d.selection.restore()}}(),d.format.apply("a",{href:e})));for(var o=u(),p=0;p<o.length;p++)(l=m(o[p])).attr(n),l.removeAttr("_moz_dirty");1==o.length&&d.$wp&&!i&&(m(o[0]).prepend(m.FE.START_MARKER).append(m.FE.END_MARKER),d.selection.restore())}if(i){var f=d.popups.get("link.insert");f&&f.find("input:focus").blur(),d.image.edit(i)}else k()}function g(){a();var e=c();if(e){var t=d.popups.get("link.insert");t||(t=s()),d.popups.isVisible("link.insert")||(d.popups.refresh("link.insert"),d.selection.save(),d.helpers.isMobile()&&(d.events.disableBlur(),d.$el.blur(),d.events.enableBlur())),d.popups.setContainer("link.insert",d.$sc);var n=(d.image?d.image.get():null)||m(e),i=n.offset().left+n.outerWidth()/2,r=n.offset().top+n.outerHeight();d.popups.show("link.insert",i,r,n.outerHeight())}}function h(){var e=d.image?d.image.getEl():null;if(e){var t=d.popups.get("link.insert");d.image.hasCaption()&&(e=e.find(".fr-img-wrap")),t||(t=s()),p(),d.popups.setContainer("link.insert",d.$sc);var n=e.offset().left+e.outerWidth()/2,i=e.offset().top+e.outerHeight();d.popups.show("link.insert",n,i,e.outerHeight())}}return{_init:function(){d.events.on("keyup",function(e){e.which!=m.FE.KEYCODE.ESC&&k(e)}),d.events.on("window.mouseup",k),d.events.$on(d.$el,"click","a",function(e){d.edit.isDisabled()&&e.preventDefault()}),d.helpers.isMobile()&&d.events.$on(d.$doc,"selectionchange",k),s(!0),"A"==d.el.tagName&&d.$el.addClass("fr-view"),d.events.on("toolbar.esc",function(){if(d.popups.isVisible("link.edit"))return d.events.disableBlur(),d.events.focus(),!1},!0)},remove:function(){var e=c(),t=d.image?d.image.get():null;if(!1===d.events.trigger("link.beforeRemove",[e]))return!1;t&&e?(t.unwrap(),d.image.edit(t)):e&&(d.selection.save(),m(e).replaceWith(m(e).html()),d.selection.restore(),a())},showInsertPopup:function(){var e=d.$tb.find('.fr-command[data-cmd="insertLink"]'),t=d.popups.get("link.insert");if(t||(t=s()),!t.hasClass("fr-active"))if(d.popups.refresh("link.insert"),d.popups.setContainer("link.insert",d.$tb||d.$sc),e.is(":visible")){var n=e.offset().left+e.outerWidth()/2,i=e.offset().top+(d.opts.toolbarBottom?10:e.outerHeight()-10);d.popups.show("link.insert",n,i,e.outerHeight())}else d.position.forSelection(t),d.popups.show("link.insert")},usePredefined:function(e){var t,n,i=d.opts.linkList[e],r=d.popups.get("link.insert"),l=r.find('input.fr-link-attr[type="text"]'),a=r.find('input.fr-link-attr[type="checkbox"]');for(n=0;n<l.length;n++)i[(t=m(l[n])).attr("name")]?t.val(i[t.attr("name")]):"text"!=t.attr("name")&&t.val("");for(n=0;n<a.length;n++)(t=m(a[n])).prop("checked",t.data("checked")==i[t.attr("name")]);d.accessibility.focusPopup(r)},insertCallback:function(){var e,t,n=d.popups.get("link.insert"),i=n.find('input.fr-link-attr[type="text"]'),r=n.find('input.fr-link-attr[type="checkbox"]'),l=(i.filter('[name="href"]').val()||"").trim(),a=i.filter('[name="text"]').val(),s={};for(t=0;t<i.length;t++)e=m(i[t]),["href","text"].indexOf(e.attr("name"))<0&&(s[e.attr("name")]=e.val());for(t=0;t<r.length;t++)(e=m(r[t])).is(":checked")?s[e.attr("name")]=e.data("checked"):s[e.attr("name")]=e.data("unchecked")||null;var o=d.helpers.scrollTop();f(l,a,s),m(d.o_win).scrollTop(o)},insert:f,update:g,get:c,allSelected:u,back:function(){d.image&&d.image.get()?d.image.back():(d.events.disableBlur(),d.selection.restore(),d.events.enableBlur(),c()&&d.$wp?(d.selection.restore(),a(),k()):"A"==d.el.tagName?(d.$el.focus(),k()):(d.popups.hide("link.insert"),d.toolbar.showInline()))},imageLink:h,applyStyle:function(e,t,n){void 0===n&&(n=d.opts.linkMultipleStyles),void 0===t&&(t=d.opts.linkStyles);var i=c();if(!i)return!1;if(!n){var r=Object.keys(t);r.splice(r.indexOf(e),1),m(i).removeClass(r.join(" "))}m(i).toggleClass(e),k()}}},m.FE.DefineIcon("insertLink",{NAME:"link"}),m.FE.RegisterShortcut(m.FE.KEYCODE.K,"insertLink",null,"K"),m.FE.RegisterCommand("insertLink",{title:"Insert Link",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("link.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("link.insert")):this.link.showInsertPopup()},plugin:"link"}),m.FE.DefineIcon("linkOpen",{NAME:"external-link",FA5NAME:"external-link-alt"}),m.FE.RegisterCommand("linkOpen",{title:"Open Link",undo:!1,refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},callback:function(){var e=this.link.get();e&&(-1!==e.href.indexOf("mailto:")?this.o_win.open(e.href).close():this.o_win.open(e.href,"_blank","noopener"),this.popups.hide("link.edit"))},plugin:"link"}),m.FE.DefineIcon("linkEdit",{NAME:"edit"}),m.FE.RegisterCommand("linkEdit",{title:"Edit Link",undo:!1,refreshAfterCallback:!1,popup:!0,callback:function(){this.link.update()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),m.FE.DefineIcon("linkRemove",{NAME:"unlink"}),m.FE.RegisterCommand("linkRemove",{title:"Unlink",callback:function(){this.link.remove()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),m.FE.DefineIcon("linkBack",{NAME:"arrow-left"}),m.FE.RegisterCommand("linkBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.link.back()},refresh:function(e){var t=this.link.get()&&this.doc.hasFocus();(this.image?this.image.get():null)||t||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))},plugin:"link"}),m.FE.DefineIcon("linkList",{NAME:"search"}),m.FE.RegisterCommand("linkList",{title:"Choose Link",type:"dropdown",focus:!1,undo:!1,refreshAfterCallback:!1,html:function(){for(var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkList,n=0;n<t.length;n++)e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkList" data-param1="'+n+'">'+(t[n].displayText||t[n].text)+"</a></li>";return e+="</ul>"},callback:function(e,t){this.link.usePredefined(t)},plugin:"link"}),m.FE.RegisterCommand("linkInsert",{focus:!1,refreshAfterCallback:!1,callback:function(){this.link.insertCallback()},refresh:function(e){this.link.get()?e.text(this.language.translate("Update")):e.text(this.language.translate("Insert"))},plugin:"link"}),m.FE.DefineIcon("imageLink",{NAME:"link"}),m.FE.RegisterCommand("imageLink",{title:"Insert Link",undo:!1,focus:!1,popup:!0,callback:function(){this.link.imageLink()},refresh:function(e){var t;this.link.get()?((t=e.prev()).hasClass("fr-separator")&&t.removeClass("fr-hidden"),e.addClass("fr-hidden")):((t=e.prev()).hasClass("fr-separator")&&t.addClass("fr-hidden"),e.removeClass("fr-hidden"))},plugin:"link"}),m.FE.DefineIcon("linkStyle",{NAME:"magic"}),m.FE.RegisterCommand("linkStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkStyles;for(var n in t)t.hasOwnProperty(n)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkStyle" data-param1="'+n+'">'+this.language.translate(t[n])+"</a></li>");return e+="</ul>"},callback:function(e,t){this.link.applyStyle(t)},refreshOnShow:function(e,t){var n=this.link.get();if(n){var i=m(n);t.find(".fr-command").each(function(){var e=m(this).data("param1"),t=i.hasClass(e);m(this).toggleClass("fr-active",t).attr("aria-selected",t)})}},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"})});
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(m){m.extend(m.FE.POPUP_TEMPLATES,{"link.edit":"[_BUTTONS_]","link.insert":"[_BUTTONS_][_INPUT_LAYER_]"}),m.extend(m.FE.DEFAULTS,{linkEditButtons:["linkOpen","linkStyle","linkEdit","linkRemove"],linkInsertButtons:["linkBack","|","linkList"],linkAttributes:{},linkAutoPrefix:"http://",linkStyles:{"fr-green":"Green","fr-strong":"Thick"},linkMultipleStyles:!0,linkConvertEmailAddress:!0,linkAlwaysBlank:!1,linkAlwaysNoFollow:!1,linkNoOpener:!0,linkNoReferrer:!0,linkList:[{text:"Froala",href:"https://froala.com",target:"_blank"},{text:"Google",href:"https://google.com",target:"_blank"},{displayText:"Facebook",href:"https://facebook.com"}],linkText:!0}),m.FE.PLUGINS.link=function(d){function c(){var e=d.image?d.image.get():null;if(!e&&d.$wp){var t=d.selection.ranges(0).commonAncestorContainer;try{t&&(t.contains&&t.contains(d.el)||!d.el.contains(t)||d.el==t)&&(t=null)}catch(r){t=null}if(t&&"A"===t.tagName)return t;var n=d.selection.element(),i=d.selection.endElement();"A"==n.tagName||d.node.isElement(n)||(n=m(n).parentsUntil(d.$el,"a:first").get(0)),"A"==i.tagName||d.node.isElement(i)||(i=m(i).parentsUntil(d.$el,"a:first").get(0));try{i&&(i.contains&&i.contains(d.el)||!d.el.contains(i)||d.el==i)&&(i=null)}catch(r){i=null}try{n&&(n.contains&&n.contains(d.el)||!d.el.contains(n)||d.el==n)&&(n=null)}catch(r){n=null}return i&&i==n&&"A"==i.tagName?(d.browser.msie||d.helpers.isMobile())&&(d.selection.info(n).atEnd||d.selection.info(n).atStart)?null:n:null}return"A"==d.el.tagName?d.el:e&&e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?e.get(0).parentNode:void 0}function u(){var e,t,n,i,r=d.image?d.image.get():null,l=[];if(r)"A"==r.get(0).parentNode.tagName&&l.push(r.get(0).parentNode);else if(d.win.getSelection){var a=d.win.getSelection();if(a.getRangeAt&&a.rangeCount){i=d.doc.createRange();for(var s=0;s<a.rangeCount;++s)if((t=(e=a.getRangeAt(s)).commonAncestorContainer)&&1!=t.nodeType&&(t=t.parentNode),t&&"a"==t.nodeName.toLowerCase())l.push(t);else{n=t.getElementsByTagName("a");for(var o=0;o<n.length;++o)i.selectNodeContents(n[o]),i.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<i.compareBoundaryPoints(e.START_TO_END,e)&&l.push(n[o])}}}else if(d.doc.selection&&"Control"!=d.doc.selection.type)if("a"==(t=(e=d.doc.selection.createRange()).parentElement()).nodeName.toLowerCase())l.push(t);else{n=t.getElementsByTagName("a"),i=d.doc.body.createTextRange();for(var p=0;p<n.length;++p)i.moveToElementText(n[p]),-1<i.compareEndPoints("StartToEnd",e)&&i.compareEndPoints("EndToStart",e)<1&&l.push(n[p])}return l}function k(r){if(d.core.hasFocus()){if(a(),r&&"keyup"===r.type&&(r.altKey||r.which==m.FE.KEYCODE.ALT))return!0;setTimeout(function(){if(!r||r&&(1==r.which||"mouseup"!=r.type)){var e=c(),t=d.image?d.image.get():null;if(e&&!t){if(d.image){var n=d.node.contents(e);if(1==n.length&&"IMG"==n[0].tagName){var i=d.selection.ranges(0);return 0===i.startOffset&&0===i.endOffset?m(e).before(m.FE.MARKERS):m(e).after(m.FE.MARKERS),d.selection.restore(),!1}}r&&r.stopPropagation(),l(e)}}},d.helpers.isIOS()?100:0)}}function l(e){var t=d.popups.get("link.edit");t||(t=function(){var e="";1<=d.opts.linkEditButtons.length&&("A"==d.el.tagName&&0<=d.opts.linkEditButtons.indexOf("linkRemove")&&d.opts.linkEditButtons.splice(d.opts.linkEditButtons.indexOf("linkRemove"),1),e='<div class="fr-buttons">'+d.button.buildList(d.opts.linkEditButtons)+"</div>");var t={buttons:e},n=d.popups.create("link.edit",t);d.$wp&&d.events.$on(d.$wp,"scroll.link-edit",function(){c()&&d.popups.isVisible("link.edit")&&l(c())});return n}());var n=m(e);d.popups.isVisible("link.edit")||d.popups.refresh("link.edit"),d.popups.setContainer("link.edit",d.$sc);var i=n.offset().left+m(e).outerWidth()/2,r=n.offset().top+n.outerHeight();d.popups.show("link.edit",i,r,n.outerHeight())}function a(){d.popups.hide("link.edit")}function o(){}function p(){var e=d.popups.get("link.insert"),t=c();if(t){var n,i,r=m(t),l=e.find('input.fr-link-attr[type="text"]'),a=e.find('input.fr-link-attr[type="checkbox"]');for(n=0;n<l.length;n++)(i=m(l[n])).val(r.attr(i.attr("name")||""));for(a.prop("checked",!1),n=0;n<a.length;n++)i=m(a[n]),r.attr(i.attr("name"))==i.data("checked")&&i.prop("checked",!0);e.find('input.fr-link-attr[type="text"][name="text"]').val(r.text())}else e.find('input.fr-link-attr[type="text"]').val(""),e.find('input.fr-link-attr[type="checkbox"]').prop("checked",!1),e.find('input.fr-link-attr[type="text"][name="text"]').val(d.selection.text());e.find("input.fr-link-attr").trigger("change"),(d.image?d.image.get():null)?e.find('.fr-link-attr[name="text"]').parent().hide():e.find('.fr-link-attr[name="text"]').parent().show()}function s(e){if(e)return d.popups.onRefresh("link.insert",p),d.popups.onHide("link.insert",o),!0;var t="";1<=d.opts.linkInsertButtons.length&&(t='<div class="fr-buttons">'+d.button.buildList(d.opts.linkInsertButtons)+"</div>");var n="",i=0;for(var r in n='<div class="fr-link-insert-layer fr-layer fr-active" id="fr-link-insert-layer-'+d.id+'">',n+='<div class="fr-input-line"><input id="fr-link-insert-layer-url-'+d.id+'" name="href" type="text" class="fr-link-attr" placeholder="'+d.language.translate("URL")+'" tabIndex="'+ ++i+'"></div>',d.opts.linkText&&(n+='<div class="fr-input-line"><input id="fr-link-insert-layer-text-'+d.id+'" name="text" type="text" class="fr-link-attr" placeholder="'+d.language.translate("Text")+'" tabIndex="'+ ++i+'"></div>'),d.opts.linkAttributes)if(d.opts.linkAttributes.hasOwnProperty(r)){var l=d.opts.linkAttributes[r];n+='<div class="fr-input-line"><input name="'+r+'" type="text" class="fr-link-attr" placeholder="'+d.language.translate(l)+'" tabIndex="'+ ++i+'"></div>'}d.opts.linkAlwaysBlank||(n+='<div class="fr-checkbox-line"><span class="fr-checkbox"><input name="target" class="fr-link-attr" data-checked="_blank" type="checkbox" id="fr-link-target-'+d.id+'" tabIndex="'+ ++i+'"><span><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10" height="10" viewBox="0 0 32 32"><path d="M27 4l-15 15-7-7-5 5 12 12 20-20z" fill="#FFF"></path></svg></span></span><label for="fr-link-target-'+d.id+'">'+d.language.translate("Open in new tab")+"</label></div>");var a={buttons:t,input_layer:n+='<div class="fr-action-buttons"><button class="fr-command fr-submit" role="button" data-cmd="linkInsert" href="#" tabIndex="'+ ++i+'" type="button">'+d.language.translate("Insert")+"</button></div></div>"},s=d.popups.create("link.insert",a);return d.$wp&&d.events.$on(d.$wp,"scroll.link-insert",function(){(d.image?d.image.get():null)&&d.popups.isVisible("link.insert")&&h(),d.popups.isVisible("link.insert")&&g()}),s}function f(e,t,n){if(void 0===n&&(n={}),!1===d.events.trigger("link.beforeInsert",[e,t,n]))return!1;var i=d.image?d.image.get():null;i||"A"==d.el.tagName?"A"==d.el.tagName&&d.$el.focus():(d.selection.restore(),d.popups.hide("link.insert"));var r=e;d.opts.linkConvertEmailAddress&&d.helpers.isEmail(e)&&!/^mailto:.*/i.test(e)&&(e="mailto:"+e);if(""===d.opts.linkAutoPrefix||new RegExp("^("+m.FE.LinkProtocols.join("|")+"):.","i").test(e)||/^data:image.*/i.test(e)||/^(https?:|ftps?:|file:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||["/","{","[","#","(","."].indexOf((e||"")[0])<0&&(e=d.opts.linkAutoPrefix+d.helpers.sanitizeURL(e)),e=d.helpers.sanitizeURL(e),d.opts.linkAlwaysBlank&&(n.target="_blank"),d.opts.linkAlwaysNoFollow&&(n.rel="nofollow"),d.helpers.isEmail(r)&&(n.target=null,n.rel=null),"_blank"==n.target?(d.opts.linkNoOpener&&(n.rel?n.rel+=" noopener":n.rel="noopener"),d.opts.linkNoReferrer&&(n.rel?n.rel+=" noreferrer":n.rel="noreferrer")):null==n.target&&(n.rel?n.rel=n.rel.replace(/noopener/,"").replace(/noreferrer/,""):n.rel=null),t=t||"",e===d.opts.linkAutoPrefix)return d.popups.get("link.insert").find('input[name="href"]').addClass("fr-error"),d.events.trigger("link.bad",[r]),!1;var l,a=c();if(a){if((l=m(a)).attr("href",e),0<t.length&&l.text()!=t&&!i){for(var s=l.get(0);1===s.childNodes.length&&s.childNodes[0].nodeType==Node.ELEMENT_NODE;)s=s.childNodes[0];m(s).text(t)}i||l.prepend(m.FE.START_MARKER).append(m.FE.END_MARKER),l.attr(n),i||d.selection.restore()}else{i?(i.wrap('<a href="'+e+'"></a>'),d.image.hasCaption()&&i.parent().append(i.parents(".fr-img-caption").find(".fr-inner"))):(d.format.remove("a"),d.selection.isCollapsed()?(t=0===t.length?r:t,d.html.insert('<a href="'+e+'">'+m.FE.START_MARKER+t.replace(/&/g,"&").replace(/</,"<",">",">")+m.FE.END_MARKER+"</a>"),d.selection.restore()):0<t.length&&t!=d.selection.text().replace(/\n/g,"")?(d.selection.remove(),d.html.insert('<a href="'+e+'">'+m.FE.START_MARKER+t.replace(/&/g,"&")+m.FE.END_MARKER+"</a>"),d.selection.restore()):(!function(){if(!d.selection.isCollapsed()){d.selection.save();for(var e=d.$el.find(".fr-marker").addClass("fr-unprocessed").toArray();e.length;){var t=m(e.pop());t.removeClass("fr-unprocessed");var n=d.node.deepestParent(t.get(0));if(n){for(var i=t.get(0),r="",l="";i=i.parentNode,d.node.isBlock(i)||(r+=d.node.closeTagString(i),l=d.node.openTagString(i)+l),i!=n;);var a=d.node.openTagString(t.get(0))+t.html()+d.node.closeTagString(t.get(0));t.replaceWith('<span id="fr-break"></span>');var s=n.outerHTML;s=(s=s.replace(/<span id="fr-break"><\/span>/g,r+a+l)).replace(l+r,""),n.outerHTML=s}e=d.$el.find(".fr-marker.fr-unprocessed").toArray()}d.html.cleanEmptyTags(),d.selection.restore()}}(),d.format.apply("a",{href:e})));for(var o=u(),p=0;p<o.length;p++)(l=m(o[p])).attr(n),l.removeAttr("_moz_dirty");1==o.length&&d.$wp&&!i&&(m(o[0]).prepend(m.FE.START_MARKER).append(m.FE.END_MARKER),d.selection.restore())}if(i){var f=d.popups.get("link.insert");f&&f.find("input:focus").blur(),d.image.edit(i)}else k()}function g(){a();var e=c();if(e){var t=d.popups.get("link.insert");t||(t=s()),d.popups.isVisible("link.insert")||(d.popups.refresh("link.insert"),d.selection.save(),d.helpers.isMobile()&&(d.events.disableBlur(),d.$el.blur(),d.events.enableBlur())),d.popups.setContainer("link.insert",d.$sc);var n=(d.image?d.image.get():null)||m(e),i=n.offset().left+n.outerWidth()/2,r=n.offset().top+n.outerHeight();d.popups.show("link.insert",i,r,n.outerHeight())}}function h(){var e=d.image?d.image.getEl():null;if(e){var t=d.popups.get("link.insert");d.image.hasCaption()&&(e=e.find(".fr-img-wrap")),t||(t=s()),p(),d.popups.setContainer("link.insert",d.$sc);var n=e.offset().left+e.outerWidth()/2,i=e.offset().top+e.outerHeight();d.popups.show("link.insert",n,i,e.outerHeight())}}return{_init:function(){d.events.on("keyup",function(e){e.which!=m.FE.KEYCODE.ESC&&k(e)}),d.events.on("window.mouseup",k),d.events.$on(d.$el,"click","a",function(e){d.edit.isDisabled()&&e.preventDefault()}),d.helpers.isMobile()&&d.events.$on(d.$doc,"selectionchange",k),s(!0),"A"==d.el.tagName&&d.$el.addClass("fr-view"),d.events.on("toolbar.esc",function(){if(d.popups.isVisible("link.edit"))return d.events.disableBlur(),d.events.focus(),!1},!0)},remove:function(){var e=c(),t=d.image?d.image.get():null;if(!1===d.events.trigger("link.beforeRemove",[e]))return!1;t&&e?(t.unwrap(),d.image.edit(t)):e&&(d.selection.save(),m(e).replaceWith(m(e).html()),d.selection.restore(),a())},showInsertPopup:function(){var e=d.$tb.find('.fr-command[data-cmd="insertLink"]'),t=d.popups.get("link.insert");if(t||(t=s()),!t.hasClass("fr-active"))if(d.popups.refresh("link.insert"),d.popups.setContainer("link.insert",d.$tb||d.$sc),e.is(":visible")){var n=e.offset().left+e.outerWidth()/2,i=e.offset().top+(d.opts.toolbarBottom?10:e.outerHeight()-10);d.popups.show("link.insert",n,i,e.outerHeight())}else d.position.forSelection(t),d.popups.show("link.insert")},usePredefined:function(e){var t,n,i=d.opts.linkList[e],r=d.popups.get("link.insert"),l=r.find('input.fr-link-attr[type="text"]'),a=r.find('input.fr-link-attr[type="checkbox"]');for(i.rel&&(r.rel=i.rel),n=0;n<l.length;n++)i[(t=m(l[n])).attr("name")]?t.val(i[t.attr("name")]):"text"!=t.attr("name")&&t.val("");for(n=0;n<a.length;n++)(t=m(a[n])).prop("checked",t.data("checked")==i[t.attr("name")]);d.accessibility.focusPopup(r)},insertCallback:function(){var e,t,n=d.popups.get("link.insert"),i=n.find('input.fr-link-attr[type="text"]'),r=n.find('input.fr-link-attr[type="checkbox"]'),l=(i.filter('[name="href"]').val()||"").trim(),a=i.filter('[name="text"]').val(),s={};for(t=0;t<i.length;t++)e=m(i[t]),["href","text"].indexOf(e.attr("name"))<0&&(s[e.attr("name")]=e.val());for(t=0;t<r.length;t++)(e=m(r[t])).is(":checked")?s[e.attr("name")]=e.data("checked"):s[e.attr("name")]=e.data("unchecked")||null;n.rel&&(s.rel=n.rel);var o=d.helpers.scrollTop();f(l,a,s),m(d.o_win).scrollTop(o)},insert:f,update:g,get:c,allSelected:u,back:function(){d.image&&d.image.get()?d.image.back():(d.events.disableBlur(),d.selection.restore(),d.events.enableBlur(),c()&&d.$wp?(d.selection.restore(),a(),k()):"A"==d.el.tagName?(d.$el.focus(),k()):(d.popups.hide("link.insert"),d.toolbar.showInline()))},imageLink:h,applyStyle:function(e,t,n){void 0===n&&(n=d.opts.linkMultipleStyles),void 0===t&&(t=d.opts.linkStyles);var i=c();if(!i)return!1;if(!n){var r=Object.keys(t);r.splice(r.indexOf(e),1),m(i).removeClass(r.join(" "))}m(i).toggleClass(e),k()}}},m.FE.DefineIcon("insertLink",{NAME:"link"}),m.FE.RegisterShortcut(m.FE.KEYCODE.K,"insertLink",null,"K"),m.FE.RegisterCommand("insertLink",{title:"Insert Link",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("link.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("link.insert")):this.link.showInsertPopup()},plugin:"link"}),m.FE.DefineIcon("linkOpen",{NAME:"external-link",FA5NAME:"external-link-alt"}),m.FE.RegisterCommand("linkOpen",{title:"Open Link",undo:!1,refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},callback:function(){var e=this.link.get();e&&(-1!==e.href.indexOf("mailto:")?this.o_win.open(e.href).close():this.o_win.open(e.href,"_blank","noopener"),this.popups.hide("link.edit"))},plugin:"link"}),m.FE.DefineIcon("linkEdit",{NAME:"edit"}),m.FE.RegisterCommand("linkEdit",{title:"Edit Link",undo:!1,refreshAfterCallback:!1,popup:!0,callback:function(){this.link.update()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),m.FE.DefineIcon("linkRemove",{NAME:"unlink"}),m.FE.RegisterCommand("linkRemove",{title:"Unlink",callback:function(){this.link.remove()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),m.FE.DefineIcon("linkBack",{NAME:"arrow-left"}),m.FE.RegisterCommand("linkBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.link.back()},refresh:function(e){var t=this.link.get()&&this.doc.hasFocus();(this.image?this.image.get():null)||t||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))},plugin:"link"}),m.FE.DefineIcon("linkList",{NAME:"search"}),m.FE.RegisterCommand("linkList",{title:"Choose Link",type:"dropdown",focus:!1,undo:!1,refreshAfterCallback:!1,html:function(){for(var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkList,n=0;n<t.length;n++)e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkList" data-param1="'+n+'">'+(t[n].displayText||t[n].text)+"</a></li>";return e+="</ul>"},callback:function(e,t){this.link.usePredefined(t)},plugin:"link"}),m.FE.RegisterCommand("linkInsert",{focus:!1,refreshAfterCallback:!1,callback:function(){this.link.insertCallback()},refresh:function(e){this.link.get()?e.text(this.language.translate("Update")):e.text(this.language.translate("Insert"))},plugin:"link"}),m.FE.DefineIcon("imageLink",{NAME:"link"}),m.FE.RegisterCommand("imageLink",{title:"Insert Link",undo:!1,focus:!1,popup:!0,callback:function(){this.link.imageLink()},refresh:function(e){var t;this.link.get()?((t=e.prev()).hasClass("fr-separator")&&t.removeClass("fr-hidden"),e.addClass("fr-hidden")):((t=e.prev()).hasClass("fr-separator")&&t.addClass("fr-hidden"),e.removeClass("fr-hidden"))},plugin:"link"}),m.FE.DefineIcon("linkStyle",{NAME:"magic"}),m.FE.RegisterCommand("linkStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkStyles;for(var n in t)t.hasOwnProperty(n)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkStyle" data-param1="'+n+'">'+this.language.translate(t[n])+"</a></li>");return e+="</ul>"},callback:function(e,t){this.link.applyStyle(t)},refreshOnShow:function(e,t){var n=this.link.get();if(n){var i=m(n);t.find(".fr-command").each(function(){var e=m(this).data("param1"),t=i.hasClass(e);m(this).toggleClass("fr-active",t).attr("aria-selected",t)})}},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
7
|
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(u){u.extend(u.FE.DEFAULTS,{listAdvancedTypes:!0}),u.FE.PLUGINS.lists=function(d){function
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(u){u.extend(u.FE.DEFAULTS,{listAdvancedTypes:!0}),u.FE.PLUGINS.lists=function(d){function g(e){return'<span class="fr-open-'+e.toLowerCase()+'"></span>'}function c(e){return'<span class="fr-close-'+e.toLowerCase()+'"></span>'}function r(e,t){!function(e,t){for(var n=[],a=0;a<e.length;a++){var r=e[a].parentNode;"LI"==e[a].tagName&&r.tagName!=t&&n.indexOf(r)<0&&n.push(r)}for(a=n.length-1;0<=a;a--){var i=u(n[a]);i.replaceWith("<"+t.toLowerCase()+" "+d.node.attributes(i.get(0))+">"+i.html()+"</"+t.toLowerCase()+">")}}(e,t);var n,a=d.html.defaultTag(),r=null;e.length&&(n="rtl"==d.opts.direction||"rtl"==u(e[0]).css("direction")?"margin-right":"margin-left");for(var i=0;i<e.length;i++)if("TD"!=e[i].tagName&&"TH"!=e[i].tagName&&"LI"!=e[i].tagName){var o=d.helpers.getPX(u(e[i]).css(n))||0;(e[i].style.marginLeft=null)===r&&(r=o);var l=0<r?"<"+t+' style="'+n+": "+r+'px;">':"<"+t+">",s="</"+t+">";for(o-=r;0<o/d.opts.indentMargin;)l+="<"+t+">",s+=s,o-=d.opts.indentMargin;a&&e[i].tagName.toLowerCase()==a?u(e[i]).replaceWith(l+"<li"+d.node.attributes(e[i])+">"+u(e[i]).html()+"</li>"+s):u(e[i]).wrap(l+"<li></li>"+s)}d.clean.lists()}function i(e){var t,n;for(t=e.length-1;0<=t;t--)for(n=t-1;0<=n;n--)if(u(e[n]).find(e[t]).length||e[n]==e[t]){e.splice(t,1);break}var a=[];for(t=0;t<e.length;t++){var r=u(e[t]),i=e[t].parentNode,o=r.attr("class");if(r.before(c(i.tagName)),"LI"==i.parentNode.tagName)r.before(c("LI")),r.after(g("LI"));else{var l="";o&&(l+=' class="'+o+'"');var s="rtl"==d.opts.direction||"rtl"==r.css("direction")?"margin-right":"margin-left";d.helpers.getPX(u(i).css(s))&&0<=(u(i).attr("style")||"").indexOf(s+":")&&(l+=' style="'+s+":"+d.helpers.getPX(u(i).css(s))+'px;"'),d.html.defaultTag()&&0===r.find(d.html.blockTagsQuery()).length&&r.wrapInner("<"+d.html.defaultTag()+l+"></"+d.html.defaultTag()+">"),d.node.isEmpty(r.get(0),!0)||0!==r.find(d.html.blockTagsQuery()).length||r.append("<br>"),r.append(g("LI")),r.prepend(c("LI"))}r.after(g(i.tagName)),"LI"==i.parentNode.tagName&&(i=i.parentNode.parentNode),a.indexOf(i)<0&&a.push(i)}for(t=0;t<a.length;t++){var p=u(a[t]),f=p.html();f=(f=f.replace(/<span class="fr-close-([a-z]*)"><\/span>/g,"</$1>")).replace(/<span class="fr-open-([a-z]*)"><\/span>/g,"<$1>"),p.replaceWith(d.node.openTagString(p.get(0))+f+d.node.closeTagString(p.get(0)))}d.$el.find("li:empty").remove(),d.$el.find("ul:empty, ol:empty").remove(),d.clean.lists(),d.html.wrap()}function o(e){d.selection.save();for(var t=0;t<e.length;t++){var n=e[t].previousSibling;if(n){var a=u(e[t]).find("> ul, > ol").last().get(0);if(a){for(var r=u("<li>").prependTo(u(a)),i=d.node.contents(e[t])[0];i&&!d.node.isList(i);){var o=i.nextSibling;r.append(i),i=o}u(n).append(u(a)),u(e[t]).remove()}else{var l=u(n).find("> ul, > ol").last().get(0);if(l)u(l).append(u(e[t]));else{var s=u("<"+e[t].parentNode.tagName+">");u(n).append(s),s.append(u(e[t]))}}}}d.clean.lists(),d.selection.restore()}function l(e){d.selection.save(),i(e),d.selection.restore()}function e(e){if("indent"==e||"outdent"==e){var t=!1,n=d.selection.blocks(),a=[];if("outdent"==e){if(n[0].previousSibling&&"LI"==n[0].previousSibling.tagName)return;if("LI"==n[0].parentElement.tagName)return}else if("indent"==e&&(!n[0].previousSibling||"LI"!=n[0].previousSibling.tagName))return;for(var r=0;r<n.length;r++)"LI"==n[r].tagName?(t=!0,a.push(n[r])):"LI"==n[r].parentNode.tagName&&(t=!0,a.push(n[r].parentNode));t&&("indent"==e?o(a):l(a))}}return{_init:function(){d.events.on("commands.after",e),d.events.on("keydown",function(e){if(e.which==u.FE.KEYCODE.TAB){for(var t=d.selection.blocks(),n=[],a=0;a<t.length;a++)"LI"==t[a].tagName?n.push(t[a]):"LI"==t[a].parentNode.tagName&&n.push(t[a].parentNode);if(1<n.length||n.length&&(d.selection.info(n[0]).atStart||d.node.isEmpty(n[0])))return e.preventDefault(),e.stopPropagation(),e.shiftKey?l(n):o(n),!1}},!0)},format:function(e,t){var n,a;for(d.selection.save(),d.html.wrap(!0,!0,!0,!0),d.selection.restore(),a=d.selection.blocks(),n=0;n<a.length;n++)"LI"!=a[n].tagName&&"LI"==a[n].parentNode.tagName&&(a[n]=a[n].parentNode);if(d.selection.save(),function(e,t){for(var n=!0,a=0;a<e.length;a++){if("LI"!=e[a].tagName)return!1;e[a].parentNode.tagName!=t&&(n=!1)}return n}(a,e)?t||i(a):r(a,e),d.html.unwrap(),d.selection.restore(),t=t||"default"){for(a=d.selection.blocks(),n=0;n<a.length;n++)"LI"!=a[n].tagName&&"LI"==a[n].parentNode.tagName&&(a[n]=a[n].parentNode);for(n=0;n<a.length;n++)"LI"==a[n].tagName&&(u(a[n].parentNode).css("list-style-type","default"===t?"":t),0===(u(a[n].parentNode).attr("style")||"").length&&u(a[n].parentNode).removeAttr("style"))}},refresh:function(e,t){var n=u(d.selection.element());if(n.get(0)!=d.el){var a=n.get(0);(a="LI"!=a.tagName&&a.firstElementChild&&"LI"!=a.firstElementChild.tagName?n.parents("li").get(0):"LI"==a.tagName||a.firstElementChild?a.firstElementChild&&"LI"==a.firstElementChild.tagName?n.get(0).firstChild:n.get(0):n.parents("li").get(0))&&a.parentNode.tagName==t&&d.el.contains(a.parentNode)&&e.addClass("fr-active")}}}},u.FE.RegisterCommand("formatUL",{title:"Unordered List",type:"button",hasOptions:function(){return this.opts.listAdvancedTypes},options:{"default":"Default",circle:"Circle",disc:"Disc",square:"Square"},refresh:function(e){this.lists.refresh(e,"UL")},callback:function(e,t){this.lists.format("UL",t)},plugin:"lists"}),u.FE.RegisterCommand("formatOL",{title:"Ordered List",hasOptions:function(){return this.opts.listAdvancedTypes},options:{"default":"Default","lower-alpha":"Lower Alpha","lower-greek":"Lower Greek","lower-roman":"Lower Roman","upper-alpha":"Upper Alpha","upper-roman":"Upper Roman"},refresh:function(e){this.lists.refresh(e,"OL")},callback:function(e,t){this.lists.format("OL",t)},plugin:"lists"}),u.FE.DefineIcon("formatUL",{NAME:"list-ul"}),u.FE.DefineIcon("formatOL",{NAME:"list-ol"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(a,e){return e===undefined&&(e="undefined"!=typeof window?require("jquery"):require("jquery")(a)),t(e)}:t(window.jQuery)}(function(g){g.extend(g.FE.DEFAULTS,{paragraphFormat:{N:"Normal",H1:"Heading 1",H2:"Heading 2",H3:"Heading 3",H4:"Heading 4",PRE:"Code"},paragraphFormatSelection:!1,paragraphDefaultSelection:"Paragraph Format"}),g.FE.PLUGINS.paragraphFormat=function(h){function f(a,e){var t=h.html.defaultTag();if(e&&e.toLowerCase()!=t)if(0<a.find("ul, ol").length){var r=g("<"+e+">");a.prepend(r);for(var n=h.node.contents(a.get(0))[0];n&&["UL","OL"].indexOf(n.tagName)<0;){var o=n.nextSibling;r.append(n),n=o}}else a.html("<"+e+">"+a.html()+"</"+e+">")}return{apply:function(a){"N"==a&&(a=h.html.defaultTag()),h.selection.save(),h.html.wrap(!0,!0,!h.opts.paragraphFormat.BLOCKQUOTE,!0,!0),h.selection.restore();var e,t,r,n,o,i,p,l,s=h.selection.blocks();h.selection.save(),h.$el.find("pre").attr("skip",!0);for(var d=0;d<s.length;d++)if(s[d].tagName!=a&&!h.node.isList(s[d])){var m=g(s[d]);"LI"==s[d].tagName?f(m,a):"LI"==s[d].parentNode.tagName&&s[d]?(i=m,p=a,l=h.html.defaultTag(),p&&p.toLowerCase()!=l||(p='div class="fr-temp-div"'),i.replaceWith(g("<"+p+">").html(i.html()))):0<=["TD","TH"].indexOf(s[d].parentNode.tagName)?(r=m,n=a,o=h.html.defaultTag(),n||(n='div class="fr-temp-div"'+(h.node.isEmpty(r.get(0),!0)?' data-empty="true"':"")),n.toLowerCase()==o?(h.node.isEmpty(r.get(0),!0)||r.append("<br/>"),r.replaceWith(r.html())):r.replaceWith(g("<"+n+">").html(r.html()))):(e=m,(t=a)||(t='div class="fr-temp-div"'+(h.node.isEmpty(e.get(0),!0)?' data-empty="true"':"")),e.replaceWith(g("<"+t+" "+h.node.attributes(e.get(0))+">").html(e.html()).removeAttr("data-empty")))}h.$el.find('pre:not([skip="true"]) + pre:not([skip="true"])').each(function(){g(this).prev().append("<br>"+g(this).html()),g(this).remove()}),h.$el.find("pre").removeAttr("skip"),h.html.unwrap(),h.selection.restore()},refreshOnShow:function(a,e){var t=h.selection.blocks();if(t.length){var r=t[0],n="N",o=h.html.defaultTag();r.tagName.toLowerCase()!=o&&r!=h.el&&(n=r.tagName),e.find('.fr-command[data-param1="'+n+'"]').addClass("fr-active").attr("aria-selected",!0)}else e.find('.fr-command[data-param1="N"]').addClass("fr-active").attr("aria-selected",!0)},refresh:function(a){if(h.opts.paragraphFormatSelection){var e=h.selection.blocks();if(e.length){var t=e[0],r="N",n=h.html.defaultTag();t.tagName.toLowerCase()!=n&&t!=h.el&&(r=t.tagName),0<=["LI","TD","TH"].indexOf(r)&&(r="N"),a.find("> span").text(h.language.translate(h.opts.paragraphFormat[r]))}else a.find("> span").text(h.language.translate(h.opts.paragraphFormat.N))}}}},g.FE.RegisterCommand("paragraphFormat",{type:"dropdown",displaySelection:function(a){return a.opts.paragraphFormatSelection},defaultSelection:function(a){return a.language.translate(a.opts.paragraphDefaultSelection)},displaySelectionWidth:125,html:function(){var a='<ul class="fr-dropdown-list" role="presentation">',e=this.opts.paragraphFormat;for(var t in e)if(e.hasOwnProperty(t)){var r=this.shortcuts.get("paragraphFormat."+t);r=r?'<span class="fr-shortcut">'+r+"</span>":"",a+='<li role="presentation"><'+("N"==t?this.html.defaultTag()||"DIV":t)+' style="padding: 0 !important; margin: 0 !important;" role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="paragraphFormat" data-param1="'+t+'" title="'+this.language.translate(e[t])+'">'+this.language.translate(e[t])+"</a></"+("N"==t?this.html.defaultTag()||"DIV":t)+"></li>"}return a+="</ul>"},title:"Paragraph Format",callback:function(a,e){this.paragraphFormat.apply(e)},refresh:function(a){this.paragraphFormat.refresh(a)},refreshOnShow:function(a,e){this.paragraphFormat.refreshOnShow(a,e)},plugin:"paragraphFormat"}),g.FE.DefineIcon("paragraphFormat",{NAME:"paragraph"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,a){return a===undefined&&(a="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(a)}:t(window.jQuery)}(function(i){i.extend(i.FE.DEFAULTS,{paragraphStyles:{"fr-text-gray":"Gray","fr-text-bordered":"Bordered","fr-text-spaced":"Spaced","fr-text-uppercase":"Uppercase"},paragraphMultipleStyles:!0}),i.FE.PLUGINS.paragraphStyle=function(o){return{_init:function(){},apply:function(e,a,t){void 0===a&&(a=o.opts.paragraphStyles),void 0===t&&(t=o.opts.paragraphMultipleStyles);var r="";t||((r=Object.keys(a)).splice(r.indexOf(e),1),r=r.join(" ")),o.selection.save(),o.html.wrap(!0,!0,!0,!0),o.selection.restore();var n=o.selection.blocks();o.selection.save();for(var s=i(n[0]).hasClass(e),l=0;l<n.length;l++)i(n[l]).removeClass(r).toggleClass(e,!s),i(n[l]).hasClass("fr-temp-div")&&i(n[l]).removeClass("fr-temp-div"),""===i(n[l]).attr("class")&&i(n[l]).removeAttr("class");o.html.unwrap(),o.selection.restore()},refreshOnShow:function(e,a){var t=o.selection.blocks();if(t.length){var r=i(t[0]);a.find(".fr-command").each(function(){var e=i(this).data("param1"),a=r.hasClass(e);i(this).toggleClass("fr-active",a).attr("aria-selected",a)})}}}},i.FE.RegisterCommand("paragraphStyle",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',a=this.opts.paragraphStyles;for(var t in a)a.hasOwnProperty(t)&&(e+='<li role="presentation"><a class="fr-command '+t+'" tabIndex="-1" role="option" data-cmd="paragraphStyle" data-param1="'+t+'" title="'+this.language.translate(a[t])+'">'+this.language.translate(a[t])+"</a></li>");return e+="</ul>"},title:"Paragraph Style",callback:function(e,a){this.paragraphStyle.apply(a)},refreshOnShow:function(e,a){this.paragraphStyle.refreshOnShow(e,a)},plugin:"paragraphStyle"}),i.FE.DefineIcon("paragraphStyle",{NAME:"magic"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(e){e.extend(e.FE.DEFAULTS,{html2pdf:window.html2pdf}),e.FE.PLUGINS.print=function(l){return{run:function(){!function(e){var t=l.$el.html(),n=null;l.shared.print_iframe?n=l.shared.print_iframe:((n=document.createElement("iframe")).name="fr-print",n.style.position="fixed",n.style.top="0",n.style.left="-9999px",n.style.height="100%",n.style.width="0",n.style.overflow="hidden",n.style["z-index"]="2147483647",n.style.tabIndex="-1",l.events.on("shared.destroy",function(){n.remove()}),l.shared.print_iframe=n);try{document.body.removeChild(n)}catch(d){}document.body.appendChild(n);var i=function(){e(),n.removeEventListener("load",i)};n.addEventListener("load",i);var o=n.contentWindow;o.document.open(),o.document.write("<!DOCTYPE html><html "+(l.opts.documentReady?'style="margin: 0; padding: 0;"':"")+"><head><title>"+document.title+"</title>"),Array.prototype.forEach.call(document.querySelectorAll("style"),function(e){e=e.cloneNode(!0),o.document.write(e.outerHTML)});var r=document.querySelectorAll("link[rel=stylesheet]");Array.prototype.forEach.call(r,function(e){var t=document.createElement("link");t.rel=e.rel,t.href=e.href,t.media="print",t.type="text/css",t.media="all",o.document.write(t.outerHTML)}),o.document.write('</head><body style="height:auto;text-align: '+("rtl"==l.opts.direction?"right":"left")+"; direction: "+l.opts.direction+"; "+(l.opts.documentReady?" padding: 2cm; width: 17cm; margin: 0;":"")+'"><div class="fr-view">'),o.document.write(t),o.document.write("</div></body></html>"),o.document.close()}(function(){setTimeout(function(){l.events.disableBlur(),window.frames["fr-print"].focus(),window.frames["fr-print"].print(),l.$win.get(0).focus(),l.events.disableBlur(),l.events.focus()},0)})},toPDF:function(){l.opts.html2pdf&&(l.$el.css("text-align","left"),l.opts.html2pdf().set({margin:[10,20],html2canvas:{useCORS:!0}}).from(l.el).save(),setTimeout(function(){l.$el.css("text-align","")},100))}}},e.FE.DefineIcon("print",{NAME:"print"}),e.FE.RegisterCommand("print",{title:"Print",undo:!1,focus:!1,plugin:"print",callback:function(){this.print.run()}}),e.FE.DefineIcon("getPDF",{NAME:"file-pdf-o",FA5NAME:"file-pdf"}),e.FE.RegisterCommand("getPDF",{title:"Download PDF",type:"button",focus:!1,undo:!1,callback:function(){this.print.toPDF()}})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),i(t)}:i(window.jQuery)}(function(d){d.extend(d.FE.DEFAULTS,{quickInsertButtons:["image","video","embedly","table","ul","ol","hr"],quickInsertTags:["p","div","h1","h2","h3","h4","h5","h6","pre","blockquote"],quickInsertEnabled:!0}),d.FE.QUICK_INSERT_BUTTONS={},d.FE.DefineIcon("quickInsert",{PATH:'<path d="M22,16.75 L16.75,16.75 L16.75,22 L15.25,22.000 L15.25,16.75 L10,16.75 L10,15.25 L15.25,15.25 L15.25,10 L16.75,10 L16.75,15.25 L22,15.25 L22,16.75 Z"/>',template:"svg"}),d.FE.RegisterQuickInsertButton=function(e,t){d.FE.QUICK_INSERT_BUTTONS[e]=d.extend({undo:!0},t)},d.FE.RegisterQuickInsertButton("image",{icon:"insertImage",requiredPlugin:"image",title:"Insert Image",undo:!1,callback:function(){var e=this;e.shared.$qi_image_input||(e.shared.$qi_image_input=d('<input accept="image/'+e.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" name="quickInsertImage'+this.id+'" style="display: none;" type="file">'),d("body:first").append(e.shared.$qi_image_input),e.events.$on(e.shared.$qi_image_input,"change",function(){var e=d(this).data("inst");this.files&&(e.quickInsert.hide(),e.image.upload(this.files)),d(this).val("")},!0)),e.$qi_image_input=e.shared.$qi_image_input,e.helpers.isMobile()&&e.selection.save(),e.events.disableBlur(),e.$qi_image_input.data("inst",e).trigger("click")}}),d.FE.RegisterQuickInsertButton("video",{icon:"insertVideo",requiredPlugin:"video",title:"Insert Video",undo:!1,callback:function(){var e=prompt(this.language.translate("Paste the URL of the video you want to insert."));e&&this.video.insertByURL(e)}}),d.FE.RegisterQuickInsertButton("embedly",{icon:"embedly",requiredPlugin:"embedly",title:"Embed URL",undo:!1,callback:function(){var e=prompt(this.language.translate("Paste the URL of any web content you want to insert."));e&&this.embedly.add(e)}}),d.FE.RegisterQuickInsertButton("table",{icon:"insertTable",requiredPlugin:"table",title:"Insert Table",callback:function(){this.table.insert(2,2)}}),d.FE.RegisterQuickInsertButton("ol",{icon:"formatOL",requiredPlugin:"lists",title:"Ordered List",callback:function(){this.lists.format("OL")}}),d.FE.RegisterQuickInsertButton("ul",{icon:"formatUL",requiredPlugin:"lists",title:"Unordered List",callback:function(){this.lists.format("UL")}}),d.FE.RegisterQuickInsertButton("hr",{icon:"insertHR",title:"Insert Horizontal Line",callback:function(){this.commands.insertHR()}}),d.FE.PLUGINS.quickInsert=function(r){var a,l;function t(e){var t,i,n;t=e.offset().top-r.$box.offset().top,i=(r.$iframe&&r.$iframe.offset().left||0)+e.offset().left<a.outerWidth()?e.offset().left+a.outerWidth():0-a.outerWidth(),r.opts.enter!=d.FE.ENTER_BR?n=(a.outerHeight()-e.outerHeight())/2:(d("<span>"+d.FE.INVISIBLE_SPACE+"</span>").insertAfter(e),n=(a.outerHeight()-e.next().outerHeight())/2,e.next().remove()),r.opts.iframe&&(t+=r.$iframe.offset().top),a.hasClass("fr-on")&&0<=t&&l.css("top",t-n),0<=t&&t-Math.abs(n)<=r.$box.outerHeight()-e.outerHeight()?(a.hasClass("fr-hidden")&&(a.hasClass("fr-on")&&o(),a.removeClass("fr-hidden")),a.css("top",t-n)):a.hasClass("fr-visible")&&(a.addClass("fr-hidden"),u()),a.css("left",i)}function i(e){a||function(){r.shared.$quick_insert||(r.shared.$quick_insert=d('<div class="fr-quick-insert"><a class="fr-floating-btn" role="button" tabIndex="-1" title="'+r.language.translate("Quick Insert")+'">'+r.icon.create("quickInsert")+"</a></div>"));a=r.shared.$quick_insert,r.tooltip.bind(r.$box,".fr-quick-insert > a.fr-floating-btn"),r.events.on("destroy",function(){a.removeClass("fr-on").appendTo(d("body:first")).css("left",-9999).css("top",-9999),l&&(u(),l.appendTo(d("body:first")))},!0),r.events.on("shared.destroy",function(){a.html("").removeData().remove(),a=null,l&&(l.html("").removeData().remove(),l=null)},!0),r.events.on("commands.before",s),r.events.on("commands.after",function(){r.popups.areVisible()||n()}),r.events.bindClick(r.$box,".fr-quick-insert > a",o),r.events.bindClick(r.$box,".fr-qi-helper > a.fr-btn",function(e){var t=d(e.currentTarget).data("cmd");if(!1===r.events.trigger("quickInsert.commands.before",[t]))return!1;d.FE.QUICK_INSERT_BUTTONS[t].callback.apply(r,[e.currentTarget]),d.FE.QUICK_INSERT_BUTTONS[t].undo&&r.undo.saveStep(),r.events.trigger("quickInsert.commands.after",[t]),r.quickInsert.hide()}),r.events.$on(r.$wp,"scroll",function(){a.hasClass("fr-visible")&&t(a.data("tag"))})}(),a.hasClass("fr-on")&&u(),r.$box.append(a),t(e),a.data("tag",e),a.addClass("fr-visible")}function n(){if(r.core.hasFocus()){var e=r.selection.element();if(r.opts.enter==d.FE.ENTER_BR||r.node.isBlock(e)||(e=r.node.blockParent(e)),r.opts.enter==d.FE.ENTER_BR&&!r.node.isBlock(e)){var t=r.node.deepestParent(e);t&&(e=t)}e&&(r.opts.enter!=d.FE.ENTER_BR&&r.node.isEmpty(e)&&0<=r.opts.quickInsertTags.indexOf(e.tagName.toLowerCase())||r.opts.enter==d.FE.ENTER_BR&&("BR"==e.tagName&&(!e.previousSibling||"BR"==e.previousSibling.tagName||r.node.isBlock(e.previousSibling))||r.node.isEmpty(e)&&(!e.previousSibling||"BR"==e.previousSibling.tagName||r.node.isBlock(e.previousSibling))&&(!e.nextSibling||"BR"==e.nextSibling.tagName||r.node.isBlock(e.nextSibling))))?a&&a.data("tag").is(d(e))&&a.hasClass("fr-on")?u():r.selection.isCollapsed()&&i(d(e)):s()}}function s(){a&&(a.hasClass("fr-on")&&u(),a.removeClass("fr-visible fr-on"),a.css("left",-9999).css("top",-9999))}function o(e){if(e&&e.preventDefault(),a.hasClass("fr-on")&&!a.hasClass("fr-hidden"))u();else{if(!r.shared.$qi_helper){for(var t=r.opts.quickInsertButtons,i='<div class="fr-qi-helper">',n=0,s=0;s<t.length;s++){var o=d.FE.QUICK_INSERT_BUTTONS[t[s]];o&&(!o.requiredPlugin||d.FE.PLUGINS[o.requiredPlugin]&&0<=r.opts.pluginsEnabled.indexOf(o.requiredPlugin))&&(i+='<a class="fr-btn fr-floating-btn" role="button" title="'+r.language.translate(o.title)+'" tabIndex="-1" data-cmd="'+t[s]+'" style="transition-delay: '+.025*n+++'s;">'+r.icon.create(o.icon)+"</a>")}i+="</div>",r.shared.$qi_helper=d(i),r.tooltip.bind(r.shared.$qi_helper,"> a.fr-btn"),r.events.$on(r.shared.$qi_helper,"mousedown",function(e){e.preventDefault()},!0)}(l=r.shared.$qi_helper).appendTo(r.$box),setTimeout(function(){l.css("top",parseFloat(a.css("top"))),l.css("left",parseFloat(a.css("left"))+a.outerWidth()),l.find("a").addClass("fr-size-1"),a.addClass("fr-on")},10)}}function u(){var e=r.$box.find(".fr-qi-helper");e.length&&(e.find("a").removeClass("fr-size-1"),e.css("left",-9999),a.hasClass("fr-hidden")||a.removeClass("fr-on"))}return{_init:function(){if(!r.$wp||!r.opts.quickInsertEnabled)return!1;r.popups.onShow("image.edit",s),r.events.on("mouseup",n),r.helpers.isMobile()&&r.events.$on(d(r.o_doc),"selectionchange",n),r.events.on("blur",s),r.events.on("keyup",n),r.events.on("keydown",function(){setTimeout(function(){n()},0)})},hide:s}}});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(a){a.FE.PLUGINS.quote=function(r){function o(e){for(;e.parentNode&&e.parentNode!=r.el;)e=e.parentNode;return e}return{apply:function(e){r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore(),"increase"==e?function(){var e,t=r.selection.blocks();for(e=0;e<t.length;e++)t[e]=o(t[e]);r.selection.save();var n=a("<blockquote>");for(n.insertBefore(t[0]),e=0;e<t.length;e++)n.append(t[e]);r.html.unwrap(),r.selection.restore()}():"decrease"==e&&function(){var e,t=r.selection.blocks();for(e=0;e<t.length;e++)"BLOCKQUOTE"!=t[e].tagName&&(t[e]=a(t[e]).parentsUntil(r.$el,"BLOCKQUOTE").get(0));for(r.selection.save(),e=0;e<t.length;e++)t[e]&&a(t[e]).replaceWith(t[e].innerHTML);r.html.unwrap(),r.selection.restore()}()}}},a.FE.RegisterShortcut(a.FE.KEYCODE.SINGLE_QUOTE,"quote","increase","'"),a.FE.RegisterShortcut(a.FE.KEYCODE.SINGLE_QUOTE,"quote","decrease","'",!0),a.FE.RegisterCommand("quote",{title:"Quote",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t={increase:"Increase",decrease:"Decrease"};for(var n in t)if(t.hasOwnProperty(n)){var r=this.shortcuts.get("quote."+n);e+='<li role="presentation"><a class="fr-command fr-active '+n+'" tabIndex="-1" role="option" data-cmd="quote" data-param1="'+n+'" title="'+t[n]+'">'+this.language.translate(t[n])+(r?'<span class="fr-shortcut">'+r+"</span>":"")+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.quote.apply(t)},plugin:"quote"}),a.FE.DefineIcon("quote",{NAME:"quote-left"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(l){l.extend(l.FE.DEFAULTS,{saveInterval:1e4,saveURL:null,saveParams:{},saveParam:"body",saveMethod:"POST"}),l.FE.PLUGINS.save=function(i){var e=null,u=null,t=!1,v=1,f=2,n={};function d(e,t){i.events.trigger("save.error",[{code:e,message:n[e]},t])}function s(e){void 0===e&&(e=i.html.get());var t=e,n=i.events.trigger("save.before",[e]);if(!1===n)return!1;if("string"==typeof n&&(e=n),i.opts.saveURL){var s={};for(var o in i.opts.saveParams)if(i.opts.saveParams.hasOwnProperty(o)){var a=i.opts.saveParams[o];s[o]="function"==typeof a?a.call(this):a}var r={};r[i.opts.saveParam]=e,l.ajax({type:i.opts.saveMethod,url:i.opts.saveURL,data:l.extend(r,s),crossDomain:i.opts.requestWithCORS,xhrFields:{withCredentials:i.opts.requestWithCredentials},headers:i.opts.requestHeaders}).done(function(e){u=t,i.events.trigger("save.after",[e])}).fail(function(e){d(f,e.response||e.responseText)})}else d(v)}function o(){clearTimeout(e),e=setTimeout(function(){var e=i.html.get();(u!=e||t)&&(t=!1,s(u=e))},i.opts.saveInterval)}return n[v]="Missing saveURL option.",n[f]="Something went wrong during save.",{_init:function(){i.opts.saveInterval&&(u=i.html.get(),i.events.on("contentChanged",o),i.events.on("keydown destroy",function(){clearTimeout(e)}))},save:s,reset:function(){o(),t=!1},force:function(){t=!0}}},l.FE.DefineIcon("save",{NAME:"floppy-o",FA5NAME:"save"}),l.FE.RegisterCommand("save",{title:"Save",undo:!1,focus:!1,refreshAfterCallback:!1,callback:function(){this.save.save()},plugin:"save"})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
7
|
!function(T){"function"==typeof define&&define.amd?define(["jquery"],T):"object"==typeof module&&module.exports?module.exports=function(E,c){return c===undefined&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(E)),T(c)}:T(window.jQuery)}(function(s){s.extend(s.FE.DEFAULTS,{specialCharactersSets:[{title:"Latin",list:[{"char":"¡",desc:"INVERTED EXCLAMATION MARK"},{"char":"¢",desc:"CENT SIGN"},{"char":"£",desc:"POUND SIGN"},{"char":"¤",desc:"CURRENCY SIGN"},{"char":"¥",desc:"YEN SIGN"},{"char":"¦",desc:"BROKEN BAR"},{"char":"§",desc:"SECTION SIGN"},{"char":"¨",desc:"DIAERESIS"},{"char":"©",desc:"COPYRIGHT SIGN"},{"char":"™",desc:"TRADEMARK SIGN"},{"char":"ª",desc:"FEMININE ORDINAL INDICATOR"},{"char":"«",desc:"LEFT-POINTING DOUBLE ANGLE QUOTATION MARK"},{"char":"¬",desc:"NOT SIGN"},{"char":"®",desc:"REGISTERED SIGN"},{"char":"¯",desc:"MACRON"},{"char":"°",desc:"DEGREE SIGN"},{"char":"±",desc:"PLUS-MINUS SIGN"},{"char":"²",desc:"SUPERSCRIPT TWO"},{"char":"³",desc:"SUPERSCRIPT THREE"},{"char":"´",desc:"ACUTE ACCENT"},{"char":"µ",desc:"MICRO SIGN"},{"char":"¶",desc:"PILCROW SIGN"},{"char":"·",desc:"MIDDLE DOT"},{"char":"¸",desc:"CEDILLA"},{"char":"¹",desc:"SUPERSCRIPT ONE"},{"char":"º",desc:"MASCULINE ORDINAL INDICATOR"},{"char":"»",desc:"RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK"},{"char":"¼",desc:"VULGAR FRACTION ONE QUARTER"},{"char":"½",desc:"VULGAR FRACTION ONE HALF"},{"char":"¾",desc:"VULGAR FRACTION THREE QUARTERS"},{"char":"¿",desc:"INVERTED QUESTION MARK"},{"char":"À",desc:"LATIN CAPITAL LETTER A WITH GRAVE"},{"char":"Á",desc:"LATIN CAPITAL LETTER A WITH ACUTE"},{"char":"Â",desc:"LATIN CAPITAL LETTER A WITH CIRCUMFLEX"},{"char":"Ã",desc:"LATIN CAPITAL LETTER A WITH TILDE"},{"char":"Ä",desc:"LATIN CAPITAL LETTER A WITH DIAERESIS "},{"char":"Å",desc:"LATIN CAPITAL LETTER A WITH RING ABOVE"},{"char":"Æ",desc:"LATIN CAPITAL LETTER AE"},{"char":"Ç",desc:"LATIN CAPITAL LETTER C WITH CEDILLA"},{"char":"È",desc:"LATIN CAPITAL LETTER E WITH GRAVE"},{"char":"É",desc:"LATIN CAPITAL LETTER E WITH ACUTE"},{"char":"Ê",desc:"LATIN CAPITAL LETTER E WITH CIRCUMFLEX"},{"char":"Ë",desc:"LATIN CAPITAL LETTER E WITH DIAERESIS"},{"char":"Ì",desc:"LATIN CAPITAL LETTER I WITH GRAVE"},{"char":"Í",desc:"LATIN CAPITAL LETTER I WITH ACUTE"},{"char":"Î",desc:"LATIN CAPITAL LETTER I WITH CIRCUMFLEX"},{"char":"Ï",desc:"LATIN CAPITAL LETTER I WITH DIAERESIS"},{"char":"Ð",desc:"LATIN CAPITAL LETTER ETH"},{"char":"Ñ",desc:"LATIN CAPITAL LETTER N WITH TILDE"},{"char":"Ò",desc:"LATIN CAPITAL LETTER O WITH GRAVE"},{"char":"Ó",desc:"LATIN CAPITAL LETTER O WITH ACUTE"},{"char":"Ô",desc:"LATIN CAPITAL LETTER O WITH CIRCUMFLEX"},{"char":"Õ",desc:"LATIN CAPITAL LETTER O WITH TILDE"},{"char":"Ö",desc:"LATIN CAPITAL LETTER O WITH DIAERESIS"},{"char":"×",desc:"MULTIPLICATION SIGN"},{"char":"Ø",desc:"LATIN CAPITAL LETTER O WITH STROKE"},{"char":"Ù",desc:"LATIN CAPITAL LETTER U WITH GRAVE"},{"char":"Ú",desc:"LATIN CAPITAL LETTER U WITH ACUTE"},{"char":"Û",desc:"LATIN CAPITAL LETTER U WITH CIRCUMFLEX"},{"char":"Ü",desc:"LATIN CAPITAL LETTER U WITH DIAERESIS"},{"char":"Ý",desc:"LATIN CAPITAL LETTER Y WITH ACUTE"},{"char":"Þ",desc:"LATIN CAPITAL LETTER THORN"},{"char":"ß",desc:"LATIN SMALL LETTER SHARP S"},{"char":"à",desc:"LATIN SMALL LETTER A WITH GRAVE"},{"char":"á",desc:"LATIN SMALL LETTER A WITH ACUTE "},{"char":"â",desc:"LATIN SMALL LETTER A WITH CIRCUMFLEX"},{"char":"ã",desc:"LATIN SMALL LETTER A WITH TILDE"},{"char":"ä",desc:"LATIN SMALL LETTER A WITH DIAERESIS"},{"char":"å",desc:"LATIN SMALL LETTER A WITH RING ABOVE"},{"char":"æ",desc:"LATIN SMALL LETTER AE"},{"char":"ç",desc:"LATIN SMALL LETTER C WITH CEDILLA"},{"char":"è",desc:"LATIN SMALL LETTER E WITH GRAVE"},{"char":"é",desc:"LATIN SMALL LETTER E WITH ACUTE"},{"char":"ê",desc:"LATIN SMALL LETTER E WITH CIRCUMFLEX"},{"char":"ë",desc:"LATIN SMALL LETTER E WITH DIAERESIS"},{"char":"ì",desc:"LATIN SMALL LETTER I WITH GRAVE"},{"char":"í",desc:"LATIN SMALL LETTER I WITH ACUTE"},{"char":"î",desc:"LATIN SMALL LETTER I WITH CIRCUMFLEX"},{"char":"ï",desc:"LATIN SMALL LETTER I WITH DIAERESIS"},{"char":"ð",desc:"LATIN SMALL LETTER ETH"},{"char":"ñ",desc:"LATIN SMALL LETTER N WITH TILDE"},{"char":"ò",desc:"LATIN SMALL LETTER O WITH GRAVE"},{"char":"ó",desc:"LATIN SMALL LETTER O WITH ACUTE"},{"char":"ô",desc:"LATIN SMALL LETTER O WITH CIRCUMFLEX"},{"char":"õ",desc:"LATIN SMALL LETTER O WITH TILDE"},{"char":"ö",desc:"LATIN SMALL LETTER O WITH DIAERESIS"},{"char":"÷",desc:"DIVISION SIGN"},{"char":"ø",desc:"LATIN SMALL LETTER O WITH STROKE"},{"char":"ù",desc:"LATIN SMALL LETTER U WITH GRAVE"},{"char":"ú",desc:"LATIN SMALL LETTER U WITH ACUTE"},{"char":"û",desc:"LATIN SMALL LETTER U WITH CIRCUMFLEX"},{"char":"ü",desc:"LATIN SMALL LETTER U WITH DIAERESIS"},{"char":"ý",desc:"LATIN SMALL LETTER Y WITH ACUTE"},{"char":"þ",desc:"LATIN SMALL LETTER THORN"},{"char":"ÿ",desc:"LATIN SMALL LETTER Y WITH DIAERESIS"}]},{title:"Greek",list:[{"char":"Α",desc:"GREEK CAPITAL LETTER ALPHA"},{"char":"Β",desc:"GREEK CAPITAL LETTER BETA"},{"char":"Γ",desc:"GREEK CAPITAL LETTER GAMMA"},{"char":"Δ",desc:"GREEK CAPITAL LETTER DELTA"},{"char":"Ε",desc:"GREEK CAPITAL LETTER EPSILON"},{"char":"Ζ",desc:"GREEK CAPITAL LETTER ZETA"},{"char":"Η",desc:"GREEK CAPITAL LETTER ETA"},{"char":"Θ",desc:"GREEK CAPITAL LETTER THETA"},{"char":"Ι",desc:"GREEK CAPITAL LETTER IOTA"},{"char":"Κ",desc:"GREEK CAPITAL LETTER KAPPA"},{"char":"Λ",desc:"GREEK CAPITAL LETTER LAMBDA"},{"char":"Μ",desc:"GREEK CAPITAL LETTER MU"},{"char":"Ν",desc:"GREEK CAPITAL LETTER NU"},{"char":"Ξ",desc:"GREEK CAPITAL LETTER XI"},{"char":"Ο",desc:"GREEK CAPITAL LETTER OMICRON"},{"char":"Π",desc:"GREEK CAPITAL LETTER PI"},{"char":"Ρ",desc:"GREEK CAPITAL LETTER RHO"},{"char":"Σ",desc:"GREEK CAPITAL LETTER SIGMA"},{"char":"Τ",desc:"GREEK CAPITAL LETTER TAU"},{"char":"Υ",desc:"GREEK CAPITAL LETTER UPSILON"},{"char":"Φ",desc:"GREEK CAPITAL LETTER PHI"},{"char":"Χ",desc:"GREEK CAPITAL LETTER CHI"},{"char":"Ψ",desc:"GREEK CAPITAL LETTER PSI"},{"char":"Ω",desc:"GREEK CAPITAL LETTER OMEGA"},{"char":"α",desc:"GREEK SMALL LETTER ALPHA"},{"char":"β",desc:"GREEK SMALL LETTER BETA"},{"char":"γ",desc:"GREEK SMALL LETTER GAMMA"},{"char":"δ",desc:"GREEK SMALL LETTER DELTA"},{"char":"ε",desc:"GREEK SMALL LETTER EPSILON"},{"char":"ζ",desc:"GREEK SMALL LETTER ZETA"},{"char":"η",desc:"GREEK SMALL LETTER ETA"},{"char":"θ",desc:"GREEK SMALL LETTER THETA"},{"char":"ι",desc:"GREEK SMALL LETTER IOTA"},{"char":"κ",desc:"GREEK SMALL LETTER KAPPA"},{"char":"λ",desc:"GREEK SMALL LETTER LAMBDA"},{"char":"μ",desc:"GREEK SMALL LETTER MU"},{"char":"ν",desc:"GREEK SMALL LETTER NU"},{"char":"ξ",desc:"GREEK SMALL LETTER XI"},{"char":"ο",desc:"GREEK SMALL LETTER OMICRON"},{"char":"π",desc:"GREEK SMALL LETTER PI"},{"char":"ρ",desc:"GREEK SMALL LETTER RHO"},{"char":"ς",desc:"GREEK SMALL LETTER FINAL SIGMA"},{"char":"σ",desc:"GREEK SMALL LETTER SIGMA"},{"char":"τ",desc:"GREEK SMALL LETTER TAU"},{"char":"υ",desc:"GREEK SMALL LETTER UPSILON"},{"char":"φ",desc:"GREEK SMALL LETTER PHI"},{"char":"χ",desc:"GREEK SMALL LETTER CHI"},{"char":"ψ",desc:"GREEK SMALL LETTER PSI"},{"char":"ω",desc:"GREEK SMALL LETTER OMEGA"},{"char":"ϑ",desc:"GREEK THETA SYMBOL"},{"char":"ϒ",desc:"GREEK UPSILON WITH HOOK SYMBOL"},{"char":"ϕ",desc:"GREEK PHI SYMBOL"},{"char":"ϖ",desc:"GREEK PI SYMBOL"},{"char":"Ϝ",desc:"GREEK LETTER DIGAMMA"},{"char":"ϝ",desc:"GREEK SMALL LETTER DIGAMMA"},{"char":"ϰ",desc:"GREEK KAPPA SYMBOL"},{"char":"ϱ",desc:"GREEK RHO SYMBOL"},{"char":"ϵ",desc:"GREEK LUNATE EPSILON SYMBOL"},{"char":"϶",desc:"GREEK REVERSED LUNATE EPSILON SYMBOL"}]},{title:"Cyrillic",list:[{"char":"Ѐ",desc:"CYRILLIC CAPITAL LETTER IE WITH GRAVE"},{"char":"Ё",desc:"CYRILLIC CAPITAL LETTER IO"},{"char":"Ђ",desc:"CYRILLIC CAPITAL LETTER DJE"},{"char":"Ѓ",desc:"CYRILLIC CAPITAL LETTER GJE"},{"char":"Є",desc:"CYRILLIC CAPITAL LETTER UKRAINIAN IE"},{"char":"Ѕ",desc:"CYRILLIC CAPITAL LETTER DZE"},{"char":"І",desc:"CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I"},{"char":"Ї",desc:"CYRILLIC CAPITAL LETTER YI"},{"char":"Ј",desc:"CYRILLIC CAPITAL LETTER JE"},{"char":"Љ",desc:"CYRILLIC CAPITAL LETTER LJE"},{"char":"Њ",desc:"CYRILLIC CAPITAL LETTER NJE"},{"char":"Ћ",desc:"CYRILLIC CAPITAL LETTER TSHE"},{"char":"Ќ",desc:"CYRILLIC CAPITAL LETTER KJE"},{"char":"Ѝ",desc:"CYRILLIC CAPITAL LETTER I WITH GRAVE"},{"char":"Ў",desc:"CYRILLIC CAPITAL LETTER SHORT U"},{"char":"Џ",desc:"CYRILLIC CAPITAL LETTER DZHE"},{"char":"А",desc:"CYRILLIC CAPITAL LETTER A"},{"char":"Б",desc:"CYRILLIC CAPITAL LETTER BE"},{"char":"В",desc:"CYRILLIC CAPITAL LETTER VE"},{"char":"Г",desc:"CYRILLIC CAPITAL LETTER GHE"},{"char":"Д",desc:"CYRILLIC CAPITAL LETTER DE"},{"char":"Е",desc:"CYRILLIC CAPITAL LETTER IE"},{"char":"Ж",desc:"CYRILLIC CAPITAL LETTER ZHE"},{"char":"З",desc:"CYRILLIC CAPITAL LETTER ZE"},{"char":"И",desc:"CYRILLIC CAPITAL LETTER I"},{"char":"Й",desc:"CYRILLIC CAPITAL LETTER SHORT I"},{"char":"К",desc:"CYRILLIC CAPITAL LETTER KA"},{"char":"Л",desc:"CYRILLIC CAPITAL LETTER EL"},{"char":"М",desc:"CYRILLIC CAPITAL LETTER EM"},{"char":"Н",desc:"CYRILLIC CAPITAL LETTER EN"},{"char":"О",desc:"CYRILLIC CAPITAL LETTER O"},{"char":"П",desc:"CYRILLIC CAPITAL LETTER PE"},{"char":"Р",desc:"CYRILLIC CAPITAL LETTER ER"},{"char":"С",desc:"CYRILLIC CAPITAL LETTER ES"},{"char":"Т",desc:"CYRILLIC CAPITAL LETTER TE"},{"char":"У",desc:"CYRILLIC CAPITAL LETTER U"},{"char":"Ф",desc:"CYRILLIC CAPITAL LETTER EF"},{"char":"Х",desc:"CYRILLIC CAPITAL LETTER HA"},{"char":"Ц",desc:"CYRILLIC CAPITAL LETTER TSE"},{"char":"Ч",desc:"CYRILLIC CAPITAL LETTER CHE"},{"char":"Ш",desc:"CYRILLIC CAPITAL LETTER SHA"},{"char":"Щ",desc:"CYRILLIC CAPITAL LETTER SHCHA"},{"char":"Ъ",desc:"CYRILLIC CAPITAL LETTER HARD SIGN"},{"char":"Ы",desc:"CYRILLIC CAPITAL LETTER YERU"},{"char":"Ь",desc:"CYRILLIC CAPITAL LETTER SOFT SIGN"},{"char":"Э",desc:"CYRILLIC CAPITAL LETTER E"},{"char":"Ю",desc:"CYRILLIC CAPITAL LETTER YU"},{"char":"Я",desc:"CYRILLIC CAPITAL LETTER YA"},{"char":"а",desc:"CYRILLIC SMALL LETTER A"},{"char":"б",desc:"CYRILLIC SMALL LETTER BE"},{"char":"в",desc:"CYRILLIC SMALL LETTER VE"},{"char":"г",desc:"CYRILLIC SMALL LETTER GHE"},{"char":"д",desc:"CYRILLIC SMALL LETTER DE"},{"char":"е",desc:"CYRILLIC SMALL LETTER IE"},{"char":"ж",desc:"CYRILLIC SMALL LETTER ZHE"},{"char":"з",desc:"CYRILLIC SMALL LETTER ZE"},{"char":"и",desc:"CYRILLIC SMALL LETTER I"},{"char":"й",desc:"CYRILLIC SMALL LETTER SHORT I"},{"char":"к",desc:"CYRILLIC SMALL LETTER KA"},{"char":"л",desc:"CYRILLIC SMALL LETTER EL"},{"char":"м",desc:"CYRILLIC SMALL LETTER EM"},{"char":"н",desc:"CYRILLIC SMALL LETTER EN"},{"char":"о",desc:"CYRILLIC SMALL LETTER O"},{"char":"п",desc:"CYRILLIC SMALL LETTER PE"},{"char":"р",desc:"CYRILLIC SMALL LETTER ER"},{"char":"с",desc:"CYRILLIC SMALL LETTER ES"},{"char":"т",desc:"CYRILLIC SMALL LETTER TE"},{"char":"у",desc:"CYRILLIC SMALL LETTER U"},{"char":"ф",desc:"CYRILLIC SMALL LETTER EF"},{"char":"х",desc:"CYRILLIC SMALL LETTER HA"},{"char":"ц",desc:"CYRILLIC SMALL LETTER TSE"},{"char":"ч",desc:"CYRILLIC SMALL LETTER CHE"},{"char":"ш",desc:"CYRILLIC SMALL LETTER SHA"},{"char":"щ",desc:"CYRILLIC SMALL LETTER SHCHA"},{"char":"ъ",desc:"CYRILLIC SMALL LETTER HARD SIGN"},{"char":"ы",desc:"CYRILLIC SMALL LETTER YERU"},{"char":"ь",desc:"CYRILLIC SMALL LETTER SOFT SIGN"},{"char":"э",desc:"CYRILLIC SMALL LETTER E"},{"char":"ю",desc:"CYRILLIC SMALL LETTER YU"},{"char":"я",desc:"CYRILLIC SMALL LETTER YA"},{"char":"ѐ",desc:"CYRILLIC SMALL LETTER IE WITH GRAVE"},{"char":"ё",desc:"CYRILLIC SMALL LETTER IO"},{"char":"ђ",desc:"CYRILLIC SMALL LETTER DJE"},{"char":"ѓ",desc:"CYRILLIC SMALL LETTER GJE"},{"char":"є",desc:"CYRILLIC SMALL LETTER UKRAINIAN IE"},{"char":"ѕ",desc:"CYRILLIC SMALL LETTER DZE"},{"char":"і",desc:"CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I"},{"char":"ї",desc:"CYRILLIC SMALL LETTER YI"},{"char":"ј",desc:"CYRILLIC SMALL LETTER JE"},{"char":"љ",desc:"CYRILLIC SMALL LETTER LJE"},{"char":"њ",desc:"CYRILLIC SMALL LETTER NJE"},{"char":"ћ",desc:"CYRILLIC SMALL LETTER TSHE"},{"char":"ќ",desc:"CYRILLIC SMALL LETTER KJE"},{"char":"ѝ",desc:"CYRILLIC SMALL LETTER I WITH GRAVE"},{"char":"ў",desc:"CYRILLIC SMALL LETTER SHORT U"},{"char":"џ",desc:"CYRILLIC SMALL LETTER DZHE"}]},{title:"Punctuation",list:[{"char":"–",desc:"EN DASH"},{"char":"—",desc:"EM DASH"},{"char":"‘",desc:"LEFT SINGLE QUOTATION MARK"},{"char":"’",desc:"RIGHT SINGLE QUOTATION MARK"},{"char":"‚",desc:"SINGLE LOW-9 QUOTATION MARK"},{"char":"“",desc:"LEFT DOUBLE QUOTATION MARK"},{"char":"”",desc:"RIGHT DOUBLE QUOTATION MARK"},{"char":"„",desc:"DOUBLE LOW-9 QUOTATION MARK"},{"char":"†",desc:"DAGGER"},{"char":"‡",desc:"DOUBLE DAGGER"},{"char":"•",desc:"BULLET"},{"char":"…",desc:"HORIZONTAL ELLIPSIS"},{"char":"‰",desc:"PER MILLE SIGN"},{"char":"′",desc:"PRIME"},{"char":"″",desc:"DOUBLE PRIME"},{"char":"‹",desc:"SINGLE LEFT-POINTING ANGLE QUOTATION MARK"},{"char":"›",desc:"SINGLE RIGHT-POINTING ANGLE QUOTATION MARK"},{"char":"‾",desc:"OVERLINE"},{"char":"⁄",desc:"FRACTION SLASH"}]},{title:"Currency",list:[{"char":"₠",desc:"EURO-CURRENCY SIGN"},{"char":"₡",desc:"COLON SIGN"},{"char":"₢",desc:"CRUZEIRO SIGN"},{"char":"₣",desc:"FRENCH FRANC SIGN"},{"char":"₤",desc:"LIRA SIGN"},{"char":"₥",desc:"MILL SIGN"},{"char":"₦",desc:"NAIRA SIGN"},{"char":"₧",desc:"PESETA SIGN"},{"char":"₨",desc:"RUPEE SIGN"},{"char":"₩",desc:"WON SIGN"},{"char":"₪",desc:"NEW SHEQEL SIGN"},{"char":"₫",desc:"DONG SIGN"},{"char":"€",desc:"EURO SIGN"},{"char":"₭",desc:"KIP SIGN"},{"char":"₮",desc:"TUGRIK SIGN"},{"char":"₯",desc:"DRACHMA SIGN"},{"char":"₰",desc:"GERMAN PENNY SYMBOL"},{"char":"₱",desc:"PESO SIGN"},{"char":"₲",desc:"GUARANI SIGN"},{"char":"₳",desc:"AUSTRAL SIGN"},{"char":"₴",desc:"HRYVNIA SIGN"},{"char":"₵",desc:"CEDI SIGN"},{"char":"₶",desc:"LIVRE TOURNOIS SIGN"},{"char":"₷",desc:"SPESMILO SIGN"},{"char":"₸",desc:"TENGE SIGN"},{"char":"₹",desc:"INDIAN RUPEE SIGN"}]},{title:"Arrows",list:[{"char":"←",desc:"LEFTWARDS ARROW"},{"char":"↑",desc:"UPWARDS ARROW"},{"char":"→",desc:"RIGHTWARDS ARROW"},{"char":"↓",desc:"DOWNWARDS ARROW"},{"char":"↔",desc:"LEFT RIGHT ARROW"},{"char":"↕",desc:"UP DOWN ARROW"},{"char":"↖",desc:"NORTH WEST ARROW"},{"char":"↗",desc:"NORTH EAST ARROW"},{"char":"↘",desc:"SOUTH EAST ARROW"},{"char":"↙",desc:"SOUTH WEST ARROW"},{"char":"↚",desc:"LEFTWARDS ARROW WITH STROKE"},{"char":"↛",desc:"RIGHTWARDS ARROW WITH STROKE"},{"char":"↜",desc:"LEFTWARDS WAVE ARROW"},{"char":"↝",desc:"RIGHTWARDS WAVE ARROW"},{"char":"↞",desc:"LEFTWARDS TWO HEADED ARROW"},{"char":"↟",desc:"UPWARDS TWO HEADED ARROW"},{"char":"↠",desc:"RIGHTWARDS TWO HEADED ARROW"},{"char":"↡",desc:"DOWNWARDS TWO HEADED ARROW"},{"char":"↢",desc:"LEFTWARDS ARROW WITH TAIL"},{"char":"↣",desc:"RIGHTWARDS ARROW WITH TAIL"},{"char":"↤",desc:"LEFTWARDS ARROW FROM BAR"},{"char":"↥",desc:"UPWARDS ARROW FROM BAR"},{"char":"↦",desc:"RIGHTWARDS ARROW FROM BAR"},{"char":"↧",desc:"DOWNWARDS ARROW FROM BAR"},{"char":"↨",desc:"UP DOWN ARROW WITH BASE"},{"char":"↩",desc:"LEFTWARDS ARROW WITH HOOK"},{"char":"↪",desc:"RIGHTWARDS ARROW WITH HOOK"},{"char":"↫",desc:"LEFTWARDS ARROW WITH LOOP"},{"char":"↬",desc:"RIGHTWARDS ARROW WITH LOOP"},{"char":"↭",desc:"LEFT RIGHT WAVE ARROW"},{"char":"↮",desc:"LEFT RIGHT ARROW WITH STROKE"},{"char":"↯",desc:"DOWNWARDS ZIGZAG ARROW"},{"char":"↰",desc:"UPWARDS ARROW WITH TIP LEFTWARDS"},{"char":"↱",desc:"UPWARDS ARROW WITH TIP RIGHTWARDS"},{"char":"↲",desc:"DOWNWARDS ARROW WITH TIP LEFTWARDS"},{"char":"↳",desc:"DOWNWARDS ARROW WITH TIP RIGHTWARDS"},{"char":"↴",desc:"RIGHTWARDS ARROW WITH CORNER DOWNWARDS"},{"char":"↵",desc:"DOWNWARDS ARROW WITH CORNER LEFTWARDS"},{"char":"↶",desc:"ANTICLOCKWISE TOP SEMICIRCLE ARROW"},{"char":"↷",desc:"CLOCKWISE TOP SEMICIRCLE ARROW"},{"char":"↸",desc:"NORTH WEST ARROW TO LONG BAR"},{"char":"↹",desc:"LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR"},{"char":"↺",desc:"ANTICLOCKWISE OPEN CIRCLE ARROW"},{"char":"↻",desc:"CLOCKWISE OPEN CIRCLE ARROW"},{"char":"↼",desc:"LEFTWARDS HARPOON WITH BARB UPWARDS"},{"char":"↽",desc:"LEFTWARDS HARPOON WITH BARB DOWNWARDS"},{"char":"↾",desc:"UPWARDS HARPOON WITH BARB RIGHTWARDS"},{"char":"↿",desc:"UPWARDS HARPOON WITH BARB LEFTWARDS"},{"char":"⇀",desc:"RIGHTWARDS HARPOON WITH BARB UPWARDS"},{"char":"⇁",desc:"RIGHTWARDS HARPOON WITH BARB DOWNWARDS"},{"char":"⇂",desc:"DOWNWARDS HARPOON WITH BARB RIGHTWARDS"},{"char":"⇃",desc:"DOWNWARDS HARPOON WITH BARB LEFTWARDS"},{"char":"⇄",desc:"RIGHTWARDS ARROW OVER LEFTWARDS ARROW"},{"char":"⇅",desc:"UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW"},{"char":"⇆",desc:"LEFTWARDS ARROW OVER RIGHTWARDS ARROW"},{"char":"⇇",desc:"LEFTWARDS PAIRED ARROWS"},{"char":"⇈",desc:"UPWARDS PAIRED ARROWS"},{"char":"⇉",desc:"RIGHTWARDS PAIRED ARROWS"},{"char":"⇊",desc:"DOWNWARDS PAIRED ARROWS"},{"char":"⇋",desc:"LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON"},{"char":"⇌",desc:"RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON"},{"char":"⇍",desc:"LEFTWARDS DOUBLE ARROW WITH STROKE"},{"char":"⇎",desc:"LEFT RIGHT DOUBLE ARROW WITH STROKE"},{"char":"⇏",desc:"RIGHTWARDS DOUBLE ARROW WITH STROKE"},{"char":"⇐",desc:"LEFTWARDS DOUBLE ARROW"},{"char":"⇑",desc:"UPWARDS DOUBLE ARROW"},{"char":"⇒",desc:"RIGHTWARDS DOUBLE ARROW"},{"char":"⇓",desc:"DOWNWARDS DOUBLE ARROW"},{"char":"⇔",desc:"LEFT RIGHT DOUBLE ARROW"},{"char":"⇕",desc:"UP DOWN DOUBLE ARROW"},{"char":"⇖",desc:"NORTH WEST DOUBLE ARROW"},{"char":"⇗",desc:"NORTH EAST DOUBLE ARROW"},{"char":"⇘",desc:"SOUTH EAST DOUBLE ARROW"},{"char":"⇙",desc:"SOUTH WEST DOUBLE ARROW"},{"char":"⇚",desc:"LEFTWARDS TRIPLE ARROW"},{"char":"⇛",desc:"RIGHTWARDS TRIPLE ARROW"},{"char":"⇜",desc:"LEFTWARDS SQUIGGLE ARROW"},{"char":"⇝",desc:"RIGHTWARDS SQUIGGLE ARROW"},{"char":"⇞",desc:"UPWARDS ARROW WITH DOUBLE STROKE"},{"char":"⇟",desc:"DOWNWARDS ARROW WITH DOUBLE STROKE"},{"char":"⇠",desc:"LEFTWARDS DASHED ARROW"},{"char":"⇡",desc:"UPWARDS DASHED ARROW"},{"char":"⇢",desc:"RIGHTWARDS DASHED ARROW"},{"char":"⇣",desc:"DOWNWARDS DASHED ARROW"},{"char":"⇤",desc:"LEFTWARDS ARROW TO BAR"},{"char":"⇥",desc:"RIGHTWARDS ARROW TO BAR"},{"char":"⇦",desc:"LEFTWARDS WHITE ARROW"},{"char":"⇧",desc:"UPWARDS WHITE ARROW"},{"char":"⇨",desc:"RIGHTWARDS WHITE ARROW"},{"char":"⇩",desc:"DOWNWARDS WHITE ARROW"},{"char":"⇪",desc:"UPWARDS WHITE ARROW FROM BAR"},{"char":"⇫",desc:"UPWARDS WHITE ARROW ON PEDESTAL"},{"char":"⇬",desc:"UPWARDS WHITE ARROW ON PEDESTAL WITH HORIZONTAL BAR"},{"char":"⇭",desc:"UPWARDS WHITE ARROW ON PEDESTAL WITH VERTICAL BAR"},{"char":"⇮",desc:"UPWARDS WHITE DOUBLE ARROW"},{"char":"⇯",desc:"UPWARDS WHITE DOUBLE ARROW ON PEDESTAL"},{"char":"⇰",desc:"RIGHTWARDS WHITE ARROW FROM WALL"},{"char":"⇱",desc:"NORTH WEST ARROW TO CORNER"},{"char":"⇲",desc:"SOUTH EAST ARROW TO CORNER"},{"char":"⇳",desc:"UP DOWN WHITE ARROW"},{"char":"⇴",desc:"RIGHT ARROW WITH SMALL CIRCLE"},{"char":"⇵",desc:"DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW"},{"char":"⇶",desc:"THREE RIGHTWARDS ARROWS"},{"char":"⇷",desc:"LEFTWARDS ARROW WITH VERTICAL STROKE"},{"char":"⇸",desc:"RIGHTWARDS ARROW WITH VERTICAL STROKE"},{"char":"⇹",desc:"LEFT RIGHT ARROW WITH VERTICAL STROKE"},{"char":"⇺",desc:"LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE"},{"char":"⇻",desc:"RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE"},{"char":"⇼",desc:"LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE"},{"char":"⇽",desc:"LEFTWARDS OPEN-HEADED ARROW"},{"char":"⇾",desc:"RIGHTWARDS OPEN-HEADED ARROW"},{"char":"⇿",desc:"LEFT RIGHT OPEN-HEADED ARROW"}]},{title:"Math",list:[{"char":"∀",desc:"FOR ALL"},{"char":"∂",desc:"PARTIAL DIFFERENTIAL"},{"char":"∃",desc:"THERE EXISTS"},{"char":"∅",desc:"EMPTY SET"},{"char":"∇",desc:"NABLA"},{"char":"∈",desc:"ELEMENT OF"},{"char":"∉",desc:"NOT AN ELEMENT OF"},{"char":"∋",desc:"CONTAINS AS MEMBER"},{"char":"∏",desc:"N-ARY PRODUCT"},{"char":"∑",desc:"N-ARY SUMMATION"},{"char":"−",desc:"MINUS SIGN"},{"char":"∗",desc:"ASTERISK OPERATOR"},{"char":"√",desc:"SQUARE ROOT"},{"char":"∝",desc:"PROPORTIONAL TO"},{"char":"∞",desc:"INFINITY"},{"char":"∠",desc:"ANGLE"},{"char":"∧",desc:"LOGICAL AND"},{"char":"∨",desc:"LOGICAL OR"},{"char":"∩",desc:"INTERSECTION"},{"char":"∪",desc:"UNION"},{"char":"∫",desc:"INTEGRAL"},{"char":"∴",desc:"THEREFORE"},{"char":"∼",desc:"TILDE OPERATOR"},{"char":"≅",desc:"APPROXIMATELY EQUAL TO"},{"char":"≈",desc:"ALMOST EQUAL TO"},{"char":"≠",desc:"NOT EQUAL TO"},{"char":"≡",desc:"IDENTICAL TO"},{"char":"≤",desc:"LESS-THAN OR EQUAL TO"},{"char":"≥",desc:"GREATER-THAN OR EQUAL TO"},{"char":"⊂",desc:"SUBSET OF"},{"char":"⊃",desc:"SUPERSET OF"},{"char":"⊄",desc:"NOT A SUBSET OF"},{"char":"⊆",desc:"SUBSET OF OR EQUAL TO"},{"char":"⊇",desc:"SUPERSET OF OR EQUAL TO"},{"char":"⊕",desc:"CIRCLED PLUS"},{"char":"⊗",desc:"CIRCLED TIMES"},{"char":"⊥",desc:"UP TACK"}]},{title:"Misc",list:[{"char":"♠",desc:"BLACK SPADE SUIT"},{"char":"♣",desc:"BLACK CLUB SUIT"},{"char":"♥",desc:"BLACK HEART SUIT"},{"char":"♦",desc:"BLACK DIAMOND SUIT"},{"char":"♩",desc:"QUARTER NOTE"},{"char":"♪",desc:"EIGHTH NOTE"},{"char":"♫",desc:"BEAMED EIGHTH NOTES"},{"char":"♬",desc:"BEAMED SIXTEENTH NOTES"},{"char":"♭",desc:"MUSIC FLAT SIGN"},{"char":"♮",desc:"MUSIC NATURAL SIGN"},{"char":"☀",desc:"BLACK SUN WITH RAYS"},{"char":"☁",desc:"CLOUD"},{"char":"☂",desc:"UMBRELLA"},{"char":"☃",desc:"SNOWMAN"},{"char":"☕",desc:"HOT BEVERAGE"},{"char":"☘",desc:"SHAMROCK"},{"char":"☯",desc:"YIN YANG"},{"char":"✔",desc:"HEAVY CHECK MARK"},{"char":"✖",desc:"HEAVY MULTIPLICATION X"},{"char":"❄",desc:"SNOWFLAKE"},{"char":"❛",desc:"HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT"},{"char":"❜",desc:"HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT"},{"char":"❝",desc:"HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT"},{"char":"❞",desc:"HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT"},{"char":"❤",desc:"HEAVY BLACK HEART"}]}]}),s.FE.PLUGINS.specialCharacters=function(a){var I,e,R="special_characters";function r(E,c){a.events.disableBlur(),E.focus(),c.preventDefault(),c.stopPropagation()}return{_init:function(){},show:function(){if(!I){var E="<h4>"+a.language.translate("Special Characters")+"</h4>",c=function(){for(var E='<div class="fr-special-characters-modal">',c=0;c<a.opts.specialCharactersSets.length;c++){for(var T=a.opts.specialCharactersSets[c],R=T.list,L='<div class="fr-special-characters-list"><p class="fr-special-characters-title">'+a.language.translate(T.title)+"</p>",A=0;A<R.length;A++){var I=R[A];L+='<span class="fr-command fr-special-character" tabIndex="-1" role="button" value="'+I["char"]+'" title="'+I.desc+'">'+I["char"]+'<span class="fr-sr-only">'+a.language.translate(I.desc)+" </span></span>"}E+=L+"</div>"}return E+="</div>"}(),T=a.modals.create(R,E,c);I=T.$modal,T.$head,e=T.$body,a.events.$on(s(a.o_win),"resize",function(){(I.data("instance")||a).modals.resize(R)}),a.events.bindClick(e,".fr-special-character",function(E){var c=I.data("instance")||a,T=s(E.currentTarget);c.specialCharacters.insert(T)}),a.events.$on(e,"keydown",function(E){var c=E.which,T=e.find("span.fr-special-character:focus:first");if(!(T.length||c!=s.FE.KEYCODE.F10||a.keys.ctrlKey(E)||E.shiftKey)&&E.altKey)return r(e.find("span.fr-special-character:first"),E),!1;if(c==s.FE.KEYCODE.TAB||c==s.FE.KEYCODE.ARROW_LEFT||c==s.FE.KEYCODE.ARROW_RIGHT){var R=null,L=null,A=!1;return c==s.FE.KEYCODE.ARROW_LEFT||c==s.FE.KEYCODE.ARROW_RIGHT?(L=c==s.FE.KEYCODE.ARROW_RIGHT,A=!0):L=!E.shiftKey,T.length?(A&&(R=L?T.nextAll("span.fr-special-character:first"):T.prevAll("span.fr-special-character:first")),R&&R.length||(R=L?T.parent().next().find("span.fr-special-character:first"):T.parent().prev().find("span.fr-special-character:"+(A?"last":"first"))).length||(R=e.find("span.fr-special-character:"+(L?"first":"last")))):R=e.find("span.fr-special-character:"+(L?"first":"last")),r(R,E),!1}if(c!=s.FE.KEYCODE.ENTER||!T.length)return!0;(I.data("instance")||a).specialCharacters.insert(T)},!0)}a.modals.show(R),a.modals.resize(R)},hide:function(){a.modals.hide(R)},insert:function(E){a.specialCharacters.hide(),a.undo.saveStep(),a.html.insert(E.attr("value"),!0),a.undo.saveStep()}}},s.FroalaEditor.DefineIcon("specialCharacters",{template:"text",NAME:"Ω"}),s.FE.RegisterCommand("specialCharacters",{title:"Special Characters",icon:"specialCharacters",undo:!1,focus:!1,modal:!0,callback:function(){this.specialCharacters.show()},plugin:"specialCharacters",showOnMobile:!0})});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*!
|
2
|
-
* froala_editor v2.9.
|
3
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
-
* Copyright 2014-2019 Froala Labs
|
5
|
-
*/
|
6
|
-
|
7
|
-
!function(l){"function"==typeof define&&define.amd?define(["jquery"],l):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),l(t)}:l(window.jQuery)}(function(Z){Z.extend(Z.FE.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_][_CUSTOM_COLOR_]"}),Z.extend(Z.FE.DEFAULTS,{tableInsertMaxSize:10,tableEditButtons:["tableHeader","tableRemove","|","tableRows","tableColumns","tableStyle","-","tableCells","tableCellBackground","tableCellVerticalAlign","tableCellHorizontalAlign","tableCellStyle"],tableInsertButtons:["tableBack","|"],tableResizer:!0,tableDefaultWidth:"100%",tableResizerOffset:5,tableResizingLimit:30,tableColorsButtons:["tableBack","|"],tableColors:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],tableColorsStep:7,tableCellStyles:{"fr-highlighted":"Highlighted","fr-thick":"Thick"},tableStyles:{"fr-dashed-borders":"Dashed Borders","fr-alternate-rows":"Alternate Rows"},tableCellMultipleStyles:!0,tableMultipleStyles:!0,tableInsertHelper:!0,tableInsertHelperOffset:15}),Z.FE.PLUGINS.table=function(w){var C,o,s,n,a,r,E;function h(){var e=O();if(e){var t=w.popups.get("table.edit");if(t||(t=p()),t){w.popups.setContainer("table.edit",w.$sc);var l=M(e),a=(l.left+l.right)/2,s=l.bottom;w.popups.show("table.edit",a,s,l.bottom-l.top),w.edit.isDisabled()&&(1<J().length&&w.toolbar.disable(),w.$el.removeClass("fr-no-selection"),w.edit.on(),w.button.bulkRefresh(),w.selection.setAtEnd(w.$el.find(".fr-selected-cell:last").get(0)),w.selection.restore())}}}function f(){var e,t,l,a,s=O();if(s){var n=w.popups.get("table.colors");n||(n=function(){var e="";0<w.opts.tableColorsButtons.length&&(e='<div class="fr-buttons fr-table-colors-buttons">'+w.button.buildList(w.opts.tableColorsButtons)+"</div>");var t="";w.opts.colorsHEXInput&&(t='<div class="fr-table-colors-hex-layer fr-active fr-layer" id="fr-table-colors-hex-layer-'+w.id+'"><div class="fr-input-line"><input maxlength="7" id="fr-table-colors-hex-layer-text-'+w.id+'" type="text" placeholder="'+w.language.translate("HEX Color")+'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="tableCellBackgroundCustomColor" tabIndex="2" role="button">'+w.language.translate("OK")+"</button></div></div>");var l={buttons:e,colors:function(){for(var e='<div class="fr-table-colors">',t=0;t<w.opts.tableColors.length;t++)0!==t&&t%w.opts.tableColorsStep==0&&(e+="<br>"),"REMOVE"!=w.opts.tableColors[t]?e+='<span class="fr-command" style="background: '+w.opts.tableColors[t]+';" tabIndex="-1" role="button" data-cmd="tableCellBackgroundColor" data-param1="'+w.opts.tableColors[t]+'"><span class="fr-sr-only">'+w.language.translate("Color")+" "+w.opts.tableColors[t]+" </span></span>":e+='<span class="fr-command" data-cmd="tableCellBackgroundColor" tabIndex="-1" role="button" data-param1="REMOVE" title="'+w.language.translate("Clear Formatting")+'">'+w.icon.create("tableColorRemove")+'<span class="fr-sr-only">'+w.language.translate("Clear Formatting")+"</span></span>";return e+="</div>"}(),custom_color:t},a=w.popups.create("table.colors",l);return w.events.$on(w.$wp,"scroll.table-colors",function(){w.popups.isVisible("table.colors")&&f()}),u=a,w.events.on("popup.tab",function(e){var t=Z(e.currentTarget);if(!w.popups.isVisible("table.colors")||!t.is("span"))return!0;var l=e.which,a=!0;if(Z.FE.KEYCODE.TAB==l){var s=u.find(".fr-buttons");a=!w.accessibility.focusToolbar(s,!!e.shiftKey)}else if(Z.FE.KEYCODE.ARROW_UP==l||Z.FE.KEYCODE.ARROW_DOWN==l||Z.FE.KEYCODE.ARROW_LEFT==l||Z.FE.KEYCODE.ARROW_RIGHT==l){var n=t.parent().find("span.fr-command"),r=n.index(t),o=w.opts.colorsStep,i=Math.floor(n.length/o),f=r%o,c=Math.floor(r/o),d=c*o+f,p=i*o;Z.FE.KEYCODE.ARROW_UP==l?d=((d-o)%p+p)%p:Z.FE.KEYCODE.ARROW_DOWN==l?d=(d+o)%p:Z.FE.KEYCODE.ARROW_LEFT==l?d=((d-1)%p+p)%p:Z.FE.KEYCODE.ARROW_RIGHT==l&&(d=(d+1)%p);var h=Z(n.get(d));w.events.disableBlur(),h.focus(),a=!1}else Z.FE.KEYCODE.ENTER==l&&(w.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0),a;var u}()),w.popups.setContainer("table.colors",w.$sc);var r=M(s),o=(r.left+r.right)/2,i=r.bottom;e=w.popups.get("table.colors"),t=w.$el.find(".fr-selected-cell:first"),l=w.helpers.RGBToHex(t.css("background-color")),a=e.find(".fr-table-colors-hex-layer input"),e.find(".fr-selected-color").removeClass("fr-selected-color fr-active-item"),e.find('span[data-param1="'+l+'"]').addClass("fr-selected-color fr-active-item"),a.val(l).trigger("change"),w.popups.show("table.colors",o,i,r.bottom-r.top)}}function i(){0===J().length&&w.toolbar.enable()}function c(e){if(e)return w.popups.onHide("table.insert",function(){w.popups.get("table.insert").find('.fr-table-size .fr-select-table-size > span[data-row="1"][data-col="1"]').trigger("mouseenter")}),!0;var t="";0<w.opts.tableInsertButtons.length&&(t='<div class="fr-buttons">'+w.button.buildList(w.opts.tableInsertButtons)+"</div>");var l,a={buttons:t,rows_columns:function(){for(var e='<div class="fr-table-size"><div class="fr-table-size-info">1 × 1</div><div class="fr-select-table-size">',t=1;t<=w.opts.tableInsertMaxSize;t++){for(var l=1;l<=w.opts.tableInsertMaxSize;l++){var a="inline-block";2<t&&!w.helpers.isMobile()&&(a="none");var s="fr-table-cell ";1==t&&1==l&&(s+=" hover"),e+='<span class="fr-command '+s+'" tabIndex="-1" data-cmd="tableInsert" data-row="'+t+'" data-col="'+l+'" data-param1="'+t+'" data-param2="'+l+'" style="display: '+a+';" role="button"><span></span><span class="fr-sr-only">'+t+" × "+l+" </span></span>"}e+='<div class="new-line"></div>'}return e+="</div></div>"}()},s=w.popups.create("table.insert",a);return w.events.$on(s,"mouseenter",".fr-table-size .fr-select-table-size .fr-table-cell",function(e){d(Z(e.currentTarget))},!0),l=s,w.events.$on(l,"focus","[tabIndex]",function(e){var t=Z(e.currentTarget);d(t)}),w.events.on("popup.tab",function(e){var t=Z(e.currentTarget);if(!w.popups.isVisible("table.insert")||!t.is("span, a"))return!0;var l,a=e.which;if(Z.FE.KEYCODE.ARROW_UP==a||Z.FE.KEYCODE.ARROW_DOWN==a||Z.FE.KEYCODE.ARROW_LEFT==a||Z.FE.KEYCODE.ARROW_RIGHT==a){if(t.is("span.fr-table-cell")){var s=t.parent().find("span.fr-table-cell"),n=s.index(t),r=w.opts.tableInsertMaxSize,o=n%r,i=Math.floor(n/r);Z.FE.KEYCODE.ARROW_UP==a?i=Math.max(0,i-1):Z.FE.KEYCODE.ARROW_DOWN==a?i=Math.min(w.opts.tableInsertMaxSize-1,i+1):Z.FE.KEYCODE.ARROW_LEFT==a?o=Math.max(0,o-1):Z.FE.KEYCODE.ARROW_RIGHT==a&&(o=Math.min(w.opts.tableInsertMaxSize-1,o+1));var f=i*r+o,c=Z(s.get(f));d(c),w.events.disableBlur(),c.focus(),l=!1}}else Z.FE.KEYCODE.ENTER==a&&(w.button.exec(t),l=!1);return!1===l&&(e.preventDefault(),e.stopPropagation()),l},!0),s}function d(e){var t=e.data("row"),l=e.data("col"),a=e.parent();a.siblings(".fr-table-size-info").html(t+" × "+l),a.find("> span").removeClass("hover fr-active-item");for(var s=1;s<=w.opts.tableInsertMaxSize;s++)for(var n=0;n<=w.opts.tableInsertMaxSize;n++){var r=a.find('> span[data-row="'+s+'"][data-col="'+n+'"]');s<=t&&n<=l?r.addClass("hover"):s<=t+1||s<=2&&!w.helpers.isMobile()?r.css("display","inline-block"):2<s&&!w.helpers.isMobile()&&r.css("display","none")}e.addClass("fr-active-item")}function p(e){if(e)return w.popups.onHide("table.edit",i),!0;if(0<w.opts.tableEditButtons.length){var t={buttons:'<div class="fr-buttons">'+w.button.buildList(w.opts.tableEditButtons)+"</div>"},l=w.popups.create("table.edit",t);return w.events.$on(w.$wp,"scroll.table-edit",function(){w.popups.isVisible("table.edit")&&h()}),l}return!1}function u(){if(0<J().length){var e=Q();w.selection.setBefore(e.get(0))||w.selection.setAfter(e.get(0)),w.selection.restore(),w.popups.hide("table.edit"),e.remove(),w.toolbar.enable()}}function b(e){var t=Q();if(0<t.length){if(0<w.$el.find("th.fr-selected-cell").length&&"above"==e)return;var l,a,s,n=O(),r=$(n);a="above"==e?r.min_i:r.max_i;var o="<tr>";for(l=0;l<n[a].length;l++){if("below"==e&&a<n.length-1&&n[a][l]==n[a+1][l]||"above"==e&&0<a&&n[a][l]==n[a-1][l]){if(0===l||0<l&&n[a][l]!=n[a][l-1]){var i=Z(n[a][l]);i.attr("rowspan",parseInt(i.attr("rowspan"),10)+1)}}else o+='<td style="'+Z(n[a][l]).attr("style")+'" ><br></td>'}o+="</tr>",s=0<w.$el.find("th.fr-selected-cell").length&&"below"==e?Z(t.find("tbody").not(t.find("table tbody"))):Z(t.find("tr").not(t.find("table tr")).get(a)),"below"==e?"TBODY"==s.prop("tagName")?s.prepend(o):s.after(o):"above"==e&&(s.before(o),w.popups.isVisible("table.edit")&&h())}}function g(e,t,l){var a,s,n,r,o,i=0,f=O(l);if(e<(t=Math.min(t,f[0].length-1)))for(s=e;s<=t;s++)if(!(e<s&&f[0][s]==f[0][s-1])&&1<(r=Math.min(parseInt(f[0][s].getAttribute("colspan"),10)||1,t-e+1))&&f[0][s]==f[0][s+1])for(i=r-1,a=1;a<f.length;a++)if(f[a][s]!=f[a-1][s]){for(n=s;n<s+r;n++)if(1<(o=parseInt(f[a][n].getAttribute("colspan"),10)||1)&&f[a][n]==f[a][n+1])n+=i=Math.min(i,o-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&v(f,i,"colspan",0,f.length-1,e,t)}function m(e,t,l){var a,s,n,r,o,i=0,f=O(l);if(e<(t=Math.min(t,f.length-1)))for(a=e;a<=t;a++)if(!(e<a&&f[a][0]==f[a-1][0])&&1<(r=Math.min(parseInt(f[a][0].getAttribute("rowspan"),10)||1,t-e+1))&&f[a][0]==f[a+1][0])for(i=r-1,s=1;s<f[0].length;s++)if(f[a][s]!=f[a][s-1]){for(n=a;n<a+r;n++)if(1<(o=parseInt(f[n][s].getAttribute("rowspan"),10)||1)&&f[n][s]==f[n+1][s])n+=i=Math.min(i,o-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&v(f,i,"rowspan",e,t,0,f[0].length-1)}function v(e,t,l,a,s,n,r){var o,i,f;for(o=a;o<=s;o++)for(i=n;i<=r;i++)a<o&&e[o][i]==e[o-1][i]||n<i&&e[o][i]==e[o][i-1]||1<(f=parseInt(e[o][i].getAttribute(l),10)||1)&&(1<f-t?e[o][i].setAttribute(l,f-t):e[o][i].removeAttribute(l))}function R(e,t,l,a,s){m(e,t,s),g(l,a,s)}function t(e){var t=w.$el.find(".fr-selected-cell");"REMOVE"!=e?t.css("background-color",w.helpers.HEXtoRGB(e)):t.css("background-color",""),h()}function O(e){var f=[];return null==(e=e||null)&&0<J().length&&(e=Q()),e&&e.find("tr:visible").not(e.find("table tr")).each(function(o,e){var t=Z(e),i=0;t.find("> th, > td").each(function(e,t){for(var l=Z(t),a=parseInt(l.attr("colspan"),10)||1,s=parseInt(l.attr("rowspan"),10)||1,n=o;n<o+s;n++)for(var r=i;r<i+a;r++)f[n]||(f[n]=[]),f[n][r]?i++:f[n][r]=t;i+=a})}),f}function A(e,t){for(var l=0;l<t.length;l++)for(var a=0;a<t[l].length;a++)if(t[l][a]==e)return{row:l,col:a}}function F(e,t,l){for(var a=e+1,s=t+1;a<l.length;){if(l[a][t]!=l[e][t]){a--;break}a++}for(a==l.length&&a--;s<l[e].length;){if(l[e][s]!=l[e][t]){s--;break}s++}return s==l[e].length&&s--,{row:a,col:s}}function x(){w.el.querySelector(".fr-cell-fixed")&&w.el.querySelector(".fr-cell-fixed").classList.remove("fr-cell-fixed"),w.el.querySelector(".fr-cell-handler")&&w.el.querySelector(".fr-cell-handler").classList.remove("fr-cell-handler")}function D(){var e=w.$el.find(".fr-selected-cell");0<e.length&&e.each(function(){var e=Z(this);e.removeClass("fr-selected-cell"),""===e.attr("class")&&e.removeAttr("class")}),x()}function y(){w.events.disableBlur(),w.selection.clear(),w.$el.addClass("fr-no-selection"),w.$el.blur(),w.events.enableBlur()}function $(e){var t=w.$el.find(".fr-selected-cell");if(0<t.length){var l,a=e.length,s=0,n=e[0].length,r=0;for(l=0;l<t.length;l++){var o=A(t[l],e),i=F(o.row,o.col,e);a=Math.min(o.row,a),s=Math.max(i.row,s),n=Math.min(o.col,n),r=Math.max(i.col,r)}return{min_i:a,max_i:s,min_j:n,max_j:r}}return null}function M(e){var t=$(e),l=Z(e[t.min_i][t.min_j]),a=Z(e[t.min_i][t.max_j]),s=Z(e[t.max_i][t.min_j]);return{left:l.offset().left,right:a.offset().left+a.outerWidth(),top:l.offset().top,bottom:s.offset().top+s.outerHeight()}}function _(t,l){if(Z(t).is(l))D(),Z(t).addClass("fr-selected-cell");else{y(),w.edit.off();var a=O(),s=A(t,a),n=A(l,a),r=function e(t,l,a,s,n){var r,o,i,f,c=t,d=l,p=a,h=s;for(r=c;r<=d;r++)(1<(parseInt(Z(n[r][p]).attr("rowspan"),10)||1)||1<(parseInt(Z(n[r][p]).attr("colspan"),10)||1))&&(f=F((i=A(n[r][p],n)).row,i.col,n),c=Math.min(i.row,c),d=Math.max(f.row,d),p=Math.min(i.col,p),h=Math.max(f.col,h)),(1<(parseInt(Z(n[r][h]).attr("rowspan"),10)||1)||1<(parseInt(Z(n[r][h]).attr("colspan"),10)||1))&&(f=F((i=A(n[r][h],n)).row,i.col,n),c=Math.min(i.row,c),d=Math.max(f.row,d),p=Math.min(i.col,p),h=Math.max(f.col,h));for(o=p;o<=h;o++)(1<(parseInt(Z(n[c][o]).attr("rowspan"),10)||1)||1<(parseInt(Z(n[c][o]).attr("colspan"),10)||1))&&(f=F((i=A(n[c][o],n)).row,i.col,n),c=Math.min(i.row,c),d=Math.max(f.row,d),p=Math.min(i.col,p),h=Math.max(f.col,h)),(1<(parseInt(Z(n[d][o]).attr("rowspan"),10)||1)||1<(parseInt(Z(n[d][o]).attr("colspan"),10)||1))&&(f=F((i=A(n[d][o],n)).row,i.col,n),c=Math.min(i.row,c),d=Math.max(f.row,d),p=Math.min(i.col,p),h=Math.max(f.col,h));return c==t&&d==l&&p==a&&h==s?{min_i:t,max_i:l,min_j:a,max_j:s}:e(c,d,p,h,n)}(Math.min(s.row,n.row),Math.max(s.row,n.row),Math.min(s.col,n.col),Math.max(s.col,n.col),a);D(),t.classList.add("fr-cell-fixed"),l.classList.add("fr-cell-handler");for(var o=r.min_i;o<=r.max_i;o++)for(var i=r.min_j;i<=r.max_j;i++)Z(a[o][i]).addClass("fr-selected-cell")}}function I(e){var t=null,l=Z(e.target);return"TD"==e.target.tagName||"TH"==e.target.tagName?t=e.target:0<l.closest("td").length?t=l.closest("td").get(0):0<l.closest("th").length&&(t=l.closest("th").get(0)),0===w.$el.find(t).length?null:t}function S(){D(),w.popups.hide("table.edit")}function e(e){var t=I(e);if("false"==Z(t).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;if(0<J().length&&!t&&S(),!w.edit.isDisabled()||w.popups.isVisible("table.edit"))if(1!=e.which||1==e.which&&w.helpers.isMac()&&e.ctrlKey)(3==e.which||1==e.which&&w.helpers.isMac()&&e.ctrlKey)&&t&&S();else if(n=!0,t){0<J().length&&!e.shiftKey&&S(),e.stopPropagation(),w.events.trigger("image.hideResizer"),w.events.trigger("video.hideResizer"),s=!0;var l=t.tagName.toLowerCase();e.shiftKey&&0<w.$el.find(l+".fr-selected-cell").length?Z(w.$el.find(l+".fr-selected-cell").closest("table")).is(Z(t).closest("table"))?_(a,t):y():((w.keys.ctrlKey(e)||e.shiftKey)&&(1<J().length||0===Z(t).find(w.selection.element()).length&&!Z(t).is(w.selection.element()))&&y(),a=t,0<w.opts.tableEditButtons.length&&_(a,a))}}function l(e){if(w.popups.areVisible())return!0;if(s||w.$tb.is(e.target)||w.$tb.is(Z(e.target).closest(w.$tb.get(0)))||(0<J().length&&w.toolbar.enable(),D()),!(1!=e.which||1==e.which&&w.helpers.isMac()&&e.ctrlKey)){if(n=!1,s)s=!1,I(e)||1!=J().length?0<J().length&&(w.selection.isCollapsed()?h():D()):D();if(E){E=!1,C.removeClass("fr-moving"),w.$el.removeClass("fr-no-selection"),w.edit.on();var t=parseFloat(C.css("left"))+w.opts.tableResizerOffset+w.$wp.offset().left;w.opts.iframe&&(t-=w.$iframe.offset().left),C.data("release-position",t),C.removeData("max-left"),C.removeData("max-right"),function(){var e=C.data("origin"),t=C.data("release-position");if(e!==t){var l=C.data("first"),a=C.data("second"),s=C.data("table"),n=s.outerWidth();if(w.undo.canDo()||w.undo.saveStep(),null!==l&&null!==a){var r,o,i,f=O(s),c=[],d=[],p=[],h=[];for(r=0;r<f.length;r++)o=Z(f[r][l]),i=Z(f[r][a]),c[r]=o.outerWidth(),p[r]=i.outerWidth(),d[r]=c[r]/n*100,h[r]=p[r]/n*100;for(r=0;r<f.length;r++)if(o=Z(f[r][l]),i=Z(f[r][a]),f[r][l]!=f[r][a]){var u=(d[r]*(c[r]+t-e)/c[r]).toFixed(4);o.css("width",u+"%"),i.css("width",(d[r]+h[r]-u).toFixed(4)+"%")}}else{var b,g=s.parent(),m=n/g.width()*100,v=(parseInt(s.css("margin-left"),10)||0)/g.width()*100,E=(parseInt(s.css("margin-right"),10)||0)/g.width()*100;"rtl"==w.opts.direction&&0===a||"rtl"!=w.opts.direction&&0!==a?(b=(n+t-e)/n*m,s.css("margin-right","calc(100% - "+Math.round(b).toFixed(4)+"% - "+Math.round(v).toFixed(4)+"%)")):("rtl"==w.opts.direction&&0!==a||"rtl"!=w.opts.direction&&0===a)&&(b=(n-t+e)/n*m,s.css("margin-left","calc(100% - "+Math.round(b).toFixed(4)+"% - "+Math.round(E).toFixed(4)+"%)")),s.css("width",Math.round(b).toFixed(4)+"%")}w.selection.restore(),w.undo.saveStep(),w.events.trigger("table.resized",[s.get(0)])}C.removeData("origin"),C.removeData("release-position"),C.removeData("first"),C.removeData("second"),C.removeData("table")}(),W()}}}function T(e){if(!0===s&&0<w.opts.tableEditButtons.length){if(Z(e.currentTarget).closest("table").is(Q())){if("TD"==e.currentTarget.tagName&&0===w.$el.find("th.fr-selected-cell").length)return void _(a,e.currentTarget);if("TH"==e.currentTarget.tagName&&0===w.$el.find("td.fr-selected-cell").length)return void _(a,e.currentTarget)}y()}}function N(e,t,l,a){for(var s,n=t;n!=w.el&&"TD"!=n.tagName&&"TH"!=n.tagName&&("up"==a?s=n.previousElementSibling:"down"==a&&(s=n.nextElementSibling),!s);)n=n.parentNode;"TD"==n.tagName||"TH"==n.tagName?function(e,t){for(var l=e;l&&"TABLE"!=l.tagName&&l.parentNode!=w.el;)l=l.parentNode;if(l&&"TABLE"==l.tagName){var a=O(Z(l));"up"==t?B(A(e,a),l,a):"down"==t&&z(A(e,a),l,a)}}(n,a):s&&("up"==a&&w.selection.setAtEnd(s),"down"==a&&w.selection.setAtStart(s))}function B(e,t,l){0<e.row?w.selection.setAtEnd(l[e.row-1][e.col]):N(0,t,0,"up")}function z(e,t,l){var a=parseInt(l[e.row][e.col].getAttribute("rowspan"),10)||1;e.row<l.length-a?w.selection.setAtStart(l[e.row+a][e.col]):N(0,t,0,"down")}function W(){C&&(C.find("div").css("opacity",0),C.css("top",0),C.css("left",0),C.css("height",0),C.find("div").css("height",0),C.hide())}function k(){o&&o.removeClass("fr-visible").css("left","-9999px")}function K(e,t){var l=Z(t),a=l.closest("table"),s=a.parent();if(t&&"TD"!=t.tagName&&"TH"!=t.tagName&&(0<l.closest("td").length?t=l.closest("td"):0<l.closest("th").length&&(t=l.closest("th"))),!t||"TD"!=t.tagName&&"TH"!=t.tagName)C&&l.get(0)!=C.get(0)&&l.parent().get(0)!=C.get(0)&&w.core.sameInstance(C)&&W();else{if(l=Z(t),0===w.$el.find(l).length)return!1;var n=l.offset().left-1,r=n+l.outerWidth();if(Math.abs(e.pageX-n)<=w.opts.tableResizerOffset||Math.abs(r-e.pageX)<=w.opts.tableResizerOffset){var o,i,f,c,d,p=O(a),h=A(t,p),u=F(h.row,h.col,p),b=a.offset().top,g=a.outerHeight()-1;"rtl"!=w.opts.direction?e.pageX-n<=w.opts.tableResizerOffset?(f=n,0<h.col?(c=n-j(h.col-1,p)+w.opts.tableResizingLimit,d=n+j(h.col,p)-w.opts.tableResizingLimit,o=h.col-1,i=h.col):(o=null,i=0,c=a.offset().left-1-parseInt(a.css("margin-left"),10),d=a.offset().left-1+a.width()-p[0].length*w.opts.tableResizingLimit)):r-e.pageX<=w.opts.tableResizerOffset&&(f=r,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=r-j(u.col,p)+w.opts.tableResizingLimit,d=r+j(u.col+1,p)-w.opts.tableResizingLimit,o=u.col,i=u.col+1):(o=u.col,i=null,c=a.offset().left-1+p[0].length*w.opts.tableResizingLimit,d=s.offset().left-1+s.width()+parseFloat(s.css("padding-left")))):r-e.pageX<=w.opts.tableResizerOffset?(f=r,0<h.col?(c=r-j(h.col,p)+w.opts.tableResizingLimit,d=r+j(h.col-1,p)-w.opts.tableResizingLimit,o=h.col,i=h.col-1):(o=null,i=0,c=a.offset().left+p[0].length*w.opts.tableResizingLimit,d=s.offset().left-1+s.width()+parseFloat(s.css("padding-left")))):e.pageX-n<=w.opts.tableResizerOffset&&(f=n,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=n-j(u.col+1,p)+w.opts.tableResizingLimit,d=n+j(u.col,p)-w.opts.tableResizingLimit,o=u.col+1,i=u.col):(o=u.col,i=null,c=s.offset().left+parseFloat(s.css("padding-left")),d=a.offset().left-1+a.width()-p[0].length*w.opts.tableResizingLimit)),C||(w.shared.$table_resizer||(w.shared.$table_resizer=Z('<div class="fr-table-resizer"><div></div></div>')),C=w.shared.$table_resizer,w.events.$on(C,"mousedown",function(e){return!w.core.sameInstance(C)||(0<J().length&&S(),1==e.which?(w.selection.save(),E=!0,C.addClass("fr-moving"),y(),w.edit.off(),C.find("div").css("opacity",1),!1):void 0)}),w.events.$on(C,"mousemove",function(e){if(!w.core.sameInstance(C))return!0;E&&(w.opts.iframe&&(e.pageX-=w.$iframe.offset().left),X(e))}),w.events.on("shared.destroy",function(){C.html("").removeData().remove(),C=null},!0),w.events.on("destroy",function(){w.$el.find(".fr-selected-cell").removeClass("fr-selected-cell"),C.hide().appendTo(Z("body:first"))},!0)),C.data("table",a),C.data("first",o),C.data("second",i),C.data("instance",w),w.$wp.append(C);var m=f-w.win.pageXOffset-w.opts.tableResizerOffset-w.$wp.offset().left,v=b-w.$wp.offset().top+w.$wp.scrollTop();w.opts.iframe&&(m+=w.$iframe.offset().left,v+=w.$iframe.offset().top,c+=w.$iframe.offset().left,d+=w.$iframe.offset().left),C.data("max-left",c),C.data("max-right",d),C.data("origin",f-w.win.pageXOffset),C.css("top",v),C.css("left",m),C.css("height",g),C.find("div").css("height",g),C.css("padding-left",w.opts.tableResizerOffset),C.css("padding-right",w.opts.tableResizerOffset),C.show()}else w.core.sameInstance(C)&&W()}}function L(e,t){if(w.$box.find(".fr-line-breaker").is(":visible"))return!1;o||q(),w.$box.append(o),o.data("instance",w);var l,a=Z(t).find("tr:first"),s=e.pageX,n=0,r=0;w.opts.iframe&&(n+=w.$iframe.offset().left-w.helpers.scrollLeft(),r+=w.$iframe.offset().top-w.helpers.scrollTop()),a.find("th, td").each(function(){var e=Z(this);return e.offset().left<=s&&s<e.offset().left+e.outerWidth()/2?(l=parseInt(o.find("a").css("width"),10),o.css("top",r+e.offset().top-w.$box.offset().top-l-5),o.css("left",n+e.offset().left-w.$box.offset().left-l/2),o.data("selected-cell",e),o.data("position","before"),o.addClass("fr-visible"),!1):e.offset().left+e.outerWidth()/2<=s&&s<e.offset().left+e.outerWidth()?(l=parseInt(o.find("a").css("width"),10),o.css("top",r+e.offset().top-w.$box.offset().top-l-5),o.css("left",n+e.offset().left-w.$box.offset().left+e.outerWidth()-l/2),o.data("selected-cell",e),o.data("position","after"),o.addClass("fr-visible"),!1):void 0})}function H(e,t){if(w.$box.find(".fr-line-breaker").is(":visible"))return!1;o||q(),w.$box.append(o),o.data("instance",w);var l,a=Z(t),s=e.pageY,n=0,r=0;w.opts.iframe&&(n+=w.$iframe.offset().left-w.helpers.scrollLeft(),r+=w.$iframe.offset().top-w.helpers.scrollTop()),a.find("tr").each(function(){var e=Z(this);return e.offset().top<=s&&s<e.offset().top+e.outerHeight()/2?(l=parseInt(o.find("a").css("width"),10),o.css("top",r+e.offset().top-w.$box.offset().top-l/2),o.css("left",n+e.offset().left-w.$box.offset().left-l-5),o.data("selected-cell",e.find("td:first")),o.data("position","above"),o.addClass("fr-visible"),!1):e.offset().top+e.outerHeight()/2<=s&&s<e.offset().top+e.outerHeight()?(l=parseInt(o.find("a").css("width"),10),o.css("top",r+e.offset().top-w.$box.offset().top+e.outerHeight()-l/2),o.css("left",n+e.offset().left-w.$box.offset().left-l-5),o.data("selected-cell",e.find("td:first")),o.data("position","below"),o.addClass("fr-visible"),!1):void 0})}function Y(e){r=null;var t=w.doc.elementFromPoint(e.pageX-w.win.pageXOffset,e.pageY-w.win.pageYOffset);w.opts.tableResizer&&(!w.popups.areVisible()||w.popups.areVisible()&&w.popups.isVisible("table.edit"))&&K(e,t),!w.opts.tableInsertHelper||w.popups.areVisible()||w.$tb.hasClass("fr-inline")&&w.$tb.is(":visible")||function(e,t){if(0===J().length){var l,a,s;if(t&&("HTML"==t.tagName||"BODY"==t.tagName||w.node.isElement(t)))for(l=1;l<=w.opts.tableInsertHelperOffset;l++){if(a=w.doc.elementFromPoint(e.pageX-w.win.pageXOffset,e.pageY-w.win.pageYOffset+l),Z(a).hasClass("fr-tooltip"))return;if(a&&("TH"==a.tagName||"TD"==a.tagName||"TABLE"==a.tagName)&&(Z(a).parents(".fr-wrapper").length||w.opts.iframe))return L(e,Z(a).closest("table"));if(s=w.doc.elementFromPoint(e.pageX-w.win.pageXOffset+l,e.pageY-w.win.pageYOffset),Z(s).hasClass("fr-tooltip"))return;if(s&&("TH"==s.tagName||"TD"==s.tagName||"TABLE"==s.tagName)&&(Z(s).parents(".fr-wrapper").length||w.opts.iframe))return H(e,Z(s).closest("table"))}w.core.sameInstance(o)&&k()}}(e,t)}function P(){if(E){var e=C.data("table").offset().top-w.win.pageYOffset;w.opts.iframe&&(e+=w.$iframe.offset().top-w.helpers.scrollTop()),C.css("top",e)}}function j(e,t){var l,a=Z(t[0][e]).outerWidth();for(l=1;l<t.length;l++)a=Math.min(a,Z(t[l][e]).outerWidth());return a}function V(e,t,l){var a,s=0;for(a=e;a<=t;a++)s+=j(a,l);return s}function X(e){if(1<J().length&&n&&y(),!1===n&&!1===s&&!1===E)r&&clearTimeout(r),w.edit.isDisabled()&&!w.popups.isVisible("table.edit")||(r=setTimeout(Y,30,e));else if(E){var t=e.pageX-w.win.pageXOffset;w.opts.iframe&&(t+=w.$iframe.offset().left);var l=C.data("max-left"),a=C.data("max-right");l<=t&&t<=a?C.css("left",t-w.opts.tableResizerOffset-w.$wp.offset().left):t<l&&parseFloat(C.css("left"),10)>l-w.opts.tableResizerOffset?C.css("left",l-w.opts.tableResizerOffset-w.$wp.offset().left):a<t&&parseFloat(C.css("left"),10)<a-w.opts.tableResizerOffset&&C.css("left",a-w.opts.tableResizerOffset-w.$wp.offset().left)}else n&&k()}function U(e){w.node.isEmpty(e.get(0))?e.prepend(Z.FE.MARKERS):e.prepend(Z.FE.START_MARKER).append(Z.FE.END_MARKER)}function q(){w.shared.$ti_helper||(w.shared.$ti_helper=Z('<div class="fr-insert-helper"><a class="fr-floating-btn" role="button" tabIndex="-1" title="'+w.language.translate("Insert")+'"><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M22,16.75 L16.75,16.75 L16.75,22 L15.25,22.000 L15.25,16.75 L10,16.75 L10,15.25 L15.25,15.25 L15.25,10 L16.75,10 L16.75,15.25 L22,15.25 L22,16.75 Z"/></svg></a></div>'),w.events.bindClick(w.shared.$ti_helper,"a",function(){var e=o.data("selected-cell"),t=o.data("position"),l=o.data("instance")||w;"before"==t?(w.undo.saveStep(),e.addClass("fr-selected-cell"),l.table.insertColumn(t),e.removeClass("fr-selected-cell"),w.undo.saveStep()):"after"==t?(w.undo.saveStep(),e.addClass("fr-selected-cell"),l.table.insertColumn(t),e.removeClass("fr-selected-cell"),w.undo.saveStep()):"above"==t?(w.undo.saveStep(),e.addClass("fr-selected-cell"),l.table.insertRow(t),e.removeClass("fr-selected-cell"),w.undo.saveStep()):"below"==t&&(w.undo.saveStep(),e.addClass("fr-selected-cell"),l.table.insertRow(t),e.removeClass("fr-selected-cell"),w.undo.saveStep()),k()}),w.events.on("shared.destroy",function(){w.shared.$ti_helper.html("").removeData().remove(),w.shared.$ti_helper=null},!0),w.events.$on(w.shared.$ti_helper,"mousemove",function(e){e.stopPropagation()},!0),w.events.$on(Z(w.o_win),"scroll",function(){k()},!0),w.events.$on(w.$wp,"scroll",function(){k()},!0)),o=w.shared.$ti_helper,w.events.on("destroy",function(){o=null}),w.tooltip.bind(w.$box,".fr-insert-helper > a.fr-floating-btn")}function G(){a=null,clearTimeout(r)}function J(){return w.el.querySelectorAll(".fr-selected-cell")}function Q(){var e=J();if(e.length){for(var t=e[0];t&&"TABLE"!=t.tagName&&t.parentNode!=w.el;)t=t.parentNode;return t&&"TABLE"==t.tagName?Z(t):Z([])}return Z([])}return{_init:function(){if(!w.$wp)return!1;if(!w.helpers.isMobile()){E=s=n=!1,w.events.$on(w.$el,"mousedown",e),w.popups.onShow("image.edit",function(){D(),s=n=!1}),w.popups.onShow("link.edit",function(){D(),s=n=!1}),w.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&D()}),w.events.$on(w.$el,"mouseenter","th, td",T),w.events.$on(w.$win,"mouseup",l),w.opts.iframe&&w.events.$on(Z(w.o_win),"mouseup",l),w.events.$on(w.$win,"mousemove",X),w.events.$on(Z(w.o_win),"scroll",P),w.events.on("contentChanged",function(){0<J().length&&(h(),w.$el.find("img").on("load.selected-cells",function(){Z(this).off("load.selected-cells"),0<J().length&&h()}))}),w.events.$on(Z(w.o_win),"resize",function(){D()}),w.events.on("toolbar.esc",function(){if(0<J().length)return w.events.disableBlur(),w.events.focus(),!1},!0),w.events.$on(Z(w.o_win),"keydown",function(){n&&s&&(s=n=!1,w.$el.removeClass("fr-no-selection"),w.edit.on(),w.selection.setAtEnd(w.$el.find(".fr-selected-cell:last").get(0)),w.selection.restore(),D())}),w.events.$on(w.$el,"keydown",function(e){e.shiftKey?!1===function(e){var t=J();if(0<t.length){var l,a,s=O(),n=e.which;1==t.length?a=l=t[0]:(l=w.el.querySelector(".fr-cell-fixed"),a=w.el.querySelector(".fr-cell-handler"));var r=A(a,s);if(Z.FE.KEYCODE.ARROW_RIGHT==n){if(r.col<s[0].length-1)return _(l,s[r.row][r.col+1]),!1}else if(Z.FE.KEYCODE.ARROW_DOWN==n){if(r.row<s.length-1)return _(l,s[r.row+1][r.col]),!1}else if(Z.FE.KEYCODE.ARROW_LEFT==n){if(0<r.col)return _(l,s[r.row][r.col-1]),!1}else if(Z.FE.KEYCODE.ARROW_UP==n&&0<r.row)return _(l,s[r.row-1][r.col]),!1}}(e)&&setTimeout(function(){h()},0):function(e){var t=e.which,l=w.selection.blocks();if(l.length&&("TD"==(l=l[0]).tagName||"TH"==l.tagName)){for(var a=l;a&&"TABLE"!=a.tagName&&a.parentNode!=w.el;)a=a.parentNode;if(a&&"TABLE"==a.tagName&&(Z.FE.KEYCODE.ARROW_LEFT==t||Z.FE.KEYCODE.ARROW_UP==t||Z.FE.KEYCODE.ARROW_RIGHT==t||Z.FE.KEYCODE.ARROW_DOWN==t)&&(0<J().length&&S(),w.browser.webkit&&(Z.FE.KEYCODE.ARROW_UP==t||Z.FE.KEYCODE.ARROW_DOWN==t))){var s=w.selection.ranges(0).startContainer;if(s.nodeType==Node.TEXT_NODE&&(Z.FE.KEYCODE.ARROW_UP==t&&(s.previousSibling&&"BR"!==s.previousSibling.tagName||s.previousSibling&&"BR"===s.previousSibling.tagName&&s.previousSibling.previousSibling)||Z.FE.KEYCODE.ARROW_DOWN==t&&(s.nextSibling&&"BR"!==s.nextSibling.tagName||s.nextSibling&&"BR"===s.nextSibling.tagName&&s.nextSibling.nextSibling)))return;e.preventDefault(),e.stopPropagation();var n=O(Z(a)),r=A(l,n);Z.FE.KEYCODE.ARROW_UP==t?B(r,a,n):Z.FE.KEYCODE.ARROW_DOWN==t&&z(r,a,n),w.selection.restore()}}}(e)}),w.events.on("keydown",function(e){if(!1===function(e){if(e.which==Z.FE.KEYCODE.TAB){var t;if(0<J().length)t=w.$el.find(".fr-selected-cell:last");else{var l=w.selection.element();"TD"==l.tagName||"TH"==l.tagName?t=Z(l):l!=w.el&&(0<Z(l).parentsUntil(w.$el,"td").length?t=Z(l).parents("td:first"):0<Z(l).parentsUntil(w.$el,"th").length&&(t=Z(l).parents("th:first")))}if(t)return e.preventDefault(),!!(0===w.selection.get().focusOffset&&0<Z(w.selection.element()).parentsUntil(w.$el,"ol, ul").length&&(0<Z(w.selection.element()).closest("li").prev().length||Z(w.selection.element()).is("li")&&0<Z(w.selection.element()).prev().length))||(S(),e.shiftKey?0<t.prev().length?U(t.prev()):0<t.closest("tr").length&&0<t.closest("tr").prev().length?U(t.closest("tr").prev().find("td:last")):0<t.closest("tbody").length&&0<t.closest("table").find("thead tr").length&&U(t.closest("table").find("thead tr th:last")):0<t.next().length?U(t.next()):0<t.closest("tr").length&&0<t.closest("tr").next().length?U(t.closest("tr").next().find("td:first")):0<t.closest("thead").length&&0<t.closest("table").find("tbody tr").length?U(t.closest("table").find("tbody tr td:first")):(t.addClass("fr-selected-cell"),b("below"),D(),U(t.closest("tr").next().find("td:first"))),w.selection.restore(),!1)}}(e))return!1;var t=J();if(0<t.length){if(0<t.length&&w.keys.ctrlKey(e)&&e.which==Z.FE.KEYCODE.A)return D(),w.popups.isVisible("table.edit")&&w.popups.hide("table.edit"),t=[],!0;if(e.which==Z.FE.KEYCODE.ESC&&w.popups.isVisible("table.edit"))return D(),w.popups.hide("table.edit"),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!(t=[]);if(1<t.length&&(e.which==Z.FE.KEYCODE.BACKSPACE||e.which==Z.FE.KEYCODE.DELETE)){w.undo.saveStep();for(var l=0;l<t.length;l++)Z(t[l]).html("<br>"),l==t.length-1&&Z(t[l]).prepend(Z.FE.MARKERS);return w.selection.restore(),w.undo.saveStep(),!(t=[])}if(1<t.length&&e.which!=Z.FE.KEYCODE.F10&&!w.keys.isBrowserAction(e))return e.preventDefault(),!(t=[])}else if(!(t=[])===function(e){if(e.altKey&&e.which==Z.FE.KEYCODE.SPACE){var t,l=w.selection.element();if("TD"==l.tagName||"TH"==l.tagName?t=l:0<Z(l).closest("td").length?t=Z(l).closest("td").get(0):0<Z(l).closest("th").length&&(t=Z(l).closest("th").get(0)),t)return e.preventDefault(),_(t,t),h(),!1}}(e))return!1},!0);var t=[];w.events.on("html.beforeGet",function(){t=J();for(var e=0;e<t.length;e++)t[e].className=(t[e].className||"").replace(/fr-selected-cell/g,"")}),w.events.on("html.afterGet",function(){for(var e=0;e<t.length;e++)t[e].className=(t[e].className?t[e].className.trim()+" ":"")+"fr-selected-cell";t=[]}),c(!0),p(!0)}w.events.on("destroy",G)},insert:function(e,t){var l,a,s="<table "+(w.opts.tableDefaultWidth?'style="width: '+w.opts.tableDefaultWidth+';" ':"")+'class="fr-inserted-table"><tbody>',n=100/t;for(l=0;l<e;l++){for(s+="<tr>",a=0;a<t;a++)s+="<td"+(w.opts.tableDefaultWidth?' style="width: '+n.toFixed(4)+'%;"':"")+">",0===l&&0===a&&(s+=Z.FE.MARKERS),s+="<br></td>";s+="</tr>"}s+="</tbody></table>",w.html.insert(s),w.selection.restore();var r=w.$el.find(".fr-inserted-table");r.removeClass("fr-inserted-table"),w.events.trigger("table.inserted",[r.get(0)])},remove:u,insertRow:b,deleteRow:function(){var e=Q();if(0<e.length){var t,l,a,s=O(),n=$(s);if(0===n.min_i&&n.max_i==s.length-1)u();else{for(t=n.max_i;t>=n.min_i;t--){for(a=Z(e.find("tr").not(e.find("table tr")).get(t)),l=0;l<s[t].length;l++)if(0===l||s[t][l]!=s[t][l-1]){var r=Z(s[t][l]);if(1<parseInt(r.attr("rowspan"),10)){var o=parseInt(r.attr("rowspan"),10)-1;1==o?r.removeAttr("rowspan"):r.attr("rowspan",o)}if(t<s.length-1&&s[t][l]==s[t+1][l]&&(0===t||s[t][l]!=s[t-1][l])){for(var i=s[t][l],f=l;0<f&&s[t][f]==s[t][f-1];)f--;0===f?Z(e.find("tr").not(e.find("table tr")).get(t+1)).prepend(i):Z(s[t+1][f-1]).after(i)}}var c=a.parent();a.remove(),0===c.find("tr").length&&c.remove(),s=O(e)}R(0,s.length-1,0,s[0].length-1,e),0<n.min_i?w.selection.setAtEnd(s[n.min_i-1][0]):w.selection.setAtEnd(s[0][0]),w.selection.restore(),w.popups.hide("table.edit")}}},insertColumn:function(i){var e=Q();if(0<e.length){var f,c=O(),t=$(c);f="before"==i?t.min_j:t.max_j;var l,d=100/c[0].length,p=100/(c[0].length+1);e.find("th, td").each(function(){(l=Z(this)).data("old-width",l.outerWidth()/e.outerWidth()*100)}),e.find("tr").not(e.find("table tr")).each(function(e){for(var t,l=Z(this),a=0,s=0;a-1<f;){if(!(t=l.find("> th, > td").get(s))){t=null;break}t==c[e][a]?(a+=parseInt(Z(t).attr("colspan"),10)||1,s++):(a+=parseInt(Z(c[e][a]).attr("colspan"),10)||1,"after"==i&&(t=0===s?-1:l.find("> th, > td").get(s-1)))}var n,r=Z(t);if("after"==i&&f<a-1||"before"==i&&0<f&&c[e][f]==c[e][f-1]){if(0===e||0<e&&c[e][f]!=c[e-1][f]){var o=parseInt(r.attr("colspan"),10)+1;r.attr("colspan",o),r.css("width",(r.data("old-width")*p/d+p).toFixed(4)+"%"),r.removeData("old-width")}}else n=0<l.find("th").length?'<th style="width: '+p.toFixed(4)+'%;"><br></th>':'<td style="width: '+p.toFixed(4)+'%;"><br></td>',-1==t?l.prepend(n):null==t?l.append(n):"before"==i?r.before(n):"after"==i&&r.after(n)}),e.find("th, td").each(function(){(l=Z(this)).data("old-width")&&(l.css("width",(l.data("old-width")*p/d).toFixed(4)+"%"),l.removeData("old-width"))}),w.popups.isVisible("table.edit")&&h()}},deleteColumn:function(){var e=Q();if(0<e.length){var t,l,a,s=O(),n=$(s);if(0===n.min_j&&n.max_j==s[0].length-1)u();else{var r=0;for(t=0;t<s.length;t++)for(l=0;l<s[0].length;l++)(a=Z(s[t][l])).hasClass("fr-selected-cell")||(a.data("old-width",a.outerWidth()/e.outerWidth()*100),(l<n.min_j||l>n.max_j)&&(r+=a.outerWidth()/e.outerWidth()*100));for(r/=s.length,l=n.max_j;l>=n.min_j;l--)for(t=0;t<s.length;t++)if(0===t||s[t][l]!=s[t-1][l])if(a=Z(s[t][l]),1<(parseInt(a.attr("colspan"),10)||1)){var o=parseInt(a.attr("colspan"),10)-1;1==o?a.removeAttr("colspan"):a.attr("colspan",o),a.css("width",(100*(a.data("old-width")-j(l,s))/r).toFixed(4)+"%"),a.removeData("old-width")}else{var i=Z(a.parent().get(0));a.remove(),0===i.find("> th, > td").length&&(0===i.prev().length||0===i.next().length||i.prev().find("> th[rowspan], > td[rowspan]").length<i.prev().find("> th, > td").length)&&i.remove()}R(0,s.length-1,0,s[0].length-1,e),0<n.min_j?w.selection.setAtEnd(s[n.min_i][n.min_j-1]):w.selection.setAtEnd(s[n.min_i][0]),w.selection.restore(),w.popups.hide("table.edit"),e.find("th, td").each(function(){(a=Z(this)).data("old-width")&&(a.css("width",(100*a.data("old-width")/r).toFixed(4)+"%"),a.removeData("old-width"))})}}},mergeCells:function(){if(1<J().length&&(0===w.$el.find("th.fr-selected-cell").length||0===w.$el.find("td.fr-selected-cell").length)){x();var e,t,l=$(O()),a=w.$el.find(".fr-selected-cell"),s=Z(a[0]),n=s.parent().find(".fr-selected-cell"),r=s.closest("table"),o=s.html(),i=0;for(e=0;e<n.length;e++)i+=Z(n[e]).outerWidth();for(s.css("width",Math.min(100,i/r.outerWidth()*100).toFixed(4)+"%"),l.min_j<l.max_j&&s.attr("colspan",l.max_j-l.min_j+1),l.min_i<l.max_i&&s.attr("rowspan",l.max_i-l.min_i+1),e=1;e<a.length;e++)"<br>"!=(t=Z(a[e])).html()&&""!==t.html()&&(o+="<br>"+t.html()),t.remove();s.html(o),w.selection.setAtEnd(s.get(0)),w.selection.restore(),w.toolbar.enable(),m(l.min_i,l.max_i,r);var f=r.find("tr:empty");for(e=f.length-1;0<=e;e--)Z(f[e]).remove();g(l.min_j,l.max_j,r),h()}},splitCellVertically:function(){if(1==J().length){var e=w.$el.find(".fr-selected-cell"),t=parseInt(e.attr("colspan"),10)||1,l=e.parent().outerWidth(),a=e.outerWidth(),s=e.clone().html("<br>"),n=O(),r=A(e.get(0),n);if(1<t){var o=Math.ceil(t/2);a=V(r.col,r.col+o-1,n)/l*100;var i=V(r.col+o,r.col+t-1,n)/l*100;1<o?e.attr("colspan",o):e.removeAttr("colspan"),1<t-o?s.attr("colspan",t-o):s.removeAttr("colspan"),e.css("width",a.toFixed(4)+"%"),s.css("width",i.toFixed(4)+"%")}else{var f;for(f=0;f<n.length;f++)if(0===f||n[f][r.col]!=n[f-1][r.col]){var c=Z(n[f][r.col]);if(!c.is(e)){var d=(parseInt(c.attr("colspan"),10)||1)+1;c.attr("colspan",d)}}a=a/l*100/2,e.css("width",a.toFixed(4)+"%"),s.css("width",a.toFixed(4)+"%")}e.after(s),D(),w.popups.hide("table.edit")}},splitCellHorizontally:function(){if(1==J().length){var e=w.$el.find(".fr-selected-cell"),t=e.parent(),l=e.closest("table"),a=parseInt(e.attr("rowspan"),10),s=O(),n=A(e.get(0),s),r=e.clone().html("<br>");if(1<a){var o=Math.ceil(a/2);1<o?e.attr("rowspan",o):e.removeAttr("rowspan"),1<a-o?r.attr("rowspan",a-o):r.removeAttr("rowspan");for(var i=n.row+o,f=0===n.col?n.col:n.col-1;0<=f&&(s[i][f]==s[i][f-1]||0<i&&s[i][f]==s[i-1][f]);)f--;-1==f?Z(l.find("tr").not(l.find("table tr")).get(i)).prepend(r):Z(s[i][f]).after(r)}else{var c,d=Z("<tr>").append(r);for(c=0;c<s[0].length;c++)if(0===c||s[n.row][c]!=s[n.row][c-1]){var p=Z(s[n.row][c]);p.is(e)||p.attr("rowspan",(parseInt(p.attr("rowspan"),10)||1)+1)}t.after(d)}D(),w.popups.hide("table.edit")}},addHeader:function(){var e=Q();if(0<e.length&&0===e.find("th").length){var t,l="<thead><tr>",a=0;for(e.find("tr:first > td").each(function(){var e=Z(this);a+=parseInt(e.attr("colspan"),10)||1}),t=0;t<a;t++)l+="<th><br></th>";l+="</tr></thead>",e.prepend(l),h()}},removeHeader:function(){var e=Q(),t=e.find("thead");if(0<t.length)if(0===e.find("tbody tr").length)u();else if(t.remove(),0<J().length)h();else{w.popups.hide("table.edit");var l=e.find("tbody tr:first td:first").get(0);l&&(w.selection.setAtEnd(l),w.selection.restore())}},setBackground:t,showInsertPopup:function(){var e=w.$tb.find('.fr-command[data-cmd="insertTable"]'),t=w.popups.get("table.insert");if(t||(t=c()),!t.hasClass("fr-active")){w.popups.refresh("table.insert"),w.popups.setContainer("table.insert",w.$tb);var l=e.offset().left+e.outerWidth()/2,a=e.offset().top+(w.opts.toolbarBottom?10:e.outerHeight()-10);w.popups.show("table.insert",l,a,e.outerHeight())}},showEditPopup:h,showColorsPopup:f,back:function(){0<J().length?h():(w.popups.hide("table.insert"),w.toolbar.showInline())},verticalAlign:function(e){w.$el.find(".fr-selected-cell").css("vertical-align",e)},horizontalAlign:function(e){w.$el.find(".fr-selected-cell").css("text-align",e)},applyStyle:function(e,t,l,a){if(0<t.length){if(!l){var s=Object.keys(a);s.splice(s.indexOf(e),1),t.removeClass(s.join(" "))}t.toggleClass(e)}},selectedTable:Q,selectedCells:J,customColor:function(){var e=w.popups.get("table.colors").find(".fr-table-colors-hex-layer input");e.length&&t(e.val())},selectCells:_}},Z.FE.DefineIcon("insertTable",{NAME:"table"}),Z.FE.RegisterCommand("insertTable",{title:"Insert Table",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("table.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("table.insert")):this.table.showInsertPopup()},plugin:"table"}),Z.FE.RegisterCommand("tableInsert",{callback:function(e,t,l){this.table.insert(t,l),this.popups.hide("table.insert")}}),Z.FE.DefineIcon("tableHeader",{NAME:"header",FA5NAME:"heading"}),Z.FE.RegisterCommand("tableHeader",{title:"Table Header",focus:!1,toggle:!0,callback:function(){this.popups.get("table.edit").find('.fr-command[data-cmd="tableHeader"]').hasClass("fr-active")?this.table.removeHeader():this.table.addHeader()},refresh:function(e){var t=this.table.selectedTable();0<t.length&&(0===t.find("th").length?e.removeClass("fr-active").attr("aria-pressed",!1):e.addClass("fr-active").attr("aria-pressed",!0))}}),Z.FE.DefineIcon("tableRows",{NAME:"bars"}),Z.FE.RegisterCommand("tableRows",{type:"dropdown",focus:!1,title:"Row",options:{above:"Insert row above",below:"Insert row below","delete":"Delete row"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableRows.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableRows" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){"above"==t||"below"==t?this.table.insertRow(t):this.table.deleteRow()}}),Z.FE.DefineIcon("tableColumns",{NAME:"bars fa-rotate-90"}),Z.FE.RegisterCommand("tableColumns",{type:"dropdown",focus:!1,title:"Column",options:{before:"Insert column before",after:"Insert column after","delete":"Delete column"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableColumns.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableColumns" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){"before"==t||"after"==t?this.table.insertColumn(t):this.table.deleteColumn()}}),Z.FE.DefineIcon("tableCells",{NAME:"square-o",FA5NAME:"square"}),Z.FE.RegisterCommand("tableCells",{type:"dropdown",focus:!1,title:"Cell",options:{merge:"Merge cells","vertical-split":"Vertical split","horizontal-split":"Horizontal split"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableCells.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCells" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){"merge"==t?this.table.mergeCells():"vertical-split"==t?this.table.splitCellVertically():this.table.splitCellHorizontally()},refreshOnShow:function(e,t){1<this.$el.find(".fr-selected-cell").length?(t.find('a[data-param1="vertical-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="horizontal-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="merge"]').removeClass("fr-disabled").attr("aria-disabled",!1)):(t.find('a[data-param1="merge"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="vertical-split"]').removeClass("fr-disabled").attr("aria-disabled",!1),t.find('a[data-param1="horizontal-split"]').removeClass("fr-disabled").attr("aria-disabled",!1))}}),Z.FE.DefineIcon("tableRemove",{NAME:"trash"}),Z.FE.RegisterCommand("tableRemove",{title:"Remove Table",focus:!1,callback:function(){this.table.remove()}}),Z.FE.DefineIcon("tableStyle",{NAME:"paint-brush"}),Z.FE.RegisterCommand("tableStyle",{title:"Table Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableStyles;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableStyle" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell").closest("table"),this.opts.tableMultipleStyles,this.opts.tableStyles)},refreshOnShow:function(e,t){var l=this.$el.find(".fr-selected-cell").closest("table");l&&t.find(".fr-command").each(function(){var e=Z(this).data("param1"),t=l.hasClass(e);Z(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Z.FE.DefineIcon("tableCellBackground",{NAME:"tint"}),Z.FE.RegisterCommand("tableCellBackground",{title:"Cell Background",focus:!1,popup:!0,callback:function(){this.table.showColorsPopup()}}),Z.FE.RegisterCommand("tableCellBackgroundColor",{undo:!0,focus:!1,callback:function(e,t){this.table.setBackground(t)}}),Z.FE.DefineIcon("tableBack",{NAME:"arrow-left"}),Z.FE.RegisterCommand("tableBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.table.back()},refresh:function(e){0!==this.table.selectedCells().length||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),Z.FE.DefineIcon("tableCellVerticalAlign",{NAME:"arrows-v",FA5NAME:"arrows-alt-v"}),Z.FE.RegisterCommand("tableCellVerticalAlign",{type:"dropdown",focus:!1,title:"Vertical Align",options:{Top:"Align Top",Middle:"Align Middle",Bottom:"Align Bottom"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableCellVerticalAlign.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellVerticalAlign" data-param1="'+l.toLowerCase()+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(l)+"</a></li>");return e+="</ul>"},callback:function(e,t){this.table.verticalAlign(t)},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.$el.find(".fr-selected-cell").css("vertical-align")+'"]').addClass("fr-active").attr("aria-selected",!0)}}),Z.FE.DefineIcon("tableCellHorizontalAlign",{NAME:"align-left"}),Z.FE.DefineIcon("align-left",{NAME:"align-left"}),Z.FE.DefineIcon("align-right",{NAME:"align-right"}),Z.FE.DefineIcon("align-center",{NAME:"align-center"}),Z.FE.DefineIcon("align-justify",{NAME:"align-justify"}),Z.FE.RegisterCommand("tableCellHorizontalAlign",{type:"dropdown",focus:!1,title:"Horizontal Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableCellHorizontalAlign.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="tableCellHorizontalAlign" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.icon.create("align-"+l)+'<span class="fr-sr-only">'+this.language.translate(t[l])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.table.horizontalAlign(t)},refresh:function(e){var t=this.table.selectedCells();t.length&&e.find("> *:first").replaceWith(this.icon.create("align-"+this.helpers.getAlignment(Z(t[0]))))},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.helpers.getAlignment(this.$el.find(".fr-selected-cell:first"))+'"]').addClass("fr-active").attr("aria-selected",!0)}}),Z.FE.DefineIcon("tableCellStyle",{NAME:"magic"}),Z.FE.RegisterCommand("tableCellStyle",{title:"Cell Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableCellStyles;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellStyle" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell"),this.opts.tableCellMultipleStyles,this.opts.tableCellStyles)},refreshOnShow:function(e,t){var l=this.$el.find(".fr-selected-cell:first");l&&t.find(".fr-command").each(function(){var e=Z(this).data("param1"),t=l.hasClass(e);Z(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Z.FE.RegisterCommand("tableCellBackgroundCustomColor",{title:"OK",undo:!0,callback:function(){this.table.customColor()}}),Z.FE.DefineIcon("tableColorRemove",{NAME:"eraser"})});
|
1
|
+
/*!
|
2
|
+
* froala_editor v2.9.6 (https://www.froala.com/wysiwyg-editor)
|
3
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
4
|
+
* Copyright 2014-2019 Froala Labs
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(l){"function"==typeof define&&define.amd?define(["jquery"],l):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),l(t)}:l(window.jQuery)}(function(Z){Z.extend(Z.FE.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_][_CUSTOM_COLOR_]"}),Z.extend(Z.FE.DEFAULTS,{tableInsertMaxSize:10,tableEditButtons:["tableHeader","tableRemove","|","tableRows","tableColumns","tableStyle","-","tableCells","tableCellBackground","tableCellVerticalAlign","tableCellHorizontalAlign","tableCellStyle"],tableInsertButtons:["tableBack","|"],tableResizer:!0,tableDefaultWidth:"100%",tableResizerOffset:5,tableResizingLimit:30,tableColorsButtons:["tableBack","|"],tableColors:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],tableColorsStep:7,tableCellStyles:{"fr-highlighted":"Highlighted","fr-thick":"Thick"},tableStyles:{"fr-dashed-borders":"Dashed Borders","fr-alternate-rows":"Alternate Rows"},tableCellMultipleStyles:!0,tableMultipleStyles:!0,tableInsertHelper:!0,tableInsertHelperOffset:15}),Z.FE.PLUGINS.table=function(w){var C,o,s,n,a,r,E;function h(){var e=O();if(e){var t=w.popups.get("table.edit");if(t||(t=p()),t){w.popups.setContainer("table.edit",w.$sc);var l=M(e),a=(l.left+l.right)/2,s=l.bottom;w.popups.show("table.edit",a,s,l.bottom-l.top),w.edit.isDisabled()&&(1<J().length&&w.toolbar.disable(),w.$el.removeClass("fr-no-selection"),w.edit.on(),w.button.bulkRefresh(),w.selection.setAtEnd(w.$el.find(".fr-selected-cell:last").get(0)),w.selection.restore())}}}function f(){var e,t,l,a,s=O();if(s){var n=w.popups.get("table.colors");n||(n=function(){var e="";0<w.opts.tableColorsButtons.length&&(e='<div class="fr-buttons fr-table-colors-buttons">'+w.button.buildList(w.opts.tableColorsButtons)+"</div>");var t="";w.opts.colorsHEXInput&&(t='<div class="fr-table-colors-hex-layer fr-active fr-layer" id="fr-table-colors-hex-layer-'+w.id+'"><div class="fr-input-line"><input maxlength="7" id="fr-table-colors-hex-layer-text-'+w.id+'" type="text" placeholder="'+w.language.translate("HEX Color")+'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="tableCellBackgroundCustomColor" tabIndex="2" role="button">'+w.language.translate("OK")+"</button></div></div>");var l={buttons:e,colors:function(){for(var e='<div class="fr-table-colors">',t=0;t<w.opts.tableColors.length;t++)0!==t&&t%w.opts.tableColorsStep==0&&(e+="<br>"),"REMOVE"!=w.opts.tableColors[t]?e+='<span class="fr-command" style="background: '+w.opts.tableColors[t]+';" tabIndex="-1" role="button" data-cmd="tableCellBackgroundColor" data-param1="'+w.opts.tableColors[t]+'"><span class="fr-sr-only">'+w.language.translate("Color")+" "+w.opts.tableColors[t]+" </span></span>":e+='<span class="fr-command" data-cmd="tableCellBackgroundColor" tabIndex="-1" role="button" data-param1="REMOVE" title="'+w.language.translate("Clear Formatting")+'">'+w.icon.create("tableColorRemove")+'<span class="fr-sr-only">'+w.language.translate("Clear Formatting")+"</span></span>";return e+="</div>"}(),custom_color:t},a=w.popups.create("table.colors",l);return w.events.$on(w.$wp,"scroll.table-colors",function(){w.popups.isVisible("table.colors")&&f()}),u=a,w.events.on("popup.tab",function(e){var t=Z(e.currentTarget);if(!w.popups.isVisible("table.colors")||!t.is("span"))return!0;var l=e.which,a=!0;if(Z.FE.KEYCODE.TAB==l){var s=u.find(".fr-buttons");a=!w.accessibility.focusToolbar(s,!!e.shiftKey)}else if(Z.FE.KEYCODE.ARROW_UP==l||Z.FE.KEYCODE.ARROW_DOWN==l||Z.FE.KEYCODE.ARROW_LEFT==l||Z.FE.KEYCODE.ARROW_RIGHT==l){var n=t.parent().find("span.fr-command"),r=n.index(t),o=w.opts.colorsStep,i=Math.floor(n.length/o),f=r%o,c=Math.floor(r/o),d=c*o+f,p=i*o;Z.FE.KEYCODE.ARROW_UP==l?d=((d-o)%p+p)%p:Z.FE.KEYCODE.ARROW_DOWN==l?d=(d+o)%p:Z.FE.KEYCODE.ARROW_LEFT==l?d=((d-1)%p+p)%p:Z.FE.KEYCODE.ARROW_RIGHT==l&&(d=(d+1)%p);var h=Z(n.get(d));w.events.disableBlur(),h.focus(),a=!1}else Z.FE.KEYCODE.ENTER==l&&(w.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0),a;var u}()),w.popups.setContainer("table.colors",w.$sc);var r=M(s),o=(r.left+r.right)/2,i=r.bottom;e=w.popups.get("table.colors"),t=w.$el.find(".fr-selected-cell:first"),l=w.helpers.RGBToHex(t.css("background-color")),a=e.find(".fr-table-colors-hex-layer input"),e.find(".fr-selected-color").removeClass("fr-selected-color fr-active-item"),e.find('span[data-param1="'+l+'"]').addClass("fr-selected-color fr-active-item"),a.val(l).trigger("change"),w.popups.show("table.colors",o,i,r.bottom-r.top)}}function i(){0===J().length&&w.toolbar.enable()}function c(e){if(e)return w.popups.onHide("table.insert",function(){w.popups.get("table.insert").find('.fr-table-size .fr-select-table-size > span[data-row="1"][data-col="1"]').trigger("mouseenter")}),!0;var t="";0<w.opts.tableInsertButtons.length&&(t='<div class="fr-buttons">'+w.button.buildList(w.opts.tableInsertButtons)+"</div>");var l,a={buttons:t,rows_columns:function(){for(var e='<div class="fr-table-size"><div class="fr-table-size-info">1 × 1</div><div class="fr-select-table-size">',t=1;t<=w.opts.tableInsertMaxSize;t++){for(var l=1;l<=w.opts.tableInsertMaxSize;l++){var a="inline-block";2<t&&!w.helpers.isMobile()&&(a="none");var s="fr-table-cell ";1==t&&1==l&&(s+=" hover"),e+='<span class="fr-command '+s+'" tabIndex="-1" data-cmd="tableInsert" data-row="'+t+'" data-col="'+l+'" data-param1="'+t+'" data-param2="'+l+'" style="display: '+a+';" role="button"><span></span><span class="fr-sr-only">'+t+" × "+l+" </span></span>"}e+='<div class="new-line"></div>'}return e+="</div></div>"}()},s=w.popups.create("table.insert",a);return w.events.$on(s,"mouseenter",".fr-table-size .fr-select-table-size .fr-table-cell",function(e){d(Z(e.currentTarget))},!0),l=s,w.events.$on(l,"focus","[tabIndex]",function(e){var t=Z(e.currentTarget);d(t)}),w.events.on("popup.tab",function(e){var t=Z(e.currentTarget);if(!w.popups.isVisible("table.insert")||!t.is("span, a"))return!0;var l,a=e.which;if(Z.FE.KEYCODE.ARROW_UP==a||Z.FE.KEYCODE.ARROW_DOWN==a||Z.FE.KEYCODE.ARROW_LEFT==a||Z.FE.KEYCODE.ARROW_RIGHT==a){if(t.is("span.fr-table-cell")){var s=t.parent().find("span.fr-table-cell"),n=s.index(t),r=w.opts.tableInsertMaxSize,o=n%r,i=Math.floor(n/r);Z.FE.KEYCODE.ARROW_UP==a?i=Math.max(0,i-1):Z.FE.KEYCODE.ARROW_DOWN==a?i=Math.min(w.opts.tableInsertMaxSize-1,i+1):Z.FE.KEYCODE.ARROW_LEFT==a?o=Math.max(0,o-1):Z.FE.KEYCODE.ARROW_RIGHT==a&&(o=Math.min(w.opts.tableInsertMaxSize-1,o+1));var f=i*r+o,c=Z(s.get(f));d(c),w.events.disableBlur(),c.focus(),l=!1}}else Z.FE.KEYCODE.ENTER==a&&(w.button.exec(t),l=!1);return!1===l&&(e.preventDefault(),e.stopPropagation()),l},!0),s}function d(e){var t=e.data("row"),l=e.data("col"),a=e.parent();a.siblings(".fr-table-size-info").html(t+" × "+l),a.find("> span").removeClass("hover fr-active-item");for(var s=1;s<=w.opts.tableInsertMaxSize;s++)for(var n=0;n<=w.opts.tableInsertMaxSize;n++){var r=a.find('> span[data-row="'+s+'"][data-col="'+n+'"]');s<=t&&n<=l?r.addClass("hover"):s<=t+1||s<=2&&!w.helpers.isMobile()?r.css("display","inline-block"):2<s&&!w.helpers.isMobile()&&r.css("display","none")}e.addClass("fr-active-item")}function p(e){if(e)return w.popups.onHide("table.edit",i),!0;if(0<w.opts.tableEditButtons.length){var t={buttons:'<div class="fr-buttons">'+w.button.buildList(w.opts.tableEditButtons)+"</div>"},l=w.popups.create("table.edit",t);return w.events.$on(w.$wp,"scroll.table-edit",function(){w.popups.isVisible("table.edit")&&h()}),l}return!1}function u(){if(0<J().length){var e=Q();w.selection.setBefore(e.get(0))||w.selection.setAfter(e.get(0)),w.selection.restore(),w.popups.hide("table.edit"),e.remove(),w.toolbar.enable()}}function b(e){var t=Q();if(0<t.length){if(0<w.$el.find("th.fr-selected-cell").length&&"above"==e)return;var l,a,s,n=O(),r=$(n);a="above"==e?r.min_i:r.max_i;var o="<tr>";for(l=0;l<n[a].length;l++){if("below"==e&&a<n.length-1&&n[a][l]==n[a+1][l]||"above"==e&&0<a&&n[a][l]==n[a-1][l]){if(0===l||0<l&&n[a][l]!=n[a][l-1]){var i=Z(n[a][l]);i.attr("rowspan",parseInt(i.attr("rowspan"),10)+1)}}else o+='<td style="'+Z(n[a][l]).attr("style")+'" ><br></td>'}o+="</tr>",s=0<w.$el.find("th.fr-selected-cell").length&&"below"==e?Z(t.find("tbody").not(t.find("table tbody"))):Z(t.find("tr").not(t.find("table tr")).get(a)),"below"==e?"TBODY"==s.prop("tagName")?s.prepend(o):s.after(o):"above"==e&&(s.before(o),w.popups.isVisible("table.edit")&&h())}}function g(e,t,l){var a,s,n,r,o,i=0,f=O(l);if(e<(t=Math.min(t,f[0].length-1)))for(s=e;s<=t;s++)if(!(e<s&&f[0][s]==f[0][s-1])&&1<(r=Math.min(parseInt(f[0][s].getAttribute("colspan"),10)||1,t-e+1))&&f[0][s]==f[0][s+1])for(i=r-1,a=1;a<f.length;a++)if(f[a][s]!=f[a-1][s]){for(n=s;n<s+r;n++)if(1<(o=parseInt(f[a][n].getAttribute("colspan"),10)||1)&&f[a][n]==f[a][n+1])n+=i=Math.min(i,o-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&v(f,i,"colspan",0,f.length-1,e,t)}function m(e,t,l){var a,s,n,r,o,i=0,f=O(l);if(e<(t=Math.min(t,f.length-1)))for(a=e;a<=t;a++)if(!(e<a&&f[a][0]==f[a-1][0])&&1<(r=Math.min(parseInt(f[a][0].getAttribute("rowspan"),10)||1,t-e+1))&&f[a][0]==f[a+1][0])for(i=r-1,s=1;s<f[0].length;s++)if(f[a][s]!=f[a][s-1]){for(n=a;n<a+r;n++)if(1<(o=parseInt(f[n][s].getAttribute("rowspan"),10)||1)&&f[n][s]==f[n+1][s])n+=i=Math.min(i,o-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&v(f,i,"rowspan",e,t,0,f[0].length-1)}function v(e,t,l,a,s,n,r){var o,i,f;for(o=a;o<=s;o++)for(i=n;i<=r;i++)a<o&&e[o][i]==e[o-1][i]||n<i&&e[o][i]==e[o][i-1]||1<(f=parseInt(e[o][i].getAttribute(l),10)||1)&&(1<f-t?e[o][i].setAttribute(l,f-t):e[o][i].removeAttribute(l))}function R(e,t,l,a,s){m(e,t,s),g(l,a,s)}function t(e){var t=w.$el.find(".fr-selected-cell");"REMOVE"!=e?t.css("background-color",w.helpers.HEXtoRGB(e)):t.css("background-color",""),h()}function O(e){var f=[];return null==(e=e||null)&&0<J().length&&(e=Q()),e&&e.find("tr:visible").not(e.find("table tr")).each(function(o,e){var t=Z(e),i=0;t.find("> th, > td").each(function(e,t){for(var l=Z(t),a=parseInt(l.attr("colspan"),10)||1,s=parseInt(l.attr("rowspan"),10)||1,n=o;n<o+s;n++)for(var r=i;r<i+a;r++)f[n]||(f[n]=[]),f[n][r]?i++:f[n][r]=t;i+=a})}),f}function A(e,t){for(var l=0;l<t.length;l++)for(var a=0;a<t[l].length;a++)if(t[l][a]==e)return{row:l,col:a}}function F(e,t,l){for(var a=e+1,s=t+1;a<l.length;){if(l[a][t]!=l[e][t]){a--;break}a++}for(a==l.length&&a--;s<l[e].length;){if(l[e][s]!=l[e][t]){s--;break}s++}return s==l[e].length&&s--,{row:a,col:s}}function x(){w.el.querySelector(".fr-cell-fixed")&&w.el.querySelector(".fr-cell-fixed").classList.remove("fr-cell-fixed"),w.el.querySelector(".fr-cell-handler")&&w.el.querySelector(".fr-cell-handler").classList.remove("fr-cell-handler")}function D(){var e=w.$el.find(".fr-selected-cell");0<e.length&&e.each(function(){var e=Z(this);e.removeClass("fr-selected-cell"),""===e.attr("class")&&e.removeAttr("class")}),x()}function y(){w.events.disableBlur(),w.selection.clear(),w.$el.addClass("fr-no-selection"),w.$el.blur(),w.events.enableBlur()}function $(e){var t=w.$el.find(".fr-selected-cell");if(0<t.length){var l,a=e.length,s=0,n=e[0].length,r=0;for(l=0;l<t.length;l++){var o=A(t[l],e),i=F(o.row,o.col,e);a=Math.min(o.row,a),s=Math.max(i.row,s),n=Math.min(o.col,n),r=Math.max(i.col,r)}return{min_i:a,max_i:s,min_j:n,max_j:r}}return null}function M(e){var t=$(e),l=Z(e[t.min_i][t.min_j]),a=Z(e[t.min_i][t.max_j]),s=Z(e[t.max_i][t.min_j]);return{left:l.length&&l.offset().left,right:a.length&&a.offset().left+a.outerWidth(),top:l.length&&l.offset().top,bottom:s.length&&s.offset().top+s.outerHeight()}}function _(t,l){if(Z(t).is(l))D(),Z(t).addClass("fr-selected-cell");else{y(),w.edit.off();var a=O(),s=A(t,a),n=A(l,a),r=function e(t,l,a,s,n){var r,o,i,f,c=t,d=l,p=a,h=s;for(r=c;r<=d;r++)(1<(parseInt(Z(n[r][p]).attr("rowspan"),10)||1)||1<(parseInt(Z(n[r][p]).attr("colspan"),10)||1))&&(f=F((i=A(n[r][p],n)).row,i.col,n),c=Math.min(i.row,c),d=Math.max(f.row,d),p=Math.min(i.col,p),h=Math.max(f.col,h)),(1<(parseInt(Z(n[r][h]).attr("rowspan"),10)||1)||1<(parseInt(Z(n[r][h]).attr("colspan"),10)||1))&&(f=F((i=A(n[r][h],n)).row,i.col,n),c=Math.min(i.row,c),d=Math.max(f.row,d),p=Math.min(i.col,p),h=Math.max(f.col,h));for(o=p;o<=h;o++)(1<(parseInt(Z(n[c][o]).attr("rowspan"),10)||1)||1<(parseInt(Z(n[c][o]).attr("colspan"),10)||1))&&(f=F((i=A(n[c][o],n)).row,i.col,n),c=Math.min(i.row,c),d=Math.max(f.row,d),p=Math.min(i.col,p),h=Math.max(f.col,h)),(1<(parseInt(Z(n[d][o]).attr("rowspan"),10)||1)||1<(parseInt(Z(n[d][o]).attr("colspan"),10)||1))&&(f=F((i=A(n[d][o],n)).row,i.col,n),c=Math.min(i.row,c),d=Math.max(f.row,d),p=Math.min(i.col,p),h=Math.max(f.col,h));return c==t&&d==l&&p==a&&h==s?{min_i:t,max_i:l,min_j:a,max_j:s}:e(c,d,p,h,n)}(Math.min(s.row,n.row),Math.max(s.row,n.row),Math.min(s.col,n.col),Math.max(s.col,n.col),a);D(),t.classList.add("fr-cell-fixed"),l.classList.add("fr-cell-handler");for(var o=r.min_i;o<=r.max_i;o++)for(var i=r.min_j;i<=r.max_j;i++)Z(a[o][i]).addClass("fr-selected-cell")}}function I(e){var t=null,l=Z(e.target);return"TD"==e.target.tagName||"TH"==e.target.tagName?t=e.target:0<l.closest("td",l.closest("tr")[0]).length?t=l.closest("td",l.closest("tr")[0]).get(0):0<l.closest("th",l.closest("thead")[0]).length&&(t=l.closest("th",l.closest("thead")[0]).get(0)),0===w.$el.find(t).length?null:t}function S(){D(),w.popups.hide("table.edit")}function e(e){var t=I(e);if("false"==Z(t).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;if(0<J().length&&!t&&S(),!w.edit.isDisabled()||w.popups.isVisible("table.edit"))if(1!=e.which||1==e.which&&w.helpers.isMac()&&e.ctrlKey)(3==e.which||1==e.which&&w.helpers.isMac()&&e.ctrlKey)&&t&&S();else if(n=!0,t){0<J().length&&!e.shiftKey&&S(),e.stopPropagation(),w.events.trigger("image.hideResizer"),w.events.trigger("video.hideResizer"),s=!0;var l=t.tagName.toLowerCase();e.shiftKey&&0<w.$el.find(l+".fr-selected-cell").length?Z(w.$el.find(l+".fr-selected-cell").closest("table")).is(Z(t).closest("table"))?_(a,t):y():((w.keys.ctrlKey(e)||e.shiftKey)&&(1<J().length||0===Z(t).find(w.selection.element()).length&&!Z(t).is(w.selection.element()))&&y(),a=t,0<w.opts.tableEditButtons.length&&_(a,a))}}function l(e){if(w.popups.areVisible())return!0;if(s||w.$tb.is(e.target)||w.$tb.is(Z(e.target).closest(w.$tb.get(0)))||(0<J().length&&w.toolbar.enable(),D()),!(1!=e.which||1==e.which&&w.helpers.isMac()&&e.ctrlKey)){if(n=!1,s)s=!1,I(e)||1!=J().length?0<J().length&&(w.selection.isCollapsed()?h():(D(),w.edit.on())):D();if(E){E=!1,C.removeClass("fr-moving"),w.$el.removeClass("fr-no-selection"),w.edit.on();var t=parseFloat(C.css("left"))+w.opts.tableResizerOffset+w.$wp.offset().left;w.opts.iframe&&(t-=w.$iframe.offset().left),C.data("release-position",t),C.removeData("max-left"),C.removeData("max-right"),function(){var e=C.data("origin"),t=C.data("release-position");if(e!==t){var l=C.data("first"),a=C.data("second"),s=C.data("table"),n=s.outerWidth();if(w.undo.canDo()||w.undo.saveStep(),null!==l&&null!==a){var r,o,i,f=O(s),c=[],d=[],p=[],h=[];for(r=0;r<f.length;r++)o=Z(f[r][l]),i=Z(f[r][a]),c[r]=o.outerWidth(),p[r]=i.outerWidth(),d[r]=c[r]/n*100,h[r]=p[r]/n*100;for(r=0;r<f.length;r++)if(o=Z(f[r][l]),i=Z(f[r][a]),f[r][l]!=f[r][a]){var u=(d[r]*(c[r]+t-e)/c[r]).toFixed(4);o.css("width",u+"%"),i.css("width",(d[r]+h[r]-u).toFixed(4)+"%")}}else{var b,g=s.parent(),m=n/g.width()*100,v=(parseInt(s.css("margin-left"),10)||0)/g.width()*100,E=(parseInt(s.css("margin-right"),10)||0)/g.width()*100;"rtl"==w.opts.direction&&0===a||"rtl"!=w.opts.direction&&0!==a?(b=(n+t-e)/n*m,s.css("margin-right","calc(100% - "+Math.round(b).toFixed(4)+"% - "+Math.round(v).toFixed(4)+"%)")):("rtl"==w.opts.direction&&0!==a||"rtl"!=w.opts.direction&&0===a)&&(b=(n-t+e)/n*m,s.css("margin-left","calc(100% - "+Math.round(b).toFixed(4)+"% - "+Math.round(E).toFixed(4)+"%)")),s.css("width",Math.round(b).toFixed(4)+"%")}w.selection.restore(),w.undo.saveStep(),w.events.trigger("table.resized",[s.get(0)])}C.removeData("origin"),C.removeData("release-position"),C.removeData("first"),C.removeData("second"),C.removeData("table")}(),W()}}}function T(e){if(!0===s&&0<w.opts.tableEditButtons.length){if(Z(e.currentTarget).closest("table").is(Q())){if("TD"==e.currentTarget.tagName&&0===w.$el.find("th.fr-selected-cell").length)return void _(a,e.currentTarget);if("TH"==e.currentTarget.tagName&&0===w.$el.find("td.fr-selected-cell").length)return void _(a,e.currentTarget)}y()}}function N(e,t,l,a){for(var s,n=t;n!=w.el&&"TD"!=n.tagName&&"TH"!=n.tagName&&("up"==a?s=n.previousElementSibling:"down"==a&&(s=n.nextElementSibling),!s);)n=n.parentNode;"TD"==n.tagName||"TH"==n.tagName?function(e,t){for(var l=e;l&&"TABLE"!=l.tagName&&l.parentNode!=w.el;)l=l.parentNode;if(l&&"TABLE"==l.tagName){var a=O(Z(l));"up"==t?B(A(e,a),l,a):"down"==t&&z(A(e,a),l,a)}}(n,a):s&&("up"==a&&w.selection.setAtEnd(s),"down"==a&&w.selection.setAtStart(s))}function B(e,t,l){0<e.row?w.selection.setAtEnd(l[e.row-1][e.col]):N(0,t,0,"up")}function z(e,t,l){var a=parseInt(l[e.row][e.col].getAttribute("rowspan"),10)||1;e.row<l.length-a?w.selection.setAtStart(l[e.row+a][e.col]):N(0,t,0,"down")}function W(){C&&(C.find("div").css("opacity",0),C.css("top",0),C.css("left",0),C.css("height",0),C.find("div").css("height",0),C.hide())}function k(){o&&o.removeClass("fr-visible").css("left","-9999px")}function K(e,t){var l=Z(t),a=l.closest("table"),s=a.parent();if(t&&"TD"!=t.tagName&&"TH"!=t.tagName&&(0<l.closest("td").length?t=l.closest("td"):0<l.closest("th").length&&(t=l.closest("th"))),!t||"TD"!=t.tagName&&"TH"!=t.tagName)C&&l.get(0)!=C.get(0)&&l.parent().get(0)!=C.get(0)&&w.core.sameInstance(C)&&W();else{if(l=Z(t),0===w.$el.find(l).length)return!1;var n=l.offset().left-1,r=n+l.outerWidth();if(Math.abs(e.pageX-n)<=w.opts.tableResizerOffset||Math.abs(r-e.pageX)<=w.opts.tableResizerOffset){var o,i,f,c,d,p=O(a),h=A(t,p),u=F(h.row,h.col,p),b=a.offset().top,g=a.outerHeight()-1;"rtl"!=w.opts.direction?e.pageX-n<=w.opts.tableResizerOffset?(f=n,0<h.col?(c=n-j(h.col-1,p)+w.opts.tableResizingLimit,d=n+j(h.col,p)-w.opts.tableResizingLimit,o=h.col-1,i=h.col):(o=null,i=0,c=a.offset().left-1-parseInt(a.css("margin-left"),10),d=a.offset().left-1+a.width()-p[0].length*w.opts.tableResizingLimit)):r-e.pageX<=w.opts.tableResizerOffset&&(f=r,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=r-j(u.col,p)+w.opts.tableResizingLimit,d=r+j(u.col+1,p)-w.opts.tableResizingLimit,o=u.col,i=u.col+1):(o=u.col,i=null,c=a.offset().left-1+p[0].length*w.opts.tableResizingLimit,d=s.offset().left-1+s.width()+parseFloat(s.css("padding-left")))):r-e.pageX<=w.opts.tableResizerOffset?(f=r,0<h.col?(c=r-j(h.col,p)+w.opts.tableResizingLimit,d=r+j(h.col-1,p)-w.opts.tableResizingLimit,o=h.col,i=h.col-1):(o=null,i=0,c=a.offset().left+p[0].length*w.opts.tableResizingLimit,d=s.offset().left-1+s.width()+parseFloat(s.css("padding-left")))):e.pageX-n<=w.opts.tableResizerOffset&&(f=n,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=n-j(u.col+1,p)+w.opts.tableResizingLimit,d=n+j(u.col,p)-w.opts.tableResizingLimit,o=u.col+1,i=u.col):(o=u.col,i=null,c=s.offset().left+parseFloat(s.css("padding-left")),d=a.offset().left-1+a.width()-p[0].length*w.opts.tableResizingLimit)),C||(w.shared.$table_resizer||(w.shared.$table_resizer=Z('<div class="fr-table-resizer"><div></div></div>')),C=w.shared.$table_resizer,w.events.$on(C,"mousedown",function(e){return!w.core.sameInstance(C)||(0<J().length&&S(),1==e.which?(w.selection.save(),E=!0,C.addClass("fr-moving"),y(),w.edit.off(),C.find("div").css("opacity",1),!1):void 0)}),w.events.$on(C,"mousemove",function(e){if(!w.core.sameInstance(C))return!0;E&&(w.opts.iframe&&(e.pageX-=w.$iframe.offset().left),X(e))}),w.events.on("shared.destroy",function(){C.html("").removeData().remove(),C=null},!0),w.events.on("destroy",function(){w.$el.find(".fr-selected-cell").removeClass("fr-selected-cell"),C.hide().appendTo(Z("body:first"))},!0)),C.data("table",a),C.data("first",o),C.data("second",i),C.data("instance",w),w.$wp.append(C);var m=f-w.win.pageXOffset-w.opts.tableResizerOffset-w.$wp.offset().left,v=b-w.$wp.offset().top+w.$wp.scrollTop();w.opts.iframe&&(m+=w.$iframe.offset().left,v+=w.$iframe.offset().top,c+=w.$iframe.offset().left,d+=w.$iframe.offset().left),C.data("max-left",c),C.data("max-right",d),C.data("origin",f-w.win.pageXOffset),C.css("top",v),C.css("left",m),C.css("height",g),C.find("div").css("height",g),C.css("padding-left",w.opts.tableResizerOffset),C.css("padding-right",w.opts.tableResizerOffset),C.show()}else w.core.sameInstance(C)&&W()}}function L(e,t){if(w.$box.find(".fr-line-breaker").is(":visible"))return!1;o||q(),w.$box.append(o),o.data("instance",w);var l,a=Z(t).find("tr:first"),s=e.pageX,n=0,r=0;w.opts.iframe&&(n+=w.$iframe.offset().left-w.helpers.scrollLeft(),r+=w.$iframe.offset().top-w.helpers.scrollTop()),a.find("th, td").each(function(){var e=Z(this);return e.offset().left<=s&&s<e.offset().left+e.outerWidth()/2?(l=parseInt(o.find("a").css("width"),10),o.css("top",r+e.offset().top-w.$box.offset().top-l-5),o.css("left",n+e.offset().left-w.$box.offset().left-l/2),o.data("selected-cell",e),o.data("position","before"),o.addClass("fr-visible"),!1):e.offset().left+e.outerWidth()/2<=s&&s<e.offset().left+e.outerWidth()?(l=parseInt(o.find("a").css("width"),10),o.css("top",r+e.offset().top-w.$box.offset().top-l-5),o.css("left",n+e.offset().left-w.$box.offset().left+e.outerWidth()-l/2),o.data("selected-cell",e),o.data("position","after"),o.addClass("fr-visible"),!1):void 0})}function H(e,t){if(w.$box.find(".fr-line-breaker").is(":visible"))return!1;o||q(),w.$box.append(o),o.data("instance",w);var l,a=Z(t),s=e.pageY,n=0,r=0;w.opts.iframe&&(n+=w.$iframe.offset().left-w.helpers.scrollLeft(),r+=w.$iframe.offset().top-w.helpers.scrollTop()),a.find("tr").each(function(){var e=Z(this);return e.offset().top<=s&&s<e.offset().top+e.outerHeight()/2?(l=parseInt(o.find("a").css("width"),10),o.css("top",r+e.offset().top-w.$box.offset().top-l/2),o.css("left",n+e.offset().left-w.$box.offset().left-l-5),o.data("selected-cell",e.find("td:first")),o.data("position","above"),o.addClass("fr-visible"),!1):e.offset().top+e.outerHeight()/2<=s&&s<e.offset().top+e.outerHeight()?(l=parseInt(o.find("a").css("width"),10),o.css("top",r+e.offset().top-w.$box.offset().top+e.outerHeight()-l/2),o.css("left",n+e.offset().left-w.$box.offset().left-l-5),o.data("selected-cell",e.find("td:first")),o.data("position","below"),o.addClass("fr-visible"),!1):void 0})}function Y(e){r=null;var t=w.doc.elementFromPoint(e.pageX-w.win.pageXOffset,e.pageY-w.win.pageYOffset);w.opts.tableResizer&&(!w.popups.areVisible()||w.popups.areVisible()&&w.popups.isVisible("table.edit"))&&K(e,t),!w.opts.tableInsertHelper||w.popups.areVisible()||w.$tb.hasClass("fr-inline")&&w.$tb.is(":visible")||function(e,t){if(0===J().length){var l,a,s;if(t&&("HTML"==t.tagName||"BODY"==t.tagName||w.node.isElement(t)))for(l=1;l<=w.opts.tableInsertHelperOffset;l++){if(a=w.doc.elementFromPoint(e.pageX-w.win.pageXOffset,e.pageY-w.win.pageYOffset+l),Z(a).hasClass("fr-tooltip"))return;if(a&&("TH"==a.tagName||"TD"==a.tagName||"TABLE"==a.tagName)&&(Z(a).parents(".fr-wrapper").length||w.opts.iframe)&&"false"!=Z(a).closest("table").attr("contenteditable"))return L(e,Z(a).closest("table"));if(s=w.doc.elementFromPoint(e.pageX-w.win.pageXOffset+l,e.pageY-w.win.pageYOffset),Z(s).hasClass("fr-tooltip"))return;if(s&&("TH"==s.tagName||"TD"==s.tagName||"TABLE"==s.tagName)&&(Z(s).parents(".fr-wrapper").length||w.opts.iframe)&&"false"!=Z(s).closest("table").attr("contenteditable"))return H(e,Z(s).closest("table"))}w.core.sameInstance(o)&&k()}}(e,t)}function P(){if(E){var e=C.data("table").offset().top-w.win.pageYOffset;w.opts.iframe&&(e+=w.$iframe.offset().top-w.helpers.scrollTop()),C.css("top",e)}}function j(e,t){var l,a=Z(t[0][e]).outerWidth();for(l=1;l<t.length;l++)a=Math.min(a,Z(t[l][e]).outerWidth());return a}function V(e,t,l){var a,s=0;for(a=e;a<=t;a++)s+=j(a,l);return s}function X(e){if(1<J().length&&n&&y(),!1===n&&!1===s&&!1===E)r&&clearTimeout(r),w.edit.isDisabled()&&!w.popups.isVisible("table.edit")||(r=setTimeout(Y,30,e));else if(E){var t=e.pageX-w.win.pageXOffset;w.opts.iframe&&(t+=w.$iframe.offset().left);var l=C.data("max-left"),a=C.data("max-right");l<=t&&t<=a?C.css("left",t-w.opts.tableResizerOffset-w.$wp.offset().left):t<l&&parseFloat(C.css("left"),10)>l-w.opts.tableResizerOffset?C.css("left",l-w.opts.tableResizerOffset-w.$wp.offset().left):a<t&&parseFloat(C.css("left"),10)<a-w.opts.tableResizerOffset&&C.css("left",a-w.opts.tableResizerOffset-w.$wp.offset().left)}else n&&k()}function U(e){w.node.isEmpty(e.get(0))?e.prepend(Z.FE.MARKERS):e.prepend(Z.FE.START_MARKER).append(Z.FE.END_MARKER)}function q(){w.shared.$ti_helper||(w.shared.$ti_helper=Z('<div class="fr-insert-helper"><a class="fr-floating-btn" role="button" tabIndex="-1" title="'+w.language.translate("Insert")+'"><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M22,16.75 L16.75,16.75 L16.75,22 L15.25,22.000 L15.25,16.75 L10,16.75 L10,15.25 L15.25,15.25 L15.25,10 L16.75,10 L16.75,15.25 L22,15.25 L22,16.75 Z"/></svg></a></div>'),w.events.bindClick(w.shared.$ti_helper,"a",function(){var e=o.data("selected-cell"),t=o.data("position"),l=o.data("instance")||w;"before"==t?(w.undo.saveStep(),e.addClass("fr-selected-cell"),l.table.insertColumn(t),e.removeClass("fr-selected-cell"),w.undo.saveStep()):"after"==t?(w.undo.saveStep(),e.addClass("fr-selected-cell"),l.table.insertColumn(t),e.removeClass("fr-selected-cell"),w.undo.saveStep()):"above"==t?(w.undo.saveStep(),e.addClass("fr-selected-cell"),l.table.insertRow(t),e.removeClass("fr-selected-cell"),w.undo.saveStep()):"below"==t&&(w.undo.saveStep(),e.addClass("fr-selected-cell"),l.table.insertRow(t),e.removeClass("fr-selected-cell"),w.undo.saveStep()),k()}),w.events.on("shared.destroy",function(){w.shared.$ti_helper.html("").removeData().remove(),w.shared.$ti_helper=null},!0),w.events.$on(w.shared.$ti_helper,"mousemove",function(e){e.stopPropagation()},!0),w.events.$on(Z(w.o_win),"scroll",function(){k()},!0),w.events.$on(w.$wp,"scroll",function(){k()},!0)),o=w.shared.$ti_helper,w.events.on("destroy",function(){o=null}),w.tooltip.bind(w.$box,".fr-insert-helper > a.fr-floating-btn")}function G(){a=null,clearTimeout(r)}function J(){return w.el.querySelectorAll(".fr-selected-cell")}function Q(){var e=J();if(e.length){for(var t=e[0];t&&"TABLE"!=t.tagName&&t.parentNode!=w.el;)t=t.parentNode;return t&&"TABLE"==t.tagName?Z(t):Z([])}return Z([])}return{_init:function(){if(!w.$wp)return!1;if(!w.helpers.isMobile()){E=s=n=!1,w.events.$on(w.$el,"mousedown",e),w.popups.onShow("image.edit",function(){D(),s=n=!1}),w.popups.onShow("link.edit",function(){D(),s=n=!1}),w.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&D()}),w.events.$on(w.$el,"mouseenter","th, td",T),w.events.$on(w.$win,"mouseup",l),w.opts.iframe&&w.events.$on(Z(w.o_win),"mouseup",l),w.events.$on(w.$win,"mousemove",X),w.events.$on(Z(w.o_win),"scroll",P),w.events.on("contentChanged",function(){0<J().length&&(h(),w.$el.find("img").on("load.selected-cells",function(){Z(this).off("load.selected-cells"),0<J().length&&h()}))}),w.events.$on(Z(w.o_win),"resize",function(){D()}),w.events.on("toolbar.esc",function(){if(0<J().length)return w.events.disableBlur(),w.events.focus(),!1},!0),w.events.$on(Z(w.o_win),"keydown",function(){n&&s&&(s=n=!1,w.$el.removeClass("fr-no-selection"),w.edit.on(),w.selection.setAtEnd(w.$el.find(".fr-selected-cell:last").get(0)),w.selection.restore(),D())}),w.events.$on(w.$el,"keydown",function(e){e.shiftKey?!1===function(e){var t=J();if(0<t.length){var l,a,s=O(),n=e.which;1==t.length?a=l=t[0]:(l=w.el.querySelector(".fr-cell-fixed"),a=w.el.querySelector(".fr-cell-handler"));var r=A(a,s);if(Z.FE.KEYCODE.ARROW_RIGHT==n){if(r.col<s[0].length-1)return _(l,s[r.row][r.col+1]),!1}else if(Z.FE.KEYCODE.ARROW_DOWN==n){if(r.row<s.length-1)return _(l,s[r.row+1][r.col]),!1}else if(Z.FE.KEYCODE.ARROW_LEFT==n){if(0<r.col)return _(l,s[r.row][r.col-1]),!1}else if(Z.FE.KEYCODE.ARROW_UP==n&&0<r.row)return _(l,s[r.row-1][r.col]),!1}}(e)&&setTimeout(function(){h()},0):function(e){var t=e.which,l=w.selection.blocks();if(l.length&&("TD"==(l=l[0]).tagName||"TH"==l.tagName)){for(var a=l;a&&"TABLE"!=a.tagName&&a.parentNode!=w.el;)a=a.parentNode;if(a&&"TABLE"==a.tagName&&(Z.FE.KEYCODE.ARROW_LEFT==t||Z.FE.KEYCODE.ARROW_UP==t||Z.FE.KEYCODE.ARROW_RIGHT==t||Z.FE.KEYCODE.ARROW_DOWN==t)&&(0<J().length&&S(),w.browser.webkit&&(Z.FE.KEYCODE.ARROW_UP==t||Z.FE.KEYCODE.ARROW_DOWN==t))){var s=w.selection.ranges(0).startContainer;if(s.nodeType==Node.TEXT_NODE&&(Z.FE.KEYCODE.ARROW_UP==t&&(s.previousSibling&&"BR"!==s.previousSibling.tagName||s.previousSibling&&"BR"===s.previousSibling.tagName&&s.previousSibling.previousSibling)||Z.FE.KEYCODE.ARROW_DOWN==t&&(s.nextSibling&&"BR"!==s.nextSibling.tagName||s.nextSibling&&"BR"===s.nextSibling.tagName&&s.nextSibling.nextSibling)))return;e.preventDefault(),e.stopPropagation();var n=O(Z(a)),r=A(l,n);Z.FE.KEYCODE.ARROW_UP==t?B(r,a,n):Z.FE.KEYCODE.ARROW_DOWN==t&&z(r,a,n),w.selection.restore()}}}(e)}),w.events.on("keydown",function(e){if(!1===function(e){if(e.which==Z.FE.KEYCODE.TAB){var t;if(0<J().length)t=w.$el.find(".fr-selected-cell:last");else{var l=w.selection.element();"TD"==l.tagName||"TH"==l.tagName?t=Z(l):l!=w.el&&(0<Z(l).parentsUntil(w.$el,"td").length?t=Z(l).parents("td:first"):0<Z(l).parentsUntil(w.$el,"th").length&&(t=Z(l).parents("th:first")))}if(t)return e.preventDefault(),!!(0===w.selection.get().focusOffset&&0<Z(w.selection.element()).parentsUntil(w.$el,"ol, ul").length&&(0<Z(w.selection.element()).closest("li").prev().length||Z(w.selection.element()).is("li")&&0<Z(w.selection.element()).prev().length))||(S(),e.shiftKey?0<t.prev().length?U(t.prev()):0<t.closest("tr").length&&0<t.closest("tr").prev().length?U(t.closest("tr").prev().find("td:last")):0<t.closest("tbody").length&&0<t.closest("table").find("thead tr").length&&U(t.closest("table").find("thead tr th:last")):0<t.next().length?U(t.next()):0<t.closest("tr").length&&0<t.closest("tr").next().length?U(t.closest("tr").next().find("td:first")):0<t.closest("thead").length&&0<t.closest("table").find("tbody tr").length?U(t.closest("table").find("tbody tr td:first")):(t.addClass("fr-selected-cell"),b("below"),D(),U(t.closest("tr").next().find("td:first"))),w.selection.restore(),!1)}}(e))return!1;var t=J();if(0<t.length){if(0<t.length&&w.keys.ctrlKey(e)&&e.which==Z.FE.KEYCODE.A)return D(),w.popups.isVisible("table.edit")&&w.popups.hide("table.edit"),t=[],!0;if(e.which==Z.FE.KEYCODE.ESC&&w.popups.isVisible("table.edit"))return D(),w.popups.hide("table.edit"),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!(t=[]);if(1<t.length&&(e.which==Z.FE.KEYCODE.BACKSPACE||e.which==Z.FE.KEYCODE.DELETE)){w.undo.saveStep();for(var l=0;l<t.length;l++)Z(t[l]).html("<br>"),l==t.length-1&&Z(t[l]).prepend(Z.FE.MARKERS);return w.selection.restore(),w.undo.saveStep(),!(t=[])}if(1<t.length&&e.which!=Z.FE.KEYCODE.F10&&!w.keys.isBrowserAction(e))return e.preventDefault(),!(t=[])}else if(!(t=[])===function(e){if(e.altKey&&e.which==Z.FE.KEYCODE.SPACE){var t,l=w.selection.element();if("TD"==l.tagName||"TH"==l.tagName?t=l:0<Z(l).closest("td").length?t=Z(l).closest("td").get(0):0<Z(l).closest("th").length&&(t=Z(l).closest("th").get(0)),t)return e.preventDefault(),_(t,t),h(),!1}}(e))return!1},!0);var t=[];w.events.on("html.beforeGet",function(){t=J();for(var e=0;e<t.length;e++)t[e].className=(t[e].className||"").replace(/fr-selected-cell/g,"")}),w.events.on("html.afterGet",function(){for(var e=0;e<t.length;e++)t[e].className=(t[e].className?t[e].className.trim()+" ":"")+"fr-selected-cell";t=[]}),c(!0),p(!0)}w.events.on("destroy",G)},insert:function(e,t){var l,a,s="<table "+(w.opts.tableDefaultWidth?'style="width: '+w.opts.tableDefaultWidth+';" ':"")+'class="fr-inserted-table"><tbody>',n=100/t;for(l=0;l<e;l++){for(s+="<tr>",a=0;a<t;a++)s+="<td"+(w.opts.tableDefaultWidth?' style="width: '+n.toFixed(4)+'%;"':"")+">",0===l&&0===a&&(s+=Z.FE.MARKERS),s+="<br></td>";s+="</tr>"}s+="</tbody></table>",w.html.insert(s),w.selection.restore();var r=w.$el.find(".fr-inserted-table");r.removeClass("fr-inserted-table"),w.events.trigger("table.inserted",[r.get(0)])},remove:u,insertRow:b,deleteRow:function(){var e=Q();if(0<e.length){var t,l,a,s=O(),n=$(s);if(0===n.min_i&&n.max_i==s.length-1)u();else{for(t=n.max_i;t>=n.min_i;t--){for(a=Z(e.find("tr").not(e.find("table tr")).get(t)),l=0;l<s[t].length;l++)if(0===l||s[t][l]!=s[t][l-1]){var r=Z(s[t][l]);if(1<parseInt(r.attr("rowspan"),10)){var o=parseInt(r.attr("rowspan"),10)-1;1==o?r.removeAttr("rowspan"):r.attr("rowspan",o)}if(t<s.length-1&&s[t][l]==s[t+1][l]&&(0===t||s[t][l]!=s[t-1][l])){for(var i=s[t][l],f=l;0<f&&s[t][f]==s[t][f-1];)f--;0===f?Z(e.find("tr").not(e.find("table tr")).get(t+1)).prepend(i):Z(s[t+1][f-1]).after(i)}}var c=a.parent();a.remove(),0===c.find("tr").length&&c.remove(),s=O(e)}R(0,s.length-1,0,s[0].length-1,e),0<n.min_i?w.selection.setAtEnd(s[n.min_i-1][0]):w.selection.setAtEnd(s[0][0]),w.selection.restore(),w.popups.hide("table.edit")}}},insertColumn:function(i){var e=Q();if(0<e.length){var f,c=O(),t=$(c);f="before"==i?t.min_j:t.max_j;var l,d=100/c[0].length,p=100/(c[0].length+1);e.find("th, td").each(function(){(l=Z(this)).data("old-width",l.outerWidth()/e.outerWidth()*100)}),e.find("tr").not(e.find("table tr")).each(function(e){for(var t,l=Z(this),a=0,s=0;a-1<f;){if(!(t=l.find("> th, > td").get(s))){t=null;break}t==c[e][a]?(a+=parseInt(Z(t).attr("colspan"),10)||1,s++):(a+=parseInt(Z(c[e][a]).attr("colspan"),10)||1,"after"==i&&(t=0===s?-1:l.find("> th, > td").get(s-1)))}var n,r=Z(t);if("after"==i&&f<a-1||"before"==i&&0<f&&c[e][f]==c[e][f-1]){if(0===e||0<e&&c[e][f]!=c[e-1][f]){var o=parseInt(r.attr("colspan"),10)+1;r.attr("colspan",o),r.css("width",(r.data("old-width")*p/d+p).toFixed(4)+"%"),r.removeData("old-width")}}else n=0<l.find("th").length?'<th style="width: '+p.toFixed(4)+'%;"><br></th>':'<td style="width: '+p.toFixed(4)+'%;"><br></td>',-1==t?l.prepend(n):null==t?l.append(n):"before"==i?r.before(n):"after"==i&&r.after(n)}),e.find("th, td").each(function(){(l=Z(this)).data("old-width")&&(l.css("width",(l.data("old-width")*p/d).toFixed(4)+"%"),l.removeData("old-width"))}),w.popups.isVisible("table.edit")&&h()}},deleteColumn:function(){var e=Q();if(0<e.length){var t,l,a,s=O(),n=$(s);if(0===n.min_j&&n.max_j==s[0].length-1)u();else{var r=0;for(t=0;t<s.length;t++)for(l=0;l<s[0].length;l++)(a=Z(s[t][l])).hasClass("fr-selected-cell")||(a.data("old-width",a.outerWidth()/e.outerWidth()*100),(l<n.min_j||l>n.max_j)&&(r+=a.outerWidth()/e.outerWidth()*100));for(r/=s.length,l=n.max_j;l>=n.min_j;l--)for(t=0;t<s.length;t++)if(0===t||s[t][l]!=s[t-1][l])if(a=Z(s[t][l]),1<(parseInt(a.attr("colspan"),10)||1)){var o=parseInt(a.attr("colspan"),10)-1;1==o?a.removeAttr("colspan"):a.attr("colspan",o),a.css("width",(100*(a.data("old-width")-j(l,s))/r).toFixed(4)+"%"),a.removeData("old-width")}else{var i=Z(a.parent().get(0));a.remove(),0===i.find("> th, > td").length&&(0===i.prev().length||0===i.next().length||i.prev().find("> th[rowspan], > td[rowspan]").length<i.prev().find("> th, > td").length)&&i.remove()}R(0,s.length-1,0,s[0].length-1,e),0<n.min_j?w.selection.setAtEnd(s[n.min_i][n.min_j-1]):w.selection.setAtEnd(s[n.min_i][0]),w.selection.restore(),w.popups.hide("table.edit"),e.find("th, td").each(function(){(a=Z(this)).data("old-width")&&(a.css("width",(100*a.data("old-width")/r).toFixed(4)+"%"),a.removeData("old-width"))})}}},mergeCells:function(){if(1<J().length&&(0===w.$el.find("th.fr-selected-cell").length||0===w.$el.find("td.fr-selected-cell").length)){x();var e,t,l=$(O()),a=w.$el.find(".fr-selected-cell"),s=Z(a[0]),n=s.parent().find(".fr-selected-cell"),r=s.closest("table"),o=s.html(),i=0;for(e=0;e<n.length;e++)i+=Z(n[e]).outerWidth();for(s.css("width",Math.min(100,i/r.outerWidth()*100).toFixed(4)+"%"),l.min_j<l.max_j&&s.attr("colspan",l.max_j-l.min_j+1),l.min_i<l.max_i&&s.attr("rowspan",l.max_i-l.min_i+1),e=1;e<a.length;e++)"<br>"!=(t=Z(a[e])).html()&&""!==t.html()&&(o+="<br>"+t.html()),t.remove();s.html(o),w.selection.setAtEnd(s.get(0)),w.selection.restore(),w.toolbar.enable(),m(l.min_i,l.max_i,r);var f=r.find("tr:empty");for(e=f.length-1;0<=e;e--)Z(f[e]).remove();g(l.min_j,l.max_j,r),h()}},splitCellVertically:function(){if(1==J().length){var e=w.$el.find(".fr-selected-cell"),t=parseInt(e.attr("colspan"),10)||1,l=e.parent().outerWidth(),a=e.outerWidth(),s=e.clone().html("<br>"),n=O(),r=A(e.get(0),n);if(1<t){var o=Math.ceil(t/2);a=V(r.col,r.col+o-1,n)/l*100;var i=V(r.col+o,r.col+t-1,n)/l*100;1<o?e.attr("colspan",o):e.removeAttr("colspan"),1<t-o?s.attr("colspan",t-o):s.removeAttr("colspan"),e.css("width",a.toFixed(4)+"%"),s.css("width",i.toFixed(4)+"%")}else{var f;for(f=0;f<n.length;f++)if(0===f||n[f][r.col]!=n[f-1][r.col]){var c=Z(n[f][r.col]);if(!c.is(e)){var d=(parseInt(c.attr("colspan"),10)||1)+1;c.attr("colspan",d)}}a=a/l*100/2,e.css("width",a.toFixed(4)+"%"),s.css("width",a.toFixed(4)+"%")}e.after(s),D(),w.popups.hide("table.edit")}},splitCellHorizontally:function(){if(1==J().length){var e=w.$el.find(".fr-selected-cell"),t=e.parent(),l=e.closest("table"),a=parseInt(e.attr("rowspan"),10),s=O(),n=A(e.get(0),s),r=e.clone().html("<br>");if(1<a){var o=Math.ceil(a/2);1<o?e.attr("rowspan",o):e.removeAttr("rowspan"),1<a-o?r.attr("rowspan",a-o):r.removeAttr("rowspan");for(var i=n.row+o,f=0===n.col?n.col:n.col-1;0<=f&&(s[i][f]==s[i][f-1]||0<i&&s[i][f]==s[i-1][f]);)f--;-1==f?Z(l.find("tr").not(l.find("table tr")).get(i)).prepend(r):Z(s[i][f]).after(r)}else{var c,d=Z("<tr>").append(r);for(c=0;c<s[0].length;c++)if(0===c||s[n.row][c]!=s[n.row][c-1]){var p=Z(s[n.row][c]);p.is(e)||p.attr("rowspan",(parseInt(p.attr("rowspan"),10)||1)+1)}t.after(d)}D(),w.popups.hide("table.edit")}},addHeader:function(){var e=Q();if(0<e.length&&0===e.find("th").length){var t,l="<thead><tr>",a=0;for(e.find("tr:first > td").each(function(){var e=Z(this);a+=parseInt(e.attr("colspan"),10)||1}),t=0;t<a;t++)l+="<th><br></th>";l+="</tr></thead>",e.prepend(l),h()}},removeHeader:function(){var e=Q(),t=e.find("thead");if(0<t.length)if(0===e.find("tbody tr").length)u();else if(t.remove(),0<J().length)h();else{w.popups.hide("table.edit");var l=e.find("tbody tr:first td:first").get(0);l&&(w.selection.setAtEnd(l),w.selection.restore())}},setBackground:t,showInsertPopup:function(){var e=w.$tb.find('.fr-command[data-cmd="insertTable"]'),t=w.popups.get("table.insert");if(t||(t=c()),!t.hasClass("fr-active")){w.popups.refresh("table.insert"),w.popups.setContainer("table.insert",w.$tb);var l=e.offset().left+e.outerWidth()/2,a=e.offset().top+(w.opts.toolbarBottom?10:e.outerHeight()-10);w.popups.show("table.insert",l,a,e.outerHeight())}},showEditPopup:h,showColorsPopup:f,back:function(){0<J().length?h():(w.popups.hide("table.insert"),w.toolbar.showInline())},verticalAlign:function(e){w.$el.find(".fr-selected-cell").css("vertical-align",e)},horizontalAlign:function(e){w.$el.find(".fr-selected-cell").css("text-align",e)},applyStyle:function(e,t,l,a){if(0<t.length){if(!l){var s=Object.keys(a);s.splice(s.indexOf(e),1),t.removeClass(s.join(" "))}t.toggleClass(e)}},selectedTable:Q,selectedCells:J,customColor:function(){var e=w.popups.get("table.colors").find(".fr-table-colors-hex-layer input");e.length&&t(e.val())},selectCells:_}},Z.FE.DefineIcon("insertTable",{NAME:"table"}),Z.FE.RegisterCommand("insertTable",{title:"Insert Table",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("table.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("table.insert")):this.table.showInsertPopup()},plugin:"table"}),Z.FE.RegisterCommand("tableInsert",{callback:function(e,t,l){this.table.insert(t,l),this.popups.hide("table.insert")}}),Z.FE.DefineIcon("tableHeader",{NAME:"header",FA5NAME:"heading"}),Z.FE.RegisterCommand("tableHeader",{title:"Table Header",focus:!1,toggle:!0,callback:function(){this.popups.get("table.edit").find('.fr-command[data-cmd="tableHeader"]').hasClass("fr-active")?this.table.removeHeader():this.table.addHeader()},refresh:function(e){var t=this.table.selectedTable();0<t.length&&(0===t.find("th").length?e.removeClass("fr-active").attr("aria-pressed",!1):e.addClass("fr-active").attr("aria-pressed",!0))}}),Z.FE.DefineIcon("tableRows",{NAME:"bars"}),Z.FE.RegisterCommand("tableRows",{type:"dropdown",focus:!1,title:"Row",options:{above:"Insert row above",below:"Insert row below","delete":"Delete row"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableRows.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableRows" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){"above"==t||"below"==t?this.table.insertRow(t):this.table.deleteRow()}}),Z.FE.DefineIcon("tableColumns",{NAME:"bars fa-rotate-90"}),Z.FE.RegisterCommand("tableColumns",{type:"dropdown",focus:!1,title:"Column",options:{before:"Insert column before",after:"Insert column after","delete":"Delete column"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableColumns.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableColumns" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){"before"==t||"after"==t?this.table.insertColumn(t):this.table.deleteColumn()}}),Z.FE.DefineIcon("tableCells",{NAME:"square-o",FA5NAME:"square"}),Z.FE.RegisterCommand("tableCells",{type:"dropdown",focus:!1,title:"Cell",options:{merge:"Merge cells","vertical-split":"Vertical split","horizontal-split":"Horizontal split"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableCells.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCells" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){"merge"==t?this.table.mergeCells():"vertical-split"==t?this.table.splitCellVertically():this.table.splitCellHorizontally()},refreshOnShow:function(e,t){1<this.$el.find(".fr-selected-cell").length?(t.find('a[data-param1="vertical-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="horizontal-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="merge"]').removeClass("fr-disabled").attr("aria-disabled",!1)):(t.find('a[data-param1="merge"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="vertical-split"]').removeClass("fr-disabled").attr("aria-disabled",!1),t.find('a[data-param1="horizontal-split"]').removeClass("fr-disabled").attr("aria-disabled",!1))}}),Z.FE.DefineIcon("tableRemove",{NAME:"trash"}),Z.FE.RegisterCommand("tableRemove",{title:"Remove Table",focus:!1,callback:function(){this.table.remove()}}),Z.FE.DefineIcon("tableStyle",{NAME:"paint-brush"}),Z.FE.RegisterCommand("tableStyle",{title:"Table Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableStyles;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableStyle" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell").closest("table"),this.opts.tableMultipleStyles,this.opts.tableStyles)},refreshOnShow:function(e,t){var l=this.$el.find(".fr-selected-cell").closest("table");l&&t.find(".fr-command").each(function(){var e=Z(this).data("param1"),t=l.hasClass(e);Z(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Z.FE.DefineIcon("tableCellBackground",{NAME:"tint"}),Z.FE.RegisterCommand("tableCellBackground",{title:"Cell Background",focus:!1,popup:!0,callback:function(){this.table.showColorsPopup()}}),Z.FE.RegisterCommand("tableCellBackgroundColor",{undo:!0,focus:!1,callback:function(e,t){this.table.setBackground(t)}}),Z.FE.DefineIcon("tableBack",{NAME:"arrow-left"}),Z.FE.RegisterCommand("tableBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.table.back()},refresh:function(e){0!==this.table.selectedCells().length||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),Z.FE.DefineIcon("tableCellVerticalAlign",{NAME:"arrows-v",FA5NAME:"arrows-alt-v"}),Z.FE.RegisterCommand("tableCellVerticalAlign",{type:"dropdown",focus:!1,title:"Vertical Align",options:{Top:"Align Top",Middle:"Align Middle",Bottom:"Align Bottom"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableCellVerticalAlign.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellVerticalAlign" data-param1="'+l.toLowerCase()+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(l)+"</a></li>");return e+="</ul>"},callback:function(e,t){this.table.verticalAlign(t)},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.$el.find(".fr-selected-cell").css("vertical-align")+'"]').addClass("fr-active").attr("aria-selected",!0)}}),Z.FE.DefineIcon("tableCellHorizontalAlign",{NAME:"align-left"}),Z.FE.DefineIcon("align-left",{NAME:"align-left"}),Z.FE.DefineIcon("align-right",{NAME:"align-right"}),Z.FE.DefineIcon("align-center",{NAME:"align-center"}),Z.FE.DefineIcon("align-justify",{NAME:"align-justify"}),Z.FE.RegisterCommand("tableCellHorizontalAlign",{type:"dropdown",focus:!1,title:"Horizontal Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.tableCellHorizontalAlign.options;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="tableCellHorizontalAlign" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.icon.create("align-"+l)+'<span class="fr-sr-only">'+this.language.translate(t[l])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.table.horizontalAlign(t)},refresh:function(e){var t=this.table.selectedCells();t.length&&e.find("> *:first").replaceWith(this.icon.create("align-"+this.helpers.getAlignment(Z(t[0]))))},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.helpers.getAlignment(this.$el.find(".fr-selected-cell:first"))+'"]').addClass("fr-active").attr("aria-selected",!0)}}),Z.FE.DefineIcon("tableCellStyle",{NAME:"magic"}),Z.FE.RegisterCommand("tableCellStyle",{title:"Cell Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableCellStyles;for(var l in t)t.hasOwnProperty(l)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellStyle" data-param1="'+l+'" title="'+this.language.translate(t[l])+'">'+this.language.translate(t[l])+"</a></li>");return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell"),this.opts.tableCellMultipleStyles,this.opts.tableCellStyles)},refreshOnShow:function(e,t){var l=this.$el.find(".fr-selected-cell:first");l&&t.find(".fr-command").each(function(){var e=Z(this).data("param1"),t=l.hasClass(e);Z(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Z.FE.RegisterCommand("tableCellBackgroundCustomColor",{title:"OK",undo:!0,callback:function(){this.table.customColor()}}),Z.FE.DefineIcon("tableColorRemove",{NAME:"eraser"})});
|