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,1276 @@
1
+ /* markup.js is part of Aloha Editor project http://aloha-editor.org
2
+ *
3
+ * Aloha Editor is a WYSIWYG HTML5 inline editing library and editor.
4
+ * Copyright (c) 2010-2012 Gentics Software GmbH, Vienna, Austria.
5
+ * Contributors http://aloha-editor.org/contribution.php
6
+ *
7
+ * Aloha Editor is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU General Public License
9
+ * as published by the Free Software Foundation; either version 2
10
+ * of the License, or any later version.
11
+ *
12
+ * Aloha Editor is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
+ *
21
+ * As an additional permission to the GNU GPL version 2, you may distribute
22
+ * non-source (e.g., minimized or compacted) forms of the Aloha-Editor
23
+ * source code without the copy of the GNU GPL normally required,
24
+ * provided you include this license notice and a URL through which
25
+ * recipients can access the Corresponding Source.
26
+ */
27
+ define([
28
+ 'aloha/core',
29
+ 'util/class',
30
+ 'util/html',
31
+ 'jquery',
32
+ 'aloha/ecma5shims',
33
+ 'aloha/console',
34
+ 'aloha/block-jump'
35
+ ], function (
36
+ Aloha,
37
+ Class,
38
+ Html,
39
+ jQuery,
40
+ shims,
41
+ console,
42
+ BlockJump
43
+ ) {
44
+ "use strict";
45
+
46
+ var GENTICS = window.GENTICS;
47
+
48
+ var isOldIE = !!(jQuery.browser.msie && 9 > parseInt(jQuery.browser.version, 10));
49
+
50
+ function isBR(node) {
51
+ return 'BR' === node.nodeName;
52
+ }
53
+
54
+ function isBlock(node) {
55
+ return 'false' === jQuery(node).attr('contenteditable');
56
+ }
57
+
58
+ function isTextNode(node) {
59
+ return node && 3 === node.nodeType; // Node.TEXT_NODE
60
+ }
61
+
62
+ function nodeLength(node) {
63
+ return !node ? 0 : (isTextNode(node) ? node.length : node.childNodes.length);
64
+ }
65
+
66
+ /**
67
+ * Determines whether the given text node is visible to the the user,
68
+ * based on our understanding that browsers will not display
69
+ * superfluous white spaces.
70
+ *
71
+ * @param {HTMLEmenent} node The text node to be checked.
72
+ */
73
+ function isVisibleTextNode(node) {
74
+ return 0 < node.data.replace(/\s+/g, '').length;
75
+ }
76
+
77
+ function nextVisibleNode(node) {
78
+ if (!node) {
79
+ return null;
80
+ }
81
+
82
+ if (node.nextSibling) {
83
+ // Skip over nodes that the user cannot see ...
84
+ if (isTextNode(node.nextSibling) && !isVisibleTextNode(node.nextSibling)) {
85
+ return nextVisibleNode(node.nextSibling);
86
+ }
87
+
88
+ // Skip over propping <br>s ...
89
+ if (isBR(node.nextSibling) && node.nextSibling === node.parentNode.lastChild) {
90
+ return nextVisibleNode(node.nextSibling);
91
+ }
92
+
93
+ // Skip over empty editable elements ...
94
+ if ('' === node.nextSibling.innerHTML && !isBlock(node.nextSibling)) {
95
+ return nextVisibleNode(node.nextSibling);
96
+ }
97
+
98
+ return node.nextSibling;
99
+ }
100
+
101
+ if (node.parentNode) {
102
+ return nextVisibleNode(node.parentNode);
103
+ }
104
+
105
+ return null;
106
+ }
107
+
108
+ function prevVisibleNode(node) {
109
+ if (!node) {
110
+ return null;
111
+ }
112
+
113
+ if (node.previousSibling) {
114
+ // Skip over nodes that the user cannot see...
115
+ if (isTextNode(node.previousSibling) && !isVisibleTextNode(node.previousSibling)) {
116
+ return prevVisibleNode(node.previousSibling);
117
+ }
118
+
119
+ // Skip over empty editable elements ...
120
+ if ('' === node.previousSibling.innerHTML && !isBlock(node.previousSibling)) {
121
+ return prevVisibleNode(node.previouSibling);
122
+ }
123
+
124
+ return node.previousSibling;
125
+ }
126
+
127
+ if (node.parentNode) {
128
+ return prevVisibleNode(node.parentNode);
129
+ }
130
+
131
+ return null;
132
+ }
133
+
134
+ function isFrontPosition(node, offset) {
135
+ return (0 === offset) || (offset <= node.data.length - node.data.replace(/^\s+/, '').length);
136
+ }
137
+
138
+ function isBlockInsideEditable($block) {
139
+ return $block.parent().hasClass('aloha-editable');
140
+ }
141
+
142
+ function isEndPosition(node, offset) {
143
+ var length = nodeLength(node);
144
+
145
+ if (length === offset) {
146
+ return true;
147
+ }
148
+
149
+ var isText = isTextNode(node);
150
+
151
+ // If within a text node, then ignore superfluous white-spaces,
152
+ // since they are invisible to the user.
153
+ if (isText && node.data.replace(/\s+$/, '').length === offset) {
154
+ return true;
155
+ }
156
+
157
+ if (1 === length && !isText) {
158
+ return isBR(node.childNodes[0]);
159
+ }
160
+
161
+ return false;
162
+ }
163
+
164
+ function blink(node) {
165
+ jQuery(node).stop(true).css({
166
+ opacity: 0
167
+ }).fadeIn(0).delay(100).fadeIn(function () {
168
+ jQuery(node).css({
169
+ opacity: 1
170
+ });
171
+ });
172
+
173
+ return node;
174
+ }
175
+
176
+ function nodeContains(node1, node2) {
177
+ return isOldIE ? (shims.compareDocumentPosition(node1, node2) & 16) : 0 < jQuery(node1).find(node2).length;
178
+ }
179
+
180
+ function isInsidePlaceholder(range) {
181
+ var start = range.startContainer;
182
+ var end = range.endContainer;
183
+ var $placeholder = window.$_alohaPlaceholder;
184
+
185
+ return $placeholder.is(start) || $placeholder.is(end) || nodeContains($placeholder[0], start) || nodeContains($placeholder[0], end);
186
+ }
187
+
188
+ function cleanupPlaceholders(range) {
189
+ if (window.$_alohaPlaceholder && !isInsidePlaceholder(range)) {
190
+ if (0 === window.$_alohaPlaceholder.html().replace(/^(&nbsp;)*$/, '').length) {
191
+ window.$_alohaPlaceholder.remove();
192
+ }
193
+
194
+ window.$_alohaPlaceholder = null;
195
+ }
196
+ }
197
+
198
+ /**
199
+ * @TODO(petro): We need to be more intelligent about whether we insert a
200
+ * block-level placeholder or a phrasing level element.
201
+ * @TODO(petro): test with <pre>
202
+ * @TODO: move to block-jump.js
203
+ */
204
+ function jumpBlock(block, isGoingLeft, currentRange) {
205
+ var range = new GENTICS.Utils.RangeObject();
206
+ var sibling = isGoingLeft ? prevVisibleNode(block) : nextVisibleNode(block);
207
+
208
+ if (!sibling || isBlock(sibling)) {
209
+ var $landing = jQuery('<div>&nbsp;</div>');
210
+
211
+ if (isGoingLeft) {
212
+ jQuery(block).before($landing);
213
+ } else {
214
+ jQuery(block).after($landing);
215
+ }
216
+
217
+ range.startContainer = range.endContainer = $landing[0];
218
+ range.startOffset = range.endOffset = 0;
219
+
220
+ // Clear out any old placeholder first ...
221
+ cleanupPlaceholders(range);
222
+
223
+ window.$_alohaPlaceholder = $landing;
224
+ } else {
225
+
226
+ // Don't jump the block yet if the cursor is moving to the
227
+ // beginning or end of a text node, or if it is about to leave
228
+ // an element node. Both these cases require a hack in some
229
+ // browsers.
230
+ var moveToBoundaryPositionInIE = ( // To the beginning or end of a text node?
231
+ (currentRange.startContainer.nodeType === 3
232
+ && currentRange.startContainer === currentRange.endContainer
233
+ && currentRange.startContainer.nodeValue !== ""
234
+ && (isGoingLeft ? currentRange.startOffset === 1 : currentRange.endOffset + 1 === currentRange.endContainer.length))
235
+ // Leaving an element node?
236
+ || (currentRange.startContainer.nodeType === 1
237
+ && (!currentRange.startOffset
238
+ || (currentRange.startContainer.childNodes[currentRange.startOffset] && currentRange.startContainer.childNodes[currentRange.startOffset].nodeType === 1)))
239
+ );
240
+
241
+ if (moveToBoundaryPositionInIE) {
242
+ // The cursor is moving to the beginning or end of a text
243
+ // node, or is leaving an element node, which requires a
244
+ // hack in some browsers.
245
+ var zeroWidthNode = BlockJump.insertZeroWidthTextNodeFix(block, isGoingLeft);
246
+ range.startContainer = range.endContainer = zeroWidthNode;
247
+ range.startOffset = range.endOffset = isGoingLeft ? 1 : 0;
248
+ } else {
249
+ // The selection is already at the boundary position - jump
250
+ // the block.
251
+ range.startContainer = range.endContainer = sibling;
252
+ range.startOffset = range.endOffset = isGoingLeft ? nodeLength(sibling) : 0;
253
+ if (!isGoingLeft) {
254
+ // Just as above, jumping to the first position right of
255
+ // a block requires a hack in some browsers. Jumping
256
+ // left seems to be fine.
257
+ BlockJump.insertZeroWidthTextNodeFix(block, true);
258
+ }
259
+ }
260
+ cleanupPlaceholders(range);
261
+ }
262
+
263
+ range.select();
264
+
265
+ Aloha.trigger('aloha-block-selected', block);
266
+ Aloha.Selection.preventSelectionChanged();
267
+ }
268
+
269
+ /**
270
+ * Markup object
271
+ */
272
+ Aloha.Markup = Class.extend({
273
+
274
+ /**
275
+ * Key handlers for special key codes
276
+ */
277
+ keyHandlers: {},
278
+
279
+ /**
280
+ * Add a key handler for the given key code
281
+ * @param keyCode key code
282
+ * @param handler handler function
283
+ */
284
+ addKeyHandler: function (keyCode, handler) {
285
+ if (!this.keyHandlers[keyCode]) {
286
+ this.keyHandlers[keyCode] = [];
287
+ }
288
+
289
+ this.keyHandlers[keyCode].push(handler);
290
+ },
291
+
292
+ /**
293
+ * Removes a key handler for the given key code
294
+ * @param keyCode key code
295
+ */
296
+ removeKeyHandler: function (keyCode) {
297
+ if (this.keyHandlers[keyCode]) {
298
+ this.keyHandlers[keyCode] = null;
299
+ }
300
+ },
301
+
302
+ insertBreak: function () {
303
+ var range = Aloha.Selection.rangeObject,
304
+ nonWSIndex,
305
+ nextTextNode,
306
+ newBreak;
307
+
308
+ if (!range.isCollapsed()) {
309
+ this.removeSelectedMarkup();
310
+ }
311
+
312
+ newBreak = jQuery('<br/>');
313
+ GENTICS.Utils.Dom.insertIntoDOM(newBreak, range, Aloha.activeEditable.obj);
314
+
315
+ nextTextNode = GENTICS.Utils.Dom.searchAdjacentTextNode(
316
+ newBreak.parent().get(0),
317
+ GENTICS.Utils.Dom.getIndexInParent(newBreak.get(0)) + 1,
318
+ false
319
+ );
320
+
321
+ if (nextTextNode) {
322
+ // trim leading whitespace
323
+ nonWSIndex = nextTextNode.data.search(/\S/);
324
+ if (nonWSIndex > 0) {
325
+ nextTextNode.data = nextTextNode.data.substring(nonWSIndex);
326
+ }
327
+ }
328
+
329
+ range.startContainer = range.endContainer = newBreak.get(0).parentNode;
330
+ range.startOffset = range.endOffset = GENTICS.Utils.Dom.getIndexInParent(newBreak.get(0)) + 1;
331
+ range.correctRange();
332
+ range.clearCaches();
333
+ range.select();
334
+ },
335
+
336
+ /**
337
+ * first method to handle key strokes
338
+ * @param event DOM event
339
+ * @param rangeObject as provided by Aloha.Selection.getRangeObject();
340
+ * @return "Aloha.Selection"
341
+ */
342
+ preProcessKeyStrokes: function (event) {
343
+ if (event.type !== 'keydown') {
344
+ return false;
345
+ }
346
+
347
+ var rangeObject,
348
+ handlers,
349
+ i;
350
+
351
+ if (this.keyHandlers[event.keyCode]) {
352
+ handlers = this.keyHandlers[event.keyCode];
353
+ for (i = 0; i < handlers.length; ++i) {
354
+ if (!handlers[i](event)) {
355
+ return false;
356
+ }
357
+ }
358
+ }
359
+
360
+ // LEFT (37), RIGHT (39) keys for block detection
361
+ if (event.keyCode === 37 || event.keyCode === 39) {
362
+ if (Aloha.getSelection().getRangeCount()) {
363
+ rangeObject = Aloha.getSelection().getRangeAt(0);
364
+
365
+ if (this.processCursor(rangeObject, event.keyCode)) {
366
+ cleanupPlaceholders(Aloha.Selection.rangeObject);
367
+ return true;
368
+ }
369
+ }
370
+
371
+ return false;
372
+ }
373
+
374
+ // BACKSPACE
375
+ if (event.keyCode === 8) {
376
+ event.preventDefault(); // prevent history.back() even on exception
377
+ Aloha.execCommand('delete', false);
378
+ return false;
379
+ }
380
+
381
+ // DELETE
382
+ if (event.keyCode === 46) {
383
+ Aloha.execCommand('forwarddelete', false);
384
+ return false;
385
+ }
386
+
387
+ // ENTER
388
+ if (event.keyCode === 13) {
389
+ if (!event.shiftKey && Html.allowNestedParagraph(Aloha.activeEditable)) {
390
+ Aloha.execCommand('insertparagraph', false);
391
+ return false;
392
+ // if the shift key is pressed, or if the active editable is not allowed
393
+ // to contain paragraphs, a linebreak is inserted instead
394
+ } else {
395
+ Aloha.execCommand('insertlinebreak', false);
396
+ return false;
397
+ }
398
+ }
399
+ return true;
400
+ },
401
+
402
+ /**
403
+ * Processing of cursor keys.
404
+ * Detect blocks (elements with contenteditable=false) and will select them
405
+ * (normally the cursor would simply jump right past them).
406
+ *
407
+ * For each block that is selected, an 'aloha-block-selected' event will be
408
+ * triggered.
409
+ *
410
+ * TODO: the above is what should happen. Currently we just skip past blocks.
411
+ *
412
+ * @param {RangyRange} range A range object for the current selection.
413
+ * @param {number} keyCode Code of the currently pressed key.
414
+ * @return {boolean} False if a block was found, to prevent further events,
415
+ * true otherwise.
416
+ * @TODO move to block-jump.js
417
+ */
418
+ processCursor: function (range, keyCode) {
419
+ if (!range.collapsed) {
420
+ return true;
421
+ }
422
+
423
+ BlockJump.removeZeroWidthTextNodeFix();
424
+
425
+ var node = range.startContainer,
426
+ selection = Aloha.getSelection();
427
+
428
+ if (!node) {
429
+ return true;
430
+ }
431
+
432
+ var sibling, offset;
433
+
434
+ // special handling for moving Cursor around zero-width whitespace in IE7
435
+ if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) <= 7 && isTextNode(node)) {
436
+ if (keyCode == 37) {
437
+ // moving left -> skip zwsp to the left
438
+ offset = range.startOffset;
439
+ while (offset > 0 && node.data.charAt(offset - 1) === '\u200b') {
440
+ offset--;
441
+ }
442
+ if (offset != range.startOffset) {
443
+ range.setStart(range.startContainer, offset);
444
+ range.setEnd(range.startContainer, offset);
445
+ selection = Aloha.getSelection();
446
+ selection.removeAllRanges();
447
+ selection.addRange(range);
448
+ }
449
+ } else if (keyCode == 39) {
450
+ // moving right -> skip zwsp to the right
451
+ offset = range.startOffset;
452
+ while (offset < node.data.length && node.data.charAt(offset) === '\u200b') {
453
+ offset++;
454
+ }
455
+ if (offset != range.startOffset) {
456
+ range.setStart(range.startContainer, offset);
457
+ range.setEnd(range.startContainer, offset);
458
+ selection.removeAllRanges();
459
+ selection.addRange(range);
460
+ }
461
+ }
462
+ }
463
+
464
+ // Versions of Internet Explorer that are older that 9, will
465
+ // erroneously allow you to enter and edit inside elements which have
466
+ // their contenteditable attribute set to false...
467
+ if (isOldIE && !jQuery(node).contentEditable()) {
468
+ var $parentBlock = jQuery(node).parents('[contenteditable=false]');
469
+ var isInsideBlock = $parentBlock.length > 0;
470
+
471
+ if (isInsideBlock) {
472
+ if (isBlockInsideEditable($parentBlock)) {
473
+ sibling = $parentBlock[0];
474
+ } else {
475
+ return true;
476
+ }
477
+ }
478
+ }
479
+
480
+ var isLeft;
481
+ if (!sibling) {
482
+ // True if keyCode denotes LEFT or UP arrow key, otherwise they
483
+ // keyCode is for RIGHT or DOWN in which this value will be false.
484
+ isLeft = (37 === keyCode || 38 === keyCode);
485
+ offset = range.startOffset;
486
+
487
+ if (isTextNode(node)) {
488
+ if (isLeft) {
489
+ var isApproachingFrontPosition = (1 === offset);
490
+ if (!isApproachingFrontPosition && !isFrontPosition(node, offset)) {
491
+ return true;
492
+ }
493
+ } else if (!isEndPosition(node, offset)) {
494
+ return true;
495
+ }
496
+
497
+ } else {
498
+ node = node.childNodes[offset === nodeLength(node) ? offset - 1 : offset];
499
+ }
500
+
501
+ sibling = isLeft ? prevVisibleNode(node) : nextVisibleNode(node);
502
+ }
503
+
504
+ if (isBlock(sibling)) {
505
+ jumpBlock(sibling, isLeft, range);
506
+ return false;
507
+ }
508
+
509
+ return true;
510
+ },
511
+
512
+ /**
513
+ * method handling shiftEnter
514
+ * @param Aloha.Selection.SelectionRange of the current selection
515
+ * @return void
516
+ */
517
+ processShiftEnter: function (rangeObject) {
518
+ this.insertHTMLBreak(rangeObject.getSelectionTree(), rangeObject);
519
+ },
520
+
521
+ /**
522
+ * method handling Enter
523
+ * @param Aloha.Selection.SelectionRange of the current selection
524
+ * @return void
525
+ */
526
+ processEnter: function (rangeObject) {
527
+ if (rangeObject.splitObject) {
528
+ // now comes a very evil hack for ie, when the enter is pressed in a text node in an li element, we just append an empty text node
529
+ // if ( jQuery.browser.msie
530
+ // && GENTICS.Utils.Dom
531
+ // .isListElement( rangeObject.splitObject ) ) {
532
+ // jQuery( rangeObject.splitObject ).append(
533
+ // jQuery( document.createTextNode( '' ) ) );
534
+ // }
535
+ this.splitRangeObject(rangeObject);
536
+ } else { // if there is no split object, the Editable is the paragraph type itself (e.g. a p or h2)
537
+ this.insertHTMLBreak(rangeObject.getSelectionTree(), rangeObject);
538
+ }
539
+ },
540
+
541
+ /**
542
+ * Insert the given html markup at the current selection
543
+ * @param html html markup to be inserted
544
+ */
545
+ insertHTMLCode: function (html) {
546
+ var rangeObject = Aloha.Selection.rangeObject;
547
+ this.insertHTMLBreak(rangeObject.getSelectionTree(), rangeObject, jQuery(html));
548
+ },
549
+
550
+ /**
551
+ * insert an HTML Break <br /> into current selection
552
+ * @param Aloha.Selection.SelectionRange of the current selection
553
+ * @return void
554
+ */
555
+ insertHTMLBreak: function (selectionTree, rangeObject, inBetweenMarkup) {
556
+ var i,
557
+ treeLength,
558
+ el,
559
+ jqEl,
560
+ jqElBefore,
561
+ jqElAfter,
562
+ tmpObject,
563
+ offset,
564
+ checkObj;
565
+
566
+ inBetweenMarkup = inBetweenMarkup || jQuery('<br/>');
567
+
568
+ for (i = 0, treeLength = selectionTree.length; i < treeLength; ++i) {
569
+ el = selectionTree[i];
570
+ jqEl = el.domobj ? jQuery(el.domobj) : undefined;
571
+
572
+ if (el.selection !== 'none') { // before cursor, leave this part inside the splitObject
573
+ if (el.selection == 'collapsed') {
574
+ // collapsed selection found (between nodes)
575
+ if (i > 0) {
576
+ // not at the start, so get the element to the left
577
+ jqElBefore = jQuery(selectionTree[i - 1].domobj);
578
+
579
+ // and insert the break after it
580
+ jqElBefore.after(inBetweenMarkup);
581
+
582
+ } else {
583
+ // at the start, so get the element to the right
584
+ jqElAfter = jQuery(selectionTree[1].domobj);
585
+
586
+ // and insert the break before it
587
+ jqElAfter.before(inBetweenMarkup);
588
+ }
589
+
590
+ // now set the range
591
+ rangeObject.startContainer = rangeObject.endContainer = inBetweenMarkup[0].parentNode;
592
+ rangeObject.startOffset = rangeObject.endOffset = GENTICS.Utils.Dom.getIndexInParent(inBetweenMarkup[0]) + 1;
593
+ rangeObject.correctRange();
594
+
595
+ } else if (el.domobj && el.domobj.nodeType === 3) { // textNode
596
+ // when the textnode is immediately followed by a blocklevel element (like p, h1, ...) we need to add an additional br in between
597
+ if (el.domobj.nextSibling && el.domobj.nextSibling.nodeType == 1 && Aloha.Selection.replacingElements[el.domobj.nextSibling.nodeName.toLowerCase()]) {
598
+ // TODO check whether this depends on the browser
599
+ jqEl.after('<br/>');
600
+ }
601
+
602
+ if (this.needEndingBreak()) {
603
+ // when the textnode is the last inside a blocklevel element
604
+ // (like p, h1, ...) we need to add an additional br as very
605
+ // last object in the blocklevel element
606
+ checkObj = el.domobj;
607
+
608
+ while (checkObj) {
609
+ if (checkObj.nextSibling) {
610
+ checkObj = false;
611
+ } else {
612
+ // go to the parent
613
+ checkObj = checkObj.parentNode;
614
+
615
+ // found a blocklevel or list element, we are done
616
+ if (GENTICS.Utils.Dom.isBlockLevelElement(checkObj) || GENTICS.Utils.Dom.isListElement(checkObj)) {
617
+ break;
618
+ }
619
+
620
+ // reached the limit object, we are done
621
+ if (checkObj === rangeObject.limitObject) {
622
+ checkObj = false;
623
+ }
624
+ }
625
+ }
626
+
627
+ // when we found a blocklevel element, insert a break at the
628
+ // end. Mark the break so that it is cleaned when the
629
+ // content is fetched.
630
+ if (checkObj) {
631
+ jQuery(checkObj).append('<br class="aloha-cleanme" />');
632
+ }
633
+ }
634
+
635
+ // insert the break
636
+ jqEl.between(inBetweenMarkup, el.startOffset);
637
+
638
+ // correct the range
639
+ // count the number of previous siblings
640
+ offset = 0;
641
+ tmpObject = inBetweenMarkup[0];
642
+ while (tmpObject) {
643
+ tmpObject = tmpObject.previousSibling;
644
+ ++offset;
645
+ }
646
+
647
+ rangeObject.startContainer = inBetweenMarkup[0].parentNode;
648
+ rangeObject.endContainer = inBetweenMarkup[0].parentNode;
649
+ rangeObject.startOffset = offset;
650
+ rangeObject.endOffset = offset;
651
+ rangeObject.correctRange();
652
+
653
+ } else if (el.domobj && el.domobj.nodeType === 1) { // other node, normally a break
654
+ if (jqEl.parent().find('br.aloha-ephemera').length === 0) {
655
+ // but before putting it, remove all:
656
+ jQuery(rangeObject.limitObject).find('br.aloha-ephemera').remove();
657
+
658
+ // now put it:
659
+ jQuery(rangeObject.commonAncestorContainer).append(this.getFillUpElement(rangeObject.splitObject));
660
+ }
661
+
662
+ jqEl.after(inBetweenMarkup);
663
+
664
+ // now set the selection. Since we just added one break do the currect el
665
+ // the new position must be el's position + 1. el's position is the index
666
+ // of the el in the selection tree, which is i. then we must add
667
+ // another +1 because we want to be AFTER the object, not before. therefor +2
668
+ rangeObject.startContainer = rangeObject.commonAncestorContainer;
669
+ rangeObject.endContainer = rangeObject.startContainer;
670
+ rangeObject.startOffset = i + 2;
671
+ rangeObject.endOffset = i + 2;
672
+ rangeObject.update();
673
+ }
674
+ }
675
+ }
676
+ rangeObject.select();
677
+ },
678
+
679
+ /**
680
+ * Check whether blocklevel elements need breaks at the end to visibly render a newline
681
+ * @return true if an ending break is necessary, false if not
682
+ */
683
+ needEndingBreak: function () {
684
+ // currently, all browser except IE need ending breaks
685
+ return !jQuery.browser.msie;
686
+ },
687
+
688
+ /**
689
+ * Get the currently selected text or false if nothing is selected (or the selection is collapsed)
690
+ * @return selected text
691
+ */
692
+ getSelectedText: function () {
693
+ var rangeObject = Aloha.Selection.rangeObject;
694
+
695
+ if (rangeObject.isCollapsed()) {
696
+ return false;
697
+ }
698
+
699
+ return this.getFromSelectionTree(rangeObject.getSelectionTree(), true);
700
+ },
701
+
702
+ /**
703
+ * Recursive function to get the selected text from the selection tree starting at the given level
704
+ * @param selectionTree array of selectiontree elements
705
+ * @param astext true when the contents shall be fetched as text, false for getting as html markup
706
+ * @return selected text from that level (incluiding all sublevels)
707
+ */
708
+ getFromSelectionTree: function (selectionTree, astext) {
709
+ var text = '', i, treeLength, el, clone;
710
+ for (i = 0, treeLength = selectionTree.length; i < treeLength; i++) {
711
+ el = selectionTree[i];
712
+ if (el.selection == 'partial') {
713
+ if (el.domobj.nodeType === 3) {
714
+ // partial text node selected, get the selected part
715
+ text += el.domobj.data.substring(el.startOffset, el.endOffset);
716
+ } else if (el.domobj.nodeType === 1 && el.children) {
717
+ // partial element node selected, do the recursion into the children
718
+ if (astext) {
719
+ text += this.getFromSelectionTree(el.children, astext);
720
+ } else {
721
+ // when the html shall be fetched, we create a clone of
722
+ // the element and remove all the children
723
+ clone = jQuery(el.domobj.outerHTML).empty();
724
+ // then we do the recursion and add the selection into the clone
725
+ clone.html(this.getFromSelectionTree(el.children, astext));
726
+ // finally we get the html of the clone
727
+ text += clone.outerHTML();
728
+ }
729
+ }
730
+ } else if (el.selection == 'full') {
731
+ if (el.domobj.nodeType === 3) {
732
+ // full text node selected, get the text
733
+ text += jQuery(el.domobj).text();
734
+ } else if (el.domobj.nodeType === 1 && el.children) {
735
+ // full element node selected, get the html of the node and all children
736
+ text += astext ? jQuery(el.domobj).text() : jQuery(el.domobj).outerHTML();
737
+ }
738
+ }
739
+ }
740
+
741
+ return text;
742
+ },
743
+
744
+ /**
745
+ * Get the currently selected markup or false if nothing is selected (or the selection is collapsed)
746
+ * @return {?String}
747
+ */
748
+ getSelectedMarkup: function () {
749
+ var rangeObject = Aloha.Selection.rangeObject;
750
+ return rangeObject.isCollapsed() ? null : this.getFromSelectionTree(rangeObject.getSelectionTree(), false);
751
+ },
752
+
753
+ /**
754
+ * Remove the currently selected markup
755
+ */
756
+ removeSelectedMarkup: function () {
757
+ var rangeObject = Aloha.Selection.rangeObject,
758
+ newRange;
759
+
760
+ if (rangeObject.isCollapsed()) {
761
+ return;
762
+ }
763
+
764
+ newRange = new Aloha.Selection.SelectionRange();
765
+ // remove the selection
766
+ this.removeFromSelectionTree(rangeObject.getSelectionTree(), newRange);
767
+
768
+ // do a cleanup now (starting with the commonancestorcontainer)
769
+ newRange.update();
770
+ GENTICS.Utils.Dom.doCleanup({
771
+ 'merge': true,
772
+ 'removeempty': true
773
+ }, Aloha.Selection.rangeObject);
774
+ Aloha.Selection.rangeObject = newRange;
775
+
776
+ // need to set the collapsed selection now
777
+ newRange.correctRange();
778
+ newRange.update();
779
+ newRange.select();
780
+ Aloha.Selection.updateSelection();
781
+ },
782
+
783
+ /**
784
+ * Recursively remove the selected items, starting with the given level in the selectiontree
785
+ * @param selectionTree current level of the selectiontree
786
+ * @param newRange new collapsed range to be set after the removal
787
+ */
788
+ removeFromSelectionTree: function (selectionTree, newRange) {
789
+ // remember the first found partially selected element node (in case we need
790
+ // to merge it with the last found partially selected element node)
791
+ var firstPartialElement, newdata, i, el, adjacentTextNode, treeLength;
792
+
793
+ // iterate through the selection tree
794
+ for (i = 0, treeLength = selectionTree.length; i < treeLength; i++) {
795
+ el = selectionTree[i];
796
+
797
+ // check the type of selection
798
+ if (el.selection == 'partial') {
799
+ if (el.domobj.nodeType === 3) {
800
+ // partial text node selected, so remove the selected portion
801
+ newdata = '';
802
+ if (el.startOffset > 0) {
803
+ newdata += el.domobj.data.substring(0, el.startOffset);
804
+ }
805
+ if (el.endOffset < el.domobj.data.length) {
806
+ newdata += el.domobj.data.substring(el.endOffset, el.domobj.data.length);
807
+ }
808
+ el.domobj.data = newdata;
809
+
810
+ // eventually set the new range (if not done before)
811
+ if (!newRange.startContainer) {
812
+ newRange.startContainer = newRange.endContainer = el.domobj;
813
+ newRange.startOffset = newRange.endOffset = el.startOffset;
814
+ }
815
+ } else if (el.domobj.nodeType === 1 && el.children) {
816
+ // partial element node selected, so do the recursion into the children
817
+ this.removeFromSelectionTree(el.children, newRange);
818
+
819
+ if (firstPartialElement) {
820
+ // when the first parially selected element is the same type
821
+ // of element, we need to merge them
822
+ if (firstPartialElement.nodeName == el.domobj.nodeName) {
823
+ // merge the nodes
824
+ jQuery(firstPartialElement).append(jQuery(el.domobj).contents());
825
+
826
+ // and remove the latter one
827
+ jQuery(el.domobj).remove();
828
+ }
829
+
830
+ } else {
831
+ // remember this element as first partially selected element
832
+ firstPartialElement = el.domobj;
833
+ }
834
+ }
835
+
836
+ } else if (el.selection == 'full') {
837
+ // eventually set the new range (if not done before)
838
+ if (!newRange.startContainer) {
839
+ adjacentTextNode = GENTICS.Utils.Dom.searchAdjacentTextNode(
840
+ el.domobj.parentNode,
841
+ GENTICS.Utils.Dom.getIndexInParent(el.domobj) + 1,
842
+ false,
843
+ {
844
+ 'blocklevel': false
845
+ }
846
+ );
847
+
848
+ if (adjacentTextNode) {
849
+ newRange.startContainer = newRange.endContainer = adjacentTextNode;
850
+ newRange.startOffset = newRange.endOffset = 0;
851
+ } else {
852
+ newRange.startContainer = newRange.endContainer = el.domobj.parentNode;
853
+ newRange.startOffset = newRange.endOffset = GENTICS.Utils.Dom.getIndexInParent(el.domobj) + 1;
854
+ }
855
+ }
856
+
857
+ // full node selected, so just remove it (will also remove all children)
858
+ jQuery(el.domobj).remove();
859
+ }
860
+ }
861
+ },
862
+
863
+ /**
864
+ * split passed rangeObject without or with optional markup
865
+ * @param Aloha.Selection.SelectionRange of the current selection
866
+ * @param markup object (jQuery) to insert in between the split elements
867
+ * @return void
868
+ */
869
+ splitRangeObject: function (rangeObject, markup) {
870
+ // UAAAA: first check where the markup can be inserted... *grrrrr*, then decide where to split
871
+ // object which is split up
872
+ var splitObject = jQuery(rangeObject.splitObject),
873
+ selectionTree,
874
+ insertAfterObject,
875
+ followUpContainer;
876
+
877
+ // update the commonAncestor with the splitObject (so that the selectionTree is correct)
878
+ rangeObject.update(rangeObject.splitObject); // set the splitObject as new commonAncestorContainer and update the selectionTree
879
+
880
+ // calculate the selection tree. NOTE: it is necessary to do this before
881
+ // getting the followupcontainer, since getting the selection tree might
882
+ // possibly merge text nodes, which would lead to differences in the followupcontainer
883
+ selectionTree = rangeObject.getSelectionTree();
884
+
885
+ // object to be inserted after the splitObject
886
+ followUpContainer = this.getSplitFollowUpContainer(rangeObject);
887
+
888
+ // now split up the splitObject into itself AND the followUpContainer
889
+ this.splitRangeObjectHelper(selectionTree, rangeObject, followUpContainer); // split the current object into itself and the followUpContainer
890
+
891
+ // check whether the followupcontainer is still marked for removal
892
+ if (followUpContainer.hasClass('preparedForRemoval')) {
893
+ // TODO shall we just remove the class or shall we not use the followupcontainer?
894
+ followUpContainer.removeClass('preparedForRemoval');
895
+ }
896
+
897
+ // now let's find the place, where the followUp is inserted afterwards. normally that's the splitObject itself, but in
898
+ // some cases it might be their parent (e.g. inside a list, a <p> followUp must be inserted outside the list)
899
+ insertAfterObject = this.getInsertAfterObject(rangeObject, followUpContainer);
900
+
901
+ // now insert the followUpContainer
902
+ jQuery(followUpContainer).insertAfter(insertAfterObject); // attach the followUpContainer right after the insertAfterObject
903
+
904
+ // in some cases, we want to remove the "empty" splitObject (e.g. LIs, if enter was hit twice)
905
+ if (rangeObject.splitObject.nodeName.toLowerCase() === 'li' && !Aloha.Selection.standardTextLevelSemanticsComparator(rangeObject.splitObject, followUpContainer)) {
906
+ jQuery(rangeObject.splitObject).remove();
907
+ }
908
+
909
+ rangeObject.startContainer = null;
910
+ // first check whether the followUpContainer starts with a <br/>
911
+ // if so, place the cursor right before the <br/>
912
+ var followContents = followUpContainer.contents();
913
+ if (followContents.length > 0 && followContents.get(0).nodeType == 1 && followContents.get(0).nodeName.toLowerCase() === 'br') {
914
+ rangeObject.startContainer = followUpContainer.get(0);
915
+ }
916
+
917
+ if (!rangeObject.startContainer) {
918
+ // find a possible text node in the followUpContainer and set the selection to it
919
+ // if no textnode is available, set the selection to the followup container itself
920
+ rangeObject.startContainer = followUpContainer.textNodes(true, true).first().get(0);
921
+ }
922
+ if (!rangeObject.startContainer) { // if no text node was found, select the parent object of <br class="aloha-ephemera" />
923
+ rangeObject.startContainer = followUpContainer.textNodes(false).first().parent().get(0);
924
+ }
925
+ if (rangeObject.startContainer) {
926
+ // the cursor is always at the beginning of the followUp
927
+ rangeObject.endContainer = rangeObject.startContainer;
928
+ rangeObject.startOffset = 0;
929
+ rangeObject.endOffset = 0;
930
+ } else {
931
+ rangeObject.startContainer = rangeObject.endContainer = followUpContainer.parent().get(0);
932
+ rangeObject.startOffset = rangeObject.endOffset = GENTICS.Utils.Dom.getIndexInParent(followUpContainer.get(0));
933
+ }
934
+
935
+ // finally update the range object again
936
+ rangeObject.update();
937
+
938
+ // now set the selection
939
+ rangeObject.select();
940
+ },
941
+
942
+ /**
943
+ * method to get the object after which the followUpContainer can be inserted during splitup
944
+ * this is a helper method, not needed anywhere else
945
+ * @param rangeObject Aloha.Selection.SelectionRange of the current selection
946
+ * @param followUpContainer optional jQuery object; if provided the rangeObject will be split and the second part will be insert inside of this object
947
+ * @return object after which the followUpContainer can be inserted
948
+ */
949
+ getInsertAfterObject: function (rangeObject, followUpContainer) {
950
+ var passedSplitObject, i, el;
951
+
952
+ for (i = 0; i < rangeObject.markupEffectiveAtStart.length; i++) {
953
+ el = rangeObject.markupEffectiveAtStart[i];
954
+
955
+ // check if we have already passed the splitObject (some other markup might come before)
956
+ if (el === rangeObject.splitObject) {
957
+ passedSplitObject = true;
958
+ }
959
+
960
+ // if not passed splitObject, skip this markup
961
+ if (!passedSplitObject) {
962
+ continue;
963
+ }
964
+
965
+ // once we are passed, check if the followUpContainer is allowed to be inserted into the currents el's parent
966
+ if (Aloha.Selection.canTag1WrapTag2(jQuery(el).parent()[0].nodeName, followUpContainer[0].nodeName)) {
967
+ return el;
968
+ }
969
+ }
970
+
971
+ return false;
972
+ },
973
+
974
+ /**
975
+ * @fixme: Someone who knows what this function does, please refactor it.
976
+ * 1. splitObject arg is not used at all
977
+ * 2. Would be better to use ternary operation would be better than if else statement
978
+ *
979
+ * method to get the html code for a fillUpElement. this is needed for empty paragraphs etc., so that they take up their expected height
980
+ * @param splitObject split object (dom object)
981
+ * @return fillUpElement HTML Code
982
+ */
983
+ getFillUpElement: function (splitObject) {
984
+ if (jQuery.browser.msie) {
985
+ return false;
986
+ }
987
+ return jQuery('<br class="aloha-cleanme"/>');
988
+ },
989
+
990
+ /**
991
+ * removes textNodes from passed array, which only contain contentWhiteSpace (e.g. a \n between two tags)
992
+ * @param domArray array of domObjects
993
+ * @return void
994
+ */
995
+ removeElementContentWhitespaceObj: function (domArray) {
996
+ var correction = 0,
997
+ removeLater = [],
998
+ i,
999
+ el,
1000
+ removeIndex;
1001
+
1002
+ for (i = 0; i < domArray.length; ++i) {
1003
+ el = domArray[i];
1004
+ if (el.isElementContentWhitespace) {
1005
+ removeLater[removeLater.length] = i;
1006
+ }
1007
+ }
1008
+
1009
+ for (i = 0; i < removeLater.length; ++i) {
1010
+ removeIndex = removeLater[i];
1011
+ domArray.splice(removeIndex - correction, 1);
1012
+ ++correction;
1013
+ }
1014
+ },
1015
+
1016
+ /**
1017
+ * recursive method to parallelly walk through two dom subtrees, leave elements before startContainer in first subtree and move rest to other
1018
+ * @param selectionTree tree to iterate over as contained in rangeObject. must be passed separately to allow recursion in the selection tree, but not in the rangeObject
1019
+ * @param rangeObject Aloha.Selection.SelectionRange of the current selection
1020
+ * @param followUpContainer optional jQuery object; if provided the rangeObject will be split and the second part will be insert inside of this object
1021
+ * @param inBetweenMarkup jQuery object to be inserted between the two split parts. will be either a <br> (if no followUpContainer is passed) OR e.g. a table, which must be inserted between the splitobject AND the follow up
1022
+ * @return void
1023
+ */
1024
+ splitRangeObjectHelper: function (selectionTree, rangeObject, followUpContainer, inBetweenMarkup) {
1025
+ if (!followUpContainer) {
1026
+ Aloha.Log.warn(this, 'no followUpContainer, no inBetweenMarkup, nothing to do...');
1027
+ }
1028
+
1029
+ var fillUpElement = this.getFillUpElement(rangeObject.splitObject),
1030
+ splitObject = jQuery(rangeObject.splitObject),
1031
+ startMoving = false,
1032
+ el,
1033
+ i,
1034
+ completeText,
1035
+ jqObj,
1036
+ mirrorLevel,
1037
+ parent,
1038
+ treeLength;
1039
+
1040
+ if (selectionTree.length > 0) {
1041
+ mirrorLevel = followUpContainer.contents();
1042
+
1043
+ // if length of mirrorLevel and selectionTree are not equal, the mirrorLevel must be corrected. this happens, when the mirrorLevel contains whitespace textNodes
1044
+ if (mirrorLevel.length !== selectionTree.length) {
1045
+ this.removeElementContentWhitespaceObj(mirrorLevel);
1046
+ }
1047
+
1048
+ for (i = 0, treeLength = selectionTree.length; i < treeLength; ++i) {
1049
+ el = selectionTree[i];
1050
+
1051
+ // remove all objects in the mirrorLevel, which are BEFORE the cursor
1052
+ // OR if the cursor is at the last position of the last Textnode (causing an empty followUpContainer to be appended)
1053
+ if ((el.selection === 'none' && startMoving === false) || (el.domobj && el.domobj.nodeType === 3 && el === selectionTree[(selectionTree.length - 1)] && el.startOffset === el.domobj.data.length)) {
1054
+ // iteration is before cursor, leave this part inside the splitObject, remove from followUpContainer
1055
+ // however if the object to remove is the last existing textNode within the followUpContainer, insert a BR instead
1056
+ // otherwise the followUpContainer is invalid and takes up no vertical space
1057
+
1058
+ if (followUpContainer.textNodes().length > 1 || (el.domobj.nodeType === 1 && el.children.length === 0)) {
1059
+ // note: the second part of the if (el.domobj.nodeType === 1 && el.children.length === 0) covers a very special condition,
1060
+ // where an empty tag is located right before the cursor when pressing enter. In this case the empty tag would not be
1061
+ // removed correctly otherwise
1062
+ mirrorLevel.eq(i).remove();
1063
+
1064
+ } else if (GENTICS.Utils.Dom.isSplitObject(followUpContainer[0])) {
1065
+ if (fillUpElement) {
1066
+ followUpContainer.html(fillUpElement); // for your zoological german knowhow: ephemera = Eintagsfliege
1067
+ } else {
1068
+ followUpContainer.empty();
1069
+ }
1070
+
1071
+ } else {
1072
+ followUpContainer.empty();
1073
+ followUpContainer.addClass('preparedForRemoval');
1074
+ }
1075
+
1076
+ continue;
1077
+
1078
+ } else {
1079
+ // split objects, which are AT the cursor Position or directly above
1080
+ if (el.selection !== 'none') { // before cursor, leave this part inside the splitObject
1081
+ // TODO better check for selection == 'partial' here?
1082
+ if (el.domobj && el.domobj.nodeType === 3 && el.startOffset !== undefined) {
1083
+ completeText = el.domobj.data;
1084
+ if (el.startOffset > 0) { // first check, if there will be some text left in the splitObject
1085
+ el.domobj.data = completeText.substr(0, el.startOffset);
1086
+ } else if (selectionTree.length > 1) { // if not, check if the splitObject contains more than one node, because then it can be removed. this happens, when ENTER is pressed inside of a textnode, but not at the borders
1087
+ jQuery(el.domobj).remove();
1088
+ } else { // if the "empty" textnode is the last node left in the splitObject, replace it with a ephemera break
1089
+ // if the parent is a blocklevel element, we insert the fillup element
1090
+ parent = jQuery(el.domobj).parent();
1091
+ if (GENTICS.Utils.Dom.isSplitObject(parent[0])) {
1092
+ if (fillUpElement) {
1093
+ parent.html(fillUpElement);
1094
+ } else {
1095
+ parent.empty();
1096
+ }
1097
+
1098
+ } else {
1099
+ // if the parent is no blocklevel element and would be empty now, we completely remove it
1100
+ parent.remove();
1101
+ }
1102
+ }
1103
+ if (completeText.length - el.startOffset > 0) {
1104
+ // first check if there is text left to put in the followUpContainer's textnode. this happens, when ENTER is pressed inside of a textnode, but not at the borders
1105
+ mirrorLevel[i].data = completeText.substr(el.startOffset, completeText.length);
1106
+ } else if (mirrorLevel.length > 1) {
1107
+ // if not, check if the followUpContainer contains more than one node, because if yes, the "empty" textnode can be removed
1108
+ mirrorLevel.eq((i)).remove();
1109
+ } else if (GENTICS.Utils.Dom.isBlockLevelElement(followUpContainer[0])) {
1110
+ // if the "empty" textnode is the last node left in the followUpContainer (which is a blocklevel element), replace it with a ephemera break
1111
+ if (fillUpElement) {
1112
+ followUpContainer.html(fillUpElement);
1113
+ } else {
1114
+ followUpContainer.empty();
1115
+ }
1116
+
1117
+ } else {
1118
+ // if the "empty" textnode is the last node left in a non-blocklevel element, mark it for removal
1119
+ followUpContainer.empty();
1120
+ followUpContainer.addClass('preparedForRemoval');
1121
+ }
1122
+ }
1123
+
1124
+ startMoving = true;
1125
+
1126
+ if (el.children.length > 0) {
1127
+ this.splitRangeObjectHelper(el.children, rangeObject, mirrorLevel.eq(i), inBetweenMarkup);
1128
+ }
1129
+
1130
+ } else {
1131
+ // remove all objects in the origin, which are AFTER the cursor
1132
+ if (el.selection === 'none' && startMoving === true) {
1133
+ // iteration is after cursor, remove from splitObject and leave this part inside the followUpContainer
1134
+ jqObj = jQuery(el.domobj).remove();
1135
+ }
1136
+ }
1137
+ }
1138
+ }
1139
+ } else {
1140
+ Aloha.Log.error(this, 'can not split splitObject due to an empty selection tree');
1141
+ }
1142
+
1143
+ // and finally cleanup: remove all fillUps > 1
1144
+ splitObject.find('br.aloha-ephemera:gt(0)').remove(); // remove all elements greater than (gt) 0, that also means: leave one
1145
+ followUpContainer.find('br.aloha-ephemera:gt(0)').remove(); // remove all elements greater than (gt) 0, that also means: leave one
1146
+
1147
+ // remove objects prepared for removal
1148
+ splitObject.find('.preparedForRemoval').remove();
1149
+ followUpContainer.find('.preparedForRemoval').remove();
1150
+
1151
+ // if splitObject / followUp are empty, place a fillUp inside
1152
+ if (splitObject.contents().length === 0 && GENTICS.Utils.Dom.isSplitObject(splitObject[0]) && fillUpElement) {
1153
+ splitObject.html(fillUpElement);
1154
+ }
1155
+
1156
+ if (followUpContainer.contents().length === 0 && GENTICS.Utils.Dom.isSplitObject(followUpContainer[0]) && fillUpElement) {
1157
+ followUpContainer.html(fillUpElement);
1158
+ }
1159
+ },
1160
+
1161
+ /**
1162
+ * returns a jQuery object fitting the passed splitObject as follow up object
1163
+ * examples,
1164
+ * - when passed a p it will return an empty p (clone of the passed p)
1165
+ * - when passed an h1, it will return either an h1 (clone of the passed one) or a new p (if the collapsed selection was at the end)
1166
+ * @param rangeObject Aloha.RangeObject
1167
+ * @return void
1168
+ */
1169
+ getSplitFollowUpContainer: function (rangeObject) {
1170
+ var tagName = rangeObject.splitObject.nodeName.toLowerCase(),
1171
+ returnObj,
1172
+ inside,
1173
+ lastObj;
1174
+
1175
+ switch (tagName) {
1176
+ case 'h1':
1177
+ case 'h2':
1178
+ case 'h3':
1179
+ case 'h4':
1180
+ case 'h5':
1181
+ case 'h6':
1182
+ // get the last textnode in the splitobject, but don't consider aloha-cleanme elements
1183
+ lastObj = jQuery(rangeObject.splitObject).textNodes(':not(.aloha-cleanme)').last()[0];
1184
+ // special case: when enter is hit at the end of a heading, the followUp should be a <p>
1185
+ if (lastObj && rangeObject.startContainer === lastObj && rangeObject.startOffset === lastObj.length) {
1186
+ returnObj = jQuery('<p></p>');
1187
+ inside = jQuery(rangeObject.splitObject.outerHTML).contents();
1188
+ returnObj.append(inside);
1189
+ return returnObj;
1190
+ }
1191
+ break;
1192
+
1193
+ case 'li':
1194
+ // TODO check whether the li is the last one
1195
+ // special case: if enter is hit twice inside a list, the next item should be a <p> (and inserted outside the list)
1196
+ if (rangeObject.startContainer.nodeName.toLowerCase() === 'br' && jQuery(rangeObject.startContainer).hasClass('aloha-ephemera')) {
1197
+ returnObj = jQuery('<p></p>');
1198
+ inside = jQuery(rangeObject.splitObject.outerHTML).contents();
1199
+ returnObj.append(inside);
1200
+ return returnObj;
1201
+ }
1202
+ // when the li is the last one and empty, we also just return a <p>
1203
+ if (!rangeObject.splitObject.nextSibling && jQuery.trim(jQuery(rangeObject.splitObject).text()).length === 0) {
1204
+ returnObj = jQuery('<p></p>');
1205
+ return returnObj;
1206
+ }
1207
+ break;
1208
+ }
1209
+
1210
+ return jQuery(rangeObject.splitObject.outerHTML);
1211
+ },
1212
+
1213
+ /**
1214
+ * Transform the given domobj into an object with the given new nodeName.
1215
+ * Preserves the content and all attributes. If a range object is given, also the range will be preserved
1216
+ * @param domobj dom object to transform
1217
+ * @param nodeName new node name
1218
+ * @param range range object
1219
+ * @api
1220
+ * @return new object as jQuery object
1221
+ */
1222
+ transformDomObject: function (domobj, nodeName, range) {
1223
+ // first create the new element
1224
+ var jqOldObj = jQuery(domobj),
1225
+ jqNewObj = jQuery('<' + nodeName + '>'),
1226
+ i,
1227
+ attributes = jqOldObj[0].cloneNode(false).attributes;
1228
+
1229
+ // TODO what about events?
1230
+ // copy attributes
1231
+ if (attributes) {
1232
+ for (i = 0; i < attributes.length; ++i) {
1233
+ if (typeof attributes[i].specified === 'undefined' || attributes[i].specified) {
1234
+ jqNewObj.attr(attributes[i].nodeName, attributes[i].nodeValue);
1235
+ }
1236
+ }
1237
+ }
1238
+
1239
+ // copy inline CSS
1240
+ if (jqOldObj[0].style && jqOldObj[0].style.cssText) {
1241
+ jqNewObj[0].style.cssText = jqOldObj[0].style.cssText;
1242
+ }
1243
+
1244
+ // now move the contents of the old dom object into the new dom object
1245
+ jqOldObj.contents().appendTo(jqNewObj);
1246
+
1247
+ // finally replace the old object with the new one
1248
+ jqOldObj.replaceWith(jqNewObj);
1249
+
1250
+ // preserve the range
1251
+ if (range) {
1252
+ if (range.startContainer == domobj) {
1253
+ range.startContainer = jqNewObj.get(0);
1254
+ }
1255
+
1256
+ if (range.endContainer == domobj) {
1257
+ range.endContainer = jqNewObj.get(0);
1258
+ }
1259
+ }
1260
+
1261
+ return jqNewObj;
1262
+ },
1263
+
1264
+ /**
1265
+ * String representation
1266
+ * @return {String}
1267
+ */
1268
+ toString: function () {
1269
+ return 'Aloha.Markup';
1270
+ }
1271
+
1272
+ });
1273
+
1274
+ Aloha.Markup = new Aloha.Markup();
1275
+ return Aloha.Markup;
1276
+ });