activeadmin_trumbowyg 0.1.3 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/app/assets/fonts/active_admin-trumbowyg.svg +1 -1
  4. data/app/assets/javascripts/activeadmin/trumbowyg/langs/da.min.js +1 -1
  5. data/app/assets/javascripts/activeadmin/trumbowyg/langs/de.min.js +1 -1
  6. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fa.min.js +1 -1
  7. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fr.min.js +3 -1
  8. data/app/assets/javascripts/activeadmin/trumbowyg/langs/lt.min.js +8 -0
  9. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sq.min.js +8 -0
  10. data/app/assets/javascripts/activeadmin/trumbowyg/langs/th.min.js +9 -0
  11. data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_tw.min.js +1 -1
  12. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js +143 -0
  13. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js +1 -0
  14. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +21 -1
  15. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +1 -1
  16. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +23 -90
  17. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +1 -1
  18. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +24 -2
  19. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +1 -1
  20. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +1 -1
  21. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +1 -1
  22. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +1 -1
  23. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +1190 -876
  24. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +1 -1
  25. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +1 -1
  26. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +1 -1
  27. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +1 -1
  28. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js +82 -0
  29. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js +1 -0
  30. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js +160 -0
  31. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js +1 -0
  32. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.js +82 -0
  33. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js +1 -0
  34. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss +25 -0
  35. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css +20 -0
  36. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css +2 -0
  37. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.js +202 -0
  38. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.min.js +1 -0
  39. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +10 -1
  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 +122 -0
  42. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.min.js +1 -0
  43. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.js +98 -0
  44. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.min.js +1 -0
  45. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/sass/trumbowyg.mathml.scss +36 -0
  46. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.css +29 -0
  47. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.min.css +2 -0
  48. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.js +111 -0
  49. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.min.js +1 -0
  50. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/sass/trumbowyg.mention.scss +39 -0
  51. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.css +32 -0
  52. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.min.css +2 -0
  53. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +12 -2
  54. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +1 -1
  55. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.js +96 -0
  56. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.min.js +1 -0
  57. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +1 -1
  58. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +1 -1
  59. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +16 -3
  60. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +1 -1
  61. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.js +69 -0
  62. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.min.js +1 -0
  63. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.js +82 -0
  64. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.min.js +1 -0
  65. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +236 -86
  66. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +1 -1
  67. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss +42 -0
  68. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.css +33 -0
  69. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.min.css +2 -0
  70. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +19 -7
  71. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +1 -1
  72. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +44 -20
  73. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +1 -1
  74. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.js +215 -78
  75. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.min.js +2 -2
  76. data/app/assets/javascripts/activeadmin/trumbowyg/ui/icons.svg +1 -1
  77. data/app/assets/javascripts/activeadmin/trumbowyg/ui/sass/trumbowyg.scss +25 -12
  78. data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.css +23 -20
  79. data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.min.css +2 -2
  80. data/app/assets/stylesheets/activeadmin/_trumbowyg_input.sass +5 -3
  81. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/icons.svg +1 -1
  82. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/sass/trumbowyg.scss +25 -12
  83. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.css +23 -20
  84. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.min.css +2 -2
  85. data/lib/activeadmin/trumbowyg/version.rb +1 -1
  86. metadata +40 -72
  87. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ar.min.js +0 -11
  88. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/bg.min.js +0 -8
  89. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/by.min.js +0 -8
  90. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ca.min.js +0 -11
  91. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/cs.min.js +0 -8
  92. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/da.min.js +0 -9
  93. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/de.min.js +0 -9
  94. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/el.min.js +0 -12
  95. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es.min.js +0 -9
  96. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es_ar.min.js +0 -10
  97. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fa.min.js +0 -10
  98. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fi.min.js +0 -9
  99. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fr.min.js +0 -10
  100. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/he.min.js +0 -9
  101. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hr.min.js +0 -9
  102. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hu.min.js +0 -10
  103. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/id.min.js +0 -11
  104. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/it.min.js +0 -8
  105. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ja.min.js +0 -10
  106. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ko.min.js +0 -10
  107. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/mn.min.js +0 -8
  108. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/my.min.js +0 -8
  109. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/nl.min.js +0 -9
  110. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/no_nb.min.js +0 -10
  111. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ph.min.js +0 -8
  112. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pl.min.js +0 -9
  113. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt.min.js +0 -11
  114. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt_br.min.js +0 -11
  115. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ro.min.js +0 -12
  116. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs.min.js +0 -8
  117. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs_latin.min.js +0 -9
  118. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ru.min.js +0 -8
  119. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sk.min.js +0 -8
  120. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sv.min.js +0 -12
  121. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/tr.min.js +0 -9
  122. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ua.min.js +0 -8
  123. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/vi.min.js +0 -9
  124. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_cn.min.js +0 -11
  125. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_tw.min.js +0 -11
  126. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +0 -121
  127. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +0 -1
  128. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +0 -179
  129. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +0 -1
  130. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +0 -176
  131. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +0 -1
  132. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +0 -49
  133. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +0 -43
  134. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +0 -2
  135. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +0 -965
  136. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +0 -1
  137. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +0 -56
  138. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +0 -47
  139. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +0 -2
  140. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +0 -83
  141. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +0 -1
  142. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +0 -101
  143. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +0 -1
  144. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +0 -41
  145. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +0 -1
  146. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +0 -123
  147. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +0 -1
  148. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +0 -154
  149. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +0 -1
  150. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +0 -58
  151. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +0 -1
  152. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +0 -242
  153. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +0 -1
  154. data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.js +0 -1688
  155. data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.min.js +0 -2
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Trumbowyg v2.11.1 - A lightweight WYSIWYG editor
3
+ * Default stylesheet for Trumbowyg editor plugin
4
+ * ------------------------
5
+ * @link http://alex-d.github.io/Trumbowyg
6
+ * @license MIT
7
+ * @author Alexandre Demode (Alex-D)
8
+ * Twitter : @AlexandreDemode
9
+ * Website : alex-d.fr
10
+ */
11
+
12
+ .trumbowyg-dropdown-mention {
13
+ height: calc(75%);
14
+ width: 300px;
15
+ max-width: 300px;
16
+ overflow-y: scroll;
17
+ overflow-x: hidden;
18
+
19
+ svg {
20
+ display: none !important;
21
+ }
22
+
23
+ button {
24
+ position: relative;
25
+ white-space: nowrap;
26
+
27
+ &:after {
28
+ content: "";
29
+ position: absolute;
30
+ top: 0;
31
+ right: 0;
32
+ width: 15%;
33
+ height: 100%;
34
+ background-size: 100%;
35
+ background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%);
36
+ pointer-events: none;
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Trumbowyg v2.11.1 - A lightweight WYSIWYG editor
3
+ * Trumbowyg plugin stylesheet
4
+ * ------------------------
5
+ * @link http://alex-d.github.io/Trumbowyg
6
+ * @license MIT
7
+ * @author Alexandre Demode (Alex-D)
8
+ * Twitter : @AlexandreDemode
9
+ * Website : alex-d.fr
10
+ */
11
+
12
+ .trumbowyg-dropdown-mention {
13
+ height: calc(75%);
14
+ width: 300px;
15
+ max-width: 300px;
16
+ overflow-y: scroll;
17
+ overflow-x: hidden; }
18
+ .trumbowyg-dropdown-mention svg {
19
+ display: none !important; }
20
+ .trumbowyg-dropdown-mention button {
21
+ position: relative;
22
+ white-space: nowrap; }
23
+ .trumbowyg-dropdown-mention button:after {
24
+ content: "";
25
+ position: absolute;
26
+ top: 0;
27
+ right: 0;
28
+ width: 15%;
29
+ height: 100%;
30
+ background-size: 100%;
31
+ background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%);
32
+ pointer-events: none; }
@@ -0,0 +1,2 @@
1
+ /** Trumbowyg v2.11.1 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
2
+ .trumbowyg-dropdown-mention{height:calc(75%);width:300px;max-width:300px;overflow-y:scroll;overflow-x:hidden}.trumbowyg-dropdown-mention svg{display:none!important}.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}
@@ -23,6 +23,9 @@
23
23
  noembed: 'Noembed',
24
24
  noembedError: 'Error'
25
25
  },
26
+ da: {
27
+ noembedError: 'Fejl'
28
+ },
26
29
  sk: {
27
30
  noembedError: 'Chyba'
28
31
  },
@@ -37,7 +40,14 @@
37
40
  },
38
41
  ja: {
39
42
  noembedError: 'エラー'
40
- }
43
+ },
44
+ tr: {
45
+ noembedError: 'Hata'
46
+ },
47
+ zh_tw: {
48
+ noembed: '插入影片',
49
+ noembedError: '錯誤'
50
+ },
41
51
  },
42
52
 
43
53
  plugins: {
@@ -98,4 +108,4 @@
98
108
  }
99
109
  }
100
110
  });
101
- })(jQuery);
111
+ })(jQuery);
@@ -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"},sk:{noembedError:"Chyba"},fr:{noembedError:"Erreur"},cs:{noembedError:"Chyba"},ru:{noembedError:"Ошибка"},ja:{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"},da:{noembedError:"Fejl"},sk:{noembedError:"Chyba"},fr:{noembedError:"Erreur"},cs:{noembedError:"Chyba"},ru:{noembedError:"Ошибка"},ja:{noembedError:"エラー"},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);
@@ -0,0 +1,96 @@
1
+ /* ===========================================================
2
+ * trumbowyg.pasteembed.js v1.0
3
+ * Url paste to iframe with noembed. Plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Max Seelig
7
+ * Facebook : https://facebook.com/maxse
8
+ * Website : https://www.maxmade.nl/
9
+ */
10
+
11
+ (function($) {
12
+ 'use strict';
13
+
14
+ var defaultOptions = {
15
+ enabled: true,
16
+ endpoints: [
17
+ 'https://noembed.com/embed?nowrap=on',
18
+ 'https://api.maxmade.nl/url2iframe/embed'
19
+ ]
20
+ };
21
+
22
+ $.extend(true, $.trumbowyg, {
23
+ plugins: {
24
+ pasteEmbed: {
25
+ init: function(trumbowyg) {
26
+ trumbowyg.o.plugins.pasteEmbed = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.pasteEmbed || {});
27
+
28
+ if (!trumbowyg.o.plugins.pasteEmbed.enabled) {
29
+ return;
30
+ }
31
+
32
+ trumbowyg.pasteHandlers.push(function(pasteEvent) {
33
+ try {
34
+ var clipboardData = (pasteEvent.originalEvent || pasteEvent).clipboardData,
35
+ pastedData = clipboardData.getData('Text'),
36
+ endpoints = trumbowyg.o.plugins.pasteEmbed.endpoints,
37
+ request = null;
38
+
39
+ if (pastedData.startsWith('http')) {
40
+ pasteEvent.stopPropagation();
41
+ pasteEvent.preventDefault();
42
+
43
+ var query = {
44
+ url: pastedData.trim()
45
+ };
46
+ var content = '';
47
+ var index = 0;
48
+
49
+ if (request && request.transport) {
50
+ request.transport.abort();
51
+ }
52
+
53
+ request = $.ajax({
54
+ crossOrigin: true,
55
+ url: endpoints[index],
56
+ type: 'GET',
57
+ data: query,
58
+ cache: false,
59
+ dataType: 'jsonp',
60
+ success: function(res) {
61
+ if (res.html) {
62
+ index = 0;
63
+ content = res.html;
64
+ } else {
65
+ index += 1;
66
+ }
67
+ },
68
+ error: function() {
69
+ index += 1;
70
+ },
71
+ complete: function() {
72
+ if (content.length === 0 && index < endpoints.length - 1) {
73
+ this.url = endpoints[index];
74
+ this.data = query;
75
+ $.ajax(this);
76
+ }
77
+ if (index === endpoints.length - 1) {
78
+ content = $('<a>', {
79
+ href: pastedData,
80
+ text: pastedData
81
+ }).prop('outerHTML');
82
+ }
83
+ if (content.length > 0) {
84
+ index = 0;
85
+ trumbowyg.execCmd('insertHTML', content);
86
+ }
87
+ }
88
+ });
89
+ }
90
+ } catch (c) {}
91
+ });
92
+ }
93
+ }
94
+ }
95
+ });
96
+ })(jQuery);
@@ -0,0 +1 @@
1
+ !function(t){"use strict";var e={enabled:!0,endpoints:["https://noembed.com/embed?nowrap=on","https://api.maxmade.nl/url2iframe/embed"]};t.extend(!0,t.trumbowyg,{plugins:{pasteEmbed:{init:function(n){n.o.plugins.pasteEmbed=t.extend(!0,{},e,n.o.plugins.pasteEmbed||{}),n.o.plugins.pasteEmbed.enabled&&n.pasteHandlers.push(function(e){try{var a=(e.originalEvent||e).clipboardData,r=a.getData("Text"),s=n.o.plugins.pasteEmbed.endpoints,i=null;if(r.startsWith("http")){e.stopPropagation(),e.preventDefault();var o={url:r.trim()},p="",l=0;i&&i.transport&&i.transport.abort(),i=t.ajax({crossOrigin:!0,url:s[l],type:"GET",data:o,cache:!1,dataType:"jsonp",success:function(t){t.html?(l=0,p=t.html):l+=1},error:function(){l+=1},complete:function(){0===p.length&&l<s.length-1&&(this.url=s[l],this.data=o,t.ajax(this)),l===s.length-1&&(p=t("<a>",{href:r,text:r}).prop("outerHTML")),p.length>0&&(l=0,n.execCmd("insertHTML",p))}})}}catch(u){}})}}}})}(jQuery);
@@ -20,7 +20,7 @@
20
20
  var items = (pasteEvent.originalEvent || pasteEvent).clipboardData.items,
21
21
  reader;
22
22
 
23
- for (var i = items.length -1; i >= 0; i += 1) {
23
+ for (var i = items.length - 1; i >= 0; i -= 1) {
24
24
  if (items[i].type.match(/^image\//)) {
25
25
  reader = new FileReader();
26
26
  /* jshint -W083 */
@@ -1 +1 @@
1
- !function(e){"use strict";e.extend(!0,e.trumbowyg,{plugins:{pasteImage:{init:function(e){e.pasteHandlers.push(function(t){try{for(var a,n=(t.originalEvent||t).clipboardData.items,i=n.length-1;i>=0;i+=1)n[i].type.match(/^image\//)&&(a=new FileReader,a.onloadend=function(t){e.execCmd("insertImage",t.target.result,void 0,!0)},a.readAsDataURL(n[i].getAsFile()))}catch(r){}})}}}})}(jQuery);
1
+ !function(e){"use strict";e.extend(!0,e.trumbowyg,{plugins:{pasteImage:{init:function(e){e.pasteHandlers.push(function(t){try{for(var a,n=(t.originalEvent||t).clipboardData.items,i=n.length-1;i>=0;i-=1)n[i].type.match(/^image\//)&&(a=new FileReader,a.onloadend=function(t){e.execCmd("insertImage",t.target.result,void 0,!0)},a.readAsDataURL(n[i].getAsFile()))}catch(r){}})}}}})}(jQuery);
@@ -16,8 +16,11 @@
16
16
  en: {
17
17
  preformatted: 'Code sample <pre>'
18
18
  },
19
+ da: {
20
+ preformatted: 'Præformateret <pre>'
21
+ },
19
22
  fr: {
20
- preformatted: 'Exemple de code'
23
+ preformatted: 'Exemple de code <pre>'
21
24
  },
22
25
  it: {
23
26
  preformatted: 'Codice <pre>'
@@ -30,7 +33,13 @@
30
33
  },
31
34
  ja: {
32
35
  preformatted: 'コードサンプル <pre>'
33
- }
36
+ },
37
+ tr: {
38
+ preformatted: 'Kod örneği <pre>'
39
+ },
40
+ zh_tw: {
41
+ preformatted: '代碼範例 <pre>'
42
+ },
34
43
  },
35
44
  // jshint camelcase:true
36
45
 
@@ -69,6 +78,7 @@
69
78
  function getSelectionParentElement() {
70
79
  var parentEl = null,
71
80
  selection;
81
+
72
82
  if (window.getSelection) {
73
83
  selection = window.getSelection();
74
84
  if (selection.rangeCount) {
@@ -80,6 +90,7 @@
80
90
  } else if ((selection = document.selection) && selection.type !== 'Control') {
81
91
  parentEl = selection.createRange().parentElement();
82
92
  }
93
+
83
94
  return parentEl;
84
95
  }
85
96
 
@@ -100,6 +111,7 @@
100
111
  */
101
112
  function unwrapCode() {
102
113
  var container = null;
114
+
103
115
  if (document.selection) { //for IE
104
116
  container = document.selection.createRange().parentElement();
105
117
  } else {
@@ -108,9 +120,11 @@
108
120
  container = select.getRangeAt(0).startContainer.parentNode;
109
121
  }
110
122
  }
123
+
111
124
  //'paranoic' unwrap
112
125
  var ispre = $(container).contents().closest('pre').length;
113
126
  var iscode = $(container).contents().closest('code').length;
127
+
114
128
  if (ispre && iscode) {
115
129
  $(container).contents().unwrap('code').unwrap('pre');
116
130
  } else if (ispre) {
@@ -119,5 +133,4 @@
119
133
  $(container).contents().unwrap('code');
120
134
  }
121
135
  }
122
-
123
136
  })(jQuery);
@@ -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 n(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}function r(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var n=window.getSelection();n.rangeCount>0&&(t=n.getRangeAt(0).startContainer.parentNode)}var r=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;r&&o?e(t).contents().unwrap("code").unwrap("pre"):r?e(t).contents().unwrap("pre"):o&&e(t).contents().unwrap("code")}e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample <pre>"},fr:{preformatted:"Exemple de code"},it:{preformatted:"Codice <pre>"},zh_cn:{preformatted:"代码示例 <pre>"},ru:{preformatted:"Пример кода <pre>"},ja:{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 r();e.execCmd("insertHTML","<pre><code>"+n(o)+"</code></pre>")}catch(c){}},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 n(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}function r(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var n=window.getSelection();n.rangeCount>0&&(t=n.getRangeAt(0).startContainer.parentNode)}var r=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;r&&o?e(t).contents().unwrap("code").unwrap("pre"):r?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>"}},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 r();e.execCmd("insertHTML","<pre><code>"+n(o)+"</code></pre>")}catch(c){}},tag:"pre"};e.addBtnDef("preformatted",o)}}}})}(jQuery);
@@ -0,0 +1,69 @@
1
+ (function ($) {
2
+ 'use strict';
3
+
4
+ var defaultOptions = {
5
+ minSize: 32,
6
+ step: 4
7
+ };
8
+
9
+ var preventDefault = function (ev) {
10
+ return ev.preventDefault();
11
+ };
12
+
13
+ $.extend(true, $.trumbowyg, {
14
+ plugins: {
15
+ resizimg: {
16
+ init: function (trumbowyg) {
17
+ trumbowyg.o.plugins.resizimg = $.extend(true, {},
18
+ defaultOptions,
19
+ trumbowyg.o.plugins.resizimg || {},
20
+ {
21
+ resizable: {
22
+ resizeWidth: false,
23
+ onDragStart: function (ev, $el) {
24
+ var opt = trumbowyg.o.plugins.resizimg;
25
+ var x = ev.pageX - $el.offset().left;
26
+ var y = ev.pageY - $el.offset().top;
27
+ if (x < $el.width() - opt.minSize || y < $el.height() - opt.minSize) {
28
+ return false;
29
+ }
30
+ },
31
+ onDrag: function (ev, $el, newWidth, newHeight) {
32
+ var opt = trumbowyg.o.plugins.resizimg;
33
+ if (newHeight < opt.minSize) {
34
+ newHeight = opt.minSize;
35
+ }
36
+ newHeight -= newHeight % opt.step;
37
+ $el.height(newHeight);
38
+ return false;
39
+ },
40
+ onDragEnd: function () {
41
+ trumbowyg.$c.trigger('tbwchange');
42
+ }
43
+ }
44
+ }
45
+ );
46
+
47
+ function initResizable() {
48
+ trumbowyg.$ed.find('img:not(.resizable)')
49
+ .resizable(trumbowyg.o.plugins.resizimg.resizable)
50
+ .on('mousedown', preventDefault);
51
+ }
52
+
53
+ function destroyResizable() {
54
+ trumbowyg.$ed.find('img.resizable')
55
+ .resizable('destroy')
56
+ .off('mousedown', preventDefault);
57
+ trumbowyg.syncTextarea();
58
+ }
59
+
60
+ trumbowyg.$c.on('tbwinit', initResizable);
61
+ trumbowyg.$c.on('tbwfocus', initResizable);
62
+ trumbowyg.$c.on('tbwchange', initResizable);
63
+ trumbowyg.$c.on('tbwblur', destroyResizable);
64
+ trumbowyg.$c.on('tbwclose', destroyResizable);
65
+ }
66
+ }
67
+ }
68
+ });
69
+ })(jQuery);
@@ -0,0 +1 @@
1
+ !function(i){"use strict";var e={minSize:32,step:4},n=function(i){return i.preventDefault()};i.extend(!0,i.trumbowyg,{plugins:{resizimg:{init:function(t){function o(){t.$ed.find("img:not(.resizable)").resizable(t.o.plugins.resizimg.resizable).on("mousedown",n)}function r(){t.$ed.find("img.resizable").resizable("destroy").off("mousedown",n),t.syncTextarea()}t.o.plugins.resizimg=i.extend(!0,{},e,t.o.plugins.resizimg||{},{resizable:{resizeWidth:!1,onDragStart:function(i,e){var n=t.o.plugins.resizimg,o=i.pageX-e.offset().left,r=i.pageY-e.offset().top;if(o<e.width()-n.minSize||r<e.height()-n.minSize)return!1},onDrag:function(i,e,n,o){var r=t.o.plugins.resizimg;return o<r.minSize&&(o=r.minSize),o-=o%r.step,e.height(o),!1},onDragEnd:function(){t.$c.trigger("tbwchange")}}}),t.$c.on("tbwinit",o),t.$c.on("tbwfocus",o),t.$c.on("tbwchange",o),t.$c.on("tbwblur",r),t.$c.on("tbwclose",r)}}}})}(jQuery);
@@ -0,0 +1,82 @@
1
+ /* ===========================================================
2
+ * trumbowyg.ruby.js v1.0
3
+ * Ruby text plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Fathi Anshory (0x00000F5C)
7
+ * Twitter : @fscchannl
8
+ * Comment : Since I use trumbowyg in my project and required it to insert ruby text, so I thought I can contribute a little. :D
9
+ */
10
+
11
+ (function ($) {
12
+ 'use strict';
13
+
14
+ $.extend(true, $.trumbowyg, {
15
+ langs: {
16
+ en: {
17
+ ruby: 'Add ruby text',
18
+ rubyModal: 'Ruby modal',
19
+ rubyText: 'Ruby text'
20
+ },
21
+ da: {
22
+ ruby: 'Tilføj ruby tekst',
23
+ rubyModal: 'Ruby modal',
24
+ rubyText: 'Ruby tekst'
25
+ },
26
+ fr: {
27
+ ruby: 'Ajouter du texte ruby',
28
+ rubyModal: 'Modale ruby',
29
+ rubyText: 'Texte ruby'
30
+ },
31
+ id: {
32
+ ruby: 'Sisipkan teks ruby',
33
+ rubyModal: 'Modal teks ruby',
34
+ rubyText: 'Teks ruby'
35
+ },
36
+ tr: {
37
+ ruby: 'Ruby metni ekle',
38
+ rubyModal: 'Ruby modal',
39
+ rubyText: 'Ruby metni'
40
+ },
41
+ zh_tw: {
42
+ ruby: '加入 ruby 文字',
43
+ rubyModal: 'Ruby 彈跳視窗',
44
+ rubyText: 'Ruby 文字'
45
+ },
46
+ },
47
+ plugins: {
48
+ ruby: {
49
+ init: function (trumbowyg) {
50
+ var btnDef = {
51
+ fn: function () {
52
+ trumbowyg.saveRange();
53
+ trumbowyg.openModalInsert(
54
+ trumbowyg.lang.ruby,
55
+ {
56
+ rubyText: {
57
+ label: trumbowyg.lang.rubyText,
58
+ required: false,
59
+ },
60
+ modal: {
61
+ label: trumbowyg.lang.rubyModal,
62
+ value: trumbowyg.getRangeText(),
63
+ required: true
64
+ }
65
+ },
66
+ function (v) {
67
+ var node = $('<ruby title="' + v.rubyText + '">' + v.modal + '<rp> (</rp><rt>' + v.rubyText + '</rt><rp>)</rp></ruby>')[0];
68
+ trumbowyg.range.deleteContents();
69
+ trumbowyg.range.insertNode(node);
70
+ trumbowyg.syncCode();
71
+ trumbowyg.$c.trigger('tbwchange');
72
+ return true;
73
+ }
74
+ );
75
+ }
76
+ };
77
+ trumbowyg.addBtnDef('ruby', btnDef);
78
+ }
79
+ }
80
+ }
81
+ });
82
+ })(jQuery);
@@ -0,0 +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"},tr:{ruby:"Ruby metni ekle",rubyModal:"Ruby modal",rubyText:"Ruby metni"},zh_tw:{ruby:"加入 ruby 文字",rubyModal:"Ruby 彈跳視窗",rubyText:"Ruby 文字"}},plugins:{ruby:{init:function(e){var u={fn:function(){e.saveRange(),e.openModalInsert(e.lang.ruby,{rubyText:{label:e.lang.rubyText,required:!1},modal:{label:e.lang.rubyModal,value:e.getRangeText(),required:!0}},function(u){var t=r('<ruby title="'+u.rubyText+'">'+u.modal+"<rp> (</rp><rt>"+u.rubyText+"</rt><rp>)</rp></ruby>")[0];return e.range.deleteContents(),e.range.insertNode(t),e.syncCode(),e.$c.trigger("tbwchange"),!0})}};e.addBtnDef("ruby",u)}}}})}(jQuery);