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
@@ -1,8 +0,0 @@
1
- /* ===========================================================
2
- * ua.js
3
- * Ukrainian translation for Trumbowyg
4
- * http://alex-d.github.com/Trumbowyg
5
- * ===========================================================
6
- * Author : Igor Buksha
7
- */
8
- jQuery.trumbowyg.langs.ua={viewHTML:"Подивитись HTML",formatting:"Форматування",p:"Звичайний",blockquote:"Витяг",code:"Код",header:"Заголовок",bold:"Напівжирний",italic:"Курсив",strikethrough:"Закреслений",underline:"Підкреслений",strong:"Напівжирний",em:"Курсив",del:"Закреслений",unorderedList:"Звичайний список",orderedList:"Нумерований список",insertImage:"Вставити зображення",insertVideo:"Вставити відео",link:"Посилання",createLink:"Вставити посилання",unlink:"Видалити посилання",justifyLeft:"По лівому краю",justifyCenter:"В центрі",justifyRight:"По правому краю",justifyFull:"По ширині",horizontalRule:"Горизонтальна лінія",fullscreen:"На весь екран",close:"Закрити",submit:"Вставити",reset:"Скасувати",required:"Обов'язкове",description:"Опис",title:"Підказка",text:"Текст"};
@@ -1,9 +0,0 @@
1
- /* ===========================================================
2
- * vi.js
3
- * Vietnamese translation for Trumbowyg
4
- * http://alex-d.github.com/Trumbowyg
5
- * ===========================================================
6
- * Author : heocoi
7
- * Github: https://github.com/heocoi
8
- */
9
- jQuery.trumbowyg.langs.vi={viewHTML:"Hiển thị HTML",formatting:"Định dạng",p:"Đoạn",blockquote:"Trích dẫn",code:"Code",header:"Đầu trang",bold:"In đậm",italic:"In nghiêng",strikethrough:"Gạch ngang",underline:"Gạch chân",strong:"In đậm",em:"In nghiêng",del:"Gạch ngang",unorderedList:"Danh sách không thứ tự",orderedList:"Danh sách có thứ tự",insertImage:"Chèn hình ảnh",insertVideo:"Chèn video",link:"Đường dẫn",createLink:"Tạo đường dẫn",unlink:"Hủy đường dẫn",justifyLeft:"Canh lề trái",justifyCenter:"Canh giữa",justifyRight:"Canh lề phải",justifyFull:"Canh đều",horizontalRule:"Thêm đường kẻ ngang",fullscreen:"Toàn màn hình",close:"Đóng",submit:"Đồng ý",reset:"Hủy bỏ",required:"Bắt buộc",description:"Mô tả",title:"Tiêu đề",text:"Nội dung"};
@@ -1,11 +0,0 @@
1
- /* ===========================================================
2
- * zh_cn.js
3
- * Simplified Chinese translation for Trumbowyg
4
- * http://alex-d.github.com/Trumbowyg
5
- * ===========================================================
6
- * Author : Liu Kai (akai)
7
- * Twitter : @akai404
8
- * Github : https://github.com/akai
9
- */
10
- // jshint camelcase:false
11
- jQuery.trumbowyg.langs.zh_cn={viewHTML:"源代码",formatting:"格式",p:"段落",blockquote:"引用",code:"代码",header:"标题",bold:"加粗",italic:"斜体",strikethrough:"删除线",underline:"下划线",strong:"加粗",em:"斜体",del:"删除线",unorderedList:"无序列表",orderedList:"有序列表",insertImage:"插入图片",insertVideo:"插入视频",link:"超链接",createLink:"插入链接",unlink:"取消链接",justifyLeft:"居左对齐",justifyCenter:"居中对齐",justifyRight:"居右对齐",justifyFull:"两端对齐",horizontalRule:"插入分隔线",fullscreen:"全屏",close:"关闭",submit:"确定",reset:"取消",required:"必需的",description:"描述",title:"标题",text:"文字"};
@@ -1,11 +0,0 @@
1
- /* ===========================================================
2
- * zh_tw.js
3
- * Traditional Chinese translation for Trumbowyg
4
- * http://alex-d.github.com/Trumbowyg
5
- * ===========================================================
6
- * Author : Peter Dave Hello (PeterDaveHello)
7
- * Twitter : @PeterDaveHello
8
- * Github : https://github.com/PeterDaveHello
9
- */
10
- // jshint camelcase:false
11
- jQuery.trumbowyg.langs.zh_tw={viewHTML:"原始碼",formatting:"格式",p:"段落",blockquote:"引用",code:"代碼",header:"標題",bold:"加粗",italic:"斜體",strikethrough:"刪除線",underline:"底線",strong:"加粗",em:"斜體",del:"刪除線",unorderedList:"無序列表",orderedList:"有序列表",insertImage:"插入圖片",insertVideo:"插入影片",link:"超連結",createLink:"插入連結",unlink:"取消連結",justifyLeft:"靠左對齊",justifyCenter:"置中對齊",justifyRight:"靠右對齊",justifyFull:"左右對齊",horizontalRule:"插入分隔線",fullscreen:"全螢幕",close:"關閉",submit:"確定",reset:"取消",required:"必需的",description:"描述",title:"標題",text:"文字"};
@@ -1,121 +0,0 @@
1
- /* ===========================================================
2
- * trumbowyg.base64.js v1.0
3
- * Base64 plugin for Trumbowyg
4
- * http://alex-d.github.com/Trumbowyg
5
- * ===========================================================
6
- * Author : Cyril Biencourt (lizardK)
7
- */
8
-
9
- (function ($) {
10
- 'use strict';
11
-
12
- var isSupported = function () {
13
- return typeof FileReader !== 'undefined';
14
- };
15
-
16
- var isValidImage = function (type) {
17
- return /^data:image\/[a-z]?/i.test(type);
18
- };
19
-
20
- $.extend(true, $.trumbowyg, {
21
- langs: {
22
- // jshint camelcase:false
23
- en: {
24
- base64: 'Image as base64',
25
- file: 'File',
26
- errFileReaderNotSupported: 'FileReader is not supported by your browser.',
27
- errInvalidImage: 'Invalid image file.'
28
- },
29
- fr: {
30
- base64: 'Image en base64',
31
- file: 'Fichier'
32
- },
33
- cs: {
34
- base64: 'Vložit obrázek',
35
- file: 'Soubor'
36
- },
37
- zh_cn: {
38
- base64: '图片(Base64编码)',
39
- file: '文件'
40
- },
41
- nl: {
42
- errFileReaderNotSupported: 'Uw browser ondersteunt deze functionaliteit niet.',
43
- errInvalidImage: 'De gekozen afbeelding is ongeldig.'
44
- },
45
- ru: {
46
- base64: 'Изображение как код в base64',
47
- file: 'Файл',
48
- errFileReaderNotSupported: 'FileReader не поддерживается вашим браузером.',
49
- errInvalidImage: 'Недопустимый файл изображения.'
50
- },
51
- ja: {
52
- base64: '画像 (Base64形式)',
53
- file: 'ファイル',
54
- errFileReaderNotSupported: 'あなたのブラウザーはFileReaderをサポートしていません',
55
- errInvalidImage: '画像形式が正しくありません'
56
- }
57
- },
58
- // jshint camelcase:true
59
-
60
- plugins: {
61
- base64: {
62
- shouldInit: isSupported,
63
- init: function (trumbowyg) {
64
- var btnDef = {
65
- isSupported: isSupported,
66
- fn: function () {
67
- trumbowyg.saveRange();
68
-
69
- var file;
70
- var $modal = trumbowyg.openModalInsert(
71
- // Title
72
- trumbowyg.lang.base64,
73
-
74
- // Fields
75
- {
76
- file: {
77
- type: 'file',
78
- required: true,
79
- attributes: {
80
- accept: 'image/*'
81
- }
82
- },
83
- alt: {
84
- label: 'description',
85
- value: trumbowyg.getRangeText()
86
- }
87
- },
88
-
89
- // Callback
90
- function (values) {
91
- var fReader = new FileReader();
92
-
93
- fReader.onloadend = function (e) {
94
- if (isValidImage(e.target.result)) {
95
- trumbowyg.execCmd('insertImage', fReader.result);
96
- $(['img[src="', fReader.result, '"]:not([alt])'].join(''), trumbowyg.$box).attr('alt', values.alt);
97
- trumbowyg.closeModal();
98
- } else {
99
- trumbowyg.addErrorOnModalField(
100
- $('input[type=file]', $modal),
101
- trumbowyg.lang.errInvalidImage
102
- );
103
- }
104
- };
105
-
106
- fReader.readAsDataURL(file);
107
- }
108
- );
109
-
110
- $('input[type=file]').on('change', function (e) {
111
- file = e.target.files[0];
112
- });
113
- }
114
- };
115
-
116
- trumbowyg.addBtnDef('base64', btnDef);
117
- }
118
- }
119
- }
120
- });
121
- })(jQuery);
@@ -1 +0,0 @@
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,179 +0,0 @@
1
- /* ===========================================================
2
- * trumbowyg.cleanpaste.js v1.0
3
- * Font Clean paste plugin for Trumbowyg
4
- * http://alex-d.github.com/Trumbowyg
5
- * ===========================================================
6
- * Author : Eric Radin
7
- */
8
-
9
- /**
10
- * This plugin will perform a "cleaning" on any paste, in particular
11
- * it will clean pasted content of microsoft word document tags and classes.
12
- */
13
- (function ($) {
14
- 'use strict';
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
- function checkValidTags(snippet) {
25
- var theString = snippet;
26
-
27
- // Replace uppercase element names with lowercase
28
- theString = theString.replace(/<[^> ]*/g, function (match) {
29
- return match.toLowerCase();
30
- });
31
-
32
- // Replace uppercase attribute names with lowercase
33
- theString = theString.replace(/<[^>]*>/g, function (match) {
34
- match = match.replace(/ [^=]+=/g, function (match2) {
35
- return match2.toLowerCase();
36
- });
37
- return match;
38
- });
39
-
40
- // Put quotes around unquoted attributes
41
- theString = theString.replace(/<[^>]*>/g, function (match) {
42
- match = match.replace(/( [^=]+=)([^"][^ >]*)/g, '$1\"$2\"');
43
- return match;
44
- });
45
-
46
- return theString;
47
- }
48
-
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
-
102
- // first make sure all tags and attributes are made valid
103
- newSnippet = checkValidTags(newSnippet);
104
-
105
- // Replace opening bold tags with strong
106
- newSnippet = newSnippet.replace(/<b(\s+|>)/g, '<strong$1');
107
- // Replace closing bold tags with closing strong
108
- newSnippet = newSnippet.replace(/<\/b(\s+|>)/g, '</strong$1');
109
-
110
- // Replace italic tags with em
111
- newSnippet = newSnippet.replace(/<i(\s+|>)/g, '<em$1');
112
- // Replace closing italic tags with closing em
113
- newSnippet = newSnippet.replace(/<\/i(\s+|>)/g, '</em$1');
114
-
115
- // strip out comments -cgCraft
116
- newSnippet = newSnippet.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g, '');
117
-
118
- // strip out &nbsp; -cgCraft
119
- newSnippet = newSnippet.replace(/&nbsp;/gi, ' ');
120
- // strip out extra spaces -cgCraft
121
- newSnippet = newSnippet.replace(/ <\//gi, '</');
122
-
123
- while (newSnippet.indexOf(' ') !== -1) {
124
- var anArray = newSnippet.split(' ');
125
- newSnippet = anArray.join(' ');
126
- }
127
-
128
- // strip &nbsp; -cgCraft
129
- newSnippet = newSnippet.replace(/^\s*|\s*$/g, '');
130
-
131
- // Strip out unaccepted attributes
132
- newSnippet = newSnippet.replace(/<[^>]*>/g, function (match) {
133
- match = match.replace(/ ([^=]+)="[^"]*"/g, function (match2, attributeName) {
134
- if (['alt', 'href', 'src', 'title'].indexOf(attributeName) !== -1) {
135
- return match2;
136
- }
137
- return '';
138
- });
139
- return match;
140
- });
141
-
142
- // Final cleanout for MS Word crud
143
- newSnippet = newSnippet.replace(/<\?xml[^>]*>/g, '');
144
- newSnippet = newSnippet.replace(/<[^ >]+:[^>]*>/g, '');
145
- newSnippet = newSnippet.replace(/<\/[^ >]+:[^>]*>/g, '');
146
-
147
- // remove unwanted tags
148
- newSnippet = newSnippet.replace(/<(div|span|style|meta|link){1}.*?>/gi, '');
149
-
150
- htmlAfter = matchedHead + newSnippet + matchedTail;
151
- return htmlAfter;
152
- }
153
-
154
- // clean editor
155
- // this will clean the inserted contents
156
- // it does a compare, before and after paste to determine the
157
- // pasted contents
158
- $.extend(true, $.trumbowyg, {
159
- plugins: {
160
- cleanPaste: {
161
- init: function (trumbowyg) {
162
- 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
- }
172
- });
173
- }
174
- }
175
- }
176
- });
177
- })(jQuery);
178
-
179
-
@@ -1 +0,0 @@
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,176 +0,0 @@
1
- /* ===========================================================
2
- * trumbowyg.colors.js v1.2
3
- * Colors picker plugin for Trumbowyg
4
- * http://alex-d.github.com/Trumbowyg
5
- * ===========================================================
6
- * Author : Alexandre Demode (Alex-D)
7
- * Twitter : @AlexandreDemode
8
- * Website : alex-d.fr
9
- */
10
-
11
- (function ($) {
12
- 'use strict';
13
-
14
- $.extend(true, $.trumbowyg, {
15
- langs: {
16
- // jshint camelcase:false
17
- cs: {
18
- foreColor: 'Barva textu',
19
- backColor: 'Barva pozadí'
20
- },
21
- en: {
22
- foreColor: 'Text color',
23
- backColor: 'Background color'
24
- },
25
- fr: {
26
- foreColor: 'Couleur du texte',
27
- backColor: 'Couleur de fond'
28
- },
29
- sk: {
30
- foreColor: 'Farba textu',
31
- backColor: 'Farba pozadia'
32
- },
33
- zh_cn: {
34
- foreColor: '文字颜色',
35
- backColor: '背景颜色'
36
- },
37
- ru: {
38
- foreColor: 'Цвет текста',
39
- backColor: 'Цвет выделения текста'
40
- },
41
- ja: {
42
- foreColor: '文字色',
43
- backColor: '背景色'
44
- }
45
- }
46
- });
47
- // jshint camelcase:true
48
-
49
-
50
- function hex(x) {
51
- return ('0' + parseInt(x).toString(16)).slice(-2);
52
- }
53
-
54
- function colorToHex(rgb) {
55
- if (rgb.search('rgb') === -1) {
56
- return rgb.replace('#', '');
57
- } else if (rgb === 'rgba(0, 0, 0, 0)') {
58
- return 'transparent';
59
- } else {
60
- rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/);
61
- return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
62
- }
63
- }
64
-
65
- function colorTagHandler(element, trumbowyg) {
66
- var tags = [];
67
-
68
- if(!element.style){
69
- return tags;
70
- }
71
-
72
- // background color
73
- if (element.style.backgroundColor !== '') {
74
- var backColor = colorToHex(element.style.backgroundColor);
75
- if (trumbowyg.o.plugins.colors.colorList.indexOf(backColor) >= 0) {
76
- tags.push('backColor' + backColor);
77
- } else {
78
- tags.push('backColorFree');
79
- }
80
- }
81
-
82
- // text color
83
- var foreColor;
84
- if (element.style.color !== '') {
85
- foreColor = colorToHex(element.style.color);
86
- } else if (element.hasAttribute('color')) {
87
- foreColor = colorToHex(element.getAttribute('color'));
88
- }
89
- if (foreColor) {
90
- if (trumbowyg.o.plugins.colors.colorList.indexOf(foreColor) >= 0) {
91
- tags.push('foreColor' + foreColor);
92
- } else {
93
- tags.push('foreColorFree');
94
- }
95
- }
96
-
97
- return tags;
98
- }
99
-
100
- 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']
102
- };
103
-
104
- // Add all colors in two dropdowns
105
- $.extend(true, $.trumbowyg, {
106
- plugins: {
107
- color: {
108
- init: function (trumbowyg) {
109
- trumbowyg.o.plugins.colors = trumbowyg.o.plugins.colors || defaultOptions;
110
- var foreColorBtnDef = {
111
- dropdown: buildDropdown('foreColor', trumbowyg)
112
- },
113
- backColorBtnDef = {
114
- dropdown: buildDropdown('backColor', trumbowyg)
115
- };
116
-
117
- trumbowyg.addBtnDef('foreColor', foreColorBtnDef);
118
- trumbowyg.addBtnDef('backColor', backColorBtnDef);
119
- },
120
- tagHandler: colorTagHandler
121
- }
122
- }
123
- });
124
-
125
- function buildDropdown(fn, trumbowyg) {
126
- var dropdown = [];
127
-
128
- $.each(trumbowyg.o.plugins.colors.colorList, function (i, color) {
129
- var btn = fn + color,
130
- btnDef = {
131
- fn: fn,
132
- forceCss: true,
133
- param: '#' + color,
134
- style: 'background-color: #' + color + ';'
135
- };
136
- trumbowyg.addBtnDef(btn, btnDef);
137
- dropdown.push(btn);
138
- });
139
-
140
- var removeColorButtonName = fn + 'Remove',
141
- removeColorBtnDef = {
142
- fn: 'removeFormat',
143
- param: fn,
144
- style: 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);'
145
- };
146
- trumbowyg.addBtnDef(removeColorButtonName, removeColorBtnDef);
147
- dropdown.push(removeColorButtonName);
148
-
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'
158
- }
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);
173
-
174
- return dropdown;
175
- }
176
- })(jQuery);