From 688a213df2e66a22bcb9b56ac3795443e49fa1b0 Mon Sep 17 00:00:00 2001 From: Alex-D Date: Mon, 30 Dec 2019 16:57:21 +0100 Subject: [PATCH] 2.21.0 --- .../colors/ui/sass/trumbowyg.colors.scss | 2 +- dist/plugins/colors/ui/trumbowyg.colors.css | 2 +- .../colors/ui/trumbowyg.colors.min.css | 2 +- dist/plugins/emoji/trumbowyg.emoji.js | 2 +- .../emoji/ui/sass/trumbowyg.emoji.scss | 2 +- dist/plugins/emoji/ui/trumbowyg.emoji.css | 2 +- dist/plugins/emoji/ui/trumbowyg.emoji.min.css | 2 +- dist/plugins/giphy/trumbowyg.giphy.js | 3 +- dist/plugins/giphy/trumbowyg.giphy.min.js | 2 +- .../giphy/ui/sass/trumbowyg.giphy.scss | 2 +- dist/plugins/giphy/ui/trumbowyg.giphy.css | 2 +- dist/plugins/giphy/ui/trumbowyg.giphy.min.css | 2 +- dist/plugins/highlight/trumbowyg.highlight.js | 2 + .../ui/sass/trumbowyg.highlight.scss | 2 +- .../highlight/ui/trumbowyg.highlight.css | 2 +- .../highlight/ui/trumbowyg.highlight.min.css | 2 +- dist/plugins/history/trumbowyg.history.js | 2 + .../insertaudio/trumbowyg.insertaudio.js | 2 + .../mathml/ui/sass/trumbowyg.mathml.scss | 2 +- dist/plugins/mathml/ui/trumbowyg.mathml.css | 2 +- .../mathml/ui/trumbowyg.mathml.min.css | 2 +- .../mention/ui/sass/trumbowyg.mention.scss | 2 +- dist/plugins/mention/ui/trumbowyg.mention.css | 2 +- .../mention/ui/trumbowyg.mention.min.css | 2 +- dist/plugins/noembed/trumbowyg.noembed.js | 2 + .../resizimg/resizable-resolveconflict.js | 20 ++ .../resizimg/resizable-resolveconflict.min.js | 1 + dist/plugins/resizimg/trumbowyg.resizimg.js | 263 ++++++++++++++++-- .../resizimg/trumbowyg.resizimg.min.js | 2 +- dist/plugins/ruby/trumbowyg.ruby.js | 22 +- dist/plugins/ruby/trumbowyg.ruby.min.js | 2 +- .../ui/sass/trumbowyg.specialchars.scss | 2 +- .../ui/trumbowyg.specialchars.css | 2 +- .../ui/trumbowyg.specialchars.min.css | 2 +- .../table/ui/sass/trumbowyg.table.scss | 2 +- dist/plugins/table/ui/trumbowyg.table.css | 2 +- dist/plugins/table/ui/trumbowyg.table.min.css | 2 +- dist/plugins/template/trumbowyg.template.js | 20 +- .../template/trumbowyg.template.min.js | 2 +- dist/trumbowyg.js | 5 +- dist/trumbowyg.min.js | 4 +- dist/ui/icons.svg | 2 +- dist/ui/sass/trumbowyg.scss | 5 +- dist/ui/trumbowyg.css | 4 +- dist/ui/trumbowyg.min.css | 4 +- 45 files changed, 340 insertions(+), 79 deletions(-) create mode 100644 dist/plugins/resizimg/resizable-resolveconflict.js create mode 100644 dist/plugins/resizimg/resizable-resolveconflict.min.js diff --git a/dist/plugins/colors/ui/sass/trumbowyg.colors.scss b/dist/plugins/colors/ui/sass/trumbowyg.colors.scss index 059c9cec4..a8c860a16 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.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 e36a04e4d..ae10d4dc9 100644 --- a/dist/plugins/colors/ui/trumbowyg.colors.css +++ b/dist/plugins/colors/ui/trumbowyg.colors.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 274ca4022..9354743e4 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.20.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.21.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;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/trumbowyg.emoji.js b/dist/plugins/emoji/trumbowyg.emoji.js index 6bd09922e..d4b456b35 100644 --- a/dist/plugins/emoji/trumbowyg.emoji.js +++ b/dist/plugins/emoji/trumbowyg.emoji.js @@ -1337,7 +1337,7 @@ defaultEmojiBtnDef = { text: emoji, fn: function () { - var encodedEmoji = String.fromCodePoint(emoji.replace("&#", "0")); + var encodedEmoji = String.fromCodePoint(emoji.replace('&#', '0')); trumbowyg.execCmd('insertText', encodedEmoji); return true; } diff --git a/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss b/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss index c80b89731..535b63185 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.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 43f8acaa2..f74888953 100644 --- a/dist/plugins/emoji/ui/trumbowyg.emoji.css +++ b/dist/plugins/emoji/ui/trumbowyg.emoji.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 34c47f1b0..da37a7ef5 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.20.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.21.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;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/trumbowyg.giphy.js b/dist/plugins/giphy/trumbowyg.giphy.js index 464e8130c..4c3dc75e5 100644 --- a/dist/plugins/giphy/trumbowyg.giphy.js +++ b/dist/plugins/giphy/trumbowyg.giphy.js @@ -10,9 +10,9 @@ fr: { giphy: 'Insérer un GIF', }, + // jshint camelcase:true } }); - // jshint camelcase:true var giphyLogo = ''; @@ -139,7 +139,6 @@ dataType: 'json', success: function(response) { - console.log(arguments); renderGifs(response, $giphyModal, trumbowyg, true); }, error: ajaxError diff --git a/dist/plugins/giphy/trumbowyg.giphy.min.js b/dist/plugins/giphy/trumbowyg.giphy.min.js index 33036a836..b0f140c47 100644 --- a/dist/plugins/giphy/trumbowyg.giphy.min.js +++ b/dist/plugins/giphy/trumbowyg.giphy.min.js @@ -1 +1 @@ -!function(i){"use strict";function e(i,e){var n,o;return function(){var t=this,l=+new Date,c=arguments;n&&l'}).join("");if(t===!0){if(0===c.length){if(i("."+o.o.prefix+"giphy-no-result",n).length>0)return;c=''}n.empty()}n.append(c),i("img",n).on("click",function(){o.restoreRange(),o.execCmd("insertImage",i(this).attr("src"),!1,!0),i("img",n).off(),o.closeModal()})}i.extend(!0,i.trumbowyg,{langs:{en:{giphy:"Insert GIF"},fr:{giphy:"Insérer un GIF"}}});var o='',t="tbwcancel",l={rating:"g",apiKey:null,throttleDelay:300,noResultGifUrl:"https://media.giphy.com/media/2Faz9FbRzmwxY0pZS/giphy.gif"};i.extend(!0,i.trumbowyg,{plugins:{giphy:{init:function(c){c.o.plugins.giphy=i.extend({},l,c.o.plugins.giphy||{}),c.addBtnDef("giphy",{fn:function(){if(null===c.o.plugins.giphy.apiKey)throw new Error("You must set a Giphy API Key");var l="https://api.giphy.com/v1/gifs/search?api_key="+c.o.plugins.giphy.apiKey+"&rating="+c.o.plugins.giphy.rating,a=l.replace("/search","/trending"),r={abort:function(){}},s=c.o.prefix,p='',g='',u='
Powered by'+o+"
",h=p+g+u+'
';c.openModal(null,h,!1).one(t,function(){try{r.abort()}catch(i){}c.closeModal()});var d=i("."+s+"giphy-search"),f=i("."+s+"giphy-close"),y=i("."+s+"giphy-modal"),v=function(){navigator.onLine||i("."+s+"giphy-offline",y).length||(y.empty(),y.append('

You are offline

'))};i.ajax({url:a,dataType:"json",success:function(i){console.log(arguments),n(i,y,c,!0)},error:v});var m=function(){var e=d.val();if(0!==e.length){try{r.abort()}catch(o){}r=i.ajax({url:l+"&q="+encodeURIComponent(e),dataType:"json",success:function(i){n(i,y,c,!0)},error:v})}},w=e(m,c.o.plugins.giphy.throttleDelay);d.on("input",w),d.focus(),f.one("click",function(){y.trigger(t)})}})}}}})}(jQuery); \ No newline at end of file +!function(i){"use strict";function e(i,e){var n,t;return function(){var o=this,l=+new Date,c=arguments;n&&l'}).join("");if(o===!0){if(0===c.length){if(i("."+t.o.prefix+"giphy-no-result",n).length>0)return;c=''}n.empty()}n.append(c),i("img",n).on("click",function(){t.restoreRange(),t.execCmd("insertImage",i(this).attr("src"),!1,!0),i("img",n).off(),t.closeModal()})}i.extend(!0,i.trumbowyg,{langs:{en:{giphy:"Insert GIF"},fr:{giphy:"Insérer un GIF"}}});var t='',o="tbwcancel",l={rating:"g",apiKey:null,throttleDelay:300,noResultGifUrl:"https://media.giphy.com/media/2Faz9FbRzmwxY0pZS/giphy.gif"};i.extend(!0,i.trumbowyg,{plugins:{giphy:{init:function(c){c.o.plugins.giphy=i.extend({},l,c.o.plugins.giphy||{}),c.addBtnDef("giphy",{fn:function(){if(null===c.o.plugins.giphy.apiKey)throw new Error("You must set a Giphy API Key");var l="https://api.giphy.com/v1/gifs/search?api_key="+c.o.plugins.giphy.apiKey+"&rating="+c.o.plugins.giphy.rating,a=l.replace("/search","/trending"),r={abort:function(){}},s=c.o.prefix,p='',g='',u='
Powered by'+t+"
",h=p+g+u+'
';c.openModal(null,h,!1).one(o,function(){try{r.abort()}catch(i){}c.closeModal()});var d=i("."+s+"giphy-search"),f=i("."+s+"giphy-close"),y=i("."+s+"giphy-modal"),v=function(){navigator.onLine||i("."+s+"giphy-offline",y).length||(y.empty(),y.append('

You are offline

'))};i.ajax({url:a,dataType:"json",success:function(i){n(i,y,c,!0)},error:v});var m=function(){var e=d.val();if(0!==e.length){try{r.abort()}catch(t){}r=i.ajax({url:l+"&q="+encodeURIComponent(e),dataType:"json",success:function(i){n(i,y,c,!0)},error:v})}},w=e(m,c.o.plugins.giphy.throttleDelay);d.on("input",w),d.focus(),f.one("click",function(){y.trigger(o)})}})}}}})}(jQuery); \ 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 615668d39..ec5dc6cbb 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.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 e9e0d5013..5daaf9e70 100644 --- a/dist/plugins/giphy/ui/trumbowyg.giphy.css +++ b/dist/plugins/giphy/ui/trumbowyg.giphy.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 9c6fc858a..b2bdacc52 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.20.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.21.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-giphy-button svg{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%;-moz-columns:3;columns:3;-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;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 95c51ee66..1ca737ca7 100644 --- a/dist/plugins/highlight/trumbowyg.highlight.js +++ b/dist/plugins/highlight/trumbowyg.highlight.js @@ -59,6 +59,7 @@ $.extend(true, $.trumbowyg, { // Add some translations langs: { + // jshint camelcase:false en: { highlight: 'Code syntax highlight' }, @@ -68,6 +69,7 @@ ko: { highlight: '코드 문법 하이라이트' }, + // jshint camelcase:true }, // Add our plugin to Trumbowyg registered plugins plugins: { diff --git a/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss b/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss index c10d26a00..80e8c2b6d 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.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 e22631419..e3abedfad 100644 --- a/dist/plugins/highlight/ui/trumbowyg.highlight.css +++ b/dist/plugins/highlight/ui/trumbowyg.highlight.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 825ab38ea..358a44db0 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.20.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.21.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/history/trumbowyg.history.js b/dist/plugins/history/trumbowyg.history.js index 16e6828e2..a66769932 100644 --- a/dist/plugins/history/trumbowyg.history.js +++ b/dist/plugins/history/trumbowyg.history.js @@ -10,6 +10,7 @@ 'use strict'; $.extend(true, $.trumbowyg, { langs: { + // jshint camelcase:false de: { history: { redo: 'Wiederholen', @@ -52,6 +53,7 @@ undo: '되돌리기' } }, + // jshint camelcase:true }, plugins: { history: { diff --git a/dist/plugins/insertaudio/trumbowyg.insertaudio.js b/dist/plugins/insertaudio/trumbowyg.insertaudio.js index 1748fd362..eeda2db5e 100644 --- a/dist/plugins/insertaudio/trumbowyg.insertaudio.js +++ b/dist/plugins/insertaudio/trumbowyg.insertaudio.js @@ -33,6 +33,7 @@ $.extend(true, $.trumbowyg, { langs: { + // jshint camelcase:false en: { insertAudio: 'Insert Audio' }, @@ -57,6 +58,7 @@ ko: { insertAudio: '소리 넣기' }, + // jshint camelcase:true }, plugins: { insertAudio: { diff --git a/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss b/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss index e74942767..1dbaacea9 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.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 886245f10..9d2b51d66 100644 --- a/dist/plugins/mathml/ui/trumbowyg.mathml.css +++ b/dist/plugins/mathml/ui/trumbowyg.mathml.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 bed769c03..8e251b68e 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.20.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.21.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);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 d8e0bc23d..5391ec7c1 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.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 4ddb2296c..8323e713a 100644 --- a/dist/plugins/mention/ui/trumbowyg.mention.css +++ b/dist/plugins/mention/ui/trumbowyg.mention.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 761382b11..ca109f2ce 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.20.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.21.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%;background-size: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/noembed/trumbowyg.noembed.js b/dist/plugins/noembed/trumbowyg.noembed.js index 20ba0ab11..212d6784f 100644 --- a/dist/plugins/noembed/trumbowyg.noembed.js +++ b/dist/plugins/noembed/trumbowyg.noembed.js @@ -19,6 +19,7 @@ $.extend(true, $.trumbowyg, { langs: { + // jshint camelcase:false en: { noembed: 'Noembed', noembedError: 'Error' @@ -56,6 +57,7 @@ noembed: 'oEmbed 넣기', noembedError: '에러' }, + // jshint camelcase:true }, plugins: { diff --git a/dist/plugins/resizimg/resizable-resolveconflict.js b/dist/plugins/resizimg/resizable-resolveconflict.js new file mode 100644 index 000000000..49a121158 --- /dev/null +++ b/dist/plugins/resizimg/resizable-resolveconflict.js @@ -0,0 +1,20 @@ +(function (factory, define, require, module) { + 'use strict'; + + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery'], factory); + } else if (typeof module === 'object' && typeof module.exports === 'object') { + // CommonJS + module.exports = factory(require('jquery')); + } else { + // Global jQuery + factory(jQuery); + } +}(function ($) { + 'use strict'; + + // rename to avoid conflict with jquery-resizable + $.fn.uiresizable = $.fn.resizable; + delete $.fn.resizable; +})); diff --git a/dist/plugins/resizimg/resizable-resolveconflict.min.js b/dist/plugins/resizimg/resizable-resolveconflict.min.js new file mode 100644 index 000000000..8420eb842 --- /dev/null +++ b/dist/plugins/resizimg/resizable-resolveconflict.min.js @@ -0,0 +1 @@ +!function(e,t,o,r){"use strict";"function"==typeof t&&t.amd?t(["jquery"],e):"object"==typeof r&&"object"==typeof r.exports?r.exports=e(o("jquery")):e(jQuery)}(function(e){"use strict";e.fn.uiresizable=e.fn.resizable,delete e.fn.resizable}); \ No newline at end of file diff --git a/dist/plugins/resizimg/trumbowyg.resizimg.js b/dist/plugins/resizimg/trumbowyg.resizimg.js index 1f97f54de..d62356985 100644 --- a/dist/plugins/resizimg/trumbowyg.resizimg.js +++ b/dist/plugins/resizimg/trumbowyg.resizimg.js @@ -1,21 +1,209 @@ -(function ($) { +;(function ($) { 'use strict'; var defaultOptions = { minSize: 32, - step: 4, + step: 4 }; - function preventDefault(ev) { - return ev.preventDefault(); + function preventDefault(e) { + e.stopPropagation(); + e.preventDefault(); } + var ResizeWithCanvas = function () { + // variable to create canvas and save img in resize mode + this.resizeCanvas = document.createElement('canvas'); + // to allow canvas to get focus + this.resizeCanvas.setAttribute('tabindex', '0'); + this.resizeCanvas.id = 'trumbowyg-resizimg-' + (+new Date()); + this.ctx = null; + this.resizeImg = null; + + this.pressEscape = function (obj) { + obj.reset(); + }; + this.pressBackspaceOrDelete = function (obj) { + $(obj.resizeCanvas).replaceWith(''); + obj.resizeImg = null; + }; + + // PRIVATE FUNCTION + var focusedNow = false; + var isCursorSeResize = false; + + // calculate offset to change mouse over square in the canvas + var offsetX, offsetY; + var reOffset = function (canvas) { + var BB = canvas.getBoundingClientRect(); + offsetX = BB.left; + offsetY = BB.top; + }; + + var drawRect = function (shapeData, ctx) { + // Inner + ctx.beginPath(); + ctx.fillStyle = 'rgb(255, 255, 255)'; + ctx.rect(shapeData.points.x, shapeData.points.y, shapeData.points.width, shapeData.points.height); + ctx.fill(); + ctx.stroke(); + }; + + var updateCanvas = function (canvas, ctx, img, canvasWidth, canvasHeight) { + ctx.translate(0.5, 0.5); + ctx.lineWidth = 1; + + // image + ctx.drawImage(img, 5, 5, canvasWidth - 10, canvasHeight - 10); + + // border + ctx.beginPath(); + ctx.rect(5, 5, canvasWidth - 10, canvasHeight - 10); + ctx.stroke(); + + // square in the angle + ctx.beginPath(); + ctx.fillStyle = 'rgb(255, 255, 255)'; + ctx.rect(canvasWidth - 10, canvasHeight - 10, 9, 9); + ctx.fill(); + ctx.stroke(); + + // get the offset to change the mouse cursor + reOffset(canvas); + + return ctx; + }; + + // PUBLIC FUNCTION + // necessary to correctly print cursor over square. Called once for instance. Useless with trumbowyg. + this.init = function () { + var _this = this; + $(window).on('scroll resize', function () { + _this.reCalcOffset(); + }); + }; + + this.reCalcOffset = function () { + reOffset(this.resizeCanvas); + }; + + this.canvasId = function () { + return this.resizeCanvas.id; + }; + + this.isActive = function () { + return this.resizeImg !== null; + }; + + this.isFocusedNow = function () { + return focusedNow; + }; + + this.blurNow = function () { + focusedNow = false; + }; + + // restore image in the HTML of the editor + this.reset = function () { + if (this.resizeImg === null) { + return; + } + + this.resizeImg.width = this.resizeCanvas.clientWidth - 10; + this.resizeImg.height = this.resizeCanvas.clientHeight - 10; + // clear style of image to avoid issue on resize because this attribute have priority over width and height attribute + this.resizeImg.removeAttribute('style'); + + $(this.resizeCanvas).replaceWith($(this.resizeImg)); + + // reset canvas style + this.resizeCanvas.removeAttribute('style'); + this.resizeImg = null; + }; + + // setup canvas with points and border to allow the resizing operation + this.setup = function (img, resizableOptions) { + this.resizeImg = img; + + if (!this.resizeCanvas.getContext) { + return false; + } + + focusedNow = true; + + // draw canvas + this.resizeCanvas.width = $(this.resizeImg).width() + 10; + this.resizeCanvas.height = $(this.resizeImg).height() + 10; + this.resizeCanvas.style.margin = '-5px'; + this.ctx = this.resizeCanvas.getContext('2d'); + + // replace image with canvas + $(this.resizeImg).replaceWith($(this.resizeCanvas)); + + updateCanvas(this.resizeCanvas, this.ctx, this.resizeImg, this.resizeCanvas.width, this.resizeCanvas.height); + + // enable resize + $(this.resizeCanvas).resizable(resizableOptions) + .on('mousedown', preventDefault); + + var _this = this; + $(this.resizeCanvas) + .on('mousemove', function (e) { + var mouseX = Math.round(e.clientX - offsetX); + var mouseY = Math.round(e.clientY - offsetY); + + var wasCursorSeResize = isCursorSeResize; + + _this.ctx.rect(_this.resizeCanvas.width - 10, _this.resizeCanvas.height - 10, 9, 9); + isCursorSeResize = _this.ctx.isPointInPath(mouseX, mouseY); + if (wasCursorSeResize !== isCursorSeResize) { + this.style.cursor = isCursorSeResize ? 'se-resize' : 'default'; + } + }) + .on('keydown', function (e) { + if (!_this.isActive()) { + return; + } + + var x = e.keyCode; + if (x === 27) { // ESC + _this.pressEscape(_this); + } else if (x === 8 || x === 46) { // BACKSPACE or DELETE + _this.pressBackspaceOrDelete(_this); + } + }) + .on('focus', preventDefault); + + this.resizeCanvas.focus(); + + return true; + }; + + // update the canvas after the resizing + this.refresh = function () { + if (!this.resizeCanvas.getContext) { + return; + } + + this.resizeCanvas.width = this.resizeCanvas.clientWidth; + this.resizeCanvas.height = this.resizeCanvas.clientHeight; + updateCanvas(this.resizeCanvas, this.ctx, this.resizeImg, this.resizeCanvas.width, this.resizeCanvas.height); + }; + }; + + // object to interact with canvas + var resizeWithCanvas = new ResizeWithCanvas(); + function destroyResizable(trumbowyg) { - trumbowyg.$ed.find('img.resizable') - .resizable('destroy') - .off('mousedown', preventDefault) - .removeClass('resizable'); - trumbowyg.syncTextarea(); + // clean html code + trumbowyg.$ed.find('canvas.resizable') + .resizable('destroy') + .off('mousedown', preventDefault) + .removeClass('resizable'); + + resizeWithCanvas.reset(); + + trumbowyg.syncCode(); } $.extend(true, $.trumbowyg, { @@ -46,6 +234,8 @@ return false; }, onDragEnd: function () { + // resize update canvas information + resizeWithCanvas.refresh(); trumbowyg.syncCode(); } } @@ -53,22 +243,55 @@ ); function initResizable() { - trumbowyg.$ed.find('img:not(.resizable)') - .resizable(trumbowyg.o.plugins.resizimg.resizable) - .on('mousedown', preventDefault); + trumbowyg.$ed.find('img') + .off('click') + .on('click', function (e) { + // if I'm already do a resize, reset it + if (resizeWithCanvas.isActive()) { + resizeWithCanvas.reset(); + } + // initialize resize of image + resizeWithCanvas.setup(this, trumbowyg.o.plugins.resizimg.resizable); + + preventDefault(e); + }); } - // Init - trumbowyg.$c.on('tbwinit', initResizable); - trumbowyg.$c.on('tbwfocus', initResizable); - trumbowyg.$c.on('tbwchange', initResizable); + trumbowyg.$c.on('tbwinit', function () { + initResizable(); + + // disable resize when click on other items + trumbowyg.$ed.on('click', function (e) { + // check if I've clicked out of canvas or image to reset it + if ($(e.target).is('img') || e.target.id === resizeWithCanvas.canvasId()) { + return; + } + + preventDefault(e); + resizeWithCanvas.reset(); + + // save changes + trumbowyg.$c.trigger('tbwchange'); + }); + + trumbowyg.$ed.on('scroll', function () { + resizeWithCanvas.reCalcOffset(); + }); + }); + + trumbowyg.$c.on('tbwfocus tbwchange', initResizable); + trumbowyg.$c.on('tbwresize', function () { + resizeWithCanvas.reCalcOffset(); + }); // Destroy trumbowyg.$c.on('tbwblur', function () { - destroyResizable(trumbowyg); - }); - trumbowyg.$c.on('tbwclose', function () { - destroyResizable(trumbowyg); + // if I have already focused the canvas avoid destroy + if (resizeWithCanvas.isFocusedNow()) { + resizeWithCanvas.blurNow(); + } else { + destroyResizable(trumbowyg); + } }); }, destroy: function (trumbowyg) { diff --git a/dist/plugins/resizimg/trumbowyg.resizimg.min.js b/dist/plugins/resizimg/trumbowyg.resizimg.min.js index c1547447e..77d1c8542 100644 --- a/dist/plugins/resizimg/trumbowyg.resizimg.min.js +++ b/dist/plugins/resizimg/trumbowyg.resizimg.min.js @@ -1 +1 @@ -!function(e){"use strict";function i(e){return e.preventDefault()}function n(e){e.$ed.find("img.resizable").resizable("destroy").off("mousedown",i).removeClass("resizable"),e.syncTextarea()}var t={minSize:32,step:4};e.extend(!0,e.trumbowyg,{plugins:{resizimg:{init:function(o){function r(){o.$ed.find("img:not(.resizable)").resizable(o.o.plugins.resizimg.resizable).on("mousedown",i)}o.o.plugins.resizimg=e.extend(!0,{},t,o.o.plugins.resizimg||{},{resizable:{resizeWidth:!1,onDragStart:function(e,i){var n=o.o.plugins.resizimg,t=e.pageX-i.offset().left,r=e.pageY-i.offset().top;if(t'+e.modal+" ("+e.rubyText+")")[0];return u.range.deleteContents(),u.range.insertNode(b),u.syncCode(),u.$c.trigger("tbwchange"),!0})}};u.addBtnDef("ruby",e)}}}})}(jQuery); \ No newline at end of file +!function(r){"use strict";r.extend(!0,r.trumbowyg,{langs:{en:{ruby:"Add ruby text",rubyModal:"Ruby modal",rubyText:"Ruby text"},da:{ruby:"Tilføj ruby tekst",rubyModal:"Ruby modal",rubyText:"Ruby tekst"},fr:{ruby:"Ajouter du texte ruby",rubyModal:"Modale ruby",rubyText:"Texte ruby"},id:{ruby:"Sisipkan teks ruby",rubyModal:"Modal teks ruby",rubyText:"Teks ruby"},ko:{ruby:"루비 문자 넣기",rubyModal:"대상 문자",rubyText:"루비 문자"},pt_br:{ruby:"Adicionar texto ruby",rubyModal:"Modal ruby",rubyText:"Texto ruby"},tr:{ruby:"Ruby metni ekle",rubyModal:"Ruby modal",rubyText:"Ruby metni"},zh_tw:{ruby:"加入 ruby 文字",rubyModal:"Ruby 彈跳視窗",rubyText:"Ruby 文字"}},plugins:{ruby:{init:function(u){var e={fn:function(){u.saveRange(),u.openModalInsert(u.lang.ruby,{rubyText:{label:u.lang.rubyText,required:!1},modal:{label:u.lang.rubyModal,value:u.getRangeText(),required:!0}},function(e){var b=r(''+e.modal+" ("+e.rubyText+")")[0];return u.range.deleteContents(),u.range.insertNode(b),u.syncCode(),u.$c.trigger("tbwchange"),!0})}};u.addBtnDef("ruby",e)}}}})}(jQuery); \ 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 e39218fa9..8f5378cf5 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.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 b48c46279..f02a2f40d 100644 --- a/dist/plugins/specialchars/ui/trumbowyg.specialchars.css +++ b/dist/plugins/specialchars/ui/trumbowyg.specialchars.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 898c53524..22d97765a 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.20.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.21.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;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 6f8a40fa8..86e938720 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.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 f45bdf2e9..b93bf4955 100644 --- a/dist/plugins/table/ui/trumbowyg.table.css +++ b/dist/plugins/table/ui/trumbowyg.table.css @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.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 2b73d686d..7ef08a1c9 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.20.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.21.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;box-shadow:0 0 0 1px #cecece inset}.trumbowyg-dropdown-table table td.active{background-color:#00b393;box-shadow:none;cursor:pointer}.trumbowyg-dropdown-table .trumbowyg-table-size{text-align:center} \ No newline at end of file diff --git a/dist/plugins/template/trumbowyg.template.js b/dist/plugins/template/trumbowyg.template.js index b2f874aac..b23f111da 100644 --- a/dist/plugins/template/trumbowyg.template.js +++ b/dist/plugins/template/trumbowyg.template.js @@ -4,6 +4,7 @@ // Adds the language variables $.extend(true, $.trumbowyg, { langs: { + // jshint camelcase:false en: { template: 'Template' }, @@ -16,27 +17,28 @@ fr: { template: 'Patron' }, + ja: { + template: 'テンプレート' + }, + ko: { + template: '서식' + }, nl: { template: 'Sjabloon' }, + pt_br: { + template: 'Modelo' + }, ru: { template: 'Шаблон' }, - ja: { - template: 'テンプレート' - }, tr: { template: 'Şablon' }, zh_tw: { template: '模板', }, - pt_br: { - template: 'Modelo' - }, - ko: { - template: '서식' - }, + // jshint camelcase:true } }); diff --git a/dist/plugins/template/trumbowyg.template.min.js b/dist/plugins/template/trumbowyg.template.min.js index 76a72fbac..979dea89f 100644 --- a/dist/plugins/template/trumbowyg.template.min.js +++ b/dist/plugins/template/trumbowyg.template.min.js @@ -1 +1 @@ -!function(t){"use strict";function e(e){var n=e.o.plugins.templates,a=[];return t.each(n,function(t,n){e.addBtnDef("template_"+t,{fn:function(){e.html(n.html)},hasIcon:!1,title:n.name}),a.push("template_"+t)}),a}t.extend(!0,t.trumbowyg,{langs:{en:{template:"Template"},da:{template:"Skabelon"},de:{template:"Vorlage"},fr:{template:"Patron"},nl:{template:"Sjabloon"},ru:{template:"Шаблон"},ja:{template:"テンプレート"},tr:{template:"Şablon"},zh_tw:{template:"模板"},pt_br:{template:"Modelo"},ko:{template:"서식"}}}),t.extend(!0,t.trumbowyg,{plugins:{template:{shouldInit:function(t){return t.o.plugins.hasOwnProperty("templates")},init:function(t){t.addBtnDef("template",{dropdown:e(t),hasIcon:!1,text:t.lang.template})}}}})}(jQuery); \ No newline at end of file +!function(t){"use strict";function e(e){var n=e.o.plugins.templates,a=[];return t.each(n,function(t,n){e.addBtnDef("template_"+t,{fn:function(){e.html(n.html)},hasIcon:!1,title:n.name}),a.push("template_"+t)}),a}t.extend(!0,t.trumbowyg,{langs:{en:{template:"Template"},da:{template:"Skabelon"},de:{template:"Vorlage"},fr:{template:"Patron"},ja:{template:"テンプレート"},ko:{template:"서식"},nl:{template:"Sjabloon"},pt_br:{template:"Modelo"},ru:{template:"Шаблон"},tr:{template:"Şablon"},zh_tw:{template:"模板"}}}),t.extend(!0,t.trumbowyg,{plugins:{template:{shouldInit:function(t){return t.o.plugins.hasOwnProperty("templates")},init:function(t){t.addBtnDef("template",{dropdown:e(t),hasIcon:!1,text:t.lang.template})}}}})}(jQuery); \ No newline at end of file diff --git a/dist/trumbowyg.js b/dist/trumbowyg.js index b4e76bfa5..a572fa3b9 100644 --- a/dist/trumbowyg.js +++ b/dist/trumbowyg.js @@ -1,5 +1,5 @@ /** - * Trumbowyg v2.20.0 - A lightweight WYSIWYG editor + * Trumbowyg v2.21.0 - A lightweight WYSIWYG editor * Trumbowyg core file * ------------------------ * @link http://alex-d.github.io/Trumbowyg @@ -740,7 +740,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { }, 0); }); - $(t.doc.body).on('keydown', function (e) { + $(t.doc.body).on('keydown.' + t.eventNamespace, function (e) { if (e.which === 27 && $('.' + prefix + 'modal-box').length >= 1) { t.closeModal(); return false; @@ -1032,6 +1032,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { $('body').removeClass(prefix + 'body-fullscreen'); t.$c.trigger('tbwclose'); $(window).off('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace); + $(t.doc.body).off('keydown.' + t.eventNamespace); }, diff --git a/dist/trumbowyg.min.js b/dist/trumbowyg.min.js index 2c45abfe1..97b2c3500 100644 --- a/dist/trumbowyg.min.js +++ b/dist/trumbowyg.min.js @@ -1,2 +1,2 @@ -/** Trumbowyg v2.20.0 - 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",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,hideButtonTexts:null},Object.defineProperty(jQuery.trumbowyg,"defaultOptions",{value:{lang:"en",fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,autogrowOnEnter:!1,imageWidthModalEdit:!1,prefix:"trumbowyg-",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},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(r){}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),r=r||{},null!=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=d!==!1,i.svgPath=i.doc.querySelector("base")?t.location.href.split("#")[0]:"",0===a("#"+s,i.doc).length&&d!==!1){if(null==d){for(var c=n.getElementsByTagName("script"),u=0;u",{"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("