diff --git a/dist/langs/sl.js b/dist/langs/sl.js index 5ea8c9e4..b2abf677 100644 --- a/dist/langs/sl.js +++ b/dist/langs/sl.js @@ -1,3 +1,11 @@ +/* =========================================================== + * sl.js + * Slovenian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author: Matjaz Zavski (https://github.com/matjaz321) + */ + jQuery.trumbowyg.langs.sl = { viewHTML: 'Prikaži HTML', @@ -33,7 +41,7 @@ jQuery.trumbowyg.langs.sl = { horizontalRule: 'Vstavite vodoravno črto', removeformat: 'Odstrani format', - + fullscreen: 'Celozaslonski način', close: 'Zapri', diff --git a/dist/langs/sl.min.js b/dist/langs/sl.min.js index e1273cf2..465dcebb 100644 --- a/dist/langs/sl.min.js +++ b/dist/langs/sl.min.js @@ -1 +1,8 @@ +/* =========================================================== + * sl.js + * Slovenian translation for Trumbowyg + * http://alex-d.github.com/Trumbowyg + * =========================================================== + * Author: Matjaz Zavski (https://github.com/matjaz321) + */ jQuery.trumbowyg.langs.sl={viewHTML:"Prikaži HTML",formatting:"Formatiranje",p:"Odstavek",blockquote:"Citat",code:"Koda",header:"Glava",bold:"Krepko",italic:"Ležeče",strikethrough:"Prečrtano",underline:"Podčrtano",strong:"Odebljeno",em:"Poudarjeno",del:"Izbrisano",unorderedList:"Neoštevilčen seznam",orderedList:"Oštevilčen seznam",image:"Slika",insertImage:"Vzstavi sliko",insertVideo:"Vzstavi video",link:"Povezava",createLink:"Vzstavi povezavo",unlink:"Odstrani povezavo",justifyLeft:"Poravnava levo",justifyCenter:"Poravnaj na sredino",justifyRight:"Poravnava desno",justifyFull:"Obojestranska poravnava",horizontalRule:"Vstavite vodoravno črto",removeformat:"Odstrani format",fullscreen:"Celozaslonski način",close:"Zapri",submit:"Potrdi",reset:"Resetiraj",required:"Erforderlich",description:"Opis",title:"Naslov",text:"Besedilo"}; \ No newline at end of file diff --git a/dist/plugins/colors/ui/sass/trumbowyg.colors.scss b/dist/plugins/colors/ui/sass/trumbowyg.colors.scss index 1defa43b..72835010 100644 --- a/dist/plugins/colors/ui/sass/trumbowyg.colors.scss +++ b/dist/plugins/colors/ui/sass/trumbowyg.colors.scss @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/colors/ui/trumbowyg.colors.css b/dist/plugins/colors/ui/trumbowyg.colors.css index 047448e9..caa846c4 100644 --- a/dist/plugins/colors/ui/trumbowyg.colors.css +++ b/dist/plugins/colors/ui/trumbowyg.colors.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/colors/ui/trumbowyg.colors.min.css b/dist/plugins/colors/ui/trumbowyg.colors.min.css index ddb5d18d..ea2144f1 100644 --- a/dist/plugins/colors/ui/trumbowyg.colors.min.css +++ b/dist/plugins/colors/ui/trumbowyg.colors.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.24.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.25.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list),.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list){max-width:276px;padding:7px 5px;overflow:initial}.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button{display:block;position:relative;float:left;text-indent:-9999px;height:20px;width:20px;border:1px solid #333;padding:0;margin:2px}.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:hover::after,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:hover::after{content:" ";display:block;position:absolute;top:-5px;left:-5px;width:27px;height:27px;background:inherit;border:1px solid #fff;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10}.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button){position:relative;color:#fff!important}.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):focus::after,.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):hover::after{content:" ";display:block;position:absolute;top:13px;left:0;width:0;height:0;border:5px solid transparent;border-left-color:#fff} \ No newline at end of file diff --git a/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss b/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss index 8e8518e4..17ce9372 100644 --- a/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss +++ b/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/emoji/ui/trumbowyg.emoji.css b/dist/plugins/emoji/ui/trumbowyg.emoji.css index d60da6af..ca15414e 100644 --- a/dist/plugins/emoji/ui/trumbowyg.emoji.css +++ b/dist/plugins/emoji/ui/trumbowyg.emoji.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/emoji/ui/trumbowyg.emoji.min.css b/dist/plugins/emoji/ui/trumbowyg.emoji.min.css index c3574c7f..40ec3355 100644 --- a/dist/plugins/emoji/ui/trumbowyg.emoji.min.css +++ b/dist/plugins/emoji/ui/trumbowyg.emoji.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.24.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.25.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-dropdown-emoji{width:265px;padding:7px 0 7px 5px}.trumbowyg-dropdown-emoji svg{display:none!important}.trumbowyg-dropdown-emoji button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-emoji button:focus::after,.trumbowyg-dropdown-emoji button:hover::after{display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10;background-color:transparent}.trumbowyg .emoji{width:22px;height:22px;display:inline-block} \ No newline at end of file diff --git a/dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss b/dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss index f443e8be..0ec1b648 100644 --- a/dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss +++ b/dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/giphy/ui/trumbowyg.giphy.css b/dist/plugins/giphy/ui/trumbowyg.giphy.css index 311c0c6e..13fee749 100644 --- a/dist/plugins/giphy/ui/trumbowyg.giphy.css +++ b/dist/plugins/giphy/ui/trumbowyg.giphy.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/giphy/ui/trumbowyg.giphy.min.css b/dist/plugins/giphy/ui/trumbowyg.giphy.min.css index c5b0618d..dd08bd9e 100644 --- a/dist/plugins/giphy/ui/trumbowyg.giphy.min.css +++ b/dist/plugins/giphy/ui/trumbowyg.giphy.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.24.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.25.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-giphy-button svg{-webkit-transform:scale(1.22);-ms-transform:scale(1.22);-o-transform:scale(1.22);transform:scale(1.22)}.trumbowyg-giphy-search{display:block;width:80%;margin:5%;padding-left:10px;padding-right:150px}.trumbowyg-giphy-close{position:absolute;top:calc(5% + 8px);right:calc(5% - 2px);width:30px;height:30px;background:0 0;border:1px solid transparent}.trumbowyg-giphy-close:focus,.trumbowyg-giphy-close:hover{outline:0;background:#ecf0f1}.trumbowyg-giphy-close:focus{border-color:rgba(0,0,0,.3)}.trumbowyg-powered-by-giphy{position:absolute;top:calc(5% + 12px);right:calc(15% + 10px);pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.trumbowyg-powered-by-giphy span{text-transform:uppercase;font-weight:700;font-size:10px;opacity:.6}.trumbowyg-powered-by-giphy svg{width:66px;height:15px;vertical-align:bottom;margin-left:6px;opacity:.45}.trumbowyg-giphy-modal-scroll{overflow:auto;overflow-x:hidden;height:240px}.trumbowyg-giphy-modal{padding:0 5%;-webkit-columns:3;-moz-columns:3;columns:3;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px}.trumbowyg-giphy-modal .trumbowyg-giphy-no-result{width:250%;margin:13% 0 0 29%}.trumbowyg-giphy-modal .trumbowyg-giphy-offline{font-size:18px;width:305%;height:600px;margin-top:95px;text-align:center}.trumbowyg-giphy-modal .img-container{width:100%;margin-bottom:10px;background-color:#ecf0f1}.trumbowyg-giphy-modal .img-container img{width:100%;cursor:pointer;opacity:0;-webkit-transition:opacity 150ms;-o-transition:opacity 150ms;transition:opacity 150ms}.trumbowyg-giphy-modal .img-container img:focus,.trumbowyg-giphy-modal .img-container img:hover{border:3px solid #2ecc71}.trumbowyg-giphy-modal .img-container img.tbw-loaded{opacity:1} \ No newline at end of file diff --git a/dist/plugins/highlight/trumbowyg.highlight.js b/dist/plugins/highlight/trumbowyg.highlight.js index c038a88d..581c0034 100644 --- a/dist/plugins/highlight/trumbowyg.highlight.js +++ b/dist/plugins/highlight/trumbowyg.highlight.js @@ -3,7 +3,182 @@ 'use strict'; // My plugin default options - var defaultOptions = {}; + var defaultOptions = { + enableLineHighlight: true, + languageNames: { + // For updated list of languages + // see https://github.com/PrismJS/prism/blob/master/plugins/show-language/prism-show-language.js + 'html': 'HTML', + 'xml': 'XML', + 'svg': 'SVG', + 'mathml': 'MathML', + 'ssml': 'SSML', + 'css': 'CSS', + 'clike': 'C-like', + 'js': 'JavaScript', + 'abap': 'ABAP', + 'abnf': 'Augmented Backus–Naur form', + 'al': 'AL', + 'antlr4': 'ANTLR4', + 'g4': 'ANTLR4', + 'apacheconf': 'Apache Configuration', + 'apl': 'APL', + 'aql': 'AQL', + 'arff': 'ARFF', + 'asciidoc': 'AsciiDoc', + 'adoc': 'AsciiDoc', + 'asm6502': '6502 Assembly', + 'aspnet': 'ASP.NET (C#)', + 'autohotkey': 'AutoHotkey', + 'autoit': 'AutoIt', + 'basic': 'BASIC', + 'bbcode': 'BBcode', + 'bnf': 'Backus–Naur form', + 'rbnf': 'Routing Backus–Naur form', + 'conc': 'Concurnas', + 'csharp': 'C#', + 'cs': 'C#', + 'dotnet': 'C#', + 'cpp': 'C++', + 'cil': 'CIL', + 'coffee': 'CoffeeScript', + 'cmake': 'CMake', + 'csp': 'Content-Security-Policy', + 'css-extras': 'CSS Extras', + 'dax': 'DAX', + 'django': 'Django/Jinja2', + 'jinja2': 'Django/Jinja2', + 'dns-zone-file': 'DNS zone file', + 'dns-zone': 'DNS zone file', + 'dockerfile': 'Docker', + 'ebnf': 'Extended Backus–Naur form', + 'ejs': 'EJS', + 'etlua': 'Embedded Lua templating', + 'erb': 'ERB', + 'excel-formula': 'Excel Formula', + 'xlsx': 'Excel Formula', + 'xls': 'Excel Formula', + 'fsharp': 'F#', + 'firestore-security-rules': 'Firestore security rules', + 'ftl': 'FreeMarker Template Language', + 'gcode': 'G-code', + 'gdscript': 'GDScript', + 'gedcom': 'GEDCOM', + 'glsl': 'GLSL', + 'gml': 'GameMaker Language', + 'gamemakerlanguage': 'GameMaker Language', + 'graphql': 'GraphQL', + 'hs': 'Haskell', + 'hcl': 'HCL', + 'hlsl': 'HLSL', + 'http': 'HTTP', + 'hpkp': 'HTTP Public-Key-Pins', + 'hsts': 'HTTP Strict-Transport-Security', + 'ichigojam': 'IchigoJam', + 'iecst': 'Structured Text (IEC 61131-3)', + 'inform7': 'Inform 7', + 'javadoc': 'JavaDoc', + 'javadoclike': 'JavaDoc-like', + 'javastacktrace': 'Java stack trace', + 'jq': 'JQ', + 'jsdoc': 'JSDoc', + 'js-extras': 'JS Extras', + 'js-templates': 'JS Templates', + 'json': 'JSON', + 'jsonp': 'JSONP', + 'json5': 'JSON5', + 'latex': 'LaTeX', + 'tex': 'TeX', + 'context': 'ConTeXt', + 'lilypond': 'LilyPond', + 'ly': 'LilyPond', + 'emacs': 'Lisp', + 'elisp': 'Lisp', + 'emacs-lisp': 'Lisp', + 'llvm': 'LLVM IR', + 'lolcode': 'LOLCODE', + 'md': 'Markdown', + 'markup-templating': 'Markup templating', + 'matlab': 'MATLAB', + 'mel': 'MEL', + 'moon': 'MoonScript', + 'n1ql': 'N1QL', + 'n4js': 'N4JS', + 'n4jsd': 'N4JS', + 'nand2tetris-hdl': 'Nand To Tetris HDL', + 'nasm': 'NASM', + 'neon': 'NEON', + 'nginx': 'nginx', + 'nsis': 'NSIS', + 'objectivec': 'Objective-C', + 'objc': 'Objective-C', + 'ocaml': 'OCaml', + 'opencl': 'OpenCL', + 'parigp': 'PARI/GP', + 'objectpascal': 'Object Pascal', + 'pcaxis': 'PC-Axis', + 'px': 'PC-Axis', + 'peoplecode': 'PeopleCode', + 'pcode': 'PeopleCode', + 'php': 'PHP', + 'phpdoc': 'PHPDoc', + 'php-extras': 'PHP Extras', + 'plsql': 'PL/SQL', + 'powerquery': 'PowerQuery', + 'pq': 'PowerQuery', + 'mscript': 'PowerQuery', + 'powershell': 'PowerShell', + 'properties': '.properties', + 'protobuf': 'Protocol Buffers', + 'py': 'Python', + 'q': 'Q (kdb+ database)', + 'qml': 'QML', + 'rkt': 'Racket', + 'jsx': 'React JSX', + 'tsx': 'React TSX', + 'renpy': 'Ren\'py', + 'rest': 'reST (reStructuredText)', + 'robotframework': 'Robot Framework', + 'robot': 'Robot Framework', + 'rb': 'Ruby', + 'sas': 'SAS', + 'sass': 'Sass (Sass)', + 'scss': 'Sass (Scss)', + 'shell-session': 'Shell session', + 'solidity': 'Solidity (Ethereum)', + 'solution-file': 'Solution file', + 'sln': 'Solution file', + 'soy': 'Soy (Closure Template)', + 'sparql': 'SPARQL', + 'rq': 'SPARQL', + 'splunk-spl': 'Splunk SPL', + 'sqf': 'SQF: Status Quo Function (Arma 3)', + 'sql': 'SQL', + 'tap': 'TAP', + 'toml': 'TOML', + 'tt2': 'Template Toolkit 2', + 'trig': 'TriG', + 'ts': 'TypeScript', + 't4-cs': 'T4 Text Templates (C#)', + 't4': 'T4 Text Templates (C#)', + 't4-vb': 'T4 Text Templates (VB)', + 't4-templating': 'T4 templating', + 'uscript': 'UnrealScript', + 'uc': 'UnrealScript', + 'vbnet': 'VB.Net', + 'vhdl': 'VHDL', + 'vim': 'vim', + 'visual-basic': 'Visual Basic', + 'vb': 'Visual Basic', + 'wasm': 'WebAssembly', + 'wiki': 'Wiki markup', + 'xeoracube': 'XeoraCube', + 'xojo': 'Xojo (REALbasic)', + 'xquery': 'XQuery', + 'yaml': 'YAML', + 'yml': 'YAML' + } + }; function highlightIt(text, language, lineHighlight) { return [ @@ -13,34 +188,58 @@ ].join(''); } + function escapeHtml(html) { + return $('
').text(html).html(); + } + + function buildHighlightOptions(trumbowyg) { + var languageNames = trumbowyg.o.plugins.highlight.languageNames; + var languageNameKeys = Object.keys(languageNames); + var prismLanguageKeys = Object.keys(Prism.languages); + + var options = prismLanguageKeys.filter(function (languageKey) { + return languageNameKeys.indexOf(languageKey) >= 0; + }).map(function (languageKey) { + return { + id: languageKey, + name: languageNames[languageKey] + }; + }).sort(function(a, b){ + // Sort languages by name + return a.name.localeCompare(b.name); + }).map(function( language){ + // Generate a list of options + return ''; + }).join(''); + + return options; + } + + function buildLineHighlightFieldIfEnabled(trumbowyg) { + if (trumbowyg.o.plugins.highlight.enableLineHighlight === false) { + return ''; + } + + return '
' + + ' ' + + '
'; + } + // If my plugin is a button function buildButtonDef(trumbowyg) { return { fn: function () { var $modal = trumbowyg.openModal('Code', [ '
', - ' ', + buildHighlightOptions(trumbowyg), ' ', '
', '
', ' ', '
', - '
', - ' ', - '
' + buildLineHighlightFieldIfEnabled(trumbowyg), ].join('\n')), $language = $modal.find('.language'), $code = $modal.find('.code'), @@ -68,18 +267,15 @@ // jshint camelcase:false en: { highlight: 'Code syntax highlight', - highlightLine: 'Highlight lines, e.g.: 1,3-5', - prismHighlightPluginAlert: 'You must have Prism Line Highlight plugin installed' + highlightLine: 'Highlight lines, e.g.: 1,3-5' }, es: { highlight: 'Resaltado de sintaxis de código', - highlightLine: 'Resaltar lineas, ej: 1,3-5', - prismHighlightPluginAlert: 'Debes de tener el plugin Prism Line Highlight instalado' + highlightLine: 'Resaltar lineas, ej: 1,3-5' }, et: { highlight: 'Koodi esiletoomine', - highlightLine: 'Koodiread, näiteks: 1,3-5', - prismHighlightPluginAlert: 'Teil peab olema paigaldatud plugin nimega Prism Line Highlight' + highlightLine: 'Koodiread, näiteks: 1,3-5' }, hu: { highlight: 'Kód kiemelés' diff --git a/dist/plugins/highlight/trumbowyg.highlight.min.js b/dist/plugins/highlight/trumbowyg.highlight.min.js index 762cb293..6594942f 100644 --- a/dist/plugins/highlight/trumbowyg.highlight.min.js +++ b/dist/plugins/highlight/trumbowyg.highlight.min.js @@ -1 +1 @@ -!function(i,e){"use strict";var g={};function l(i){return{fn:function(){var g=i.openModal("Code",['
',' ","
",'
',' ',"
",'
',' ',"
"].join("\n")),l=g.find(".language"),h=g.find(".code"),t=g.find(".trumbowyg-line-highlight");g.on("tbwconfirm",(function(){var g,n,o;i.restoreRange(),i.execCmd("insertHTML",(g=h.val(),n=l.val(),o=t.val(),['
",''+e.highlight(g,e.languages[n])+"","
"].join(""))),i.execCmd("insertHTML","


"),i.closeModal()})),g.on("tbwcancel",(function(){i.closeModal()}))}}}i.extend(!0,i.trumbowyg,{langs:{en:{highlight:"Code syntax highlight",highlightLine:"Highlight lines, e.g.: 1,3-5",prismHighlightPluginAlert:"You must have Prism Line Highlight plugin installed"},es:{highlight:"Resaltado de sintaxis de código",highlightLine:"Resaltar lineas, ej: 1,3-5",prismHighlightPluginAlert:"Debes de tener el plugin Prism Line Highlight instalado"},et:{highlight:"Koodi esiletoomine",highlightLine:"Koodiread, näiteks: 1,3-5",prismHighlightPluginAlert:"Teil peab olema paigaldatud plugin nimega Prism Line Highlight"},hu:{highlight:"Kód kiemelés"},ko:{highlight:"코드 문법 하이라이트"},pt_br:{highlight:"Realçar sintaxe de código"}},plugins:{highlight:{init:function(e){e.o.plugins.highlight=i.extend(!0,{},g,e.o.plugins.highlight||{}),e.addBtnDef("highlight",l(e))}}}})}(jQuery,Prism); \ No newline at end of file +!function(e,i){"use strict";var t={enableLineHighlight:!0,languageNames:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"Augmented Backus–Naur form",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"Backus–Naur form",rbnf:"Routing Backus–Naur form",conc:"Concurnas",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cil:"CIL",coffee:"CoffeeScript",cmake:"CMake",csp:"Content-Security-Policy","css-extras":"CSS Extras",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",ebnf:"Extended Backus–Naur form",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",graphql:"GraphQL",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",iecst:"Structured Text (IEC 61131-3)",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras","js-templates":"JS Templates",json:"JSON",jsonp:"JSONP",json5:"JSON5",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",lolcode:"LOLCODE",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",objectpascal:"Object Pascal",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",py:"Python",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session",solidity:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",tap:"TAP",toml:"TOML",tt2:"Template Toolkit 2",trig:"TriG",ts:"TypeScript","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)","t4-templating":"T4 templating",uscript:"UnrealScript",uc:"UnrealScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML"}};function a(i){return e("
").text(i).html()}function o(e){var t=e.o.plugins.highlight.languageNames,o=Object.keys(t);return Object.keys(i.languages).filter((function(e){return o.indexOf(e)>=0})).map((function(e){return{id:e,name:t[e]}})).sort((function(e,i){return e.name.localeCompare(i.name)})).map((function(e){return'"})).join("")}function l(e){return!1===e.o.plugins.highlight.enableLineHighlight?"":'
'}function s(e){return{fn:function(){var t=e.openModal("Code",['
',' ","
",'
',' ',"
",l(e)].join("\n")),a=t.find(".language"),s=t.find(".code"),n=t.find(".trumbowyg-line-highlight");t.on("tbwconfirm",(function(){var t,o,l;e.restoreRange(),e.execCmd("insertHTML",(t=s.val(),o=a.val(),l=n.val(),['
",''+i.highlight(t,i.languages[o])+"","
"].join(""))),e.execCmd("insertHTML","


"),e.closeModal()})),t.on("tbwcancel",(function(){e.closeModal()}))}}}e.extend(!0,e.trumbowyg,{langs:{en:{highlight:"Code syntax highlight",highlightLine:"Highlight lines, e.g.: 1,3-5"},es:{highlight:"Resaltado de sintaxis de código",highlightLine:"Resaltar lineas, ej: 1,3-5"},et:{highlight:"Koodi esiletoomine",highlightLine:"Koodiread, näiteks: 1,3-5"},hu:{highlight:"Kód kiemelés"},ko:{highlight:"코드 문법 하이라이트"},pt_br:{highlight:"Realçar sintaxe de código"}},plugins:{highlight:{init:function(i){i.o.plugins.highlight=e.extend(!0,{},t,i.o.plugins.highlight||{}),i.addBtnDef("highlight",s(i))}}}})}(jQuery,Prism); \ No newline at end of file diff --git a/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss b/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss index 43d6188c..59bc7c81 100644 --- a/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss +++ b/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/highlight/ui/trumbowyg.highlight.css b/dist/plugins/highlight/ui/trumbowyg.highlight.css index c32dc77a..645c32bb 100644 --- a/dist/plugins/highlight/ui/trumbowyg.highlight.css +++ b/dist/plugins/highlight/ui/trumbowyg.highlight.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/highlight/ui/trumbowyg.highlight.min.css b/dist/plugins/highlight/ui/trumbowyg.highlight.min.css index b5f29005..abf30dae 100644 --- a/dist/plugins/highlight/ui/trumbowyg.highlight.min.css +++ b/dist/plugins/highlight/ui/trumbowyg.highlight.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.24.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.25.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-highlight-form-group{margin:15px 10px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control{width:100%;border:1px solid #DEDEDE;font-size:14px;padding:7px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code{height:200px} \ No newline at end of file diff --git a/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss b/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss index 18bc94f0..5962de89 100644 --- a/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss +++ b/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/mathml/ui/trumbowyg.mathml.css b/dist/plugins/mathml/ui/trumbowyg.mathml.css index 632339d3..7bc46f77 100644 --- a/dist/plugins/mathml/ui/trumbowyg.mathml.css +++ b/dist/plugins/mathml/ui/trumbowyg.mathml.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/mathml/ui/trumbowyg.mathml.min.css b/dist/plugins/mathml/ui/trumbowyg.mathml.min.css index c8593d4d..15be026d 100644 --- a/dist/plugins/mathml/ui/trumbowyg.mathml.min.css +++ b/dist/plugins/mathml/ui/trumbowyg.mathml.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.24.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.25.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .mathMlContainer{position:relative}.mathMlContainer[inline=false]{display:block;width:100%}.mathMlContainer:hover{pointer-events:none}.mathMlContainer:hover::after{content:'\270E';position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(255,255,255,.83);-webkit-box-shadow:0 0 5px 5px rgba(255,255,255,.83);box-shadow:0 0 5px 5px rgba(255,255,255,.83);cursor:pointer;pointer-events:auto} \ No newline at end of file diff --git a/dist/plugins/mention/ui/sass/trumbowyg.mention.scss b/dist/plugins/mention/ui/sass/trumbowyg.mention.scss index 9d2b168b..90da53e1 100644 --- a/dist/plugins/mention/ui/sass/trumbowyg.mention.scss +++ b/dist/plugins/mention/ui/sass/trumbowyg.mention.scss @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/mention/ui/trumbowyg.mention.css b/dist/plugins/mention/ui/trumbowyg.mention.css index 39ce9cab..665027cb 100644 --- a/dist/plugins/mention/ui/trumbowyg.mention.css +++ b/dist/plugins/mention/ui/trumbowyg.mention.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/mention/ui/trumbowyg.mention.min.css b/dist/plugins/mention/ui/trumbowyg.mention.min.css index a54dd52a..7a83f7c2 100644 --- a/dist/plugins/mention/ui/trumbowyg.mention.min.css +++ b/dist/plugins/mention/ui/trumbowyg.mention.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.24.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.25.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-dropdown-mention button{position:relative;white-space:nowrap}.trumbowyg-dropdown-mention button:after{content:"";position:absolute;top:0;right:0;width:15%;height:100%;-webkit-background-size:100% 100%;background-size:100%;background-image:-webkit-gradient(linear,left top,right top,from(rgba(255,255,255,0)),color-stop(80%,#fff),to(#fff));background-image:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);background-image:-o-linear-gradient(left,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);background-image:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);pointer-events:none} \ No newline at end of file diff --git a/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss b/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss index d63d3489..4410d169 100644 --- a/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss +++ b/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/specialchars/ui/trumbowyg.specialchars.css b/dist/plugins/specialchars/ui/trumbowyg.specialchars.css index 5ff85c7c..449a87d0 100644 --- a/dist/plugins/specialchars/ui/trumbowyg.specialchars.css +++ b/dist/plugins/specialchars/ui/trumbowyg.specialchars.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css b/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css index 3edabef0..bc5b445a 100644 --- a/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css +++ b/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.24.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.25.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-symbol-\ -dropdown-button{display:none!important}.trumbowyg-symbol-\ -dropdown-button+button{clear:both}.trumbowyg-dropdown-specialChars{width:248px;padding:5px 3px 3px}.trumbowyg-dropdown-specialChars button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-specialChars button:focus::after,.trumbowyg-dropdown-specialChars button:hover::after{display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10;background-color:transparent}.trumbowyg .specialChars{width:22px;height:22px;display:inline-block} \ No newline at end of file diff --git a/dist/plugins/table/ui/sass/trumbowyg.table.scss b/dist/plugins/table/ui/sass/trumbowyg.table.scss index 045644f0..a4dc1add 100644 --- a/dist/plugins/table/ui/sass/trumbowyg.table.scss +++ b/dist/plugins/table/ui/sass/trumbowyg.table.scss @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/table/ui/trumbowyg.table.css b/dist/plugins/table/ui/trumbowyg.table.css index abf53d5e..88aeee3a 100644 --- a/dist/plugins/table/ui/trumbowyg.table.css +++ b/dist/plugins/table/ui/trumbowyg.table.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ * @link http://alex-d.github.io/Trumbowyg diff --git a/dist/plugins/table/ui/trumbowyg.table.min.css b/dist/plugins/table/ui/trumbowyg.table.min.css index d5aa483c..f5230861 100644 --- a/dist/plugins/table/ui/trumbowyg.table.min.css +++ b/dist/plugins/table/ui/trumbowyg.table.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.24.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.25.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-editor table{width:100%}.trumbowyg-editor table td{border:1px dotted #e7eaec;padding:8px}.trumbowyg-dropdown-table table{margin:10px;display:inline-block}.trumbowyg-dropdown-table table td{display:inline-block;height:20px;width:20px;margin:1px;padding:0;background-color:#fff;-webkit-box-shadow:0 0 0 1px #cecece inset;box-shadow:0 0 0 1px #cecece inset}.trumbowyg-dropdown-table table td.active{background-color:#00b393;-webkit-box-shadow:none;box-shadow:none;cursor:pointer}.trumbowyg-dropdown-table .trumbowyg-table-size{text-align:center} \ No newline at end of file diff --git a/dist/trumbowyg.js b/dist/trumbowyg.js index 88b83fd5..51f70af7 100644 --- a/dist/trumbowyg.js +++ b/dist/trumbowyg.js @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg core file * ------------------------ * @link http://alex-d.github.io/Trumbowyg @@ -1617,7 +1617,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { if (buildForm) { // Focus in modal box - $('input:first', $box).focus(); + $(':input:first', $box).focus(); // Append Confirm and Cancel buttons t.buildModalBtn('submit', $box); @@ -1668,22 +1668,31 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { var t = this, prefix = t.o.prefix, lg = t.lang, - html = ''; + html = '', + idPrefix = prefix + 'form-' + Date.now() + '-'; $.each(fields, function (fieldName, field) { var l = field.label || fieldName, n = field.name || fieldName, - a = field.attributes || {}; + a = field.attributes || {}, + fieldId = idPrefix + fieldName; var attr = Object.keys(a).map(function (prop) { return prop + '="' + a[prop] + '"'; }).join(' '); - html += ''; + if (typeof field.type === 'function') { + if (!field.name) { + field.name = n; + } + html += field.type(field, fieldId, prefix, lg); + } else { + html += '
' + + '
' + + '
'; + html += '
'; + } }); return t.openModal(title, html) @@ -1695,8 +1704,8 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { $.each(fields, function (fieldName, field) { var n = field.name || fieldName; - var $field = $('input[name="' + n + '"]', $form), - inputType = $field.attr('type'); + var $field = $(':input[name="' + n + '"]', $form), + inputType = $field[0].type; switch (inputType.toLowerCase()) { case 'checkbox': @@ -1738,19 +1747,19 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { addErrorOnModalField: function ($field, err) { var prefix = this.o.prefix, spanErrorClass = prefix + 'msg-error', - $label = $field.parent(); + $row = $field.closest('.' + prefix + 'input-row'); $field .on('change keyup', function () { - $label.removeClass(prefix + 'input-error'); + $row.removeClass(prefix + 'input-error'); setTimeout(function () { - $label.find('.' + spanErrorClass).remove(); + $row.find('.' + spanErrorClass).remove(); }, 150); }); - $label + $row .addClass(prefix + 'input-error') - .find('input+span') + .find('.' + prefix + 'input-infos label') .append( $('', { class: spanErrorClass, diff --git a/dist/trumbowyg.min.js b/dist/trumbowyg.min.js index 99c3d7b0..78779382 100644 --- a/dist/trumbowyg.min.js +++ b/dist/trumbowyg.min.js @@ -1,6 +1,6 @@ -/** Trumbowyg v2.24.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.25.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ /** - * Trumbowyg v2.24.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.25.0 - A lightweight WYSIWYG editor * Trumbowyg core file * ------------------------ * @link http://alex-d.github.io/Trumbowyg @@ -9,4 +9,4 @@ * Twitter : @AlexandreDemode * Website : alex-d.fr */ -jQuery.trumbowyg={langs:{en:{viewHTML:"View HTML",undo:"Undo",redo:"Redo",formatting:"Formatting",p:"Paragraph",blockquote:"Quote",code:"Code",header:"Header",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",underline:"Underline",strong:"Strong",em:"Emphasis",del:"Deleted",superscript:"Superscript",subscript:"Subscript",unorderedList:"Unordered list",orderedList:"Ordered list",insertImage:"Insert Image",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",target:"Target",width:"Width"}},plugins:{},svgPath:null,svgAbsoluteUseHref:!1,hideButtonTexts:null},Object.defineProperty(jQuery.trumbowyg,"defaultOptions",{value:{lang:"en",fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,autogrowOnEnter:!1,imageWidthModalEdit:!1,hideButtonTexts:null,prefix:"trumbowyg-",tagClasses:{},semantic:!0,semanticKeepAttributes:!1,resetCss:!1,removeformatPasted:!1,tabToIndent:!1,tagsToRemove:[],tagsToKeep:["hr","img","embed","iframe","input"],btns:[["viewHTML"],["undo","redo"],["formatting"],["strong","em","del"],["superscript","subscript"],["link"],["insertImage"],["justifyLeft","justifyCenter","justifyRight","justifyFull"],["unorderedList","orderedList"],["horizontalRule"],["removeformat"],["fullscreen"]],btnsDef:{},changeActiveDropdownIcon:!1,inlineElementsSelector:"a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u",pasteHandlers:[],plugins:{},urlProtocol:!1,minimalLinks:!1,defaultLinkTarget:void 0,svgPath:null},writable:!1,enumerable:!0,configurable:!1}),function(e,t,n,a){"use strict";var o="tbwconfirm",r="tbwcancel";a.fn.trumbowyg=function(e,t){var n="trumbowyg";if(e===Object(e)||!e)return this.each((function(){a(this).data(n)||a(this).data(n,new i(this,e))}));if(1===this.length)try{var o=a(this).data(n);switch(e){case"execCmd":return o.execCmd(t.cmd,t.param,t.forceCss,t.skipTrumbowyg);case"openModal":return o.openModal(t.title,t.content);case"closeModal":return o.closeModal();case"openModalInsert":return o.openModalInsert(t.title,t.fields,t.callback);case"saveRange":return o.saveRange();case"getRange":return o.range;case"getRangeText":return o.getRangeText();case"restoreRange":return o.restoreRange();case"enable":return o.setDisabled(!1);case"disable":return o.setDisabled(!0);case"toggle":return o.toggle();case"destroy":return o.destroy();case"empty":return o.empty();case"html":return o.html(t)}}catch(e){}return!1};var i=function(o,r){var i=this,s="trumbowyg-icons",l=a.trumbowyg;i.doc=o.ownerDocument||n,i.$ta=a(o),i.$c=a(o),null!=(r=r||{}).lang||null!=l.langs[r.lang]?i.lang=a.extend(!0,{},l.langs.en,l.langs[r.lang]):i.lang=l.langs.en,i.hideButtonTexts=null!=l.hideButtonTexts?l.hideButtonTexts:r.hideButtonTexts;var d=null!=l.svgPath?l.svgPath:r.svgPath;if(i.hasSvg=!1!==d,!1!==d&&(l.svgAbsoluteUseHref||0===a("#trumbowyg-icons",i.doc).length)){if(null==d)a("script[src]").each((function(e,t){var n=t.src,a=n.match("trumbowyg(.min)?.js");null!=a&&(d=n.substring(0,n.indexOf(a[0]))+"ui/icons.svg")}));if(null==d)console.warn("You must define svgPath: https://goo.gl/CfTY9U");else if(!l.svgAbsoluteUseHref){var c=i.doc.createElement("div");c.id=s,i.doc.body.insertBefore(c,i.doc.body.childNodes[0]),a.ajax({async:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",dataType:"xml",crossDomain:!0,url:d,data:null,beforeSend:null,complete:null,success:function(e){c.innerHTML=(new XMLSerializer).serializeToString(e.documentElement)}})}}var u=i.doc.querySelector("base")?t.location.href.split(/[?#]/)[0]:"";i.svgPath=l.svgAbsoluteUseHref?d:u;var g=i.lang.header,f=function(){return(t.chrome||t.Intl&&Intl.v8BreakIterator)&&"CSS"in t};i.btnsDef={viewHTML:{fn:"toggle",class:"trumbowyg-not-disable"},undo:{isSupported:f,key:"Z"},redo:{isSupported:f,key:"Y"},p:{fn:"formatBlock"},blockquote:{fn:"formatBlock"},h1:{fn:"formatBlock",title:g+" 1"},h2:{fn:"formatBlock",title:g+" 2"},h3:{fn:"formatBlock",title:g+" 3"},h4:{fn:"formatBlock",title:g+" 4"},h5:{fn:"formatBlock",title:g+" 5"},h6:{fn:"formatBlock",title:g+" 6"},subscript:{tag:"sub"},superscript:{tag:"sup"},bold:{key:"B",tag:"b"},italic:{key:"I",tag:"i"},underline:{tag:"u"},strikethrough:{tag:"strike"},strong:{fn:"bold",key:"B"},em:{fn:"italic",key:"I"},del:{fn:"strikethrough"},createLink:{key:"K",tag:"a"},unlink:{},insertImage:{},justifyLeft:{tag:"left",forceCss:!0},justifyCenter:{tag:"center",forceCss:!0},justifyRight:{tag:"right",forceCss:!0},justifyFull:{tag:"justify",forceCss:!0},unorderedList:{fn:"insertUnorderedList",tag:"ul"},orderedList:{fn:"insertOrderedList",tag:"ol"},horizontalRule:{fn:"insertHorizontalRule"},removeformat:{},fullscreen:{class:"trumbowyg-not-disable"},close:{fn:"destroy",class:"trumbowyg-not-disable"},formatting:{dropdown:["p","blockquote","h1","h2","h3","h4"],ico:"p"},link:{dropdown:["createLink","unlink"]}},i.o=a.extend(!0,{},l.defaultOptions,r),i.o.hasOwnProperty("imgDblClickHandler")||(i.o.imgDblClickHandler=i.getDefaultImgDblClickHandler()),i.urlPrefix=i.setupUrlPrefix(),i.disabled=i.o.disabled||"TEXTAREA"===o.nodeName&&o.disabled,r.btns?i.o.btns=r.btns:i.o.semantic||(i.o.btns[3]=["bold","italic","underline","strikethrough"]),a.each(i.o.btnsDef,(function(e,t){i.addBtnDef(e,t)})),i.eventNamespace="trumbowyg-event",i.keys=[],i.tagToButton={},i.tagHandlers=[],i.pasteHandlers=[].concat(i.o.pasteHandlers),i.isIE=-1!==e.userAgent.indexOf("MSIE")||-1!==e.appVersion.indexOf("Trident/"),i.isMac=-1!==e.platform.toUpperCase().indexOf("MAC"),i.init()};i.prototype={DEFAULT_SEMANTIC_MAP:{b:"strong",i:"em",s:"del",strike:"del",div:"p"},init:function(){var e=this;e.height=e.$ta.height(),e.initPlugins();try{e.doc.execCommand("enableObjectResizing",!1,!1),e.doc.execCommand("defaultParagraphSeparator",!1,"p")}catch(e){}e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),e.buildOverlay(),setTimeout((function(){e.disabled&&e.setDisabled(!0),e.$c.trigger("tbwinit")}))},addBtnDef:function(e,t){this.btnsDef[e]=a.extend(t,this.btnsDef[e]||{})},setupUrlPrefix:function(){var e=this.o.urlProtocol;if(e)return"string"!=typeof e?"https://":e.replace("://","")+"://"},buildEditor:function(){var e=this,n=e.o.prefix,o="";e.$box=a("
",{class:n+"box "+n+"editor-visible "+n+e.o.lang+" trumbowyg"}),e.isTextarea=e.$ta.is("textarea"),e.isTextarea?(o=e.$ta.val(),e.$ed=a("
"),e.$box.insertAfter(e.$ta).append(e.$ed,e.$ta)):(e.$ed=e.$ta,o=e.$ed.html(),e.$ta=a("