/*! * froala_editor v2.0.4 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms * Copyright 2014-2015 Froala Labs */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.extend(a.FroalaEditor.POPUP_TEMPLATES,{emoticons:"[_BUTTONS_][_EMOTICONS_]"}),a.extend(a.FroalaEditor.DEFAULTS,{emoticonsStep:8,emoticonsSet:[{code:"😀",desc:"Grinning face"},{code:"😁",desc:"Grinning face with smiling eyes"},{code:"😂",desc:"Face with tears of joy"},{code:"😃",desc:"Smiling face with open mouth"},{code:"😄",desc:"Smiling face with open mouth and smiling eyes"},{code:"😅",desc:"Smiling face with open mouth and cold sweat"},{code:"😆",desc:"Smiling face with open mouth and tightly-closed eyes"},{code:"😇",desc:"Smiling face with halo"},{code:"😈",desc:"Smiling face with horns"},{code:"😉",desc:"Winking face"},{code:"😊",desc:"Smiling face with smiling eyes"},{code:"😋",desc:"Face savoring delicious food"},{code:"😌",desc:"Relieved face"},{code:"😍",desc:"Smiling face with heart-shaped eyes"},{code:"😎",desc:"Smiling face with sunglasses"},{code:"😏",desc:"Smirking face"},{code:"😐",desc:"Neutral face"},{code:"😑",desc:"Expressionless face"},{code:"😒",desc:"Unamused face"},{code:"😓",desc:"Face with cold sweat"},{code:"😔",desc:"Pensive face"},{code:"😕",desc:"Confused face"},{code:"😖",desc:"Confounded face"},{code:"😗",desc:"Kissing face"},{code:"😘",desc:"Face throwing a kiss"},{code:"😙",desc:"Kissing face with smiling eyes"},{code:"😚",desc:"Kissing face with closed eyes"},{code:"😛",desc:"Face with stuck out tongue"},{code:"😜",desc:"Face with stuck out tongue and winking eye"},{code:"😝",desc:"Face with stuck out tongue and tightly-closed eyes"},{code:"😞",desc:"Disappointed face"},{code:"😟",desc:"Worried face"},{code:"😠",desc:"Angry face"},{code:"😡",desc:"Pouting face"},{code:"😢",desc:"Crying face"},{code:"😣",desc:"Persevering face"},{code:"😤",desc:"Face with look of triumph"},{code:"😥",desc:"Disappointed but relieved face"},{code:"😦",desc:"Frowning face with open mouth"},{code:"😧",desc:"Anguished face"},{code:"😨",desc:"Fearful face"},{code:"😩",desc:"Weary face"},{code:"😪",desc:"Sleepy face"},{code:"😫",desc:"Tired face"},{code:"😬",desc:"Grimacing face"},{code:"😭",desc:"Loudly crying face"},{code:"😮",desc:"Face with open mouth"},{code:"😯",desc:"Hushed face"},{code:"😰",desc:"Face with open mouth and cold sweat"},{code:"😱",desc:"Face screaming in fear"},{code:"😲",desc:"Astonished face"},{code:"😳",desc:"Flushed face"},{code:"😴",desc:"Sleeping face"},{code:"😵",desc:"Dizzy face"},{code:"😶",desc:"Face without mouth"},{code:"😷",desc:"Face with medical mask"}],emoticonsButtons:["emoticonsBack","|"]}),a.FroalaEditor.PLUGINS.emoticons=function(b){function c(){var a=b.$tb.find('.fr-command[data-cmd="emoticons"]'),c=b.popups.get("emoticons");if(c||(c=e()),!c.hasClass("fr-active")){b.popups.refresh("emoticons"),b.popups.setContainer("emoticons",b.$tb);var d=a.offset().left+a.outerWidth()/2,f=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("emoticons",d,f,a.outerHeight())}}function d(){b.popups.hide("emoticons")}function e(){var a="";b.opts.toolbarInline&&b.opts.emoticonsButtons.length>0&&(a='
'+b.button.buildList(b.opts.emoticonsButtons)+"
");var c={buttons:a,emoticons:f()},d=b.popups.create("emoticons",c);return b.tooltip.bind(d,".fr-emoticon"),d}function f(){for(var a="
",c=0;c"),a+=''+b.opts.emoticonsSet[c].code+"";return a+="
"}function g(c){b.html.insert(''+c+""+a.FroalaEditor.MARKERS,!0)}function h(){b.popups.hide("emoticons"),b.toolbar.showInline()}function i(){b.events.on("html.get",function(c){for(var d=0;d").html(e.code).text();c=c.split(f).join(e.code)}return c});var c=function(){if(!b.selection.isCollapsed())return!1;var c=b.selection.element(),d=b.selection.endElement();if(a(c).hasClass("fr-emoticon"))return c;if(a(d).hasClass("fr-emoticon"))return d;var e=b.selection.ranges(0),f=e.startContainer;if(f.nodeType==Node.ELEMENT_NODE&&f.childNodes.length>0&&e.startOffset>0){var g=f.childNodes[e.startOffset-1];if(a(g).hasClass("fr-emoticon"))return g}return!1};b.events.on("keydown",function(d){if(b.keys.isCharacter(d.which)&&b.selection.inEditor()){var e=b.selection.ranges(0),f=c();f&&(0===e.startOffset?a(f).before(a.FroalaEditor.MARKERS+a.FroalaEditor.INVISIBLE_SPACE):a(f).after(a.FroalaEditor.INVISIBLE_SPACE+a.FroalaEditor.MARKERS),b.selection.restore())}}),b.events.on("keyup",function(){for(var c=b.$el.get(0).querySelectorAll(".fr-emoticon"),d=0;d