activeadmin_trumbowyg 0.1.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE.txt +1 -1
  3. data/README.md +9 -3
  4. data/Rakefile +2 -2
  5. data/app/assets/fonts/trumbowyg/icons.svg +1 -0
  6. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ar.js +67 -0
  7. data/app/assets/javascripts/activeadmin/trumbowyg/langs/bg.js +54 -0
  8. data/app/assets/javascripts/activeadmin/trumbowyg/langs/by.js +61 -0
  9. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ca.js +57 -0
  10. data/app/assets/javascripts/activeadmin/trumbowyg/langs/cs.js +54 -0
  11. data/app/assets/javascripts/activeadmin/trumbowyg/langs/da.js +64 -0
  12. data/app/assets/javascripts/activeadmin/trumbowyg/langs/da.min.js +1 -1
  13. data/app/assets/javascripts/activeadmin/trumbowyg/langs/de.js +57 -0
  14. data/app/assets/javascripts/activeadmin/trumbowyg/langs/de.min.js +1 -1
  15. data/app/assets/javascripts/activeadmin/trumbowyg/langs/el.js +59 -0
  16. data/app/assets/javascripts/activeadmin/trumbowyg/langs/es.js +63 -0
  17. data/app/assets/javascripts/activeadmin/trumbowyg/langs/es_ar.js +56 -0
  18. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fa.js +58 -0
  19. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fa.min.js +1 -1
  20. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fi.js +58 -0
  21. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fr.js +66 -0
  22. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fr.min.js +3 -1
  23. data/app/assets/javascripts/activeadmin/trumbowyg/langs/he.js +57 -0
  24. data/app/assets/javascripts/activeadmin/trumbowyg/langs/hr.js +54 -0
  25. data/app/assets/javascripts/activeadmin/trumbowyg/langs/hu.js +58 -0
  26. data/app/assets/javascripts/activeadmin/trumbowyg/langs/id.js +57 -0
  27. data/app/assets/javascripts/activeadmin/trumbowyg/langs/it.js +59 -0
  28. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ja.js +63 -0
  29. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ko.js +63 -0
  30. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ko.min.js +3 -4
  31. data/app/assets/javascripts/activeadmin/trumbowyg/langs/lt.js +59 -0
  32. data/app/assets/javascripts/activeadmin/trumbowyg/langs/lt.min.js +8 -0
  33. data/app/assets/javascripts/activeadmin/trumbowyg/langs/mn.js +49 -0
  34. data/app/assets/javascripts/activeadmin/trumbowyg/langs/my.js +54 -0
  35. data/app/assets/javascripts/activeadmin/trumbowyg/langs/nl.js +61 -0
  36. data/app/assets/javascripts/activeadmin/trumbowyg/langs/nl.min.js +1 -1
  37. data/app/assets/javascripts/activeadmin/trumbowyg/langs/no_nb.js +56 -0
  38. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ph.js +54 -0
  39. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pl.js +55 -0
  40. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt.js +65 -0
  41. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt_br.js +65 -0
  42. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt_br.min.js +1 -1
  43. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ro.js +58 -0
  44. data/app/assets/javascripts/activeadmin/trumbowyg/langs/rs.js +53 -0
  45. data/app/assets/javascripts/activeadmin/trumbowyg/langs/rs_latin.js +54 -0
  46. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ru.js +61 -0
  47. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ru.min.js +1 -1
  48. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sk.js +54 -0
  49. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sl.js +48 -0
  50. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sl.min.js +1 -0
  51. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sq.js +65 -0
  52. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sq.min.js +8 -0
  53. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sv.js +58 -0
  54. data/app/assets/javascripts/activeadmin/trumbowyg/langs/th.js +55 -0
  55. data/app/assets/javascripts/activeadmin/trumbowyg/langs/th.min.js +9 -0
  56. data/app/assets/javascripts/activeadmin/trumbowyg/langs/tr.js +55 -0
  57. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ua.js +54 -0
  58. data/app/assets/javascripts/activeadmin/trumbowyg/langs/vi.js +56 -0
  59. data/app/assets/javascripts/activeadmin/trumbowyg/langs/vi.min.js +1 -1
  60. data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_cn.js +57 -0
  61. data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_tw.js +66 -0
  62. data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_tw.min.js +1 -1
  63. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js +162 -0
  64. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js +1 -0
  65. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +34 -2
  66. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +1 -1
  67. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +29 -97
  68. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +1 -1
  69. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +109 -35
  70. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +1 -1
  71. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +30 -11
  72. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +27 -15
  73. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +2 -2
  74. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +1265 -877
  75. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +1 -1
  76. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +1 -4
  77. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +2 -5
  78. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +2 -2
  79. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js +95 -0
  80. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js +1 -0
  81. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js +257 -0
  82. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js +1 -0
  83. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/trumbowyg.giphy.js +182 -0
  84. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/trumbowyg.giphy.min.js +1 -0
  85. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/sass/trumbowyg.giphy.scss +111 -0
  86. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.css +90 -0
  87. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.min.css +2 -0
  88. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.js +90 -0
  89. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js +1 -0
  90. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss +25 -0
  91. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css +20 -0
  92. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css +2 -0
  93. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.js +216 -0
  94. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.min.js +1 -0
  95. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +19 -2
  96. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +1 -1
  97. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.js +162 -0
  98. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.min.js +1 -0
  99. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.js +117 -0
  100. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.min.js +1 -0
  101. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/sass/trumbowyg.mathml.scss +36 -0
  102. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.css +29 -0
  103. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.min.css +2 -0
  104. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.js +116 -0
  105. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.min.js +1 -0
  106. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/sass/trumbowyg.mention.scss +29 -0
  107. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.css +24 -0
  108. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.min.css +2 -0
  109. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +21 -1
  110. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +1 -1
  111. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.js +96 -0
  112. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.min.js +1 -0
  113. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +10 -2
  114. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +1 -1
  115. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +22 -3
  116. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +1 -1
  117. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/resizable-resolveconflict.js +20 -0
  118. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/resizable-resolveconflict.min.js +1 -0
  119. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.js +303 -0
  120. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.min.js +1 -0
  121. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.js +94 -0
  122. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.min.js +1 -0
  123. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/trumbowyg.specialchars.js +79 -0
  124. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/trumbowyg.specialchars.min.js +1 -0
  125. data/app/assets/{stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss → javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss} +11 -11
  126. data/app/assets/{stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css → javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.css} +12 -12
  127. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.min.css +2 -0
  128. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +346 -81
  129. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +1 -1
  130. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss +46 -0
  131. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.css +36 -0
  132. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.min.css +2 -0
  133. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +32 -9
  134. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +1 -1
  135. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +58 -23
  136. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +1 -1
  137. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.js +427 -188
  138. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.min.js +2 -2
  139. data/app/assets/javascripts/activeadmin/trumbowyg_input.js +17 -6
  140. data/app/assets/stylesheets/activeadmin/_trumbowyg_input.scss +67 -0
  141. data/app/assets/stylesheets/activeadmin/trumbowyg/{ui/sass/trumbowyg.scss → trumbowyg.scss} +44 -16
  142. data/lib/activeadmin/trumbowyg.rb +2 -0
  143. data/lib/activeadmin/trumbowyg/engine.rb +2 -0
  144. data/lib/activeadmin/trumbowyg/version.rb +3 -1
  145. data/lib/activeadmin_trumbowyg.rb +2 -1
  146. data/lib/formtastic/inputs/trumbowyg_input.rb +3 -2
  147. data/lib/tasks/trumbowyg.rake +4 -2
  148. metadata +230 -92
  149. data/.gitignore +0 -3
  150. data/Gemfile +0 -4
  151. data/activeadmin_trumbowyg.gemspec +0 -19
  152. data/app/assets/fonts/active_admin-trumbowyg.svg +0 -1
  153. data/app/assets/javascripts/activeadmin/trumbowyg/ui/icons.svg +0 -1
  154. data/app/assets/javascripts/activeadmin/trumbowyg/ui/sass/trumbowyg.scss +0 -796
  155. data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.css +0 -584
  156. data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.min.css +0 -2
  157. data/app/assets/stylesheets/activeadmin/_trumbowyg_input.sass +0 -54
  158. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ar.min.js +0 -11
  159. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/bg.min.js +0 -8
  160. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/by.min.js +0 -8
  161. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ca.min.js +0 -11
  162. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/cs.min.js +0 -8
  163. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/da.min.js +0 -9
  164. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/de.min.js +0 -9
  165. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/el.min.js +0 -12
  166. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es.min.js +0 -9
  167. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es_ar.min.js +0 -10
  168. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fa.min.js +0 -10
  169. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fi.min.js +0 -9
  170. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fr.min.js +0 -10
  171. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/he.min.js +0 -9
  172. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hr.min.js +0 -9
  173. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hu.min.js +0 -10
  174. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/id.min.js +0 -11
  175. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/it.min.js +0 -8
  176. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ja.min.js +0 -10
  177. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ko.min.js +0 -10
  178. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/mn.min.js +0 -8
  179. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/my.min.js +0 -8
  180. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/nl.min.js +0 -9
  181. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/no_nb.min.js +0 -10
  182. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ph.min.js +0 -8
  183. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pl.min.js +0 -9
  184. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt.min.js +0 -11
  185. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt_br.min.js +0 -11
  186. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ro.min.js +0 -12
  187. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs.min.js +0 -8
  188. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs_latin.min.js +0 -9
  189. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ru.min.js +0 -8
  190. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sk.min.js +0 -8
  191. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sv.min.js +0 -12
  192. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/tr.min.js +0 -9
  193. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ua.min.js +0 -8
  194. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/vi.min.js +0 -9
  195. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_cn.min.js +0 -11
  196. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_tw.min.js +0 -11
  197. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +0 -121
  198. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +0 -1
  199. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +0 -179
  200. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +0 -1
  201. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +0 -176
  202. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +0 -1
  203. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +0 -49
  204. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +0 -43
  205. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +0 -2
  206. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +0 -965
  207. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +0 -1
  208. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +0 -2
  209. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +0 -83
  210. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +0 -1
  211. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +0 -101
  212. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +0 -1
  213. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +0 -41
  214. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +0 -1
  215. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +0 -123
  216. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +0 -1
  217. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +0 -154
  218. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +0 -1
  219. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +0 -58
  220. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +0 -1
  221. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +0 -242
  222. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +0 -1
  223. data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.js +0 -1688
  224. data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.min.js +0 -2
  225. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/icons.svg +0 -1
  226. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.css +0 -584
  227. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.min.css +0 -2
  228. data/screenshot.jpg +0 -0
@@ -0,0 +1 @@
1
+ !function(i){"use strict";function e(i,e){var n,t;return function(){var o=this,l=+new Date,c=arguments;n&&l<n+e?(clearTimeout(t),t=setTimeout(function(){n=l,i.apply(o,c)},e)):(n=l,i.apply(o,c))}}function n(e,n,t,o){var l=(n.width()-20)/3,c=e.data.filter(function(i){return""!==i.images.downsized.url}).map(function(i){var e=i.images.downsized,n=e.height/e.width;return'<div class="img-container"><img src='+e.url+' width="'+l+'" height="'+n*l+'" loading="lazy" onload="this.classList.add(\'tbw-loaded\')"/></div>'}).join("");if(o===!0){if(0===c.length){if(i("."+t.o.prefix+"giphy-no-result",n).length>0)return;c='<img class="'+t.o.prefix+'giphy-no-result" src="'+t.o.plugins.giphy.noResultGifUrl+'"/>'}n.empty()}n.append(c),i("img",n).on("click",function(){t.restoreRange(),t.execCmd("insertImage",i(this).attr("src"),!1,!0),i("img",n).off(),t.closeModal()})}i.extend(!0,i.trumbowyg,{langs:{en:{giphy:"Insert GIF"},fr:{giphy:"Insérer un GIF"}}});var t='<svg viewBox="0 0 231 53" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M48.32 22.386c0-1.388-.252-1.892-1.767-1.85-3.448.126-6.855.042-10.303.042H25.443c-.927 0-1.346.211-1.305 1.22.085 2.86.085 5.72.043 8.58 0 .883.252 1.169 1.169 1.135 2.018-.084 3.995-.042 6.014 0 1.64 0 4.164-.546 4.752.252.841 1.169.421 3.364.337 5.089-.043.547-.547 1.304-1.094 1.598-2.692 1.556-5.678 2.018-8.747 1.892-5.342-.21-9.336-2.439-11.481-7.527-1.388-3.364-1.725-6.855-1.01-10.43 1.01-4.963 3.407-8.747 8.58-10.051 5.215-1.305 10.136-.547 14.467 2.817 1.219.967 1.798.715 2.691-.294 1.514-1.724 3.154-3.322 4.753-4.963 1.892-1.933 1.892-1.892-.169-3.7C38.429.813 31.238-.617 23.5.224 12.818 1.393 5.248 6.658 1.59 17.045-.177 22.008-.428 27.097.623 32.227c1.682 7.914 5.551 14.12 13.289 17.368 6.898 2.901 14.046 3.448 21.321 1.598 4.331-1.093 8.411-2.608 11.354-6.223 1.136-1.388 1.725-2.902 1.682-4.71l.043-17.873.008-.001zm125.153 3.784l.042-23.046c0-1.136-.168-1.598-1.472-1.556a238.02 238.02 0 0 1-11.017 0c-1.136-.042-1.439.337-1.439 1.439v15.645c0 1.345-.421 1.556-1.641 1.556a422.563 422.563 0 0 0-14.593 0c-1.262.042-1.472-.421-1.439-1.556l.043-15.813c0-.926-.169-1.304-1.17-1.262h-11.513c-.927 0-1.304.169-1.304 1.22v46.764c0 .967.252 1.262 1.219 1.262h11.512c1.169.042 1.262-.462 1.262-1.388l-.042-15.644c0-1.053.251-1.346 1.304-1.346h15.14c1.22 0 1.388.421 1.388 1.472l-.042 15.477c0 1.093.21 1.472 1.388 1.439 3.615-.085 7.233-.085 10.807 0 1.304.042 1.598-.337 1.598-1.598l-.042-23.047.011-.018zM106.565 1.654c-8.369-.211-16.728-.126-25.065-.211-1.346 0-1.767.337-1.767 1.724l.043 23.004v23.215c0 1.009.168 1.439 1.304 1.387a271.22 271.22 0 0 1 11.691 0c1.094 0 1.346-.336 1.346-1.345l-.042-10.64c0-1.052.294-1.345 1.345-1.345 3.322.042 6.645.085 9.967-.085 4.407-.21 8.621-1.219 12.111-4.12 5.551-4.584 7.613-12.701 5.131-20.061-2.313-6.561-8.747-11.354-16.064-11.522v-.001zm-3.028 24.013c-2.818.042-5.594-.043-8.411.042-1.169.042-1.439-.378-1.345-1.439.084-1.556 0-3.069 0-4.626v-5.131c-.043-.841.251-1.094 1.052-1.052 2.986.042 5.929-.085 8.915.042 3.616.126 5.887 2.692 5.846 6.266-.126 3.658-2.313 5.846-6.055 5.887l-.002.011zM229.699 1.569c-4.458 0-8.915-.042-13.415.043-.629 0-1.472.503-1.85 1.052a505.695 505.695 0 0 0-8.957 14.214c-.884 1.472-1.22 1.169-1.977-.084l-8.496-14.089c-.503-.841-1.052-1.136-2.018-1.136l-13.078.043c-.462 0-.967.125-1.439.21.21.378.378.799.629 1.169l17.412 27.167c.462.715.715 1.682.757 2.524v16.653c0 1.052.168 1.514 1.388 1.472 3.784-.084 7.57-.084 11.354 0 1.136.043 1.304-.377 1.304-1.387l-.042-8.58c0-2.734-.084-5.51.042-8.243.043-.926.337-1.933.841-2.649l18.167-27.041c.252-.337.337-.758.547-1.17a3.636 3.636 0 0 0-1.169-.168zM70.104 2.661c0-1.009-.294-1.219-1.262-1.219H57.69c-1.262-.043-1.472.377-1.472 1.513l.042 23.004v23.34c0 1.053.126 1.514 1.346 1.473 3.7-.085 7.444-.043 11.152 0 .966 0 1.387-.085 1.387-1.262l-.042-46.857.001.008z" fill="currentColor" fill-rule="nonzero"/></svg>',o="tbwcancel",l={rating:"g",apiKey:null,throttleDelay:300,noResultGifUrl:"https://media.giphy.com/media/2Faz9FbRzmwxY0pZS/giphy.gif"};i.extend(!0,i.trumbowyg,{plugins:{giphy:{init:function(c){c.o.plugins.giphy=i.extend({},l,c.o.plugins.giphy||{}),c.addBtnDef("giphy",{fn:function(){if(null===c.o.plugins.giphy.apiKey)throw new Error("You must set a Giphy API Key");var l="https://api.giphy.com/v1/gifs/search?api_key="+c.o.plugins.giphy.apiKey+"&rating="+c.o.plugins.giphy.rating,a=l.replace("/search","/trending"),r={abort:function(){}},s=c.o.prefix,p='<input name="" class="'+s+'giphy-search" placeholder="Search a GIF" autofocus="autofocus">',g='<button class="'+s+'giphy-close" title="'+c.lang.close+'"><svg><use xlink:href="'+c.svgPath+"#"+s+'close"/></svg></button>',u='<div class="'+s+'powered-by-giphy"><span>Powered by</span>'+t+"</div>",h=p+g+u+'<div class="'+s+'giphy-modal-scroll"><div class="'+s+'giphy-modal"></div></div>';c.openModal(null,h,!1).one(o,function(){try{r.abort()}catch(i){}c.closeModal()});var d=i("."+s+"giphy-search"),f=i("."+s+"giphy-close"),y=i("."+s+"giphy-modal"),v=function(){navigator.onLine||i("."+s+"giphy-offline",y).length||(y.empty(),y.append('<p class="'+s+'giphy-offline">You are offline</p>'))};i.ajax({url:a,dataType:"json",success:function(i){n(i,y,c,!0)},error:v});var m=function(){var e=d.val();if(0!==e.length){try{r.abort()}catch(t){}r=i.ajax({url:l+"&q="+encodeURIComponent(e),dataType:"json",success:function(i){n(i,y,c,!0)},error:v})}},w=e(m,c.o.plugins.giphy.throttleDelay);d.on("input",w),d.focus(),f.one("click",function(){y.trigger(o)})}})}}}})}(jQuery);
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Trumbowyg v2.21.0 - 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-giphy-button svg {
13
+ transform: scale(1.22);
14
+ }
15
+
16
+ .trumbowyg-giphy-search {
17
+ display: block;
18
+ width: 80%;
19
+ margin: 5%;
20
+ padding-left: 10px;
21
+ padding-right: 150px;
22
+ }
23
+
24
+ .trumbowyg-giphy-close {
25
+ position: absolute;
26
+ top: calc(5% + 8px);
27
+ right: calc(5% - 2px);
28
+ width: 30px;
29
+ height: 30px;
30
+ background: none;
31
+ border: 1px solid transparent;
32
+
33
+ &:hover,
34
+ &:focus {
35
+ outline: none;
36
+ background: #ecf0f1;
37
+ }
38
+ &:focus {
39
+ border-color: rgba(0, 0, 0, 0.3);
40
+ }
41
+ }
42
+
43
+ .trumbowyg-powered-by-giphy {
44
+ position: absolute;
45
+ top: calc(5% + 12px);
46
+ right: calc(15% + 10px);
47
+ pointer-events: none;
48
+ user-select: none;
49
+
50
+ span {
51
+ text-transform: uppercase;
52
+ font-weight: bold;
53
+ font-size: 10px;
54
+ opacity: 0.6;
55
+ }
56
+
57
+ svg {
58
+ width: 66px;
59
+ height: 15px;
60
+ vertical-align: bottom;
61
+ margin-left: 6px;
62
+ opacity: 0.45;
63
+ }
64
+ }
65
+
66
+ .trumbowyg-giphy-modal-scroll {
67
+ overflow: auto;
68
+ overflow-x: hidden;
69
+ height: 240px;
70
+ }
71
+
72
+ .trumbowyg-giphy-modal {
73
+ padding: 0 5%;
74
+ columns: 3;
75
+ column-gap: 10px;
76
+
77
+ .trumbowyg-giphy-no-result {
78
+ width: 250%;
79
+ margin: 13% 0 0 29%;
80
+ }
81
+
82
+ .trumbowyg-giphy-offline {
83
+ font-size: 18px;
84
+ width: 305%;
85
+ height: 600px;
86
+ margin-top: 95px;
87
+ text-align: center;
88
+ }
89
+ }
90
+
91
+ .trumbowyg-giphy-modal .img-container {
92
+ width: 100%;
93
+ margin-bottom: 10px;
94
+ background-color: #ecf0f1;
95
+
96
+ img {
97
+ width: 100%;
98
+ cursor: pointer;
99
+ opacity: 0;
100
+ transition: opacity 150ms;
101
+
102
+ &:hover,
103
+ &:focus {
104
+ border: #2ecc71 solid 3px;
105
+ }
106
+ }
107
+
108
+ img.tbw-loaded {
109
+ opacity: 1;
110
+ }
111
+ }
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Trumbowyg v2.21.0 - 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-giphy-button svg {
13
+ transform: scale(1.22); }
14
+
15
+ .trumbowyg-giphy-search {
16
+ display: block;
17
+ width: 80%;
18
+ margin: 5%;
19
+ padding-left: 10px;
20
+ padding-right: 150px; }
21
+
22
+ .trumbowyg-giphy-close {
23
+ position: absolute;
24
+ top: calc(5% + 8px);
25
+ right: calc(5% - 2px);
26
+ width: 30px;
27
+ height: 30px;
28
+ background: none;
29
+ border: 1px solid transparent; }
30
+ .trumbowyg-giphy-close:hover, .trumbowyg-giphy-close:focus {
31
+ outline: none;
32
+ background: #ecf0f1; }
33
+ .trumbowyg-giphy-close:focus {
34
+ border-color: rgba(0, 0, 0, 0.3); }
35
+
36
+ .trumbowyg-powered-by-giphy {
37
+ position: absolute;
38
+ top: calc(5% + 12px);
39
+ right: calc(15% + 10px);
40
+ pointer-events: none;
41
+ -webkit-user-select: none;
42
+ -moz-user-select: none;
43
+ -ms-user-select: none;
44
+ user-select: none; }
45
+ .trumbowyg-powered-by-giphy span {
46
+ text-transform: uppercase;
47
+ font-weight: bold;
48
+ font-size: 10px;
49
+ opacity: 0.6; }
50
+ .trumbowyg-powered-by-giphy svg {
51
+ width: 66px;
52
+ height: 15px;
53
+ vertical-align: bottom;
54
+ margin-left: 6px;
55
+ opacity: 0.45; }
56
+
57
+ .trumbowyg-giphy-modal-scroll {
58
+ overflow: auto;
59
+ overflow-x: hidden;
60
+ height: 240px; }
61
+
62
+ .trumbowyg-giphy-modal {
63
+ padding: 0 5%;
64
+ -moz-columns: 3;
65
+ columns: 3;
66
+ -moz-column-gap: 10px;
67
+ column-gap: 10px; }
68
+ .trumbowyg-giphy-modal .trumbowyg-giphy-no-result {
69
+ width: 250%;
70
+ margin: 13% 0 0 29%; }
71
+ .trumbowyg-giphy-modal .trumbowyg-giphy-offline {
72
+ font-size: 18px;
73
+ width: 305%;
74
+ height: 600px;
75
+ margin-top: 95px;
76
+ text-align: center; }
77
+
78
+ .trumbowyg-giphy-modal .img-container {
79
+ width: 100%;
80
+ margin-bottom: 10px;
81
+ background-color: #ecf0f1; }
82
+ .trumbowyg-giphy-modal .img-container img {
83
+ width: 100%;
84
+ cursor: pointer;
85
+ opacity: 0;
86
+ transition: opacity 150ms; }
87
+ .trumbowyg-giphy-modal .img-container img:hover, .trumbowyg-giphy-modal .img-container img:focus {
88
+ border: #2ecc71 solid 3px; }
89
+ .trumbowyg-giphy-modal .img-container img.tbw-loaded {
90
+ opacity: 1; }
@@ -0,0 +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 */
2
+ .trumbowyg-giphy-button svg{transform:scale(1.22)}.trumbowyg-giphy-search{display:block;width:80%;margin:5%;padding-left:10px;padding-right:150px}.trumbowyg-giphy-close{position:absolute;top:calc(5% + 8px);right:calc(5% - 2px);width:30px;height:30px;background:0 0;border:1px solid transparent}.trumbowyg-giphy-close:focus,.trumbowyg-giphy-close:hover{outline:0;background:#ecf0f1}.trumbowyg-giphy-close:focus{border-color:rgba(0,0,0,.3)}.trumbowyg-powered-by-giphy{position:absolute;top:calc(5% + 12px);right:calc(15% + 10px);pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.trumbowyg-powered-by-giphy span{text-transform:uppercase;font-weight:700;font-size:10px;opacity:.6}.trumbowyg-powered-by-giphy svg{width:66px;height:15px;vertical-align:bottom;margin-left:6px;opacity:.45}.trumbowyg-giphy-modal-scroll{overflow:auto;overflow-x:hidden;height:240px}.trumbowyg-giphy-modal{padding:0 5%;-moz-columns:3;columns:3;-moz-column-gap:10px;column-gap:10px}.trumbowyg-giphy-modal .trumbowyg-giphy-no-result{width:250%;margin:13% 0 0 29%}.trumbowyg-giphy-modal .trumbowyg-giphy-offline{font-size:18px;width:305%;height:600px;margin-top:95px;text-align:center}.trumbowyg-giphy-modal .img-container{width:100%;margin-bottom:10px;background-color:#ecf0f1}.trumbowyg-giphy-modal .img-container img{width:100%;cursor:pointer;opacity:0;transition:opacity 150ms}.trumbowyg-giphy-modal .img-container img:focus,.trumbowyg-giphy-modal .img-container img:hover{border:3px solid #2ecc71}.trumbowyg-giphy-modal .img-container img.tbw-loaded{opacity:1}
@@ -0,0 +1,90 @@
1
+ /* globals Prism */
2
+ (function ($, Prism) {
3
+ 'use strict';
4
+
5
+ // My plugin default options
6
+ var defaultOptions = {};
7
+
8
+ function highlightIt(text, language) {
9
+ return [
10
+ '<pre class="language-' + language + '">',
11
+ '<code class="language-' + language + '">' + Prism.highlight(text, Prism.languages[language]) + '</code>',
12
+ '</pre>',
13
+ ].join('');
14
+ }
15
+
16
+ // If my plugin is a button
17
+ function buildButtonDef(trumbowyg) {
18
+ return {
19
+ fn: function () {
20
+ var $modal = trumbowyg.openModal('Code', [
21
+ '<div class="' + trumbowyg.o.prefix + 'highlight-form-group">',
22
+ ' <select class="' + trumbowyg.o.prefix + 'highlight-form-control language">',
23
+ (function () {
24
+ var options = '';
25
+
26
+ for (var lang in Prism.languages) {
27
+ if (Prism.languages.hasOwnProperty(lang)) {
28
+ options += '<option value="' + lang + '">' + lang + '</option>';
29
+ }
30
+ }
31
+
32
+ return options;
33
+ })(),
34
+ ' </select>',
35
+ '</div>',
36
+ '<div class="' + trumbowyg.o.prefix + 'highlight-form-group">',
37
+ ' <textarea class="' + trumbowyg.o.prefix + 'highlight-form-control code"></textarea>',
38
+ '</div>',
39
+ ].join('\n')),
40
+ $language = $modal.find('.language'),
41
+ $code = $modal.find('.code');
42
+
43
+ // Listen clicks on modal box buttons
44
+ $modal.on('tbwconfirm', function () {
45
+ trumbowyg.restoreRange();
46
+ trumbowyg.execCmd('insertHTML', highlightIt($code.val(), $language.val()));
47
+ trumbowyg.execCmd('insertHTML', '<p><br></p>');
48
+
49
+ trumbowyg.closeModal();
50
+ });
51
+
52
+ $modal.on('tbwcancel', function () {
53
+ trumbowyg.closeModal();
54
+ });
55
+ }
56
+ };
57
+ }
58
+
59
+ $.extend(true, $.trumbowyg, {
60
+ // Add some translations
61
+ langs: {
62
+ // jshint camelcase:false
63
+ en: {
64
+ highlight: 'Code syntax highlight'
65
+ },
66
+ pt_br: {
67
+ highlight: 'Realçar sintaxe de código'
68
+ },
69
+ ko: {
70
+ highlight: '코드 문법 하이라이트'
71
+ },
72
+ // jshint camelcase:true
73
+ },
74
+ // Add our plugin to Trumbowyg registered plugins
75
+ plugins: {
76
+ highlight: {
77
+ init: function (trumbowyg) {
78
+ // Fill current Trumbowyg instance with my plugin default options
79
+ trumbowyg.o.plugins.highlight = $.extend(true, {},
80
+ defaultOptions,
81
+ trumbowyg.o.plugins.highlight || {}
82
+ );
83
+
84
+ // If my plugin is a button
85
+ trumbowyg.addBtnDef('highlight', buildButtonDef(trumbowyg));
86
+ }
87
+ }
88
+ }
89
+ });
90
+ })(jQuery, Prism);
@@ -0,0 +1 @@
1
+ !function(i,n){"use strict";function e(i,e){return['<pre class="language-'+e+'">','<code class="language-'+e+'">'+n.highlight(i,n.languages[e])+"</code>","</pre>"].join("")}function o(i){return{fn:function(){var o=i.openModal("Code",['<div class="'+i.o.prefix+'highlight-form-group">',' <select class="'+i.o.prefix+'highlight-form-control language">',function(){var i="";for(var e in n.languages)n.languages.hasOwnProperty(e)&&(i+='<option value="'+e+'">'+e+"</option>");return i}()," </select>","</div>",'<div class="'+i.o.prefix+'highlight-form-group">',' <textarea class="'+i.o.prefix+'highlight-form-control code"></textarea>',"</div>"].join("\n")),t=o.find(".language"),g=o.find(".code");o.on("tbwconfirm",function(){i.restoreRange(),i.execCmd("insertHTML",e(g.val(),t.val())),i.execCmd("insertHTML","<p><br></p>"),i.closeModal()}),o.on("tbwcancel",function(){i.closeModal()})}}}var t={};i.extend(!0,i.trumbowyg,{langs:{en:{highlight:"Code syntax highlight"},pt_br:{highlight:"Realçar sintaxe de código"},ko:{highlight:"코드 문법 하이라이트"}},plugins:{highlight:{init:function(n){n.o.plugins.highlight=i.extend(!0,{},t,n.o.plugins.highlight||{}),n.addBtnDef("highlight",o(n))}}}})}(jQuery,Prism);
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Trumbowyg v2.21.0 - 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-highlight-form-group {
13
+ margin: 15px 10px;
14
+
15
+ .trumbowyg-highlight-form-control {
16
+ width: 100%;
17
+ border: 1px solid #DEDEDE;
18
+ font-size: 14px;
19
+ padding: 7px;
20
+
21
+ &.code {
22
+ height: 200px;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Trumbowyg v2.21.0 - 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-highlight-form-group {
13
+ margin: 15px 10px; }
14
+ .trumbowyg-highlight-form-group .trumbowyg-highlight-form-control {
15
+ width: 100%;
16
+ border: 1px solid #DEDEDE;
17
+ font-size: 14px;
18
+ padding: 7px; }
19
+ .trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code {
20
+ height: 200px; }
@@ -0,0 +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 */
2
+ .trumbowyg-highlight-form-group{margin:15px 10px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control{width:100%;border:1px solid #DEDEDE;font-size:14px;padding:7px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code{height:200px}
@@ -0,0 +1,216 @@
1
+ /*/* ===========================================================
2
+ * trumbowyg.history.js v1.0
3
+ * history plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Sven Dunemann [dunemann@forelabs.eu]
7
+ */
8
+
9
+ (function ($) {
10
+ 'use strict';
11
+ $.extend(true, $.trumbowyg, {
12
+ langs: {
13
+ // jshint camelcase:false
14
+ de: {
15
+ history: {
16
+ redo: 'Wiederholen',
17
+ undo: 'Rückgängig'
18
+ }
19
+ },
20
+ en: {
21
+ history: {
22
+ redo: 'Redo',
23
+ undo: 'Undo'
24
+ }
25
+ },
26
+ da: {
27
+ history: {
28
+ redo: 'Annuller fortryd',
29
+ undo: 'Fortryd'
30
+ }
31
+ },
32
+ fr: {
33
+ history: {
34
+ redo: 'Annuler',
35
+ undo: 'Rétablir'
36
+ }
37
+ },
38
+ zh_tw: {
39
+ history: {
40
+ redo: '重做',
41
+ undo: '復原'
42
+ }
43
+ },
44
+ pt_br: {
45
+ history: {
46
+ redo: 'Refazer',
47
+ undo: 'Desfazer'
48
+ }
49
+ },
50
+ ko: {
51
+ history: {
52
+ redo: '다시 실행',
53
+ undo: '되돌리기'
54
+ }
55
+ },
56
+ // jshint camelcase:true
57
+ },
58
+ plugins: {
59
+ history: {
60
+ init: function (t) {
61
+ t.o.plugins.history = $.extend(true, {
62
+ _stack: [],
63
+ _index: -1,
64
+ _focusEl: undefined
65
+ }, t.o.plugins.history || {});
66
+
67
+ var btnBuildDefRedo = {
68
+ title: t.lang.history.redo,
69
+ ico: 'redo',
70
+ key: 'Y',
71
+ fn: function () {
72
+ if (t.o.plugins.history._index < t.o.plugins.history._stack.length - 1) {
73
+ t.o.plugins.history._index += 1;
74
+ var index = t.o.plugins.history._index;
75
+ var newState = t.o.plugins.history._stack[index];
76
+
77
+ t.execCmd('html', newState);
78
+ // because of some semantic optimisations we have to save the state back
79
+ // to history
80
+ t.o.plugins.history._stack[index] = t.$ed.html();
81
+
82
+ carretToEnd();
83
+ toggleButtonStates();
84
+ }
85
+ }
86
+ };
87
+
88
+ var btnBuildDefUndo = {
89
+ title: t.lang.history.undo,
90
+ ico: 'undo',
91
+ key: 'Z',
92
+ fn: function () {
93
+ if (t.o.plugins.history._index > 0) {
94
+ t.o.plugins.history._index -= 1;
95
+ var index = t.o.plugins.history._index,
96
+ newState = t.o.plugins.history._stack[index];
97
+
98
+ t.execCmd('html', newState);
99
+ // because of some semantic optimisations we have to save the state back
100
+ // to history
101
+ t.o.plugins.history._stack[index] = t.$ed.html();
102
+
103
+ carretToEnd();
104
+ toggleButtonStates();
105
+ }
106
+ }
107
+ };
108
+
109
+ var pushToHistory = function () {
110
+ var index = t.o.plugins.history._index,
111
+ stack = t.o.plugins.history._stack,
112
+ latestState = stack.slice(-1)[0] || '<p></p>',
113
+ prevState = stack[index],
114
+ newState = t.$ed.html(),
115
+ focusEl = t.doc.getSelection().focusNode,
116
+ focusElText = '',
117
+ latestStateTagsList,
118
+ newStateTagsList,
119
+ prevFocusEl = t.o.plugins.history._focusEl;
120
+
121
+ latestStateTagsList = $('<div>' + latestState + '</div>').find('*').map(function () {
122
+ return this.localName;
123
+ });
124
+ newStateTagsList = $('<div>' + newState + '</div>').find('*').map(function () {
125
+ return this.localName;
126
+ });
127
+ if (focusEl) {
128
+ t.o.plugins.history._focusEl = focusEl;
129
+ focusElText = focusEl.outerHTML || focusEl.textContent;
130
+ }
131
+
132
+ if (newState !== prevState) {
133
+ // a new stack entry is defined when current insert ends on a whitespace character
134
+ // or count of node elements has been changed
135
+ // or focused element differs from previous one
136
+ if (focusElText.slice(-1).match(/\s/) ||
137
+ !arraysAreIdentical(latestStateTagsList, newStateTagsList) ||
138
+ t.o.plugins.history._index <= 0 || focusEl !== prevFocusEl)
139
+ {
140
+ t.o.plugins.history._index += 1;
141
+ // remove newer entries in history when something new was added
142
+ // because timeline was changes with interaction
143
+ t.o.plugins.history._stack = stack.slice(
144
+ 0, t.o.plugins.history._index
145
+ );
146
+ // now add new state to modified history
147
+ t.o.plugins.history._stack.push(newState);
148
+ } else {
149
+ // modify last stack entry
150
+ t.o.plugins.history._stack[index] = newState;
151
+ }
152
+
153
+ toggleButtonStates();
154
+ }
155
+ };
156
+
157
+ var toggleButtonStates = function () {
158
+ var index = t.o.plugins.history._index,
159
+ stackSize = t.o.plugins.history._stack.length,
160
+ undoState = (index > 0),
161
+ redoState = (stackSize !== 0 && index !== stackSize - 1);
162
+
163
+ toggleButtonState('historyUndo', undoState);
164
+ toggleButtonState('historyRedo', redoState);
165
+ };
166
+
167
+ var toggleButtonState = function (btn, enable) {
168
+ var button = t.$box.find('.trumbowyg-' + btn + '-button');
169
+
170
+ if (enable) {
171
+ button.removeClass('trumbowyg-disable');
172
+ } else if (!button.hasClass('trumbowyg-disable')) {
173
+ button.addClass('trumbowyg-disable');
174
+ }
175
+ };
176
+
177
+ var arraysAreIdentical = function (a, b) {
178
+ if (a === b) {
179
+ return true;
180
+ }
181
+ if (a == null || b == null) {
182
+ return false;
183
+ }
184
+ if (a.length !== b.length) {
185
+ return false;
186
+ }
187
+
188
+ for (var i = 0; i < a.length; i += 1) {
189
+ if (a[i] !== b[i]) {
190
+ return false;
191
+ }
192
+ }
193
+ return true;
194
+ };
195
+
196
+ var carretToEnd = function () {
197
+ var node = t.doc.getSelection().focusNode,
198
+ range = t.doc.createRange();
199
+
200
+ if (node.childNodes.length > 0) {
201
+ range.setStartAfter(node.childNodes[node.childNodes.length - 1]);
202
+ range.setEndAfter(node.childNodes[node.childNodes.length - 1]);
203
+ t.doc.getSelection().removeAllRanges();
204
+ t.doc.getSelection().addRange(range);
205
+ }
206
+ };
207
+
208
+ t.$c.on('tbwinit tbwchange', pushToHistory);
209
+
210
+ t.addBtnDef('historyRedo', btnBuildDefRedo);
211
+ t.addBtnDef('historyUndo', btnBuildDefUndo);
212
+ }
213
+ }
214
+ }
215
+ });
216
+ })(jQuery);