aloha-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1045) hide show
  1. data/.gitignore +18 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +22 -0
  4. data/README.md +34 -0
  5. data/Rakefile +9 -0
  6. data/aloha-rails.gemspec +22 -0
  7. data/lib/aloha-rails.rb +13 -0
  8. data/lib/aloha-rails/engine.rb +9 -0
  9. data/lib/aloha-rails/helpers.rb +45 -0
  10. data/lib/aloha-rails/railtie.rb +9 -0
  11. data/lib/aloha-rails/version.rb +5 -0
  12. data/lib/generators/aloha/install/USAGE +9 -0
  13. data/lib/generators/aloha/install/install_generator.rb +25 -0
  14. data/lib/generators/aloha/install/templates/aloha-config.coffee +88 -0
  15. data/lib/generators/aloha/install/templates/aloha-config.js +108 -0
  16. data/lib/generators/aloha/install/templates/aloha.rb +21 -0
  17. data/lib/generators/aloha/install/templates/application.js +16 -0
  18. data/spec/aloha_spec.rb +20 -0
  19. data/spec/helpers/aloha_helpers_spec.rb +69 -0
  20. data/spec/spec_helper.rb +17 -0
  21. data/vendor/assets/javascripts/aloha/css/aloha-core.css +44 -0
  22. data/vendor/assets/javascripts/aloha/css/aloha-sidebar.css +284 -0
  23. data/vendor/assets/javascripts/aloha/css/aloha.css +7774 -0
  24. data/vendor/assets/javascripts/aloha/css/ext-aloha-reset.css +33 -0
  25. data/vendor/assets/javascripts/aloha/css/ext-aloha.css +357 -0
  26. data/vendor/assets/javascripts/aloha/img/arrow-down.png +0 -0
  27. data/vendor/assets/javascripts/aloha/img/arrow-left.png +0 -0
  28. data/vendor/assets/javascripts/aloha/img/arrow.png +0 -0
  29. data/vendor/assets/javascripts/aloha/img/base-big.png +0 -0
  30. data/vendor/assets/javascripts/aloha/img/base-multi.png +0 -0
  31. data/vendor/assets/javascripts/aloha/img/base.png +0 -0
  32. data/vendor/assets/javascripts/aloha/img/bg.png +0 -0
  33. data/vendor/assets/javascripts/aloha/img/breadcrumb-divider.png +0 -0
  34. data/vendor/assets/javascripts/aloha/img/fade-in.png +0 -0
  35. data/vendor/assets/javascripts/aloha/img/fade-out.png +0 -0
  36. data/vendor/assets/javascripts/aloha/img/gentics-logo.png +0 -0
  37. data/vendor/assets/javascripts/aloha/img/grabhandle.png +0 -0
  38. data/vendor/assets/javascripts/aloha/img/maximize.png +0 -0
  39. data/vendor/assets/javascripts/aloha/img/multisplit-base.jpg +0 -0
  40. data/vendor/assets/javascripts/aloha/img/multisplit-close.gif +0 -0
  41. data/vendor/assets/javascripts/aloha/img/multisplit-open.gif +0 -0
  42. data/vendor/assets/javascripts/aloha/img/pin.png +0 -0
  43. data/vendor/assets/javascripts/aloha/img/removeformat.png +0 -0
  44. data/vendor/assets/javascripts/aloha/img/text_indent.png +0 -0
  45. data/vendor/assets/javascripts/aloha/img/text_indent_remove.png +0 -0
  46. data/vendor/assets/javascripts/aloha/lib/aloha-bootstrap.js +27645 -0
  47. data/vendor/assets/javascripts/aloha/lib/aloha.js +88750 -0
  48. data/vendor/assets/javascripts/aloha/lib/aloha/command.js +246 -0
  49. data/vendor/assets/javascripts/aloha/lib/aloha/console.js +330 -0
  50. data/vendor/assets/javascripts/aloha/lib/aloha/contenthandlermanager.js +65 -0
  51. data/vendor/assets/javascripts/aloha/lib/aloha/core.js +560 -0
  52. data/vendor/assets/javascripts/aloha/lib/aloha/ecma5.js +194 -0
  53. data/vendor/assets/javascripts/aloha/lib/aloha/ecma5shims.js +280 -0
  54. data/vendor/assets/javascripts/aloha/lib/aloha/editable.js +854 -0
  55. data/vendor/assets/javascripts/aloha/lib/aloha/engine.js +8306 -0
  56. data/vendor/assets/javascripts/aloha/lib/aloha/ext-alohaproxy.js +86 -0
  57. data/vendor/assets/javascripts/aloha/lib/aloha/ext-alohareader.js +50 -0
  58. data/vendor/assets/javascripts/aloha/lib/aloha/ext-alohatreeloader.js +77 -0
  59. data/vendor/assets/javascripts/aloha/lib/aloha/ext.js +32 -0
  60. data/vendor/assets/javascripts/aloha/lib/aloha/floatingmenu.js +1304 -0
  61. data/vendor/assets/javascripts/aloha/lib/aloha/ierange-m2.js +546 -0
  62. data/vendor/assets/javascripts/aloha/lib/aloha/jquery.aloha.js +324 -0
  63. data/vendor/assets/javascripts/aloha/lib/aloha/jquery.js +24 -0
  64. data/vendor/assets/javascripts/aloha/lib/aloha/jquery.patch.js +115 -0
  65. data/vendor/assets/javascripts/aloha/lib/aloha/markup.js +977 -0
  66. data/vendor/assets/javascripts/aloha/lib/aloha/message.js +115 -0
  67. data/vendor/assets/javascripts/aloha/lib/aloha/nls/de/i18n.js +10 -0
  68. data/vendor/assets/javascripts/aloha/lib/aloha/nls/i18n.js +20 -0
  69. data/vendor/assets/javascripts/aloha/lib/aloha/observable.js +106 -0
  70. data/vendor/assets/javascripts/aloha/lib/aloha/plugin.js +276 -0
  71. data/vendor/assets/javascripts/aloha/lib/aloha/pluginmanager.js +146 -0
  72. data/vendor/assets/javascripts/aloha/lib/aloha/rangy-core.js +3242 -0
  73. data/vendor/assets/javascripts/aloha/lib/aloha/registry.js +59 -0
  74. data/vendor/assets/javascripts/aloha/lib/aloha/repository.js +241 -0
  75. data/vendor/assets/javascripts/aloha/lib/aloha/repositorymanager.js +570 -0
  76. data/vendor/assets/javascripts/aloha/lib/aloha/repositoryobjects.js +146 -0
  77. data/vendor/assets/javascripts/aloha/lib/aloha/selection.js +2083 -0
  78. data/vendor/assets/javascripts/aloha/lib/aloha/sidebar.js +1133 -0
  79. data/vendor/assets/javascripts/aloha/lib/aloha/ui-attributefield.js +530 -0
  80. data/vendor/assets/javascripts/aloha/lib/aloha/ui-browser.js +214 -0
  81. data/vendor/assets/javascripts/aloha/lib/aloha/ui.js +889 -0
  82. data/vendor/assets/javascripts/aloha/lib/css.js +313 -0
  83. data/vendor/assets/javascripts/aloha/lib/i18n.js +153 -0
  84. data/vendor/assets/javascripts/aloha/lib/jquery-plugin.js +46 -0
  85. data/vendor/assets/javascripts/aloha/lib/order.js +140 -0
  86. data/vendor/assets/javascripts/aloha/lib/require.js +2013 -0
  87. data/vendor/assets/javascripts/aloha/lib/text.js +262 -0
  88. data/vendor/assets/javascripts/aloha/lib/util/class.js +80 -0
  89. data/vendor/assets/javascripts/aloha/lib/util/dom.js +1673 -0
  90. data/vendor/assets/javascripts/aloha/lib/util/json2.js +481 -0
  91. data/vendor/assets/javascripts/aloha/lib/util/lang.js +66 -0
  92. data/vendor/assets/javascripts/aloha/lib/util/position.js +158 -0
  93. data/vendor/assets/javascripts/aloha/lib/util/range.js +923 -0
  94. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/adapter/jquery/ext-jquery-adapter-debug.js +2470 -0
  95. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/adapter/jquery/ext-jquery-adapter.js +7 -0
  96. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/ext-all-debug.js +47684 -0
  97. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/ext-all.js +13 -0
  98. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/gpl-3.0.txt +674 -0
  99. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/license.txt +42 -0
  100. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/charts.swf +0 -0
  101. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/css/ext-all.css +5903 -0
  102. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/css/ext-all.less +6795 -0
  103. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/css/xtheme-gray.css +1692 -0
  104. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/expressinstall.swf +0 -0
  105. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/corners-blue.gif +0 -0
  106. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/corners.gif +0 -0
  107. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/l-blue.gif +0 -0
  108. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/l.gif +0 -0
  109. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/r-blue.gif +0 -0
  110. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/r.gif +0 -0
  111. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/tb-blue.gif +0 -0
  112. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/box/tb.gif +0 -0
  113. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/arrow.gif +0 -0
  114. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/btn.gif +0 -0
  115. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/group-cs.gif +0 -0
  116. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/group-lr.gif +0 -0
  117. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/group-tb.gif +0 -0
  118. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-b-noline.gif +0 -0
  119. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-b.gif +0 -0
  120. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-bo.gif +0 -0
  121. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-noline.gif +0 -0
  122. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow-o.gif +0 -0
  123. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/button/s-arrow.gif +0 -0
  124. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/dd/drop-add.gif +0 -0
  125. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/dd/drop-no.gif +0 -0
  126. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/dd/drop-yes.gif +0 -0
  127. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/editor/tb-sprite.gif +0 -0
  128. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/checkbox.gif +0 -0
  129. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/clear-trigger.gif +0 -0
  130. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/clear-trigger.psd +0 -0
  131. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/date-trigger.gif +0 -0
  132. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/date-trigger.psd +0 -0
  133. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/error-tip-corners.gif +0 -0
  134. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/exclamation.gif +0 -0
  135. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/radio.gif +0 -0
  136. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/search-trigger.gif +0 -0
  137. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/search-trigger.psd +0 -0
  138. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/text-bg.gif +0 -0
  139. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger-square.gif +0 -0
  140. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger-square.psd +0 -0
  141. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger-tpl.gif +0 -0
  142. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger.gif +0 -0
  143. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/form/trigger.psd +0 -0
  144. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/gradient-bg.gif +0 -0
  145. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/arrow-left-white.gif +0 -0
  146. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/arrow-right-white.gif +0 -0
  147. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/col-move-bottom.gif +0 -0
  148. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/col-move-top.gif +0 -0
  149. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/columns.gif +0 -0
  150. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/dirty.gif +0 -0
  151. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/done.gif +0 -0
  152. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/drop-no.gif +0 -0
  153. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/drop-yes.gif +0 -0
  154. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/footer-bg.gif +0 -0
  155. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-blue-hd.gif +0 -0
  156. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-blue-split.gif +0 -0
  157. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-hrow.gif +0 -0
  158. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-loading.gif +0 -0
  159. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-split.gif +0 -0
  160. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid-vista-hd.gif +0 -0
  161. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-hd-btn.gif +0 -0
  162. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-hrow-over.gif +0 -0
  163. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-hrow.gif +0 -0
  164. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-special-col-bg.gif +0 -0
  165. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/grid3-special-col-sel-bg.gif +0 -0
  166. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/group-by.gif +0 -0
  167. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/group-collapse.gif +0 -0
  168. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/group-expand-sprite.gif +0 -0
  169. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/group-expand.gif +0 -0
  170. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hd-pop.gif +0 -0
  171. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-asc.gif +0 -0
  172. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-desc.gif +0 -0
  173. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-lock.gif +0 -0
  174. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-lock.png +0 -0
  175. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-unlock.gif +0 -0
  176. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/hmenu-unlock.png +0 -0
  177. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/invalid_line.gif +0 -0
  178. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/loading.gif +0 -0
  179. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/mso-hd.gif +0 -0
  180. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/nowait.gif +0 -0
  181. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-first-disabled.gif +0 -0
  182. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-first.gif +0 -0
  183. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-last-disabled.gif +0 -0
  184. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-last.gif +0 -0
  185. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-next-disabled.gif +0 -0
  186. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-next.gif +0 -0
  187. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-prev-disabled.gif +0 -0
  188. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/page-prev.gif +0 -0
  189. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/pick-button.gif +0 -0
  190. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/refresh.gif +0 -0
  191. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/row-check-sprite.gif +0 -0
  192. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/row-expand-sprite.gif +0 -0
  193. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/row-over.gif +0 -0
  194. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/row-sel.gif +0 -0
  195. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/sort-hd.gif +0 -0
  196. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/sort_asc.gif +0 -0
  197. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/sort_desc.gif +0 -0
  198. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/grid/wait.gif +0 -0
  199. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/collapse.gif +0 -0
  200. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/expand.gif +0 -0
  201. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/gradient-bg.gif +0 -0
  202. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/mini-bottom.gif +0 -0
  203. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/mini-left.gif +0 -0
  204. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/mini-right.gif +0 -0
  205. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/mini-top.gif +0 -0
  206. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/ns-collapse.gif +0 -0
  207. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/ns-expand.gif +0 -0
  208. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/panel-close.gif +0 -0
  209. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/panel-title-bg.gif +0 -0
  210. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/panel-title-light-bg.gif +0 -0
  211. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/stick.gif +0 -0
  212. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/stuck.gif +0 -0
  213. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/tab-close-on.gif +0 -0
  214. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/layout/tab-close.gif +0 -0
  215. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/checked.gif +0 -0
  216. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/group-checked.gif +0 -0
  217. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/item-over.gif +0 -0
  218. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/menu-parent.gif +0 -0
  219. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/menu.gif +0 -0
  220. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/menu/unchecked.gif +0 -0
  221. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/corners-sprite.gif +0 -0
  222. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/left-right.gif +0 -0
  223. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/light-hd.gif +0 -0
  224. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/tool-sprite-tpl.gif +0 -0
  225. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/tool-sprites.gif +0 -0
  226. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/tools-sprites-trans.gif +0 -0
  227. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/top-bottom.gif +0 -0
  228. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/top-bottom.png +0 -0
  229. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/white-corners-sprite.gif +0 -0
  230. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/white-left-right.gif +0 -0
  231. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/panel/white-top-bottom.gif +0 -0
  232. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/progress/progress-bg.gif +0 -0
  233. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/qtip/bg.gif +0 -0
  234. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/qtip/close.gif +0 -0
  235. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/qtip/tip-anchor-sprite.gif +0 -0
  236. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/qtip/tip-sprite.gif +0 -0
  237. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/s.gif +0 -0
  238. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shadow-c.png +0 -0
  239. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shadow-lr.png +0 -0
  240. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shadow.png +0 -0
  241. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/blue-loading.gif +0 -0
  242. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/calendar.gif +0 -0
  243. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/glass-bg.gif +0 -0
  244. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/hd-sprite.gif +0 -0
  245. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/large-loading.gif +0 -0
  246. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/left-btn.gif +0 -0
  247. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/loading-balls.gif +0 -0
  248. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/right-btn.gif +0 -0
  249. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/shared/warning.gif +0 -0
  250. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/e-handle-dark.gif +0 -0
  251. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/e-handle.gif +0 -0
  252. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/ne-handle-dark.gif +0 -0
  253. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/ne-handle.gif +0 -0
  254. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/nw-handle-dark.gif +0 -0
  255. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/nw-handle.gif +0 -0
  256. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/s-handle-dark.gif +0 -0
  257. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/s-handle.gif +0 -0
  258. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/se-handle-dark.gif +0 -0
  259. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/se-handle.gif +0 -0
  260. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/square.gif +0 -0
  261. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/sw-handle-dark.gif +0 -0
  262. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/sizer/sw-handle.gif +0 -0
  263. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/slider/slider-bg.png +0 -0
  264. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/slider/slider-thumb.png +0 -0
  265. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/slider/slider-v-bg.png +0 -0
  266. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/slider/slider-v-thumb.png +0 -0
  267. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/scroll-left.gif +0 -0
  268. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/scroll-right.gif +0 -0
  269. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/scroller-bg.gif +0 -0
  270. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
  271. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
  272. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-left-bg.gif +0 -0
  273. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-over-left-bg.gif +0 -0
  274. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-over-right-bg.gif +0 -0
  275. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-btm-right-bg.gif +0 -0
  276. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-close.gif +0 -0
  277. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-strip-bg.gif +0 -0
  278. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-strip-bg.png +0 -0
  279. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tab-strip-btm-bg.gif +0 -0
  280. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tabs/tabs-sprite.gif +0 -0
  281. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/bg.gif +0 -0
  282. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/btn-arrow-light.gif +0 -0
  283. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/btn-arrow.gif +0 -0
  284. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/btn-over-bg.gif +0 -0
  285. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/gray-bg.gif +0 -0
  286. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/more.gif +0 -0
  287. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/tb-bg.gif +0 -0
  288. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/tb-btn-sprite.gif +0 -0
  289. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/tb-xl-btn-sprite.gif +0 -0
  290. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/toolbar/tb-xl-sep.gif +0 -0
  291. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/arrows.gif +0 -0
  292. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-add.gif +0 -0
  293. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-between.gif +0 -0
  294. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-no.gif +0 -0
  295. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-over.gif +0 -0
  296. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-under.gif +0 -0
  297. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/drop-yes.gif +0 -0
  298. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end-minus-nl.gif +0 -0
  299. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end-minus.gif +0 -0
  300. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end-plus-nl.gif +0 -0
  301. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end-plus.gif +0 -0
  302. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-end.gif +0 -0
  303. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-line.gif +0 -0
  304. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-minus-nl.gif +0 -0
  305. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-minus.gif +0 -0
  306. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-plus-nl.gif +0 -0
  307. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow-plus.gif +0 -0
  308. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/elbow.gif +0 -0
  309. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/folder-open.gif +0 -0
  310. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/folder.gif +0 -0
  311. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/leaf.gif +0 -0
  312. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/loading.gif +0 -0
  313. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/tree/s.gif +0 -0
  314. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/icon-error.gif +0 -0
  315. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/icon-info.gif +0 -0
  316. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/icon-question.gif +0 -0
  317. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/icon-warning.gif +0 -0
  318. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/left-corners.png +0 -0
  319. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/left-corners.psd +0 -0
  320. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/left-right.png +0 -0
  321. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/left-right.psd +0 -0
  322. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/right-corners.png +0 -0
  323. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/right-corners.psd +0 -0
  324. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/top-bottom.png +0 -0
  325. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/default/window/top-bottom.psd +0 -0
  326. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/btn-arrow.gif +0 -0
  327. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/btn-sprite.gif +0 -0
  328. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/btn.gif +0 -0
  329. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/group-cs.gif +0 -0
  330. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/group-lr.gif +0 -0
  331. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/group-tb.gif +0 -0
  332. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/s-arrow-bo.gif +0 -0
  333. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/button/s-arrow-o.gif +0 -0
  334. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/clear-trigger.gif +0 -0
  335. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/date-trigger.gif +0 -0
  336. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/search-trigger.gif +0 -0
  337. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/trigger-square.gif +0 -0
  338. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/form/trigger.gif +0 -0
  339. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/gradient-bg.gif +0 -0
  340. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/col-move-bottom.gif +0 -0
  341. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/col-move-top.gif +0 -0
  342. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hd-btn.gif +0 -0
  343. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hrow-over.gif +0 -0
  344. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hrow-over2.gif +0 -0
  345. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hrow.gif +0 -0
  346. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-hrow2.gif +0 -0
  347. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-special-col-bg.gif +0 -0
  348. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-special-col-bg2.gif +0 -0
  349. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/grid3-special-col-sel-bg.gif +0 -0
  350. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/group-collapse.gif +0 -0
  351. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/group-expand-sprite.gif +0 -0
  352. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/group-expand.gif +0 -0
  353. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/page-first.gif +0 -0
  354. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/page-last.gif +0 -0
  355. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/page-next.gif +0 -0
  356. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/page-prev.gif +0 -0
  357. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/refresh.gif +0 -0
  358. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/row-expand-sprite.gif +0 -0
  359. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/sort_asc.gif +0 -0
  360. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/grid/sort_desc.gif +0 -0
  361. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/menu/group-checked.gif +0 -0
  362. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/menu/item-over-disabled.gif +0 -0
  363. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/menu/item-over.gif +0 -0
  364. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/menu/menu-parent.gif +0 -0
  365. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/corners-sprite.gif +0 -0
  366. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/left-right.gif +0 -0
  367. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/light-hd.gif +0 -0
  368. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/tool-sprite-tpl.gif +0 -0
  369. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/tool-sprites.gif +0 -0
  370. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/tools-sprites-trans.gif +0 -0
  371. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/top-bottom.gif +0 -0
  372. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/top-bottom.png +0 -0
  373. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/white-corners-sprite.gif +0 -0
  374. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/white-left-right.gif +0 -0
  375. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/panel/white-top-bottom.gif +0 -0
  376. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/progress/progress-bg.gif +0 -0
  377. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/qtip/bg.gif +0 -0
  378. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/qtip/close.gif +0 -0
  379. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/qtip/tip-anchor-sprite.gif +0 -0
  380. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/qtip/tip-sprite.gif +0 -0
  381. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/s.gif +0 -0
  382. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/shared/hd-sprite.gif +0 -0
  383. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/shared/left-btn.gif +0 -0
  384. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/shared/right-btn.gif +0 -0
  385. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/e-handle.gif +0 -0
  386. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/ne-handle.gif +0 -0
  387. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/nw-handle.gif +0 -0
  388. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/s-handle.gif +0 -0
  389. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/se-handle.gif +0 -0
  390. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/square.gif +0 -0
  391. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/sizer/sw-handle.gif +0 -0
  392. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/slider/slider-thumb.png +0 -0
  393. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/slider/slider-v-thumb.png +0 -0
  394. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/scroll-left.gif +0 -0
  395. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/scroll-right.gif +0 -0
  396. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/scroller-bg.gif +0 -0
  397. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-inactive-left-bg.gif +0 -0
  398. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-inactive-right-bg.gif +0 -0
  399. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-left-bg.gif +0 -0
  400. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-over-left-bg.gif +0 -0
  401. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-over-right-bg.gif +0 -0
  402. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-btm-right-bg.gif +0 -0
  403. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-close.gif +0 -0
  404. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-strip-bg.gif +0 -0
  405. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-strip-bg.png +0 -0
  406. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tab-strip-btm-bg.gif +0 -0
  407. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tabs/tabs-sprite.gif +0 -0
  408. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/bg.gif +0 -0
  409. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/btn-arrow-light.gif +0 -0
  410. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/btn-arrow.gif +0 -0
  411. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/btn-over-bg.gif +0 -0
  412. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/gray-bg.gif +0 -0
  413. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/more.gif +0 -0
  414. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/tb-bg.gif +0 -0
  415. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/toolbar/tb-btn-sprite.gif +0 -0
  416. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/arrows.gif +0 -0
  417. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/elbow-end-minus-nl.gif +0 -0
  418. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/elbow-end-minus.gif +0 -0
  419. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/elbow-end-plus-nl.gif +0 -0
  420. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/tree/elbow-end-plus.gif +0 -0
  421. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/icon-error.gif +0 -0
  422. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/icon-info.gif +0 -0
  423. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/icon-question.gif +0 -0
  424. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/icon-warning.gif +0 -0
  425. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/left-corners.png +0 -0
  426. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/left-corners.pspimage +0 -0
  427. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/left-right.png +0 -0
  428. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/right-corners.png +0 -0
  429. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/images/gray/window/top-bottom.png +0 -0
  430. data/vendor/assets/javascripts/aloha/lib/vendor/ext-3.2.1/resources/resources.jsb +507 -0
  431. data/vendor/assets/javascripts/aloha/lib/vendor/jquery-1.6.1.js +8936 -0
  432. data/vendor/assets/javascripts/aloha/lib/vendor/jquery.json-2.2.min.js +33 -0
  433. data/vendor/assets/javascripts/aloha/lib/vendor/jquery.store.js +446 -0
  434. data/vendor/assets/javascripts/aloha/lib/vendor/sanitize.js +267 -0
  435. data/vendor/assets/javascripts/aloha/plugins/common/abbr/css/abbr.css +0 -0
  436. data/vendor/assets/javascripts/aloha/plugins/common/abbr/lib/abbr-plugin.js +293 -0
  437. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/de/i18n.js +1 -0
  438. data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/i18n.js +4 -0
  439. data/vendor/assets/javascripts/aloha/plugins/common/abbr/package.json +1 -0
  440. data/vendor/assets/javascripts/aloha/plugins/common/align/LICENSE +166 -0
  441. data/vendor/assets/javascripts/aloha/plugins/common/align/README +12 -0
  442. data/vendor/assets/javascripts/aloha/plugins/common/align/css/align.css +19 -0
  443. data/vendor/assets/javascripts/aloha/plugins/common/align/img/align.png +0 -0
  444. data/vendor/assets/javascripts/aloha/plugins/common/align/lib/align-plugin.js +345 -0
  445. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/en/i18n.js +1 -0
  446. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/fr/i18n.js +1 -0
  447. data/vendor/assets/javascripts/aloha/plugins/common/align/nls/i18n.js +6 -0
  448. data/vendor/assets/javascripts/aloha/plugins/common/align/package.json +2 -0
  449. data/vendor/assets/javascripts/aloha/plugins/common/block/README +0 -0
  450. data/vendor/assets/javascripts/aloha/plugins/common/block/css/block.css +51 -0
  451. data/vendor/assets/javascripts/aloha/plugins/common/block/img/toolbar-draghandle.gif +0 -0
  452. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/block-plugin.js +104 -0
  453. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/block.js +442 -0
  454. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/blockcontenthandler.js +58 -0
  455. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/blockmanager.js +242 -0
  456. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/editor.js +209 -0
  457. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/editormanager.js +34 -0
  458. data/vendor/assets/javascripts/aloha/plugins/common/block/lib/sidebarattributeeditor.js +119 -0
  459. data/vendor/assets/javascripts/aloha/plugins/common/block/package.json +11 -0
  460. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/css/characterpicker.css +38 -0
  461. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/img/icon.png +0 -0
  462. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/lib/characterpicker-plugin.js +227 -0
  463. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/de/i18n.js +1 -0
  464. data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/i18n.js +4 -0
  465. data/vendor/assets/javascripts/aloha/plugins/common/commands/css/abbr.css +0 -0
  466. data/vendor/assets/javascripts/aloha/plugins/common/commands/lib/commands-plugin.js +15 -0
  467. data/vendor/assets/javascripts/aloha/plugins/common/commands/lib/inserthtml.js +107 -0
  468. data/vendor/assets/javascripts/aloha/plugins/common/commands/package.json +1 -0
  469. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/README.md +0 -0
  470. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/contenthandler-plugin.js +54 -0
  471. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/genericcontenthandler.js +255 -0
  472. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/oembedcontenthandler.js +276 -0
  473. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/sanitizecontenthandler.js +136 -0
  474. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/wordcontenthandler.js +279 -0
  475. data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/package.json +1 -0
  476. data/vendor/assets/javascripts/aloha/plugins/common/format/css/format.css +8 -0
  477. data/vendor/assets/javascripts/aloha/plugins/common/format/img/em.png +0 -0
  478. data/vendor/assets/javascripts/aloha/plugins/common/format/img/strong.png +0 -0
  479. data/vendor/assets/javascripts/aloha/plugins/common/format/lib/format-plugin.js +303 -0
  480. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/de/i18n.js +1 -0
  481. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/eo/i18n.js +1 -0
  482. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/fi/i18n.js +1 -0
  483. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/fr/i18n.js +1 -0
  484. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/i18n.js +10 -0
  485. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/it/i18n.js +1 -0
  486. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/pl/i18n.js +1 -0
  487. data/vendor/assets/javascripts/aloha/plugins/common/format/nls/ru/i18n.js +1 -0
  488. data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/css/highlighteditables.css +14 -0
  489. data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/lib/highlighteditables-plugin.js +72 -0
  490. data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/package.json +1 -0
  491. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/css/horizontalruler.css +4 -0
  492. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/img/icon.png +0 -0
  493. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/lib/horizontalruler-plugin.js +55 -0
  494. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/de/i18n.js +1 -0
  495. data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/i18n.js +4 -0
  496. data/vendor/assets/javascripts/aloha/plugins/common/image/AGPL3 +661 -0
  497. data/vendor/assets/javascripts/aloha/plugins/common/image/LICENSE +25 -0
  498. data/vendor/assets/javascripts/aloha/plugins/common/image/README.md +83 -0
  499. data/vendor/assets/javascripts/aloha/plugins/common/image/css/image.css +124 -0
  500. data/vendor/assets/javascripts/aloha/plugins/common/image/demo/crop.html +76 -0
  501. data/vendor/assets/javascripts/aloha/plugins/common/image/demo/crop.php +21 -0
  502. data/vendor/assets/javascripts/aloha/plugins/common/image/demo/cropnresize.jpg +0 -0
  503. data/vendor/assets/javascripts/aloha/plugins/common/image/demo/index.html +120 -0
  504. data/vendor/assets/javascripts/aloha/plugins/common/image/img/blank.jpg +0 -0
  505. data/vendor/assets/javascripts/aloha/plugins/common/image/img/cropnresize.png +0 -0
  506. data/vendor/assets/javascripts/aloha/plugins/common/image/img/handle-sw.png +0 -0
  507. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-left.png +0 -0
  508. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-none.png +0 -0
  509. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-right.png +0 -0
  510. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-border.png +0 -0
  511. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-title.png +0 -0
  512. data/vendor/assets/javascripts/aloha/plugins/common/image/img/image.gif +0 -0
  513. data/vendor/assets/javascripts/aloha/plugins/common/image/img/padding-decrease.gif +0 -0
  514. data/vendor/assets/javascripts/aloha/plugins/common/image/img/padding-increase.gif +0 -0
  515. data/vendor/assets/javascripts/aloha/plugins/common/image/img/page.png +0 -0
  516. data/vendor/assets/javascripts/aloha/plugins/common/image/img/size-decrease.gif +0 -0
  517. data/vendor/assets/javascripts/aloha/plugins/common/image/img/size-increase.gif +0 -0
  518. data/vendor/assets/javascripts/aloha/plugins/common/image/lib/image-plugin.js +1615 -0
  519. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/cz/i18n.js +16 -0
  520. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/de/i18n.js +1 -0
  521. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/fr/i18n.js +1 -0
  522. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/i18n.js +7 -0
  523. data/vendor/assets/javascripts/aloha/plugins/common/image/nls/ru/i18n.js +16 -0
  524. data/vendor/assets/javascripts/aloha/plugins/common/image/package.json +1 -0
  525. data/vendor/assets/javascripts/aloha/plugins/common/image/test/test.css +12 -0
  526. data/vendor/assets/javascripts/aloha/plugins/common/image/test/test.html +40 -0
  527. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jcrop.gif +0 -0
  528. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jquery.jcrop.css +35 -0
  529. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jquery.jcrop.min.js +163 -0
  530. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/mousewheel/mousewheel.js +60 -0
  531. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/jquery-ui-1.8.10.custom.min.js +97 -0
  532. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  533. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  534. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  535. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  536. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  537. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  538. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  539. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  540. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  541. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  542. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  543. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  544. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  545. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  546. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/jquery-ui-1.8.10.cropnresize.css +33 -0
  547. data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/jquery-ui-1.8.10.custom.css +314 -0
  548. data/vendor/assets/javascripts/aloha/plugins/common/link/css/link.css +55 -0
  549. data/vendor/assets/javascripts/aloha/plugins/common/link/demo/background.png +0 -0
  550. data/vendor/assets/javascripts/aloha/plugins/common/link/demo/external-link-ltr-icon.png +0 -0
  551. data/vendor/assets/javascripts/aloha/plugins/common/link/demo/index.css +91 -0
  552. data/vendor/assets/javascripts/aloha/plugins/common/link/demo/index.html +91 -0
  553. data/vendor/assets/javascripts/aloha/plugins/common/link/extra/delicious.js +246 -0
  554. data/vendor/assets/javascripts/aloha/plugins/common/link/extra/linklist.js +227 -0
  555. data/vendor/assets/javascripts/aloha/plugins/common/link/extra/slowlinklist.js +228 -0
  556. data/vendor/assets/javascripts/aloha/plugins/common/link/lib/link-plugin.js +759 -0
  557. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/de/i18n.js +13 -0
  558. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/fr/i18n.js +6 -0
  559. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/i18n.js +9 -0
  560. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/pl/i18n.js +6 -0
  561. data/vendor/assets/javascripts/aloha/plugins/common/link/nls/ru/i18n.js +6 -0
  562. data/vendor/assets/javascripts/aloha/plugins/common/list/lib/list-plugin.js +849 -0
  563. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/de/i18n.js +1 -0
  564. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/eo/i18n.js +1 -0
  565. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/fi/i18n.js +1 -0
  566. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/fr/i18n.js +1 -0
  567. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/i18n.js +9 -0
  568. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/it/i18n.js +1 -0
  569. data/vendor/assets/javascripts/aloha/plugins/common/list/nls/ru/i18n.js +1 -0
  570. data/vendor/assets/javascripts/aloha/plugins/common/list/package.json +1 -0
  571. data/vendor/assets/javascripts/aloha/plugins/common/paste/README.md +3 -0
  572. data/vendor/assets/javascripts/aloha/plugins/common/paste/lib/paste-plugin.js +221 -0
  573. data/vendor/assets/javascripts/aloha/plugins/common/paste/package.json +8 -0
  574. data/vendor/assets/javascripts/aloha/plugins/common/table/css/table.css +160 -0
  575. data/vendor/assets/javascripts/aloha/plugins/common/table/img/down.cur +0 -0
  576. data/vendor/assets/javascripts/aloha/plugins/common/table/img/left.cur +0 -0
  577. data/vendor/assets/javascripts/aloha/plugins/common/table/img/table_layout.png +0 -0
  578. data/vendor/assets/javascripts/aloha/plugins/common/table/img/wai-green.png +0 -0
  579. data/vendor/assets/javascripts/aloha/plugins/common/table/img/wai-red.png +0 -0
  580. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-cell.js +463 -0
  581. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-create-layer.js +210 -0
  582. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-plugin-utils.js +355 -0
  583. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-plugin.js +1498 -0
  584. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-selection.js +374 -0
  585. data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table.js +1529 -0
  586. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/de/i18n.js +1 -0
  587. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/eo/i18n.js +1 -0
  588. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/fi/i18n.js +1 -0
  589. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/fr/i18n.js +1 -0
  590. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/i18n.js +11 -0
  591. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/it/i18n.js +1 -0
  592. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/pl/i18n.js +1 -0
  593. data/vendor/assets/javascripts/aloha/plugins/common/table/nls/ru/i18n.js +1 -0
  594. data/vendor/assets/javascripts/aloha/plugins/common/table/package.json +1 -0
  595. data/vendor/assets/javascripts/aloha/plugins/common/undo/demo/index.css +49 -0
  596. data/vendor/assets/javascripts/aloha/plugins/common/undo/demo/index.html +85 -0
  597. data/vendor/assets/javascripts/aloha/plugins/common/undo/lib/undo-plugin.js +134 -0
  598. data/vendor/assets/javascripts/aloha/plugins/common/undo/package.json +7 -0
  599. data/vendor/assets/javascripts/aloha/plugins/common/undo/vendor/diff_match_patch_uncompressed.js +2155 -0
  600. data/vendor/assets/javascripts/aloha/plugins/common/undo/vendor/undo.js +119 -0
  601. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/README +0 -0
  602. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/css/attributes.css +12 -0
  603. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/lib/attributes-plugin.js +217 -0
  604. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/de/i18n.js +1 -0
  605. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/en/i18n.js +1 -0
  606. data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/i18n.js +5 -0
  607. data/vendor/assets/javascripts/aloha/plugins/extra/browser/README +0 -0
  608. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/browser.css +360 -0
  609. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/browser.jqgrid.css +374 -0
  610. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/browsercombined.css +752 -0
  611. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  612. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  613. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  614. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  615. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  616. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  617. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  618. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  619. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_222222_256x240.png +0 -0
  620. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_2e83ff_256x240.png +0 -0
  621. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_454545_256x240.png +0 -0
  622. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_888888_256x240.png +0 -0
  623. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  624. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/jquery-ui-1.8.13.custom.css +319 -0
  625. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/jstree.css +88 -0
  626. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/throbber.gif +0 -0
  627. data/vendor/assets/javascripts/aloha/plugins/extra/browser/css/ui.jqgrid.css +148 -0
  628. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-000-medium.png +0 -0
  629. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-180.png +0 -0
  630. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-315-medium.png +0 -0
  631. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-stop-180.png +0 -0
  632. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow-stop.png +0 -0
  633. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/arrow.png +0 -0
  634. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/control-stop-square-small.png +0 -0
  635. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/folder-horizontal-open.png +0 -0
  636. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/folder-open.png +0 -0
  637. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/gcn-icons/gcn-icon-file.gif +0 -0
  638. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/gcn-icons/gcn-icon-image.gif +0 -0
  639. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/gcn-icons/gcn-icon-page.gif +0 -0
  640. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/magnifier-left.png +0 -0
  641. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/page.png +0 -0
  642. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/picture.png +0 -0
  643. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/sort-alphabet-descending.png +0 -0
  644. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/sort-alphabet.png +0 -0
  645. data/vendor/assets/javascripts/aloha/plugins/extra/browser/img/throbber.gif +0 -0
  646. data/vendor/assets/javascripts/aloha/plugins/extra/browser/lib/browser-plugin.js +10 -0
  647. data/vendor/assets/javascripts/aloha/plugins/extra/browser/lib/browser.js +1103 -0
  648. data/vendor/assets/javascripts/aloha/plugins/extra/browser/lib/locale.js +26 -0
  649. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/de.json +1 -0
  650. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/de/i18n.js +18 -0
  651. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/en.json +1 -0
  652. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/en/i18n.js +18 -0
  653. data/vendor/assets/javascripts/aloha/plugins/extra/browser/nls/i18n.js +4 -0
  654. data/vendor/assets/javascripts/aloha/plugins/extra/browser/vendor/grid.locale.de.js +134 -0
  655. data/vendor/assets/javascripts/aloha/plugins/extra/browser/vendor/grid.locale.en.js +129 -0
  656. data/vendor/assets/javascripts/aloha/plugins/extra/browser/vendor/jquery.jqGrid.js +467 -0
  657. data/vendor/assets/javascripts/aloha/plugins/extra/browser/vendor/jquery.jstree.js +4544 -0
  658. data/vendor/assets/javascripts/aloha/plugins/extra/browser/vendor/jquery.ui.js +756 -0
  659. data/vendor/assets/javascripts/aloha/plugins/extra/browser/vendor/ui-layout.js +108 -0
  660. data/vendor/assets/javascripts/aloha/plugins/extra/cite/README +0 -0
  661. data/vendor/assets/javascripts/aloha/plugins/extra/cite/css/cite.css +49 -0
  662. data/vendor/assets/javascripts/aloha/plugins/extra/cite/img/blockquote.png +0 -0
  663. data/vendor/assets/javascripts/aloha/plugins/extra/cite/img/icon_cite.png +0 -0
  664. data/vendor/assets/javascripts/aloha/plugins/extra/cite/lib/cite-plugin.js +539 -0
  665. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/de/i18n.js +1 -0
  666. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/en/i18n.js +1 -0
  667. data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/i18n.js +4 -0
  668. data/vendor/assets/javascripts/aloha/plugins/extra/cite/package.json +1 -0
  669. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/add-icon.png +0 -0
  670. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/add.png +0 -0
  671. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/comments.png +0 -0
  672. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/hr.png +0 -0
  673. data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/textbox.png +0 -0
  674. data/vendor/assets/javascripts/aloha/plugins/extra/comments/package.json +1 -0
  675. data/vendor/assets/javascripts/aloha/plugins/extra/comments/src/comments.css +442 -0
  676. data/vendor/assets/javascripts/aloha/plugins/extra/comments/src/comments.js +669 -0
  677. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/AGPL3 +661 -0
  678. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/LICENSE +25 -0
  679. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/README.md +5 -0
  680. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/TODO.md +2 -0
  681. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/index.css +47 -0
  682. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/index.html +101 -0
  683. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/migration/index.css +189 -0
  684. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/migration/index.html +321 -0
  685. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/specs/DragnDropnImage.graphml +677 -0
  686. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/style.css +47 -0
  687. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/demo/upload.php +26 -0
  688. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/i18n/en.json +1 -0
  689. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/i18n/fr.json +1 -0
  690. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/cross.png +0 -0
  691. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/hourglass.png +0 -0
  692. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/loading.gif +0 -0
  693. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/page.png +0 -0
  694. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/tick.png +0 -0
  695. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/draganddropfiles-plugin.js +4 -0
  696. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dragndropfiles.css +110 -0
  697. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dragndropfiles.js +349 -0
  698. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dropfilesrepository.js +365 -0
  699. data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/package.json +1 -0
  700. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/README.md +3 -0
  701. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/css/formatless.css +7 -0
  702. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/img/button.png +0 -0
  703. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/lib/formatlesshandler.js +67 -0
  704. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/lib/formatlesspaste-plugin.js +103 -0
  705. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/de/i18n.js +1 -0
  706. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/i18n.js +7 -0
  707. data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/package.json +8 -0
  708. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/README +0 -0
  709. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/css/headerids.css +8 -0
  710. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/lib/headerids-plugin.js +127 -0
  711. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/de/i18n.js +1 -0
  712. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/en/i18n.js +1 -0
  713. data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/i18n.js +5 -0
  714. data/vendor/assets/javascripts/aloha/plugins/extra/hints/dep/jquery.poshytip.js +470 -0
  715. data/vendor/assets/javascripts/aloha/plugins/extra/hints/i18n/de.json +1 -0
  716. data/vendor/assets/javascripts/aloha/plugins/extra/hints/i18n/en.json +1 -0
  717. data/vendor/assets/javascripts/aloha/plugins/extra/hints/img/tip-twitter_arrows.gif +0 -0
  718. data/vendor/assets/javascripts/aloha/plugins/extra/hints/package.json +9 -0
  719. data/vendor/assets/javascripts/aloha/plugins/extra/hints/src/hints.css +61 -0
  720. data/vendor/assets/javascripts/aloha/plugins/extra/hints/src/hints.js +49 -0
  721. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/README +0 -0
  722. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ad.png +0 -0
  723. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ae.png +0 -0
  724. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/af.png +0 -0
  725. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ag.png +0 -0
  726. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ai.png +0 -0
  727. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/al.png +0 -0
  728. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/am.png +0 -0
  729. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/an.png +0 -0
  730. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ao.png +0 -0
  731. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ar.png +0 -0
  732. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/as.png +0 -0
  733. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/at.png +0 -0
  734. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/au.png +0 -0
  735. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/aw.png +0 -0
  736. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ax.png +0 -0
  737. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/az.png +0 -0
  738. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ba.png +0 -0
  739. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bb.png +0 -0
  740. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bd.png +0 -0
  741. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/be.png +0 -0
  742. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bf.png +0 -0
  743. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bg.png +0 -0
  744. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bh.png +0 -0
  745. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bi.png +0 -0
  746. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bj.png +0 -0
  747. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bm.png +0 -0
  748. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bn.png +0 -0
  749. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bo.png +0 -0
  750. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/br.png +0 -0
  751. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bs.png +0 -0
  752. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bt.png +0 -0
  753. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bv.png +0 -0
  754. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bw.png +0 -0
  755. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/by.png +0 -0
  756. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bz.png +0 -0
  757. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ca.png +0 -0
  758. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/catalonia.png +0 -0
  759. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cc.png +0 -0
  760. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cd.png +0 -0
  761. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cf.png +0 -0
  762. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cg.png +0 -0
  763. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ch.png +0 -0
  764. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ci.png +0 -0
  765. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ck.png +0 -0
  766. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cl.png +0 -0
  767. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cm.png +0 -0
  768. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cn.png +0 -0
  769. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/co.png +0 -0
  770. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cr.png +0 -0
  771. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cs.png +0 -0
  772. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cu.png +0 -0
  773. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cv.png +0 -0
  774. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cx.png +0 -0
  775. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cy.png +0 -0
  776. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cz.png +0 -0
  777. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/de.png +0 -0
  778. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dj.png +0 -0
  779. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dk.png +0 -0
  780. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dm.png +0 -0
  781. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/do.png +0 -0
  782. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dz.png +0 -0
  783. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ec.png +0 -0
  784. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ee.png +0 -0
  785. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/eg.png +0 -0
  786. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/eh.png +0 -0
  787. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/en.png +0 -0
  788. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/er.png +0 -0
  789. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/es.png +0 -0
  790. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/et.png +0 -0
  791. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/europeanunion.png +0 -0
  792. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fam.png +0 -0
  793. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fi.png +0 -0
  794. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fj.png +0 -0
  795. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fk.png +0 -0
  796. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fm.png +0 -0
  797. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fo.png +0 -0
  798. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fr.png +0 -0
  799. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ga.png +0 -0
  800. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gb.png +0 -0
  801. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gd.png +0 -0
  802. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ge.png +0 -0
  803. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gf.png +0 -0
  804. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gh.png +0 -0
  805. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gi.png +0 -0
  806. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gl.png +0 -0
  807. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gm.png +0 -0
  808. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gn.png +0 -0
  809. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gp.png +0 -0
  810. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gq.png +0 -0
  811. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gr.png +0 -0
  812. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gs.png +0 -0
  813. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gt.png +0 -0
  814. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gu.png +0 -0
  815. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gw.png +0 -0
  816. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gy.png +0 -0
  817. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hk.png +0 -0
  818. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hm.png +0 -0
  819. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hn.png +0 -0
  820. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hr.png +0 -0
  821. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ht.png +0 -0
  822. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hu.png +0 -0
  823. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/id.png +0 -0
  824. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ie.png +0 -0
  825. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/il.png +0 -0
  826. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/in.png +0 -0
  827. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/io.png +0 -0
  828. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/iq.png +0 -0
  829. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ir.png +0 -0
  830. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/is.png +0 -0
  831. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/it.png +0 -0
  832. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jm.png +0 -0
  833. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jo.png +0 -0
  834. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jp.png +0 -0
  835. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ke.png +0 -0
  836. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kg.png +0 -0
  837. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kh.png +0 -0
  838. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ki.png +0 -0
  839. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/km.png +0 -0
  840. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kn.png +0 -0
  841. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kp.png +0 -0
  842. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kr.png +0 -0
  843. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kw.png +0 -0
  844. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ky.png +0 -0
  845. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kz.png +0 -0
  846. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/la.png +0 -0
  847. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lb.png +0 -0
  848. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lc.png +0 -0
  849. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/li.png +0 -0
  850. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lk.png +0 -0
  851. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lr.png +0 -0
  852. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ls.png +0 -0
  853. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lt.png +0 -0
  854. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lu.png +0 -0
  855. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lv.png +0 -0
  856. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ly.png +0 -0
  857. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ma.png +0 -0
  858. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mc.png +0 -0
  859. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/md.png +0 -0
  860. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/me.png +0 -0
  861. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mg.png +0 -0
  862. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mh.png +0 -0
  863. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mk.png +0 -0
  864. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ml.png +0 -0
  865. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mm.png +0 -0
  866. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mn.png +0 -0
  867. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mo.png +0 -0
  868. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mp.png +0 -0
  869. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mq.png +0 -0
  870. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mr.png +0 -0
  871. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ms.png +0 -0
  872. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mt.png +0 -0
  873. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mu.png +0 -0
  874. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mv.png +0 -0
  875. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mw.png +0 -0
  876. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mx.png +0 -0
  877. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/my.png +0 -0
  878. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mz.png +0 -0
  879. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/na.png +0 -0
  880. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nc.png +0 -0
  881. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ne.png +0 -0
  882. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nf.png +0 -0
  883. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ng.png +0 -0
  884. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ni.png +0 -0
  885. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nl.png +0 -0
  886. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/no.png +0 -0
  887. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/np.png +0 -0
  888. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nr.png +0 -0
  889. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nu.png +0 -0
  890. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nz.png +0 -0
  891. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/om.png +0 -0
  892. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pa.png +0 -0
  893. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pe.png +0 -0
  894. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pf.png +0 -0
  895. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pg.png +0 -0
  896. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ph.png +0 -0
  897. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pk.png +0 -0
  898. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pl.png +0 -0
  899. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pm.png +0 -0
  900. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pn.png +0 -0
  901. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pr.png +0 -0
  902. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ps.png +0 -0
  903. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pt.png +0 -0
  904. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pw.png +0 -0
  905. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/py.png +0 -0
  906. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/qa.png +0 -0
  907. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/re.png +0 -0
  908. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ro.png +0 -0
  909. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/rs.png +0 -0
  910. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ru.png +0 -0
  911. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/rw.png +0 -0
  912. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sa.png +0 -0
  913. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sb.png +0 -0
  914. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sc.png +0 -0
  915. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/scotland.png +0 -0
  916. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sd.png +0 -0
  917. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/se.png +0 -0
  918. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sg.png +0 -0
  919. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sh.png +0 -0
  920. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/si.png +0 -0
  921. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sj.png +0 -0
  922. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sk.png +0 -0
  923. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sl.png +0 -0
  924. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sm.png +0 -0
  925. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sn.png +0 -0
  926. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/so.png +0 -0
  927. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sr.png +0 -0
  928. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/st.png +0 -0
  929. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sv.png +0 -0
  930. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sy.png +0 -0
  931. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sz.png +0 -0
  932. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tc.png +0 -0
  933. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/td.png +0 -0
  934. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tf.png +0 -0
  935. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tg.png +0 -0
  936. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/th.png +0 -0
  937. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tj.png +0 -0
  938. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tk.png +0 -0
  939. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tl.png +0 -0
  940. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tm.png +0 -0
  941. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tn.png +0 -0
  942. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/to.png +0 -0
  943. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tr.png +0 -0
  944. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tt.png +0 -0
  945. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tv.png +0 -0
  946. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tw.png +0 -0
  947. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tz.png +0 -0
  948. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ua.png +0 -0
  949. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ug.png +0 -0
  950. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/um.png +0 -0
  951. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/us.png +0 -0
  952. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/uy.png +0 -0
  953. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/uz.png +0 -0
  954. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/va.png +0 -0
  955. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vc.png +0 -0
  956. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ve.png +0 -0
  957. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vg.png +0 -0
  958. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vi.png +0 -0
  959. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vn.png +0 -0
  960. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vu.png +0 -0
  961. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/wales.png +0 -0
  962. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/wf.png +0 -0
  963. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ws.png +0 -0
  964. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ye.png +0 -0
  965. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/yt.png +0 -0
  966. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/za.png +0 -0
  967. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/zm.png +0 -0
  968. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/zw.png +0 -0
  969. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/lib/linkbrowser-plugin.js +153 -0
  970. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/de/i18n.js +1 -0
  971. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/fr/i18n.js +1 -0
  972. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/i18n.js +7 -0
  973. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/pl/i18n.js +1 -0
  974. data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/ru/i18n.js +1 -0
  975. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/demo/index.css +49 -0
  976. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/demo/index.html +82 -0
  977. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/i18n/en.json +1 -0
  978. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/package.json +1 -0
  979. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/proxy.php +244 -0
  980. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/src/linkchecker.css +14 -0
  981. data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/src/linkchecker.js +256 -0
  982. data/vendor/assets/javascripts/aloha/plugins/extra/listenforcer/lib/listenforcer-plugin.js +165 -0
  983. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/README +0 -0
  984. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/css/metaview.css +86 -0
  985. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/anchor.png +0 -0
  986. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/blockquote.png +0 -0
  987. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/button.png +0 -0
  988. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/caption.png +0 -0
  989. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/cite.png +0 -0
  990. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dd.png +0 -0
  991. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/div.png +0 -0
  992. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dl.png +0 -0
  993. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dt.png +0 -0
  994. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h1.png +0 -0
  995. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h2.png +0 -0
  996. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h3.png +0 -0
  997. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h4.png +0 -0
  998. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h5.png +0 -0
  999. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h6.png +0 -0
  1000. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/icon_cite.png +0 -0
  1001. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/p.png +0 -0
  1002. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/pre.png +0 -0
  1003. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/table.png +0 -0
  1004. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/td.png +0 -0
  1005. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/th.png +0 -0
  1006. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/lib/metaview-plugin.js +82 -0
  1007. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/de.json +1 -0
  1008. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/de/i18n.js +1 -0
  1009. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/en.json +1 -0
  1010. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/en/i18n.js +1 -0
  1011. data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/i18n.js +5 -0
  1012. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/README +0 -0
  1013. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/css/numerated-headers.css +7 -0
  1014. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/demo/index.css +189 -0
  1015. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/demo/index.html +139 -0
  1016. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/demo/js/aloha-config.js +115 -0
  1017. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/img/headers.png +0 -0
  1018. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/lib/numerated-headers-plugin.js +233 -0
  1019. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/de/i18n.js +1 -0
  1020. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/en/i18n.js +1 -0
  1021. data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/i18n.js +5 -0
  1022. data/vendor/assets/javascripts/aloha/plugins/extra/profiler/css/profiler.css +34 -0
  1023. data/vendor/assets/javascripts/aloha/plugins/extra/profiler/lib/profiler-plugin.js +285 -0
  1024. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/LICENSE.md +662 -0
  1025. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/README.md +8 -0
  1026. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/css/ribbon.css +10 -0
  1027. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/lib/ribbon-plugin.js +186 -0
  1028. data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/package.json +1 -0
  1029. data/vendor/assets/javascripts/aloha/plugins/extra/toc/i18n/de.json +1 -0
  1030. data/vendor/assets/javascripts/aloha/plugins/extra/toc/i18n/en.json +1 -0
  1031. data/vendor/assets/javascripts/aloha/plugins/extra/toc/package.json +1 -0
  1032. data/vendor/assets/javascripts/aloha/plugins/extra/toc/src/toc.js +350 -0
  1033. data/vendor/assets/javascripts/aloha/plugins/extra/vie/LICENSE +22 -0
  1034. data/vendor/assets/javascripts/aloha/plugins/extra/vie/README.markdown +65 -0
  1035. data/vendor/assets/javascripts/aloha/plugins/extra/vie/demo/index.html +93 -0
  1036. data/vendor/assets/javascripts/aloha/plugins/extra/vie/img/cms-decoupled-communications.png +0 -0
  1037. data/vendor/assets/javascripts/aloha/plugins/extra/vie/package.json +1 -0
  1038. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/backbone-min.js +27 -0
  1039. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/underscore-min.js +25 -0
  1040. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/vie-aloha.js +74 -0
  1041. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/vie-collectionmanager.js +70 -0
  1042. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/vie-containermanager.js +263 -0
  1043. data/vendor/assets/javascripts/aloha/plugins/extra/vie/src/vie.js +20 -0
  1044. data/vendor/assets/stylesheets/aloha.css +1 -0
  1045. metadata +1133 -0
@@ -0,0 +1,146 @@
1
+ /*!
2
+ * This file is part of Aloha Editor Project http://aloha-editor.org
3
+ * Copyright © 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
+ // Do not add dependencies that require depend on aloha/core
22
+ define(
23
+ [ 'aloha/jquery', 'util/class' ],
24
+ function( jQuery, Class ) {
25
+
26
+
27
+ /**
28
+ * The Plugin Manager controls the lifecycle of all Aloha Plugins.
29
+ *
30
+ * @namespace Aloha
31
+ * @class PluginManager
32
+ * @singleton
33
+ */
34
+ return new (Class.extend({
35
+ plugins: {},
36
+
37
+ /**
38
+ * Initialize all registered plugins
39
+ * @return void
40
+ * @hide
41
+ */
42
+ init: function(next, userPlugins) {
43
+
44
+ var
45
+ me = this,
46
+ globalSettings = ( Aloha && Aloha.settings ) ? Aloha.settings.plugins||{}: {},
47
+ i,
48
+ plugin,
49
+ pluginName;
50
+
51
+ // Global to local settings
52
+ for ( pluginName in globalSettings ) {
53
+
54
+ if ( globalSettings.hasOwnProperty( pluginName ) ) {
55
+
56
+ plugin = this.plugins[pluginName] || false;
57
+
58
+ if ( plugin ) {
59
+ plugin.settings = globalSettings[ pluginName ] || {};
60
+ }
61
+ }
62
+ }
63
+
64
+ // Default: All loaded plugins are enabled
65
+ if ( !userPlugins.length ) {
66
+
67
+ for ( pluginName in this.plugins ) {
68
+
69
+ if ( this.plugins.hasOwnProperty( pluginName ) ) {
70
+ userPlugins.push( pluginName );
71
+ }
72
+ }
73
+ }
74
+
75
+ // Enable Plugins specified by User
76
+ for ( i=0; i < userPlugins.length; ++i ) {
77
+
78
+ pluginName = userPlugins[ i ];
79
+ plugin = this.plugins[ pluginName ]||false;
80
+
81
+ if ( plugin ) {
82
+
83
+ plugin.settings = plugin.settings || {};
84
+
85
+ if ( typeof plugin.settings.enabled === 'undefined' ) {
86
+ plugin.settings.enabled = true;
87
+ }
88
+
89
+ if ( plugin.settings.enabled ) {
90
+ if ( plugin.checkDependencies() ) {
91
+ plugin.init();
92
+ }
93
+ }
94
+ }
95
+ }
96
+
97
+ next();
98
+ },
99
+
100
+ /**
101
+ * Register a plugin
102
+ * @param {Plugin} plugin plugin to register
103
+ */
104
+ register: function( plugin ) {
105
+
106
+ if ( !plugin.name ) {
107
+ throw new Error( 'Plugin does not have an name.' );
108
+ }
109
+
110
+ if ( this.plugins[ plugin.name ]) {
111
+ throw new Error( 'Already registered the plugin "' + plugin.name + '"!' );
112
+ }
113
+
114
+ this.plugins[ plugin.name ] = plugin;
115
+ },
116
+
117
+ /**
118
+ * Pass the given jQuery object, which represents an editable to all plugins, so that they can make the content clean (prepare for saving)
119
+ * @param obj jQuery object representing an editable
120
+ * @return void
121
+ * @hide
122
+ */
123
+ makeClean: function(obj) {
124
+ var i, plugin;
125
+ // iterate through all registered plugins
126
+ for ( plugin in this.plugins ) {
127
+ if ( this.plugins.hasOwnProperty( plugin ) ) {
128
+ if (Aloha.Log.isDebugEnabled()) {
129
+ Aloha.Log.debug(this, 'Passing contents of HTML Element with id { ' + obj.attr('id') +
130
+ ' } for cleaning to plugin { ' + plugin + ' }');
131
+ }
132
+ this.plugins[plugin].makeClean(obj);
133
+ }
134
+ }
135
+ },
136
+
137
+ /**
138
+ * Expose a nice name for the Plugin Manager
139
+ * @hide
140
+ */
141
+ toString: function() {
142
+ return 'pluginmanager';
143
+ }
144
+
145
+ }))();
146
+ });
@@ -0,0 +1,3242 @@
1
+ /**
2
+ * @license Rangy, a cross-browser JavaScript range and selection library
3
+ * http://code.google.com/p/rangy/
4
+ *
5
+ * Copyright 2011, Tim Down
6
+ * Licensed under the MIT license.
7
+ * Version: 1.2.1
8
+ * Build date: 8 October 2011
9
+ */
10
+ define( 'aloha/rangy-core', [], function(){} );
11
+ var rangy = (function() {
12
+
13
+
14
+ var OBJECT = "object", FUNCTION = "function", UNDEFINED = "undefined";
15
+
16
+ var domRangeProperties = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed",
17
+ "commonAncestorContainer", "START_TO_START", "START_TO_END", "END_TO_START", "END_TO_END"];
18
+
19
+ var domRangeMethods = ["setStart", "setStartBefore", "setStartAfter", "setEnd", "setEndBefore",
20
+ "setEndAfter", "collapse", "selectNode", "selectNodeContents", "compareBoundaryPoints", "deleteContents",
21
+ "extractContents", "cloneContents", "insertNode", "surroundContents", "cloneRange", "toString", "detach"];
22
+
23
+ var textRangeProperties = ["boundingHeight", "boundingLeft", "boundingTop", "boundingWidth", "htmlText", "text"];
24
+
25
+ // Subset of TextRange's full set of methods that we're interested in
26
+ var textRangeMethods = ["collapse", "compareEndPoints", "duplicate", "getBookmark", "moveToBookmark",
27
+ "moveToElementText", "parentElement", "pasteHTML", "select", "setEndPoint", "getBoundingClientRect"];
28
+
29
+ /*----------------------------------------------------------------------------------------------------------------*/
30
+
31
+ // Trio of functions taken from Peter Michaux's article:
32
+ // http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
33
+ function isHostMethod(o, p) {
34
+ var t = typeof o[p];
35
+ return t == FUNCTION || (!!(t == OBJECT && o[p])) || t == "unknown";
36
+ }
37
+
38
+ function isHostObject(o, p) {
39
+ return !!(typeof o[p] == OBJECT && o[p]);
40
+ }
41
+
42
+ function isHostProperty(o, p) {
43
+ return typeof o[p] != UNDEFINED;
44
+ }
45
+
46
+ // Creates a convenience function to save verbose repeated calls to tests functions
47
+ function createMultiplePropertyTest(testFunc) {
48
+ return function(o, props) {
49
+ var i = props.length;
50
+ while (i--) {
51
+ if (!testFunc(o, props[i])) {
52
+ return false;
53
+ }
54
+ }
55
+ return true;
56
+ };
57
+ }
58
+
59
+ // Next trio of functions are a convenience to save verbose repeated calls to previous two functions
60
+ var areHostMethods = createMultiplePropertyTest(isHostMethod);
61
+ var areHostObjects = createMultiplePropertyTest(isHostObject);
62
+ var areHostProperties = createMultiplePropertyTest(isHostProperty);
63
+
64
+ function isTextRange(range) {
65
+ return range && areHostMethods(range, textRangeMethods) && areHostProperties(range, textRangeProperties);
66
+ }
67
+
68
+ var api = {
69
+ version: "1.2.1",
70
+ initialized: false,
71
+ supported: true,
72
+
73
+ util: {
74
+ isHostMethod: isHostMethod,
75
+ isHostObject: isHostObject,
76
+ isHostProperty: isHostProperty,
77
+ areHostMethods: areHostMethods,
78
+ areHostObjects: areHostObjects,
79
+ areHostProperties: areHostProperties,
80
+ isTextRange: isTextRange
81
+ },
82
+
83
+ features: {},
84
+
85
+ modules: {},
86
+ config: {
87
+ alertOnWarn: false,
88
+ preferTextRange: false
89
+ }
90
+ };
91
+
92
+ function fail(reason) {
93
+ window.alert("Rangy not supported in your browser. Reason: " + reason);
94
+ api.initialized = true;
95
+ api.supported = false;
96
+ }
97
+
98
+ api.fail = fail;
99
+
100
+ function warn(msg) {
101
+ var warningMessage = "Rangy warning: " + msg;
102
+ if (api.config.alertOnWarn) {
103
+ window.alert(warningMessage);
104
+ } else if (typeof window.console != UNDEFINED && typeof window.console.log != UNDEFINED) {
105
+ window.console.log(warningMessage);
106
+ }
107
+ }
108
+
109
+ api.warn = warn;
110
+
111
+ if ({}.hasOwnProperty) {
112
+ api.util.extend = function(o, props) {
113
+ for (var i in props) {
114
+ if (props.hasOwnProperty(i)) {
115
+ o[i] = props[i];
116
+ }
117
+ }
118
+ };
119
+ } else {
120
+ fail("hasOwnProperty not supported");
121
+ }
122
+
123
+ var initListeners = [];
124
+ var moduleInitializers = [];
125
+
126
+ // Initialization
127
+ function init() {
128
+ if (api.initialized) {
129
+ return;
130
+ }
131
+ var testRange;
132
+ var implementsDomRange = false, implementsTextRange = false;
133
+
134
+ // First, perform basic feature tests
135
+
136
+ if (isHostMethod(document, "createRange")) {
137
+ testRange = document.createRange();
138
+ if (areHostMethods(testRange, domRangeMethods) && areHostProperties(testRange, domRangeProperties)) {
139
+ implementsDomRange = true;
140
+ }
141
+ testRange.detach();
142
+ }
143
+
144
+ var body = isHostObject(document, "body") ? document.body : document.getElementsByTagName("body")[0];
145
+
146
+ if (body && isHostMethod(body, "createTextRange")) {
147
+ testRange = body.createTextRange();
148
+ if (isTextRange(testRange)) {
149
+ implementsTextRange = true;
150
+ }
151
+ }
152
+
153
+ if (!implementsDomRange && !implementsTextRange) {
154
+ fail("Neither Range nor TextRange are implemented");
155
+ }
156
+
157
+ api.initialized = true;
158
+ api.features = {
159
+ implementsDomRange: implementsDomRange,
160
+ implementsTextRange: implementsTextRange
161
+ };
162
+
163
+ // Initialize modules and call init listeners
164
+ var allListeners = moduleInitializers.concat(initListeners);
165
+ for (var i = 0, len = allListeners.length; i < len; ++i) {
166
+ try {
167
+ allListeners[i](api);
168
+ } catch (ex) {
169
+ if (isHostObject(window, "console") && isHostMethod(window.console, "log")) {
170
+ window.console.log("Init listener threw an exception. Continuing.", ex);
171
+ }
172
+
173
+ }
174
+ }
175
+ }
176
+
177
+ // Allow external scripts to initialize this library in case it's loaded after the document has loaded
178
+ api.init = init;
179
+
180
+ // Execute listener immediately if already initialized
181
+ api.addInitListener = function(listener) {
182
+ if (api.initialized) {
183
+ listener(api);
184
+ } else {
185
+ initListeners.push(listener);
186
+ }
187
+ };
188
+
189
+ var createMissingNativeApiListeners = [];
190
+
191
+ api.addCreateMissingNativeApiListener = function(listener) {
192
+ createMissingNativeApiListeners.push(listener);
193
+ };
194
+
195
+ function createMissingNativeApi(win) {
196
+ win = win || window;
197
+ init();
198
+
199
+ // Notify listeners
200
+ for (var i = 0, len = createMissingNativeApiListeners.length; i < len; ++i) {
201
+ createMissingNativeApiListeners[i](win);
202
+ }
203
+ }
204
+
205
+ api.createMissingNativeApi = createMissingNativeApi;
206
+
207
+ /**
208
+ * @constructor
209
+ */
210
+ function Module(name) {
211
+ this.name = name;
212
+ this.initialized = false;
213
+ this.supported = false;
214
+ }
215
+
216
+ Module.prototype.fail = function(reason) {
217
+ this.initialized = true;
218
+ this.supported = false;
219
+
220
+ throw new Error("Module '" + this.name + "' failed to load: " + reason);
221
+ };
222
+
223
+ Module.prototype.warn = function(msg) {
224
+ api.warn("Module " + this.name + ": " + msg);
225
+ };
226
+
227
+ Module.prototype.createError = function(msg) {
228
+ return new Error("Error in Rangy " + this.name + " module: " + msg);
229
+ };
230
+
231
+ api.createModule = function(name, initFunc) {
232
+ var module = new Module(name);
233
+ api.modules[name] = module;
234
+
235
+ moduleInitializers.push(function(api) {
236
+ initFunc(api, module);
237
+ module.initialized = true;
238
+ module.supported = true;
239
+ });
240
+ };
241
+
242
+ api.requireModules = function(modules) {
243
+ for (var i = 0, len = modules.length, module, moduleName; i < len; ++i) {
244
+ moduleName = modules[i];
245
+ module = api.modules[moduleName];
246
+ if (!module || !(module instanceof Module)) {
247
+ throw new Error("Module '" + moduleName + "' not found");
248
+ }
249
+ if (!module.supported) {
250
+ throw new Error("Module '" + moduleName + "' not supported");
251
+ }
252
+ }
253
+ };
254
+
255
+ /*----------------------------------------------------------------------------------------------------------------*/
256
+
257
+ // Wait for document to load before running tests
258
+
259
+ var docReady = false;
260
+
261
+ var loadHandler = function(e) {
262
+
263
+ if (!docReady) {
264
+ docReady = true;
265
+ if (!api.initialized) {
266
+ init();
267
+ }
268
+ }
269
+ };
270
+
271
+ // Test whether we have window and document objects that we will need
272
+ if (typeof window == UNDEFINED) {
273
+ fail("No window found");
274
+ return;
275
+ }
276
+ if (typeof document == UNDEFINED) {
277
+ fail("No document found");
278
+ return;
279
+ }
280
+
281
+ if (isHostMethod(document, "addEventListener")) {
282
+ document.addEventListener("DOMContentLoaded", loadHandler, false);
283
+ }
284
+
285
+ // Add a fallback in case the DOMContentLoaded event isn't supported
286
+ if (isHostMethod(window, "addEventListener")) {
287
+ window.addEventListener("load", loadHandler, false);
288
+ } else if (isHostMethod(window, "attachEvent")) {
289
+ window.attachEvent("onload", loadHandler);
290
+ } else {
291
+ fail("Window does not have required addEventListener or attachEvent method");
292
+ }
293
+
294
+ return api;
295
+ })();
296
+ rangy.createModule("DomUtil", function(api, module) {
297
+
298
+ var UNDEF = "undefined";
299
+ var util = api.util;
300
+
301
+ // Perform feature tests
302
+ if (!util.areHostMethods(document, ["createDocumentFragment", "createElement", "createTextNode"])) {
303
+ module.fail("document missing a Node creation method");
304
+ }
305
+
306
+ if (!util.isHostMethod(document, "getElementsByTagName")) {
307
+ module.fail("document missing getElementsByTagName method");
308
+ }
309
+
310
+ var el = document.createElement("div");
311
+ if (!util.areHostMethods(el, ["insertBefore", "appendChild", "cloneNode"] ||
312
+ !util.areHostObjects(el, ["previousSibling", "nextSibling", "childNodes", "parentNode"]))) {
313
+ module.fail("Incomplete Element implementation");
314
+ }
315
+
316
+ // innerHTML is required for Range's createContextualFragment method
317
+ if (!util.isHostProperty(el, "innerHTML")) {
318
+ module.fail("Element is missing innerHTML property");
319
+ }
320
+
321
+ var textNode = document.createTextNode("test");
322
+ if (!util.areHostMethods(textNode, ["splitText", "deleteData", "insertData", "appendData", "cloneNode"] ||
323
+ !util.areHostObjects(el, ["previousSibling", "nextSibling", "childNodes", "parentNode"]) ||
324
+ !util.areHostProperties(textNode, ["data"]))) {
325
+ module.fail("Incomplete Text Node implementation");
326
+ }
327
+
328
+ /*----------------------------------------------------------------------------------------------------------------*/
329
+
330
+ // Removed use of indexOf because of a bizarre bug in Opera that is thrown in one of the Acid3 tests. I haven't been
331
+ // able to replicate it outside of the test. The bug is that indexOf returns -1 when called on an Array that
332
+ // contains just the document as a single element and the value searched for is the document.
333
+ var arrayContains = /*Array.prototype.indexOf ?
334
+ function(arr, val) {
335
+ return arr.indexOf(val) > -1;
336
+ }:*/
337
+
338
+ function(arr, val) {
339
+ var i = arr.length;
340
+ while (i--) {
341
+ if (arr[i] === val) {
342
+ return true;
343
+ }
344
+ }
345
+ return false;
346
+ };
347
+
348
+ // Opera 11 puts HTML elements in the null namespace, it seems, and IE 7 has undefined namespaceURI
349
+ function isHtmlNamespace(node) {
350
+ var ns;
351
+ return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == "http://www.w3.org/1999/xhtml");
352
+ }
353
+
354
+ function parentElement(node) {
355
+ var parent = node.parentNode;
356
+ return (parent.nodeType == 1) ? parent : null;
357
+ }
358
+
359
+ function getNodeIndex(node) {
360
+ var i = 0;
361
+ while( (node = node.previousSibling) ) {
362
+ i++;
363
+ }
364
+ return i;
365
+ }
366
+
367
+ function getNodeLength(node) {
368
+ var childNodes;
369
+ return isCharacterDataNode(node) ? node.length : ((childNodes = node.childNodes) ? childNodes.length : 0);
370
+ }
371
+
372
+ function getCommonAncestor(node1, node2) {
373
+ var ancestors = [], n;
374
+ for (n = node1; n; n = n.parentNode) {
375
+ ancestors.push(n);
376
+ }
377
+
378
+ for (n = node2; n; n = n.parentNode) {
379
+ if (arrayContains(ancestors, n)) {
380
+ return n;
381
+ }
382
+ }
383
+
384
+ return null;
385
+ }
386
+
387
+ function isAncestorOf(ancestor, descendant, selfIsAncestor) {
388
+ var n = selfIsAncestor ? descendant : descendant.parentNode;
389
+ while (n) {
390
+ if (n === ancestor) {
391
+ return true;
392
+ } else {
393
+ n = n.parentNode;
394
+ }
395
+ }
396
+ return false;
397
+ }
398
+
399
+ function getClosestAncestorIn(node, ancestor, selfIsAncestor) {
400
+ var p, n = selfIsAncestor ? node : node.parentNode;
401
+ while (n) {
402
+ p = n.parentNode;
403
+ if (p === ancestor) {
404
+ return n;
405
+ }
406
+ n = p;
407
+ }
408
+ return null;
409
+ }
410
+
411
+ function isCharacterDataNode(node) {
412
+ var t = node.nodeType;
413
+ return t == 3 || t == 4 || t == 8 ; // Text, CDataSection or Comment
414
+ }
415
+
416
+ function insertAfter(node, precedingNode) {
417
+ var nextNode = precedingNode.nextSibling, parent = precedingNode.parentNode;
418
+ if (nextNode) {
419
+ parent.insertBefore(node, nextNode);
420
+ } else {
421
+ parent.appendChild(node);
422
+ }
423
+ return node;
424
+ }
425
+
426
+ // Note that we cannot use splitText() because it is bugridden in IE 9.
427
+ function splitDataNode(node, index) {
428
+ var newNode = node.cloneNode(false);
429
+ newNode.deleteData(0, index);
430
+ node.deleteData(index, node.length - index);
431
+ insertAfter(newNode, node);
432
+ return newNode;
433
+ }
434
+
435
+ function getDocument(node) {
436
+ if (node.nodeType == 9) {
437
+ return node;
438
+ } else if (typeof node.ownerDocument != UNDEF) {
439
+ return node.ownerDocument;
440
+ } else if (typeof node.document != UNDEF) {
441
+ return node.document;
442
+ } else if (node.parentNode) {
443
+ return getDocument(node.parentNode);
444
+ } else {
445
+ throw new Error("getDocument: no document found for node");
446
+ }
447
+ }
448
+
449
+ function getWindow(node) {
450
+ var doc = getDocument(node);
451
+ if (typeof doc.defaultView != UNDEF) {
452
+ return doc.defaultView;
453
+ } else if (typeof doc.parentWindow != UNDEF) {
454
+ return doc.parentWindow;
455
+ } else {
456
+ throw new Error("Cannot get a window object for node");
457
+ }
458
+ }
459
+
460
+ function getIframeDocument(iframeEl) {
461
+ if (typeof iframeEl.contentDocument != UNDEF) {
462
+ return iframeEl.contentDocument;
463
+ } else if (typeof iframeEl.contentWindow != UNDEF) {
464
+ return iframeEl.contentWindow.document;
465
+ } else {
466
+ throw new Error("getIframeWindow: No Document object found for iframe element");
467
+ }
468
+ }
469
+
470
+ function getIframeWindow(iframeEl) {
471
+ if (typeof iframeEl.contentWindow != UNDEF) {
472
+ return iframeEl.contentWindow;
473
+ } else if (typeof iframeEl.contentDocument != UNDEF) {
474
+ return iframeEl.contentDocument.defaultView;
475
+ } else {
476
+ throw new Error("getIframeWindow: No Window object found for iframe element");
477
+ }
478
+ }
479
+
480
+ function getBody(doc) {
481
+ return util.isHostObject(doc, "body") ? doc.body : doc.getElementsByTagName("body")[0];
482
+ }
483
+
484
+ function getRootContainer(node) {
485
+ var parent;
486
+ while ( (parent = node.parentNode) ) {
487
+ node = parent;
488
+ }
489
+ return node;
490
+ }
491
+
492
+ /**
493
+ * This is a very ugly workaround for an IE9 issue Before comparing DOM
494
+ * elements "normalize" them. There are cases, where anchorNode and
495
+ * focusNode in a nativeselection point to DOM elements with same
496
+ * parentNode, same previousSibling and same nextSibling, but the nodes
497
+ * themselves are not the same
498
+ * If such nodes are compared in the comparePoints method, an error occurs.
499
+ * To fix this, we move to the previousSibling/nextSibling/parentNode and back, to hopefully get
500
+ * the "correct" node in the DOM
501
+ * @param node node to fix
502
+ * @return normalized node
503
+ */
504
+ function fixNode(node) {
505
+ if (!node) {
506
+ return;
507
+ }
508
+ if (node.previousSibling) {
509
+ return node.previousSibling.nextSibling;
510
+ } else if (node.nextSibling) {
511
+ return node.nextSibling.previousSibling;
512
+ } else if (node.parentNode) {
513
+ return node.parentNode.firstChild;
514
+ } else {
515
+ return node;
516
+ }
517
+ }
518
+
519
+ function comparePoints(nodeA, offsetA, nodeB, offsetB) {
520
+ // fix the nodes before comparing them
521
+ nodeA = fixNode(nodeA);
522
+ nodeB = fixNode(nodeB);
523
+ // See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Comparing
524
+ var nodeC, root, childA, childB, n;
525
+ if (nodeA == nodeB) {
526
+
527
+ // Case 1: nodes are the same
528
+ return offsetA === offsetB ? 0 : (offsetA < offsetB) ? -1 : 1;
529
+ } else if ( (nodeC = getClosestAncestorIn(nodeB, nodeA, true)) ) {
530
+
531
+ // Case 2: node C (container B or an ancestor) is a child node of A
532
+ return offsetA <= getNodeIndex(nodeC) ? -1 : 1;
533
+ } else if ( (nodeC = getClosestAncestorIn(nodeA, nodeB, true)) ) {
534
+
535
+ // Case 3: node C (container A or an ancestor) is a child node of B
536
+ return getNodeIndex(nodeC) < offsetB ? -1 : 1;
537
+ } else {
538
+
539
+ // Case 4: containers are siblings or descendants of siblings
540
+ root = getCommonAncestor(nodeA, nodeB);
541
+ childA = (nodeA === root) ? root : getClosestAncestorIn(nodeA, root, true);
542
+ childB = (nodeB === root) ? root : getClosestAncestorIn(nodeB, root, true);
543
+
544
+ if (childA === childB) {
545
+ // This shouldn't be possible
546
+
547
+ throw new Error("comparePoints got to case 4 and childA and childB are the same!");
548
+ } else {
549
+ n = root.firstChild;
550
+ while (n) {
551
+ if (n === childA) {
552
+ return -1;
553
+ } else if (n === childB) {
554
+ return 1;
555
+ }
556
+ n = n.nextSibling;
557
+ }
558
+ throw new Error("Should not be here!");
559
+ }
560
+ }
561
+ }
562
+
563
+ function fragmentFromNodeChildren(node) {
564
+ var fragment = getDocument(node).createDocumentFragment(), child;
565
+ while ( (child = node.firstChild) ) {
566
+ fragment.appendChild(child);
567
+ }
568
+ return fragment;
569
+ }
570
+
571
+ function inspectNode(node) {
572
+ if (!node) {
573
+ return "[No node]";
574
+ }
575
+ if (isCharacterDataNode(node)) {
576
+ return '"' + node.data + '"';
577
+ } else if (node.nodeType == 1) {
578
+ var idAttr = node.id ? ' id="' + node.id + '"' : "";
579
+ return "<" + node.nodeName + idAttr + ">[" + node.childNodes.length + "]";
580
+ } else {
581
+ return node.nodeName;
582
+ }
583
+ }
584
+
585
+ /**
586
+ * @constructor
587
+ */
588
+ function NodeIterator(root) {
589
+ this.root = root;
590
+ this._next = root;
591
+ }
592
+
593
+ NodeIterator.prototype = {
594
+ _current: null,
595
+
596
+ hasNext: function() {
597
+ return !!this._next;
598
+ },
599
+
600
+ next: function() {
601
+ var n = this._current = this._next;
602
+ var child, next;
603
+ if (this._current) {
604
+ child = n.firstChild;
605
+ if (child) {
606
+ this._next = child;
607
+ } else {
608
+ next = null;
609
+ while ((n !== this.root) && !(next = n.nextSibling)) {
610
+ n = n.parentNode;
611
+ }
612
+ this._next = next;
613
+ }
614
+ }
615
+ return this._current;
616
+ },
617
+
618
+ detach: function() {
619
+ this._current = this._next = this.root = null;
620
+ }
621
+ };
622
+
623
+ function createIterator(root) {
624
+ return new NodeIterator(root);
625
+ }
626
+
627
+ /**
628
+ * @constructor
629
+ */
630
+ function DomPosition(node, offset) {
631
+ this.node = node;
632
+ this.offset = offset;
633
+ }
634
+
635
+ DomPosition.prototype = {
636
+ equals: function(pos) {
637
+ return this.node === pos.node & this.offset == pos.offset;
638
+ },
639
+
640
+ inspect: function() {
641
+ return "[DomPosition(" + inspectNode(this.node) + ":" + this.offset + ")]";
642
+ }
643
+ };
644
+
645
+ /**
646
+ * @constructor
647
+ */
648
+ function DOMException(codeName) {
649
+ this.code = this[codeName];
650
+ this.codeName = codeName;
651
+ this.message = "DOMException: " + this.codeName;
652
+ }
653
+
654
+ DOMException.prototype = {
655
+ INDEX_SIZE_ERR: 1,
656
+ HIERARCHY_REQUEST_ERR: 3,
657
+ WRONG_DOCUMENT_ERR: 4,
658
+ NO_MODIFICATION_ALLOWED_ERR: 7,
659
+ NOT_FOUND_ERR: 8,
660
+ NOT_SUPPORTED_ERR: 9,
661
+ INVALID_STATE_ERR: 11
662
+ };
663
+
664
+ DOMException.prototype.toString = function() {
665
+ return this.message;
666
+ };
667
+
668
+ api.dom = {
669
+ arrayContains: arrayContains,
670
+ isHtmlNamespace: isHtmlNamespace,
671
+ parentElement: parentElement,
672
+ getNodeIndex: getNodeIndex,
673
+ getNodeLength: getNodeLength,
674
+ getCommonAncestor: getCommonAncestor,
675
+ isAncestorOf: isAncestorOf,
676
+ getClosestAncestorIn: getClosestAncestorIn,
677
+ isCharacterDataNode: isCharacterDataNode,
678
+ insertAfter: insertAfter,
679
+ splitDataNode: splitDataNode,
680
+ getDocument: getDocument,
681
+ getWindow: getWindow,
682
+ getIframeWindow: getIframeWindow,
683
+ getIframeDocument: getIframeDocument,
684
+ getBody: getBody,
685
+ getRootContainer: getRootContainer,
686
+ comparePoints: comparePoints,
687
+ inspectNode: inspectNode,
688
+ fragmentFromNodeChildren: fragmentFromNodeChildren,
689
+ createIterator: createIterator,
690
+ DomPosition: DomPosition
691
+ };
692
+
693
+ api.DOMException = DOMException;
694
+ });rangy.createModule("DomRange", function(api, module) {
695
+ api.requireModules( ["DomUtil"] );
696
+
697
+
698
+ var dom = api.dom;
699
+ var DomPosition = dom.DomPosition;
700
+ var DOMException = api.DOMException;
701
+
702
+ /*----------------------------------------------------------------------------------------------------------------*/
703
+
704
+ // Utility functions
705
+
706
+ function isNonTextPartiallySelected(node, range) {
707
+ return (node.nodeType != 3) &&
708
+ (dom.isAncestorOf(node, range.startContainer, true) || dom.isAncestorOf(node, range.endContainer, true));
709
+ }
710
+
711
+ function getRangeDocument(range) {
712
+ return dom.getDocument(range.startContainer);
713
+ }
714
+
715
+ function dispatchEvent(range, type, args) {
716
+ var listeners = range._listeners[type];
717
+ if (listeners) {
718
+ for (var i = 0, len = listeners.length; i < len; ++i) {
719
+ listeners[i].call(range, {target: range, args: args});
720
+ }
721
+ }
722
+ }
723
+
724
+ function getBoundaryBeforeNode(node) {
725
+ return new DomPosition(node.parentNode, dom.getNodeIndex(node));
726
+ }
727
+
728
+ function getBoundaryAfterNode(node) {
729
+ return new DomPosition(node.parentNode, dom.getNodeIndex(node) + 1);
730
+ }
731
+
732
+ function insertNodeAtPosition(node, n, o) {
733
+ var firstNodeInserted = node.nodeType == 11 ? node.firstChild : node;
734
+ if (dom.isCharacterDataNode(n)) {
735
+ if (o == n.length) {
736
+ dom.insertAfter(node, n);
737
+ } else {
738
+ n.parentNode.insertBefore(node, o == 0 ? n : dom.splitDataNode(n, o));
739
+ }
740
+ } else if (o >= n.childNodes.length) {
741
+ n.appendChild(node);
742
+ } else {
743
+ n.insertBefore(node, n.childNodes[o]);
744
+ }
745
+ return firstNodeInserted;
746
+ }
747
+
748
+ function cloneSubtree(iterator) {
749
+ var partiallySelected;
750
+ for (var node, frag = getRangeDocument(iterator.range).createDocumentFragment(), subIterator; node = iterator.next(); ) {
751
+ partiallySelected = iterator.isPartiallySelectedSubtree();
752
+
753
+ node = node.cloneNode(!partiallySelected);
754
+ if (partiallySelected) {
755
+ subIterator = iterator.getSubtreeIterator();
756
+ node.appendChild(cloneSubtree(subIterator));
757
+ subIterator.detach(true);
758
+ }
759
+
760
+ if (node.nodeType == 10) { // DocumentType
761
+ throw new DOMException("HIERARCHY_REQUEST_ERR");
762
+ }
763
+ frag.appendChild(node);
764
+ }
765
+ return frag;
766
+ }
767
+
768
+ function iterateSubtree(rangeIterator, func, iteratorState) {
769
+ var it, n;
770
+ iteratorState = iteratorState || { stop: false };
771
+ for (var node, subRangeIterator; node = rangeIterator.next(); ) {
772
+ //log.debug("iterateSubtree, partially selected: " + rangeIterator.isPartiallySelectedSubtree(), nodeToString(node));
773
+ if (rangeIterator.isPartiallySelectedSubtree()) {
774
+ // The node is partially selected by the Range, so we can use a new RangeIterator on the portion of the
775
+ // node selected by the Range.
776
+ if (func(node) === false) {
777
+ iteratorState.stop = true;
778
+ return;
779
+ } else {
780
+ subRangeIterator = rangeIterator.getSubtreeIterator();
781
+ iterateSubtree(subRangeIterator, func, iteratorState);
782
+ subRangeIterator.detach(true);
783
+ if (iteratorState.stop) {
784
+ return;
785
+ }
786
+ }
787
+ } else {
788
+ // The whole node is selected, so we can use efficient DOM iteration to iterate over the node and its
789
+ // descendant
790
+ it = dom.createIterator(node);
791
+ while ( (n = it.next()) ) {
792
+ if (func(n) === false) {
793
+ iteratorState.stop = true;
794
+ return;
795
+ }
796
+ }
797
+ }
798
+ }
799
+ }
800
+
801
+ function deleteSubtree(iterator) {
802
+ var subIterator;
803
+ while (iterator.next()) {
804
+ if (iterator.isPartiallySelectedSubtree()) {
805
+ subIterator = iterator.getSubtreeIterator();
806
+ deleteSubtree(subIterator);
807
+ subIterator.detach(true);
808
+ } else {
809
+ iterator.remove();
810
+ }
811
+ }
812
+ }
813
+
814
+ function extractSubtree(iterator) {
815
+
816
+ for (var node, frag = getRangeDocument(iterator.range).createDocumentFragment(), subIterator; node = iterator.next(); ) {
817
+
818
+
819
+ if (iterator.isPartiallySelectedSubtree()) {
820
+ node = node.cloneNode(false);
821
+ subIterator = iterator.getSubtreeIterator();
822
+ node.appendChild(extractSubtree(subIterator));
823
+ subIterator.detach(true);
824
+ } else {
825
+ iterator.remove();
826
+ }
827
+ if (node.nodeType == 10) { // DocumentType
828
+ throw new DOMException("HIERARCHY_REQUEST_ERR");
829
+ }
830
+ frag.appendChild(node);
831
+ }
832
+ return frag;
833
+ }
834
+
835
+ function getNodesInRange(range, nodeTypes, filter) {
836
+ //log.info("getNodesInRange, " + nodeTypes.join(","));
837
+ var filterNodeTypes = !!(nodeTypes && nodeTypes.length), regex;
838
+ var filterExists = !!filter;
839
+ if (filterNodeTypes) {
840
+ regex = new RegExp("^(" + nodeTypes.join("|") + ")$");
841
+ }
842
+
843
+ var nodes = [];
844
+ iterateSubtree(new RangeIterator(range, false), function(node) {
845
+ if ((!filterNodeTypes || regex.test(node.nodeType)) && (!filterExists || filter(node))) {
846
+ nodes.push(node);
847
+ }
848
+ });
849
+ return nodes;
850
+ }
851
+
852
+ function inspect(range) {
853
+ var name = (typeof range.getName == "undefined") ? "Range" : range.getName();
854
+ return "[" + name + "(" + dom.inspectNode(range.startContainer) + ":" + range.startOffset + ", " +
855
+ dom.inspectNode(range.endContainer) + ":" + range.endOffset + ")]";
856
+ }
857
+
858
+ /*----------------------------------------------------------------------------------------------------------------*/
859
+
860
+ // RangeIterator code partially borrows from IERange by Tim Ryan (http://github.com/timcameronryan/IERange)
861
+
862
+ /**
863
+ * @constructor
864
+ */
865
+ function RangeIterator(range, clonePartiallySelectedTextNodes) {
866
+ this.range = range;
867
+ this.clonePartiallySelectedTextNodes = clonePartiallySelectedTextNodes;
868
+
869
+
870
+
871
+ if (!range.collapsed) {
872
+ this.sc = range.startContainer;
873
+ this.so = range.startOffset;
874
+ this.ec = range.endContainer;
875
+ this.eo = range.endOffset;
876
+ var root = range.commonAncestorContainer;
877
+
878
+ if (this.sc === this.ec && dom.isCharacterDataNode(this.sc)) {
879
+ this.isSingleCharacterDataNode = true;
880
+ this._first = this._last = this._next = this.sc;
881
+ } else {
882
+ this._first = this._next = (this.sc === root && !dom.isCharacterDataNode(this.sc)) ?
883
+ this.sc.childNodes[this.so] : dom.getClosestAncestorIn(this.sc, root, true);
884
+ this._last = (this.ec === root && !dom.isCharacterDataNode(this.ec)) ?
885
+ this.ec.childNodes[this.eo - 1] : dom.getClosestAncestorIn(this.ec, root, true);
886
+ }
887
+
888
+ }
889
+ }
890
+
891
+ RangeIterator.prototype = {
892
+ _current: null,
893
+ _next: null,
894
+ _first: null,
895
+ _last: null,
896
+ isSingleCharacterDataNode: false,
897
+
898
+ reset: function() {
899
+ this._current = null;
900
+ this._next = this._first;
901
+ },
902
+
903
+ hasNext: function() {
904
+ return !!this._next;
905
+ },
906
+
907
+ next: function() {
908
+ // Move to next node
909
+ var current = this._current = this._next;
910
+ if (current) {
911
+ this._next = (current !== this._last) ? current.nextSibling : null;
912
+
913
+ // Check for partially selected text nodes
914
+ if (dom.isCharacterDataNode(current) && this.clonePartiallySelectedTextNodes) {
915
+ if (current === this.ec) {
916
+
917
+ (current = current.cloneNode(true)).deleteData(this.eo, current.length - this.eo);
918
+ }
919
+ if (this._current === this.sc) {
920
+
921
+ (current = current.cloneNode(true)).deleteData(0, this.so);
922
+ }
923
+ }
924
+ }
925
+
926
+ return current;
927
+ },
928
+
929
+ remove: function() {
930
+ var current = this._current, start, end;
931
+
932
+ if (dom.isCharacterDataNode(current) && (current === this.sc || current === this.ec)) {
933
+ start = (current === this.sc) ? this.so : 0;
934
+ end = (current === this.ec) ? this.eo : current.length;
935
+ if (start != end) {
936
+ current.deleteData(start, end - start);
937
+ }
938
+ } else {
939
+ if (current.parentNode) {
940
+ current.parentNode.removeChild(current);
941
+ } else {
942
+
943
+ }
944
+ }
945
+ },
946
+
947
+ // Checks if the current node is partially selected
948
+ isPartiallySelectedSubtree: function() {
949
+ var current = this._current;
950
+ return isNonTextPartiallySelected(current, this.range);
951
+ },
952
+
953
+ getSubtreeIterator: function() {
954
+ var subRange;
955
+ if (this.isSingleCharacterDataNode) {
956
+ subRange = this.range.cloneRange();
957
+ subRange.collapse();
958
+ } else {
959
+ subRange = new Range(getRangeDocument(this.range));
960
+ var current = this._current;
961
+ var startContainer = current, startOffset = 0, endContainer = current, endOffset = dom.getNodeLength(current);
962
+
963
+ if (dom.isAncestorOf(current, this.sc, true)) {
964
+ startContainer = this.sc;
965
+ startOffset = this.so;
966
+ }
967
+ if (dom.isAncestorOf(current, this.ec, true)) {
968
+ endContainer = this.ec;
969
+ endOffset = this.eo;
970
+ }
971
+
972
+ updateBoundaries(subRange, startContainer, startOffset, endContainer, endOffset);
973
+ }
974
+ return new RangeIterator(subRange, this.clonePartiallySelectedTextNodes);
975
+ },
976
+
977
+ detach: function(detachRange) {
978
+ if (detachRange) {
979
+ this.range.detach();
980
+ }
981
+ this.range = this._current = this._next = this._first = this._last = this.sc = this.so = this.ec = this.eo = null;
982
+ }
983
+ };
984
+
985
+ /*----------------------------------------------------------------------------------------------------------------*/
986
+
987
+ // Exceptions
988
+
989
+ /**
990
+ * @constructor
991
+ */
992
+ function RangeException(codeName) {
993
+ this.code = this[codeName];
994
+ this.codeName = codeName;
995
+ this.message = "RangeException: " + this.codeName;
996
+ }
997
+
998
+ RangeException.prototype = {
999
+ BAD_BOUNDARYPOINTS_ERR: 1,
1000
+ INVALID_NODE_TYPE_ERR: 2
1001
+ };
1002
+
1003
+ RangeException.prototype.toString = function() {
1004
+ return this.message;
1005
+ };
1006
+
1007
+ /*----------------------------------------------------------------------------------------------------------------*/
1008
+
1009
+ /**
1010
+ * Currently iterates through all nodes in the range on creation until I think of a decent way to do it
1011
+ * TODO: Look into making this a proper iterator, not requiring preloading everything first
1012
+ * @constructor
1013
+ */
1014
+ function RangeNodeIterator(range, nodeTypes, filter) {
1015
+ this.nodes = getNodesInRange(range, nodeTypes, filter);
1016
+ this._next = this.nodes[0];
1017
+ this._position = 0;
1018
+ }
1019
+
1020
+ RangeNodeIterator.prototype = {
1021
+ _current: null,
1022
+
1023
+ hasNext: function() {
1024
+ return !!this._next;
1025
+ },
1026
+
1027
+ next: function() {
1028
+ this._current = this._next;
1029
+ this._next = this.nodes[ ++this._position ];
1030
+ return this._current;
1031
+ },
1032
+
1033
+ detach: function() {
1034
+ this._current = this._next = this.nodes = null;
1035
+ }
1036
+ };
1037
+
1038
+ var beforeAfterNodeTypes = [1, 3, 4, 5, 7, 8, 10];
1039
+ var rootContainerNodeTypes = [2, 9, 11];
1040
+ var readonlyNodeTypes = [5, 6, 10, 12];
1041
+ var insertableNodeTypes = [1, 3, 4, 5, 7, 8, 10, 11];
1042
+ var surroundNodeTypes = [1, 3, 4, 5, 7, 8];
1043
+
1044
+ function createAncestorFinder(nodeTypes) {
1045
+ return function(node, selfIsAncestor) {
1046
+ var t, n = selfIsAncestor ? node : node.parentNode;
1047
+ while (n) {
1048
+ t = n.nodeType;
1049
+ if (dom.arrayContains(nodeTypes, t)) {
1050
+ return n;
1051
+ }
1052
+ n = n.parentNode;
1053
+ }
1054
+ return null;
1055
+ };
1056
+ }
1057
+
1058
+ var getRootContainer = dom.getRootContainer;
1059
+ var getDocumentOrFragmentContainer = createAncestorFinder( [9, 11] );
1060
+ var getReadonlyAncestor = createAncestorFinder(readonlyNodeTypes);
1061
+ var getDocTypeNotationEntityAncestor = createAncestorFinder( [6, 10, 12] );
1062
+
1063
+ function assertNoDocTypeNotationEntityAncestor(node, allowSelf) {
1064
+ if (getDocTypeNotationEntityAncestor(node, allowSelf)) {
1065
+ throw new RangeException("INVALID_NODE_TYPE_ERR");
1066
+ }
1067
+ }
1068
+
1069
+ function assertNotDetached(range) {
1070
+ if (!range.startContainer) {
1071
+ throw new DOMException("INVALID_STATE_ERR");
1072
+ }
1073
+ }
1074
+
1075
+ function assertValidNodeType(node, invalidTypes) {
1076
+ if (!dom.arrayContains(invalidTypes, node.nodeType)) {
1077
+ throw new RangeException("INVALID_NODE_TYPE_ERR");
1078
+ }
1079
+ }
1080
+
1081
+ function assertValidOffset(node, offset) {
1082
+ if (offset < 0 || offset > (dom.isCharacterDataNode(node) ? node.length : node.childNodes.length)) {
1083
+ throw new DOMException("INDEX_SIZE_ERR");
1084
+ }
1085
+ }
1086
+
1087
+ function assertSameDocumentOrFragment(node1, node2) {
1088
+ if (getDocumentOrFragmentContainer(node1, true) !== getDocumentOrFragmentContainer(node2, true)) {
1089
+ throw new DOMException("WRONG_DOCUMENT_ERR");
1090
+ }
1091
+ }
1092
+
1093
+ function assertNodeNotReadOnly(node) {
1094
+ if (getReadonlyAncestor(node, true)) {
1095
+ throw new DOMException("NO_MODIFICATION_ALLOWED_ERR");
1096
+ }
1097
+ }
1098
+
1099
+ function assertNode(node, codeName) {
1100
+ if (!node) {
1101
+ throw new DOMException(codeName);
1102
+ }
1103
+ }
1104
+
1105
+ function isOrphan(node) {
1106
+ return !dom.arrayContains(rootContainerNodeTypes, node.nodeType) && !getDocumentOrFragmentContainer(node, true);
1107
+ }
1108
+
1109
+ function isValidOffset(node, offset) {
1110
+ return offset <= (dom.isCharacterDataNode(node) ? node.length : node.childNodes.length);
1111
+ }
1112
+
1113
+ function assertRangeValid(range) {
1114
+ assertNotDetached(range);
1115
+ if (isOrphan(range.startContainer) || isOrphan(range.endContainer) ||
1116
+ !isValidOffset(range.startContainer, range.startOffset) ||
1117
+ !isValidOffset(range.endContainer, range.endOffset)) {
1118
+ throw new Error("Range error: Range is no longer valid after DOM mutation (" + range.inspect() + ")");
1119
+ }
1120
+ }
1121
+
1122
+ /*----------------------------------------------------------------------------------------------------------------*/
1123
+
1124
+ // Test the browser's innerHTML support to decide how to implement createContextualFragment
1125
+ var styleEl = document.createElement("style");
1126
+ var htmlParsingConforms = false;
1127
+ try {
1128
+ styleEl.innerHTML = "<b>x</b>";
1129
+ htmlParsingConforms = (styleEl.firstChild.nodeType == 3); // Opera incorrectly creates an element node
1130
+ } catch (e) {
1131
+ // IE 6 and 7 throw
1132
+ }
1133
+
1134
+ api.features.htmlParsingConforms = htmlParsingConforms;
1135
+
1136
+ var createContextualFragment = htmlParsingConforms ?
1137
+
1138
+ // Implementation as per HTML parsing spec, trusting in the browser's implementation of innerHTML. See
1139
+ // discussion and base code for this implementation at issue 67.
1140
+ // Spec: http://html5.org/specs/dom-parsing.html#extensions-to-the-range-interface
1141
+ // Thanks to Aleks Williams.
1142
+ function(fragmentStr) {
1143
+ // "Let node the context object's start's node."
1144
+ var node = this.startContainer;
1145
+ var doc = dom.getDocument(node);
1146
+
1147
+ // "If the context object's start's node is null, raise an INVALID_STATE_ERR
1148
+ // exception and abort these steps."
1149
+ if (!node) {
1150
+ throw new DOMException("INVALID_STATE_ERR");
1151
+ }
1152
+
1153
+ // "Let element be as follows, depending on node's interface:"
1154
+ // Document, Document Fragment: null
1155
+ var el = null;
1156
+
1157
+ // "Element: node"
1158
+ if (node.nodeType == 1) {
1159
+ el = node;
1160
+
1161
+ // "Text, Comment: node's parentElement"
1162
+ } else if (dom.isCharacterDataNode(node)) {
1163
+ el = dom.parentElement(node);
1164
+ }
1165
+
1166
+ // "If either element is null or element's ownerDocument is an HTML document
1167
+ // and element's local name is "html" and element's namespace is the HTML
1168
+ // namespace"
1169
+ if (el === null || (
1170
+ el.nodeName == "HTML"
1171
+ && dom.isHtmlNamespace(dom.getDocument(el).documentElement)
1172
+ && dom.isHtmlNamespace(el)
1173
+ )) {
1174
+
1175
+ // "let element be a new Element with "body" as its local name and the HTML
1176
+ // namespace as its namespace.""
1177
+ el = doc.createElement("body");
1178
+ } else {
1179
+ el = el.cloneNode(false);
1180
+ }
1181
+
1182
+ // "If the node's document is an HTML document: Invoke the HTML fragment parsing algorithm."
1183
+ // "If the node's document is an XML document: Invoke the XML fragment parsing algorithm."
1184
+ // "In either case, the algorithm must be invoked with fragment as the input
1185
+ // and element as the context element."
1186
+ el.innerHTML = fragmentStr;
1187
+
1188
+ // "If this raises an exception, then abort these steps. Otherwise, let new
1189
+ // children be the nodes returned."
1190
+
1191
+ // "Let fragment be a new DocumentFragment."
1192
+ // "Append all new children to fragment."
1193
+ // "Return fragment."
1194
+ return dom.fragmentFromNodeChildren(el);
1195
+ } :
1196
+
1197
+ // In this case, innerHTML cannot be trusted, so fall back to a simpler, non-conformant implementation that
1198
+ // previous versions of Rangy used (with the exception of using a body element rather than a div)
1199
+ function(fragmentStr) {
1200
+ assertNotDetached(this);
1201
+ var doc = getRangeDocument(this);
1202
+ var el = doc.createElement("body");
1203
+ el.innerHTML = fragmentStr;
1204
+
1205
+ return dom.fragmentFromNodeChildren(el);
1206
+ };
1207
+
1208
+ /*----------------------------------------------------------------------------------------------------------------*/
1209
+
1210
+ var rangeProperties = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed",
1211
+ "commonAncestorContainer"];
1212
+
1213
+ var s2s = 0, s2e = 1, e2e = 2, e2s = 3;
1214
+ var n_b = 0, n_a = 1, n_b_a = 2, n_i = 3;
1215
+
1216
+ function RangePrototype() {}
1217
+
1218
+ RangePrototype.prototype = {
1219
+ attachListener: function(type, listener) {
1220
+ this._listeners[type].push(listener);
1221
+ },
1222
+
1223
+ compareBoundaryPoints: function(how, range) {
1224
+ assertRangeValid(this);
1225
+ assertSameDocumentOrFragment(this.startContainer, range.startContainer);
1226
+
1227
+ var nodeA, offsetA, nodeB, offsetB;
1228
+ var prefixA = (how == e2s || how == s2s) ? "start" : "end";
1229
+ var prefixB = (how == s2e || how == s2s) ? "start" : "end";
1230
+ nodeA = this[prefixA + "Container"];
1231
+ offsetA = this[prefixA + "Offset"];
1232
+ nodeB = range[prefixB + "Container"];
1233
+ offsetB = range[prefixB + "Offset"];
1234
+ return dom.comparePoints(nodeA, offsetA, nodeB, offsetB);
1235
+ },
1236
+
1237
+ insertNode: function(node) {
1238
+ assertRangeValid(this);
1239
+ assertValidNodeType(node, insertableNodeTypes);
1240
+ assertNodeNotReadOnly(this.startContainer);
1241
+
1242
+ if (dom.isAncestorOf(node, this.startContainer, true)) {
1243
+ throw new DOMException("HIERARCHY_REQUEST_ERR");
1244
+ }
1245
+
1246
+ // No check for whether the container of the start of the Range is of a type that does not allow
1247
+ // children of the type of node: the browser's DOM implementation should do this for us when we attempt
1248
+ // to add the node
1249
+
1250
+ var firstNodeInserted = insertNodeAtPosition(node, this.startContainer, this.startOffset);
1251
+ this.setStartBefore(firstNodeInserted);
1252
+ },
1253
+
1254
+ cloneContents: function() {
1255
+ assertRangeValid(this);
1256
+
1257
+ var clone, frag;
1258
+ if (this.collapsed) {
1259
+ return getRangeDocument(this).createDocumentFragment();
1260
+ } else {
1261
+ if (this.startContainer === this.endContainer && dom.isCharacterDataNode(this.startContainer)) {
1262
+ clone = this.startContainer.cloneNode(true);
1263
+ clone.data = clone.data.slice(this.startOffset, this.endOffset);
1264
+ frag = getRangeDocument(this).createDocumentFragment();
1265
+ frag.appendChild(clone);
1266
+ return frag;
1267
+ } else {
1268
+ var iterator = new RangeIterator(this, true);
1269
+ clone = cloneSubtree(iterator);
1270
+ iterator.detach();
1271
+ }
1272
+ return clone;
1273
+ }
1274
+ },
1275
+
1276
+ canSurroundContents: function() {
1277
+ assertRangeValid(this);
1278
+ assertNodeNotReadOnly(this.startContainer);
1279
+ assertNodeNotReadOnly(this.endContainer);
1280
+
1281
+ // Check if the contents can be surrounded. Specifically, this means whether the range partially selects
1282
+ // no non-text nodes.
1283
+ var iterator = new RangeIterator(this, true);
1284
+ var boundariesInvalid = (iterator._first && (isNonTextPartiallySelected(iterator._first, this)) ||
1285
+ (iterator._last && isNonTextPartiallySelected(iterator._last, this)));
1286
+ iterator.detach();
1287
+ return !boundariesInvalid;
1288
+ },
1289
+
1290
+ surroundContents: function(node) {
1291
+ assertValidNodeType(node, surroundNodeTypes);
1292
+
1293
+ if (!this.canSurroundContents()) {
1294
+ throw new RangeException("BAD_BOUNDARYPOINTS_ERR");
1295
+ }
1296
+
1297
+ // Extract the contents
1298
+ var content = this.extractContents();
1299
+
1300
+ // Clear the children of the node
1301
+ if (node.hasChildNodes()) {
1302
+ while (node.lastChild) {
1303
+ node.removeChild(node.lastChild);
1304
+ }
1305
+ }
1306
+
1307
+ // Insert the new node and add the extracted contents
1308
+ insertNodeAtPosition(node, this.startContainer, this.startOffset);
1309
+ node.appendChild(content);
1310
+
1311
+ this.selectNode(node);
1312
+ },
1313
+
1314
+ cloneRange: function() {
1315
+ assertRangeValid(this);
1316
+ var range = new Range(getRangeDocument(this));
1317
+ var i = rangeProperties.length, prop;
1318
+ while (i--) {
1319
+ prop = rangeProperties[i];
1320
+ range[prop] = this[prop];
1321
+ }
1322
+ return range;
1323
+ },
1324
+
1325
+ toString: function() {
1326
+ assertRangeValid(this);
1327
+ var sc = this.startContainer;
1328
+ if (sc === this.endContainer && dom.isCharacterDataNode(sc)) {
1329
+ return (sc.nodeType == 3 || sc.nodeType == 4) ? sc.data.slice(this.startOffset, this.endOffset) : "";
1330
+ } else {
1331
+ var textBits = [], iterator = new RangeIterator(this, true);
1332
+
1333
+ iterateSubtree(iterator, function(node) {
1334
+ // Accept only text or CDATA nodes, not comments
1335
+
1336
+ if (node.nodeType == 3 || node.nodeType == 4) {
1337
+ textBits.push(node.data);
1338
+ }
1339
+ });
1340
+ iterator.detach();
1341
+ return textBits.join("");
1342
+ }
1343
+ },
1344
+
1345
+ // The methods below are all non-standard. The following batch were introduced by Mozilla but have since
1346
+ // been removed from Mozilla.
1347
+
1348
+ compareNode: function(node) {
1349
+ assertRangeValid(this);
1350
+
1351
+ var parent = node.parentNode;
1352
+ var nodeIndex = dom.getNodeIndex(node);
1353
+
1354
+ if (!parent) {
1355
+ throw new DOMException("NOT_FOUND_ERR");
1356
+ }
1357
+
1358
+ var startComparison = this.comparePoint(parent, nodeIndex),
1359
+ endComparison = this.comparePoint(parent, nodeIndex + 1);
1360
+
1361
+ if (startComparison < 0) { // Node starts before
1362
+ return (endComparison > 0) ? n_b_a : n_b;
1363
+ } else {
1364
+ return (endComparison > 0) ? n_a : n_i;
1365
+ }
1366
+ },
1367
+
1368
+ comparePoint: function(node, offset) {
1369
+ assertRangeValid(this);
1370
+ assertNode(node, "HIERARCHY_REQUEST_ERR");
1371
+ assertSameDocumentOrFragment(node, this.startContainer);
1372
+
1373
+ if (dom.comparePoints(node, offset, this.startContainer, this.startOffset) < 0) {
1374
+ return -1;
1375
+ } else if (dom.comparePoints(node, offset, this.endContainer, this.endOffset) > 0) {
1376
+ return 1;
1377
+ }
1378
+ return 0;
1379
+ },
1380
+
1381
+ createContextualFragment: createContextualFragment,
1382
+
1383
+ toHtml: function() {
1384
+ assertRangeValid(this);
1385
+ var container = getRangeDocument(this).createElement("div");
1386
+ container.appendChild(this.cloneContents());
1387
+ return container.innerHTML;
1388
+ },
1389
+
1390
+ // touchingIsIntersecting determines whether this method considers a node that borders a range intersects
1391
+ // with it (as in WebKit) or not (as in Gecko pre-1.9, and the default)
1392
+ intersectsNode: function(node, touchingIsIntersecting) {
1393
+ assertRangeValid(this);
1394
+ assertNode(node, "NOT_FOUND_ERR");
1395
+ if (dom.getDocument(node) !== getRangeDocument(this)) {
1396
+ return false;
1397
+ }
1398
+
1399
+ var parent = node.parentNode, offset = dom.getNodeIndex(node);
1400
+ assertNode(parent, "NOT_FOUND_ERR");
1401
+
1402
+ var startComparison = dom.comparePoints(parent, offset, this.endContainer, this.endOffset),
1403
+ endComparison = dom.comparePoints(parent, offset + 1, this.startContainer, this.startOffset);
1404
+
1405
+ return touchingIsIntersecting ? startComparison <= 0 && endComparison >= 0 : startComparison < 0 && endComparison > 0;
1406
+ },
1407
+
1408
+
1409
+ isPointInRange: function(node, offset) {
1410
+ assertRangeValid(this);
1411
+ assertNode(node, "HIERARCHY_REQUEST_ERR");
1412
+ assertSameDocumentOrFragment(node, this.startContainer);
1413
+
1414
+ return (dom.comparePoints(node, offset, this.startContainer, this.startOffset) >= 0) &&
1415
+ (dom.comparePoints(node, offset, this.endContainer, this.endOffset) <= 0);
1416
+ },
1417
+
1418
+ // The methods below are non-standard and invented by me.
1419
+
1420
+ // Sharing a boundary start-to-end or end-to-start does not count as intersection.
1421
+ intersectsRange: function(range, touchingIsIntersecting) {
1422
+ assertRangeValid(this);
1423
+
1424
+ if (getRangeDocument(range) != getRangeDocument(this)) {
1425
+ throw new DOMException("WRONG_DOCUMENT_ERR");
1426
+ }
1427
+
1428
+ var startComparison = dom.comparePoints(this.startContainer, this.startOffset, range.endContainer, range.endOffset),
1429
+ endComparison = dom.comparePoints(this.endContainer, this.endOffset, range.startContainer, range.startOffset);
1430
+
1431
+ return touchingIsIntersecting ? startComparison <= 0 && endComparison >= 0 : startComparison < 0 && endComparison > 0;
1432
+ },
1433
+
1434
+ intersection: function(range) {
1435
+ if (this.intersectsRange(range)) {
1436
+ var startComparison = dom.comparePoints(this.startContainer, this.startOffset, range.startContainer, range.startOffset),
1437
+ endComparison = dom.comparePoints(this.endContainer, this.endOffset, range.endContainer, range.endOffset);
1438
+
1439
+ var intersectionRange = this.cloneRange();
1440
+
1441
+ if (startComparison == -1) {
1442
+ intersectionRange.setStart(range.startContainer, range.startOffset);
1443
+ }
1444
+ if (endComparison == 1) {
1445
+ intersectionRange.setEnd(range.endContainer, range.endOffset);
1446
+ }
1447
+ return intersectionRange;
1448
+ }
1449
+ return null;
1450
+ },
1451
+
1452
+ union: function(range) {
1453
+ if (this.intersectsRange(range, true)) {
1454
+ var unionRange = this.cloneRange();
1455
+ if (dom.comparePoints(range.startContainer, range.startOffset, this.startContainer, this.startOffset) == -1) {
1456
+ unionRange.setStart(range.startContainer, range.startOffset);
1457
+ }
1458
+ if (dom.comparePoints(range.endContainer, range.endOffset, this.endContainer, this.endOffset) == 1) {
1459
+ unionRange.setEnd(range.endContainer, range.endOffset);
1460
+ }
1461
+ return unionRange;
1462
+ } else {
1463
+ throw new RangeException("Ranges do not intersect");
1464
+ }
1465
+ },
1466
+
1467
+ containsNode: function(node, allowPartial) {
1468
+ if (allowPartial) {
1469
+ return this.intersectsNode(node, false);
1470
+ } else {
1471
+ return this.compareNode(node) == n_i;
1472
+ }
1473
+ },
1474
+
1475
+ containsNodeContents: function(node) {
1476
+ return this.comparePoint(node, 0) >= 0 && this.comparePoint(node, dom.getNodeLength(node)) <= 0;
1477
+ },
1478
+
1479
+ containsRange: function(range) {
1480
+ return this.intersection(range).equals(range);
1481
+ },
1482
+
1483
+ containsNodeText: function(node) {
1484
+ var nodeRange = this.cloneRange();
1485
+ nodeRange.selectNode(node);
1486
+ var textNodes = nodeRange.getNodes([3]);
1487
+ if (textNodes.length > 0) {
1488
+ nodeRange.setStart(textNodes[0], 0);
1489
+ var lastTextNode = textNodes.pop();
1490
+ nodeRange.setEnd(lastTextNode, lastTextNode.length);
1491
+ var contains = this.containsRange(nodeRange);
1492
+ nodeRange.detach();
1493
+ return contains;
1494
+ } else {
1495
+ return this.containsNodeContents(node);
1496
+ }
1497
+ },
1498
+
1499
+ createNodeIterator: function(nodeTypes, filter) {
1500
+ assertRangeValid(this);
1501
+ return new RangeNodeIterator(this, nodeTypes, filter);
1502
+ },
1503
+
1504
+ getNodes: function(nodeTypes, filter) {
1505
+ assertRangeValid(this);
1506
+ return getNodesInRange(this, nodeTypes, filter);
1507
+ },
1508
+
1509
+ getDocument: function() {
1510
+ return getRangeDocument(this);
1511
+ },
1512
+
1513
+ collapseBefore: function(node) {
1514
+ assertNotDetached(this);
1515
+
1516
+ this.setEndBefore(node);
1517
+ this.collapse(false);
1518
+ },
1519
+
1520
+ collapseAfter: function(node) {
1521
+ assertNotDetached(this);
1522
+
1523
+ this.setStartAfter(node);
1524
+ this.collapse(true);
1525
+ },
1526
+
1527
+ getName: function() {
1528
+ return "DomRange";
1529
+ },
1530
+
1531
+ equals: function(range) {
1532
+ return Range.rangesEqual(this, range);
1533
+ },
1534
+
1535
+ inspect: function() {
1536
+ return inspect(this);
1537
+ }
1538
+ };
1539
+
1540
+ function copyComparisonConstantsToObject(obj) {
1541
+ obj.START_TO_START = s2s;
1542
+ obj.START_TO_END = s2e;
1543
+ obj.END_TO_END = e2e;
1544
+ obj.END_TO_START = e2s;
1545
+
1546
+ obj.NODE_BEFORE = n_b;
1547
+ obj.NODE_AFTER = n_a;
1548
+ obj.NODE_BEFORE_AND_AFTER = n_b_a;
1549
+ obj.NODE_INSIDE = n_i;
1550
+ }
1551
+
1552
+ function copyComparisonConstants(constructor) {
1553
+ copyComparisonConstantsToObject(constructor);
1554
+ copyComparisonConstantsToObject(constructor.prototype);
1555
+ }
1556
+
1557
+ function createRangeContentRemover(remover, boundaryUpdater) {
1558
+ return function() {
1559
+ assertRangeValid(this);
1560
+
1561
+ var sc = this.startContainer, so = this.startOffset, root = this.commonAncestorContainer;
1562
+
1563
+ var iterator = new RangeIterator(this, true);
1564
+
1565
+ // Work out where to position the range after content removal
1566
+ var node, boundary;
1567
+ if (sc !== root) {
1568
+ node = dom.getClosestAncestorIn(sc, root, true);
1569
+ boundary = getBoundaryAfterNode(node);
1570
+ sc = boundary.node;
1571
+ so = boundary.offset;
1572
+ }
1573
+
1574
+ // Check none of the range is read-only
1575
+ iterateSubtree(iterator, assertNodeNotReadOnly);
1576
+
1577
+ iterator.reset();
1578
+
1579
+ // Remove the content
1580
+ var returnValue = remover(iterator);
1581
+ iterator.detach();
1582
+
1583
+ // Move to the new position
1584
+ boundaryUpdater(this, sc, so, sc, so);
1585
+
1586
+ return returnValue;
1587
+ };
1588
+ }
1589
+
1590
+ function createPrototypeRange(constructor, boundaryUpdater, detacher) {
1591
+ function createBeforeAfterNodeSetter(isBefore, isStart) {
1592
+ return function(node) {
1593
+ assertNotDetached(this);
1594
+ assertValidNodeType(node, beforeAfterNodeTypes);
1595
+ assertValidNodeType(getRootContainer(node), rootContainerNodeTypes);
1596
+
1597
+ var boundary = (isBefore ? getBoundaryBeforeNode : getBoundaryAfterNode)(node);
1598
+ (isStart ? setRangeStart : setRangeEnd)(this, boundary.node, boundary.offset);
1599
+ };
1600
+ }
1601
+
1602
+ function setRangeStart(range, node, offset) {
1603
+ var ec = range.endContainer, eo = range.endOffset;
1604
+ if (node !== range.startContainer || offset !== this.startOffset) {
1605
+ // Check the root containers of the range and the new boundary, and also check whether the new boundary
1606
+ // is after the current end. In either case, collapse the range to the new position
1607
+ if (getRootContainer(node) != getRootContainer(ec) || dom.comparePoints(node, offset, ec, eo) == 1) {
1608
+ ec = node;
1609
+ eo = offset;
1610
+ }
1611
+ boundaryUpdater(range, node, offset, ec, eo);
1612
+ }
1613
+ }
1614
+
1615
+ function setRangeEnd(range, node, offset) {
1616
+ var sc = range.startContainer, so = range.startOffset;
1617
+ if (node !== range.endContainer || offset !== this.endOffset) {
1618
+ // Check the root containers of the range and the new boundary, and also check whether the new boundary
1619
+ // is after the current end. In either case, collapse the range to the new position
1620
+ if (getRootContainer(node) != getRootContainer(sc) || dom.comparePoints(node, offset, sc, so) == -1) {
1621
+ sc = node;
1622
+ so = offset;
1623
+ }
1624
+ boundaryUpdater(range, sc, so, node, offset);
1625
+ }
1626
+ }
1627
+
1628
+ function setRangeStartAndEnd(range, node, offset) {
1629
+ if (node !== range.startContainer || offset !== this.startOffset || node !== range.endContainer || offset !== this.endOffset) {
1630
+ boundaryUpdater(range, node, offset, node, offset);
1631
+ }
1632
+ }
1633
+
1634
+ constructor.prototype = new RangePrototype();
1635
+
1636
+ api.util.extend(constructor.prototype, {
1637
+ setStart: function(node, offset) {
1638
+ assertNotDetached(this);
1639
+ assertNoDocTypeNotationEntityAncestor(node, true);
1640
+ assertValidOffset(node, offset);
1641
+
1642
+ setRangeStart(this, node, offset);
1643
+ },
1644
+
1645
+ setEnd: function(node, offset) {
1646
+ assertNotDetached(this);
1647
+ assertNoDocTypeNotationEntityAncestor(node, true);
1648
+ assertValidOffset(node, offset);
1649
+
1650
+ setRangeEnd(this, node, offset);
1651
+ },
1652
+
1653
+ setStartBefore: createBeforeAfterNodeSetter(true, true),
1654
+ setStartAfter: createBeforeAfterNodeSetter(false, true),
1655
+ setEndBefore: createBeforeAfterNodeSetter(true, false),
1656
+ setEndAfter: createBeforeAfterNodeSetter(false, false),
1657
+
1658
+ collapse: function(isStart) {
1659
+ assertRangeValid(this);
1660
+ if (isStart) {
1661
+ boundaryUpdater(this, this.startContainer, this.startOffset, this.startContainer, this.startOffset);
1662
+ } else {
1663
+ boundaryUpdater(this, this.endContainer, this.endOffset, this.endContainer, this.endOffset);
1664
+ }
1665
+ },
1666
+
1667
+ selectNodeContents: function(node) {
1668
+ // This doesn't seem well specified: the spec talks only about selecting the node's contents, which
1669
+ // could be taken to mean only its children. However, browsers implement this the same as selectNode for
1670
+ // text nodes, so I shall do likewise
1671
+ assertNotDetached(this);
1672
+ assertNoDocTypeNotationEntityAncestor(node, true);
1673
+
1674
+ boundaryUpdater(this, node, 0, node, dom.getNodeLength(node));
1675
+ },
1676
+
1677
+ selectNode: function(node) {
1678
+ assertNotDetached(this);
1679
+ assertNoDocTypeNotationEntityAncestor(node, false);
1680
+ assertValidNodeType(node, beforeAfterNodeTypes);
1681
+
1682
+ var start = getBoundaryBeforeNode(node), end = getBoundaryAfterNode(node);
1683
+ boundaryUpdater(this, start.node, start.offset, end.node, end.offset);
1684
+ },
1685
+
1686
+ extractContents: createRangeContentRemover(extractSubtree, boundaryUpdater),
1687
+
1688
+ deleteContents: createRangeContentRemover(deleteSubtree, boundaryUpdater),
1689
+
1690
+ canSurroundContents: function() {
1691
+ assertRangeValid(this);
1692
+ assertNodeNotReadOnly(this.startContainer);
1693
+ assertNodeNotReadOnly(this.endContainer);
1694
+
1695
+ // Check if the contents can be surrounded. Specifically, this means whether the range partially selects
1696
+ // no non-text nodes.
1697
+ var iterator = new RangeIterator(this, true);
1698
+ var boundariesInvalid = (iterator._first && (isNonTextPartiallySelected(iterator._first, this)) ||
1699
+ (iterator._last && isNonTextPartiallySelected(iterator._last, this)));
1700
+ iterator.detach();
1701
+ return !boundariesInvalid;
1702
+ },
1703
+
1704
+ detach: function() {
1705
+ detacher(this);
1706
+ },
1707
+
1708
+ splitBoundaries: function() {
1709
+ assertRangeValid(this);
1710
+
1711
+
1712
+ var sc = this.startContainer, so = this.startOffset, ec = this.endContainer, eo = this.endOffset;
1713
+ var startEndSame = (sc === ec);
1714
+
1715
+ if (dom.isCharacterDataNode(ec) && eo > 0 && eo < ec.length) {
1716
+ dom.splitDataNode(ec, eo);
1717
+
1718
+ }
1719
+
1720
+ if (dom.isCharacterDataNode(sc) && so > 0 && so < sc.length) {
1721
+
1722
+ sc = dom.splitDataNode(sc, so);
1723
+ if (startEndSame) {
1724
+ eo -= so;
1725
+ ec = sc;
1726
+ } else if (ec == sc.parentNode && eo >= dom.getNodeIndex(sc)) {
1727
+ eo++;
1728
+ }
1729
+ so = 0;
1730
+
1731
+ }
1732
+ boundaryUpdater(this, sc, so, ec, eo);
1733
+ },
1734
+
1735
+ normalizeBoundaries: function() {
1736
+ assertRangeValid(this);
1737
+
1738
+ var sc = this.startContainer, so = this.startOffset, ec = this.endContainer, eo = this.endOffset;
1739
+
1740
+ var mergeForward = function(node) {
1741
+ var sibling = node.nextSibling;
1742
+ if (sibling && sibling.nodeType == node.nodeType) {
1743
+ ec = node;
1744
+ eo = node.length;
1745
+ node.appendData(sibling.data);
1746
+ sibling.parentNode.removeChild(sibling);
1747
+ }
1748
+ };
1749
+
1750
+ var mergeBackward = function(node) {
1751
+ var sibling = node.previousSibling;
1752
+ if (sibling && sibling.nodeType == node.nodeType) {
1753
+ sc = node;
1754
+ var nodeLength = node.length;
1755
+ so = sibling.length;
1756
+ node.insertData(0, sibling.data);
1757
+ sibling.parentNode.removeChild(sibling);
1758
+ if (sc == ec) {
1759
+ eo += so;
1760
+ ec = sc;
1761
+ } else if (ec == node.parentNode) {
1762
+ var nodeIndex = dom.getNodeIndex(node);
1763
+ if (eo == nodeIndex) {
1764
+ ec = node;
1765
+ eo = nodeLength;
1766
+ } else if (eo > nodeIndex) {
1767
+ eo--;
1768
+ }
1769
+ }
1770
+ }
1771
+ };
1772
+
1773
+ var normalizeStart = true;
1774
+
1775
+ if (dom.isCharacterDataNode(ec)) {
1776
+ if (ec.length == eo) {
1777
+ mergeForward(ec);
1778
+ }
1779
+ } else {
1780
+ if (eo > 0) {
1781
+ var endNode = ec.childNodes[eo - 1];
1782
+ if (endNode && dom.isCharacterDataNode(endNode)) {
1783
+ mergeForward(endNode);
1784
+ }
1785
+ }
1786
+ normalizeStart = !this.collapsed;
1787
+ }
1788
+
1789
+ if (normalizeStart) {
1790
+ if (dom.isCharacterDataNode(sc)) {
1791
+ if (so == 0) {
1792
+ mergeBackward(sc);
1793
+ }
1794
+ } else {
1795
+ if (so < sc.childNodes.length) {
1796
+ var startNode = sc.childNodes[so];
1797
+ if (startNode && dom.isCharacterDataNode(startNode)) {
1798
+ mergeBackward(startNode);
1799
+ }
1800
+ }
1801
+ }
1802
+ } else {
1803
+ sc = ec;
1804
+ so = eo;
1805
+ }
1806
+
1807
+ boundaryUpdater(this, sc, so, ec, eo);
1808
+ },
1809
+
1810
+ collapseToPoint: function(node, offset) {
1811
+ assertNotDetached(this);
1812
+
1813
+ assertNoDocTypeNotationEntityAncestor(node, true);
1814
+ assertValidOffset(node, offset);
1815
+
1816
+ setRangeStartAndEnd(this, node, offset);
1817
+ }
1818
+ });
1819
+
1820
+ copyComparisonConstants(constructor);
1821
+ }
1822
+
1823
+ /*----------------------------------------------------------------------------------------------------------------*/
1824
+
1825
+ // Updates commonAncestorContainer and collapsed after boundary change
1826
+ function updateCollapsedAndCommonAncestor(range) {
1827
+ range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);
1828
+ range.commonAncestorContainer = range.collapsed ?
1829
+ range.startContainer : dom.getCommonAncestor(range.startContainer, range.endContainer);
1830
+ }
1831
+
1832
+ function updateBoundaries(range, startContainer, startOffset, endContainer, endOffset) {
1833
+ var startMoved = (range.startContainer !== startContainer || range.startOffset !== startOffset);
1834
+ var endMoved = (range.endContainer !== endContainer || range.endOffset !== endOffset);
1835
+
1836
+ range.startContainer = startContainer;
1837
+ range.startOffset = startOffset;
1838
+ range.endContainer = endContainer;
1839
+ range.endOffset = endOffset;
1840
+
1841
+ updateCollapsedAndCommonAncestor(range);
1842
+ dispatchEvent(range, "boundarychange", {startMoved: startMoved, endMoved: endMoved});
1843
+ }
1844
+
1845
+ function detach(range) {
1846
+ assertNotDetached(range);
1847
+ range.startContainer = range.startOffset = range.endContainer = range.endOffset = null;
1848
+ range.collapsed = range.commonAncestorContainer = null;
1849
+ dispatchEvent(range, "detach", null);
1850
+ range._listeners = null;
1851
+ }
1852
+
1853
+ /**
1854
+ * @constructor
1855
+ */
1856
+ function Range(doc) {
1857
+ this.startContainer = doc;
1858
+ this.startOffset = 0;
1859
+ this.endContainer = doc;
1860
+ this.endOffset = 0;
1861
+ this._listeners = {
1862
+ boundarychange: [],
1863
+ detach: []
1864
+ };
1865
+ updateCollapsedAndCommonAncestor(this);
1866
+ }
1867
+
1868
+ createPrototypeRange(Range, updateBoundaries, detach);
1869
+
1870
+ api.rangePrototype = RangePrototype.prototype;
1871
+
1872
+ Range.rangeProperties = rangeProperties;
1873
+ Range.RangeIterator = RangeIterator;
1874
+ Range.copyComparisonConstants = copyComparisonConstants;
1875
+ Range.createPrototypeRange = createPrototypeRange;
1876
+ Range.inspect = inspect;
1877
+ Range.getRangeDocument = getRangeDocument;
1878
+ Range.rangesEqual = function(r1, r2) {
1879
+ return r1.startContainer === r2.startContainer &&
1880
+ r1.startOffset === r2.startOffset &&
1881
+ r1.endContainer === r2.endContainer &&
1882
+ r1.endOffset === r2.endOffset;
1883
+ };
1884
+
1885
+ api.DomRange = Range;
1886
+ api.RangeException = RangeException;
1887
+ });rangy.createModule("WrappedRange", function(api, module) {
1888
+ api.requireModules( ["DomUtil", "DomRange"] );
1889
+
1890
+ /**
1891
+ * @constructor
1892
+ */
1893
+ var WrappedRange;
1894
+ var dom = api.dom;
1895
+ var DomPosition = dom.DomPosition;
1896
+ var DomRange = api.DomRange;
1897
+
1898
+
1899
+
1900
+ /*----------------------------------------------------------------------------------------------------------------*/
1901
+
1902
+ /*
1903
+ This is a workaround for a bug where IE returns the wrong container element from the TextRange's parentElement()
1904
+ method. For example, in the following (where pipes denote the selection boundaries):
1905
+
1906
+ <ul id="ul"><li id="a">| a </li><li id="b"> b |</li></ul>
1907
+
1908
+ var range = document.selection.createRange();
1909
+ alert(range.parentElement().id); // Should alert "ul" but alerts "b"
1910
+
1911
+ This method returns the common ancestor node of the following:
1912
+ - the parentElement() of the textRange
1913
+ - the parentElement() of the textRange after calling collapse(true)
1914
+ - the parentElement() of the textRange after calling collapse(false)
1915
+ */
1916
+ function getTextRangeContainerElement(textRange) {
1917
+ var parentEl = textRange.parentElement();
1918
+
1919
+ var range = textRange.duplicate();
1920
+ range.collapse(true);
1921
+ var startEl = range.parentElement();
1922
+ range = textRange.duplicate();
1923
+ range.collapse(false);
1924
+ var endEl = range.parentElement();
1925
+ var startEndContainer = (startEl == endEl) ? startEl : dom.getCommonAncestor(startEl, endEl);
1926
+
1927
+ return startEndContainer == parentEl ? startEndContainer : dom.getCommonAncestor(parentEl, startEndContainer);
1928
+ }
1929
+
1930
+ function textRangeIsCollapsed(textRange) {
1931
+ return textRange.compareEndPoints("StartToEnd", textRange) == 0;
1932
+ }
1933
+
1934
+ // Gets the boundary of a TextRange expressed as a node and an offset within that node. This function started out as
1935
+ // an improved version of code found in Tim Cameron Ryan's IERange (http://code.google.com/p/ierange/) but has
1936
+ // grown, fixing problems with line breaks in preformatted text, adding workaround for IE TextRange bugs, handling
1937
+ // for inputs and images, plus optimizations.
1938
+ function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed) {
1939
+ var workingRange = textRange.duplicate();
1940
+
1941
+ workingRange.collapse(isStart);
1942
+ var containerElement = workingRange.parentElement();
1943
+
1944
+ // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so
1945
+ // check for that
1946
+ // TODO: Find out when. Workaround for wholeRangeContainerElement may break this
1947
+ if (!dom.isAncestorOf(wholeRangeContainerElement, containerElement, true)) {
1948
+ containerElement = wholeRangeContainerElement;
1949
+
1950
+ }
1951
+
1952
+
1953
+
1954
+ // Deal with nodes that cannot "contain rich HTML markup". In practice, this means form inputs, images and
1955
+ // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx
1956
+ if (!containerElement.canHaveHTML) {
1957
+ return new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));
1958
+ }
1959
+
1960
+ var workingNode = dom.getDocument(containerElement).createElement("span");
1961
+ var comparison, workingComparisonType = isStart ? "StartToStart" : "StartToEnd";
1962
+ var previousNode, nextNode, boundaryPosition, boundaryNode;
1963
+
1964
+ // Move the working range through the container's children, starting at the end and working backwards, until the
1965
+ // working range reaches or goes past the boundary we're interested in
1966
+ do {
1967
+ containerElement.insertBefore(workingNode, workingNode.previousSibling);
1968
+ workingRange.moveToElementText(workingNode);
1969
+ } while ( (comparison = workingRange.compareEndPoints(workingComparisonType, textRange)) > 0 &&
1970
+ workingNode.previousSibling);
1971
+
1972
+ // We've now reached or gone past the boundary of the text range we're interested in
1973
+ // so have identified the node we want
1974
+ boundaryNode = workingNode.nextSibling;
1975
+
1976
+ if (comparison == -1 && boundaryNode && dom.isCharacterDataNode(boundaryNode)) {
1977
+ // This is a character data node (text, comment, cdata). The working range is collapsed at the start of the
1978
+ // node containing the text range's boundary, so we move the end of the working range to the boundary point
1979
+ // and measure the length of its text to get the boundary's offset within the node.
1980
+ workingRange.setEndPoint(isStart ? "EndToStart" : "EndToEnd", textRange);
1981
+
1982
+
1983
+ var offset;
1984
+
1985
+ if (/[\r\n]/.test(boundaryNode.data)) {
1986
+ /*
1987
+ For the particular case of a boundary within a text node containing line breaks (within a <pre> element,
1988
+ for example), we need a slightly complicated approach to get the boundary's offset in IE. The facts:
1989
+
1990
+ - Each line break is represented as \r in the text node's data/nodeValue properties
1991
+ - Each line break is represented as \r\n in the TextRange's 'text' property
1992
+ - The 'text' property of the TextRange does not contain trailing line breaks
1993
+
1994
+ To get round the problem presented by the final fact above, we can use the fact that TextRange's
1995
+ moveStart() and moveEnd() methods return the actual number of characters moved, which is not necessarily
1996
+ the same as the number of characters it was instructed to move. The simplest approach is to use this to
1997
+ store the characters moved when moving both the start and end of the range to the start of the document
1998
+ body and subtracting the start offset from the end offset (the "move-negative-gazillion" method).
1999
+ However, this is extremely slow when the document is large and the range is near the end of it. Clearly
2000
+ doing the mirror image (i.e. moving the range boundaries to the end of the document) has the same
2001
+ problem.
2002
+
2003
+ Another approach that works is to use moveStart() to move the start boundary of the range up to the end
2004
+ boundary one character at a time and incrementing a counter with the value returned by the moveStart()
2005
+ call. However, the check for whether the start boundary has reached the end boundary is expensive, so
2006
+ this method is slow (although unlike "move-negative-gazillion" is largely unaffected by the location of
2007
+ the range within the document).
2008
+
2009
+ The method below is a hybrid of the two methods above. It uses the fact that a string containing the
2010
+ TextRange's 'text' property with each \r\n converted to a single \r character cannot be longer than the
2011
+ text of the TextRange, so the start of the range is moved that length initially and then a character at
2012
+ a time to make up for any trailing line breaks not contained in the 'text' property. This has good
2013
+ performance in most situations compared to the previous two methods.
2014
+ */
2015
+ var tempRange = workingRange.duplicate();
2016
+ var rangeLength = tempRange.text.replace(/\r\n/g, "\r").length;
2017
+
2018
+ offset = tempRange.moveStart("character", rangeLength);
2019
+ while ( (comparison = tempRange.compareEndPoints("StartToEnd", tempRange)) == -1) {
2020
+ offset++;
2021
+ tempRange.moveStart("character", 1);
2022
+ }
2023
+ } else {
2024
+ offset = workingRange.text.length;
2025
+ }
2026
+ boundaryPosition = new DomPosition(boundaryNode, offset);
2027
+ } else {
2028
+
2029
+
2030
+ // If the boundary immediately follows a character data node and this is the end boundary, we should favour
2031
+ // a position within that, and likewise for a start boundary preceding a character data node
2032
+ previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;
2033
+ nextNode = (isCollapsed || isStart) && workingNode.nextSibling;
2034
+
2035
+
2036
+
2037
+ if (nextNode && dom.isCharacterDataNode(nextNode)) {
2038
+ boundaryPosition = new DomPosition(nextNode, 0);
2039
+ } else if (previousNode && dom.isCharacterDataNode(previousNode)) {
2040
+ boundaryPosition = new DomPosition(previousNode, previousNode.length);
2041
+ } else {
2042
+ boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));
2043
+ }
2044
+ }
2045
+
2046
+ // Clean up
2047
+ workingNode.parentNode.removeChild(workingNode);
2048
+
2049
+ return boundaryPosition;
2050
+ }
2051
+
2052
+ // Returns a TextRange representing the boundary of a TextRange expressed as a node and an offset within that node.
2053
+ // This function started out as an optimized version of code found in Tim Cameron Ryan's IERange
2054
+ // (http://code.google.com/p/ierange/)
2055
+ function createBoundaryTextRange(boundaryPosition, isStart) {
2056
+ var boundaryNode, boundaryParent, boundaryOffset = boundaryPosition.offset;
2057
+ var doc = dom.getDocument(boundaryPosition.node);
2058
+ var workingNode, childNodes, workingRange = doc.body.createTextRange();
2059
+ var nodeIsDataNode = dom.isCharacterDataNode(boundaryPosition.node);
2060
+
2061
+ if (nodeIsDataNode) {
2062
+ boundaryNode = boundaryPosition.node;
2063
+ boundaryParent = boundaryNode.parentNode;
2064
+ } else {
2065
+ childNodes = boundaryPosition.node.childNodes;
2066
+ boundaryNode = (boundaryOffset < childNodes.length) ? childNodes[boundaryOffset] : null;
2067
+ boundaryParent = boundaryPosition.node;
2068
+ }
2069
+
2070
+ // Position the range immediately before the node containing the boundary
2071
+ workingNode = doc.createElement("span");
2072
+
2073
+ // Making the working element non-empty element persuades IE to consider the TextRange boundary to be within the
2074
+ // element rather than immediately before or after it, which is what we want
2075
+ workingNode.innerHTML = "&#feff;";
2076
+
2077
+ // insertBefore is supposed to work like appendChild if the second parameter is null. However, a bug report
2078
+ // for IERange suggests that it can crash the browser: http://code.google.com/p/ierange/issues/detail?id=12
2079
+ if (boundaryNode) {
2080
+ boundaryParent.insertBefore(workingNode, boundaryNode);
2081
+ } else {
2082
+ boundaryParent.appendChild(workingNode);
2083
+ }
2084
+
2085
+ workingRange.moveToElementText(workingNode);
2086
+ workingRange.collapse(!isStart);
2087
+
2088
+ // Clean up
2089
+ boundaryParent.removeChild(workingNode);
2090
+
2091
+ // Move the working range to the text offset, if required
2092
+ if (nodeIsDataNode) {
2093
+ workingRange[isStart ? "moveStart" : "moveEnd"]("character", boundaryOffset);
2094
+ }
2095
+
2096
+ return workingRange;
2097
+ }
2098
+
2099
+ /*----------------------------------------------------------------------------------------------------------------*/
2100
+
2101
+ if (api.features.implementsDomRange && (!api.features.implementsTextRange || !api.config.preferTextRange)) {
2102
+ // This is a wrapper around the browser's native DOM Range. It has two aims:
2103
+ // - Provide workarounds for specific browser bugs
2104
+ // - provide convenient extensions, which are inherited from Rangy's DomRange
2105
+
2106
+ (function() {
2107
+ var rangeProto;
2108
+ var rangeProperties = DomRange.rangeProperties;
2109
+ var canSetRangeStartAfterEnd;
2110
+
2111
+ function updateRangeProperties(range) {
2112
+ var i = rangeProperties.length, prop;
2113
+ while (i--) {
2114
+ prop = rangeProperties[i];
2115
+ range[prop] = range.nativeRange[prop];
2116
+ }
2117
+ }
2118
+
2119
+ function updateNativeRange(range, startContainer, startOffset, endContainer,endOffset) {
2120
+ var startMoved = (range.startContainer !== startContainer || range.startOffset != startOffset);
2121
+ var endMoved = (range.endContainer !== endContainer || range.endOffset != endOffset);
2122
+
2123
+ // Always set both boundaries for the benefit of IE9 (see issue 35)
2124
+ if (startMoved || endMoved) {
2125
+ range.setEnd(endContainer, endOffset);
2126
+ range.setStart(startContainer, startOffset);
2127
+ }
2128
+ }
2129
+
2130
+ function detach(range) {
2131
+ range.nativeRange.detach();
2132
+ range.detached = true;
2133
+ var i = rangeProperties.length, prop;
2134
+ while (i--) {
2135
+ prop = rangeProperties[i];
2136
+ range[prop] = null;
2137
+ }
2138
+ }
2139
+
2140
+ var createBeforeAfterNodeSetter;
2141
+
2142
+ WrappedRange = function(range) {
2143
+ if (!range) {
2144
+ throw new Error("Range must be specified");
2145
+ }
2146
+ this.nativeRange = range;
2147
+ updateRangeProperties(this);
2148
+ };
2149
+
2150
+ DomRange.createPrototypeRange(WrappedRange, updateNativeRange, detach);
2151
+
2152
+ rangeProto = WrappedRange.prototype;
2153
+
2154
+ rangeProto.selectNode = function(node) {
2155
+ this.nativeRange.selectNode(node);
2156
+ updateRangeProperties(this);
2157
+ };
2158
+
2159
+ rangeProto.deleteContents = function() {
2160
+ this.nativeRange.deleteContents();
2161
+ updateRangeProperties(this);
2162
+ };
2163
+
2164
+ rangeProto.extractContents = function() {
2165
+ var frag = this.nativeRange.extractContents();
2166
+ updateRangeProperties(this);
2167
+ return frag;
2168
+ };
2169
+
2170
+ rangeProto.cloneContents = function() {
2171
+ return this.nativeRange.cloneContents();
2172
+ };
2173
+
2174
+ // TODO: Until I can find a way to programmatically trigger the Firefox bug (apparently long-standing, still
2175
+ // present in 3.6.8) that throws "Index or size is negative or greater than the allowed amount" for
2176
+ // insertNode in some circumstances, all browsers will have to use the Rangy's own implementation of
2177
+ // insertNode, which works but is almost certainly slower than the native implementation.
2178
+ /*
2179
+ rangeProto.insertNode = function(node) {
2180
+ this.nativeRange.insertNode(node);
2181
+ updateRangeProperties(this);
2182
+ };
2183
+ */
2184
+
2185
+ rangeProto.surroundContents = function(node) {
2186
+ this.nativeRange.surroundContents(node);
2187
+ updateRangeProperties(this);
2188
+ };
2189
+
2190
+ rangeProto.collapse = function(isStart) {
2191
+ this.nativeRange.collapse(isStart);
2192
+ updateRangeProperties(this);
2193
+ };
2194
+
2195
+ rangeProto.cloneRange = function() {
2196
+ return new WrappedRange(this.nativeRange.cloneRange());
2197
+ };
2198
+
2199
+ rangeProto.refresh = function() {
2200
+ updateRangeProperties(this);
2201
+ };
2202
+
2203
+ rangeProto.toString = function() {
2204
+ return this.nativeRange.toString();
2205
+ };
2206
+
2207
+ // Create test range and node for feature detection
2208
+
2209
+ var testTextNode = document.createTextNode("test");
2210
+ dom.getBody(document).appendChild(testTextNode);
2211
+ var range = document.createRange();
2212
+
2213
+ /*--------------------------------------------------------------------------------------------------------*/
2214
+
2215
+ // Test for Firefox 2 bug that prevents moving the start of a Range to a point after its current end and
2216
+ // correct for it
2217
+
2218
+ range.setStart(testTextNode, 0);
2219
+ range.setEnd(testTextNode, 0);
2220
+
2221
+ try {
2222
+ range.setStart(testTextNode, 1);
2223
+ canSetRangeStartAfterEnd = true;
2224
+
2225
+ rangeProto.setStart = function(node, offset) {
2226
+ this.nativeRange.setStart(node, offset);
2227
+ updateRangeProperties(this);
2228
+ };
2229
+
2230
+ rangeProto.setEnd = function(node, offset) {
2231
+ this.nativeRange.setEnd(node, offset);
2232
+ updateRangeProperties(this);
2233
+ };
2234
+
2235
+ createBeforeAfterNodeSetter = function(name) {
2236
+ return function(node) {
2237
+ this.nativeRange[name](node);
2238
+ updateRangeProperties(this);
2239
+ };
2240
+ };
2241
+
2242
+ } catch(ex) {
2243
+
2244
+
2245
+ canSetRangeStartAfterEnd = false;
2246
+
2247
+ rangeProto.setStart = function(node, offset) {
2248
+ try {
2249
+ this.nativeRange.setStart(node, offset);
2250
+ } catch (ex) {
2251
+ this.nativeRange.setEnd(node, offset);
2252
+ this.nativeRange.setStart(node, offset);
2253
+ }
2254
+ updateRangeProperties(this);
2255
+ };
2256
+
2257
+ rangeProto.setEnd = function(node, offset) {
2258
+ try {
2259
+ this.nativeRange.setEnd(node, offset);
2260
+ } catch (ex) {
2261
+ this.nativeRange.setStart(node, offset);
2262
+ this.nativeRange.setEnd(node, offset);
2263
+ }
2264
+ updateRangeProperties(this);
2265
+ };
2266
+
2267
+ createBeforeAfterNodeSetter = function(name, oppositeName) {
2268
+ return function(node) {
2269
+ try {
2270
+ this.nativeRange[name](node);
2271
+ } catch (ex) {
2272
+ this.nativeRange[oppositeName](node);
2273
+ this.nativeRange[name](node);
2274
+ }
2275
+ updateRangeProperties(this);
2276
+ };
2277
+ };
2278
+ }
2279
+
2280
+ rangeProto.setStartBefore = createBeforeAfterNodeSetter("setStartBefore", "setEndBefore");
2281
+ rangeProto.setStartAfter = createBeforeAfterNodeSetter("setStartAfter", "setEndAfter");
2282
+ rangeProto.setEndBefore = createBeforeAfterNodeSetter("setEndBefore", "setStartBefore");
2283
+ rangeProto.setEndAfter = createBeforeAfterNodeSetter("setEndAfter", "setStartAfter");
2284
+
2285
+ /*--------------------------------------------------------------------------------------------------------*/
2286
+
2287
+ // Test for and correct Firefox 2 behaviour with selectNodeContents on text nodes: it collapses the range to
2288
+ // the 0th character of the text node
2289
+ range.selectNodeContents(testTextNode);
2290
+ if (range.startContainer == testTextNode && range.endContainer == testTextNode &&
2291
+ range.startOffset == 0 && range.endOffset == testTextNode.length) {
2292
+ rangeProto.selectNodeContents = function(node) {
2293
+ this.nativeRange.selectNodeContents(node);
2294
+ updateRangeProperties(this);
2295
+ };
2296
+ } else {
2297
+ rangeProto.selectNodeContents = function(node) {
2298
+ this.setStart(node, 0);
2299
+ this.setEnd(node, DomRange.getEndOffset(node));
2300
+ };
2301
+ }
2302
+
2303
+ /*--------------------------------------------------------------------------------------------------------*/
2304
+
2305
+ // Test for WebKit bug that has the beahviour of compareBoundaryPoints round the wrong way for constants
2306
+ // START_TO_END and END_TO_START: https://bugs.webkit.org/show_bug.cgi?id=20738
2307
+
2308
+ range.selectNodeContents(testTextNode);
2309
+ range.setEnd(testTextNode, 3);
2310
+
2311
+ var range2 = document.createRange();
2312
+ range2.selectNodeContents(testTextNode);
2313
+ range2.setEnd(testTextNode, 4);
2314
+ range2.setStart(testTextNode, 2);
2315
+
2316
+ if (range.compareBoundaryPoints(range.START_TO_END, range2) == -1 &
2317
+ range.compareBoundaryPoints(range.END_TO_START, range2) == 1) {
2318
+ // This is the wrong way round, so correct for it
2319
+
2320
+
2321
+ rangeProto.compareBoundaryPoints = function(type, range) {
2322
+ range = range.nativeRange || range;
2323
+ if (type == range.START_TO_END) {
2324
+ type = range.END_TO_START;
2325
+ } else if (type == range.END_TO_START) {
2326
+ type = range.START_TO_END;
2327
+ }
2328
+ return this.nativeRange.compareBoundaryPoints(type, range);
2329
+ };
2330
+ } else {
2331
+ rangeProto.compareBoundaryPoints = function(type, range) {
2332
+ return this.nativeRange.compareBoundaryPoints(type, range.nativeRange || range);
2333
+ };
2334
+ }
2335
+
2336
+ /*--------------------------------------------------------------------------------------------------------*/
2337
+
2338
+ // Test for existence of createContextualFragment and delegate to it if it exists
2339
+ if (api.util.isHostMethod(range, "createContextualFragment")) {
2340
+ rangeProto.createContextualFragment = function(fragmentStr) {
2341
+ return this.nativeRange.createContextualFragment(fragmentStr);
2342
+ };
2343
+ }
2344
+
2345
+ /*--------------------------------------------------------------------------------------------------------*/
2346
+
2347
+ // Clean up
2348
+ dom.getBody(document).removeChild(testTextNode);
2349
+ range.detach();
2350
+ range2.detach();
2351
+ })();
2352
+
2353
+ api.createNativeRange = function(doc) {
2354
+ doc = doc || document;
2355
+ return doc.createRange();
2356
+ };
2357
+ } else if (api.features.implementsTextRange) {
2358
+ // This is a wrapper around a TextRange, providing full DOM Range functionality using rangy's DomRange as a
2359
+ // prototype
2360
+
2361
+ WrappedRange = function(textRange) {
2362
+ this.textRange = textRange;
2363
+ this.refresh();
2364
+ };
2365
+
2366
+ WrappedRange.prototype = new DomRange(document);
2367
+
2368
+ WrappedRange.prototype.refresh = function() {
2369
+ var start, end;
2370
+
2371
+ // TextRange's parentElement() method cannot be trusted. getTextRangeContainerElement() works around that.
2372
+ var rangeContainerElement = getTextRangeContainerElement(this.textRange);
2373
+
2374
+ if (textRangeIsCollapsed(this.textRange)) {
2375
+ end = start = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, true, true);
2376
+ } else {
2377
+
2378
+ start = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, true, false);
2379
+ end = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, false, false);
2380
+ }
2381
+
2382
+ this.setStart(start.node, start.offset);
2383
+ this.setEnd(end.node, end.offset);
2384
+ };
2385
+
2386
+ DomRange.copyComparisonConstants(WrappedRange);
2387
+
2388
+ // Add WrappedRange as the Range property of the global object to allow expression like Range.END_TO_END to work
2389
+ var globalObj = (function() { return this; })();
2390
+ if (typeof globalObj.Range == "undefined") {
2391
+ globalObj.Range = WrappedRange;
2392
+ }
2393
+
2394
+ api.createNativeRange = function(doc) {
2395
+ doc = doc || document;
2396
+ return doc.body.createTextRange();
2397
+ };
2398
+ }
2399
+
2400
+ if (api.features.implementsTextRange) {
2401
+ WrappedRange.rangeToTextRange = function(range) {
2402
+ if (range.collapsed) {
2403
+ var tr = createBoundaryTextRange(new DomPosition(range.startContainer, range.startOffset), true);
2404
+
2405
+
2406
+
2407
+ return tr;
2408
+
2409
+ //return createBoundaryTextRange(new DomPosition(range.startContainer, range.startOffset), true);
2410
+ } else {
2411
+ var startRange = createBoundaryTextRange(new DomPosition(range.startContainer, range.startOffset), true);
2412
+ var endRange = createBoundaryTextRange(new DomPosition(range.endContainer, range.endOffset), false);
2413
+ var textRange = dom.getDocument(range.startContainer).body.createTextRange();
2414
+ textRange.setEndPoint("StartToStart", startRange);
2415
+ textRange.setEndPoint("EndToEnd", endRange);
2416
+ return textRange;
2417
+ }
2418
+ };
2419
+ }
2420
+
2421
+ WrappedRange.prototype.getName = function() {
2422
+ return "WrappedRange";
2423
+ };
2424
+
2425
+ api.WrappedRange = WrappedRange;
2426
+
2427
+ api.createRange = function(doc) {
2428
+ doc = doc || document;
2429
+ return new WrappedRange(api.createNativeRange(doc));
2430
+ };
2431
+
2432
+ api.createRangyRange = function(doc) {
2433
+ doc = doc || document;
2434
+ return new DomRange(doc);
2435
+ };
2436
+
2437
+ api.createIframeRange = function(iframeEl) {
2438
+ return api.createRange(dom.getIframeDocument(iframeEl));
2439
+ };
2440
+
2441
+ api.createIframeRangyRange = function(iframeEl) {
2442
+ return api.createRangyRange(dom.getIframeDocument(iframeEl));
2443
+ };
2444
+
2445
+ api.addCreateMissingNativeApiListener(function(win) {
2446
+ var doc = win.document;
2447
+ if (typeof doc.createRange == "undefined") {
2448
+ doc.createRange = function() {
2449
+ return api.createRange(this);
2450
+ };
2451
+ }
2452
+ doc = win = null;
2453
+ });
2454
+ });rangy.createModule("WrappedSelection", function(api, module) {
2455
+ // This will create a selection object wrapper that follows the Selection object found in the WHATWG draft DOM Range
2456
+ // spec (http://html5.org/specs/dom-range.html)
2457
+
2458
+ api.requireModules( ["DomUtil", "DomRange", "WrappedRange"] );
2459
+
2460
+ api.config.checkSelectionRanges = true;
2461
+
2462
+ var BOOLEAN = "boolean",
2463
+ windowPropertyName = "_rangySelection",
2464
+ dom = api.dom,
2465
+ util = api.util,
2466
+ DomRange = api.DomRange,
2467
+ WrappedRange = api.WrappedRange,
2468
+ DOMException = api.DOMException,
2469
+ DomPosition = dom.DomPosition,
2470
+ getSelection,
2471
+ selectionIsCollapsed,
2472
+ CONTROL = "Control";
2473
+
2474
+
2475
+
2476
+ function getWinSelection(winParam) {
2477
+ return (winParam || window).getSelection();
2478
+ }
2479
+
2480
+ function getDocSelection(winParam) {
2481
+ return (winParam || window).document.selection;
2482
+ }
2483
+
2484
+ // Test for the Range/TextRange and Selection features required
2485
+ // Test for ability to retrieve selection
2486
+ var implementsWinGetSelection = api.util.isHostMethod(window, "getSelection"),
2487
+ implementsDocSelection = api.util.isHostObject(document, "selection");
2488
+
2489
+ var useDocumentSelection = implementsDocSelection && (!implementsWinGetSelection || api.config.preferTextRange);
2490
+
2491
+ if (useDocumentSelection) {
2492
+ getSelection = getDocSelection;
2493
+ api.isSelectionValid = function(winParam) {
2494
+ var doc = (winParam || window).document, nativeSel = doc.selection;
2495
+
2496
+ // Check whether the selection TextRange is actually contained within the correct document
2497
+ return (nativeSel.type != "None" || dom.getDocument(nativeSel.createRange().parentElement()) == doc);
2498
+ };
2499
+ } else if (implementsWinGetSelection) {
2500
+ getSelection = getWinSelection;
2501
+ api.isSelectionValid = function() {
2502
+ return true;
2503
+ };
2504
+ } else {
2505
+ module.fail("Neither document.selection or window.getSelection() detected.");
2506
+ }
2507
+
2508
+ api.getNativeSelection = getSelection;
2509
+
2510
+ var testSelection = getSelection();
2511
+ var testRange = api.createNativeRange(document);
2512
+ var body = dom.getBody(document);
2513
+
2514
+ // Obtaining a range from a selection
2515
+ var selectionHasAnchorAndFocus = util.areHostObjects(testSelection, ["anchorNode", "focusNode"] &&
2516
+ util.areHostProperties(testSelection, ["anchorOffset", "focusOffset"]));
2517
+ api.features.selectionHasAnchorAndFocus = selectionHasAnchorAndFocus;
2518
+
2519
+ // Test for existence of native selection extend() method
2520
+ var selectionHasExtend = util.isHostMethod(testSelection, "extend");
2521
+ api.features.selectionHasExtend = selectionHasExtend;
2522
+
2523
+ // Test if rangeCount exists
2524
+ var selectionHasRangeCount = (typeof testSelection.rangeCount == "number");
2525
+ api.features.selectionHasRangeCount = selectionHasRangeCount;
2526
+
2527
+ var selectionSupportsMultipleRanges = false;
2528
+ var collapsedNonEditableSelectionsSupported = true;
2529
+
2530
+ if (util.areHostMethods(testSelection, ["addRange", "getRangeAt", "removeAllRanges"]) &&
2531
+ typeof testSelection.rangeCount == "number" && api.features.implementsDomRange) {
2532
+
2533
+ (function() {
2534
+ var iframe = document.createElement("iframe");
2535
+ body.appendChild(iframe);
2536
+
2537
+ var iframeDoc = dom.getIframeDocument(iframe);
2538
+ iframeDoc.open();
2539
+ iframeDoc.write("<html><head></head><body>12</body></html>");
2540
+ iframeDoc.close();
2541
+
2542
+ var sel = dom.getIframeWindow(iframe).getSelection();
2543
+ var docEl = iframeDoc.documentElement;
2544
+ var iframeBody = docEl.lastChild, textNode = iframeBody.firstChild;
2545
+
2546
+ // Test whether the native selection will allow a collapsed selection within a non-editable element
2547
+ var r1 = iframeDoc.createRange();
2548
+ r1.setStart(textNode, 1);
2549
+ r1.collapse(true);
2550
+ sel.addRange(r1);
2551
+ collapsedNonEditableSelectionsSupported = (sel.rangeCount == 1);
2552
+ sel.removeAllRanges();
2553
+
2554
+ // Test whether the native selection is capable of supporting multiple ranges
2555
+ var r2 = r1.cloneRange();
2556
+ r1.setStart(textNode, 0);
2557
+ r2.setEnd(textNode, 2);
2558
+ sel.addRange(r1);
2559
+ sel.addRange(r2);
2560
+
2561
+ selectionSupportsMultipleRanges = (sel.rangeCount == 2);
2562
+
2563
+ // Clean up
2564
+ r1.detach();
2565
+ r2.detach();
2566
+
2567
+ body.removeChild(iframe);
2568
+ })();
2569
+ }
2570
+
2571
+ api.features.selectionSupportsMultipleRanges = selectionSupportsMultipleRanges;
2572
+ api.features.collapsedNonEditableSelectionsSupported = collapsedNonEditableSelectionsSupported;
2573
+
2574
+ // ControlRanges
2575
+ var implementsControlRange = false, testControlRange;
2576
+
2577
+ if (body && util.isHostMethod(body, "createControlRange")) {
2578
+ testControlRange = body.createControlRange();
2579
+ if (util.areHostProperties(testControlRange, ["item", "add"])) {
2580
+ implementsControlRange = true;
2581
+ }
2582
+ }
2583
+ api.features.implementsControlRange = implementsControlRange;
2584
+
2585
+ // Selection collapsedness
2586
+ if (selectionHasAnchorAndFocus) {
2587
+ selectionIsCollapsed = function(sel) {
2588
+ return sel.anchorNode === sel.focusNode && sel.anchorOffset === sel.focusOffset;
2589
+ };
2590
+ } else {
2591
+ selectionIsCollapsed = function(sel) {
2592
+ return sel.rangeCount ? sel.getRangeAt(sel.rangeCount - 1).collapsed : false;
2593
+ };
2594
+ }
2595
+
2596
+ function updateAnchorAndFocusFromRange(sel, range, backwards) {
2597
+ var anchorPrefix = backwards ? "end" : "start", focusPrefix = backwards ? "start" : "end";
2598
+ sel.anchorNode = range[anchorPrefix + "Container"];
2599
+ sel.anchorOffset = range[anchorPrefix + "Offset"];
2600
+ sel.focusNode = range[focusPrefix + "Container"];
2601
+ sel.focusOffset = range[focusPrefix + "Offset"];
2602
+ }
2603
+
2604
+ function updateAnchorAndFocusFromNativeSelection(sel) {
2605
+ var nativeSel = sel.nativeSelection;
2606
+ sel.anchorNode = nativeSel.anchorNode;
2607
+ sel.anchorOffset = nativeSel.anchorOffset;
2608
+ sel.focusNode = nativeSel.focusNode;
2609
+ sel.focusOffset = nativeSel.focusOffset;
2610
+ }
2611
+
2612
+ function updateEmptySelection(sel) {
2613
+ sel.anchorNode = sel.focusNode = null;
2614
+ sel.anchorOffset = sel.focusOffset = 0;
2615
+ sel.rangeCount = 0;
2616
+ sel.isCollapsed = true;
2617
+ sel._ranges.length = 0;
2618
+ }
2619
+
2620
+ function getNativeRange(range) {
2621
+ var nativeRange;
2622
+ if (range instanceof DomRange) {
2623
+ nativeRange = range._selectionNativeRange;
2624
+ if (!nativeRange) {
2625
+ nativeRange = api.createNativeRange(dom.getDocument(range.startContainer));
2626
+ nativeRange.setEnd(range.endContainer, range.endOffset);
2627
+ nativeRange.setStart(range.startContainer, range.startOffset);
2628
+ range._selectionNativeRange = nativeRange;
2629
+ range.attachListener("detach", function() {
2630
+
2631
+ this._selectionNativeRange = null;
2632
+ });
2633
+ }
2634
+ } else if (range instanceof WrappedRange) {
2635
+ nativeRange = range.nativeRange;
2636
+ } else if (api.features.implementsDomRange && (range instanceof dom.getWindow(range.startContainer).Range)) {
2637
+ nativeRange = range;
2638
+ }
2639
+ return nativeRange;
2640
+ }
2641
+
2642
+ function rangeContainsSingleElement(rangeNodes) {
2643
+ if (!rangeNodes.length || rangeNodes[0].nodeType != 1) {
2644
+ return false;
2645
+ }
2646
+ for (var i = 1, len = rangeNodes.length; i < len; ++i) {
2647
+ if (!dom.isAncestorOf(rangeNodes[0], rangeNodes[i])) {
2648
+ return false;
2649
+ }
2650
+ }
2651
+ return true;
2652
+ }
2653
+
2654
+ function getSingleElementFromRange(range) {
2655
+ var nodes = range.getNodes();
2656
+ if (!rangeContainsSingleElement(nodes)) {
2657
+ throw new Error("getSingleElementFromRange: range " + range.inspect() + " did not consist of a single element");
2658
+ }
2659
+ return nodes[0];
2660
+ }
2661
+
2662
+ function isTextRange(range) {
2663
+ return !!range && typeof range.text != "undefined";
2664
+ }
2665
+
2666
+ function updateFromTextRange(sel, range) {
2667
+ // Create a Range from the selected TextRange
2668
+ var wrappedRange = new WrappedRange(range);
2669
+ sel._ranges = [wrappedRange];
2670
+
2671
+ updateAnchorAndFocusFromRange(sel, wrappedRange, false);
2672
+ sel.rangeCount = 1;
2673
+ sel.isCollapsed = wrappedRange.collapsed;
2674
+ }
2675
+
2676
+ function updateControlSelection(sel) {
2677
+ // Update the wrapped selection based on what's now in the native selection
2678
+ sel._ranges.length = 0;
2679
+ if (sel.docSelection.type == "None") {
2680
+ updateEmptySelection(sel);
2681
+ } else {
2682
+ var controlRange = sel.docSelection.createRange();
2683
+ if (isTextRange(controlRange)) {
2684
+ // This case (where the selection type is "Control" and calling createRange() on the selection returns
2685
+ // a TextRange) can happen in IE 9. It happens, for example, when all elements in the selected
2686
+ // ControlRange have been removed from the ControlRange and removed from the document.
2687
+ updateFromTextRange(sel, controlRange);
2688
+ } else {
2689
+ sel.rangeCount = controlRange.length;
2690
+ var range, doc = dom.getDocument(controlRange.item(0));
2691
+ for (var i = 0; i < sel.rangeCount; ++i) {
2692
+ range = api.createRange(doc);
2693
+ range.selectNode(controlRange.item(i));
2694
+ sel._ranges.push(range);
2695
+ }
2696
+ sel.isCollapsed = sel.rangeCount == 1 && sel._ranges[0].collapsed;
2697
+ updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], false);
2698
+ }
2699
+ }
2700
+ }
2701
+
2702
+ function addRangeToControlSelection(sel, range) {
2703
+ var controlRange = sel.docSelection.createRange();
2704
+ var rangeElement = getSingleElementFromRange(range);
2705
+
2706
+ // Create a new ControlRange containing all the elements in the selected ControlRange plus the element
2707
+ // contained by the supplied range
2708
+ var doc = dom.getDocument(controlRange.item(0));
2709
+ var newControlRange = dom.getBody(doc).createControlRange();
2710
+ for (var i = 0, len = controlRange.length; i < len; ++i) {
2711
+ newControlRange.add(controlRange.item(i));
2712
+ }
2713
+ try {
2714
+ newControlRange.add(rangeElement);
2715
+ } catch (ex) {
2716
+ throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)");
2717
+ }
2718
+ newControlRange.select();
2719
+
2720
+ // Update the wrapped selection based on what's now in the native selection
2721
+ updateControlSelection(sel);
2722
+ }
2723
+
2724
+ var getSelectionRangeAt;
2725
+
2726
+ if (util.isHostMethod(testSelection, "getRangeAt")) {
2727
+ getSelectionRangeAt = function(sel, index) {
2728
+ try {
2729
+ return sel.getRangeAt(index);
2730
+ } catch(ex) {
2731
+ return null;
2732
+ }
2733
+ };
2734
+ } else if (selectionHasAnchorAndFocus) {
2735
+ getSelectionRangeAt = function(sel) {
2736
+ var doc = dom.getDocument(sel.anchorNode);
2737
+ var range = api.createRange(doc);
2738
+ range.setStart(sel.anchorNode, sel.anchorOffset);
2739
+ range.setEnd(sel.focusNode, sel.focusOffset);
2740
+
2741
+ // Handle the case when the selection was selected backwards (from the end to the start in the
2742
+ // document)
2743
+ if (range.collapsed !== this.isCollapsed) {
2744
+ range.setStart(sel.focusNode, sel.focusOffset);
2745
+ range.setEnd(sel.anchorNode, sel.anchorOffset);
2746
+ }
2747
+
2748
+ return range;
2749
+ };
2750
+ }
2751
+
2752
+ /**
2753
+ * @constructor
2754
+ */
2755
+ function WrappedSelection(selection, docSelection, win) {
2756
+ this.nativeSelection = selection;
2757
+ this.docSelection = docSelection;
2758
+ this._ranges = [];
2759
+ this.win = win;
2760
+ this.refresh();
2761
+ }
2762
+
2763
+ api.getSelection = function(win) {
2764
+ win = win || window;
2765
+ var sel = win[windowPropertyName];
2766
+ var nativeSel = getSelection(win), docSel = implementsDocSelection ? getDocSelection(win) : null;
2767
+ if (sel) {
2768
+ sel.nativeSelection = nativeSel;
2769
+ sel.docSelection = docSel;
2770
+ sel.refresh(win);
2771
+ } else {
2772
+ sel = new WrappedSelection(nativeSel, docSel, win);
2773
+ win[windowPropertyName] = sel;
2774
+ }
2775
+ return sel;
2776
+ };
2777
+
2778
+ api.getIframeSelection = function(iframeEl) {
2779
+ return api.getSelection(dom.getIframeWindow(iframeEl));
2780
+ };
2781
+
2782
+ var selProto = WrappedSelection.prototype;
2783
+
2784
+ function createControlSelection(sel, ranges) {
2785
+ // Ensure that the selection becomes of type "Control"
2786
+ var doc = dom.getDocument(ranges[0].startContainer);
2787
+ var controlRange = dom.getBody(doc).createControlRange();
2788
+ for (var i = 0, el; i < rangeCount; ++i) {
2789
+ el = getSingleElementFromRange(ranges[i]);
2790
+ try {
2791
+ controlRange.add(el);
2792
+ } catch (ex) {
2793
+ throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)");
2794
+ }
2795
+ }
2796
+ controlRange.select();
2797
+
2798
+ // Update the wrapped selection based on what's now in the native selection
2799
+ updateControlSelection(sel);
2800
+ }
2801
+
2802
+ // Selecting a range
2803
+ if (!useDocumentSelection && selectionHasAnchorAndFocus && util.areHostMethods(testSelection, ["removeAllRanges", "addRange"])) {
2804
+ selProto.removeAllRanges = function() {
2805
+ this.nativeSelection.removeAllRanges();
2806
+ updateEmptySelection(this);
2807
+ };
2808
+
2809
+ var addRangeBackwards = function(sel, range) {
2810
+ var doc = DomRange.getRangeDocument(range);
2811
+ var endRange = api.createRange(doc);
2812
+ endRange.collapseToPoint(range.endContainer, range.endOffset);
2813
+ sel.nativeSelection.addRange(getNativeRange(endRange));
2814
+ sel.nativeSelection.extend(range.startContainer, range.startOffset);
2815
+ sel.refresh();
2816
+ };
2817
+
2818
+ if (selectionHasRangeCount) {
2819
+ selProto.addRange = function(range, backwards) {
2820
+ if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {
2821
+ addRangeToControlSelection(this, range);
2822
+ } else {
2823
+ if (backwards && selectionHasExtend) {
2824
+ addRangeBackwards(this, range);
2825
+ } else {
2826
+ var previousRangeCount;
2827
+ if (selectionSupportsMultipleRanges) {
2828
+ previousRangeCount = this.rangeCount;
2829
+ } else {
2830
+ this.removeAllRanges();
2831
+ previousRangeCount = 0;
2832
+ }
2833
+ this.nativeSelection.addRange(getNativeRange(range));
2834
+
2835
+ // Check whether adding the range was successful
2836
+ this.rangeCount = this.nativeSelection.rangeCount;
2837
+
2838
+ if (this.rangeCount == previousRangeCount + 1) {
2839
+ // The range was added successfully
2840
+
2841
+ // Check whether the range that we added to the selection is reflected in the last range extracted from
2842
+ // the selection
2843
+ if (api.config.checkSelectionRanges) {
2844
+ var nativeRange = getSelectionRangeAt(this.nativeSelection, this.rangeCount - 1);
2845
+ if (nativeRange && !DomRange.rangesEqual(nativeRange, range)) {
2846
+ // Happens in WebKit with, for example, a selection placed at the start of a text node
2847
+ range = new WrappedRange(nativeRange);
2848
+ }
2849
+ }
2850
+ this._ranges[this.rangeCount - 1] = range;
2851
+ updateAnchorAndFocusFromRange(this, range, selectionIsBackwards(this.nativeSelection));
2852
+ this.isCollapsed = selectionIsCollapsed(this);
2853
+ } else {
2854
+ // The range was not added successfully. The simplest thing is to refresh
2855
+ this.refresh();
2856
+ }
2857
+ }
2858
+ }
2859
+ };
2860
+ } else {
2861
+ selProto.addRange = function(range, backwards) {
2862
+ if (backwards && selectionHasExtend) {
2863
+ addRangeBackwards(this, range);
2864
+ } else {
2865
+ this.nativeSelection.addRange(getNativeRange(range));
2866
+ this.refresh();
2867
+ }
2868
+ };
2869
+ }
2870
+
2871
+ selProto.setRanges = function(ranges) {
2872
+ if (implementsControlRange && ranges.length > 1) {
2873
+ createControlSelection(this, ranges);
2874
+ } else {
2875
+ this.removeAllRanges();
2876
+ for (var i = 0, len = ranges.length; i < len; ++i) {
2877
+ this.addRange(ranges[i]);
2878
+ }
2879
+ }
2880
+ };
2881
+ } else if (util.isHostMethod(testSelection, "empty") && util.isHostMethod(testRange, "select") &&
2882
+ implementsControlRange && useDocumentSelection) {
2883
+
2884
+ selProto.removeAllRanges = function() {
2885
+ // Added try/catch as fix for issue #21
2886
+ try {
2887
+ this.docSelection.empty();
2888
+
2889
+ // Check for empty() not working (issue #24)
2890
+ if (this.docSelection.type != "None") {
2891
+ // Work around failure to empty a control selection by instead selecting a TextRange and then
2892
+ // calling empty()
2893
+ var doc;
2894
+ if (this.anchorNode) {
2895
+ doc = dom.getDocument(this.anchorNode);
2896
+ } else if (this.docSelection.type == CONTROL) {
2897
+ var controlRange = this.docSelection.createRange();
2898
+ if (controlRange.length) {
2899
+ doc = dom.getDocument(controlRange.item(0)).body.createTextRange();
2900
+ }
2901
+ }
2902
+ if (doc) {
2903
+ var textRange = doc.body.createTextRange();
2904
+ textRange.select();
2905
+ this.docSelection.empty();
2906
+ }
2907
+ }
2908
+ } catch(ex) {}
2909
+ updateEmptySelection(this);
2910
+ };
2911
+
2912
+ selProto.addRange = function(range) {
2913
+ if (this.docSelection.type == CONTROL) {
2914
+ addRangeToControlSelection(this, range);
2915
+ } else {
2916
+ WrappedRange.rangeToTextRange(range).select();
2917
+ this._ranges[0] = range;
2918
+ this.rangeCount = 1;
2919
+ this.isCollapsed = this._ranges[0].collapsed;
2920
+ updateAnchorAndFocusFromRange(this, range, false);
2921
+ }
2922
+ };
2923
+
2924
+ selProto.setRanges = function(ranges) {
2925
+ this.removeAllRanges();
2926
+ var rangeCount = ranges.length;
2927
+ if (rangeCount > 1) {
2928
+ createControlSelection(this, ranges);
2929
+ } else if (rangeCount) {
2930
+ this.addRange(ranges[0]);
2931
+ }
2932
+ };
2933
+ } else {
2934
+ module.fail("No means of selecting a Range or TextRange was found");
2935
+ return false;
2936
+ }
2937
+
2938
+ selProto.getRangeAt = function(index) {
2939
+ if (index < 0 || index >= this.rangeCount) {
2940
+ throw new DOMException("INDEX_SIZE_ERR");
2941
+ } else {
2942
+ return this._ranges[index];
2943
+ }
2944
+ };
2945
+
2946
+ var refreshSelection;
2947
+
2948
+ if (useDocumentSelection) {
2949
+ refreshSelection = function(sel) {
2950
+ var range;
2951
+ if (api.isSelectionValid(sel.win)) {
2952
+ range = sel.docSelection.createRange();
2953
+ } else {
2954
+ range = dom.getBody(sel.win.document).createTextRange();
2955
+ range.collapse(true);
2956
+ }
2957
+
2958
+
2959
+ if (sel.docSelection.type == CONTROL) {
2960
+ updateControlSelection(sel);
2961
+ } else if (isTextRange(range)) {
2962
+ updateFromTextRange(sel, range);
2963
+ } else {
2964
+ updateEmptySelection(sel);
2965
+ }
2966
+ };
2967
+ } else if (util.isHostMethod(testSelection, "getRangeAt") && typeof testSelection.rangeCount == "number") {
2968
+ refreshSelection = function(sel) {
2969
+ if (implementsControlRange && implementsDocSelection && sel.docSelection.type == CONTROL) {
2970
+ updateControlSelection(sel);
2971
+ } else {
2972
+ sel._ranges.length = sel.rangeCount = sel.nativeSelection.rangeCount;
2973
+ if (sel.rangeCount) {
2974
+ for (var i = 0, len = sel.rangeCount; i < len; ++i) {
2975
+ sel._ranges[i] = new api.WrappedRange(sel.nativeSelection.getRangeAt(i));
2976
+ }
2977
+ updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], selectionIsBackwards(sel.nativeSelection));
2978
+ sel.isCollapsed = selectionIsCollapsed(sel);
2979
+ } else {
2980
+ updateEmptySelection(sel);
2981
+ }
2982
+ }
2983
+ };
2984
+ } else if (selectionHasAnchorAndFocus && typeof testSelection.isCollapsed == BOOLEAN && typeof testRange.collapsed == BOOLEAN && api.features.implementsDomRange) {
2985
+ refreshSelection = function(sel) {
2986
+ var range, nativeSel = sel.nativeSelection;
2987
+ if (nativeSel.anchorNode) {
2988
+ range = getSelectionRangeAt(nativeSel, 0);
2989
+ sel._ranges = [range];
2990
+ sel.rangeCount = 1;
2991
+ updateAnchorAndFocusFromNativeSelection(sel);
2992
+ sel.isCollapsed = selectionIsCollapsed(sel);
2993
+ } else {
2994
+ updateEmptySelection(sel);
2995
+ }
2996
+ };
2997
+ } else {
2998
+ module.fail("No means of obtaining a Range or TextRange from the user's selection was found");
2999
+ return false;
3000
+ }
3001
+
3002
+ selProto.refresh = function(checkForChanges) {
3003
+ var oldRanges = checkForChanges ? this._ranges.slice(0) : null;
3004
+ refreshSelection(this);
3005
+ if (checkForChanges) {
3006
+ var i = oldRanges.length;
3007
+ if (i != this._ranges.length) {
3008
+ return false;
3009
+ }
3010
+ while (i--) {
3011
+ if (!DomRange.rangesEqual(oldRanges[i], this._ranges[i])) {
3012
+ return false;
3013
+ }
3014
+ }
3015
+ return true;
3016
+ }
3017
+ };
3018
+
3019
+ // Removal of a single range
3020
+ var removeRangeManually = function(sel, range) {
3021
+ var ranges = sel.getAllRanges(), removed = false;
3022
+ sel.removeAllRanges();
3023
+ for (var i = 0, len = ranges.length; i < len; ++i) {
3024
+ if (removed || range !== ranges[i]) {
3025
+ sel.addRange(ranges[i]);
3026
+ } else {
3027
+ // According to the draft WHATWG Range spec, the same range may be added to the selection multiple
3028
+ // times. removeRange should only remove the first instance, so the following ensures only the first
3029
+ // instance is removed
3030
+ removed = true;
3031
+ }
3032
+ }
3033
+ if (!sel.rangeCount) {
3034
+ updateEmptySelection(sel);
3035
+ }
3036
+ };
3037
+
3038
+ if (implementsControlRange) {
3039
+ selProto.removeRange = function(range) {
3040
+ if (this.docSelection.type == CONTROL) {
3041
+ var controlRange = this.docSelection.createRange();
3042
+ var rangeElement = getSingleElementFromRange(range);
3043
+
3044
+ // Create a new ControlRange containing all the elements in the selected ControlRange minus the
3045
+ // element contained by the supplied range
3046
+ var doc = dom.getDocument(controlRange.item(0));
3047
+ var newControlRange = dom.getBody(doc).createControlRange();
3048
+ var el, removed = false;
3049
+ for (var i = 0, len = controlRange.length; i < len; ++i) {
3050
+ el = controlRange.item(i);
3051
+ if (el !== rangeElement || removed) {
3052
+ newControlRange.add(controlRange.item(i));
3053
+ } else {
3054
+ removed = true;
3055
+ }
3056
+ }
3057
+ newControlRange.select();
3058
+
3059
+ // Update the wrapped selection based on what's now in the native selection
3060
+ updateControlSelection(this);
3061
+ } else {
3062
+ removeRangeManually(this, range);
3063
+ }
3064
+ };
3065
+ } else {
3066
+ selProto.removeRange = function(range) {
3067
+ removeRangeManually(this, range);
3068
+ };
3069
+ }
3070
+
3071
+ // Detecting if a selection is backwards
3072
+ var selectionIsBackwards;
3073
+ if (!useDocumentSelection && selectionHasAnchorAndFocus && api.features.implementsDomRange) {
3074
+ selectionIsBackwards = function(sel) {
3075
+ var backwards = false;
3076
+ if (sel.anchorNode) {
3077
+ backwards = (dom.comparePoints(sel.anchorNode, sel.anchorOffset, sel.focusNode, sel.focusOffset) == 1);
3078
+ }
3079
+ return backwards;
3080
+ };
3081
+
3082
+ selProto.isBackwards = function() {
3083
+ return selectionIsBackwards(this);
3084
+ };
3085
+ } else {
3086
+ selectionIsBackwards = selProto.isBackwards = function() {
3087
+ return false;
3088
+ };
3089
+ }
3090
+
3091
+ // Selection text
3092
+ // This is conformant to the new WHATWG DOM Range draft spec but differs from WebKit and Mozilla's implementation
3093
+ selProto.toString = function() {
3094
+
3095
+ var rangeTexts = [];
3096
+ for (var i = 0, len = this.rangeCount; i < len; ++i) {
3097
+ rangeTexts[i] = "" + this._ranges[i];
3098
+ }
3099
+ return rangeTexts.join("");
3100
+ };
3101
+
3102
+ function assertNodeInSameDocument(sel, node) {
3103
+ if (sel.anchorNode && (dom.getDocument(sel.anchorNode) !== dom.getDocument(node))) {
3104
+ throw new DOMException("WRONG_DOCUMENT_ERR");
3105
+ }
3106
+ }
3107
+
3108
+ // No current browsers conform fully to the HTML 5 draft spec for this method, so Rangy's own method is always used
3109
+ selProto.collapse = function(node, offset) {
3110
+ assertNodeInSameDocument(this, node);
3111
+ var range = api.createRange(dom.getDocument(node));
3112
+ range.collapseToPoint(node, offset);
3113
+ this.removeAllRanges();
3114
+ this.addRange(range);
3115
+ this.isCollapsed = true;
3116
+ };
3117
+
3118
+ selProto.collapseToStart = function() {
3119
+ if (this.rangeCount) {
3120
+ var range = this._ranges[0];
3121
+ this.collapse(range.startContainer, range.startOffset);
3122
+ } else {
3123
+ throw new DOMException("INVALID_STATE_ERR");
3124
+ }
3125
+ };
3126
+
3127
+ selProto.collapseToEnd = function() {
3128
+ if (this.rangeCount) {
3129
+ var range = this._ranges[this.rangeCount - 1];
3130
+ this.collapse(range.endContainer, range.endOffset);
3131
+ } else {
3132
+ throw new DOMException("INVALID_STATE_ERR");
3133
+ }
3134
+ };
3135
+
3136
+ // The HTML 5 spec is very specific on how selectAllChildren should be implemented so the native implementation is
3137
+ // never used by Rangy.
3138
+ selProto.selectAllChildren = function(node) {
3139
+ assertNodeInSameDocument(this, node);
3140
+ var range = api.createRange(dom.getDocument(node));
3141
+ range.selectNodeContents(node);
3142
+ this.removeAllRanges();
3143
+ this.addRange(range);
3144
+ };
3145
+
3146
+ selProto.deleteFromDocument = function() {
3147
+ // Sepcial behaviour required for Control selections
3148
+ if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {
3149
+ var controlRange = this.docSelection.createRange();
3150
+ var element;
3151
+ while (controlRange.length) {
3152
+ element = controlRange.item(0);
3153
+ controlRange.remove(element);
3154
+ element.parentNode.removeChild(element);
3155
+ }
3156
+ this.refresh();
3157
+ } else if (this.rangeCount) {
3158
+ var ranges = this.getAllRanges();
3159
+ this.removeAllRanges();
3160
+ for (var i = 0, len = ranges.length; i < len; ++i) {
3161
+ ranges[i].deleteContents();
3162
+ }
3163
+ // The HTML5 spec says nothing about what the selection should contain after calling deleteContents on each
3164
+ // range. Firefox moves the selection to where the final selected range was, so we emulate that
3165
+ this.addRange(ranges[len - 1]);
3166
+ }
3167
+ };
3168
+
3169
+ // The following are non-standard extensions
3170
+ selProto.getAllRanges = function() {
3171
+ return this._ranges.slice(0);
3172
+ };
3173
+
3174
+ selProto.setSingleRange = function(range) {
3175
+ this.setRanges( [range] );
3176
+ };
3177
+
3178
+ selProto.containsNode = function(node, allowPartial) {
3179
+ for (var i = 0, len = this._ranges.length; i < len; ++i) {
3180
+ if (this._ranges[i].containsNode(node, allowPartial)) {
3181
+ return true;
3182
+ }
3183
+ }
3184
+ return false;
3185
+ };
3186
+
3187
+ selProto.toHtml = function() {
3188
+ var html = "";
3189
+ if (this.rangeCount) {
3190
+ var container = DomRange.getRangeDocument(this._ranges[0]).createElement("div");
3191
+ for (var i = 0, len = this._ranges.length; i < len; ++i) {
3192
+ container.appendChild(this._ranges[i].cloneContents());
3193
+ }
3194
+ html = container.innerHTML;
3195
+ }
3196
+ return html;
3197
+ };
3198
+
3199
+ function inspect(sel) {
3200
+ var rangeInspects = [];
3201
+ var anchor = new DomPosition(sel.anchorNode, sel.anchorOffset);
3202
+ var focus = new DomPosition(sel.focusNode, sel.focusOffset);
3203
+ var name = (typeof sel.getName == "function") ? sel.getName() : "Selection";
3204
+
3205
+ if (typeof sel.rangeCount != "undefined") {
3206
+ for (var i = 0, len = sel.rangeCount; i < len; ++i) {
3207
+ rangeInspects[i] = DomRange.inspect(sel.getRangeAt(i));
3208
+ }
3209
+ }
3210
+ return "[" + name + "(Ranges: " + rangeInspects.join(", ") +
3211
+ ")(anchor: " + anchor.inspect() + ", focus: " + focus.inspect() + "]";
3212
+
3213
+ }
3214
+
3215
+ selProto.getName = function() {
3216
+ return "WrappedSelection";
3217
+ };
3218
+
3219
+ selProto.inspect = function() {
3220
+ return inspect(this);
3221
+ };
3222
+
3223
+ selProto.detach = function() {
3224
+ this.win[windowPropertyName] = null;
3225
+ this.win = this.anchorNode = this.focusNode = null;
3226
+ };
3227
+
3228
+ WrappedSelection.inspect = inspect;
3229
+
3230
+ api.Selection = WrappedSelection;
3231
+
3232
+ api.selectionPrototype = selProto;
3233
+
3234
+ api.addCreateMissingNativeApiListener(function(win) {
3235
+ if (typeof win.getSelection == "undefined") {
3236
+ win.getSelection = function() {
3237
+ return api.getSelection(this);
3238
+ };
3239
+ }
3240
+ win = null;
3241
+ });
3242
+ });