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";function i(e){e.stopPropagation(),e.preventDefault()}function t(e){e.$ed.find("canvas.resizable").resizable("destroy").off("mousedown",i).removeClass("resizable"),r.reset(),e.syncCode()}var s={minSize:32,step:4},n=function(){this.resizeCanvas=document.createElement("canvas"),this.resizeCanvas.setAttribute("tabindex","0"),this.resizeCanvas.id="trumbowyg-resizimg-"+ +new Date,this.ctx=null,this.resizeImg=null,this.pressEscape=function(e){e.reset()},this.pressBackspaceOrDelete=function(i){e(i.resizeCanvas).replaceWith(""),i.resizeImg=null};var t,s,n=!1,r=!1,a=function(e){var i=e.getBoundingClientRect();t=i.left,s=i.top},h=function(e,i,t,s,n){return i.translate(.5,.5),i.lineWidth=1,i.drawImage(t,5,5,s-10,n-10),i.beginPath(),i.rect(5,5,s-10,n-10),i.stroke(),i.beginPath(),i.fillStyle="rgb(255, 255, 255)",i.rect(s-10,n-10,9,9),i.fill(),i.stroke(),a(e),i};this.init=function(){var i=this;e(window).on("scroll resize",function(){i.reCalcOffset()})},this.reCalcOffset=function(){a(this.resizeCanvas)},this.canvasId=function(){return this.resizeCanvas.id},this.isActive=function(){return null!==this.resizeImg},this.isFocusedNow=function(){return n},this.blurNow=function(){n=!1},this.reset=function(){null!==this.resizeImg&&(this.resizeImg.width=this.resizeCanvas.clientWidth-10,this.resizeImg.height=this.resizeCanvas.clientHeight-10,this.resizeImg.removeAttribute("style"),e(this.resizeCanvas).replaceWith(e(this.resizeImg)),this.resizeCanvas.removeAttribute("style"),this.resizeImg=null)},this.setup=function(a,o){if(this.resizeImg=a,!this.resizeCanvas.getContext)return!1;n=!0,this.resizeCanvas.width=e(this.resizeImg).width()+10,this.resizeCanvas.height=e(this.resizeImg).height()+10,this.resizeCanvas.style.margin="-5px",this.ctx=this.resizeCanvas.getContext("2d"),e(this.resizeImg).replaceWith(e(this.resizeCanvas)),h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height),e(this.resizeCanvas).resizable(o).on("mousedown",i);var c=this;return e(this.resizeCanvas).on("mousemove",function(e){var i=Math.round(e.clientX-t),n=Math.round(e.clientY-s),a=r;c.ctx.rect(c.resizeCanvas.width-10,c.resizeCanvas.height-10,9,9),r=c.ctx.isPointInPath(i,n),a!==r&&(this.style.cursor=r?"se-resize":"default")}).on("keydown",function(e){if(c.isActive()){var i=e.keyCode;27===i?c.pressEscape(c):8!==i&&46!==i||c.pressBackspaceOrDelete(c)}}).on("focus",i),this.resizeCanvas.focus(),!0},this.refresh=function(){this.resizeCanvas.getContext&&(this.resizeCanvas.width=this.resizeCanvas.clientWidth,this.resizeCanvas.height=this.resizeCanvas.clientHeight,h(this.resizeCanvas,this.ctx,this.resizeImg,this.resizeCanvas.width,this.resizeCanvas.height))}},r=new n;e.extend(!0,e.trumbowyg,{plugins:{resizimg:{init:function(n){function a(){n.$ed.find("img").off("click").on("click",function(e){r.isActive()&&r.reset(),r.setup(this,n.o.plugins.resizimg.resizable),i(e)})}n.o.plugins.resizimg=e.extend(!0,{},s,n.o.plugins.resizimg||{},{resizable:{resizeWidth:!1,onDragStart:function(e,i){var t=n.o.plugins.resizimg,s=e.pageX-i.offset().left,r=e.pageY-i.offset().top;if(s<i.width()-t.minSize||r<i.height()-t.minSize)return!1},onDrag:function(e,i,t,s){var r=n.o.plugins.resizimg;return s<r.minSize&&(s=r.minSize),s-=s%r.step,i.height(s),!1},onDragEnd:function(){r.refresh(),n.syncCode()}}}),n.$c.on("tbwinit",function(){a(),n.$ed.on("click",function(t){e(t.target).is("img")||t.target.id===r.canvasId()||(i(t),r.reset(),n.$c.trigger("tbwchange"))}),n.$ed.on("scroll",function(){r.reCalcOffset()})}),n.$c.on("tbwfocus tbwchange",a),n.$c.on("tbwresize",function(){r.reCalcOffset()}),n.$c.on("tbwblur",function(){r.isFocusedNow()?r.blurNow():t(n)})},destroy:function(e){t(e)}}}})}(jQuery);
@@ -0,0 +1,94 @@
1
+ /* ===========================================================
2
+ * trumbowyg.ruby.js v1.0
3
+ * Ruby text plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Fathi Anshory (0x00000F5C)
7
+ * Twitter : @fscchannl
8
+ * Comment : Since I use trumbowyg in my project and required it to insert ruby text, so I thought I can contribute a little. :D
9
+ */
10
+
11
+ (function ($) {
12
+ 'use strict';
13
+
14
+ $.extend(true, $.trumbowyg, {
15
+ langs: {
16
+ // jshint camelcase:false
17
+ en: {
18
+ ruby: 'Add ruby text',
19
+ rubyModal: 'Ruby modal',
20
+ rubyText: 'Ruby text'
21
+ },
22
+ da: {
23
+ ruby: 'Tilføj ruby tekst',
24
+ rubyModal: 'Ruby modal',
25
+ rubyText: 'Ruby tekst'
26
+ },
27
+ fr: {
28
+ ruby: 'Ajouter du texte ruby',
29
+ rubyModal: 'Modale ruby',
30
+ rubyText: 'Texte ruby'
31
+ },
32
+ id: {
33
+ ruby: 'Sisipkan teks ruby',
34
+ rubyModal: 'Modal teks ruby',
35
+ rubyText: 'Teks ruby'
36
+ },
37
+ ko: {
38
+ ruby: '루비 문자 넣기',
39
+ rubyModal: '대상 문자',
40
+ rubyText: '루비 문자'
41
+ },
42
+ pt_br: {
43
+ ruby: 'Adicionar texto ruby',
44
+ rubyModal: 'Modal ruby',
45
+ rubyText: 'Texto ruby'
46
+ },
47
+ tr: {
48
+ ruby: 'Ruby metni ekle',
49
+ rubyModal: 'Ruby modal',
50
+ rubyText: 'Ruby metni'
51
+ },
52
+ zh_tw: {
53
+ ruby: '加入 ruby 文字',
54
+ rubyModal: 'Ruby 彈跳視窗',
55
+ rubyText: 'Ruby 文字'
56
+ },
57
+ // jshint camelcase:true
58
+ },
59
+ plugins: {
60
+ ruby: {
61
+ init: function (trumbowyg) {
62
+ var btnDef = {
63
+ fn: function () {
64
+ trumbowyg.saveRange();
65
+ trumbowyg.openModalInsert(
66
+ trumbowyg.lang.ruby,
67
+ {
68
+ rubyText: {
69
+ label: trumbowyg.lang.rubyText,
70
+ required: false,
71
+ },
72
+ modal: {
73
+ label: trumbowyg.lang.rubyModal,
74
+ value: trumbowyg.getRangeText(),
75
+ required: true
76
+ }
77
+ },
78
+ function (v) {
79
+ var node = $('<ruby title="' + v.rubyText + '">' + v.modal + '<rp> (</rp><rt>' + v.rubyText + '</rt><rp>)</rp></ruby>')[0];
80
+ trumbowyg.range.deleteContents();
81
+ trumbowyg.range.insertNode(node);
82
+ trumbowyg.syncCode();
83
+ trumbowyg.$c.trigger('tbwchange');
84
+ return true;
85
+ }
86
+ );
87
+ }
88
+ };
89
+ trumbowyg.addBtnDef('ruby', btnDef);
90
+ }
91
+ }
92
+ }
93
+ });
94
+ })(jQuery);
@@ -0,0 +1 @@
1
+ !function(r){"use strict";r.extend(!0,r.trumbowyg,{langs:{en:{ruby:"Add ruby text",rubyModal:"Ruby modal",rubyText:"Ruby text"},da:{ruby:"Tilføj ruby tekst",rubyModal:"Ruby modal",rubyText:"Ruby tekst"},fr:{ruby:"Ajouter du texte ruby",rubyModal:"Modale ruby",rubyText:"Texte ruby"},id:{ruby:"Sisipkan teks ruby",rubyModal:"Modal teks ruby",rubyText:"Teks ruby"},ko:{ruby:"루비 문자 넣기",rubyModal:"대상 문자",rubyText:"루비 문자"},pt_br:{ruby:"Adicionar texto ruby",rubyModal:"Modal ruby",rubyText:"Texto ruby"},tr:{ruby:"Ruby metni ekle",rubyModal:"Ruby modal",rubyText:"Ruby metni"},zh_tw:{ruby:"加入 ruby 文字",rubyModal:"Ruby 彈跳視窗",rubyText:"Ruby 文字"}},plugins:{ruby:{init:function(u){var e={fn:function(){u.saveRange(),u.openModalInsert(u.lang.ruby,{rubyText:{label:u.lang.rubyText,required:!1},modal:{label:u.lang.rubyModal,value:u.getRangeText(),required:!0}},function(e){var b=r('<ruby title="'+e.rubyText+'">'+e.modal+"<rp> (</rp><rt>"+e.rubyText+"</rt><rp>)</rp></ruby>")[0];return u.range.deleteContents(),u.range.insertNode(b),u.syncCode(),u.$c.trigger("tbwchange"),!0})}};u.addBtnDef("ruby",e)}}}})}(jQuery);
@@ -0,0 +1,79 @@
1
+ /* ===========================================================
2
+ * trumbowyg.specialchars.js v0.99
3
+ * Unicode characters picker plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Renaud Hoyoux (geektortoise)
7
+ */
8
+
9
+ (function ($) {
10
+ 'use strict';
11
+
12
+ var defaultOptions = {
13
+ symbolList: [
14
+ // currencies
15
+ '0024', '20AC', '00A3', '00A2', '00A5', '00A4', '2030', null,
16
+ // legal signs
17
+ '00A9', '00AE', '2122', null,
18
+ // textual sign
19
+ '00A7', '00B6', '00C6', '00E6', '0152', '0153', null,
20
+ '2022', '25CF', '2023', '25B6', '2B29', '25C6', null,
21
+ //maths
22
+ '00B1', '00D7', '00F7', '21D2', '21D4', '220F', '2211', '2243', '2264', '2265'
23
+ ]
24
+ };
25
+
26
+ $.extend(true, $.trumbowyg, {
27
+ langs: {
28
+ en: {
29
+ specialChars: 'Special characters'
30
+ },
31
+ fr: {
32
+ specialChars: 'Caractères spéciaux'
33
+ },
34
+ ko: {
35
+ specialChars: '특수문자'
36
+ },
37
+ },
38
+ plugins: {
39
+ specialchars: {
40
+ init: function (trumbowyg) {
41
+ trumbowyg.o.plugins.specialchars = trumbowyg.o.plugins.specialchars || defaultOptions;
42
+ var specialCharsBtnDef = {
43
+ dropdown: buildDropdown(trumbowyg)
44
+ };
45
+
46
+ trumbowyg.addBtnDef('specialChars', specialCharsBtnDef);
47
+ }
48
+ }
49
+ }
50
+ });
51
+
52
+ function buildDropdown(trumbowyg) {
53
+ var dropdown = [];
54
+ $.each(trumbowyg.o.plugins.specialchars.symbolList, function (i, symbol) {
55
+ if (symbol === null) {
56
+ symbol = '&nbsp';
57
+ } else {
58
+ symbol = '&#x' + symbol;
59
+ }
60
+
61
+ var btn = symbol.replace(/:/g, ''),
62
+ defaultSymbolBtnName = 'symbol-' + btn,
63
+ defaultSymbolBtnDef = {
64
+ text: symbol,
65
+ hasIcon: false,
66
+ fn: function () {
67
+ var encodedSymbol = String.fromCodePoint(parseInt(symbol.replace('&#', '0')));
68
+ trumbowyg.execCmd('insertText', encodedSymbol);
69
+ return true;
70
+ }
71
+ };
72
+
73
+ trumbowyg.addBtnDef(defaultSymbolBtnName, defaultSymbolBtnDef);
74
+ dropdown.push(defaultSymbolBtnName);
75
+ });
76
+
77
+ return dropdown;
78
+ }
79
+ })(jQuery);
@@ -0,0 +1 @@
1
+ !function(s){"use strict";function a(a){var n=[];return s.each(a.o.plugins.specialchars.symbolList,function(s,e){e=null===e?"&nbsp":"&#x"+e;var r=e.replace(/:/g,""),l="symbol-"+r,c={text:e,hasIcon:!1,fn:function(){var s=String.fromCodePoint(parseInt(e.replace("&#","0")));return a.execCmd("insertText",s),!0}};a.addBtnDef(l,c),n.push(l)}),n}var n={symbolList:["0024","20AC","00A3","00A2","00A5","00A4","2030",null,"00A9","00AE","2122",null,"00A7","00B6","00C6","00E6","0152","0153",null,"2022","25CF","2023","25B6","2B29","25C6",null,"00B1","00D7","00F7","21D2","21D4","220F","2211","2243","2264","2265"]};s.extend(!0,s.trumbowyg,{langs:{en:{specialChars:"Special characters"},fr:{specialChars:"Caractères spéciaux"},ko:{specialChars:"특수문자"}},plugins:{specialchars:{init:function(s){s.o.plugins.specialchars=s.o.plugins.specialchars||n;var e={dropdown:a(s)};s.addBtnDef("specialChars",e)}}}})}(jQuery);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Trumbowyg v2.8.1 - A lightweight WYSIWYG editor
2
+ * Trumbowyg v2.21.0 - A lightweight WYSIWYG editor
3
3
  * Default stylesheet for Trumbowyg editor plugin
4
4
  * ------------------------
5
5
  * @link http://alex-d.github.io/Trumbowyg
@@ -9,19 +9,19 @@
9
9
  * Website : alex-d.fr
10
10
  */
11
11
 
12
- .trumbowyg-dropdown-emoji {
13
- width: 265px;
14
- padding: 7px 0 7px 5px;
15
- height: 200px;
16
- overflow-y: scroll;
17
- overflow-x: hidden;
12
+ .trumbowyg-symbol-\&nbsp-dropdown-button {
13
+ display: none !important;
14
+ }
15
+ .trumbowyg-symbol-\&nbsp-dropdown-button + button {
16
+ clear: both;
18
17
  }
19
18
 
20
- .trumbowyg-dropdown-emoji svg {
21
- display: none !important;
19
+ .trumbowyg-dropdown-specialChars {
20
+ width: 248px;
21
+ padding: 5px 3px 3px;
22
22
  }
23
23
 
24
- .trumbowyg-dropdown-emoji button {
24
+ .trumbowyg-dropdown-specialChars button {
25
25
  display: block;
26
26
  position: relative;
27
27
  float: left;
@@ -49,7 +49,7 @@
49
49
  }
50
50
  }
51
51
 
52
- .trumbowyg .emoji {
52
+ .trumbowyg .specialChars {
53
53
  width: 22px;
54
54
  height: 22px;
55
55
  display: inline-block;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Trumbowyg v2.8.1 - A lightweight WYSIWYG editor
2
+ * Trumbowyg v2.21.0 - A lightweight WYSIWYG editor
3
3
  * Trumbowyg plugin stylesheet
4
4
  * ------------------------
5
5
  * @link http://alex-d.github.io/Trumbowyg
@@ -9,17 +9,17 @@
9
9
  * Website : alex-d.fr
10
10
  */
11
11
 
12
- .trumbowyg-dropdown-emoji {
13
- width: 265px;
14
- padding: 7px 0 7px 5px;
15
- height: 200px;
16
- overflow-y: scroll;
17
- overflow-x: hidden; }
18
-
19
- .trumbowyg-dropdown-emoji svg {
12
+ .trumbowyg-symbol-\&nbsp-dropdown-button {
20
13
  display: none !important; }
21
14
 
22
- .trumbowyg-dropdown-emoji button {
15
+ .trumbowyg-symbol-\&nbsp-dropdown-button + button {
16
+ clear: both; }
17
+
18
+ .trumbowyg-dropdown-specialChars {
19
+ width: 248px;
20
+ padding: 5px 3px 3px; }
21
+
22
+ .trumbowyg-dropdown-specialChars button {
23
23
  display: block;
24
24
  position: relative;
25
25
  float: left;
@@ -29,7 +29,7 @@
29
29
  margin: 2px;
30
30
  line-height: 24px;
31
31
  text-align: center; }
32
- .trumbowyg-dropdown-emoji button:hover::after, .trumbowyg-dropdown-emoji button:focus::after {
32
+ .trumbowyg-dropdown-specialChars button:hover::after, .trumbowyg-dropdown-specialChars button:focus::after {
33
33
  display: block;
34
34
  position: absolute;
35
35
  top: -5px;
@@ -41,7 +41,7 @@
41
41
  z-index: 10;
42
42
  background-color: transparent; }
43
43
 
44
- .trumbowyg .emoji {
44
+ .trumbowyg .specialChars {
45
45
  width: 22px;
46
46
  height: 22px;
47
47
  display: inline-block; }
@@ -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-symbol-\&nbsp-dropdown-button{display:none!important}.trumbowyg-symbol-\&nbsp-dropdown-button+button{clear:both}.trumbowyg-dropdown-specialChars{width:248px;padding:5px 3px 3px}.trumbowyg-dropdown-specialChars button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-specialChars button:focus::after,.trumbowyg-dropdown-specialChars button:hover::after{display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;box-shadow:#000 0 0 2px;z-index:10;background-color:transparent}.trumbowyg .specialChars{width:22px;height:22px;display:inline-block}
@@ -1,154 +1,419 @@
1
1
  /* ===========================================================
2
- * trumbowyg.table.js v1.2
2
+ * trumbowyg.table.custom.js v2.0
3
3
  * Table plugin for Trumbowyg
4
4
  * http://alex-d.github.com/Trumbowyg
5
5
  * ===========================================================
6
- * Author : Lawrence Meckan
7
- * Twitter : @absalomedia
8
- * Website : absalom.biz
6
+ * Author : Sven Dunemann [dunemann@forelabs.eu]
9
7
  */
10
8
 
11
9
  (function ($) {
12
10
  'use strict';
13
11
 
14
12
  var defaultOptions = {
15
- rows: 0,
16
- columns: 0,
17
- styler: ''
13
+ rows: 8,
14
+ columns: 8,
15
+ styler: 'table'
18
16
  };
19
17
 
20
18
  $.extend(true, $.trumbowyg, {
21
19
  langs: {
20
+ // jshint camelcase:false
22
21
  en: {
23
22
  table: 'Insert table',
24
- tableAddRow: 'Add rows',
25
- tableAddColumn: 'Add columns',
26
- rows: 'Rows',
27
- columns: 'Columns',
28
- styler: 'Table class',
23
+ tableAddRow: 'Add row',
24
+ tableAddRowAbove: 'Add row above',
25
+ tableAddColumnLeft: 'Add column to the left',
26
+ tableAddColumn: 'Add column to the right',
27
+ tableDeleteRow: 'Delete row',
28
+ tableDeleteColumn: 'Delete column',
29
+ tableDestroy: 'Delete table',
30
+ error: 'Error'
31
+ },
32
+ da: {
33
+ table: 'Indsæt tabel',
34
+ tableAddRow: 'Tilføj række',
35
+ tableAddRowAbove: 'Tilføj række',
36
+ tableAddColumnLeft: 'Tilføj kolonne',
37
+ tableAddColumn: 'Tilføj kolonne',
38
+ tableDeleteRow: 'Slet række',
39
+ tableDeleteColumn: 'Slet kolonne',
40
+ tableDestroy: 'Slet tabel',
41
+ error: 'Fejl'
42
+ },
43
+ de: {
44
+ table: 'Tabelle einfügen',
45
+ tableAddRow: 'Zeile hinzufügen',
46
+ tableAddRowAbove: 'Zeile hinzufügen',
47
+ tableAddColumnLeft: 'Spalte hinzufügen',
48
+ tableAddColumn: 'Spalte hinzufügen',
49
+ tableDeleteRow: 'Zeile löschen',
50
+ tableDeleteColumn: 'Spalte löschen',
51
+ tableDestroy: 'Tabelle löschen',
29
52
  error: 'Error'
30
53
  },
31
54
  sk: {
32
55
  table: 'Vytvoriť tabuľky',
33
56
  tableAddRow: 'Pridať riadok',
57
+ tableAddRowAbove: 'Pridať riadok',
58
+ tableAddColumnLeft: 'Pridať stĺpec',
34
59
  tableAddColumn: 'Pridať stĺpec',
35
- rows: 'Riadky',
36
- columns: 'Stĺpce',
37
- styler: 'Tabuľku triedy',
38
60
  error: 'Chyba'
39
61
  },
40
62
  fr: {
41
63
  table: 'Insérer un tableau',
42
64
  tableAddRow: 'Ajouter des lignes',
65
+ tableAddRowAbove: 'Ajouter des lignes',
66
+ tableAddColumnLeft: 'Ajouter des colonnes',
43
67
  tableAddColumn: 'Ajouter des colonnes',
44
- rows: 'Lignes',
45
- columns: 'Colonnes',
46
- styler: 'Classes CSS sur la table',
68
+ tableDeleteRow: 'Effacer la ligne',
69
+ tableDeleteColumn: 'Effacer la colonne',
70
+ tableDestroy: 'Effacer le tableau',
47
71
  error: 'Erreur'
48
72
  },
49
73
  cs: {
50
74
  table: 'Vytvořit příkaz Table',
51
75
  tableAddRow: 'Přidat řádek',
76
+ tableAddRowAbove: 'Přidat řádek',
77
+ tableAddColumnLeft: 'Přidat sloupec',
52
78
  tableAddColumn: 'Přidat sloupec',
53
- rows: 'Řádky',
54
- columns: 'Sloupce',
55
- styler: 'Tabulku třída',
56
79
  error: 'Chyba'
57
80
  },
58
81
  ru: {
59
82
  table: 'Вставить таблицу',
60
- tableAddRow: 'Добавить строки',
61
- tableAddColumn: 'Добавить столбцы',
62
- rows: 'Строки',
63
- columns: 'Столбцы',
64
- styler: 'Имя CSS класса для таблицы',
83
+ tableAddRow: 'Добавить строку',
84
+ tableAddRowAbove: 'Добавить строку',
85
+ tableAddColumnLeft: 'Добавить столбец',
86
+ tableAddColumn: 'Добавить столбец',
87
+ tableDeleteRow: 'Удалить строку',
88
+ tableDeleteColumn: 'Удалить столбец',
89
+ tableDestroy: 'Удалить таблицу',
65
90
  error: 'Ошибка'
66
91
  },
67
92
  ja: {
68
93
  table: '表の挿入',
69
94
  tableAddRow: '行の追加',
95
+ tableAddRowAbove: '行の追加',
96
+ tableAddColumnLeft: '列の追加',
70
97
  tableAddColumn: '列の追加',
71
- rows: '行',
72
- columns: '列',
73
- styler: '表のクラス',
74
98
  error: 'エラー'
75
- }
99
+ },
100
+ tr: {
101
+ table: 'Tablo ekle',
102
+ tableAddRow: 'Satır ekle',
103
+ tableAddRowAbove: 'Satır ekle',
104
+ tableAddColumnLeft: 'Kolon ekle',
105
+ tableAddColumn: 'Kolon ekle',
106
+ error: 'Hata'
107
+ },
108
+ zh_tw: {
109
+ table: '插入表格',
110
+ tableAddRow: '加入行',
111
+ tableAddRowAbove: '加入行',
112
+ tableAddColumnLeft: '加入列',
113
+ tableAddColumn: '加入列',
114
+ tableDeleteRow: '刪除行',
115
+ tableDeleteColumn: '刪除列',
116
+ tableDestroy: '刪除表格',
117
+ error: '錯誤'
118
+ },
119
+ id: {
120
+ table: 'Sisipkan tabel',
121
+ tableAddRow: 'Sisipkan baris',
122
+ tableAddRowAbove: 'Sisipkan baris',
123
+ tableAddColumnLeft: 'Sisipkan kolom',
124
+ tableAddColumn: 'Sisipkan kolom',
125
+ tableDeleteRow: 'Hapus baris',
126
+ tableDeleteColumn: 'Hapus kolom',
127
+ tableDestroy: 'Hapus tabel',
128
+ error: 'Galat'
129
+ },
130
+ pt_br: {
131
+ table: 'Inserir tabela',
132
+ tableAddRow: 'Adicionar linha',
133
+ tableAddRowAbove: 'Adicionar linha',
134
+ tableAddColumnLeft: 'Adicionar coluna',
135
+ tableAddColumn: 'Adicionar coluna',
136
+ tableDeleteRow: 'Deletar linha',
137
+ tableDeleteColumn: 'Deletar coluna',
138
+ tableDestroy: 'Deletar tabela',
139
+ error: 'Erro'
140
+ },
141
+ ko: {
142
+ table: '표 넣기',
143
+ tableAddRow: '줄 추가',
144
+ tableAddRowAbove: '줄 추가',
145
+ tableAddColumnLeft: '칸 추가',
146
+ tableAddColumn: '칸 추가',
147
+ tableDeleteRow: '줄 삭제',
148
+ tableDeleteColumn: '칸 삭제',
149
+ tableDestroy: '표 지우기',
150
+ error: '에러'
151
+ },
152
+ // jshint camelcase:true
76
153
  },
77
154
 
78
155
  plugins: {
79
156
  table: {
80
- init: function (trumbowyg) {
81
- trumbowyg.o.plugins.table = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.table || {});
157
+ init: function (t) {
158
+ t.o.plugins.table = $.extend(true, {}, defaultOptions, t.o.plugins.table || {});
82
159
 
83
- var tableBuild = {
160
+ var buildButtonDef = {
84
161
  fn: function () {
85
- trumbowyg.saveRange();
86
- trumbowyg.openModalInsert(
87
- // Title
88
- trumbowyg.lang.table,
89
-
90
- // Fields
91
- {
92
- rows: {
93
- type: 'number',
94
- required: true
95
- },
96
- columns: {
97
- type: 'number',
98
- required: true
99
- },
100
- styler: {
101
- label: trumbowyg.lang.styler,
102
- type: 'text'
103
- }
104
- },
105
- function (v) { // v is value
106
- var tabler = $('<table></table>');
107
- if (v.styler.length !== 0) {
108
- tabler.addClass(v.styler);
109
- }
162
+ t.saveRange();
163
+
164
+ var btnName = 'table';
165
+
166
+ var dropdownPrefix = t.o.prefix + 'dropdown',
167
+ dropdownOptions = { // the dropdown
168
+ class: dropdownPrefix + '-' + btnName + ' ' + dropdownPrefix + ' ' + t.o.prefix + 'fixed-top'
169
+ };
170
+ dropdownOptions['data-' + dropdownPrefix] = btnName;
171
+ var $dropdown = $('<div/>', dropdownOptions);
172
+
173
+ if (t.$box.find('.' + dropdownPrefix + '-' + btnName).length === 0) {
174
+ t.$box.append($dropdown.hide());
175
+ } else {
176
+ $dropdown = t.$box.find('.' + dropdownPrefix + '-' + btnName);
177
+ }
110
178
 
111
- for (var i = 0; i < v.rows; i += 1) {
112
- var row = $('<tr></tr>').appendTo(tabler);
113
- for (var j = 0; j < v.columns; j += 1) {
114
- $('<td></td>').appendTo(row);
115
- }
179
+ // clear dropdown
180
+ $dropdown.html('');
181
+
182
+ // when active table show AddRow / AddColumn
183
+ if (t.$box.find('.' + t.o.prefix + 'table-button').hasClass(t.o.prefix + 'active-button')) {
184
+ $dropdown.append(t.buildSubBtn('tableAddRowAbove'));
185
+ $dropdown.append(t.buildSubBtn('tableAddRow'));
186
+ $dropdown.append(t.buildSubBtn('tableAddColumnLeft'));
187
+ $dropdown.append(t.buildSubBtn('tableAddColumn'));
188
+ $dropdown.append(t.buildSubBtn('tableDeleteRow'));
189
+ $dropdown.append(t.buildSubBtn('tableDeleteColumn'));
190
+ $dropdown.append(t.buildSubBtn('tableDestroy'));
191
+ } else {
192
+ var tableSelect = $('<table/>');
193
+ $('<tbody/>').appendTo(tableSelect);
194
+ for (var i = 0; i < t.o.plugins.table.rows; i += 1) {
195
+ var row = $('<tr/>').appendTo(tableSelect);
196
+ for (var j = 0; j < t.o.plugins.table.columns; j += 1) {
197
+ $('<td/>').appendTo(row);
116
198
  }
199
+ }
200
+ tableSelect.find('td').on('mouseover', tableAnimate);
201
+ tableSelect.find('td').on('mousedown', tableBuild);
117
202
 
118
- trumbowyg.range.deleteContents();
119
- trumbowyg.range.insertNode(tabler[0]);
120
- return true;
121
- });
203
+ $dropdown.append(tableSelect);
204
+ $dropdown.append($('<div class="trumbowyg-table-size">1x1</div>'));
205
+ }
206
+
207
+ t.dropdown(btnName);
208
+ }
209
+ };
210
+
211
+ var tableAnimate = function(columnEvent) {
212
+ var column = $(columnEvent.target),
213
+ table = column.closest('table'),
214
+ colIndex = this.cellIndex,
215
+ rowIndex = this.parentNode.rowIndex;
216
+
217
+ // reset all columns
218
+ table.find('td').removeClass('active');
219
+
220
+ for (var i = 0; i <= rowIndex; i += 1) {
221
+ for (var j = 0; j <= colIndex; j += 1) {
222
+ table.find('tr:nth-of-type('+(i+1)+')').find('td:nth-of-type('+(j+1)+')').addClass('active');
223
+ }
224
+ }
225
+
226
+ // set label
227
+ table.next('.trumbowyg-table-size').html((colIndex+1) + 'x' + (rowIndex+1));
228
+ };
229
+
230
+ var tableBuild = function() {
231
+ t.saveRange();
232
+
233
+ var tabler = $('<table/>');
234
+ $('<tbody/>').appendTo(tabler);
235
+ if (t.o.plugins.table.styler) {
236
+ tabler.attr('class', t.o.plugins.table.styler);
237
+ }
238
+
239
+ var colIndex = this.cellIndex,
240
+ rowIndex = this.parentNode.rowIndex;
241
+
242
+ for (var i = 0; i <= rowIndex; i += 1) {
243
+ var row = $('<tr></tr>').appendTo(tabler);
244
+ for (var j = 0; j <= colIndex; j += 1) {
245
+ $('<td/>').appendTo(row);
246
+ }
122
247
  }
248
+
249
+ t.range.deleteContents();
250
+ t.range.insertNode(tabler[0]);
251
+ t.$c.trigger('tbwchange');
123
252
  };
124
253
 
125
254
  var addRow = {
255
+ title: t.lang.tableAddRow,
256
+ text: t.lang.tableAddRow,
257
+ ico: 'row-below',
258
+
259
+ fn: function () {
260
+ t.saveRange();
261
+
262
+ var node = t.doc.getSelection().focusNode;
263
+ var focusedRow = $(node).closest('tr');
264
+ var table = $(node).closest('table');
265
+
266
+ if(table.length > 0) {
267
+ var row = $('<tr/>');
268
+ // add columns according to current columns count
269
+ for (var i = 0; i < table.find('tr')[0].childElementCount; i += 1) {
270
+ $('<td/>').appendTo(row);
271
+ }
272
+ // add row to table
273
+ focusedRow.after(row);
274
+ }
275
+
276
+ t.syncCode();
277
+ }
278
+ };
279
+
280
+ var addRowAbove = {
281
+ title: t.lang.tableAddRowAbove,
282
+ text: t.lang.tableAddRowAbove,
283
+ ico: 'row-above',
284
+
126
285
  fn: function () {
127
- trumbowyg.saveRange();
128
- var rower = $('<tr></tr>');
129
- trumbowyg.range.deleteContents();
130
- trumbowyg.range.insertNode(rower[0]);
131
- return true;
286
+ t.saveRange();
287
+
288
+ var node = t.doc.getSelection().focusNode;
289
+ var focusedRow = $(node).closest('tr');
290
+ var table = $(node).closest('table');
291
+
292
+ if(table.length > 0) {
293
+ var row = $('<tr/>');
294
+ // add columns according to current columns count
295
+ for (var i = 0; i < table.find('tr')[0].childElementCount; i += 1) {
296
+ $('<td/>').appendTo(row);
297
+ }
298
+ // add row to table
299
+ focusedRow.before(row);
300
+ }
132
301
 
302
+ t.syncCode();
133
303
  }
134
304
  };
135
305
 
136
306
  var addColumn = {
307
+ title: t.lang.tableAddColumn,
308
+ text: t.lang.tableAddColumn,
309
+ ico: 'col-right',
310
+
311
+ fn: function () {
312
+ t.saveRange();
313
+
314
+ var node = t.doc.getSelection().focusNode;
315
+ var focusedCol = $(node).closest('td');
316
+ var table = $(node).closest('table');
317
+ var focusedColIdx = focusedCol.index();
318
+
319
+ if(table.length > 0) {
320
+ $(table).find('tr').each(function() {
321
+ $($(this).children()[focusedColIdx]).after('<td></td>');
322
+ });
323
+ }
324
+
325
+ t.syncCode();
326
+ }
327
+ };
328
+
329
+ var addColumnLeft = {
330
+ title: t.lang.tableAddColumnLeft,
331
+ text: t.lang.tableAddColumnLeft,
332
+ ico: 'col-left',
333
+
334
+ fn: function () {
335
+ t.saveRange();
336
+
337
+ var node = t.doc.getSelection().focusNode;
338
+ var focusedCol = $(node).closest('td');
339
+ var table = $(node).closest('table');
340
+ var focusedColIdx = focusedCol.index();
341
+
342
+ if(table.length > 0) {
343
+ $(table).find('tr').each(function() {
344
+ $($(this).children()[focusedColIdx]).before('<td></td>');
345
+ });
346
+ }
347
+
348
+ t.syncCode();
349
+ }
350
+ };
351
+
352
+ var destroy = {
353
+ title: t.lang.tableDestroy,
354
+ text: t.lang.tableDestroy,
355
+ ico: 'table-delete',
356
+
357
+ fn: function () {
358
+ t.saveRange();
359
+
360
+ var node = t.doc.getSelection().focusNode,
361
+ table = $(node).closest('table');
362
+
363
+ table.remove();
364
+
365
+ t.syncCode();
366
+ }
367
+ };
368
+
369
+ var deleteRow = {
370
+ title: t.lang.tableDeleteRow,
371
+ text: t.lang.tableDeleteRow,
372
+ ico: 'row-delete',
373
+
137
374
  fn: function () {
138
- trumbowyg.saveRange();
139
- var columner = $('<td></td>');
140
- trumbowyg.range.deleteContents();
141
- trumbowyg.range.insertNode(columner[0]);
142
- return true;
375
+ t.saveRange();
376
+
377
+ var node = t.doc.getSelection().focusNode,
378
+ row = $(node).closest('tr');
379
+
380
+ row.remove();
381
+
382
+ t.syncCode();
383
+ }
384
+ };
385
+
386
+ var deleteColumn = {
387
+ title: t.lang.tableDeleteColumn,
388
+ text: t.lang.tableDeleteColumn,
389
+ ico: 'col-delete',
390
+
391
+ fn: function () {
392
+ t.saveRange();
393
+
394
+ var node = t.doc.getSelection().focusNode,
395
+ table = $(node).closest('table'),
396
+ td = $(node).closest('td'),
397
+ cellIndex = td.index();
398
+
399
+ $(table).find('tr').each(function() {
400
+ $(this).find('td:eq(' + cellIndex + ')').remove();
401
+ });
143
402
 
403
+ t.syncCode();
144
404
  }
145
405
  };
146
406
 
147
- trumbowyg.addBtnDef('table', tableBuild);
148
- trumbowyg.addBtnDef('tableAddRow', addRow);
149
- trumbowyg.addBtnDef('tableAddColumn', addColumn);
407
+ t.addBtnDef('table', buildButtonDef);
408
+ t.addBtnDef('tableAddRowAbove', addRowAbove);
409
+ t.addBtnDef('tableAddRow', addRow);
410
+ t.addBtnDef('tableAddColumnLeft', addColumnLeft);
411
+ t.addBtnDef('tableAddColumn', addColumn);
412
+ t.addBtnDef('tableDeleteRow', deleteRow);
413
+ t.addBtnDef('tableDeleteColumn', deleteColumn);
414
+ t.addBtnDef('tableDestroy', destroy);
150
415
  }
151
416
  }
152
417
  }
153
418
  });
154
- })(jQuery);
419
+ })(jQuery);