gnuside-aloha-rails 0.23.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (826) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +18 -0
  3. data/README.md +48 -0
  4. data/Rakefile +69 -0
  5. data/app/assets/javascripts/aloha.js +3 -0
  6. data/app/assets/javascripts/aloha/preinit.js.erb +1 -0
  7. data/lib/aloha-rails.rb +1 -0
  8. data/lib/aloha/rails.rb +2 -0
  9. data/lib/aloha/rails/engine.rb +9 -0
  10. data/lib/aloha/rails/version.rb +7 -0
  11. data/lib/tasks/aloha-assets.rake +9 -0
  12. data/vendor/assets/javascripts/aloha/css/aloha.scss +31 -0
  13. data/vendor/assets/javascripts/aloha/img/arrow-down.png +0 -0
  14. data/vendor/assets/javascripts/aloha/img/arrow-left.png +0 -0
  15. data/vendor/assets/javascripts/aloha/img/arrow.png +0 -0
  16. data/vendor/assets/javascripts/aloha/img/base-multi.png +0 -0
  17. data/vendor/assets/javascripts/aloha/img/base.png +0 -0
  18. data/vendor/assets/javascripts/aloha/img/bg.png +0 -0
  19. data/vendor/assets/javascripts/aloha/img/breadcrumb-divider.png +0 -0
  20. data/vendor/assets/javascripts/aloha/img/gentics-logo.png +0 -0
  21. data/vendor/assets/javascripts/aloha/img/grabhandle.png +0 -0
  22. data/vendor/assets/javascripts/aloha/img/maximize.png +0 -0
  23. data/vendor/assets/javascripts/aloha/img/multisplit-base.jpg +0 -0
  24. data/vendor/assets/javascripts/aloha/img/multisplit-close.gif +0 -0
  25. data/vendor/assets/javascripts/aloha/img/multisplit-open.gif +0 -0
  26. data/vendor/assets/javascripts/aloha/img/pin.png +0 -0
  27. data/vendor/assets/javascripts/aloha/img/removeformat.png +0 -0
  28. data/vendor/assets/javascripts/aloha/img/text_indent.png +0 -0
  29. data/vendor/assets/javascripts/aloha/img/text_indent_remove.png +0 -0
  30. data/vendor/assets/javascripts/aloha/lib/aloha-jquery-noconflict.js +14 -0
  31. data/vendor/assets/javascripts/aloha/lib/aloha.js +595 -0
  32. data/vendor/assets/javascripts/aloha/lib/aloha/block-jump.js +153 -0
  33. data/vendor/assets/javascripts/aloha/lib/aloha/command.js +287 -0
  34. data/vendor/assets/javascripts/aloha/lib/aloha/console.js +347 -0
  35. data/vendor/assets/javascripts/aloha/lib/aloha/contenthandlermanager.js +104 -0
  36. data/vendor/assets/javascripts/aloha/lib/aloha/copypaste.js +108 -0
  37. data/vendor/assets/javascripts/aloha/lib/aloha/core.js +623 -0
  38. data/vendor/assets/javascripts/aloha/lib/aloha/ecma5shims.js +326 -0
  39. data/vendor/assets/javascripts/aloha/lib/aloha/editable.js +1042 -0
  40. data/vendor/assets/javascripts/aloha/lib/aloha/engine.js +8646 -0
  41. data/vendor/assets/javascripts/aloha/lib/aloha/ephemera.js +492 -0
  42. data/vendor/assets/javascripts/aloha/lib/aloha/ierange-m2.js +29 -0
  43. data/vendor/assets/javascripts/aloha/lib/aloha/jquery.aloha.js +542 -0
  44. data/vendor/assets/javascripts/aloha/lib/aloha/markup.js +1276 -0
  45. data/vendor/assets/javascripts/aloha/lib/aloha/nls/ca/i18n.js +11 -0
  46. data/vendor/assets/javascripts/aloha/lib/aloha/nls/de/i18n.js +11 -0
  47. data/vendor/assets/javascripts/aloha/lib/aloha/nls/i18n.js +20 -0
  48. data/vendor/assets/javascripts/aloha/lib/aloha/nls/mk/i18n.js +11 -0
  49. data/vendor/assets/javascripts/aloha/lib/aloha/nls/pt-br/i18n.js +11 -0
  50. data/vendor/assets/javascripts/aloha/lib/aloha/nls/ru/i18n.js +11 -0
  51. data/vendor/assets/javascripts/aloha/lib/aloha/nls/uk/i18n.js +11 -0
  52. data/vendor/assets/javascripts/aloha/lib/aloha/nls/zh-hans/i18n.js +11 -0
  53. data/vendor/assets/javascripts/aloha/lib/aloha/observable.js +113 -0
  54. data/vendor/assets/javascripts/aloha/lib/aloha/plugin.js +281 -0
  55. data/vendor/assets/javascripts/aloha/lib/aloha/pluginmanager.js +203 -0
  56. data/vendor/assets/javascripts/aloha/lib/aloha/rangy-core.js +30 -0
  57. data/vendor/assets/javascripts/aloha/lib/aloha/registry.js +137 -0
  58. data/vendor/assets/javascripts/aloha/lib/aloha/repository.js +255 -0
  59. data/vendor/assets/javascripts/aloha/lib/aloha/repositorymanager.js +742 -0
  60. data/vendor/assets/javascripts/aloha/lib/aloha/repositoryobjects.js +162 -0
  61. data/vendor/assets/javascripts/aloha/lib/aloha/selection.js +2402 -0
  62. data/vendor/assets/javascripts/aloha/lib/aloha/sidebar.js +1045 -0
  63. data/vendor/assets/javascripts/aloha/lib/aloha/state-override.js +147 -0
  64. data/vendor/assets/javascripts/aloha/lib/css.js +455 -0
  65. data/vendor/assets/javascripts/aloha/lib/i18n.js +192 -0
  66. data/vendor/assets/javascripts/aloha/lib/require.js +2053 -0
  67. data/vendor/assets/javascripts/aloha/lib/text.js +288 -0
  68. data/vendor/assets/javascripts/aloha/lib/util/arrays.js +287 -0
  69. data/vendor/assets/javascripts/aloha/lib/util/boundary-markers.js +86 -0
  70. data/vendor/assets/javascripts/aloha/lib/util/browser.js +32 -0
  71. data/vendor/assets/javascripts/aloha/lib/util/class.js +78 -0
  72. data/vendor/assets/javascripts/aloha/lib/util/dom.js +1888 -0
  73. data/vendor/assets/javascripts/aloha/lib/util/dom2.js +908 -0
  74. data/vendor/assets/javascripts/aloha/lib/util/functions.js +62 -0
  75. data/vendor/assets/javascripts/aloha/lib/util/html.js +311 -0
  76. data/vendor/assets/javascripts/aloha/lib/util/json2.js +464 -0
  77. data/vendor/assets/javascripts/aloha/lib/util/keys.js +65 -0
  78. data/vendor/assets/javascripts/aloha/lib/util/lang.js +89 -0
  79. data/vendor/assets/javascripts/aloha/lib/util/maps.js +130 -0
  80. data/vendor/assets/javascripts/aloha/lib/util/misc.js +51 -0
  81. data/vendor/assets/javascripts/aloha/lib/util/position.js +176 -0
  82. data/vendor/assets/javascripts/aloha/lib/util/range-context.js +776 -0
  83. data/vendor/assets/javascripts/aloha/lib/util/range.js +917 -0
  84. data/vendor/assets/javascripts/aloha/lib/util/strings.js +122 -0
  85. data/vendor/assets/javascripts/aloha/lib/util/trees.js +336 -0
  86. data/vendor/assets/javascripts/aloha/lib/vendor/3rdparty.txt +70 -0
  87. data/vendor/assets/javascripts/aloha/lib/vendor/amplify.store.js +298 -0
  88. data/vendor/assets/javascripts/aloha/lib/vendor/class.js +76 -0
  89. data/vendor/assets/javascripts/aloha/lib/vendor/grid.locale.de.js +138 -0
  90. data/vendor/assets/javascripts/aloha/lib/vendor/grid.locale.en.js +133 -0
  91. data/vendor/assets/javascripts/aloha/lib/vendor/ierange-m2.js +508 -0
  92. data/vendor/assets/javascripts/aloha/lib/vendor/jquery-1.7.2.js +9421 -0
  93. data/vendor/assets/javascripts/aloha/lib/vendor/jquery-ui-1.9.0.custom-aloha.js +14711 -0
  94. data/vendor/assets/javascripts/aloha/lib/vendor/jquery.jqgrid.js +474 -0
  95. data/vendor/assets/javascripts/aloha/lib/vendor/jquery.jstree.js +4549 -0
  96. data/vendor/assets/javascripts/aloha/lib/vendor/jquery.layout-1.3.0-rc30.7.js +5924 -0
  97. data/vendor/assets/javascripts/aloha/lib/vendor/pubsub/js/pubsub-unminified.js +187 -0
  98. data/vendor/assets/javascripts/aloha/lib/vendor/pubsub/js/pubsub.js +2 -0
  99. data/vendor/assets/javascripts/aloha/lib/vendor/rangy-core.js +3295 -0
  100. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/css/jstree.css +88 -0
  101. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/css/repository-browser.css +744 -0
  102. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-000-medium.png +0 -0
  103. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-180.png +0 -0
  104. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-315-medium.png +0 -0
  105. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-stop-180.png +0 -0
  106. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-stop.png +0 -0
  107. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow.png +0 -0
  108. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/control-stop-square-small.png +0 -0
  109. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/folder-horizontal-open.png +0 -0
  110. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/folder-open.png +0 -0
  111. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/magnifier-left.png +0 -0
  112. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/page.png +0 -0
  113. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/picture.png +0 -0
  114. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/sort-alphabet-descending.png +0 -0
  115. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/sort-alphabet.png +0 -0
  116. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/throbber.gif +0 -0
  117. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/js/repository-browser-unminified.js +1450 -0
  118. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/js/repository-browser.js +32 -0
  119. data/vendor/assets/javascripts/aloha/lib/vendor/sanitize.js +278 -0
  120. data/vendor/assets/javascripts/aloha/plugins/common/abbr/css/abbr.css +1 -0
  121. data/vendor/assets/javascripts/aloha/plugins/common/abbr/img/remabbr.png +0 -0
  122. data/vendor/assets/javascripts/aloha/plugins/common/abbr/lib/abbr-plugin.js +304 -0
  123. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/ca/i18n.js +6 -0
  124. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/de/i18n.js +6 -0
  125. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/i18n.js +15 -0
  126. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/mk/i18n.js +6 -0
  127. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/pt-br/i18n.js +6 -0
  128. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/ru/i18n.js +6 -0
  129. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/uk/i18n.js +6 -0
  130. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/zh-hans/i18n.js +6 -0
  131. data/vendor/assets/javascripts/aloha/plugins/common/abbr/package.json +1 -0
  132. data/vendor/assets/javascripts/aloha/plugins/common/align/LICENSE +166 -0
  133. data/vendor/assets/javascripts/aloha/plugins/common/align/README +12 -0
  134. data/vendor/assets/javascripts/aloha/plugins/common/align/css/align.css +31 -0
  135. data/vendor/assets/javascripts/aloha/plugins/common/align/img/align.png +0 -0
  136. data/vendor/assets/javascripts/aloha/plugins/common/align/lib/align-plugin.js +465 -0
  137. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/ca/i18n.js +6 -0
  138. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/de/i18n.js +9 -0
  139. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/i18n.js +18 -0
  140. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/mk/i18n.js +6 -0
  141. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/pt-br/i18n.js +6 -0
  142. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/ru/i18n.js +6 -0
  143. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/uk/i18n.js +6 -0
  144. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/zh-hans/i18n.js +6 -0
  145. data/vendor/assets/javascripts/aloha/plugins/common/align/package.json +2 -0
  146. data/vendor/assets/javascripts/aloha/plugins/common/block/README +0 -0
  147. data/vendor/assets/javascripts/aloha/plugins/common/block/css/block.css +110 -0
  148. data/vendor/assets/javascripts/aloha/plugins/common/block/img/toolbar-draghandle.gif +0 -0
  149. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/block-plugin.js +347 -0
  150. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/block.js +1277 -0
  151. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/blockcontenthandler.js +118 -0
  152. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/blockmanager.js +621 -0
  153. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/editor.js +331 -0
  154. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/editormanager.js +55 -0
  155. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/sidebarattributeeditor.js +126 -0
  156. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/ca/i18n.js +3 -0
  157. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/de/i18n.js +3 -0
  158. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/i18n.js +12 -0
  159. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/mk/i18n.js +3 -0
  160. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/pt-br/i18n.js +3 -0
  161. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/ru/i18n.js +3 -0
  162. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/uk/i18n.js +3 -0
  163. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/zh-hans/i18n.js +3 -0
  164. data/vendor/assets/javascripts/aloha/plugins/common/block/package.json +11 -0
  165. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/css/characterpicker.css +44 -0
  166. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/img/icon.png +0 -0
  167. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/lib/characterpicker-plugin.js +466 -0
  168. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/ca/i18n.js +3 -0
  169. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/de/i18n.js +3 -0
  170. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/i18n.js +12 -0
  171. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/mk/i18n.js +3 -0
  172. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/pt-br/i18n.js +3 -0
  173. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/ru/i18n.js +3 -0
  174. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/uk/i18n.js +3 -0
  175. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/zh-hans/i18n.js +3 -0
  176. data/vendor/assets/javascripts/aloha/plugins/common/commands/css/abbr.css +0 -0
  177. data/vendor/assets/javascripts/aloha/plugins/common/commands/lib/commands-plugin.js +33 -0
  178. data/vendor/assets/javascripts/aloha/plugins/common/commands/lib/inserthtml.js +126 -0
  179. data/vendor/assets/javascripts/aloha/plugins/common/commands/package.json +1 -0
  180. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/README.md +0 -0
  181. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/blockelementcontenthandler.js +144 -0
  182. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/contenthandler-plugin.js +65 -0
  183. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/contenthandler-utils.js +58 -0
  184. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/genericcontenthandler.js +359 -0
  185. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/oembedcontenthandler.js +461 -0
  186. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/sanitizecontenthandler.js +186 -0
  187. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/wordcontenthandler.js +461 -0
  188. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/package.json +1 -0
  189. data/vendor/assets/javascripts/aloha/plugins/common/dom-to-xhtml/lib/dom-to-xhtml-plugin.js +74 -0
  190. data/vendor/assets/javascripts/aloha/plugins/common/dom-to-xhtml/lib/dom-to-xhtml.js +415 -0
  191. data/vendor/assets/javascripts/aloha/plugins/common/format/img/em.png +0 -0
  192. data/vendor/assets/javascripts/aloha/plugins/common/format/img/strong.png +0 -0
  193. data/vendor/assets/javascripts/aloha/plugins/common/format/lib/format-plugin.js +594 -0
  194. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/ca/i18n.js +52 -0
  195. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/de/i18n.js +52 -0
  196. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/i18n.js +61 -0
  197. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/mk/i18n.js +52 -0
  198. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/pt-br/i18n.js +52 -0
  199. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/ru/i18n.js +52 -0
  200. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/uk/i18n.js +52 -0
  201. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/zh-hans/i18n.js +52 -0
  202. data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/css/highlighteditables.css +14 -0
  203. data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/lib/highlighteditables-plugin.js +100 -0
  204. data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/package.json +1 -0
  205. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/css/horizontalruler.css +3 -0
  206. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/img/icon.png +0 -0
  207. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/lib/horizontalruler-plugin.js +95 -0
  208. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/ca/i18n.js +3 -0
  209. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/de/i18n.js +3 -0
  210. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/i18n.js +12 -0
  211. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/mk/i18n.js +3 -0
  212. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/pt-br/i18n.js +3 -0
  213. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/ru/i18n.js +3 -0
  214. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/uk/i18n.js +3 -0
  215. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/zh-hans/i18n.js +3 -0
  216. data/vendor/assets/javascripts/aloha/plugins/common/image/README.md +66 -0
  217. data/vendor/assets/javascripts/aloha/plugins/common/image/css/image.css +133 -0
  218. data/vendor/assets/javascripts/aloha/plugins/common/image/img/blank.jpg +0 -0
  219. data/vendor/assets/javascripts/aloha/plugins/common/image/img/crop-buttons.gif +0 -0
  220. data/vendor/assets/javascripts/aloha/plugins/common/image/img/cropnresize.png +0 -0
  221. data/vendor/assets/javascripts/aloha/plugins/common/image/img/handle-sw.png +0 -0
  222. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-left.png +0 -0
  223. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-none.png +0 -0
  224. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-right.png +0 -0
  225. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-border.png +0 -0
  226. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-title.png +0 -0
  227. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image.gif +0 -0
  228. data/vendor/assets/javascripts/aloha/plugins/common/image/img/padding-decrease.gif +0 -0
  229. data/vendor/assets/javascripts/aloha/plugins/common/image/img/padding-increase.gif +0 -0
  230. data/vendor/assets/javascripts/aloha/plugins/common/image/img/page.png +0 -0
  231. data/vendor/assets/javascripts/aloha/plugins/common/image/img/size-decrease.gif +0 -0
  232. data/vendor/assets/javascripts/aloha/plugins/common/image/img/size-increase.gif +0 -0
  233. data/vendor/assets/javascripts/aloha/plugins/common/image/lib/image-floatingMenu.js +308 -0
  234. data/vendor/assets/javascripts/aloha/plugins/common/image/lib/image-plugin-actions.js +0 -0
  235. data/vendor/assets/javascripts/aloha/plugins/common/image/lib/image-plugin.js +1341 -0
  236. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/ca/i18n.js +32 -0
  237. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/de/i18n.js +32 -0
  238. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/i18n.js +41 -0
  239. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/mk/i18n.js +32 -0
  240. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/pt-br/i18n.js +32 -0
  241. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/ru/i18n.js +32 -0
  242. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/uk/i18n.js +32 -0
  243. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/zh-hans/i18n.js +32 -0
  244. data/vendor/assets/javascripts/aloha/plugins/common/image/package.json +1 -0
  245. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jcrop.gif +0 -0
  246. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jquery.jcrop.css +46 -0
  247. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jquery.jcrop.min.js +165 -0
  248. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/mousewheel/mousewheel.js +85 -0
  249. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  250. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  251. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  252. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  253. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  254. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  255. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  256. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  257. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  258. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  259. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  260. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  261. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  262. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  263. data/vendor/assets/javascripts/aloha/plugins/common/link/css/link.css +52 -0
  264. data/vendor/assets/javascripts/aloha/plugins/common/link/extra/delicious.js +264 -0
  265. data/vendor/assets/javascripts/aloha/plugins/common/link/extra/linklist.js +247 -0
  266. data/vendor/assets/javascripts/aloha/plugins/common/link/extra/slowlinklist.js +247 -0
  267. data/vendor/assets/javascripts/aloha/plugins/common/link/lib/link-plugin.js +958 -0
  268. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/ca/i18n.js +14 -0
  269. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/de/i18n.js +14 -0
  270. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/i18n.js +23 -0
  271. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/mk/i18n.js +14 -0
  272. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/pt-br/i18n.js +14 -0
  273. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/ru/i18n.js +14 -0
  274. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/uk/i18n.js +14 -0
  275. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/zh-hans/i18n.js +14 -0
  276. data/vendor/assets/javascripts/aloha/plugins/common/list/lib/list-plugin.js +878 -0
  277. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/ca/i18n.js +7 -0
  278. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/de/i18n.js +7 -0
  279. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/i18n.js +16 -0
  280. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/mk/i18n.js +7 -0
  281. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/pt-br/i18n.js +7 -0
  282. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/ru/i18n.js +7 -0
  283. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/uk/i18n.js +7 -0
  284. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/zh-hans/i18n.js +7 -0
  285. data/vendor/assets/javascripts/aloha/plugins/common/list/package.json +1 -0
  286. data/vendor/assets/javascripts/aloha/plugins/common/paste/lib/paste-plugin.js +457 -0
  287. data/vendor/assets/javascripts/aloha/plugins/common/paste/package.json +8 -0
  288. data/vendor/assets/javascripts/aloha/plugins/common/table/css/table.css +125 -0
  289. data/vendor/assets/javascripts/aloha/plugins/common/table/img/down.cur +0 -0
  290. data/vendor/assets/javascripts/aloha/plugins/common/table/img/left.cur +0 -0
  291. data/vendor/assets/javascripts/aloha/plugins/common/table/img/table_layout.png +0 -0
  292. data/vendor/assets/javascripts/aloha/plugins/common/table/img/wai-green.png +0 -0
  293. data/vendor/assets/javascripts/aloha/plugins/common/table/img/wai-red.png +0 -0
  294. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-cell.js +542 -0
  295. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-create-layer.js +213 -0
  296. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-plugin-utils.js +494 -0
  297. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-plugin.js +1596 -0
  298. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-selection.js +468 -0
  299. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table.js +2110 -0
  300. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/ca/i18n.js +28 -0
  301. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/de/i18n.js +29 -0
  302. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/i18n.js +38 -0
  303. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/mk/i18n.js +28 -0
  304. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/pt-br/i18n.js +28 -0
  305. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/ru/i18n.js +28 -0
  306. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/uk/i18n.js +28 -0
  307. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/zh-hans/i18n.js +28 -0
  308. data/vendor/assets/javascripts/aloha/plugins/common/table/package.json +1 -0
  309. data/vendor/assets/javascripts/aloha/plugins/common/ui/css/jquery-ui-1.9m6.css +430 -0
  310. data/vendor/assets/javascripts/aloha/plugins/common/ui/css/ui.css +689 -0
  311. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/blockquote.png +0 -0
  312. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/character-picker.png +0 -0
  313. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/em.png +0 -0
  314. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/format-block.png +0 -0
  315. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/format-inline.png +0 -0
  316. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/indent.png +0 -0
  317. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/jqueryui/ui-icons_222222_256x240.png +0 -0
  318. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/justify.png +0 -0
  319. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/language-annotation.png +0 -0
  320. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview.png +0 -0
  321. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/anchor.png +0 -0
  322. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/blockquote.png +0 -0
  323. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/caption.png +0 -0
  324. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/cite.png +0 -0
  325. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/dd.png +0 -0
  326. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/div.png +0 -0
  327. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/dl.png +0 -0
  328. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/dt.png +0 -0
  329. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h1.png +0 -0
  330. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h2.png +0 -0
  331. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h3.png +0 -0
  332. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h4.png +0 -0
  333. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h5.png +0 -0
  334. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h6.png +0 -0
  335. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/p.png +0 -0
  336. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/pre.png +0 -0
  337. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/q.png +0 -0
  338. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/table.png +0 -0
  339. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/td.png +0 -0
  340. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/th.png +0 -0
  341. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/multisplit-close.gif +0 -0
  342. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/multisplit-open.gif +0 -0
  343. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/outdent.png +0 -0
  344. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/quote.png +0 -0
  345. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/removeformat.png +0 -0
  346. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/strong.png +0 -0
  347. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/tree.png +0 -0
  348. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/arena.js +11 -0
  349. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/autocomplete.js +70 -0
  350. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/button.js +114 -0
  351. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/component.js +121 -0
  352. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/container.js +210 -0
  353. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/context.js +53 -0
  354. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/dialog.js +215 -0
  355. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/floating.js +405 -0
  356. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/menuButton.js +169 -0
  357. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/multiSplit.js +237 -0
  358. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/port-helper-attribute-field.js +440 -0
  359. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/port-helper-multi-split.js +71 -0
  360. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/scopes.js +187 -0
  361. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/settings.js +202 -0
  362. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/subguarded.js +183 -0
  363. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/surface.js +106 -0
  364. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/tab.js +316 -0
  365. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/text.js +33 -0
  366. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/toggleButton.js +57 -0
  367. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/toolbar.js +251 -0
  368. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/ui-plugin.js +169 -0
  369. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/ui.js +181 -0
  370. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/utils.js +104 -0
  371. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/ca/i18n.js +46 -0
  372. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/de/i18n.js +48 -0
  373. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/i18n.js +75 -0
  374. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/mk/i18n.js +46 -0
  375. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/pt-br/i18n.js +46 -0
  376. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/ru/i18n.js +46 -0
  377. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/uk/i18n.js +46 -0
  378. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/zh-hans/i18n.js +46 -0
  379. data/vendor/assets/javascripts/aloha/plugins/common/ui/vendor/jquery-ui-autocomplete-html.js +42 -0
  380. data/vendor/assets/javascripts/aloha/plugins/common/undo/lib/undo-plugin.js +165 -0
  381. data/vendor/assets/javascripts/aloha/plugins/common/undo/package.json +7 -0
  382. data/vendor/assets/javascripts/aloha/plugins/common/undo/vendor/diff_match_patch_uncompressed.js +2155 -0
  383. data/vendor/assets/javascripts/aloha/plugins/common/undo/vendor/undo.js +121 -0
  384. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/README +0 -0
  385. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/css/attributes.css +12 -0
  386. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/lib/attributes-plugin.js +237 -0
  387. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/ca/i18n.js +5 -0
  388. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/de/i18n.js +5 -0
  389. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/i18n.js +14 -0
  390. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/mk/i18n.js +5 -0
  391. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/pt-br/i18n.js +5 -0
  392. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/ru/i18n.js +5 -0
  393. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/uk/i18n.js +5 -0
  394. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/zh-hans/i18n.js +5 -0
  395. data/vendor/assets/javascripts/aloha/plugins/extra/captioned-image/css/captioned-image.css +15 -0
  396. data/vendor/assets/javascripts/aloha/plugins/extra/captioned-image/lib/captioned-image-plugin.js +555 -0
  397. data/vendor/assets/javascripts/aloha/plugins/extra/cite/README +0 -0
  398. data/vendor/assets/javascripts/aloha/plugins/extra/cite/css/cite.css +39 -0
  399. data/vendor/assets/javascripts/aloha/plugins/extra/cite/img/blockquote.png +0 -0
  400. data/vendor/assets/javascripts/aloha/plugins/extra/cite/img/icon_cite.png +0 -0
  401. data/vendor/assets/javascripts/aloha/plugins/extra/cite/lib/cite-plugin.js +614 -0
  402. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/ca/i18n.js +4 -0
  403. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/de/i18n.js +4 -0
  404. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/i18n.js +13 -0
  405. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/mk/i18n.js +4 -0
  406. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/pt-br/i18n.js +4 -0
  407. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/ru/i18n.js +4 -0
  408. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/uk/i18n.js +4 -0
  409. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/zh-hans/i18n.js +4 -0
  410. data/vendor/assets/javascripts/aloha/plugins/extra/cite/package.json +1 -0
  411. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/add-icon.png +0 -0
  412. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/add.png +0 -0
  413. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/comments.png +0 -0
  414. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/hr.png +0 -0
  415. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/textbox.png +0 -0
  416. data/vendor/assets/javascripts/aloha/plugins/extra/comments/lib/comments-plugin.js +692 -0
  417. data/vendor/assets/javascripts/aloha/plugins/extra/comments/lib/comments.css +442 -0
  418. data/vendor/assets/javascripts/aloha/plugins/extra/comments/package.json +1 -0
  419. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/README.md +5 -0
  420. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/TODO.md +2 -0
  421. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/cross.png +0 -0
  422. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/hourglass.png +0 -0
  423. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/loading.gif +0 -0
  424. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/page.png +0 -0
  425. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/tick.png +0 -0
  426. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/draganddropfiles-plugin.js +4 -0
  427. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dragndropfiles.css +110 -0
  428. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dragndropfiles.js +363 -0
  429. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dropfilesrepository.js +365 -0
  430. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/ca/i18n.js +3 -0
  431. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/de/i18n.js +3 -0
  432. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/i18n.js +12 -0
  433. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/mk/i18n.js +3 -0
  434. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/pt-br/i18n.js +3 -0
  435. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/ru/i18n.js +3 -0
  436. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/uk/i18n.js +3 -0
  437. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/zh-hans/i18n.js +3 -0
  438. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/package.json +1 -0
  439. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/README.md +1 -0
  440. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/css/formatless.css +7 -0
  441. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/img/button.png +0 -0
  442. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/lib/formatlesshandler.js +97 -0
  443. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/lib/formatlesspaste-plugin.js +230 -0
  444. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/ca/i18n.js +3 -0
  445. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/de/i18n.js +3 -0
  446. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/i18n.js +12 -0
  447. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/mk/i18n.js +3 -0
  448. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/pt-br/i18n.js +3 -0
  449. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/ru/i18n.js +3 -0
  450. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/uk/i18n.js +3 -0
  451. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/zh-hans/i18n.js +3 -0
  452. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/package.json +8 -0
  453. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/README +0 -0
  454. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/css/headerids.css +8 -0
  455. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/lib/headerids-plugin.js +254 -0
  456. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/ca/i18n.js +6 -0
  457. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/de/i18n.js +6 -0
  458. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/i18n.js +15 -0
  459. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/mk/i18n.js +6 -0
  460. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/pt-br/i18n.js +6 -0
  461. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/ru/i18n.js +6 -0
  462. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/uk/i18n.js +6 -0
  463. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/zh-hans/i18n.js +6 -0
  464. data/vendor/assets/javascripts/aloha/plugins/extra/hints/README.md +12 -0
  465. data/vendor/assets/javascripts/aloha/plugins/extra/hints/css/hints.css +29 -0
  466. data/vendor/assets/javascripts/aloha/plugins/extra/hints/lib/hints-plugin.js +97 -0
  467. data/vendor/assets/javascripts/aloha/plugins/extra/hints/package.json +9 -0
  468. data/vendor/assets/javascripts/aloha/plugins/extra/hints/vendor/tipsy.js +242 -0
  469. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/README +0 -0
  470. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/lib/imagebrowser-plugin.js +160 -0
  471. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/ca/i18n.js +6 -0
  472. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/de/i18n.js +6 -0
  473. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/i18n.js +15 -0
  474. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/mk/i18n.js +6 -0
  475. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/pt-br/i18n.js +6 -0
  476. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/ru/i18n.js +6 -0
  477. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/uk/i18n.js +6 -0
  478. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/zh-hans/i18n.js +6 -0
  479. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/README +0 -0
  480. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ad.png +0 -0
  481. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ae.png +0 -0
  482. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/af.png +0 -0
  483. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ag.png +0 -0
  484. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ai.png +0 -0
  485. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/al.png +0 -0
  486. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/am.png +0 -0
  487. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/an.png +0 -0
  488. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ao.png +0 -0
  489. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ar.png +0 -0
  490. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/as.png +0 -0
  491. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/at.png +0 -0
  492. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/au.png +0 -0
  493. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/aw.png +0 -0
  494. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ax.png +0 -0
  495. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/az.png +0 -0
  496. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ba.png +0 -0
  497. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bb.png +0 -0
  498. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bd.png +0 -0
  499. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/be.png +0 -0
  500. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bf.png +0 -0
  501. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bg.png +0 -0
  502. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bh.png +0 -0
  503. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bi.png +0 -0
  504. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bj.png +0 -0
  505. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bm.png +0 -0
  506. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bn.png +0 -0
  507. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bo.png +0 -0
  508. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/br.png +0 -0
  509. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bs.png +0 -0
  510. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bt.png +0 -0
  511. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bv.png +0 -0
  512. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bw.png +0 -0
  513. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/by.png +0 -0
  514. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bz.png +0 -0
  515. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ca.png +0 -0
  516. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/catalonia.png +0 -0
  517. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cc.png +0 -0
  518. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cd.png +0 -0
  519. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cf.png +0 -0
  520. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cg.png +0 -0
  521. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ch.png +0 -0
  522. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ci.png +0 -0
  523. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ck.png +0 -0
  524. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cl.png +0 -0
  525. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cm.png +0 -0
  526. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cn.png +0 -0
  527. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/co.png +0 -0
  528. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cr.png +0 -0
  529. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cs.png +0 -0
  530. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cu.png +0 -0
  531. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cv.png +0 -0
  532. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cx.png +0 -0
  533. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cy.png +0 -0
  534. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cz.png +0 -0
  535. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/de.png +0 -0
  536. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dj.png +0 -0
  537. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dk.png +0 -0
  538. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dm.png +0 -0
  539. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/do.png +0 -0
  540. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dz.png +0 -0
  541. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ec.png +0 -0
  542. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ee.png +0 -0
  543. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/eg.png +0 -0
  544. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/eh.png +0 -0
  545. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/en.png +0 -0
  546. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/er.png +0 -0
  547. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/es.png +0 -0
  548. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/et.png +0 -0
  549. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/europeanunion.png +0 -0
  550. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fam.png +0 -0
  551. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fi.png +0 -0
  552. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fj.png +0 -0
  553. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fk.png +0 -0
  554. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fm.png +0 -0
  555. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fo.png +0 -0
  556. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fr.png +0 -0
  557. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ga.png +0 -0
  558. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gb.png +0 -0
  559. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gd.png +0 -0
  560. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ge.png +0 -0
  561. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gf.png +0 -0
  562. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gh.png +0 -0
  563. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gi.png +0 -0
  564. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gl.png +0 -0
  565. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gm.png +0 -0
  566. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gn.png +0 -0
  567. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gp.png +0 -0
  568. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gq.png +0 -0
  569. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gr.png +0 -0
  570. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gs.png +0 -0
  571. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gt.png +0 -0
  572. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gu.png +0 -0
  573. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gw.png +0 -0
  574. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gy.png +0 -0
  575. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hk.png +0 -0
  576. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hm.png +0 -0
  577. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hn.png +0 -0
  578. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hr.png +0 -0
  579. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ht.png +0 -0
  580. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hu.png +0 -0
  581. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/id.png +0 -0
  582. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ie.png +0 -0
  583. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/il.png +0 -0
  584. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/in.png +0 -0
  585. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/io.png +0 -0
  586. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/iq.png +0 -0
  587. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ir.png +0 -0
  588. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/is.png +0 -0
  589. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/it.png +0 -0
  590. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jm.png +0 -0
  591. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jo.png +0 -0
  592. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jp.png +0 -0
  593. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ke.png +0 -0
  594. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kg.png +0 -0
  595. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kh.png +0 -0
  596. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ki.png +0 -0
  597. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/km.png +0 -0
  598. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kn.png +0 -0
  599. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kp.png +0 -0
  600. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kr.png +0 -0
  601. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kw.png +0 -0
  602. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ky.png +0 -0
  603. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kz.png +0 -0
  604. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/la.png +0 -0
  605. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lb.png +0 -0
  606. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lc.png +0 -0
  607. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/li.png +0 -0
  608. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lk.png +0 -0
  609. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lr.png +0 -0
  610. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ls.png +0 -0
  611. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lt.png +0 -0
  612. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lu.png +0 -0
  613. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lv.png +0 -0
  614. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ly.png +0 -0
  615. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ma.png +0 -0
  616. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mc.png +0 -0
  617. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/md.png +0 -0
  618. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/me.png +0 -0
  619. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mg.png +0 -0
  620. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mh.png +0 -0
  621. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mk.png +0 -0
  622. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ml.png +0 -0
  623. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mm.png +0 -0
  624. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mn.png +0 -0
  625. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mo.png +0 -0
  626. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mp.png +0 -0
  627. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mq.png +0 -0
  628. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mr.png +0 -0
  629. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ms.png +0 -0
  630. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mt.png +0 -0
  631. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mu.png +0 -0
  632. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mv.png +0 -0
  633. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mw.png +0 -0
  634. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mx.png +0 -0
  635. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/my.png +0 -0
  636. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mz.png +0 -0
  637. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/na.png +0 -0
  638. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nc.png +0 -0
  639. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ne.png +0 -0
  640. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nf.png +0 -0
  641. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ng.png +0 -0
  642. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ni.png +0 -0
  643. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nl.png +0 -0
  644. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/no.png +0 -0
  645. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/np.png +0 -0
  646. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nr.png +0 -0
  647. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nu.png +0 -0
  648. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nz.png +0 -0
  649. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/om.png +0 -0
  650. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pa.png +0 -0
  651. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pe.png +0 -0
  652. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pf.png +0 -0
  653. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pg.png +0 -0
  654. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ph.png +0 -0
  655. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pk.png +0 -0
  656. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pl.png +0 -0
  657. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pm.png +0 -0
  658. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pn.png +0 -0
  659. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pr.png +0 -0
  660. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ps.png +0 -0
  661. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pt.png +0 -0
  662. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pw.png +0 -0
  663. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/py.png +0 -0
  664. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/qa.png +0 -0
  665. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/re.png +0 -0
  666. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ro.png +0 -0
  667. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/rs.png +0 -0
  668. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ru.png +0 -0
  669. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/rw.png +0 -0
  670. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sa.png +0 -0
  671. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sb.png +0 -0
  672. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sc.png +0 -0
  673. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/scotland.png +0 -0
  674. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sd.png +0 -0
  675. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/se.png +0 -0
  676. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sg.png +0 -0
  677. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sh.png +0 -0
  678. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/si.png +0 -0
  679. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sj.png +0 -0
  680. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sk.png +0 -0
  681. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sl.png +0 -0
  682. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sm.png +0 -0
  683. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sn.png +0 -0
  684. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/so.png +0 -0
  685. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sr.png +0 -0
  686. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/st.png +0 -0
  687. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sv.png +0 -0
  688. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sy.png +0 -0
  689. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sz.png +0 -0
  690. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tc.png +0 -0
  691. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/td.png +0 -0
  692. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tf.png +0 -0
  693. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tg.png +0 -0
  694. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/th.png +0 -0
  695. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tj.png +0 -0
  696. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tk.png +0 -0
  697. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tl.png +0 -0
  698. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tm.png +0 -0
  699. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tn.png +0 -0
  700. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/to.png +0 -0
  701. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tr.png +0 -0
  702. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tt.png +0 -0
  703. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tv.png +0 -0
  704. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tw.png +0 -0
  705. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tz.png +0 -0
  706. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ua.png +0 -0
  707. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ug.png +0 -0
  708. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/um.png +0 -0
  709. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/us.png +0 -0
  710. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/uy.png +0 -0
  711. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/uz.png +0 -0
  712. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/va.png +0 -0
  713. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vc.png +0 -0
  714. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ve.png +0 -0
  715. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vg.png +0 -0
  716. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vi.png +0 -0
  717. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vn.png +0 -0
  718. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vu.png +0 -0
  719. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/wales.png +0 -0
  720. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/wf.png +0 -0
  721. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ws.png +0 -0
  722. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ye.png +0 -0
  723. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/yt.png +0 -0
  724. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/za.png +0 -0
  725. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/zm.png +0 -0
  726. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/zw.png +0 -0
  727. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/lib/linkbrowser-plugin.js +161 -0
  728. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/ca/i18n.js +6 -0
  729. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/de/i18n.js +6 -0
  730. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/i18n.js +15 -0
  731. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/mk/i18n.js +6 -0
  732. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/pt-br/i18n.js +6 -0
  733. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/ru/i18n.js +6 -0
  734. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/uk/i18n.js +6 -0
  735. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/zh-hans/i18n.js +6 -0
  736. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/ca/i18n.js +28 -0
  737. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/de/i18n.js +28 -0
  738. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/i18n.js +37 -0
  739. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/mk/i18n.js +28 -0
  740. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/pt-br/i18n.js +28 -0
  741. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/ru/i18n.js +28 -0
  742. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/uk/i18n.js +28 -0
  743. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/zh-hans/i18n.js +28 -0
  744. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/package.json +1 -0
  745. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/proxy.php.example +244 -0
  746. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/src/linkchecker.css +14 -0
  747. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/src/linkchecker.js +269 -0
  748. data/vendor/assets/javascripts/aloha/plugins/extra/listenforcer/lib/listenforcer-plugin.js +190 -0
  749. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/README +0 -0
  750. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/css/metaview.css +78 -0
  751. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/anchor.png +0 -0
  752. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/blockquote.png +0 -0
  753. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/button.png +0 -0
  754. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/caption.png +0 -0
  755. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/cite.png +0 -0
  756. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dd.png +0 -0
  757. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/div.png +0 -0
  758. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dl.png +0 -0
  759. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dt.png +0 -0
  760. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h1.png +0 -0
  761. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h2.png +0 -0
  762. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h3.png +0 -0
  763. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h4.png +0 -0
  764. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h5.png +0 -0
  765. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h6.png +0 -0
  766. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/hr.png +0 -0
  767. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/icon_cite.png +0 -0
  768. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/p.png +0 -0
  769. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/pre.png +0 -0
  770. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/table.png +0 -0
  771. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/td.png +0 -0
  772. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/th.png +0 -0
  773. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/lib/metaview-plugin.js +185 -0
  774. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/ca/i18n.js +3 -0
  775. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/de/i18n.js +3 -0
  776. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/i18n.js +12 -0
  777. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/mk/i18n.js +3 -0
  778. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/pt-br/i18n.js +3 -0
  779. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/ru/i18n.js +3 -0
  780. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/uk/i18n.js +3 -0
  781. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/zh-hans/i18n.js +3 -0
  782. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/README +0 -0
  783. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/css/numerated-headers.css +7 -0
  784. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/img/headers.png +0 -0
  785. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/lib/numerated-headers-plugin.js +421 -0
  786. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/ca/i18n.js +5 -0
  787. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/de/i18n.js +6 -0
  788. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/i18n.js +15 -0
  789. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/mk/i18n.js +5 -0
  790. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/pt-br/i18n.js +5 -0
  791. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/ru/i18n.js +5 -0
  792. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/uk/i18n.js +5 -0
  793. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/zh-hans/i18n.js +5 -0
  794. data/vendor/assets/javascripts/aloha/plugins/extra/profiler/css/profiler.css +34 -0
  795. data/vendor/assets/javascripts/aloha/plugins/extra/profiler/lib/profiler-plugin.js +304 -0
  796. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/README.md +8 -0
  797. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/css/ribbon.css +54 -0
  798. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/img/fade-in.png +0 -0
  799. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/img/fade-out.png +0 -0
  800. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/lib/ribbon-plugin.js +144 -0
  801. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/package.json +1 -0
  802. data/vendor/assets/javascripts/aloha/plugins/extra/sourceview/css/sourceview.css +18 -0
  803. data/vendor/assets/javascripts/aloha/plugins/extra/sourceview/lib/sourceview-plugin.js +252 -0
  804. data/vendor/assets/javascripts/aloha/plugins/extra/sourceview/vendor/htmlbeautifier.js +468 -0
  805. data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/css/textcolor.css +65 -0
  806. data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/img/icon.png +0 -0
  807. data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/lib/textcolor-plugin.js +420 -0
  808. data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/nls/de/i18n.js +3 -0
  809. data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/nls/i18n.js +6 -0
  810. data/vendor/assets/javascripts/aloha/plugins/extra/toc/lib/toc-plugin.js +399 -0
  811. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/ca/i18n.js +3 -0
  812. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/de/i18n.js +3 -0
  813. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/i18n.js +12 -0
  814. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/mk/i18n.js +3 -0
  815. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/pt-br/i18n.js +3 -0
  816. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/ru/i18n.js +3 -0
  817. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/uk/i18n.js +3 -0
  818. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/zh-hans/i18n.js +3 -0
  819. data/vendor/assets/javascripts/aloha/plugins/extra/toc/package.json +1 -0
  820. data/vendor/assets/javascripts/aloha/plugins/extra/validation/lib/validation-plugin.js +277 -0
  821. data/vendor/assets/stylesheets/aloha-common-extra.css +24 -0
  822. data/vendor/assets/stylesheets/aloha-core.css +19 -0
  823. data/vendor/assets/stylesheets/aloha-reset.css +24 -0
  824. data/vendor/assets/stylesheets/aloha-sidebar.css +296 -0
  825. data/vendor/assets/stylesheets/aloha.css +31 -0
  826. metadata +898 -0
@@ -0,0 +1,2110 @@
1
+ /**
2
+ * Aloha Table Plugin
3
+ * ------------------
4
+ * This plugin provides advanced support for manipulating tables in Aloha
5
+ * Editables.
6
+ * Nested tables are not support. If nested tables are pasted into the
7
+ * editable, they will simply be left alone.
8
+ * Each (non-nested) table in the editable will have a corresponding Aloha
9
+ * Table instance created for it, which will maintain internal state, and
10
+ * information related to its DOM element.
11
+ *
12
+ * @todo: - selectRow/selectColumn should take into account the helper row/column.
13
+ * ie: selectRow(0) and selectColumn(0), should be zero indexed
14
+ */
15
+ define([
16
+ 'aloha',
17
+ 'jquery',
18
+ 'ui/scopes',
19
+ 'ui/dialog',
20
+ 'i18n!table/nls/i18n',
21
+ 'table/table-cell',
22
+ 'table/table-selection',
23
+ 'table/table-plugin-utils',
24
+ 'util/html',
25
+ 'util/dom2'
26
+ ], function (
27
+ Aloha,
28
+ jQuery,
29
+ Scopes,
30
+ Dialog,
31
+ i18n,
32
+ TableCell,
33
+ TableSelection,
34
+ Utils,
35
+ Html,
36
+ Dom
37
+ ) {
38
+ var undefined = void 0;
39
+ var GENTICS = window.GENTICS;
40
+
41
+ /**
42
+ * Returns an Array with all elements and textnodes included in the
43
+ * hierarchy of the element received. Is Similar to do
44
+ * jQuery('*', element).contents(), the diference it's this function returns the
45
+ * array in the correct order of apparition
46
+ * @example
47
+ * <pre>
48
+ * &gt;p&lt;
49
+ * textnode
50
+ * <b>b textnode</b>
51
+ * another text node
52
+ * &gt;/p&lt;
53
+ *
54
+ * jQuery('*', lt).contents();
55
+ * // returns ["textnode", "<b>", "another textnode", "b textnode"]
56
+ * getPlainHierarchy(lt)
57
+ * // returns ["textnode", "<b>", "b textnode", "another textnode"]
58
+ * </pre>
59
+ *
60
+ * @return {Array.<HTMLElement|TextNode>}
61
+ */
62
+ function getPlainHierarchy(element) {
63
+ if (element.jquery) {
64
+ element = element[0];
65
+ }
66
+ var i, result = [], child;
67
+ for (i = 0; i < element.childNodes.length; i++) {
68
+ child = element.childNodes[i];
69
+ result.push(child);
70
+ if (child.nodeType === 1) {
71
+ result = result.concat(getPlainHierarchy(child));
72
+ }
73
+ }
74
+
75
+ return result;
76
+ }
77
+
78
+ /**
79
+ * Find the first or the last element inside a table, even if in a td
80
+ *
81
+ * @param {String} type Accepts two values: 'first' or 'last'
82
+ * @param {HTMLElement|jQuery} parent the parent element to search
83
+ *
84
+ * @return {jQuery}
85
+ */
86
+ function getNewSelectedElement(type, parent) {
87
+ var toSelectElement;
88
+ if ('first' === type) {
89
+ toSelectElement = jQuery('[contenteditable]', parent).first()[0]
90
+ .firstChild;
91
+ if (undefined === toSelectElement) {
92
+ toSelectElement = jQuery('*', parent).first()[0].firstChild;
93
+ }
94
+ } else if ('last' === type) {
95
+ toSelectElement = getPlainHierarchy(jQuery('td:last', parent))
96
+ .reverse()[0];
97
+ }
98
+
99
+ return toSelectElement;
100
+ }
101
+
102
+ /**
103
+ * Constructor of the table object
104
+ *
105
+ * @param table
106
+ * the dom-representation of the held table
107
+ * @return void
108
+ */
109
+ var Table = function ( table, tablePlugin ) {
110
+ // set the table attribut "obj" as a jquery represenation of the dom-table
111
+ this.obj = jQuery( table );
112
+
113
+ correctTableStructure( this );
114
+
115
+ if ( !this.obj.attr( 'id' ) ) {
116
+ this.obj.attr( 'id', GENTICS.Utils.guid() );
117
+ }
118
+
119
+ this.tablePlugin = tablePlugin;
120
+ this.selection = new TableSelection( this );
121
+ this.refresh();
122
+ };
123
+
124
+ jQuery.extend( Table.prototype, {
125
+ /**
126
+ * Attribute holding the jQuery-table-represenation
127
+ */
128
+ obj: undefined,
129
+
130
+ /**
131
+ * The DOM-element of the outest div-container wrapped around the cell
132
+ */
133
+ tableWrapper: undefined,
134
+
135
+ /**
136
+ * An array of all Cells contained in the Table
137
+ *
138
+ * @see TableCell
139
+ */
140
+ cells: undefined,
141
+
142
+ /**
143
+ * Number of rows of the table
144
+ */
145
+ numRows: undefined,
146
+
147
+ /**
148
+ * Number of rows of the table
149
+ */
150
+ numCols: undefined,
151
+
152
+ /**
153
+ * Flag wether the table is active or not
154
+ */
155
+ isActive: false,
156
+
157
+ /**
158
+ * Flag wether the table is focused or not
159
+ */
160
+ hasFocus: false,
161
+
162
+ /**
163
+ * The editable which contains the table
164
+ */
165
+ parentEditable: undefined,
166
+
167
+ /**
168
+ * Flag to check if the mouse was pressed. For row- and column-selection.
169
+ */
170
+ mousedown: false,
171
+
172
+ /**
173
+ * ID of the column which was pressed when selecting columns
174
+ */
175
+ clickedColumnId: -1,
176
+
177
+ /**
178
+ * ID of the row which was pressed when selecting rows
179
+ */
180
+ clickedRowId: -1,
181
+
182
+ /**
183
+ * collection of columnindexes of the columns which should be selected
184
+ */
185
+ columnsToSelect: [],
186
+
187
+ /**
188
+ * collection of rowindexes of the rows which should be selected
189
+ */
190
+ rowsToSelect: [],
191
+
192
+ /**
193
+ * contains the plugin id used for interaction with the floating menu
194
+ */
195
+ fmPluginId: undefined
196
+ } );
197
+
198
+ /**
199
+ * @hide
200
+ */
201
+ Table.prototype.refresh = function () {
202
+ // find the dimensions of the table
203
+ this.numCols = this.countVirtualCols();
204
+
205
+ var rows = this.getRows();
206
+ this.numRows = rows.length;
207
+
208
+ // init the cell-attribute with an empty array
209
+ this.cells = [];
210
+
211
+ // iterate over table cells and create Cell-objects
212
+ for ( var i = 0; i < rows.length; i++ ) {
213
+ var row = jQuery(rows[i]);
214
+ var cols = row.children();
215
+ for ( var j = 0; j < cols.length; j++ ) {
216
+ var col = cols[j];
217
+ var Cell = this.newCell( col );
218
+ }
219
+ }
220
+ };
221
+
222
+ Table.prototype.countVirtualCols = function () {
223
+ var $firstRow = this.obj.children().children( 'tr:first-child' ).children();
224
+ return $firstRow.length - $firstRow.filter( '.' + this.get( 'classLeftUpperCorner' ) ).length;
225
+ };
226
+
227
+ /**
228
+ * Wrapper-Mehotd to return a property of TablePlugin.get
229
+ *
230
+ * @see TablePlugin.get
231
+ * @param property
232
+ * the property whichs value should be return
233
+ * @return the value associated with the property
234
+ */
235
+ Table.prototype.get = function(property) {
236
+ return this.tablePlugin.get(property);
237
+ };
238
+
239
+ /**
240
+ * Wrapper-Method for TablePlugin.set
241
+ *
242
+ * @see TablePlugin.set
243
+ * @param key
244
+ * the key whichs value should be set
245
+ * @param value
246
+ * the value for the key
247
+ * @return void
248
+ */
249
+ Table.prototype.set = function(key, value) {
250
+ this.tablePlugin.set(key, value);
251
+ };
252
+
253
+ /**
254
+ * Given an unbalanced table structure, pad it with the necessary cells to
255
+ * make it perfectly rectangular
256
+ *
257
+ * @param {Aloha.Table} tableObj
258
+ */
259
+ function correctTableStructure ( tableObj ) {
260
+ var table = tableObj.obj,
261
+
262
+ i,
263
+ j,
264
+ row,
265
+ rows = tableObj.getRows(),
266
+ rowsNum = rows.length,
267
+
268
+ cols,
269
+ colsNum,
270
+
271
+ colsCount,
272
+ maxColsCount = 0,
273
+ cachedColsCounts = [rowsNum],
274
+ colsCountDiff,
275
+ colSpan;
276
+
277
+ for ( i = 0; i < rowsNum; i++ ) {
278
+ row = jQuery( rows[ i ] );
279
+ cols = row.children( 'td, th' );
280
+ colsNum = cols.length;
281
+ colsCount = Utils.cellIndexToGridColumn( rows, i, colsNum - 1 ) + 1;
282
+
283
+ // Check if the last cell in this row has a col span, to account
284
+ // for it in the total number of colums in this row
285
+
286
+ colSpan = parseInt( cols.last().attr( 'colspan' ), 10 );
287
+
288
+ if ( colSpan == 0 ) {
289
+ // TODO: support colspan=0
290
+ // http://dev.w3.org/html5/markup/td.html#td.attrs.colspan
291
+ // http://www.w3.org/TR/html401/struct/tables.html#adef-colspan
292
+ // The value zero ("0") means that the cell spans all columns
293
+ // from the current column to the last column of the column
294
+ // group (COLGROUP) in which the cel
295
+ } else if ( !isNaN( colSpan ) ) {
296
+ // The default value of this attribute is one ("1"), so where this
297
+ // is the case, we will remove such superfluous colspan attributes
298
+ if ( colSpan == 1 ) {
299
+ cols.last().removeAttr( 'colspan' );
300
+ }
301
+
302
+ colsCount += ( colSpan - 1 );
303
+ }
304
+
305
+ // if a rowspan is set in the last element of the row, the row(s) below
306
+ // are supposed to have one less column for every colspan the element has
307
+ rowSpan = parseInt(cols.last().attr('rowspan'), 10);
308
+ if (rowSpan > 1) {
309
+ for (j = 1; j < rowSpan-1; j++) {
310
+ if (colSpan > 1) {
311
+ cachedColsCounts[i+j] += colSpan;
312
+ } else {
313
+ cachedColsCounts[i+j] += 1;
314
+ }
315
+ }
316
+ }
317
+
318
+ cachedColsCounts[i] += colsCount;
319
+
320
+ if (cachedColsCounts[i] > maxColsCount) {
321
+ maxColsCount = cachedColsCounts[i];
322
+ }
323
+ }
324
+
325
+ for ( i = 0; i < rowsNum; i++ ) {
326
+ colsCountDiff = maxColsCount - cachedColsCounts[ i ];
327
+ if ( colsCountDiff > 0 ) {
328
+ // Create as many td's as we need to complete the row
329
+ jQuery( rows[ i ] ).append(
330
+ ( new Array( colsCountDiff + 1 ) ).join( '<td></td>' )
331
+ );
332
+ }
333
+ }
334
+ };
335
+
336
+ /**
337
+ * If all of the selected cells have been set to the same predefined style,
338
+ * then its style-button is toggled on. Otherwise, all style-buttons are toggled off.
339
+ *
340
+ * @param selectedCells the cells to be checked
341
+ * @param config the list of styles as defined in the aloha-configuration
342
+ * @param items the multisplit-toggle-items
343
+ * @param button a multisplit-button
344
+ *
345
+ * @return void
346
+ */
347
+ function setActiveStyle(selectedCells, config, items, button) {
348
+ var className;
349
+ var allSelected = false;
350
+
351
+ // activate all formatting buttons
352
+ for (var i = 0; i < items.length; i++) {
353
+ button.showItem(items[i].name);
354
+ }
355
+
356
+ // clear active style block
357
+ button.setActiveItem();
358
+
359
+ // select class of first element as reference
360
+ for (var i = 0; i < config.length; i++) {
361
+ if (jQuery(selectedCells[0]).hasClass(config[i].cssClass)) {
362
+ allSelected = true;
363
+ className = config[i].name;
364
+ break;
365
+ }
366
+ }
367
+
368
+ // if all selected cells have the same class, set it as active
369
+ jQuery(selectedCells).each(function(index) {
370
+ if (!jQuery(this).hasClass(className)) {
371
+ allSelected = false;
372
+ }
373
+ });
374
+ if (allSelected) {
375
+ button.setActiveItem(className);
376
+ }
377
+ }
378
+
379
+ /**
380
+ * Transforms the existing dom-table into an editable aloha-table. In fact it
381
+ * replaces the td-elements with equivalent TableCell-elements
382
+ * with attached events.
383
+ * Furthermore it creates wrapping divs to realize a click-area for row- and
384
+ * column selection and also attaches events.
385
+ *
386
+ * @return void
387
+ */
388
+ Table.prototype.activate = function () {
389
+ if ( this.isActive ) {
390
+ return;
391
+ }
392
+
393
+ var that = this,
394
+ htmlTableWrapper,
395
+ tableWrapper, eventContainer;
396
+
397
+ // alter the table attributes
398
+ this.obj.addClass( this.get( 'className' ) );
399
+ this.obj.contentEditable( false );
400
+
401
+ // set an id to the table if not already set
402
+ if ( this.obj.attr( 'id' ) == '' ) {
403
+ this.obj.attr( 'id', GENTICS.Utils.guid() );
404
+ }
405
+
406
+ // unset the selection type
407
+ this.selection.selectionType = undefined;
408
+
409
+ // the eventContainer will be the tbody (if there is one), or the table (if no tbody exists)
410
+ eventContainer = this.obj.children('tbody');
411
+ if (eventContainer.length === 0) {
412
+ eventContainer = this.obj;
413
+ }
414
+
415
+ eventContainer.bind( 'keydown', function ( jqEvent ) {
416
+ if ( !jqEvent.ctrlKey && !jqEvent.shiftKey ) {
417
+ if ( that.selection.selectedCells.length > 0 &&
418
+ that.selection.selectedCells[ 0 ].length > 0 ) {
419
+ that.selection.selectedCells[ 0 ][ 0 ].firstChild.focus();
420
+ }
421
+ }
422
+ } );
423
+
424
+ function isNotUnrenderedNode(node) {
425
+ return !Html.isUnrenderedNode(node);
426
+ }
427
+
428
+ /**
429
+ * @param {WrappedRange} range
430
+ */
431
+ function isRangeVisiblyAtLeftBoundary(range) {
432
+ var offset = range.startOffset;
433
+ var node = range.startContainer;
434
+ if (0 === offset) {
435
+ return true;
436
+ }
437
+ if (1 === node.nodeType) {
438
+ return !Html.findNodeRight(
439
+ node.childNodes[offset - 1],
440
+ isNotUnrenderedNode
441
+ );
442
+ }
443
+ if (3 === node.nodeType) {
444
+ return Html.isWSPorZWSPText(node.data.substr(0, offset));
445
+ }
446
+ return false;
447
+ }
448
+
449
+ /**
450
+ * @param {WrappedRange} range
451
+ */
452
+ function isRangeVisiblyAtRightBoundary(range) {
453
+ var offset = range.startOffset;
454
+ var node = range.startContainer;
455
+ if (Dom.nodeLength(node) === offset) {
456
+ return true;
457
+ }
458
+ if (1 === node.nodeType) {
459
+ return !Html.findNodeLeft(
460
+ node.childNodes[offset - 1],
461
+ isNotUnrenderedNode
462
+ );
463
+ }
464
+ if (3 === node.nodeType) {
465
+ return Html.isWSPorZWSPText(node.data.substr(offset));
466
+ }
467
+ return false;
468
+ }
469
+
470
+ Aloha.bind('aloha-command-will-execute', function (_, event){
471
+ var range = Aloha.getSelection().getRangeAt(0);
472
+ var adjacent;
473
+ if ('forwarddelete' === event.commandId) {
474
+ if (!range.collapsed || !isRangeVisiblyAtRightBoundary(range)) {
475
+ return;
476
+ }
477
+ var node = range.commonAncestorContainer;
478
+ if (3 === node.nodeType) {
479
+ adjacent = node.parentNode
480
+ && Html.findNodeLeft(
481
+ node.parentNode.nextSibling,
482
+ isNotUnrenderedNode
483
+ );
484
+ } else if (1 === node.nodeType) {
485
+ adjacent = Html.findNodeLeft(
486
+ node.nextSibling,
487
+ isNotUnrenderedNode
488
+ );
489
+ }
490
+ if (adjacent === that.tableWrapper) {
491
+ event.preventDefault = true;
492
+ Aloha.getSelection().collapse(
493
+ getNewSelectedElement('first', that.obj),
494
+ 0
495
+ );
496
+ }
497
+ } else if ('delete' === event.commandId) {
498
+ if (!range.collapsed || !isRangeVisiblyAtLeftBoundary(range)) {
499
+ return;
500
+ }
501
+ var node = range.commonAncestorContainer;
502
+ if (3 === node.nodeType) {
503
+ adjacent = node.parentNode
504
+ && Html.findNodeRight(
505
+ node.parentNode.previousSibling,
506
+ isNotUnrenderedNode
507
+ );
508
+ } else if (1 === node.nodeType) {
509
+ adjacent = Html.findNodeRight(
510
+ node.previousSibling,
511
+ isNotUnrenderedNode
512
+ );
513
+ }
514
+ if (adjacent === that.tableWrapper) {
515
+ var nodeToSelect = getNewSelectedElement('last', that.obj);
516
+ event.preventDefault = true;
517
+ Aloha.getSelection().collapse(
518
+ nodeToSelect,
519
+ Dom.nodeLength(nodeToSelect)
520
+ );
521
+ }
522
+ }
523
+ });
524
+
525
+ /*
526
+ We need to make sure that when the user has selected text inside a
527
+ table cell we do not delete the entire row, before we activate this
528
+
529
+ this.obj.bind( 'keyup', function ( $event ) {
530
+ if ( $event.keyCode == 46 ) {
531
+ if ( that.selection.selectedColumnIdxs.length ) {
532
+ that.deleteColumns();
533
+ $event.stopPropagation();
534
+ } else if ( that.selection.selectedRowIdxs.length ) {
535
+ that.deleteRows();
536
+ $event.stopPropagation();
537
+ } else {
538
+ // Nothing to delete
539
+ }
540
+ }
541
+ } );
542
+ */
543
+
544
+ // handle click event of the table
545
+ // this.obj.bind('click', function(e){
546
+ // // stop bubbling the event to the outer divs, a click in the table
547
+ // // should only be handled in the table
548
+ // e.stopPropagation();
549
+ // return false;
550
+ // });
551
+ //
552
+
553
+ // handle column/row resize
554
+ eventContainer.delegate( 'td', 'mousemove', function( e ) {
555
+
556
+ var jqObj = jQuery( this );
557
+ // offset to be used for activating the resize cursor near a table border
558
+ var mouseOffset = 3;
559
+
560
+ // filter out the control cells
561
+ if ( jQuery( this ).hasClass( 'aloha-table-selectrow' ) || jQuery( this ).closest( 'tr' ).hasClass( 'aloha-table-selectcolumn' ))
562
+ return;
563
+
564
+ var closeToLeftBorder = function(cell) {
565
+ return ( ( e.pageX - cell.offset().left ) < mouseOffset );
566
+ };
567
+
568
+ var closeToTopBorder = function(cell) {
569
+ return ( ( e.pageY - cell.offset().top ) < mouseOffset );
570
+ };
571
+
572
+ var closeToTableBottom = function(cell) {
573
+ var row = cell.closest( 'tr');
574
+ // check if it's the last row
575
+ if ( row.next( 'tr').length > 0 ) {
576
+ return false
577
+ }
578
+
579
+ var cursorOffset = e.pageY - ( row.offset().top + row.outerHeight() );
580
+ return cursorOffset > (mouseOffset * -1) && cursorOffset < mouseOffset;
581
+ }
582
+
583
+ var colResize = that.tablePlugin.colResize;
584
+ var rowResize = that.tablePlugin.rowResize;
585
+
586
+ if ( colResize && closeToLeftBorder( jqObj ) ) {
587
+ jqObj.css( 'cursor', 'col-resize' );
588
+ return that.attachColumnResize( jqObj );
589
+ } else if ( rowResize && closeToTopBorder( jqObj ) ) {
590
+ jqObj.css( 'cursor', 'row-resize' );
591
+ return that.attachRowResize( jqObj );
592
+ } else if ( rowResize && closeToTableBottom( jqObj ) ) {
593
+ jqObj.css( 'cursor', 'row-resize' );
594
+ return that.attachRowResize( jqObj, true );
595
+ } else {
596
+ jqObj.css( 'cursor', 'default' );
597
+ return that.detachRowColResize( jqObj );
598
+ }
599
+ });
600
+
601
+ eventContainer.bind( 'mousemove', function( e ) {
602
+
603
+ var jqObj = jQuery( this ).closest( 'table' );
604
+
605
+ var isTableRightBorder = function( table ) {
606
+ var cursorOffset = e.pageX - ( table.offset().left + table.outerWidth() );
607
+ return cursorOffset > -5 && cursorOffset < 5;
608
+ };
609
+
610
+ var tableResize = that.tablePlugin.tableResize;
611
+
612
+ if ( tableResize && isTableRightBorder( jqObj ) ) {
613
+ return that.attachTableResizeWidth( jqObj );
614
+ }
615
+
616
+ });
617
+
618
+ eventContainer.bind( 'mousedown', function ( jqEvent ) {
619
+ // focus the table if not already done
620
+ if ( !that.hasFocus ) {
621
+ that.focus();
622
+ }
623
+
624
+
625
+ // DEACTIVATED by Haymo prevents selecting rows
626
+ // // if a mousedown is done on the table, just focus the first cell of the table
627
+ // setTimeout(function() {
628
+ // var firstCell = that.obj.find('tr:nth-child(2) td:nth-child(2)').children('div[contenteditable=true]').get(0);
629
+ // TableSelection.unselectCells();
630
+ // jQuery(firstCell).get(0).focus();
631
+ // // move focus in first cell
632
+ // that.obj.cells[0].wrapper.get(0).focus();
633
+ // }, 0);
634
+
635
+ // stop bubbling and default-behaviour
636
+ jqEvent.stopPropagation();
637
+ jqEvent.preventDefault();
638
+ return false;
639
+ } );
640
+
641
+ // ### create a wrapper for the table (@see HINT below)
642
+ // wrapping div for the table to suppress the display of the resize-controls of
643
+ // the editable divs within the cells
644
+ // tha data-block-skip-scope attribute will keep the block plugin from setting the
645
+ // FloatingMenu's scope when the block is clicked
646
+ tableWrapper = jQuery(
647
+ '<div class="' + this.get( 'classTableWrapper' ) + '" data-block-skip-scope="true"></div>'
648
+ );
649
+ tableWrapper.contentEditable( false );
650
+
651
+ // wrap the tableWrapper around the table
652
+ this.obj.wrap( tableWrapper );
653
+
654
+ // Check because the aloha block plugin may not be loaded
655
+ var parent = this.obj.parent();
656
+ if (parent.alohaBlock) {
657
+ parent.alohaBlock();
658
+ }
659
+
660
+ // :HINT The outest div (Editable) of the table is still in an editable
661
+ // div. So IE will surround the the wrapper div with a resize-border
662
+ // Workaround => just disable the handles so hopefully won't happen any ugly stuff.
663
+ // Disable resize and selection of the controls (only IE)
664
+ // Events only can be set to elements which are loaded from the DOM (if they
665
+ // were created dynamically before) ;)
666
+
667
+ htmlTableWrapper = this.obj.parents( '.' + this.get( 'classTableWrapper' ) );
668
+ htmlTableWrapper.get( 0 ).onresizestart = function ( e ) { return false; };
669
+ htmlTableWrapper.get( 0 ).oncontrolselect = function ( e ) { return false; };
670
+ htmlTableWrapper.get( 0 ).ondragstart = function ( e ) { return false; };
671
+ htmlTableWrapper.get( 0 ).onmovestart = function ( e ) { return false; };
672
+ // the following handler prevents proper selection in the editable div in the caption!
673
+ // htmlTableWrapper.get( 0 ).onselectstart = function ( e ) { return false; };
674
+
675
+ this.tableWrapper = this.obj.parents( '.' + this.get( 'classTableWrapper' ) ).get( 0 );
676
+
677
+ jQuery( this.cells ).each( function () {
678
+ this.activate();
679
+ } );
680
+
681
+ // after the cells where replaced with contentEditables ... add selection cells
682
+ // first add the additional columns on the left side
683
+ this.attachSelectionColumn();
684
+ // then add the additional row at the top
685
+ this.attachSelectionRow();
686
+ this.makeCaptionEditable();
687
+ this.checkWai();
688
+ this.isActive = true;
689
+
690
+ Aloha.trigger( 'aloha-table-activated' );
691
+ };
692
+
693
+ /**
694
+ * Make the table caption editable (if present)
695
+ */
696
+ Table.prototype.makeCaptionEditable = function() {
697
+ var caption = this.obj.find('caption').eq(0);
698
+ if (caption) {
699
+ this.tablePlugin.makeCaptionEditable(caption);
700
+ }
701
+ };
702
+
703
+ /**
704
+ * check the WAI conformity of the table and sets the attribute.
705
+ */
706
+ Table.prototype.checkWai = function () {
707
+ var w = this.wai;
708
+ if (!w) {
709
+ return;
710
+ }
711
+
712
+ w.removeClass(this.get('waiGreen'));
713
+ w.removeClass(this.get('waiRed'));
714
+
715
+ // Y U NO explain why we must check that summary is longer than 5 characters?
716
+ // http://cdn3.knowyourmeme.com/i/000/089/665/original/tumblr_l96b01l36p1qdhmifo1_500.jpg
717
+
718
+ if (jQuery.trim(this.obj[0].summary) != '') {
719
+ w.addClass(this.get('waiGreen'));
720
+ } else {
721
+ w.addClass(this.get('waiRed'));
722
+ }
723
+ };
724
+
725
+ /**
726
+ * Add the selection-column to the left side of the table and attach the events
727
+ * for selection rows
728
+ *
729
+ * @return void
730
+ */
731
+ Table.prototype.attachSelectionColumn = function() {
732
+ // create an empty cell
733
+ var emptyCell = jQuery('<td>'),
734
+ rowIndex, columnToInsert, rowObj, that = this, rows, i;
735
+
736
+ // set the unicode '&nbsp;' code
737
+ emptyCell.html('\u00a0');
738
+
739
+ that = this;
740
+ rows = this.obj.context.rows;
741
+
742
+ // add a column before each first cell of each row
743
+ for ( i = 0; i < rows.length; i++) {
744
+ rowObj = jQuery(rows[i]);
745
+ columnToInsert = emptyCell.clone();
746
+ columnToInsert.addClass(this.get('classSelectionColumn'));
747
+ columnToInsert.css('width', this.get('selectionArea') + 'px');
748
+ //rowObj.find('td:first').before(columnToInsert);
749
+ rowObj.prepend(columnToInsert);
750
+ // rowIndex + 1 because an addtional row is still added
751
+ rowIndex = i + 1;
752
+
753
+ // this method sets the selection-events to the cell
754
+ this.attachRowSelectionEventsToCell(columnToInsert);
755
+ }
756
+ };
757
+
758
+ /**
759
+ * Binds the needed selection-mouse events to the given cell
760
+ *
761
+ * @param cell
762
+ * The jquery object of the table-data field
763
+ * @return void
764
+ */
765
+ Table.prototype.attachRowSelectionEventsToCell = function(cell){
766
+ var that = this;
767
+
768
+ // unbind eventually existing events of this cell
769
+ cell.unbind('mousedown');
770
+ cell.unbind('mouseover');
771
+
772
+ // prevent ie from selecting the contents of the table
773
+ cell.get(0).onselectstart = function() { return false; };
774
+
775
+ cell.bind('mousedown', function(e) {
776
+ // set flag that the mouse is pressed
777
+ //TODO to implement the mousedown-select effect not only must the
778
+ //mousedown be set here but also be unset when the mouse button is
779
+ //released.
780
+ // that.mousedown = true;
781
+ return that.rowSelectionMouseDown(e);
782
+ });
783
+
784
+ cell.bind('mouseover', function(e){
785
+ // only select more crows if the mouse is pressed
786
+ if ( that.mousedown ) {
787
+ return that.rowSelectionMouseOver(e);
788
+ }
789
+ });
790
+ };
791
+
792
+ /**
793
+ * Mouse-Down event for the selection-cells on the left side of the table
794
+ *
795
+ * @param jqEvent
796
+ * the jquery-event object
797
+ * @return void
798
+ */
799
+ Table.prototype.rowSelectionMouseDown = function ( jqEvent ) {
800
+ // focus the table (if not already done)
801
+ this.focus();
802
+
803
+ // if no cells are selected, reset the selection-array
804
+ if ( this.selection.selectedCells.length == 0 ) {
805
+ this.rowsToSelect = [];
806
+ }
807
+
808
+ // set the origin-rowId of the mouse-click
809
+ this.clickedRowId = jqEvent.currentTarget.parentNode.rowIndex;
810
+
811
+ // set single column selection
812
+ if ( jqEvent.metaKey ) {
813
+ var arrayIndex = jQuery.inArray( this.clickedRowId, this.rowsToSelect );
814
+ if ( arrayIndex >= 0 ) {
815
+ this.rowsToSelect.splice( arrayIndex, 1 );
816
+ } else {
817
+ this.rowsToSelect.push( this.clickedRowId );
818
+ }
819
+ // block of columns selection
820
+ } else if ( jqEvent.shiftKey ) {
821
+ this.rowsToSelect.sort( function( a, b ) { return a - b; } );
822
+ var start = this.rowsToSelect[ 0 ];
823
+ var end = this.clickedRowId;
824
+ if ( start > end ) {
825
+ start = end;
826
+ end = this.rowsToSelect[ 0 ];
827
+ }
828
+ this.rowsToSelect = [];
829
+ for ( var i = start; i <= end; i++ ) {
830
+ this.rowsToSelect.push( i );
831
+ }
832
+ // single column
833
+ } else {
834
+ this.rowsToSelect = [ this.clickedRowId ];
835
+ }
836
+
837
+ // mark the selection visual
838
+ this.selectRows();
839
+
840
+ // prevent browser from selecting the table
841
+ jqEvent.preventDefault();
842
+
843
+ // stop bubble, otherwise the mousedown of the table is called ...
844
+ jqEvent.stopPropagation();
845
+
846
+ this.tablePlugin.summary.focus();
847
+
848
+ // prevent ff/chrome/safare from selecting the contents of the table
849
+ return false;
850
+ };
851
+
852
+ /**
853
+ * The mouse-over event for the selection-cells on the left side of the table.
854
+ * On mouse-over check which column was clicked, calculate the span between
855
+ * clicked and mouse-overed cell and mark them as selected
856
+ *
857
+ * @param jqEvent
858
+ * the jquery-event object
859
+ * @return void
860
+ */
861
+ Table.prototype.rowSelectionMouseOver = function (jqEvent) {
862
+ var rowIndex = jqEvent.currentTarget.parentNode.rowIndex,
863
+ indexInArray, start, end, i;
864
+
865
+ // only select the row if the mouse was clicked and the clickedRowId isn't
866
+ // from the selection-row (row-id = 0)
867
+ if (this.mousedown && this.clickedRowId >= 0) {
868
+
869
+ // select first cell
870
+ //var firstCell = this.obj.find('tr:nth-child(2) td:nth-child(2)').children('div[contenteditable=true]').get(0);
871
+ //jQuery(firstCell).get(0).focus();
872
+
873
+ indexInArray = jQuery.inArray(rowIndex, this.rowsToSelect);
874
+
875
+ start = (rowIndex < this.clickedRowId) ? rowIndex : this.clickedRowId;
876
+ end = (rowIndex < this.clickedRowId) ? this.clickedRowId : rowIndex;
877
+
878
+ this.rowsToSelect = new Array();
879
+ for ( i = start; i <= end; i++) {
880
+ this.rowsToSelect.push(i);
881
+ }
882
+
883
+ // this actually selects the rows
884
+ this.selectRows();
885
+
886
+ // prevent browser from selecting the table
887
+ jqEvent.preventDefault();
888
+
889
+ // stop bubble, otherwise the mousedown of the table is called ...
890
+ jqEvent.stopPropagation();
891
+
892
+ // prevent ff/chrome/safare from selecting the contents of the table
893
+ return false;
894
+ }
895
+ };
896
+
897
+ /**
898
+ * Binds the needed selection-mouse events to the given cell
899
+ *
900
+ * @param cell
901
+ * The jquery object of the table-data field
902
+ * @return void
903
+ */
904
+ Table.prototype.attachSelectionRow = function () {
905
+ var that = this;
906
+
907
+ // create an empty td
908
+ var emptyCell = jQuery('<td>');
909
+ emptyCell.html('\u00a0');
910
+
911
+ // get the number of columns in the table (first row)
912
+ // iterate through all rows and find the maximum number of columns to add
913
+ var numColumns = 0;
914
+ for( var i = 0; i < this.obj.context.rows.length; i++ ){
915
+ var curNumColumns = 0;
916
+
917
+ for( var j = 0; j < this.obj.context.rows[i].cells.length; j++ ){
918
+ var colspan = Utils.colspan( this.obj.context.rows[i].cells[j] );
919
+ curNumColumns += colspan;
920
+ }
921
+
922
+ if( numColumns < curNumColumns ) {
923
+ numColumns = curNumColumns;
924
+ }
925
+ }
926
+
927
+ var selectionRow = jQuery('<tr>');
928
+ selectionRow.addClass(this.get('classSelectionRow'));
929
+ selectionRow.css('height', this.get('selectionArea') + 'px');
930
+
931
+ for (var i = 0; i < numColumns; i++) {
932
+
933
+ var columnToInsert = emptyCell.clone();
934
+ // the first cell should have no function, so only attach the events for
935
+ // the rest
936
+ if (i > 0) {
937
+ // bind all mouse-events to the cell
938
+ this.attachColumnSelectEventsToCell(columnToInsert);
939
+ //set the colspan of selection column to match the colspan of first row columns
940
+ } else {
941
+ var columnToInsert = jQuery('<td>').clone();
942
+ columnToInsert.addClass(this.get('classLeftUpperCorner'));
943
+ var clickHandler = function (e) {
944
+ // select the Table
945
+ that.focus();
946
+ that.selection.selectAll();
947
+
948
+ // set the selection type before updating the scope
949
+ that.tablePlugin.activeTable.selection.selectionType = 'cell';
950
+ that.tablePlugin.updateFloatingMenuScope();
951
+
952
+ // As side-effect of the following call the focus
953
+ // will be set on the first selected cell.
954
+ // This will be overwritten with the summary
955
+ // attribute-field, if the setting summaryinsidebar
956
+ // is false.
957
+ that._removeCursorSelection();
958
+
959
+ //If the summary should be modified in the sidebar
960
+ //we activate the sidebar panel
961
+ if (that.tablePlugin.settings.summaryinsidebar) {
962
+ that.tablePlugin.sidebar.open();
963
+ that.tablePlugin.sidebarPanel.activate(that.obj);
964
+ that.tablePlugin.sidebar.correctHeight();
965
+ }
966
+
967
+ // jump in Summary field
968
+ // attempting to focus on summary input field will occasionally result in the
969
+ // following exception:
970
+ //uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLInputElement.setSelectionRange]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: src/dep/ext-3.2.1/ext-all.js :: <TOP_LEVEL> :: line 11" data: no]
971
+ // this occurs when the tab in which the summary field is contained is not visible
972
+ // TODO: I'm adding a try catch clause here for the time being, but a proper solution, which addresses the problem of how to handle invisible fields ought to be persued.
973
+
974
+ try {
975
+ that.tablePlugin.summary.focus();
976
+ e.stopPropagation();
977
+ e.preventDefault();
978
+ } catch (e) {
979
+ }
980
+
981
+ return false;
982
+ };
983
+ this.wai = jQuery('<div/>').width(25).height(12).click(clickHandler);
984
+ columnToInsert.append(this.wai);
985
+ }
986
+
987
+ // add the cell to the row
988
+ selectionRow.append(columnToInsert);
989
+ }
990
+
991
+ // global mouseup event to reset the selection properties
992
+ jQuery(document).bind('mouseup', function(e) { that.columnSelectionMouseUp(e) } );
993
+
994
+ this.obj.find('tr:first').before( selectionRow );
995
+ };
996
+
997
+ /**
998
+ * Binds the events for the column selection to the given cell.
999
+ *
1000
+ * @param cell
1001
+ * the jquery object of the td-field
1002
+ * @return void
1003
+ */
1004
+ Table.prototype.attachColumnSelectEventsToCell = function ( cell ) {
1005
+ var that = this;
1006
+
1007
+ // unbind eventually existing events of this cell
1008
+ cell.unbind( 'mousedown' );
1009
+ cell.unbind( 'mouseover' );
1010
+
1011
+ // prevent ie from selecting the contents of the table
1012
+ cell.get( 0 ).onselectstart = function () { return false; };
1013
+
1014
+ cell.bind( 'mousedown', function ( e ) { that.columnSelectionMouseDown( e ) } );
1015
+ cell.bind( 'mouseover', function ( e ) { that.columnSelectionMouseOver( e ) } );
1016
+ };
1017
+
1018
+ /**
1019
+ * Handles the mouse-down event for the selection-cells on the top of the
1020
+ * menu
1021
+ *
1022
+ * @param {jQuery:Event} jqEvent - the jquery-event object
1023
+ * @return void
1024
+ */
1025
+ Table.prototype.columnSelectionMouseDown = function ( jqEvent ) {
1026
+ // focus the table (if not already done)
1027
+ this.focus();
1028
+
1029
+ // if no cells are selected, reset the selection-array
1030
+ if ( this.selection.selectedCells.length == 0 ) {
1031
+ this.columnsToSelect = [];
1032
+ }
1033
+
1034
+ // set the origin-columnId of the mouse-click
1035
+ this.clickedColumnId = jQuery( jqEvent.currentTarget.parentNode )
1036
+ .children().index( jqEvent.currentTarget );
1037
+
1038
+ // set single column selection
1039
+ if ( jqEvent.metaKey ) {
1040
+ var arrayIndex = jQuery.inArray( this.clickedColumnId, this.columnsToSelect );
1041
+ if ( arrayIndex >= 0 ) {
1042
+ this.columnsToSelect.splice( arrayIndex, 1 );
1043
+ } else {
1044
+ this.columnsToSelect.push( this.clickedColumnId );
1045
+ }
1046
+ // block of columns selection
1047
+ } else if ( jqEvent.shiftKey ) {
1048
+ this.columnsToSelect.sort( function( a, b ) { return a - b; } );
1049
+ var start = this.columnsToSelect[ 0 ];
1050
+ var end = this.clickedColumnId;
1051
+ if ( start > end ) {
1052
+ start = end;
1053
+ end = this.columnsToSelect[ 0 ];
1054
+ }
1055
+ this.columnsToSelect = [];
1056
+ for ( var i = start; i <= end; i++ ) {
1057
+ this.columnsToSelect.push( i );
1058
+ }
1059
+ // single column
1060
+ } else {
1061
+ this.columnsToSelect = [ this.clickedColumnId ];
1062
+ }
1063
+
1064
+ // mark the selection visual
1065
+ this.selectColumns();
1066
+
1067
+ // prevent browser from selecting the table
1068
+ jqEvent.preventDefault();
1069
+
1070
+ // stop bubble, otherwise the mousedown of the table is called ...
1071
+ jqEvent.stopPropagation();
1072
+
1073
+ // prevent ff/chrome/safare from selecting the contents of the table
1074
+ return false;
1075
+ };
1076
+
1077
+ /**
1078
+ * Mouseover-event for the column-selection cell. This method calcluates the
1079
+ * span between the clicked column and the mouse-overed cell and selects the
1080
+ * columns inbetween. and mark them as selected
1081
+ *
1082
+ * @param jqEvent
1083
+ * the jquery-event object
1084
+ * @return void
1085
+ */
1086
+ Table.prototype.columnSelectionMouseOver = function (jqEvent) {
1087
+
1088
+ var
1089
+ colIdx = jqEvent.currentTarget.cellIndex,
1090
+ columnsToSelect = [],
1091
+ start,
1092
+ end;
1093
+
1094
+ // select all columns from the last clicked to the hoverd
1095
+ if ( this.mouseDownColIdx ) {
1096
+ start = (colIdx < this.mouseDownColIdx) ? colIdx : this.mouseDownColIdx;
1097
+ end = (colIdx < this.mouseDownColIdx) ? this.mouseDownColIdx : colIdx;
1098
+ for (var i = start; i <= end; i++) {
1099
+ columnsToSelect.push(i);
1100
+ }
1101
+ this.selectColumns( columnsToSelect );
1102
+ }
1103
+ };
1104
+
1105
+ /**
1106
+ * MouseUp-event for the column-selection. This method resets the
1107
+ * selection mode
1108
+ *
1109
+ * @param jqEvent
1110
+ * the jquery-event object
1111
+ * @return void
1112
+ */
1113
+ Table.prototype.columnSelectionMouseUp = function (jqEvent) {
1114
+ this.mouseDownColIdx = false;
1115
+ };
1116
+
1117
+ /**
1118
+ * Deletes the selected rows. If no row are selected, delete the row, where the
1119
+ * cursor is positioned. If all rows of the table should be deleted, the whole
1120
+ * table is deletet and removed from the tableRegistry.
1121
+ *
1122
+ * @return void
1123
+ */
1124
+ Table.prototype.deleteRows = function() {
1125
+ var
1126
+ rowIDs = [],
1127
+ rowsToDelete = {},
1128
+ table = this;
1129
+
1130
+ // if a selection was made, delete the selected cells
1131
+ if (0 === this.selection.selectedCells.length) {
1132
+ return;
1133
+ }
1134
+
1135
+ for (var i = 0; i < this.selection.selectedCells.length; i++) {
1136
+ rowsToDelete[this.selection.selectedCells[i].parentNode.rowIndex] = true;
1137
+ }
1138
+
1139
+ for (rowId in rowsToDelete) {
1140
+ rowIDs.push(rowId);
1141
+ }
1142
+
1143
+ // if all rows should be deleted, set a flag to remove the WHOLE table
1144
+ var deleteTable = false;
1145
+ if (rowIDs.length == this.numRows) {
1146
+ deleteTable = true;
1147
+ }
1148
+
1149
+ // delete the whole table
1150
+ if (deleteTable) {
1151
+ var that = this;
1152
+ Dialog.confirm({
1153
+ title : i18n.t('Table'),
1154
+ text : i18n.t('deletetable.confirm'),
1155
+ yes : function () {
1156
+ that.deleteTable();
1157
+ }
1158
+ });
1159
+ } else {
1160
+
1161
+ rowIDs.sort(function(a,b){return a - b;});
1162
+
1163
+ // check which cell should be focused after the deletion
1164
+ var focusRowId = rowIDs[0];
1165
+ if (focusRowId > (this.numRows - rowIDs.length)) {
1166
+ focusRowId --;
1167
+ }
1168
+
1169
+ // get all rows
1170
+ var rows = this.getRows();
1171
+
1172
+ //splits all cells on the rows to be deleted
1173
+ jQuery.each( rowIDs, function ( unused, rowId ) {
1174
+ var row = rows[ rowId ];
1175
+ for (var i = 0; i < row.cells.length; i++) {
1176
+ Utils.splitCell( row.cells[i], function () {
1177
+ return table.newActiveCell().obj;
1178
+ });
1179
+ }
1180
+ });
1181
+
1182
+ //decreases rowspans of cells that span the row to be deleted
1183
+ //and removes the row
1184
+ var grid = Utils.makeGrid( rows );
1185
+ jQuery.each( rowIDs, function ( unused, rowId ) {
1186
+ var row = grid[ rowId ];
1187
+ for ( var j = 0; j < row.length; ) {
1188
+ var cellInfo = row[ j ];
1189
+ var rowspan = Utils.rowspan( cellInfo.cell );
1190
+ if ( 1 < rowspan ) {
1191
+ jQuery( cellInfo.cell ).attr( 'rowspan', rowspan - 1);
1192
+ }
1193
+ j += cellInfo.colspan;
1194
+ }
1195
+ jQuery( rows[ rowId ] ).remove();
1196
+ });
1197
+
1198
+ // reduce the attribute storing the number of rows in the table
1199
+ this.numRows -= rowIDs.length;
1200
+
1201
+ // IE needs a timeout to work properly
1202
+ window.setTimeout( function() {
1203
+ var lastCell = jQuery( rows[1].cells[ focusRowId +1 ] );
1204
+ lastCell.focus();
1205
+ }, 5);
1206
+
1207
+ // finally unselect the marked cells
1208
+ this.selection.unselectCells();
1209
+ }
1210
+ };
1211
+
1212
+ /**
1213
+ * Deletes the selected columns. If no columns are selected, delete the column, where the
1214
+ * cursor is positioned. If all columns of the table should be deleted, the whole
1215
+ * table is deleted from the dom and removed from the tableRegistry.
1216
+ *
1217
+ * @return void
1218
+ */
1219
+ Table.prototype.deleteColumns = function() {
1220
+ var
1221
+ colIDs = [],
1222
+ cellToDelete = [],
1223
+ // get all rows to iterate
1224
+ rows = this.getRows(),
1225
+ that = this,
1226
+ changeColspan = [],
1227
+ cells,
1228
+ cellInfo;
1229
+
1230
+ var grid = Utils.makeGrid(rows);
1231
+ var selectColWidth = 1; //width of the select-row column
1232
+
1233
+ // if all columns should be deleted, remove the WHOLE table
1234
+ // delete the whole table
1235
+ if ( this.selection.selectedColumnIdxs.length == grid[0].length - selectColWidth ) {
1236
+
1237
+ Dialog.confirm({
1238
+ title : i18n.t('Table'),
1239
+ text : i18n.t('deletetable.confirm'),
1240
+ yes : function () {
1241
+ that.deleteTable();
1242
+ }
1243
+ });
1244
+
1245
+ } else {
1246
+
1247
+ colIDs.sort(function(a,b) {return a - b;} );
1248
+
1249
+ //TODO there is a bug that that occurs if a column is
1250
+ //selected and deleted, and then a column with a greater
1251
+ //x-index is selected and deleted.
1252
+
1253
+ //sorted so we delete from right to left to minimize interfernce of deleted rows
1254
+ var gridColumns = this.selection.selectedColumnIdxs.sort(function(a,b){ return b - a; });
1255
+ for (var i = 0; i < gridColumns.length; i++) {
1256
+ var gridColumn = gridColumns[i];
1257
+ for (var j = 0; j < rows.length; j++) {
1258
+ var cellInfo = grid[j][gridColumn];
1259
+ if ( ! cellInfo ) {
1260
+ //TODO this case occurred because of a bug somewhere which should be fixed
1261
+ continue;
1262
+ }
1263
+ if ( 0 === cellInfo.spannedX ) {
1264
+ if (1 < cellInfo.colspan) {
1265
+ var nCell = this.newActiveCell().obj;
1266
+ jQuery( cellInfo.cell ).after(nCell);
1267
+ nCell.attr('rowspan', cellInfo.rowspan);
1268
+ nCell.attr('colspan', cellInfo.colspan - 1);
1269
+ }
1270
+ jQuery( cellInfo.cell ).remove();
1271
+ } else {
1272
+ jQuery( cellInfo.cell ).attr('colspan', cellInfo.colspan - 1);
1273
+ }
1274
+ //ensures that always 0 === cellInfo.spannedY
1275
+ j += cellInfo.rowspan - 1;
1276
+ }
1277
+ //rebuild the grid to reflect the table structure change
1278
+ grid = Utils.makeGrid(rows);
1279
+ }
1280
+
1281
+ // reduce the attribute storing the number of rows in the table
1282
+ this.numCols -= colIDs.length;
1283
+
1284
+ // IE needs a timeout to work properly
1285
+ window.setTimeout( function() {
1286
+ var lastCell = jQuery( rows[1].cells[1] );
1287
+ lastCell.focus();
1288
+ }, 5);
1289
+
1290
+ this.selection.unselectCells();
1291
+ }
1292
+ };
1293
+
1294
+ /**
1295
+ * Deletes the table from the dom and remove it from the tableRegistry.
1296
+ *
1297
+ * @return void
1298
+ */
1299
+ Table.prototype.deleteTable = function() {
1300
+ var deleteIndex = -1;
1301
+ for (var i = 0; i < this.tablePlugin.TableRegistry.length; i++){
1302
+ if (this.tablePlugin.TableRegistry[i].obj.attr('id') == this.obj.attr('id')) {
1303
+ deleteIndex = i;
1304
+ break;
1305
+ }
1306
+ }
1307
+ if (deleteIndex >= 0) {
1308
+ // before deleting the table, deactivate it
1309
+ this.deactivate();
1310
+
1311
+ this.selection.selectionType = undefined;
1312
+ this.tablePlugin.TableRegistry.splice(i, 1);
1313
+
1314
+ // we will set the cursor right before the removed table
1315
+ var newRange = Aloha.Selection.rangeObject;
1316
+ // TODO set the correct range here (cursor shall be right before the removed table)
1317
+ newRange.endContainer = this.obj.get(0).parentNode;
1318
+ newRange.startContainer = newRange.endContainer;
1319
+
1320
+ newRange.endOffset = GENTICS.Utils.Dom.getIndexInParent(this.obj.get(0));
1321
+ newRange.startOffset = newRange.endOffset;
1322
+
1323
+ newRange.clearCaches();
1324
+
1325
+ this.obj.remove();
1326
+ this.parentEditable.obj.focus();
1327
+ // select the new range
1328
+ newRange.correctRange();
1329
+ newRange.select();
1330
+ }
1331
+ };
1332
+
1333
+ /**
1334
+ * @param {string} position
1335
+ * could be 'after' or 'before'. defines the position where the new
1336
+ * rows should be inserted
1337
+ */
1338
+ function rowIndexFromSelection( position, selection ) {
1339
+
1340
+ var newRowIndex = -1;
1341
+
1342
+ // get the index where the new rows should be inserted
1343
+ var cellOfInterest = null;
1344
+ if ( 'before' === position ) {
1345
+ cellOfInterest = selection.selectedCells[ 0 ];
1346
+ } else if ( 'after' === position ) {
1347
+ var offset = selection.selectedCells.length - 1;
1348
+ cellOfInterest = selection.selectedCells[ offset ];
1349
+ }
1350
+
1351
+ if (cellOfInterest && cellOfInterest.nodeType == 1) {
1352
+ newRowIndex = cellOfInterest.parentNode.rowIndex;
1353
+ }
1354
+
1355
+ return newRowIndex;
1356
+ }
1357
+
1358
+ /**
1359
+ * Wrapper function for this.addRow to add a row before the active row
1360
+ *
1361
+ * @see Table.prototype.addRow
1362
+ */
1363
+ Table.prototype.addRowBeforeSelection = function(highlightNewRows) {
1364
+ var newRowIndex = rowIndexFromSelection( 'before', this.selection );
1365
+ if ( -1 !== newRowIndex ) {
1366
+ this.addRow( newRowIndex );
1367
+ }
1368
+ };
1369
+
1370
+ /**
1371
+ * Wrapper function for this.addRow to add a row after the active row
1372
+ *
1373
+ * @see Table.prototype.addRow
1374
+ */
1375
+ Table.prototype.addRowAfterSelection = function() {
1376
+ var newRowIndex = rowIndexFromSelection( 'after', this.selection );
1377
+ if ( -1 !== newRowIndex ) {
1378
+ this.addRow( newRowIndex + 1 );
1379
+ }
1380
+ };
1381
+
1382
+ /**
1383
+ * Adds a new row to the table.
1384
+ *
1385
+ * @param {int} rowIndex
1386
+ * the index at which the new row shall be inserted
1387
+ */
1388
+ Table.prototype.addRow = function(newRowIndex) {
1389
+
1390
+ var that = this;
1391
+ var rowsToInsert = 1;
1392
+
1393
+ var numCols = this.countVirtualCols();
1394
+ var $rows = this.obj.children().children('tr');
1395
+ for (var j = 0; j < rowsToInsert; j++) {
1396
+ var insertionRow = jQuery('<tr>');
1397
+
1398
+ // create the first column, the "select row" column
1399
+ var selectionColumn = jQuery('<td>');
1400
+ selectionColumn.addClass(this.get('classSelectionColumn'));
1401
+ this.attachRowSelectionEventsToCell(selectionColumn);
1402
+ insertionRow.append(selectionColumn);
1403
+
1404
+ var grid = Utils.makeGrid($rows);
1405
+ var selectColOffset = 1;
1406
+ if ( newRowIndex >= grid.length ) {
1407
+ for (var i = selectColOffset; i < grid[0].length; i++) {
1408
+ insertionRow.append(this.newActiveCell().obj);
1409
+ }
1410
+ } else {
1411
+ for (var i = selectColOffset; i < grid[newRowIndex].length; ) {
1412
+ var cellInfo = grid[newRowIndex][i];
1413
+ if (Utils.containsDomCell(cellInfo)) {
1414
+ var colspan = cellInfo.colspan;
1415
+ while (colspan--) {
1416
+ insertionRow.append(this.newActiveCell().obj);
1417
+ }
1418
+ } else {
1419
+ jQuery( cellInfo.cell ).attr('rowspan', cellInfo.rowspan + 1);
1420
+ }
1421
+ i += cellInfo.colspan;
1422
+ }
1423
+ }
1424
+
1425
+ if ( newRowIndex >= $rows.length ) {
1426
+ $rows.eq( $rows.length - 1 ).after( insertionRow );
1427
+ } else {
1428
+ $rows.eq( newRowIndex ).before( insertionRow );
1429
+ }
1430
+ }
1431
+
1432
+ this.numRows += rowsToInsert;
1433
+ };
1434
+
1435
+ /**
1436
+ * Wrapper method to add columns on the right side
1437
+ *
1438
+ * @see Table.addColumns
1439
+ * @return void
1440
+ */
1441
+ Table.prototype.addColumnsRight = function () {
1442
+ this.addColumns('right');
1443
+ };
1444
+
1445
+ /**
1446
+ * Wrapper method to add columns on the left side
1447
+ *
1448
+ * @see Table.addColumns
1449
+ * @return void
1450
+ */
1451
+ Table.prototype.addColumnsLeft = function() {
1452
+ this.addColumns('left');
1453
+ };
1454
+
1455
+ /**
1456
+ * Inserts new columns into the table. Either on the right or left side. If
1457
+ * columns are selected, the amount of selected columns will be inserted on the
1458
+ * 'right' or 'left' side. If no cells are selected, 1 new column will be
1459
+ * inserted before/after the column of the last active cell.
1460
+ * As well all column-selection events must be bound to the firsts row-cell.
1461
+ *
1462
+ * @param position
1463
+ * could be 'left' or 'right'. defines the position where the new
1464
+ * columns should be inserted
1465
+ * @return void
1466
+ */
1467
+ Table.prototype.addColumns = function( position ) {
1468
+ var
1469
+ that = this,
1470
+ emptyCell = jQuery( '<td>' ),
1471
+ rows = this.getRows(),
1472
+ cell,
1473
+ currentColIdx,
1474
+ columnsToSelect = [],
1475
+ selectedColumnIdxs = this.selection.selectedColumnIdxs;
1476
+
1477
+ if ( 0 === selectedColumnIdxs.length ) {
1478
+ return;
1479
+ }
1480
+
1481
+ selectedColumnIdxs.sort( function ( a, b ) { return a - b; } );
1482
+
1483
+ // refuse to insert a column unless a consecutive range has been selected
1484
+ if ( ! Utils.isConsecutive( selectedColumnIdxs ) ) {
1485
+ Dialog.alert( {
1486
+ title : i18n.t( 'Table' ),
1487
+ text : i18n.t( 'table.addColumns.nonConsecutive' )
1488
+ });
1489
+ return;
1490
+ }
1491
+
1492
+ if ( 'left' === position ) {
1493
+ currentColIdx = selectedColumnIdxs[ 0 ];
1494
+ // inserting a row before the selected column indicies moves
1495
+ // all selected columns one to the right
1496
+ for ( var i = 0; i < this.selection.selectedColumnIdxs.length; i++ ) {
1497
+ this.selection.selectedColumnIdxs[ i ] += 1;
1498
+ }
1499
+ } else {//"right" == position
1500
+ currentColIdx = selectedColumnIdxs[ selectedColumnIdxs.length - 1 ];
1501
+ }
1502
+
1503
+ var grid = Utils.makeGrid( rows );
1504
+
1505
+ for ( var i = 0; i < rows.length; i++ ) {
1506
+ // prepare the cell to be inserted
1507
+ cell = emptyCell.clone();
1508
+ cell.html( '\u00a0' );
1509
+
1510
+ // on first row correct the position of the selected columns
1511
+ if ( i == 0 ) {
1512
+ // this is the first row, so make a column-selection cell
1513
+ this.attachColumnSelectEventsToCell( cell );
1514
+ } else {
1515
+ // activate the cell for this table
1516
+ cellObj = this.newActiveCell( cell.get(0) );
1517
+ cell = cellObj.obj;
1518
+ }
1519
+
1520
+ var leftCell = Utils.leftDomCell( grid, i, currentColIdx );
1521
+ if ( null == leftCell ) {
1522
+ jQuery( rows[i] ).prepend( cell );
1523
+ } else {
1524
+ if ( 'left' === position && Utils.containsDomCell( grid[ i ][ currentColIdx ] ) ) {
1525
+ jQuery( leftCell ).before( cell );
1526
+ } else {//right
1527
+ jQuery( leftCell ).after( cell );
1528
+ }
1529
+ }
1530
+
1531
+ this.numCols++;
1532
+ }
1533
+ };
1534
+
1535
+ /**
1536
+ * Helper method to set the focus-attribute of the table to true
1537
+ *
1538
+ * @return void
1539
+ */
1540
+ Table.prototype.focus = function() {
1541
+ if (!this.hasFocus) {
1542
+ if (!this.parentEditable.isActive) {
1543
+ this.parentEditable.obj.focus();
1544
+ }
1545
+
1546
+ // @iefix
1547
+ this.tablePlugin.setFocusedTable(this);
1548
+
1549
+ // select first cell
1550
+ // TODO put cursor in first cell without selecting
1551
+ //var firstCell = this.obj.find('tr:nth-child(2) td:nth-child(2)').children('div[contenteditable=true]').get(0);
1552
+ //jQuery(firstCell).get(0).focus();
1553
+
1554
+ }
1555
+
1556
+ // TODO workaround - fix this. the selection is updated later on by the browser
1557
+ // using setTimeout here is hideous, but a simple execution-time call will fail
1558
+ // DEACTIVATED by Haymo prevents selecting rows
1559
+ // setTimeout('Aloha.Selection.updateSelection(false, true)', 50);
1560
+
1561
+ };
1562
+
1563
+ /**
1564
+ * Helper method to set the focus-attribute of the table to false
1565
+ *
1566
+ * @return void
1567
+ */
1568
+ Table.prototype.focusOut = function() {
1569
+ if (this.hasFocus) {
1570
+ this.tablePlugin.setFocusedTable(undefined);
1571
+ this.selection.selectionType = undefined;
1572
+ }
1573
+ };
1574
+
1575
+ /**
1576
+ * Undoes the cursor-selection after cells have been selected. This
1577
+ * is done to be more consistent in the UI - there should either be
1578
+ * a cursor-selection or a cell-selection, but not both.
1579
+ */
1580
+ Table.prototype._removeCursorSelection = function() {
1581
+ // We can't remove the selection on IE because whenever a
1582
+ // row/column is selected, and then another row/column is
1583
+ // selected, the browser windows scrolls to the top of the page
1584
+ // (som kind of browser bug).
1585
+
1586
+ // This is no problem for IE because IE removes the
1587
+ // cursor-selection by itself and shows a frame around the
1588
+ // table, with resize handles (the frame seems useless).
1589
+
1590
+ // On other browsers, we can't remove the selection because the
1591
+ // floating menu will disappear when one selects a rows/column
1592
+ // and types a key (that's the same effect as when one clicks
1593
+ // outside the editable).
1594
+
1595
+ //TODO: currently, removing the cursor selection can't be
1596
+ // reliably implemented.
1597
+ //if ( ! jQuery.browser.msie ) {
1598
+ // Aloha.getSelection().removeAllRanges();
1599
+ //}
1600
+
1601
+ // The following is a workaround for the above because we can't
1602
+ // leave the cursor-selection outside of the table, since
1603
+ // otherwise the floating menu scope will be incorrect when one
1604
+ // CTRL-clicks on the rows or columns.
1605
+
1606
+ var selection = Aloha.getSelection();
1607
+
1608
+ if ( !selection ||
1609
+ !selection._nativeSelection ||
1610
+ selection._nativeSelection._ranges.length == 0 ) {
1611
+ return;
1612
+ }
1613
+
1614
+ var range = selection.getRangeAt( 0 );
1615
+ if ( null == range.startContainer ) {
1616
+ return;
1617
+ }
1618
+
1619
+ // if the selection is already in the table, do nothing
1620
+ if ( 0 !== jQuery( range.startContainer ).closest('table').length ) {
1621
+ return;
1622
+ }
1623
+
1624
+ // if no cells are selected, do nothing
1625
+ if ( 0 === this.selection.selectedCells.length ) {
1626
+ return;
1627
+ }
1628
+
1629
+ // set the foces to the first selected cell
1630
+ var container = TableCell.getContainer( this.selection.selectedCells[ 0 ] );
1631
+ jQuery( container ).focus();
1632
+ }
1633
+
1634
+ /**
1635
+ * Marks all cells of the specified column as marked (adds a special class)
1636
+ *
1637
+ * @return void
1638
+ */
1639
+ Table.prototype.selectColumns = function ( columns ) {
1640
+ var columnsToSelect;
1641
+
1642
+ if (columns) {
1643
+ columnsToSelect = columns;
1644
+ } else {
1645
+ columnsToSelect = this.columnsToSelect;
1646
+ }
1647
+
1648
+ Scopes.setScope(this.tablePlugin.name + '.column');
1649
+ this.selection.selectColumns(columnsToSelect);
1650
+ this.tablePlugin._columnheaderButton.setState(this.selection.isHeader());
1651
+
1652
+ // ====== BEGIN UI specific code - should be handled on event aloha-table-selection-changed by UI =======
1653
+
1654
+ setActiveStyle(this.selection.selectedCells, this.tablePlugin.columnConfig,
1655
+ this.tablePlugin.columnMSItems, this.tablePlugin.columnMSButton);
1656
+
1657
+ // ====== END UI specific code - should be handled by UI =======
1658
+
1659
+ // blur all editables within the table
1660
+ this.obj.find('div.aloha-ui-table-cell-editable').blur();
1661
+
1662
+ this.selection.notifyCellsSelected();
1663
+ this._removeCursorSelection();
1664
+ };
1665
+
1666
+ /**
1667
+ * Marks all cells of the specified row as marked (adds a special class)
1668
+ *
1669
+ * @return void
1670
+ */
1671
+ Table.prototype.selectRows = function () {
1672
+
1673
+ Scopes.setScope(this.tablePlugin.name + '.row');
1674
+ this.selection.selectRows(this.rowsToSelect);
1675
+ this.tablePlugin._rowheaderButton.setState(this.selection.isHeader());
1676
+
1677
+ // ====== BEGIN UI specific code - should be handled on event aloha-table-selection-changed by UI =======
1678
+
1679
+ setActiveStyle(this.selection.selectedCells, this.tablePlugin.rowConfig,
1680
+ this.tablePlugin.rowMSItems, this.tablePlugin.rowMSButton);
1681
+
1682
+ // ====== END UI specific code - should be handled by UI =======
1683
+
1684
+ // blur all editables within the table
1685
+ this.obj.find('div.aloha-ui-table-cell-editable').blur();
1686
+
1687
+ this.selection.notifyCellsSelected();
1688
+ this._removeCursorSelection();
1689
+ };
1690
+
1691
+ /**
1692
+ * Deactivation of a Aloha-table. Clean up ... remove the wrapping div and the
1693
+ * selection-helper divs
1694
+ *
1695
+ * @return void
1696
+ */
1697
+ Table.prototype.deactivate = function() {
1698
+ // unblockify the table wrapper
1699
+ var parent = this.obj.parent();
1700
+ if (parent.mahaloBlock) {
1701
+ parent.mahaloBlock();
1702
+ }
1703
+
1704
+ this.obj.removeClass(this.get('className'));
1705
+ if (jQuery.trim(this.obj.attr('class')) == '') {
1706
+ this.obj.removeAttr('class');
1707
+ }
1708
+ this.obj.removeAttr('contenteditable');
1709
+ // this.obj.removeAttr('id');
1710
+
1711
+ // unwrap the selectionLeft-div if available
1712
+ if (this.obj.parents('.' + this.get('classTableWrapper')).length){
1713
+ this.obj.unwrap();
1714
+ }
1715
+
1716
+ // remove the selection row
1717
+ this.obj.find('tr.' + this.get('classSelectionRow') + ':first').remove();
1718
+ // remove the selection column (first column left)
1719
+ var that = this;
1720
+ jQuery.each(this.obj.context.rows, function(){
1721
+ jQuery(this).children('td.' + that.get('classSelectionColumn')).remove();
1722
+ });
1723
+
1724
+ // remove the "selection class" from all td and th in the table
1725
+ this.obj.find('td, th').removeClass(this.get('classCellSelected'));
1726
+ this.obj.find('td, th').removeClass('aloha-table-cell_active');
1727
+
1728
+ // remove cursor-styles
1729
+ this.obj.find('td, th').css('cursor', '');
1730
+
1731
+ this.obj.unbind();
1732
+ this.obj.children('tbody').unbind();
1733
+
1734
+ // wrap the inner html of the contentEditable div to its outer html
1735
+ for (var i = 0; i < this.cells.length; i++) {
1736
+ var Cell = this.cells[i];
1737
+ Cell.deactivate();
1738
+ }
1739
+
1740
+ // remove editable span in caption (if any)
1741
+ this.obj.find('caption div').each(function() {
1742
+ jQuery(this).contents().unwrap();
1743
+ });
1744
+
1745
+ // better unset ;-) otherwise activate() may think you're activated.
1746
+ this.isActive = false;
1747
+ };
1748
+
1749
+ /**
1750
+ * Attach the event for column resize for the given cell.
1751
+ * @param {DOMElement} tableCell
1752
+ *
1753
+ * @return void
1754
+ */
1755
+ Table.prototype.attachColumnResize = function(cell) {
1756
+
1757
+ var that = this;
1758
+
1759
+ //unbind any exisiting resize event handlers
1760
+ that.detachRowColResize( cell );
1761
+
1762
+ var rows = cell.closest( 'tbody' ).children( 'tr' );
1763
+ var cellRow = cell.closest( 'tr' );
1764
+ var gridId = Utils.cellIndexToGridColumn( rows,
1765
+ rows.index( cellRow ),
1766
+ cellRow.children().index( cell )
1767
+ );
1768
+
1769
+ var resizeColumns = function(pixelsMoved) {
1770
+ var expandToWidth, reduceToWidth;
1771
+
1772
+ Utils.walkCells(rows, function(ri, ci, gridCi, colspan, rowspan) {
1773
+ var currentCell = jQuery( jQuery( rows[ri] ).children()[ ci ] );
1774
+
1775
+ // skip the select & cells with colspans
1776
+ if ( currentCell.hasClass( 'aloha-table-selectrow' ) || currentCell.closest( 'tr' ).hasClass( 'aloha-table-selectcolumn' ) || colspan > 1 ) {
1777
+ return true;
1778
+ }
1779
+
1780
+ if (gridCi === gridId ) {
1781
+ if (!reduceToWidth) {
1782
+ reduceToWidth = currentCell.width() - pixelsMoved;
1783
+ }
1784
+
1785
+ Utils.resizeCellWidth( currentCell, reduceToWidth );
1786
+
1787
+ } else if (gridCi === gridId - 1) {
1788
+ if (!expandToWidth) {
1789
+ expandToWidth = currentCell.width() + pixelsMoved;
1790
+ }
1791
+
1792
+ Utils.resizeCellWidth( currentCell, expandToWidth );
1793
+
1794
+ }
1795
+
1796
+ return true;
1797
+ });
1798
+ };
1799
+
1800
+ cell.bind( 'mousedown.resize', function() {
1801
+
1802
+ // create a guide
1803
+ var guide = jQuery( '<div></div>' );
1804
+ guide.css({
1805
+ 'height': jQuery( cell ).closest( 'tbody' ).innerHeight(),
1806
+ 'width': jQuery( cell ).outerWidth() - jQuery( cell ).innerWidth(),
1807
+ 'top': jQuery( cell ).closest( 'tbody' ).offset().top,
1808
+ 'left': jQuery( cell ).offset().left,
1809
+ 'position': 'absolute',
1810
+ 'background-color': '#80B5F2'
1811
+ });
1812
+ jQuery( 'body' ).append( guide );
1813
+
1814
+ Utils.getCellResizeBoundaries(gridId, rows, function(maxPageX, minPageX) {
1815
+
1816
+ // unset the selection type
1817
+ that.selection.resizeMode = true;
1818
+
1819
+ // move the guide while dragging
1820
+ jQuery( 'body' ).bind( 'mousemove.dnd_col_resize', function(e) {
1821
+ // limit the maximum resize
1822
+ if ( e.pageX > minPageX && e.pageX < maxPageX ) {
1823
+ guide.css( 'left', e.pageX );
1824
+ }
1825
+ });
1826
+
1827
+ // do the actual resizing after drag stops
1828
+ jQuery( 'body' ).bind( 'mouseup.dnd_col_resize', function(e) {
1829
+ var pixelsMoved = 0;
1830
+
1831
+ if ( e.pageX < minPageX ) {
1832
+ pixelsMoved = minPageX - cell.offset().left;
1833
+ } else if ( e.pageX > minPageX && e.pageX < maxPageX ) {
1834
+ pixelsMoved = e.pageX - cell.offset().left;
1835
+ } else if ( e.pageX > maxPageX ) {
1836
+ pixelsMoved = maxPageX - cell.offset().left;
1837
+ }
1838
+
1839
+ if ( pixelsMoved !== 0 ) {
1840
+ resizeColumns( pixelsMoved );
1841
+ }
1842
+
1843
+ jQuery( 'body' ).unbind( 'mousemove.dnd_col_resize' );
1844
+ jQuery( 'body' ).unbind( 'mouseup.dnd_col_resize' );
1845
+
1846
+ // unset the selection resize mode
1847
+ that.selection.resizeMode = false;
1848
+
1849
+ guide.remove();
1850
+ });
1851
+
1852
+ });
1853
+
1854
+ });
1855
+
1856
+ };
1857
+
1858
+ /**
1859
+ * Attach the event handler for row resize for the given cell.
1860
+ * @param {DOMElement} tableCell
1861
+ *
1862
+ * @return void
1863
+ */
1864
+ Table.prototype.attachRowResize = function(cell, lastRow) {
1865
+
1866
+ var that = this;
1867
+
1868
+ //unbind any exisiting resize event handlers
1869
+ that.detachRowColResize( cell );
1870
+
1871
+ var resizeRows = function(pixelsMoved) {
1872
+ var expandingRow;
1873
+
1874
+ if (lastRow) {
1875
+ expandingRow = cell.closest( 'tr' );
1876
+ } else {
1877
+ expandingRow = cell.closest( 'tr' ).prev( 'tr' );
1878
+ }
1879
+
1880
+ var currentRowHeight = expandingRow.height();
1881
+ var expandToHeight = currentRowHeight + pixelsMoved;
1882
+
1883
+ // correct if the height is a minus value
1884
+ if ( expandToHeight < 0 ) {
1885
+ expandToHeight = 1;
1886
+ }
1887
+
1888
+ expandingRow.css( 'height', expandToHeight );
1889
+ };
1890
+
1891
+ cell.bind( 'mousedown.resize', function(){
1892
+
1893
+ // create a guide
1894
+ var guide = jQuery( '<div></div>' );
1895
+
1896
+ var guideTop = function() {
1897
+ if (lastRow) {
1898
+ return cell.offset().top + cell.outerHeight();
1899
+ } else {
1900
+ return cell.offset().top;
1901
+ }
1902
+ };
1903
+
1904
+ guide.css({
1905
+ 'width': cell.closest( 'tbody' ).innerWidth(),
1906
+ 'height': cell.outerHeight() - cell.innerHeight(),
1907
+ 'top': guideTop(),
1908
+ 'left': cell.closest( 'tbody' ).offset().left,
1909
+ 'position': 'absolute',
1910
+ 'background-color': '#80B5F2'
1911
+ });
1912
+ jQuery( 'body' ).append( guide );
1913
+
1914
+ // set the minimum resize
1915
+ var minHeight = function() {
1916
+ if (lastRow) {
1917
+ return cell.closest('tr').offset().top;
1918
+ } else {
1919
+ return cell.closest('tr').prev( 'tr' ).offset().top;
1920
+ }
1921
+ };
1922
+
1923
+ // set the selection resize mode
1924
+ that.selection.resizeMode = true;
1925
+
1926
+ // move the guide while dragging
1927
+ jQuery( 'body' ).bind( 'mousemove.dnd_row_resize', function(e) {
1928
+ if ( e.pageY > minHeight() ) {
1929
+ guide.css( 'top', e.pageY );
1930
+ }
1931
+ });
1932
+
1933
+ // do the actual resizing after drag stops
1934
+ jQuery( 'body' ).bind( 'mouseup.dnd_row_resize', function(e) {
1935
+
1936
+ var pixelsMoved = 0;
1937
+
1938
+ if (lastRow) {
1939
+ pixelsMoved = e.pageY - ( cell.offset().top + cell.outerHeight() );
1940
+ } else {
1941
+ pixelsMoved = e.pageY - cell.offset().top;
1942
+ }
1943
+
1944
+ resizeRows( pixelsMoved );
1945
+
1946
+ jQuery( 'body' ).unbind( 'mousemove.dnd_row_resize' );
1947
+ jQuery( 'body' ).unbind( 'mouseup.dnd_row_resize' );
1948
+
1949
+ // unset the selection resize mode
1950
+ that.selection.resizeMode = false;
1951
+
1952
+ guide.remove();
1953
+ });
1954
+
1955
+ });
1956
+
1957
+ };
1958
+
1959
+ /**
1960
+ * Attach the table width resize event.
1961
+ * @param {DOMElement} table
1962
+ *
1963
+ * @return void
1964
+ */
1965
+ Table.prototype.attachTableResizeWidth = function(table) {
1966
+
1967
+ var that = this;
1968
+ var tableContainer = table.closest('.aloha-table-wrapper')
1969
+ var lastColumn = table.find("tr:not(.aloha-table-selectcolumn) td:last-child")
1970
+ var lastCell;
1971
+
1972
+ jQuery.each( lastColumn, function() {
1973
+ // don't use colspanned cell as the base cell
1974
+ if ( !jQuery( this ).attr('colspan') || jQuery( this ).attr('colspan') < 2 ) {
1975
+ lastCell = jQuery( this );
1976
+ return false;
1977
+ }
1978
+ });
1979
+
1980
+ // change the cursor
1981
+ lastColumn.css( 'cursor', 'col-resize' );
1982
+
1983
+ var resizeColumns = function(pixelsMoved) {
1984
+ var rows = table.find( 'tr' );
1985
+ var lastCellRow = lastCell.closest( 'tr' );
1986
+ var gridId = Utils.cellIndexToGridColumn( rows,
1987
+ rows.index( lastCellRow ),
1988
+ lastCellRow.children().index( lastCell )
1989
+ );
1990
+ var expandToWidth = pixelsMoved - Utils.getCellBorder(lastCell) - Utils.getCellPadding(lastCell);
1991
+
1992
+ Utils.walkCells(rows, function(ri, ci, gridCi, colspan, rowspan) {
1993
+ var currentCell = jQuery( jQuery( rows[ri] ).children()[ ci ] )
1994
+
1995
+ // skip the select cells and cells with colspans
1996
+ if ( currentCell.hasClass( 'aloha-table-selectrow' ) || currentCell.closest( 'tr' ).hasClass( 'aloha-table-selectcolumn' ) || colspan > 1 ) {
1997
+ return true;
1998
+ }
1999
+
2000
+ if (gridCi === gridId ) {
2001
+ Utils.resizeCellWidth( currentCell, expandToWidth );
2002
+ } else {
2003
+ Utils.resizeCellWidth( currentCell, currentCell.width() );
2004
+ }
2005
+
2006
+ return true;
2007
+ });
2008
+ };
2009
+
2010
+ lastColumn.bind( 'mousedown.resize', function() {
2011
+
2012
+ // create a guide
2013
+ var guide = jQuery( '<div></div>' );
2014
+ guide.css({
2015
+ 'height': table.children( 'tbody' ).innerHeight(),
2016
+ 'width': lastCell.outerWidth() - lastCell.innerWidth(),
2017
+ 'top': table.find('tbody').offset().top,
2018
+ 'left': table.offset().left + table.outerWidth(),
2019
+ 'position': 'absolute',
2020
+ 'background-color': '#80B5F2'
2021
+ });
2022
+ jQuery( 'body' ).append( guide );
2023
+
2024
+ // set the maximum and minimum resize
2025
+ var maxPageX = tableContainer.offset().left + tableContainer.width();
2026
+ var minPageX = lastCell.offset().left + ( lastCell.innerWidth() - lastCell.width() ) + Utils.getMinColWidth( lastCell );
2027
+
2028
+ // unset the selection type
2029
+ that.selection.resizeMode = true;
2030
+
2031
+ // move the guide while dragging
2032
+ jQuery( 'body' ).bind( 'mousemove.dnd_col_resize', function(e) {
2033
+ // limit the maximum resize
2034
+ if ( e.pageX > minPageX && e.pageX < maxPageX ) {
2035
+ guide.css( 'left', e.pageX );
2036
+ }
2037
+ });
2038
+
2039
+ // do the actual resizing after drag stops
2040
+ jQuery( 'body' ).bind( 'mouseup.dnd_col_resize', function(e) {
2041
+ var pixelsMoved = 0;
2042
+
2043
+ if ( e.pageX <= minPageX ) {
2044
+ pixelsMoved = minPageX - lastCell.offset().left;
2045
+ } else if ( e.pageX > minPageX && e.pageX < maxPageX ) {
2046
+ pixelsMoved = e.pageX - lastCell.offset().left;
2047
+ } else if ( e.pageX > maxPageX ) {
2048
+ pixelsMoved = maxPageX - lastCell.offset().left;
2049
+ }
2050
+
2051
+ // set the table width
2052
+ resizeColumns( pixelsMoved );
2053
+
2054
+ // unbind the events and reset the cursor
2055
+ jQuery( 'body' ).unbind( 'mousemove.dnd_col_resize' );
2056
+ jQuery( 'body' ).unbind( 'mouseup.dnd_col_resize' );
2057
+ lastColumn.unbind( 'mousedown.resize' );
2058
+ lastColumn.css( 'cursor', 'default' );
2059
+
2060
+ // unset the selection resize mode
2061
+ that.selection.resizeMode = false;
2062
+
2063
+ guide.remove();
2064
+ });
2065
+
2066
+ });
2067
+
2068
+ };
2069
+
2070
+ /**
2071
+ * Detach any column/row resize event handlers attached to the cell.
2072
+ * @param {DOMElement} tableCell
2073
+ *
2074
+ * @return void
2075
+ */
2076
+ Table.prototype.detachRowColResize = function(cell) {
2077
+ return cell.unbind('mousedown.resize');
2078
+ };
2079
+
2080
+ /**
2081
+ * toString-method for Table object
2082
+ *
2083
+ * @return void
2084
+ */
2085
+ Table.prototype.toString = function() {
2086
+ return 'Table';
2087
+ };
2088
+
2089
+ Table.prototype.newCell = function(domElement) {
2090
+ return new TableCell(domElement, this);
2091
+ };
2092
+
2093
+ Table.prototype.newActiveCell = function(domElement) {
2094
+ var cell = new TableCell(domElement, this);
2095
+ cell.activate();
2096
+ return cell;
2097
+ };
2098
+
2099
+ /**
2100
+ * @return the rows of the table as an array of DOM nodes
2101
+ */
2102
+ Table.prototype.getRows = function () {
2103
+ //W3C DOM property .rows supported by all modern browsers
2104
+ var rows = this.obj.get( 0 ).rows;
2105
+ //converts the HTMLCollection to a real array
2106
+ return jQuery.makeArray( rows );
2107
+ };
2108
+
2109
+ return Table;
2110
+ });