activeadmin_trumbowyg 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +7 -2
  3. data/app/assets/fonts/trumbowyg/icons.svg +1 -0
  4. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ar.js +67 -0
  5. data/app/assets/javascripts/activeadmin/trumbowyg/langs/bg.js +54 -0
  6. data/app/assets/javascripts/activeadmin/trumbowyg/langs/by.js +61 -0
  7. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ca.js +57 -0
  8. data/app/assets/javascripts/activeadmin/trumbowyg/langs/cs.js +54 -0
  9. data/app/assets/javascripts/activeadmin/trumbowyg/langs/da.js +64 -0
  10. data/app/assets/javascripts/activeadmin/trumbowyg/langs/da.min.js +1 -1
  11. data/app/assets/javascripts/activeadmin/trumbowyg/langs/de.js +57 -0
  12. data/app/assets/javascripts/activeadmin/trumbowyg/langs/de.min.js +1 -1
  13. data/app/assets/javascripts/activeadmin/trumbowyg/langs/el.js +59 -0
  14. data/app/assets/javascripts/activeadmin/trumbowyg/langs/es.js +63 -0
  15. data/app/assets/javascripts/activeadmin/trumbowyg/langs/es_ar.js +56 -0
  16. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fa.js +58 -0
  17. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fa.min.js +1 -1
  18. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fi.js +58 -0
  19. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fr.js +66 -0
  20. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fr.min.js +3 -1
  21. data/app/assets/javascripts/activeadmin/trumbowyg/langs/he.js +57 -0
  22. data/app/assets/javascripts/activeadmin/trumbowyg/langs/hr.js +54 -0
  23. data/app/assets/javascripts/activeadmin/trumbowyg/langs/hu.js +58 -0
  24. data/app/assets/javascripts/activeadmin/trumbowyg/langs/id.js +57 -0
  25. data/app/assets/javascripts/activeadmin/trumbowyg/langs/it.js +59 -0
  26. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ja.js +63 -0
  27. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ko.js +63 -0
  28. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ko.min.js +3 -4
  29. data/app/assets/javascripts/activeadmin/trumbowyg/langs/lt.js +59 -0
  30. data/app/assets/javascripts/activeadmin/trumbowyg/langs/lt.min.js +8 -0
  31. data/app/assets/javascripts/activeadmin/trumbowyg/langs/mn.js +49 -0
  32. data/app/assets/javascripts/activeadmin/trumbowyg/langs/my.js +54 -0
  33. data/app/assets/javascripts/activeadmin/trumbowyg/langs/nl.js +61 -0
  34. data/app/assets/javascripts/activeadmin/trumbowyg/langs/nl.min.js +1 -1
  35. data/app/assets/javascripts/activeadmin/trumbowyg/langs/no_nb.js +56 -0
  36. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ph.js +54 -0
  37. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pl.js +55 -0
  38. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt.js +65 -0
  39. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt_br.js +65 -0
  40. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt_br.min.js +1 -1
  41. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ro.js +58 -0
  42. data/app/assets/javascripts/activeadmin/trumbowyg/langs/rs.js +53 -0
  43. data/app/assets/javascripts/activeadmin/trumbowyg/langs/rs_latin.js +54 -0
  44. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ru.js +61 -0
  45. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ru.min.js +1 -1
  46. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sk.js +54 -0
  47. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sl.js +48 -0
  48. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sl.min.js +1 -0
  49. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sq.js +65 -0
  50. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sq.min.js +8 -0
  51. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sv.js +58 -0
  52. data/app/assets/javascripts/activeadmin/trumbowyg/langs/th.js +55 -0
  53. data/app/assets/javascripts/activeadmin/trumbowyg/langs/th.min.js +9 -0
  54. data/app/assets/javascripts/activeadmin/trumbowyg/langs/tr.js +55 -0
  55. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ua.js +54 -0
  56. data/app/assets/javascripts/activeadmin/trumbowyg/langs/vi.js +56 -0
  57. data/app/assets/javascripts/activeadmin/trumbowyg/langs/vi.min.js +1 -1
  58. data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_cn.js +57 -0
  59. data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_tw.js +66 -0
  60. data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_tw.min.js +1 -1
  61. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js +162 -0
  62. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js +1 -0
  63. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +34 -2
  64. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +1 -1
  65. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +29 -97
  66. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +1 -1
  67. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +109 -35
  68. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +1 -1
  69. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +30 -11
  70. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +27 -15
  71. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +2 -2
  72. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +1265 -877
  73. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +1 -1
  74. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +1 -4
  75. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +2 -5
  76. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +2 -2
  77. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js +95 -0
  78. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js +1 -0
  79. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js +257 -0
  80. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js +1 -0
  81. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/trumbowyg.giphy.js +182 -0
  82. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/trumbowyg.giphy.min.js +1 -0
  83. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/sass/trumbowyg.giphy.scss +111 -0
  84. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.css +90 -0
  85. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.min.css +2 -0
  86. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.js +90 -0
  87. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js +1 -0
  88. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss +25 -0
  89. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css +20 -0
  90. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css +2 -0
  91. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.js +216 -0
  92. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.min.js +1 -0
  93. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +19 -2
  94. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +1 -1
  95. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.js +162 -0
  96. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.min.js +1 -0
  97. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.js +117 -0
  98. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.min.js +1 -0
  99. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/sass/trumbowyg.mathml.scss +36 -0
  100. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.css +29 -0
  101. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.min.css +2 -0
  102. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.js +116 -0
  103. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.min.js +1 -0
  104. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/sass/trumbowyg.mention.scss +29 -0
  105. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.css +24 -0
  106. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.min.css +2 -0
  107. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +21 -1
  108. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +1 -1
  109. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.js +96 -0
  110. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.min.js +1 -0
  111. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +10 -2
  112. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +1 -1
  113. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +22 -3
  114. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +1 -1
  115. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/resizable-resolveconflict.js +20 -0
  116. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/resizable-resolveconflict.min.js +1 -0
  117. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.js +303 -0
  118. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.min.js +1 -0
  119. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.js +94 -0
  120. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.min.js +1 -0
  121. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/trumbowyg.specialchars.js +79 -0
  122. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/trumbowyg.specialchars.min.js +1 -0
  123. 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
  124. data/app/assets/{stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css → javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.css} +12 -12
  125. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.min.css +2 -0
  126. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +346 -81
  127. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +1 -1
  128. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss +46 -0
  129. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.css +36 -0
  130. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.min.css +2 -0
  131. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +32 -9
  132. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +1 -1
  133. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +58 -23
  134. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +1 -1
  135. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.js +427 -188
  136. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.min.js +2 -2
  137. data/app/assets/javascripts/activeadmin/trumbowyg_input.js +17 -4
  138. data/app/assets/stylesheets/activeadmin/_trumbowyg_input.sass +11 -3
  139. data/app/assets/stylesheets/activeadmin/trumbowyg/{ui/sass/trumbowyg.scss → trumbowyg.scss} +44 -16
  140. data/lib/activeadmin/trumbowyg/version.rb +1 -1
  141. data/lib/tasks/trumbowyg.rake +21 -0
  142. metadata +230 -91
  143. data/.gitignore +0 -3
  144. data/Gemfile +0 -4
  145. data/activeadmin_trumbowyg.gemspec +0 -19
  146. data/app/assets/fonts/ui/icons.svg +0 -1
  147. data/app/assets/javascripts/activeadmin/trumbowyg/ui/icons.svg +0 -1
  148. data/app/assets/javascripts/activeadmin/trumbowyg/ui/sass/trumbowyg.scss +0 -796
  149. data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.css +0 -584
  150. data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.min.css +0 -2
  151. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ar.min.js +0 -11
  152. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/bg.min.js +0 -8
  153. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/by.min.js +0 -8
  154. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ca.min.js +0 -11
  155. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/cs.min.js +0 -8
  156. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/da.min.js +0 -9
  157. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/de.min.js +0 -9
  158. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/el.min.js +0 -12
  159. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es.min.js +0 -9
  160. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es_ar.min.js +0 -10
  161. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fa.min.js +0 -10
  162. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fi.min.js +0 -9
  163. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fr.min.js +0 -10
  164. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/he.min.js +0 -9
  165. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hr.min.js +0 -9
  166. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hu.min.js +0 -10
  167. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/id.min.js +0 -11
  168. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/it.min.js +0 -8
  169. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ja.min.js +0 -10
  170. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ko.min.js +0 -10
  171. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/mn.min.js +0 -8
  172. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/my.min.js +0 -8
  173. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/nl.min.js +0 -9
  174. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/no_nb.min.js +0 -10
  175. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ph.min.js +0 -8
  176. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pl.min.js +0 -9
  177. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt.min.js +0 -11
  178. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt_br.min.js +0 -11
  179. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ro.min.js +0 -12
  180. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs.min.js +0 -8
  181. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs_latin.min.js +0 -9
  182. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ru.min.js +0 -8
  183. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sk.min.js +0 -8
  184. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sv.min.js +0 -12
  185. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/tr.min.js +0 -9
  186. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ua.min.js +0 -8
  187. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/vi.min.js +0 -9
  188. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_cn.min.js +0 -11
  189. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_tw.min.js +0 -11
  190. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +0 -121
  191. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +0 -1
  192. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +0 -179
  193. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +0 -1
  194. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +0 -176
  195. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +0 -1
  196. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +0 -49
  197. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +0 -43
  198. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +0 -2
  199. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +0 -965
  200. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +0 -1
  201. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +0 -2
  202. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +0 -83
  203. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +0 -1
  204. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +0 -101
  205. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +0 -1
  206. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +0 -41
  207. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +0 -1
  208. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +0 -123
  209. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +0 -1
  210. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +0 -154
  211. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +0 -1
  212. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +0 -58
  213. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +0 -1
  214. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +0 -242
  215. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +0 -1
  216. data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.js +0 -1688
  217. data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.min.js +0 -2
  218. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/icons.svg +0 -1
  219. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.css +0 -584
  220. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.min.css +0 -2
  221. data/screenshot.jpg +0 -0
@@ -0,0 +1 @@
1
+ !function(e){"use strict";var a={allowedTags:[],removableTags:["a","abbr","address","b","bdi","bdo","blockquote","br","cite","code","del","dfn","details","em","h1","h2","h3","h4","h5","h6","hr","i","ins","kbd","mark","meter","pre","progress","q","rp","rt","ruby","s","samp","small","span","strong","sub","summary","sup","time","u","var","wbr","img","map","area","canvas","figcaption","figure","picture","audio","source","track","video","ul","ol","li","dl","dt","dd","table","caption","th","tr","td","thead","tbody","tfoot","col","colgroup","style","div","p","form","input","textarea","button","select","optgroup","option","label","fieldset","legend","datalist","keygen","output","iframe","link","nav","header","hgroup","footer","main","section","article","aside","dialog","script","noscript","embed","object","param"]};e.extend(!0,e.trumbowyg,{plugins:{allowTagsFromPaste:{init:function(t){if(t.o.removeformatPasted=!1,t.o.plugins.allowTagsFromPaste){var o=t.o.plugins.allowTagsFromPaste.allowedTags||a.allowedTags,r=t.o.plugins.allowTagsFromPaste.removableTags||a.removableTags;if(0!==o.length){var s=e(r).not(o).get();t.pasteHandlers.push(function(){setTimeout(function(){var a=t.$ed.html();e.each(s,function(e,t){a=a.replace(new RegExp("<\\/?"+t+"(\\s[^>]*)?>","gi"),"")}),t.$ed.html(a)},0)})}}}}}})}(jQuery);
@@ -26,6 +26,12 @@
26
26
  errFileReaderNotSupported: 'FileReader is not supported by your browser.',
27
27
  errInvalidImage: 'Invalid image file.'
28
28
  },
29
+ da: {
30
+ base64: 'Billede som base64',
31
+ file: 'Fil',
32
+ errFileReaderNotSupported: 'FileReader er ikke understøttet af din browser.',
33
+ errInvalidImage: 'Ugyldig billedfil.'
34
+ },
29
35
  fr: {
30
36
  base64: 'Image en base64',
31
37
  file: 'Fichier'
@@ -39,6 +45,8 @@
39
45
  file: '文件'
40
46
  },
41
47
  nl: {
48
+ base64: 'Afbeelding inline',
49
+ file: 'Bestand',
42
50
  errFileReaderNotSupported: 'Uw browser ondersteunt deze functionaliteit niet.',
43
51
  errInvalidImage: 'De gekozen afbeelding is ongeldig.'
44
52
  },
@@ -53,7 +61,31 @@
53
61
  file: 'ファイル',
54
62
  errFileReaderNotSupported: 'あなたのブラウザーはFileReaderをサポートしていません',
55
63
  errInvalidImage: '画像形式が正しくありません'
56
- }
64
+ },
65
+ tr: {
66
+ base64: 'Base64 olarak resim',
67
+ file: 'Dosya',
68
+ errFileReaderNotSupported: 'FileReader tarayıcınız tarafından desteklenmiyor.',
69
+ errInvalidImage: 'Geçersiz resim dosyası.'
70
+ },
71
+ zh_tw: {
72
+ base64: '圖片(base64編碼)',
73
+ file: '檔案',
74
+ errFileReaderNotSupported: '你的瀏覽器不支援FileReader',
75
+ errInvalidImage: '不正確的檔案格式'
76
+ },
77
+ pt_br: {
78
+ base64: 'Imagem em base64',
79
+ file: 'Arquivo',
80
+ errFileReaderNotSupported: 'FileReader não é suportado pelo seu navegador.',
81
+ errInvalidImage: 'Arquivo de imagem inválido.'
82
+ },
83
+ ko: {
84
+ base64: '그림 넣기(base64)',
85
+ file: '파일',
86
+ errFileReaderNotSupported: 'FileReader가 현재 브라우저를 지원하지 않습니다.',
87
+ errInvalidImage: '유효하지 않은 파일'
88
+ },
57
89
  },
58
90
  // jshint camelcase:true
59
91
 
@@ -92,7 +124,7 @@
92
124
 
93
125
  fReader.onloadend = function (e) {
94
126
  if (isValidImage(e.target.result)) {
95
- trumbowyg.execCmd('insertImage', fReader.result);
127
+ trumbowyg.execCmd('insertImage', fReader.result, false, true);
96
128
  $(['img[src="', fReader.result, '"]:not([alt])'].join(''), trumbowyg.$box).attr('alt', values.alt);
97
129
  trumbowyg.closeModal();
98
130
  } else {
@@ -1 +1 @@
1
- !function(e){"use strict";var a=function(){return"undefined"!=typeof FileReader},r=function(e){return/^data:image\/[a-z]?/i.test(e)};e.extend(!0,e.trumbowyg,{langs:{en:{base64:"Image as base64",file:"File",errFileReaderNotSupported:"FileReader is not supported by your browser.",errInvalidImage:"Invalid image file."},fr:{base64:"Image en base64",file:"Fichier"},cs:{base64:"Vložit obrázek",file:"Soubor"},zh_cn:{base64:"图片(Base64编码)",file:"文件"},nl:{errFileReaderNotSupported:"Uw browser ondersteunt deze functionaliteit niet.",errInvalidImage:"De gekozen afbeelding is ongeldig."},ru:{base64:"Изображение как код в base64",file:"Файл",errFileReaderNotSupported:"FileReader не поддерживается вашим браузером.",errInvalidImage:"Недопустимый файл изображения."},ja:{base64:"画像 (Base64形式)",file:"ファイル",errFileReaderNotSupported:"あなたのブラウザーはFileReaderをサポートしていません",errInvalidImage:"画像形式が正しくありません"}},plugins:{base64:{shouldInit:a,init:function(i){var t={isSupported:a,fn:function(){i.saveRange();var a,t=i.openModalInsert(i.lang.base64,{file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:i.getRangeText()}},function(n){var l=new FileReader;l.onloadend=function(a){r(a.target.result)?(i.execCmd("insertImage",l.result),e(['img[src="',l.result,'"]:not([alt])'].join(""),i.$box).attr("alt",n.alt),i.closeModal()):i.addErrorOnModalField(e("input[type=file]",t),i.lang.errInvalidImage)},l.readAsDataURL(a)});e("input[type=file]").on("change",function(e){a=e.target.files[0]})}};i.addBtnDef("base64",t)}}}})}(jQuery);
1
+ !function(e){"use strict";var a=function(){return"undefined"!=typeof FileReader},r=function(e){return/^data:image\/[a-z]?/i.test(e)};e.extend(!0,e.trumbowyg,{langs:{en:{base64:"Image as base64",file:"File",errFileReaderNotSupported:"FileReader is not supported by your browser.",errInvalidImage:"Invalid image file."},da:{base64:"Billede som base64",file:"Fil",errFileReaderNotSupported:"FileReader er ikke understøttet af din browser.",errInvalidImage:"Ugyldig billedfil."},fr:{base64:"Image en base64",file:"Fichier"},cs:{base64:"Vložit obrázek",file:"Soubor"},zh_cn:{base64:"图片(Base64编码)",file:"文件"},nl:{base64:"Afbeelding inline",file:"Bestand",errFileReaderNotSupported:"Uw browser ondersteunt deze functionaliteit niet.",errInvalidImage:"De gekozen afbeelding is ongeldig."},ru:{base64:"Изображение как код в base64",file:"Файл",errFileReaderNotSupported:"FileReader не поддерживается вашим браузером.",errInvalidImage:"Недопустимый файл изображения."},ja:{base64:"画像 (Base64形式)",file:"ファイル",errFileReaderNotSupported:"あなたのブラウザーはFileReaderをサポートしていません",errInvalidImage:"画像形式が正しくありません"},tr:{base64:"Base64 olarak resim",file:"Dosya",errFileReaderNotSupported:"FileReader tarayıcınız tarafından desteklenmiyor.",errInvalidImage:"Geçersiz resim dosyası."},zh_tw:{base64:"圖片(base64編碼)",file:"檔案",errFileReaderNotSupported:"你的瀏覽器不支援FileReader",errInvalidImage:"不正確的檔案格式"},pt_br:{base64:"Imagem em base64",file:"Arquivo",errFileReaderNotSupported:"FileReader não é suportado pelo seu navegador.",errInvalidImage:"Arquivo de imagem inválido."},ko:{base64:"그림 넣기(base64)",file:"파일",errFileReaderNotSupported:"FileReader가 현재 브라우저를 지원하지 않습니다.",errInvalidImage:"유효하지 않은 파일"}},plugins:{base64:{shouldInit:a,init:function(i){var t={isSupported:a,fn:function(){i.saveRange();var a,t=i.openModalInsert(i.lang.base64,{file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:i.getRangeText()}},function(l){var n=new FileReader;n.onloadend=function(a){r(a.target.result)?(i.execCmd("insertImage",n.result,!1,!0),e(['img[src="',n.result,'"]:not([alt])'].join(""),i.$box).attr("alt",l.alt),i.closeModal()):i.addErrorOnModalField(e("input[type=file]",t),i.lang.errInvalidImage)},n.readAsDataURL(a)});e("input[type=file]").on("change",function(e){a=e.target.files[0]})}};i.addBtnDef("base64",t)}}}})}(jQuery);
@@ -3,24 +3,16 @@
3
3
  * Font Clean paste plugin for Trumbowyg
4
4
  * http://alex-d.github.com/Trumbowyg
5
5
  * ===========================================================
6
- * Author : Eric Radin
7
- */
8
-
9
- /**
6
+ * Authors : Eric Radin
7
+ * Todd Graham (slackwalker)
8
+ *
10
9
  * This plugin will perform a "cleaning" on any paste, in particular
11
10
  * it will clean pasted content of microsoft word document tags and classes.
12
11
  */
12
+
13
13
  (function ($) {
14
14
  'use strict';
15
15
 
16
- function reverse(sentString) {
17
- var theString = '';
18
- for (var i = sentString.length - 1; i >= 0; i -= 1) {
19
- theString += sentString.charAt(i);
20
- }
21
- return theString;
22
- }
23
-
24
16
  function checkValidTags(snippet) {
25
17
  var theString = snippet;
26
18
 
@@ -46,90 +38,36 @@
46
38
  return theString;
47
39
  }
48
40
 
49
- function cleanIt(htmlBefore, htmlAfter) {
50
- var matchedHead = '';
51
- var matchedTail = '';
52
- var afterStart;
53
- var afterFinish;
54
- var newSnippet;
55
-
56
- // we need to extract the inserted block
57
- for (afterStart = 0; htmlAfter.charAt(afterStart) === htmlBefore.charAt(afterStart); afterStart += 1) {
58
- matchedHead += htmlAfter.charAt(afterStart);
59
- }
60
-
61
- // If afterStart is inside a HTML tag, move to opening brace of tag
62
- for (var i = afterStart; i >= 0; i -= 1) {
63
- if (htmlBefore.charAt(i) === '<') {
64
- afterStart = i;
65
- matchedHead = htmlBefore.substring(0, afterStart);
66
- break;
67
- } else if (htmlBefore.charAt(i) === '>') {
68
- break;
69
- }
70
- }
71
-
72
- // now reverse string and work from the end in
73
- htmlAfter = reverse(htmlAfter);
74
- htmlBefore = reverse(htmlBefore);
75
-
76
- // Find end of both strings that matches
77
- for (afterFinish = 0; htmlAfter.charAt(afterFinish) === htmlBefore.charAt(afterFinish); afterFinish += 1) {
78
- matchedTail += htmlAfter.charAt(afterFinish);
79
- }
80
-
81
- // If afterFinish is inside a HTML tag, move to closing brace of tag
82
- for (var j = afterFinish; j >= 0; j -= 1) {
83
- if (htmlBefore.charAt(j) === '>') {
84
- afterFinish = j;
85
- matchedTail = htmlBefore.substring(0, afterFinish);
86
- break;
87
- } else if (htmlBefore.charAt(j) === '<') {
88
- break;
89
- }
90
- }
91
-
92
- matchedTail = reverse(matchedTail);
93
-
94
- // If there's no difference in pasted content
95
- if (afterStart === (htmlAfter.length - afterFinish)) {
96
- return false;
97
- }
98
-
99
- htmlAfter = reverse(htmlAfter);
100
- newSnippet = htmlAfter.substring(afterStart, htmlAfter.length - afterFinish);
101
-
41
+ function cleanIt(html) {
102
42
  // first make sure all tags and attributes are made valid
103
- newSnippet = checkValidTags(newSnippet);
43
+ html = checkValidTags(html);
104
44
 
105
45
  // Replace opening bold tags with strong
106
- newSnippet = newSnippet.replace(/<b(\s+|>)/g, '<strong$1');
46
+ html = html.replace(/<b(\s+|>)/g, '<strong$1');
107
47
  // Replace closing bold tags with closing strong
108
- newSnippet = newSnippet.replace(/<\/b(\s+|>)/g, '</strong$1');
48
+ html = html.replace(/<\/b(\s+|>)/g, '</strong$1');
109
49
 
110
50
  // Replace italic tags with em
111
- newSnippet = newSnippet.replace(/<i(\s+|>)/g, '<em$1');
51
+ html = html.replace(/<i(\s+|>)/g, '<em$1');
112
52
  // Replace closing italic tags with closing em
113
- newSnippet = newSnippet.replace(/<\/i(\s+|>)/g, '</em$1');
53
+ html = html.replace(/<\/i(\s+|>)/g, '</em$1');
114
54
 
115
55
  // strip out comments -cgCraft
116
- newSnippet = newSnippet.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g, '');
56
+ html = html.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g, '');
117
57
 
118
58
  // strip out &nbsp; -cgCraft
119
- newSnippet = newSnippet.replace(/&nbsp;/gi, ' ');
59
+ html = html.replace(/&nbsp;/gi, ' ');
120
60
  // strip out extra spaces -cgCraft
121
- newSnippet = newSnippet.replace(/ <\//gi, '</');
61
+ html = html.replace(/ <\//gi, '</');
122
62
 
123
- while (newSnippet.indexOf(' ') !== -1) {
124
- var anArray = newSnippet.split(' ');
125
- newSnippet = anArray.join(' ');
126
- }
63
+ // Remove multiple spaces
64
+ html.replace(/\s+/g, ' ');
127
65
 
128
66
  // strip &nbsp; -cgCraft
129
- newSnippet = newSnippet.replace(/^\s*|\s*$/g, '');
67
+ html = html.replace(/^\s*|\s*$/g, '');
130
68
 
131
69
  // Strip out unaccepted attributes
132
- newSnippet = newSnippet.replace(/<[^>]*>/g, function (match) {
70
+ html = html.replace(/<[^>]*>/g, function (match) {
133
71
  match = match.replace(/ ([^=]+)="[^"]*"/g, function (match2, attributeName) {
134
72
  if (['alt', 'href', 'src', 'title'].indexOf(attributeName) !== -1) {
135
73
  return match2;
@@ -139,16 +77,15 @@
139
77
  return match;
140
78
  });
141
79
 
142
- // Final cleanout for MS Word crud
143
- newSnippet = newSnippet.replace(/<\?xml[^>]*>/g, '');
144
- newSnippet = newSnippet.replace(/<[^ >]+:[^>]*>/g, '');
145
- newSnippet = newSnippet.replace(/<\/[^ >]+:[^>]*>/g, '');
80
+ // Final clean out for MS Word crud
81
+ html = html.replace(/<\?xml[^>]*>/g, '');
82
+ html = html.replace(/<[^ >]+:[^>]*>/g, '');
83
+ html = html.replace(/<\/[^ >]+:[^>]*>/g, '');
146
84
 
147
85
  // remove unwanted tags
148
- newSnippet = newSnippet.replace(/<(div|span|style|meta|link){1}.*?>/gi, '');
86
+ html = html.replace(/<(div|span|style|meta|link).*?>/gi, '');
149
87
 
150
- htmlAfter = matchedHead + newSnippet + matchedTail;
151
- return htmlAfter;
88
+ return html;
152
89
  }
153
90
 
154
91
  // clean editor
@@ -160,20 +97,15 @@
160
97
  cleanPaste: {
161
98
  init: function (trumbowyg) {
162
99
  trumbowyg.pasteHandlers.push(function () {
163
- try {
164
- var contentBefore = trumbowyg.$ed.html();
165
- setTimeout(function () {
166
- var contentAfter = trumbowyg.$ed.html();
167
- contentAfter = cleanIt(contentBefore, contentAfter);
168
- trumbowyg.$ed.html(contentAfter);
169
- }, 0);
170
- } catch (c) {
171
- }
100
+ setTimeout(function () {
101
+ try {
102
+ trumbowyg.$ed.html(cleanIt(trumbowyg.$ed.html()));
103
+ } catch (c) {
104
+ }
105
+ }, 0);
172
106
  });
173
107
  }
174
108
  }
175
109
  }
176
110
  });
177
111
  })(jQuery);
178
-
179
-
@@ -1 +1 @@
1
- !function(r){"use strict";function e(r){for(var e="",t=r.length-1;t>=0;t-=1)e+=r.charAt(t);return e}function t(r){var e=r;return e=e.replace(/<[^> ]*/g,function(r){return r.toLowerCase()}),e=e.replace(/<[^>]*>/g,function(r){return r=r.replace(/ [^=]+=/g,function(r){return r.toLowerCase()})}),e=e.replace(/<[^>]*>/g,function(r){return r=r.replace(/( [^=]+=)([^"][^ >]*)/g,'$1"$2"')})}function n(r,n){var a,c,i,l="",s="";for(a=0;n.charAt(a)===r.charAt(a);a+=1)l+=n.charAt(a);for(var u=a;u>=0;u-=1){if("<"===r.charAt(u)){a=u,l=r.substring(0,a);break}if(">"===r.charAt(u))break}for(n=e(n),r=e(r),c=0;n.charAt(c)===r.charAt(c);c+=1)s+=n.charAt(c);for(var g=c;g>=0;g-=1){if(">"===r.charAt(g)){c=g,s=r.substring(0,c);break}if("<"===r.charAt(g))break}if(s=e(s),a===n.length-c)return!1;for(n=e(n),i=n.substring(a,n.length-c),i=t(i),i=i.replace(/<b(\s+|>)/g,"<strong$1"),i=i.replace(/<\/b(\s+|>)/g,"</strong$1"),i=i.replace(/<i(\s+|>)/g,"<em$1"),i=i.replace(/<\/i(\s+|>)/g,"</em$1"),i=i.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g,""),i=i.replace(/&nbsp;/gi," "),i=i.replace(/ <\//gi,"</");-1!==i.indexOf(" ");){var o=i.split(" ");i=o.join(" ")}return i=i.replace(/^\s*|\s*$/g,""),i=i.replace(/<[^>]*>/g,function(r){return r=r.replace(/ ([^=]+)="[^"]*"/g,function(r,e){return-1!==["alt","href","src","title"].indexOf(e)?r:""})}),i=i.replace(/<\?xml[^>]*>/g,""),i=i.replace(/<[^ >]+:[^>]*>/g,""),i=i.replace(/<\/[^ >]+:[^>]*>/g,""),i=i.replace(/<(div|span|style|meta|link){1}.*?>/gi,""),n=l+i+s}r.extend(!0,r.trumbowyg,{plugins:{cleanPaste:{init:function(r){r.pasteHandlers.push(function(){try{var e=r.$ed.html();setTimeout(function(){var t=r.$ed.html();t=n(e,t),r.$ed.html(t)},0)}catch(t){}})}}}})}(jQuery);
1
+ !function(e){"use strict";function r(e){var r=e;return r=r.replace(/<[^> ]*/g,function(e){return e.toLowerCase()}),r=r.replace(/<[^>]*>/g,function(e){return e=e.replace(/ [^=]+=/g,function(e){return e.toLowerCase()})}),r=r.replace(/<[^>]*>/g,function(e){return e=e.replace(/( [^=]+=)([^"][^ >]*)/g,'$1"$2"')})}function n(e){return e=r(e),e=e.replace(/<b(\s+|>)/g,"<strong$1"),e=e.replace(/<\/b(\s+|>)/g,"</strong$1"),e=e.replace(/<i(\s+|>)/g,"<em$1"),e=e.replace(/<\/i(\s+|>)/g,"</em$1"),e=e.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g,""),e=e.replace(/&nbsp;/gi," "),e=e.replace(/ <\//gi,"</"),e.replace(/\s+/g," "),e=e.replace(/^\s*|\s*$/g,""),e=e.replace(/<[^>]*>/g,function(e){return e=e.replace(/ ([^=]+)="[^"]*"/g,function(e,r){return["alt","href","src","title"].indexOf(r)!==-1?e:""})}),e=e.replace(/<\?xml[^>]*>/g,""),e=e.replace(/<[^ >]+:[^>]*>/g,""),e=e.replace(/<\/[^ >]+:[^>]*>/g,""),e=e.replace(/<(div|span|style|meta|link).*?>/gi,"")}e.extend(!0,e.trumbowyg,{plugins:{cleanPaste:{init:function(e){e.pasteHandlers.push(function(){setTimeout(function(){try{e.$ed.html(n(e.$ed.html()))}catch(r){}},0)})}}}})}(jQuery);
@@ -20,11 +20,27 @@
20
20
  },
21
21
  en: {
22
22
  foreColor: 'Text color',
23
- backColor: 'Background color'
23
+ backColor: 'Background color',
24
+ foreColorRemove: 'Remove text color',
25
+ backColorRemove: 'Remove background color'
26
+ },
27
+ da: {
28
+ foreColor: 'Tekstfarve',
29
+ backColor: 'Baggrundsfarve'
24
30
  },
25
31
  fr: {
26
32
  foreColor: 'Couleur du texte',
27
- backColor: 'Couleur de fond'
33
+ backColor: 'Couleur de fond',
34
+ foreColorRemove: 'Supprimer la couleur du texte',
35
+ backColorRemove: 'Supprimer la couleur de fond'
36
+ },
37
+ de: {
38
+ foreColor: 'Textfarbe',
39
+ backColor: 'Hintergrundfarbe'
40
+ },
41
+ nl: {
42
+ foreColor: 'Tekstkleur',
43
+ backColor: 'Achtergrondkleur'
28
44
  },
29
45
  sk: {
30
46
  foreColor: 'Farba textu',
@@ -34,6 +50,10 @@
34
50
  foreColor: '文字颜色',
35
51
  backColor: '背景颜色'
36
52
  },
53
+ zh_tw: {
54
+ foreColor: '文字顏色',
55
+ backColor: '背景顏色'
56
+ },
37
57
  ru: {
38
58
  foreColor: 'Цвет текста',
39
59
  backColor: 'Цвет выделения текста'
@@ -41,9 +61,24 @@
41
61
  ja: {
42
62
  foreColor: '文字色',
43
63
  backColor: '背景色'
44
- }
64
+ },
65
+ tr: {
66
+ foreColor: 'Yazı rengi',
67
+ backColor: 'Arkaplan rengi'
68
+ },
69
+ pt_br: {
70
+ foreColor: 'Cor de fonte',
71
+ backColor: 'Cor de fundo'
72
+ },
73
+ ko: {
74
+ foreColor: '글자색',
75
+ backColor: '배경색',
76
+ foreColorRemove: '글자색 지우기',
77
+ backColorRemove: '배경색 지우기'
78
+ },
45
79
  }
46
80
  });
81
+
47
82
  // jshint camelcase:true
48
83
 
49
84
 
@@ -65,7 +100,7 @@
65
100
  function colorTagHandler(element, trumbowyg) {
66
101
  var tags = [];
67
102
 
68
- if(!element.style){
103
+ if (!element.style) {
69
104
  return tags;
70
105
  }
71
106
 
@@ -98,7 +133,19 @@
98
133
  }
99
134
 
100
135
  var defaultOptions = {
101
- colorList: ['ffffff', '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646', 'ffff00', 'f2f2f2', '7f7f7f', 'ddd9c3', 'c6d9f0', 'dbe5f1', 'f2dcdb', 'ebf1dd', 'e5e0ec', 'dbeef3', 'fdeada', 'fff2ca', 'd8d8d8', '595959', 'c4bd97', '8db3e2', 'b8cce4', 'e5b9b7', 'd7e3bc', 'ccc1d9', 'b7dde8', 'fbd5b5', 'ffe694', 'bfbfbf', '3f3f3f', '938953', '548dd4', '95b3d7', 'd99694', 'c3d69b', 'b2a2c7', 'b7dde8', 'fac08f', 'f2c314', 'a5a5a5', '262626', '494429', '17365d', '366092', '953734', '76923c', '5f497a', '92cddc', 'e36c09', 'c09100', '7f7f7f', '0c0c0c', '1d1b10', '0f243e', '244061', '632423', '4f6128', '3f3151', '31859b', '974806', '7f6000']
136
+ colorList: [
137
+ 'ffffff', '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646', 'ffff00',
138
+ 'f2f2f2', '7f7f7f', 'ddd9c3', 'c6d9f0', 'dbe5f1', 'f2dcdb', 'ebf1dd', 'e5e0ec', 'dbeef3', 'fdeada', 'fff2ca',
139
+ 'd8d8d8', '595959', 'c4bd97', '8db3e2', 'b8cce4', 'e5b9b7', 'd7e3bc', 'ccc1d9', 'b7dde8', 'fbd5b5', 'ffe694',
140
+ 'bfbfbf', '3f3f3f', '938953', '548dd4', '95b3d7', 'd99694', 'c3d69b', 'b2a2c7', 'b7dde8', 'fac08f', 'f2c314',
141
+ 'a5a5a5', '262626', '494429', '17365d', '366092', '953734', '76923c', '5f497a', '92cddc', 'e36c09', 'c09100',
142
+ '7f7f7f', '0c0c0c', '1d1b10', '0f243e', '244061', '632423', '4f6128', '3f3151', '31859b', '974806', '7f6000'
143
+ ],
144
+ foreColorList: null, // fallbacks on colorList
145
+ backColorList: null, // fallbacks on colorList
146
+ allowCustomForeColor: true,
147
+ allowCustomBackColor: true,
148
+ displayAsList: false,
102
149
  };
103
150
 
104
151
  // Add all colors in two dropdowns
@@ -107,12 +154,16 @@
107
154
  color: {
108
155
  init: function (trumbowyg) {
109
156
  trumbowyg.o.plugins.colors = trumbowyg.o.plugins.colors || defaultOptions;
157
+ var dropdownClass = trumbowyg.o.plugins.colors.displayAsList ? trumbowyg.o.prefix + 'dropdown--color-list' : '';
158
+
110
159
  var foreColorBtnDef = {
111
- dropdown: buildDropdown('foreColor', trumbowyg)
112
- },
113
- backColorBtnDef = {
114
- dropdown: buildDropdown('backColor', trumbowyg)
115
- };
160
+ dropdown: buildDropdown('foreColor', trumbowyg),
161
+ dropdownClass: dropdownClass,
162
+ },
163
+ backColorBtnDef = {
164
+ dropdown: buildDropdown('backColor', trumbowyg),
165
+ dropdownClass: dropdownClass,
166
+ };
116
167
 
117
168
  trumbowyg.addBtnDef('foreColor', foreColorBtnDef);
118
169
  trumbowyg.addBtnDef('backColor', backColorBtnDef);
@@ -123,53 +174,76 @@
123
174
  });
124
175
 
125
176
  function buildDropdown(fn, trumbowyg) {
126
- var dropdown = [];
177
+ var dropdown = [],
178
+ trumbowygColorOptions = trumbowyg.o.plugins.colors,
179
+ colorList = trumbowygColorOptions[fn + 'List'] || trumbowygColorOptions.colorList;
127
180
 
128
- $.each(trumbowyg.o.plugins.colors.colorList, function (i, color) {
181
+ $.each(colorList, function (i, color) {
129
182
  var btn = fn + color,
130
183
  btnDef = {
131
184
  fn: fn,
132
185
  forceCss: true,
186
+ hasIcon: false,
187
+ text: trumbowyg.lang['#' + color] || ('#' + color),
133
188
  param: '#' + color,
134
189
  style: 'background-color: #' + color + ';'
135
190
  };
191
+
192
+ if (trumbowygColorOptions.displayAsList && fn === 'foreColor') {
193
+ btnDef.style = 'color: #' + color + ' !important;';
194
+ }
195
+
136
196
  trumbowyg.addBtnDef(btn, btnDef);
137
197
  dropdown.push(btn);
138
198
  });
139
199
 
200
+ // Remove color
140
201
  var removeColorButtonName = fn + 'Remove',
141
202
  removeColorBtnDef = {
142
203
  fn: 'removeFormat',
204
+ hasIcon: false,
143
205
  param: fn,
144
206
  style: 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);'
145
207
  };
208
+
209
+ if (trumbowygColorOptions.displayAsList) {
210
+ removeColorBtnDef.style = '';
211
+ }
212
+
146
213
  trumbowyg.addBtnDef(removeColorButtonName, removeColorBtnDef);
147
214
  dropdown.push(removeColorButtonName);
148
215
 
149
- // add free color btn
150
- var freeColorButtonName = fn + 'Free',
151
- freeColorBtnDef = {
152
- fn: function () {
153
- trumbowyg.openModalInsert(trumbowyg.lang[fn],
154
- {
155
- color: {
156
- label: fn,
157
- value: '#FFFFFF'
216
+ // Custom color
217
+ if (trumbowygColorOptions['allowCustom' + fn.charAt(0).toUpperCase() + fn.substr(1)]) {
218
+ // add free color btn
219
+ var freeColorButtonName = fn + 'Free',
220
+ freeColorBtnDef = {
221
+ fn: function () {
222
+ trumbowyg.openModalInsert(trumbowyg.lang[fn],
223
+ {
224
+ color: {
225
+ label: fn,
226
+ forceCss: true,
227
+ type: 'color',
228
+ value: '#FFFFFF'
229
+ }
230
+ },
231
+ // callback
232
+ function (values) {
233
+ trumbowyg.execCmd(fn, values.color);
234
+ return true;
158
235
  }
159
- },
160
- // callback
161
- function (values) {
162
- trumbowyg.execCmd(fn, values.color);
163
- return true;
164
- }
165
- );
166
- },
167
- text: '#',
168
- // style adjust for displaying the text
169
- style: 'text-indent: 0;line-height: 20px;padding: 0 5px;'
170
- };
171
- trumbowyg.addBtnDef(freeColorButtonName, freeColorBtnDef);
172
- dropdown.push(freeColorButtonName);
236
+ );
237
+ },
238
+ hasIcon: false,
239
+ text: '#',
240
+ // style adjust for displaying the text
241
+ style: 'text-indent: 0; line-height: 20px; padding: 0 5px;'
242
+ };
243
+
244
+ trumbowyg.addBtnDef(freeColorButtonName, freeColorBtnDef);
245
+ dropdown.push(freeColorButtonName);
246
+ }
173
247
 
174
248
  return dropdown;
175
249
  }