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(o){"use strict";o.extend(!0,o.trumbowyg,{langs:{de:{history:{redo:"Wiederholen",undo:"Rückgängig"}},en:{history:{redo:"Redo",undo:"Undo"}},da:{history:{redo:"Annuller fortryd",undo:"Fortryd"}},fr:{history:{redo:"Annuler",undo:"Rétablir"}},zh_tw:{history:{redo:"重做",undo:"復原"}},pt_br:{history:{redo:"Refazer",undo:"Desfazer"}},ko:{history:{redo:"다시 실행",undo:"되돌리기"}}},plugins:{history:{init:function(i){i.o.plugins.history=o.extend(!0,{_stack:[],_index:-1,_focusEl:void 0},i.o.plugins.history||{});var t={title:i.lang.history.redo,ico:"redo",key:"Y",fn:function(){if(i.o.plugins.history._index<i.o.plugins.history._stack.length-1){i.o.plugins.history._index+=1;var o=i.o.plugins.history._index,t=i.o.plugins.history._stack[o];i.execCmd("html",t),i.o.plugins.history._stack[o]=i.$ed.html(),l(),s()}}},n={title:i.lang.history.undo,ico:"undo",key:"Z",fn:function(){if(i.o.plugins.history._index>0){i.o.plugins.history._index-=1;var o=i.o.plugins.history._index,t=i.o.plugins.history._stack[o];i.execCmd("html",t),i.o.plugins.history._stack[o]=i.$ed.html(),l(),s()}}},e=function(){var t,n,e=i.o.plugins.history._index,r=i.o.plugins.history._stack,l=r.slice(-1)[0]||"<p></p>",u=r[e],h=i.$ed.html(),c=i.doc.getSelection().focusNode,g="",a=i.o.plugins.history._focusEl;t=o("<div>"+l+"</div>").find("*").map(function(){return this.localName}),n=o("<div>"+h+"</div>").find("*").map(function(){return this.localName}),c&&(i.o.plugins.history._focusEl=c,g=c.outerHTML||c.textContent),h!==u&&(g.slice(-1).match(/\s/)||!d(t,n)||i.o.plugins.history._index<=0||c!==a?(i.o.plugins.history._index+=1,i.o.plugins.history._stack=r.slice(0,i.o.plugins.history._index),i.o.plugins.history._stack.push(h)):i.o.plugins.history._stack[e]=h,s())},s=function(){var o=i.o.plugins.history._index,t=i.o.plugins.history._stack.length,n=o>0,e=0!==t&&o!==t-1;r("historyUndo",n),r("historyRedo",e)},r=function(o,t){var n=i.$box.find(".trumbowyg-"+o+"-button");t?n.removeClass("trumbowyg-disable"):n.hasClass("trumbowyg-disable")||n.addClass("trumbowyg-disable")},d=function(o,i){if(o===i)return!0;if(null==o||null==i)return!1;if(o.length!==i.length)return!1;for(var t=0;t<o.length;t+=1)if(o[t]!==i[t])return!1;return!0},l=function(){var o=i.doc.getSelection().focusNode,t=i.doc.createRange();o.childNodes.length>0&&(t.setStartAfter(o.childNodes[o.childNodes.length-1]),t.setEndAfter(o.childNodes[o.childNodes.length-1]),i.doc.getSelection().removeAllRanges(),i.doc.getSelection().addRange(t))};i.$c.on("tbwinit tbwchange",e),i.addBtnDef("historyRedo",t),i.addBtnDef("historyUndo",n)}}}})}(jQuery);
1
+ !function(o){"use strict";o.extend(!0,o.trumbowyg,{langs:{en:{history:{redo:"Redo",undo:"Undo"}},da:{history:{redo:"Annuller fortryd",undo:"Fortryd"}},de:{history:{redo:"Wiederholen",undo:"Rückgängig"}},fr:{history:{redo:"Annuler",undo:"Rétablir"}},hu:{history:{redo:"Visszállít",undo:"Visszavon"}},ko:{history:{redo:"다시 실행",undo:"되돌리기"}},pt_br:{history:{redo:"Refazer",undo:"Desfazer"}},zh_tw:{history:{redo:"重做",undo:"復原"}}},plugins:{history:{init:function(i){i.o.plugins.history=o.extend(!0,{_stack:[],_index:-1,_focusEl:void 0},i.o.plugins.history||{});var t={title:i.lang.history.redo,ico:"redo",key:"Y",fn:function(){if(i.o.plugins.history._index<i.o.plugins.history._stack.length-1){i.o.plugins.history._index+=1;var o=i.o.plugins.history._index,t=i.o.plugins.history._stack[o];i.execCmd("html",t),i.o.plugins.history._stack[o]=i.$ed.html(),l(),e()}}},n={title:i.lang.history.undo,ico:"undo",key:"Z",fn:function(){if(i.o.plugins.history._index>0){i.o.plugins.history._index-=1;var o=i.o.plugins.history._index,t=i.o.plugins.history._stack[o];i.execCmd("html",t),i.o.plugins.history._stack[o]=i.$ed.html(),l(),e()}}},s=function(){var t,n,s=i.o.plugins.history._index,r=i.o.plugins.history._stack,l=r.slice(-1)[0]||"<p></p>",u=r[s],h=i.$ed.html(),c=i.doc.getSelection().focusNode,g="",a=i.o.plugins.history._focusEl;t=o("<div>"+l+"</div>").find("*").map(function(){return this.localName}),n=o("<div>"+h+"</div>").find("*").map(function(){return this.localName}),c&&(i.o.plugins.history._focusEl=c,g=c.outerHTML||c.textContent),h!==u&&(g.slice(-1).match(/\s/)||!d(t,n)||i.o.plugins.history._index<=0||c!==a?(i.o.plugins.history._index+=1,i.o.plugins.history._stack=r.slice(0,i.o.plugins.history._index),i.o.plugins.history._stack.push(h)):i.o.plugins.history._stack[s]=h,e())},e=function(){var o=i.o.plugins.history._index,t=i.o.plugins.history._stack.length,n=o>0,s=0!==t&&o!==t-1;r("historyUndo",n),r("historyRedo",s)},r=function(o,t){var n=i.$box.find(".trumbowyg-"+o+"-button");t?n.removeClass("trumbowyg-disable"):n.hasClass("trumbowyg-disable")||n.addClass("trumbowyg-disable")},d=function(o,i){if(o===i)return!0;if(null==o||null==i)return!1;if(o.length!==i.length)return!1;for(var t=0;t<o.length;t+=1)if(o[t]!==i[t])return!1;return!0},l=function(){var o=i.doc.getSelection().focusNode,t=i.doc.createRange();o.childNodes.length>0&&(t.setStartAfter(o.childNodes[o.childNodes.length-1]),t.setEndAfter(o.childNodes[o.childNodes.length-1]),i.doc.getSelection().removeAllRanges(),i.doc.getSelection().addRange(t))};i.$c.on("tbwinit tbwchange",s),i.addBtnDef("historyRedo",t),i.addBtnDef("historyUndo",n)}}}})}(jQuery);
@@ -0,0 +1,56 @@
1
+
2
+ /* ===========================================================
3
+ * trumbowyg.indent.js v1.0
4
+ * Indent or Outdent plugin for Trumbowyg
5
+ * http://alex-d.github.com/Trumbowyg
6
+ * ===========================================================
7
+ * Author : Fabacks
8
+ * Website : https://github.com/Fabacks
9
+ */
10
+
11
+ (function ($) {
12
+ 'use strict';
13
+
14
+ $.extend(true, $.trumbowyg, {
15
+ langs: {
16
+ en: {
17
+ indent: 'Indent',
18
+ outdent: 'Outdent'
19
+ },
20
+ fr: {
21
+ indent: 'Augmenter le retrait',
22
+ outdent: 'Diminuer le retrait'
23
+ }
24
+ }
25
+ });
26
+
27
+ // Adds the extra button definition
28
+ $.extend(true, $.trumbowyg, {
29
+ plugins: {
30
+ paragraph: {
31
+ init: function (trumbowyg) {
32
+ var indentBtnDef = {
33
+ fn: 'indent',
34
+ title: trumbowyg.lang.indent,
35
+ isSupported: function () {
36
+ return !!document.queryCommandSupported && !!document.queryCommandSupported('indent');
37
+ },
38
+ ico: 'indent'
39
+ };
40
+
41
+ var outdentBtnDef = {
42
+ fn: 'outdent',
43
+ title: trumbowyg.lang.outdent,
44
+ isSupported: function () {
45
+ return !!document.queryCommandSupported && !!document.queryCommandSupported('outdent');
46
+ },
47
+ ico: 'outdent'
48
+ };
49
+
50
+ trumbowyg.addBtnDef('indent', indentBtnDef);
51
+ trumbowyg.addBtnDef('outdent', outdentBtnDef);
52
+ }
53
+ }
54
+ }
55
+ });
56
+ })(jQuery);
@@ -0,0 +1 @@
1
+ !function(t){"use strict";t.extend(!0,t.trumbowyg,{langs:{en:{indent:"Indent",outdent:"Outdent"},fr:{indent:"Augmenter le retrait",outdent:"Diminuer le retrait"}}}),t.extend(!0,t.trumbowyg,{plugins:{paragraph:{init:function(t){var n={fn:"indent",title:t.lang.indent,isSupported:function(){return!!document.queryCommandSupported&&!!document.queryCommandSupported("indent")},ico:"indent"},e={fn:"outdent",title:t.lang.outdent,isSupported:function(){return!!document.queryCommandSupported&&!!document.queryCommandSupported("outdent")},ico:"outdent"};t.addBtnDef("indent",n),t.addBtnDef("outdent",e)}}}})}(jQuery);
@@ -43,20 +43,23 @@
43
43
  fr: {
44
44
  insertAudio: 'Insérer un son'
45
45
  },
46
- ru: {
47
- insertAudio: 'Вставить аудио'
46
+ hu: {
47
+ insertAudio: 'Audio beszúrás'
48
48
  },
49
49
  ja: {
50
50
  insertAudio: '音声の挿入'
51
51
  },
52
- tr: {
53
- insertAudio: 'Ses Ekle'
52
+ ko: {
53
+ insertAudio: '소리 넣기'
54
54
  },
55
55
  pt_br: {
56
56
  insertAudio: 'Inserir áudio'
57
57
  },
58
- ko: {
59
- insertAudio: '소리 넣기'
58
+ ru: {
59
+ insertAudio: 'Вставить аудио'
60
+ },
61
+ tr: {
62
+ insertAudio: 'Ses Ekle'
60
63
  },
61
64
  // jshint camelcase:true
62
65
  },
@@ -1 +1 @@
1
- !function(e){"use strict";var r={src:{label:"URL",required:!0},autoplay:{label:"AutoPlay",required:!1,type:"checkbox"},muted:{label:"Muted",required:!1,type:"checkbox"},preload:{label:"preload options",required:!1}};e.extend(!0,e.trumbowyg,{langs:{en:{insertAudio:"Insert Audio"},da:{insertAudio:"Indsæt lyd"},fr:{insertAudio:"Insérer un son"},ru:{insertAudio:"Вставить аудио"},ja:{insertAudio:"音声の挿入"},tr:{insertAudio:"Ses Ekle"},pt_br:{insertAudio:"Inserir áudio"},ko:{insertAudio:"소리 넣기"}},plugins:{insertAudio:{init:function(n){var t={fn:function(){var t=function(r){var t="<audio controls";r.src&&(t+=" src='"+r.src+"'"),r.autoplay&&(t+=" autoplay"),r.muted&&(t+=" muted"),r.preload&&(t+=" preload='"+r+"'"),t+="></audio>";var i=e(t)[0];return n.range.deleteContents(),n.range.insertNode(i),!0};n.openModalInsert(n.lang.insertAudio,r,t)}};n.addBtnDef("insertAudio",t)}}}})}(jQuery);
1
+ !function(e){"use strict";var r={src:{label:"URL",required:!0},autoplay:{label:"AutoPlay",required:!1,type:"checkbox"},muted:{label:"Muted",required:!1,type:"checkbox"},preload:{label:"preload options",required:!1}};e.extend(!0,e.trumbowyg,{langs:{en:{insertAudio:"Insert Audio"},da:{insertAudio:"Indsæt lyd"},fr:{insertAudio:"Insérer un son"},hu:{insertAudio:"Audio beszúrás"},ja:{insertAudio:"音声の挿入"},ko:{insertAudio:"소리 넣기"},pt_br:{insertAudio:"Inserir áudio"},ru:{insertAudio:"Вставить аудио"},tr:{insertAudio:"Ses Ekle"}},plugins:{insertAudio:{init:function(i){var n={fn:function(){var n=function(r){var n="<audio controls";r.src&&(n+=" src='"+r.src+"'"),r.autoplay&&(n+=" autoplay"),r.muted&&(n+=" muted"),r.preload&&(n+=" preload='"+r+"'"),n+="></audio>";var t=e(n)[0];return i.range.deleteContents(),i.range.insertNode(t),!0};i.openModalInsert(i.lang.insertAudio,r,n)}};i.addBtnDef("insertAudio",n)}}}})}(jQuery);
@@ -31,6 +31,33 @@
31
31
  '2.0': 'Très grande'
32
32
  }
33
33
  },
34
+ hu: {
35
+ lineheight: 'Line height',
36
+ lineheights: {
37
+ '0.9': 'Small',
38
+ 'normal': 'Regular',
39
+ '1.5': 'Large',
40
+ '2.0': 'Extra large'
41
+ }
42
+ },
43
+ it: {
44
+ lineheight: 'Altezza linea',
45
+ lineheights: {
46
+ '0.9': 'Bassa',
47
+ 'normal': 'Normale',
48
+ '1.5': 'Alta',
49
+ '2.0': 'Molto alta'
50
+ }
51
+ },
52
+ ko: {
53
+ lineheight: '줄 간격',
54
+ lineheights: {
55
+ '0.9': '좁게',
56
+ 'normal': '보통',
57
+ '1.5': '넓게',
58
+ '2.0': '아주 넓게'
59
+ }
60
+ },
34
61
  nl: {
35
62
  lineheight: 'Regelhoogte',
36
63
  lineheights: {
@@ -40,6 +67,15 @@
40
67
  '2.0': 'Extra groot'
41
68
  }
42
69
  },
70
+ pt_br: {
71
+ lineheight: 'Altura de linha',
72
+ lineheights: {
73
+ '0.9': 'Pequena',
74
+ 'normal': 'Regular',
75
+ '1.5': 'Grande',
76
+ '2.0': 'Extra grande'
77
+ }
78
+ },
43
79
  tr: {
44
80
  lineheight: 'Satır yüksekliği',
45
81
  lineheights: {
@@ -58,33 +94,6 @@
58
94
  '2.0': '特大'
59
95
  }
60
96
  },
61
- pt_br: {
62
- lineheight: 'Altura de linha',
63
- lineheights: {
64
- '0.9': 'Pequena',
65
- 'normal': 'Regular',
66
- '1.5': 'Grande',
67
- '2.0': 'Extra grande'
68
- }
69
- },
70
- it: {
71
- lineheight: 'Altezza linea',
72
- lineheights: {
73
- '0.9': 'Bassa',
74
- 'normal': 'Normale',
75
- '1.5': 'Alta',
76
- '2.0': 'Molto alta'
77
- }
78
- },
79
- ko: {
80
- lineheight: '줄 간격',
81
- lineheights: {
82
- '0.9': '좁게',
83
- 'normal': '보통',
84
- '1.5': '넓게',
85
- '2.0': '아주 넓게'
86
- }
87
- },
88
97
  }
89
98
  });
90
99
  // jshint camelcase:true
@@ -1 +1 @@
1
- !function(e){"use strict";function n(n){var i=[];return e.each(n.o.plugins.lineheight.sizeList,function(l,a){n.addBtnDef("lineheight_"+a,{text:n.lang.lineheights[a]||a,hasIcon:!1,fn:function(){n.saveRange();var i=n.getRangeText();if(""!==i.replace(/\s/g,""))try{var l=t();e(l).css("lineHeight",a)}catch(h){}}}),i.push("lineheight_"+a)}),i}function t(){var e,n=null;return window.getSelection?(e=window.getSelection(),e.rangeCount&&(n=e.getRangeAt(0).commonAncestorContainer,1!==n.nodeType&&(n=n.parentNode))):(e=document.selection)&&"Control"!==e.type&&(n=e.createRange().parentElement()),n}e.extend(!0,e.trumbowyg,{langs:{en:{lineheight:"Line height",lineheights:{.9:"Small",normal:"Regular",1.5:"Large","2.0":"Extra large"}},da:{lineheight:"Linjehøjde",lineheights:{.9:"Lille",normal:"Normal",1.5:"Stor","2.0":"Ekstra stor"}},fr:{lineheight:"Hauteur de ligne",lineheights:{.9:"Petite",normal:"Normale",1.5:"Grande","2.0":"Très grande"}},nl:{lineheight:"Regelhoogte",lineheights:{.9:"Klein",normal:"Normaal",1.5:"Groot","2.0":"Extra groot"}},tr:{lineheight:"Satır yüksekliği",lineheights:{.9:"Küçük",normal:"Normal",1.5:"Büyük","2.0":"Çok Büyük"}},zh_tw:{lineheight:"文字間距",lineheights:{.9:"",normal:"正常",1.5:"","2.0":"特大"}},pt_br:{lineheight:"Altura de linha",lineheights:{.9:"Pequena",normal:"Regular",1.5:"Grande","2.0":"Extra grande"}},it:{lineheight:"Altezza linea",lineheights:{.9:"Bassa",normal:"Normale",1.5:"Alta","2.0":"Molto alta"}},ko:{lineheight:"줄 간격",lineheights:{.9:"좁게",normal:"보통",1.5:"넓게","2.0":"아주 넓게"}}}});var i={sizeList:["0.9","normal","1.5","2.0"]};e.extend(!0,e.trumbowyg,{plugins:{lineheight:{init:function(t){t.o.plugins.lineheight=e.extend({},i,t.o.plugins.lineheight||{}),t.addBtnDef("lineheight",{dropdown:n(t)})}}}})}(jQuery);
1
+ !function(e){"use strict";function n(n){var i=[];return e.each(n.o.plugins.lineheight.sizeList,function(l,a){n.addBtnDef("lineheight_"+a,{text:n.lang.lineheights[a]||a,hasIcon:!1,fn:function(){n.saveRange();var i=n.getRangeText();if(""!==i.replace(/\s/g,""))try{var l=t();e(l).css("lineHeight",a)}catch(h){}}}),i.push("lineheight_"+a)}),i}function t(){var e,n=null;return window.getSelection?(e=window.getSelection(),e.rangeCount&&(n=e.getRangeAt(0).commonAncestorContainer,1!==n.nodeType&&(n=n.parentNode))):(e=document.selection)&&"Control"!==e.type&&(n=e.createRange().parentElement()),n}e.extend(!0,e.trumbowyg,{langs:{en:{lineheight:"Line height",lineheights:{.9:"Small",normal:"Regular",1.5:"Large","2.0":"Extra large"}},da:{lineheight:"Linjehøjde",lineheights:{.9:"Lille",normal:"Normal",1.5:"Stor","2.0":"Ekstra stor"}},fr:{lineheight:"Hauteur de ligne",lineheights:{.9:"Petite",normal:"Normale",1.5:"Grande","2.0":"Très grande"}},hu:{lineheight:"Line height",lineheights:{.9:"Small",normal:"Regular",1.5:"Large","2.0":"Extra large"}},it:{lineheight:"Altezza linea",lineheights:{.9:"Bassa",normal:"Normale",1.5:"Alta","2.0":"Molto alta"}},ko:{lineheight:"줄 간격",lineheights:{.9:"좁게",normal:"보통",1.5:"넓게","2.0":"아주 넓게"}},nl:{lineheight:"Regelhoogte",lineheights:{.9:"Klein",normal:"Normaal",1.5:"Groot","2.0":"Extra groot"}},pt_br:{lineheight:"Altura de linha",lineheights:{.9:"Pequena",normal:"Regular",1.5:"Grande","2.0":"Extra grande"}},tr:{lineheight:"Satır yüksekliği",lineheights:{.9:"Küçük",normal:"Normal",1.5:"Büyük","2.0":"Çok Büyük"}},zh_tw:{lineheight:"文字間距",lineheights:{.9:"",normal:"正常",1.5:"","2.0":"特大"}}}});var i={sizeList:["0.9","normal","1.5","2.0"]};e.extend(!0,e.trumbowyg,{plugins:{lineheight:{init:function(t){t.o.plugins.lineheight=e.extend({},i,t.o.plugins.lineheight||{}),t.addBtnDef("lineheight",{dropdown:n(t)})}}}})}(jQuery);
@@ -27,6 +27,21 @@
27
27
  formulas: 'Formule',
28
28
  inline: 'En ligne'
29
29
  },
30
+ hu: {
31
+ mathml: 'Formulák beszúrás',
32
+ formulas: 'Formulák',
33
+ inline: 'Inline'
34
+ },
35
+ ko: {
36
+ mathml: '수식 넣기',
37
+ formulas: '수식',
38
+ inline: '글 안에 넣기'
39
+ },
40
+ pt_br: {
41
+ mathml: 'Inserir fórmulas',
42
+ formulas: 'Fórmulas',
43
+ inline: 'Em linha'
44
+ },
30
45
  tr: {
31
46
  mathml: 'Formül Ekle',
32
47
  formulas: 'Formüller',
@@ -37,16 +52,6 @@
37
52
  formulas: '方程式',
38
53
  inline: '內嵌'
39
54
  },
40
- pt_br: {
41
- mathml: 'Inserir fórmulas',
42
- formulas: 'Fórmulas',
43
- inline: 'Em linha'
44
- },
45
- ko: {
46
- mathml: '수식 넣기',
47
- formulas: '수식',
48
- inline: '글 안에 넣기'
49
- },
50
55
  },
51
56
  // jshint camelcase:true
52
57
 
@@ -1 +1 @@
1
- !function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{mathml:"Insert Formulas",formulas:"Formulas",inline:"Inline"},da:{mathml:"Indsæt formler",formulas:"Formler",inline:"Inline"},fr:{mathml:"Inserer une formule",formulas:"Formule",inline:"En ligne"},tr:{mathml:"Formül Ekle",formulas:"Formüller",inline:"Satır içi"},zh_tw:{mathml:"插入方程式",formulas:"方程式",inline:"內嵌"},pt_br:{mathml:"Inserir fórmulas",formulas:"Fórmulas",inline:"Em linha"},ko:{mathml:"수식 넣기",formulas:"수식",inline:" 안에 넣기"}},plugins:{mathml:{init:function(n){var l={fn:function(){n.saveRange();var l={formulas:{label:n.lang.formulas,required:!0,value:""},inline:{label:n.lang.inline,attributes:{checked:!0},type:"checkbox",required:!1}},a=function(t){var r=t.inline?"$":"$$";if(n.currentMathNode)e(n.currentMathNode).html(r+" "+t.formulas+" "+r).attr("formulas",t.formulas).attr("inline",t.inline?"true":"false");else{var i='<span class="mathMlContainer" contenteditable="false" formulas="'+t.formulas+'" inline="'+(t.inline?"true":"false")+'" >'+r+" "+t.formulas+" "+r+"</span>",u=e(i)[0];u.onclick=function(){n.currentMathNode=this,l.formulas.value=e(this).attr("formulas"),"true"===e(this).attr("inline")?l.inline.attributes.checked=!0:delete l.inline.attributes.checked,n.openModalInsert(n.lang.mathml,l,a)},n.range.deleteContents(),n.range.insertNode(u)}return n.currentMathNode=!1,MathJax.Hub.Queue(["Typeset",MathJax.Hub]),!0};l.formulas.value=n.getRangeText(),l.inline.attributes.checked=!0,n.openModalInsert(n.lang.mathml,l,a)}};n.addBtnDef("mathml",l)}}}})}(jQuery);
1
+ !function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{mathml:"Insert Formulas",formulas:"Formulas",inline:"Inline"},da:{mathml:"Indsæt formler",formulas:"Formler",inline:"Inline"},fr:{mathml:"Inserer une formule",formulas:"Formule",inline:"En ligne"},hu:{mathml:"Formulák beszúrás",formulas:"Formulák",inline:"Inline"},ko:{mathml:"수식 넣기",formulas:"수식",inline:"글 안에 넣기"},pt_br:{mathml:"Inserir fórmulas",formulas:"Fórmulas",inline:"Em linha"},tr:{mathml:"Formül Ekle",formulas:"Formüller",inline:"Satır içi"},zh_tw:{mathml:"插入方程式",formulas:"方程式",inline:"內嵌"}},plugins:{mathml:{init:function(n){var l={fn:function(){n.saveRange();var l={formulas:{label:n.lang.formulas,required:!0,value:""},inline:{label:n.lang.inline,attributes:{checked:!0},type:"checkbox",required:!1}},a=function(t){var r=t.inline?"$":"$$";if(n.currentMathNode)e(n.currentMathNode).html(r+" "+t.formulas+" "+r).attr("formulas",t.formulas).attr("inline",t.inline?"true":"false");else{var i='<span class="mathMlContainer" contenteditable="false" formulas="'+t.formulas+'" inline="'+(t.inline?"true":"false")+'" >'+r+" "+t.formulas+" "+r+"</span>",m=e(i)[0];m.onclick=function(){n.currentMathNode=this,l.formulas.value=e(this).attr("formulas"),"true"===e(this).attr("inline")?l.inline.attributes.checked=!0:delete l.inline.attributes.checked,n.openModalInsert(n.lang.mathml,l,a)},n.range.deleteContents(),n.range.insertNode(m)}return n.currentMathNode=!1,MathJax.Hub.Queue(["Typeset",MathJax.Hub]),!0};l.formulas.value=n.getRangeText(),l.inline.attributes.checked=!0,n.openModalInsert(n.lang.mathml,l,a)}};n.addBtnDef("mathml",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
  * 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
  .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}
@@ -29,6 +29,15 @@
29
29
  fr: {
30
30
  mention: 'Mentionner'
31
31
  },
32
+ hu: {
33
+ mention: 'Említ'
34
+ },
35
+ ko: {
36
+ mention: '언급'
37
+ },
38
+ pt_br: {
39
+ mention: 'Menção'
40
+ },
32
41
  ru: {
33
42
  mention: 'Упомянуть'
34
43
  },
@@ -38,12 +47,6 @@
38
47
  zh_tw: {
39
48
  mention: '標記'
40
49
  },
41
- pt_br: {
42
- mention: 'Menção'
43
- },
44
- ko: {
45
- mention: '언급'
46
- },
47
50
  // jshint camelcase:true
48
51
  },
49
52
 
@@ -1 +1 @@
1
- !function(n){"use strict";function t(t,o){var e=[];return n.each(t,function(n,t){var i="mention-"+n,r={hasIcon:!1,text:o.o.plugins.mention.formatDropdownItem(t),fn:function(){return o.execCmd("insertHTML",o.o.plugins.mention.formatResult(t)),!0}};o.addBtnDef(i,r),e.push(i)}),e}function o(n){return n.login}function e(n){return"@"+n.login+" "}var i={source:[],formatDropdownItem:o,formatResult:e};n.extend(!0,n.trumbowyg,{langs:{en:{mention:"Mention"},da:{mention:"Nævn"},fr:{mention:"Mentionner"},ru:{mention:"Упомянуть"},tr:{mention:"Bahset"},zh_tw:{mention:"標記"},pt_br:{mention:"Menção"},ko:{mention:"언급"}},plugins:{mention:{init:function(o){o.o.plugins.mention=n.extend(!0,{},i,o.o.plugins.mention||{});var e={dropdown:t(o.o.plugins.mention.source,o)};o.addBtnDef("mention",e)}}}})}(jQuery);
1
+ !function(n){"use strict";function t(t,o){var e=[];return n.each(t,function(n,t){var i="mention-"+n,r={hasIcon:!1,text:o.o.plugins.mention.formatDropdownItem(t),fn:function(){return o.execCmd("insertHTML",o.o.plugins.mention.formatResult(t)),!0}};o.addBtnDef(i,r),e.push(i)}),e}function o(n){return n.login}function e(n){return"@"+n.login+" "}var i={source:[],formatDropdownItem:o,formatResult:e};n.extend(!0,n.trumbowyg,{langs:{en:{mention:"Mention"},da:{mention:"Nævn"},fr:{mention:"Mentionner"},hu:{mention:"Említ"},ko:{mention:"언급"},pt_br:{mention:"Menção"},ru:{mention:"Упомянуть"},tr:{mention:"Bahset"},zh_tw:{mention:"標記"}},plugins:{mention:{init:function(o){o.o.plugins.mention=n.extend(!0,{},i,o.o.plugins.mention||{});var e={dropdown:t(o.o.plugins.mention.source,o)};o.addBtnDef("mention",e)}}}})}(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-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}
@@ -24,23 +24,35 @@
24
24
  noembed: 'Noembed',
25
25
  noembedError: 'Error'
26
26
  },
27
+ cs: {
28
+ noembedError: 'Chyba'
29
+ },
27
30
  da: {
28
31
  noembedError: 'Fejl'
29
32
  },
30
- sk: {
31
- noembedError: 'Chyba'
32
- },
33
33
  fr: {
34
34
  noembedError: 'Erreur'
35
35
  },
36
- cs: {
37
- noembedError: 'Chyba'
36
+ hu: {
37
+ noembed: 'Noembed',
38
+ noembedError: 'Hiba'
39
+ },
40
+ ja: {
41
+ noembedError: 'エラー'
42
+ },
43
+ ko: {
44
+ noembed: 'oEmbed 넣기',
45
+ noembedError: '에러'
46
+ },
47
+ pt_br: {
48
+ noembed: 'Incorporar',
49
+ noembedError: 'Erro'
38
50
  },
39
51
  ru: {
40
52
  noembedError: 'Ошибка'
41
53
  },
42
- ja: {
43
- noembedError: 'エラー'
54
+ sk: {
55
+ noembedError: 'Chyba'
44
56
  },
45
57
  tr: {
46
58
  noembedError: 'Hata'
@@ -49,14 +61,6 @@
49
61
  noembed: '插入影片',
50
62
  noembedError: '錯誤'
51
63
  },
52
- pt_br: {
53
- noembed: 'Incorporar',
54
- noembedError: 'Erro'
55
- },
56
- ko: {
57
- noembed: 'oEmbed 넣기',
58
- noembedError: '에러'
59
- },
60
64
  // jshint camelcase:true
61
65
  },
62
66
 
@@ -1 +1 @@
1
- !function(e){"use strict";var r={proxy:"https://noembed.com/embed?nowrap=on",urlFiled:"url",data:[],success:void 0,error:void 0};e.extend(!0,e.trumbowyg,{langs:{en:{noembed:"Noembed",noembedError:"Error"},da:{noembedError:"Fejl"},sk:{noembedError:"Chyba"},fr:{noembedError:"Erreur"},cs:{noembedError:"Chyba"},ru:{noembedError:"Ошибка"},ja:{noembedError:"エラー"},tr:{noembedError:"Hata"},zh_tw:{noembed:"插入影片",noembedError:"錯誤"},pt_br:{noembed:"Incorporar",noembedError:"Erro"},ko:{noembed:"oEmbed 넣기",noembedError:"에러"}},plugins:{noembed:{init:function(o){o.o.plugins.noembed=e.extend(!0,{},r,o.o.plugins.noembed||{});var n={fn:function(){var r=o.openModalInsert(o.lang.noembed,{url:{label:"URL",required:!0}},function(n){e.ajax({url:o.o.plugins.noembed.proxy,type:"GET",data:n,cache:!1,dataType:"json",success:o.o.plugins.noembed.success||function(n){n.html?(o.execCmd("insertHTML",n.html),setTimeout(function(){o.closeModal()},250)):o.addErrorOnModalField(e("input[type=text]",r),n.error)},error:o.o.plugins.noembed.error||function(){o.addErrorOnModalField(e("input[type=text]",r),o.lang.noembedError)}})})}};o.addBtnDef("noembed",n)}}}})}(jQuery);
1
+ !function(e){"use strict";var r={proxy:"https://noembed.com/embed?nowrap=on",urlFiled:"url",data:[],success:void 0,error:void 0};e.extend(!0,e.trumbowyg,{langs:{en:{noembed:"Noembed",noembedError:"Error"},cs:{noembedError:"Chyba"},da:{noembedError:"Fejl"},fr:{noembedError:"Erreur"},hu:{noembed:"Noembed",noembedError:"Hiba"},ja:{noembedError:"エラー"},ko:{noembed:"oEmbed 넣기",noembedError:"에러"},pt_br:{noembed:"Incorporar",noembedError:"Erro"},ru:{noembedError:"Ошибка"},sk:{noembedError:"Chyba"},tr:{noembedError:"Hata"},zh_tw:{noembed:"插入影片",noembedError:"錯誤"}},plugins:{noembed:{init:function(o){o.o.plugins.noembed=e.extend(!0,{},r,o.o.plugins.noembed||{});var n={fn:function(){var r=o.openModalInsert(o.lang.noembed,{url:{label:"URL",required:!0}},function(n){e.ajax({url:o.o.plugins.noembed.proxy,type:"GET",data:n,cache:!1,dataType:"json",success:o.o.plugins.noembed.success||function(n){n.html?(o.execCmd("insertHTML",n.html),setTimeout(function(){o.closeModal()},250)):o.addErrorOnModalField(e("input[type=text]",r),n.error)},error:o.o.plugins.noembed.error||function(){o.addErrorOnModalField(e("input[type=text]",r),o.lang.noembedError)}})})}};o.addBtnDef("noembed",n)}}}})}(jQuery);
@@ -22,30 +22,33 @@
22
22
  fr: {
23
23
  preformatted: 'Exemple de code <pre>'
24
24
  },
25
+ hu: {
26
+ preformatted: 'Kód minta <pre>'
27
+ },
25
28
  it: {
26
29
  preformatted: 'Codice <pre>'
27
30
  },
28
- zh_cn: {
29
- preformatted: '代码示例 <pre>'
31
+ ja: {
32
+ preformatted: 'コードサンプル <pre>'
33
+ },
34
+ ko: {
35
+ preformatted: '코드 예제 <pre>'
36
+ },
37
+ pt_br: {
38
+ preformatted: 'Exemple de código <pre>'
30
39
  },
31
40
  ru: {
32
41
  preformatted: 'Пример кода <pre>'
33
42
  },
34
- ja: {
35
- preformatted: 'コードサンプル <pre>'
36
- },
37
43
  tr: {
38
44
  preformatted: 'Kod örneği <pre>'
39
45
  },
46
+ zh_cn: {
47
+ preformatted: '代码示例 <pre>'
48
+ },
40
49
  zh_tw: {
41
50
  preformatted: '代碼範例 <pre>'
42
51
  },
43
- pt_br: {
44
- preformatted: 'Exemple de código <pre>'
45
- },
46
- ko: {
47
- preformatted: '코드 예제 <pre>'
48
- },
49
52
  },
50
53
  // jshint camelcase:true
51
54
 
@@ -1 +1 @@
1
- !function(e){"use strict";function t(){var e,t=null;return window.getSelection?(e=window.getSelection(),e.rangeCount&&(t=e.getRangeAt(0).commonAncestorContainer,1!==t.nodeType&&(t=t.parentNode))):(e=document.selection)&&"Control"!==e.type&&(t=e.createRange().parentElement()),t}function r(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}function n(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var r=window.getSelection();r.rangeCount>0&&(t=r.getRangeAt(0).startContainer.parentNode)}var n=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;n&&o?e(t).contents().unwrap("code").unwrap("pre"):n?e(t).contents().unwrap("pre"):o&&e(t).contents().unwrap("code")}e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample <pre>"},da:{preformatted:"Præformateret <pre>"},fr:{preformatted:"Exemple de code <pre>"},it:{preformatted:"Codice <pre>"},zh_cn:{preformatted:"代码示例 <pre>"},ru:{preformatted:"Пример кода <pre>"},ja:{preformatted:"コードサンプル <pre>"},tr:{preformatted:"Kod örneği <pre>"},zh_tw:{preformatted:"代碼範例 <pre>"},pt_br:{preformatted:"Exemple de código <pre>"},ko:{preformatted:"코드 예제 <pre>"}},plugins:{preformatted:{init:function(e){var o={fn:function(){e.saveRange();var o=e.getRangeText();if(""!==o.replace(/\s/g,""))try{var a=t().tagName.toLowerCase();if("code"===a||"pre"===a)return n();e.execCmd("insertHTML","<pre><code>"+r(o)+"</code></pre>")}catch(p){}},tag:"pre"};e.addBtnDef("preformatted",o)}}}})}(jQuery);
1
+ !function(e){"use strict";function t(){var e,t=null;return window.getSelection?(e=window.getSelection(),e.rangeCount&&(t=e.getRangeAt(0).commonAncestorContainer,1!==t.nodeType&&(t=t.parentNode))):(e=document.selection)&&"Control"!==e.type&&(t=e.createRange().parentElement()),t}function r(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}function n(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var r=window.getSelection();r.rangeCount>0&&(t=r.getRangeAt(0).startContainer.parentNode)}var n=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;n&&o?e(t).contents().unwrap("code").unwrap("pre"):n?e(t).contents().unwrap("pre"):o&&e(t).contents().unwrap("code")}e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample <pre>"},da:{preformatted:"Præformateret <pre>"},fr:{preformatted:"Exemple de code <pre>"},hu:{preformatted:"Kód minta <pre>"},it:{preformatted:"Codice <pre>"},ja:{preformatted:"コードサンプル <pre>"},ko:{preformatted:"코드 예제 <pre>"},pt_br:{preformatted:"Exemple de código <pre>"},ru:{preformatted:"Пример кода <pre>"},tr:{preformatted:"Kod örneği <pre>"},zh_cn:{preformatted:"代码示例 <pre>"},zh_tw:{preformatted:"代碼範例 <pre>"}},plugins:{preformatted:{init:function(e){var o={fn:function(){e.saveRange();var o=e.getRangeText();if(""!==o.replace(/\s/g,""))try{var a=t().tagName.toLowerCase();if("code"===a||"pre"===a)return n();e.execCmd("insertHTML","<pre><code>"+r(o)+"</code></pre>")}catch(p){}},tag:"pre"};e.addBtnDef("preformatted",o)}}}})}(jQuery);
@@ -1,4 +1,4 @@
1
- ;(function ($) {
1
+ ; (function ($) {
2
2
  'use strict';
3
3
 
4
4
  var defaultOptions = {
@@ -11,7 +11,7 @@
11
11
  e.preventDefault();
12
12
  }
13
13
 
14
- var ResizeWithCanvas = function () {
14
+ var ResizeWithCanvas = function (trumbowyg) {
15
15
  // variable to create canvas and save img in resize mode
16
16
  this.resizeCanvas = document.createElement('canvas');
17
17
  // to allow canvas to get focus
@@ -24,8 +24,13 @@
24
24
  obj.reset();
25
25
  };
26
26
  this.pressBackspaceOrDelete = function (obj) {
27
- $(obj.resizeCanvas).replaceWith('');
27
+ $(obj.resizeCanvas).remove();
28
28
  obj.resizeImg = null;
29
+ if (trumbowyg !== null){
30
+ trumbowyg.syncCode();
31
+ // notify changes
32
+ trumbowyg.$c.trigger('tbwchange');
33
+ }
29
34
  };
30
35
 
31
36
  // PRIVATE FUNCTION
@@ -40,15 +45,6 @@
40
45
  offsetY = BB.top;
41
46
  };
42
47
 
43
- var drawRect = function (shapeData, ctx) {
44
- // Inner
45
- ctx.beginPath();
46
- ctx.fillStyle = 'rgb(255, 255, 255)';
47
- ctx.rect(shapeData.points.x, shapeData.points.y, shapeData.points.width, shapeData.points.height);
48
- ctx.fill();
49
- ctx.stroke();
50
- };
51
-
52
48
  var updateCanvas = function (canvas, ctx, img, canvasWidth, canvasHeight) {
53
49
  ctx.translate(0.5, 0.5);
54
50
  ctx.lineWidth = 1;
@@ -109,10 +105,8 @@
109
105
  return;
110
106
  }
111
107
 
112
- this.resizeImg.width = this.resizeCanvas.clientWidth - 10;
113
- this.resizeImg.height = this.resizeCanvas.clientHeight - 10;
114
- // clear style of image to avoid issue on resize because this attribute have priority over width and height attribute
115
- this.resizeImg.removeAttribute('style');
108
+ // set style of image to avoid issue on resize because this attribute have priority over width and height attribute
109
+ this.resizeImg.setAttribute('style', 'width: 100%; max-width: ' + (this.resizeCanvas.clientWidth - 10) + 'px; height: auto; max-height: ' + (this.resizeCanvas.clientHeight - 10) + 'px;');
116
110
 
117
111
  $(this.resizeCanvas).replaceWith($(this.resizeImg));
118
112
 
@@ -172,7 +166,16 @@
172
166
  _this.pressBackspaceOrDelete(_this);
173
167
  }
174
168
  })
175
- .on('focus', preventDefault);
169
+ .on('focus', preventDefault)
170
+ .on('blur', function () {
171
+ _this.reset();
172
+ // save changes
173
+ if (trumbowyg !== null){
174
+ trumbowyg.syncCode();
175
+ // notify changes
176
+ trumbowyg.$c.trigger('tbwchange');
177
+ }
178
+ });
176
179
 
177
180
  this.resizeCanvas.focus();
178
181
 
@@ -191,25 +194,28 @@
191
194
  };
192
195
  };
193
196
 
194
- // object to interact with canvas
195
- var resizeWithCanvas = new ResizeWithCanvas();
196
-
197
- function destroyResizable(trumbowyg) {
198
- // clean html code
199
- trumbowyg.$ed.find('canvas.resizable')
200
- .resizable('destroy')
201
- .off('mousedown', preventDefault)
202
- .removeClass('resizable');
203
-
204
- resizeWithCanvas.reset();
205
-
206
- trumbowyg.syncCode();
207
- }
208
-
209
197
  $.extend(true, $.trumbowyg, {
210
198
  plugins: {
211
199
  resizimg: {
200
+ destroyResizable: function () {},
212
201
  init: function (trumbowyg) {
202
+ var destroyResizable = this.destroyResizable;
203
+
204
+ // object to interact with canvas
205
+ var resizeWithCanvas = new ResizeWithCanvas(trumbowyg);
206
+
207
+ this.destroyResizable = function () {
208
+ // clean html code
209
+ trumbowyg.$ed.find('canvas.resizable')
210
+ .resizable('destroy')
211
+ .off('mousedown', preventDefault)
212
+ .removeClass('resizable');
213
+
214
+ resizeWithCanvas.reset();
215
+
216
+ trumbowyg.syncCode();
217
+ };
218
+
213
219
  trumbowyg.o.plugins.resizimg = $.extend(true, {},
214
220
  defaultOptions,
215
221
  trumbowyg.o.plugins.resizimg || {},
@@ -269,8 +275,9 @@
269
275
 
270
276
  preventDefault(e);
271
277
  resizeWithCanvas.reset();
272
-
273
- // save changes
278
+ //sync
279
+ trumbowyg.syncCode();
280
+ // notify changes
274
281
  trumbowyg.$c.trigger('tbwchange');
275
282
  });
276
283
 
@@ -286,16 +293,17 @@
286
293
 
287
294
  // Destroy
288
295
  trumbowyg.$c.on('tbwblur', function () {
289
- // if I have already focused the canvas avoid destroy
296
+ // when canvas is created the tbwblur is called
297
+ // this code avoid to destroy the canvas that allow the image resizing
290
298
  if (resizeWithCanvas.isFocusedNow()) {
291
299
  resizeWithCanvas.blurNow();
292
300
  } else {
293
- destroyResizable(trumbowyg);
301
+ destroyResizable();
294
302
  }
295
303
  });
296
304
  },
297
- destroy: function (trumbowyg) {
298
- destroyResizable(trumbowyg);
305
+ destroy: function () {
306
+ this.destroyResizable();
299
307
  }
300
308
  }
301
309
  }