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,57 @@
1
+ /**
2
+ * UndoStack.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
+ define("tinymce/imagetoolsplugin/UndoStack", [
12
+ ], function() {
13
+ return function() {
14
+ var data = [], index = -1;
15
+
16
+ function add(state) {
17
+ var removed;
18
+
19
+ removed = data.splice(++index);
20
+ data.push(state);
21
+
22
+ return {
23
+ state: state,
24
+ removed: removed
25
+ };
26
+ }
27
+
28
+ function undo() {
29
+ if (canUndo()) {
30
+ return data[--index];
31
+ }
32
+ }
33
+
34
+ function redo() {
35
+ if (canRedo()) {
36
+ return data[++index];
37
+ }
38
+ }
39
+
40
+ function canUndo() {
41
+ return index > 0;
42
+ }
43
+
44
+ function canRedo() {
45
+ return index != -1 && index < data.length - 1;
46
+ }
47
+
48
+ return {
49
+ data: data,
50
+ add: add,
51
+ undo: undo,
52
+ redo: redo,
53
+ canUndo: canUndo,
54
+ canRedo: canRedo
55
+ };
56
+ };
57
+ });
@@ -0,0 +1,149 @@
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
+ expose(["tinymce/imagetoolsplugin/Canvas","tinymce/imagetoolsplugin/Mime","tinymce/imagetoolsplugin/ImageSize","tinymce/imagetoolsplugin/Conversions","tinymce/imagetoolsplugin/ImageTools","tinymce/imagetoolsplugin/CropRect","tinymce/imagetoolsplugin/ImagePanel","tinymce/imagetoolsplugin/ColorMatrix","tinymce/imagetoolsplugin/Filters","tinymce/imagetoolsplugin/UndoStack","tinymce/imagetoolsplugin/Dialog","tinymce/imagetoolsplugin/Plugin"]);
132
+
133
+ load('classes/Canvas.js');
134
+ load('classes/Mime.js');
135
+ load('classes/ImageSize.js');
136
+ load('classes/Conversions.js');
137
+ load('classes/ImageTools.js');
138
+ load('classes/CropRect.js');
139
+ load('classes/ImagePanel.js');
140
+ load('classes/ColorMatrix.js');
141
+ load('classes/Filters.js');
142
+ load('classes/UndoStack.js');
143
+ load('classes/Dialog.js');
144
+ load('classes/Plugin.js');
145
+
146
+ writeScripts();
147
+ })(this);
148
+
149
+ // $hash: 1d271fbe68c3a30b1f8840e66ccdda78
@@ -0,0 +1,2334 @@
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/imagetools/classes/Canvas.js
101
+
102
+ /**
103
+ * Canvas.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
+ * Contains various canvas functions.
114
+ */
115
+ define("tinymce/imagetoolsplugin/Canvas", [], function() {
116
+ function create(width, height) {
117
+ return resize(document.createElement('canvas'), width, height);
118
+ }
119
+
120
+ function get2dContext(canvas) {
121
+ return canvas.getContext("2d");
122
+ }
123
+
124
+ function resize(canvas, width, height) {
125
+ canvas.width = width;
126
+ canvas.height = height;
127
+
128
+ return canvas;
129
+ }
130
+
131
+ return {
132
+ create: create,
133
+ resize: resize,
134
+ get2dContext: get2dContext
135
+ };
136
+ });
137
+
138
+ // Included from: js/tinymce/plugins/imagetools/classes/Mime.js
139
+
140
+ /**
141
+ * Mime.js
142
+ *
143
+ * Released under LGPL License.
144
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
145
+ *
146
+ * License: http://www.tinymce.com/license
147
+ * Contributing: http://www.tinymce.com/contributing
148
+ */
149
+
150
+ /**
151
+ * Returns mime types for uris.
152
+ */
153
+ define("tinymce/imagetoolsplugin/Mime", [], function() {
154
+ function getUriPathName(uri) {
155
+ var a = document.createElement('a');
156
+
157
+ a.href = uri;
158
+
159
+ return a.pathname;
160
+ }
161
+
162
+ function guessMimeType(uri) {
163
+ var parts = getUriPathName(uri).split('.'),
164
+ ext = parts[parts.length - 1],
165
+ mimes = {
166
+ 'jpg': 'image/jpeg',
167
+ 'jpeg': 'image/jpeg',
168
+ 'png': 'image/png'
169
+ };
170
+
171
+ if (ext) {
172
+ ext = ext.toLowerCase();
173
+ }
174
+
175
+ return mimes[ext];
176
+ }
177
+
178
+ return {
179
+ guessMimeType: guessMimeType
180
+ };
181
+ });
182
+
183
+ // Included from: js/tinymce/plugins/imagetools/classes/ImageSize.js
184
+
185
+ /**
186
+ * ImageSize.js
187
+ *
188
+ * Released under LGPL License.
189
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
190
+ *
191
+ * License: http://www.tinymce.com/license
192
+ * Contributing: http://www.tinymce.com/contributing
193
+ */
194
+
195
+ /**
196
+ * Returns the size of images.
197
+ */
198
+ define("tinymce/imagetoolsplugin/ImageSize", [], function() {
199
+ function getWidth(image) {
200
+ return image.naturalWidth || image.width;
201
+ }
202
+
203
+ function getHeight(image) {
204
+ return image.naturalHeight || image.height;
205
+ }
206
+
207
+ return {
208
+ getWidth: getWidth,
209
+ getHeight: getHeight
210
+ };
211
+ });
212
+
213
+ // Included from: js/tinymce/plugins/imagetools/classes/Conversions.js
214
+
215
+ /**
216
+ * Conversions.js
217
+ *
218
+ * Released under LGPL License.
219
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
220
+ *
221
+ * License: http://www.tinymce.com/license
222
+ * Contributing: http://www.tinymce.com/contributing
223
+ */
224
+
225
+ /**
226
+ * Converts blob/uris/images back and forth.
227
+ */
228
+ define("tinymce/imagetoolsplugin/Conversions", [
229
+ "tinymce/util/Promise",
230
+ "tinymce/imagetoolsplugin/Canvas",
231
+ "tinymce/imagetoolsplugin/Mime",
232
+ "tinymce/imagetoolsplugin/ImageSize"
233
+ ], function(Promise, Canvas, Mime, ImageSize) {
234
+ function loadImage(image) {
235
+ return new Promise(function(resolve) {
236
+ function loaded() {
237
+ image.removeEventListener('load', loaded);
238
+ resolve(image);
239
+ }
240
+
241
+ if (image.complete) {
242
+ resolve(image);
243
+ } else {
244
+ image.addEventListener('load', loaded);
245
+ }
246
+ });
247
+ }
248
+
249
+ function imageToCanvas(image) {
250
+ return loadImage(image).then(function(image) {
251
+ var context, canvas;
252
+
253
+ canvas = Canvas.create(ImageSize.getWidth(image), ImageSize.getHeight(image));
254
+ context = Canvas.get2dContext(canvas);
255
+ context.drawImage(image, 0, 0);
256
+
257
+ return canvas;
258
+ });
259
+ }
260
+
261
+ function imageToBlob(image) {
262
+ return loadImage(image).then(function(image) {
263
+ var src = image.src;
264
+
265
+ if (src.indexOf('blob:') === 0) {
266
+ return blobUriToBlob(src);
267
+ }
268
+
269
+ if (src.indexOf('data:') === 0) {
270
+ return dataUriToBlob(src);
271
+ }
272
+
273
+ return imageToCanvas(image).then(function(canvas) {
274
+ return dataUriToBlob(canvas.toDataURL(Mime.guessMimeType(src)));
275
+ });
276
+ });
277
+ }
278
+
279
+ function blobToImage(blob) {
280
+ return new Promise(function(resolve) {
281
+ var image = new Image();
282
+
283
+ function loaded() {
284
+ image.removeEventListener('load', loaded);
285
+ resolve(image);
286
+ }
287
+
288
+ image.addEventListener('load', loaded);
289
+ image.src = URL.createObjectURL(blob);
290
+
291
+ if (image.complete) {
292
+ loaded();
293
+ }
294
+ });
295
+ }
296
+
297
+ function blobUriToBlob(url) {
298
+ return new Promise(function(resolve) {
299
+ var xhr = new XMLHttpRequest();
300
+
301
+ xhr.open('GET', url, true);
302
+ xhr.responseType = 'blob';
303
+
304
+ xhr.onload = function() {
305
+ if (this.status == 200) {
306
+ resolve(this.response);
307
+ }
308
+ };
309
+
310
+ xhr.send();
311
+ });
312
+ }
313
+
314
+ function dataUriToBlob(uri) {
315
+ return new Promise(function(resolve) {
316
+ var str, arr, i, matches, type, blobBuilder;
317
+
318
+ uri = uri.split(',');
319
+
320
+ matches = /data:([^;]+)/.exec(uri[0]);
321
+ if (matches) {
322
+ type = matches[1];
323
+ }
324
+
325
+ str = atob(uri[1]);
326
+
327
+ if (window.WebKitBlobBuilder) {
328
+ /*globals WebKitBlobBuilder:false */
329
+ blobBuilder = new WebKitBlobBuilder();
330
+
331
+ arr = new ArrayBuffer(str.length);
332
+ for (i = 0; i < arr.length; i++) {
333
+ arr[i] = str.charCodeAt(i);
334
+ }
335
+
336
+ blobBuilder.append(arr);
337
+
338
+ resolve(blobBuilder.getBlob(type));
339
+ return;
340
+ }
341
+
342
+ arr = new Uint8Array(str.length);
343
+
344
+ for (i = 0; i < arr.length; i++) {
345
+ arr[i] = str.charCodeAt(i);
346
+ }
347
+
348
+ resolve(new Blob([arr], {type: type}));
349
+ });
350
+ }
351
+
352
+ function uriToBlob(url) {
353
+ if (url.indexOf('blob:') === 0) {
354
+ return blobUriToBlob(url);
355
+ }
356
+
357
+ if (url.indexOf('data:') === 0) {
358
+ return dataUriToBlob(url);
359
+ }
360
+
361
+ return null;
362
+ }
363
+
364
+ function canvasToBlob(canvas, type) {
365
+ return dataUriToBlob(canvas.toDataURL(type));
366
+ }
367
+
368
+ function blobToDataUri(blob) {
369
+ return new Promise(function(resolve) {
370
+ var reader = new FileReader();
371
+
372
+ reader.onloadend = function() {
373
+ resolve(reader.result);
374
+ };
375
+
376
+ reader.readAsDataURL(blob);
377
+ });
378
+ }
379
+
380
+ function blobToBase64(blob) {
381
+ return blobToDataUri(blob).then(function(dataUri) {
382
+ return dataUri.split(',')[1];
383
+ });
384
+ }
385
+
386
+ function revokeImageUrl(image) {
387
+ URL.revokeObjectURL(image.src);
388
+ }
389
+
390
+ return {
391
+ blobToImage: blobToImage,
392
+ imageToBlob: imageToBlob,
393
+ uriToBlob: uriToBlob,
394
+ blobToDataUri: blobToDataUri,
395
+ blobToBase64: blobToBase64,
396
+ imageToCanvas: imageToCanvas,
397
+ canvasToBlob: canvasToBlob,
398
+ revokeImageUrl: revokeImageUrl
399
+ };
400
+ });
401
+
402
+ // Included from: js/tinymce/plugins/imagetools/classes/ImageTools.js
403
+
404
+ /**
405
+ * ImageTools.js
406
+ *
407
+ * Released under LGPL License.
408
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
409
+ *
410
+ * License: http://www.tinymce.com/license
411
+ * Contributing: http://www.tinymce.com/contributing
412
+ */
413
+
414
+ /**
415
+ * Modifies image blobs.
416
+ */
417
+ define("tinymce/imagetoolsplugin/ImageTools", [
418
+ "tinymce/imagetoolsplugin/Conversions",
419
+ "tinymce/imagetoolsplugin/Canvas",
420
+ "tinymce/imagetoolsplugin/ImageSize"
421
+ ], function(Conversions, Canvas, ImageSize) {
422
+ var revokeImageUrl = Conversions.revokeImageUrl;
423
+
424
+ function rotate(blob, angle) {
425
+ return Conversions.blobToImage(blob).then(function(image) {
426
+ var canvas = Canvas.create(ImageSize.getWidth(image), ImageSize.getHeight(image)),
427
+ context = Canvas.get2dContext(canvas),
428
+ translateX = 0, translateY = 0;
429
+
430
+ angle = angle < 0 ? 360 + angle : angle;
431
+
432
+ if (angle == 90 || angle == 270) {
433
+ Canvas.resize(canvas, canvas.height, canvas.width);
434
+ }
435
+
436
+ if (angle == 90 || angle == 180) {
437
+ translateX = canvas.width;
438
+ }
439
+
440
+ if (angle == 270 || angle == 180) {
441
+ translateY = canvas.height;
442
+ }
443
+
444
+ context.translate(translateX, translateY);
445
+ context.rotate(angle * Math.PI / 180);
446
+ context.drawImage(image, 0, 0);
447
+ revokeImageUrl(image);
448
+
449
+ return Conversions.canvasToBlob(canvas, blob.type);
450
+ });
451
+ }
452
+
453
+ function flip(blob, axis) {
454
+ return Conversions.blobToImage(blob).then(function(image) {
455
+ var canvas = Canvas.create(ImageSize.getWidth(image), ImageSize.getHeight(image)),
456
+ context = Canvas.get2dContext(canvas);
457
+
458
+ if (axis == 'v') {
459
+ context.scale(1, -1);
460
+ context.drawImage(image, 0, -canvas.height);
461
+ } else {
462
+ context.scale(-1, 1);
463
+ context.drawImage(image, -canvas.width, 0);
464
+ }
465
+
466
+ revokeImageUrl(image);
467
+
468
+ return Conversions.canvasToBlob(canvas);
469
+ });
470
+ }
471
+
472
+ function crop(blob, x, y, w, h) {
473
+ return Conversions.blobToImage(blob).then(function(image) {
474
+ var canvas = Canvas.create(w, h),
475
+ context = Canvas.get2dContext(canvas);
476
+
477
+ context.drawImage(image, -x, -y);
478
+ revokeImageUrl(image);
479
+
480
+ return Conversions.canvasToBlob(canvas);
481
+ });
482
+ }
483
+
484
+ function resize(blob, w, h) {
485
+ return Conversions.blobToImage(blob).then(function(image) {
486
+ var canvas = Canvas.create(w, h),
487
+ context = Canvas.get2dContext(canvas);
488
+
489
+ context.drawImage(image, 0, 0, w, h);
490
+ revokeImageUrl(image);
491
+
492
+ return Conversions.canvasToBlob(canvas, blob.type);
493
+ });
494
+ }
495
+
496
+ return {
497
+ rotate: rotate,
498
+ flip: flip,
499
+ crop: crop,
500
+ resize: resize
501
+ };
502
+ });
503
+
504
+ // Included from: js/tinymce/plugins/imagetools/classes/CropRect.js
505
+
506
+ /**
507
+ * CropRect.js
508
+ *
509
+ * Released under LGPL License.
510
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
511
+ *
512
+ * License: http://www.tinymce.com/license
513
+ * Contributing: http://www.tinymce.com/contributing
514
+ */
515
+
516
+ /**
517
+ * ...
518
+ */
519
+ define("tinymce/imagetoolsplugin/CropRect", [
520
+ "tinymce/dom/DomQuery",
521
+ "tinymce/ui/DragHelper",
522
+ "tinymce/ui/Rect",
523
+ "tinymce/util/Tools",
524
+ "tinymce/util/Observable"
525
+ ], function($, DragHelper, Rect, Tools, Observable) {
526
+ var count = 0;
527
+
528
+ return function(currentRect, viewPortRect, clampRect, containerElm) {
529
+ var instance, handles, dragHelpers, blockers, prefix = 'mce-', id = prefix + 'crid-' + (count++);
530
+
531
+ handles = [
532
+ {name: 'move', xMul: 0, yMul: 0, deltaX: 1, deltaY: 1, deltaW: 0, deltaH: 0},
533
+ {name: 'nw', xMul: 0, yMul: 0, deltaX: 1, deltaY: 1, deltaW: -1, deltaH: -1},
534
+ {name: 'ne', xMul: 1, yMul: 0, deltaX: 0, deltaY: 1, deltaW: 1, deltaH: -1},
535
+ {name: 'sw', xMul: 0, yMul: 1, deltaX: 1, deltaY: 0, deltaW: -1, deltaH: 1},
536
+ {name: 'se', xMul: 1, yMul: 1, deltaX: 0, deltaY: 0, deltaW: 1, deltaH: 1}
537
+ ];
538
+
539
+ blockers = ["top", "right", "bottom", "left"];
540
+
541
+ function getAbsoluteRect(outerRect, relativeRect) {
542
+ return {
543
+ x: relativeRect.x + outerRect.x,
544
+ y: relativeRect.y + outerRect.y,
545
+ w: relativeRect.w,
546
+ h: relativeRect.h
547
+ };
548
+ }
549
+
550
+ function getRelativeRect(outerRect, innerRect) {
551
+ return {
552
+ x: innerRect.x - outerRect.x,
553
+ y: innerRect.y - outerRect.y,
554
+ w: innerRect.w,
555
+ h: innerRect.h
556
+ };
557
+ }
558
+
559
+ function getInnerRect() {
560
+ return getRelativeRect(clampRect, currentRect);
561
+ }
562
+
563
+ function render() {
564
+ function createDragHelper(handle) {
565
+ var startRect;
566
+
567
+ return new DragHelper(id, {
568
+ document: containerElm.ownerDocument,
569
+ handle: id + '-' + handle.name,
570
+
571
+ start: function() {
572
+ startRect = currentRect;
573
+ },
574
+
575
+ drag: function(e) {
576
+ var x, y, w, h, rect;
577
+
578
+ x = startRect.x;
579
+ y = startRect.y;
580
+ w = startRect.w;
581
+ h = startRect.h;
582
+
583
+ x += e.deltaX * handle.deltaX;
584
+ y += e.deltaY * handle.deltaY;
585
+ w += e.deltaX * handle.deltaW;
586
+ h += e.deltaY * handle.deltaH;
587
+
588
+ if (w < 20) {
589
+ w = 20;
590
+ }
591
+
592
+ if (h < 20) {
593
+ h = 20;
594
+ }
595
+
596
+ rect = currentRect = Rect.clamp({x: x, y: y, w: w, h: h}, clampRect, handle.name == 'move');
597
+ rect = getRelativeRect(clampRect, rect);
598
+
599
+ instance.fire('updateRect', {rect: rect});
600
+ setInnerRect(rect);
601
+ }
602
+ });
603
+ }
604
+
605
+ $('<div id="' + id + '" class="' + prefix + 'croprect-container" data-mce-bogus="all">').appendTo(containerElm);
606
+
607
+ Tools.each(blockers, function(blocker) {
608
+ $('#' + id, containerElm).append(
609
+ '<div id="' + id + '-' + blocker + '"class="' + prefix + 'croprect-block" style="display: none" data-mce-bogus="all">'
610
+ );
611
+ });
612
+
613
+ Tools.each(handles, function(handle) {
614
+ $('#' + id, containerElm).append(
615
+ '<div id="' + id + '-' + handle.name + '" class="' + prefix +
616
+ 'croprect-handle ' + prefix + 'croprect-handle-' + handle.name + '" style="display: none" data-mce-bogus="all">'
617
+ );
618
+ });
619
+
620
+ dragHelpers = Tools.map(handles, createDragHelper);
621
+
622
+ repaint(currentRect);
623
+ }
624
+
625
+ function toggleVisibility(state) {
626
+ var selectors;
627
+
628
+ selectors = Tools.map(handles, function(handle) {
629
+ return '#' + id + '-' + handle.name;
630
+ }).concat(Tools.map(blockers, function(blocker) {
631
+ return '#' + id + '-' + blocker;
632
+ })).join(',');
633
+
634
+ if (state) {
635
+ $(selectors, containerElm).show();
636
+ } else {
637
+ $(selectors, containerElm).hide();
638
+ }
639
+ }
640
+
641
+ function repaint(rect) {
642
+ function updateElementRect(name, rect) {
643
+ if (rect.h < 0) {
644
+ rect.h = 0;
645
+ }
646
+
647
+ if (rect.w < 0) {
648
+ rect.w = 0;
649
+ }
650
+
651
+ $('#' + id + '-' + name, containerElm).css({
652
+ left: rect.x,
653
+ top: rect.y,
654
+ width: rect.w,
655
+ height: rect.h
656
+ });
657
+ }
658
+
659
+ Tools.each(handles, function(handle) {
660
+ $('#' + id + '-' + handle.name, containerElm).css({
661
+ left: rect.w * handle.xMul + rect.x,
662
+ top: rect.h * handle.yMul + rect.y
663
+ });
664
+ });
665
+
666
+ updateElementRect('top', {x: viewPortRect.x, y: viewPortRect.y, w: viewPortRect.w, h: rect.y - viewPortRect.y});
667
+ updateElementRect('right', {x: rect.x + rect.w, y: rect.y, w: viewPortRect.w - rect.x - rect.w + viewPortRect.x, h: rect.h});
668
+ updateElementRect('bottom', {
669
+ x: viewPortRect.x,
670
+ y: rect.y + rect.h,
671
+ w: viewPortRect.w,
672
+ h: viewPortRect.h - rect.y - rect.h + viewPortRect.y
673
+ });
674
+ updateElementRect('left', {x: viewPortRect.x, y: rect.y, w: rect.x - viewPortRect.x, h: rect.h});
675
+ updateElementRect('move', rect);
676
+ }
677
+
678
+ function setRect(rect) {
679
+ currentRect = rect;
680
+ repaint(currentRect);
681
+ }
682
+
683
+ function setViewPortRect(rect) {
684
+ viewPortRect = rect;
685
+ repaint(currentRect);
686
+ }
687
+
688
+ function setInnerRect(rect) {
689
+ setRect(getAbsoluteRect(clampRect, rect));
690
+ }
691
+
692
+ function setClampRect(rect) {
693
+ clampRect = rect;
694
+ repaint(currentRect);
695
+ }
696
+
697
+ function destroy() {
698
+ Tools.each(dragHelpers, function(helper) {
699
+ helper.destroy();
700
+ });
701
+
702
+ dragHelpers = [];
703
+ }
704
+
705
+ render(containerElm);
706
+
707
+ instance = Tools.extend({
708
+ toggleVisibility: toggleVisibility,
709
+ setClampRect: setClampRect,
710
+ setRect: setRect,
711
+ getInnerRect: getInnerRect,
712
+ setInnerRect: setInnerRect,
713
+ setViewPortRect: setViewPortRect,
714
+ destroy: destroy
715
+ }, Observable);
716
+
717
+ return instance;
718
+ };
719
+ });
720
+
721
+ // Included from: js/tinymce/plugins/imagetools/classes/ImagePanel.js
722
+
723
+ /**
724
+ * ImagePanel.js
725
+ *
726
+ * Released under LGPL License.
727
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
728
+ *
729
+ * License: http://www.tinymce.com/license
730
+ * Contributing: http://www.tinymce.com/contributing
731
+ */
732
+
733
+ /**
734
+ * ...
735
+ *
736
+ * @-x-less ImagePanel.less
737
+ */
738
+ define("tinymce/imagetoolsplugin/ImagePanel", [
739
+ "tinymce/ui/Control",
740
+ "tinymce/ui/DragHelper",
741
+ "tinymce/ui/Rect",
742
+ "tinymce/util/Tools",
743
+ "tinymce/util/Promise",
744
+ "tinymce/imagetoolsplugin/CropRect"
745
+ ], function(Control, DragHelper, Rect, Tools, Promise, CropRect) {
746
+ function loadImage(image) {
747
+ return new Promise(function(resolve) {
748
+ function loaded() {
749
+ image.removeEventListener('load', loaded);
750
+ resolve(image);
751
+ }
752
+
753
+ if (image.complete) {
754
+ resolve(image);
755
+ } else {
756
+ image.addEventListener('load', loaded);
757
+ }
758
+ });
759
+ }
760
+
761
+ return Control.extend({
762
+ Defaults: {
763
+ classes: "imagepanel"
764
+ },
765
+
766
+ selection: function(rect) {
767
+ if (arguments.length) {
768
+ this.state.set('rect', rect);
769
+ return this;
770
+ }
771
+
772
+ return this.state.get('rect');
773
+ },
774
+
775
+ imageSize: function() {
776
+ var viewRect = this.state.get('viewRect');
777
+
778
+ return {
779
+ w: viewRect.w,
780
+ h: viewRect.h
781
+ };
782
+ },
783
+
784
+ toggleCropRect: function(state) {
785
+ this.state.set('cropEnabled', state);
786
+ },
787
+
788
+ imageSrc: function(url) {
789
+ var self = this, img = new Image();
790
+
791
+ img.src = url;
792
+
793
+ loadImage(img).then(function() {
794
+ var rect, $img, lastRect = self.state.get('viewRect');
795
+
796
+ $img = self.$el.find('img');
797
+ if ($img[0]) {
798
+ $img.replaceWith(img);
799
+ } else {
800
+ self.getEl().appendChild(img);
801
+ }
802
+
803
+ rect = {x: 0, y: 0, w: img.naturalWidth, h: img.naturalHeight};
804
+ self.state.set('viewRect', rect);
805
+ self.state.set('rect', Rect.inflate(rect, -20, -20));
806
+
807
+ if (!lastRect || lastRect.w != rect.w || lastRect.h != rect.h) {
808
+ self.zoomFit();
809
+ }
810
+
811
+ self.repaintImage();
812
+ self.fire('load');
813
+ });
814
+ },
815
+
816
+ zoom: function(value) {
817
+ if (arguments.length) {
818
+ this.state.set('zoom', value);
819
+ return this;
820
+ }
821
+
822
+ return this.state.get('zoom');
823
+ },
824
+
825
+ postRender: function() {
826
+ this.imageSrc(this.settings.imageSrc);
827
+ return this._super();
828
+ },
829
+
830
+ zoomFit: function() {
831
+ var self = this, $img, pw, ph, w, h, zoom, padding;
832
+
833
+ padding = 10;
834
+ $img = self.$el.find('img');
835
+ pw = self.getEl().clientWidth;
836
+ ph = self.getEl().clientHeight;
837
+ w = $img[0].naturalWidth;
838
+ h = $img[0].naturalHeight;
839
+ zoom = Math.min((pw - padding) / w, (ph - padding) / h);
840
+
841
+ if (zoom >= 1) {
842
+ zoom = 1;
843
+ }
844
+
845
+ self.zoom(zoom);
846
+ },
847
+
848
+ repaintImage: function() {
849
+ var x, y, w, h, pw, ph, $img, zoom, rect, elm;
850
+
851
+ elm = this.getEl();
852
+ zoom = this.zoom();
853
+ rect = this.state.get('rect');
854
+ $img = this.$el.find('img');
855
+ pw = elm.offsetWidth;
856
+ ph = elm.offsetHeight;
857
+ w = $img[0].naturalWidth * zoom;
858
+ h = $img[0].naturalHeight * zoom;
859
+ x = Math.max(0, pw / 2 - w / 2);
860
+ y = Math.max(0, ph / 2 - h / 2);
861
+
862
+ $img.css({
863
+ left: x,
864
+ top: y,
865
+ width: w,
866
+ height: h
867
+ });
868
+
869
+ if (this.cropRect) {
870
+ this.cropRect.setRect({
871
+ x: rect.x * zoom + x,
872
+ y: rect.y * zoom + y,
873
+ w: rect.w * zoom,
874
+ h: rect.h * zoom
875
+ });
876
+
877
+ this.cropRect.setClampRect({
878
+ x: x,
879
+ y: y,
880
+ w: w,
881
+ h: h
882
+ });
883
+
884
+ this.cropRect.setViewPortRect({
885
+ x: 0,
886
+ y: 0,
887
+ w: pw,
888
+ h: ph
889
+ });
890
+ }
891
+ },
892
+
893
+ bindStates: function() {
894
+ var self = this;
895
+
896
+ function setupCropRect(rect) {
897
+ self.cropRect = new CropRect(
898
+ rect,
899
+ self.state.get('viewRect'),
900
+ self.state.get('viewRect'),
901
+ self.getEl()
902
+ );
903
+
904
+ self.cropRect.on('updateRect', function(e) {
905
+ var rect = e.rect, zoom = self.zoom();
906
+
907
+ rect = {
908
+ x: Math.round(rect.x / zoom),
909
+ y: Math.round(rect.y / zoom),
910
+ w: Math.round(rect.w / zoom),
911
+ h: Math.round(rect.h / zoom)
912
+ };
913
+
914
+ self.state.set('rect', rect);
915
+ });
916
+
917
+ self.on('remove', self.cropRect.destroy);
918
+ }
919
+
920
+ self.state.on('change:cropEnabled', function(e) {
921
+ self.cropRect.toggleVisibility(e.value);
922
+ self.repaintImage();
923
+ });
924
+
925
+ self.state.on('change:zoom', function() {
926
+ self.repaintImage();
927
+ });
928
+
929
+ self.state.on('change:rect', function(e) {
930
+ var rect = e.value;
931
+
932
+ if (!self.cropRect) {
933
+ setupCropRect(rect);
934
+ }
935
+
936
+ self.cropRect.setRect(rect);
937
+ });
938
+ }
939
+ });
940
+ });
941
+
942
+ // Included from: js/tinymce/plugins/imagetools/classes/ColorMatrix.js
943
+
944
+ /**
945
+ * ImageTools.js
946
+ *
947
+ * Released under LGPL License.
948
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
949
+ *
950
+ * License: http://www.tinymce.com/license
951
+ * Contributing: http://www.tinymce.com/contributing
952
+ *
953
+ * Some of the matrix calculations and constants are from the EaselJS library released under MIT:
954
+ * https://github.com/CreateJS/EaselJS/blob/master/src/easeljs/filters/ColorMatrix.js
955
+ */
956
+
957
+ /**
958
+ * Various operations for color matrices.
959
+ */
960
+ define("tinymce/imagetoolsplugin/ColorMatrix", [], function() {
961
+ function clamp(value, min, max) {
962
+ value = parseFloat(value);
963
+
964
+ if (value > max) {
965
+ value = max;
966
+ } else if (value < min) {
967
+ value = min;
968
+ }
969
+
970
+ return value;
971
+ }
972
+
973
+ function identity() {
974
+ return [
975
+ 1, 0, 0, 0, 0,
976
+ 0, 1, 0, 0, 0,
977
+ 0, 0, 1, 0, 0,
978
+ 0, 0, 0, 1, 0,
979
+ 0, 0, 0, 0, 1
980
+ ];
981
+ }
982
+
983
+ var DELTA_INDEX = [
984
+ 0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11,
985
+ 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.20, 0.21, 0.22, 0.24,
986
+ 0.25, 0.27, 0.28, 0.30, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42,
987
+ 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68,
988
+ 0.71, 0.74, 0.77, 0.80, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98,
989
+ 1.0, 1.06, 1.12, 1.18, 1.24, 1.30, 1.36, 1.42, 1.48, 1.54,
990
+ 1.60, 1.66, 1.72, 1.78, 1.84, 1.90, 1.96, 2.0, 2.12, 2.25,
991
+ 2.37, 2.50, 2.62, 2.75, 2.87, 3.0, 3.2, 3.4, 3.6, 3.8,
992
+ 4.0, 4.3, 4.7, 4.9, 5.0, 5.5, 6.0, 6.5, 6.8, 7.0,
993
+ 7.3, 7.5, 7.8, 8.0, 8.4, 8.7, 9.0, 9.4, 9.6, 9.8,
994
+ 10.0
995
+ ];
996
+
997
+ function multiply(matrix1, matrix2) {
998
+ var i, j, k, val, col = [], out = new Array(10);
999
+
1000
+ for (i = 0; i < 5; i++) {
1001
+ for (j = 0; j < 5; j++) {
1002
+ col[j] = matrix2[j + i * 5];
1003
+ }
1004
+
1005
+ for (j = 0; j < 5; j++) {
1006
+ val = 0;
1007
+
1008
+ for (k = 0; k < 5; k++) {
1009
+ val += matrix1[j + k * 5] * col[k];
1010
+ }
1011
+
1012
+ out[j + i * 5] = val;
1013
+ }
1014
+ }
1015
+
1016
+ return out;
1017
+ }
1018
+
1019
+ function adjust(matrix, adjustValue) {
1020
+ adjustValue = clamp(adjustValue, 0, 1);
1021
+
1022
+ return matrix.map(function(value, index) {
1023
+ if (index % 6 === 0) {
1024
+ value = 1.0 - ((1 - value) * adjustValue);
1025
+ } else {
1026
+ value *= adjustValue;
1027
+ }
1028
+
1029
+ return clamp(value, 0, 1);
1030
+ });
1031
+ }
1032
+
1033
+ function adjustContrast(matrix, value) {
1034
+ var x;
1035
+
1036
+ value = clamp(value, -1, 1);
1037
+ value *= 100;
1038
+
1039
+ if (value < 0) {
1040
+ x = 127 + value / 100 * 127;
1041
+ } else {
1042
+ x = value % 1;
1043
+
1044
+ if (x === 0) {
1045
+ x = DELTA_INDEX[value];
1046
+ } else {
1047
+ // use linear interpolation for more granularity.
1048
+ x = DELTA_INDEX[(Math.floor(value))] * (1 - x) + DELTA_INDEX[(Math.floor(value)) + 1] * x;
1049
+ }
1050
+
1051
+ x = x * 127 + 127;
1052
+ }
1053
+
1054
+ return multiply(matrix, [
1055
+ x / 127, 0, 0, 0, 0.5 * (127 - x),
1056
+ 0, x / 127, 0, 0, 0.5 * (127 - x),
1057
+ 0, 0, x / 127, 0, 0.5 * (127 - x),
1058
+ 0, 0, 0, 1, 0,
1059
+ 0, 0, 0, 0, 1
1060
+ ]);
1061
+ }
1062
+
1063
+ function adjustSaturation(matrix, value) {
1064
+ var x, lumR, lumG, lumB;
1065
+
1066
+ value = clamp(value, -1, 1);
1067
+ x = 1 + ((value > 0) ? 3 * value : value);
1068
+ lumR = 0.3086;
1069
+ lumG = 0.6094;
1070
+ lumB = 0.0820;
1071
+
1072
+ return multiply(matrix, [
1073
+ lumR * (1 - x) + x, lumG * (1 - x), lumB * (1 - x), 0, 0,
1074
+ lumR * (1 - x), lumG * (1 - x) + x, lumB * (1 - x), 0, 0,
1075
+ lumR * (1 - x), lumG * (1 - x), lumB * (1 - x) + x, 0, 0,
1076
+ 0, 0, 0, 1, 0,
1077
+ 0, 0, 0, 0, 1
1078
+ ]);
1079
+ }
1080
+
1081
+ function adjustHue(matrix, angle) {
1082
+ var cosVal, sinVal, lumR, lumG, lumB;
1083
+
1084
+ angle = clamp(angle, -180, 180) / 180 * Math.PI;
1085
+ cosVal = Math.cos(angle);
1086
+ sinVal = Math.sin(angle);
1087
+ lumR = 0.213;
1088
+ lumG = 0.715;
1089
+ lumB = 0.072;
1090
+
1091
+ return multiply(matrix, [
1092
+ lumR + cosVal * (1 - lumR) + sinVal * (-lumR), lumG + cosVal * (-lumG) + sinVal * (-lumG),
1093
+ lumB + cosVal * (-lumB) + sinVal * (1 - lumB), 0, 0,
1094
+ lumR + cosVal * (-lumR) + sinVal * (0.143), lumG + cosVal * (1 - lumG) + sinVal * (0.140),
1095
+ lumB + cosVal * (-lumB) + sinVal * (-0.283), 0, 0,
1096
+ lumR + cosVal * (-lumR) + sinVal * (-(1 - lumR)), lumG + cosVal * (-lumG) + sinVal * (lumG),
1097
+ lumB + cosVal * (1 - lumB) + sinVal * (lumB), 0, 0,
1098
+ 0, 0, 0, 1, 0,
1099
+ 0, 0, 0, 0, 1
1100
+ ]);
1101
+ }
1102
+
1103
+ function adjustBrightness(matrix, value) {
1104
+ value = clamp(255 * value, -255, 255);
1105
+
1106
+ return multiply(matrix, [
1107
+ 1, 0, 0, 0, value,
1108
+ 0, 1, 0, 0, value,
1109
+ 0, 0, 1, 0, value,
1110
+ 0, 0, 0, 1, 0,
1111
+ 0, 0, 0, 0, 1
1112
+ ]);
1113
+ }
1114
+
1115
+ function adjustColors(matrix, adjustR, adjustG, adjustB) {
1116
+ adjustR = clamp(adjustR, 0, 2);
1117
+ adjustG = clamp(adjustG, 0, 2);
1118
+ adjustB = clamp(adjustB, 0, 2);
1119
+
1120
+ return multiply(matrix, [
1121
+ adjustR, 0, 0, 0, 0,
1122
+ 0, adjustG, 0, 0, 0,
1123
+ 0, 0, adjustB, 0, 0,
1124
+ 0, 0, 0, 1, 0,
1125
+ 0, 0, 0, 0, 1
1126
+ ]);
1127
+ }
1128
+
1129
+ function adjustSepia(matrix, value) {
1130
+ value = clamp(value, 0, 1);
1131
+
1132
+ return multiply(matrix, adjust([
1133
+ 0.393, 0.769, 0.189, 0, 0,
1134
+ 0.349, 0.686, 0.168, 0, 0,
1135
+ 0.272, 0.534, 0.131, 0, 0,
1136
+ 0, 0, 0, 1, 0,
1137
+ 0, 0, 0, 0, 1
1138
+ ], value));
1139
+ }
1140
+
1141
+ function adjustGrayscale(matrix, value) {
1142
+ value = clamp(value, 0, 1);
1143
+
1144
+ return multiply(matrix, adjust([
1145
+ 0.33, 0.34, 0.33, 0, 0,
1146
+ 0.33, 0.34, 0.33, 0, 0,
1147
+ 0.33, 0.34, 0.33, 0, 0,
1148
+ 0, 0, 0, 1, 0,
1149
+ 0, 0, 0, 0, 1
1150
+ ], value));
1151
+ }
1152
+
1153
+ return {
1154
+ identity: identity,
1155
+ adjust: adjust,
1156
+ multiply: multiply,
1157
+ adjustContrast: adjustContrast,
1158
+ adjustBrightness: adjustBrightness,
1159
+ adjustSaturation: adjustSaturation,
1160
+ adjustHue: adjustHue,
1161
+ adjustColors: adjustColors,
1162
+ adjustSepia: adjustSepia,
1163
+ adjustGrayscale: adjustGrayscale
1164
+ };
1165
+ });
1166
+
1167
+ // Included from: js/tinymce/plugins/imagetools/classes/Filters.js
1168
+
1169
+ /**
1170
+ * Filters.js
1171
+ *
1172
+ * Released under LGPL License.
1173
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
1174
+ *
1175
+ * License: http://www.tinymce.com/license
1176
+ * Contributing: http://www.tinymce.com/contributing
1177
+ */
1178
+
1179
+ /**
1180
+ * Applies various filters to blobs.
1181
+ */
1182
+ define("tinymce/imagetoolsplugin/Filters", [
1183
+ "tinymce/imagetoolsplugin/Canvas",
1184
+ "tinymce/imagetoolsplugin/ImageSize",
1185
+ "tinymce/imagetoolsplugin/Conversions",
1186
+ "tinymce/imagetoolsplugin/ColorMatrix"
1187
+ ], function(Canvas, ImageSize, Conversions, ColorMatrix) {
1188
+ var revokeImageUrl = Conversions.revokeImageUrl;
1189
+
1190
+ function colorFilter(blob, matrix) {
1191
+ return Conversions.blobToImage(blob).then(function(image) {
1192
+ var canvas = Canvas.create(ImageSize.getWidth(image), ImageSize.getHeight(image)),
1193
+ context = Canvas.get2dContext(canvas),
1194
+ pixels;
1195
+
1196
+ function applyMatrix(pixels, m) {
1197
+ var d = pixels.data, r, g, b, a, i,
1198
+ m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], m4 = m[4],
1199
+ m5 = m[5], m6 = m[6], m7 = m[7], m8 = m[8], m9 = m[9],
1200
+ m10 = m[10], m11 = m[11], m12 = m[12], m13 = m[13], m14 = m[14],
1201
+ m15 = m[15], m16 = m[16], m17 = m[17], m18 = m[18], m19 = m[19];
1202
+
1203
+ for (i = 0; i < d.length; i += 4) {
1204
+ r = d[i];
1205
+ g = d[i + 1];
1206
+ b = d[i + 2];
1207
+ a = d[i + 3];
1208
+
1209
+ d[i] = r * m0 + g * m1 + b * m2 + a * m3 + m4;
1210
+ d[i + 1] = r * m5 + g * m6 + b * m7 + a * m8 + m9;
1211
+ d[i + 2] = r * m10 + g * m11 + b * m12 + a * m13 + m14;
1212
+ d[i + 3] = r * m15 + g * m16 + b * m17 + a * m18 + m19;
1213
+ }
1214
+
1215
+ return pixels;
1216
+ }
1217
+
1218
+ context.drawImage(image, 0, 0);
1219
+ revokeImageUrl(image);
1220
+ pixels = applyMatrix(context.getImageData(0, 0, canvas.width, canvas.height), matrix);
1221
+ context.putImageData(pixels, 0, 0);
1222
+
1223
+ return Conversions.canvasToBlob(canvas);
1224
+ });
1225
+ }
1226
+
1227
+ function convoluteFilter(blob, matrix) {
1228
+ return Conversions.blobToImage(blob).then(function(image) {
1229
+ var canvas = Canvas.create(ImageSize.getWidth(image), ImageSize.getHeight(image)),
1230
+ context = Canvas.get2dContext(canvas),
1231
+ pixelsIn, pixelsOut;
1232
+
1233
+ function applyMatrix(pixelsIn, pixelsOut, matrix) {
1234
+ var rgba, drgba, side, halfSide, x, y, r, g, b,
1235
+ cx, cy, scx, scy, offset, wt, w, h;
1236
+
1237
+ function clamp(value, min, max) {
1238
+ if (value > max) {
1239
+ value = max;
1240
+ } else if (value < min) {
1241
+ value = min;
1242
+ }
1243
+
1244
+ return value;
1245
+ }
1246
+
1247
+ // Calc side and half side of matrix
1248
+ side = Math.round(Math.sqrt(matrix.length));
1249
+ halfSide = Math.floor(side / 2);
1250
+ rgba = pixelsIn.data;
1251
+ drgba = pixelsOut.data;
1252
+ w = pixelsIn.width;
1253
+ h = pixelsIn.height;
1254
+
1255
+ // Apply convolution matrix to pixels
1256
+ for (y = 0; y < h; y++) {
1257
+ for (x = 0; x < w; x++) {
1258
+ r = g = b = 0;
1259
+
1260
+ for (cy = 0; cy < side; cy++) {
1261
+ for (cx = 0; cx < side; cx++) {
1262
+ // Calc relative x, y based on matrix
1263
+ scx = clamp(x + cx - halfSide, 0, w - 1);
1264
+ scy = clamp(y + cy - halfSide, 0, h - 1);
1265
+
1266
+ // Calc r, g, b
1267
+ offset = (scy * w + scx) * 4;
1268
+ wt = matrix[cy * side + cx];
1269
+ r += rgba[offset] * wt;
1270
+ g += rgba[offset + 1] * wt;
1271
+ b += rgba[offset + 2] * wt;
1272
+ }
1273
+ }
1274
+
1275
+ // Set new RGB to destination buffer
1276
+ offset = (y * w + x) * 4;
1277
+ drgba[offset] = clamp(r, 0, 255);
1278
+ drgba[offset + 1] = clamp(g, 0, 255);
1279
+ drgba[offset + 2] = clamp(b, 0, 255);
1280
+ }
1281
+ }
1282
+
1283
+ return pixelsOut;
1284
+ }
1285
+
1286
+ context.drawImage(image, 0, 0);
1287
+ revokeImageUrl(image);
1288
+ pixelsIn = context.getImageData(0, 0, canvas.width, canvas.height);
1289
+ pixelsOut = context.getImageData(0, 0, canvas.width, canvas.height);
1290
+ pixelsOut = applyMatrix(pixelsIn, pixelsOut, matrix);
1291
+ context.putImageData(pixelsOut, 0, 0);
1292
+
1293
+ return Conversions.canvasToBlob(canvas);
1294
+ });
1295
+ }
1296
+
1297
+ function functionColorFilter(colorFn) {
1298
+ return function(blob, value) {
1299
+ return Conversions.blobToImage(blob).then(function(image) {
1300
+ var canvas = Canvas.create(ImageSize.getWidth(image), ImageSize.getHeight(image)),
1301
+ context = Canvas.get2dContext(canvas),
1302
+ pixels, i, lookup = new Array(256);
1303
+
1304
+ function applyLookup(pixels, lookup) {
1305
+ var d = pixels.data, i;
1306
+
1307
+ for (i = 0; i < d.length; i += 4) {
1308
+ d[i] = lookup[d[i]];
1309
+ d[i + 1] = lookup[d[i + 1]];
1310
+ d[i + 2] = lookup[d[i + 2]];
1311
+ }
1312
+
1313
+ return pixels;
1314
+ }
1315
+
1316
+ for (i = 0; i < lookup.length; i++) {
1317
+ lookup[i] = colorFn(i, value);
1318
+ }
1319
+
1320
+ context.drawImage(image, 0, 0);
1321
+ revokeImageUrl(image);
1322
+ pixels = applyLookup(context.getImageData(0, 0, canvas.width, canvas.height), lookup);
1323
+ context.putImageData(pixels, 0, 0);
1324
+
1325
+ return Conversions.canvasToBlob(canvas);
1326
+ });
1327
+ };
1328
+ }
1329
+
1330
+ function complexAdjustableColorFilter(matrixAdjustFn) {
1331
+ return function(blob, adjust) {
1332
+ return colorFilter(blob, matrixAdjustFn(ColorMatrix.identity(), adjust));
1333
+ };
1334
+ }
1335
+
1336
+ function basicColorFilter(matrix) {
1337
+ return function(blob) {
1338
+ return colorFilter(blob, matrix);
1339
+ };
1340
+ }
1341
+
1342
+ function basicConvolutionFilter(kernel) {
1343
+ return function(blob) {
1344
+ return convoluteFilter(blob, kernel);
1345
+ };
1346
+ }
1347
+
1348
+ return {
1349
+ invert: basicColorFilter([
1350
+ -1, 0, 0, 0, 255,
1351
+ 0, -1, 0, 0, 255,
1352
+ 0, 0, -1, 0, 255,
1353
+ 0, 0, 0, 1, 0
1354
+ ]),
1355
+
1356
+ brightness: complexAdjustableColorFilter(ColorMatrix.adjustBrightness),
1357
+ hue: complexAdjustableColorFilter(ColorMatrix.adjustHue),
1358
+ saturate: complexAdjustableColorFilter(ColorMatrix.adjustSaturation),
1359
+ contrast: complexAdjustableColorFilter(ColorMatrix.adjustContrast),
1360
+ grayscale: complexAdjustableColorFilter(ColorMatrix.adjustGrayscale),
1361
+ sepia: complexAdjustableColorFilter(ColorMatrix.adjustSepia),
1362
+ colorize: function(blob, adjustR, adjustG, adjustB) {
1363
+ return colorFilter(blob, ColorMatrix.adjustColors(ColorMatrix.identity(), adjustR, adjustG, adjustB));
1364
+ },
1365
+
1366
+ sharpen: basicConvolutionFilter([
1367
+ 0, -1, 0,
1368
+ -1, 5, -1,
1369
+ 0, -1, 0
1370
+ ]),
1371
+
1372
+ emboss: basicConvolutionFilter([
1373
+ -2, -1, 0,
1374
+ -1, 1, 1,
1375
+ 0, 1, 2
1376
+ ]),
1377
+
1378
+ gamma: functionColorFilter(function(color, value) {
1379
+ return Math.pow(color / 255, 1 - value) * 255;
1380
+ }),
1381
+
1382
+ exposure: functionColorFilter(function(color, value) {
1383
+ return 255 * (1 - Math.exp(-(color / 255) * value));
1384
+ }),
1385
+
1386
+ colorFilter: colorFilter,
1387
+ convoluteFilter: convoluteFilter
1388
+ };
1389
+ });
1390
+
1391
+ // Included from: js/tinymce/plugins/imagetools/classes/UndoStack.js
1392
+
1393
+ /**
1394
+ * UndoStack.js
1395
+ *
1396
+ * Released under LGPL License.
1397
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
1398
+ *
1399
+ * License: http://www.tinymce.com/license
1400
+ * Contributing: http://www.tinymce.com/contributing
1401
+ */
1402
+
1403
+ define("tinymce/imagetoolsplugin/UndoStack", [
1404
+ ], function() {
1405
+ return function() {
1406
+ var data = [], index = -1;
1407
+
1408
+ function add(state) {
1409
+ var removed;
1410
+
1411
+ removed = data.splice(++index);
1412
+ data.push(state);
1413
+
1414
+ return {
1415
+ state: state,
1416
+ removed: removed
1417
+ };
1418
+ }
1419
+
1420
+ function undo() {
1421
+ if (canUndo()) {
1422
+ return data[--index];
1423
+ }
1424
+ }
1425
+
1426
+ function redo() {
1427
+ if (canRedo()) {
1428
+ return data[++index];
1429
+ }
1430
+ }
1431
+
1432
+ function canUndo() {
1433
+ return index > 0;
1434
+ }
1435
+
1436
+ function canRedo() {
1437
+ return index != -1 && index < data.length - 1;
1438
+ }
1439
+
1440
+ return {
1441
+ data: data,
1442
+ add: add,
1443
+ undo: undo,
1444
+ redo: redo,
1445
+ canUndo: canUndo,
1446
+ canRedo: canRedo
1447
+ };
1448
+ };
1449
+ });
1450
+
1451
+ // Included from: js/tinymce/plugins/imagetools/classes/Dialog.js
1452
+
1453
+ /**
1454
+ * Dialog.js
1455
+ *
1456
+ * Released under LGPL License.
1457
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
1458
+ *
1459
+ * License: http://www.tinymce.com/license
1460
+ * Contributing: http://www.tinymce.com/contributing
1461
+ */
1462
+
1463
+ /**
1464
+ * ...
1465
+ */
1466
+ define("tinymce/imagetoolsplugin/Dialog", [
1467
+ "tinymce/dom/DOMUtils",
1468
+ "tinymce/util/Tools",
1469
+ "tinymce/util/Promise",
1470
+ "tinymce/ui/Factory",
1471
+ "tinymce/ui/Form",
1472
+ "tinymce/ui/Container",
1473
+ "tinymce/imagetoolsplugin/ImagePanel",
1474
+ "tinymce/imagetoolsplugin/ImageTools",
1475
+ "tinymce/imagetoolsplugin/Filters",
1476
+ "tinymce/imagetoolsplugin/Conversions",
1477
+ "tinymce/imagetoolsplugin/UndoStack"
1478
+ ], function(DOMUtils, Tools, Promise, Factory, Form, Container, ImagePanel, ImageTools, Filters, Conversions, UndoStack) {
1479
+ function createState(blob) {
1480
+ return {
1481
+ blob: blob,
1482
+ url: URL.createObjectURL(blob)
1483
+ };
1484
+ }
1485
+
1486
+ function destroyState(state) {
1487
+ if (state) {
1488
+ URL.revokeObjectURL(state.url);
1489
+ }
1490
+ }
1491
+
1492
+ function destroyStates(states) {
1493
+ Tools.each(states, destroyState);
1494
+ }
1495
+
1496
+ function open(currentState, resolve, reject) {
1497
+ var win, undoStack = new UndoStack(), mainPanel, filtersPanel, tempState,
1498
+ cropPanel, resizePanel, flipRotatePanel, imagePanel, sidePanel, mainViewContainer,
1499
+ invertPanel, brightnessPanel, huePanel, saturatePanel, contrastPanel, grayscalePanel,
1500
+ sepiaPanel, colorizePanel, sharpenPanel, embossPanel, gammaPanel, exposurePanel, panels,
1501
+ width, height, ratioW, ratioH;
1502
+
1503
+ function recalcSize(e) {
1504
+ var widthCtrl, heightCtrl, newWidth, newHeight;
1505
+
1506
+ widthCtrl = win.find('#w')[0];
1507
+ heightCtrl = win.find('#h')[0];
1508
+
1509
+ newWidth = parseInt(widthCtrl.value(), 10);
1510
+ newHeight = parseInt(heightCtrl.value(), 10);
1511
+
1512
+ if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) {
1513
+ if (e.control.settings.name == 'w') {
1514
+ newHeight = Math.round(newWidth * ratioW);
1515
+ heightCtrl.value(newHeight);
1516
+ } else {
1517
+ newWidth = Math.round(newHeight * ratioH);
1518
+ widthCtrl.value(newWidth);
1519
+ }
1520
+ }
1521
+
1522
+ width = newWidth;
1523
+ height = newHeight;
1524
+ }
1525
+
1526
+ function floatToPercent(value) {
1527
+ return Math.round(value * 100) + '%';
1528
+ }
1529
+
1530
+ function updateButtonUndoStates() {
1531
+ win.find('#undo').disabled(!undoStack.canUndo());
1532
+ win.find('#redo').disabled(!undoStack.canRedo());
1533
+ win.statusbar.find('#save').disabled(!undoStack.canUndo());
1534
+ }
1535
+
1536
+ function disableUndoRedo() {
1537
+ win.find('#undo').disabled(true);
1538
+ win.find('#redo').disabled(true);
1539
+ }
1540
+
1541
+ function displayState(state) {
1542
+ if (state) {
1543
+ imagePanel.imageSrc(state.url);
1544
+ }
1545
+ }
1546
+
1547
+ function switchPanel(targetPanel) {
1548
+ return function() {
1549
+ var hidePanels = Tools.grep(panels, function(panel) {
1550
+ return panel.settings.name != targetPanel;
1551
+ });
1552
+
1553
+ Tools.each(hidePanels, function(panel) {
1554
+ panel.hide();
1555
+ });
1556
+
1557
+ targetPanel.show();
1558
+ };
1559
+ }
1560
+
1561
+ function addTempState(blob) {
1562
+ tempState = createState(blob);
1563
+ displayState(tempState);
1564
+ }
1565
+
1566
+ function addBlobState(blob) {
1567
+ currentState = createState(blob);
1568
+ displayState(currentState);
1569
+ destroyStates(undoStack.add(currentState).removed);
1570
+ updateButtonUndoStates();
1571
+ }
1572
+
1573
+ function crop() {
1574
+ var rect = imagePanel.selection();
1575
+
1576
+ ImageTools.crop(currentState.blob, rect.x, rect.y, rect.w, rect.h).then(function(blob) {
1577
+ addBlobState(blob);
1578
+ cancel();
1579
+ });
1580
+ }
1581
+
1582
+ function tempAction(fn) {
1583
+ var args = [].slice.call(arguments, 1);
1584
+
1585
+ return function() {
1586
+ var state = tempState || currentState;
1587
+
1588
+ fn.apply(this, [state.blob].concat(args)).then(addTempState);
1589
+ };
1590
+ }
1591
+
1592
+ function action(fn) {
1593
+ var args = [].slice.call(arguments, 1);
1594
+
1595
+ return function() {
1596
+ fn.apply(this, [currentState.blob].concat(args)).then(addBlobState);
1597
+ };
1598
+ }
1599
+
1600
+ function cancel() {
1601
+ displayState(currentState);
1602
+ destroyState(tempState);
1603
+ switchPanel(mainPanel)();
1604
+ updateButtonUndoStates();
1605
+ }
1606
+
1607
+ function applyTempState() {
1608
+ if (tempState) {
1609
+ addBlobState(tempState.blob);
1610
+ cancel();
1611
+ }
1612
+ }
1613
+
1614
+ function zoomIn() {
1615
+ var zoom = imagePanel.zoom();
1616
+
1617
+ if (zoom < 2) {
1618
+ zoom += 0.1;
1619
+ }
1620
+
1621
+ imagePanel.zoom(zoom);
1622
+ }
1623
+
1624
+ function zoomOut() {
1625
+ var zoom = imagePanel.zoom();
1626
+
1627
+ if (zoom > 0.1) {
1628
+ zoom -= 0.1;
1629
+ }
1630
+
1631
+ imagePanel.zoom(zoom);
1632
+ }
1633
+
1634
+ function undo() {
1635
+ currentState = undoStack.undo();
1636
+ displayState(currentState);
1637
+ updateButtonUndoStates();
1638
+ }
1639
+
1640
+ function redo() {
1641
+ currentState = undoStack.redo();
1642
+ displayState(currentState);
1643
+ updateButtonUndoStates();
1644
+ }
1645
+
1646
+ function save() {
1647
+ resolve(currentState.blob);
1648
+ win.close();
1649
+ }
1650
+
1651
+ function createPanel(items) {
1652
+ return new Form({
1653
+ layout: 'flex',
1654
+ direction: 'row',
1655
+ labelGap: 5,
1656
+ border: '0 0 1 0',
1657
+ align: 'center',
1658
+ pack: 'center',
1659
+ padding: '0 10 0 10',
1660
+ spacing: 5,
1661
+ flex: 0,
1662
+ minHeight: 60,
1663
+ defaults: {
1664
+ classes: 'imagetool',
1665
+ type: 'button'
1666
+ },
1667
+ items: items
1668
+ });
1669
+ }
1670
+
1671
+ function createFilterPanel(title, filter) {
1672
+ return createPanel([
1673
+ {text: 'Back', onclick: cancel},
1674
+ {type: 'spacer', flex: 1},
1675
+ {text: 'Apply', subtype: 'primary', onclick: applyTempState}
1676
+ ]).hide().on('show', function() {
1677
+ disableUndoRedo();
1678
+
1679
+ filter(currentState.blob).then(function(blob) {
1680
+ var newTempState = createState(blob);
1681
+
1682
+ displayState(newTempState);
1683
+ destroyState(tempState);
1684
+ tempState = newTempState;
1685
+ });
1686
+ });
1687
+ }
1688
+
1689
+ function createVariableFilterPanel(title, filter, value, min, max) {
1690
+ function update(value) {
1691
+ filter(currentState.blob, value).then(function(blob) {
1692
+ var newTempState = createState(blob);
1693
+ displayState(newTempState);
1694
+ destroyState(tempState);
1695
+ tempState = newTempState;
1696
+ });
1697
+ }
1698
+
1699
+ return createPanel([
1700
+ {text: 'Back', onclick: cancel},
1701
+ {type: 'spacer', flex: 1},
1702
+ {
1703
+ type: 'slider',
1704
+ flex: 1,
1705
+ ondragend: function(e) {
1706
+ update(e.value);
1707
+ },
1708
+ minValue: min,
1709
+ maxValue: max,
1710
+ value: value,
1711
+ previewFilter: floatToPercent
1712
+ },
1713
+ {type: 'spacer', flex: 1},
1714
+ {text: 'Apply', subtype: 'primary', onclick: applyTempState}
1715
+ ]).hide().on('show', function() {
1716
+ this.find('slider').value(value);
1717
+ disableUndoRedo();
1718
+ });
1719
+ }
1720
+
1721
+ function createRgbFilterPanel(title, filter) {
1722
+ function update() {
1723
+ var r, g, b;
1724
+
1725
+ r = win.find('#r')[0].value();
1726
+ g = win.find('#g')[0].value();
1727
+ b = win.find('#b')[0].value();
1728
+
1729
+ filter(currentState.blob, r, g, b).then(function(blob) {
1730
+ var newTempState = createState(blob);
1731
+ displayState(newTempState);
1732
+ destroyState(tempState);
1733
+ tempState = newTempState;
1734
+ });
1735
+ }
1736
+
1737
+ return createPanel([
1738
+ {text: 'Back', onclick: cancel},
1739
+ {type: 'spacer', flex: 1},
1740
+ {
1741
+ type: 'slider', label: 'R', name: 'r', minValue: 0,
1742
+ value: 1, maxValue: 2, ondragend: update, previewFilter: floatToPercent
1743
+ },
1744
+ {
1745
+ type: 'slider', label: 'G', name: 'g', minValue: 0,
1746
+ value: 1, maxValue: 2, ondragend: update, previewFilter: floatToPercent
1747
+ },
1748
+ {
1749
+ type: 'slider', label: 'B', name: 'b', minValue: 0,
1750
+ value: 1, maxValue: 2, ondragend: update, previewFilter: floatToPercent
1751
+ },
1752
+ {type: 'spacer', flex: 1},
1753
+ {text: 'Apply', subtype: 'primary', onclick: applyTempState}
1754
+ ]).hide().on('show', function() {
1755
+ win.find('#r,#g,#b').value(1);
1756
+ disableUndoRedo();
1757
+ });
1758
+ }
1759
+
1760
+ cropPanel = createPanel([
1761
+ {text: 'Back', onclick: cancel},
1762
+ {type: 'spacer', flex: 1},
1763
+ {text: 'Apply', subtype: 'primary', onclick: crop}
1764
+ ]).hide().on('show hide', function(e) {
1765
+ imagePanel.toggleCropRect(e.type == 'show');
1766
+ }).on('show', disableUndoRedo);
1767
+
1768
+ function toggleConstrain(e) {
1769
+ if (e.control.value() === true) {
1770
+ ratioW = height / width;
1771
+ ratioH = width / height;
1772
+ }
1773
+ }
1774
+
1775
+ resizePanel = createPanel([
1776
+ {text: 'Back', onclick: cancel},
1777
+ {type: 'spacer', flex: 1},
1778
+ {type: 'textbox', name: 'w', label: 'Width', size: 4, onkeyup: recalcSize},
1779
+ {type: 'textbox', name: 'h', label: 'Height', size: 4, onkeyup: recalcSize},
1780
+ {type: 'checkbox', name: 'constrain', text: 'Constrain proportions', checked: true, onchange: toggleConstrain},
1781
+ {type: 'spacer', flex: 1},
1782
+ {text: 'Apply', subtype: 'primary', onclick: 'submit'}
1783
+ ]).hide().on('submit', function(e) {
1784
+ var width = parseInt(win.find('#w').value(), 10),
1785
+ height = parseInt(win.find('#h').value(), 10);
1786
+
1787
+ e.preventDefault();
1788
+
1789
+ action(ImageTools.resize, width, height)();
1790
+ cancel();
1791
+ }).on('show', disableUndoRedo);
1792
+
1793
+ flipRotatePanel = createPanel([
1794
+ {text: 'Back', onclick: cancel},
1795
+ {type: 'spacer', flex: 1},
1796
+ {icon: 'fliph', tooltip: 'Flip horizontally', onclick: tempAction(ImageTools.flip, 'h')},
1797
+ {icon: 'flipv', tooltip: 'Flip vertically', onclick: tempAction(ImageTools.flip, 'v')},
1798
+ {icon: 'rotateleft', tooltip: 'Rotate counterclockwise', onclick: tempAction(ImageTools.rotate, -90)},
1799
+ {icon: 'rotateright', tooltip: 'Rotate clockwise', onclick: tempAction(ImageTools.rotate, 90)},
1800
+ {type: 'spacer', flex: 1},
1801
+ {text: 'Apply', subtype: 'primary', onclick: applyTempState}
1802
+ ]).hide().on('show', disableUndoRedo);
1803
+
1804
+ invertPanel = createFilterPanel("Invert", Filters.invert);
1805
+ sharpenPanel = createFilterPanel("Sharpen", Filters.sharpen);
1806
+ embossPanel = createFilterPanel("Emboss", Filters.emboss);
1807
+
1808
+ brightnessPanel = createVariableFilterPanel("Brightness", Filters.brightness, 0, -1, 1);
1809
+ huePanel = createVariableFilterPanel("Hue", Filters.hue, 180, 0, 360);
1810
+ saturatePanel = createVariableFilterPanel("Saturate", Filters.saturate, 0, -1, 1);
1811
+ contrastPanel = createVariableFilterPanel("Contrast", Filters.contrast, 0, -1, 1);
1812
+ grayscalePanel = createVariableFilterPanel("Grayscale", Filters.grayscale, 0, 0, 1);
1813
+ sepiaPanel = createVariableFilterPanel("Sepia", Filters.sepia, 0, 0, 1);
1814
+ colorizePanel = createRgbFilterPanel("Colorize", Filters.colorize);
1815
+ gammaPanel = createVariableFilterPanel("Gamma", Filters.gamma, 0, -1, 1);
1816
+ exposurePanel = createVariableFilterPanel("Exposure", Filters.exposure, 1, 0, 2);
1817
+
1818
+ filtersPanel = createPanel([
1819
+ {text: 'Back', onclick: cancel},
1820
+ {type: 'spacer', flex: 1},
1821
+ {text: 'hue', icon: 'hue', onclick: switchPanel(huePanel)},
1822
+ {text: 'saturate', icon: 'saturate', onclick: switchPanel(saturatePanel)},
1823
+ {text: 'sepia', icon: 'sepia', onclick: switchPanel(sepiaPanel)},
1824
+ {text: 'emboss', icon: 'emboss', onclick: switchPanel(embossPanel)},
1825
+ {text: 'exposure', icon: 'exposure', onclick: switchPanel(exposurePanel)},
1826
+ {type: 'spacer', flex: 1}
1827
+ ]).hide();
1828
+
1829
+ mainPanel = createPanel([
1830
+ {tooltip: 'Crop', icon: 'crop', onclick: switchPanel(cropPanel)},
1831
+ {tooltip: 'Resize', icon: 'resize2', onclick: switchPanel(resizePanel)},
1832
+ {tooltip: 'Orientation', icon: 'orientation', onclick: switchPanel(flipRotatePanel)},
1833
+ {tooltip: 'Brightness', icon: 'sun', onclick: switchPanel(brightnessPanel)},
1834
+ {tooltip: 'Sharpen', icon: 'sharpen', onclick: switchPanel(sharpenPanel)},
1835
+ {tooltip: 'Contrast', icon: 'contrast', onclick: switchPanel(contrastPanel)},
1836
+ {tooltip: 'Color levels', icon: 'drop', onclick: switchPanel(colorizePanel)},
1837
+ {tooltip: 'Gamma', icon: 'gamma', onclick: switchPanel(gammaPanel)},
1838
+ {tooltip: 'Invert', icon: 'invert', onclick: switchPanel(invertPanel)}
1839
+ //{text: 'More', onclick: switchPanel(filtersPanel)}
1840
+ ]);
1841
+
1842
+ imagePanel = new ImagePanel({
1843
+ flex: 1,
1844
+ imageSrc: currentState.url
1845
+ });
1846
+
1847
+ sidePanel = new Container({
1848
+ layout: 'flex',
1849
+ direction: 'column',
1850
+ border: '0 1 0 0',
1851
+ padding: 5,
1852
+ spacing: 5,
1853
+ items: [
1854
+ {type: 'button', icon: 'undo', tooltip: 'Undo', name: 'undo', onclick: undo},
1855
+ {type: 'button', icon: 'redo', tooltip: 'Redo', name: 'redo', onclick: redo},
1856
+ {type: 'button', icon: 'zoomin', tooltip: 'Zoom in', onclick: zoomIn},
1857
+ {type: 'button', icon: 'zoomout', tooltip: 'Zoom out', onclick: zoomOut}
1858
+ ]
1859
+ });
1860
+
1861
+ mainViewContainer = new Container({
1862
+ type: 'container',
1863
+ layout: 'flex',
1864
+ direction: 'row',
1865
+ align: 'stretch',
1866
+ flex: 1,
1867
+ items: [sidePanel, imagePanel]
1868
+ });
1869
+
1870
+ panels = [
1871
+ mainPanel,
1872
+ cropPanel,
1873
+ resizePanel,
1874
+ flipRotatePanel,
1875
+ filtersPanel,
1876
+ invertPanel,
1877
+ brightnessPanel,
1878
+ huePanel,
1879
+ saturatePanel,
1880
+ contrastPanel,
1881
+ grayscalePanel,
1882
+ sepiaPanel,
1883
+ colorizePanel,
1884
+ sharpenPanel,
1885
+ embossPanel,
1886
+ gammaPanel,
1887
+ exposurePanel
1888
+ ];
1889
+
1890
+ win = Factory.create('window', {
1891
+ layout: 'flex',
1892
+ direction: 'column',
1893
+ align: 'stretch',
1894
+ minWidth: Math.min(DOMUtils.DOM.getViewPort().w, 800),
1895
+ minHeight: Math.min(DOMUtils.DOM.getViewPort().h, 650),
1896
+ title: 'Edit image',
1897
+ items: panels.concat([mainViewContainer]),
1898
+ buttons: [
1899
+ {text: 'Save', name: 'save', subtype: 'primary', onclick: save},
1900
+ {text: 'Cancel', onclick: 'close'}
1901
+ ]
1902
+ });
1903
+
1904
+ win.renderTo(document.body).reflow();
1905
+
1906
+ win.on('close', function() {
1907
+ reject();
1908
+ destroyStates(undoStack.data);
1909
+ undoStack = null;
1910
+ tempState = null;
1911
+ });
1912
+
1913
+ undoStack.add(currentState);
1914
+ updateButtonUndoStates();
1915
+
1916
+ imagePanel.on('load', function() {
1917
+ width = imagePanel.imageSize().w;
1918
+ height = imagePanel.imageSize().h;
1919
+ ratioW = height / width;
1920
+ ratioH = width / height;
1921
+
1922
+ win.find('#w').value(width);
1923
+ win.find('#h').value(height);
1924
+ });
1925
+ }
1926
+
1927
+ function edit(blob) {
1928
+ return new Promise(function(resolve, reject) {
1929
+ open(createState(blob), resolve, reject);
1930
+ });
1931
+ }
1932
+
1933
+ //edit('img/dogleft.jpg');
1934
+
1935
+ return {
1936
+ edit: edit
1937
+ };
1938
+ });
1939
+
1940
+ // Included from: js/tinymce/plugins/imagetools/classes/Plugin.js
1941
+
1942
+ /**
1943
+ * Plugin.js
1944
+ *
1945
+ * Released under LGPL License.
1946
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
1947
+ *
1948
+ * License: http://www.tinymce.com/license
1949
+ * Contributing: http://www.tinymce.com/contributing
1950
+ */
1951
+
1952
+ /**
1953
+ *
1954
+ * Settings:
1955
+ * imagetools_cors_hosts - Array of remote domains that has CORS setup.
1956
+ * imagetools_proxy - Url to proxy that streams images from remote host to local host.
1957
+ * imagetools_toolbar - Toolbar items to render when an editable image is selected.
1958
+ */
1959
+ define("tinymce/imagetoolsplugin/Plugin", [
1960
+ "tinymce/PluginManager",
1961
+ "tinymce/Env",
1962
+ "tinymce/util/Promise",
1963
+ "tinymce/util/URI",
1964
+ "tinymce/util/Tools",
1965
+ "tinymce/imagetoolsplugin/ImageTools",
1966
+ "tinymce/imagetoolsplugin/Conversions",
1967
+ "tinymce/imagetoolsplugin/Dialog"
1968
+ ], function(PluginManager, Env, Promise, URI, Tools, ImageTools, Conversions, Dialog) {
1969
+ PluginManager.add('imagetools', function(editor) {
1970
+ var count = 0, imageUploadTimer, lastSelectedImage;
1971
+
1972
+ if (!Env.fileApi) {
1973
+ return;
1974
+ }
1975
+
1976
+ /*
1977
+ function startCrop() {
1978
+ var imageRect, viewPortRect;
1979
+
1980
+ imageRect = getSelectedImage().getBoundingClientRect();
1981
+
1982
+ imageRect = {
1983
+ x: imageRect.left,
1984
+ y: imageRect.top,
1985
+ w: imageRect.width,
1986
+ h: imageRect.height
1987
+ };
1988
+
1989
+ viewPortRect = {
1990
+ x: 0,
1991
+ y: 0,
1992
+ w: editor.getBody().scrollWidth,
1993
+ h: editor.getBody().scrollHeight
1994
+ };
1995
+
1996
+ cropRect = new CropRect(imageRect, viewPortRect, imageRect, editor.getBody());
1997
+ cropRect.toggleVisibility(true);
1998
+
1999
+ editor.selection.getSel().removeAllRanges();
2000
+ editor.nodeChanged();
2001
+ }
2002
+
2003
+ function stopCrop() {
2004
+ if (cropRect) {
2005
+ cropRect.destroy();
2006
+ cropRect = null;
2007
+ }
2008
+ }
2009
+ */
2010
+
2011
+ function getImageSize(img) {
2012
+ var width, height;
2013
+
2014
+ function isPxValue(value) {
2015
+ return value.indexOf('px') == value.length - 2;
2016
+ }
2017
+
2018
+ width = img.style.width;
2019
+ height = img.style.height;
2020
+ if (width || height) {
2021
+ if (isPxValue(width) && isPxValue(height)) {
2022
+ return {
2023
+ w: parseInt(width, 10),
2024
+ h: parseInt(height, 10)
2025
+ };
2026
+ }
2027
+
2028
+ return null;
2029
+ }
2030
+
2031
+ width = editor.$(img).attr('width');
2032
+ height = editor.$(img).attr('height');
2033
+ if (width && height) {
2034
+ return {
2035
+ w: parseInt(width, 10),
2036
+ h: parseInt(height, 10)
2037
+ };
2038
+ }
2039
+
2040
+ return null;
2041
+ }
2042
+
2043
+ function setImageSize(img, size) {
2044
+ var width, height;
2045
+
2046
+ if (size) {
2047
+ width = img.style.width;
2048
+ height = img.style.height;
2049
+
2050
+ if (width || height) {
2051
+ editor.$(img).css({
2052
+ width: size.w,
2053
+ height: size.h
2054
+ }).removeAttr('data-mce-style');
2055
+ }
2056
+
2057
+ width = img.width;
2058
+ height = img.height;
2059
+
2060
+ if (width || height) {
2061
+ editor.$(img).attr({
2062
+ width: size.w,
2063
+ height: size.h
2064
+ });
2065
+ }
2066
+ }
2067
+ }
2068
+
2069
+ function getNaturalImageSize(img) {
2070
+ return {
2071
+ w: img.naturalWidth,
2072
+ h: img.naturalHeight
2073
+ };
2074
+ }
2075
+
2076
+ function getSelectedImage() {
2077
+ return editor.selection.getNode();
2078
+ }
2079
+
2080
+ function createId() {
2081
+ return 'imagetools' + count++;
2082
+ }
2083
+
2084
+ function isLocalImage(img) {
2085
+ var url = img.src;
2086
+
2087
+ return url.indexOf('data:') === 0 || url.indexOf('blob:') === 0 || new URI(url).host === editor.documentBaseURI.host;
2088
+ }
2089
+
2090
+ function isCorsImage(img) {
2091
+ return Tools.inArray(editor.settings.imagetools_cors_hosts, new URI(img.src).host) !== -1;
2092
+ }
2093
+
2094
+ function requestUrlAsBlob(url) {
2095
+ // Needs to be XHR for IE 10 compatibility
2096
+ return new Promise(function(resolve) {
2097
+ var xhr = new XMLHttpRequest();
2098
+
2099
+ xhr.onload = function() {
2100
+ resolve(this.response);
2101
+ };
2102
+
2103
+ xhr.open('GET', url, true);
2104
+ xhr.responseType = 'blob';
2105
+ xhr.send();
2106
+ });
2107
+ }
2108
+
2109
+ function imageToBlob(img) {
2110
+ var src = img.src;
2111
+
2112
+ if (isCorsImage(img)) {
2113
+ return requestUrlAsBlob(img.src);
2114
+ }
2115
+
2116
+ if (!isLocalImage(img)) {
2117
+ src = editor.settings.imagetools_proxy;
2118
+ src += (src.indexOf('?') === -1 ? '?' : '&') + 'url=' + encodeURIComponent(img.src);
2119
+ img = new Image();
2120
+ img.src = src;
2121
+ }
2122
+
2123
+ return Conversions.imageToBlob(img);
2124
+ }
2125
+
2126
+ function findSelectedBlobInfo() {
2127
+ var blobInfo;
2128
+
2129
+ blobInfo = editor.editorUpload.blobCache.getByUri(getSelectedImage().src);
2130
+ if (blobInfo) {
2131
+ return blobInfo;
2132
+ }
2133
+
2134
+ return imageToBlob(getSelectedImage()).then(function(blob) {
2135
+ return Conversions.blobToBase64(blob).then(function(base64) {
2136
+ var blobCache = editor.editorUpload.blobCache;
2137
+ var blobInfo = blobCache.create(createId(), blob, base64);
2138
+ blobCache.add(blobInfo);
2139
+ return blobInfo;
2140
+ });
2141
+ });
2142
+ }
2143
+
2144
+ function startTimedUpload() {
2145
+ imageUploadTimer = setTimeout(function() {
2146
+ editor.editorUpload.uploadImagesAuto();
2147
+ }, 30000);
2148
+ }
2149
+
2150
+ function cancelTimedUpload() {
2151
+ clearTimeout(imageUploadTimer);
2152
+ }
2153
+
2154
+ function updateSelectedImage(blob, uploadImmediately) {
2155
+ return Conversions.blobToDataUri(blob).then(function(dataUri) {
2156
+ var id, base64, blobCache, blobInfo, selectedImage;
2157
+
2158
+ selectedImage = getSelectedImage();
2159
+ id = createId();
2160
+ blobCache = editor.editorUpload.blobCache;
2161
+ base64 = URI.parseDataUri(dataUri).data;
2162
+
2163
+ blobInfo = blobCache.create(id, blob, base64);
2164
+ blobCache.add(blobInfo);
2165
+
2166
+ editor.undoManager.transact(function() {
2167
+ function imageLoadedHandler() {
2168
+ editor.$(selectedImage).off('load', imageLoadedHandler);
2169
+ editor.nodeChanged();
2170
+
2171
+ if (uploadImmediately) {
2172
+ editor.editorUpload.uploadImagesAuto();
2173
+ } else {
2174
+ cancelTimedUpload();
2175
+ startTimedUpload();
2176
+ }
2177
+ }
2178
+
2179
+ editor.$(selectedImage).on('load', imageLoadedHandler);
2180
+
2181
+ editor.$(selectedImage).attr({
2182
+ src: blobInfo.blobUri()
2183
+ }).removeAttr('data-mce-src');
2184
+ });
2185
+
2186
+ return blobInfo;
2187
+ });
2188
+ }
2189
+
2190
+ function selectedImageOperation(fn) {
2191
+ return function() {
2192
+ return editor._scanForImages().then(findSelectedBlobInfo).then(fn).then(updateSelectedImage);
2193
+ };
2194
+ }
2195
+
2196
+ function rotate(angle) {
2197
+ return function() {
2198
+ return selectedImageOperation(function(blobInfo) {
2199
+ var size = getImageSize(getSelectedImage());
2200
+
2201
+ if (size) {
2202
+ setImageSize(getSelectedImage(), {
2203
+ w: size.h,
2204
+ h: size.w
2205
+ });
2206
+ }
2207
+
2208
+ return ImageTools.rotate(blobInfo.blob(), angle);
2209
+ })();
2210
+ };
2211
+ }
2212
+
2213
+ function flip(axis) {
2214
+ return function() {
2215
+ return selectedImageOperation(function(blobInfo) {
2216
+ return ImageTools.flip(blobInfo.blob(), axis);
2217
+ })();
2218
+ };
2219
+ }
2220
+
2221
+ function editImageDialog() {
2222
+ var img = getSelectedImage(), originalSize = getNaturalImageSize(img);
2223
+
2224
+ if (img) {
2225
+ imageToBlob(img).then(Dialog.edit).then(function(blob) {
2226
+ return new Promise(function(resolve) {
2227
+ Conversions.blobToImage(blob).then(function(newImage) {
2228
+ var newSize = getNaturalImageSize(newImage);
2229
+
2230
+ if (originalSize.w != newSize.w || originalSize.h != newSize.h) {
2231
+ if (getImageSize(img)) {
2232
+ setImageSize(img, newSize);
2233
+ }
2234
+ }
2235
+
2236
+ URL.revokeObjectURL(newImage.src);
2237
+ resolve(blob);
2238
+ });
2239
+ });
2240
+ }).then(function(blob) {
2241
+ updateSelectedImage(blob, true);
2242
+ }, function() {
2243
+ // Close dialog
2244
+ });
2245
+ }
2246
+ }
2247
+
2248
+ function addButtons() {
2249
+ editor.addButton('rotateleft', {
2250
+ title: 'Rotate counterclockwise',
2251
+ onclick: rotate(-90)
2252
+ });
2253
+
2254
+ editor.addButton('rotateright', {
2255
+ title: 'Rotate clockwise',
2256
+ onclick: rotate(90)
2257
+ });
2258
+
2259
+ editor.addButton('flipv', {
2260
+ title: 'Flip vertically',
2261
+ onclick: flip('v')
2262
+ });
2263
+
2264
+ editor.addButton('fliph', {
2265
+ title: 'Flip horizontally',
2266
+ onclick: flip('h')
2267
+ });
2268
+
2269
+ editor.addButton('editimage', {
2270
+ title: 'Edit image',
2271
+ onclick: editImageDialog
2272
+ });
2273
+
2274
+ editor.addButton('imageoptions', {
2275
+ title: 'Image options',
2276
+ icon: 'options',
2277
+ cmd: 'mceImage'
2278
+ });
2279
+
2280
+ /*
2281
+ editor.addButton('crop', {
2282
+ title: 'Crop',
2283
+ onclick: startCrop
2284
+ });
2285
+ */
2286
+ }
2287
+
2288
+ function addEvents() {
2289
+ editor.on('NodeChange', function(e) {
2290
+ //If the last node we selected was an image
2291
+ //And had a source that doesn't match the current blob url
2292
+ //We need to attempt to upload it
2293
+ if (lastSelectedImage && lastSelectedImage.src != e.element.src) {
2294
+ cancelTimedUpload();
2295
+ editor.editorUpload.uploadImagesAuto();
2296
+ lastSelectedImage = undefined;
2297
+ }
2298
+
2299
+ //Set up the lastSelectedImage
2300
+ if (isEditableImage(e.element)) {
2301
+ lastSelectedImage = e.element;
2302
+ }
2303
+ });
2304
+ }
2305
+
2306
+ function isEditableImage(img) {
2307
+ var selectorMatched = editor.dom.is(img, 'img:not([data-mce-object],[data-mce-placeholder])');
2308
+
2309
+ return selectorMatched && (isLocalImage(img) || isCorsImage(img) || editor.settings.imagetools_proxy);
2310
+ }
2311
+
2312
+ function addToolbars() {
2313
+ var toolbarItems = editor.settings.imagetools_toolbar;
2314
+
2315
+ if (!toolbarItems) {
2316
+ toolbarItems = 'rotateleft rotateright | flipv fliph | crop editimage imageoptions';
2317
+ }
2318
+
2319
+ editor.addContextToolbar(
2320
+ isEditableImage,
2321
+ toolbarItems
2322
+ );
2323
+ }
2324
+
2325
+ addButtons();
2326
+ addToolbars();
2327
+ addEvents();
2328
+
2329
+ editor.addCommand('mceEditImage', editImageDialog);
2330
+ });
2331
+ });
2332
+
2333
+ expose(["tinymce/imagetoolsplugin/Canvas","tinymce/imagetoolsplugin/Mime","tinymce/imagetoolsplugin/ImageSize","tinymce/imagetoolsplugin/Conversions","tinymce/imagetoolsplugin/ImageTools","tinymce/imagetoolsplugin/CropRect","tinymce/imagetoolsplugin/ImagePanel","tinymce/imagetoolsplugin/ColorMatrix","tinymce/imagetoolsplugin/Filters","tinymce/imagetoolsplugin/UndoStack","tinymce/imagetoolsplugin/Dialog","tinymce/imagetoolsplugin/Plugin"]);
2334
+ })(this);