locomotive-aloha-rails 0.20.1.5 → 0.23.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1280) hide show
  1. data/README.md +4 -4
  2. data/Rakefile +15 -6
  3. data/app/assets/javascripts/aloha.js +1 -0
  4. data/lib/aloha/rails/engine.rb +1 -1
  5. data/lib/aloha/rails/version.rb +2 -2
  6. data/vendor/assets/javascripts/aloha/css/aloha-common-extra.css +24 -0
  7. data/vendor/assets/javascripts/aloha/css/aloha-core.css +4 -29
  8. data/vendor/assets/javascripts/aloha/css/aloha-reset.css +24 -0
  9. data/vendor/assets/javascripts/aloha/css/aloha-sidebar.css +77 -89
  10. data/vendor/assets/javascripts/aloha/css/aloha.css +31 -7777
  11. data/vendor/assets/javascripts/aloha/img/arrow-down.png +0 -0
  12. data/vendor/assets/javascripts/aloha/img/arrow-left.png +0 -0
  13. data/vendor/assets/javascripts/aloha/img/arrow.png +0 -0
  14. data/vendor/assets/javascripts/aloha/img/base-multi.png +0 -0
  15. data/vendor/assets/javascripts/aloha/img/base.png +0 -0
  16. data/vendor/assets/javascripts/aloha/img/bg.png +0 -0
  17. data/vendor/assets/javascripts/aloha/img/breadcrumb-divider.png +0 -0
  18. data/vendor/assets/javascripts/aloha/img/gentics-logo.png +0 -0
  19. data/vendor/assets/javascripts/aloha/img/grabhandle.png +0 -0
  20. data/vendor/assets/javascripts/aloha/img/maximize.png +0 -0
  21. data/vendor/assets/javascripts/aloha/img/multisplit-base.jpg +0 -0
  22. data/vendor/assets/javascripts/aloha/img/multisplit-close.gif +0 -0
  23. data/vendor/assets/javascripts/aloha/img/multisplit-open.gif +0 -0
  24. data/vendor/assets/javascripts/aloha/img/pin.png +0 -0
  25. data/vendor/assets/javascripts/aloha/img/removeformat.png +0 -0
  26. data/vendor/assets/javascripts/aloha/img/text_indent.png +0 -0
  27. data/vendor/assets/javascripts/aloha/img/text_indent_remove.png +0 -0
  28. data/vendor/assets/javascripts/aloha/lib/aloha-jquery-noconflict.js +12 -0
  29. data/vendor/assets/javascripts/aloha/lib/aloha.js +532 -89342
  30. data/vendor/assets/javascripts/aloha/lib/aloha/block-jump.js +153 -0
  31. data/vendor/assets/javascripts/aloha/lib/aloha/command.js +161 -123
  32. data/vendor/assets/javascripts/aloha/lib/aloha/console.js +312 -295
  33. data/vendor/assets/javascripts/aloha/lib/aloha/contenthandlermanager.js +82 -44
  34. data/vendor/assets/javascripts/aloha/lib/aloha/copypaste.js +108 -0
  35. data/vendor/assets/javascripts/aloha/lib/aloha/core.js +453 -410
  36. data/vendor/assets/javascripts/aloha/lib/aloha/ecma5shims.js +307 -277
  37. data/vendor/assets/javascripts/aloha/lib/aloha/editable.js +548 -408
  38. data/vendor/assets/javascripts/aloha/lib/aloha/engine.js +7359 -7182
  39. data/vendor/assets/javascripts/aloha/lib/aloha/ephemera.js +485 -0
  40. data/vendor/assets/javascripts/aloha/lib/aloha/ierange-m2.js +28 -545
  41. data/vendor/assets/javascripts/aloha/lib/aloha/jquery.aloha.js +364 -146
  42. data/vendor/assets/javascripts/aloha/lib/aloha/markup.js +1272 -1255
  43. data/vendor/assets/javascripts/aloha/lib/aloha/nls/ca/i18n.js +11 -0
  44. data/vendor/assets/javascripts/aloha/lib/aloha/nls/de/i18n.js +11 -10
  45. data/vendor/assets/javascripts/aloha/lib/aloha/nls/i18n.js +19 -19
  46. data/vendor/assets/javascripts/aloha/lib/aloha/nls/mk/i18n.js +11 -0
  47. data/vendor/assets/javascripts/aloha/lib/aloha/nls/pt-br/i18n.js +11 -0
  48. data/vendor/assets/javascripts/aloha/lib/aloha/nls/ru/i18n.js +11 -0
  49. data/vendor/assets/javascripts/aloha/lib/aloha/nls/uk/i18n.js +11 -0
  50. data/vendor/assets/javascripts/aloha/lib/aloha/nls/zh-hans/i18n.js +11 -0
  51. data/vendor/assets/javascripts/aloha/lib/aloha/observable.js +43 -36
  52. data/vendor/assets/javascripts/aloha/lib/aloha/plugin.js +80 -75
  53. data/vendor/assets/javascripts/aloha/lib/aloha/pluginmanager.js +146 -97
  54. data/vendor/assets/javascripts/aloha/lib/aloha/rangy-core.js +30 -3242
  55. data/vendor/assets/javascripts/aloha/lib/aloha/registry.js +102 -24
  56. data/vendor/assets/javascripts/aloha/lib/aloha/repository.js +137 -123
  57. data/vendor/assets/javascripts/aloha/lib/aloha/repositorymanager.js +742 -571
  58. data/vendor/assets/javascripts/aloha/lib/aloha/repositoryobjects.js +77 -61
  59. data/vendor/assets/javascripts/aloha/lib/aloha/selection.js +2402 -2102
  60. data/vendor/assets/javascripts/aloha/lib/aloha/sidebar.js +566 -664
  61. data/vendor/assets/javascripts/aloha/lib/aloha/state-override.js +125 -0
  62. data/vendor/assets/javascripts/aloha/lib/css.js +329 -187
  63. data/vendor/assets/javascripts/aloha/lib/i18n.js +118 -79
  64. data/vendor/assets/javascripts/aloha/lib/require.js +1424 -1384
  65. data/vendor/assets/javascripts/aloha/lib/text.js +39 -13
  66. data/vendor/assets/javascripts/aloha/lib/util/arrays.js +240 -0
  67. data/vendor/assets/javascripts/aloha/lib/util/browser.js +32 -0
  68. data/vendor/assets/javascripts/aloha/lib/util/class.js +67 -69
  69. data/vendor/assets/javascripts/aloha/lib/util/dom.js +1525 -1504
  70. data/vendor/assets/javascripts/aloha/lib/util/dom2.js +748 -0
  71. data/vendor/assets/javascripts/aloha/lib/util/functions.js +62 -0
  72. data/vendor/assets/javascripts/aloha/lib/util/html.js +121 -0
  73. data/vendor/assets/javascripts/aloha/lib/util/json2.js +240 -257
  74. data/vendor/assets/javascripts/aloha/lib/util/keys.js +65 -0
  75. data/vendor/assets/javascripts/aloha/lib/util/lang.js +89 -66
  76. data/vendor/assets/javascripts/aloha/lib/util/maps.js +108 -0
  77. data/vendor/assets/javascripts/aloha/lib/util/misc.js +51 -0
  78. data/vendor/assets/javascripts/aloha/lib/util/position.js +176 -158
  79. data/vendor/assets/javascripts/aloha/lib/util/range-context.js +528 -0
  80. data/vendor/assets/javascripts/aloha/lib/util/range.js +799 -805
  81. data/vendor/assets/javascripts/aloha/lib/util/strings.js +114 -0
  82. data/vendor/assets/javascripts/aloha/lib/util/trees.js +336 -0
  83. data/vendor/assets/javascripts/aloha/lib/vendor/3rdparty.txt +70 -0
  84. data/vendor/assets/javascripts/aloha/lib/vendor/amplify.store.js +298 -0
  85. data/vendor/assets/javascripts/aloha/lib/vendor/class.js +76 -0
  86. data/vendor/assets/javascripts/aloha/{plugins/extra/browser → lib}/vendor/grid.locale.de.js +138 -139
  87. data/vendor/assets/javascripts/aloha/{plugins/extra/browser → lib}/vendor/grid.locale.en.js +43 -44
  88. data/vendor/assets/javascripts/aloha/lib/vendor/ierange-m2.js +508 -0
  89. data/vendor/assets/javascripts/aloha/lib/vendor/{jquery-1.6.1.js → jquery-1.7.2.js} +2553 -2068
  90. data/vendor/assets/javascripts/aloha/lib/vendor/jquery-ui-1.9.0.custom-aloha.js +14711 -0
  91. data/vendor/assets/javascripts/aloha/{plugins/extra/browser/vendor/jquery.jqGrid.js → lib/vendor/jquery.jqgrid.js} +5 -3
  92. data/vendor/assets/javascripts/aloha/{plugins/extra/browser → lib}/vendor/jquery.jstree.js +4 -4
  93. data/vendor/assets/javascripts/aloha/lib/vendor/jquery.layout-1.3.0-rc30.7.js +5924 -0
  94. data/vendor/assets/javascripts/aloha/lib/vendor/pubsub/js/pubsub-unminified.js +187 -0
  95. data/vendor/assets/javascripts/aloha/lib/vendor/pubsub/js/pubsub.js +2 -0
  96. data/vendor/assets/javascripts/aloha/lib/vendor/rangy-core.js +3295 -0
  97. data/vendor/assets/javascripts/aloha/{plugins/extra/browser → lib/vendor/repository-browser}/css/jstree.css +0 -0
  98. data/vendor/assets/javascripts/aloha/{plugins/extra/browser/css/browsercombined.css → lib/vendor/repository-browser/css/repository-browser.css} +64 -60
  99. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-000-medium.png +0 -0
  100. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-180.png +0 -0
  101. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-315-medium.png +0 -0
  102. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-stop-180.png +0 -0
  103. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-stop.png +0 -0
  104. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow.png +0 -0
  105. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/control-stop-square-small.png +0 -0
  106. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/folder-horizontal-open.png +0 -0
  107. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/folder-open.png +0 -0
  108. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/magnifier-left.png +0 -0
  109. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/page.png +0 -0
  110. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/picture.png +0 -0
  111. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/sort-alphabet-descending.png +0 -0
  112. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/sort-alphabet.png +0 -0
  113. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/throbber.gif +0 -0
  114. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/js/repository-browser-unminified.js +1450 -0
  115. data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/js/repository-browser.js +32 -0
  116. data/vendor/assets/javascripts/aloha/lib/vendor/sanitize.js +18 -7
  117. data/vendor/assets/javascripts/aloha/plugins/common/abbr/css/abbr.css +1 -0
  118. data/vendor/assets/javascripts/aloha/plugins/common/abbr/img/remabbr.png +0 -0
  119. data/vendor/assets/javascripts/aloha/plugins/common/abbr/lib/abbr-plugin.js +119 -109
  120. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/ca/i18n.js +6 -0
  121. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/de/i18n.js +6 -1
  122. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/i18n.js +14 -3
  123. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/mk/i18n.js +6 -0
  124. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/pt-br/i18n.js +6 -0
  125. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/ru/i18n.js +6 -0
  126. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/uk/i18n.js +6 -0
  127. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/zh-hans/i18n.js +6 -0
  128. data/vendor/assets/javascripts/aloha/plugins/common/abbr/package.json +0 -0
  129. data/vendor/assets/javascripts/aloha/plugins/common/align/css/align.css +17 -5
  130. data/vendor/assets/javascripts/aloha/plugins/common/align/img/align.png +0 -0
  131. data/vendor/assets/javascripts/aloha/plugins/common/align/lib/align-plugin.js +463 -353
  132. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/ca/i18n.js +6 -0
  133. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/de/i18n.js +6 -0
  134. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/i18n.js +16 -4
  135. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/mk/i18n.js +6 -0
  136. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/pt-br/i18n.js +6 -0
  137. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/ru/i18n.js +6 -0
  138. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/uk/i18n.js +6 -0
  139. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/zh-hans/i18n.js +6 -0
  140. data/vendor/assets/javascripts/aloha/plugins/common/block/css/block.css +13 -7
  141. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/block-plugin.js +270 -24
  142. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/block.js +268 -49
  143. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/blockcontenthandler.js +27 -8
  144. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/blockmanager.js +624 -479
  145. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/editor.js +30 -11
  146. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/editormanager.js +26 -7
  147. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/sidebarattributeeditor.js +33 -13
  148. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/ca/i18n.js +3 -0
  149. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/de/i18n.js +3 -0
  150. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/i18n.js +12 -0
  151. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/mk/i18n.js +3 -0
  152. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/pt-br/i18n.js +3 -0
  153. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/ru/i18n.js +3 -0
  154. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/uk/i18n.js +3 -0
  155. data/vendor/assets/javascripts/aloha/plugins/common/block/nls/zh-hans/i18n.js +3 -0
  156. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/css/characterpicker.css +29 -26
  157. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/img/icon.png +0 -0
  158. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/lib/characterpicker-plugin.js +445 -215
  159. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/ca/i18n.js +3 -0
  160. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/de/i18n.js +3 -1
  161. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/i18n.js +11 -3
  162. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/mk/i18n.js +3 -0
  163. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/pt-br/i18n.js +3 -0
  164. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/ru/i18n.js +3 -0
  165. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/uk/i18n.js +3 -0
  166. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/zh-hans/i18n.js +3 -0
  167. data/vendor/assets/javascripts/aloha/plugins/common/commands/css/abbr.css +0 -0
  168. data/vendor/assets/javascripts/aloha/plugins/common/commands/lib/commands-plugin.js +27 -9
  169. data/vendor/assets/javascripts/aloha/plugins/common/commands/lib/inserthtml.js +28 -9
  170. data/vendor/assets/javascripts/aloha/plugins/common/commands/package.json +0 -0
  171. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/blockelementcontenthandler.js +173 -0
  172. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/contenthandler-plugin.js +45 -34
  173. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/contenthandler-utils.js +58 -0
  174. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/genericcontenthandler.js +320 -255
  175. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/oembedcontenthandler.js +420 -235
  176. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/sanitizecontenthandler.js +82 -33
  177. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/wordcontenthandler.js +204 -128
  178. data/vendor/assets/javascripts/aloha/plugins/common/dom-to-xhtml/lib/dom-to-xhtml-plugin.js +57 -12
  179. data/vendor/assets/javascripts/aloha/plugins/common/dom-to-xhtml/lib/dom-to-xhtml.js +186 -77
  180. data/vendor/assets/javascripts/aloha/plugins/common/format/img/em.png +0 -0
  181. data/vendor/assets/javascripts/aloha/plugins/common/format/img/strong.png +0 -0
  182. data/vendor/assets/javascripts/aloha/plugins/common/format/lib/format-plugin.js +480 -255
  183. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/ca/i18n.js +52 -0
  184. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/de/i18n.js +52 -1
  185. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/i18n.js +60 -9
  186. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/mk/i18n.js +52 -0
  187. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/pt-br/i18n.js +52 -0
  188. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/ru/i18n.js +52 -1
  189. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/uk/i18n.js +52 -0
  190. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/zh-hans/i18n.js +52 -0
  191. data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/css/highlighteditables.css +0 -0
  192. data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/lib/highlighteditables-plugin.js +43 -15
  193. data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/package.json +0 -0
  194. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/css/horizontalruler.css +2 -3
  195. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/img/icon.png +0 -0
  196. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/lib/horizontalruler-plugin.js +53 -28
  197. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/ca/i18n.js +3 -0
  198. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/de/i18n.js +3 -1
  199. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/i18n.js +11 -3
  200. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/mk/i18n.js +3 -0
  201. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/pt-br/i18n.js +3 -0
  202. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/ru/i18n.js +3 -0
  203. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/uk/i18n.js +3 -0
  204. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/zh-hans/i18n.js +3 -0
  205. data/vendor/assets/javascripts/aloha/plugins/common/image/README.md +5 -22
  206. data/vendor/assets/javascripts/aloha/plugins/common/image/css/image.css +24 -15
  207. data/vendor/assets/javascripts/aloha/plugins/common/image/img/blank.jpg +0 -0
  208. data/vendor/assets/javascripts/aloha/plugins/common/image/img/cropnresize.png +0 -0
  209. data/vendor/assets/javascripts/aloha/plugins/common/image/img/handle-sw.png +0 -0
  210. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-left.png +0 -0
  211. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-none.png +0 -0
  212. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-right.png +0 -0
  213. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-border.png +0 -0
  214. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-title.png +0 -0
  215. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image.gif +0 -0
  216. data/vendor/assets/javascripts/aloha/plugins/common/image/img/padding-decrease.gif +0 -0
  217. data/vendor/assets/javascripts/aloha/plugins/common/image/img/padding-increase.gif +0 -0
  218. data/vendor/assets/javascripts/aloha/plugins/common/image/img/page.png +0 -0
  219. data/vendor/assets/javascripts/aloha/plugins/common/image/img/size-decrease.gif +0 -0
  220. data/vendor/assets/javascripts/aloha/plugins/common/image/img/size-increase.gif +0 -0
  221. data/vendor/assets/javascripts/aloha/plugins/common/image/lib/image-floatingMenu.js +308 -0
  222. data/vendor/assets/javascripts/aloha/plugins/{extra/browser/README → common/image/lib/image-plugin-actions.js} +0 -0
  223. data/vendor/assets/javascripts/aloha/plugins/common/image/lib/image-plugin.js +1330 -1632
  224. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/ca/i18n.js +32 -0
  225. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/de/i18n.js +32 -1
  226. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/i18n.js +39 -5
  227. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/mk/i18n.js +32 -0
  228. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/pt-br/i18n.js +32 -0
  229. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/ru/i18n.js +32 -16
  230. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/uk/i18n.js +32 -0
  231. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/zh-hans/i18n.js +32 -0
  232. data/vendor/assets/javascripts/aloha/plugins/common/image/package.json +0 -0
  233. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jcrop.gif +0 -0
  234. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jquery.jcrop.css +0 -0
  235. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jquery.jcrop.min.js +3 -1
  236. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/mousewheel/mousewheel.js +42 -17
  237. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  238. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  239. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  240. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  241. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  242. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  243. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  244. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  245. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  246. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  247. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  248. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  249. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  250. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  251. data/vendor/assets/javascripts/aloha/plugins/common/link/css/link.css +58 -55
  252. data/vendor/assets/javascripts/aloha/plugins/common/link/extra/delicious.js +26 -8
  253. data/vendor/assets/javascripts/aloha/plugins/common/link/extra/linklist.js +91 -73
  254. data/vendor/assets/javascripts/aloha/plugins/common/link/extra/slowlinklist.js +29 -10
  255. data/vendor/assets/javascripts/aloha/plugins/common/link/lib/link-plugin.js +429 -297
  256. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/ca/i18n.js +14 -0
  257. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/de/i18n.js +14 -13
  258. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/i18n.js +23 -9
  259. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/mk/i18n.js +14 -0
  260. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/pt-br/i18n.js +14 -0
  261. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/ru/i18n.js +14 -6
  262. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/uk/i18n.js +14 -0
  263. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/zh-hans/i18n.js +14 -0
  264. data/vendor/assets/javascripts/aloha/plugins/common/list/lib/list-plugin.js +150 -121
  265. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/ca/i18n.js +7 -0
  266. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/de/i18n.js +7 -5
  267. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/i18n.js +15 -8
  268. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/mk/i18n.js +7 -0
  269. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/pt-br/i18n.js +7 -0
  270. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/ru/i18n.js +7 -1
  271. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/uk/i18n.js +7 -0
  272. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/zh-hans/i18n.js +7 -0
  273. data/vendor/assets/javascripts/aloha/plugins/common/list/package.json +0 -0
  274. data/vendor/assets/javascripts/aloha/plugins/common/paste/lib/paste-plugin.js +338 -192
  275. data/vendor/assets/javascripts/aloha/plugins/common/table/css/table.css +5 -40
  276. data/vendor/assets/javascripts/aloha/plugins/common/table/img/down.cur +0 -0
  277. data/vendor/assets/javascripts/aloha/plugins/common/table/img/left.cur +0 -0
  278. data/vendor/assets/javascripts/aloha/plugins/common/table/img/table_layout.png +0 -0
  279. data/vendor/assets/javascripts/aloha/plugins/common/table/img/wai-green.png +0 -0
  280. data/vendor/assets/javascripts/aloha/plugins/common/table/img/wai-red.png +0 -0
  281. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-cell.js +177 -106
  282. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-create-layer.js +5 -2
  283. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-plugin-utils.js +147 -8
  284. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-plugin.js +925 -892
  285. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-selection.js +10 -6
  286. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table.js +577 -193
  287. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/ca/i18n.js +28 -0
  288. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/de/i18n.js +28 -27
  289. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/i18n.js +37 -36
  290. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/mk/i18n.js +28 -0
  291. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/pt-br/i18n.js +28 -0
  292. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/ru/i18n.js +28 -1
  293. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/uk/i18n.js +28 -0
  294. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/zh-hans/i18n.js +28 -0
  295. data/vendor/assets/javascripts/aloha/plugins/common/table/package.json +0 -0
  296. data/vendor/assets/javascripts/aloha/plugins/common/ui/css/jquery-ui-1.9m6.css +430 -0
  297. data/vendor/assets/javascripts/aloha/plugins/common/ui/css/ui.css +689 -0
  298. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/blockquote.png +0 -0
  299. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/character-picker.png +0 -0
  300. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/em.png +0 -0
  301. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/format-block.png +0 -0
  302. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/format-inline.png +0 -0
  303. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/indent.png +0 -0
  304. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/jqueryui/ui-icons_222222_256x240.png +0 -0
  305. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/justify.png +0 -0
  306. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/language-annotation.png +0 -0
  307. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview.png +0 -0
  308. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/anchor.png +0 -0
  309. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/blockquote.png +0 -0
  310. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/caption.png +0 -0
  311. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/cite.png +0 -0
  312. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/dd.png +0 -0
  313. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/div.png +0 -0
  314. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/dl.png +0 -0
  315. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/dt.png +0 -0
  316. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h1.png +0 -0
  317. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h2.png +0 -0
  318. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h3.png +0 -0
  319. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h4.png +0 -0
  320. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h5.png +0 -0
  321. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h6.png +0 -0
  322. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/p.png +0 -0
  323. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/pre.png +0 -0
  324. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/q.png +0 -0
  325. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/table.png +0 -0
  326. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/td.png +0 -0
  327. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/th.png +0 -0
  328. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/multisplit-close.gif +0 -0
  329. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/multisplit-open.gif +0 -0
  330. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/outdent.png +0 -0
  331. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/quote.png +0 -0
  332. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/removeformat.png +0 -0
  333. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/strong.png +0 -0
  334. data/vendor/assets/javascripts/aloha/plugins/common/ui/img/tree.png +0 -0
  335. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/arena.js +11 -0
  336. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/autocomplete.js +70 -0
  337. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/button.js +114 -0
  338. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/component.js +121 -0
  339. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/container.js +210 -0
  340. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/context.js +53 -0
  341. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/dialog.js +215 -0
  342. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/floating.js +405 -0
  343. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/menuButton.js +169 -0
  344. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/multiSplit.js +237 -0
  345. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/port-helper-attribute-field.js +444 -0
  346. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/port-helper-multi-split.js +71 -0
  347. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/scopes.js +187 -0
  348. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/settings.js +202 -0
  349. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/subguarded.js +183 -0
  350. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/surface.js +106 -0
  351. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/tab.js +281 -0
  352. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/text.js +33 -0
  353. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/toggleButton.js +57 -0
  354. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/toolbar.js +251 -0
  355. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/ui-plugin.js +169 -0
  356. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/ui.js +181 -0
  357. data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/utils.js +104 -0
  358. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/ca/i18n.js +46 -0
  359. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/de/i18n.js +47 -0
  360. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/i18n.js +75 -0
  361. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/mk/i18n.js +46 -0
  362. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/pt-br/i18n.js +46 -0
  363. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/ru/i18n.js +46 -0
  364. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/uk/i18n.js +46 -0
  365. data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/zh-hans/i18n.js +46 -0
  366. data/vendor/assets/javascripts/aloha/plugins/common/ui/vendor/jquery-ui-autocomplete-html.js +42 -0
  367. data/vendor/assets/javascripts/aloha/plugins/common/undo/lib/undo-plugin.js +165 -134
  368. data/vendor/assets/javascripts/aloha/plugins/common/undo/package.json +0 -0
  369. data/vendor/assets/javascripts/aloha/plugins/common/undo/vendor/undo.js +2 -0
  370. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/lib/attributes-plugin.js +27 -7
  371. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/ca/i18n.js +5 -0
  372. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/de/i18n.js +5 -1
  373. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/i18n.js +13 -4
  374. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/mk/i18n.js +5 -0
  375. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/pt-br/i18n.js +5 -0
  376. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/ru/i18n.js +5 -0
  377. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/uk/i18n.js +5 -0
  378. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/zh-hans/i18n.js +5 -0
  379. data/vendor/assets/javascripts/aloha/plugins/extra/captioned-image/css/captioned-image.css +15 -0
  380. data/vendor/assets/javascripts/aloha/plugins/extra/captioned-image/lib/captioned-image-plugin.js +555 -0
  381. data/vendor/assets/javascripts/aloha/plugins/extra/cite/img/blockquote.png +0 -0
  382. data/vendor/assets/javascripts/aloha/plugins/extra/cite/img/icon_cite.png +0 -0
  383. data/vendor/assets/javascripts/aloha/plugins/extra/cite/lib/cite-plugin.js +369 -308
  384. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/ca/i18n.js +4 -0
  385. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/de/i18n.js +4 -1
  386. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/i18n.js +12 -3
  387. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/mk/i18n.js +4 -0
  388. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/pt-br/i18n.js +4 -0
  389. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/ru/i18n.js +4 -0
  390. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/uk/i18n.js +4 -0
  391. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/zh-hans/i18n.js +4 -0
  392. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/add-icon.png +0 -0
  393. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/add.png +0 -0
  394. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/comments.png +0 -0
  395. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/hr.png +0 -0
  396. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/textbox.png +0 -0
  397. data/vendor/assets/javascripts/aloha/plugins/extra/comments/{src/comments.js → lib/comments-plugin.js} +38 -15
  398. data/vendor/assets/javascripts/aloha/plugins/extra/comments/{src → lib}/comments.css +0 -0
  399. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/README.md +1 -1
  400. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/TODO.md +0 -0
  401. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/cross.png +0 -0
  402. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/hourglass.png +0 -0
  403. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/loading.gif +0 -0
  404. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/page.png +0 -0
  405. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/tick.png +0 -0
  406. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/draganddropfiles-plugin.js +1 -1
  407. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dragndropfiles.css +0 -0
  408. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dragndropfiles.js +27 -13
  409. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dropfilesrepository.js +2 -2
  410. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/ca/i18n.js +3 -0
  411. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/de/i18n.js +3 -0
  412. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/i18n.js +12 -0
  413. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/mk/i18n.js +3 -0
  414. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/pt-br/i18n.js +3 -0
  415. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/ru/i18n.js +3 -0
  416. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/uk/i18n.js +3 -0
  417. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/zh-hans/i18n.js +3 -0
  418. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/package.json +0 -0
  419. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/README.md +1 -3
  420. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/css/formatless.css +1 -1
  421. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/img/button.png +0 -0
  422. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/lib/formatlesshandler.js +76 -46
  423. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/lib/formatlesspaste-plugin.js +217 -90
  424. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/ca/i18n.js +3 -0
  425. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/de/i18n.js +3 -1
  426. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/i18n.js +10 -5
  427. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/mk/i18n.js +3 -0
  428. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/pt-br/i18n.js +3 -0
  429. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/ru/i18n.js +3 -0
  430. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/uk/i18n.js +3 -0
  431. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/zh-hans/i18n.js +3 -0
  432. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/lib/headerids-plugin.js +69 -30
  433. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/ca/i18n.js +6 -0
  434. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/de/i18n.js +6 -1
  435. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/i18n.js +14 -4
  436. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/mk/i18n.js +6 -0
  437. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/pt-br/i18n.js +6 -0
  438. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/ru/i18n.js +6 -0
  439. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/uk/i18n.js +6 -0
  440. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/zh-hans/i18n.js +6 -0
  441. data/vendor/assets/javascripts/aloha/plugins/extra/hints/README.md +12 -0
  442. data/vendor/assets/javascripts/aloha/plugins/extra/hints/css/hints.css +29 -0
  443. data/vendor/assets/javascripts/aloha/plugins/extra/hints/lib/hints-plugin.js +97 -0
  444. data/vendor/assets/javascripts/aloha/plugins/extra/hints/package.json +3 -3
  445. data/vendor/assets/javascripts/aloha/plugins/extra/hints/vendor/tipsy.js +242 -0
  446. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/README +0 -0
  447. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/lib/imagebrowser-plugin.js +160 -0
  448. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/ca/i18n.js +6 -0
  449. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/de/i18n.js +6 -0
  450. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/i18n.js +15 -0
  451. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/mk/i18n.js +6 -0
  452. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/pt-br/i18n.js +6 -0
  453. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/ru/i18n.js +6 -0
  454. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/uk/i18n.js +6 -0
  455. data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/zh-hans/i18n.js +6 -0
  456. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ad.png +0 -0
  457. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ae.png +0 -0
  458. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/af.png +0 -0
  459. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ag.png +0 -0
  460. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ai.png +0 -0
  461. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/al.png +0 -0
  462. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/am.png +0 -0
  463. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/an.png +0 -0
  464. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ao.png +0 -0
  465. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ar.png +0 -0
  466. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/as.png +0 -0
  467. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/at.png +0 -0
  468. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/au.png +0 -0
  469. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/aw.png +0 -0
  470. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ax.png +0 -0
  471. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/az.png +0 -0
  472. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ba.png +0 -0
  473. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bb.png +0 -0
  474. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bd.png +0 -0
  475. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/be.png +0 -0
  476. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bf.png +0 -0
  477. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bg.png +0 -0
  478. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bh.png +0 -0
  479. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bi.png +0 -0
  480. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bj.png +0 -0
  481. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bm.png +0 -0
  482. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bn.png +0 -0
  483. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bo.png +0 -0
  484. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/br.png +0 -0
  485. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bs.png +0 -0
  486. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bt.png +0 -0
  487. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bv.png +0 -0
  488. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bw.png +0 -0
  489. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/by.png +0 -0
  490. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bz.png +0 -0
  491. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ca.png +0 -0
  492. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/catalonia.png +0 -0
  493. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cc.png +0 -0
  494. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cd.png +0 -0
  495. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cf.png +0 -0
  496. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cg.png +0 -0
  497. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ch.png +0 -0
  498. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ci.png +0 -0
  499. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ck.png +0 -0
  500. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cl.png +0 -0
  501. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cm.png +0 -0
  502. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cn.png +0 -0
  503. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/co.png +0 -0
  504. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cr.png +0 -0
  505. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cs.png +0 -0
  506. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cu.png +0 -0
  507. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cv.png +0 -0
  508. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cx.png +0 -0
  509. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cy.png +0 -0
  510. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cz.png +0 -0
  511. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/de.png +0 -0
  512. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dj.png +0 -0
  513. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dk.png +0 -0
  514. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dm.png +0 -0
  515. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/do.png +0 -0
  516. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dz.png +0 -0
  517. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ec.png +0 -0
  518. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ee.png +0 -0
  519. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/eg.png +0 -0
  520. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/eh.png +0 -0
  521. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/en.png +0 -0
  522. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/er.png +0 -0
  523. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/es.png +0 -0
  524. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/et.png +0 -0
  525. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/europeanunion.png +0 -0
  526. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fam.png +0 -0
  527. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fi.png +0 -0
  528. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fj.png +0 -0
  529. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fk.png +0 -0
  530. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fm.png +0 -0
  531. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fo.png +0 -0
  532. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fr.png +0 -0
  533. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ga.png +0 -0
  534. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gb.png +0 -0
  535. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gd.png +0 -0
  536. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ge.png +0 -0
  537. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gf.png +0 -0
  538. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gh.png +0 -0
  539. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gi.png +0 -0
  540. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gl.png +0 -0
  541. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gm.png +0 -0
  542. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gn.png +0 -0
  543. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gp.png +0 -0
  544. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gq.png +0 -0
  545. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gr.png +0 -0
  546. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gs.png +0 -0
  547. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gt.png +0 -0
  548. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gu.png +0 -0
  549. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gw.png +0 -0
  550. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gy.png +0 -0
  551. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hk.png +0 -0
  552. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hm.png +0 -0
  553. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hn.png +0 -0
  554. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hr.png +0 -0
  555. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ht.png +0 -0
  556. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hu.png +0 -0
  557. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/id.png +0 -0
  558. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ie.png +0 -0
  559. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/il.png +0 -0
  560. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/in.png +0 -0
  561. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/io.png +0 -0
  562. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/iq.png +0 -0
  563. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ir.png +0 -0
  564. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/is.png +0 -0
  565. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/it.png +0 -0
  566. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jm.png +0 -0
  567. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jo.png +0 -0
  568. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jp.png +0 -0
  569. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ke.png +0 -0
  570. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kg.png +0 -0
  571. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kh.png +0 -0
  572. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ki.png +0 -0
  573. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/km.png +0 -0
  574. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kn.png +0 -0
  575. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kp.png +0 -0
  576. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kr.png +0 -0
  577. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kw.png +0 -0
  578. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ky.png +0 -0
  579. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kz.png +0 -0
  580. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/la.png +0 -0
  581. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lb.png +0 -0
  582. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lc.png +0 -0
  583. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/li.png +0 -0
  584. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lk.png +0 -0
  585. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lr.png +0 -0
  586. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ls.png +0 -0
  587. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lt.png +0 -0
  588. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lu.png +0 -0
  589. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lv.png +0 -0
  590. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ly.png +0 -0
  591. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ma.png +0 -0
  592. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mc.png +0 -0
  593. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/md.png +0 -0
  594. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/me.png +0 -0
  595. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mg.png +0 -0
  596. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mh.png +0 -0
  597. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mk.png +0 -0
  598. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ml.png +0 -0
  599. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mm.png +0 -0
  600. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mn.png +0 -0
  601. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mo.png +0 -0
  602. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mp.png +0 -0
  603. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mq.png +0 -0
  604. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mr.png +0 -0
  605. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ms.png +0 -0
  606. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mt.png +0 -0
  607. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mu.png +0 -0
  608. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mv.png +0 -0
  609. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mw.png +0 -0
  610. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mx.png +0 -0
  611. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/my.png +0 -0
  612. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mz.png +0 -0
  613. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/na.png +0 -0
  614. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nc.png +0 -0
  615. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ne.png +0 -0
  616. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nf.png +0 -0
  617. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ng.png +0 -0
  618. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ni.png +0 -0
  619. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nl.png +0 -0
  620. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/no.png +0 -0
  621. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/np.png +0 -0
  622. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nr.png +0 -0
  623. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nu.png +0 -0
  624. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nz.png +0 -0
  625. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/om.png +0 -0
  626. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pa.png +0 -0
  627. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pe.png +0 -0
  628. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pf.png +0 -0
  629. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pg.png +0 -0
  630. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ph.png +0 -0
  631. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pk.png +0 -0
  632. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pl.png +0 -0
  633. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pm.png +0 -0
  634. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pn.png +0 -0
  635. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pr.png +0 -0
  636. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ps.png +0 -0
  637. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pt.png +0 -0
  638. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pw.png +0 -0
  639. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/py.png +0 -0
  640. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/qa.png +0 -0
  641. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/re.png +0 -0
  642. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ro.png +0 -0
  643. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/rs.png +0 -0
  644. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ru.png +0 -0
  645. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/rw.png +0 -0
  646. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sa.png +0 -0
  647. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sb.png +0 -0
  648. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sc.png +0 -0
  649. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/scotland.png +0 -0
  650. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sd.png +0 -0
  651. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/se.png +0 -0
  652. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sg.png +0 -0
  653. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sh.png +0 -0
  654. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/si.png +0 -0
  655. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sj.png +0 -0
  656. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sk.png +0 -0
  657. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sl.png +0 -0
  658. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sm.png +0 -0
  659. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sn.png +0 -0
  660. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/so.png +0 -0
  661. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sr.png +0 -0
  662. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/st.png +0 -0
  663. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sv.png +0 -0
  664. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sy.png +0 -0
  665. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sz.png +0 -0
  666. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tc.png +0 -0
  667. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/td.png +0 -0
  668. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tf.png +0 -0
  669. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tg.png +0 -0
  670. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/th.png +0 -0
  671. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tj.png +0 -0
  672. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tk.png +0 -0
  673. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tl.png +0 -0
  674. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tm.png +0 -0
  675. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tn.png +0 -0
  676. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/to.png +0 -0
  677. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tr.png +0 -0
  678. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tt.png +0 -0
  679. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tv.png +0 -0
  680. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tw.png +0 -0
  681. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tz.png +0 -0
  682. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ua.png +0 -0
  683. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ug.png +0 -0
  684. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/um.png +0 -0
  685. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/us.png +0 -0
  686. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/uy.png +0 -0
  687. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/uz.png +0 -0
  688. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/va.png +0 -0
  689. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vc.png +0 -0
  690. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ve.png +0 -0
  691. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vg.png +0 -0
  692. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vi.png +0 -0
  693. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vn.png +0 -0
  694. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vu.png +0 -0
  695. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/wales.png +0 -0
  696. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/wf.png +0 -0
  697. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ws.png +0 -0
  698. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ye.png +0 -0
  699. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/yt.png +0 -0
  700. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/za.png +0 -0
  701. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/zm.png +0 -0
  702. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/zw.png +0 -0
  703. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/lib/linkbrowser-plugin.js +96 -100
  704. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/ca/i18n.js +6 -0
  705. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/de/i18n.js +6 -1
  706. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/i18n.js +14 -6
  707. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/mk/i18n.js +6 -0
  708. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/pt-br/i18n.js +6 -0
  709. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/ru/i18n.js +6 -1
  710. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/uk/i18n.js +6 -0
  711. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/zh-hans/i18n.js +6 -0
  712. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/ca/i18n.js +28 -0
  713. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/de/i18n.js +28 -0
  714. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/i18n.js +37 -0
  715. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/mk/i18n.js +28 -0
  716. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/pt-br/i18n.js +28 -0
  717. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/ru/i18n.js +28 -0
  718. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/uk/i18n.js +28 -0
  719. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/zh-hans/i18n.js +28 -0
  720. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/package.json +0 -0
  721. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/{proxy.php → proxy.php.example} +0 -0
  722. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/src/linkchecker.css +0 -0
  723. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/src/linkchecker.js +28 -15
  724. data/vendor/assets/javascripts/aloha/plugins/extra/listenforcer/lib/listenforcer-plugin.js +56 -31
  725. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/css/metaview.css +6 -14
  726. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/anchor.png +0 -0
  727. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/blockquote.png +0 -0
  728. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/button.png +0 -0
  729. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/caption.png +0 -0
  730. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/cite.png +0 -0
  731. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dd.png +0 -0
  732. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/div.png +0 -0
  733. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dl.png +0 -0
  734. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dt.png +0 -0
  735. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h1.png +0 -0
  736. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h2.png +0 -0
  737. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h3.png +0 -0
  738. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h4.png +0 -0
  739. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h5.png +0 -0
  740. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h6.png +0 -0
  741. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/hr.png +0 -0
  742. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/icon_cite.png +0 -0
  743. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/p.png +0 -0
  744. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/pre.png +0 -0
  745. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/table.png +0 -0
  746. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/td.png +0 -0
  747. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/th.png +0 -0
  748. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/lib/metaview-plugin.js +178 -74
  749. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/ca/i18n.js +3 -0
  750. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/de/i18n.js +3 -1
  751. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/i18n.js +11 -4
  752. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/mk/i18n.js +3 -0
  753. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/pt-br/i18n.js +3 -0
  754. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/ru/i18n.js +3 -0
  755. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/uk/i18n.js +3 -0
  756. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/zh-hans/i18n.js +3 -0
  757. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/css/numerated-headers.css +1 -1
  758. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/img/headers.png +0 -0
  759. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/lib/numerated-headers-plugin.js +405 -217
  760. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/ca/i18n.js +5 -0
  761. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/de/i18n.js +5 -1
  762. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/i18n.js +13 -4
  763. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/mk/i18n.js +5 -0
  764. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/pt-br/i18n.js +5 -0
  765. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/ru/i18n.js +5 -0
  766. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/uk/i18n.js +5 -0
  767. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/zh-hans/i18n.js +5 -0
  768. data/vendor/assets/javascripts/aloha/plugins/extra/profiler/lib/profiler-plugin.js +29 -10
  769. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/README.md +0 -0
  770. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/css/ribbon.css +49 -5
  771. data/vendor/assets/javascripts/aloha/{img → plugins/extra/ribbon/img}/fade-in.png +0 -0
  772. data/vendor/assets/javascripts/aloha/{img → plugins/extra/ribbon/img}/fade-out.png +0 -0
  773. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/lib/ribbon-plugin.js +108 -150
  774. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/package.json +0 -0
  775. data/vendor/assets/javascripts/aloha/plugins/extra/sourceview/css/sourceview.css +18 -0
  776. data/vendor/assets/javascripts/aloha/plugins/extra/sourceview/lib/sourceview-plugin.js +252 -0
  777. data/vendor/assets/javascripts/aloha/plugins/extra/sourceview/vendor/htmlbeautifier.js +468 -0
  778. data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/css/textcolor.css +50 -0
  779. data/vendor/assets/javascripts/aloha/{lib/vendor/ext-3.2.1/resources/images/gray/window/left-right.png → plugins/extra/textcolor/img/icon.png} +0 -0
  780. data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/lib/textcolor-plugin.js +420 -0
  781. data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/nls/de/i18n.js +3 -0
  782. data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/nls/i18n.js +6 -0
  783. data/vendor/assets/javascripts/aloha/plugins/extra/toc/lib/toc-plugin.js +56 -39
  784. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/ca/i18n.js +3 -0
  785. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/de/i18n.js +3 -3
  786. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/i18n.js +11 -3
  787. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/mk/i18n.js +3 -0
  788. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/pt-br/i18n.js +3 -0
  789. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/ru/i18n.js +3 -0
  790. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/uk/i18n.js +3 -0
  791. data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/zh-hans/i18n.js +3 -0
  792. data/vendor/assets/javascripts/aloha/plugins/extra/toc/package.json +0 -0
  793. data/vendor/assets/javascripts/aloha/plugins/extra/validation/lib/validation-plugin.js +277 -0
  794. metadata +293 -508
  795. data/vendor/assets/javascripts/aloha/css/ext-aloha-reset.css +0 -33
  796. data/vendor/assets/javascripts/aloha/css/ext-aloha.css +0 -360
  797. data/vendor/assets/javascripts/aloha/img/base-big.png +0 -0
  798. data/vendor/assets/javascripts/aloha/lib/aloha-bootstrap.js +0 -28276
  799. data/vendor/assets/javascripts/aloha/lib/aloha/ecma5.js +0 -194
  800. data/vendor/assets/javascripts/aloha/lib/aloha/ext-alohaproxy.js +0 -86
  801. data/vendor/assets/javascripts/aloha/lib/aloha/ext-alohareader.js +0 -50
  802. data/vendor/assets/javascripts/aloha/lib/aloha/ext-alohatreeloader.js +0 -77
  803. data/vendor/assets/javascripts/aloha/lib/aloha/ext.js +0 -32
  804. data/vendor/assets/javascripts/aloha/lib/aloha/floatingmenu.js +0 -1496
  805. data/vendor/assets/javascripts/aloha/lib/aloha/jquery.js +0 -34
  806. data/vendor/assets/javascripts/aloha/lib/aloha/jquery.patch.js +0 -115
  807. data/vendor/assets/javascripts/aloha/lib/aloha/message.js +0 -115
  808. data/vendor/assets/javascripts/aloha/lib/aloha/ui-attributefield.js +0 -530
  809. data/vendor/assets/javascripts/aloha/lib/aloha/ui-browser.js +0 -214
  810. data/vendor/assets/javascripts/aloha/lib/aloha/ui.js +0 -889
  811. data/vendor/assets/javascripts/aloha/lib/jquery-plugin.js +0 -49
  812. data/vendor/assets/javascripts/aloha/lib/order.js +0 -140
  813. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/adapter/jquery/ext-jquery-adapter-debug.js +0 -2470
  814. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/adapter/jquery/ext-jquery-adapter.js +0 -7
  815. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/ext-all-debug.js +0 -47708
  816. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/ext-all.js +0 -13
  817. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/gpl-3.0.txt +0 -674
  818. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/license.txt +0 -42
  819. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/charts.swf +0 -0
  820. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/css/ext-all.css +0 -5903
  821. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/css/ext-all.less +0 -6795
  822. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/css/xtheme-gray.css +0 -1692
  823. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/expressinstall.swf +0 -0
  824. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/corners-blue.gif +0 -0
  825. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/corners.gif +0 -0
  826. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/l-blue.gif +0 -0
  827. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/l.gif +0 -0
  828. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/r-blue.gif +0 -0
  829. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/r.gif +0 -0
  830. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/tb-blue.gif +0 -0
  831. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/tb.gif +0 -0
  832. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/arrow.gif +0 -0
  833. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/btn.gif +0 -0
  834. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/group-cs.gif +0 -0
  835. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/group-lr.gif +0 -0
  836. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/group-tb.gif +0 -0
  837. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-b-noline.gif +0 -0
  838. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-b.gif +0 -0
  839. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-bo.gif +0 -0
  840. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-noline.gif +0 -0
  841. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-o.gif +0 -0
  842. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow.gif +0 -0
  843. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/dd/drop-add.gif +0 -0
  844. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/dd/drop-no.gif +0 -0
  845. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/dd/drop-yes.gif +0 -0
  846. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/editor/tb-sprite.gif +0 -0
  847. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/checkbox.gif +0 -0
  848. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/clear-trigger.gif +0 -0
  849. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/clear-trigger.psd +0 -0
  850. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/date-trigger.gif +0 -0
  851. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/date-trigger.psd +0 -0
  852. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/error-tip-corners.gif +0 -0
  853. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/exclamation.gif +0 -0
  854. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/radio.gif +0 -0
  855. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/search-trigger.gif +0 -0
  856. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/search-trigger.psd +0 -0
  857. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/text-bg.gif +0 -0
  858. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger-square.gif +0 -0
  859. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger-square.psd +0 -0
  860. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger-tpl.gif +0 -0
  861. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger.gif +0 -0
  862. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger.psd +0 -0
  863. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/gradient-bg.gif +0 -0
  864. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/arrow-left-white.gif +0 -0
  865. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/arrow-right-white.gif +0 -0
  866. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/col-move-bottom.gif +0 -0
  867. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/col-move-top.gif +0 -0
  868. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/columns.gif +0 -0
  869. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/dirty.gif +0 -0
  870. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/done.gif +0 -0
  871. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/drop-no.gif +0 -0
  872. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/drop-yes.gif +0 -0
  873. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/footer-bg.gif +0 -0
  874. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-blue-hd.gif +0 -0
  875. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-blue-split.gif +0 -0
  876. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-hrow.gif +0 -0
  877. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-loading.gif +0 -0
  878. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-split.gif +0 -0
  879. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-vista-hd.gif +0 -0
  880. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-hd-btn.gif +0 -0
  881. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-hrow-over.gif +0 -0
  882. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-hrow.gif +0 -0
  883. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-special-col-bg.gif +0 -0
  884. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-special-col-sel-bg.gif +0 -0
  885. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/group-by.gif +0 -0
  886. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/group-collapse.gif +0 -0
  887. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/group-expand-sprite.gif +0 -0
  888. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/group-expand.gif +0 -0
  889. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hd-pop.gif +0 -0
  890. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-asc.gif +0 -0
  891. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-desc.gif +0 -0
  892. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-lock.gif +0 -0
  893. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-lock.png +0 -0
  894. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-unlock.gif +0 -0
  895. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-unlock.png +0 -0
  896. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/invalid_line.gif +0 -0
  897. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/loading.gif +0 -0
  898. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/mso-hd.gif +0 -0
  899. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/nowait.gif +0 -0
  900. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-first-disabled.gif +0 -0
  901. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-first.gif +0 -0
  902. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-last-disabled.gif +0 -0
  903. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-last.gif +0 -0
  904. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-next-disabled.gif +0 -0
  905. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-next.gif +0 -0
  906. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-prev-disabled.gif +0 -0
  907. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-prev.gif +0 -0
  908. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/pick-button.gif +0 -0
  909. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/refresh.gif +0 -0
  910. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/row-check-sprite.gif +0 -0
  911. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/row-expand-sprite.gif +0 -0
  912. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/row-over.gif +0 -0
  913. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/row-sel.gif +0 -0
  914. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/sort-hd.gif +0 -0
  915. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/sort_asc.gif +0 -0
  916. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/sort_desc.gif +0 -0
  917. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/wait.gif +0 -0
  918. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/collapse.gif +0 -0
  919. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/expand.gif +0 -0
  920. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/gradient-bg.gif +0 -0
  921. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/mini-bottom.gif +0 -0
  922. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/mini-left.gif +0 -0
  923. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/mini-right.gif +0 -0
  924. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/mini-top.gif +0 -0
  925. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/ns-collapse.gif +0 -0
  926. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/ns-expand.gif +0 -0
  927. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/panel-close.gif +0 -0
  928. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/panel-title-bg.gif +0 -0
  929. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/panel-title-light-bg.gif +0 -0
  930. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/stick.gif +0 -0
  931. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/stuck.gif +0 -0
  932. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/tab-close-on.gif +0 -0
  933. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/tab-close.gif +0 -0
  934. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/checked.gif +0 -0
  935. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/group-checked.gif +0 -0
  936. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/item-over.gif +0 -0
  937. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/menu-parent.gif +0 -0
  938. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/menu.gif +0 -0
  939. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/unchecked.gif +0 -0
  940. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/corners-sprite.gif +0 -0
  941. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/left-right.gif +0 -0
  942. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/light-hd.gif +0 -0
  943. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/tool-sprite-tpl.gif +0 -0
  944. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/tool-sprites.gif +0 -0
  945. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/tools-sprites-trans.gif +0 -0
  946. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/top-bottom.gif +0 -0
  947. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/top-bottom.png +0 -0
  948. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/white-corners-sprite.gif +0 -0
  949. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/white-left-right.gif +0 -0
  950. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/white-top-bottom.gif +0 -0
  951. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/progress/progress-bg.gif +0 -0
  952. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/qtip/bg.gif +0 -0
  953. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/qtip/close.gif +0 -0
  954. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/qtip/tip-anchor-sprite.gif +0 -0
  955. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/qtip/tip-sprite.gif +0 -0
  956. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/s.gif +0 -0
  957. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shadow-c.png +0 -0
  958. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shadow-lr.png +0 -0
  959. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shadow.png +0 -0
  960. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/blue-loading.gif +0 -0
  961. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/calendar.gif +0 -0
  962. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/glass-bg.gif +0 -0
  963. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/hd-sprite.gif +0 -0
  964. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/large-loading.gif +0 -0
  965. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/left-btn.gif +0 -0
  966. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/loading-balls.gif +0 -0
  967. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/right-btn.gif +0 -0
  968. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/warning.gif +0 -0
  969. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/e-handle-dark.gif +0 -0
  970. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/e-handle.gif +0 -0
  971. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/ne-handle-dark.gif +0 -0
  972. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/ne-handle.gif +0 -0
  973. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/nw-handle-dark.gif +0 -0
  974. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/nw-handle.gif +0 -0
  975. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/s-handle-dark.gif +0 -0
  976. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/s-handle.gif +0 -0
  977. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/se-handle-dark.gif +0 -0
  978. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/se-handle.gif +0 -0
  979. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/square.gif +0 -0
  980. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/sw-handle-dark.gif +0 -0
  981. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/sw-handle.gif +0 -0
  982. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/slider/slider-bg.png +0 -0
  983. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/slider/slider-thumb.png +0 -0
  984. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/slider/slider-v-bg.png +0 -0
  985. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/slider/slider-v-thumb.png +0 -0
  986. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/scroll-left.gif +0 -0
  987. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/scroll-right.gif +0 -0
  988. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/scroller-bg.gif +0 -0
  989. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
  990. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
  991. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-left-bg.gif +0 -0
  992. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-over-left-bg.gif +0 -0
  993. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-over-right-bg.gif +0 -0
  994. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-right-bg.gif +0 -0
  995. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-close.gif +0 -0
  996. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-strip-bg.gif +0 -0
  997. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-strip-bg.png +0 -0
  998. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-strip-btm-bg.gif +0 -0
  999. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tabs-sprite.gif +0 -0
  1000. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/bg.gif +0 -0
  1001. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/btn-arrow-light.gif +0 -0
  1002. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/btn-arrow.gif +0 -0
  1003. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/btn-over-bg.gif +0 -0
  1004. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/gray-bg.gif +0 -0
  1005. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/more.gif +0 -0
  1006. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/tb-bg.gif +0 -0
  1007. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/tb-btn-sprite.gif +0 -0
  1008. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/tb-xl-btn-sprite.gif +0 -0
  1009. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/tb-xl-sep.gif +0 -0
  1010. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/arrows.gif +0 -0
  1011. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-add.gif +0 -0
  1012. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-between.gif +0 -0
  1013. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-no.gif +0 -0
  1014. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-over.gif +0 -0
  1015. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-under.gif +0 -0
  1016. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-yes.gif +0 -0
  1017. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end-minus-nl.gif +0 -0
  1018. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end-minus.gif +0 -0
  1019. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end-plus-nl.gif +0 -0
  1020. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end-plus.gif +0 -0
  1021. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end.gif +0 -0
  1022. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-line.gif +0 -0
  1023. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-minus-nl.gif +0 -0
  1024. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-minus.gif +0 -0
  1025. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-plus-nl.gif +0 -0
  1026. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-plus.gif +0 -0
  1027. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow.gif +0 -0
  1028. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/folder-open.gif +0 -0
  1029. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/folder.gif +0 -0
  1030. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/leaf.gif +0 -0
  1031. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/loading.gif +0 -0
  1032. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/s.gif +0 -0
  1033. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/icon-error.gif +0 -0
  1034. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/icon-info.gif +0 -0
  1035. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/icon-question.gif +0 -0
  1036. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/icon-warning.gif +0 -0
  1037. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/left-corners.png +0 -0
  1038. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/left-corners.psd +0 -0
  1039. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/left-right.png +0 -0
  1040. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/left-right.psd +0 -0
  1041. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/right-corners.png +0 -0
  1042. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/right-corners.psd +0 -0
  1043. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/top-bottom.png +0 -0
  1044. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/top-bottom.psd +0 -0
  1045. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/btn-arrow.gif +0 -0
  1046. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/btn-sprite.gif +0 -0
  1047. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/btn.gif +0 -0
  1048. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/group-cs.gif +0 -0
  1049. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/group-lr.gif +0 -0
  1050. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/group-tb.gif +0 -0
  1051. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/s-arrow-bo.gif +0 -0
  1052. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/s-arrow-o.gif +0 -0
  1053. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/clear-trigger.gif +0 -0
  1054. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/date-trigger.gif +0 -0
  1055. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/search-trigger.gif +0 -0
  1056. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/trigger-square.gif +0 -0
  1057. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/trigger.gif +0 -0
  1058. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/gradient-bg.gif +0 -0
  1059. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/col-move-bottom.gif +0 -0
  1060. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/col-move-top.gif +0 -0
  1061. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hd-btn.gif +0 -0
  1062. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hrow-over.gif +0 -0
  1063. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hrow-over2.gif +0 -0
  1064. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hrow.gif +0 -0
  1065. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hrow2.gif +0 -0
  1066. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-special-col-bg.gif +0 -0
  1067. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-special-col-bg2.gif +0 -0
  1068. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-special-col-sel-bg.gif +0 -0
  1069. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/group-collapse.gif +0 -0
  1070. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/group-expand-sprite.gif +0 -0
  1071. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/group-expand.gif +0 -0
  1072. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/page-first.gif +0 -0
  1073. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/page-last.gif +0 -0
  1074. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/page-next.gif +0 -0
  1075. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/page-prev.gif +0 -0
  1076. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/refresh.gif +0 -0
  1077. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/row-expand-sprite.gif +0 -0
  1078. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/sort_asc.gif +0 -0
  1079. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/sort_desc.gif +0 -0
  1080. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/menu/group-checked.gif +0 -0
  1081. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/menu/item-over-disabled.gif +0 -0
  1082. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/menu/item-over.gif +0 -0
  1083. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/menu/menu-parent.gif +0 -0
  1084. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/corners-sprite.gif +0 -0
  1085. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/left-right.gif +0 -0
  1086. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/light-hd.gif +0 -0
  1087. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/tool-sprite-tpl.gif +0 -0
  1088. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/tool-sprites.gif +0 -0
  1089. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/tools-sprites-trans.gif +0 -0
  1090. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/top-bottom.gif +0 -0
  1091. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/top-bottom.png +0 -0
  1092. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/white-corners-sprite.gif +0 -0
  1093. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/white-left-right.gif +0 -0
  1094. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/white-top-bottom.gif +0 -0
  1095. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/progress/progress-bg.gif +0 -0
  1096. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/qtip/bg.gif +0 -0
  1097. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/qtip/close.gif +0 -0
  1098. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/qtip/tip-anchor-sprite.gif +0 -0
  1099. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/qtip/tip-sprite.gif +0 -0
  1100. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/s.gif +0 -0
  1101. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/shared/hd-sprite.gif +0 -0
  1102. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/shared/left-btn.gif +0 -0
  1103. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/shared/right-btn.gif +0 -0
  1104. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/e-handle.gif +0 -0
  1105. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/ne-handle.gif +0 -0
  1106. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/nw-handle.gif +0 -0
  1107. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/s-handle.gif +0 -0
  1108. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/se-handle.gif +0 -0
  1109. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/square.gif +0 -0
  1110. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/sw-handle.gif +0 -0
  1111. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/slider/slider-thumb.png +0 -0
  1112. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/slider/slider-v-thumb.png +0 -0
  1113. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/scroll-left.gif +0 -0
  1114. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/scroll-right.gif +0 -0
  1115. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/scroller-bg.gif +0 -0
  1116. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-inactive-left-bg.gif +0 -0
  1117. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-inactive-right-bg.gif +0 -0
  1118. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-left-bg.gif +0 -0
  1119. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-over-left-bg.gif +0 -0
  1120. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-over-right-bg.gif +0 -0
  1121. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-right-bg.gif +0 -0
  1122. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-close.gif +0 -0
  1123. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-strip-bg.gif +0 -0
  1124. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-strip-bg.png +0 -0
  1125. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-strip-btm-bg.gif +0 -0
  1126. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tabs-sprite.gif +0 -0
  1127. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/bg.gif +0 -0
  1128. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/btn-arrow-light.gif +0 -0
  1129. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/btn-arrow.gif +0 -0
  1130. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/btn-over-bg.gif +0 -0
  1131. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/gray-bg.gif +0 -0
  1132. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/more.gif +0 -0
  1133. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/tb-bg.gif +0 -0
  1134. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/tb-btn-sprite.gif +0 -0
  1135. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/arrows.gif +0 -0
  1136. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/elbow-end-minus-nl.gif +0 -0
  1137. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/elbow-end-minus.gif +0 -0
  1138. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/elbow-end-plus-nl.gif +0 -0
  1139. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/elbow-end-plus.gif +0 -0
  1140. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/icon-error.gif +0 -0
  1141. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/icon-info.gif +0 -0
  1142. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/icon-question.gif +0 -0
  1143. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/icon-warning.gif +0 -0
  1144. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/left-corners.png +0 -0
  1145. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/left-corners.pspimage +0 -0
  1146. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/right-corners.png +0 -0
  1147. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/top-bottom.png +0 -0
  1148. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/resources.jsb +0 -507
  1149. data/vendor/assets/javascripts/aloha/lib/vendor/jquery.json-2.2.min.js +0 -33
  1150. data/vendor/assets/javascripts/aloha/lib/vendor/jquery.store.js +0 -470
  1151. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/en/i18n.js +0 -1
  1152. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/fr/i18n.js +0 -1
  1153. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/jquery-ui-1.8.16.custom.min.js +0 -198
  1154. data/vendor/assets/javascripts/aloha/plugins/common/format/css/format.css +0 -8
  1155. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/eo/i18n.js +0 -1
  1156. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/fi/i18n.js +0 -1
  1157. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/fr/i18n.js +0 -1
  1158. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/it/i18n.js +0 -1
  1159. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/pl/i18n.js +0 -1
  1160. data/vendor/assets/javascripts/aloha/plugins/common/image/AGPL3 +0 -661
  1161. data/vendor/assets/javascripts/aloha/plugins/common/image/LICENSE +0 -25
  1162. data/vendor/assets/javascripts/aloha/plugins/common/image/demo/crop.html +0 -76
  1163. data/vendor/assets/javascripts/aloha/plugins/common/image/demo/crop.php +0 -21
  1164. data/vendor/assets/javascripts/aloha/plugins/common/image/demo/cropnresize.jpg +0 -0
  1165. data/vendor/assets/javascripts/aloha/plugins/common/image/demo/index.html +0 -120
  1166. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/cz/i18n.js +0 -16
  1167. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/fr/i18n.js +0 -1
  1168. data/vendor/assets/javascripts/aloha/plugins/common/image/test/test.css +0 -12
  1169. data/vendor/assets/javascripts/aloha/plugins/common/image/test/test.html +0 -40
  1170. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/jquery-ui-1.8.10.custom.min.js +0 -97
  1171. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/jquery-ui-1.8.10.cropnresize.css +0 -33
  1172. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/jquery-ui-1.8.10.custom.css +0 -314
  1173. data/vendor/assets/javascripts/aloha/plugins/common/link/demo/background.png +0 -0
  1174. data/vendor/assets/javascripts/aloha/plugins/common/link/demo/external-link-ltr-icon.png +0 -0
  1175. data/vendor/assets/javascripts/aloha/plugins/common/link/demo/index.css +0 -91
  1176. data/vendor/assets/javascripts/aloha/plugins/common/link/demo/index.html +0 -91
  1177. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/fr/i18n.js +0 -6
  1178. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/pl/i18n.js +0 -6
  1179. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/eo/i18n.js +0 -1
  1180. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/fi/i18n.js +0 -1
  1181. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/fr/i18n.js +0 -1
  1182. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/it/i18n.js +0 -1
  1183. data/vendor/assets/javascripts/aloha/plugins/common/paste/README.md +0 -3
  1184. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/eo/i18n.js +0 -1
  1185. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/fi/i18n.js +0 -1
  1186. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/fr/i18n.js +0 -1
  1187. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/it/i18n.js +0 -1
  1188. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/pl/i18n.js +0 -1
  1189. data/vendor/assets/javascripts/aloha/plugins/common/undo/demo/index.css +0 -49
  1190. data/vendor/assets/javascripts/aloha/plugins/common/undo/demo/index.html +0 -85
  1191. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/en/i18n.js +0 -1
  1192. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/browser.css +0 -360
  1193. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/browser.jqgrid.css +0 -374
  1194. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  1195. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  1196. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  1197. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  1198. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  1199. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  1200. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  1201. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  1202. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_222222_256x240.png +0 -0
  1203. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_2e83ff_256x240.png +0 -0
  1204. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_454545_256x240.png +0 -0
  1205. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_888888_256x240.png +0 -0
  1206. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  1207. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/jquery-ui-1.8.13.custom.css +0 -319
  1208. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/throbber.gif +0 -0
  1209. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/ui.jqgrid.css +0 -148
  1210. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-000-medium.png +0 -0
  1211. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-180.png +0 -0
  1212. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-315-medium.png +0 -0
  1213. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-stop-180.png +0 -0
  1214. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-stop.png +0 -0
  1215. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow.png +0 -0
  1216. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/control-stop-square-small.png +0 -0
  1217. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/folder-horizontal-open.png +0 -0
  1218. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/folder-open.png +0 -0
  1219. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/gcn-icons/gcn-icon-file.gif +0 -0
  1220. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/gcn-icons/gcn-icon-image.gif +0 -0
  1221. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/gcn-icons/gcn-icon-page.gif +0 -0
  1222. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/magnifier-left.png +0 -0
  1223. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/page.png +0 -0
  1224. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/picture.png +0 -0
  1225. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/sort-alphabet-descending.png +0 -0
  1226. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/sort-alphabet.png +0 -0
  1227. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/throbber.gif +0 -0
  1228. data/vendor/assets/javascripts/aloha/plugins/extra/browser/lib/browser-plugin.js +0 -10
  1229. data/vendor/assets/javascripts/aloha/plugins/extra/browser/lib/browser.js +0 -1126
  1230. data/vendor/assets/javascripts/aloha/plugins/extra/browser/lib/locale.js +0 -26
  1231. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/de.json +0 -1
  1232. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/de/i18n.js +0 -18
  1233. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/en.json +0 -1
  1234. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/en/i18n.js +0 -18
  1235. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/i18n.js +0 -4
  1236. data/vendor/assets/javascripts/aloha/plugins/extra/browser/vendor/jquery.ui.js +0 -761
  1237. data/vendor/assets/javascripts/aloha/plugins/extra/browser/vendor/ui-layout.js +0 -113
  1238. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/en/i18n.js +0 -1
  1239. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/AGPL3 +0 -661
  1240. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/LICENSE +0 -25
  1241. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/index.css +0 -47
  1242. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/index.html +0 -101
  1243. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/migration/index.css +0 -189
  1244. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/migration/index.html +0 -321
  1245. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/specs/DragnDropnImage.graphml +0 -677
  1246. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/style.css +0 -47
  1247. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/upload.php +0 -26
  1248. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/i18n/en.json +0 -1
  1249. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/i18n/fr.json +0 -1
  1250. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/en/i18n.js +0 -1
  1251. data/vendor/assets/javascripts/aloha/plugins/extra/hints/dep/jquery.poshytip.js +0 -470
  1252. data/vendor/assets/javascripts/aloha/plugins/extra/hints/i18n/de.json +0 -1
  1253. data/vendor/assets/javascripts/aloha/plugins/extra/hints/i18n/en.json +0 -1
  1254. data/vendor/assets/javascripts/aloha/plugins/extra/hints/img/tip-twitter_arrows.gif +0 -0
  1255. data/vendor/assets/javascripts/aloha/plugins/extra/hints/src/hints.css +0 -61
  1256. data/vendor/assets/javascripts/aloha/plugins/extra/hints/src/hints.js +0 -49
  1257. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/fr/i18n.js +0 -1
  1258. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/pl/i18n.js +0 -1
  1259. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/demo/index.css +0 -49
  1260. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/demo/index.html +0 -82
  1261. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/i18n/en.json +0 -1
  1262. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/de.json +0 -1
  1263. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/en.json +0 -1
  1264. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/en/i18n.js +0 -1
  1265. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/demo/index.css +0 -189
  1266. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/demo/index.html +0 -139
  1267. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/demo/js/aloha-config.js +0 -115
  1268. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/en/i18n.js +0 -1
  1269. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/LICENSE.md +0 -662
  1270. data/vendor/assets/javascripts/aloha/plugins/extra/vie/LICENSE +0 -22
  1271. data/vendor/assets/javascripts/aloha/plugins/extra/vie/README.markdown +0 -65
  1272. data/vendor/assets/javascripts/aloha/plugins/extra/vie/demo/index.html +0 -93
  1273. data/vendor/assets/javascripts/aloha/plugins/extra/vie/img/cms-decoupled-communications.png +0 -0
  1274. data/vendor/assets/javascripts/aloha/plugins/extra/vie/package.json +0 -1
  1275. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/backbone-min.js +0 -27
  1276. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/underscore-min.js +0 -25
  1277. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/vie-aloha.js +0 -74
  1278. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/vie-collectionmanager.js +0 -70
  1279. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/vie-containermanager.js +0 -263
  1280. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/vie.js +0 -20
@@ -1,20 +1,42 @@
1
- /*!
2
- * This file is part of Aloha Editor
3
- * Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
4
- * Licensed unter the terms of http://www.aloha-editor.com/license.html
1
+ /* repositoryobjects.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.
5
26
  */
6
- define(
7
- [ 'aloha/core', 'util/class'],
8
- function( Aloha, Class ) {
9
-
10
-
11
- var
12
- // Aloha = window.Aloha,
13
- // Class = window.Class,
14
- GENTICS = window.GENTICS;
15
-
16
- Aloha.RepositoryObject = function() {};
17
-
27
+ define([
28
+ 'aloha/core',
29
+ 'util/class'
30
+ ], function (
31
+ Aloha,
32
+ Class
33
+ ) {
34
+ "use strict";
35
+
36
+ var GENTICS = window.GENTICS;
37
+
38
+ Aloha.RepositoryObject = function () {};
39
+
18
40
  /**
19
41
  * @namespace Aloha.Repository
20
42
  * @class Document
@@ -55,34 +77,31 @@ function( Aloha, Class ) {
55
77
  *
56
78
  */
57
79
  Aloha.RepositoryDocument = Class.extend({
58
- _constructor: function (properties) {
59
-
60
- var p = properties;
61
-
62
- this.type = 'document';
63
-
64
- // Basic error checking for MUST attributes
65
- if (!p.id ||
66
- !p.name ||
67
- !p.repositoryId
68
- ) {
69
- // Aloha.Log.error(this, "No valid Aloha Object. Missing MUST property");
70
- return;
71
- }
72
-
73
- GENTICS.Utils.applyProperties(this, properties);
74
-
75
- this.baseType = 'document';
80
+ _constructor: function (properties) {
81
+
82
+ var p = properties;
83
+
84
+ this.type = 'document';
85
+
86
+ // Basic error checking for MUST attributes
87
+ if (!p.id || !p.name || !p.repositoryId) {
88
+ // Aloha.Log.error(this, "No valid Aloha Object. Missing MUST property");
89
+ return;
76
90
  }
77
- // /**
78
- // * Not implemented method to generate this JS API doc correctly.
79
- // */
80
- // ,empty = function() }
81
-
82
- });
83
-
84
-
85
-
91
+
92
+ GENTICS.Utils.applyProperties(this, properties);
93
+
94
+ this.baseType = 'document';
95
+ }
96
+ // /**
97
+ // * Not implemented method to generate this JS API doc correctly.
98
+ // */
99
+ // ,empty = function() }
100
+
101
+ });
102
+
103
+
104
+
86
105
  /**
87
106
  * @namespace Aloha.Repository
88
107
  * @class Folder
@@ -116,31 +135,28 @@ function( Aloha, Class ) {
116
135
  *
117
136
  */
118
137
  Aloha.RepositoryFolder = Class.extend({
119
-
120
- _constructor: function(properties) {
121
-
138
+
139
+ _constructor: function (properties) {
140
+
122
141
  var p = properties;
123
-
142
+
124
143
  this.type = 'folder';
125
-
144
+
126
145
  // Basic error checking for MUST attributes
127
- if (!p.id ||
128
- !p.name ||
129
- !p.repositoryId
130
- ) {
131
- // Aloha.Log.error(this, "No valid Aloha Object. Missing MUST property");
146
+ if (!p.id || !p.name || !p.repositoryId) {
147
+ // Aloha.Log.error(this, "No valid Aloha Object. Missing MUST property");
132
148
  return;
133
149
  }
134
-
150
+
135
151
  GENTICS.Utils.applyProperties(this, properties);
136
-
152
+
137
153
  this.baseType = 'folder';
138
-
154
+
139
155
  }
140
- // /**
141
- // * Not implemented method to generate this JS API doc correctly.
142
- // */
143
- // ,empty = function() {};
144
-
156
+ // /**
157
+ // * Not implemented method to generate this JS API doc correctly.
158
+ // */
159
+ // ,empty = function() {};
160
+
145
161
  });
146
162
  });
@@ -1,2102 +1,2402 @@
1
- /*!
2
- * This file is part of Aloha Editor Project http://aloha-editor.org
3
- * Copyright (c) 2010-2011 Gentics Software GmbH, aloha@gentics.com
4
- * Contributors http://aloha-editor.org/contribution.php
5
- * Licensed unter the terms of http://www.aloha-editor.org/license.html
6
- *//*
7
- * Aloha Editor is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Affero General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) 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 Affero General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU Affero General Public License
18
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
- */
20
-
21
-
22
- define(
23
- [ 'aloha/core', 'aloha/jquery', 'aloha/floatingmenu', 'util/class', 'util/range', 'aloha/rangy-core' ],
24
- function(Aloha, jQuery, FloatingMenu, Class, Range) {
25
- var
26
- // $ = jQuery,
27
- // Aloha = window.Aloha,
28
- // Class = window.Class,
29
- GENTICS = window.GENTICS;
30
-
31
- /**
32
- * @namespace Aloha
33
- * @class Selection
34
- * This singleton class always represents the current user selection
35
- * @singleton
36
- */
37
- var Selection = Class.extend({
38
- _constructor: function(){
39
- // Pseudo Range Clone being cleaned up for better HTML wrapping support
40
- this.rangeObject = {};
41
-
42
- this.preventSelectionChangedFlag = false; // will remember if someone urged us to skip the next aloha-selection-changed event
43
-
44
- // define basics first
45
- this.tagHierarchy = {
46
- 'textNode' : [],
47
- 'abbr' : ['textNode'],
48
- 'b' : ['textNode', 'b', 'i', 'em', 'sup', 'sub', 'br', 'span', 'img','a','del','ins','u', 'cite', 'q', 'code', 'abbr', 'strong'],
49
- 'pre' : ['textNode', 'b', 'i', 'em', 'sup', 'sub', 'br', 'span', 'img','a','del','ins','u', 'cite','q', 'code', 'abbr', 'code'],
50
- 'blockquote' : ['textNode', 'b', 'i', 'em', 'sup', 'sub', 'br', 'span', 'img','a','del','ins','u', 'cite', 'q', 'code', 'abbr', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
51
- 'ins' : ['textNode', 'b', 'i', 'em', 'sup', 'sub', 'br', 'span', 'img','a','u', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
52
- 'ul' : ['li'],
53
- 'ol' : ['li'],
54
- 'li' : ['textNode', 'b', 'i', 'em', 'sup', 'sub', 'br', 'span', 'img', 'ul', 'ol', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'del', 'ins', 'u', 'a'],
55
- 'tr' : ['td','th'],
56
- 'table' : ['tr'],
57
- 'div' : ['textNode', 'b', 'i', 'em', 'sup', 'sub', 'br', 'span', 'img', 'ul', 'ol', 'table', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'del', 'ins', 'u', 'p', 'div', 'pre', 'blockquote', 'a'],
58
- 'h1' : ['textNode', 'b', 'i', 'em', 'sup', 'sub', 'br', 'span', 'img','a', 'del', 'ins', 'u']
59
- };
60
- // now reference the basics for all other equal tags (important: don't forget to include
61
- // the basics itself as reference: 'b' : this.tagHierarchy.b
62
- this.tagHierarchy = {
63
- 'textNode' : this.tagHierarchy.textNode,
64
- 'abbr' : this.tagHierarchy.abbr,
65
- 'br' : this.tagHierarchy.textNode,
66
- 'img' : this.tagHierarchy.textNode,
67
- 'b' : this.tagHierarchy.b,
68
- 'strong' : this.tagHierarchy.b,
69
- 'code' : this.tagHierarchy.b,
70
- 'q' : this.tagHierarchy.b,
71
- 'blockquote' : this.tagHierarchy.blockquote,
72
- 'cite' : this.tagHierarchy.b,
73
- 'i' : this.tagHierarchy.b,
74
- 'em' : this.tagHierarchy.b,
75
- 'sup' : this.tagHierarchy.b,
76
- 'sub' : this.tagHierarchy.b,
77
- 'span' : this.tagHierarchy.b,
78
- 'del' : this.tagHierarchy.del,
79
- 'ins' : this.tagHierarchy.ins,
80
- 'u' : this.tagHierarchy.b,
81
- 'p' : this.tagHierarchy.b,
82
- 'pre' : this.tagHierarchy.pre,
83
- 'a' : this.tagHierarchy.b,
84
- 'ul' : this.tagHierarchy.ul,
85
- 'ol' : this.tagHierarchy.ol,
86
- 'li' : this.tagHierarchy.li,
87
- 'td' : this.tagHierarchy.li,
88
- 'div' : this.tagHierarchy.div,
89
- 'h1' : this.tagHierarchy.h1,
90
- 'h2' : this.tagHierarchy.h1,
91
- 'h3' : this.tagHierarchy.h1,
92
- 'h4' : this.tagHierarchy.h1,
93
- 'h5' : this.tagHierarchy.h1,
94
- 'h6' : this.tagHierarchy.h1,
95
- 'table' : this.tagHierarchy.table
96
- };
97
-
98
- // When applying this elements to selection they will replace the assigned elements
99
- this.replacingElements = {
100
- 'h1' : ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6','pre', 'blockquote']
101
- };
102
- this.replacingElements = {
103
- 'h1' : this.replacingElements.h1,
104
- 'h2' : this.replacingElements.h1,
105
- 'h3' : this.replacingElements.h1,
106
- 'h4' : this.replacingElements.h1,
107
- 'h5' : this.replacingElements.h1,
108
- 'h6' : this.replacingElements.h1,
109
- 'pre' : this.replacingElements.h1,
110
- 'p' : this.replacingElements.h1,
111
- 'blockquote' : this.replacingElements.h1
112
- };
113
- this.allowedToStealElements = {
114
- 'h1' : ['textNode']
115
- };
116
- this.allowedToStealElements = {
117
- 'h1' : this.allowedToStealElements.h1,
118
- 'h2' : this.allowedToStealElements.h1,
119
- 'h3' : this.allowedToStealElements.h1,
120
- 'h4' : this.allowedToStealElements.h1,
121
- 'h5' : this.allowedToStealElements.h1,
122
- 'h6' : this.allowedToStealElements.h1,
123
- 'p' : this.tagHierarchy.b
124
- };
125
- },
126
-
127
- /**
128
- * Class definition of a SelectionTree (relevant for all formatting / markup changes)
129
- * TODO: remove this (was moved to range.js)
130
- * Structure:
131
- * +
132
- * |-domobj: <reference to the DOM Object> (NOT jQuery)
133
- * |-selection: defines if this node is marked by user [none|partial|full]
134
- * |-children: recursive structure like this
135
- * @hide
136
- */
137
- SelectionTree: function() {
138
- this.domobj = {};
139
- this.selection = undefined;
140
- this.children = [];
141
- },
142
-
143
- /**
144
- * INFO: Method is used for integration with Gentics Aloha, has no use otherwise
145
- * Updates the rangeObject according to the current user selection
146
- * Method is always called on selection change
147
- * @param objectClicked Object that triggered the selectionChange event
148
- * @return true when rangeObject was modified, false otherwise
149
- * @hide
150
- */
151
- onChange: function(objectClicked, event) {
152
- if (this.updateSelectionTimeout) {
153
- window.clearTimeout(this.updateSelectionTimeout);
154
- this.updateSelectionTimeout = undefined;
155
- }
156
- //we have to work around an IE bug that causes the user
157
- //selection to be incorrectly set on the body element when
158
- //the updateSelectionTimeout triggers. We remember the range
159
- //from the time when this onChange is triggered and provide
160
- //it instead of the current user selection when the timout
161
- //is triggered. The bug is caused by selecting some text and
162
- //then clicking once inside the selection (which collapses
163
- //the selection). Interesting fact: when the timeout is
164
- //increased to 500 milliseconds, the bug will not cause any
165
- //problems since the selection will correct itself somehow.
166
- var range = new Aloha.Selection.SelectionRange(true);
167
- this.updateSelectionTimeout = window.setTimeout(function () {
168
- Aloha.Selection._updateSelection(event, range);
169
- }, 5);
170
- },
171
-
172
- /**
173
- * prevents the next aloha-selection-changed event from being triggered
174
- */
175
- preventSelectionChanged: function () {
176
- this.preventSelectionChangedFlag = true;
177
- },
178
-
179
- /**
180
- * will return wheter selection change event was prevented or not, and reset the preventSelectionChangedFlag
181
- * @return {Boolean} true if aloha-selection-change event was prevented
182
- */
183
- isSelectionChangedPrevented: function () {
184
- var prevented = this.preventSelectionChangedFlag;
185
- this.preventSelectionChangedFlag = false;
186
- return prevented;
187
- },
188
-
189
- /**
190
- * Checks if the current rangeObject common ancector container is edtiable
191
- * @return {Boolean} true if current common ancestor is editable
192
- */
193
- isSelectionEditable: function() {
194
- return ( this.rangeObject.commonAncestorContainer &&
195
- jQuery( this.rangeObject.commonAncestorContainer )
196
- .contentEditable() );
197
- },
198
-
199
- /**
200
- * This method checks, if the current rangeObject common ancestor container has a 'data-aloha-floatingmenu-visible' Attribute.
201
- * Needed in Floating Menu for exceptional display of floatingmenu.
202
- */
203
- isFloatingMenuVisible: function() {
204
- var visible = jQuery(Aloha.Selection.rangeObject
205
- .commonAncestorContainer).attr('data-aloha-floatingmenu-visible');
206
- if(visible !== 'undefined'){
207
- if (visible === 'true'){
208
- return true;
209
- } else {
210
- return false;
211
- }
212
- }
213
- return false;
214
- },
215
-
216
- /**
217
- * INFO: Method is used for integration with Gentics Aloha, has no use otherwise
218
- * Updates the rangeObject according to the current user selection
219
- * Method is always called on selection change
220
- * @param event jQuery browser event object
221
- * @return true when rangeObject was modified, false otherwise
222
- * @hide
223
- */
224
- updateSelection: function(event) {
225
- return this._updateSelection(event, null);
226
- },
227
-
228
- /**
229
- * Internal version of updateSelection that adds the range parameter to be
230
- * able to work around an IE bug that caused the current user selection
231
- * sometimes to be on the body element.
232
- * @param {Object} event
233
- * @param {Object} range a substitute for the current user selection. if not provided,
234
- * the current user selection will be used.
235
- * @hide
236
- */
237
- _updateSelection: function( event, range ) {
238
- if ( event && event.originalEvent
239
- && event.originalEvent.stopSelectionUpdate === true ) {
240
- return false;
241
- }
242
-
243
- if ( typeof range === 'undefined' ) {
244
- return false;
245
- }
246
-
247
- this.rangeObject = range || new Aloha.Selection.SelectionRange( true );
248
-
249
- // Only execute the workaround when a valid rangeObject was provided
250
- if ( typeof this.rangeObject !== "undefined" && typeof this.rangeObject.startContainer !== "undefined" && this.rangeObject.endContainer !== "undefined") {
251
- // workaround for a nasty IE bug that allows the user to select text nodes inside areas with contenteditable "false"
252
- if ( (this.rangeObject.startContainer.nodeType === 3 && !jQuery(this.rangeObject.startContainer.parentNode).contentEditable())
253
- || (this.rangeObject.endContainer.nodeType === 3 && !jQuery(this.rangeObject.endContainer.parentNode).contentEditable())) {
254
- Aloha.getSelection().removeAllRanges();
255
- return true;
256
- }
257
- }
258
-
259
- // find the CAC (Common Ancestor Container) and update the selection Tree
260
- this.rangeObject.update();
261
-
262
- // check if aloha-selection-changed event has been prevented
263
- if (this.isSelectionChangedPrevented()) {
264
- return true;
265
- }
266
-
267
- // Only set the specific scope if an event was provided, which means
268
- // that somehow an editable was selected
269
- // TODO Bind code to aloha-selection-changed event to remove coupling to floatingmenu
270
- if (event !== undefined) {
271
- // Initiallly set the scope to 'continuoustext'
272
- FloatingMenu.setScope('Aloha.continuoustext');
273
- }
274
-
275
- // throw the event that the selection has changed. Plugins now have the
276
- // chance to react on the chancurrentElements[childCount].children.lengthged selection
277
- Aloha.trigger('aloha-selection-changed', [ this.rangeObject, event ]);
278
-
279
- return true;
280
- },
281
-
282
- /**
283
- * creates an object with x items containing all relevant dom objects.
284
- * Structure:
285
- * +
286
- * |-domobj: <reference to the DOM Object> (NOT jQuery)
287
- * |-selection: defines if this node is marked by user [none|partial|full]
288
- * |-children: recursive structure like this ("x.." because it's then shown last in DOM Browsers...)
289
- * TODO: remove this (was moved to range.js)
290
- *
291
- * @param rangeObject "Aloha clean" range object including a commonAncestorContainer
292
- * @return obj selection
293
- * @hide
294
- */
295
- getSelectionTree: function(rangeObject) {
296
- if (!rangeObject) { // if called without any parameters, the method acts as getter for this.selectionTree
297
- return this.rangeObject.getSelectionTree();
298
- }
299
- if (!rangeObject.commonAncestorContainer) {
300
- Aloha.Log.error(this, 'the rangeObject is missing the commonAncestorContainer');
301
- return false;
302
- }
303
-
304
- this.inselection = false;
305
-
306
- // before getting the selection tree, we do a cleanup
307
- if (GENTICS.Utils.Dom.doCleanup({'merge' : true}, rangeObject)) {
308
- this.rangeObject.update();
309
- this.rangeObject.select();
310
- }
311
-
312
- return this.recursiveGetSelectionTree(rangeObject, rangeObject.commonAncestorContainer);
313
- },
314
-
315
- /**
316
- * Recursive inner function for generating the selection tree.
317
- * TODO: remove this (was moved to range.js)
318
- * @param rangeObject range object
319
- * @param currentObject current DOM object for which the selection tree shall be generated
320
- * @return array of SelectionTree objects for the children of the current DOM object
321
- * @hide
322
- */
323
- recursiveGetSelectionTree: function (rangeObject, currentObject) {
324
- // get all direct children of the given object
325
- var jQueryCurrentObject = jQuery(currentObject),
326
- childCount = 0,
327
- that = this,
328
- currentElements = [];
329
-
330
- jQueryCurrentObject.contents().each(function(index) {
331
- var selectionType = 'none',
332
- startOffset = false,
333
- endOffset = false,
334
- collapsedFound = false,
335
- i, elementsLength,
336
- noneFound = false,
337
- partialFound = false,
338
- fullFound = false;
339
-
340
- // check for collapsed selections between nodes
341
- if (rangeObject.isCollapsed() && currentObject === rangeObject.startContainer && rangeObject.startOffset == index) {
342
- // insert an extra selectiontree object for the collapsed selection here
343
- currentElements[childCount] = new Aloha.Selection.SelectionTree();
344
- currentElements[childCount].selection = 'collapsed';
345
- currentElements[childCount].domobj = undefined;
346
- that.inselection = false;
347
- collapsedFound = true;
348
- childCount++;
349
- }
350
-
351
- if (!that.inselection && !collapsedFound) {
352
- // the start of the selection was not yet found, so look for it now
353
- // check whether the start of the selection is found here
354
-
355
- // Try to read the nodeType property and return if we do not have permission
356
- // ie.: frame document to an external URL
357
- var nodeType;
358
- try {
359
- nodeType = this.nodeType;
360
- }
361
- catch (e) {
362
- return;
363
- }
364
-
365
- // check is dependent on the node type
366
- switch(nodeType) {
367
- case 3: // text node
368
- if (this === rangeObject.startContainer) {
369
- // the selection starts here
370
- that.inselection = true;
371
-
372
- // when the startoffset is > 0, the selection type is only partial
373
- selectionType = rangeObject.startOffset > 0 ? 'partial' : 'full';
374
- startOffset = rangeObject.startOffset;
375
- endOffset = this.length;
376
- }
377
- break;
378
- case 1: // element node
379
- if (this === rangeObject.startContainer && rangeObject.startOffset === 0) {
380
- // the selection starts here
381
- that.inselection = true;
382
- selectionType = 'full';
383
- }
384
- if (currentObject === rangeObject.startContainer && rangeObject.startOffset === index) {
385
- // the selection starts here
386
- that.inselection = true;
387
- selectionType = 'full';
388
- }
389
- break;
390
- }
391
- }
392
-
393
- if (that.inselection && !collapsedFound) {
394
- if (selectionType == 'none') {
395
- selectionType = 'full';
396
- }
397
- // we already found the start of the selection, so look for the end of the selection now
398
- // check whether the end of the selection is found here
399
-
400
- switch(this.nodeType) {
401
- case 3: // text node
402
- if (this === rangeObject.endContainer) {
403
- // the selection ends here
404
- that.inselection = false;
405
-
406
- // check for partial selection here
407
- if (rangeObject.endOffset < this.length) {
408
- selectionType = 'partial';
409
- }
410
- if (startOffset === false) {
411
- startOffset = 0;
412
- }
413
- endOffset = rangeObject.endOffset;
414
- }
415
- break;
416
- case 1: // element node
417
- if (this === rangeObject.endContainer && rangeObject.endOffset === 0) {
418
- that.inselection = false;
419
- }
420
- break;
421
- }
422
- if (currentObject === rangeObject.endContainer && rangeObject.endOffset <= index) {
423
- that.inselection = false;
424
- selectionType = 'none';
425
- }
426
- }
427
-
428
- // create the current selection tree entry
429
- currentElements[childCount] = new Aloha.Selection.SelectionTree();
430
- currentElements[childCount].domobj = this;
431
- currentElements[childCount].selection = selectionType;
432
- if (selectionType == 'partial') {
433
- currentElements[childCount].startOffset = startOffset;
434
- currentElements[childCount].endOffset = endOffset;
435
- }
436
-
437
- // now do the recursion step into the current object
438
- currentElements[childCount].children = that.recursiveGetSelectionTree(rangeObject, this);
439
- elementsLength = currentElements[childCount].children.length;
440
-
441
- // check whether a selection was found within the children
442
- if (elementsLength > 0) {
443
- for ( i = 0; i < elementsLength; ++i) {
444
- switch(currentElements[childCount].children[i].selection) {
445
- case 'none':
446
- noneFound = true;
447
- break;
448
- case 'full':
449
- fullFound = true;
450
- break;
451
- case 'partial':
452
- partialFound = true;
453
- break;
454
- }
455
- }
456
-
457
- if (partialFound || (fullFound && noneFound)) {
458
- // found at least one 'partial' selection in the children, or both 'full' and 'none', so this element is also 'partial' selected
459
- currentElements[childCount].selection = 'partial';
460
- } else if (fullFound && !partialFound && !noneFound) {
461
- // only found 'full' selected children, so this element is also 'full' selected
462
- currentElements[childCount].selection = 'full';
463
- }
464
- }
465
-
466
- childCount++;
467
- });
468
-
469
- // extra check for collapsed selections at the end of the current element
470
- if (rangeObject.isCollapsed()
471
- && currentObject === rangeObject.startContainer
472
- && rangeObject.startOffset == currentObject.childNodes.length) {
473
- currentElements[childCount] = new Aloha.Selection.SelectionTree();
474
- currentElements[childCount].selection = 'collapsed';
475
- currentElements[childCount].domobj = undefined;
476
- }
477
-
478
- return currentElements;
479
- },
480
-
481
- /**
482
- * Get the currently selected range
483
- * @return {Aloha.Selection.SelectionRange} currently selected range
484
- * @method
485
- */
486
- getRangeObject: function() {
487
- return this.rangeObject;
488
- },
489
-
490
- /**
491
- * method finds out, if a node is within a certain markup or not
492
- * @param rangeObj Aloha rangeObject
493
- * @param startOrEnd boolean; defines, if start or endContainer should be used: false for start, true for end
494
- * @param markupObject jQuery object of the markup to look for
495
- * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
496
- * @param limitObject dom object which limits the search are within the dom. normally this will be the active Editable
497
- * @return true, if the markup is effective on the range objects start or end node
498
- * @hide
499
- */
500
- isRangeObjectWithinMarkup: function(rangeObject, startOrEnd, markupObject, tagComparator, limitObject) {
501
- var
502
- domObj = !startOrEnd?rangeObject.startContainer:rangeObject.endContainer,
503
- that = this,
504
- parents = jQuery(domObj).parents(),
505
- returnVal = false,
506
- i = -1;
507
-
508
- // check if a comparison method was passed as parameter ...
509
- if (typeof tagComparator !== 'undefined' && typeof tagComparator !== 'function') {
510
- Aloha.Log.error(this,'parameter tagComparator is not a function');
511
- }
512
- // ... if not use this as standard tag comparison method
513
- if (typeof tagComparator === 'undefined') {
514
- tagComparator = function(domobj, markupObject) {
515
- return that.standardTextLevelSemanticsComparator(domobj, markupObject); // TODO should actually be this.getStandardTagComparator(markupObject)
516
- };
517
- }
518
-
519
- if (parents.length > 0) {
520
- parents.each(function() {
521
- // the limit object was reached (normally the Editable Element)
522
- if (this === limitObject) {
523
- Aloha.Log.debug(that,'reached limit dom obj');
524
- return false; // break() of jQuery .each(); THIS IS NOT THE FUNCTION RETURN VALUE
525
- }
526
- if (tagComparator(this, markupObject)) {
527
- if (returnVal === false) {
528
- returnVal = [];
529
- }
530
- Aloha.Log.debug(that,'reached object equal to markup');
531
- i++;
532
- returnVal[i] = this;
533
- return true; // continue() of jQuery .each(); THIS IS NOT THE FUNCTION RETURN VALUE
534
- }
535
- });
536
- }
537
- return returnVal;
538
- },
539
-
540
- /**
541
- * standard method, to compare a domobj and a jquery object for sections and grouping content (e.g. p, h1, h2, ul, ....).
542
- * is always used when no other tag comparator is passed as parameter
543
- * @param domobj domobject to compare with markup
544
- * @param markupObject jQuery object of the markup to compare with domobj
545
- * @return true if objects are equal and false if not
546
- * @hide
547
- */
548
- standardSectionsAndGroupingContentComparator: function(domobj, markupObject) {
549
- if (domobj.nodeType === 1) {
550
- if (markupObject[0].tagName && Aloha.Selection.replacingElements[ domobj.tagName.toLowerCase() ] && Aloha.Selection.replacingElements[ domobj.tagName.toLowerCase() ].indexOf(markupObject[0].tagName.toLowerCase()) != -1) {
551
- return true;
552
- }
553
- } else {
554
- Aloha.Log.debug(this,'only element nodes (nodeType == 1) can be compared');
555
- }
556
- return false;
557
- },
558
-
559
- /**
560
- * standard method, to compare a domobj and a jquery object for their tagName (aka span elements, e.g. b, i, sup, span, ...).
561
- * is always used when no other tag comparator is passed as parameter
562
- * @param domobj domobject to compare with markup
563
- * @param markupObject jQuery object of the markup to compare with domobj
564
- * @return true if objects are equal and false if not
565
- * @hide
566
- */
567
- standardTagNameComparator : function(domobj, markupObject) {
568
- if (domobj.nodeType === 1) {
569
- if (domobj.tagName.toLowerCase() != markupObject[0].tagName.toLowerCase()) {
570
- // Aloha.Log.debug(this, 'tag comparison for <' + domobj.tagName.toLowerCase() + '> and <' + markupObject[0].tagName.toLowerCase() + '> failed because tags are different');
571
- return false;
572
- }
573
- return true;//domobj.attributes.length
574
- } else {
575
- Aloha.Log.debug(this,'only element nodes (nodeType == 1) can be compared');
576
- }
577
- return false;
578
- },
579
-
580
- /**
581
- * standard method, to compare a domobj and a jquery object for text level semantics (aka span elements, e.g. b, i, sup, span, ...).
582
- * is always used when no other tag comparator is passed as parameter
583
- * @param domobj domobject to compare with markup
584
- * @param markupObject jQuery object of the markup to compare with domobj
585
- * @return true if objects are equal and false if not
586
- * @hide
587
- */
588
- standardTextLevelSemanticsComparator: function(domobj, markupObject) {
589
- // only element nodes can be compared
590
- if (domobj.nodeType === 1) {
591
- if (domobj.tagName.toLowerCase() != markupObject[0].tagName.toLowerCase()) {
592
- // Aloha.Log.debug(this, 'tag comparison for <' + domobj.tagName.toLowerCase() + '> and <' + markupObject[0].tagName.toLowerCase() + '> failed because tags are different');
593
- return false;
594
- }
595
- if (!this.standardAttributesComparator(domobj, markupObject)) {
596
- return false;
597
- }
598
- return true;//domobj.attributes.length
599
- } else {
600
- Aloha.Log.debug(this,'only element nodes (nodeType == 1) can be compared');
601
- }
602
- return false;
603
- },
604
-
605
-
606
- /**
607
- * standard method, to compare attributes of one dom obj and one markup obj (jQuery)
608
- * @param domobj domobject to compare with markup
609
- * @param markupObject jQuery object of the markup to compare with domobj
610
- * @return true if objects are equal and false if not
611
- * @hide
612
- */
613
- standardAttributesComparator: function(domobj, markupObject) {
614
- var i, attr, classString, classes, classes2, classLength, attrLength, domAttrLength;
615
-
616
- // Cloning the domobj works around an IE7 bug that crashes
617
- // the browser. The exact place where IE7 crashes is when
618
- // the domobj.attribute[i] is read below.
619
- // The bug can be reproduced with an editable that contains
620
- // some text and and image, by clicking inside and outside the
621
- // editable a few times.
622
- domobj = domobj.cloneNode(false);
623
-
624
- if (domobj.attributes && domobj.attributes.length && domobj.attributes.length > 0) {
625
- for (i = 0, domAttrLength = domobj.attributes.length; i < domAttrLength; i++) {
626
- // Dereferencing attributes[i] here would crash IE7 if domobj were not cloned above
627
- attr = domobj.attributes[i];
628
- if (attr.nodeName.toLowerCase() == 'class' && attr.nodeValue.length > 0) {
629
- classString = attr.nodeValue;
630
- classes = classString.split(' ');
631
- }
632
- }
633
- }
634
-
635
- if (markupObject[0].attributes && markupObject[0].attributes.length && markupObject[0].attributes.length > 0) {
636
- for (i = 0, attrLength = markupObject[0].attributes.length; i < attrLength; i++) {
637
- attr = markupObject[0].attributes[i];
638
- if (attr.nodeName.toLowerCase() == 'class' && attr.nodeValue.length > 0) {
639
- classString = attr.nodeValue;
640
- classes2 = classString.split(' ');
641
- }
642
- }
643
- }
644
-
645
- if (classes && !classes2 || classes2 && !classes) {
646
- Aloha.Log.debug(this, 'tag comparison for <' + domobj.tagName.toLowerCase() + '> failed because one element has classes and the other has not');
647
- return false;
648
- }
649
- if (classes && classes2 && classes.length != classes2.length) {
650
- Aloha.Log.debug(this, 'tag comparison for <' + domobj.tagName.toLowerCase() + '> failed because of a different amount of classes');
651
- return false;
652
- }
653
- if (classes && classes2 && classes.length === classes2.length && classes.length !== 0) {
654
- for (i = 0, classLength = classes.length; i < classLength; i++) {
655
- if (!markupObject.hasClass(classes[ i ])) {
656
- Aloha.Log.debug(this, 'tag comparison for <' + domobj.tagName.toLowerCase() + '> failed because of different classes');
657
- return false;
658
- }
659
- }
660
- }
661
- return true;
662
- },
663
-
664
- /**
665
- * method finds out, if a node is within a certain markup or not
666
- * @param rangeObj Aloha rangeObject
667
- * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
668
- * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
669
- * @return void; TODO: should return true if the markup applied successfully and false if not
670
- * @hide
671
- */
672
- changeMarkup: function(rangeObject, markupObject, tagComparator) {
673
- var
674
- tagName = markupObject[0].tagName.toLowerCase(),
675
- newCAC, limitObject,
676
- backupRangeObject,
677
- relevantMarkupObjectsAtSelectionStart = this.isRangeObjectWithinMarkup(rangeObject, false, markupObject, tagComparator, limitObject),
678
- relevantMarkupObjectsAtSelectionEnd = this.isRangeObjectWithinMarkup(rangeObject, true, markupObject, tagComparator, limitObject),
679
- nextSibling, relevantMarkupObjectAfterSelection,
680
- prevSibling, relevantMarkupObjectBeforeSelection,
681
- extendedRangeObject;
682
-
683
- // if the element is a replacing element (like p/h1/h2/h3/h4/h5/h6...), which must not wrap each other
684
- // use a clone of rangeObject
685
- if (this.replacingElements[ tagName ]) {
686
- // backup rangeObject for later selection;
687
- backupRangeObject = rangeObject;
688
-
689
- // create a new range object to not modify the orginal
690
- rangeObject = new this.SelectionRange(rangeObject);
691
-
692
- // either select the active Editable as new commonAncestorContainer (CAC) or use the body
693
- if (Aloha.activeEditable) {
694
- newCAC= Aloha.activeEditable.obj.get(0);
695
- } else {
696
- newCAC = jQuery('body');
697
- }
698
- // update rangeObject by setting the newCAC and automatically recalculating the selectionTree
699
- rangeObject.update(newCAC);
700
-
701
- // store the information, that the markupObject can be replaced (not must be!!) inside the jQuery markup object
702
- markupObject.isReplacingElement = true;
703
- }
704
- // if the element is NOT a replacing element, then something needs to be selected, otherwise it can not be wrapped
705
- // therefor the method can return false, if nothing is selected ( = rangeObject is collapsed)
706
- else {
707
- if (rangeObject.isCollapsed()) {
708
- Aloha.Log.debug(this, 'early returning from applying markup because nothing is currently selected');
709
- return false;
710
- }
711
- }
712
-
713
- // is Start/End DOM Obj inside the markup to change
714
- if (Aloha.activeEditable) {
715
- limitObject = Aloha.activeEditable.obj[0];
716
- } else {
717
- limitObject = jQuery('body');
718
- }
719
-
720
- if (!markupObject.isReplacingElement && rangeObject.startOffset === 0) { // don't care about replacers, because they never extend
721
- if (prevSibling = this.getTextNodeSibling(false, rangeObject.commonAncestorContainer.parentNode, rangeObject.startContainer)) {
722
- relevantMarkupObjectBeforeSelection = this.isRangeObjectWithinMarkup({startContainer : prevSibling, startOffset : 0}, false, markupObject, tagComparator, limitObject);
723
- }
724
- }
725
- if (!markupObject.isReplacingElement && (rangeObject.endOffset === rangeObject.endContainer.length)) { // don't care about replacers, because they never extend
726
- if (nextSibling = this.getTextNodeSibling(true, rangeObject.commonAncestorContainer.parentNode, rangeObject.endContainer)) {
727
- relevantMarkupObjectAfterSelection = this.isRangeObjectWithinMarkup({startContainer: nextSibling, startOffset: 0}, false, markupObject, tagComparator, limitObject);
728
- }
729
- }
730
-
731
- // decide what to do (expand or reduce markup)
732
- // Alternative A: from markup to no-markup: markup will be removed in selection;
733
- // reapplied from original markup start to selection start
734
- if (!markupObject.isReplacingElement && (relevantMarkupObjectsAtSelectionStart && !relevantMarkupObjectsAtSelectionEnd)) {
735
- Aloha.Log.info(this, 'markup 2 non-markup');
736
- this.prepareForRemoval(rangeObject.getSelectionTree(), markupObject, tagComparator);
737
- jQuery(relevantMarkupObjectsAtSelectionStart).addClass('preparedForRemoval');
738
- this.insertCroppedMarkups(relevantMarkupObjectsAtSelectionStart, rangeObject, false, tagComparator);
739
- }
740
-
741
- // Alternative B: from markup to markup:
742
- // remove selected markup (=split existing markup if single, shrink if two different)
743
- else if (!markupObject.isReplacingElement && relevantMarkupObjectsAtSelectionStart && relevantMarkupObjectsAtSelectionEnd) {
744
- Aloha.Log.info(this, 'markup 2 markup');
745
- this.prepareForRemoval(rangeObject.getSelectionTree(), markupObject, tagComparator);
746
- this.splitRelevantMarkupObject(relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd, rangeObject, tagComparator);
747
- }
748
-
749
- // Alternative C: from no-markup to markup OR with next2markup:
750
- // new markup is wrapped from selection start to end of originalmarkup, original is remove afterwards
751
- else if (!markupObject.isReplacingElement && ((!relevantMarkupObjectsAtSelectionStart && relevantMarkupObjectsAtSelectionEnd) || relevantMarkupObjectAfterSelection || relevantMarkupObjectBeforeSelection )) { //
752
- Aloha.Log.info(this, 'non-markup 2 markup OR with next2markup');
753
- // move end of rangeObject to end of relevant markups
754
- if (relevantMarkupObjectBeforeSelection && relevantMarkupObjectAfterSelection) {
755
- extendedRangeObject = new Aloha.Selection.SelectionRange(rangeObject);
756
- extendedRangeObject.startContainer = jQuery(relevantMarkupObjectBeforeSelection[ relevantMarkupObjectBeforeSelection.length-1 ]).textNodes()[0];
757
- extendedRangeObject.startOffset = 0;
758
- extendedRangeObject.endContainer = jQuery(relevantMarkupObjectAfterSelection[ relevantMarkupObjectAfterSelection.length-1 ]).textNodes().last()[0];
759
- extendedRangeObject.endOffset = extendedRangeObject.endContainer.length;
760
- extendedRangeObject.update();
761
- this.applyMarkup(extendedRangeObject.getSelectionTree(), rangeObject, markupObject, tagComparator);
762
- Aloha.Log.info(this, 'double extending previous markup(previous and after selection), actually wrapping it ...');
763
-
764
- } else if (relevantMarkupObjectBeforeSelection && !relevantMarkupObjectAfterSelection && !relevantMarkupObjectsAtSelectionEnd) {
765
- this.extendExistingMarkupWithSelection(relevantMarkupObjectBeforeSelection, rangeObject, false, tagComparator);
766
- Aloha.Log.info(this, 'extending previous markup');
767
-
768
- } else if (relevantMarkupObjectBeforeSelection && !relevantMarkupObjectAfterSelection && relevantMarkupObjectsAtSelectionEnd) {
769
- extendedRangeObject = new Aloha.Selection.SelectionRange(rangeObject);
770
- extendedRangeObject.startContainer = jQuery(relevantMarkupObjectBeforeSelection[ relevantMarkupObjectBeforeSelection.length-1 ]).textNodes()[0];
771
- extendedRangeObject.startOffset = 0;
772
- extendedRangeObject.endContainer = jQuery(relevantMarkupObjectsAtSelectionEnd[ relevantMarkupObjectsAtSelectionEnd.length-1 ]).textNodes().last()[0];
773
- extendedRangeObject.endOffset = extendedRangeObject.endContainer.length;
774
- extendedRangeObject.update();
775
- this.applyMarkup(extendedRangeObject.getSelectionTree(), rangeObject, markupObject, tagComparator);
776
- Aloha.Log.info(this, 'double extending previous markup(previous and relevant at the end), actually wrapping it ...');
777
-
778
- } else if (!relevantMarkupObjectBeforeSelection && relevantMarkupObjectAfterSelection) {
779
- this.extendExistingMarkupWithSelection(relevantMarkupObjectAfterSelection, rangeObject, true, tagComparator);
780
- Aloha.Log.info(this, 'extending following markup backwards');
781
-
782
- } else {
783
- this.extendExistingMarkupWithSelection(relevantMarkupObjectsAtSelectionEnd, rangeObject, true, tagComparator);
784
- }
785
- }
786
-
787
- // Alternative D: no-markup to no-markup: easy
788
- else if (markupObject.isReplacingElement || (!relevantMarkupObjectsAtSelectionStart && !relevantMarkupObjectsAtSelectionEnd && !relevantMarkupObjectBeforeSelection && !relevantMarkupObjectAfterSelection)) {
789
- Aloha.Log.info(this, 'non-markup 2 non-markup');
790
- this.applyMarkup(rangeObject.getSelectionTree(), rangeObject, markupObject, tagComparator, {setRangeObject2NewMarkup: true});
791
- }
792
-
793
- // remove all marked items
794
- jQuery('.preparedForRemoval').zap();
795
-
796
- // recalculate cac and selectionTree
797
- rangeObject.update();
798
-
799
- // update selection
800
- if (markupObject.isReplacingElement) {
801
- // this.setSelection(backupRangeObject, true);
802
- backupRangeObject.select();
803
- } else {
804
- // this.setSelection(rangeObject);
805
- rangeObject.select();
806
- }
807
- },
808
-
809
- /**
810
- * method compares a JS array of domobjects with a range object and decides, if the rangeObject spans the whole markup objects. method is used to decide if a markup2markup selection can be completely remove or if it must be splitted into 2 separate markups
811
- * @param relevantMarkupObjectsAtSelectionStart JS Array of dom objects, which are parents to the rangeObject.startContainer
812
- * @param relevantMarkupObjectsAtSelectionEnd JS Array of dom objects, which are parents to the rangeObject.endContainer
813
- * @param rangeObj Aloha rangeObject
814
- * @return true, if rangeObjects and markup objects are identical, false otherwise
815
- * @hide
816
- */
817
- areMarkupObjectsAsLongAsRangeObject: function(relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd, rangeObject) {
818
- var i, el, textNode, relMarkupEnd, relMarkupStart;
819
-
820
- if (rangeObject.startOffset !== 0) {
821
- return false;
822
- }
823
-
824
- for (i = 0, relMarkupStart = relevantMarkupObjectsAtSelectionStart.length; i < relMarkupStart; i++) {
825
- el = jQuery(relevantMarkupObjectsAtSelectionStart[i]);
826
- if (el.textNodes().first()[0] !== rangeObject.startContainer) {
827
- return false;
828
- }
829
- }
830
-
831
- for (i = 0, relMarkupEnd = relevantMarkupObjectsAtSelectionEnd.length; i < relMarkupEnd; i++) {
832
- el = jQuery(relevantMarkupObjectsAtSelectionEnd[i]);
833
- textNode = el.textNodes().last()[0];
834
- if (textNode !== rangeObject.endContainer || textNode.length != rangeObject.endOffset) {
835
- return false;
836
- }
837
- }
838
-
839
- return true;
840
- },
841
-
842
- /**
843
- * method used to remove/split markup from a "markup2markup" selection
844
- * @param relevantMarkupObjectsAtSelectionStart JS Array of dom objects, which are parents to the rangeObject.startContainer
845
- * @param relevantMarkupObjectsAtSelectionEnd JS Array of dom objects, which are parents to the rangeObject.endContainer
846
- * @param rangeObj Aloha rangeObject
847
- * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
848
- * @return true (always, since no "false" case is currently known...but might be added)
849
- * @hide
850
- */
851
- splitRelevantMarkupObject: function(relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd, rangeObject, tagComparator) {
852
- // mark them to be deleted
853
- jQuery(relevantMarkupObjectsAtSelectionStart).addClass('preparedForRemoval');
854
- jQuery(relevantMarkupObjectsAtSelectionEnd).addClass('preparedForRemoval');
855
-
856
- // check if the rangeObject is identical with the relevantMarkupObjects (in this case the markup can simply be removed)
857
- if (this.areMarkupObjectsAsLongAsRangeObject(relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd, rangeObject)) {
858
- return true;
859
- }
860
-
861
- // find intersection (this can always only be one dom element (namely the highest) because all others will be removed
862
- var relevantMarkupObjectAtSelectionStartAndEnd = this.intersectRelevantMarkupObjects(relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd);
863
-
864
- if (relevantMarkupObjectAtSelectionStartAndEnd) {
865
- this.insertCroppedMarkups([relevantMarkupObjectAtSelectionStartAndEnd], rangeObject, false, tagComparator);
866
- this.insertCroppedMarkups([relevantMarkupObjectAtSelectionStartAndEnd], rangeObject, true, tagComparator);
867
- } else {
868
- this.insertCroppedMarkups(relevantMarkupObjectsAtSelectionStart, rangeObject, false, tagComparator);
869
- this.insertCroppedMarkups(relevantMarkupObjectsAtSelectionEnd, rangeObject, true, tagComparator);
870
- }
871
- return true;
872
- },
873
-
874
- /**
875
- * method takes two arrays of bottom up dom objects, compares them and returns either the object closest to the root or false
876
- * @param relevantMarkupObjectsAtSelectionStart JS Array of dom objects
877
- * @param relevantMarkupObjectsAtSelectionEnd JS Array of dom objects
878
- * @return dom object closest to the root or false
879
- * @hide
880
- */
881
- intersectRelevantMarkupObjects: function(relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd) {
882
- var intersection = false, i, elStart, j, elEnd, relMarkupStart, relMarkupEnd;
883
- if (!relevantMarkupObjectsAtSelectionStart || !relevantMarkupObjectsAtSelectionEnd) {
884
- return intersection; // we can only intersect, if we have to arrays!
885
- }
886
- relMarkupStart = relevantMarkupObjectsAtSelectionStart.length;
887
- relMarkupEnd = relevantMarkupObjectsAtSelectionEnd.length;
888
- for (i = 0; i < relMarkupStart; i++) {
889
- elStart = relevantMarkupObjectsAtSelectionStart[i];
890
- for (j = 0; j < relMarkupEnd; j++) {
891
- elEnd = relevantMarkupObjectsAtSelectionEnd[j];
892
- if (elStart === elEnd) {
893
- intersection = elStart;
894
- }
895
- }
896
- }
897
- return intersection;
898
- },
899
-
900
- /**
901
- * method used to add markup to a nonmarkup2markup selection
902
- * @param relevantMarkupObjects JS Array of dom objects effecting either the start or endContainer of a selection (which should be extended)
903
- * @param rangeObject Aloha rangeObject the markups should be extended to
904
- * @param startOrEnd boolean; defines, if the existing markups should be extended forwards or backwards (is propably redundant and could be found out by comparing start or end container with the markup array dom objects)
905
- * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
906
- * @return true
907
- * @hide
908
- */
909
- extendExistingMarkupWithSelection: function(relevantMarkupObjects, rangeObject, startOrEnd, tagComparator) {
910
- var extendMarkupsAtStart, extendMarkupsAtEnd, objects, i, relMarkupLength, el, textnodes, nodeNr;
911
- if (!startOrEnd) { // = Start
912
- // start part of rangeObject should be used, therefor existing markups are cropped at the end
913
- extendMarkupsAtStart = true;
914
- }
915
- if (startOrEnd) { // = End
916
- // end part of rangeObject should be used, therefor existing markups are cropped at start (beginning)
917
- extendMarkupsAtEnd = true;
918
- }
919
- objects = [];
920
- for( i = 0, relMarkupLength = relevantMarkupObjects.length; i < relMarkupLength; i++){
921
- objects[i] = new this.SelectionRange();
922
- el = relevantMarkupObjects[i];
923
- if (extendMarkupsAtEnd && !extendMarkupsAtStart) {
924
- objects[i].startContainer = rangeObject.startContainer; // jQuery(el).contents()[0];
925
- objects[i].startOffset = rangeObject.startOffset;
926
- textnodes = jQuery(el).textNodes(true);
927
-
928
- nodeNr = textnodes.length - 1;
929
- objects[i].endContainer = textnodes[ nodeNr ];
930
- objects[i].endOffset = textnodes[ nodeNr ].length;
931
- objects[i].update();
932
- this.applyMarkup(objects[i].getSelectionTree(), rangeObject, this.getClonedMarkup4Wrapping(el), tagComparator, {setRangeObject2NewMarkup: true});
933
- }
934
- if (!extendMarkupsAtEnd && extendMarkupsAtStart) {
935
- textnodes = jQuery(el).textNodes(true);
936
- objects[i].startContainer = textnodes[0]; // jQuery(el).contents()[0];
937
- objects[i].startOffset = 0;
938
- objects[i].endContainer = rangeObject.endContainer;
939
- objects[i].endOffset = rangeObject.endOffset;
940
- objects[i].update();
941
- this.applyMarkup(objects[i].getSelectionTree(), rangeObject, this.getClonedMarkup4Wrapping(el), tagComparator, {setRangeObject2NewMarkup: true});
942
- }
943
- }
944
- return true;
945
- },
946
-
947
- /**
948
- * method creates an empty markup jQuery object from a dom object passed as paramter
949
- * @param domobj domobject to be cloned, cleaned and emptied
950
- * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
951
- * @return jQuery wrapper object to be passed to e.g. this.applyMarkup(...)
952
- * @hide
953
- */
954
- getClonedMarkup4Wrapping: function(domobj) {
955
- var wrapper = jQuery(domobj).clone().removeClass('preparedForRemoval').empty();
956
- if (wrapper.attr('class').length === 0) {
957
- wrapper.removeAttr('class');
958
- }
959
- return wrapper;
960
- },
961
-
962
- /**
963
- * method used to subtract the range object from existing markup. in other words: certain markup is removed from the selections defined by the rangeObject
964
- * @param relevantMarkupObjects JS Array of dom objects effecting either the start or endContainer of a selection (which should be extended)
965
- * @param rangeObject Aloha rangeObject the markups should be removed from
966
- * @param startOrEnd boolean; defines, if the existing markups should be reduced at the beginning of the tag or at the end (is propably redundant and could be found out by comparing start or end container with the markup array dom objects)
967
- * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
968
- * @return true
969
- * @hide
970
- */
971
- insertCroppedMarkups: function(relevantMarkupObjects, rangeObject, startOrEnd, tagComparator) {
972
- var cropMarkupsAtEnd,cropMarkupsAtStart,textnodes,objects,i,el,textNodes;
973
- if (!startOrEnd) { // = Start
974
- // start part of rangeObject should be used, therefor existing markups are cropped at the end
975
- cropMarkupsAtEnd = true;
976
- } else { // = End
977
- // end part of rangeObject should be used, therefor existing markups are cropped at start (beginning)
978
- cropMarkupsAtStart = true;
979
- }
980
- objects = [];
981
- for( i = 0; i<relevantMarkupObjects.length; i++){
982
- objects[i] = new this.SelectionRange();
983
- el = relevantMarkupObjects[i];
984
- if (cropMarkupsAtEnd && !cropMarkupsAtStart) {
985
- textNodes = jQuery(el).textNodes(true);
986
- objects[i].startContainer = textNodes[0];
987
- objects[i].startOffset = 0;
988
- // if the existing markup startContainer & startOffset are equal to the rangeObject startContainer and startOffset,
989
- // then markupobject does not have to be added again, because it would have no content (zero-length)
990
- if (objects[i].startContainer === rangeObject.startContainer && objects[i].startOffset === rangeObject.startOffset) {
991
- continue;
992
- }
993
- if (rangeObject.startOffset === 0) {
994
- objects[i].endContainer = this.getTextNodeSibling(false, el, rangeObject.startContainer);
995
- objects[i].endOffset = objects[i].endContainer.length;
996
- } else {
997
- objects[i].endContainer = rangeObject.startContainer;
998
- objects[i].endOffset = rangeObject.startOffset;
999
- }
1000
-
1001
- objects[i].update();
1002
-
1003
- this.applyMarkup(objects[i].getSelectionTree(), rangeObject, this.getClonedMarkup4Wrapping(el), tagComparator, {setRangeObject2NextSibling: true});
1004
- }
1005
-
1006
- if (!cropMarkupsAtEnd && cropMarkupsAtStart) {
1007
- objects[i].startContainer = rangeObject.endContainer; // jQuery(el).contents()[0];
1008
- objects[i].startOffset = rangeObject.endOffset;
1009
- textnodes = jQuery(el).textNodes(true);
1010
- objects[i].endContainer = textnodes[ textnodes.length-1 ];
1011
- objects[i].endOffset = textnodes[ textnodes.length-1 ].length;
1012
- objects[i].update();
1013
- this.applyMarkup(objects[i].getSelectionTree(), rangeObject, this.getClonedMarkup4Wrapping(el), tagComparator, {setRangeObject2PreviousSibling: true});
1014
- }
1015
- }
1016
- return true;
1017
- },
1018
-
1019
- /**
1020
- * apply a certain markup to the current selection
1021
- * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1022
- * @return void
1023
- * @hide
1024
- */
1025
- changeMarkupOnSelection: function(markupObject) {
1026
- // change the markup
1027
- this.changeMarkup(this.getRangeObject(), markupObject, this.getStandardTagComparator(markupObject));
1028
-
1029
- // merge text nodes
1030
-
1031
- GENTICS.Utils.Dom.doCleanup({'merge' : true}, this.rangeObject);
1032
- // update the range and select it
1033
- this.rangeObject.update();
1034
- this.rangeObject.select();
1035
- },
1036
-
1037
- /**
1038
- * apply a certain markup to the selection Tree
1039
- * @param selectionTree SelectionTree Object markup should be applied to
1040
- * @param rangeObject Aloha rangeObject which will be modified to reflect the dom changes, after the markup was applied (only if activated via options)
1041
- * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1042
- * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1043
- * @param options JS object, with the following boolean properties: setRangeObject2NewMarkup, setRangeObject2NextSibling, setRangeObject2PreviousSibling
1044
- * @return void
1045
- * @hide
1046
- */
1047
- applyMarkup: function(selectionTree, rangeObject, markupObject, tagComparator, options) {
1048
- var optimizedSelectionTree, i, el, breakpoint;
1049
-
1050
- options = options ? options : {};
1051
- // first same tags from within fully selected nodes for removal
1052
- this.prepareForRemoval(selectionTree, markupObject, tagComparator);
1053
-
1054
- // first let's optimize the selection Tree in useful groups which can be wrapped together
1055
- optimizedSelectionTree = this.optimizeSelectionTree4Markup(selectionTree, markupObject, tagComparator);
1056
- breakpoint = true;
1057
-
1058
- // now iterate over grouped elements and either recursively dive into object or wrap it as a whole
1059
- for ( i = 0; i < optimizedSelectionTree.length; i++) {
1060
- el = optimizedSelectionTree[i];
1061
- if (el.wrappable) {
1062
- this.wrapMarkupAroundSelectionTree(el.elements, rangeObject, markupObject, tagComparator, options);
1063
- } else {
1064
- Aloha.Log.debug(this,'dive further into non-wrappable object');
1065
- this.applyMarkup(el.element.children, rangeObject, markupObject, tagComparator, options);
1066
- }
1067
- }
1068
- },
1069
-
1070
- /**
1071
- * returns the type of the given markup (trying to match HTML5)
1072
- * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1073
- * @return string name of the markup type
1074
- * @hide
1075
- */
1076
- getMarkupType: function(markupObject) {
1077
- var nn = jQuery(markupObject)[0].nodeName.toLowerCase();
1078
- if (markupObject.outerHtml) {
1079
- Aloha.Log.debug(this, 'Node name detected: ' + nn + ' for: ' + markupObject.outerHtml());
1080
- }
1081
- if (nn == '#text') {return 'textNode';}
1082
- if (this.replacingElements[ nn ]) {return 'sectionOrGroupingContent';}
1083
- if (this.tagHierarchy [ nn ]) {return 'textLevelSemantics';}
1084
- Aloha.Log.warn(this, 'unknown markup passed to this.getMarkupType(...): ' + markupObject.outerHtml());
1085
- },
1086
-
1087
- /**
1088
- * returns the standard tag comparator for the given markup object
1089
- * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1090
- * @return function tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1091
- * @hide
1092
- */
1093
- getStandardTagComparator: function(markupObject) {
1094
- var that = this, result;
1095
- switch(this.getMarkupType(markupObject)) {
1096
- case 'textNode':
1097
- result = function(p1, p2) {
1098
- return false;
1099
- };
1100
- break;
1101
-
1102
- case 'sectionOrGroupingContent':
1103
- result = function(domobj, markupObject) {
1104
- return that.standardSectionsAndGroupingContentComparator(domobj, markupObject);
1105
- };
1106
- break;
1107
-
1108
- case 'textLevelSemantics':
1109
- /* falls through */
1110
- default:
1111
- result = function(domobj, markupObject) {
1112
- return that.standardTextLevelSemanticsComparator(domobj, markupObject);
1113
- };
1114
- break;
1115
- }
1116
- return result;
1117
- },
1118
-
1119
- /**
1120
- * searches for fully selected equal markup tags
1121
- * @param selectionTree SelectionTree Object markup should be applied to
1122
- * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1123
- * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1124
- * @return void
1125
- * @hide
1126
- */
1127
- prepareForRemoval: function(selectionTree, markupObject, tagComparator) {
1128
- var that = this, i, el;
1129
-
1130
- // check if a comparison method was passed as parameter ...
1131
- if (typeof tagComparator !== 'undefined' && typeof tagComparator !== 'function') {
1132
- Aloha.Log.error(this,'parameter tagComparator is not a function');
1133
- }
1134
- // ... if not use this as standard tag comparison method
1135
- if (typeof tagComparator === 'undefined') {
1136
- tagComparator = this.getStandardTagComparator(markupObject);
1137
- }
1138
- for ( i = 0; i<selectionTree.length; i++) {
1139
- el = selectionTree[i];
1140
- if (el.domobj && (el.selection == 'full' || (el.selection == 'partial' && markupObject.isReplacingElement))) {
1141
- // mark for removal
1142
- if (el.domobj.nodeType === 1 && tagComparator(el.domobj, markupObject)) {
1143
- Aloha.Log.debug(this, 'Marking for removal: ' + el.domobj.nodeName);
1144
- jQuery(el.domobj).addClass('preparedForRemoval');
1145
- }
1146
- }
1147
- if (el.selection != 'none' && el.children.length > 0) {
1148
- this.prepareForRemoval(el.children, markupObject, tagComparator);
1149
- }
1150
-
1151
- }
1152
- },
1153
-
1154
- /**
1155
- * searches for fully selected equal markup tags
1156
- * @param selectionTree SelectionTree Object markup should be applied to
1157
- * @param rangeObject Aloha rangeObject the markup will be applied to
1158
- * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1159
- * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1160
- * @param options JS object, with the following boolean properties: setRangeObject2NewMarkup, setRangeObject2NextSibling, setRangeObject2PreviousSibling
1161
- * @return void
1162
- * @hide
1163
- */
1164
- wrapMarkupAroundSelectionTree: function(selectionTree, rangeObject, markupObject, tagComparator, options) {
1165
- // first let's find out if theoretically the whole selection can be wrapped with one tag and save it for later use
1166
- var objects2wrap = [], // // this will be used later to collect objects
1167
- j = -1, // internal counter,
1168
- breakpoint = true,
1169
- preText = '',
1170
- postText = '',
1171
- prevOrNext,
1172
- textNode2Start,
1173
- textnodes,
1174
- newMarkup,
1175
- i, el, middleText;
1176
-
1177
-
1178
-
1179
- Aloha.Log.debug(this,'The formatting <' + markupObject[0].tagName + '> will be wrapped around the selection');
1180
-
1181
- // now lets iterate over the elements
1182
- for (i = 0; i < selectionTree.length; i++) {
1183
- el = selectionTree[i];
1184
-
1185
- // check if markup is allowed inside the elements parent
1186
- if (el.domobj && !this.canTag1WrapTag2(el.domobj.parentNode.tagName.toLowerCase(), markupObject[0].tagName.toLowerCase())) {
1187
- Aloha.Log.info(this,'Skipping the wrapping of <' + markupObject[0].tagName.toLowerCase() + '> because this tag is not allowed inside <' + el.domobj.parentNode.tagName.toLowerCase() + '>');
1188
- continue;
1189
- }
1190
-
1191
- // skip empty text nodes
1192
- if (el.domobj && el.domobj.nodeType === 3 && jQuery.trim(el.domobj.nodeValue).length === 0) {
1193
- continue;
1194
- }
1195
-
1196
- // partial element, can either be a textnode and therefore be wrapped (at least partially)
1197
- // or can be a nodeType == 1 (tag) which must be dived into
1198
- if (el.domobj && el.selection == 'partial' && !markupObject.isReplacingElement) {
1199
- if (el.startOffset !== undefined && el.endOffset === undefined) {
1200
- j++;
1201
- preText += el.domobj.data.substr(0,el.startOffset);
1202
- el.domobj.data = el.domobj.data.substr(el.startOffset, el.domobj.data.length-el.startOffset);
1203
- objects2wrap[j] = el.domobj;
1204
- } else if (el.endOffset !== undefined && el.startOffset === undefined) {
1205
- j++;
1206
- postText += el.domobj.data.substr(el.endOffset, el.domobj.data.length-el.endOffset);
1207
- el.domobj.data = el.domobj.data.substr(0, el.endOffset);
1208
- objects2wrap[j] = el.domobj;
1209
- } else if (el.endOffset !== undefined && el.startOffset !== undefined) {
1210
- if (el.startOffset == el.endOffset) { // do not wrap empty selections
1211
- Aloha.Log.debug(this, 'skipping empty selection');
1212
- continue;
1213
- }
1214
- j++;
1215
- preText += el.domobj.data.substr(0,el.startOffset);
1216
- middleText = el.domobj.data.substr(el.startOffset,el.endOffset-el.startOffset);
1217
- postText += el.domobj.data.substr(el.endOffset, el.domobj.data.length-el.endOffset);
1218
- el.domobj.data = middleText;
1219
- objects2wrap[j] = el.domobj;
1220
- } else {
1221
- // a partially selected item without selectionStart/EndOffset is a nodeType 1 Element on the way to the textnode
1222
- Aloha.Log.debug(this, 'diving into object');
1223
- this.applyMarkup(el.children, rangeObject, markupObject, tagComparator, options);
1224
- }
1225
- }
1226
- // fully selected dom elements can be wrapped as whole element
1227
- if (el.domobj && (el.selection == 'full' || (el.selection == 'partial' && markupObject.isReplacingElement))) {
1228
- j++;
1229
- objects2wrap[j] = el.domobj;
1230
- }
1231
- }
1232
-
1233
- if (objects2wrap.length > 0) {
1234
- // wrap collected DOM object with markupObject
1235
- objects2wrap = jQuery(objects2wrap);
1236
-
1237
- // make a fix for text nodes in <li>'s in ie
1238
- jQuery.each(objects2wrap, function(index, element) {
1239
- if (jQuery.browser.msie && element.nodeType == 3
1240
- && !element.nextSibling && !element.previousSibling
1241
- && element.parentNode
1242
- && element.parentNode.nodeName.toLowerCase() == 'li') {
1243
- element.data = jQuery.trim(element.data);
1244
- }
1245
- });
1246
-
1247
- newMarkup = objects2wrap.wrapAll(markupObject).parent();
1248
- newMarkup.before(preText).after(postText);
1249
-
1250
- if (options.setRangeObject2NewMarkup) { // this is used, when markup is added to normal/normal Text
1251
- textnodes = objects2wrap.textNodes();
1252
-
1253
- if (textnodes.index(rangeObject.startContainer) != -1) {
1254
- rangeObject.startOffset = 0;
1255
- }
1256
- if (textnodes.index(rangeObject.endContainer) != -1) {
1257
- rangeObject.endOffset = rangeObject.endContainer.length;
1258
- }
1259
- breakpoint=true;
1260
- }
1261
- if (options.setRangeObject2NextSibling){
1262
- prevOrNext = true;
1263
- textNode2Start = newMarkup.textNodes(true).last()[0];
1264
- if (objects2wrap.index(rangeObject.startContainer) != -1) {
1265
- rangeObject.startContainer = this.getTextNodeSibling(prevOrNext, newMarkup.parent(), textNode2Start);
1266
- rangeObject.startOffset = 0;
1267
- }
1268
- if (objects2wrap.index(rangeObject.endContainer) != -1) {
1269
- rangeObject.endContainer = this.getTextNodeSibling(prevOrNext, newMarkup.parent(), textNode2Start);
1270
- rangeObject.endOffset = rangeObject.endOffset - textNode2Start.length;
1271
- }
1272
- }
1273
- if (options.setRangeObject2PreviousSibling){
1274
- prevOrNext = false;
1275
- textNode2Start = newMarkup.textNodes(true).first()[0];
1276
- if (objects2wrap.index(rangeObject.startContainer) != -1) {
1277
- rangeObject.startContainer = this.getTextNodeSibling(prevOrNext, newMarkup.parent(), textNode2Start);
1278
- rangeObject.startOffset = 0;
1279
- }
1280
- if (objects2wrap.index(rangeObject.endContainer) != -1) {
1281
- rangeObject.endContainer = this.getTextNodeSibling(prevOrNext, newMarkup.parent(), textNode2Start);
1282
- rangeObject.endOffset = rangeObject.endContainer.length;
1283
- }
1284
- }
1285
- }
1286
- },
1287
-
1288
- /**
1289
- * takes a text node and return either the next recursive text node sibling or the previous
1290
- * @param previousOrNext boolean, false for previous, true for next sibling
1291
- * @param commonAncestorContainer dom object to be used as root for the sibling search
1292
- * @param currentTextNode dom object of the originating text node
1293
- * @return dom object of the sibling text node
1294
- * @hide
1295
- */
1296
- getTextNodeSibling: function(previousOrNext, commonAncestorContainer, currentTextNode) {
1297
- var textNodes = jQuery(commonAncestorContainer).textNodes(true),
1298
- newIndex, index;
1299
-
1300
- index = textNodes.index(currentTextNode);
1301
- if (index == -1) { // currentTextNode was not found
1302
- return false;
1303
- }
1304
- newIndex = index + (!previousOrNext ? -1 : 1);
1305
- return textNodes[newIndex] ? textNodes[newIndex] : false;
1306
- },
1307
-
1308
- /**
1309
- * takes a selection tree and groups it into markup wrappable selection trees
1310
- * @param selectionTree rangeObject selection tree
1311
- * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1312
- * @return JS array of wrappable selection trees
1313
- * @hide
1314
- */
1315
- optimizeSelectionTree4Markup: function(selectionTree, markupObject, tagComparator) {
1316
- var groupMap = [],
1317
- outerGroupIndex = 0,
1318
- innerGroupIndex = 0,
1319
- that = this,
1320
- i,j,
1321
- endPosition, startPosition;
1322
-
1323
- if (typeof tagComparator === 'undefined') {
1324
- tagComparator = function(domobj, markupObject) {
1325
- return that.standardTextLevelSemanticsComparator(markupObject);
1326
- };
1327
- }
1328
- for( i = 0; i<selectionTree.length; i++) {
1329
- // we are just interested in selected item, but not in non-selected items
1330
- if (selectionTree[i].domobj && selectionTree[i].selection != 'none') {
1331
- if (markupObject.isReplacingElement && tagComparator(markupObject[0], jQuery(selectionTree[i].domobj))) {
1332
- if (groupMap[outerGroupIndex] !== undefined) {
1333
- outerGroupIndex++;
1334
- }
1335
- groupMap[outerGroupIndex] = {};
1336
- groupMap[outerGroupIndex].wrappable = true;
1337
- groupMap[outerGroupIndex].elements = [];
1338
- groupMap[outerGroupIndex].elements[innerGroupIndex] = selectionTree[i];
1339
- outerGroupIndex++;
1340
-
1341
- } else
1342
- // now check, if the children of our item could be wrapped all together by the markup object
1343
- if (this.canMarkupBeApplied2ElementAsWhole([ selectionTree[i] ], markupObject)) {
1344
- // if yes, add it to the current group
1345
- if (groupMap[outerGroupIndex] === undefined) {
1346
- groupMap[outerGroupIndex] = {};
1347
- groupMap[outerGroupIndex].wrappable = true;
1348
- groupMap[outerGroupIndex].elements = [];
1349
- }
1350
- if (markupObject.isReplacingElement) { // && selectionTree[i].domobj.nodeType === 3
1351
- /* we found the node to wrap for a replacing element. however there might
1352
- * be siblings which should be included as well
1353
- * although they are actually not selected. example:
1354
- * li
1355
- * |-textNode ( .selection = 'none')
1356
- * |-textNode (cursor inside, therefor .selection = 'partial')
1357
- * |-textNode ( .selection = 'none')
1358
- *
1359
- * in this case it would be useful to select the previous and following textNodes as well (they might result from a previous DOM manipulation)
1360
- * Think about other cases, where the parent is the Editable. In this case we propably only want to select from and until the next <br /> ??
1361
- * .... many possibilities, here I realize the two described cases
1362
- */
1363
-
1364
- // first find start element starting from the current element going backwards until sibling 0
1365
- startPosition = i;
1366
- for (j = i-1; j >= 0; j--) {
1367
- if (this.canMarkupBeApplied2ElementAsWhole([ selectionTree[ j ] ], markupObject) && this.isMarkupAllowedToStealSelectionTreeElement(selectionTree[ j ], markupObject)) {
1368
- startPosition = j;
1369
- } else {
1370
- break;
1371
- }
1372
- }
1373
-
1374
- // now find the end element starting from the current element going forward until the last sibling
1375
- endPosition = i;
1376
- for (j = i+1; j < selectionTree.length; j++) {
1377
- if (this.canMarkupBeApplied2ElementAsWhole([ selectionTree[ j ] ], markupObject) && this.isMarkupAllowedToStealSelectionTreeElement(selectionTree[ j ], markupObject)) {
1378
- endPosition = j;
1379
- } else {
1380
- break;
1381
- }
1382
- }
1383
-
1384
- // now add the elements to the groupMap
1385
- innerGroupIndex = 0;
1386
- for (j = startPosition; j <= endPosition; j++) {
1387
- groupMap[outerGroupIndex].elements[innerGroupIndex] = selectionTree[j];
1388
- groupMap[outerGroupIndex].elements[innerGroupIndex].selection = 'full';
1389
- innerGroupIndex++;
1390
- }
1391
- innerGroupIndex = 0;
1392
- } else {
1393
- // normal text level semantics object, no siblings need to be selected
1394
- groupMap[outerGroupIndex].elements[innerGroupIndex] = selectionTree[i];
1395
- innerGroupIndex++;
1396
- }
1397
- } else {
1398
- // if no, isolate it in its own group
1399
- if (groupMap[outerGroupIndex] !== undefined) {
1400
- outerGroupIndex++;
1401
- }
1402
- groupMap[outerGroupIndex] = {};
1403
- groupMap[outerGroupIndex].wrappable = false;
1404
- groupMap[outerGroupIndex].element = selectionTree[i];
1405
- innerGroupIndex = 0;
1406
- outerGroupIndex++;
1407
- }
1408
- }
1409
- }
1410
- return groupMap;
1411
- },
1412
-
1413
- /**
1414
- * very tricky method, which decides, if a certain markup (normally a replacing markup element like p, h1, blockquote)
1415
- * is allowed to extend the user selection to other dom objects (represented as selectionTreeElement)
1416
- * to understand the purpose: if the user selection is collapsed inside e.g. some text, which is currently not
1417
- * wrapped by the markup to be applied, and therefor the markup does not have an equal markup to replace, then the DOM
1418
- * manipulator has to decide which objects to wrap. real example:
1419
- * <div>
1420
- * <h1>headline</h1>
1421
- * some text blabla bla<br>
1422
- * more text HERE THE | CURSOR BLINKING and <b>even more bold text</b>
1423
- * </div>
1424
- * when the user now wants to apply e.g. a <p> tag, what will be wrapped? it could be useful if the manipulator would actually
1425
- * wrap everything inside the div except the <h1>. but for this purpose someone has to decide, if the markup is
1426
- * allowed to wrap certain dom elements in this case the question would be, if the <p> is allowed to wrap
1427
- * textNodes, <br> and <b> and <h1>. therefore this tricky method should answer the question for those 3 elements
1428
- * with true, but for for the <h1> it should return false. and since the method does not know this, there is a configuration
1429
- * for this
1430
- *
1431
- * @param selectionTree rangeObject selection tree element (only one, not an array of)
1432
- * @param markupObject lowercase string of the tag to be verified (e.g. "b")
1433
- * @return true if the markup is allowed to wrap the selection tree element, false otherwise
1434
- * @hide
1435
- */
1436
- isMarkupAllowedToStealSelectionTreeElement: function(selectionTreeElement, markupObject) {
1437
- if (!selectionTreeElement.domobj) {
1438
- return false;
1439
- }
1440
- var nodeName = selectionTreeElement.domobj.nodeName.toLowerCase(),
1441
- markupName;
1442
-
1443
- nodeName = (nodeName == '#text') ? 'textNode' : nodeName;
1444
- markupName = markupObject[0].nodeName.toLowerCase();
1445
- // if nothing is defined for the markup, it's now allowed
1446
- if (!this.allowedToStealElements[ markupName ]) {
1447
- return false;
1448
- }
1449
- // if something is defined, but the specifig tag is not in the list
1450
- if (this.allowedToStealElements[ markupName ].indexOf(nodeName) == -1) {
1451
- return false;
1452
- }
1453
- return true;
1454
- },
1455
-
1456
- /**
1457
- * checks if a selection can be completey wrapped by a certain html tags (helper method for this.optimizeSelectionTree4Markup
1458
- * @param selectionTree rangeObject selection tree
1459
- * @param markupObject lowercase string of the tag to be verified (e.g. "b")
1460
- * @return true if selection can be applied as whole, false otherwise
1461
- * @hide
1462
- */
1463
- canMarkupBeApplied2ElementAsWhole: function(selectionTree, markupObject) {
1464
- var htmlTag, i, el, returnVal;
1465
-
1466
- if (markupObject.jquery) {
1467
- htmlTag = markupObject[0].tagName;
1468
- }
1469
- if (markupObject.tagName) {
1470
- htmlTag = markupObject.tagName;
1471
- }
1472
-
1473
- returnVal = true;
1474
- for ( i = 0; i < selectionTree.length; i++) {
1475
- el = selectionTree[i];
1476
- if (el.domobj && (el.selection != "none" || markupObject.isReplacingElement)) {
1477
- // Aloha.Log.debug(this, 'Checking, if <' + htmlTag + '> can be applied to ' + el.domobj.nodeName);
1478
- if (!this.canTag1WrapTag2(htmlTag, el.domobj.nodeName)) {
1479
- return false;
1480
- }
1481
- if (el.children.length > 0 && !this.canMarkupBeApplied2ElementAsWhole(el.children, markupObject)) {
1482
- return false;
1483
- }
1484
- }
1485
- }
1486
- return returnVal;
1487
- },
1488
-
1489
- /**
1490
- * checks if a tag 1 (first parameter) can wrap tag 2 (second parameter).
1491
- * IMPORTANT: the method does not verify, if there have to be other tags in between
1492
- * Example: this.canTag1WrapTag2("table", "td") will return true, because the method does not take into account, that there has to be a "tr" in between
1493
- * @param t1 string: tagname of outer tag to verify, e.g. "b"
1494
- * @param t2 string: tagname of inner tag to verify, e.g. "b"
1495
- * @return true if tag 1 can wrap tag 2, false otherwise
1496
- * @hide
1497
- */
1498
- canTag1WrapTag2: function(t1, t2) {
1499
- t1 = (t1 == '#text')?'textNode':t1.toLowerCase();
1500
- t2 = (t2 == '#text')?'textNode':t2.toLowerCase();
1501
- if (!this.tagHierarchy[ t1 ]) {
1502
- // Aloha.Log.warn(this, t1 + ' is an unknown tag to the method canTag1WrapTag2 (paramter 1). Sadfully allowing the wrapping...');
1503
- return true;
1504
- }
1505
- if (!this.tagHierarchy[ t2 ]) {
1506
- // Aloha.Log.warn(this, t2 + ' is an unknown tag to the method canTag1WrapTag2 (paramter 2). Sadfully allowing the wrapping...');
1507
- return true;
1508
- }
1509
- var t1Array = this.tagHierarchy[ t1 ],
1510
- returnVal = (t1Array.indexOf( t2 ) != -1) ? true : false;
1511
- return returnVal;
1512
- },
1513
-
1514
- /**
1515
- * Check whether it is allowed to insert the given tag at the start of the
1516
- * current selection. This method will check whether the markup effective for
1517
- * the start and outside of the editable part (starting with the editable tag
1518
- * itself) may wrap the given tag.
1519
- * @param tagName {String} name of the tag which shall be inserted
1520
- * @return true when it is allowed to insert that tag, false if not
1521
- * @hide
1522
- */
1523
- mayInsertTag: function (tagName) {
1524
- if (typeof this.rangeObject.unmodifiableMarkupAtStart == 'object') {
1525
- // iterate over all DOM elements outside of the editable part
1526
- for (var i = 0; i < this.rangeObject.unmodifiableMarkupAtStart.length; ++i) {
1527
- // check whether an element may not wrap the given
1528
- if (!this.canTag1WrapTag2(this.rangeObject.unmodifiableMarkupAtStart[i].nodeName, tagName)) {
1529
- // found a DOM element which forbids to insert the given tag, we are done
1530
- return false;
1531
- }
1532
- }
1533
-
1534
- // all of the found DOM elements allow inserting the given tag
1535
- return true;
1536
- } else {
1537
- Aloha.Log.warn(this, 'Unable to determine whether tag ' + tagName + ' may be inserted');
1538
- return true;
1539
- }
1540
- },
1541
-
1542
- /**
1543
- * String representation
1544
- * @return "Aloha.Selection"
1545
- * @hide
1546
- */
1547
- toString: function() {
1548
- return 'Aloha.Selection';
1549
- },
1550
-
1551
- /**
1552
- * @namespace Aloha.Selection
1553
- * @class SelectionRange
1554
- * @extends GENTICS.Utils.RangeObject
1555
- * Constructor for a range object.
1556
- * Optionally you can pass in a range object that's properties will be assigned to the new range object.
1557
- * @param rangeObject A range object thats properties will be assigned to the new range object.
1558
- * @constructor
1559
- */
1560
- SelectionRange: GENTICS.Utils.RangeObject.extend({
1561
- _constructor: function(rangeObject){
1562
- this._super(rangeObject);
1563
- // If a range object was passed in we apply the values to the new range object
1564
- if (rangeObject) {
1565
- if (rangeObject.commonAncestorContainer) {
1566
- this.commonAncestorContainer = rangeObject.commonAncestorContainer;
1567
- }
1568
- if (rangeObject.selectionTree) {
1569
- this.selectionTree = rangeObject.selectionTree;
1570
- }
1571
- if (rangeObject.limitObject) {
1572
- this.limitObject = rangeObject.limitObject;
1573
- }
1574
- if (rangeObject.markupEffectiveAtStart) {
1575
- this.markupEffectiveAtStart = rangeObject.markupEffectiveAtStart;
1576
- }
1577
- if (rangeObject.unmodifiableMarkupAtStart) {
1578
- this.unmodifiableMarkupAtStart = rangeObject.unmodifiableMarkupAtStart;
1579
- }
1580
- if (rangeObject.splitObject) {
1581
- this.splitObject = rangeObject.splitObject;
1582
- }
1583
- }
1584
- },
1585
-
1586
- /**
1587
- * DOM object of the common ancestor from startContainer and endContainer
1588
- * @hide
1589
- */
1590
- commonAncestorContainer: undefined,
1591
-
1592
- /**
1593
- * The selection tree
1594
- * @hide
1595
- */
1596
- selectionTree: undefined,
1597
-
1598
- /**
1599
- * Array of DOM objects effective for the start container and inside the
1600
- * editable part (inside the limit object). relevant for the button status
1601
- * @hide
1602
- */
1603
- markupEffectiveAtStart: [],
1604
-
1605
- /**
1606
- * Array of DOM objects effective for the start container, which lies
1607
- * outside of the editable portion (starting with the limit object)
1608
- * @hide
1609
- */
1610
- unmodifiableMarkupAtStart: [],
1611
-
1612
- /**
1613
- * DOM object being the limit for all markup relevant activities
1614
- * @hide
1615
- */
1616
- limitObject: undefined,
1617
-
1618
- /**
1619
- * DOM object being split when enter key gets hit
1620
- * @hide
1621
- */
1622
- splitObject: undefined,
1623
-
1624
- /**
1625
- * Sets the visible selection in the Browser based on the range object.
1626
- * If the selection is collapsed, this will result in a blinking cursor,
1627
- * otherwise in a text selection.
1628
- * @method
1629
- */
1630
- select: function() {
1631
- // Call Utils' select()
1632
- this._super();
1633
-
1634
- // update the selection
1635
- Aloha.Selection.updateSelection();
1636
- },
1637
-
1638
- /**
1639
- * Method to update a range object internally
1640
- * @param commonAncestorContainer (DOM Object); optional Parameter; if set, the parameter
1641
- * will be used instead of the automatically calculated CAC
1642
- * @return void
1643
- * @hide
1644
- */
1645
- update: function(commonAncestorContainer) {
1646
- this.updatelimitObject();
1647
- this.updateMarkupEffectiveAtStart();
1648
- this.updateCommonAncestorContainer(commonAncestorContainer);
1649
-
1650
- // reset the selectiontree (must be recalculated)
1651
- this.selectionTree = undefined;
1652
- },
1653
-
1654
- /**
1655
- * Get the selection tree for this range
1656
- * TODO: remove this (was moved to range.js)
1657
- * @return selection tree
1658
- * @hide
1659
- */
1660
- getSelectionTree: function () {
1661
- // if not yet calculated, do this now
1662
- if (!this.selectionTree) {
1663
- this.selectionTree = Aloha.Selection.getSelectionTree(this);
1664
- }
1665
-
1666
- return this.selectionTree;
1667
- },
1668
-
1669
- /**
1670
- * TODO: move this to range.js
1671
- * Get an array of domobj (in dom tree order) of siblings of the given domobj, which are contained in the selection
1672
- * @param domobj dom object to start with
1673
- * @return array of siblings of the given domobj, which are also selected
1674
- * @hide
1675
- */
1676
- getSelectedSiblings: function (domobj) {
1677
- var selectionTree = this.getSelectionTree();
1678
-
1679
- return this.recursionGetSelectedSiblings(domobj, selectionTree);
1680
- },
1681
-
1682
- /**
1683
- * TODO: move this to range.js
1684
- * Recursive method to find the selected siblings of the given domobj (which should be selected as well)
1685
- * @param domobj dom object for which the selected siblings shall be found
1686
- * @param selectionTree current level of the selection tree
1687
- * @return array of selected siblings of dom objects or false if none found
1688
- * @hide
1689
- */
1690
- recursionGetSelectedSiblings: function (domobj, selectionTree) {
1691
- var selectedSiblings = false,
1692
- foundObj = false,
1693
- i;
1694
-
1695
- for ( i = 0; i < selectionTree.length; ++i) {
1696
- if (selectionTree[i].domobj === domobj) {
1697
- foundObj = true;
1698
- selectedSiblings = [];
1699
- } else if (!foundObj && selectionTree[i].children) {
1700
- // do the recursion
1701
- selectedSiblings = this.recursionGetSelectedSiblings(domobj, selectionTree[i].children);
1702
- if (selectedSiblings !== false) {
1703
- break;
1704
- }
1705
- } else if (foundObj && selectionTree[i].domobj && selectionTree[i].selection != 'collapsed' && selectionTree[i].selection != 'none') {
1706
- selectedSiblings.push(selectionTree[i].domobj);
1707
- } else if (foundObj && selectionTree[i].selection == 'none') {
1708
- break;
1709
- }
1710
- }
1711
-
1712
- return selectedSiblings;
1713
- },
1714
-
1715
- /**
1716
- * TODO: move this to range.js
1717
- * Method updates member var markupEffectiveAtStart and splitObject, which is relevant primarily for button status and enter key behaviour
1718
- * @return void
1719
- * @hide
1720
- */
1721
- updateMarkupEffectiveAtStart: function() {
1722
- // reset the current markup
1723
- this.markupEffectiveAtStart = [];
1724
- this.unmodifiableMarkupAtStart = [];
1725
-
1726
- var
1727
- parents = this.getStartContainerParents(),
1728
- limitFound = false,
1729
- splitObjectWasSet,
1730
- i, el;
1731
-
1732
- for ( i = 0; i < parents.length; i++) {
1733
- el = parents[i];
1734
- if (!limitFound && (el !== this.limitObject)) {
1735
- this.markupEffectiveAtStart[ i ] = el;
1736
- if (!splitObjectWasSet && GENTICS.Utils.Dom.isSplitObject(el)) {
1737
- splitObjectWasSet = true;
1738
- this.splitObject = el;
1739
- }
1740
- } else {
1741
- limitFound = true;
1742
- this.unmodifiableMarkupAtStart.push(el);
1743
- }
1744
- }
1745
- if (!splitObjectWasSet) {
1746
- this.splitObject = false;
1747
- }
1748
- return;
1749
- },
1750
-
1751
- /**
1752
- * TODO: remove this
1753
- * Method updates member var markupEffectiveAtStart, which is relevant primarily for button status
1754
- * @return void
1755
- * @hide
1756
- */
1757
- updatelimitObject: function() {
1758
- if (Aloha.editables && Aloha.editables.length > 0) {
1759
- var parents = this.getStartContainerParents(),
1760
- editables = Aloha.editables,
1761
- i, el, j, editable;
1762
- for ( i = 0; i < parents.length; i++) {
1763
- el = parents[i];
1764
- for ( j = 0; j < editables.length; j++) {
1765
- editable = editables[j].obj[0];
1766
- if (el === editable) {
1767
- this.limitObject = el;
1768
- return true;
1769
- }
1770
- }
1771
- }
1772
- }
1773
- this.limitObject = jQuery('body');
1774
- return true;
1775
- },
1776
-
1777
- /**
1778
- * string representation of the range object
1779
- * @param verbose set to true for verbose output
1780
- * @return string representation of the range object
1781
- * @hide
1782
- */
1783
- toString: function(verbose) {
1784
- if (!verbose) {
1785
- return 'Aloha.Selection.SelectionRange';
1786
- }
1787
- return 'Aloha.Selection.SelectionRange {start [' + this.startContainer.nodeValue + '] offset '
1788
- + this.startOffset + ', end [' + this.endContainer.nodeValue + '] offset ' + this.endOffset + '}';
1789
- }
1790
-
1791
- }) // SelectionRange
1792
-
1793
- }); // Selection
1794
-
1795
-
1796
- /**
1797
- * This method implements an ugly workaround for a selection problem in ie:
1798
- * when the cursor shall be placed at the end of a text node in a li element, that is followed by a nested list,
1799
- * the selection would always snap into the first li of the nested list
1800
- * therefore, we make sure that the text node ends with a space and place the cursor right before it
1801
- */
1802
- function nestedListInIEWorkaround ( range ) {
1803
- if (jQuery.browser.msie
1804
- && range.startContainer === range.endContainer
1805
- && range.startOffset === range.endOffset
1806
- && range.startContainer.nodeType == 3
1807
- && range.startOffset == range.startContainer.data.length
1808
- && range.startContainer.nextSibling
1809
- && ["OL", "UL"].indexOf(range.startContainer.nextSibling.nodeName) !== -1) {
1810
- if (range.startContainer.data[range.startContainer.data.length-1] == ' ') {
1811
- range.startOffset = range.endOffset = range.startOffset-1;
1812
- } else {
1813
- range.startContainer.data = range.startContainer.data + ' ';
1814
- }
1815
- }
1816
- }
1817
-
1818
- function correctRange ( range ) {
1819
- nestedListInIEWorkaround(range);
1820
- return range;
1821
- }
1822
-
1823
- /**
1824
- * Implements Selection http://html5.org/specs/dom-range.html#selection
1825
- * @namespace Aloha
1826
- * @class Selection This singleton class always represents the
1827
- * current user selection
1828
- * @singleton
1829
- */
1830
- var AlohaSelection = Class.extend({
1831
-
1832
- _constructor : function( nativeSelection ) {
1833
-
1834
- this._nativeSelection = nativeSelection;
1835
- this.ranges = [];
1836
-
1837
- // will remember if urged to not change the selection
1838
- this.preventChange = false;
1839
-
1840
- },
1841
-
1842
- /**
1843
- * Returns the element that contains the start of the selection. Returns null if there's no selection.
1844
- * @readonly
1845
- * @type Node
1846
- */
1847
- anchorNode: null,
1848
-
1849
- /**
1850
- * Returns the offset of the start of the selection relative to the element that contains the start
1851
- * of the selection. Returns 0 if there's no selection.
1852
- * @readonly
1853
- * @type int
1854
- */
1855
- anchorOffset: 0,
1856
-
1857
- /**
1858
- * Returns the element that contains the end of the selection.
1859
- * Returns null if there's no selection.
1860
- * @readonly
1861
- * @type Node
1862
- */
1863
- focusNode: null,
1864
-
1865
- /**
1866
- * Returns the offset of the end of the selection relative to the element that contains the end
1867
- * of the selection. Returns 0 if there's no selection.
1868
- * @readonly
1869
- * @type int
1870
- */
1871
- focusOffset: 0,
1872
-
1873
- /**
1874
- * Returns true if there's no selection or if the selection is empty. Otherwise, returns false.
1875
- * @readonly
1876
- * @type boolean
1877
- */
1878
- isCollapsed: false,
1879
-
1880
- /**
1881
- * Returns the number of ranges in the selection.
1882
- * @readonly
1883
- * @type int
1884
- */
1885
- rangeCount: 0,
1886
-
1887
- /**
1888
- * Replaces the selection with an empty one at the given position.
1889
- * @throws a WRONG_DOCUMENT_ERR exception if the given node is in a different document.
1890
- * @param parentNode Node of new selection
1891
- * @param offest offest of new Selection in parentNode
1892
- * @void
1893
- */
1894
- collapse: function ( parentNode, offset ) {
1895
- this._nativeSelection.collapse( parentNode, offset );
1896
- },
1897
-
1898
- /**
1899
- * Replaces the selection with an empty one at the position of the start of the current selection.
1900
- * @throws an INVALID_STATE_ERR exception if there is no selection.
1901
- * @void
1902
- */
1903
- collapseToStart: function() {
1904
- throw "NOT_IMPLEMENTED";
1905
- },
1906
-
1907
- /**
1908
- * @void
1909
- */
1910
- extend: function ( parentNode, offset) {
1911
-
1912
- },
1913
-
1914
- /**
1915
- * @param alter DOMString
1916
- * @param direction DOMString
1917
- * @param granularity DOMString
1918
- * @void
1919
- */
1920
- modify: function ( alter, direction, granularity ) {
1921
-
1922
- },
1923
-
1924
- /**
1925
- * Replaces the selection with an empty one at the position of the end of the current selection.
1926
- * @throws an INVALID_STATE_ERR exception if there is no selection.
1927
- * @void
1928
- */
1929
- collapseToEnd: function() {
1930
- throw "NOT_IMPLEMENTED";
1931
- },
1932
-
1933
- /**
1934
- * Replaces the selection with one that contains all the contents of the given element.
1935
- * @throws a WRONG_DOCUMENT_ERR exception if the given node is in a different document.
1936
- * @param parentNode Node the Node fully select
1937
- * @void
1938
- */
1939
- selectAllChildren: function( parentNode ) {
1940
- throw "NOT_IMPLEMENTED";
1941
- },
1942
-
1943
- /**
1944
- * Deletes the contents of the selection
1945
- */
1946
- deleteFromDocument: function() {
1947
- throw "NOT_IMPLEMENTED";
1948
- },
1949
-
1950
- /**
1951
- * NB!
1952
- * We have serious problem in IE.
1953
- * The range that we get in IE is not the same as the range we had set,
1954
- * so even if we normalize it during getRangeAt, in IE, we will be
1955
- * correcting the range to the "correct" place, but still not the place
1956
- * where it was originally set.
1957
- *
1958
- * Returns the given range.
1959
- * The getRangeAt(index) method returns the indexth range in the list.
1960
- * NOTE: Aloha Editor only support 1 range! index can only be 0
1961
- * @throws INDEX_SIZE_ERR DOM exception if index is less than zero or
1962
- * greater or equal to the value returned by the rangeCount.
1963
- * @param index int
1964
- * @return Range return the selected range from index
1965
- */
1966
- getRangeAt: function ( index ) {
1967
- return correctRange( this._nativeSelection.getRangeAt( index ) );
1968
- //if ( index < 0 || this.rangeCount ) {
1969
- // throw "INDEX_SIZE_ERR DOM";
1970
- //}
1971
- //return this._ranges[index];
1972
- },
1973
-
1974
- /**
1975
- * Adds the given range to the selection.
1976
- * The addRange(range) method adds the given range Range object to the list of
1977
- * selections, at the end (so the newly added range is the new last range).
1978
- * NOTE: Aloha Editor only support 1 range! The added range will replace the
1979
- * range at index 0
1980
- * see http://html5.org/specs/dom-range.html#selection note about addRange
1981
- * @throws an INVALID_NODE_TYPE_ERR exception if the given Range has a boundary point
1982
- * node that's not a Text or Element node, and an INVALID_MODIFICATION_ERR exception
1983
- * if it has a boundary point node that doesn't descend from a Document.
1984
- * @param range Range adds the range to the selection
1985
- * @void
1986
- */
1987
- addRange: function( range ) {
1988
- // set readonly attributes
1989
- this._nativeSelection.addRange( range );
1990
- // We will correct the range after rangy has processed the native
1991
- // selection range, so that our correction will be the final fix on
1992
- // the range according to the guarentee's that Aloha wants to make
1993
- this._nativeSelection._ranges[ 0 ] = correctRange( range );
1994
-
1995
- // make sure, the old Aloha selection will be updated (until all implementations use the new AlohaSelection)
1996
- Aloha.Selection.updateSelection();
1997
- },
1998
-
1999
- /**
2000
- * Removes the given range from the selection, if the range was one of the ones in the selection.
2001
- * NOTE: Aloha Editor only support 1 range! The added range will replace the
2002
- * range at with index 0
2003
- * @param range Range removes the range from the selection
2004
- * @void
2005
- */
2006
- removeRange: function( range ) {
2007
- this._nativeSelection.removeRange();
2008
- },
2009
-
2010
- /**
2011
- * Removes all the ranges in the selection.
2012
- * @viod
2013
- */
2014
- removeAllRanges: function() {
2015
- this._nativeSelection.removeAllRanges();
2016
- },
2017
-
2018
- /**
2019
- * prevents the next aloha-selection-changed event from
2020
- * being triggered
2021
- * @param flag boolean defines weather to update the selection on change or not
2022
- */
2023
- preventedChange: function( flag ) {
2024
- // this.preventChange = typeof flag === 'undefined' ? false : flag;
2025
- },
2026
-
2027
- /**
2028
- * will return wheter selection change event was prevented or not, and reset the
2029
- * preventSelectionChangedFlag
2030
- * @return boolean true if aloha-selection-change event
2031
- * was prevented
2032
- */
2033
- isChangedPrevented: function() {
2034
- // return this.preventSelectionChangedFlag;
2035
- },
2036
-
2037
- /**
2038
- * INFO: Method is used for integration with Gentics
2039
- * Aloha, has no use otherwise Updates the rangeObject
2040
- * according to the current user selection Method is
2041
- * always called on selection change
2042
- *
2043
- * @param event
2044
- * jQuery browser event object
2045
- * @return true when rangeObject was modified, false
2046
- * otherwise
2047
- * @hide
2048
- */
2049
- refresh: function(event) {
2050
-
2051
- },
2052
-
2053
- /**
2054
- * String representation
2055
- *
2056
- * @return "Aloha.Selection"
2057
- * @hide
2058
- */
2059
- toString: function() {
2060
- return 'Aloha.Selection';
2061
- },
2062
-
2063
- getRangeCount: function() {
2064
- return this._nativeSelection.rangeCount;
2065
- }
2066
-
2067
- });
2068
-
2069
- /**
2070
- * A wrapper for the function of the same name in the rangy core-depdency.
2071
- * This function should be preferred as it hides the global rangy object.
2072
- * For more information look at the following sites:
2073
- * http://html5.org/specs/dom-range.html
2074
- * @param window optional - specifices the window to get the selection of
2075
- */
2076
- Aloha.getSelection = function( target ) {
2077
- var target = ( target !== document || target !== window ) ? window : target;
2078
- // Aloha.Selection.refresh()
2079
- // implement Aloha Selection
2080
- // TODO cache
2081
- return new AlohaSelection( window.rangy.getSelection( target ) );
2082
- };
2083
-
2084
- /**
2085
- * A wrapper for the function of the same name in the rangy core-depdency.
2086
- * This function should be preferred as it hides the global rangy object.
2087
- * Please note: when the range object is not needed anymore,
2088
- * invoke the detach method on it. It is currently unknown to me why
2089
- * this is required, but that's what it says in the rangy specification.
2090
- * For more information look at the following sites:
2091
- * http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
2092
- * @param document optional - specifies which document to create the range for
2093
- */
2094
- Aloha.createRange = function(givenWindow) {
2095
- return window.rangy.createRange(givenWindow);
2096
- };
2097
-
2098
- var selection = new Selection();
2099
- Aloha.Selection = selection;
2100
-
2101
- return selection;
2102
- });
1
+ /* selection.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
+ 'jquery',
30
+ 'util/class',
31
+ 'util/range',
32
+ 'util/arrays',
33
+ 'util/strings',
34
+ 'aloha/console',
35
+ 'PubSub',
36
+ 'aloha/engine',
37
+ 'aloha/ecma5shims',
38
+ 'aloha/rangy-core'
39
+ ], function (
40
+ Aloha,
41
+ jQuery,
42
+ Class,
43
+ Range,
44
+ Arrays,
45
+ Strings,
46
+ console,
47
+ PubSub,
48
+ Engine,
49
+ e5s
50
+ ) {
51
+ "use strict";
52
+
53
+ var GENTICS = window.GENTICS;
54
+
55
+ function isCollapsedAndEmptyOrEndBr(rangeObject) {
56
+ var firstChild;
57
+ if (rangeObject.startContainer !== rangeObject.endContainer) {
58
+ return false;
59
+ }
60
+ // check whether the container starts in an element node
61
+ if (rangeObject.startContainer.nodeType != 1) {
62
+ return false;
63
+ }
64
+ firstChild = rangeObject.startContainer.firstChild;
65
+ return (!firstChild || (!firstChild.nextSibling && firstChild.nodeName == 'BR'));
66
+ }
67
+
68
+ function isCollapsedAndEndBr(rangeObject) {
69
+ if (rangeObject.startContainer !== rangeObject.endContainer) {
70
+ return false;
71
+ }
72
+ if (rangeObject.startContainer.nodeType != 1) {
73
+ return false;
74
+ }
75
+ return Engine.isEndBreak(rangeObject.startContainer);
76
+ }
77
+
78
+ var prevStartContext = null;
79
+ var prevEndContext = null;
80
+
81
+ function makeContextHtml(node, parents) {
82
+ var result = [],
83
+ parent,
84
+ len,
85
+ i;
86
+ if (1 === node.nodeType && node.nodeName !== 'BODY' && node.nodeName !== 'HTML') {
87
+ result.push(node.cloneNode(false).outerHTML);
88
+ } else {
89
+ result.push('#' + node.nodeType);
90
+ }
91
+ for (i = 0, len = parents.length; i < len; i++) {
92
+ parent = parents[i];
93
+ if (parent.nodeName === 'BODY' || parent.nodeName === 'HTML') {
94
+ // Although we limit the ancestors in most cases to the
95
+ // active editable, in some cases (copy&paste) the
96
+ // parent may be outside.
97
+ // On IE7 this means the following code may clone the
98
+ // HTML node too, which causes the browser to crash.
99
+ // On other browsers, this is just an optimization
100
+ // because the body and html elements should probably
101
+ // not be considered part of the context of an edit
102
+ // operation.
103
+ break;
104
+ }
105
+ result.push(parent.cloneNode(false).outerHTML);
106
+ }
107
+ return result.join('');
108
+ }
109
+
110
+ function getChangedContext(node, context) {
111
+ var until = Aloha.activeEditable ? Aloha.activeEditable.obj.parent()[0] : null;
112
+ var parents = jQuery(node).parentsUntil(until).get();
113
+ var html = makeContextHtml(node, parents);
114
+ var equal = (context && node === context.node && Arrays.equal(context.parents, parents) && html === context.html);
115
+ return equal ? null : {
116
+ node: node,
117
+ parents: parents,
118
+ html: html
119
+ };
120
+ }
121
+
122
+ function triggerSelectionContextChanged(rangeObject, event) {
123
+ var startContainer = rangeObject.startContainer;
124
+ var endContainer = rangeObject.endContainer;
125
+ if (!startContainer || !endContainer) {
126
+ console.warn("aloha/selection", "encountered range object without start or end container");
127
+ return;
128
+ }
129
+ var startContext = getChangedContext(startContainer, prevStartContext);
130
+ var endContext = getChangedContext(endContainer, prevEndContext);
131
+ if (!startContext && !endContext) {
132
+ return;
133
+ }
134
+ prevStartContext = startContext;
135
+ prevEndContext = endContext;
136
+
137
+ /**
138
+ * @api documented in the guides
139
+ */
140
+ PubSub.pub('aloha.selection.context-change', {
141
+ range: rangeObject,
142
+ event: event
143
+ });
144
+ }
145
+
146
+ /**
147
+ * @namespace Aloha
148
+ * @class Selection
149
+ * This singleton class always represents the current user selection
150
+ * @singleton
151
+ */
152
+ var Selection = Class.extend({
153
+ _constructor: function () {
154
+ // Pseudo Range Clone being cleaned up for better HTML wrapping support
155
+ this.rangeObject = {};
156
+
157
+ this.preventSelectionChangedFlag = false; // will remember if someone urged us to skip the next aloha-selection-changed event
158
+
159
+ // define basics first
160
+ this.tagHierarchy = {
161
+ 'textNode': {},
162
+ 'abbr': {
163
+ 'textNode': true
164
+ },
165
+ 'b': {
166
+ 'textNode': true,
167
+ 'b': true,
168
+ 'i': true,
169
+ 'em': true,
170
+ 'sup': true,
171
+ 'sub': true,
172
+ 'br': true,
173
+ 'span': true,
174
+ 'img': true,
175
+ 'a': true,
176
+ 'del': true,
177
+ 'ins': true,
178
+ 'u': true,
179
+ 'cite': true,
180
+ 'q': true,
181
+ 'code': true,
182
+ 'abbr': true,
183
+ 'strong': true
184
+ },
185
+ 'pre': {
186
+ 'textNode': true,
187
+ 'b': true,
188
+ 'i': true,
189
+ 'em': true,
190
+ 'sup': true,
191
+ 'sub': true,
192
+ 'br': true,
193
+ 'span': true,
194
+ 'img': true,
195
+ 'a': true,
196
+ 'del': true,
197
+ 'ins': true,
198
+ 'u': true,
199
+ 'cite': true,
200
+ 'q': true,
201
+ 'code': true,
202
+ 'abbr': true
203
+ },
204
+ 'blockquote': {
205
+ 'textNode': true,
206
+ 'b': true,
207
+ 'i': true,
208
+ 'em': true,
209
+ 'sup': true,
210
+ 'sub': true,
211
+ 'br': true,
212
+ 'span': true,
213
+ 'img': true,
214
+ 'a': true,
215
+ 'del': true,
216
+ 'ins': true,
217
+ 'u': true,
218
+ 'cite': true,
219
+ 'q': true,
220
+ 'code': true,
221
+ 'abbr': true,
222
+ 'p': true,
223
+ 'h1': true,
224
+ 'h2': true,
225
+ 'h3': true,
226
+ 'h4': true,
227
+ 'h5': true,
228
+ 'h6': true
229
+ },
230
+ 'ins': {
231
+ 'textNode': true,
232
+ 'b': true,
233
+ 'i': true,
234
+ 'em': true,
235
+ 'sup': true,
236
+ 'sub': true,
237
+ 'br': true,
238
+ 'span': true,
239
+ 'img': true,
240
+ 'a': true,
241
+ 'u': true,
242
+ 'p': true,
243
+ 'h1': true,
244
+ 'h2': true,
245
+ 'h3': true,
246
+ 'h4': true,
247
+ 'h5': true,
248
+ 'h6': true
249
+ },
250
+ 'ul': {
251
+ 'li': true
252
+ },
253
+ 'ol': {
254
+ 'li': true
255
+ },
256
+ 'li': {
257
+ 'textNode': true,
258
+ 'b': true,
259
+ 'i': true,
260
+ 'em': true,
261
+ 'sup': true,
262
+ 'sub': true,
263
+ 'br': true,
264
+ 'span': true,
265
+ 'img': true,
266
+ 'ul': true,
267
+ 'ol': true,
268
+ 'h1': true,
269
+ 'h2': true,
270
+ 'h3': true,
271
+ 'h4': true,
272
+ 'h5': true,
273
+ 'h6': true,
274
+ 'del': true,
275
+ 'ins': true,
276
+ 'u': true,
277
+ 'a': true
278
+ },
279
+ 'tr': {
280
+ 'td': true,
281
+ 'th': true
282
+ },
283
+ 'table': {
284
+ 'tr': true
285
+ },
286
+ 'div': {
287
+ 'textNode': true,
288
+ 'b': true,
289
+ 'i': true,
290
+ 'em': true,
291
+ 'sup': true,
292
+ 'sub': true,
293
+ 'br': true,
294
+ 'span': true,
295
+ 'img': true,
296
+ 'ul': true,
297
+ 'ol': true,
298
+ 'table': true,
299
+ 'h1': true,
300
+ 'h2': true,
301
+ 'h3': true,
302
+ 'h4': true,
303
+ 'h5': true,
304
+ 'h6': true,
305
+ 'del': true,
306
+ 'ins': true,
307
+ 'u': true,
308
+ 'p': true,
309
+ 'div': true,
310
+ 'pre': true,
311
+ 'blockquote': true,
312
+ 'a': true
313
+ },
314
+ 'h1': {
315
+ 'textNode': true,
316
+ 'b': true,
317
+ 'i': true,
318
+ 'em': true,
319
+ 'sup': true,
320
+ 'sub': true,
321
+ 'br': true,
322
+ 'span': true,
323
+ 'img': true,
324
+ 'a': true,
325
+ 'del': true,
326
+ 'ins': true,
327
+ 'u': true
328
+ }
329
+ };
330
+
331
+ // now reference the basics for all other equal tags (important: don't forget to include
332
+ // the basics itself as reference: 'b' : this.tagHierarchy.b
333
+ this.tagHierarchy = {
334
+ 'textNode': this.tagHierarchy.textNode,
335
+ 'abbr': this.tagHierarchy.abbr,
336
+ 'br': this.tagHierarchy.textNode,
337
+ 'img': this.tagHierarchy.textNode,
338
+ 'b': this.tagHierarchy.b,
339
+ 'strong': this.tagHierarchy.b,
340
+ 'code': this.tagHierarchy.b,
341
+ 'q': this.tagHierarchy.b,
342
+ 'blockquote': this.tagHierarchy.blockquote,
343
+ 'cite': this.tagHierarchy.b,
344
+ 'i': this.tagHierarchy.b,
345
+ 'em': this.tagHierarchy.b,
346
+ 'sup': this.tagHierarchy.b,
347
+ 'sub': this.tagHierarchy.b,
348
+ 'span': this.tagHierarchy.b,
349
+ 'del': this.tagHierarchy.del,
350
+ 'ins': this.tagHierarchy.ins,
351
+ 'u': this.tagHierarchy.b,
352
+ 'p': this.tagHierarchy.b,
353
+ 'pre': this.tagHierarchy.pre,
354
+ 'a': this.tagHierarchy.b,
355
+ 'ul': this.tagHierarchy.ul,
356
+ 'ol': this.tagHierarchy.ol,
357
+ 'li': this.tagHierarchy.li,
358
+ 'td': this.tagHierarchy.li,
359
+ 'div': this.tagHierarchy.div,
360
+ 'h1': this.tagHierarchy.h1,
361
+ 'h2': this.tagHierarchy.h1,
362
+ 'h3': this.tagHierarchy.h1,
363
+ 'h4': this.tagHierarchy.h1,
364
+ 'h5': this.tagHierarchy.h1,
365
+ 'h6': this.tagHierarchy.h1,
366
+ 'table': this.tagHierarchy.table
367
+ };
368
+
369
+ // When applying this elements to selection they will replace the assigned elements
370
+ this.replacingElements = {
371
+ 'h1': {
372
+ 'p': true,
373
+ 'h1': true,
374
+ 'h2': true,
375
+ 'h3': true,
376
+ 'h4': true,
377
+ 'h5': true,
378
+ 'h6': true,
379
+ 'pre': true,
380
+ 'blockquote': true
381
+ }
382
+ };
383
+ this.replacingElements = {
384
+ 'h1': this.replacingElements.h1,
385
+ 'h2': this.replacingElements.h1,
386
+ 'h3': this.replacingElements.h1,
387
+ 'h4': this.replacingElements.h1,
388
+ 'h5': this.replacingElements.h1,
389
+ 'h6': this.replacingElements.h1,
390
+ 'pre': this.replacingElements.h1,
391
+ 'p': this.replacingElements.h1,
392
+ 'blockquote': this.replacingElements.h1
393
+ };
394
+ this.allowedToStealElements = {
395
+ 'h1': {
396
+ 'textNode': true
397
+ }
398
+ };
399
+ this.allowedToStealElements = {
400
+ 'h1': this.allowedToStealElements.h1,
401
+ 'h2': this.allowedToStealElements.h1,
402
+ 'h3': this.allowedToStealElements.h1,
403
+ 'h4': this.allowedToStealElements.h1,
404
+ 'h5': this.allowedToStealElements.h1,
405
+ 'h6': this.allowedToStealElements.h1,
406
+ 'p': this.tagHierarchy.b
407
+ };
408
+ },
409
+
410
+ /**
411
+ * Class definition of a SelectionTree (relevant for all formatting / markup changes)
412
+ * TODO: remove this (was moved to range.js)
413
+ * Structure:
414
+ * +
415
+ * |-domobj: <reference to the DOM Object> (NOT jQuery)
416
+ * |-selection: defines if this node is marked by user [none|partial|full]
417
+ * |-children: recursive structure like this
418
+ * @hide
419
+ */
420
+ SelectionTree: function () {
421
+ this.domobj = {};
422
+ this.selection = undefined;
423
+ this.children = [];
424
+ },
425
+
426
+ /**
427
+ * INFO: Method is used for integration with Gentics Aloha, has no use otherwise
428
+ * Updates the rangeObject according to the current user selection
429
+ * Method is always called on selection change
430
+ * @param objectClicked Object that triggered the selectionChange event
431
+ * @return true when rangeObject was modified, false otherwise
432
+ * @hide
433
+ */
434
+ onChange: function (objectClicked, event, timeout) {
435
+ if (this.updateSelectionTimeout) {
436
+ window.clearTimeout(this.updateSelectionTimeout);
437
+ }
438
+
439
+ // We have to update the selection in a timeout due to an IE
440
+ // bug that is is caused by selecting some text and then
441
+ // clicking once inside the selection (which collapses the
442
+ // selection inside the previous selection).
443
+ var selection = this;
444
+ this.updateSelectionTimeout = window.setTimeout(function () {
445
+ var range = new Aloha.Selection.SelectionRange(true);
446
+ // We have to work around an IE bug that causes the user
447
+ // selection to be incorrectly set on the body element
448
+ // when the updateSelectionTimeout triggers. The
449
+ // selection corrects itself after waiting a while.
450
+ if (!range.startContainer || 'HTML' === range.startContainer.nodeName || 'BODY' === range.startContainer.nodeName) {
451
+ if (!this.updateSelectionTimeout) {
452
+ // First wait 5 millis, then 20 millis, 50 millis, 110 millis etc.
453
+ selection.onChange(objectClicked, event, 10 + (timeout || 5) * 2);
454
+ }
455
+ return;
456
+ }
457
+ Aloha.Selection._updateSelection(event, range);
458
+ }, timeout || 5);
459
+ },
460
+
461
+ /**
462
+ * prevents the next aloha-selection-changed event from being triggered
463
+ */
464
+ preventSelectionChanged: function () {
465
+ this.preventSelectionChangedFlag = true;
466
+ },
467
+
468
+ /**
469
+ * will return wheter selection change event was prevented or not, and reset the preventSelectionChangedFlag
470
+ * @return {Boolean} true if aloha-selection-change event was prevented
471
+ */
472
+ isSelectionChangedPrevented: function () {
473
+ var prevented = this.preventSelectionChangedFlag;
474
+ this.preventSelectionChangedFlag = false;
475
+ return prevented;
476
+ },
477
+
478
+ /**
479
+ * Checks if the current rangeObject common ancector container is edtiable
480
+ * @return {Boolean} true if current common ancestor is editable
481
+ */
482
+ isSelectionEditable: function () {
483
+ return (this.rangeObject.commonAncestorContainer && jQuery(this.rangeObject.commonAncestorContainer).contentEditable());
484
+ },
485
+
486
+ /**
487
+ * This method checks, if the current rangeObject common ancestor container has a 'data-aloha-floatingmenu-visible' Attribute.
488
+ * Needed in Floating Menu for exceptional display of floatingmenu.
489
+ */
490
+ isFloatingMenuVisible: function () {
491
+ var visible = jQuery(Aloha.Selection.rangeObject.commonAncestorContainer).attr('data-aloha-floatingmenu-visible');
492
+ if (visible !== 'undefined') {
493
+ if (visible === 'true') {
494
+ return true;
495
+ }
496
+ return false;
497
+ }
498
+ return false;
499
+ },
500
+
501
+ /**
502
+ * INFO: Method is used for integration with Gentics Aloha, has no use otherwise
503
+ * Updates the rangeObject according to the current user selection
504
+ * Method is always called on selection change
505
+ * @param event jQuery browser event object
506
+ * @return true when rangeObject was modified, false otherwise
507
+ * @hide
508
+ */
509
+ updateSelection: function (event) {
510
+ return this._updateSelection(event, null);
511
+ },
512
+
513
+ /**
514
+ * Internal version of updateSelection that adds the range parameter to be
515
+ * able to work around an IE bug that caused the current user selection
516
+ * sometimes to be on the body element.
517
+ * @param {Object} event
518
+ * @param {Object} range a substitute for the current user selection. if not provided,
519
+ * the current user selection will be used.
520
+ * @hide
521
+ */
522
+ _updateSelection: function (event, range) {
523
+ if (event && event.originalEvent &&
524
+ true === event.originalEvent.stopSelectionUpdate) {
525
+ return false;
526
+ }
527
+
528
+ if (typeof range === 'undefined') {
529
+ return false;
530
+ }
531
+
532
+ this.rangeObject = range =
533
+ range || new Aloha.Selection.SelectionRange(true);
534
+
535
+ // Determine the common ancestor container and update the selection
536
+ // tree.
537
+ range.update();
538
+
539
+ // Workaround for nasty IE bug that allows the user to select
540
+ // text nodes inside areas with contenteditable "false"
541
+ if (range && range.startContainer && range.endContainer) {
542
+ var inEditable =
543
+ jQuery(range.commonAncestorContainer)
544
+ .closest('.aloha-editable').length > 0;
545
+
546
+ if (inEditable) {
547
+ var validStartPosition = !(3 === range.startContainer.nodeType &&
548
+ !jQuery(range.startContainer.parentNode).contentEditable());
549
+
550
+ var validEndPosition = !(3 === range.endContainer.nodeType &&
551
+ !jQuery(range.endContainer.parentNode).contentEditable());
552
+
553
+ if (!validStartPosition || !validEndPosition) {
554
+ Aloha.getSelection().removeAllRanges();
555
+ return true;
556
+ }
557
+ }
558
+ }
559
+
560
+ // check if aloha-selection-changed event has been prevented
561
+ if (this.isSelectionChangedPrevented()) {
562
+ return true;
563
+ }
564
+
565
+ Aloha.trigger('aloha-selection-changed-before', [this.rangeObject, event]);
566
+
567
+ // throw the event that the selection has changed. Plugins now have the
568
+ // chance to react on the currentElements[childCount].children.lengthged selection
569
+ Aloha.trigger('aloha-selection-changed', [this.rangeObject, event]);
570
+
571
+ triggerSelectionContextChanged(this.rangeObject, event);
572
+
573
+ Aloha.trigger('aloha-selection-changed-after', [this.rangeObject, event]);
574
+
575
+ return true;
576
+ },
577
+
578
+ /**
579
+ * creates an object with x items containing all relevant dom objects.
580
+ * Structure:
581
+ * +
582
+ * |-domobj: <reference to the DOM Object> (NOT jQuery)
583
+ * |-selection: defines if this node is marked by user [none|partial|full]
584
+ * |-children: recursive structure like this ("x.." because it's then shown last in DOM Browsers...)
585
+ * TODO: remove this (was moved to range.js)
586
+ *
587
+ * @param rangeObject "Aloha clean" range object including a commonAncestorContainer
588
+ * @return obj selection
589
+ * @hide
590
+ */
591
+ getSelectionTree: function (rangeObject) {
592
+ if (!rangeObject) { // if called without any parameters, the method acts as getter for this.selectionTree
593
+ return this.rangeObject.getSelectionTree();
594
+ }
595
+ if (!rangeObject.commonAncestorContainer) {
596
+ Aloha.Log.error(this, 'the rangeObject is missing the commonAncestorContainer');
597
+ return false;
598
+ }
599
+
600
+ this.inselection = false;
601
+
602
+ // before getting the selection tree, we do a cleanup
603
+ if (GENTICS.Utils.Dom.doCleanup({ 'merge': true }, rangeObject)) {
604
+ rangeObject.update();
605
+ rangeObject.select();
606
+ }
607
+
608
+ return this.recursiveGetSelectionTree(rangeObject, rangeObject.commonAncestorContainer);
609
+ },
610
+
611
+ /**
612
+ * Recursive inner function for generating the selection tree.
613
+ * TODO: remove this (was moved to range.js)
614
+ * @param rangeObject range object
615
+ * @param currentObject current DOM object for which the selection tree shall be generated
616
+ * @return array of SelectionTree objects for the children of the current DOM object
617
+ * @hide
618
+ */
619
+ recursiveGetSelectionTree: function (rangeObject, currentObject) {
620
+ // get all direct children of the given object
621
+ var jQueryCurrentObject = jQuery(currentObject),
622
+ childCount = 0,
623
+ that = this,
624
+ currentElements = [];
625
+
626
+ jQueryCurrentObject.contents().each(function (index) {
627
+ var selectionType = 'none',
628
+ startOffset = false,
629
+ endOffset = false,
630
+ collapsedFound = false,
631
+ i,
632
+ elementsLength,
633
+ noneFound = false,
634
+ partialFound = false,
635
+ fullFound = false;
636
+
637
+ // check for collapsed selections between nodes
638
+ if (rangeObject.isCollapsed() && currentObject === rangeObject.startContainer && rangeObject.startOffset == index) {
639
+ // insert an extra selectiontree object for the collapsed selection here
640
+ currentElements[childCount] = new Aloha.Selection.SelectionTree();
641
+ currentElements[childCount].selection = 'collapsed';
642
+ currentElements[childCount].domobj = undefined;
643
+ that.inselection = false;
644
+ collapsedFound = true;
645
+ childCount++;
646
+ }
647
+
648
+ if (!that.inselection && !collapsedFound) {
649
+ // the start of the selection was not yet found, so look for it now
650
+ // check whether the start of the selection is found here
651
+
652
+ // Try to read the nodeType property and return if we do not have permission
653
+ // ie.: frame document to an external URL
654
+ var nodeType;
655
+ try {
656
+ nodeType = this.nodeType;
657
+ } catch (e) {
658
+ return;
659
+ }
660
+
661
+ // check is dependent on the node type
662
+ switch (nodeType) {
663
+ case 3:
664
+ // text node
665
+ if (this === rangeObject.startContainer) {
666
+ // the selection starts here
667
+ that.inselection = true;
668
+
669
+ // when the startoffset is > 0, the selection type is only partial
670
+ selectionType = rangeObject.startOffset > 0 ? 'partial' : 'full';
671
+ startOffset = rangeObject.startOffset;
672
+ endOffset = this.length;
673
+ }
674
+ break;
675
+ case 1:
676
+ // element node
677
+ if (this === rangeObject.startContainer && rangeObject.startOffset === 0) {
678
+ // the selection starts here
679
+ that.inselection = true;
680
+ selectionType = 'full';
681
+ }
682
+ if (currentObject === rangeObject.startContainer && rangeObject.startOffset === index) {
683
+ // the selection starts here
684
+ that.inselection = true;
685
+ selectionType = 'full';
686
+ }
687
+ break;
688
+ }
689
+ }
690
+
691
+ if (that.inselection && !collapsedFound) {
692
+ if (selectionType == 'none') {
693
+ selectionType = 'full';
694
+ }
695
+ // we already found the start of the selection, so look for the end of the selection now
696
+ // check whether the end of the selection is found here
697
+
698
+ switch (this.nodeType) {
699
+ case 3:
700
+ // text node
701
+ if (this === rangeObject.endContainer) {
702
+ // the selection ends here
703
+ that.inselection = false;
704
+
705
+ // check for partial selection here
706
+ if (rangeObject.endOffset < this.length) {
707
+ selectionType = 'partial';
708
+ }
709
+ if (startOffset === false) {
710
+ startOffset = 0;
711
+ }
712
+ endOffset = rangeObject.endOffset;
713
+ }
714
+ break;
715
+ case 1:
716
+ // element node
717
+ if (this === rangeObject.endContainer && rangeObject.endOffset === 0) {
718
+ that.inselection = false;
719
+ }
720
+ break;
721
+ }
722
+ if (currentObject === rangeObject.endContainer && rangeObject.endOffset <= index) {
723
+ that.inselection = false;
724
+ selectionType = 'none';
725
+ }
726
+ }
727
+
728
+ // create the current selection tree entry
729
+ currentElements[childCount] = new Aloha.Selection.SelectionTree();
730
+ currentElements[childCount].domobj = this;
731
+ currentElements[childCount].selection = selectionType;
732
+ if (selectionType == 'partial') {
733
+ currentElements[childCount].startOffset = startOffset;
734
+ currentElements[childCount].endOffset = endOffset;
735
+ }
736
+
737
+ // now do the recursion step into the current object
738
+ currentElements[childCount].children = that.recursiveGetSelectionTree(rangeObject, this);
739
+ elementsLength = currentElements[childCount].children.length;
740
+
741
+ // check whether a selection was found within the children
742
+ if (elementsLength > 0) {
743
+ for (i = 0; i < elementsLength; ++i) {
744
+ switch (currentElements[childCount].children[i].selection) {
745
+ case 'none':
746
+ noneFound = true;
747
+ break;
748
+ case 'full':
749
+ fullFound = true;
750
+ break;
751
+ case 'partial':
752
+ partialFound = true;
753
+ break;
754
+ }
755
+ }
756
+
757
+ if (partialFound || (fullFound && noneFound)) {
758
+ // found at least one 'partial' selection in the children, or both 'full' and 'none', so this element is also 'partial' selected
759
+ currentElements[childCount].selection = 'partial';
760
+ } else if (fullFound && !partialFound && !noneFound) {
761
+ // only found 'full' selected children, so this element is also 'full' selected
762
+ currentElements[childCount].selection = 'full';
763
+ }
764
+ }
765
+
766
+ childCount++;
767
+ });
768
+
769
+ // extra check for collapsed selections at the end of the current element
770
+ if (rangeObject.isCollapsed() && currentObject === rangeObject.startContainer && rangeObject.startOffset == currentObject.childNodes.length) {
771
+ currentElements[childCount] = new Aloha.Selection.SelectionTree();
772
+ currentElements[childCount].selection = 'collapsed';
773
+ currentElements[childCount].domobj = undefined;
774
+ }
775
+
776
+ return currentElements;
777
+ },
778
+
779
+ /**
780
+ * Get the currently selected range
781
+ * @return {Aloha.Selection.SelectionRange} currently selected range
782
+ * @method
783
+ */
784
+ getRangeObject: function () {
785
+ return this.rangeObject;
786
+ },
787
+
788
+ /**
789
+ * method finds out, if a node is within a certain markup or not
790
+ * @param rangeObj Aloha rangeObject
791
+ * @param startOrEnd boolean; defines, if start or endContainer should be used: false for start, true for end
792
+ * @param markupObject jQuery object of the markup to look for
793
+ * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
794
+ * @param limitObject dom object which limits the search are within the dom. normally this will be the active Editable
795
+ * @return true, if the markup is effective on the range objects start or end node
796
+ * @hide
797
+ */
798
+ isRangeObjectWithinMarkup: function (rangeObject, startOrEnd, markupObject, tagComparator, limitObject) {
799
+ var domObj = !startOrEnd ? rangeObject.startContainer : rangeObject.endContainer,
800
+ that = this,
801
+ parents = jQuery(domObj).parents(),
802
+ returnVal = false,
803
+ i = -1;
804
+
805
+ // check if a comparison method was passed as parameter ...
806
+ if (typeof tagComparator !== 'undefined' && typeof tagComparator !== 'function') {
807
+ Aloha.Log.error(this, 'parameter tagComparator is not a function');
808
+ }
809
+ // ... if not use this as standard tag comparison method
810
+ if (typeof tagComparator === 'undefined') {
811
+ tagComparator = function (domobj, markupObject) {
812
+ return that.standardTextLevelSemanticsComparator(domobj, markupObject); // TODO should actually be this.getStandardTagComparator(markupObject)
813
+ };
814
+ }
815
+
816
+ if (parents.length > 0) {
817
+ parents.each(function () {
818
+ // the limit object was reached (normally the Editable Element)
819
+ if (this === limitObject) {
820
+ Aloha.Log.debug(that, 'reached limit dom obj');
821
+ return false; // break() of jQuery .each(); THIS IS NOT THE FUNCTION RETURN VALUE
822
+ }
823
+ if (tagComparator(this, markupObject)) {
824
+ if (returnVal === false) {
825
+ returnVal = [];
826
+ }
827
+ Aloha.Log.debug(that, 'reached object equal to markup');
828
+ i++;
829
+ returnVal[i] = this;
830
+ return true; // continue() of jQuery .each(); THIS IS NOT THE FUNCTION RETURN VALUE
831
+ }
832
+ });
833
+ }
834
+ return returnVal;
835
+ },
836
+
837
+ /**
838
+ * standard method, to compare a domobj and a jquery object for sections and grouping content (e.g. p, h1, h2, ul, ....).
839
+ * is always used when no other tag comparator is passed as parameter
840
+ * @param domobj domobject to compare with markup
841
+ * @param markupObject jQuery object of the markup to compare with domobj
842
+ * @return true if objects are equal and false if not
843
+ * @hide
844
+ */
845
+ standardSectionsAndGroupingContentComparator: function (domobj, markupObject) {
846
+ if (domobj.nodeType !== 1) {
847
+ Aloha.Log.debug(this, 'only element nodes (nodeType == 1) can be compared');
848
+ return false;
849
+ }
850
+ if (!markupObject[0].nodeName) {
851
+ return false;
852
+ }
853
+ var elemMap = Aloha.Selection.replacingElements[domobj.nodeName.toLowerCase()];
854
+ return elemMap && elemMap[markupObject[0].nodeName.toLowerCase()];
855
+ },
856
+
857
+ /**
858
+ * standard method, to compare a domobj and a jquery object for their tagName (aka span elements, e.g. b, i, sup, span, ...).
859
+ * is always used when no other tag comparator is passed as parameter
860
+ * @param domobj domobject to compare with markup
861
+ * @param markupObject jQuery object of the markup to compare with domobj
862
+ * @return true if objects are equal and false if not
863
+ * @hide
864
+ */
865
+ standardTagNameComparator: function (domobj, markupObject) {
866
+ if (domobj.nodeType === 1) {
867
+ if (domobj.nodeName != markupObject[0].nodeName) {
868
+ return false;
869
+ }
870
+ return true;
871
+ }
872
+ Aloha.Log.debug(this, 'only element nodes (nodeType == 1) can be compared');
873
+ return false;
874
+ },
875
+
876
+ /**
877
+ * standard method, to compare a domobj and a jquery object for text level semantics (aka span elements, e.g. b, i, sup, span, ...).
878
+ * is always used when no other tag comparator is passed as parameter
879
+ * @param domobj domobject to compare with markup
880
+ * @param markupObject jQuery object of the markup to compare with domobj
881
+ * @return true if objects are equal and false if not
882
+ * @hide
883
+ */
884
+ standardTextLevelSemanticsComparator: function (domobj, markupObject) {
885
+ // only element nodes can be compared
886
+ if (domobj.nodeType === 1) {
887
+ if (domobj.nodeName != markupObject[0].nodeName) {
888
+ return false;
889
+ }
890
+ if (!this.standardAttributesComparator(domobj, markupObject)) {
891
+ return false;
892
+ }
893
+ return true;
894
+ }
895
+ Aloha.Log.debug(this, 'only element nodes (nodeType == 1) can be compared');
896
+ return false;
897
+ },
898
+
899
+
900
+ /**
901
+ * standard method, to compare attributes of one dom obj and one markup obj (jQuery)
902
+ * @param domobj domobject to compare with markup
903
+ * @param markupObject jQuery object of the markup to compare with domobj
904
+ * @return true if objects are equal and false if not
905
+ * @hide
906
+ */
907
+ standardAttributesComparator: function (domobj, markupObject) {
908
+ var classesA = Strings.words((domobj && domobj.className) || '');
909
+ var classesB = Strings.words((markupObject.length && markupObject[0].className) || '');
910
+ Arrays.sortUnique(classesA);
911
+ Arrays.sortUnique(classesB);
912
+ return Arrays.equal(classesA, classesB);
913
+ },
914
+
915
+ /**
916
+ * method finds out, if a node is within a certain markup or not
917
+ * @param rangeObj Aloha rangeObject
918
+ * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
919
+ * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
920
+ * @return void; TODO: should return true if the markup applied successfully and false if not
921
+ * @hide
922
+ */
923
+ changeMarkup: function (rangeObject, markupObject, tagComparator) {
924
+ var tagName = markupObject[0].tagName.toLowerCase(),
925
+ newCAC,
926
+ limitObject,
927
+ backupRangeObject,
928
+ relevantMarkupObjectsAtSelectionStart = this.isRangeObjectWithinMarkup(rangeObject, false, markupObject, tagComparator, limitObject),
929
+ relevantMarkupObjectsAtSelectionEnd = this.isRangeObjectWithinMarkup(rangeObject, true, markupObject, tagComparator, limitObject),
930
+ nextSibling,
931
+ relevantMarkupObjectAfterSelection,
932
+ prevSibling,
933
+ relevantMarkupObjectBeforeSelection,
934
+ extendedRangeObject;
935
+ var parentElement;
936
+
937
+ // if the element is a replacing element (like p/h1/h2/h3/h4/h5/h6...), which must not wrap each other
938
+ // use a clone of rangeObject
939
+ if (this.replacingElements[tagName]) {
940
+ // backup rangeObject for later selection;
941
+ backupRangeObject = rangeObject;
942
+
943
+ // create a new range object to not modify the orginal
944
+ rangeObject = new this.SelectionRange(rangeObject);
945
+
946
+ // either select the active Editable as new commonAncestorContainer (CAC) or use the body
947
+ if (Aloha.activeEditable) {
948
+ newCAC = Aloha.activeEditable.obj.get(0);
949
+ } else {
950
+ newCAC = jQuery('body');
951
+ }
952
+ // update rangeObject by setting the newCAC and automatically recalculating the selectionTree
953
+ rangeObject.update(newCAC);
954
+
955
+ // store the information, that the markupObject can be replaced (not must be!!) inside the jQuery markup object
956
+ markupObject.isReplacingElement = true;
957
+ } else {
958
+ // if the element is NOT a replacing element, then something needs to be selected, otherwise it can not be wrapped
959
+ // therefor the method can return false, if nothing is selected ( = rangeObject is collapsed)
960
+ if (rangeObject.isCollapsed()) {
961
+ Aloha.Log.debug(this, 'early returning from applying markup because nothing is currently selected');
962
+ return false;
963
+ }
964
+ }
965
+
966
+ // is Start/End DOM Obj inside the markup to change
967
+ if (Aloha.activeEditable) {
968
+ limitObject = Aloha.activeEditable.obj[0];
969
+ } else {
970
+ limitObject = jQuery('body');
971
+ }
972
+
973
+ if (!markupObject.isReplacingElement && rangeObject.startOffset === 0) { // don't care about replacers, because they never extend
974
+ if (null != (prevSibling = this.getTextNodeSibling(false, rangeObject.commonAncestorContainer.parentNode, rangeObject.startContainer))) {
975
+ relevantMarkupObjectBeforeSelection = this.isRangeObjectWithinMarkup({
976
+ startContainer: prevSibling,
977
+ startOffset: 0
978
+ }, false, markupObject, tagComparator, limitObject);
979
+ }
980
+ }
981
+ if (!markupObject.isReplacingElement && (rangeObject.endOffset === rangeObject.endContainer.length)) { // don't care about replacers, because they never extend
982
+ if (null != (nextSibling = this.getTextNodeSibling(true, rangeObject.commonAncestorContainer.parentNode, rangeObject.endContainer))) {
983
+ relevantMarkupObjectAfterSelection = this.isRangeObjectWithinMarkup({
984
+ startContainer: nextSibling,
985
+ startOffset: 0
986
+ }, false, markupObject, tagComparator, limitObject);
987
+ }
988
+ }
989
+
990
+ // decide what to do (expand or reduce markup)
991
+ // Alternative A: from markup to no-markup: markup will be removed in selection;
992
+ // reapplied from original markup start to selection start
993
+ if (!markupObject.isReplacingElement && (relevantMarkupObjectsAtSelectionStart && !relevantMarkupObjectsAtSelectionEnd)) {
994
+ Aloha.Log.info(this, 'markup 2 non-markup');
995
+ this.prepareForRemoval(rangeObject.getSelectionTree(), markupObject, tagComparator);
996
+ jQuery(relevantMarkupObjectsAtSelectionStart).addClass('preparedForRemoval');
997
+ this.insertCroppedMarkups(relevantMarkupObjectsAtSelectionStart, rangeObject, false, tagComparator);
998
+ } else if (!markupObject.isReplacingElement && relevantMarkupObjectsAtSelectionStart && relevantMarkupObjectsAtSelectionEnd) {
999
+ // Alternative B: from markup to markup:
1000
+ // remove selected markup (=split existing markup if single, shrink if two different)
1001
+ Aloha.Log.info(this, 'markup 2 markup');
1002
+ this.prepareForRemoval(rangeObject.getSelectionTree(), markupObject, tagComparator);
1003
+ this.splitRelevantMarkupObject(relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd, rangeObject, tagComparator);
1004
+ } else if (!markupObject.isReplacingElement && ((!relevantMarkupObjectsAtSelectionStart && relevantMarkupObjectsAtSelectionEnd) || relevantMarkupObjectAfterSelection || relevantMarkupObjectBeforeSelection)) { //
1005
+ // Alternative C: from no-markup to markup OR with next2markup:
1006
+ // new markup is wrapped from selection start to end of originalmarkup, original is remove afterwards
1007
+ Aloha.Log.info(this, 'non-markup 2 markup OR with next2markup');
1008
+ // move end of rangeObject to end of relevant markups
1009
+ if (relevantMarkupObjectBeforeSelection && relevantMarkupObjectAfterSelection) {
1010
+ extendedRangeObject = new Aloha.Selection.SelectionRange(rangeObject);
1011
+ extendedRangeObject.startContainer = jQuery(relevantMarkupObjectBeforeSelection[relevantMarkupObjectBeforeSelection.length - 1]).textNodes()[0];
1012
+ extendedRangeObject.startOffset = 0;
1013
+ extendedRangeObject.endContainer = jQuery(relevantMarkupObjectAfterSelection[relevantMarkupObjectAfterSelection.length - 1]).textNodes().last()[0];
1014
+ extendedRangeObject.endOffset = extendedRangeObject.endContainer.length;
1015
+ extendedRangeObject.update();
1016
+ this.applyMarkup(extendedRangeObject.getSelectionTree(), rangeObject, markupObject, tagComparator);
1017
+ Aloha.Log.info(this, 'double extending previous markup(previous and after selection), actually wrapping it ...');
1018
+
1019
+ } else if (relevantMarkupObjectBeforeSelection && !relevantMarkupObjectAfterSelection && !relevantMarkupObjectsAtSelectionEnd) {
1020
+ this.extendExistingMarkupWithSelection(relevantMarkupObjectBeforeSelection, rangeObject, false, tagComparator);
1021
+ Aloha.Log.info(this, 'extending previous markup');
1022
+
1023
+ } else if (relevantMarkupObjectBeforeSelection && !relevantMarkupObjectAfterSelection && relevantMarkupObjectsAtSelectionEnd) {
1024
+ extendedRangeObject = new Aloha.Selection.SelectionRange(rangeObject);
1025
+ extendedRangeObject.startContainer = jQuery(relevantMarkupObjectBeforeSelection[relevantMarkupObjectBeforeSelection.length - 1]).textNodes()[0];
1026
+ extendedRangeObject.startOffset = 0;
1027
+ extendedRangeObject.endContainer = jQuery(relevantMarkupObjectsAtSelectionEnd[relevantMarkupObjectsAtSelectionEnd.length - 1]).textNodes().last()[0];
1028
+ extendedRangeObject.endOffset = extendedRangeObject.endContainer.length;
1029
+ extendedRangeObject.update();
1030
+ this.applyMarkup(extendedRangeObject.getSelectionTree(), rangeObject, markupObject, tagComparator);
1031
+ Aloha.Log.info(this, 'double extending previous markup(previous and relevant at the end), actually wrapping it ...');
1032
+
1033
+ } else if (!relevantMarkupObjectBeforeSelection && relevantMarkupObjectAfterSelection) {
1034
+ this.extendExistingMarkupWithSelection(relevantMarkupObjectAfterSelection, rangeObject, true, tagComparator);
1035
+ Aloha.Log.info(this, 'extending following markup backwards');
1036
+
1037
+ } else {
1038
+ this.extendExistingMarkupWithSelection(relevantMarkupObjectsAtSelectionEnd, rangeObject, true, tagComparator);
1039
+ }
1040
+ } else if (markupObject.isReplacingElement || (!relevantMarkupObjectsAtSelectionStart && !relevantMarkupObjectsAtSelectionEnd && !relevantMarkupObjectBeforeSelection && !relevantMarkupObjectAfterSelection)) {
1041
+ // Alternative D: no-markup to no-markup: easy
1042
+ Aloha.Log.info(this, 'non-markup 2 non-markup');
1043
+
1044
+ // workaround to keep the caret at the right position if it's an empty element
1045
+ // applyMarkup was not working correctly and has a lot of overhead we don't need in that case
1046
+ if (isCollapsedAndEmptyOrEndBr(rangeObject)) {
1047
+ var newMarkup = markupObject.clone();
1048
+
1049
+ if (isCollapsedAndEndBr(rangeObject)) {
1050
+ newMarkup[0].appendChild(Engine.createEndBreak());
1051
+ }
1052
+
1053
+ // setting the focus is needed for mozilla and IE 7 to have a working rangeObject.select()
1054
+ if (Aloha.activeEditable && jQuery.browser.mozilla) {
1055
+ Aloha.activeEditable.obj.focus();
1056
+ }
1057
+
1058
+ if (Engine.isEditable(rangeObject.startContainer)) {
1059
+ Engine.copyAttributes(rangeObject.startContainer, newMarkup[0]);
1060
+ jQuery(rangeObject.startContainer).after(newMarkup[0]).remove();
1061
+ } else if (Engine.isEditingHost(rangeObject.startContainer)) {
1062
+ jQuery(rangeObject.startContainer).append(newMarkup[0]);
1063
+ Engine.ensureContainerEditable(newMarkup[0]);
1064
+ }
1065
+
1066
+ backupRangeObject.startContainer = newMarkup[0];
1067
+ backupRangeObject.endContainer = newMarkup[0];
1068
+ backupRangeObject.startOffset = 0;
1069
+ backupRangeObject.endOffset = 0;
1070
+ return;
1071
+ }
1072
+ this.applyMarkup(rangeObject.getSelectionTree(), rangeObject, markupObject, tagComparator, {
1073
+ setRangeObject2NewMarkup: true
1074
+ });
1075
+ backupRangeObject.startContainer = rangeObject.startContainer;
1076
+ backupRangeObject.endContainer = rangeObject.endContainer;
1077
+ backupRangeObject.startOffset = rangeObject.startOffset;
1078
+ backupRangeObject.endOffset = rangeObject.endOffset;
1079
+ }
1080
+
1081
+ if (markupObject.isReplacingElement) {
1082
+ //Check if the startContainer is one of the zapped elements
1083
+ if (backupRangeObject && backupRangeObject.startContainer.className && backupRangeObject.startContainer.className.indexOf('preparedForRemoval') > -1) {
1084
+ //var parentElement = jQuery(backupRangeObject.startContainer).closest(markupObject[0].tagName).get(0);
1085
+ parentElement = jQuery(backupRangeObject.startContainer).parents(markupObject[0].tagName).get(0);
1086
+ backupRangeObject.startContainer = parentElement;
1087
+ rangeObject.startContainer = parentElement;
1088
+ }
1089
+ //check if the endContainer is one of the zapped elements
1090
+ if (backupRangeObject && backupRangeObject.endContainer.className && backupRangeObject.endContainer.className.indexOf('preparedForRemoval') > -1) {
1091
+ //var parentElement = jQuery(backupRangeObject.endContainer).closest(markupObject[0].tagName).get(0);
1092
+ parentElement = jQuery(backupRangeObject.endContainer).parents(markupObject[0].tagName).get(0);
1093
+ backupRangeObject.endContainer = parentElement;
1094
+ rangeObject.endContainer = parentElement;
1095
+ }
1096
+ }
1097
+ // remove all marked items
1098
+ jQuery('.preparedForRemoval').zap();
1099
+
1100
+ // recalculate cac and selectionTree
1101
+
1102
+ // update selection
1103
+ if (markupObject.isReplacingElement) {
1104
+ //After the zapping we have to check for wrong offsets
1105
+ if (e5s.Node.ELEMENT_NODE === backupRangeObject.startContainer.nodeType && backupRangeObject.startContainer.childNodes && backupRangeObject.startContainer.childNodes.length < backupRangeObject.startOffset) {
1106
+ backupRangeObject.startOffset = backupRangeObject.startContainer.childNodes.length;
1107
+ rangeObject.startOffset = backupRangeObject.startContainer.childNodes.length;
1108
+ }
1109
+ if (e5s.Node.ELEMENT_NODE === backupRangeObject.endContainer.nodeType && backupRangeObject.endContainer.childNodes && backupRangeObject.endContainer.childNodes.length < backupRangeObject.endOffset) {
1110
+ backupRangeObject.endOffset = backupRangeObject.endContainer.childNodes.length;
1111
+ rangeObject.endOffset = backupRangeObject.endContainer.childNodes.length;
1112
+ }
1113
+ rangeObject.endContainer = backupRangeObject.endContainer;
1114
+ rangeObject.endOffset = backupRangeObject.endOffset;
1115
+ rangeObject.startContainer = backupRangeObject.startContainer;
1116
+ rangeObject.startOffset = backupRangeObject.startOffset;
1117
+ backupRangeObject.update();
1118
+ backupRangeObject.select();
1119
+ } else {
1120
+ rangeObject.update();
1121
+ rangeObject.select();
1122
+ }
1123
+ },
1124
+
1125
+ /**
1126
+ * method compares a JS array of domobjects with a range object and decides, if the rangeObject spans the whole markup objects. method is used to decide if a markup2markup selection can be completely remove or if it must be splitted into 2 separate markups
1127
+ * @param relevantMarkupObjectsAtSelectionStart JS Array of dom objects, which are parents to the rangeObject.startContainer
1128
+ * @param relevantMarkupObjectsAtSelectionEnd JS Array of dom objects, which are parents to the rangeObject.endContainer
1129
+ * @param rangeObj Aloha rangeObject
1130
+ * @return true, if rangeObjects and markup objects are identical, false otherwise
1131
+ * @hide
1132
+ */
1133
+ areMarkupObjectsAsLongAsRangeObject: function (relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd, rangeObject) {
1134
+ var i, el, textNode, relMarkupEnd, relMarkupStart;
1135
+
1136
+ if (rangeObject.startOffset !== 0) {
1137
+ return false;
1138
+ }
1139
+
1140
+ for (i = 0, relMarkupStart = relevantMarkupObjectsAtSelectionStart.length; i < relMarkupStart; i++) {
1141
+ el = jQuery(relevantMarkupObjectsAtSelectionStart[i]);
1142
+ if (el.textNodes().first()[0] !== rangeObject.startContainer) {
1143
+ return false;
1144
+ }
1145
+ }
1146
+
1147
+ for (i = 0, relMarkupEnd = relevantMarkupObjectsAtSelectionEnd.length; i < relMarkupEnd; i++) {
1148
+ el = jQuery(relevantMarkupObjectsAtSelectionEnd[i]);
1149
+ textNode = el.textNodes().last()[0];
1150
+ if (textNode !== rangeObject.endContainer || textNode.length != rangeObject.endOffset) {
1151
+ return false;
1152
+ }
1153
+ }
1154
+
1155
+ return true;
1156
+ },
1157
+
1158
+ /**
1159
+ * method used to remove/split markup from a "markup2markup" selection
1160
+ * @param relevantMarkupObjectsAtSelectionStart JS Array of dom objects, which are parents to the rangeObject.startContainer
1161
+ * @param relevantMarkupObjectsAtSelectionEnd JS Array of dom objects, which are parents to the rangeObject.endContainer
1162
+ * @param rangeObj Aloha rangeObject
1163
+ * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1164
+ * @return true (always, since no "false" case is currently known...but might be added)
1165
+ * @hide
1166
+ */
1167
+ splitRelevantMarkupObject: function (relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd, rangeObject, tagComparator) {
1168
+ // mark them to be deleted
1169
+ jQuery(relevantMarkupObjectsAtSelectionStart).addClass('preparedForRemoval');
1170
+ jQuery(relevantMarkupObjectsAtSelectionEnd).addClass('preparedForRemoval');
1171
+
1172
+ // check if the rangeObject is identical with the relevantMarkupObjects (in this case the markup can simply be removed)
1173
+ if (this.areMarkupObjectsAsLongAsRangeObject(relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd, rangeObject)) {
1174
+ return true;
1175
+ }
1176
+
1177
+ // find intersection (this can always only be one dom element (namely the highest) because all others will be removed
1178
+ var relevantMarkupObjectAtSelectionStartAndEnd = this.intersectRelevantMarkupObjects(relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd);
1179
+
1180
+ if (relevantMarkupObjectAtSelectionStartAndEnd) {
1181
+ this.insertCroppedMarkups([relevantMarkupObjectAtSelectionStartAndEnd], rangeObject, false, tagComparator);
1182
+ this.insertCroppedMarkups([relevantMarkupObjectAtSelectionStartAndEnd], rangeObject, true, tagComparator);
1183
+ } else {
1184
+ this.insertCroppedMarkups(relevantMarkupObjectsAtSelectionStart, rangeObject, false, tagComparator);
1185
+ this.insertCroppedMarkups(relevantMarkupObjectsAtSelectionEnd, rangeObject, true, tagComparator);
1186
+ }
1187
+ return true;
1188
+ },
1189
+
1190
+ /**
1191
+ * method takes two arrays of bottom up dom objects, compares them and returns either the object closest to the root or false
1192
+ * @param relevantMarkupObjectsAtSelectionStart JS Array of dom objects
1193
+ * @param relevantMarkupObjectsAtSelectionEnd JS Array of dom objects
1194
+ * @return dom object closest to the root or false
1195
+ * @hide
1196
+ */
1197
+ intersectRelevantMarkupObjects: function (relevantMarkupObjectsAtSelectionStart, relevantMarkupObjectsAtSelectionEnd) {
1198
+ var intersection = false, i, elStart, j, elEnd, relMarkupStart, relMarkupEnd;
1199
+ if (!relevantMarkupObjectsAtSelectionStart || !relevantMarkupObjectsAtSelectionEnd) {
1200
+ return intersection; // we can only intersect, if we have to arrays!
1201
+ }
1202
+ relMarkupStart = relevantMarkupObjectsAtSelectionStart.length;
1203
+ relMarkupEnd = relevantMarkupObjectsAtSelectionEnd.length;
1204
+ for (i = 0; i < relMarkupStart; i++) {
1205
+ elStart = relevantMarkupObjectsAtSelectionStart[i];
1206
+ for (j = 0; j < relMarkupEnd; j++) {
1207
+ elEnd = relevantMarkupObjectsAtSelectionEnd[j];
1208
+ if (elStart === elEnd) {
1209
+ intersection = elStart;
1210
+ }
1211
+ }
1212
+ }
1213
+ return intersection;
1214
+ },
1215
+
1216
+ /**
1217
+ * method used to add markup to a nonmarkup2markup selection
1218
+ * @param relevantMarkupObjects JS Array of dom objects effecting either the start or endContainer of a selection (which should be extended)
1219
+ * @param rangeObject Aloha rangeObject the markups should be extended to
1220
+ * @param startOrEnd boolean; defines, if the existing markups should be extended forwards or backwards (is propably redundant and could be found out by comparing start or end container with the markup array dom objects)
1221
+ * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1222
+ * @return true
1223
+ * @hide
1224
+ */
1225
+ extendExistingMarkupWithSelection: function (relevantMarkupObjects, rangeObject, startOrEnd, tagComparator) {
1226
+ var extendMarkupsAtStart, extendMarkupsAtEnd, objects, i, relMarkupLength, el, textnodes, nodeNr;
1227
+ if (!startOrEnd) { // = Start
1228
+ // start part of rangeObject should be used, therefor existing markups are cropped at the end
1229
+ extendMarkupsAtStart = true;
1230
+ }
1231
+ if (startOrEnd) { // = End
1232
+ // end part of rangeObject should be used, therefor existing markups are cropped at start (beginning)
1233
+ extendMarkupsAtEnd = true;
1234
+ }
1235
+ objects = [];
1236
+ for (i = 0, relMarkupLength = relevantMarkupObjects.length; i < relMarkupLength; i++) {
1237
+ objects[i] = new this.SelectionRange();
1238
+ el = relevantMarkupObjects[i];
1239
+ if (extendMarkupsAtEnd && !extendMarkupsAtStart) {
1240
+ objects[i].startContainer = rangeObject.startContainer; // jQuery(el).contents()[0];
1241
+ objects[i].startOffset = rangeObject.startOffset;
1242
+ textnodes = jQuery(el).textNodes(true);
1243
+
1244
+ nodeNr = textnodes.length - 1;
1245
+ objects[i].endContainer = textnodes[nodeNr];
1246
+ objects[i].endOffset = textnodes[nodeNr].length;
1247
+ objects[i].update();
1248
+ this.applyMarkup(objects[i].getSelectionTree(), rangeObject, this.getClonedMarkup4Wrapping(el), tagComparator, {
1249
+ setRangeObject2NewMarkup: true
1250
+ });
1251
+ }
1252
+ if (!extendMarkupsAtEnd && extendMarkupsAtStart) {
1253
+ textnodes = jQuery(el).textNodes(true);
1254
+ objects[i].startContainer = textnodes[0]; // jQuery(el).contents()[0];
1255
+ objects[i].startOffset = 0;
1256
+ objects[i].endContainer = rangeObject.endContainer;
1257
+ objects[i].endOffset = rangeObject.endOffset;
1258
+ objects[i].update();
1259
+ this.applyMarkup(objects[i].getSelectionTree(), rangeObject, this.getClonedMarkup4Wrapping(el), tagComparator, {
1260
+ setRangeObject2NewMarkup: true
1261
+ });
1262
+ }
1263
+ }
1264
+ return true;
1265
+ },
1266
+
1267
+ /**
1268
+ * method creates an empty markup jQuery object from a dom object passed as paramter
1269
+ * @param domobj domobject to be cloned, cleaned and emptied
1270
+ * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1271
+ * @return jQuery wrapper object to be passed to e.g. this.applyMarkup(...)
1272
+ * @hide
1273
+ */
1274
+ getClonedMarkup4Wrapping: function (domobj) {
1275
+ var wrapper = jQuery(domobj.outerHTML).removeClass('preparedForRemoval').empty();
1276
+ if (wrapper.attr('class').length === 0) {
1277
+ wrapper.removeAttr('class');
1278
+ }
1279
+ return wrapper;
1280
+ },
1281
+
1282
+ /**
1283
+ * method used to subtract the range object from existing markup. in other words: certain markup is removed from the selections defined by the rangeObject
1284
+ * @param relevantMarkupObjects JS Array of dom objects effecting either the start or endContainer of a selection (which should be extended)
1285
+ * @param rangeObject Aloha rangeObject the markups should be removed from
1286
+ * @param startOrEnd boolean; defines, if the existing markups should be reduced at the beginning of the tag or at the end (is propably redundant and could be found out by comparing start or end container with the markup array dom objects)
1287
+ * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1288
+ * @return true
1289
+ * @hide
1290
+ */
1291
+ insertCroppedMarkups: function (relevantMarkupObjects, rangeObject, startOrEnd, tagComparator) {
1292
+ var cropMarkupsAtEnd, cropMarkupsAtStart, textnodes, objects, i, el, textNodes;
1293
+ if (!startOrEnd) { // = Start
1294
+ // start part of rangeObject should be used, therefor existing markups are cropped at the end
1295
+ cropMarkupsAtEnd = true;
1296
+ } else { // = End
1297
+ // end part of rangeObject should be used, therefor existing markups are cropped at start (beginning)
1298
+ cropMarkupsAtStart = true;
1299
+ }
1300
+ objects = [];
1301
+ for (i = 0; i < relevantMarkupObjects.length; i++) {
1302
+ objects[i] = new this.SelectionRange();
1303
+ el = relevantMarkupObjects[i];
1304
+ if (cropMarkupsAtEnd && !cropMarkupsAtStart) {
1305
+ textNodes = jQuery(el).textNodes(true);
1306
+ objects[i].startContainer = textNodes[0];
1307
+ objects[i].startOffset = 0;
1308
+ // if the existing markup startContainer & startOffset are equal to the rangeObject startContainer and startOffset,
1309
+ // then markupobject does not have to be added again, because it would have no content (zero-length)
1310
+ if (objects[i].startContainer === rangeObject.startContainer && objects[i].startOffset === rangeObject.startOffset) {
1311
+ continue;
1312
+ }
1313
+ if (rangeObject.startOffset === 0) {
1314
+ objects[i].endContainer = this.getTextNodeSibling(false, el, rangeObject.startContainer);
1315
+ objects[i].endOffset = objects[i].endContainer.length;
1316
+ } else {
1317
+ objects[i].endContainer = rangeObject.startContainer;
1318
+ objects[i].endOffset = rangeObject.startOffset;
1319
+ }
1320
+
1321
+ objects[i].update();
1322
+
1323
+ this.applyMarkup(objects[i].getSelectionTree(), rangeObject, this.getClonedMarkup4Wrapping(el), tagComparator, {
1324
+ setRangeObject2NextSibling: true
1325
+ });
1326
+ }
1327
+
1328
+ if (!cropMarkupsAtEnd && cropMarkupsAtStart) {
1329
+ objects[i].startContainer = rangeObject.endContainer; // jQuery(el).contents()[0];
1330
+ objects[i].startOffset = rangeObject.endOffset;
1331
+ textnodes = jQuery(el).textNodes(true);
1332
+ objects[i].endContainer = textnodes[textnodes.length - 1];
1333
+ objects[i].endOffset = textnodes[textnodes.length - 1].length;
1334
+ objects[i].update();
1335
+ this.applyMarkup(objects[i].getSelectionTree(), rangeObject, this.getClonedMarkup4Wrapping(el), tagComparator, {
1336
+ setRangeObject2PreviousSibling: true
1337
+ });
1338
+ }
1339
+ }
1340
+ return true;
1341
+ },
1342
+
1343
+ /**
1344
+ * apply a certain markup to the current selection
1345
+ * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1346
+ * @return void
1347
+ * @hide
1348
+ */
1349
+ changeMarkupOnSelection: function (markupObject) {
1350
+ var rangeObject = this.getRangeObject();
1351
+
1352
+ // change the markup
1353
+ this.changeMarkup(rangeObject, markupObject, this.getStandardTagComparator(markupObject));
1354
+
1355
+ // merge text nodes
1356
+ GENTICS.Utils.Dom.doCleanup({
1357
+ 'merge': true
1358
+ }, rangeObject);
1359
+
1360
+ // update the range and select it
1361
+ rangeObject.update();
1362
+ rangeObject.select();
1363
+ this.rangeObject = rangeObject;
1364
+ },
1365
+
1366
+ /**
1367
+ * apply a certain markup to the selection Tree
1368
+ * @param selectionTree SelectionTree Object markup should be applied to
1369
+ * @param rangeObject Aloha rangeObject which will be modified to reflect the dom changes, after the markup was applied (only if activated via options)
1370
+ * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1371
+ * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1372
+ * @param options JS object, with the following boolean properties: setRangeObject2NewMarkup, setRangeObject2NextSibling, setRangeObject2PreviousSibling
1373
+ * @return void
1374
+ * @hide
1375
+ */
1376
+ applyMarkup: function (selectionTree, rangeObject, markupObject, tagComparator, options) {
1377
+ var optimizedSelectionTree, i, el, breakpoint;
1378
+ options = options || {};
1379
+ // first same tags from within fully selected nodes for removal
1380
+ this.prepareForRemoval(selectionTree, markupObject, tagComparator);
1381
+
1382
+ // first let's optimize the selection Tree in useful groups which can be wrapped together
1383
+ optimizedSelectionTree = this.optimizeSelectionTree4Markup(selectionTree, markupObject, tagComparator);
1384
+ breakpoint = true;
1385
+
1386
+ // now iterate over grouped elements and either recursively dive into object or wrap it as a whole
1387
+ for (i = 0; i < optimizedSelectionTree.length; i++) {
1388
+ el = optimizedSelectionTree[i];
1389
+ if (el.wrappable) {
1390
+ this.wrapMarkupAroundSelectionTree(el.elements, rangeObject, markupObject, tagComparator, options);
1391
+ } else {
1392
+ Aloha.Log.debug(this, 'dive further into non-wrappable object');
1393
+ this.applyMarkup(el.element.children, rangeObject, markupObject, tagComparator, options);
1394
+ }
1395
+ }
1396
+ },
1397
+
1398
+ /**
1399
+ * returns the type of the given markup (trying to match HTML5)
1400
+ * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1401
+ * @return string name of the markup type
1402
+ * @hide
1403
+ */
1404
+ getMarkupType: function (markupObject) {
1405
+ var nn = jQuery(markupObject)[0].nodeName.toLowerCase();
1406
+ if (markupObject.outerHtml) {
1407
+ Aloha.Log.debug(this, 'Node name detected: ' + nn + ' for: ' + markupObject.outerHtml());
1408
+ }
1409
+ if (nn == '#text') {
1410
+ return 'textNode';
1411
+ }
1412
+ if (this.replacingElements[nn]) {
1413
+ return 'sectionOrGroupingContent';
1414
+ }
1415
+ if (this.tagHierarchy[nn]) {
1416
+ return 'textLevelSemantics';
1417
+ }
1418
+ Aloha.Log.warn(this, 'unknown markup passed to this.getMarkupType(...): ' + markupObject.outerHtml());
1419
+ },
1420
+
1421
+ /**
1422
+ * returns the standard tag comparator for the given markup object
1423
+ * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1424
+ * @return function tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1425
+ * @hide
1426
+ */
1427
+ getStandardTagComparator: function (markupObject) {
1428
+ var that = this,
1429
+ result;
1430
+ switch (this.getMarkupType(markupObject)) {
1431
+ case 'textNode':
1432
+ result = function (p1, p2) {
1433
+ return false;
1434
+ };
1435
+ break;
1436
+
1437
+ case 'sectionOrGroupingContent':
1438
+ result = function (domobj, markupObject) {
1439
+ return that.standardSectionsAndGroupingContentComparator(domobj, markupObject);
1440
+ };
1441
+ break;
1442
+
1443
+ //case 'textLevelSemantics' covered by default
1444
+ default:
1445
+ result = function (domobj, markupObject) {
1446
+ return that.standardTextLevelSemanticsComparator(domobj, markupObject);
1447
+ };
1448
+ break;
1449
+ }
1450
+ return result;
1451
+ },
1452
+
1453
+ /**
1454
+ * searches for fully selected equal markup tags
1455
+ * @param selectionTree SelectionTree Object markup should be applied to
1456
+ * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1457
+ * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1458
+ * @return void
1459
+ * @hide
1460
+ */
1461
+ prepareForRemoval: function (selectionTree, markupObject, tagComparator) {
1462
+ var that = this, i, el;
1463
+
1464
+ // check if a comparison method was passed as parameter ...
1465
+ if (typeof tagComparator !== 'undefined' && typeof tagComparator !== 'function') {
1466
+ Aloha.Log.error(this, 'parameter tagComparator is not a function');
1467
+ }
1468
+ // ... if not use this as standard tag comparison method
1469
+ if (typeof tagComparator === 'undefined') {
1470
+ tagComparator = this.getStandardTagComparator(markupObject);
1471
+ }
1472
+ for (i = 0; i < selectionTree.length; i++) {
1473
+ el = selectionTree[i];
1474
+ if (el.domobj && (el.selection == 'full' || (el.selection == 'partial' && markupObject.isReplacingElement))) {
1475
+ // mark for removal
1476
+ if (el.domobj.nodeType === 1 && tagComparator(el.domobj, markupObject)) {
1477
+ Aloha.Log.debug(this, 'Marking for removal: ' + el.domobj.nodeName);
1478
+ jQuery(el.domobj).addClass('preparedForRemoval');
1479
+ }
1480
+ }
1481
+ if (el.selection != 'none' && el.children.length > 0) {
1482
+ this.prepareForRemoval(el.children, markupObject, tagComparator);
1483
+ }
1484
+
1485
+ }
1486
+ },
1487
+
1488
+ /**
1489
+ * searches for fully selected equal markup tags
1490
+ * @param selectionTree SelectionTree Object markup should be applied to
1491
+ * @param rangeObject Aloha rangeObject the markup will be applied to
1492
+ * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1493
+ * @param tagComparator method, which is used to compare the dom object and the jQuery markup object. the method must accept 2 parameters, the first is the domobj, the second is the jquery object. if no method is specified, the method this.standardTextLevelSemanticsComparator is used
1494
+ * @param options JS object, with the following boolean properties: setRangeObject2NewMarkup, setRangeObject2NextSibling, setRangeObject2PreviousSibling
1495
+ * @return void
1496
+ * @hide
1497
+ */
1498
+ wrapMarkupAroundSelectionTree: function (selectionTree, rangeObject, markupObject, tagComparator, options) {
1499
+ // first let's find out if theoretically the whole selection can be wrapped with one tag and save it for later use
1500
+ var objects2wrap = [], // // this will be used later to collect objects
1501
+ j = -1, // internal counter,
1502
+ breakpoint = true,
1503
+ preText = '',
1504
+ postText = '',
1505
+ prevOrNext,
1506
+ textNode2Start,
1507
+ textnodes,
1508
+ newMarkup,
1509
+ i,
1510
+ el,
1511
+ middleText;
1512
+
1513
+ Aloha.Log.debug(this, 'The formatting <' + markupObject[0].tagName + '> will be wrapped around the selection');
1514
+
1515
+ // now lets iterate over the elements
1516
+ for (i = 0; i < selectionTree.length; i++) {
1517
+ el = selectionTree[i];
1518
+
1519
+ // check if markup is allowed inside the elements parent
1520
+ if (el.domobj && !this.canTag1WrapTag2(el.domobj.parentNode.tagName.toLowerCase(), markupObject[0].tagName.toLowerCase())) {
1521
+ Aloha.Log.info(this, 'Skipping the wrapping of <' + markupObject[0].tagName.toLowerCase() + '> because this tag is not allowed inside <' + el.domobj.parentNode.tagName.toLowerCase() + '>');
1522
+ continue;
1523
+ }
1524
+
1525
+ // skip empty text nodes
1526
+ if (el.domobj && el.domobj.nodeType === 3 && jQuery.trim(el.domobj.nodeValue).length === 0) {
1527
+ continue;
1528
+ }
1529
+
1530
+ // partial element, can either be a textnode and therefore be wrapped (at least partially)
1531
+ // or can be a nodeType == 1 (tag) which must be dived into
1532
+ if (el.domobj && el.selection == 'partial' && !markupObject.isReplacingElement) {
1533
+ if (el.startOffset !== undefined && el.endOffset === undefined) {
1534
+ j++;
1535
+ preText += el.domobj.data.substr(0, el.startOffset);
1536
+ el.domobj.data = el.domobj.data.substr(el.startOffset, el.domobj.data.length - el.startOffset);
1537
+ objects2wrap[j] = el.domobj;
1538
+ } else if (el.endOffset !== undefined && el.startOffset === undefined) {
1539
+ j++;
1540
+ postText += el.domobj.data.substr(el.endOffset, el.domobj.data.length - el.endOffset);
1541
+ el.domobj.data = el.domobj.data.substr(0, el.endOffset);
1542
+ objects2wrap[j] = el.domobj;
1543
+ } else if (el.endOffset !== undefined && el.startOffset !== undefined) {
1544
+ if (el.startOffset == el.endOffset) { // do not wrap empty selections
1545
+ Aloha.Log.debug(this, 'skipping empty selection');
1546
+ continue;
1547
+ }
1548
+ j++;
1549
+ preText += el.domobj.data.substr(0, el.startOffset);
1550
+ middleText = el.domobj.data.substr(el.startOffset, el.endOffset - el.startOffset);
1551
+ postText += el.domobj.data.substr(el.endOffset, el.domobj.data.length - el.endOffset);
1552
+ el.domobj.data = middleText;
1553
+ objects2wrap[j] = el.domobj;
1554
+ } else {
1555
+ // a partially selected item without selectionStart/EndOffset is a nodeType 1 Element on the way to the textnode
1556
+ Aloha.Log.debug(this, 'diving into object');
1557
+ this.applyMarkup(el.children, rangeObject, markupObject, tagComparator, options);
1558
+ }
1559
+ }
1560
+ // fully selected dom elements can be wrapped as whole element
1561
+ if (el.domobj && (el.selection == 'full' || (el.selection == 'partial' && markupObject.isReplacingElement))) {
1562
+ j++;
1563
+ objects2wrap[j] = el.domobj;
1564
+ }
1565
+ }
1566
+
1567
+ if (objects2wrap.length > 0) {
1568
+ // wrap collected DOM object with markupObject
1569
+ objects2wrap = jQuery(objects2wrap);
1570
+
1571
+ // make a fix for text nodes in <li>'s in ie
1572
+ jQuery.each(objects2wrap, function (index, element) {
1573
+ if (jQuery.browser.msie && element.nodeType == 3 && !element.nextSibling && !element.previousSibling && element.parentNode && element.parentNode.nodeName.toLowerCase() == 'li') {
1574
+ element.data = jQuery.trim(element.data);
1575
+ }
1576
+ });
1577
+
1578
+ newMarkup = objects2wrap.wrapAll(markupObject).parent();
1579
+ newMarkup.before(preText).after(postText);
1580
+
1581
+ if (options.setRangeObject2NewMarkup) { // this is used, when markup is added to normal/normal Text
1582
+ textnodes = objects2wrap.textNodes();
1583
+
1584
+ if (textnodes.index(rangeObject.startContainer) != -1) {
1585
+ rangeObject.startOffset = 0;
1586
+ }
1587
+ if (textnodes.index(rangeObject.endContainer) != -1) {
1588
+ rangeObject.endOffset = rangeObject.endContainer.length;
1589
+ }
1590
+ breakpoint = true;
1591
+ }
1592
+ if (options.setRangeObject2NextSibling) {
1593
+ prevOrNext = true;
1594
+ textNode2Start = newMarkup.textNodes(true).last()[0];
1595
+ if (objects2wrap.index(rangeObject.startContainer) != -1) {
1596
+ rangeObject.startContainer = this.getTextNodeSibling(prevOrNext, newMarkup.parent(), textNode2Start);
1597
+ rangeObject.startOffset = 0;
1598
+ }
1599
+ if (objects2wrap.index(rangeObject.endContainer) != -1) {
1600
+ rangeObject.endContainer = this.getTextNodeSibling(prevOrNext, newMarkup.parent(), textNode2Start);
1601
+ rangeObject.endOffset = rangeObject.endOffset - textNode2Start.length;
1602
+ }
1603
+ }
1604
+ if (options.setRangeObject2PreviousSibling) {
1605
+ prevOrNext = false;
1606
+ textNode2Start = newMarkup.textNodes(true).first()[0];
1607
+ if (objects2wrap.index(rangeObject.startContainer) != -1) {
1608
+ rangeObject.startContainer = this.getTextNodeSibling(prevOrNext, newMarkup.parent(), textNode2Start);
1609
+ rangeObject.startOffset = 0;
1610
+ }
1611
+ if (objects2wrap.index(rangeObject.endContainer) != -1) {
1612
+ rangeObject.endContainer = this.getTextNodeSibling(prevOrNext, newMarkup.parent(), textNode2Start);
1613
+ rangeObject.endOffset = rangeObject.endContainer.length;
1614
+ }
1615
+ }
1616
+ }
1617
+ },
1618
+
1619
+ /**
1620
+ * takes a text node and return either the next recursive text node sibling or the previous
1621
+ * @param previousOrNext boolean, false for previous, true for next sibling
1622
+ * @param commonAncestorContainer dom object to be used as root for the sibling search
1623
+ * @param currentTextNode dom object of the originating text node
1624
+ * @return dom object of the sibling text node
1625
+ * @hide
1626
+ */
1627
+ getTextNodeSibling: function (previousOrNext, commonAncestorContainer, currentTextNode) {
1628
+ var textNodes = jQuery(commonAncestorContainer).textNodes(true), newIndex, index;
1629
+
1630
+ index = textNodes.index(currentTextNode);
1631
+ if (index == -1) { // currentTextNode was not found
1632
+ return false;
1633
+ }
1634
+ newIndex = index + (!previousOrNext ? -1 : 1);
1635
+ return textNodes[newIndex] || false;
1636
+ },
1637
+
1638
+ /**
1639
+ * takes a selection tree and groups it into markup wrappable selection trees
1640
+ * @param selectionTree rangeObject selection tree
1641
+ * @param markupObject jQuery object of the markup to be applied (e.g. created with obj = jQuery('<b></b>'); )
1642
+ * @return JS array of wrappable selection trees
1643
+ * @hide
1644
+ */
1645
+ optimizeSelectionTree4Markup: function (selectionTree, markupObject, tagComparator) {
1646
+ var groupMap = [],
1647
+ outerGroupIndex = 0,
1648
+ innerGroupIndex = 0,
1649
+ that = this,
1650
+ i,
1651
+ j,
1652
+ endPosition,
1653
+ startPosition;
1654
+
1655
+ if (typeof tagComparator === 'undefined') {
1656
+ tagComparator = function (domobj, markupObject) {
1657
+ return that.standardTextLevelSemanticsComparator(markupObject);
1658
+ };
1659
+ }
1660
+ for (i = 0; i < selectionTree.length; i++) {
1661
+ // we are just interested in selected item, but not in non-selected items
1662
+ if (selectionTree[i].domobj && selectionTree[i].selection != 'none') {
1663
+ if (markupObject.isReplacingElement && tagComparator(markupObject[0], jQuery(selectionTree[i].domobj))) {
1664
+ if (groupMap[outerGroupIndex] !== undefined) {
1665
+ outerGroupIndex++;
1666
+ }
1667
+ groupMap[outerGroupIndex] = {};
1668
+ groupMap[outerGroupIndex].wrappable = true;
1669
+ groupMap[outerGroupIndex].elements = [];
1670
+ groupMap[outerGroupIndex].elements[innerGroupIndex] = selectionTree[i];
1671
+ outerGroupIndex++;
1672
+
1673
+ } else if (this.canMarkupBeApplied2ElementAsWhole([selectionTree[i]], markupObject)) {
1674
+ // now check, if the children of our item could be wrapped all together by the markup object
1675
+ // if yes, add it to the current group
1676
+ if (groupMap[outerGroupIndex] === undefined) {
1677
+ groupMap[outerGroupIndex] = {};
1678
+ groupMap[outerGroupIndex].wrappable = true;
1679
+ groupMap[outerGroupIndex].elements = [];
1680
+ }
1681
+ if (markupObject.isReplacingElement) { // && selectionTree[i].domobj.nodeType === 3
1682
+ /* we found the node to wrap for a replacing element. however there might
1683
+ * be siblings which should be included as well
1684
+ * although they are actually not selected. example:
1685
+ * li
1686
+ * |-textNode ( .selection = 'none')
1687
+ * |-textNode (cursor inside, therefor .selection = 'partial')
1688
+ * |-textNode ( .selection = 'none')
1689
+ *
1690
+ * in this case it would be useful to select the previous and following textNodes as well (they might result from a previous DOM manipulation)
1691
+ * Think about other cases, where the parent is the Editable. In this case we propably only want to select from and until the next <br /> ??
1692
+ * .... many possibilities, here I realize the two described cases
1693
+ */
1694
+
1695
+ // first find start element starting from the current element going backwards until sibling 0
1696
+ startPosition = i;
1697
+ for (j = i - 1; j >= 0; j--) {
1698
+ if (this.canMarkupBeApplied2ElementAsWhole([selectionTree[j]], markupObject) && this.isMarkupAllowedToStealSelectionTreeElement(selectionTree[j], markupObject)) {
1699
+ startPosition = j;
1700
+ } else {
1701
+ break;
1702
+ }
1703
+ }
1704
+
1705
+ // now find the end element starting from the current element going forward until the last sibling
1706
+ endPosition = i;
1707
+ for (j = i + 1; j < selectionTree.length; j++) {
1708
+ if (this.canMarkupBeApplied2ElementAsWhole([selectionTree[j]], markupObject) && this.isMarkupAllowedToStealSelectionTreeElement(selectionTree[j], markupObject)) {
1709
+ endPosition = j;
1710
+ } else {
1711
+ break;
1712
+ }
1713
+ }
1714
+
1715
+ // now add the elements to the groupMap
1716
+ innerGroupIndex = 0;
1717
+ for (j = startPosition; j <= endPosition; j++) {
1718
+ groupMap[outerGroupIndex].elements[innerGroupIndex] = selectionTree[j];
1719
+ groupMap[outerGroupIndex].elements[innerGroupIndex].selection = 'full';
1720
+ innerGroupIndex++;
1721
+ }
1722
+ innerGroupIndex = 0;
1723
+ } else {
1724
+ // normal text level semantics object, no siblings need to be selected
1725
+ groupMap[outerGroupIndex].elements[innerGroupIndex] = selectionTree[i];
1726
+ innerGroupIndex++;
1727
+ }
1728
+ } else {
1729
+ // if no, isolate it in its own group
1730
+ if (groupMap[outerGroupIndex] !== undefined) {
1731
+ outerGroupIndex++;
1732
+ }
1733
+ groupMap[outerGroupIndex] = {};
1734
+ groupMap[outerGroupIndex].wrappable = false;
1735
+ groupMap[outerGroupIndex].element = selectionTree[i];
1736
+ innerGroupIndex = 0;
1737
+ outerGroupIndex++;
1738
+ }
1739
+ }
1740
+ }
1741
+ return groupMap;
1742
+ },
1743
+
1744
+ /**
1745
+ * very tricky method, which decides, if a certain markup (normally a replacing markup element like p, h1, blockquote)
1746
+ * is allowed to extend the user selection to other dom objects (represented as selectionTreeElement)
1747
+ * to understand the purpose: if the user selection is collapsed inside e.g. some text, which is currently not
1748
+ * wrapped by the markup to be applied, and therefor the markup does not have an equal markup to replace, then the DOM
1749
+ * manipulator has to decide which objects to wrap. real example:
1750
+ * <div>
1751
+ * <h1>headline</h1>
1752
+ * some text blabla bla<br>
1753
+ * more text HERE THE | CURSOR BLINKING and <b>even more bold text</b>
1754
+ * </div>
1755
+ * when the user now wants to apply e.g. a <p> tag, what will be wrapped? it could be useful if the manipulator would actually
1756
+ * wrap everything inside the div except the <h1>. but for this purpose someone has to decide, if the markup is
1757
+ * allowed to wrap certain dom elements in this case the question would be, if the <p> is allowed to wrap
1758
+ * textNodes, <br> and <b> and <h1>. therefore this tricky method should answer the question for those 3 elements
1759
+ * with true, but for for the <h1> it should return false. and since the method does not know this, there is a configuration
1760
+ * for this
1761
+ *
1762
+ * @param selectionTree rangeObject selection tree element (only one, not an array of)
1763
+ * @param markupObject lowercase string of the tag to be verified (e.g. "b")
1764
+ * @return true if the markup is allowed to wrap the selection tree element, false otherwise
1765
+ * @hide
1766
+ */
1767
+ isMarkupAllowedToStealSelectionTreeElement: function (selectionTreeElement, markupObject) {
1768
+ if (!selectionTreeElement.domobj) {
1769
+ return false;
1770
+ }
1771
+ var maybeTextNodeName = selectionTreeElement.domobj.nodeName.toLowerCase(),
1772
+ nodeName = (maybeTextNodeName == '#text') ? 'textNode' : maybeTextNodeName,
1773
+ markupName = markupObject[0].nodeName.toLowerCase(),
1774
+ elemMap = this.allowedToStealElements[markupName];
1775
+ return elemMap && elemMap[nodeName];
1776
+ },
1777
+
1778
+ /**
1779
+ * checks if a selection can be completey wrapped by a certain html tags (helper method for this.optimizeSelectionTree4Markup
1780
+ * @param selectionTree rangeObject selection tree
1781
+ * @param markupObject lowercase string of the tag to be verified (e.g. "b")
1782
+ * @return true if selection can be applied as whole, false otherwise
1783
+ * @hide
1784
+ */
1785
+ canMarkupBeApplied2ElementAsWhole: function (selectionTree, markupObject) {
1786
+ var htmlTag, i, el, returnVal;
1787
+
1788
+ if (markupObject.jquery) {
1789
+ htmlTag = markupObject[0].tagName;
1790
+ }
1791
+ if (markupObject.tagName) {
1792
+ htmlTag = markupObject.tagName;
1793
+ }
1794
+
1795
+ returnVal = true;
1796
+ for (i = 0; i < selectionTree.length; i++) {
1797
+ el = selectionTree[i];
1798
+ if (el.domobj && (el.selection != "none" || markupObject.isReplacingElement)) {
1799
+ // Aloha.Log.debug(this, 'Checking, if <' + htmlTag + '> can be applied to ' + el.domobj.nodeName);
1800
+ if (!this.canTag1WrapTag2(htmlTag, el.domobj.nodeName)) {
1801
+ return false;
1802
+ }
1803
+ if (el.children.length > 0 && !this.canMarkupBeApplied2ElementAsWhole(el.children, markupObject)) {
1804
+ return false;
1805
+ }
1806
+ }
1807
+ }
1808
+ return returnVal;
1809
+ },
1810
+
1811
+ /**
1812
+ * checks if a tag 1 (first parameter) can wrap tag 2 (second parameter).
1813
+ * IMPORTANT: the method does not verify, if there have to be other tags in between
1814
+ * Example: this.canTag1WrapTag2("table", "td") will return true, because the method does not take into account, that there has to be a "tr" in between
1815
+ * @param t1 string: tagname of outer tag to verify, e.g. "b"
1816
+ * @param t2 string: tagname of inner tag to verify, e.g. "b"
1817
+ * @return true if tag 1 can wrap tag 2, false otherwise
1818
+ * @hide
1819
+ */
1820
+ canTag1WrapTag2: function (t1, t2) {
1821
+ t1 = (t1 == '#text') ? 'textNode' : t1.toLowerCase();
1822
+ t2 = (t2 == '#text') ? 'textNode' : t2.toLowerCase();
1823
+ var t1Map = this.tagHierarchy[t1];
1824
+ if (!t1Map) {
1825
+ return true;
1826
+ }
1827
+ if (!this.tagHierarchy[t2]) {
1828
+ return true;
1829
+ }
1830
+ return t1Map[t2];
1831
+ },
1832
+
1833
+ /**
1834
+ * Check whether it is allowed to insert the given tag at the start of the
1835
+ * current selection. This method will check whether the markup effective for
1836
+ * the start and outside of the editable part (starting with the editable tag
1837
+ * itself) may wrap the given tag.
1838
+ * @param tagName {String} name of the tag which shall be inserted
1839
+ * @return true when it is allowed to insert that tag, false if not
1840
+ * @hide
1841
+ */
1842
+ mayInsertTag: function (tagName) {
1843
+ var i;
1844
+ if (typeof this.rangeObject.unmodifiableMarkupAtStart == 'object') {
1845
+ // iterate over all DOM elements outside of the editable part
1846
+ for (i = 0; i < this.rangeObject.unmodifiableMarkupAtStart.length; ++i) {
1847
+ // check whether an element may not wrap the given
1848
+ if (!this.canTag1WrapTag2(this.rangeObject.unmodifiableMarkupAtStart[i].nodeName, tagName)) {
1849
+ // found a DOM element which forbids to insert the given tag, we are done
1850
+ return false;
1851
+ }
1852
+ }
1853
+
1854
+ // all of the found DOM elements allow inserting the given tag
1855
+ return true;
1856
+ }
1857
+ Aloha.Log.warn(this, 'Unable to determine whether tag ' + tagName + ' may be inserted');
1858
+ return true;
1859
+ },
1860
+
1861
+ /**
1862
+ * String representation
1863
+ * @return "Aloha.Selection"
1864
+ * @hide
1865
+ */
1866
+ toString: function () {
1867
+ return 'Aloha.Selection';
1868
+ },
1869
+
1870
+ /**
1871
+ * @namespace Aloha.Selection
1872
+ * @class SelectionRange
1873
+ * @extends GENTICS.Utils.RangeObject
1874
+ * Constructor for a range object.
1875
+ * Optionally you can pass in a range object that's properties will be assigned to the new range object.
1876
+ * @param rangeObject A range object thats properties will be assigned to the new range object.
1877
+ * @constructor
1878
+ */
1879
+ SelectionRange: GENTICS.Utils.RangeObject.extend({
1880
+ _constructor: function (rangeObject) {
1881
+ this._super(rangeObject);
1882
+ // If a range object was passed in we apply the values to the new range object
1883
+ if (rangeObject) {
1884
+ if (rangeObject.commonAncestorContainer) {
1885
+ this.commonAncestorContainer = rangeObject.commonAncestorContainer;
1886
+ }
1887
+ if (rangeObject.selectionTree) {
1888
+ this.selectionTree = rangeObject.selectionTree;
1889
+ }
1890
+ if (rangeObject.limitObject) {
1891
+ this.limitObject = rangeObject.limitObject;
1892
+ }
1893
+ if (rangeObject.markupEffectiveAtStart) {
1894
+ this.markupEffectiveAtStart = rangeObject.markupEffectiveAtStart;
1895
+ }
1896
+ if (rangeObject.unmodifiableMarkupAtStart) {
1897
+ this.unmodifiableMarkupAtStart = rangeObject.unmodifiableMarkupAtStart;
1898
+ }
1899
+ if (rangeObject.splitObject) {
1900
+ this.splitObject = rangeObject.splitObject;
1901
+ }
1902
+ }
1903
+ },
1904
+
1905
+ /**
1906
+ * DOM object of the common ancestor from startContainer and endContainer
1907
+ * @hide
1908
+ */
1909
+ commonAncestorContainer: undefined,
1910
+
1911
+ /**
1912
+ * The selection tree
1913
+ * @hide
1914
+ */
1915
+ selectionTree: undefined,
1916
+
1917
+ /**
1918
+ * Array of DOM objects effective for the start container and inside the
1919
+ * editable part (inside the limit object). relevant for the button status
1920
+ * @hide
1921
+ */
1922
+ markupEffectiveAtStart: [],
1923
+
1924
+ /**
1925
+ * Array of DOM objects effective for the start container, which lies
1926
+ * outside of the editable portion (starting with the limit object)
1927
+ * @hide
1928
+ */
1929
+ unmodifiableMarkupAtStart: [],
1930
+
1931
+ /**
1932
+ * DOM object being the limit for all markup relevant activities
1933
+ * @hide
1934
+ */
1935
+ limitObject: undefined,
1936
+
1937
+ /**
1938
+ * DOM object being split when enter key gets hit
1939
+ * @hide
1940
+ */
1941
+ splitObject: undefined,
1942
+
1943
+ /**
1944
+ * Sets the visible selection in the Browser based on the range object.
1945
+ * If the selection is collapsed, this will result in a blinking cursor,
1946
+ * otherwise in a text selection.
1947
+ * @method
1948
+ */
1949
+ select: function () {
1950
+ // Call Utils' select()
1951
+ this._super();
1952
+
1953
+ // update the selection
1954
+ Aloha.Selection.updateSelection();
1955
+ },
1956
+
1957
+ /**
1958
+ * Method to update a range object internally
1959
+ * @param commonAncestorContainer (DOM Object); optional Parameter; if set, the parameter
1960
+ * will be used instead of the automatically calculated CAC
1961
+ * @return void
1962
+ * @hide
1963
+ */
1964
+ update: function (commonAncestorContainer) {
1965
+ this.updatelimitObject();
1966
+ this.updateMarkupEffectiveAtStart();
1967
+ this.updateCommonAncestorContainer(commonAncestorContainer);
1968
+
1969
+ // reset the selectiontree (must be recalculated)
1970
+ this.selectionTree = undefined;
1971
+ },
1972
+
1973
+ /**
1974
+ * Get the selection tree for this range
1975
+ * TODO: remove this (was moved to range.js)
1976
+ * @return selection tree
1977
+ * @hide
1978
+ */
1979
+ getSelectionTree: function () {
1980
+ // if not yet calculated, do this now
1981
+ if (!this.selectionTree) {
1982
+ this.selectionTree = Aloha.Selection.getSelectionTree(this);
1983
+ }
1984
+
1985
+ return this.selectionTree;
1986
+ },
1987
+
1988
+ /**
1989
+ * TODO: move this to range.js
1990
+ * Get an array of domobj (in dom tree order) of siblings of the given domobj, which are contained in the selection
1991
+ * @param domobj dom object to start with
1992
+ * @return array of siblings of the given domobj, which are also selected
1993
+ * @hide
1994
+ */
1995
+ getSelectedSiblings: function (domobj) {
1996
+ var selectionTree = this.getSelectionTree();
1997
+
1998
+ return this.recursionGetSelectedSiblings(domobj, selectionTree);
1999
+ },
2000
+
2001
+ /**
2002
+ * TODO: move this to range.js
2003
+ * Recursive method to find the selected siblings of the given domobj (which should be selected as well)
2004
+ * @param domobj dom object for which the selected siblings shall be found
2005
+ * @param selectionTree current level of the selection tree
2006
+ * @return array of selected siblings of dom objects or false if none found
2007
+ * @hide
2008
+ */
2009
+ recursionGetSelectedSiblings: function (domobj, selectionTree) {
2010
+ var selectedSiblings = false,
2011
+ foundObj = false,
2012
+ i;
2013
+
2014
+ for (i = 0; i < selectionTree.length; ++i) {
2015
+ if (selectionTree[i].domobj === domobj) {
2016
+ foundObj = true;
2017
+ selectedSiblings = [];
2018
+ } else if (!foundObj && selectionTree[i].children) {
2019
+ // do the recursion
2020
+ selectedSiblings = this.recursionGetSelectedSiblings(domobj, selectionTree[i].children);
2021
+ if (selectedSiblings !== false) {
2022
+ break;
2023
+ }
2024
+ } else if (foundObj && selectionTree[i].domobj && selectionTree[i].selection != 'collapsed' && selectionTree[i].selection != 'none') {
2025
+ selectedSiblings.push(selectionTree[i].domobj);
2026
+ } else if (foundObj && selectionTree[i].selection == 'none') {
2027
+ break;
2028
+ }
2029
+ }
2030
+
2031
+ return selectedSiblings;
2032
+ },
2033
+
2034
+ /**
2035
+ * TODO: move this to range.js
2036
+ * Method updates member var markupEffectiveAtStart and splitObject, which is relevant primarily for button status and enter key behaviour
2037
+ * @return void
2038
+ * @hide
2039
+ */
2040
+ updateMarkupEffectiveAtStart: function () {
2041
+ // reset the current markup
2042
+ this.markupEffectiveAtStart = [];
2043
+ this.unmodifiableMarkupAtStart = [];
2044
+
2045
+ var parents = this.getStartContainerParents(),
2046
+ limitFound = false,
2047
+ splitObjectWasSet,
2048
+ i,
2049
+ el;
2050
+
2051
+ for (i = 0; i < parents.length; i++) {
2052
+ el = parents[i];
2053
+ if (!limitFound && (el !== this.limitObject)) {
2054
+ this.markupEffectiveAtStart[i] = el;
2055
+ if (!splitObjectWasSet && GENTICS.Utils.Dom.isSplitObject(el)) {
2056
+ splitObjectWasSet = true;
2057
+ this.splitObject = el;
2058
+ }
2059
+ } else {
2060
+ limitFound = true;
2061
+ this.unmodifiableMarkupAtStart.push(el);
2062
+ }
2063
+ }
2064
+ if (!splitObjectWasSet) {
2065
+ this.splitObject = false;
2066
+ }
2067
+ return;
2068
+ },
2069
+
2070
+ /**
2071
+ * TODO: remove this
2072
+ * Method updates member var markupEffectiveAtStart, which is relevant primarily for button status
2073
+ * @return void
2074
+ * @hide
2075
+ */
2076
+ updatelimitObject: function () {
2077
+ if (Aloha.editables && Aloha.editables.length > 0) {
2078
+ var parents = this.getStartContainerParents(),
2079
+ editables = Aloha.editables,
2080
+ i,
2081
+ el,
2082
+ j,
2083
+ editable;
2084
+ for (i = 0; i < parents.length; i++) {
2085
+ el = parents[i];
2086
+ for (j = 0; j < editables.length; j++) {
2087
+ editable = editables[j].obj[0];
2088
+ if (el === editable) {
2089
+ this.limitObject = el;
2090
+ return true;
2091
+ }
2092
+ }
2093
+ }
2094
+ }
2095
+ this.limitObject = jQuery('body');
2096
+ return true;
2097
+ },
2098
+
2099
+ /**
2100
+ * string representation of the range object
2101
+ * @param verbose set to true for verbose output
2102
+ * @return string representation of the range object
2103
+ * @hide
2104
+ */
2105
+ toString: function (verbose) {
2106
+ if (!verbose) {
2107
+ return 'Aloha.Selection.SelectionRange';
2108
+ }
2109
+ return 'Aloha.Selection.SelectionRange {start [' + this.startContainer.nodeValue + '] offset ' + this.startOffset + ', end [' + this.endContainer.nodeValue + '] offset ' + this.endOffset + '}';
2110
+ }
2111
+
2112
+ }) // SelectionRange
2113
+
2114
+ }); // Selection
2115
+
2116
+
2117
+ /**
2118
+ * This method implements an ugly workaround for a selection problem in ie:
2119
+ * when the cursor shall be placed at the end of a text node in a li element, that is followed by a nested list,
2120
+ * the selection would always snap into the first li of the nested list
2121
+ * therefore, we make sure that the text node ends with a space and place the cursor right before it
2122
+ */
2123
+ function nestedListInIEWorkaround(range) {
2124
+ var nextSibling;
2125
+ if (jQuery.browser.msie && range.startContainer === range.endContainer && range.startOffset === range.endOffset && range.startContainer.nodeType == 3 && range.startOffset == range.startContainer.data.length && range.startContainer.nextSibling) {
2126
+ nextSibling = range.startContainer.nextSibling;
2127
+ if ('OL' === nextSibling.nodeName || 'UL' === nextSibling.nodeName) {
2128
+ if (range.startContainer.data[range.startContainer.data.length - 1] == ' ') {
2129
+ range.startOffset = range.endOffset = range.startOffset - 1;
2130
+ } else {
2131
+ range.startContainer.data = range.startContainer.data + ' ';
2132
+ }
2133
+ }
2134
+ }
2135
+ }
2136
+
2137
+ function correctRange(range) {
2138
+ nestedListInIEWorkaround(range);
2139
+ return range;
2140
+ }
2141
+
2142
+ /**
2143
+ * Implements Selection http://html5.org/specs/dom-range.html#selection
2144
+ * @namespace Aloha
2145
+ * @class Selection This singleton class always represents the
2146
+ * current user selection
2147
+ * @singleton
2148
+ */
2149
+ var AlohaSelection = Class.extend({
2150
+
2151
+ _constructor: function (nativeSelection) {
2152
+
2153
+ this._nativeSelection = nativeSelection;
2154
+ this.ranges = [];
2155
+
2156
+ // will remember if urged to not change the selection
2157
+ this.preventChange = false;
2158
+
2159
+ },
2160
+
2161
+ /**
2162
+ * Returns the element that contains the start of the selection. Returns null if there's no selection.
2163
+ * @readonly
2164
+ * @type Node
2165
+ */
2166
+ anchorNode: null,
2167
+
2168
+ /**
2169
+ * Returns the offset of the start of the selection relative to the element that contains the start
2170
+ * of the selection. Returns 0 if there's no selection.
2171
+ * @readonly
2172
+ * @type int
2173
+ */
2174
+ anchorOffset: 0,
2175
+
2176
+ /**
2177
+ * Returns the element that contains the end of the selection.
2178
+ * Returns null if there's no selection.
2179
+ * @readonly
2180
+ * @type Node
2181
+ */
2182
+ focusNode: null,
2183
+
2184
+ /**
2185
+ * Returns the offset of the end of the selection relative to the element that contains the end
2186
+ * of the selection. Returns 0 if there's no selection.
2187
+ * @readonly
2188
+ * @type int
2189
+ */
2190
+ focusOffset: 0,
2191
+
2192
+ /**
2193
+ * Returns true if there's no selection or if the selection is empty. Otherwise, returns false.
2194
+ * @readonly
2195
+ * @type boolean
2196
+ */
2197
+ isCollapsed: false,
2198
+
2199
+ /**
2200
+ * Returns the number of ranges in the selection.
2201
+ * @readonly
2202
+ * @type int
2203
+ */
2204
+ rangeCount: 0,
2205
+
2206
+ /**
2207
+ * Replaces the selection with an empty one at the given position.
2208
+ * @throws a WRONG_DOCUMENT_ERR exception if the given node is in a different document.
2209
+ * @param parentNode Node of new selection
2210
+ * @param offest offest of new Selection in parentNode
2211
+ * @void
2212
+ */
2213
+ collapse: function (parentNode, offset) {
2214
+ this._nativeSelection.collapse(parentNode, offset);
2215
+ },
2216
+
2217
+ /**
2218
+ * Replaces the selection with an empty one at the position of the start of the current selection.
2219
+ * @throws an INVALID_STATE_ERR exception if there is no selection.
2220
+ * @void
2221
+ */
2222
+ collapseToStart: function () {
2223
+ throw "NOT_IMPLEMENTED";
2224
+ },
2225
+
2226
+ /**
2227
+ * @void
2228
+ */
2229
+ extend: function (parentNode, offset) {
2230
+
2231
+ },
2232
+
2233
+ /**
2234
+ * @param alter DOMString
2235
+ * @param direction DOMString
2236
+ * @param granularity DOMString
2237
+ * @void
2238
+ */
2239
+ modify: function (alter, direction, granularity) {
2240
+
2241
+ },
2242
+
2243
+ /**
2244
+ * Replaces the selection with an empty one at the position of the end of the current selection.
2245
+ * @throws an INVALID_STATE_ERR exception if there is no selection.
2246
+ * @void
2247
+ */
2248
+ collapseToEnd: function () {
2249
+ this._nativeSelection.collapseToEnd();
2250
+ },
2251
+
2252
+ /**
2253
+ * Replaces the selection with one that contains all the contents of the given element.
2254
+ * @throws a WRONG_DOCUMENT_ERR exception if the given node is in a different document.
2255
+ * @param parentNode Node the Node fully select
2256
+ * @void
2257
+ */
2258
+ selectAllChildren: function (parentNode) {
2259
+ throw "NOT_IMPLEMENTED";
2260
+ },
2261
+
2262
+ /**
2263
+ * Deletes the contents of the selection
2264
+ */
2265
+ deleteFromDocument: function () {
2266
+ throw "NOT_IMPLEMENTED";
2267
+ },
2268
+
2269
+ /**
2270
+ * NB!
2271
+ * We have serious problem in IE.
2272
+ * The range that we get in IE is not the same as the range we had set,
2273
+ * so even if we normalize it during getRangeAt, in IE, we will be
2274
+ * correcting the range to the "correct" place, but still not the place
2275
+ * where it was originally set.
2276
+ *
2277
+ * Returns the given range.
2278
+ * The getRangeAt(index) method returns the indexth range in the list.
2279
+ * NOTE: Aloha Editor only support 1 range! index can only be 0
2280
+ * @throws INDEX_SIZE_ERR DOM exception if index is less than zero or
2281
+ * greater or equal to the value returned by the rangeCount.
2282
+ * @param index int
2283
+ * @return Range return the selected range from index
2284
+ */
2285
+ getRangeAt: function (index) {
2286
+ return correctRange(this._nativeSelection.getRangeAt(index));
2287
+ //if ( index < 0 || this.rangeCount ) {
2288
+ // throw "INDEX_SIZE_ERR DOM";
2289
+ //}
2290
+ //return this._ranges[index];
2291
+ },
2292
+
2293
+ /**
2294
+ * Adds the given range to the selection.
2295
+ * The addRange(range) method adds the given range Range object to the list of
2296
+ * selections, at the end (so the newly added range is the new last range).
2297
+ * NOTE: Aloha Editor only support 1 range! The added range will replace the
2298
+ * range at index 0
2299
+ * see http://html5.org/specs/dom-range.html#selection note about addRange
2300
+ * @throws an INVALID_NODE_TYPE_ERR exception if the given Range has a boundary point
2301
+ * node that's not a Text or Element node, and an INVALID_MODIFICATION_ERR exception
2302
+ * if it has a boundary point node that doesn't descend from a Document.
2303
+ * @param range Range adds the range to the selection
2304
+ * @void
2305
+ */
2306
+ addRange: function (range) {
2307
+ // set readonly attributes
2308
+ this._nativeSelection.addRange(range);
2309
+ // We will correct the range after rangy has processed the native
2310
+ // selection range, so that our correction will be the final fix on
2311
+ // the range according to the guarentee's that Aloha wants to make
2312
+ this._nativeSelection._ranges[0] = correctRange(range);
2313
+
2314
+ // make sure, the old Aloha selection will be updated (until all implementations use the new AlohaSelection)
2315
+ Aloha.Selection.updateSelection();
2316
+ },
2317
+
2318
+ /**
2319
+ * Removes the given range from the selection, if the range was one of the ones in the selection.
2320
+ * NOTE: Aloha Editor only support 1 range! The added range will replace the
2321
+ * range at with index 0
2322
+ * @param range Range removes the range from the selection
2323
+ * @void
2324
+ */
2325
+ removeRange: function (range) {
2326
+ this._nativeSelection.removeRange();
2327
+ },
2328
+
2329
+ /**
2330
+ * Removes all the ranges in the selection.
2331
+ * @viod
2332
+ */
2333
+ removeAllRanges: function () {
2334
+ this._nativeSelection.removeAllRanges();
2335
+ },
2336
+
2337
+ /**
2338
+ * INFO: Method is used for integration with Gentics
2339
+ * Aloha, has no use otherwise Updates the rangeObject
2340
+ * according to the current user selection Method is
2341
+ * always called on selection change
2342
+ *
2343
+ * @param event
2344
+ * jQuery browser event object
2345
+ * @return true when rangeObject was modified, false
2346
+ * otherwise
2347
+ * @hide
2348
+ */
2349
+ refresh: function (event) {
2350
+
2351
+ },
2352
+
2353
+ /**
2354
+ * String representation
2355
+ *
2356
+ * @return "Aloha.Selection"
2357
+ * @hide
2358
+ */
2359
+ toString: function () {
2360
+ return 'Aloha.Selection';
2361
+ },
2362
+
2363
+ getRangeCount: function () {
2364
+ return this._nativeSelection.rangeCount;
2365
+ }
2366
+
2367
+ });
2368
+
2369
+ /**
2370
+ * A wrapper for the function of the same name in the rangy core-depdency.
2371
+ * This function should be preferred as it hides the global rangy object.
2372
+ * For more information look at the following sites:
2373
+ * http://html5.org/specs/dom-range.html
2374
+ * @param window optional - specifices the window to get the selection of
2375
+ */
2376
+ Aloha.getSelection = function (target) {
2377
+ target = (target !== document || target !== window) ? window : target;
2378
+ // Aloha.Selection.refresh()
2379
+ // implement Aloha Selection
2380
+ // TODO cache
2381
+ return new AlohaSelection(window.rangy.getSelection(target));
2382
+ };
2383
+
2384
+ /**
2385
+ * A wrapper for the function of the same name in the rangy core-depdency.
2386
+ * This function should be preferred as it hides the global rangy object.
2387
+ * Please note: when the range object is not needed anymore,
2388
+ * invoke the detach method on it. It is currently unknown to me why
2389
+ * this is required, but that's what it says in the rangy specification.
2390
+ * For more information look at the following sites:
2391
+ * http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
2392
+ * @param document optional - specifies which document to create the range for
2393
+ */
2394
+ Aloha.createRange = function (givenWindow) {
2395
+ return window.rangy.createRange(givenWindow);
2396
+ };
2397
+
2398
+ var selection = new Selection();
2399
+ Aloha.Selection = selection;
2400
+
2401
+ return selection;
2402
+ });