goldencobra 1.4.27 → 2.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1017) hide show
  1. checksums.yaml +7 -0
  2. data/README.markdown +112 -41
  3. data/app/adapters/goldencobra/article_adapter.rb +75 -0
  4. data/app/assets/images/goldencobra/chosen-sprite@2x.png +0 -0
  5. data/app/assets/images/goldencobra/lastnode.png +0 -0
  6. data/app/assets/images/goldencobra/node.png +0 -0
  7. data/app/assets/images/goldencobra/vline.png +0 -0
  8. data/app/assets/javascripts/active_admin.js +1 -0
  9. data/app/assets/javascripts/goldencobra/active_admin.js +189 -202
  10. data/app/assets/javascripts/goldencobra/application.js.erb +86 -0
  11. data/app/assets/javascripts/goldencobra/chosen.jquery.js +1257 -0
  12. data/app/assets/javascripts/goldencobra/components.js +1 -0
  13. data/app/assets/javascripts/goldencobra/components/navigation_menu.js +191 -0
  14. data/app/assets/javascripts/goldencobra/components/overviewTree.js +156 -0
  15. data/app/assets/javascripts/goldencobra/components/select.js +43 -0
  16. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/adapters/jquery.js +10 -0
  17. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/ckeditor.js +996 -0
  18. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/ckeditor_inits.js +25 -0
  19. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/config.js +45 -0
  20. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/contents.css +132 -0
  21. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/lang/de.js +5 -0
  22. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/lang/en-gb.js +5 -0
  23. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/lang/en.js +5 -0
  24. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -0
  25. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt +25 -0
  26. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/af.js +11 -0
  27. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +11 -0
  28. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +11 -0
  29. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +12 -0
  30. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +12 -0
  31. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +11 -0
  32. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +11 -0
  33. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +12 -0
  34. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +12 -0
  35. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/en-gb.js +11 -0
  36. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +11 -0
  37. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +13 -0
  38. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +12 -0
  39. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +11 -0
  40. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/eu.js +12 -0
  41. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +11 -0
  42. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +11 -0
  43. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/fo.js +11 -0
  44. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/fr-ca.js +11 -0
  45. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +12 -0
  46. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/gl.js +12 -0
  47. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +11 -0
  48. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +11 -0
  49. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +11 -0
  50. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +11 -0
  51. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +12 -0
  52. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/id.js +11 -0
  53. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +13 -0
  54. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +9 -0
  55. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +11 -0
  56. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/ko.js +10 -0
  57. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +11 -0
  58. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +11 -0
  59. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +12 -0
  60. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +11 -0
  61. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +11 -0
  62. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +12 -0
  63. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +11 -0
  64. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +11 -0
  65. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +13 -0
  66. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +13 -0
  67. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +12 -0
  68. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +11 -0
  69. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +11 -0
  70. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/si.js +10 -0
  71. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +11 -0
  72. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +11 -0
  73. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/sq.js +11 -0
  74. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/sr-latn.js +11 -0
  75. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/sr.js +11 -0
  76. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +11 -0
  77. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +11 -0
  78. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +12 -0
  79. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/tt.js +11 -0
  80. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +12 -0
  81. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +12 -0
  82. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +11 -0
  83. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +9 -0
  84. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js +9 -0
  85. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/about/dialogs/about.js +7 -0
  86. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
  87. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  88. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/autogrow/plugin.js +221 -0
  89. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/clipboard/dialogs/paste.js +12 -0
  90. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
  91. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/dialogadvtab/plugin.js +196 -0
  92. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/icons.png +0 -0
  93. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/icons_hidpi.png +0 -0
  94. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/image/dialogs/image.js +44 -0
  95. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/image/images/noimage.png +0 -0
  96. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/link/dialogs/anchor.js +7 -0
  97. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/link/dialogs/link.js +26 -0
  98. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/link/images/anchor.png +0 -0
  99. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
  100. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/magicline/images/hidpi/icon-rtl.png +0 -0
  101. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/magicline/images/hidpi/icon.png +0 -0
  102. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/magicline/images/icon-rtl.png +0 -0
  103. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/magicline/images/icon.png +0 -0
  104. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/pastefromword/filter/default.js +32 -0
  105. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/scayt/LICENSE.md +28 -0
  106. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/scayt/README.md +25 -0
  107. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/scayt/dialogs/options.js +18 -0
  108. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
  109. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt +20 -0
  110. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/af.js +13 -0
  111. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/ar.js +13 -0
  112. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/bg.js +13 -0
  113. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/ca.js +14 -0
  114. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/cs.js +13 -0
  115. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/cy.js +14 -0
  116. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/da.js +11 -0
  117. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/de.js +13 -0
  118. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/el.js +13 -0
  119. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/en-gb.js +13 -0
  120. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/en.js +13 -0
  121. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/eo.js +12 -0
  122. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/es.js +13 -0
  123. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/et.js +13 -0
  124. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/eu.js +13 -0
  125. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/fa.js +12 -0
  126. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/fi.js +13 -0
  127. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/fr-ca.js +10 -0
  128. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/fr.js +11 -0
  129. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/gl.js +13 -0
  130. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/he.js +12 -0
  131. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/hr.js +13 -0
  132. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/hu.js +12 -0
  133. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/id.js +13 -0
  134. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/it.js +14 -0
  135. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/ja.js +9 -0
  136. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/km.js +13 -0
  137. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/ko.js +10 -0
  138. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/ku.js +13 -0
  139. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/lt.js +13 -0
  140. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/lv.js +13 -0
  141. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/nb.js +11 -0
  142. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/nl.js +13 -0
  143. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/no.js +11 -0
  144. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/pl.js +12 -0
  145. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
  146. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/pt.js +13 -0
  147. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/ru.js +13 -0
  148. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/si.js +13 -0
  149. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/sk.js +13 -0
  150. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/sl.js +12 -0
  151. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/sq.js +13 -0
  152. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/sv.js +11 -0
  153. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/th.js +13 -0
  154. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/tr.js +12 -0
  155. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/tt.js +13 -0
  156. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/ug.js +13 -0
  157. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/uk.js +12 -0
  158. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/vi.js +14 -0
  159. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
  160. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/lang/zh.js +9 -0
  161. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/specialchar/dialogs/specialchar.js +14 -0
  162. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/table/dialogs/table.js +21 -0
  163. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/tabletools/dialogs/tableCell.js +17 -0
  164. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/wsc/LICENSE.md +28 -0
  165. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/wsc/README.md +25 -0
  166. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/wsc/dialogs/ciframe.html +66 -0
  167. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
  168. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/wsc/dialogs/wsc.css +82 -0
  169. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/wsc/dialogs/wsc.js +92 -0
  170. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/plugins/wsc/dialogs/wsc_ie.js +11 -0
  171. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/dialog.css +5 -0
  172. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/dialog_ie.css +5 -0
  173. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/dialog_ie7.css +5 -0
  174. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/dialog_ie8.css +5 -0
  175. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/dialog_iequirks.css +5 -0
  176. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/editor.css +5 -0
  177. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/editor_gecko.css +5 -0
  178. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/editor_ie.css +5 -0
  179. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/editor_ie7.css +5 -0
  180. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/editor_ie8.css +5 -0
  181. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/editor_iequirks.css +5 -0
  182. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/icons.png +0 -0
  183. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/icons_hidpi.png +0 -0
  184. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/arrow.png +0 -0
  185. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/close.png +0 -0
  186. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/hidpi/close.png +0 -0
  187. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
  188. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
  189. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
  190. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/lock-open.png +0 -0
  191. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/lock.png +0 -0
  192. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/refresh.png +0 -0
  193. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/images/spinner.gif +0 -0
  194. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/skins/moono/readme.md +49 -0
  195. data/app/assets/javascripts/goldencobra/html_editors/ckeditor/styles.js +111 -0
  196. data/app/assets/javascripts/goldencobra/html_editors/general.js +32 -0
  197. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/jquery.tinymce_v3.js +1 -0
  198. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/langs/de.js +1 -0
  199. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/langs/en.js +1 -0
  200. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advhr/css/advhr.css +0 -0
  201. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advhr/editor_plugin.js +0 -0
  202. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advhr/editor_plugin_src.js +0 -0
  203. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advhr/js/rule.js +0 -0
  204. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advhr/langs/en_dlg.js +0 -0
  205. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advhr/rule.htm +0 -0
  206. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advimage/css/advimage.css +0 -0
  207. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advimage/editor_plugin.js +0 -0
  208. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advimage/editor_plugin_src.js +0 -0
  209. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advimage/image.htm +0 -0
  210. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advimage/img/sample.gif +0 -0
  211. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/advimage/js/image.js +464 -0
  212. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advimage/langs/en_dlg.js +0 -0
  213. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advlink/css/advlink.css +0 -0
  214. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advlink/editor_plugin.js +0 -0
  215. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advlink/editor_plugin_src.js +0 -0
  216. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/advlink/js/advlink.js +543 -0
  217. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advlink/langs/en_dlg.js +0 -0
  218. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advlink/link.htm +0 -0
  219. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advlist/editor_plugin.js +0 -0
  220. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/advlist/editor_plugin_src.js +0 -0
  221. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/autolink/editor_plugin.js +1 -0
  222. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/autolink/editor_plugin_src.js +184 -0
  223. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/autoresize/editor_plugin.js +1 -0
  224. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/autoresize/editor_plugin_src.js +119 -0
  225. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/autosave/editor_plugin.js +1 -0
  226. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/autosave/editor_plugin_src.js +433 -0
  227. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/bbcode/editor_plugin.js +0 -0
  228. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/bbcode/editor_plugin_src.js +0 -0
  229. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/contextmenu/editor_plugin.js +1 -0
  230. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/contextmenu/editor_plugin_src.js +163 -0
  231. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/directionality/editor_plugin.js +1 -0
  232. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/directionality/editor_plugin_src.js +85 -0
  233. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/editor_plugin.js +0 -0
  234. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/editor_plugin_src.js +0 -0
  235. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/emotions/emotions.htm +42 -0
  236. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-cool.gif +0 -0
  237. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-cry.gif +0 -0
  238. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-embarassed.gif +0 -0
  239. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-foot-in-mouth.gif +0 -0
  240. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-frown.gif +0 -0
  241. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-innocent.gif +0 -0
  242. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-kiss.gif +0 -0
  243. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-laughing.gif +0 -0
  244. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-money-mouth.gif +0 -0
  245. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-sealed.gif +0 -0
  246. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-smile.gif +0 -0
  247. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-surprised.gif +0 -0
  248. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-tongue-out.gif +0 -0
  249. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-undecided.gif +0 -0
  250. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-wink.gif +0 -0
  251. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/img/smiley-yell.gif +0 -0
  252. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/js/emotions.js +0 -0
  253. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/emotions/langs/en_dlg.js +0 -0
  254. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/example/dialog.htm +0 -0
  255. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/example/editor_plugin.js +0 -0
  256. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/example/editor_plugin_src.js +84 -0
  257. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/example/img/example.gif +0 -0
  258. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/example/js/dialog.js +0 -0
  259. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/example/langs/en.js +0 -0
  260. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/example/langs/en_dlg.js +0 -0
  261. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/example_dependency/editor_plugin.js +0 -0
  262. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/example_dependency/editor_plugin_src.js +0 -0
  263. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/fullpage/css/fullpage.css +0 -0
  264. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/fullpage/editor_plugin.js +0 -0
  265. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/fullpage/editor_plugin_src.js +0 -0
  266. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/fullpage/fullpage.htm +0 -0
  267. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/fullpage/js/fullpage.js +0 -0
  268. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/fullpage/langs/en_dlg.js +0 -0
  269. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/fullscreen/editor_plugin.js +1 -0
  270. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/fullscreen/editor_plugin_src.js +234 -0
  271. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/fullscreen/fullscreen.htm +117 -0
  272. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/iespell/editor_plugin.js +0 -0
  273. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/iespell/editor_plugin_src.js +0 -0
  274. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/inlinepopups/editor_plugin.js +1 -0
  275. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/inlinepopups/editor_plugin_src.js +699 -0
  276. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  277. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  278. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  279. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  280. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  281. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  282. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  283. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/inlinepopups/skins/clearlooks2/window.css +0 -0
  284. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/inlinepopups/template.htm +0 -0
  285. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/insertdatetime/editor_plugin.js +0 -0
  286. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/insertdatetime/editor_plugin_src.js +0 -0
  287. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/layer/editor_plugin.js +0 -0
  288. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/layer/editor_plugin_src.js +0 -0
  289. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/legacyoutput/editor_plugin.js +1 -0
  290. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/legacyoutput/editor_plugin_src.js +139 -0
  291. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/lists/editor_plugin.js +1 -0
  292. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/lists/editor_plugin_src.js +955 -0
  293. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/media/css/media.css +0 -0
  294. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/media/editor_plugin.js +1 -0
  295. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/media/editor_plugin_src.js +898 -0
  296. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/media/js/embed.js +0 -0
  297. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/media/js/media.js +513 -0
  298. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/media/langs/en_dlg.js +0 -0
  299. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/media/media.htm +0 -0
  300. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/media/moxieplayer.swf +0 -0
  301. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/nonbreaking/editor_plugin.js +0 -0
  302. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/nonbreaking/editor_plugin_src.js +0 -0
  303. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/noneditable/editor_plugin.js +1 -0
  304. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/noneditable/editor_plugin_src.js +537 -0
  305. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/pagebreak/editor_plugin.js +0 -0
  306. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/pagebreak/editor_plugin_src.js +0 -0
  307. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/paste/editor_plugin.js +1 -0
  308. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/paste/editor_plugin_src.js +887 -0
  309. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/paste/js/pastetext.js +0 -0
  310. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/paste/js/pasteword.js +0 -0
  311. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/paste/langs/en_dlg.js +0 -0
  312. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/paste/pastetext.htm +0 -0
  313. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/paste/pasteword.htm +0 -0
  314. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/preview/editor_plugin.js +0 -0
  315. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/preview/editor_plugin_src.js +0 -0
  316. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/preview/example.html +0 -0
  317. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/preview/jscripts/embed.js +0 -0
  318. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/preview/preview.html +0 -0
  319. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/print/editor_plugin.js +0 -0
  320. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/print/editor_plugin_src.js +0 -0
  321. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/save/editor_plugin.js +0 -0
  322. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/save/editor_plugin_src.js +0 -0
  323. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/searchreplace/css/searchreplace.css +0 -0
  324. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/searchreplace/editor_plugin.js +0 -0
  325. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/searchreplace/editor_plugin_src.js +0 -0
  326. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/searchreplace/js/searchreplace.js +152 -0
  327. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/searchreplace/langs/en_dlg.js +0 -0
  328. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/searchreplace/searchreplace.htm +100 -0
  329. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/spellchecker/css/content.css +0 -0
  330. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/spellchecker/editor_plugin.js +1 -0
  331. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/spellchecker/editor_plugin_src.js +471 -0
  332. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/spellchecker/img/wline.gif +0 -0
  333. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/style/css/props.css +14 -0
  334. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/style/editor_plugin.js +1 -0
  335. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/style/editor_plugin_src.js +71 -0
  336. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/style/js/props.js +709 -0
  337. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/style/langs/en_dlg.js +1 -0
  338. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/style/props.htm +845 -0
  339. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/style/readme.txt +19 -0
  340. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/tabfocus/editor_plugin.js +1 -0
  341. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/tabfocus/editor_plugin_src.js +122 -0
  342. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/table/cell.htm +0 -0
  343. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/table/css/cell.css +0 -0
  344. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/table/css/row.css +0 -0
  345. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/table/css/table.css +0 -0
  346. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/table/editor_plugin.js +1 -0
  347. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/table/editor_plugin_src.js +1456 -0
  348. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/table/js/cell.js +319 -0
  349. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/table/js/merge_cells.js +0 -0
  350. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/table/js/row.js +254 -0
  351. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/table/js/table.js +501 -0
  352. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/table/langs/en_dlg.js +0 -0
  353. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/table/merge_cells.htm +0 -0
  354. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/table/row.htm +158 -0
  355. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/table/table.htm +0 -0
  356. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/template/blank.htm +0 -0
  357. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/template/css/template.css +0 -0
  358. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/template/editor_plugin.js +0 -0
  359. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/template/editor_plugin_src.js +0 -0
  360. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/template/js/template.js +0 -0
  361. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/template/langs/en_dlg.js +0 -0
  362. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/template/template.htm +0 -0
  363. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/visualblocks/css/visualblocks.css +21 -0
  364. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/visualblocks/editor_plugin.js +1 -0
  365. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/visualblocks/editor_plugin_src.js +63 -0
  366. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/visualchars/editor_plugin.js +0 -0
  367. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/visualchars/editor_plugin_src.js +0 -0
  368. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/wordcount/editor_plugin.js +1 -0
  369. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/wordcount/editor_plugin_src.js +122 -0
  370. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/abbr.htm +0 -0
  371. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/acronym.htm +0 -0
  372. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/attributes.htm +0 -0
  373. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/cite.htm +0 -0
  374. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/css/attributes.css +0 -0
  375. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/css/popup.css +0 -0
  376. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/del.htm +0 -0
  377. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/editor_plugin.js +0 -0
  378. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/editor_plugin_src.js +0 -0
  379. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/ins.htm +0 -0
  380. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/js/abbr.js +0 -0
  381. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/js/acronym.js +0 -0
  382. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/js/attributes.js +0 -0
  383. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/js/cite.js +0 -0
  384. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/js/del.js +0 -0
  385. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/js/element_common.js +0 -0
  386. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/js/ins.js +0 -0
  387. data/app/assets/javascripts/goldencobra/{plugins → html_editors/tinymce_v3/plugins}/xhtmlxtras/langs/en_dlg.js +0 -0
  388. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/about.htm +0 -0
  389. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/anchor.htm +0 -0
  390. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/charmap.htm +0 -0
  391. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/color_picker.htm +70 -0
  392. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/editor_template.js +1 -0
  393. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/editor_template_src.js +1490 -0
  394. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/image.htm +0 -0
  395. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/colorpicker.jpg +0 -0
  396. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/flash.gif +0 -0
  397. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/img/icons.gif +0 -0
  398. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/iframe.gif +0 -0
  399. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/pagebreak.gif +0 -0
  400. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/quicktime.gif +0 -0
  401. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/realmedia.gif +0 -0
  402. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/shockwave.gif +0 -0
  403. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/trans.gif +0 -0
  404. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/video.gif +0 -0
  405. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/img/windowsmedia.gif +0 -0
  406. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/js/about.js +0 -0
  407. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/js/anchor.js +56 -0
  408. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/js/charmap.js +0 -0
  409. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/js/color_picker.js +345 -0
  410. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/js/image.js +253 -0
  411. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/js/link.js +159 -0
  412. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/js/source_editor.js +78 -0
  413. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/langs/de.js +1 -0
  414. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/langs/de_dlg.js +1 -0
  415. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/langs/en.js +0 -0
  416. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/langs/en_dlg.js +1 -0
  417. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/link.htm +0 -0
  418. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/shortcuts.htm +0 -0
  419. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/default/content.css +0 -0
  420. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/skins/default/dialog.css +118 -0
  421. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/default/img/buttons.png +0 -0
  422. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/default/img/items.gif +0 -0
  423. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/default/img/menu_arrow.gif +0 -0
  424. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/default/img/menu_check.gif +0 -0
  425. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/default/img/progress.gif +0 -0
  426. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/default/img/tabs.gif +0 -0
  427. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/skins/default/ui.css +219 -0
  428. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/highcontrast/content.css +0 -0
  429. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/skins/highcontrast/dialog.css +106 -0
  430. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/skins/highcontrast/ui.css +106 -0
  431. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/o2k7/content.css +0 -0
  432. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/skins/o2k7/dialog.css +118 -0
  433. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/o2k7/img/button_bg.png +0 -0
  434. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  435. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  436. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/skins/o2k7/ui.css +222 -0
  437. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/o2k7/ui_black.css +0 -0
  438. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/advanced/skins/o2k7/ui_silver.css +0 -0
  439. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/advanced/source_editor.htm +25 -0
  440. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/simple/editor_template.js +0 -0
  441. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/simple/editor_template_src.js +0 -0
  442. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/simple/img/icons.gif +0 -0
  443. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/themes/simple/langs/de.js +1 -0
  444. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/simple/langs/en.js +0 -0
  445. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/simple/skins/default/content.css +0 -0
  446. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/simple/skins/default/ui.css +0 -0
  447. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/simple/skins/o2k7/content.css +0 -0
  448. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/simple/skins/o2k7/img/button_bg.png +0 -0
  449. data/app/assets/javascripts/goldencobra/{themes → html_editors/tinymce_v3/themes}/simple/skins/o2k7/ui.css +0 -0
  450. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/tiny_mce_popup.js +5 -0
  451. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/tiny_mce_src.js +17942 -0
  452. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/tinymce_v3.js +1 -0
  453. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v3/tinymce_v3_inits.js +62 -0
  454. data/app/assets/javascripts/goldencobra/{utils → html_editors/tinymce_v3/utils}/editable_selects.js +0 -0
  455. data/app/assets/javascripts/goldencobra/{utils → html_editors/tinymce_v3/utils}/form_utils.js +0 -0
  456. data/app/assets/javascripts/goldencobra/{utils → html_editors/tinymce_v3/utils}/mctabs.js +0 -0
  457. data/app/assets/javascripts/goldencobra/{utils → html_editors/tinymce_v3/utils}/validate.js +0 -0
  458. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/jquery.tinymce_v4.js +1 -0
  459. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/langs/de.js +219 -0
  460. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/langs/readme.md +3 -0
  461. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/advlist/plugin.js +97 -0
  462. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/advlist/plugin.min.js +1 -0
  463. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/anchor/plugin.js +47 -0
  464. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/anchor/plugin.min.js +1 -0
  465. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/autolink/plugin.js +199 -0
  466. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/autolink/plugin.min.js +1 -0
  467. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/autoresize/plugin.js +162 -0
  468. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/autoresize/plugin.min.js +1 -0
  469. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/autosave/plugin.js +165 -0
  470. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/autosave/plugin.min.js +1 -0
  471. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/bbcode/plugin.js +123 -0
  472. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/bbcode/plugin.min.js +1 -0
  473. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/charmap/plugin.js +398 -0
  474. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/charmap/plugin.min.js +1 -0
  475. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/code/plugin.js +60 -0
  476. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/code/plugin.min.js +1 -0
  477. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/colorpicker/plugin.js +112 -0
  478. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/colorpicker/plugin.min.js +1 -0
  479. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/css/dialog.css +118 -0
  480. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/img/buttons.png +0 -0
  481. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/img/icons.gif +0 -0
  482. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/img/items.gif +0 -0
  483. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/img/menu_arrow.gif +0 -0
  484. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/img/menu_check.gif +0 -0
  485. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/img/progress.gif +0 -0
  486. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/img/tabs.gif +0 -0
  487. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/plugin.js +297 -0
  488. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/plugin.min.js +1 -0
  489. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/tiny_mce_popup.js +542 -0
  490. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/utils/editable_selects.js +70 -0
  491. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/utils/form_utils.js +210 -0
  492. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/utils/mctabs.js +164 -0
  493. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/compat3x/utils/validate.js +252 -0
  494. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/contextmenu/plugin.js +88 -0
  495. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/contextmenu/plugin.min.js +1 -0
  496. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/directionality/plugin.js +64 -0
  497. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/directionality/plugin.min.js +1 -0
  498. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-cool.gif +0 -0
  499. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-cry.gif +0 -0
  500. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  501. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  502. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-frown.gif +0 -0
  503. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-innocent.gif +0 -0
  504. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-kiss.gif +0 -0
  505. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-laughing.gif +0 -0
  506. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  507. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-sealed.gif +0 -0
  508. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-smile.gif +0 -0
  509. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-surprised.gif +0 -0
  510. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  511. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-undecided.gif +0 -0
  512. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-wink.gif +0 -0
  513. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/img/smiley-yell.gif +0 -0
  514. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/plugin.js +65 -0
  515. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/emoticons/plugin.min.js +1 -0
  516. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/example/dialog.html +8 -0
  517. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/example/plugin.js +68 -0
  518. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/example/plugin.min.js +1 -0
  519. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/example_dependency/plugin.js +22 -0
  520. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/example_dependency/plugin.min.js +1 -0
  521. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/fullpage/plugin.js +490 -0
  522. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/fullpage/plugin.min.js +1 -0
  523. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/fullscreen/plugin.js +136 -0
  524. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/fullscreen/plugin.min.js +1 -0
  525. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/hr/plugin.js +30 -0
  526. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/hr/plugin.min.js +1 -0
  527. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/image/plugin.js +550 -0
  528. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/image/plugin.min.js +1 -0
  529. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/Canvas.js +35 -0
  530. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/ColorMatrix.js +222 -0
  531. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/Conversions.js +186 -0
  532. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/CropRect.js +214 -0
  533. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/Dialog.js +486 -0
  534. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/Filters.js +221 -0
  535. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/ImagePanel.js +218 -0
  536. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/ImageSize.js +27 -0
  537. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/ImageTools.js +99 -0
  538. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/Mime.js +42 -0
  539. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/Plugin.js +390 -0
  540. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/classes/UndoStack.js +57 -0
  541. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/plugin.dev.js +149 -0
  542. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/plugin.js +2334 -0
  543. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/imagetools/plugin.min.js +1 -0
  544. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/importcss/plugin.js +197 -0
  545. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/importcss/plugin.min.js +1 -0
  546. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/insertdatetime/plugin.js +121 -0
  547. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/insertdatetime/plugin.min.js +1 -0
  548. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/layer/plugin.js +225 -0
  549. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/layer/plugin.min.js +1 -0
  550. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/legacyoutput/plugin.js +211 -0
  551. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/legacyoutput/plugin.min.js +1 -0
  552. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/link/plugin.js +403 -0
  553. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/link/plugin.min.js +1 -0
  554. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/lists/plugin.js +821 -0
  555. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/lists/plugin.min.js +1 -0
  556. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/media/moxieplayer.swf +0 -0
  557. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/media/plugin.js +795 -0
  558. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/media/plugin.min.js +1 -0
  559. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/nonbreaking/plugin.js +53 -0
  560. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/nonbreaking/plugin.min.js +1 -0
  561. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/noneditable/plugin.js +614 -0
  562. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/noneditable/plugin.min.js +1 -0
  563. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/pagebreak/plugin.js +88 -0
  564. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/pagebreak/plugin.min.js +1 -0
  565. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/paste/classes/Clipboard.js +688 -0
  566. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/paste/classes/Plugin.js +110 -0
  567. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/paste/classes/Quirks.js +159 -0
  568. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/paste/classes/Utils.js +129 -0
  569. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/paste/classes/WordFilter.js +498 -0
  570. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/paste/plugin.dev.js +142 -0
  571. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/paste/plugin.js +1700 -0
  572. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/paste/plugin.min.js +1 -0
  573. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/preview/plugin.js +88 -0
  574. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/preview/plugin.min.js +1 -0
  575. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/print/plugin.js +32 -0
  576. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/print/plugin.min.js +1 -0
  577. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/save/plugin.js +94 -0
  578. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/save/plugin.min.js +1 -0
  579. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/searchreplace/plugin.js +600 -0
  580. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/searchreplace/plugin.min.js +1 -0
  581. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/spellchecker/classes/DomTextMatcher.js +470 -0
  582. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/spellchecker/classes/Plugin.js +435 -0
  583. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/spellchecker/plugin.dev.js +139 -0
  584. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/spellchecker/plugin.js +1012 -0
  585. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/spellchecker/plugin.min.js +1 -0
  586. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/tabfocus/plugin.js +120 -0
  587. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/tabfocus/plugin.min.js +1 -0
  588. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/table/classes/CellSelection.js +176 -0
  589. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/table/classes/Dialogs.js +824 -0
  590. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/table/classes/Plugin.js +436 -0
  591. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/table/classes/Quirks.js +397 -0
  592. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/table/classes/TableGrid.js +860 -0
  593. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/table/classes/Utils.js +34 -0
  594. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/table/plugin.dev.js +141 -0
  595. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/table/plugin.js +2844 -0
  596. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/table/plugin.min.js +1 -0
  597. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/template/plugin.js +264 -0
  598. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/template/plugin.min.js +1 -0
  599. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/textcolor/plugin.js +282 -0
  600. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/textcolor/plugin.min.js +1 -0
  601. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/textpattern/plugin.js +268 -0
  602. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/textpattern/plugin.min.js +1 -0
  603. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/css/visualblocks.css +135 -0
  604. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/address.gif +0 -0
  605. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/article.gif +0 -0
  606. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/aside.gif +0 -0
  607. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/blockquote.gif +0 -0
  608. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/div.gif +0 -0
  609. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/dl.gif +0 -0
  610. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/figure.gif +0 -0
  611. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/h1.gif +0 -0
  612. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/h2.gif +0 -0
  613. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/h3.gif +0 -0
  614. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/h4.gif +0 -0
  615. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/h5.gif +0 -0
  616. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/h6.gif +0 -0
  617. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/hgroup.gif +0 -0
  618. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/ol.gif +0 -0
  619. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/p.gif +0 -0
  620. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/pre.gif +0 -0
  621. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/section.gif +0 -0
  622. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/img/ul.gif +0 -0
  623. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/plugin.js +86 -0
  624. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualblocks/plugin.min.js +1 -0
  625. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualchars/plugin.js +123 -0
  626. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/visualchars/plugin.min.js +1 -0
  627. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/wordcount/plugin.js +69 -0
  628. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/plugins/wordcount/plugin.min.js +1 -0
  629. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/content.inline.min.css +1 -0
  630. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/content.min.css +1 -0
  631. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/fonts/tinymce-small.eot +0 -0
  632. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/fonts/tinymce-small.svg +62 -0
  633. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  634. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/fonts/tinymce-small.woff +0 -0
  635. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/fonts/tinymce.eot +0 -0
  636. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/fonts/tinymce.svg +83 -0
  637. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/fonts/tinymce.ttf +0 -0
  638. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/fonts/tinymce.woff +0 -0
  639. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/img/anchor.gif +0 -0
  640. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/img/loader.gif +0 -0
  641. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/img/object.gif +0 -0
  642. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/img/trans.gif +0 -0
  643. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/skin.ie7.min.css +1 -0
  644. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/skins/lightgray/skin.min.css +1 -0
  645. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/themes/modern/theme.js +1 -0
  646. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/themes/modern/theme.min.js +1 -0
  647. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/tinymce_v4.js +11 -0
  648. data/app/assets/javascripts/goldencobra/html_editors/tinymce_v4/tinymce_v4_inits.js +62 -0
  649. data/app/assets/javascripts/goldencobra/jquery.color-2.1.2.js +663 -0
  650. data/app/assets/javascripts/goldencobra/pagination.js +28 -0
  651. data/app/assets/javascripts/goldencobra/react_0.13.1.min.js +15 -0
  652. data/app/assets/javascripts/goldencobra/tiny_mce_popup.js +1 -1
  653. data/app/assets/javascripts/goldencobra/tiny_mce_src.js +17942 -0
  654. data/app/assets/stylesheets/goldencobra/active_admin.scss +16 -0
  655. data/app/assets/stylesheets/goldencobra/active_admin_backup.scss +608 -0
  656. data/app/assets/stylesheets/goldencobra/{application.css.scss → application.scss} +0 -0
  657. data/app/assets/stylesheets/goldencobra/chosen.css +51 -31
  658. data/app/assets/stylesheets/goldencobra/gc-articles.scss +12 -0
  659. data/app/assets/stylesheets/goldencobra/gc-chosen-overwrite.scss +12 -0
  660. data/app/assets/stylesheets/goldencobra/gc-general.scss +487 -0
  661. data/app/assets/stylesheets/goldencobra/gc-grid.scss +5 -0
  662. data/app/assets/stylesheets/goldencobra/gc-header.scss +47 -0
  663. data/app/assets/stylesheets/goldencobra/gc-overview-tree.scss +145 -0
  664. data/app/assets/stylesheets/goldencobra/gc-settings.scss +52 -0
  665. data/app/assets/stylesheets/goldencobra/ikusei_active_admin.scss +16 -34
  666. data/app/controllers/goldencobra/api/v1/tokens_controller.rb +10 -0
  667. data/app/controllers/goldencobra/api/v2/articles_controller.rb +213 -143
  668. data/app/controllers/goldencobra/api/v2/locales_controller.rb +1 -1
  669. data/app/controllers/goldencobra/api/v2/navigation_menus_controller.rb +223 -0
  670. data/app/controllers/goldencobra/api/v2/settings_controller.rb +1 -1
  671. data/app/controllers/goldencobra/api/v2/uploads_controller.rb +32 -0
  672. data/app/controllers/goldencobra/api/v3/articles_controller.rb +124 -0
  673. data/app/controllers/goldencobra/application_controller.rb +17 -41
  674. data/app/controllers/goldencobra/articles_controller.rb +60 -62
  675. data/app/controllers/goldencobra/manage_controller.rb +3 -4
  676. data/app/controllers/goldencobra/sessions_controller.rb +22 -15
  677. data/app/helpers/goldencobra/application_helper.rb +15 -3
  678. data/app/helpers/goldencobra/articles_helper.rb +80 -52
  679. data/app/helpers/goldencobra/login_helper.rb +4 -5
  680. data/app/helpers/goldencobra/navigation_helper.rb +52 -44
  681. data/app/mailers/goldencobra/confirmation_mailer.rb +3 -2
  682. data/app/models/ability.rb +1 -1
  683. data/app/models/active_admin/views/index_as_seo_table.rb +9 -0
  684. data/app/models/active_admin/views/index_as_tree.rb +118 -0
  685. data/app/models/goldencobra/article.rb +327 -246
  686. data/app/models/goldencobra/article_concerns/meta_tag.rb +104 -0
  687. data/app/models/goldencobra/article_image.rb +2 -2
  688. data/app/models/goldencobra/article_url.rb +54 -0
  689. data/app/models/goldencobra/articletype.rb +109 -48
  690. data/app/models/goldencobra/articletype_field.rb +3 -2
  691. data/app/models/goldencobra/articletype_group.rb +4 -4
  692. data/app/models/goldencobra/author.rb +5 -3
  693. data/app/models/goldencobra/comment.rb +7 -7
  694. data/app/models/goldencobra/domain.rb +3 -3
  695. data/app/models/goldencobra/import.rb +282 -282
  696. data/app/models/goldencobra/import_metadata.rb +5 -1
  697. data/app/models/goldencobra/link_checker.rb +27 -14
  698. data/app/models/goldencobra/location.rb +16 -4
  699. data/app/models/goldencobra/menue.rb +144 -17
  700. data/app/models/goldencobra/permission.rb +15 -3
  701. data/app/models/goldencobra/redirector.rb +23 -23
  702. data/app/models/goldencobra/role.rb +1 -0
  703. data/app/models/goldencobra/role_user.rb +4 -2
  704. data/app/models/goldencobra/setting.rb +54 -35
  705. data/app/models/goldencobra/tracking.rb +6 -3
  706. data/app/models/goldencobra/upload.rb +71 -53
  707. data/app/models/goldencobra/vita.rb +3 -3
  708. data/app/models/goldencobra/widget.rb +22 -16
  709. data/app/models/translation.rb +2 -2
  710. data/app/models/user.rb +18 -15
  711. data/app/models/visitor.rb +13 -8
  712. data/app/presenters/goldencobra/articletype_presenter.rb +266 -0
  713. data/app/serializers/goldencobra/article_custom_serializer.rb +24 -0
  714. data/app/serializers/goldencobra/article_serializer.rb +26 -0
  715. data/app/serializers/goldencobra/upload_serializer.rb +22 -0
  716. data/app/services/goldencobra/attribute_repair_service.rb +47 -0
  717. data/app/services/goldencobra/attribute_validator.rb +55 -0
  718. data/app/services/goldencobra/settings_cleanup.rb +95 -0
  719. data/app/services/goldencobra/url.rb +25 -0
  720. data/app/views/goldencobra/admin/articles/_article_type.html.erb +4 -3
  721. data/app/views/goldencobra/admin/articles/_image_module_sidebar.html.erb +2 -2
  722. data/app/views/goldencobra/admin/articles/_link_checker.html.erb +10 -13
  723. data/app/views/goldencobra/admin/articles/_select_article_type.html.erb +1 -4
  724. data/app/views/goldencobra/admin/dashboard/_base_dashboard.html.arb +106 -0
  725. data/app/views/goldencobra/admin/shared/_item.html.erb +1 -1
  726. data/app/views/goldencobra/admin/shared/_overview.html.erb +3 -3
  727. data/app/views/goldencobra/admin/shared/_react_overview.html.erb +15 -0
  728. data/app/views/goldencobra/admin/shared/load_overviewtree.js.erb +8 -3
  729. data/app/views/goldencobra/api/v2/articles/index.xml.builder +29 -0
  730. data/app/views/goldencobra/articles/show.rss.builder +1 -1
  731. data/app/views/goldencobra/manage/_admin_article_management_content.html.erb +2 -2
  732. data/app/views/layouts/goldencobra/active_admin_resque.html.erb +15 -15
  733. data/app/views/layouts/goldencobra/application.html.erb +1 -1
  734. data/app/views/layouts/goldencobra/bare_layout.html.erb +1 -1
  735. data/app/views/layouts/goldencobra/for_pdf.html.erb +1 -1
  736. data/app/worker/articles_cache_worker.rb +1 -2
  737. data/config/initializers/active_admin_devise.rb +4 -4
  738. data/config/initializers/check_for_missing_articletypes.rb +2 -55
  739. data/config/initializers/devise.rb +9 -1
  740. data/config/initializers/http_validator.rb +8 -10
  741. data/config/initializers/sass_load_path.rb +4 -0
  742. data/config/initializers/sidekiq.rb.tmpl +7 -0
  743. data/config/locales/active_admin.de.yml +49 -25
  744. data/config/locales/active_admin.en.yml +46 -22
  745. data/config/locales/active_admin.zh-CN.yml +645 -0
  746. data/config/locales/de.yml +95 -78
  747. data/config/locales/en.yml +97 -90
  748. data/config/locales/zh-CN.yml +632 -0
  749. data/config/routes.rb +37 -78
  750. data/config/settings.yml +17 -8
  751. data/config/spring.rb +1 -0
  752. data/db/migrate/20150811082119_install_goldencobra.rb +589 -0
  753. data/db/migrate/20150818133609_change_article_index_type_default.rb +5 -0
  754. data/db/migrate/20150818140444_rename_user_title_to_user_position.rb +5 -0
  755. data/db/migrate/20150818141321_add_displayarticletypeindex_to_goldencobra_articles.rb +5 -0
  756. data/db/migrate/20150819121715_add_descendentsdepth_to_goldencobra_articles.rb +6 -0
  757. data/db/migrate/20150820073443_change_metatag_storage.rb +13 -0
  758. data/db/migrate/20160527083745_add_state_to_goldencobra_articles.rb +5 -0
  759. data/db/migrate/20160614074840_create_goldencobra_article_urls.rb +10 -0
  760. data/db/migrate/20160704070529_add_showindexarticles_to_goldencobra_articles.rb +5 -0
  761. data/db/seeds.rb +28 -13
  762. data/lib/generators/goldencobra/articletype/articletype_generator.rb +3 -5
  763. data/lib/generators/goldencobra/articletype/templates/edit_articletype.html.erb +3 -3
  764. data/lib/generators/goldencobra/articletype/templates/edit_index.html.erb +11 -6
  765. data/lib/generators/goldencobra/articletype/templates/edit_show.html.erb +4 -6
  766. data/lib/generators/goldencobra/articletype/templates/index.html.erb +18 -21
  767. data/lib/generators/goldencobra/articletype/templates/initializer.rb +3 -6
  768. data/lib/generators/goldencobra/articletype/templates/show.html.erb +187 -9
  769. data/lib/generators/goldencobra/install_generator.rb +47 -65
  770. data/lib/generators/goldencobra/server_generator.rb +14 -17
  771. data/lib/generators/goldencobra/templates/active_admin.rb.erb +20 -17
  772. data/lib/generators/goldencobra/templates/assets/javascripts/application.js +1 -29
  773. data/lib/generators/goldencobra/templates/assets/stylesheets/_bootstrap_overwrite.scss +60 -0
  774. data/lib/generators/goldencobra/templates/assets/stylesheets/{active_admin.css.scss → active_admin.scss} +0 -0
  775. data/lib/generators/goldencobra/templates/assets/stylesheets/application.scss +16 -0
  776. data/lib/generators/goldencobra/templates/deploy.rb.erb +0 -6
  777. data/lib/generators/goldencobra/templates/robots.txt +6 -2
  778. data/lib/generators/goldencobra/templates/seeds.rb.erb +29 -163
  779. data/lib/generators/goldencobra/templates/views/articletypes/default/_edit_index.html.erb +3 -9
  780. data/lib/generators/goldencobra/templates/views/articletypes/default/_show.html.erb +181 -15
  781. data/lib/generators/goldencobra/templates/views/layouts/_footer.html.erb +22 -18
  782. data/lib/generators/goldencobra/templates/views/layouts/_header_meta.html.erb +29 -15
  783. data/lib/generators/goldencobra/templates/views/layouts/_navigation.html.erb +31 -0
  784. data/lib/generators/goldencobra/templates/views/layouts/_startpage.html.erb +71 -0
  785. data/lib/generators/goldencobra/templates/views/layouts/application.html.erb +10 -41
  786. data/lib/goldencobra.rb +33 -0
  787. data/lib/goldencobra/acts_as_setting.rb +8 -10
  788. data/lib/goldencobra/engine.rb +30 -41
  789. data/lib/goldencobra/version.rb +1 -3
  790. data/lib/i18n/backend/active_record.rb +61 -0
  791. data/lib/i18n/backend/active_record/translation.rb +109 -0
  792. data/lib/tasks/article_cache.rake +1 -1
  793. data/lib/tasks/attribute_validator.rake +18 -0
  794. data/lib/tasks/link_checker.rake +3 -7
  795. metadata +917 -803
  796. data/app/assets/javascripts/goldencobra/application.js +0 -84
  797. data/app/assets/javascripts/goldencobra/jquery.tinymce.js +0 -1
  798. data/app/assets/javascripts/goldencobra/langs/en.js +0 -1
  799. data/app/assets/javascripts/goldencobra/plugins/advimage/js/image.js +0 -462
  800. data/app/assets/javascripts/goldencobra/plugins/advlink/js/advlink.js +0 -532
  801. data/app/assets/javascripts/goldencobra/plugins/autolink/editor_plugin.js +0 -1
  802. data/app/assets/javascripts/goldencobra/plugins/autolink/editor_plugin_src.js +0 -172
  803. data/app/assets/javascripts/goldencobra/plugins/autoresize/editor_plugin.js +0 -1
  804. data/app/assets/javascripts/goldencobra/plugins/autoresize/editor_plugin_src.js +0 -137
  805. data/app/assets/javascripts/goldencobra/plugins/autosave/editor_plugin.js +0 -1
  806. data/app/assets/javascripts/goldencobra/plugins/autosave/editor_plugin_src.js +0 -431
  807. data/app/assets/javascripts/goldencobra/plugins/autosave/langs/en.js +0 -4
  808. data/app/assets/javascripts/goldencobra/plugins/contextmenu/editor_plugin.js +0 -1
  809. data/app/assets/javascripts/goldencobra/plugins/contextmenu/editor_plugin_src.js +0 -160
  810. data/app/assets/javascripts/goldencobra/plugins/directionality/editor_plugin.js +0 -1
  811. data/app/assets/javascripts/goldencobra/plugins/directionality/editor_plugin_src.js +0 -82
  812. data/app/assets/javascripts/goldencobra/plugins/emotions/emotions.htm +0 -42
  813. data/app/assets/javascripts/goldencobra/plugins/example/editor_plugin_src.js +0 -84
  814. data/app/assets/javascripts/goldencobra/plugins/example/img/image_button.gif +0 -0
  815. data/app/assets/javascripts/goldencobra/plugins/fullscreen/editor_plugin.js +0 -1
  816. data/app/assets/javascripts/goldencobra/plugins/fullscreen/editor_plugin_src.js +0 -159
  817. data/app/assets/javascripts/goldencobra/plugins/fullscreen/fullscreen.htm +0 -110
  818. data/app/assets/javascripts/goldencobra/plugins/inlinepopups/editor_plugin.js +0 -1
  819. data/app/assets/javascripts/goldencobra/plugins/inlinepopups/editor_plugin_src.js +0 -699
  820. data/app/assets/javascripts/goldencobra/plugins/legacyoutput/editor_plugin.js +0 -1
  821. data/app/assets/javascripts/goldencobra/plugins/legacyoutput/editor_plugin_src.js +0 -139
  822. data/app/assets/javascripts/goldencobra/plugins/lists/editor_plugin.js +0 -1
  823. data/app/assets/javascripts/goldencobra/plugins/lists/editor_plugin_src.js +0 -925
  824. data/app/assets/javascripts/goldencobra/plugins/media/editor_plugin.js +0 -1
  825. data/app/assets/javascripts/goldencobra/plugins/media/editor_plugin_src.js +0 -890
  826. data/app/assets/javascripts/goldencobra/plugins/media/js/media.js +0 -464
  827. data/app/assets/javascripts/goldencobra/plugins/noneditable/editor_plugin.js +0 -1
  828. data/app/assets/javascripts/goldencobra/plugins/noneditable/editor_plugin_src.js +0 -95
  829. data/app/assets/javascripts/goldencobra/plugins/paste/editor_plugin.js +0 -1
  830. data/app/assets/javascripts/goldencobra/plugins/paste/editor_plugin_src.js +0 -871
  831. data/app/assets/javascripts/goldencobra/plugins/searchreplace/js/searchreplace.js +0 -142
  832. data/app/assets/javascripts/goldencobra/plugins/searchreplace/searchreplace.htm +0 -100
  833. data/app/assets/javascripts/goldencobra/plugins/spellchecker/editor_plugin.js +0 -1
  834. data/app/assets/javascripts/goldencobra/plugins/spellchecker/editor_plugin_src.js +0 -436
  835. data/app/assets/javascripts/goldencobra/plugins/style/css/props.css +0 -13
  836. data/app/assets/javascripts/goldencobra/plugins/style/editor_plugin.js +0 -1
  837. data/app/assets/javascripts/goldencobra/plugins/style/editor_plugin_src.js +0 -55
  838. data/app/assets/javascripts/goldencobra/plugins/style/js/props.js +0 -635
  839. data/app/assets/javascripts/goldencobra/plugins/style/langs/en_dlg.js +0 -1
  840. data/app/assets/javascripts/goldencobra/plugins/style/props.htm +0 -840
  841. data/app/assets/javascripts/goldencobra/plugins/tabfocus/editor_plugin.js +0 -1
  842. data/app/assets/javascripts/goldencobra/plugins/tabfocus/editor_plugin_src.js +0 -122
  843. data/app/assets/javascripts/goldencobra/plugins/table/editor_plugin.js +0 -1
  844. data/app/assets/javascripts/goldencobra/plugins/table/editor_plugin_src.js +0 -1408
  845. data/app/assets/javascripts/goldencobra/plugins/table/js/cell.js +0 -319
  846. data/app/assets/javascripts/goldencobra/plugins/table/js/row.js +0 -237
  847. data/app/assets/javascripts/goldencobra/plugins/table/js/table.js +0 -484
  848. data/app/assets/javascripts/goldencobra/plugins/table/row.htm +0 -158
  849. data/app/assets/javascripts/goldencobra/plugins/wordcount/editor_plugin.js +0 -1
  850. data/app/assets/javascripts/goldencobra/plugins/wordcount/editor_plugin_src.js +0 -114
  851. data/app/assets/javascripts/goldencobra/themes/advanced/color_picker.htm +0 -74
  852. data/app/assets/javascripts/goldencobra/themes/advanced/editor_template.js +0 -1
  853. data/app/assets/javascripts/goldencobra/themes/advanced/editor_template_src.js +0 -1362
  854. data/app/assets/javascripts/goldencobra/themes/advanced/img/icons.gif +0 -0
  855. data/app/assets/javascripts/goldencobra/themes/advanced/js/anchor.js +0 -43
  856. data/app/assets/javascripts/goldencobra/themes/advanced/js/color_picker.js +0 -329
  857. data/app/assets/javascripts/goldencobra/themes/advanced/js/image.js +0 -251
  858. data/app/assets/javascripts/goldencobra/themes/advanced/js/link.js +0 -153
  859. data/app/assets/javascripts/goldencobra/themes/advanced/js/source_editor.js +0 -56
  860. data/app/assets/javascripts/goldencobra/themes/advanced/langs/en_dlg.js +0 -1
  861. data/app/assets/javascripts/goldencobra/themes/advanced/skins/default/dialog.css +0 -117
  862. data/app/assets/javascripts/goldencobra/themes/advanced/skins/default/ui.css +0 -214
  863. data/app/assets/javascripts/goldencobra/themes/advanced/skins/highcontrast/dialog.css +0 -105
  864. data/app/assets/javascripts/goldencobra/themes/advanced/skins/highcontrast/ui.css +0 -102
  865. data/app/assets/javascripts/goldencobra/themes/advanced/skins/o2k7/dialog.css +0 -117
  866. data/app/assets/javascripts/goldencobra/themes/advanced/skins/o2k7/ui.css +0 -217
  867. data/app/assets/javascripts/goldencobra/themes/advanced/source_editor.htm +0 -25
  868. data/app/assets/javascripts/goldencobra/tiny_mce.js +0 -1
  869. data/app/assets/stylesheets/goldencobra/active_admin.css.scss +0 -595
  870. data/app/models/goldencobra/metatag.rb +0 -23
  871. data/app/models/goldencobra/url_builder.rb +0 -58
  872. data/app/views/goldencobra/admin/articles/_articles_index.html.erb +0 -4
  873. data/app/views/goldencobra/admin/articles/_widgets_sidebar.html.erb +0 -15
  874. data/app/views/goldencobra/admin/articles/toggle_expert_mode.js.erb +0 -7
  875. data/config/initializers/check_for_migrations.rb +0 -21
  876. data/config/initializers/compass.rb +0 -24
  877. data/db/migrate/20120109093658_create_articles.rb +0 -9
  878. data/db/migrate/20120109111205_add_devise_to_admin_users.rb +0 -56
  879. data/db/migrate/20120109121212_create_admin_notes.rb +0 -16
  880. data/db/migrate/20120109121213_move_admin_notes_to_comments.rb +0 -25
  881. data/db/migrate/20120109140423_create_roles.rb +0 -10
  882. data/db/migrate/20120109141338_create_role_users.rb +0 -8
  883. data/db/migrate/20120110112157_add_urlname_to_article.rb +0 -7
  884. data/db/migrate/20120110114803_create_friendly_id_slugs.rb +0 -18
  885. data/db/migrate/20120112163045_add_body_to_articles.rb +0 -6
  886. data/db/migrate/20120112171037_add_ancestry_to_articles.rb +0 -6
  887. data/db/migrate/20120112172723_add_index_to_articles.rb +0 -9
  888. data/db/migrate/20120113100243_create_menues.rb +0 -12
  889. data/db/migrate/20120113101714_add_ancestry_to_menues.rb +0 -6
  890. data/db/migrate/20120113170904_add_startpage_to_article.rb +0 -5
  891. data/db/migrate/20120120095700_create_goldencobra_metatags.rb +0 -11
  892. data/db/migrate/20120125145920_add_fields_to_articles.rb +0 -9
  893. data/db/migrate/20120125161800_add_noindex_to_articles.rb +0 -5
  894. data/db/migrate/20120126132846_create_goldencobra_uploads.rb +0 -14
  895. data/db/migrate/20120206110452_create_goldencobra_locations.rb +0 -15
  896. data/db/migrate/20120209100956_create_goldencobra_settings.rb +0 -11
  897. data/db/migrate/20120217085735_add_options_to_users.rb +0 -16
  898. data/db/migrate/20120221100021_create_goldencobra_helps.rb +0 -11
  899. data/db/migrate/20120307151355_add_breadcrumb_to_goldencobra_articles.rb +0 -6
  900. data/db/migrate/20120312111338_create_goldencobra_widgets.rb +0 -12
  901. data/db/migrate/20120312150558_create_goldencobra_article_widgets.rb +0 -10
  902. data/db/migrate/20120313125443_create_goldencobra_permissions.rb +0 -18
  903. data/db/migrate/20120313142221_add_name_to_goldencobra_widgets.rb +0 -6
  904. data/db/migrate/20120313142421_add_sorter_to_goldencobra_widgets.rb +0 -6
  905. data/db/migrate/20120314102039_add_template_to_goldencobra_articles.rb +0 -6
  906. data/db/migrate/20120315161536_add_sorter_to_goldencobra_menue.rb +0 -6
  907. data/db/migrate/20120321102414_acts_as_taggable_on_migration.rb +0 -30
  908. data/db/migrate/20120321114923_add_articleindex_to_goldencobra_articles.rb +0 -7
  909. data/db/migrate/20120321120727_add_social_sharing_to_goldencobra_articles.rb +0 -6
  910. data/db/migrate/20120321130204_add_articleindeximages_to_goldencobra_articles.rb +0 -6
  911. data/db/migrate/20120321131058_create_goldencobra_article_images.rb +0 -10
  912. data/db/migrate/20120416154848_create_goldencobra_vita.rb +0 -13
  913. data/db/migrate/20120420094029_add_cachable_to_goldencobra_articles.rb +0 -5
  914. data/db/migrate/20120423141814_add_imagegallery_to_goldencobra_articles.rb +0 -5
  915. data/db/migrate/20120509125734_add_title_to_goldencobra_locations.rb +0 -5
  916. data/db/migrate/20120604141401_add_article_type_to_goldencobra_articles.rb +0 -5
  917. data/db/migrate/20120605082035_add_description_to_goldencobra_menues.rb +0 -6
  918. data/db/migrate/20120608095444_add_teaser_title_to_goldencobra_menue.rb +0 -5
  919. data/db/migrate/20120608121356_create_versions.rb +0 -18
  920. data/db/migrate/20120611082814_create_goldencobra_imports.rb +0 -13
  921. data/db/migrate/20120615085225_add_externalurl_to_goldencobra_article.rb +0 -5
  922. data/db/migrate/20120615150128_add_attachable_to_goldencobra_uploads.rb +0 -6
  923. data/db/migrate/20120618122627_add_indextag_to_goldencobra_articles.rb +0 -5
  924. data/db/migrate/20120618132330_add_sliderfields_to_widgets.rb +0 -5
  925. data/db/migrate/20120618141449_add_teaser_to_goldencobra_widgets.rb +0 -5
  926. data/db/migrate/20120619123238_add_sorter_to_goldencobra_articles.rb +0 -5
  927. data/db/migrate/20120619132259_add_reverse_sort_to_goldencobra_articles.rb +0 -5
  928. data/db/migrate/20120625131154_add_author_to_goldencobra_articles.rb +0 -5
  929. data/db/migrate/20120627122742_add_sorter_limit_to_goldencobra_articles.rb +0 -5
  930. data/db/migrate/20120718153348_add_nottags_to_goldencobra_articles.rb +0 -5
  931. data/db/migrate/20120730103912_add_use_frontend_tags_to_goldencobra_articles.rb +0 -5
  932. data/db/migrate/20120807124808_add_image_to_goldencobra_menues.rb +0 -5
  933. data/db/migrate/20120814111900_add_default_and_description_to_goldencobra.rb +0 -6
  934. data/db/migrate/20120814114800_change_default_type_to_goldencobra_widgets.rb +0 -6
  935. data/db/migrate/20120821105002_add_alttext_to_goldencobra_uploads.rb +0 -5
  936. data/db/migrate/20120926133635_add_position_to_goldencobra_article_images.rb +0 -5
  937. data/db/migrate/20120928092721_create_goldencobra_comments.rb +0 -16
  938. data/db/migrate/20120928105956_devise_create_visitors.rb +0 -46
  939. data/db/migrate/20121001092249_add_names_to_visitors.rb +0 -6
  940. data/db/migrate/20121002143111_add_columns_to_visitors.rb +0 -8
  941. data/db/migrate/20121003102003_add_dynamicredirect_to_goldencobraarticles.rb +0 -6
  942. data/db/migrate/20121003140056_add_token_to_visitors.rb +0 -12
  943. data/db/migrate/20121006095912_add_commentable_to_article.rb +0 -5
  944. data/db/migrate/20121007125002_add_activesince_to_goldencobra_articles.rb +0 -5
  945. data/db/migrate/20121011062432_add_username_to_visitors.rb +0 -5
  946. data/db/migrate/20121015071150_add_link_title_to_goldencobra_articles.rb +0 -5
  947. data/db/migrate/20121029131138_add_offline_setter_to_goldencobra_widgets.rb +0 -7
  948. data/db/migrate/20121030112343_add_offline_active_to_goldencobra_widgets.rb +0 -5
  949. data/db/migrate/20121030120838_add_alternative_content_to_goldencobra_widgets.rb +0 -5
  950. data/db/migrate/20121121144623_add_datum_to_widgets.rb +0 -6
  951. data/db/migrate/20121122091033_add_sorter_number_to_goldencobra_uploads.rb +0 -5
  952. data/db/migrate/20121206104701_add_type_to_goldencobra_settings.rb +0 -5
  953. data/db/migrate/20130104145454_add_weektimes_to_goldencobra_widgets.rb +0 -7
  954. data/db/migrate/20130114154115_add_sorter_to_goldencobra_permissions.rb +0 -8
  955. data/db/migrate/20130115104440_add_expert_mode_to_users.rb +0 -5
  956. data/db/migrate/20130118115233_add_poly_to_goldencobra_role_users.rb +0 -6
  957. data/db/migrate/20130128170204_add_default_article_type_for_nil.rb +0 -11
  958. data/db/migrate/20130129092029_add_poly_to_goldencobra_locations.rb +0 -6
  959. data/db/migrate/20130204102953_add_locationoption_to_goldencobra_locations.rb +0 -5
  960. data/db/migrate/20130205084748_add_loginable_to_visitors.rb +0 -6
  961. data/db/migrate/20130225154241_add_redirect_to_goldencobra_roles.rb +0 -5
  962. data/db/migrate/20130301144344_add_indextypes_to_goldencobra_articles.rb +0 -5
  963. data/db/migrate/20130404110743_add_sessions_table.rb +0 -12
  964. data/db/migrate/20130404121434_create_goldencobra_trackings.rb +0 -13
  965. data/db/migrate/20130404135801_add_options_to_goldencobra_trackings.rb +0 -6
  966. data/db/migrate/20130404140858_add_moreoptions_to_goldencobra_trackings.rb +0 -8
  967. data/db/migrate/20130405071320_add_params_to_goldencobra_trackings.rb +0 -5
  968. data/db/migrate/20130405073103_add_googleparams_to_goldencobra_trackings.rb +0 -9
  969. data/db/migrate/20130405074654_add_location_to_tracking.rb +0 -5
  970. data/db/migrate/20130426123928_add_polymorphic_to_goldencobra_metatags.rb +0 -6
  971. data/db/migrate/20130507115517_create_translations.rb +0 -13
  972. data/db/migrate/20130702155529_create_goldencobra_authors.rb +0 -12
  973. data/db/migrate/20130702160247_rename_authorstobackup_to_goldencobra_articles.rb +0 -11
  974. data/db/migrate/20130722152135_add_encodingtype_to_goldencobra_imports.rb +0 -5
  975. data/db/migrate/20130723084542_add_assgroup_to_goldencobra_importer.rb +0 -5
  976. data/db/migrate/20130724123225_create_goldencobra_import_metadata.rb +0 -16
  977. data/db/migrate/20130730113452_add_skip_to_goldencobra_locations.rb +0 -5
  978. data/db/migrate/20130730144331_add_linkchecker_to_goldencobra_articles.rb +0 -5
  979. data/db/migrate/20130903085746_change_datatype_of_url_paremeters.rb +0 -9
  980. data/db/migrate/20130909143144_create_goldencobra_domains.rb +0 -11
  981. data/db/migrate/20130925133203_add_prefix_to_goldencobra_domains.rb +0 -5
  982. data/db/migrate/20131018111343_add_cache_to_goldencobra_menues.rb +0 -12
  983. data/db/migrate/20131129143509_add_remote_to_goldencobra_menues.rb +0 -5
  984. data/db/migrate/20131216110750_add_main_to_goldencobra_domains.rb +0 -7
  985. data/db/migrate/20140127084929_create_goldencobra_articletypes.rb +0 -16
  986. data/db/migrate/20140128091516_create_goldencobra_articletype_groups.rb +0 -16
  987. data/db/migrate/20140128104519_create_goldencobra_articletype_fields.rb +0 -14
  988. data/db/migrate/20140128112747_add_position_to_goldencobra_articletype_group.rb +0 -7
  989. data/db/migrate/20140204221345_add_operator_to_goldencobra_permissions.rb +0 -5
  990. data/db/migrate/20140411152728_add_creator_id_to_goldencobra_articles.rb +0 -5
  991. data/db/migrate/20140505144517_add_taggingcounter.rb +0 -15
  992. data/db/migrate/20140603084537_add_domain_to_goldencobra_permissions.rb +0 -7
  993. data/db/migrate/20140615200342_resize_link_checkfield.rb +0 -13
  994. data/db/migrate/20140626135753_add_externalreferee_to_goldencobra_articles.rb +0 -6
  995. data/db/migrate/20140702103024_add_externaldate_to_goldencobra_articles.rb +0 -5
  996. data/db/migrate/20140702105550_add_remoteurl_to_goldencobra_uploads.rb +0 -5
  997. data/db/migrate/20140702142818_add_image_gallery_type_to_goldencobra_articles.rb +0 -5
  998. data/db/migrate/20140819101033_add_urlpath_to_goldencobra_articles.rb +0 -5
  999. data/db/migrate/20141104115144_create_goldencobra_redirectors.rb +0 -15
  1000. data/db/migrate/20141112124531_add_globalsorting_to_goldencobra_articles.rb +0 -7
  1001. data/db/migrate/20141124170930_add_indiex_to_gc.rb +0 -26
  1002. data/db/migrate/20150115111024_create_goldencobra_article_authors.rb +0 -28
  1003. data/db/migrate/20150115134707_add_remove_author_stuff.rb +0 -11
  1004. data/db/migrate/20150417153454_add_status_to_goldencobra_vita_steps.rb +0 -5
  1005. data/lib/generators/goldencobra/templates/assets/images/icons/icon-bookmark-40x40-light.png +0 -0
  1006. data/lib/generators/goldencobra/templates/assets/images/icons/icon-pdf-40x40-light.png +0 -0
  1007. data/lib/generators/goldencobra/templates/assets/images/icons/icon-print-40x40-light.png +0 -0
  1008. data/lib/generators/goldencobra/templates/assets/images/logo.gif +0 -0
  1009. data/lib/generators/goldencobra/templates/assets/images/rails.png +0 -0
  1010. data/lib/generators/goldencobra/templates/assets/stylesheets/application.css.scss +0 -29
  1011. data/lib/generators/goldencobra/templates/assets/stylesheets/footer/content.css.scss +0 -31
  1012. data/lib/generators/goldencobra/templates/assets/stylesheets/header/content.css.scss +0 -102
  1013. data/lib/generators/goldencobra/templates/assets/stylesheets/main/content.css.scss +0 -192
  1014. data/lib/generators/goldencobra/templates/assets/stylesheets/share/mixins.css.scss +0 -174
  1015. data/lib/generators/goldencobra/templates/assets/stylesheets/share/variables.css.scss +0 -31
  1016. data/lib/generators/goldencobra/templates/views/layouts/_header.html.erb +0 -61
  1017. data/lib/generators/goldencobra/templates/views/layouts/_header_slider.html.erb +0 -14
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Utils.js
3
+ *
4
+ * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
+ *
7
+ * License: http://www.tinymce.com/license
8
+ * Contributing: http://www.tinymce.com/contributing
9
+ */
10
+
11
+ /**
12
+ * Various utility functions.
13
+ *
14
+ * @class tinymce.tableplugin.Utils
15
+ * @private
16
+ */
17
+ define("tinymce/tableplugin/Utils", [
18
+ "tinymce/Env"
19
+ ], function(Env) {
20
+ function getSpanVal(td, name) {
21
+ return parseInt(td.getAttribute(name) || 1, 10);
22
+ }
23
+
24
+ function paddCell(cell) {
25
+ if (!Env.ie || Env.ie > 10) {
26
+ cell.innerHTML = '<br data-mce-bogus="1" />';
27
+ }
28
+ }
29
+
30
+ return {
31
+ getSpanVal: getSpanVal,
32
+ paddCell: paddCell
33
+ };
34
+ });
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Inline development version. Only to be used while developing since it uses document.write to load scripts.
3
+ */
4
+
5
+ /*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
6
+ /*globals $code */
7
+
8
+ (function(exports) {
9
+ "use strict";
10
+
11
+ var html = "", baseDir;
12
+ var modules = {}, exposedModules = [], moduleCount = 0;
13
+
14
+ var scripts = document.getElementsByTagName('script');
15
+ for (var i = 0; i < scripts.length; i++) {
16
+ var src = scripts[i].src;
17
+
18
+ if (src.indexOf('/plugin.dev.js') != -1) {
19
+ baseDir = src.substring(0, src.lastIndexOf('/'));
20
+ }
21
+ }
22
+
23
+ function require(ids, callback) {
24
+ var module, defs = [];
25
+
26
+ for (var i = 0; i < ids.length; ++i) {
27
+ module = modules[ids[i]] || resolve(ids[i]);
28
+ if (!module) {
29
+ throw 'module definition dependecy not found: ' + ids[i];
30
+ }
31
+
32
+ defs.push(module);
33
+ }
34
+
35
+ callback.apply(null, defs);
36
+ }
37
+
38
+ function resolve(id) {
39
+ if (exports.privateModules && id in exports.privateModules) {
40
+ return;
41
+ }
42
+
43
+ var target = exports;
44
+ var fragments = id.split(/[.\/]/);
45
+
46
+ for (var fi = 0; fi < fragments.length; ++fi) {
47
+ if (!target[fragments[fi]]) {
48
+ return;
49
+ }
50
+
51
+ target = target[fragments[fi]];
52
+ }
53
+
54
+ return target;
55
+ }
56
+
57
+ function register(id) {
58
+ var target = exports;
59
+ var fragments = id.split(/[.\/]/);
60
+
61
+ for (var fi = 0; fi < fragments.length - 1; ++fi) {
62
+ if (target[fragments[fi]] === undefined) {
63
+ target[fragments[fi]] = {};
64
+ }
65
+
66
+ target = target[fragments[fi]];
67
+ }
68
+
69
+ target[fragments[fragments.length - 1]] = modules[id];
70
+ }
71
+
72
+ function define(id, dependencies, definition) {
73
+ var privateModules, i;
74
+
75
+ if (typeof id !== 'string') {
76
+ throw 'invalid module definition, module id must be defined and be a string';
77
+ }
78
+
79
+ if (dependencies === undefined) {
80
+ throw 'invalid module definition, dependencies must be specified';
81
+ }
82
+
83
+ if (definition === undefined) {
84
+ throw 'invalid module definition, definition function must be specified';
85
+ }
86
+
87
+ require(dependencies, function() {
88
+ modules[id] = definition.apply(null, arguments);
89
+ });
90
+
91
+ if (--moduleCount === 0) {
92
+ for (i = 0; i < exposedModules.length; i++) {
93
+ register(exposedModules[i]);
94
+ }
95
+ }
96
+
97
+ // Expose private modules for unit tests
98
+ if (exports.AMDLC_TESTS) {
99
+ privateModules = exports.privateModules || {};
100
+
101
+ for (id in modules) {
102
+ privateModules[id] = modules[id];
103
+ }
104
+
105
+ for (i = 0; i < exposedModules.length; i++) {
106
+ delete privateModules[exposedModules[i]];
107
+ }
108
+
109
+ exports.privateModules = privateModules;
110
+ }
111
+
112
+ }
113
+
114
+ function expose(ids) {
115
+ exposedModules = ids;
116
+ }
117
+
118
+ function writeScripts() {
119
+ document.write(html);
120
+ }
121
+
122
+ function load(path) {
123
+ html += '<script type="text/javascript" src="' + baseDir + '/' + path + '"></script>\n';
124
+ moduleCount++;
125
+ }
126
+
127
+ // Expose globally
128
+ exports.define = define;
129
+ exports.require = require;
130
+
131
+ load('classes/Utils.js');
132
+ load('classes/TableGrid.js');
133
+ load('classes/Quirks.js');
134
+ load('classes/CellSelection.js');
135
+ load('classes/Dialogs.js');
136
+ load('classes/Plugin.js');
137
+
138
+ writeScripts();
139
+ })(this);
140
+
141
+ // $hash: 89b06b4fd9525fcda41462475e8e8f54
@@ -0,0 +1,2844 @@
1
+ /**
2
+ * Compiled inline version. (Library mode)
3
+ */
4
+
5
+ /*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
6
+ /*globals $code */
7
+
8
+ (function(exports, undefined) {
9
+ "use strict";
10
+
11
+ var modules = {};
12
+
13
+ function require(ids, callback) {
14
+ var module, defs = [];
15
+
16
+ for (var i = 0; i < ids.length; ++i) {
17
+ module = modules[ids[i]] || resolve(ids[i]);
18
+ if (!module) {
19
+ throw 'module definition dependecy not found: ' + ids[i];
20
+ }
21
+
22
+ defs.push(module);
23
+ }
24
+
25
+ callback.apply(null, defs);
26
+ }
27
+
28
+ function define(id, dependencies, definition) {
29
+ if (typeof id !== 'string') {
30
+ throw 'invalid module definition, module id must be defined and be a string';
31
+ }
32
+
33
+ if (dependencies === undefined) {
34
+ throw 'invalid module definition, dependencies must be specified';
35
+ }
36
+
37
+ if (definition === undefined) {
38
+ throw 'invalid module definition, definition function must be specified';
39
+ }
40
+
41
+ require(dependencies, function() {
42
+ modules[id] = definition.apply(null, arguments);
43
+ });
44
+ }
45
+
46
+ function defined(id) {
47
+ return !!modules[id];
48
+ }
49
+
50
+ function resolve(id) {
51
+ var target = exports;
52
+ var fragments = id.split(/[.\/]/);
53
+
54
+ for (var fi = 0; fi < fragments.length; ++fi) {
55
+ if (!target[fragments[fi]]) {
56
+ return;
57
+ }
58
+
59
+ target = target[fragments[fi]];
60
+ }
61
+
62
+ return target;
63
+ }
64
+
65
+ function expose(ids) {
66
+ var i, target, id, fragments, privateModules;
67
+
68
+ for (i = 0; i < ids.length; i++) {
69
+ target = exports;
70
+ id = ids[i];
71
+ fragments = id.split(/[.\/]/);
72
+
73
+ for (var fi = 0; fi < fragments.length - 1; ++fi) {
74
+ if (target[fragments[fi]] === undefined) {
75
+ target[fragments[fi]] = {};
76
+ }
77
+
78
+ target = target[fragments[fi]];
79
+ }
80
+
81
+ target[fragments[fragments.length - 1]] = modules[id];
82
+ }
83
+
84
+ // Expose private modules for unit tests
85
+ if (exports.AMDLC_TESTS) {
86
+ privateModules = exports.privateModules || {};
87
+
88
+ for (id in modules) {
89
+ privateModules[id] = modules[id];
90
+ }
91
+
92
+ for (i = 0; i < ids.length; i++) {
93
+ delete privateModules[ids[i]];
94
+ }
95
+
96
+ exports.privateModules = privateModules;
97
+ }
98
+ }
99
+
100
+ // Included from: js/tinymce/plugins/table/classes/Utils.js
101
+
102
+ /**
103
+ * Utils.js
104
+ *
105
+ * Released under LGPL License.
106
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
107
+ *
108
+ * License: http://www.tinymce.com/license
109
+ * Contributing: http://www.tinymce.com/contributing
110
+ */
111
+
112
+ /**
113
+ * Various utility functions.
114
+ *
115
+ * @class tinymce.tableplugin.Utils
116
+ * @private
117
+ */
118
+ define("tinymce/tableplugin/Utils", [
119
+ "tinymce/Env"
120
+ ], function(Env) {
121
+ function getSpanVal(td, name) {
122
+ return parseInt(td.getAttribute(name) || 1, 10);
123
+ }
124
+
125
+ function paddCell(cell) {
126
+ if (!Env.ie || Env.ie > 10) {
127
+ cell.innerHTML = '<br data-mce-bogus="1" />';
128
+ }
129
+ }
130
+
131
+ return {
132
+ getSpanVal: getSpanVal,
133
+ paddCell: paddCell
134
+ };
135
+ });
136
+
137
+ // Included from: js/tinymce/plugins/table/classes/TableGrid.js
138
+
139
+ /**
140
+ * TableGrid.js
141
+ *
142
+ * Released under LGPL License.
143
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
144
+ *
145
+ * License: http://www.tinymce.com/license
146
+ * Contributing: http://www.tinymce.com/contributing
147
+ */
148
+
149
+ /**
150
+ * This class creates a grid out of a table element. This
151
+ * makes it a whole lot easier to handle complex tables with
152
+ * col/row spans.
153
+ *
154
+ * @class tinymce.tableplugin.TableGrid
155
+ * @private
156
+ */
157
+ define("tinymce/tableplugin/TableGrid", [
158
+ "tinymce/util/Tools",
159
+ "tinymce/Env",
160
+ "tinymce/tableplugin/Utils"
161
+ ], function(Tools, Env, Utils) {
162
+ var each = Tools.each, getSpanVal = Utils.getSpanVal;
163
+
164
+ return function(editor, table) {
165
+ var grid, gridWidth, startPos, endPos, selectedCell, selection = editor.selection, dom = selection.dom;
166
+
167
+ function buildGrid() {
168
+ var startY = 0;
169
+
170
+ grid = [];
171
+ gridWidth = 0;
172
+
173
+ each(['thead', 'tbody', 'tfoot'], function(part) {
174
+ var rows = dom.select('> ' + part + ' tr', table);
175
+
176
+ each(rows, function(tr, y) {
177
+ y += startY;
178
+
179
+ each(dom.select('> td, > th', tr), function(td, x) {
180
+ var x2, y2, rowspan, colspan;
181
+
182
+ // Skip over existing cells produced by rowspan
183
+ if (grid[y]) {
184
+ while (grid[y][x]) {
185
+ x++;
186
+ }
187
+ }
188
+
189
+ // Get col/rowspan from cell
190
+ rowspan = getSpanVal(td, 'rowspan');
191
+ colspan = getSpanVal(td, 'colspan');
192
+
193
+ // Fill out rowspan/colspan right and down
194
+ for (y2 = y; y2 < y + rowspan; y2++) {
195
+ if (!grid[y2]) {
196
+ grid[y2] = [];
197
+ }
198
+
199
+ for (x2 = x; x2 < x + colspan; x2++) {
200
+ grid[y2][x2] = {
201
+ part: part,
202
+ real: y2 == y && x2 == x,
203
+ elm: td,
204
+ rowspan: rowspan,
205
+ colspan: colspan
206
+ };
207
+ }
208
+ }
209
+
210
+ gridWidth = Math.max(gridWidth, x + 1);
211
+ });
212
+ });
213
+
214
+ startY += rows.length;
215
+ });
216
+ }
217
+
218
+ function cloneNode(node, children) {
219
+ node = node.cloneNode(children);
220
+ node.removeAttribute('id');
221
+
222
+ return node;
223
+ }
224
+
225
+ function getCell(x, y) {
226
+ var row;
227
+
228
+ row = grid[y];
229
+ if (row) {
230
+ return row[x];
231
+ }
232
+ }
233
+
234
+ function setSpanVal(td, name, val) {
235
+ if (td) {
236
+ val = parseInt(val, 10);
237
+
238
+ if (val === 1) {
239
+ td.removeAttribute(name, 1);
240
+ } else {
241
+ td.setAttribute(name, val, 1);
242
+ }
243
+ }
244
+ }
245
+
246
+ function isCellSelected(cell) {
247
+ return cell && (dom.hasClass(cell.elm, 'mce-item-selected') || cell == selectedCell);
248
+ }
249
+
250
+ function getSelectedRows() {
251
+ var rows = [];
252
+
253
+ each(table.rows, function(row) {
254
+ each(row.cells, function(cell) {
255
+ if (dom.hasClass(cell, 'mce-item-selected') || (selectedCell && cell == selectedCell.elm)) {
256
+ rows.push(row);
257
+ return false;
258
+ }
259
+ });
260
+ });
261
+
262
+ return rows;
263
+ }
264
+
265
+ function deleteTable() {
266
+ var rng = dom.createRng();
267
+
268
+ rng.setStartAfter(table);
269
+ rng.setEndAfter(table);
270
+
271
+ selection.setRng(rng);
272
+
273
+ dom.remove(table);
274
+ }
275
+
276
+ function cloneCell(cell) {
277
+ var formatNode, cloneFormats = {};
278
+
279
+ if (editor.settings.table_clone_elements !== false) {
280
+ cloneFormats = Tools.makeMap(
281
+ (editor.settings.table_clone_elements || 'strong em b i span font h1 h2 h3 h4 h5 h6 p div').toUpperCase(),
282
+ /[ ,]/
283
+ );
284
+ }
285
+
286
+ // Clone formats
287
+ Tools.walk(cell, function(node) {
288
+ var curNode;
289
+
290
+ if (node.nodeType == 3) {
291
+ each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
292
+ if (!cloneFormats[node.nodeName]) {
293
+ return;
294
+ }
295
+
296
+ node = cloneNode(node, false);
297
+
298
+ if (!formatNode) {
299
+ formatNode = curNode = node;
300
+ } else if (curNode) {
301
+ curNode.appendChild(node);
302
+ }
303
+
304
+ curNode = node;
305
+ });
306
+
307
+ // Add something to the inner node
308
+ if (curNode) {
309
+ curNode.innerHTML = Env.ie ? '&nbsp;' : '<br data-mce-bogus="1" />';
310
+ }
311
+
312
+ return false;
313
+ }
314
+ }, 'childNodes');
315
+
316
+ cell = cloneNode(cell, false);
317
+ setSpanVal(cell, 'rowSpan', 1);
318
+ setSpanVal(cell, 'colSpan', 1);
319
+
320
+ if (formatNode) {
321
+ cell.appendChild(formatNode);
322
+ } else {
323
+ Utils.paddCell(cell);
324
+ }
325
+
326
+ return cell;
327
+ }
328
+
329
+ function cleanup() {
330
+ var rng = dom.createRng(), row;
331
+
332
+ // Empty rows
333
+ each(dom.select('tr', table), function(tr) {
334
+ if (tr.cells.length === 0) {
335
+ dom.remove(tr);
336
+ }
337
+ });
338
+
339
+ // Empty table
340
+ if (dom.select('tr', table).length === 0) {
341
+ rng.setStartBefore(table);
342
+ rng.setEndBefore(table);
343
+ selection.setRng(rng);
344
+ dom.remove(table);
345
+ return;
346
+ }
347
+
348
+ // Empty header/body/footer
349
+ each(dom.select('thead,tbody,tfoot', table), function(part) {
350
+ if (part.rows.length === 0) {
351
+ dom.remove(part);
352
+ }
353
+ });
354
+
355
+ // Restore selection to start position if it still exists
356
+ buildGrid();
357
+
358
+ // If we have a valid startPos object
359
+ if (startPos) {
360
+ // Restore the selection to the closest table position
361
+ row = grid[Math.min(grid.length - 1, startPos.y)];
362
+ if (row) {
363
+ selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
364
+ selection.collapse(true);
365
+ }
366
+ }
367
+ }
368
+
369
+ function fillLeftDown(x, y, rows, cols) {
370
+ var tr, x2, r, c, cell;
371
+
372
+ tr = grid[y][x].elm.parentNode;
373
+ for (r = 1; r <= rows; r++) {
374
+ tr = dom.getNext(tr, 'tr');
375
+
376
+ if (tr) {
377
+ // Loop left to find real cell
378
+ for (x2 = x; x2 >= 0; x2--) {
379
+ cell = grid[y + r][x2].elm;
380
+
381
+ if (cell.parentNode == tr) {
382
+ // Append clones after
383
+ for (c = 1; c <= cols; c++) {
384
+ dom.insertAfter(cloneCell(cell), cell);
385
+ }
386
+
387
+ break;
388
+ }
389
+ }
390
+
391
+ if (x2 == -1) {
392
+ // Insert nodes before first cell
393
+ for (c = 1; c <= cols; c++) {
394
+ tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
395
+ }
396
+ }
397
+ }
398
+ }
399
+ }
400
+
401
+ function split() {
402
+ each(grid, function(row, y) {
403
+ each(row, function(cell, x) {
404
+ var colSpan, rowSpan, i;
405
+
406
+ if (isCellSelected(cell)) {
407
+ cell = cell.elm;
408
+ colSpan = getSpanVal(cell, 'colspan');
409
+ rowSpan = getSpanVal(cell, 'rowspan');
410
+
411
+ if (colSpan > 1 || rowSpan > 1) {
412
+ setSpanVal(cell, 'rowSpan', 1);
413
+ setSpanVal(cell, 'colSpan', 1);
414
+
415
+ // Insert cells right
416
+ for (i = 0; i < colSpan - 1; i++) {
417
+ dom.insertAfter(cloneCell(cell), cell);
418
+ }
419
+
420
+ fillLeftDown(x, y, rowSpan - 1, colSpan);
421
+ }
422
+ }
423
+ });
424
+ });
425
+ }
426
+
427
+ function merge(cell, cols, rows) {
428
+ var pos, startX, startY, endX, endY, x, y, startCell, endCell, children, count;
429
+
430
+ // Use specified cell and cols/rows
431
+ if (cell) {
432
+ pos = getPos(cell);
433
+ startX = pos.x;
434
+ startY = pos.y;
435
+ endX = startX + (cols - 1);
436
+ endY = startY + (rows - 1);
437
+ } else {
438
+ startPos = endPos = null;
439
+
440
+ // Calculate start/end pos by checking for selected cells in grid works better with context menu
441
+ each(grid, function(row, y) {
442
+ each(row, function(cell, x) {
443
+ if (isCellSelected(cell)) {
444
+ if (!startPos) {
445
+ startPos = {x: x, y: y};
446
+ }
447
+
448
+ endPos = {x: x, y: y};
449
+ }
450
+ });
451
+ });
452
+
453
+ // Use selection, but make sure startPos is valid before accessing
454
+ if (startPos) {
455
+ startX = startPos.x;
456
+ startY = startPos.y;
457
+ endX = endPos.x;
458
+ endY = endPos.y;
459
+ }
460
+ }
461
+
462
+ // Find start/end cells
463
+ startCell = getCell(startX, startY);
464
+ endCell = getCell(endX, endY);
465
+
466
+ // Check if the cells exists and if they are of the same part for example tbody = tbody
467
+ if (startCell && endCell && startCell.part == endCell.part) {
468
+ // Split and rebuild grid
469
+ split();
470
+ buildGrid();
471
+
472
+ // Set row/col span to start cell
473
+ startCell = getCell(startX, startY).elm;
474
+ setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
475
+ setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
476
+
477
+ // Remove other cells and add it's contents to the start cell
478
+ for (y = startY; y <= endY; y++) {
479
+ for (x = startX; x <= endX; x++) {
480
+ if (!grid[y] || !grid[y][x]) {
481
+ continue;
482
+ }
483
+
484
+ cell = grid[y][x].elm;
485
+
486
+ /*jshint loopfunc:true */
487
+ /*eslint no-loop-func:0 */
488
+ if (cell != startCell) {
489
+ // Move children to startCell
490
+ children = Tools.grep(cell.childNodes);
491
+ each(children, function(node) {
492
+ startCell.appendChild(node);
493
+ });
494
+
495
+ // Remove bogus nodes if there is children in the target cell
496
+ if (children.length) {
497
+ children = Tools.grep(startCell.childNodes);
498
+ count = 0;
499
+ each(children, function(node) {
500
+ if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) {
501
+ startCell.removeChild(node);
502
+ }
503
+ });
504
+ }
505
+
506
+ dom.remove(cell);
507
+ }
508
+ }
509
+ }
510
+
511
+ // Remove empty rows etc and restore caret location
512
+ cleanup();
513
+ }
514
+ }
515
+
516
+ function insertRow(before) {
517
+ var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
518
+
519
+ // Find first/last row
520
+ each(grid, function(row, y) {
521
+ each(row, function(cell) {
522
+ if (isCellSelected(cell)) {
523
+ cell = cell.elm;
524
+ rowElm = cell.parentNode;
525
+ newRow = cloneNode(rowElm, false);
526
+ posY = y;
527
+
528
+ if (before) {
529
+ return false;
530
+ }
531
+ }
532
+ });
533
+
534
+ if (before) {
535
+ return !posY;
536
+ }
537
+ });
538
+
539
+ // If posY is undefined there is nothing for us to do here...just return to avoid crashing below
540
+ if (posY === undefined) {
541
+ return;
542
+ }
543
+
544
+ for (x = 0; x < grid[0].length; x++) {
545
+ // Cell not found could be because of an invalid table structure
546
+ if (!grid[posY][x]) {
547
+ continue;
548
+ }
549
+
550
+ cell = grid[posY][x].elm;
551
+
552
+ if (cell != lastCell) {
553
+ if (!before) {
554
+ rowSpan = getSpanVal(cell, 'rowspan');
555
+ if (rowSpan > 1) {
556
+ setSpanVal(cell, 'rowSpan', rowSpan + 1);
557
+ continue;
558
+ }
559
+ } else {
560
+ // Check if cell above can be expanded
561
+ if (posY > 0 && grid[posY - 1][x]) {
562
+ otherCell = grid[posY - 1][x].elm;
563
+ rowSpan = getSpanVal(otherCell, 'rowSpan');
564
+ if (rowSpan > 1) {
565
+ setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
566
+ continue;
567
+ }
568
+ }
569
+ }
570
+
571
+ // Insert new cell into new row
572
+ newCell = cloneCell(cell);
573
+ setSpanVal(newCell, 'colSpan', cell.colSpan);
574
+
575
+ newRow.appendChild(newCell);
576
+
577
+ lastCell = cell;
578
+ }
579
+ }
580
+
581
+ if (newRow.hasChildNodes()) {
582
+ if (!before) {
583
+ dom.insertAfter(newRow, rowElm);
584
+ } else {
585
+ rowElm.parentNode.insertBefore(newRow, rowElm);
586
+ }
587
+ }
588
+ }
589
+
590
+ function insertCol(before) {
591
+ var posX, lastCell;
592
+
593
+ // Find first/last column
594
+ each(grid, function(row) {
595
+ each(row, function(cell, x) {
596
+ if (isCellSelected(cell)) {
597
+ posX = x;
598
+
599
+ if (before) {
600
+ return false;
601
+ }
602
+ }
603
+ });
604
+
605
+ if (before) {
606
+ return !posX;
607
+ }
608
+ });
609
+
610
+ each(grid, function(row, y) {
611
+ var cell, rowSpan, colSpan;
612
+
613
+ if (!row[posX]) {
614
+ return;
615
+ }
616
+
617
+ cell = row[posX].elm;
618
+ if (cell != lastCell) {
619
+ colSpan = getSpanVal(cell, 'colspan');
620
+ rowSpan = getSpanVal(cell, 'rowspan');
621
+
622
+ if (colSpan == 1) {
623
+ if (!before) {
624
+ dom.insertAfter(cloneCell(cell), cell);
625
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);
626
+ } else {
627
+ cell.parentNode.insertBefore(cloneCell(cell), cell);
628
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);
629
+ }
630
+ } else {
631
+ setSpanVal(cell, 'colSpan', cell.colSpan + 1);
632
+ }
633
+
634
+ lastCell = cell;
635
+ }
636
+ });
637
+ }
638
+
639
+ function deleteCols() {
640
+ var cols = [];
641
+
642
+ // Get selected column indexes
643
+ each(grid, function(row) {
644
+ each(row, function(cell, x) {
645
+ if (isCellSelected(cell) && Tools.inArray(cols, x) === -1) {
646
+ each(grid, function(row) {
647
+ var cell = row[x].elm, colSpan;
648
+
649
+ colSpan = getSpanVal(cell, 'colSpan');
650
+
651
+ if (colSpan > 1) {
652
+ setSpanVal(cell, 'colSpan', colSpan - 1);
653
+ } else {
654
+ dom.remove(cell);
655
+ }
656
+ });
657
+
658
+ cols.push(x);
659
+ }
660
+ });
661
+ });
662
+
663
+ cleanup();
664
+ }
665
+
666
+ function deleteRows() {
667
+ var rows;
668
+
669
+ function deleteRow(tr) {
670
+ var pos, lastCell;
671
+
672
+ // Move down row spanned cells
673
+ each(tr.cells, function(cell) {
674
+ var rowSpan = getSpanVal(cell, 'rowSpan');
675
+
676
+ if (rowSpan > 1) {
677
+ setSpanVal(cell, 'rowSpan', rowSpan - 1);
678
+ pos = getPos(cell);
679
+ fillLeftDown(pos.x, pos.y, 1, 1);
680
+ }
681
+ });
682
+
683
+ // Delete cells
684
+ pos = getPos(tr.cells[0]);
685
+ each(grid[pos.y], function(cell) {
686
+ var rowSpan;
687
+
688
+ cell = cell.elm;
689
+
690
+ if (cell != lastCell) {
691
+ rowSpan = getSpanVal(cell, 'rowSpan');
692
+
693
+ if (rowSpan <= 1) {
694
+ dom.remove(cell);
695
+ } else {
696
+ setSpanVal(cell, 'rowSpan', rowSpan - 1);
697
+ }
698
+
699
+ lastCell = cell;
700
+ }
701
+ });
702
+ }
703
+
704
+ // Get selected rows and move selection out of scope
705
+ rows = getSelectedRows();
706
+
707
+ // Delete all selected rows
708
+ each(rows.reverse(), function(tr) {
709
+ deleteRow(tr);
710
+ });
711
+
712
+ cleanup();
713
+ }
714
+
715
+ function cutRows() {
716
+ var rows = getSelectedRows();
717
+
718
+ dom.remove(rows);
719
+ cleanup();
720
+
721
+ return rows;
722
+ }
723
+
724
+ function copyRows() {
725
+ var rows = getSelectedRows();
726
+
727
+ each(rows, function(row, i) {
728
+ rows[i] = cloneNode(row, true);
729
+ });
730
+
731
+ return rows;
732
+ }
733
+
734
+ function pasteRows(rows, before) {
735
+ var selectedRows = getSelectedRows(),
736
+ targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
737
+ targetCellCount = targetRow.cells.length;
738
+
739
+ // Nothing to paste
740
+ if (!rows) {
741
+ return;
742
+ }
743
+
744
+ // Calc target cell count
745
+ each(grid, function(row) {
746
+ var match;
747
+
748
+ targetCellCount = 0;
749
+ each(row, function(cell) {
750
+ if (cell.real) {
751
+ targetCellCount += cell.colspan;
752
+ }
753
+
754
+ if (cell.elm.parentNode == targetRow) {
755
+ match = 1;
756
+ }
757
+ });
758
+
759
+ if (match) {
760
+ return false;
761
+ }
762
+ });
763
+
764
+ if (!before) {
765
+ rows.reverse();
766
+ }
767
+
768
+ each(rows, function(row) {
769
+ var i, cellCount = row.cells.length, cell;
770
+
771
+ // Remove col/rowspans
772
+ for (i = 0; i < cellCount; i++) {
773
+ cell = row.cells[i];
774
+ setSpanVal(cell, 'colSpan', 1);
775
+ setSpanVal(cell, 'rowSpan', 1);
776
+ }
777
+
778
+ // Needs more cells
779
+ for (i = cellCount; i < targetCellCount; i++) {
780
+ row.appendChild(cloneCell(row.cells[cellCount - 1]));
781
+ }
782
+
783
+ // Needs less cells
784
+ for (i = targetCellCount; i < cellCount; i++) {
785
+ dom.remove(row.cells[i]);
786
+ }
787
+
788
+ // Add before/after
789
+ if (before) {
790
+ targetRow.parentNode.insertBefore(row, targetRow);
791
+ } else {
792
+ dom.insertAfter(row, targetRow);
793
+ }
794
+ });
795
+
796
+ // Remove current selection
797
+ dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected');
798
+ }
799
+
800
+ function getPos(target) {
801
+ var pos;
802
+
803
+ each(grid, function(row, y) {
804
+ each(row, function(cell, x) {
805
+ if (cell.elm == target) {
806
+ pos = {x: x, y: y};
807
+ return false;
808
+ }
809
+ });
810
+
811
+ return !pos;
812
+ });
813
+
814
+ return pos;
815
+ }
816
+
817
+ function setStartCell(cell) {
818
+ startPos = getPos(cell);
819
+ }
820
+
821
+ function findEndPos() {
822
+ var maxX, maxY;
823
+
824
+ maxX = maxY = 0;
825
+
826
+ each(grid, function(row, y) {
827
+ each(row, function(cell, x) {
828
+ var colSpan, rowSpan;
829
+
830
+ if (isCellSelected(cell)) {
831
+ cell = grid[y][x];
832
+
833
+ if (x > maxX) {
834
+ maxX = x;
835
+ }
836
+
837
+ if (y > maxY) {
838
+ maxY = y;
839
+ }
840
+
841
+ if (cell.real) {
842
+ colSpan = cell.colspan - 1;
843
+ rowSpan = cell.rowspan - 1;
844
+
845
+ if (colSpan) {
846
+ if (x + colSpan > maxX) {
847
+ maxX = x + colSpan;
848
+ }
849
+ }
850
+
851
+ if (rowSpan) {
852
+ if (y + rowSpan > maxY) {
853
+ maxY = y + rowSpan;
854
+ }
855
+ }
856
+ }
857
+ }
858
+ });
859
+ });
860
+
861
+ return {x: maxX, y: maxY};
862
+ }
863
+
864
+ function setEndCell(cell) {
865
+ var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan, x, y;
866
+
867
+ endPos = getPos(cell);
868
+
869
+ if (startPos && endPos) {
870
+ // Get start/end positions
871
+ startX = Math.min(startPos.x, endPos.x);
872
+ startY = Math.min(startPos.y, endPos.y);
873
+ endX = Math.max(startPos.x, endPos.x);
874
+ endY = Math.max(startPos.y, endPos.y);
875
+
876
+ // Expand end positon to include spans
877
+ maxX = endX;
878
+ maxY = endY;
879
+
880
+ // Expand startX
881
+ for (y = startY; y <= maxY; y++) {
882
+ cell = grid[y][startX];
883
+
884
+ if (!cell.real) {
885
+ if (startX - (cell.colspan - 1) < startX) {
886
+ startX -= cell.colspan - 1;
887
+ }
888
+ }
889
+ }
890
+
891
+ // Expand startY
892
+ for (x = startX; x <= maxX; x++) {
893
+ cell = grid[startY][x];
894
+
895
+ if (!cell.real) {
896
+ if (startY - (cell.rowspan - 1) < startY) {
897
+ startY -= cell.rowspan - 1;
898
+ }
899
+ }
900
+ }
901
+
902
+ // Find max X, Y
903
+ for (y = startY; y <= endY; y++) {
904
+ for (x = startX; x <= endX; x++) {
905
+ cell = grid[y][x];
906
+
907
+ if (cell.real) {
908
+ colSpan = cell.colspan - 1;
909
+ rowSpan = cell.rowspan - 1;
910
+
911
+ if (colSpan) {
912
+ if (x + colSpan > maxX) {
913
+ maxX = x + colSpan;
914
+ }
915
+ }
916
+
917
+ if (rowSpan) {
918
+ if (y + rowSpan > maxY) {
919
+ maxY = y + rowSpan;
920
+ }
921
+ }
922
+ }
923
+ }
924
+ }
925
+
926
+ // Remove current selection
927
+ dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected');
928
+
929
+ // Add new selection
930
+ for (y = startY; y <= maxY; y++) {
931
+ for (x = startX; x <= maxX; x++) {
932
+ if (grid[y][x]) {
933
+ dom.addClass(grid[y][x].elm, 'mce-item-selected');
934
+ }
935
+ }
936
+ }
937
+ }
938
+ }
939
+
940
+ function moveRelIdx(cellElm, delta) {
941
+ var pos, index, cell;
942
+
943
+ pos = getPos(cellElm);
944
+ index = pos.y * gridWidth + pos.x;
945
+
946
+ do {
947
+ index += delta;
948
+ cell = getCell(index % gridWidth, Math.floor(index / gridWidth));
949
+
950
+ if (!cell) {
951
+ break;
952
+ }
953
+
954
+ if (cell.elm != cellElm) {
955
+ selection.select(cell.elm, true);
956
+
957
+ if (dom.isEmpty(cell.elm)) {
958
+ selection.collapse(true);
959
+ }
960
+
961
+ return true;
962
+ }
963
+ } while (cell.elm == cellElm);
964
+
965
+ return false;
966
+ }
967
+
968
+ table = table || dom.getParent(selection.getStart(true), 'table');
969
+
970
+ buildGrid();
971
+
972
+ selectedCell = dom.getParent(selection.getStart(true), 'th,td');
973
+
974
+ if (selectedCell) {
975
+ startPos = getPos(selectedCell);
976
+ endPos = findEndPos();
977
+ selectedCell = getCell(startPos.x, startPos.y);
978
+ }
979
+
980
+ Tools.extend(this, {
981
+ deleteTable: deleteTable,
982
+ split: split,
983
+ merge: merge,
984
+ insertRow: insertRow,
985
+ insertCol: insertCol,
986
+ deleteCols: deleteCols,
987
+ deleteRows: deleteRows,
988
+ cutRows: cutRows,
989
+ copyRows: copyRows,
990
+ pasteRows: pasteRows,
991
+ getPos: getPos,
992
+ setStartCell: setStartCell,
993
+ setEndCell: setEndCell,
994
+ moveRelIdx: moveRelIdx,
995
+ refresh: buildGrid
996
+ });
997
+ };
998
+ });
999
+
1000
+ // Included from: js/tinymce/plugins/table/classes/Quirks.js
1001
+
1002
+ /**
1003
+ * Quirks.js
1004
+ *
1005
+ * Released under LGPL License.
1006
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
1007
+ *
1008
+ * License: http://www.tinymce.com/license
1009
+ * Contributing: http://www.tinymce.com/contributing
1010
+ */
1011
+
1012
+ /**
1013
+ * This class includes fixes for various browser quirks.
1014
+ *
1015
+ * @class tinymce.tableplugin.Quirks
1016
+ * @private
1017
+ */
1018
+ define("tinymce/tableplugin/Quirks", [
1019
+ "tinymce/util/VK",
1020
+ "tinymce/Env",
1021
+ "tinymce/util/Tools",
1022
+ "tinymce/tableplugin/Utils"
1023
+ ], function(VK, Env, Tools, Utils) {
1024
+ var each = Tools.each, getSpanVal = Utils.getSpanVal;
1025
+
1026
+ return function(editor) {
1027
+ /**
1028
+ * Fixed caret movement around tables on WebKit.
1029
+ */
1030
+ function moveWebKitSelection() {
1031
+ function eventHandler(e) {
1032
+ var key = e.keyCode;
1033
+
1034
+ function handle(upBool, sourceNode) {
1035
+ var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
1036
+ var currentRow = editor.dom.getParent(sourceNode, 'tr');
1037
+ var siblingRow = currentRow[siblingDirection];
1038
+
1039
+ if (siblingRow) {
1040
+ moveCursorToRow(editor, sourceNode, siblingRow, upBool);
1041
+ e.preventDefault();
1042
+ return true;
1043
+ }
1044
+
1045
+ var tableNode = editor.dom.getParent(currentRow, 'table');
1046
+ var middleNode = currentRow.parentNode;
1047
+ var parentNodeName = middleNode.nodeName.toLowerCase();
1048
+ if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
1049
+ var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
1050
+ if (targetParent !== null) {
1051
+ return moveToRowInTarget(upBool, targetParent, sourceNode);
1052
+ }
1053
+ }
1054
+
1055
+ return escapeTable(upBool, currentRow, siblingDirection, tableNode);
1056
+ }
1057
+
1058
+ function getTargetParent(upBool, topNode, secondNode, nodeName) {
1059
+ var tbodies = editor.dom.select('>' + nodeName, topNode);
1060
+ var position = tbodies.indexOf(secondNode);
1061
+ if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
1062
+ return getFirstHeadOrFoot(upBool, topNode);
1063
+ } else if (position === -1) {
1064
+ var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
1065
+ return tbodies[topOrBottom];
1066
+ }
1067
+
1068
+ return tbodies[position + (upBool ? -1 : 1)];
1069
+ }
1070
+
1071
+ function getFirstHeadOrFoot(upBool, parent) {
1072
+ var tagName = upBool ? 'thead' : 'tfoot';
1073
+ var headOrFoot = editor.dom.select('>' + tagName, parent);
1074
+ return headOrFoot.length !== 0 ? headOrFoot[0] : null;
1075
+ }
1076
+
1077
+ function moveToRowInTarget(upBool, targetParent, sourceNode) {
1078
+ var targetRow = getChildForDirection(targetParent, upBool);
1079
+
1080
+ if (targetRow) {
1081
+ moveCursorToRow(editor, sourceNode, targetRow, upBool);
1082
+ }
1083
+
1084
+ e.preventDefault();
1085
+ return true;
1086
+ }
1087
+
1088
+ function escapeTable(upBool, currentRow, siblingDirection, table) {
1089
+ var tableSibling = table[siblingDirection];
1090
+
1091
+ if (tableSibling) {
1092
+ moveCursorToStartOfElement(tableSibling);
1093
+ return true;
1094
+ }
1095
+
1096
+ var parentCell = editor.dom.getParent(table, 'td,th');
1097
+ if (parentCell) {
1098
+ return handle(upBool, parentCell, e);
1099
+ }
1100
+
1101
+ var backUpSibling = getChildForDirection(currentRow, !upBool);
1102
+ moveCursorToStartOfElement(backUpSibling);
1103
+ e.preventDefault();
1104
+ return false;
1105
+ }
1106
+
1107
+ function getChildForDirection(parent, up) {
1108
+ var child = parent && parent[up ? 'lastChild' : 'firstChild'];
1109
+ // BR is not a valid table child to return in this case we return the table cell
1110
+ return child && child.nodeName === 'BR' ? editor.dom.getParent(child, 'td,th') : child;
1111
+ }
1112
+
1113
+ function moveCursorToStartOfElement(n) {
1114
+ editor.selection.setCursorLocation(n, 0);
1115
+ }
1116
+
1117
+ function isVerticalMovement() {
1118
+ return key == VK.UP || key == VK.DOWN;
1119
+ }
1120
+
1121
+ function isInTable(editor) {
1122
+ var node = editor.selection.getNode();
1123
+ var currentRow = editor.dom.getParent(node, 'tr');
1124
+ return currentRow !== null;
1125
+ }
1126
+
1127
+ function columnIndex(column) {
1128
+ var colIndex = 0;
1129
+ var c = column;
1130
+ while (c.previousSibling) {
1131
+ c = c.previousSibling;
1132
+ colIndex = colIndex + getSpanVal(c, "colspan");
1133
+ }
1134
+ return colIndex;
1135
+ }
1136
+
1137
+ function findColumn(rowElement, columnIndex) {
1138
+ var c = 0, r = 0;
1139
+
1140
+ each(rowElement.children, function(cell, i) {
1141
+ c = c + getSpanVal(cell, "colspan");
1142
+ r = i;
1143
+ if (c > columnIndex) {
1144
+ return false;
1145
+ }
1146
+ });
1147
+ return r;
1148
+ }
1149
+
1150
+ function moveCursorToRow(ed, node, row, upBool) {
1151
+ var srcColumnIndex = columnIndex(editor.dom.getParent(node, 'td,th'));
1152
+ var tgtColumnIndex = findColumn(row, srcColumnIndex);
1153
+ var tgtNode = row.childNodes[tgtColumnIndex];
1154
+ var rowCellTarget = getChildForDirection(tgtNode, upBool);
1155
+ moveCursorToStartOfElement(rowCellTarget || tgtNode);
1156
+ }
1157
+
1158
+ function shouldFixCaret(preBrowserNode) {
1159
+ var newNode = editor.selection.getNode();
1160
+ var newParent = editor.dom.getParent(newNode, 'td,th');
1161
+ var oldParent = editor.dom.getParent(preBrowserNode, 'td,th');
1162
+
1163
+ return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent);
1164
+ }
1165
+
1166
+ function checkSameParentTable(nodeOne, NodeTwo) {
1167
+ return editor.dom.getParent(nodeOne, 'TABLE') === editor.dom.getParent(NodeTwo, 'TABLE');
1168
+ }
1169
+
1170
+ if (isVerticalMovement() && isInTable(editor)) {
1171
+ var preBrowserNode = editor.selection.getNode();
1172
+ setTimeout(function() {
1173
+ if (shouldFixCaret(preBrowserNode)) {
1174
+ handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
1175
+ }
1176
+ }, 0);
1177
+ }
1178
+ }
1179
+
1180
+ editor.on('KeyDown', function(e) {
1181
+ eventHandler(e);
1182
+ });
1183
+ }
1184
+
1185
+ function fixBeforeTableCaretBug() {
1186
+ // Checks if the selection/caret is at the start of the specified block element
1187
+ function isAtStart(rng, par) {
1188
+ var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
1189
+
1190
+ rng2.setStartBefore(par);
1191
+ rng2.setEnd(rng.endContainer, rng.endOffset);
1192
+
1193
+ elm = doc.createElement('body');
1194
+ elm.appendChild(rng2.cloneContents());
1195
+
1196
+ // Check for text characters of other elements that should be treated as content
1197
+ return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length === 0;
1198
+ }
1199
+
1200
+ // Fixes an bug where it's impossible to place the caret before a table in Gecko
1201
+ // this fix solves it by detecting when the caret is at the beginning of such a table
1202
+ // and then manually moves the caret infront of the table
1203
+ editor.on('KeyDown', function(e) {
1204
+ var rng, table, dom = editor.dom;
1205
+
1206
+ // On gecko it's not possible to place the caret before a table
1207
+ if (e.keyCode == 37 || e.keyCode == 38) {
1208
+ rng = editor.selection.getRng();
1209
+ table = dom.getParent(rng.startContainer, 'table');
1210
+
1211
+ if (table && editor.getBody().firstChild == table) {
1212
+ if (isAtStart(rng, table)) {
1213
+ rng = dom.createRng();
1214
+
1215
+ rng.setStartBefore(table);
1216
+ rng.setEndBefore(table);
1217
+
1218
+ editor.selection.setRng(rng);
1219
+
1220
+ e.preventDefault();
1221
+ }
1222
+ }
1223
+ }
1224
+ });
1225
+ }
1226
+
1227
+ // Fixes an issue on Gecko where it's impossible to place the caret behind a table
1228
+ // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
1229
+ function fixTableCaretPos() {
1230
+ editor.on('KeyDown SetContent VisualAid', function() {
1231
+ var last;
1232
+
1233
+ // Skip empty text nodes from the end
1234
+ for (last = editor.getBody().lastChild; last; last = last.previousSibling) {
1235
+ if (last.nodeType == 3) {
1236
+ if (last.nodeValue.length > 0) {
1237
+ break;
1238
+ }
1239
+ } else if (last.nodeType == 1 && (last.tagName == 'BR' || !last.getAttribute('data-mce-bogus'))) {
1240
+ break;
1241
+ }
1242
+ }
1243
+
1244
+ if (last && last.nodeName == 'TABLE') {
1245
+ if (editor.settings.forced_root_block) {
1246
+ editor.dom.add(
1247
+ editor.getBody(),
1248
+ editor.settings.forced_root_block,
1249
+ editor.settings.forced_root_block_attrs,
1250
+ Env.ie && Env.ie < 11 ? '&nbsp;' : '<br data-mce-bogus="1" />'
1251
+ );
1252
+ } else {
1253
+ editor.dom.add(editor.getBody(), 'br', {'data-mce-bogus': '1'});
1254
+ }
1255
+ }
1256
+ });
1257
+
1258
+ editor.on('PreProcess', function(o) {
1259
+ var last = o.node.lastChild;
1260
+
1261
+ if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 &&
1262
+ (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) &&
1263
+ last.previousSibling && last.previousSibling.nodeName == "TABLE") {
1264
+ editor.dom.remove(last);
1265
+ }
1266
+ });
1267
+ }
1268
+
1269
+ // this nasty hack is here to work around some WebKit selection bugs.
1270
+ function fixTableCellSelection() {
1271
+ function tableCellSelected(ed, rng, n, currentCell) {
1272
+ // The decision of when a table cell is selected is somewhat involved. The fact that this code is
1273
+ // required is actually a pointer to the root cause of this bug. A cell is selected when the start
1274
+ // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
1275
+ // or the parent of the table (in the case of the selection containing the last cell of a table).
1276
+ var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE');
1277
+ var tableParent, allOfCellSelected, tableCellSelection;
1278
+
1279
+ if (table) {
1280
+ tableParent = table.parentNode;
1281
+ }
1282
+
1283
+ allOfCellSelected = rng.startContainer.nodeType == TEXT_NODE &&
1284
+ rng.startOffset === 0 &&
1285
+ rng.endOffset === 0 &&
1286
+ currentCell &&
1287
+ (n.nodeName == "TR" || n == tableParent);
1288
+
1289
+ tableCellSelection = (n.nodeName == "TD" || n.nodeName == "TH") && !currentCell;
1290
+
1291
+ return allOfCellSelected || tableCellSelection;
1292
+ }
1293
+
1294
+ function fixSelection() {
1295
+ var rng = editor.selection.getRng();
1296
+ var n = editor.selection.getNode();
1297
+ var currentCell = editor.dom.getParent(rng.startContainer, 'TD,TH');
1298
+
1299
+ if (!tableCellSelected(editor, rng, n, currentCell)) {
1300
+ return;
1301
+ }
1302
+
1303
+ if (!currentCell) {
1304
+ currentCell = n;
1305
+ }
1306
+
1307
+ // Get the very last node inside the table cell
1308
+ var end = currentCell.lastChild;
1309
+ while (end.lastChild) {
1310
+ end = end.lastChild;
1311
+ }
1312
+
1313
+ // Select the entire table cell. Nothing outside of the table cell should be selected.
1314
+ if (end.nodeType == 3) {
1315
+ rng.setEnd(end, end.data.length);
1316
+ editor.selection.setRng(rng);
1317
+ }
1318
+ }
1319
+
1320
+ editor.on('KeyDown', function() {
1321
+ fixSelection();
1322
+ });
1323
+
1324
+ editor.on('MouseDown', function(e) {
1325
+ if (e.button != 2) {
1326
+ fixSelection();
1327
+ }
1328
+ });
1329
+ }
1330
+
1331
+ /**
1332
+ * Delete table if all cells are selected.
1333
+ */
1334
+ function deleteTable() {
1335
+ function placeCaretInCell(cell) {
1336
+ editor.selection.select(cell, true);
1337
+ editor.selection.collapse(true);
1338
+ }
1339
+
1340
+ function clearCell(cell) {
1341
+ editor.$(cell).empty();
1342
+ Utils.paddCell(cell);
1343
+ }
1344
+
1345
+ editor.on('keydown', function(e) {
1346
+ if ((e.keyCode == VK.DELETE || e.keyCode == VK.BACKSPACE) && !e.isDefaultPrevented()) {
1347
+ var table, tableCells, selectedTableCells, cell;
1348
+
1349
+ table = editor.dom.getParent(editor.selection.getStart(), 'table');
1350
+ if (table) {
1351
+ tableCells = editor.dom.select('td,th', table);
1352
+ selectedTableCells = Tools.grep(tableCells, function(cell) {
1353
+ return editor.dom.hasClass(cell, 'mce-item-selected');
1354
+ });
1355
+
1356
+ if (selectedTableCells.length === 0) {
1357
+ // If caret is within an empty table cell then empty it for real
1358
+ cell = editor.dom.getParent(editor.selection.getStart(), 'td,th');
1359
+ if (editor.selection.isCollapsed() && cell && editor.dom.isEmpty(cell)) {
1360
+ e.preventDefault();
1361
+ clearCell(cell);
1362
+ placeCaretInCell(cell);
1363
+ }
1364
+
1365
+ return;
1366
+ }
1367
+
1368
+ e.preventDefault();
1369
+
1370
+ if (tableCells.length == selectedTableCells.length) {
1371
+ editor.execCommand('mceTableDelete');
1372
+ } else {
1373
+ Tools.each(selectedTableCells, clearCell);
1374
+ placeCaretInCell(selectedTableCells[0]);
1375
+ }
1376
+ }
1377
+ }
1378
+ });
1379
+ }
1380
+
1381
+ deleteTable();
1382
+
1383
+ if (Env.webkit) {
1384
+ moveWebKitSelection();
1385
+ fixTableCellSelection();
1386
+ }
1387
+
1388
+ if (Env.gecko) {
1389
+ fixBeforeTableCaretBug();
1390
+ fixTableCaretPos();
1391
+ }
1392
+
1393
+ if (Env.ie > 10) {
1394
+ fixBeforeTableCaretBug();
1395
+ fixTableCaretPos();
1396
+ }
1397
+ };
1398
+ });
1399
+
1400
+ // Included from: js/tinymce/plugins/table/classes/CellSelection.js
1401
+
1402
+ /**
1403
+ * CellSelection.js
1404
+ *
1405
+ * Released under LGPL License.
1406
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
1407
+ *
1408
+ * License: http://www.tinymce.com/license
1409
+ * Contributing: http://www.tinymce.com/contributing
1410
+ */
1411
+
1412
+ /**
1413
+ * This class handles table cell selection by faking it using a css class that gets applied
1414
+ * to cells when dragging the mouse from one cell to another.
1415
+ *
1416
+ * @class tinymce.tableplugin.CellSelection
1417
+ * @private
1418
+ */
1419
+ define("tinymce/tableplugin/CellSelection", [
1420
+ "tinymce/tableplugin/TableGrid",
1421
+ "tinymce/dom/TreeWalker",
1422
+ "tinymce/util/Tools"
1423
+ ], function(TableGrid, TreeWalker, Tools) {
1424
+ return function(editor) {
1425
+ var dom = editor.dom, tableGrid, startCell, startTable, hasCellSelection = true, resizing;
1426
+
1427
+ function clear(force) {
1428
+ // Restore selection possibilities
1429
+ editor.getBody().style.webkitUserSelect = '';
1430
+
1431
+ if (force || hasCellSelection) {
1432
+ editor.dom.removeClass(
1433
+ editor.dom.select('td.mce-item-selected,th.mce-item-selected'),
1434
+ 'mce-item-selected'
1435
+ );
1436
+
1437
+ hasCellSelection = false;
1438
+ }
1439
+ }
1440
+
1441
+ function cellSelectionHandler(e) {
1442
+ var sel, table, target = e.target;
1443
+
1444
+ if (resizing) {
1445
+ return;
1446
+ }
1447
+
1448
+ if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
1449
+ table = dom.getParent(target, 'table');
1450
+ if (table == startTable) {
1451
+ if (!tableGrid) {
1452
+ tableGrid = new TableGrid(editor, table);
1453
+ tableGrid.setStartCell(startCell);
1454
+
1455
+ editor.getBody().style.webkitUserSelect = 'none';
1456
+ }
1457
+
1458
+ tableGrid.setEndCell(target);
1459
+ hasCellSelection = true;
1460
+ }
1461
+
1462
+ // Remove current selection
1463
+ sel = editor.selection.getSel();
1464
+
1465
+ try {
1466
+ if (sel.removeAllRanges) {
1467
+ sel.removeAllRanges();
1468
+ } else {
1469
+ sel.empty();
1470
+ }
1471
+ } catch (ex) {
1472
+ // IE9 might throw errors here
1473
+ }
1474
+
1475
+ e.preventDefault();
1476
+ }
1477
+ }
1478
+
1479
+ // Add cell selection logic
1480
+ editor.on('MouseDown', function(e) {
1481
+ if (e.button != 2 && !resizing) {
1482
+ clear();
1483
+
1484
+ startCell = dom.getParent(e.target, 'td,th');
1485
+ startTable = dom.getParent(startCell, 'table');
1486
+ }
1487
+ });
1488
+
1489
+ editor.on('mouseover', cellSelectionHandler);
1490
+
1491
+ editor.on('remove', function() {
1492
+ dom.unbind(editor.getDoc(), 'mouseover', cellSelectionHandler);
1493
+ });
1494
+
1495
+ editor.on('MouseUp', function() {
1496
+ var rng, sel = editor.selection, selectedCells, walker, node, lastNode;
1497
+
1498
+ function setPoint(node, start) {
1499
+ var walker = new TreeWalker(node, node);
1500
+
1501
+ do {
1502
+ // Text node
1503
+ if (node.nodeType == 3 && Tools.trim(node.nodeValue).length !== 0) {
1504
+ if (start) {
1505
+ rng.setStart(node, 0);
1506
+ } else {
1507
+ rng.setEnd(node, node.nodeValue.length);
1508
+ }
1509
+
1510
+ return;
1511
+ }
1512
+
1513
+ // BR element
1514
+ if (node.nodeName == 'BR') {
1515
+ if (start) {
1516
+ rng.setStartBefore(node);
1517
+ } else {
1518
+ rng.setEndBefore(node);
1519
+ }
1520
+
1521
+ return;
1522
+ }
1523
+ } while ((node = (start ? walker.next() : walker.prev())));
1524
+ }
1525
+
1526
+ // Move selection to startCell
1527
+ if (startCell) {
1528
+ if (tableGrid) {
1529
+ editor.getBody().style.webkitUserSelect = '';
1530
+ }
1531
+
1532
+ // Try to expand text selection as much as we can only Gecko supports cell selection
1533
+ selectedCells = dom.select('td.mce-item-selected,th.mce-item-selected');
1534
+ if (selectedCells.length > 0) {
1535
+ rng = dom.createRng();
1536
+ node = selectedCells[0];
1537
+ rng.setStartBefore(node);
1538
+ rng.setEndAfter(node);
1539
+
1540
+ setPoint(node, 1);
1541
+ walker = new TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
1542
+
1543
+ do {
1544
+ if (node.nodeName == 'TD' || node.nodeName == 'TH') {
1545
+ if (!dom.hasClass(node, 'mce-item-selected')) {
1546
+ break;
1547
+ }
1548
+
1549
+ lastNode = node;
1550
+ }
1551
+ } while ((node = walker.next()));
1552
+
1553
+ setPoint(lastNode);
1554
+
1555
+ sel.setRng(rng);
1556
+ }
1557
+
1558
+ editor.nodeChanged();
1559
+ startCell = tableGrid = startTable = null;
1560
+ }
1561
+ });
1562
+
1563
+ editor.on('KeyUp Drop SetContent', function(e) {
1564
+ clear(e.type == 'setcontent');
1565
+ startCell = tableGrid = startTable = null;
1566
+ resizing = false;
1567
+ });
1568
+
1569
+ editor.on('ObjectResizeStart ObjectResized', function(e) {
1570
+ resizing = e.type != 'objectresized';
1571
+ });
1572
+
1573
+ return {
1574
+ clear: clear
1575
+ };
1576
+ };
1577
+ });
1578
+
1579
+ // Included from: js/tinymce/plugins/table/classes/Dialogs.js
1580
+
1581
+ /**
1582
+ * Dialogs.js
1583
+ *
1584
+ * Released under LGPL License.
1585
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
1586
+ *
1587
+ * License: http://www.tinymce.com/license
1588
+ * Contributing: http://www.tinymce.com/contributing
1589
+ */
1590
+
1591
+ /*eslint dot-notation:0*/
1592
+
1593
+ /**
1594
+ * ...
1595
+ *
1596
+ * @class tinymce.tableplugin.Dialogs
1597
+ * @private
1598
+ */
1599
+ define("tinymce/tableplugin/Dialogs", [
1600
+ "tinymce/util/Tools",
1601
+ "tinymce/Env"
1602
+ ], function(Tools, Env) {
1603
+ var each = Tools.each;
1604
+
1605
+ return function(editor) {
1606
+ var self = this;
1607
+
1608
+ function createColorPickAction() {
1609
+ var colorPickerCallback = editor.settings.color_picker_callback;
1610
+
1611
+ if (colorPickerCallback) {
1612
+ return function() {
1613
+ var self = this;
1614
+
1615
+ colorPickerCallback.call(
1616
+ editor,
1617
+ function(value) {
1618
+ self.value(value).fire('change');
1619
+ },
1620
+ self.value()
1621
+ );
1622
+ };
1623
+ }
1624
+ }
1625
+
1626
+ function createStyleForm(dom) {
1627
+ return {
1628
+ title: 'Advanced',
1629
+ type: 'form',
1630
+ defaults: {
1631
+ onchange: function() {
1632
+ updateStyle(dom, this.parents().reverse()[0], this.name() == "style");
1633
+ }
1634
+ },
1635
+ items: [
1636
+ {
1637
+ label: 'Style',
1638
+ name: 'style',
1639
+ type: 'textbox'
1640
+ },
1641
+
1642
+ {
1643
+ type: 'form',
1644
+ padding: 0,
1645
+ formItemDefaults: {
1646
+ layout: 'grid',
1647
+ alignH: ['start', 'right']
1648
+ },
1649
+ defaults: {
1650
+ size: 7
1651
+ },
1652
+ items: [
1653
+ {
1654
+ label: 'Border color',
1655
+ type: 'colorbox',
1656
+ name: 'borderColor',
1657
+ onaction: createColorPickAction()
1658
+ },
1659
+
1660
+ {
1661
+ label: 'Background color',
1662
+ type: 'colorbox',
1663
+ name: 'backgroundColor',
1664
+ onaction: createColorPickAction()
1665
+ }
1666
+ ]
1667
+ }
1668
+ ]
1669
+ };
1670
+ }
1671
+
1672
+ function removePxSuffix(size) {
1673
+ return size ? size.replace(/px$/, '') : "";
1674
+ }
1675
+
1676
+ function addSizeSuffix(size) {
1677
+ if (/^[0-9]+$/.test(size)) {
1678
+ size += "px";
1679
+ }
1680
+
1681
+ return size;
1682
+ }
1683
+
1684
+ function unApplyAlign(elm) {
1685
+ each('left center right'.split(' '), function(name) {
1686
+ editor.formatter.remove('align' + name, {}, elm);
1687
+ });
1688
+ }
1689
+
1690
+ function unApplyVAlign(elm) {
1691
+ each('top middle bottom'.split(' '), function(name) {
1692
+ editor.formatter.remove('valign' + name, {}, elm);
1693
+ });
1694
+ }
1695
+
1696
+ function buildListItems(inputList, itemCallback, startItems) {
1697
+ function appendItems(values, output) {
1698
+ output = output || [];
1699
+
1700
+ Tools.each(values, function(item) {
1701
+ var menuItem = {text: item.text || item.title};
1702
+
1703
+ if (item.menu) {
1704
+ menuItem.menu = appendItems(item.menu);
1705
+ } else {
1706
+ menuItem.value = item.value;
1707
+
1708
+ if (itemCallback) {
1709
+ itemCallback(menuItem);
1710
+ }
1711
+ }
1712
+
1713
+ output.push(menuItem);
1714
+ });
1715
+
1716
+ return output;
1717
+ }
1718
+
1719
+ return appendItems(inputList, startItems || []);
1720
+ }
1721
+
1722
+ function updateStyle(dom, win, isStyleCtrl) {
1723
+ var data = win.toJSON();
1724
+ var css = dom.parseStyle(data.style);
1725
+
1726
+ if (isStyleCtrl) {
1727
+ win.find('#borderColor').value(css["border-color"] || '')[0].fire('change');
1728
+ win.find('#backgroundColor').value(css["background-color"] || '')[0].fire('change');
1729
+ } else {
1730
+ css["border-color"] = data.borderColor;
1731
+ css["background-color"] = data.backgroundColor;
1732
+ }
1733
+
1734
+ win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
1735
+ }
1736
+
1737
+ function appendStylesToData(dom, data, elm) {
1738
+ var css = dom.parseStyle(dom.getAttrib(elm, 'style'));
1739
+
1740
+ if (css["border-color"]) {
1741
+ data.borderColor = css["border-color"];
1742
+ }
1743
+
1744
+ if (css["background-color"]) {
1745
+ data.backgroundColor = css["background-color"];
1746
+ }
1747
+
1748
+ data.style = dom.serializeStyle(css);
1749
+ }
1750
+
1751
+ function mergeStyles(dom, elm, styles) {
1752
+ var css = dom.parseStyle(dom.getAttrib(elm, 'style'));
1753
+
1754
+ each(styles, function(style) {
1755
+ css[style.name] = style.value;
1756
+ });
1757
+
1758
+ dom.setAttrib(elm, 'style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
1759
+ }
1760
+
1761
+ self.tableProps = function() {
1762
+ self.table(true);
1763
+ };
1764
+
1765
+ self.table = function(isProps) {
1766
+ var dom = editor.dom, tableElm, colsCtrl, rowsCtrl, classListCtrl, data = {}, generalTableForm, stylesToMerge;
1767
+
1768
+ function onSubmitTableForm() {
1769
+
1770
+ //Explore the layers of the table till we find the first layer of tds or ths
1771
+ function styleTDTH(elm, name, value) {
1772
+ if (elm.tagName === "TD" || elm.tagName === "TH") {
1773
+ dom.setStyle(elm, name, value);
1774
+ } else {
1775
+ if (elm.children) {
1776
+ for (var i = 0; i < elm.children.length; i++) {
1777
+ styleTDTH(elm.children[i], name, value);
1778
+ }
1779
+ }
1780
+ }
1781
+ }
1782
+
1783
+ var captionElm;
1784
+
1785
+ updateStyle(dom, this);
1786
+ data = Tools.extend(data, this.toJSON());
1787
+
1788
+ if (data["class"] === false) {
1789
+ delete data["class"];
1790
+ }
1791
+
1792
+ editor.undoManager.transact(function() {
1793
+ if (!tableElm) {
1794
+ tableElm = editor.plugins.table.insertTable(data.cols || 1, data.rows || 1);
1795
+ }
1796
+
1797
+ editor.dom.setAttribs(tableElm, {
1798
+ style: data.style,
1799
+ 'class': data['class']
1800
+ });
1801
+
1802
+ if (editor.settings.table_style_by_css) {
1803
+ stylesToMerge = [];
1804
+ stylesToMerge.push({name: 'border', value: data.border});
1805
+ stylesToMerge.push({name: 'border-spacing', value: addSizeSuffix(data.cellspacing)});
1806
+ mergeStyles(dom, tableElm, stylesToMerge);
1807
+ dom.setAttribs(tableElm, {
1808
+ 'data-mce-border-color': data.borderColor,
1809
+ 'data-mce-cell-padding': data.cellpadding,
1810
+ 'data-mce-border': data.border
1811
+ });
1812
+ if (tableElm.children) {
1813
+ for (var i = 0; i < tableElm.children.length; i++) {
1814
+ styleTDTH(tableElm.children[i], 'border', data.border);
1815
+ styleTDTH(tableElm.children[i], 'padding', addSizeSuffix(data.cellpadding));
1816
+ }
1817
+ }
1818
+ } else {
1819
+ editor.dom.setAttribs(tableElm, {
1820
+ border: data.border,
1821
+ cellpadding: data.cellpadding,
1822
+ cellspacing: data.cellspacing
1823
+ });
1824
+ }
1825
+
1826
+ if (dom.getAttrib(tableElm, 'width') && !editor.settings.table_style_by_css) {
1827
+ dom.setAttrib(tableElm, 'width', removePxSuffix(data.width));
1828
+ } else {
1829
+ dom.setStyle(tableElm, 'width', addSizeSuffix(data.width));
1830
+ }
1831
+
1832
+ dom.setStyle(tableElm, 'height', addSizeSuffix(data.height));
1833
+
1834
+ // Toggle caption on/off
1835
+ captionElm = dom.select('caption', tableElm)[0];
1836
+
1837
+ if (captionElm && !data.caption) {
1838
+ dom.remove(captionElm);
1839
+ }
1840
+
1841
+ if (!captionElm && data.caption) {
1842
+ captionElm = dom.create('caption');
1843
+ captionElm.innerHTML = !Env.ie ? '<br data-mce-bogus="1"/>' : '\u00a0';
1844
+ tableElm.insertBefore(captionElm, tableElm.firstChild);
1845
+ }
1846
+ unApplyAlign(tableElm);
1847
+ if (data.align) {
1848
+ editor.formatter.apply('align' + data.align, {}, tableElm);
1849
+ }
1850
+
1851
+ editor.focus();
1852
+ editor.addVisual();
1853
+ });
1854
+ }
1855
+
1856
+ function getTDTHOverallStyle(elm, name) {
1857
+ var cells = editor.dom.select("td,th", elm), firstChildStyle;
1858
+
1859
+ function checkChildren(firstChildStyle, elms) {
1860
+
1861
+ for (var i = 0; i < elms.length; i++) {
1862
+ var currentStyle = dom.getStyle(elms[i], name);
1863
+ if (typeof firstChildStyle === "undefined") {
1864
+ firstChildStyle = currentStyle;
1865
+ }
1866
+ if (firstChildStyle != currentStyle) {
1867
+ return "";
1868
+ }
1869
+ }
1870
+
1871
+ return firstChildStyle;
1872
+
1873
+ }
1874
+
1875
+ firstChildStyle = checkChildren(firstChildStyle, cells);
1876
+
1877
+ return firstChildStyle;
1878
+ }
1879
+
1880
+ if (isProps === true) {
1881
+ tableElm = dom.getParent(editor.selection.getStart(), 'table');
1882
+
1883
+ if (tableElm) {
1884
+ data = {
1885
+ width: removePxSuffix(dom.getStyle(tableElm, 'width') || dom.getAttrib(tableElm, 'width')),
1886
+ height: removePxSuffix(dom.getStyle(tableElm, 'height') || dom.getAttrib(tableElm, 'height')),
1887
+ cellspacing: removePxSuffix(dom.getStyle(tableElm, 'border-spacing') ||
1888
+ dom.getAttrib(tableElm, 'cellspacing')),
1889
+ cellpadding: dom.getAttrib(tableElm, 'data-mce-cell-padding') || dom.getAttrib(tableElm, 'cellpadding') ||
1890
+ getTDTHOverallStyle(tableElm, 'padding'),
1891
+ border: dom.getAttrib(tableElm, 'data-mce-border') || dom.getAttrib(tableElm, 'border') ||
1892
+ getTDTHOverallStyle(tableElm, 'border'),
1893
+ borderColor: dom.getAttrib(tableElm, 'data-mce-border-color'),
1894
+ caption: !!dom.select('caption', tableElm)[0],
1895
+ 'class': dom.getAttrib(tableElm, 'class')
1896
+ };
1897
+
1898
+ each('left center right'.split(' '), function(name) {
1899
+ if (editor.formatter.matchNode(tableElm, 'align' + name)) {
1900
+ data.align = name;
1901
+ }
1902
+ });
1903
+ }
1904
+ } else {
1905
+ colsCtrl = {label: 'Cols', name: 'cols'};
1906
+ rowsCtrl = {label: 'Rows', name: 'rows'};
1907
+ }
1908
+
1909
+ if (editor.settings.table_class_list) {
1910
+ if (data["class"]) {
1911
+ data["class"] = data["class"].replace(/\s*mce\-item\-table\s*/g, '');
1912
+ }
1913
+
1914
+ classListCtrl = {
1915
+ name: 'class',
1916
+ type: 'listbox',
1917
+ label: 'Class',
1918
+ values: buildListItems(
1919
+ editor.settings.table_class_list,
1920
+ function(item) {
1921
+ if (item.value) {
1922
+ item.textStyle = function() {
1923
+ return editor.formatter.getCssText({block: 'table', classes: [item.value]});
1924
+ };
1925
+ }
1926
+ }
1927
+ )
1928
+ };
1929
+ }
1930
+
1931
+ generalTableForm = {
1932
+ type: 'form',
1933
+ layout: 'flex',
1934
+ direction: 'column',
1935
+ labelGapCalc: 'children',
1936
+ padding: 0,
1937
+ items: [
1938
+ {
1939
+ type: 'form',
1940
+ labelGapCalc: false,
1941
+ padding: 0,
1942
+ layout: 'grid',
1943
+ columns: 2,
1944
+ defaults: {
1945
+ type: 'textbox',
1946
+ maxWidth: 50
1947
+ },
1948
+ items: (editor.settings.table_appearance_options !== false) ? [
1949
+ colsCtrl,
1950
+ rowsCtrl,
1951
+ {label: 'Width', name: 'width'},
1952
+ {label: 'Height', name: 'height'},
1953
+ {label: 'Cell spacing', name: 'cellspacing'},
1954
+ {label: 'Cell padding', name: 'cellpadding'},
1955
+ {label: 'Border', name: 'border'},
1956
+ {label: 'Caption', name: 'caption', type: 'checkbox'}
1957
+ ] : [
1958
+ colsCtrl,
1959
+ rowsCtrl,
1960
+ {label: 'Width', name: 'width'},
1961
+ {label: 'Height', name: 'height'}
1962
+ ]
1963
+ },
1964
+
1965
+ {
1966
+ label: 'Alignment',
1967
+ name: 'align',
1968
+ type: 'listbox',
1969
+ text: 'None',
1970
+ values: [
1971
+ {text: 'None', value: ''},
1972
+ {text: 'Left', value: 'left'},
1973
+ {text: 'Center', value: 'center'},
1974
+ {text: 'Right', value: 'right'}
1975
+ ]
1976
+ },
1977
+
1978
+ classListCtrl
1979
+ ]
1980
+ };
1981
+
1982
+ if (editor.settings.table_advtab !== false) {
1983
+ appendStylesToData(dom, data, tableElm);
1984
+
1985
+ editor.windowManager.open({
1986
+ title: "Table properties",
1987
+ data: data,
1988
+ bodyType: 'tabpanel',
1989
+ body: [
1990
+ {
1991
+ title: 'General',
1992
+ type: 'form',
1993
+ items: generalTableForm
1994
+ },
1995
+ createStyleForm(dom)
1996
+ ],
1997
+
1998
+ onsubmit: onSubmitTableForm
1999
+ });
2000
+ } else {
2001
+ editor.windowManager.open({
2002
+ title: "Table properties",
2003
+ data: data,
2004
+ body: generalTableForm,
2005
+ onsubmit: onSubmitTableForm
2006
+ });
2007
+ }
2008
+ };
2009
+
2010
+ self.merge = function(grid, cell) {
2011
+ editor.windowManager.open({
2012
+ title: "Merge cells",
2013
+ body: [
2014
+ {label: 'Cols', name: 'cols', type: 'textbox', value: '1', size: 10},
2015
+ {label: 'Rows', name: 'rows', type: 'textbox', value: '1', size: 10}
2016
+ ],
2017
+ onsubmit: function() {
2018
+ var data = this.toJSON();
2019
+
2020
+ editor.undoManager.transact(function() {
2021
+ grid.merge(cell, data.cols, data.rows);
2022
+ });
2023
+ }
2024
+ });
2025
+ };
2026
+
2027
+ self.cell = function() {
2028
+ var dom = editor.dom, cellElm, data, classListCtrl, cells = [];
2029
+
2030
+ function onSubmitCellForm() {
2031
+ updateStyle(dom, this);
2032
+ data = Tools.extend(data, this.toJSON());
2033
+
2034
+ editor.undoManager.transact(function() {
2035
+ each(cells, function(cellElm) {
2036
+ editor.dom.setAttribs(cellElm, {
2037
+ scope: data.scope,
2038
+ style: data.style,
2039
+ 'class': data['class']
2040
+ });
2041
+
2042
+ editor.dom.setStyles(cellElm, {
2043
+ width: addSizeSuffix(data.width),
2044
+ height: addSizeSuffix(data.height)
2045
+ });
2046
+
2047
+ // Switch cell type
2048
+ if (data.type && cellElm.nodeName.toLowerCase() != data.type) {
2049
+ cellElm = dom.rename(cellElm, data.type);
2050
+ }
2051
+
2052
+ // Apply/remove alignment
2053
+ unApplyAlign(cellElm);
2054
+ if (data.align) {
2055
+ editor.formatter.apply('align' + data.align, {}, cellElm);
2056
+ }
2057
+
2058
+ // Apply/remove vertical alignment
2059
+ unApplyVAlign(cellElm);
2060
+ if (data.valign) {
2061
+ editor.formatter.apply('valign' + data.valign, {}, cellElm);
2062
+ }
2063
+ });
2064
+
2065
+ editor.focus();
2066
+ });
2067
+ }
2068
+
2069
+ // Get selected cells or the current cell
2070
+ cells = editor.dom.select('td.mce-item-selected,th.mce-item-selected');
2071
+ cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th');
2072
+ if (!cells.length && cellElm) {
2073
+ cells.push(cellElm);
2074
+ }
2075
+
2076
+ cellElm = cellElm || cells[0];
2077
+
2078
+ if (!cellElm) {
2079
+ // If this element is null, return now to avoid crashing.
2080
+ return;
2081
+ }
2082
+
2083
+ data = {
2084
+ width: removePxSuffix(dom.getStyle(cellElm, 'width') || dom.getAttrib(cellElm, 'width')),
2085
+ height: removePxSuffix(dom.getStyle(cellElm, 'height') || dom.getAttrib(cellElm, 'height')),
2086
+ scope: dom.getAttrib(cellElm, 'scope'),
2087
+ 'class': dom.getAttrib(cellElm, 'class')
2088
+ };
2089
+
2090
+ data.type = cellElm.nodeName.toLowerCase();
2091
+
2092
+ each('left center right'.split(' '), function(name) {
2093
+ if (editor.formatter.matchNode(cellElm, 'align' + name)) {
2094
+ data.align = name;
2095
+ }
2096
+ });
2097
+
2098
+ each('top middle bottom'.split(' '), function(name) {
2099
+ if (editor.formatter.matchNode(cellElm, 'valign' + name)) {
2100
+ data.valign = name;
2101
+ }
2102
+ });
2103
+
2104
+ if (editor.settings.table_cell_class_list) {
2105
+ classListCtrl = {
2106
+ name: 'class',
2107
+ type: 'listbox',
2108
+ label: 'Class',
2109
+ values: buildListItems(
2110
+ editor.settings.table_cell_class_list,
2111
+ function(item) {
2112
+ if (item.value) {
2113
+ item.textStyle = function() {
2114
+ return editor.formatter.getCssText({block: 'td', classes: [item.value]});
2115
+ };
2116
+ }
2117
+ }
2118
+ )
2119
+ };
2120
+ }
2121
+
2122
+ var generalCellForm = {
2123
+ type: 'form',
2124
+ layout: 'flex',
2125
+ direction: 'column',
2126
+ labelGapCalc: 'children',
2127
+ padding: 0,
2128
+ items: [
2129
+ {
2130
+ type: 'form',
2131
+ layout: 'grid',
2132
+ columns: 2,
2133
+ labelGapCalc: false,
2134
+ padding: 0,
2135
+ defaults: {
2136
+ type: 'textbox',
2137
+ maxWidth: 50
2138
+ },
2139
+ items: [
2140
+ {label: 'Width', name: 'width'},
2141
+ {label: 'Height', name: 'height'},
2142
+ {
2143
+ label: 'Cell type',
2144
+ name: 'type',
2145
+ type: 'listbox',
2146
+ text: 'None',
2147
+ minWidth: 90,
2148
+ maxWidth: null,
2149
+ values: [
2150
+ {text: 'Cell', value: 'td'},
2151
+ {text: 'Header cell', value: 'th'}
2152
+ ]
2153
+ },
2154
+ {
2155
+ label: 'Scope',
2156
+ name: 'scope',
2157
+ type: 'listbox',
2158
+ text: 'None',
2159
+ minWidth: 90,
2160
+ maxWidth: null,
2161
+ values: [
2162
+ {text: 'None', value: ''},
2163
+ {text: 'Row', value: 'row'},
2164
+ {text: 'Column', value: 'col'},
2165
+ {text: 'Row group', value: 'rowgroup'},
2166
+ {text: 'Column group', value: 'colgroup'}
2167
+ ]
2168
+ },
2169
+ {
2170
+ label: 'H Align',
2171
+ name: 'align',
2172
+ type: 'listbox',
2173
+ text: 'None',
2174
+ minWidth: 90,
2175
+ maxWidth: null,
2176
+ values: [
2177
+ {text: 'None', value: ''},
2178
+ {text: 'Left', value: 'left'},
2179
+ {text: 'Center', value: 'center'},
2180
+ {text: 'Right', value: 'right'}
2181
+ ]
2182
+ },
2183
+ {
2184
+ label: 'V Align',
2185
+ name: 'valign',
2186
+ type: 'listbox',
2187
+ text: 'None',
2188
+ minWidth: 90,
2189
+ maxWidth: null,
2190
+ values: [
2191
+ {text: 'None', value: ''},
2192
+ {text: 'Top', value: 'top'},
2193
+ {text: 'Middle', value: 'middle'},
2194
+ {text: 'Bottom', value: 'bottom'}
2195
+ ]
2196
+ }
2197
+ ]
2198
+ },
2199
+
2200
+ classListCtrl
2201
+ ]
2202
+ };
2203
+
2204
+ if (editor.settings.table_cell_advtab !== false) {
2205
+ appendStylesToData(dom, data, cellElm);
2206
+
2207
+ editor.windowManager.open({
2208
+ title: "Cell properties",
2209
+ bodyType: 'tabpanel',
2210
+ data: data,
2211
+ body: [
2212
+ {
2213
+ title: 'General',
2214
+ type: 'form',
2215
+ items: generalCellForm
2216
+ },
2217
+
2218
+ createStyleForm(dom)
2219
+ ],
2220
+
2221
+ onsubmit: onSubmitCellForm
2222
+ });
2223
+ } else {
2224
+ editor.windowManager.open({
2225
+ title: "Cell properties",
2226
+ data: data,
2227
+ body: generalCellForm,
2228
+ onsubmit: onSubmitCellForm
2229
+ });
2230
+ }
2231
+ };
2232
+
2233
+ self.row = function() {
2234
+ var dom = editor.dom, tableElm, cellElm, rowElm, classListCtrl, data, rows = [], generalRowForm;
2235
+
2236
+ function onSubmitRowForm() {
2237
+ var tableElm, oldParentElm, parentElm;
2238
+
2239
+ updateStyle(dom, this);
2240
+ data = Tools.extend(data, this.toJSON());
2241
+
2242
+ editor.undoManager.transact(function() {
2243
+ var toType = data.type;
2244
+
2245
+ each(rows, function(rowElm) {
2246
+ editor.dom.setAttribs(rowElm, {
2247
+ scope: data.scope,
2248
+ style: data.style,
2249
+ 'class': data['class']
2250
+ });
2251
+
2252
+ editor.dom.setStyles(rowElm, {
2253
+ height: addSizeSuffix(data.height)
2254
+ });
2255
+
2256
+ if (toType != rowElm.parentNode.nodeName.toLowerCase()) {
2257
+ tableElm = dom.getParent(rowElm, 'table');
2258
+
2259
+ oldParentElm = rowElm.parentNode;
2260
+ parentElm = dom.select(toType, tableElm)[0];
2261
+ if (!parentElm) {
2262
+ parentElm = dom.create(toType);
2263
+ if (tableElm.firstChild) {
2264
+ tableElm.insertBefore(parentElm, tableElm.firstChild);
2265
+ } else {
2266
+ tableElm.appendChild(parentElm);
2267
+ }
2268
+ }
2269
+
2270
+ parentElm.appendChild(rowElm);
2271
+
2272
+ if (!oldParentElm.hasChildNodes()) {
2273
+ dom.remove(oldParentElm);
2274
+ }
2275
+ }
2276
+
2277
+ // Apply/remove alignment
2278
+ unApplyAlign(rowElm);
2279
+ if (data.align) {
2280
+ editor.formatter.apply('align' + data.align, {}, rowElm);
2281
+ }
2282
+ });
2283
+
2284
+ editor.focus();
2285
+ });
2286
+ }
2287
+
2288
+ tableElm = editor.dom.getParent(editor.selection.getStart(), 'table');
2289
+ cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th');
2290
+
2291
+ each(tableElm.rows, function(row) {
2292
+ each(row.cells, function(cell) {
2293
+ if (dom.hasClass(cell, 'mce-item-selected') || cell == cellElm) {
2294
+ rows.push(row);
2295
+ return false;
2296
+ }
2297
+ });
2298
+ });
2299
+
2300
+ rowElm = rows[0];
2301
+ if (!rowElm) {
2302
+ // If this element is null, return now to avoid crashing.
2303
+ return;
2304
+ }
2305
+
2306
+ data = {
2307
+ height: removePxSuffix(dom.getStyle(rowElm, 'height') || dom.getAttrib(rowElm, 'height')),
2308
+ scope: dom.getAttrib(rowElm, 'scope'),
2309
+ 'class': dom.getAttrib(rowElm, 'class')
2310
+ };
2311
+
2312
+ data.type = rowElm.parentNode.nodeName.toLowerCase();
2313
+
2314
+ each('left center right'.split(' '), function(name) {
2315
+ if (editor.formatter.matchNode(rowElm, 'align' + name)) {
2316
+ data.align = name;
2317
+ }
2318
+ });
2319
+
2320
+ if (editor.settings.table_row_class_list) {
2321
+ classListCtrl = {
2322
+ name: 'class',
2323
+ type: 'listbox',
2324
+ label: 'Class',
2325
+ values: buildListItems(
2326
+ editor.settings.table_row_class_list,
2327
+ function(item) {
2328
+ if (item.value) {
2329
+ item.textStyle = function() {
2330
+ return editor.formatter.getCssText({block: 'tr', classes: [item.value]});
2331
+ };
2332
+ }
2333
+ }
2334
+ )
2335
+ };
2336
+ }
2337
+
2338
+ generalRowForm = {
2339
+ type: 'form',
2340
+ columns: 2,
2341
+ padding: 0,
2342
+ defaults: {
2343
+ type: 'textbox'
2344
+ },
2345
+ items: [
2346
+ {
2347
+ type: 'listbox',
2348
+ name: 'type',
2349
+ label: 'Row type',
2350
+ text: 'None',
2351
+ maxWidth: null,
2352
+ values: [
2353
+ {text: 'Header', value: 'thead'},
2354
+ {text: 'Body', value: 'tbody'},
2355
+ {text: 'Footer', value: 'tfoot'}
2356
+ ]
2357
+ },
2358
+ {
2359
+ type: 'listbox',
2360
+ name: 'align',
2361
+ label: 'Alignment',
2362
+ text: 'None',
2363
+ maxWidth: null,
2364
+ values: [
2365
+ {text: 'None', value: ''},
2366
+ {text: 'Left', value: 'left'},
2367
+ {text: 'Center', value: 'center'},
2368
+ {text: 'Right', value: 'right'}
2369
+ ]
2370
+ },
2371
+ {label: 'Height', name: 'height'},
2372
+ classListCtrl
2373
+ ]
2374
+ };
2375
+
2376
+ if (editor.settings.table_row_advtab !== false) {
2377
+ appendStylesToData(dom, data, rowElm);
2378
+
2379
+ editor.windowManager.open({
2380
+ title: "Row properties",
2381
+ data: data,
2382
+ bodyType: 'tabpanel',
2383
+ body: [
2384
+ {
2385
+ title: 'General',
2386
+ type: 'form',
2387
+ items: generalRowForm
2388
+ },
2389
+ createStyleForm(dom)
2390
+ ],
2391
+
2392
+ onsubmit: onSubmitRowForm
2393
+ });
2394
+ } else {
2395
+ editor.windowManager.open({
2396
+ title: "Row properties",
2397
+ data: data,
2398
+ body: generalRowForm,
2399
+ onsubmit: onSubmitRowForm
2400
+ });
2401
+ }
2402
+ };
2403
+ };
2404
+ });
2405
+
2406
+ // Included from: js/tinymce/plugins/table/classes/Plugin.js
2407
+
2408
+ /**
2409
+ * Plugin.js
2410
+ *
2411
+ * Released under LGPL License.
2412
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
2413
+ *
2414
+ * License: http://www.tinymce.com/license
2415
+ * Contributing: http://www.tinymce.com/contributing
2416
+ */
2417
+
2418
+ /**
2419
+ * This class contains all core logic for the table plugin.
2420
+ *
2421
+ * @class tinymce.tableplugin.Plugin
2422
+ * @private
2423
+ */
2424
+ define("tinymce/tableplugin/Plugin", [
2425
+ "tinymce/tableplugin/TableGrid",
2426
+ "tinymce/tableplugin/Quirks",
2427
+ "tinymce/tableplugin/CellSelection",
2428
+ "tinymce/tableplugin/Dialogs",
2429
+ "tinymce/util/Tools",
2430
+ "tinymce/dom/TreeWalker",
2431
+ "tinymce/Env",
2432
+ "tinymce/PluginManager"
2433
+ ], function(TableGrid, Quirks, CellSelection, Dialogs, Tools, TreeWalker, Env, PluginManager) {
2434
+ var each = Tools.each;
2435
+
2436
+ function Plugin(editor) {
2437
+ var clipboardRows, self = this, dialogs = new Dialogs(editor);
2438
+
2439
+ function cmd(command) {
2440
+ return function() {
2441
+ editor.execCommand(command);
2442
+ };
2443
+ }
2444
+
2445
+ function insertTable(cols, rows) {
2446
+ var y, x, html, tableElm;
2447
+
2448
+ html = '<table id="__mce"><tbody>';
2449
+
2450
+ for (y = 0; y < rows; y++) {
2451
+ html += '<tr>';
2452
+
2453
+ for (x = 0; x < cols; x++) {
2454
+ html += '<td>' + (Env.ie ? " " : '<br>') + '</td>';
2455
+ }
2456
+
2457
+ html += '</tr>';
2458
+ }
2459
+
2460
+ html += '</tbody></table>';
2461
+
2462
+ editor.undoManager.transact(function() {
2463
+ editor.insertContent(html);
2464
+
2465
+ tableElm = editor.dom.get('__mce');
2466
+ editor.dom.setAttrib(tableElm, 'id', null);
2467
+
2468
+ editor.dom.setAttribs(tableElm, editor.settings.table_default_attributes || {});
2469
+ editor.dom.setStyles(tableElm, editor.settings.table_default_styles || {});
2470
+ });
2471
+
2472
+ return tableElm;
2473
+ }
2474
+
2475
+ function handleDisabledState(ctrl, selector) {
2476
+ function bindStateListener() {
2477
+ ctrl.disabled(!editor.dom.getParent(editor.selection.getStart(), selector));
2478
+
2479
+ editor.selection.selectorChanged(selector, function(state) {
2480
+ ctrl.disabled(!state);
2481
+ });
2482
+ }
2483
+
2484
+ if (editor.initialized) {
2485
+ bindStateListener();
2486
+ } else {
2487
+ editor.on('init', bindStateListener);
2488
+ }
2489
+ }
2490
+
2491
+ function postRender() {
2492
+ /*jshint validthis:true*/
2493
+ handleDisabledState(this, 'table');
2494
+ }
2495
+
2496
+ function postRenderCell() {
2497
+ /*jshint validthis:true*/
2498
+ handleDisabledState(this, 'td,th');
2499
+ }
2500
+
2501
+ function generateTableGrid() {
2502
+ var html = '';
2503
+
2504
+ html = '<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';
2505
+
2506
+ for (var y = 0; y < 10; y++) {
2507
+ html += '<tr>';
2508
+
2509
+ for (var x = 0; x < 10; x++) {
2510
+ html += '<td role="gridcell" tabindex="-1"><a id="mcegrid' + (y * 10 + x) + '" href="#" ' +
2511
+ 'data-mce-x="' + x + '" data-mce-y="' + y + '"></a></td>';
2512
+ }
2513
+
2514
+ html += '</tr>';
2515
+ }
2516
+
2517
+ html += '</table>';
2518
+
2519
+ html += '<div class="mce-text-center" role="presentation">1 x 1</div>';
2520
+
2521
+ return html;
2522
+ }
2523
+
2524
+ function selectGrid(tx, ty, control) {
2525
+ var table = control.getEl().getElementsByTagName('table')[0];
2526
+ var x, y, focusCell, cell, active;
2527
+ var rtl = control.isRtl() || control.parent().rel == 'tl-tr';
2528
+
2529
+ table.nextSibling.innerHTML = (tx + 1) + ' x ' + (ty + 1);
2530
+
2531
+ if (rtl) {
2532
+ tx = 9 - tx;
2533
+ }
2534
+
2535
+ for (y = 0; y < 10; y++) {
2536
+ for (x = 0; x < 10; x++) {
2537
+ cell = table.rows[y].childNodes[x].firstChild;
2538
+ active = (rtl ? x >= tx : x <= tx) && y <= ty;
2539
+
2540
+ editor.dom.toggleClass(cell, 'mce-active', active);
2541
+
2542
+ if (active) {
2543
+ focusCell = cell;
2544
+ }
2545
+ }
2546
+ }
2547
+
2548
+ return focusCell.parentNode;
2549
+ }
2550
+
2551
+ if (editor.settings.table_grid === false) {
2552
+ editor.addMenuItem('inserttable', {
2553
+ text: 'Insert table',
2554
+ icon: 'table',
2555
+ context: 'table',
2556
+ onclick: dialogs.table
2557
+ });
2558
+ } else {
2559
+ editor.addMenuItem('inserttable', {
2560
+ text: 'Insert table',
2561
+ icon: 'table',
2562
+ context: 'table',
2563
+ ariaHideMenu: true,
2564
+ onclick: function(e) {
2565
+ if (e.aria) {
2566
+ this.parent().hideAll();
2567
+ e.stopImmediatePropagation();
2568
+ dialogs.table();
2569
+ }
2570
+ },
2571
+ onshow: function() {
2572
+ selectGrid(0, 0, this.menu.items()[0]);
2573
+ },
2574
+ onhide: function() {
2575
+ var elements = this.menu.items()[0].getEl().getElementsByTagName('a');
2576
+ editor.dom.removeClass(elements, 'mce-active');
2577
+ editor.dom.addClass(elements[0], 'mce-active');
2578
+ },
2579
+ menu: [
2580
+ {
2581
+ type: 'container',
2582
+ html: generateTableGrid(),
2583
+
2584
+ onPostRender: function() {
2585
+ this.lastX = this.lastY = 0;
2586
+ },
2587
+
2588
+ onmousemove: function(e) {
2589
+ var target = e.target, x, y;
2590
+
2591
+ if (target.tagName.toUpperCase() == 'A') {
2592
+ x = parseInt(target.getAttribute('data-mce-x'), 10);
2593
+ y = parseInt(target.getAttribute('data-mce-y'), 10);
2594
+
2595
+ if (this.isRtl() || this.parent().rel == 'tl-tr') {
2596
+ x = 9 - x;
2597
+ }
2598
+
2599
+ if (x !== this.lastX || y !== this.lastY) {
2600
+ selectGrid(x, y, e.control);
2601
+
2602
+ this.lastX = x;
2603
+ this.lastY = y;
2604
+ }
2605
+ }
2606
+ },
2607
+
2608
+ onclick: function(e) {
2609
+ var self = this;
2610
+
2611
+ if (e.target.tagName.toUpperCase() == 'A') {
2612
+ e.preventDefault();
2613
+ e.stopPropagation();
2614
+ self.parent().cancel();
2615
+
2616
+ editor.undoManager.transact(function() {
2617
+ insertTable(self.lastX + 1, self.lastY + 1);
2618
+ });
2619
+
2620
+ editor.addVisual();
2621
+ }
2622
+ }
2623
+ }
2624
+ ]
2625
+ });
2626
+ }
2627
+
2628
+ editor.addMenuItem('tableprops', {
2629
+ text: 'Table properties',
2630
+ context: 'table',
2631
+ onPostRender: postRender,
2632
+ onclick: dialogs.tableProps
2633
+ });
2634
+
2635
+ editor.addMenuItem('deletetable', {
2636
+ text: 'Delete table',
2637
+ context: 'table',
2638
+ onPostRender: postRender,
2639
+ cmd: 'mceTableDelete'
2640
+ });
2641
+
2642
+ editor.addMenuItem('cell', {
2643
+ separator: 'before',
2644
+ text: 'Cell',
2645
+ context: 'table',
2646
+ menu: [
2647
+ {text: 'Cell properties', onclick: cmd('mceTableCellProps'), onPostRender: postRenderCell},
2648
+ {text: 'Merge cells', onclick: cmd('mceTableMergeCells'), onPostRender: postRenderCell},
2649
+ {text: 'Split cell', onclick: cmd('mceTableSplitCells'), onPostRender: postRenderCell}
2650
+ ]
2651
+ });
2652
+
2653
+ editor.addMenuItem('row', {
2654
+ text: 'Row',
2655
+ context: 'table',
2656
+ menu: [
2657
+ {text: 'Insert row before', onclick: cmd('mceTableInsertRowBefore'), onPostRender: postRenderCell},
2658
+ {text: 'Insert row after', onclick: cmd('mceTableInsertRowAfter'), onPostRender: postRenderCell},
2659
+ {text: 'Delete row', onclick: cmd('mceTableDeleteRow'), onPostRender: postRenderCell},
2660
+ {text: 'Row properties', onclick: cmd('mceTableRowProps'), onPostRender: postRenderCell},
2661
+ {text: '-'},
2662
+ {text: 'Cut row', onclick: cmd('mceTableCutRow'), onPostRender: postRenderCell},
2663
+ {text: 'Copy row', onclick: cmd('mceTableCopyRow'), onPostRender: postRenderCell},
2664
+ {text: 'Paste row before', onclick: cmd('mceTablePasteRowBefore'), onPostRender: postRenderCell},
2665
+ {text: 'Paste row after', onclick: cmd('mceTablePasteRowAfter'), onPostRender: postRenderCell}
2666
+ ]
2667
+ });
2668
+
2669
+ editor.addMenuItem('column', {
2670
+ text: 'Column',
2671
+ context: 'table',
2672
+ menu: [
2673
+ {text: 'Insert column before', onclick: cmd('mceTableInsertColBefore'), onPostRender: postRenderCell},
2674
+ {text: 'Insert column after', onclick: cmd('mceTableInsertColAfter'), onPostRender: postRenderCell},
2675
+ {text: 'Delete column', onclick: cmd('mceTableDeleteCol'), onPostRender: postRenderCell}
2676
+ ]
2677
+ });
2678
+
2679
+ var menuItems = [];
2680
+ each("inserttable tableprops deletetable | cell row column".split(' '), function(name) {
2681
+ if (name == '|') {
2682
+ menuItems.push({text: '-'});
2683
+ } else {
2684
+ menuItems.push(editor.menuItems[name]);
2685
+ }
2686
+ });
2687
+
2688
+ editor.addButton("table", {
2689
+ type: "menubutton",
2690
+ title: "Table",
2691
+ menu: menuItems
2692
+ });
2693
+
2694
+ // Select whole table is a table border is clicked
2695
+ if (!Env.isIE) {
2696
+ editor.on('click', function(e) {
2697
+ e = e.target;
2698
+
2699
+ if (e.nodeName === 'TABLE') {
2700
+ editor.selection.select(e);
2701
+ editor.nodeChanged();
2702
+ }
2703
+ });
2704
+ }
2705
+
2706
+ self.quirks = new Quirks(editor);
2707
+
2708
+ editor.on('Init', function() {
2709
+ self.cellSelection = new CellSelection(editor);
2710
+ });
2711
+
2712
+ editor.on('PreInit', function() {
2713
+ // Remove internal data attributes
2714
+ editor.serializer.addAttributeFilter(
2715
+ 'data-mce-cell-padding,data-mce-border,data-mce-border-color',
2716
+ function(nodes, name) {
2717
+
2718
+ var i = nodes.length;
2719
+
2720
+ while (i--) {
2721
+ nodes[i].attr(name, null);
2722
+ }
2723
+ });
2724
+ });
2725
+
2726
+ // Register action commands
2727
+ each({
2728
+ mceTableSplitCells: function(grid) {
2729
+ grid.split();
2730
+ },
2731
+
2732
+ mceTableMergeCells: function(grid) {
2733
+ var cell;
2734
+
2735
+ cell = editor.dom.getParent(editor.selection.getStart(), 'th,td');
2736
+
2737
+ if (!editor.dom.select('td.mce-item-selected,th.mce-item-selected').length) {
2738
+ dialogs.merge(grid, cell);
2739
+ } else {
2740
+ grid.merge();
2741
+ }
2742
+ },
2743
+
2744
+ mceTableInsertRowBefore: function(grid) {
2745
+ grid.insertRow(true);
2746
+ },
2747
+
2748
+ mceTableInsertRowAfter: function(grid) {
2749
+ grid.insertRow();
2750
+ },
2751
+
2752
+ mceTableInsertColBefore: function(grid) {
2753
+ grid.insertCol(true);
2754
+ },
2755
+
2756
+ mceTableInsertColAfter: function(grid) {
2757
+ grid.insertCol();
2758
+ },
2759
+
2760
+ mceTableDeleteCol: function(grid) {
2761
+ grid.deleteCols();
2762
+ },
2763
+
2764
+ mceTableDeleteRow: function(grid) {
2765
+ grid.deleteRows();
2766
+ },
2767
+
2768
+ mceTableCutRow: function(grid) {
2769
+ clipboardRows = grid.cutRows();
2770
+ },
2771
+
2772
+ mceTableCopyRow: function(grid) {
2773
+ clipboardRows = grid.copyRows();
2774
+ },
2775
+
2776
+ mceTablePasteRowBefore: function(grid) {
2777
+ grid.pasteRows(clipboardRows, true);
2778
+ },
2779
+
2780
+ mceTablePasteRowAfter: function(grid) {
2781
+ grid.pasteRows(clipboardRows);
2782
+ },
2783
+
2784
+ mceTableDelete: function(grid) {
2785
+ grid.deleteTable();
2786
+ }
2787
+ }, function(func, name) {
2788
+ editor.addCommand(name, function() {
2789
+ var grid = new TableGrid(editor);
2790
+
2791
+ if (grid) {
2792
+ func(grid);
2793
+ editor.execCommand('mceRepaint');
2794
+ self.cellSelection.clear();
2795
+ }
2796
+ });
2797
+ });
2798
+
2799
+ // Register dialog commands
2800
+ each({
2801
+ mceInsertTable: dialogs.table,
2802
+ mceTableProps: function() {
2803
+ dialogs.table(true);
2804
+ },
2805
+ mceTableRowProps: dialogs.row,
2806
+ mceTableCellProps: dialogs.cell
2807
+ }, function(func, name) {
2808
+ editor.addCommand(name, function(ui, val) {
2809
+ func(val);
2810
+ });
2811
+ });
2812
+
2813
+ // Enable tab key cell navigation
2814
+ if (editor.settings.table_tab_navigation !== false) {
2815
+ editor.on('keydown', function(e) {
2816
+ var cellElm, grid, delta;
2817
+
2818
+ if (e.keyCode == 9) {
2819
+ cellElm = editor.dom.getParent(editor.selection.getStart(), 'th,td');
2820
+
2821
+ if (cellElm) {
2822
+ e.preventDefault();
2823
+
2824
+ grid = new TableGrid(editor);
2825
+ delta = e.shiftKey ? -1 : 1;
2826
+
2827
+ editor.undoManager.transact(function() {
2828
+ if (!grid.moveRelIdx(cellElm, delta) && delta > 0) {
2829
+ grid.insertRow();
2830
+ grid.refresh();
2831
+ grid.moveRelIdx(cellElm, delta);
2832
+ }
2833
+ });
2834
+ }
2835
+ }
2836
+ });
2837
+ }
2838
+
2839
+ self.insertTable = insertTable;
2840
+ }
2841
+
2842
+ PluginManager.add('table', Plugin);
2843
+ });
2844
+ })(this);