activeadmin_trumbowyg 0.2.10 → 0.2.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/trumbowyg/icons.svg +1 -1
  3. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ko.js +4 -1
  4. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ko.min.js +3 -1
  5. data/app/assets/javascripts/activeadmin/trumbowyg/langs/tr.js +7 -1
  6. data/app/assets/javascripts/activeadmin/trumbowyg/langs/tr.min.js +4 -1
  7. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +30 -24
  8. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +1 -1
  9. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +41 -5
  10. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +1 -1
  11. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +35 -29
  12. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +1 -1
  13. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +1 -1
  14. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +1 -1
  15. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +1 -1
  16. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +156 -92
  17. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +1 -1
  18. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +1 -1
  19. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +1 -1
  20. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +1 -1
  21. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js +11 -8
  22. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js +1 -1
  23. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js +102 -79
  24. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js +1 -1
  25. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/trumbowyg.giphy.js +4 -1
  26. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/trumbowyg.giphy.min.js +1 -1
  27. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/sass/trumbowyg.giphy.scss +1 -1
  28. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.css +1 -1
  29. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.min.css +1 -1
  30. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.js +23 -7
  31. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js +1 -1
  32. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss +1 -1
  33. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css +1 -1
  34. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css +1 -1
  35. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.js +21 -15
  36. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.min.js +1 -1
  37. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/indent/trumbowyg.indent.js +56 -0
  38. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/indent/trumbowyg.indent.min.js +1 -0
  39. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +9 -6
  40. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +1 -1
  41. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.js +36 -27
  42. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.min.js +1 -1
  43. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.js +15 -10
  44. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.min.js +1 -1
  45. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/sass/trumbowyg.mathml.scss +1 -1
  46. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.css +1 -1
  47. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.min.css +1 -1
  48. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.js +9 -6
  49. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.min.js +1 -1
  50. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/sass/trumbowyg.mention.scss +1 -1
  51. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.css +1 -1
  52. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.min.css +1 -1
  53. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +19 -15
  54. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +1 -1
  55. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +14 -11
  56. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +1 -1
  57. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.js +46 -38
  58. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.min.js +1 -1
  59. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.js +5 -0
  60. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.min.js +1 -1
  61. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/trumbowyg.specialchars.js +3 -0
  62. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/trumbowyg.specialchars.min.js +1 -1
  63. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss +1 -1
  64. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.css +1 -1
  65. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.min.css +1 -1
  66. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +66 -55
  67. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +1 -1
  68. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss +1 -1
  69. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.css +1 -1
  70. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.min.css +1 -1
  71. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +3 -0
  72. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +1 -1
  73. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +47 -30
  74. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +1 -1
  75. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.js +141 -65
  76. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.min.js +2 -2
  77. data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.scss +2 -2
  78. data/lib/activeadmin/trumbowyg/version.rb +2 -1
  79. metadata +4 -2
@@ -1 +1 @@
1
- !function(e){"use strict";function i(e){e.stopPropagation(),e.preventDefault()}function t(e){e.$ed.find("canvas.resizable").resizable("destroy").off("mousedown",i).removeClass("resizable"),r.reset(),e.syncCode()}var s={minSize:32,step:4},n=function(){this.resizeCanvas=document.createElement("canvas"),this.resizeCanvas.setAttribute("tabindex","0"),this.resizeCanvas.id="trumbowyg-resizimg-"+ +new Date,this.ctx=null,this.resizeImg=null,this.pressEscape=function(e){e.reset()},this.pressBackspaceOrDelete=function(i){e(i.resizeCanvas).replaceWith(""),i.resizeImg=null};var t,s,n=!1,r=!1,a=function(e){var i=e.getBoundingClientRect();t=i.left,s=i.top},h=function(e,i,t,s,n){return i.translate(.5,.5),i.lineWidth=1,i.drawImage(t,5,5,s-10,n-10),i.beginPath(),i.rect(5,5,s-10,n-10),i.stroke(),i.beginPath(),i.fillStyle="rgb(255, 255, 255)",i.rect(s-10,n-10,9,9),i.fill(),i.stroke(),a(e),i};this.init=function(){var i=this;e(window).on("scroll resize",function(){i.reCalcOffset()})},this.reCalcOffset=function(){a(this.resizeCanvas)},this.canvasId=function(){return this.resizeCanvas.id},this.isActive=function(){return null!==this.resizeImg},this.isFocusedNow=function(){return n},this.blurNow=function(){n=!1},this.reset=function(){null!==this.resizeImg&&(this.resizeImg.width=this.resizeCanvas.clientWidth-10,this.resizeImg.height=this.resizeCanvas.clientHeight-10,this.resizeImg.removeAttribute("style"),e(this.resizeCanvas).replaceWith(e(this.resizeImg)),this.resizeCanvas.removeAttribute("style"),this.resizeImg=null)},this.setup=function(a,o){if(this.resizeImg=a,!this.resizeCanvas.getContext)return!1;n=!0,this.resizeCanvas.width=e(this.resizeImg).width()+10,this.resizeCanvas.height=e(this.resizeImg).height()+10,this.resizeCanvas.style.margin="-5px",this.ctx=this.resizeCanvas.getContext("2d"),e(this.resizeImg).replaceWith(e(this.resizeCanvas)),h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height),e(this.resizeCanvas).resizable(o).on("mousedown",i);var c=this;return e(this.resizeCanvas).on("mousemove",function(e){var i=Math.round(e.clientX-t),n=Math.round(e.clientY-s),a=r;c.ctx.rect(c.resizeCanvas.width-10,c.resizeCanvas.height-10,9,9),r=c.ctx.isPointInPath(i,n),a!==r&&(this.style.cursor=r?"se-resize":"default")}).on("keydown",function(e){if(c.isActive()){var i=e.keyCode;27===i?c.pressEscape(c):8!==i&&46!==i||c.pressBackspaceOrDelete(c)}}).on("focus",i),this.resizeCanvas.focus(),!0},this.refresh=function(){this.resizeCanvas.getContext&&(this.resizeCanvas.width=this.resizeCanvas.clientWidth,this.resizeCanvas.height=this.resizeCanvas.clientHeight,h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height))}},r=new n;e.extend(!0,e.trumbowyg,{plugins:{resizimg:{init:function(n){function a(){n.$ed.find("img").off("click").on("click",function(e){r.isActive()&&r.reset(),r.setup(this,n.o.plugins.resizimg.resizable),i(e)})}n.o.plugins.resizimg=e.extend(!0,{},s,n.o.plugins.resizimg||{},{resizable:{resizeWidth:!1,onDragStart:function(e,i){var t=n.o.plugins.resizimg,s=e.pageX-i.offset().left,r=e.pageY-i.offset().top;if(s<i.width()-t.minSize||r<i.height()-t.minSize)return!1},onDrag:function(e,i,t,s){var r=n.o.plugins.resizimg;return s<r.minSize&&(s=r.minSize),s-=s%r.step,i.height(s),!1},onDragEnd:function(){r.refresh(),n.syncCode()}}}),n.$c.on("tbwinit",function(){a(),n.$ed.on("click",function(t){e(t.target).is("img")||t.target.id===r.canvasId()||(i(t),r.reset(),n.$c.trigger("tbwchange"))}),n.$ed.on("scroll",function(){r.reCalcOffset()})}),n.$c.on("tbwfocus tbwchange",a),n.$c.on("tbwresize",function(){r.reCalcOffset()}),n.$c.on("tbwblur",function(){r.isFocusedNow()?r.blurNow():t(n)})},destroy:function(e){t(e)}}}})}(jQuery);
1
+ !function(e){"use strict";function i(e){e.stopPropagation(),e.preventDefault()}var t={minSize:32,step:4},s=function(t){this.resizeCanvas=document.createElement("canvas"),this.resizeCanvas.setAttribute("tabindex","0"),this.resizeCanvas.id="trumbowyg-resizimg-"+ +new Date,this.ctx=null,this.resizeImg=null,this.pressEscape=function(e){e.reset()},this.pressBackspaceOrDelete=function(i){e(i.resizeCanvas).remove(),i.resizeImg=null,null!==t&&(t.syncCode(),t.$c.trigger("tbwchange"))};var s,n,r=!1,a=!1,o=function(e){var i=e.getBoundingClientRect();s=i.left,n=i.top},h=function(e,i,t,s,n){return i.translate(.5,.5),i.lineWidth=1,i.drawImage(t,5,5,s-10,n-10),i.beginPath(),i.rect(5,5,s-10,n-10),i.stroke(),i.beginPath(),i.fillStyle="rgb(255, 255, 255)",i.rect(s-10,n-10,9,9),i.fill(),i.stroke(),o(e),i};this.init=function(){var i=this;e(window).on("scroll resize",function(){i.reCalcOffset()})},this.reCalcOffset=function(){o(this.resizeCanvas)},this.canvasId=function(){return this.resizeCanvas.id},this.isActive=function(){return null!==this.resizeImg},this.isFocusedNow=function(){return r},this.blurNow=function(){r=!1},this.reset=function(){null!==this.resizeImg&&(this.resizeImg.setAttribute("style","width: 100%; max-width: "+(this.resizeCanvas.clientWidth-10)+"px; height: auto; max-height: "+(this.resizeCanvas.clientHeight-10)+"px;"),e(this.resizeCanvas).replaceWith(e(this.resizeImg)),this.resizeCanvas.removeAttribute("style"),this.resizeImg=null)},this.setup=function(o,c){if(this.resizeImg=o,!this.resizeCanvas.getContext)return!1;r=!0,this.resizeCanvas.width=e(this.resizeImg).width()+10,this.resizeCanvas.height=e(this.resizeImg).height()+10,this.resizeCanvas.style.margin="-5px",this.ctx=this.resizeCanvas.getContext("2d"),e(this.resizeImg).replaceWith(e(this.resizeCanvas)),h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height),e(this.resizeCanvas).resizable(c).on("mousedown",i);var u=this;return e(this.resizeCanvas).on("mousemove",function(e){var i=Math.round(e.clientX-s),t=Math.round(e.clientY-n),r=a;u.ctx.rect(u.resizeCanvas.width-10,u.resizeCanvas.height-10,9,9),a=u.ctx.isPointInPath(i,t),r!==a&&(this.style.cursor=a?"se-resize":"default")}).on("keydown",function(e){if(u.isActive()){var i=e.keyCode;27===i?u.pressEscape(u):8!==i&&46!==i||u.pressBackspaceOrDelete(u)}}).on("focus",i).on("blur",function(){u.reset(),null!==t&&(t.syncCode(),t.$c.trigger("tbwchange"))}),this.resizeCanvas.focus(),!0},this.refresh=function(){this.resizeCanvas.getContext&&(this.resizeCanvas.width=this.resizeCanvas.clientWidth,this.resizeCanvas.height=this.resizeCanvas.clientHeight,h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height))}};e.extend(!0,e.trumbowyg,{plugins:{resizimg:{destroyResizable:function(){},init:function(n){function r(){n.$ed.find("img").off("click").on("click",function(e){o.isActive()&&o.reset(),o.setup(this,n.o.plugins.resizimg.resizable),i(e)})}var a=this.destroyResizable,o=new s(n);this.destroyResizable=function(){n.$ed.find("canvas.resizable").resizable("destroy").off("mousedown",i).removeClass("resizable"),o.reset(),n.syncCode()},n.o.plugins.resizimg=e.extend(!0,{},t,n.o.plugins.resizimg||{},{resizable:{resizeWidth:!1,onDragStart:function(e,i){var t=n.o.plugins.resizimg,s=e.pageX-i.offset().left,r=e.pageY-i.offset().top;if(s<i.width()-t.minSize||r<i.height()-t.minSize)return!1},onDrag:function(e,i,t,s){var r=n.o.plugins.resizimg;return s<r.minSize&&(s=r.minSize),s-=s%r.step,i.height(s),!1},onDragEnd:function(){o.refresh(),n.syncCode()}}}),n.$c.on("tbwinit",function(){r(),n.$ed.on("click",function(t){e(t.target).is("img")||t.target.id===o.canvasId()||(i(t),o.reset(),n.syncCode(),n.$c.trigger("tbwchange"))}),n.$ed.on("scroll",function(){o.reCalcOffset()})}),n.$c.on("tbwfocus tbwchange",r),n.$c.on("tbwresize",function(){o.reCalcOffset()}),n.$c.on("tbwblur",function(){o.isFocusedNow()?o.blurNow():a()})},destroy:function(){this.destroyResizable()}}}})}(jQuery);
@@ -29,6 +29,11 @@
29
29
  rubyModal: 'Modale ruby',
30
30
  rubyText: 'Texte ruby'
31
31
  },
32
+ hu: {
33
+ ruby: 'Ruby szöveg hozzáadás',
34
+ rubyModal: 'Ruby modal',
35
+ rubyText: 'Ruby szöveg'
36
+ },
32
37
  id: {
33
38
  ruby: 'Sisipkan teks ruby',
34
39
  rubyModal: 'Modal teks ruby',
@@ -1 +1 @@
1
- !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('<ruby title="'+e.rubyText+'">'+e.modal+"<rp> (</rp><rt>"+e.rubyText+"</rt><rp>)</rp></ruby>")[0];return u.range.deleteContents(),u.range.insertNode(b),u.syncCode(),u.$c.trigger("tbwchange"),!0})}};u.addBtnDef("ruby",e)}}}})}(jQuery);
1
+ !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"},hu:{ruby:"Ruby szöveg hozzáadás",rubyModal:"Ruby modal",rubyText:"Ruby szöveg"},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('<ruby title="'+e.rubyText+'">'+e.modal+"<rp> (</rp><rt>"+e.rubyText+"</rt><rp>)</rp></ruby>")[0];return u.range.deleteContents(),u.range.insertNode(b),u.syncCode(),u.$c.trigger("tbwchange"),!0})}};u.addBtnDef("ruby",e)}}}})}(jQuery);
@@ -31,6 +31,9 @@
31
31
  fr: {
32
32
  specialChars: 'Caractères spéciaux'
33
33
  },
34
+ hu: {
35
+ specialChars: 'Speciális karakterek'
36
+ },
34
37
  ko: {
35
38
  specialChars: '특수문자'
36
39
  },
@@ -1 +1 @@
1
- !function(s){"use strict";function a(a){var n=[];return s.each(a.o.plugins.specialchars.symbolList,function(s,e){e=null===e?"&nbsp":"&#x"+e;var r=e.replace(/:/g,""),l="symbol-"+r,c={text:e,hasIcon:!1,fn:function(){var s=String.fromCodePoint(parseInt(e.replace("&#","0")));return a.execCmd("insertText",s),!0}};a.addBtnDef(l,c),n.push(l)}),n}var n={symbolList:["0024","20AC","00A3","00A2","00A5","00A4","2030",null,"00A9","00AE","2122",null,"00A7","00B6","00C6","00E6","0152","0153",null,"2022","25CF","2023","25B6","2B29","25C6",null,"00B1","00D7","00F7","21D2","21D4","220F","2211","2243","2264","2265"]};s.extend(!0,s.trumbowyg,{langs:{en:{specialChars:"Special characters"},fr:{specialChars:"Caractères spéciaux"},ko:{specialChars:"특수문자"}},plugins:{specialchars:{init:function(s){s.o.plugins.specialchars=s.o.plugins.specialchars||n;var e={dropdown:a(s)};s.addBtnDef("specialChars",e)}}}})}(jQuery);
1
+ !function(a){"use strict";function s(s){var e=[];return a.each(s.o.plugins.specialchars.symbolList,function(a,n){n=null===n?"&nbsp":"&#x"+n;var r=n.replace(/:/g,""),l="symbol-"+r,c={text:n,hasIcon:!1,fn:function(){var a=String.fromCodePoint(parseInt(n.replace("&#","0")));return s.execCmd("insertText",a),!0}};s.addBtnDef(l,c),e.push(l)}),e}var e={symbolList:["0024","20AC","00A3","00A2","00A5","00A4","2030",null,"00A9","00AE","2122",null,"00A7","00B6","00C6","00E6","0152","0153",null,"2022","25CF","2023","25B6","2B29","25C6",null,"00B1","00D7","00F7","21D2","21D4","220F","2211","2243","2264","2265"]};a.extend(!0,a.trumbowyg,{langs:{en:{specialChars:"Special characters"},fr:{specialChars:"Caractères spéciaux"},hu:{specialChars:"Speciális karakterek"},ko:{specialChars:"특수문자"}},plugins:{specialchars:{init:function(a){a.o.plugins.specialchars=a.o.plugins.specialchars||e;var n={dropdown:s(a)};a.addBtnDef("specialChars",n)}}}})}(jQuery);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Trumbowyg v2.21.0 - A lightweight WYSIWYG editor
2
+ * Trumbowyg v2.23.0 - A lightweight WYSIWYG editor
3
3
  * Default stylesheet for Trumbowyg editor plugin
4
4
  * ------------------------
5
5
  * @link http://alex-d.github.io/Trumbowyg
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Trumbowyg v2.21.0 - A lightweight WYSIWYG editor
2
+ * Trumbowyg v2.23.0 - A lightweight WYSIWYG editor
3
3
  * Trumbowyg plugin stylesheet
4
4
  * ------------------------
5
5
  * @link http://alex-d.github.io/Trumbowyg
@@ -1,2 +1,2 @@
1
- /** Trumbowyg v2.21.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
1
+ /** Trumbowyg v2.23.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
2
2
  .trumbowyg-symbol-\&nbsp-dropdown-button{display:none!important}.trumbowyg-symbol-\&nbsp-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}
@@ -29,6 +29,14 @@
29
29
  tableDestroy: 'Delete table',
30
30
  error: 'Error'
31
31
  },
32
+ cs: {
33
+ table: 'Vytvořit příkaz Table',
34
+ tableAddRow: 'Přidat řádek',
35
+ tableAddRowAbove: 'Přidat řádek',
36
+ tableAddColumnLeft: 'Přidat sloupec',
37
+ tableAddColumn: 'Přidat sloupec',
38
+ error: 'Chyba'
39
+ },
32
40
  da: {
33
41
  table: 'Indsæt tabel',
34
42
  tableAddRow: 'Tilføj række',
@@ -51,14 +59,6 @@
51
59
  tableDestroy: 'Tabelle löschen',
52
60
  error: 'Error'
53
61
  },
54
- sk: {
55
- table: 'Vytvoriť tabuľky',
56
- tableAddRow: 'Pridať riadok',
57
- tableAddRowAbove: 'Pridať riadok',
58
- tableAddColumnLeft: 'Pridať stĺpec',
59
- tableAddColumn: 'Pridať stĺpec',
60
- error: 'Chyba'
61
- },
62
62
  fr: {
63
63
  table: 'Insérer un tableau',
64
64
  tableAddRow: 'Ajouter des lignes',
@@ -70,13 +70,57 @@
70
70
  tableDestroy: 'Effacer le tableau',
71
71
  error: 'Erreur'
72
72
  },
73
- cs: {
74
- table: 'Vytvořit příkaz Table',
75
- tableAddRow: 'Přidat řádek',
76
- tableAddRowAbove: 'Přidat řádek',
77
- tableAddColumnLeft: 'Přidat sloupec',
78
- tableAddColumn: 'Přidat sloupec',
79
- error: 'Chyba'
73
+ hu: {
74
+ table: 'Táblázat beszúrás',
75
+ tableAddRow: 'Sor hozzáadás',
76
+ tableAddRowAbove: 'Sor beszúrás fönt',
77
+ tableAddColumnLeft: 'Sor beszúrás balra',
78
+ tableAddColumn: 'Sor beszúrás jobbra',
79
+ tableDeleteRow: 'Sor törlés',
80
+ tableDeleteColumn: 'Oszlop törlés',
81
+ tableDestroy: 'Táblázat törlés',
82
+ error: 'Hiba'
83
+ },
84
+ id: {
85
+ table: 'Sisipkan tabel',
86
+ tableAddRow: 'Sisipkan baris',
87
+ tableAddRowAbove: 'Sisipkan baris',
88
+ tableAddColumnLeft: 'Sisipkan kolom',
89
+ tableAddColumn: 'Sisipkan kolom',
90
+ tableDeleteRow: 'Hapus baris',
91
+ tableDeleteColumn: 'Hapus kolom',
92
+ tableDestroy: 'Hapus tabel',
93
+ error: 'Galat'
94
+ },
95
+ ja: {
96
+ table: '表の挿入',
97
+ tableAddRow: '行の追加',
98
+ tableAddRowAbove: '行の追加',
99
+ tableAddColumnLeft: '列の追加',
100
+ tableAddColumn: '列の追加',
101
+ error: 'エラー'
102
+ },
103
+ ko: {
104
+ table: '표 넣기',
105
+ tableAddRow: '줄 추가',
106
+ tableAddRowAbove: '줄 추가',
107
+ tableAddColumnLeft: '칸 추가',
108
+ tableAddColumn: '칸 추가',
109
+ tableDeleteRow: '줄 삭제',
110
+ tableDeleteColumn: '칸 삭제',
111
+ tableDestroy: '표 지우기',
112
+ error: '에러'
113
+ },
114
+ pt_br: {
115
+ table: 'Inserir tabela',
116
+ tableAddRow: 'Adicionar linha',
117
+ tableAddRowAbove: 'Adicionar linha',
118
+ tableAddColumnLeft: 'Adicionar coluna',
119
+ tableAddColumn: 'Adicionar coluna',
120
+ tableDeleteRow: 'Deletar linha',
121
+ tableDeleteColumn: 'Deletar coluna',
122
+ tableDestroy: 'Deletar tabela',
123
+ error: 'Erro'
80
124
  },
81
125
  ru: {
82
126
  table: 'Вставить таблицу',
@@ -89,13 +133,13 @@
89
133
  tableDestroy: 'Удалить таблицу',
90
134
  error: 'Ошибка'
91
135
  },
92
- ja: {
93
- table: '表の挿入',
94
- tableAddRow: '行の追加',
95
- tableAddRowAbove: '行の追加',
96
- tableAddColumnLeft: '列の追加',
97
- tableAddColumn: '列の追加',
98
- error: 'エラー'
136
+ sk: {
137
+ table: 'Vytvoriť tabuľky',
138
+ tableAddRow: 'Pridať riadok',
139
+ tableAddRowAbove: 'Pridať riadok',
140
+ tableAddColumnLeft: 'Pridať stĺpec',
141
+ tableAddColumn: 'Pridať stĺpec',
142
+ error: 'Chyba'
99
143
  },
100
144
  tr: {
101
145
  table: 'Tablo ekle',
@@ -116,39 +160,6 @@
116
160
  tableDestroy: '刪除表格',
117
161
  error: '錯誤'
118
162
  },
119
- id: {
120
- table: 'Sisipkan tabel',
121
- tableAddRow: 'Sisipkan baris',
122
- tableAddRowAbove: 'Sisipkan baris',
123
- tableAddColumnLeft: 'Sisipkan kolom',
124
- tableAddColumn: 'Sisipkan kolom',
125
- tableDeleteRow: 'Hapus baris',
126
- tableDeleteColumn: 'Hapus kolom',
127
- tableDestroy: 'Hapus tabel',
128
- error: 'Galat'
129
- },
130
- pt_br: {
131
- table: 'Inserir tabela',
132
- tableAddRow: 'Adicionar linha',
133
- tableAddRowAbove: 'Adicionar linha',
134
- tableAddColumnLeft: 'Adicionar coluna',
135
- tableAddColumn: 'Adicionar coluna',
136
- tableDeleteRow: 'Deletar linha',
137
- tableDeleteColumn: 'Deletar coluna',
138
- tableDestroy: 'Deletar tabela',
139
- error: 'Erro'
140
- },
141
- ko: {
142
- table: '표 넣기',
143
- tableAddRow: '줄 추가',
144
- tableAddRowAbove: '줄 추가',
145
- tableAddColumnLeft: '칸 추가',
146
- tableAddColumn: '칸 추가',
147
- tableDeleteRow: '줄 삭제',
148
- tableDeleteColumn: '칸 삭제',
149
- tableDestroy: '표 지우기',
150
- error: '에러'
151
- },
152
163
  // jshint camelcase:true
153
164
  },
154
165
 
@@ -1 +1 @@
1
- !function(e){"use strict";var t={rows:8,columns:8,styler:"table"};e.extend(!0,e.trumbowyg,{langs:{en:{table:"Insert table",tableAddRow:"Add row",tableAddRowAbove:"Add row above",tableAddColumnLeft:"Add column to the left",tableAddColumn:"Add column to the right",tableDeleteRow:"Delete row",tableDeleteColumn:"Delete column",tableDestroy:"Delete table",error:"Error"},da:{table:"Indsæt tabel",tableAddRow:"Tilføj række",tableAddRowAbove:"Tilføj række",tableAddColumnLeft:"Tilføj kolonne",tableAddColumn:"Tilføj kolonne",tableDeleteRow:"Slet række",tableDeleteColumn:"Slet kolonne",tableDestroy:"Slet tabel",error:"Fejl"},de:{table:"Tabelle einfügen",tableAddRow:"Zeile hinzufügen",tableAddRowAbove:"Zeile hinzufügen",tableAddColumnLeft:"Spalte hinzufügen",tableAddColumn:"Spalte hinzufügen",tableDeleteRow:"Zeile löschen",tableDeleteColumn:"Spalte löschen",tableDestroy:"Tabelle löschen",error:"Error"},sk:{table:"Vytvoriť tabuľky",tableAddRow:"Pridať riadok",tableAddRowAbove:"Pridať riadok",tableAddColumnLeft:"Pridať stĺpec",tableAddColumn:"Pridať stĺpec",error:"Chyba"},fr:{table:"Insérer un tableau",tableAddRow:"Ajouter des lignes",tableAddRowAbove:"Ajouter des lignes",tableAddColumnLeft:"Ajouter des colonnes",tableAddColumn:"Ajouter des colonnes",tableDeleteRow:"Effacer la ligne",tableDeleteColumn:"Effacer la colonne",tableDestroy:"Effacer le tableau",error:"Erreur"},cs:{table:"Vytvořit příkaz Table",tableAddRow:"Přidat řádek",tableAddRowAbove:"Přidat řádek",tableAddColumnLeft:"Přidat sloupec",tableAddColumn:"Přidat sloupec",error:"Chyba"},ru:{table:"Вставить таблицу",tableAddRow:"Добавить строку",tableAddRowAbove:"Добавить строку",tableAddColumnLeft:"Добавить столбец",tableAddColumn:"Добавить столбец",tableDeleteRow:"Удалить строку",tableDeleteColumn:"Удалить столбец",tableDestroy:"Удалить таблицу",error:"Ошибка"},ja:{table:"表の挿入",tableAddRow:"行の追加",tableAddRowAbove:"行の追加",tableAddColumnLeft:"列の追加",tableAddColumn:"列の追加",error:"エラー"},tr:{table:"Tablo ekle",tableAddRow:"Satır ekle",tableAddRowAbove:"Satır ekle",tableAddColumnLeft:"Kolon ekle",tableAddColumn:"Kolon ekle",error:"Hata"},zh_tw:{table:"插入表格",tableAddRow:"加入行",tableAddRowAbove:"加入行",tableAddColumnLeft:"加入列",tableAddColumn:"加入列",tableDeleteRow:"刪除行",tableDeleteColumn:"刪除列",tableDestroy:"刪除表格",error:"錯誤"},id:{table:"Sisipkan tabel",tableAddRow:"Sisipkan baris",tableAddRowAbove:"Sisipkan baris",tableAddColumnLeft:"Sisipkan kolom",tableAddColumn:"Sisipkan kolom",tableDeleteRow:"Hapus baris",tableDeleteColumn:"Hapus kolom",tableDestroy:"Hapus tabel",error:"Galat"},pt_br:{table:"Inserir tabela",tableAddRow:"Adicionar linha",tableAddRowAbove:"Adicionar linha",tableAddColumnLeft:"Adicionar coluna",tableAddColumn:"Adicionar coluna",tableDeleteRow:"Deletar linha",tableDeleteColumn:"Deletar coluna",tableDestroy:"Deletar tabela",error:"Erro"},ko:{table:"표 넣기",tableAddRow:"줄 추가",tableAddRowAbove:"줄 추가",tableAddColumnLeft:"칸 추가",tableAddColumn:"칸 추가",tableDeleteRow:"줄 삭제",tableDeleteColumn:"칸 삭제",tableDestroy:"표 지우기",error:"에러"}},plugins:{table:{init:function(l){l.o.plugins.table=e.extend(!0,{},t,l.o.plugins.table||{});var o={fn:function(){l.saveRange();var t="table",o=l.o.prefix+"dropdown",n={"class":o+"-"+t+" "+o+" "+l.o.prefix+"fixed-top"};n["data-"+o]=t;var b=e("<div/>",n);if(0===l.$box.find("."+o+"-"+t).length?l.$box.append(b.hide()):b=l.$box.find("."+o+"-"+t),b.html(""),l.$box.find("."+l.o.prefix+"table-button").hasClass(l.o.prefix+"active-button"))b.append(l.buildSubBtn("tableAddRowAbove")),b.append(l.buildSubBtn("tableAddRow")),b.append(l.buildSubBtn("tableAddColumnLeft")),b.append(l.buildSubBtn("tableAddColumn")),b.append(l.buildSubBtn("tableDeleteRow")),b.append(l.buildSubBtn("tableDeleteColumn")),b.append(l.buildSubBtn("tableDestroy"));else{var r=e("<table/>");e("<tbody/>").appendTo(r);for(var i=0;i<l.o.plugins.table.rows;i+=1)for(var s=e("<tr/>").appendTo(r),u=0;u<l.o.plugins.table.columns;u+=1)e("<td/>").appendTo(s);r.find("td").on("mouseover",a),r.find("td").on("mousedown",d),b.append(r),b.append(e('<div class="trumbowyg-table-size">1x1</div>'))}l.dropdown(t)}},a=function(t){var l=e(t.target),o=l.closest("table"),a=this.cellIndex,d=this.parentNode.rowIndex;o.find("td").removeClass("active");for(var n=0;n<=d;n+=1)for(var b=0;b<=a;b+=1)o.find("tr:nth-of-type("+(n+1)+")").find("td:nth-of-type("+(b+1)+")").addClass("active");o.next(".trumbowyg-table-size").html(a+1+"x"+(d+1))},d=function(){l.saveRange();var t=e("<table/>");e("<tbody/>").appendTo(t),l.o.plugins.table.styler&&t.attr("class",l.o.plugins.table.styler);for(var o=this.cellIndex,a=this.parentNode.rowIndex,d=0;d<=a;d+=1)for(var n=e("<tr></tr>").appendTo(t),b=0;b<=o;b+=1)e("<td/>").appendTo(n);l.range.deleteContents(),l.range.insertNode(t[0]),l.$c.trigger("tbwchange")},n={title:l.lang.tableAddRow,text:l.lang.tableAddRow,ico:"row-below",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("tr"),a=e(t).closest("table");if(a.length>0){for(var d=e("<tr/>"),n=0;n<a.find("tr")[0].childElementCount;n+=1)e("<td/>").appendTo(d);o.after(d)}l.syncCode()}},b={title:l.lang.tableAddRowAbove,text:l.lang.tableAddRowAbove,ico:"row-above",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("tr"),a=e(t).closest("table");if(a.length>0){for(var d=e("<tr/>"),n=0;n<a.find("tr")[0].childElementCount;n+=1)e("<td/>").appendTo(d);o.before(d)}l.syncCode()}},r={title:l.lang.tableAddColumn,text:l.lang.tableAddColumn,ico:"col-right",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("td"),a=e(t).closest("table"),d=o.index();a.length>0&&e(a).find("tr").each(function(){e(e(this).children()[d]).after("<td></td>")}),l.syncCode()}},i={title:l.lang.tableAddColumnLeft,text:l.lang.tableAddColumnLeft,ico:"col-left",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("td"),a=e(t).closest("table"),d=o.index();a.length>0&&e(a).find("tr").each(function(){e(e(this).children()[d]).before("<td></td>")}),l.syncCode()}},s={title:l.lang.tableDestroy,text:l.lang.tableDestroy,ico:"table-delete",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("table");o.remove(),l.syncCode()}},u={title:l.lang.tableDeleteRow,text:l.lang.tableDeleteRow,ico:"row-delete",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("tr");o.remove(),l.syncCode()}},c={title:l.lang.tableDeleteColumn,text:l.lang.tableDeleteColumn,ico:"col-delete",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("table"),a=e(t).closest("td"),d=a.index();e(o).find("tr").each(function(){e(this).find("td:eq("+d+")").remove()}),l.syncCode()}};l.addBtnDef("table",o),l.addBtnDef("tableAddRowAbove",b),l.addBtnDef("tableAddRow",n),l.addBtnDef("tableAddColumnLeft",i),l.addBtnDef("tableAddColumn",r),l.addBtnDef("tableDeleteRow",u),l.addBtnDef("tableDeleteColumn",c),l.addBtnDef("tableDestroy",s)}}}})}(jQuery);
1
+ !function(e){"use strict";var t={rows:8,columns:8,styler:"table"};e.extend(!0,e.trumbowyg,{langs:{en:{table:"Insert table",tableAddRow:"Add row",tableAddRowAbove:"Add row above",tableAddColumnLeft:"Add column to the left",tableAddColumn:"Add column to the right",tableDeleteRow:"Delete row",tableDeleteColumn:"Delete column",tableDestroy:"Delete table",error:"Error"},cs:{table:"Vytvořit příkaz Table",tableAddRow:"Přidat řádek",tableAddRowAbove:"Přidat řádek",tableAddColumnLeft:"Přidat sloupec",tableAddColumn:"Přidat sloupec",error:"Chyba"},da:{table:"Indsæt tabel",tableAddRow:"Tilføj række",tableAddRowAbove:"Tilføj række",tableAddColumnLeft:"Tilføj kolonne",tableAddColumn:"Tilføj kolonne",tableDeleteRow:"Slet række",tableDeleteColumn:"Slet kolonne",tableDestroy:"Slet tabel",error:"Fejl"},de:{table:"Tabelle einfügen",tableAddRow:"Zeile hinzufügen",tableAddRowAbove:"Zeile hinzufügen",tableAddColumnLeft:"Spalte hinzufügen",tableAddColumn:"Spalte hinzufügen",tableDeleteRow:"Zeile löschen",tableDeleteColumn:"Spalte löschen",tableDestroy:"Tabelle löschen",error:"Error"},fr:{table:"Insérer un tableau",tableAddRow:"Ajouter des lignes",tableAddRowAbove:"Ajouter des lignes",tableAddColumnLeft:"Ajouter des colonnes",tableAddColumn:"Ajouter des colonnes",tableDeleteRow:"Effacer la ligne",tableDeleteColumn:"Effacer la colonne",tableDestroy:"Effacer le tableau",error:"Erreur"},hu:{table:"Táblázat beszúrás",tableAddRow:"Sor hozzáadás",tableAddRowAbove:"Sor beszúrás fönt",tableAddColumnLeft:"Sor beszúrás balra",tableAddColumn:"Sor beszúrás jobbra",tableDeleteRow:"Sor törlés",tableDeleteColumn:"Oszlop törlés",tableDestroy:"Táblázat törlés",error:"Hiba"},id:{table:"Sisipkan tabel",tableAddRow:"Sisipkan baris",tableAddRowAbove:"Sisipkan baris",tableAddColumnLeft:"Sisipkan kolom",tableAddColumn:"Sisipkan kolom",tableDeleteRow:"Hapus baris",tableDeleteColumn:"Hapus kolom",tableDestroy:"Hapus tabel",error:"Galat"},ja:{table:"表の挿入",tableAddRow:"行の追加",tableAddRowAbove:"行の追加",tableAddColumnLeft:"列の追加",tableAddColumn:"列の追加",error:"エラー"},ko:{table:" 넣기",tableAddRow:" 추가",tableAddRowAbove:" 추가",tableAddColumnLeft:" 추가",tableAddColumn:" 추가",tableDeleteRow:"줄 삭제",tableDeleteColumn:"칸 삭제",tableDestroy:"표 지우기",error:"에러"},pt_br:{table:"Inserir tabela",tableAddRow:"Adicionar linha",tableAddRowAbove:"Adicionar linha",tableAddColumnLeft:"Adicionar coluna",tableAddColumn:"Adicionar coluna",tableDeleteRow:"Deletar linha",tableDeleteColumn:"Deletar coluna",tableDestroy:"Deletar tabela",error:"Erro"},ru:{table:"Вставить таблицу",tableAddRow:"Добавить строку",tableAddRowAbove:"Добавить строку",tableAddColumnLeft:"Добавить столбец",tableAddColumn:"Добавить столбец",tableDeleteRow:"Удалить строку",tableDeleteColumn:"Удалить столбец",tableDestroy:"Удалить таблицу",error:"Ошибка"},sk:{table:"Vytvoriť tabuľky",tableAddRow:"Pridať riadok",tableAddRowAbove:"Pridať riadok",tableAddColumnLeft:"Pridať stĺpec",tableAddColumn:"Pridať stĺpec",error:"Chyba"},tr:{table:"Tablo ekle",tableAddRow:"Satır ekle",tableAddRowAbove:"Satır ekle",tableAddColumnLeft:"Kolon ekle",tableAddColumn:"Kolon ekle",error:"Hata"},zh_tw:{table:"插入表格",tableAddRow:"加入行",tableAddRowAbove:"加入行",tableAddColumnLeft:"加入列",tableAddColumn:"加入列",tableDeleteRow:"刪除行",tableDeleteColumn:"刪除列",tableDestroy:"刪除表格",error:"錯誤"}},plugins:{table:{init:function(l){l.o.plugins.table=e.extend(!0,{},t,l.o.plugins.table||{});var o={fn:function(){l.saveRange();var t="table",o=l.o.prefix+"dropdown",n={"class":o+"-"+t+" "+o+" "+l.o.prefix+"fixed-top"};n["data-"+o]=t;var b=e("<div/>",n);if(0===l.$box.find("."+o+"-"+t).length?l.$box.append(b.hide()):b=l.$box.find("."+o+"-"+t),b.html(""),l.$box.find("."+l.o.prefix+"table-button").hasClass(l.o.prefix+"active-button"))b.append(l.buildSubBtn("tableAddRowAbove")),b.append(l.buildSubBtn("tableAddRow")),b.append(l.buildSubBtn("tableAddColumnLeft")),b.append(l.buildSubBtn("tableAddColumn")),b.append(l.buildSubBtn("tableDeleteRow")),b.append(l.buildSubBtn("tableDeleteColumn")),b.append(l.buildSubBtn("tableDestroy"));else{var r=e("<table/>");e("<tbody/>").appendTo(r);for(var i=0;i<l.o.plugins.table.rows;i+=1)for(var s=e("<tr/>").appendTo(r),u=0;u<l.o.plugins.table.columns;u+=1)e("<td/>").appendTo(s);r.find("td").on("mouseover",a),r.find("td").on("mousedown",d),b.append(r),b.append(e('<div class="trumbowyg-table-size">1x1</div>'))}l.dropdown(t)}},a=function(t){var l=e(t.target),o=l.closest("table"),a=this.cellIndex,d=this.parentNode.rowIndex;o.find("td").removeClass("active");for(var n=0;n<=d;n+=1)for(var b=0;b<=a;b+=1)o.find("tr:nth-of-type("+(n+1)+")").find("td:nth-of-type("+(b+1)+")").addClass("active");o.next(".trumbowyg-table-size").html(a+1+"x"+(d+1))},d=function(){l.saveRange();var t=e("<table/>");e("<tbody/>").appendTo(t),l.o.plugins.table.styler&&t.attr("class",l.o.plugins.table.styler);for(var o=this.cellIndex,a=this.parentNode.rowIndex,d=0;d<=a;d+=1)for(var n=e("<tr></tr>").appendTo(t),b=0;b<=o;b+=1)e("<td/>").appendTo(n);l.range.deleteContents(),l.range.insertNode(t[0]),l.$c.trigger("tbwchange")},n={title:l.lang.tableAddRow,text:l.lang.tableAddRow,ico:"row-below",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("tr"),a=e(t).closest("table");if(a.length>0){for(var d=e("<tr/>"),n=0;n<a.find("tr")[0].childElementCount;n+=1)e("<td/>").appendTo(d);o.after(d)}l.syncCode()}},b={title:l.lang.tableAddRowAbove,text:l.lang.tableAddRowAbove,ico:"row-above",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("tr"),a=e(t).closest("table");if(a.length>0){for(var d=e("<tr/>"),n=0;n<a.find("tr")[0].childElementCount;n+=1)e("<td/>").appendTo(d);o.before(d)}l.syncCode()}},r={title:l.lang.tableAddColumn,text:l.lang.tableAddColumn,ico:"col-right",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("td"),a=e(t).closest("table"),d=o.index();a.length>0&&e(a).find("tr").each(function(){e(e(this).children()[d]).after("<td></td>")}),l.syncCode()}},i={title:l.lang.tableAddColumnLeft,text:l.lang.tableAddColumnLeft,ico:"col-left",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("td"),a=e(t).closest("table"),d=o.index();a.length>0&&e(a).find("tr").each(function(){e(e(this).children()[d]).before("<td></td>")}),l.syncCode()}},s={title:l.lang.tableDestroy,text:l.lang.tableDestroy,ico:"table-delete",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("table");o.remove(),l.syncCode()}},u={title:l.lang.tableDeleteRow,text:l.lang.tableDeleteRow,ico:"row-delete",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("tr");o.remove(),l.syncCode()}},f={title:l.lang.tableDeleteColumn,text:l.lang.tableDeleteColumn,ico:"col-delete",fn:function(){l.saveRange();var t=l.doc.getSelection().focusNode,o=e(t).closest("table"),a=e(t).closest("td"),d=a.index();e(o).find("tr").each(function(){e(this).find("td:eq("+d+")").remove()}),l.syncCode()}};l.addBtnDef("table",o),l.addBtnDef("tableAddRowAbove",b),l.addBtnDef("tableAddRow",n),l.addBtnDef("tableAddColumnLeft",i),l.addBtnDef("tableAddColumn",r),l.addBtnDef("tableDeleteRow",u),l.addBtnDef("tableDeleteColumn",f),l.addBtnDef("tableDestroy",s)}}}})}(jQuery);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Trumbowyg v2.21.0 - A lightweight WYSIWYG editor
2
+ * Trumbowyg v2.23.0 - A lightweight WYSIWYG editor
3
3
  * Default stylesheet for Trumbowyg editor plugin
4
4
  * ------------------------
5
5
  * @link http://alex-d.github.io/Trumbowyg
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Trumbowyg v2.21.0 - A lightweight WYSIWYG editor
2
+ * Trumbowyg v2.23.0 - A lightweight WYSIWYG editor
3
3
  * Trumbowyg plugin stylesheet
4
4
  * ------------------------
5
5
  * @link http://alex-d.github.io/Trumbowyg
@@ -1,2 +1,2 @@
1
- /** Trumbowyg v2.21.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
1
+ /** Trumbowyg v2.23.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
2
2
  .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}
@@ -17,6 +17,9 @@
17
17
  fr: {
18
18
  template: 'Patron'
19
19
  },
20
+ hu: {
21
+ template: 'Sablon'
22
+ },
20
23
  ja: {
21
24
  template: 'テンプレート'
22
25
  },
@@ -1 +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"},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);
1
+ !function(t){"use strict";function e(e){var a=e.o.plugins.templates,n=[];return t.each(a,function(t,a){e.addBtnDef("template_"+t,{fn:function(){e.html(a.html)},hasIcon:!1,title:a.name}),n.push("template_"+t)}),n}t.extend(!0,t.trumbowyg,{langs:{en:{template:"Template"},da:{template:"Skabelon"},de:{template:"Vorlage"},fr:{template:"Patron"},hu:{template:"Sablon"},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);
@@ -21,7 +21,7 @@
21
21
  headers: {}, // Additional headers
22
22
  xhrFields: {}, // Additional fields
23
23
  urlPropertyName: 'file', // How to get url from the json response (for instance 'url' for {url: ....})
24
- statusPropertyName: 'success', // How to get status from the json response
24
+ statusPropertyName: 'success', // How to get status from the json response
25
25
  success: undefined, // Success callback: function (data, trumbowyg, $modal, values) {}
26
26
  error: undefined, // Error callback: function () {}
27
27
  imageWidthModalEdit: false // Add ability to edit image width
@@ -53,6 +53,11 @@
53
53
  file: 'File',
54
54
  uploadError: 'Error'
55
55
  },
56
+ cs: {
57
+ upload: 'Nahrát obrázek',
58
+ file: 'Soubor',
59
+ uploadError: 'Chyba'
60
+ },
56
61
  da: {
57
62
  upload: 'Upload',
58
63
  file: 'Fil',
@@ -63,55 +68,55 @@
63
68
  file: 'Datei',
64
69
  uploadError: 'Fehler'
65
70
  },
66
- sk: {
67
- upload: 'Nahrať',
68
- file: 'Súbor',
69
- uploadError: 'Chyba'
70
- },
71
71
  fr: {
72
72
  upload: 'Envoi',
73
73
  file: 'Fichier',
74
74
  uploadError: 'Erreur'
75
75
  },
76
- cs: {
77
- upload: 'Nahrát obrázek',
78
- file: 'Soubor',
79
- uploadError: 'Chyba'
80
- },
81
- zh_cn: {
82
- upload: '上传',
83
- file: '文件',
84
- uploadError: '错误'
85
- },
86
- zh_tw: {
87
- upload: '上傳',
88
- file: '文件',
89
- uploadError: '錯誤'
90
- },
91
- ru: {
92
- upload: 'Загрузка',
93
- file: 'Файл',
94
- uploadError: 'Ошибка'
76
+ hu: {
77
+ upload: 'Feltöltés',
78
+ file: 'Fájl',
79
+ uploadError: 'Hiba'
95
80
  },
96
81
  ja: {
97
82
  upload: 'アップロード',
98
83
  file: 'ファイル',
99
84
  uploadError: 'エラー'
100
85
  },
86
+ ko: {
87
+ upload: '그림 올리기',
88
+ file: '파일',
89
+ uploadError: '에러'
90
+ },
101
91
  pt_br: {
102
92
  upload: 'Enviar do local',
103
93
  file: 'Arquivo',
104
94
  uploadError: 'Erro'
105
95
  },
96
+ ru: {
97
+ upload: 'Загрузка',
98
+ file: 'Файл',
99
+ uploadError: 'Ошибка'
100
+ },
101
+ sk: {
102
+ upload: 'Nahrať',
103
+ file: 'Súbor',
104
+ uploadError: 'Chyba'
105
+ },
106
106
  tr: {
107
107
  upload: 'Yükle',
108
108
  file: 'Dosya',
109
109
  uploadError: 'Hata'
110
110
  },
111
- ko: {
112
- upload: '그림 올리기',
113
- file: '파일',
114
- uploadError: '에러'
111
+ zh_cn: {
112
+ upload: '上传',
113
+ file: '文件',
114
+ uploadError: '错误'
115
+ },
116
+ zh_tw: {
117
+ upload: '上傳',
118
+ file: '文件',
119
+ uploadError: '錯誤'
115
120
  },
116
121
  },
117
122
  // jshint camelcase:true
@@ -147,6 +152,9 @@
147
152
  };
148
153
  }
149
154
 
155
+ // Prevent multiple submissions while uploading
156
+ var isUploading = false;
157
+
150
158
  var $modal = trumbowyg.openModalInsert(
151
159
  // Title
152
160
  trumbowyg.lang.upload,
@@ -156,6 +164,11 @@
156
164
 
157
165
  // Callback
158
166
  function (values) {
167
+ if (isUploading) {
168
+ return;
169
+ }
170
+ isUploading = true;
171
+
159
172
  var data = new FormData();
160
173
  data.append(trumbowyg.o.plugins.upload.fileFieldName, file);
161
174
 
@@ -206,7 +219,7 @@
206
219
  trumbowyg.execCmd('insertImage', url, false, true);
207
220
  var $img = $('img[src="' + url + '"]:not([alt])', trumbowyg.$box);
208
221
  $img.attr('alt', values.alt);
209
- if (trumbowyg.o.imageWidthModalEdit && parseInt(values.width) > 0) {
222
+ if (trumbowyg.o.plugins.upload.imageWidthModalEdit && parseInt(values.width) > 0) {
210
223
  $img.attr({
211
224
  width: values.width
212
225
  });
@@ -223,6 +236,8 @@
223
236
  trumbowyg.$c.trigger('tbwuploaderror', [trumbowyg, data]);
224
237
  }
225
238
  }
239
+
240
+ isUploading = false;
226
241
  },
227
242
 
228
243
  error: trumbowyg.o.plugins.upload.error || function () {
@@ -231,6 +246,8 @@
231
246
  trumbowyg.lang.uploadError
232
247
  );
233
248
  trumbowyg.$c.trigger('tbwuploaderror', [trumbowyg]);
249
+
250
+ isUploading = false;
234
251
  }
235
252
  });
236
253
  }
@@ -1 +1 @@
1
- !function(r){"use strict";function e(r,a){var o=a.shift(),l=a;if(null!==r){if(0===l.length)return r[o];if("object"==typeof r)return e(r[o],l)}return r}function a(){if(!r.trumbowyg.addedXhrProgressEvent){var e=r.ajaxSettings.xhr;r.ajaxSetup({xhr:function(){var r=this,a=e();return a&&"object"==typeof a.upload&&void 0!==r.progressUpload&&a.upload.addEventListener("progress",function(e){r.progressUpload(e)},!1),a}}),r.trumbowyg.addedXhrProgressEvent=!0}}var o={serverPath:"",fileFieldName:"fileToUpload",data:[],headers:{},xhrFields:{},urlPropertyName:"file",statusPropertyName:"success",success:void 0,error:void 0,imageWidthModalEdit:!1};a(),r.extend(!0,r.trumbowyg,{langs:{en:{upload:"Upload",file:"File",uploadError:"Error"},da:{upload:"Upload",file:"Fil",uploadError:"Fejl"},de:{upload:"Hochladen",file:"Datei",uploadError:"Fehler"},sk:{upload:"Nahrať",file:"Súbor",uploadError:"Chyba"},fr:{upload:"Envoi",file:"Fichier",uploadError:"Erreur"},cs:{upload:"Nahrát obrázek",file:"Soubor",uploadError:"Chyba"},zh_cn:{upload:"上传",file:"文件",uploadError:"错误"},zh_tw:{upload:"上傳",file:"文件",uploadError:"錯誤"},ru:{upload:"Загрузка",file:"Файл",uploadError:"Ошибка"},ja:{upload:"アップロード",file:"ファイル",uploadError:"エラー"},pt_br:{upload:"Enviar do local",file:"Arquivo",uploadError:"Erro"},tr:{upload:"Yükle",file:"Dosya",uploadError:"Hata"},ko:{upload:"그림 올리기",file:"파일",uploadError:"에러"}},plugins:{upload:{init:function(a){a.o.plugins.upload=r.extend(!0,{},o,a.o.plugins.upload||{});var l={fn:function(){a.saveRange();var o,l=a.o.prefix,t={file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:a.getRangeText()}};a.o.plugins.upload.imageWidthModalEdit&&(t.width={value:""});var d=a.openModalInsert(a.lang.upload,t,function(t){var i=new FormData;i.append(a.o.plugins.upload.fileFieldName,o),a.o.plugins.upload.data.map(function(r){i.append(r.name,r.value)}),r.map(t,function(r,e){"file"!==e&&i.append(e,r)}),0===r("."+l+"progress",d).length&&r("."+l+"modal-title",d).after(r("<div/>",{"class":l+"progress"}).append(r("<div/>",{"class":l+"progress-bar"}))),r.ajax({url:a.o.plugins.upload.serverPath,headers:a.o.plugins.upload.headers,xhrFields:a.o.plugins.upload.xhrFields,type:"POST",data:i,cache:!1,dataType:"json",processData:!1,contentType:!1,progressUpload:function(e){r("."+l+"progress-bar").css("width",Math.round(100*e.loaded/e.total)+"%")},success:function(o){if(a.o.plugins.upload.success)a.o.plugins.upload.success(o,a,d,t);else if(e(o,a.o.plugins.upload.statusPropertyName.split("."))){var l=e(o,a.o.plugins.upload.urlPropertyName.split("."));a.execCmd("insertImage",l,!1,!0);var i=r('img[src="'+l+'"]:not([alt])',a.$box);i.attr("alt",t.alt),a.o.imageWidthModalEdit&&parseInt(t.width)>0&&i.attr({width:t.width}),setTimeout(function(){a.closeModal()},250),a.$c.trigger("tbwuploadsuccess",[a,o,l])}else a.addErrorOnModalField(r("input[type=file]",d),a.lang[o.message]),a.$c.trigger("tbwuploaderror",[a,o])},error:a.o.plugins.upload.error||function(){a.addErrorOnModalField(r("input[type=file]",d),a.lang.uploadError),a.$c.trigger("tbwuploaderror",[a])}})});r("input[type=file]").on("change",function(r){try{o=r.target.files[0]}catch(e){o=r.target.value}})}};a.addBtnDef("upload",l)}}}})}(jQuery);
1
+ !function(r){"use strict";function a(r,e){var o=e.shift(),l=e;if(null!==r){if(0===l.length)return r[o];if("object"==typeof r)return a(r[o],l)}return r}function e(){if(!r.trumbowyg.addedXhrProgressEvent){var a=r.ajaxSettings.xhr;r.ajaxSetup({xhr:function(){var r=this,e=a();return e&&"object"==typeof e.upload&&void 0!==r.progressUpload&&e.upload.addEventListener("progress",function(a){r.progressUpload(a)},!1),e}}),r.trumbowyg.addedXhrProgressEvent=!0}}var o={serverPath:"",fileFieldName:"fileToUpload",data:[],headers:{},xhrFields:{},urlPropertyName:"file",statusPropertyName:"success",success:void 0,error:void 0,imageWidthModalEdit:!1};e(),r.extend(!0,r.trumbowyg,{langs:{en:{upload:"Upload",file:"File",uploadError:"Error"},cs:{upload:"Nahrát obrázek",file:"Soubor",uploadError:"Chyba"},da:{upload:"Upload",file:"Fil",uploadError:"Fejl"},de:{upload:"Hochladen",file:"Datei",uploadError:"Fehler"},fr:{upload:"Envoi",file:"Fichier",uploadError:"Erreur"},hu:{upload:"Feltöltés",file:"Fájl",uploadError:"Hiba"},ja:{upload:"アップロード",file:"ファイル",uploadError:"エラー"},ko:{upload:"그림 올리기",file:"파일",uploadError:"에러"},pt_br:{upload:"Enviar do local",file:"Arquivo",uploadError:"Erro"},ru:{upload:"Загрузка",file:"Файл",uploadError:"Ошибка"},sk:{upload:"Nahrať",file:"Súbor",uploadError:"Chyba"},tr:{upload:"Yükle",file:"Dosya",uploadError:"Hata"},zh_cn:{upload:"上传",file:"文件",uploadError:"错误"},zh_tw:{upload:"上傳",file:"文件",uploadError:"錯誤"}},plugins:{upload:{init:function(e){e.o.plugins.upload=r.extend(!0,{},o,e.o.plugins.upload||{});var l={fn:function(){e.saveRange();var o,l=e.o.prefix,t={file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:e.getRangeText()}};e.o.plugins.upload.imageWidthModalEdit&&(t.width={value:""});var d=!1,i=e.openModalInsert(e.lang.upload,t,function(t){if(!d){d=!0;var u=new FormData;u.append(e.o.plugins.upload.fileFieldName,o),e.o.plugins.upload.data.map(function(r){u.append(r.name,r.value)}),r.map(t,function(r,a){"file"!==a&&u.append(a,r)}),0===r("."+l+"progress",i).length&&r("."+l+"modal-title",i).after(r("<div/>",{"class":l+"progress"}).append(r("<div/>",{"class":l+"progress-bar"}))),r.ajax({url:e.o.plugins.upload.serverPath,headers:e.o.plugins.upload.headers,xhrFields:e.o.plugins.upload.xhrFields,type:"POST",data:u,cache:!1,dataType:"json",processData:!1,contentType:!1,progressUpload:function(a){r("."+l+"progress-bar").css("width",Math.round(100*a.loaded/a.total)+"%")},success:function(o){if(e.o.plugins.upload.success)e.o.plugins.upload.success(o,e,i,t);else if(a(o,e.o.plugins.upload.statusPropertyName.split("."))){var l=a(o,e.o.plugins.upload.urlPropertyName.split("."));e.execCmd("insertImage",l,!1,!0);var u=r('img[src="'+l+'"]:not([alt])',e.$box);u.attr("alt",t.alt),e.o.plugins.upload.imageWidthModalEdit&&parseInt(t.width)>0&&u.attr({width:t.width}),setTimeout(function(){e.closeModal()},250),e.$c.trigger("tbwuploadsuccess",[e,o,l])}else e.addErrorOnModalField(r("input[type=file]",i),e.lang[o.message]),e.$c.trigger("tbwuploaderror",[e,o]);d=!1},error:e.o.plugins.upload.error||function(){e.addErrorOnModalField(r("input[type=file]",i),e.lang.uploadError),e.$c.trigger("tbwuploaderror",[e]),d=!1}})}});r("input[type=file]").on("change",function(r){try{o=r.target.files[0]}catch(a){o=r.target.value}})}};e.addBtnDef("upload",l)}}}})}(jQuery);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Trumbowyg v2.21.0 - A lightweight WYSIWYG editor
2
+ * Trumbowyg v2.23.0 - A lightweight WYSIWYG editor
3
3
  * Trumbowyg core file
4
4
  * ------------------------
5
5
  * @link http://alex-d.github.io/Trumbowyg
@@ -72,6 +72,7 @@ jQuery.trumbowyg = {
72
72
 
73
73
  // SVG Path globally
74
74
  svgPath: null,
75
+ svgAbsoluteUseHref: false,
75
76
 
76
77
  hideButtonTexts: null
77
78
  };
@@ -86,9 +87,10 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
86
87
  autogrow: false,
87
88
  autogrowOnEnter: false,
88
89
  imageWidthModalEdit: false,
90
+ hideButtonTexts: null,
89
91
 
90
92
  prefix: 'trumbowyg-',
91
-
93
+ tagClasses: {},
92
94
  semantic: true,
93
95
  semanticKeepAttributes: false,
94
96
  resetCss: false,
@@ -121,9 +123,12 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
121
123
  // imgDblClickHandler: default is defined in constructor
122
124
 
123
125
  plugins: {},
126
+
124
127
  urlProtocol: false,
125
128
  minimalLinks: false,
126
- defaultLinkTarget: undefined
129
+ defaultLinkTarget: undefined,
130
+
131
+ svgPath: null
127
132
  },
128
133
  writable: false,
129
134
  enumerable: true,
@@ -228,42 +233,48 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
228
233
  // SVG path
229
234
  var svgPathOption = $trumbowyg.svgPath != null ? $trumbowyg.svgPath : options.svgPath;
230
235
  t.hasSvg = svgPathOption !== false;
231
- t.svgPath = !!t.doc.querySelector('base') ? window.location.href.split('#')[0] : '';
232
- if ($('#' + trumbowygIconsId, t.doc).length === 0 && svgPathOption !== false) {
236
+
237
+ if (svgPathOption !== false && ($trumbowyg.svgAbsoluteUseHref || $('#' + trumbowygIconsId, t.doc).length === 0)) {
233
238
  if (svgPathOption == null) {
234
239
  // Hack to get svgPathOption based on trumbowyg.js path
235
- var scriptElements = document.getElementsByTagName('script');
236
- for (var i = 0; i < scriptElements.length; i += 1) {
237
- var source = scriptElements[i].src;
240
+ var $scriptElements = $('script[src]');
241
+ $scriptElements.each(function (i, scriptElement) {
242
+ var source = scriptElement.src;
238
243
  var matches = source.match('trumbowyg(\.min)?\.js');
239
244
  if (matches != null) {
240
245
  svgPathOption = source.substring(0, source.indexOf(matches[0])) + 'ui/icons.svg';
241
246
  }
242
- }
243
- if (svgPathOption == null) {
244
- console.warn('You must define svgPath: https://goo.gl/CfTY9U'); // jshint ignore:line
245
- }
247
+ });
246
248
  }
247
249
 
248
- var div = t.doc.createElement('div');
249
- div.id = trumbowygIconsId;
250
- t.doc.body.insertBefore(div, t.doc.body.childNodes[0]);
251
- $.ajax({
252
- async: true,
253
- type: 'GET',
254
- contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
255
- dataType: 'xml',
256
- crossDomain: true,
257
- url: svgPathOption,
258
- data: null,
259
- beforeSend: null,
260
- complete: null,
261
- success: function (data) {
262
- div.innerHTML = new XMLSerializer().serializeToString(data.documentElement);
263
- }
264
- });
250
+ // Do not merge with previous if block: svgPathOption can be redefined in it.
251
+ // Here we are checking that we find a match
252
+ if (svgPathOption == null) {
253
+ console.warn('You must define svgPath: https://goo.gl/CfTY9U'); // jshint ignore:line
254
+ } else if (!$trumbowyg.svgAbsoluteUseHref) {
255
+ var div = t.doc.createElement('div');
256
+ div.id = trumbowygIconsId;
257
+ t.doc.body.insertBefore(div, t.doc.body.childNodes[0]);
258
+ $.ajax({
259
+ async: true,
260
+ type: 'GET',
261
+ contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
262
+ dataType: 'xml',
263
+ crossDomain: true,
264
+ url: svgPathOption,
265
+ data: null,
266
+ beforeSend: null,
267
+ complete: null,
268
+ success: function (data) {
269
+ div.innerHTML = new XMLSerializer().serializeToString(data.documentElement);
270
+ }
271
+ });
272
+ }
265
273
  }
266
274
 
275
+ var baseHref = !!t.doc.querySelector('base') ? window.location.href.split(/[?#]/)[0] : '';
276
+ t.svgPath = $trumbowyg.svgAbsoluteUseHref ? svgPathOption : baseHref;
277
+
267
278
 
268
279
  /**
269
280
  * When the button is associated to a empty object
@@ -418,7 +429,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
418
429
  }
419
430
  };
420
431
 
421
- // Defaults Options
432
+ // Default Options
422
433
  t.o = $.extend(true, {}, $trumbowyg.defaultOptions, options);
423
434
  if (!t.o.hasOwnProperty('imgDblClickHandler')) {
424
435
  t.o.imgDblClickHandler = t.getDefaultImgDblClickHandler();
@@ -507,7 +518,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
507
518
  return;
508
519
  }
509
520
 
510
- if (typeof(protocol) !== 'string') {
521
+ if (typeof (protocol) !== 'string') {
511
522
  return 'https://';
512
523
  }
513
524
  return protocol.replace('://', '') + '://';
@@ -595,6 +606,11 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
595
606
  t.$ed
596
607
  .on('dblclick', 'img', t.o.imgDblClickHandler)
597
608
  .on('keydown', function (e) {
609
+ // append flags to differentiate Chrome spans
610
+ var keyCode = e.which;
611
+ if (keyCode === 8 || keyCode === 13 || keyCode === 46) {
612
+ t.toggleSpan(true);
613
+ }
598
614
  if ((e.ctrlKey || e.metaKey) && !e.altKey) {
599
615
  ctrl = true;
600
616
  var key = t.keys[String.fromCharCode(e.which).toUpperCase()];
@@ -602,7 +618,8 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
602
618
  try {
603
619
  t.execCmd(key.fn, key.param);
604
620
  return false;
605
- } catch (c) {}
621
+ } catch (c) {
622
+ }
606
623
  } else {
607
624
  if (t.o.tabToIndent && e.key === 'Tab') {
608
625
  try {
@@ -612,7 +629,8 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
612
629
  t.execCmd('indent', true, null);
613
630
  }
614
631
  return false;
615
- } catch (c) {}
632
+ } catch (c) {
633
+ }
616
634
  }
617
635
  }
618
636
  })
@@ -632,6 +650,11 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
632
650
  return;
633
651
  }
634
652
 
653
+ // remove Chrome generated span tags
654
+ if (keyCode === 8 || keyCode === 13 || keyCode === 46) {
655
+ t.toggleSpan();
656
+ }
657
+
635
658
  if ((e.ctrlKey || e.metaKey) && (keyCode === 89 || keyCode === 90)) {
636
659
  t.semanticCode(false, true);
637
660
  t.$c.trigger('tbwchange');
@@ -670,15 +693,14 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
670
693
  if (e.type === 'focus') {
671
694
  t.autogrowOnEnterWasFocused = true;
672
695
  t.autogrowEditorOnEnter();
673
- }
674
- else if (!t.o.autogrow) {
696
+ } else if (!t.o.autogrow) {
675
697
  t.$ed.css({height: t.$ed.css('min-height')});
676
698
  t.$c.trigger('tbwresize');
677
699
  }
678
700
  }
679
701
  })
680
702
  .on('keyup focus', function () {
681
- if (!t.$ta.val().match(/<.*>/)) {
703
+ if (!t.$ta.val().match(/<.*>/) && !t.$ed.html().match(/<.*>/)) {
682
704
  setTimeout(function () {
683
705
  var block = t.isIE ? '<p>' : 'p';
684
706
  t.doc.execCommand('formatBlock', false, block);
@@ -883,8 +905,8 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
883
905
  type: 'button',
884
906
  class: prefix + btnName + '-dropdown-button ' + (btn.class || '') + (btn.ico ? ' ' + prefix + btn.ico + '-button' : ''),
885
907
  html: t.hasSvg && hasIcon ?
886
- '<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' + (btn.text || btn.title || t.lang[btnName] || btnName) :
887
- (btn.text || btn.title || t.lang[btnName] || btnName),
908
+ '<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' + (btn.text || btn.title || t.lang[btnName] || btnName) :
909
+ (btn.text || btn.title || t.lang[btnName] || btnName),
888
910
  title: (btn.key ? '(' + (t.isMac ? 'Cmd' : 'Ctrl') + ' + ' + btn.key + ')' : null),
889
911
  style: btn.style || null,
890
912
  mousedown: function () {
@@ -1072,6 +1094,22 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1072
1094
  }, 0);
1073
1095
  },
1074
1096
 
1097
+ // Remove or add flags to span tags to remove Chrome generated spans
1098
+ toggleSpan: function (addFlag) {
1099
+ var t = this;
1100
+ t.$ed.find('span').each(function () {
1101
+ if (addFlag === true) {
1102
+ $(this).attr('data-tbw-flag', true);
1103
+ } else {
1104
+ if ($(this).attr('data-tbw-flag')) {
1105
+ $(this).removeAttr('data-tbw-flag');
1106
+ } else {
1107
+ $(this).contents().unwrap();
1108
+ }
1109
+ }
1110
+ });
1111
+ },
1112
+
1075
1113
  // Open dropdown when click on a button which open that
1076
1114
  dropdown: function (name) {
1077
1115
  var t = this,
@@ -1162,6 +1200,11 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1162
1200
  t.saveRange();
1163
1201
  t.syncCode(force);
1164
1202
 
1203
+ var restoreRange = true;
1204
+ if (t.range && t.range.collapsed) {
1205
+ restoreRange = false;
1206
+ }
1207
+
1165
1208
  if (t.o.semantic) {
1166
1209
  t.semanticTag('b', t.o.semanticKeepAttributes);
1167
1210
  t.semanticTag('i', t.o.semanticKeepAttributes);
@@ -1197,7 +1240,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1197
1240
  t.$ed.find('p:empty').remove();
1198
1241
  }
1199
1242
 
1200
- if (!keepRange) {
1243
+ if (!keepRange && restoreRange) {
1201
1244
  t.restoreRange();
1202
1245
  }
1203
1246
 
@@ -1205,8 +1248,9 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1205
1248
  }
1206
1249
  },
1207
1250
 
1208
- semanticTag: function (oldTag, copyAttributes) {
1209
- var newTag;
1251
+ semanticTag: function (oldTag, copyAttributes, revert) {
1252
+ var newTag, t = this;
1253
+ var tmpTag = oldTag;
1210
1254
 
1211
1255
  if (this.o.semantic != null && typeof this.o.semantic === 'object' && this.o.semantic.hasOwnProperty(oldTag)) {
1212
1256
  newTag = this.o.semantic[oldTag];
@@ -1216,19 +1260,34 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1216
1260
  return;
1217
1261
  }
1218
1262
 
1263
+ if(revert) {
1264
+ oldTag = newTag;
1265
+ newTag = tmpTag;
1266
+ }
1267
+
1219
1268
  $(oldTag, this.$ed).each(function () {
1269
+ var resetRange = false;
1220
1270
  var $oldTag = $(this);
1221
- if($oldTag.contents().length === 0) {
1271
+ if ($oldTag.contents().length === 0) {
1222
1272
  return false;
1223
1273
  }
1224
1274
 
1225
- $oldTag.wrap('<' + newTag + '/>');
1275
+ if(t.range.startContainer.parentNode && t.range.startContainer.parentNode === this) {
1276
+ resetRange = true;
1277
+ }
1278
+ var $newTag = $('<' + newTag + '/>');
1279
+ $newTag.insertBefore($oldTag);
1226
1280
  if (copyAttributes) {
1227
1281
  $.each($oldTag.prop('attributes'), function () {
1228
- $oldTag.parent().attr(this.name, this.value);
1282
+ $newTag.attr(this.name, this.value);
1229
1283
  });
1230
1284
  }
1231
- $oldTag.contents().unwrap();
1285
+ $newTag.html($oldTag.html());
1286
+ $oldTag.remove();
1287
+ if(resetRange === true) {
1288
+ t.range.selectNodeContents($newTag.get(0));
1289
+ t.range.collapse(false);
1290
+ }
1232
1291
  });
1233
1292
  },
1234
1293
 
@@ -1265,7 +1324,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1265
1324
 
1266
1325
  var options = {
1267
1326
  url: {
1268
- label: 'URL',
1327
+ label: t.lang.linkUrl || 'URL',
1269
1328
  required: true,
1270
1329
  value: url
1271
1330
  },
@@ -1423,6 +1482,10 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1423
1482
  t.$ed.focus();
1424
1483
  }
1425
1484
 
1485
+ if(cmd === 'strikethrough' && t.o.semantic) {
1486
+ t.semanticTag('strike', t.o.semanticKeepAttributes, true); // browsers cannot undo e.g. <del> as they expect <strike>
1487
+ }
1488
+
1426
1489
  try {
1427
1490
  t.doc.execCommand('styleWithCSS', false, forceCss || false);
1428
1491
  } catch (c) {
@@ -1444,6 +1507,19 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1444
1507
 
1445
1508
  t.syncCode();
1446
1509
  t.semanticCode(false, true);
1510
+ try {
1511
+ var listId = window.getSelection().focusNode;
1512
+ if(!$(window.getSelection().focusNode.parentNode).hasClass('trumbowyg-editor')){
1513
+ listId = window.getSelection().focusNode.parentNode;
1514
+ }
1515
+ var classes = t.o.tagClasses[param];
1516
+ if (classes) {
1517
+ $(listId).addClass(classes);
1518
+ }
1519
+ } catch (e) {
1520
+
1521
+ }
1522
+
1447
1523
  }
1448
1524
 
1449
1525
  if (cmd !== 'dropdown') {
@@ -1496,19 +1572,19 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1496
1572
  action: '',
1497
1573
  html: content
1498
1574
  })
1499
- .on('submit', function () {
1500
- $modal.trigger(CONFIRM_EVENT);
1501
- return false;
1502
- })
1503
- .on('reset', function () {
1504
- $modal.trigger(CANCEL_EVENT);
1505
- return false;
1506
- })
1507
- .on('submit reset', function () {
1508
- if (t.o.autogrowOnEnter) {
1509
- t.autogrowOnEnterDontClose = false;
1510
- }
1511
- });
1575
+ .on('submit', function () {
1576
+ $modal.trigger(CONFIRM_EVENT);
1577
+ return false;
1578
+ })
1579
+ .on('reset', function () {
1580
+ $modal.trigger(CANCEL_EVENT);
1581
+ return false;
1582
+ })
1583
+ .on('submit reset', function () {
1584
+ if (t.o.autogrowOnEnter) {
1585
+ t.autogrowOnEnterDontClose = false;
1586
+ }
1587
+ });
1512
1588
  } else {
1513
1589
  formOrContent = content;
1514
1590
  }
@@ -1820,9 +1896,9 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1820
1896
 
1821
1897
  clearButtonPaneStatus: function () {
1822
1898
  var t = this,
1823
- prefix = t.o.prefix,
1824
- activeClasses = prefix + 'active-button ' + prefix + 'active',
1825
- originalIconClass = prefix + 'original-icon';
1899
+ prefix = t.o.prefix,
1900
+ activeClasses = prefix + 'active-button ' + prefix + 'active',
1901
+ originalIconClass = prefix + 'original-icon';
1826
1902
 
1827
1903
  // Reset all buttons and dropdown state
1828
1904
  $('.' + prefix + 'active-button', t.$btnPane).removeClass(activeClasses);
@@ -1860,12 +1936,12 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
1860
1936
  if (t.o.changeActiveDropdownIcon && $btnSvgUse.length > 0) {
1861
1937
  // Save original icon
1862
1938
  $dropdownBtn
1863
- .addClass(originalIconClass)
1864
- .data(originalIconClass, $dropdownBtnSvgUse.attr('xlink:href'));
1939
+ .addClass(originalIconClass)
1940
+ .data(originalIconClass, $dropdownBtnSvgUse.attr('xlink:href'));
1865
1941
 
1866
1942
  // Put the active sub-button's icon
1867
1943
  $dropdownBtnSvgUse
1868
- .attr('xlink:href', $btnSvgUse.attr('xlink:href'));
1944
+ .attr('xlink:href', $btnSvgUse.attr('xlink:href'));
1869
1945
  }
1870
1946
  } catch (e) {
1871
1947
  }