/** Trumbowyg v2.0.0-beta.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ jQuery.trumbowyg={langs:{en:{viewHTML:"View HTML",formatting:"Formatting",p:"Paragraph",blockquote:"Quote",code:"Code",header:"Header",bold:"Bold",italic:"Italic",strikethrough:"Stroke",underline:"Underline",strong:"Strong",em:"Emphasis",del:"Deleted",unorderedList:"Unordered list",orderedList:"Ordered list",insertImage:"Insert Image",insertVideo:"Insert Video",link:"Link",createLink:"Insert link",unlink:"Remove link",justifyLeft:"Align Left",justifyCenter:"Align Center",justifyRight:"Align Right",justifyFull:"Align Justify",horizontalRule:"Insert horizontal rule",removeformat:"Remove format",fullscreen:"fullscreen",close:"Close",submit:"Confirm",reset:"Cancel",required:"Required",description:"Description",title:"Title",text:"Text"}},opts:{},btnsGrps:{design:["bold","italic","underline","strikethrough"],semantic:["strong","em","del"],justify:["justifyLeft","justifyCenter","justifyRight","justifyFull"],lists:["unorderedList","orderedList"]}},function(e,t,n,o,i){"use strict";o.fn.trumbowyg=function(e,t){if(e===Object(e)||!e)return this.each(function(){o(this).data("trumbowyg")||o(this).data("trumbowyg",new r(this,e))});if(1===this.length)try{var n=o(this).data("trumbowyg");switch(e){case"openModal":return n.openModal(t.title,t.content);case"closeModal":return n.closeModal();case"openModalInsert":return n.openModalInsert(t.title,t.fields,t.callback);case"saveSelection":return n.saveSelection();case"getSelection":return n.selection;case"getSelectedText":return n.getSelectedText();case"restoreSelection":return n.restoreSelection();case"destroy":return n.destroy();case"empty":return n.empty();case"lang":return n.lang;case"html":return n.html(t)}}catch(i){}return!1};var r=function(e,t){var i=this;i.doc=e.ownerDocument||n,i.$ta=o(e),i.$c=o(e),t=o.extend(!0,{},t,o.trumbowyg.opts),i.lang="undefined"==typeof t.lang||"undefined"==typeof o.trumbowyg.langs[t.lang]?o.trumbowyg.langs.en:o.extend(!0,{},o.trumbowyg.langs.en,o.trumbowyg.langs[t.lang]);var r=i.lang.header;i.o=o.extend(!0,{},{lang:"en",dir:"ltr",closable:!1,fullscreenable:!0,fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,prefix:"trumbowyg-",semantic:!0,resetCss:!1,removeformatPasted:!1,btns:["viewHTML","|","formatting","|","btnGrp-design","|","link","|","insertImage","|","btnGrp-justify","|","btnGrp-lists","|","horizontalRule","|","removeformat"],btnsAdd:[],btnsDef:{viewHTML:{func:"toggle"},p:{func:"formatBlock"},blockquote:{func:"formatBlock"},h1:{func:"formatBlock",title:r+" 1"},h2:{func:"formatBlock",title:r+" 2"},h3:{func:"formatBlock",title:r+" 3"},h4:{func:"formatBlock",title:r+" 4"},bold:{key:"B"},italic:{key:"I"},underline:{},strikethrough:{},strong:{func:"bold",key:"B"},em:{func:"italic",key:"I"},del:{func:"strikethrough"},createLink:{key:"K"},unlink:{},insertImage:{},justifyLeft:{},justifyCenter:{},justifyRight:{},justifyFull:{},unorderedList:{func:"insertUnorderedList"},orderedList:{func:"insertOrderedList"},horizontalRule:{func:"insertHorizontalRule"},removeformat:{},formatting:{dropdown:["p","blockquote","h1","h2","h3","h4"]},link:{dropdown:["createLink","unlink"]}}},t),t.btns?i.o.btns=t.btns:i.o.semantic&&(i.o.btns[4]="btnGrp-semantic"),i.keys=[],i.init()};r.prototype={init:function(){var e=this;e.height=e.$ta.height(),e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),e.buildOverlay()},buildEditor:function(){var e=this,i=e.o.prefix,r="";e.$box=o("
",{"class":i+"box "+i+"editor-visible "+i+e.o.lang+" trumbowyg"}),e.isTextarea=e.$ta.is("textarea"),e.isTextarea?(r=e.$ta.val(),e.$ed=o("
"),e.$box.insertAfter(e.$ta).append(e.$ed,e.$ta)):(e.$ed=e.$ta,r=e.$ed.html(),e.$ta=o("