locomotive_cms 0.0.4.beta12 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. data/Gemfile +13 -15
  2. data/README.textile +4 -5
  3. data/app/controllers/admin/api_contents_controller.rb +1 -10
  4. data/app/controllers/admin/base_controller.rb +2 -2
  5. data/app/controllers/admin/cross_domain_sessions_controller.rb +4 -7
  6. data/app/controllers/admin/current_sites_controller.rb +0 -2
  7. data/app/controllers/admin/imports_controller.rb +19 -13
  8. data/app/controllers/admin/pages_controller.rb +1 -1
  9. data/app/controllers/admin/passwords_controller.rb +2 -2
  10. data/app/controllers/admin/sessions_controller.rb +2 -2
  11. data/app/controllers/admin/sites_controller.rb +0 -2
  12. data/app/controllers/admin/theme_assets_controller.rb +1 -1
  13. data/app/controllers/application_controller.rb +1 -1
  14. data/app/controllers/home_controller.rb +7 -0
  15. data/app/helpers/admin/assets_helper.rb +6 -0
  16. data/app/helpers/admin/custom_fields_helper.rb +2 -2
  17. data/app/helpers/admin/{box_helper.rb → login_helper.rb} +3 -7
  18. data/app/models/asset_collection.rb +3 -15
  19. data/app/models/content_instance.rb +0 -19
  20. data/app/models/content_type.rb +3 -21
  21. data/app/models/extensions/page/tree.rb +7 -63
  22. data/app/models/page.rb +0 -2
  23. data/app/models/site.rb +3 -15
  24. data/app/uploaders/asset_uploader.rb +1 -1
  25. data/app/uploaders/theme_asset_uploader.rb +1 -12
  26. data/app/views/admin/asset_collections/edit.html.haml +2 -2
  27. data/app/views/admin/asset_collections/new.html.haml +1 -1
  28. data/app/views/admin/assets/_form.html.haml +2 -2
  29. data/app/views/admin/content_types/_form.html.haml +2 -2
  30. data/app/views/admin/content_types/new.html.haml +1 -1
  31. data/app/views/admin/contents/_form.html.haml +2 -2
  32. data/app/views/admin/contents/index.html.haml +1 -1
  33. data/app/views/admin/cross_domain_sessions/new.html.haml +1 -1
  34. data/app/views/admin/current_sites/_form.html.haml +3 -3
  35. data/app/views/admin/current_sites/edit.html.haml +1 -1
  36. data/app/views/admin/imports/new.html.haml +0 -11
  37. data/app/views/admin/imports/show.html.haml +1 -1
  38. data/app/views/admin/my_accounts/edit.html.haml +1 -1
  39. data/app/views/admin/pages/_form.html.haml +3 -2
  40. data/app/views/admin/pages/_page.html.haml +2 -4
  41. data/app/views/admin/pages/index.html.haml +1 -1
  42. data/app/views/admin/passwords/edit.html.haml +2 -2
  43. data/app/views/admin/passwords/new.html.haml +2 -2
  44. data/app/views/admin/sessions/new.html.haml +2 -2
  45. data/app/views/admin/shared/_head.html.haml +5 -4
  46. data/app/views/admin/shared/menu/_contents.html.haml +1 -1
  47. data/app/views/admin/sites/_form.html.haml +3 -3
  48. data/app/views/admin/snippets/_form.html.haml +2 -2
  49. data/app/views/admin/snippets/index.html.haml +15 -0
  50. data/app/views/admin/theme_assets/_form.html.haml +2 -2
  51. data/app/views/admin/theme_assets/index.html.haml +1 -1
  52. data/app/views/home/show.html.haml +4 -0
  53. data/app/views/{admin/layouts → layouts/admin}/application.html.haml +0 -0
  54. data/app/views/layouts/admin/box.html.haml +19 -0
  55. data/app/views/layouts/application.html.haml +7 -0
  56. data/config/application.rb +3 -1
  57. data/config/environments/development.rb +6 -1
  58. data/config/environments/production.rb +1 -1
  59. data/config/environments/test.rb +5 -1
  60. data/config/initializers/locomotive.rb +0 -14
  61. data/config/locales/admin_ui_en.yml +1 -33
  62. data/config/locales/admin_ui_fr.yml +1 -34
  63. data/config/locales/default_en.yml +0 -1
  64. data/config/locales/default_fr.yml +0 -1
  65. data/config/locales/flash.en.yml +0 -1
  66. data/config/locales/flash.fr.yml +0 -1
  67. data/config/mongoid.yml +5 -13
  68. data/config/routes.rb +1 -6
  69. data/lib/generators/locomotive/copy_assets/copy_assets_generator.rb +14 -0
  70. data/lib/generators/locomotive/install/install_generator.rb +10 -18
  71. data/lib/generators/locomotive/install/templates/README +13 -23
  72. data/lib/generators/locomotive/install/templates/locomotive.rb +1 -15
  73. data/lib/locomotive/carrierwave.rb +0 -1
  74. data/lib/locomotive/configuration.rb +1 -3
  75. data/lib/locomotive/custom_fields.rb +1 -0
  76. data/lib/locomotive/delayed_job.rb +2 -1
  77. data/lib/locomotive/engine.rb +7 -24
  78. data/lib/locomotive/heroku.rb +0 -1
  79. data/lib/locomotive/httparty/webservice.rb +1 -12
  80. data/lib/locomotive/import.rb +0 -2
  81. data/lib/locomotive/import/asset_collections.rb +8 -40
  82. data/lib/locomotive/import/assets.rb +12 -20
  83. data/lib/locomotive/import/content_types.rb +15 -51
  84. data/lib/locomotive/import/job.rb +11 -106
  85. data/lib/locomotive/import/pages.rb +26 -79
  86. data/lib/locomotive/import/site.rb +5 -3
  87. data/lib/locomotive/import/snippets.rb +8 -6
  88. data/lib/locomotive/inherited_resources.rb +0 -1
  89. data/lib/locomotive/liquid/drops/asset_collections.rb +4 -4
  90. data/lib/locomotive/liquid/drops/contents.rb +16 -21
  91. data/lib/locomotive/liquid/drops/page.rb +0 -4
  92. data/lib/locomotive/liquid/filters/html.rb +29 -15
  93. data/lib/locomotive/liquid/tags/consume.rb +1 -1
  94. data/lib/locomotive/liquid/tags/nav.rb +17 -48
  95. data/lib/locomotive/liquid/tags/paginate.rb +3 -3
  96. data/lib/locomotive/middlewares/fonts.rb +11 -3
  97. data/lib/locomotive/misc_form_builder.rb +7 -2
  98. data/lib/locomotive/regexps.rb +1 -1
  99. data/lib/locomotive/render.rb +3 -9
  100. data/lib/locomotive/routing/site_dispatcher.rb +6 -10
  101. data/lib/locomotive/version.rb +1 -2
  102. data/public/images/admin/box/buttons/right_bg.png +0 -0
  103. data/public/javascripts/admin/aloha/VERSION.txt +1 -1
  104. data/public/javascripts/admin/aloha/aloha-nodeps.js +101 -140
  105. data/public/javascripts/admin/aloha/aloha.js +105 -193
  106. data/public/javascripts/admin/aloha/css/aloha.css +4 -65
  107. data/public/javascripts/admin/aloha/deps/prettyPhoto/resources/css/prettyPhoto.css +2 -2
  108. data/public/javascripts/admin/aloha/i18n/de.dict +0 -2
  109. data/public/javascripts/admin/aloha/i18n/en.dict +0 -2
  110. data/public/javascripts/admin/aloha/images/base.png +0 -0
  111. data/public/javascripts/admin/aloha/images/base_multi.png +0 -0
  112. data/public/javascripts/admin/aloha/images/fade_in.png +0 -0
  113. data/public/javascripts/admin/aloha/images/fade_out.png +0 -0
  114. data/public/javascripts/admin/aloha/images/gentics_logo.png +0 -0
  115. data/public/javascripts/admin/aloha/images/grabhandle.png +0 -0
  116. data/public/javascripts/admin/aloha/images/maximize.png +0 -0
  117. data/public/javascripts/admin/aloha/images/pin.png +0 -0
  118. data/public/javascripts/admin/aloha/images/removeformat.png +0 -0
  119. data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/de.dict +2 -0
  120. data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/en.dict +2 -0
  121. data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/eo.dict +2 -0
  122. data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/fi.dict +2 -0
  123. data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/fr.dict +2 -0
  124. data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/it.dict +2 -0
  125. data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/plugin.js +7 -0
  126. data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/de.dict +0 -0
  127. data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/en.dict +0 -0
  128. data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/fi.dict +0 -0
  129. data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/fr.dict +0 -0
  130. data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/it.dict +0 -0
  131. data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/plugin.js +0 -0
  132. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Format/plugin.js +1 -1
  133. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/de.dict +20 -0
  134. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/en.dict +20 -0
  135. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/eo.dict +16 -0
  136. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/fi.dict +20 -0
  137. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/fr.dict +16 -0
  138. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/it.dict +20 -0
  139. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/plugin.js +7 -0
  140. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.HighlightEditables/plugin.js +1 -1
  141. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/css/jquery.autocomplete.css +48 -0
  142. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/deps/jquery.autocomplete.js +1 -0
  143. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/plugin.js +1 -1
  144. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/ressource.js +7 -0
  145. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/ressourcedummy.js +7 -0
  146. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/ressourceregistry.js +7 -0
  147. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.List/plugin.js +1 -1
  148. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.TOC/plugin.js +1 -1
  149. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/i18n/de.dict +0 -2
  150. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/i18n/en.dict +0 -2
  151. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/plugin.js +1 -1
  152. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/resources/table.css +110 -28
  153. data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Loader/plugin.js +1 -0
  154. data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/i18n/en.dict +2 -0
  155. data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/i18n/fi.dict +2 -0
  156. data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/i18n/fr.dict +2 -0
  157. data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/person.css +3 -0
  158. data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/plugin.js +1 -0
  159. data/public/javascripts/admin/aloha/plugins/simpletable/plugin.js.deactivated +2330 -0
  160. data/public/javascripts/admin/asset_collections.js +7 -11
  161. data/public/javascripts/admin/contents.js +1 -3
  162. data/public/javascripts/admin/site.js +3 -9
  163. data/public/javascripts/admin/snippets.js +1 -1
  164. data/public/javascripts/admin/utils.js +3 -5
  165. data/public/stylesheets/admin/application.css +1 -1
  166. data/public/stylesheets/admin/box.css +5 -5
  167. data/public/stylesheets/admin/buttons.css +5 -0
  168. data/public/stylesheets/admin/formtastic_changes.css +12 -5
  169. data/public/stylesheets/admin/inline_editor.css +5 -22
  170. data/public/stylesheets/admin/layout.css +4 -9
  171. metadata +130 -187
  172. data/app/controllers/admin/installation_controller.rb +0 -79
  173. data/app/uploaders/theme_uploader.rb +0 -19
  174. data/app/views/admin/errors/no_page.html.haml +0 -1
  175. data/app/views/admin/errors/no_site.html.haml +0 -1
  176. data/app/views/admin/installation/step_1.html.haml +0 -24
  177. data/app/views/admin/installation/step_2.html.haml +0 -26
  178. data/app/views/admin/installation/step_3.html.haml +0 -23
  179. data/app/views/admin/layouts/box.html.haml +0 -21
  180. data/app/views/admin/layouts/error.html.haml +0 -1
  181. data/config/assets.yml +0 -96
  182. data/config/initializers/carrierwave.rb +0 -17
  183. data/lib/locomotive/import/base.rb +0 -46
  184. data/lib/locomotive/import/logger.rb +0 -13
  185. data/lib/locomotive/railties/tasks.rake +0 -16
  186. data/public/javascripts/admin/aloha/i18n/pl.dict +0 -5
  187. data/public/javascripts/admin/aloha/images/base_big.png +0 -0
  188. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/examples/triSports.css +0 -86
  189. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/examples/triSports.html +0 -44
  190. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/i18n/de.dict +0 -4
  191. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/i18n/en.dict +0 -4
  192. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/i18n/fr.dict +0 -4
  193. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/plugin.js +0 -1
  194. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/product.js +0 -1
  195. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/2xu-wetsuit.jpg +0 -0
  196. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/asics-noosa.jpg +0 -0
  197. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/fivefingers-kso.jpg +0 -0
  198. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/kuota-kueen-k.jpg +0 -0
  199. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/mizuno-wave-musha2.jpg +0 -0
  200. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/product.css +0 -69
  201. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/product_button.gif +0 -0
  202. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/simplon-mrt.jpg +0 -0
  203. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/trek-fuel-ex.jpg +0 -0
  204. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/trisports.jpg +0 -0
  205. data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/zoggs-predator.jpg +0 -0
  206. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/examples/AlohaAbbr.css +0 -48
  207. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/examples/AlohaAbbr.html +0 -69
  208. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/i18n/de.dict +0 -4
  209. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/i18n/en.dict +0 -4
  210. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/plugin.js +0 -7
  211. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Format/i18n/pl.dict +0 -30
  212. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/LinkList.js +0 -7
  213. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/delicious.js +0 -7
  214. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/i18n/pl.dict +0 -4
  215. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/css/LinkChecker.css +0 -14
  216. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/examples/AlohaLinkChecker.css +0 -49
  217. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/examples/AlohaLinkChecker.html +0 -82
  218. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/i18n/en.dict +0 -27
  219. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/plugin.js +0 -7
  220. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/proxy.php +0 -235
  221. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Paste/plugin.js +0 -7
  222. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Paste/wordpastehandler.js +0 -7
  223. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.TOC/i18n/de.dict +0 -1
  224. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.TOC/i18n/en.dict +0 -1
  225. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/i18n/pl.dict +0 -12
  226. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/resources/wai_green.png +0 -0
  227. data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/resources/wai_red.png +0 -0
  228. data/public/stylesheets/admin/installation.css +0 -50
  229. data/public/stylesheets/admin/safari.css +0 -15
@@ -168,14 +168,14 @@
168
168
  position: absolute;
169
169
  top: 0;
170
170
  width: 100%;
171
- z-index: 19500;
171
+ z-index: 9500;
172
172
  }
173
173
 
174
174
  div.pp_pic_holder {
175
175
  display: none;
176
176
  position: absolute;
177
177
  width: 100px;
178
- z-index: 20000;
178
+ z-index: 10000;
179
179
  }
180
180
 
181
181
  .pp_top {
@@ -3,5 +3,3 @@ floatingmenu.tab.insert=Einfügen
3
3
  yes=Ja
4
4
  no=Nein
5
5
  cancel=Abbrechen
6
- repository.no_item_found=Keinen Eintrag gefunden.
7
- repository.loading=Es wird geladen
@@ -3,5 +3,3 @@ floatingmenu.tab.insert=Insert
3
3
  yes=Yes
4
4
  no=No
5
5
  cancel=Cancel
6
- repository.no_item_found=No item found.
7
- repository.loading=Loading
@@ -0,0 +1,2 @@
1
+ button.person.tooltip=Person hinzufügen
2
+ button.event.tooltip=Event hinzufügen
@@ -0,0 +1,2 @@
1
+ button.person.tooltip=Add Person
2
+ button.event.tooltip=Add Event
@@ -0,0 +1,2 @@
1
+ button.person.tooltip=Aldoni personon
2
+ button.event.tooltip=Aldoni eventon
@@ -0,0 +1,2 @@
1
+ button.person.tooltip=Lisää henkilö
2
+ button.event.tooltip=Lisää tapahtuma
@@ -0,0 +1,2 @@
1
+ button.person.tooltip=Ajouter une personne
2
+ button.event.tooltip=Ajouter un événement
@@ -0,0 +1,2 @@
1
+ button.person.tooltip=Aggiungi persona
2
+ button.event.tooltip=Aggiungi evento
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Aloha Editor
3
+ * Author & Copyright (c) 2010 Gentics Software GmbH
4
+ * aloha-sales@gentics.com
5
+ * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
+ */
7
+ if(typeof EXAMPLE=="undefined"||!EXAMPLE){var EXAMPLE={}}EXAMPLE.DummyDCPlugin=new GENTICS.Aloha.Plugin("com.example.aloha.DummyDC");EXAMPLE.DummyDCPlugin.languages=["en","de","eo","fi","fr","it"];EXAMPLE.DummyDCPlugin.init=function(){GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addPerson",size:"small",tooltip:this.i18n("button.person.tooltip")}),GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1);GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addEvent",size:"small",tooltip:this.i18n("button.event.tooltip")}),GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1)};
@@ -4,4 +4,4 @@
4
4
  * aloha-sales@gentics.com
5
5
  * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
6
  */
7
- GENTICS.Aloha.Format=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Format");GENTICS.Aloha.Format.languages=["en","de","fr","eo","fi","ru","it","pl"];GENTICS.Aloha.Format.config=["b","i","del","sub","sup","p","title","h1","h2","h3","h4","h5","h6","pre","removeFormat"];GENTICS.Aloha.Format.init=function(){this.initButtons();var that=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(e,params){that.applyButtonConfig(params.editable.obj)})};GENTICS.Aloha.Format.applyButtonConfig=function(obj){config=this.getEditableConfig(obj);for(var button in this.buttons){if(jQuery.inArray(button,config)!=-1){this.buttons[button].button.show()}else{this.buttons[button].button.hide()}}for(var i in this.multiSplitItems){if(jQuery.inArray(this.multiSplitItems[i].name,config)!=-1){this.multiSplitButton.extButton.showItem(this.multiSplitItems[i].name)}else{this.multiSplitButton.extButton.hideItem(this.multiSplitItems[i].name)}}};GENTICS.Aloha.Format.initButtons=function(){var scope="GENTICS.Aloha.continuoustext";this.buttons={};var that=this;this.multiSplitItems=new Array();this.multiSplitButton;jQuery.each(GENTICS.Aloha.Format.config,function(j,button){switch(button){case"b":case"i":case"cite":case"q":case"code":case"abbr":case"del":case"sub":case"sup":that.buttons[button]={button:new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_"+button,size:"small",onclick:function(){if(GENTICS.Aloha.activeEditable){GENTICS.Aloha.activeEditable.obj[0].focus()}var markup=jQuery("<"+button+"></"+button+">");var rangeObject=GENTICS.Aloha.Selection.rangeObject;var foundMarkup=rangeObject.findMarkup(function(){return this.nodeName.toLowerCase()==markup.get(0).nodeName.toLowerCase()},GENTICS.Aloha.activeEditable.obj);if(foundMarkup){if(rangeObject.isCollapsed()){GENTICS.Utils.Dom.removeFromDOM(foundMarkup,rangeObject,true)}else{GENTICS.Utils.Dom.removeMarkup(rangeObject,markup,GENTICS.Aloha.activeEditable.obj)}}else{if(rangeObject.isCollapsed()){GENTICS.Utils.Dom.extendToWord(rangeObject)}GENTICS.Utils.Dom.addMarkup(rangeObject,markup)}rangeObject.select();return false},tooltip:that.i18n("button."+button+".tooltip"),toggle:true}),markup:jQuery("<"+button+"></"+button+">")};GENTICS.Aloha.FloatingMenu.addButton(scope,that.buttons[button].button,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1);break;case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"pre":that.multiSplitItems.push({name:button,tooltip:that.i18n("button."+button+".tooltip"),iconClass:"GENTICS_button "+that.i18n("GENTICS_button_"+button),markup:jQuery("<"+button+"></"+button+">"),click:function(){if(GENTICS.Aloha.activeEditable){GENTICS.Aloha.activeEditable.obj[0].focus()}GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+button+"></"+button+">"))}});break;case"removeFormat":that.multiSplitItems.push({name:button,text:that.i18n("button."+button+".text"),tooltip:that.i18n("button."+button+".tooltip"),iconClass:"GENTICS_button GENTICS_button_"+button,wide:true,click:function(){GENTICS.Aloha.Format.removeFormat()}});break;default:GENTICS.Aloha.log("warn",this,'Button "'+button+'" is not defined');break}});if(this.multiSplitItems.length>0){this.multiSplitButton=new GENTICS.Aloha.ui.MultiSplitButton({items:this.multiSplitItems});GENTICS.Aloha.FloatingMenu.addButton(scope,this.multiSplitButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),3)}GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(event,rangeObject){jQuery.each(that.buttons,function(index,button){for(var i=0;i<rangeObject.markupEffectiveAtStart.length;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(effectiveMarkup,button.markup)){button.button.setPressed(true);var statusWasSet=true}}if(!statusWasSet){button.button.setPressed(false)}});if(that.multiSplitItems.length>0){var foundMultiSplit=false;for(var i=0;i<rangeObject.markupEffectiveAtStart.length&&!foundMultiSplit;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];for(var j=0;j<that.multiSplitItems.length&&!foundMultiSplit;j++){var multiSplitItem=that.multiSplitItems[j];if(!multiSplitItem.markup){continue}if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(effectiveMarkup,multiSplitItem.markup)){that.multiSplitButton.setActiveItem(multiSplitItem.name);foundMultiSplit=true}}}if(!foundMultiSplit){that.multiSplitButton.setActiveItem(null)}}})};GENTICS.Aloha.Format.removeFormat=function(){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<p></p>"));var formats=["b","i","cite","q","code","abbr","del","sub","sup"];var rangeObject=GENTICS.Aloha.Selection.rangeObject;var startObj=jQuery(rangeObject.startContainer);var limitObj=jQuery(rangeObject.limitObject);if(rangeObject.isCollapsed()||startObj===limitObj){return}var parent=startObj.parent();while(parent.get(0)!==limitObj.get(0)){var index=formats.indexOf(parent.get(0).nodeName.toLowerCase());parent=parent.parent();if(index!=-1){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+formats[index]+"></"+formats[index]+">"));formats.splice(index,1)}}for(var i in formats){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+formats[i]+"></"+formats[i]+">"));GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+formats[i]+"></"+formats[i]+">"))}};GENTICS.Aloha.Format.toString=function(){return"com.gentics.aloha.plugins.Format"};
7
+ GENTICS.Aloha.Format=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Format");GENTICS.Aloha.Format.languages=["en","de","fr","eo","fi","ru","it"];GENTICS.Aloha.Format.config=["b","i","del","sub","sup","p","title","h1","h2","h3","h4","h5","h6","pre","removeFormat"];GENTICS.Aloha.Format.init=function(){this.initButtons();var that=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(e,params){that.applyButtonConfig(params.editable.obj)})};GENTICS.Aloha.Format.applyButtonConfig=function(obj){config=this.getEditableConfig(obj);for(var button in this.buttons){if(jQuery.inArray(button,config)!=-1){this.buttons[button].button.show()}else{this.buttons[button].button.hide()}}for(var i in this.multiSplitItems){if(jQuery.inArray(this.multiSplitItems[i].name,config)!=-1){this.multiSplitButton.extButton.showItem(this.multiSplitItems[i].name)}else{this.multiSplitButton.extButton.hideItem(this.multiSplitItems[i].name)}}};GENTICS.Aloha.Format.initButtons=function(){var scope="GENTICS.Aloha.continuoustext";this.buttons={};var that=this;this.multiSplitItems=new Array();this.multiSplitButton;jQuery.each(GENTICS.Aloha.Format.config,function(j,button){switch(button){case"b":case"i":case"cite":case"q":case"code":case"abbr":case"del":case"sub":case"sup":that.buttons[button]={button:new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_"+button,size:"small",onclick:function(){if(GENTICS.Aloha.activeEditable){GENTICS.Aloha.activeEditable.obj[0].focus()}var markup=jQuery("<"+button+"></"+button+">");var rangeObject=GENTICS.Aloha.Selection.rangeObject;var foundMarkup=rangeObject.findMarkup(function(){return this.nodeName.toLowerCase()==markup.get(0).nodeName.toLowerCase()},GENTICS.Aloha.activeEditable.obj);if(foundMarkup){if(rangeObject.isCollapsed()){GENTICS.Utils.Dom.removeFromDOM(foundMarkup,rangeObject,true)}else{GENTICS.Utils.Dom.removeMarkup(rangeObject,markup,GENTICS.Aloha.activeEditable.obj)}}else{if(rangeObject.isCollapsed()){GENTICS.Utils.Dom.extendToWord(rangeObject)}GENTICS.Utils.Dom.addMarkup(rangeObject,markup)}rangeObject.select();return false},tooltip:that.i18n("button."+button+".tooltip"),toggle:true}),markup:jQuery("<"+button+"></"+button+">")};GENTICS.Aloha.FloatingMenu.addButton(scope,that.buttons[button].button,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1);break;case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"pre":that.multiSplitItems.push({name:button,tooltip:that.i18n("button."+button+".tooltip"),iconClass:"GENTICS_button "+that.i18n("GENTICS_button_"+button),markup:jQuery("<"+button+"></"+button+">"),click:function(){if(GENTICS.Aloha.activeEditable){GENTICS.Aloha.activeEditable.obj[0].focus()}GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+button+"></"+button+">"))}});break;case"removeFormat":that.multiSplitItems.push({name:button,text:that.i18n("button."+button+".text"),tooltip:that.i18n("button."+button+".tooltip"),iconClass:"GENTICS_button GENTICS_button_"+button,wide:true,click:function(){GENTICS.Aloha.Format.removeFormat()}});break;default:GENTICS.Aloha.log("warn",this,'Button "'+button+'" is not defined');break}});if(this.multiSplitItems.length>0){this.multiSplitButton=new GENTICS.Aloha.ui.MultiSplitButton({items:this.multiSplitItems});GENTICS.Aloha.FloatingMenu.addButton(scope,this.multiSplitButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),3)}GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(event,rangeObject){jQuery.each(that.buttons,function(index,button){for(var i=0;i<rangeObject.markupEffectiveAtStart.length;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(effectiveMarkup,button.markup)){button.button.setPressed(true);var statusWasSet=true}}if(!statusWasSet){button.button.setPressed(false)}});if(that.multiSplitItems.length>0){var foundMultiSplit=false;for(var i=0;i<rangeObject.markupEffectiveAtStart.length&&!foundMultiSplit;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];for(var j=0;j<that.multiSplitItems.length&&!foundMultiSplit;j++){var multiSplitItem=that.multiSplitItems[j];if(!multiSplitItem.markup){continue}if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(effectiveMarkup,multiSplitItem.markup)){that.multiSplitButton.setActiveItem(multiSplitItem.name);foundMultiSplit=true}}}if(!foundMultiSplit){that.multiSplitButton.setActiveItem(null)}}})};GENTICS.Aloha.Format.removeFormat=function(){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<p></p>"));var formats=["b","i","cite","q","code","abbr","del","sub","sup"];var rangeObject=GENTICS.Aloha.Selection.rangeObject;var startObj=jQuery(rangeObject.startContainer);var limitObj=jQuery(rangeObject.limitObject);if(rangeObject.isCollapsed()||startObj===limitObj){return}var parent=startObj.parent();while(parent.get(0)!==limitObj.get(0)){var index=formats.indexOf(parent.get(0).nodeName.toLowerCase());parent=parent.parent();if(index!=-1){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+formats[index]+"></"+formats[index]+">"));formats.splice(index,1)}}for(var i in formats){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+formats[i]+"></"+formats[i]+">"));GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+formats[i]+"></"+formats[i]+">"))}};GENTICS.Aloha.Format.toString=function(){return"com.gentics.aloha.plugins.Format"};
@@ -0,0 +1,20 @@
1
+ restcall.savepage = Seite speichern
2
+ restcall.savepage.error = Beim Speichern der Seite ist ein Fehler aufgetreten!
3
+ button.language = Sprache
4
+ button.page=Seite
5
+ button.preview=Vorschau
6
+ button.edit=Bearbeiten
7
+ button.livepreview=Live Vorschau
8
+ button.properties=Eigenschaften
9
+ button.objectproperties=Objekt Eigenschaften
10
+ button.timemanagement=Zeitmanagement
11
+ button.cancel=Abbrechen
12
+ button.quit=Beenden
13
+ button.save=Speichern
14
+ button.publish=Veröffentlichen
15
+ button.publishat=Veröffentlichen am...
16
+ insert_tag=Tag einfügen
17
+ restcall.createtag.error = Beim Erstellen eines neuen Tags ist ein Fehler aufgetreten!
18
+ restcall.reloadtag.error = Beim Aktualisieren eines Tags ist ein Fehler aufgetreten!
19
+ confirm.editable.modified = Die Seite wurde geändert! Möchten Sie die Änderungen jetzt speichern?
20
+ save.progress = Bitte warten, Änderungen werden gespeichert!
@@ -0,0 +1,20 @@
1
+ restcall.savepage = Save page
2
+ restcall.savepage.error = An error occurred while saving the page!
3
+ button.language = Language
4
+ button.page=Page
5
+ button.preview=Preview
6
+ button.edit=Edit
7
+ button.livepreview=Live Preview
8
+ button.properties=Properties
9
+ button.objectproperties=Object Properties
10
+ button.timemanagement=Timemanagement
11
+ button.cancel=Cancel
12
+ button.quit=Quit
13
+ button.save=Save
14
+ button.publish=Publish
15
+ button.publishat=Publish at...
16
+ insert_tag=Insert tag
17
+ restcall.createtag.error = An error occurred while creating a new tag!
18
+ restcall.reloadtag.error = An error occurred while reloading a tag!
19
+ confirm.editable.modified = The page has been modified! Do you want to save the changes now?
20
+ save.progress = Please wait while changes are saved!
@@ -0,0 +1,16 @@
1
+ restcall.savepage = Konservi la pa�on
2
+ restcall.savepage.error = Eraro okazis dum konservado de la pa�o
3
+ button.language = Lingvo
4
+ button.page=Pa�o
5
+ button.preview=Anta�vidi
6
+ button.edit=Redakti
7
+ button.livepreview=Anta�vidi realtempe
8
+ button.properties=Propra�oj
9
+ button.objectproperties=Propra�oj de la objekto
10
+ button.timemanagement=Tempa prizorgado
11
+ button.cancel=Nuligi
12
+ button.quit=Eliri
13
+ button.save=Konservi
14
+ button.publish=Publikigi
15
+ button.publishat=Publikigi en...
16
+ insert_tag=Enmeti etikedon
@@ -0,0 +1,20 @@
1
+ restcall.savepage = Tallenna sivu
2
+ restcall.savepage.error = Sivun tallennuksessa tapahtui virhe!
3
+ button.language = Kieli
4
+ button.page=Sivu
5
+ button.preview=Esikatselu
6
+ button.edit=Muokkaus
7
+ button.livepreview=Päivittyvä esikatselu
8
+ button.properties=Ominaisuudet
9
+ button.objectproperties=Olion ominaisuudet
10
+ button.timemanagement=Ajanhallinta
11
+ button.cancel=Peruuta
12
+ button.quit=Sulje
13
+ button.save=Tallenna
14
+ button.publish=Julkaise
15
+ button.publishat=Julkaise aikaan...
16
+ insert_tag=Lisää merkki
17
+ restcall.createtag.error = Uuden merkin luonnissa tapahtui virhe!
18
+ restcall.reloadtag.error = Merkin uudelleenlatauksessa tapahtui virhe!
19
+ confirm.editable.modified = Sivua on muokattu! Haluatko tallentaa muutokset?
20
+ save.progress = Odota, muutoksia tallennetaan!
@@ -0,0 +1,16 @@
1
+ restcall.savepage = Sauvegarder la page
2
+ restcall.savepage.error = Une erreur s'est produite lors de l'enregistrement de la page!
3
+ button.language = Langue
4
+ button.page=Page
5
+ button.preview=Prévisualisé
6
+ button.edit=Editer
7
+ button.livepreview=Prévisualisation en direct
8
+ button.properties=Propriétés
9
+ button.objectproperties=Propriétés de l'objet
10
+ button.timemanagement=La gestion du temps
11
+ button.cancel=Annuler
12
+ button.quit=Quitter
13
+ button.save=Sauvegarder
14
+ button.publish=Publier
15
+ button.publishat=Publier sur ...
16
+ insert_tag=Insert tag
@@ -0,0 +1,20 @@
1
+ restcall.savepage = Salva pagina
2
+ restcall.savepage.error = C'è stato un errore durante il salvataggio!
3
+ button.language = Lingua
4
+ button.page=Pagina
5
+ button.preview=Anteprima
6
+ button.edit=Modifica
7
+ button.livepreview=Anteprima Live
8
+ button.properties=Proprietà
9
+ button.objectproperties=Properties dell'oggetto
10
+ button.timemanagement=Pianificazione tempo
11
+ button.cancel=Annulla
12
+ button.quit=Esci
13
+ button.save=Salva
14
+ button.publish=Pubblica
15
+ button.publishat=Pubblica alle..
16
+ insert_tag=Inserisci tag
17
+ restcall.createtag.error = C'è stato un errore durante la creazione del tag!
18
+ restcall.reloadtag.error = C'è stato un errore durante il caricamento del tag!
19
+ confirm.editable.modified = La pagina è stata modificata! Salvare le modifiche?
20
+ save.progress = Attendere il termine del salvataggio!
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Aloha Editor
3
+ * Author & Copyright (c) 2010 Gentics Software GmbH
4
+ * aloha-sales@gentics.com
5
+ * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
+ */
7
+ GENTICS.Aloha.GCN=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.GCN");GENTICS.Aloha.GCN.languages=["en","de","fr","eo","fi","it"];GENTICS.Aloha.GCN.maximized=false;GENTICS.Aloha.GCN.buttons={};GENTICS.Aloha.GCN.lastActiveEditable={};GENTICS.Aloha.GCN.backendUrl="../CNPortletapp/";GENTICS.Aloha.GCN.restUrl=GENTICS.Aloha.GCN.backendUrl+"rest";GENTICS.Aloha.GCN.closeLightbox=function(){jQuery.prettyPhoto.close();GENTICS.Aloha.Ribbon.show();if(GENTICS.Aloha.GCN.lastActiveEditable!=undefined){GENTICS.Aloha.GCN.lastActiveEditable.activate();GENTICS.Aloha.GCN.lastActiveEditable.obj.focus()}};GENTICS.Aloha.GCN.init=function(){var that=this;jQuery().prettyPhoto({theme:"light_square",opacity:0.4,markup:'<div class="pp_pic_holder"> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_loaderIcon"></div> <div class="pp_hoverContainer"> <a class="pp_next" href="#">next</a> <a class="pp_previous" href="#">previous</a> </div> <div id="pp_full_res"></div> <div class="pp_details"> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div> <div class="ppt"></div>'});var maximizeOptions=null;if(this.isGCNFrame()){GENTICS.Aloha.settings.ribbon=false;jQuery("head").append('<link type="text/css" href="'+this.createGCNURL({url:that.settings.stag_prefix,params:{"do":20,url:"lib/css/gui.css"}})+'" rel="stylesheet">');jQuery("body").append('<div style="z-index: 999999; position: absolute; visibility: hidden" class="gentics_submenu" id="nodesubmenu1"> </div>');jQuery("head").append('<script type="text/javascript" src="'+this.createGCNURL({url:this.settings.stag_prefix,params:{"do":20,url:"lib/js/layer.js"}})+'"><\/script>');jQuery("head").append('<script type="text/javascript" src="'+this.createGCNURL({url:this.settings.stag_prefix,params:{"do":20,url:"lib/js/tools.js"}})+'"><\/script>');jQuery("head").append('<script type="text/javascript" src="'+this.createGCNURL({url:this.settings.stag_prefix,params:{"do":20,url:"lib/js/menu1.js"}})+'"><\/script>');if(top.menu){top.menu.location=this.createGCNURL({url:this.settings.stag_prefix,params:{"do":14004,MENU_LAYER:0,ass_pre_flapped:0,aloha:true}})}jQuery("html").click(function(){hide_layer(get_layer("nodesubmenu1"));if(top.menu){top.menu.nodesubmenu1_clicked=false}});jQuery("html").mouseover(function(){if(top.tree&&top.tree.frame_small){top.tree.frame_small()}})}GENTICS.Aloha.GCN.updateFrameUI();jQuery(window).unload(function(){that.restoreFrameUI();if(GENTICS.Aloha.isModified()){if(confirm(GENTICS.Aloha.i18n(GENTICS.Aloha,"confirm_editable_modified"))){that.savePage({silent:true,async:false});return false}}});this.alohaEditables(this.settings.editables);this.alohaBlocks(this.settings.blocks);if(this.settings.welcomeMessages){jQuery.each(this.settings.welcomeMessages,function(index,message){GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:"Gentics Content.Node",text:message.message,type:GENTICS.Aloha.Message.Type.ALERT}))})}if(GENTICS.Aloha.Log.isDebugEnabled()){var editables=0;var blocks=0;if(this.settings.editables){editables=this.settings.editables.length}if(this.settings.blocks){blocks=this.settings.blocks.length}GENTICS.Aloha.Log.debug(this,"Loaded page with id { "+this.settings.id+" }.");GENTICS.Aloha.Log.debug(this,"Found "+editables+" editables and "+blocks+" blocks.")}var pageMenu=new Array();pageMenu.push(new GENTICS.Aloha.ui.Button({label:this.i18n("button.preview"),onclick:function(){that.previewPage()}}));pageMenu.push(new GENTICS.Aloha.ui.Button({label:this.i18n("button.edit"),onclick:function(){that.editPage()}}));pageMenu.push(new GENTICS.Aloha.ui.Button({label:this.i18n("button.livepreview"),onclick:function(){that.savePage({onsuccess:function(){that.openGCNURL({url:that.settings.stag_prefix,popup:true,params:{live:that.settings.id,"do":14001}})},onfailure:function(){},silent:true})}}));var propsBackParam=this.isGCNFrame()?"":'a:3:{s:4:"REDO";s:5:"14012";s:6:"realid";s:'+String(this.settings.id).length+':"'+this.settings.id+'";s:4:"real";s:4:"edit";}';pageMenu.push(new GENTICS.Aloha.ui.Button({label:this.i18n("button.properties"),onclick:function(){that.openGCNURL({url:that.settings.stag_prefix,params:{"do":14000,PAGE_ID:that.settings.id,FOLDER_ID:that.settings.folderId,back:propsBackParam}})}}));var pageButton=new GENTICS.Aloha.ui.Button({label:this.i18n("button.page"),menu:pageMenu});GENTICS.Aloha.Ribbon.addButton(pageButton);if(this.settings.languageMenu&&this.settings.languageMenu.length>0){var menu=Array();jQuery.each(this.settings.languageMenu,function(index,language){menu.push(new GENTICS.Aloha.ui.Button({label:language.name,icon:that.createGCNURL({url:that.settings.stag_prefix,params:{"do":14203,base:"doc_hi.png",lang:language.code,module:"content"}}),onclick:function(){that.openGCNURL({url:that.settings.stag_prefix,params:{"do":14015,t_type:10007,redo:14001,CONTENTGROUP_ID:language.id}})}}))});GENTICS.Aloha.Ribbon.addButton(new GENTICS.Aloha.ui.Button({label:this.i18n("button.language"),menu:menu}))}var publishParams=this.isGCNFrame()?{"do":14003,cmd:"pub"}:{"do":14012,realid:this.settings.id,real:"pub"};var publishAtParams=this.isGCNFrame()?{"do":14021}:{"do":14021,PAGE_ID:this.settings.id,FOLDER_ID:this.settings.folderId,back:propsBackParam};var saveButtonMenu=Array();saveButtonMenu.push(new GENTICS.Aloha.ui.Button({label:this.i18n("button.publish"),onclick:function(){that.openGCNURL({url:that.settings.stag_prefix,params:publishParams})}}));if(this.isGCNFrame()){saveButtonMenu.push(new GENTICS.Aloha.ui.Button({label:this.i18n("button.publishat"),onclick:function(){that.openGCNURL({url:that.settings.stag_prefix,params:publishAtParams})}}))}var saveButton=new GENTICS.Aloha.ui.Button({label:this.i18n("button.save"),onclick:function(){that.savePage()},menu:saveButtonMenu});GENTICS.Aloha.Ribbon.addButton(saveButton);if(GENTICS.Aloha.settings.readonly){GENTICS.Aloha.Ribbon.addButton(new GENTICS.Aloha.ui.Button({label:this.i18n("button.quit"),onclick:function(){that.quitEdit()}}))}else{var cancelButton=new GENTICS.Aloha.ui.Button({label:this.i18n("button.cancel"),onclick:function(){that.cancelEdit(function(){that.previewPage()})},menu:[new GENTICS.Aloha.ui.Button({label:this.i18n("button.quit"),onclick:function(){that.quitEdit()}})]});GENTICS.Aloha.Ribbon.addButton(cancelButton)}if(this.isGCNFrame()){GENTICS.Aloha.Ribbon.hide()}GENTICS.Aloha.Ribbon.setIcon("GENTICS_logo");var contentTagsMenu=new Array();var constructs=new Array();if(this.settings.constructCategories){for(var i=0;i<this.settings.constructCategories.length;i++){constructs=new Array();for(var j=0;j<this.settings.constructCategories[i].constructs.length;j++){constructs.push(new GENTICS.Aloha.ui.Button({label:this.settings.constructCategories[i].constructs[j].name,icon:this.createGCNURL({url:that.settings.stag_prefix,params:{"do":11,img:"constr/"+this.settings.constructCategories[i].constructs[j].icon,module:"content"}}),constructId:this.settings.constructCategories[i].constructs[j].id,onclick:function(){that.createTag(this.constructId)}}))}contentTagsMenu.push(new GENTICS.Aloha.ui.Button({label:this.settings.constructCategories[i].name,icon:this.createGCNURL({url:that.settings.stag_prefix,params:{"do":11,img:"constructopen.gif",module:"content"}}),menu:constructs,onclick:function(){}}))}if(contentTagsMenu.length>0){GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",new GENTICS.Aloha.ui.Button({tooltip:this.i18n("insert_tag"),icon:this.createGCNURL({url:that.settings.stag_prefix,params:{"do":11,img:"constructopen.gif",module:"content"}}),menu:contentTagsMenu,size:"medium"}),GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1)}}GENTICS.Utils.Position.addMouseMoveCallback(function(){if(GENTICS.Aloha.activeEditable){jQuery(".GENTICS_editable_active .GENTICS_editicon:not(.GENTICS_editicon_hover)").fadeIn("fast")}else{jQuery(".GENTICS_editicon:not(.GENTICS_editicon_hover)").show()}});GENTICS.Utils.Position.addMouseStopCallback(function(){if(GENTICS.Aloha.activeEditable){jQuery(".GENTICS_editable_active .GENTICS_editicon:not(.GENTICS_editicon_hover)").fadeOut("normal")}else{jQuery(".GENTICS_editicon:not(.GENTICS_editicon_hover)").fadeOut("normal")}});GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(){jQuery(".GENTICS_editicon").fadeOut("normal")})};GENTICS.Aloha.GCN.alohaEditables=function(editables){if(editables){jQuery.each(editables,function(index,editable){jQuery("#"+editable.id).aloha()})}};GENTICS.Aloha.GCN.alohaBlocks=function(blocks){if(blocks){jQuery.each(blocks,function(index,block){jQuery("#"+block.id).addClass("GENTICS_block").attr("contenteditable",false);if(!GENTICS.Aloha.settings.readonly){var imgTag=jQuery("<img>");imgTag.attr("border",0);imgTag.attr("src",block.iconurl);var buttonTag=jQuery("<button>");buttonTag.click(function(){GENTICS.Aloha.GCN.openTagFill(block.tagid)});buttonTag.attr("alt",block.icontitle).attr("title",block.icontitle).addClass("GENTICS_editicon").mouseover(function(){jQuery(this).addClass("GENTICS_editicon_hover")}).mouseout(function(){jQuery(this).removeClass("GENTICS_editicon_hover")}).prepend(imgTag);jQuery("#"+block.id).prepend(buttonTag)}})}};GENTICS.Aloha.GCN.maximizeOptions={fsContent_cols:"0,*,0",frameset0_cols:"315,*",frameset2_rows:"101,*"};GENTICS.Aloha.GCN.toggleEditFrame=function(){if(!top.main){return}if(this.isEditFrameMaximized()){this.normalizeEditFrame()}else{this.maximizeEditFrame()}};GENTICS.Aloha.GCN.normalizeEditFrame=function(){top.main.document.getElementById("fsContent").cols=this.maximizeOptions.fsContent_cols;top.document.getElementsByTagName("frameset")[0].cols=this.maximizeOptions.frameset0_cols;top.document.getElementsByTagName("frameset")[2].rows=this.maximizeOptions.frameset2_rows;this.buttons.maximizeButton.setPressed(false)};GENTICS.Aloha.GCN.maximizeEditFrame=function(){this.maximizeOptions.fsContent_cols=top.main.document.getElementById("fsContent").cols;this.maximizeOptions.frameset0_cols=top.document.getElementsByTagName("frameset")[0].cols;this.maximizeOptions.frameset2_rows=top.document.getElementsByTagName("frameset")[2].rows;top.main.document.getElementById("fsContent").cols="0,*,0";top.document.getElementsByTagName("frameset")[0].cols="0,*";top.document.getElementsByTagName("frameset")[2].rows="0,*";this.buttons.maximizeButton.setPressed(true)};GENTICS.Aloha.GCN.isEditFrameMaximized=function(){if(!this.isGCNFrame()){return false}if(top.document.getElementsByTagName("frameset")[0].cols=="0,*"){return true}else{return false}};GENTICS.Aloha.GCN.isGCNFrame=function(){if(!window.parent){return false}var assistant=jQuery("frame",window.parent.document).eq(0);if(assistant.attr("name")==="ass"){return true}assistant=jQuery("frame",window.parent.document).eq(2);if(assistant.attr("name")==="ass"){return true}return false};GENTICS.Aloha.GCN.updateFrameUI=function(){if(this.isGCNFrame()){var assistantFrameset=jQuery("frameset",window.parent.document);this.originalColumns=assistantFrameset.attr("cols");this.originalRows=assistantFrameset.attr("rows");if(this.originalColumns){assistantFrameset.attr("cols","0,*,0")}if(this.originalRows){assistantFrameset.attr("rows","*,0,0")}var menuFrame=jQuery(window.parent.parent.frames[2].document);menuFrame.find("#ProgressStatusInfo_0").hide()}};GENTICS.Aloha.GCN.restoreFrameUI=function(){if(this.isGCNFrame()){var assistantFrameset=jQuery("frameset",window.parent.document);if(this.originalColumns){assistantFrameset.attr("cols",this.originalColumns)}if(this.originalRows){assistantFrameset.attr("rows",this.originalRows)}}};GENTICS.Aloha.GCN.cancelEdit=function(callback){var that=this;for(var i in GENTICS.Aloha.editables){if(GENTICS.Aloha.editables[i].setUnmodified){GENTICS.Aloha.editables[i].setUnmodified()}}this.performRESTRequest({url:this.settings.stag_prefix+this.restUrl+"/page/cancel/"+this.settings.id,description:"restcall.cancelpage",success:callback,error:function(data){GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:"Gentics Content.Node",text:that.i18n("restcall.cancelpage.error"),type:GENTICS.Aloha.Message.Type.ALERT}))}})};GENTICS.Aloha.GCN.quitEdit=function(){var that=this;if(this.isEditFrameMaximized()){this.normalizeEditFrame()}this.cancelEdit(function(){if(that.settings.backurl){document.location.href=that.settings.backurl}else{if(that.isGCNFrame()){that.openGCNURL({url:that.settings.stag_prefix,params:{"do":13011}})}else{that.openGCNURL({url:that.settings.stag_prefix,params:{"do":14300,close:true}})}}})};GENTICS.Aloha.GCN.previewPage=function(){var that=this;this.openGCNURL({url:this.settings.stag_prefix+this.backendUrl+"/alohapage",params:{realid:that.settings.id,language:that.settings.languageid,real:"view",links:that.settings.links}})};GENTICS.Aloha.GCN.editPage=function(){var that=this;this.openGCNURL({url:this.settings.stag_prefix+this.backendUrl+"/alohapage",params:{realid:that.settings.id,language:that.settings.languageid,real:"edit",links:that.settings.links}})};GENTICS.Aloha.GCN.savePage=function(data){var that=this;if(typeof data=="undefined"){data={}}if(typeof data.async=="undefined"){data.async=true}if(!data.async){var saveProgress=new GENTICS.Aloha.Message({title:"Gentics Content.Node",text:GENTICS.Aloha.i18n(that,"save.progress"),type:GENTICS.Aloha.Message.Type.WAIT});GENTICS.Aloha.showMessage(saveProgress)}var requestBody={unlock:data.closeAfterSave?true:false,page:{id:this.settings.id,templateId:this.settings.templateId,folderId:this.settings.folderId,name:this.settings.name,fileName:this.settings.fileName,description:this.settings.description,priority:this.settings.priority}};requestBody.page.tags={};for(var i=0;i<GENTICS.Aloha.editables.length;++i){var editable=GENTICS.Aloha.editables[i];var gcnEditable=this.findLoadedEditable(editable.getId());if(gcnEditable){var content=editable.getContents();content=content.replace(/<span class=\"GENTICS_block\" id=\"(\w+)\">x<\/span>/g,"<node $1>");if(gcnEditable.metaproperty){if(gcnEditable.metaproperty.indexOf("page.")!=0){continue}var prop=gcnEditable.metaproperty.replace(/^page\./,"");requestBody.page[prop]=content}else{var properties={};if(!requestBody.page.tags[gcnEditable.tagname]){requestBody.page.tags[gcnEditable.tagname]={name:gcnEditable.tagname,active:true,properties:{}}}requestBody.page.tags[gcnEditable.tagname].properties[gcnEditable.partname]={type:"RICHTEXT",stringValue:content}}}else{}}var onsuccess=data?data.onsuccess:undefined;var onfailure=data?data.onfailure:undefined;if(typeof onfailure!="function"){onfailure=function(data){GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:"Gentics Content.Node",text:that.i18n("restcall.savepage.error"),type:GENTICS.Aloha.Message.Type.ALERT}))}}var showMessages=data&&data.silent?false:true;this.performRESTRequest({url:this.settings.stag_prefix+this.restUrl+"/page/save/"+this.settings.id,body:requestBody,description:"restcall.savepage",success:function(data){for(var i in GENTICS.Aloha.editables){if(GENTICS.Aloha.editables[i].setUnmodified){GENTICS.Aloha.editables[i].setUnmodified()}}if(typeof saveProgress!="undefined"){GENTICS.Aloha.hideMessage(saveProgress)}if(showMessages&&data.messages){jQuery.each(data.messages,function(index,message){GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:"Gentics Content.Node",text:message.message,type:GENTICS.Aloha.Message.Type.ALERT}))})}if(onsuccess){onsuccess(data)}},error:function(data){if(typeof saveProgress!="undefined"){GENTICS.Aloha.hideMessage(saveProgress)}if(onfailure){onfailure(data)}},async:data.async})};GENTICS.Aloha.GCN.publishPage=function(success){var that=this;this.savePage({onsuccess:function(){var publishParams=success?{"do":14022,page_id:that.settings.id}:(that.isGCNFrame()?{"do":14003,cmd:"pub",PAGE_ID:that.settings.id}:{"do":14012,realid:that.settings.id,real:"pub"});if(success){that.performRESTRequest({url:that.settings.stag_prefix,params:publishParams,success:function(){success.apply()}})}else{that.openGCNURL({url:that.settings.stag_prefix,params:publishParams})}},onfailure:function(){},silent:success?true:false})};GENTICS.Aloha.GCN.publishPageAt=function(){var that=this;this.savePage({onsuccess:function(){var propsBackParam=that.isGCNFrame()?"":'a:3:{s:4:"REDO";s:5:"14012";s:6:"realid";s:'+String(that.settings.id).length+':"'+that.settings.id+'";s:4:"real";s:4:"edit";}';var publishAtParams=that.isGCNFrame()?{"do":14021}:{"do":14021,PAGE_ID:that.settings.id,FOLDER_ID:that.settings.folderId,back:propsBackParam};that.openGCNURL({url:that.settings.stag_prefix,params:publishAtParams})},onfailure:function(){}})};GENTICS.Aloha.GCN.findLoadedEditable=function(id){if(this.settings.editables){for(var i=0;i<this.settings.editables.length;++i){if(this.settings.editables[i].id==id){return this.settings.editables[i]}}}};GENTICS.Aloha.GCN.makeClean=function(obj){if(this.settings.blocks){jQuery.each(this.settings.blocks,function(index,block){obj.find("#"+block.id).replaceWith('<span class="GENTICS_block" id="'+block.tagname+'">x</span>')})}};GENTICS.Aloha.GCN.performRESTRequest=function(data){var that=this;if(!data.type){data.type="POST"}var ajaxObject={type:data.type,dataType:"json",timeout:10000,contentType:"application/json; charset=utf-8",data:jQuery.toJSON(data.body)};ajaxObject.url=data.url+"?sid="+this.settings.sid+"&time="+(new Date()).getTime();if(data.params){for(var paramName in data.params){ajaxObject.url+="&"+paramName+"="+encodeURI(data.params[paramName])}}if(typeof data.async!="undefined"){ajaxObject.async=data.async}if(data.success){ajaxObject.success=data.success}if(data.error){ajaxObject.error=data.error}jQuery.ajax(ajaxObject)};GENTICS.Aloha.GCN.createGCNURL=function(data){var url=data.url+"?sid="+this.settings.sid+"&time="+(new Date()).getTime();for(var paramName in data.params){url+="&"+paramName+"="+encodeURI(data.params[paramName])}return url};GENTICS.Aloha.GCN.openGCNURL=function(data){var url=this.createGCNURL(data);var popup=data.popup;if(this.isEditFrameMaximized()){this.normalizeEditFrame()}this.openURL(url,popup)};GENTICS.Aloha.GCN.openURL=function(url,popup){if(GENTICS.Aloha.isModified()){this.savePage({unlock:false,onsuccess:function(){if(GENTICS.Aloha.Log.isDebugEnabled()){this.log("debug","opening url: "+url)}if(popup){window.open(url)}else{document.location.href=url}},silent:true,async:false})}else{if(GENTICS.Aloha.Log.isDebugEnabled()){this.log("debug","opening url: "+url)}if(popup){window.open(url)}else{document.location.href=url}}};GENTICS.Aloha.GCN.openTagFill=function(tagid){var that=this;GENTICS.Aloha.FloatingMenu.setScope("GENTICS.Aloha.empty");if(GENTICS.Aloha.activeEditable){GENTICS.Aloha.activeEditable.blur();GENTICS.Aloha.Ribbon.hide()}var editdo=10008;var block=this.getBlock(tagid);if(block&&block.editdo){editdo=block.editdo}var tagfillBackParam=this.isGCNFrame()?"":"realid|"+this.settings.id;var editLink=this.createGCNURL({url:this.settings.stag_prefix,params:{"do":editdo,id:tagid,type:"page",keepsid:1,backparam:tagfillBackParam}});if(GENTICS.Aloha.isModified()){this.savePage({onsuccess:function(){GENTICS.Aloha.Ribbon.hide();try{GENTICS.Aloha.activeEditable.blur();GENTICS.Aloha.GCN.lastActiveEditable=GENTICS.Aloha.activeEditable}catch(e){GENTICS.Aloha.GCN.lastActiveEditable=undefined}jQuery.prettyPhoto.open(new Array(editLink+"&iframe=true&width=100%&height=100%"))},unlock:false,silent:true,async:false})}else{GENTICS.Aloha.Ribbon.hide();try{GENTICS.Aloha.activeEditable.blur();GENTICS.Aloha.GCN.lastActiveEditable=GENTICS.Aloha.activeEditable}catch(e){GENTICS.Aloha.GCN.lastActiveEditable=undefined}jQuery.prettyPhoto.open(new Array(editLink+"&iframe=true&width=100%&height=100%"))}};GENTICS.Aloha.GCN.createTag=function(constructId){var that=this;this.performRESTRequest({url:this.settings.stag_prefix+this.restUrl+"/page/newtag/"+this.settings.id,params:{constructId:constructId},description:"restcall.createtag",success:function(data){that.performRESTRequest({url:that.settings.stag_prefix+that.backendUrl+"/alohatag",type:"GET",params:{realid:that.settings.id,real:"edit",template:"<node "+data.tag.name+">",language:that.settings.languageid,links:that.settings.links},success:function(data){that.handleBlock(data,true)},error:function(){GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:"Gentics Content.Node",text:GENTICS.Aloha.i18n(that,"restcall.createtag.error"),type:GENTICS.Aloha.Message.Type.ALERT}))}})}})};GENTICS.Aloha.GCN.getBlock=function(tagid){if(!this.settings.blocks){return false}for(var i=0;i<this.settings.blocks.length;++i){if(this.settings.blocks[i].tagid==tagid){return this.settings.blocks[i]}}return false};GENTICS.Aloha.GCN.reloadBlock=function(tagid){var block=this.getBlock(tagid);var that=this;if(!block){return}this.performRESTRequest({url:this.settings.stag_prefix+this.backendUrl+"/alohatag",type:"GET",params:{realid:that.settings.id,real:"edit",template:"<node "+block.tagname+">",language:that.settings.languageid,links:that.settings.links},success:function(data){that.handleBlock(data,false)},error:function(){GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:"Gentics Content.Node",text:GENTICS.Aloha.i18n(that,"restcall.reloadtag.error"),type:GENTICS.Aloha.Message.Type.ALERT}))}})};GENTICS.Aloha.GCN.handleBlock=function(data,insert){if(this.settings.renderBlockContentURL){data.content=this.renderBlockContent(data.content)}var blockObj=jQuery(data.content);jQuery("#"+blockObj.attr("id")).replaceWith(data.content);if(insert){GENTICS.Aloha.Markup.insertHTMLCode(data.content)}if(data.editables){if(!this.settings.editables){this.settings.editables=new Array()}for(var i=0;i<data.editables.length;++i){this.settings.editables.push(data.editables[i])}this.alohaEditables(data.editables)}if(data.blocks){if(!this.settings.blocks){this.settings.blocks=new Array()}for(var i=0;i<data.blocks.length;++i){this.settings.blocks.push(data.blocks[i])}this.alohaBlocks(data.blocks)}};GENTICS.Aloha.GCN.renderBlockContent=function(content){var that=this;var newContent=content;jQuery.ajax({url:this.settings.renderBlockContentURL,type:"POST",timeout:10000,data:{content:content},dataType:"text",async:false,success:function(data){newContent=data}});return newContent};function cn3_go_list(url){GENTICS.Aloha.GCN.openURL(url)};
@@ -4,4 +4,4 @@
4
4
  * aloha-sales@gentics.com
5
5
  * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
6
  */
7
- GENTICS.Aloha.HighlightEditables=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.highlighteditables");GENTICS.Aloha.HighlightEditables.init=function(){var that=this;GENTICS.Utils.Position.addMouseMoveCallback(function(){for(var i=0;i<GENTICS.Aloha.editables.length;i++){var editable=GENTICS.Aloha.editables[i];if(!GENTICS.Aloha.activeEditable&&!editable.isDisabled()){editable.obj.addClass("GENTICS_editable_highlight")}}});GENTICS.Utils.Position.addMouseStopCallback(function(){that.fade()});GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(jEvent,aEvent){aEvent.editable.obj.addClass("GENTICS_editable_active");that.fade()});GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableDeactivated",function(jEvent,aEvent){aEvent.editable.obj.removeClass("GENTICS_editable_active")})};GENTICS.Aloha.HighlightEditables.fade=function(){for(var i=0;i<GENTICS.Aloha.editables.length;i++){var editable=GENTICS.Aloha.editables[i].obj;if(editable.hasClass("GENTICS_editable_highlight")){editable.removeClass("GENTICS_editable_highlight").css("outline","5px solid #FFE767").animate({outlineWidth:"0px"},300,"swing",function(){jQuery(this).css("outline","")})}}};
7
+ GENTICS.Aloha.HighlightEditables=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.highlighteditables");GENTICS.Aloha.HighlightEditables.init=function(){var that=this;GENTICS.Utils.Position.addMouseMoveCallback(function(){for(var i=0;i<GENTICS.Aloha.editables.length;i++){var editable=GENTICS.Aloha.editables[i].obj;if(!GENTICS.Aloha.activeEditable){editable.addClass("GENTICS_editable_highlight")}}});GENTICS.Utils.Position.addMouseStopCallback(function(){that.fade()});GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(jEvent,aEvent){aEvent.editable.obj.addClass("GENTICS_editable_active");that.fade()});GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableDeactivated",function(jEvent,aEvent){aEvent.editable.obj.removeClass("GENTICS_editable_active")})};GENTICS.Aloha.HighlightEditables.fade=function(){for(var i=0;i<GENTICS.Aloha.editables.length;i++){var editable=GENTICS.Aloha.editables[i].obj;if(editable.hasClass("GENTICS_editable_highlight")){editable.removeClass("GENTICS_editable_highlight").css("outline","5px solid #FFE767").animate({outlineWidth:"0px"},300,"swing",function(){jQuery(this).css("outline","")})}}};
@@ -0,0 +1,48 @@
1
+ .ac_results {
2
+ padding: 0px;
3
+ border: 1px solid gray;
4
+ background-color: white;
5
+ overflow: hidden;
6
+ z-index: 99999;
7
+ }
8
+
9
+ .ac_results ul {
10
+ width: 100%;
11
+ list-style-position: outside;
12
+ list-style: none;
13
+ padding: 0;
14
+ margin: 0;
15
+ }
16
+
17
+ .ac_results li {
18
+ margin: 0px;
19
+ padding: 2px 5px;
20
+ cursor: default;
21
+ display: block;
22
+ /*
23
+ if width will be 100% horizontal scrollbar will apear
24
+ when scroll mode will be used
25
+ */
26
+ /*width: 100%;*/
27
+ font: menu;
28
+ font-size: 12px;
29
+ /*
30
+ it is very important, if line-height not setted or setted
31
+ in relative units scroll will be broken in firefox
32
+ */
33
+ line-height: 16px;
34
+ overflow: hidden;
35
+ }
36
+
37
+ .ac_loading {
38
+ background: white url('indicator.gif') right center no-repeat;
39
+ }
40
+
41
+ .ac_odd {
42
+ background-color: #eee;
43
+ }
44
+
45
+ .ac_over {
46
+ background-color: #B7D6FA;
47
+ color: white;
48
+ }
@@ -0,0 +1 @@
1
+ (function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options)})},result:function(handler){return this.bind("result",handler)},search:function(handler){return this.trigger("search",[handler])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(options){return this.trigger("setOptions",[options])},unautocomplete:function(){return this.trigger("unautocomplete")}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev()}else{onChange(0,true)}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next()}else{onChange(0,true)}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp()}else{onChange(0,true)}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown()}else{onChange(0,true)}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break}}).focus(function(){hasFocus++}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults()}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true)}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break}}}if(typeof fn=="function"){fn(result)}else{$input.trigger("result",result&&[result.data,result.value])}}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback)})}).bind("flushCache",function(){cache.flush()}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data" in arguments[1]){cache.populate()}}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete")});function selectCurrent(){var selected=select.selected();if(!selected){return false}var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false}progress+=seperator});words[wordAt]=v;v=words.join(options.multipleSeparator)}v+=options.multipleSeparator}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return}var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue){return}previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase){currentValue=currentValue.toLowerCase()}request(currentValue,receiveData,hideResultsNow)}else{stopLoading();select.hide()}}function trimWords(value){if(!value){return[""]}if(!options.multiple){return[$.trim(value)]}return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null})}function lastWord(value){if(!options.multiple){return value}var words=trimWords(value);if(words.length==1){return words[0]}var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""))}return words[words.length-1]}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length)}}function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200)}function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""))}else{$input.val("");$input.trigger("result",null)}}})}}function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show()}else{hideResultsNow()}}function request(term,success,failure){if(!options.matchCase){term=term.toLowerCase()}var data=cache.load(term);if(data&&data.length){success(term,data)}else{if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed)}})}else{select.emptyList();failure(term)}}}function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]}}}return parsed}function stopLoading(){$input.removeClass(options.loadingClass)}};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase){s=s.toLowerCase()}var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase())}if(i==-1){return false}return i==0||options.matchContains}function add(q,value){if(length>options.cacheLength){flush()}if(!data[q]){length++}data[q]=value}function populate(){if(!options.data){return false}var stMatchSets={},nullData=0;if(!options.url){options.cacheLength=1}stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false){continue}var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar]){stMatchSets[firstChar]=[]}var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row)}}$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value)})}setTimeout(populate,25);function flush(){data={};length=0}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length){return null}if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x)}})}}return csub}else{if(data[q]){return data[q]}else{if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x}});return csub}}}}}return null}}};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit){return}element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=="LI"){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE)}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false}).mousedown(function(){config.mouseDownOnSelect=true}).mouseup(function(){config.mouseDownOnSelect=false});if(options.width>0){element.css("width",options.width)}needsInit=false}function target(event){var element=event.target;while(element&&element.tagName!="LI"){element=element.parentNode}if(!element){return[]}return element}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight())}else{if(offset<list.scrollTop()){list.scrollTop(offset)}}}}function movePosition(step){active+=step;if(active<0){active=listItems.size()-1}else{if(active>=listItems.size()){active=0}}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i]){continue}var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false){continue}var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i])}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0}if($.fn.bgiframe){list.bgiframe()}}return{display:function(d,q){init();data=d;term=q;fillList()},next:function(){moveSelect(1)},prev:function(){moveSelect(-1)},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active)}else{moveSelect(-8)}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active)}else{moveSelect(8)}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1},visible:function(){return element&&element.is(":visible")},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0])},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:"auto"});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight});var scrollbarsVisible=listHeight>options.scrollHeight;list.css("height",scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")))}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data")},emptyList:function(){list&&list.empty()},unbind:function(){element&&element.remove()}}};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select()}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select()}}else{if(this.setSelectionRange){this.setSelectionRange(start,end)}else{if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end}}}})}var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else{if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selectionEnd}}}}})(jQuery);
@@ -4,4 +4,4 @@
4
4
  * aloha-sales@gentics.com
5
5
  * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
6
  */
7
- GENTICS.Aloha.Link=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Link");GENTICS.Aloha.Link.languages=["en","de","fr","ru","pl"];GENTICS.Aloha.Link.config=["a"];GENTICS.Aloha.Link.targetregex="";GENTICS.Aloha.Link.target="";GENTICS.Aloha.Link.cssclassregex="";GENTICS.Aloha.Link.cssclass="";GENTICS.Aloha.Link.objectTypeFilter=[];GENTICS.Aloha.Link.onHrefChange=null;GENTICS.Aloha.Link.init=function(){if(GENTICS.Aloha.Link.settings.targetregex!=undefined){GENTICS.Aloha.Link.targetregex=GENTICS.Aloha.Link.settings.targetregex}if(GENTICS.Aloha.Link.settings.target!=undefined){GENTICS.Aloha.Link.target=GENTICS.Aloha.Link.settings.target}if(GENTICS.Aloha.Link.settings.cssclassregex!=undefined){GENTICS.Aloha.Link.cssclassregex=GENTICS.Aloha.Link.settings.cssclassregex}if(GENTICS.Aloha.Link.settings.cssclass!=undefined){GENTICS.Aloha.Link.cssclass=GENTICS.Aloha.Link.settings.cssclass}if(GENTICS.Aloha.Link.settings.objectTypeFilter!=undefined){GENTICS.Aloha.Link.objectTypeFilter=GENTICS.Aloha.Link.settings.objectTypeFilter}if(GENTICS.Aloha.Link.settings.onHrefChange!=undefined){GENTICS.Aloha.Link.onHrefChange=GENTICS.Aloha.Link.settings.onHrefChange}this.createButtons();this.subscribeEvents();this.bindInteractions()};GENTICS.Aloha.Link.createButtons=function(){var that=this;this.formatLinkButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a",size:"small",onclick:function(){that.formatLink()},tooltip:this.i18n("button.addlink.tooltip"),toggle:true});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.formatLinkButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1);this.insertLinkButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a",size:"small",onclick:function(){that.insertLink(false)},tooltip:this.i18n("button.addlink.tooltip"),toggle:false});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.insertLinkButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1);GENTICS.Aloha.FloatingMenu.createScope(this.getUID("link"),"GENTICS.Aloha.continuoustext");this.browser=new GENTICS.Aloha.ui.Browser();this.browser.setObjectTypeFilter(GENTICS.Aloha.Link.objectTypeFilter);this.browser.onSelect=function(item){that.hrefField.setItem(item);that.hrefChange()};this.repositoryButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button_big GENTICS_button_tree",size:"large",onclick:function(){that.browser.show()},tooltip:this.i18n("button.addlink.tooltip"),toggle:false});GENTICS.Aloha.FloatingMenu.addButton(this.getUID("link"),this.repositoryButton,this.i18n("floatingmenu.tab.link"),1);this.hrefField=new GENTICS.Aloha.ui.AttributeField({width:320});this.hrefField.setObjectTypeFilter(GENTICS.Aloha.Link.objectTypeFilter);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("link"),this.hrefField,this.i18n("floatingmenu.tab.link"),1);this.removeLinkButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a_remove",size:"small",onclick:function(){that.removeLink()},tooltip:this.i18n("button.removelink.tooltip")});GENTICS.Aloha.FloatingMenu.addButton(this.getUID("link"),this.removeLinkButton,this.i18n("floatingmenu.tab.link"),1)};GENTICS.Aloha.Link.bindInteractions=function(){var that=this;this.hrefField.addListener("keyup",function(obj,event){if(event.keyCode==27){var curval=that.hrefField.getQueryValue();if(curval[0]=="/"||curval.match(/^.*\.([a-z]){2,4}$/i)||curval[0]=="#"||curval.match(/^htt.*/i)){}else{}}that.hrefChange()});this.hrefField.addListener("blur",function(obj,event){if(this.getValue()==""){that.removeLink()}});for(var i=0;i<GENTICS.Aloha.editables.length;i++){GENTICS.Aloha.editables[i].obj.keydown(function(e){if(e.metaKey&&e.which==76){if(that.findLinkMarkup()){GENTICS.Aloha.FloatingMenu.userActivatedTab=that.i18n("floatingmenu.tab.link");GENTICS.Aloha.FloatingMenu.doLayout();that.hrefField.focus()}else{that.insertLink()}return false}});GENTICS.Aloha.editables[i].obj.find("a").each(function(i){jQuery(this).mouseenter(function(e){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"mouse over link.");that.mouseOverLink=this;that.updateMousePointer()});jQuery(this).mouseleave(function(e){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"mouse left link.");that.mouseOverLink=null;that.updateMousePointer()});jQuery(this).click(function(e){if(e.metaKey){GENTICS.Aloha.activeEditable.blur();setTimeout(function(){location.href=e.target},0);e.stopPropagation();return false}})})}jQuery(document).keydown(function(e){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"Meta key down.");that.metaKey=e.metaKey;that.updateMousePointer()});jQuery(document).keyup(function(e){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"Meta key up.");that.metaKey=e.metaKey;that.updateMousePointer()})};GENTICS.Aloha.Link.updateMousePointer=function(){if(this.metaKey&&this.mouseOverLink){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"set pointer");jQuery(this.mouseOverLink).removeClass("GENTICS_link_text");jQuery(this.mouseOverLink).addClass("GENTICS_link_pointer")}else{jQuery(this.mouseOverLink).removeClass("GENTICS_link_pointer");jQuery(this.mouseOverLink).addClass("GENTICS_link_text")}};GENTICS.Aloha.Link.subscribeEvents=function(){var that=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(event,rangeObject){if(GENTICS.Aloha.activeEditable){var config=that.getEditableConfig(GENTICS.Aloha.activeEditable.obj);if(jQuery.inArray("a",config)!=-1){that.formatLinkButton.show();that.insertLinkButton.show()}else{that.formatLinkButton.hide();that.insertLinkButton.hide();return}var foundMarkup=that.findLinkMarkup(rangeObject);if(foundMarkup){that.insertLinkButton.hide();that.formatLinkButton.setPressed(true);GENTICS.Aloha.FloatingMenu.setScope(that.getUID("link"));that.hrefField.setTargetObject(foundMarkup,"href")}else{that.formatLinkButton.setPressed(false);that.hrefField.setTargetObject(null)}GENTICS.Aloha.FloatingMenu.doLayout()}})};GENTICS.Aloha.Link.findLinkMarkup=function(range){if(typeof range=="undefined"){var range=GENTICS.Aloha.Selection.getRangeObject()}if(GENTICS.Aloha.activeEditable){return range.findMarkup(function(){return this.nodeName.toLowerCase()=="a"},GENTICS.Aloha.activeEditable.obj)}else{return null}};GENTICS.Aloha.Link.formatLink=function(){var range=GENTICS.Aloha.Selection.getRangeObject();if(GENTICS.Aloha.activeEditable){if(this.findLinkMarkup(range)){this.removeLink()}else{this.insertLink()}}};GENTICS.Aloha.Link.insertLink=function(extendToWord){if(this.findLinkMarkup(range)){return}GENTICS.Aloha.FloatingMenu.userActivatedTab=this.i18n("floatingmenu.tab.link");var range=GENTICS.Aloha.Selection.getRangeObject();if(range.isCollapsed()&&extendToWord!=false){GENTICS.Utils.Dom.extendToWord(range)}if(range.isCollapsed()){var linkText=this.i18n("newlink.defaulttext");var newLink=jQuery('<a href="">'+linkText+"</a>");GENTICS.Utils.Dom.insertIntoDOM(newLink,range,jQuery(GENTICS.Aloha.activeEditable.obj));range.startContainer=range.endContainer=newLink.contents().get(0);range.startOffset=0;range.endOffset=linkText.length}else{var newLink=jQuery('<a href=""></a>');GENTICS.Utils.Dom.addMarkup(range,newLink,false)}range.select();this.hrefField.focus();this.hrefChange()};GENTICS.Aloha.Link.removeLink=function(){var range=GENTICS.Aloha.Selection.getRangeObject();var foundMarkup=this.findLinkMarkup();if(foundMarkup){GENTICS.Utils.Dom.removeFromDOM(foundMarkup,range,true);GENTICS.Aloha.activeEditable.obj[0].focus();range.select()}};GENTICS.Aloha.Link.hrefChange=function(){this.hrefField.setAttribute("target",this.target,this.targetregex,this.hrefField.getQueryValue());this.hrefField.setAttribute("class",this.cssclass,this.cssclassregex,this.hrefField.getQueryValue());if(typeof this.onHrefChange=="function"){this.onHrefChange.call(this,this.hrefField.getTargetObject(),this.hrefField.getQueryValue(),this.hrefField.getItem())}GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("hrefChanged",GENTICS.Aloha,{obj:this.hrefField.getTargetObject(),href:this.hrefField.getQueryValue(),item:this.hrefField.getItem()}))};GENTICS.Aloha.Link.makeClean=function(obj){obj.find("a").each(function(){jQuery(this).removeClass("GENTICS_link_pointer");jQuery(this).removeClass("GENTICS_link_text")})};
7
+ GENTICS.Aloha.Link=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Link");GENTICS.Aloha.Link.languages=["en","de","fr"];GENTICS.Aloha.Link.config=["a"];GENTICS.Aloha.Link.targetregex="";GENTICS.Aloha.Link.target="";GENTICS.Aloha.Link.cssclassregex="";GENTICS.Aloha.Link.cssclass="";GENTICS.Aloha.Link.mouseOverLink=null;GENTICS.Aloha.Link.ressource=null;GENTICS.Aloha.Link.init=function(){if(GENTICS.Aloha.Link.settings.targetregex!=undefined){GENTICS.Aloha.Link.targetregex=GENTICS.Aloha.Link.settings.targetregex}if(GENTICS.Aloha.Link.settings.target!=undefined){GENTICS.Aloha.Link.target=GENTICS.Aloha.Link.settings.target}if(GENTICS.Aloha.Link.settings.cssclassregex!=undefined){GENTICS.Aloha.Link.cssclassregex=GENTICS.Aloha.Link.settings.cssclassregex}if(GENTICS.Aloha.Link.settings.cssclass!=undefined){GENTICS.Aloha.Link.cssclass=GENTICS.Aloha.Link.settings.cssclass}if(GENTICS.Aloha.Link.settings.ressource!=undefined){GENTICS.Aloha.Link.ressource=GENTICS.Aloha.Link.settings.ressource}this.initButtons();this.subscribeEvents();this.bindInteractions()};GENTICS.Aloha.Link.initButtons=function(){var that=this;this.formatLinkButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a",size:"small",onclick:function(){that.formatLink()},tooltip:this.i18n("button.addlink.tooltip"),toggle:true});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.formatLinkButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1);this.insertLinkButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a",size:"small",onclick:function(){that.insertLink(false)},tooltip:this.i18n("button.addlink.tooltip"),toggle:false});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.insertLinkButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1);GENTICS.Aloha.FloatingMenu.createScope(this.getUID("link"),"GENTICS.Aloha.continuoustext");this.srcFieldButton=new GENTICS.Aloha.Link.SrcField();GENTICS.Aloha.FloatingMenu.addButton(this.getUID("link"),this.srcFieldButton,this.i18n("floatingmenu.tab.link"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("link"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a_remove",size:"small",onclick:function(){that.removeLink()},tooltip:this.i18n("button.removelink.tooltip")}),this.i18n("floatingmenu.tab.link"),1)};GENTICS.Aloha.Link.bindInteractions=function(){var that=this;for(var i=0;i<GENTICS.Aloha.editables.length;i++){GENTICS.Aloha.editables[i].obj.keydown(function(e){if((that.isCrtlDown||that.isMetaDown)&&e.which==76){if(that.findLinkMarkup()){GENTICS.Aloha.FloatingMenu.userActivatedTab=that.i18n("floatingmenu.tab.link");GENTICS.Aloha.FloatingMenu.doLayout();that.srcFieldButton.focus()}else{that.insertLink()}return false}});GENTICS.Aloha.editables[i].obj.find("a").each(function(i){jQuery(this).mouseenter(function(e){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"mouse over link.");that.mouseOverLink=this;that.updateMousePointer()});jQuery(this).mouseleave(function(e){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"mouse left link.");that.moseOverLink=null;that.updateMousePointer()});jQuery(this).click(function(e){if(e.metaKey||e.ctrlKey){GENTICS.Aloha.activeEditable.blur();setTimeout(function(){location.href=e.target},0);e.stopPropagation();return false}})})}jQuery(document).keyup(function(e){switch(e.which){case 17:GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"ctrl up");that.isCtrlDown=false;that.updateMousePointer();break;case 91:that.isMetaLDown=false;if(!that.isMetaRDown){that.isMetaDown=false;GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"meta up")}that.updateMousePointer();break;case 93:that.isMetaRDown=false;if(!that.isMetaLDown){that.isMetaDown=false;GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"meta up")}that.updateMousePointer();break}});jQuery(document).keydown(function(e){switch(e.which){case 17:GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"meta ctrl");that.isCtrlDown=true;that.updateMousePointer();break;case 91:GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"meta down");that.isMetaLDown=true;that.isMetaDown=true;that.updateMousePointer();break;case 93:GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"meta down");that.isMetaRDown=true;that.isMetaDown=true;that.updateMousePointer();break}})};GENTICS.Aloha.Link.updateMousePointer=function(){var that=this;if((that.isCrtlDown||that.isMetaDown)&&that.mouseOverLink!=null){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"set pointer");jQuery(that.mouseOverLink).removeClass("GENTICS_link_text");jQuery(that.mouseOverLink).addClass("GENTICS_link_pointer")}else{jQuery(that.mouseOverLink).removeClass("GENTICS_link_pointer");jQuery(that.mouseOverLink).addClass("GENTICS_link_text")}};GENTICS.Aloha.Link.subscribeEvents=function(){var that=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(event,rangeObject){if(GENTICS.Aloha.activeEditable){var config=that.getEditableConfig(GENTICS.Aloha.activeEditable.obj);if(jQuery.inArray("a",config)!=-1){that.formatLinkButton.show();that.insertLinkButton.show()}else{that.formatLinkButton.hide();that.insertLinkButton.hide();return}var foundMarkup=that.findLinkMarkup(rangeObject);if(foundMarkup){that.insertLinkButton.hide();that.formatLinkButton.setPressed(true);GENTICS.Aloha.FloatingMenu.setScope(that.getUID("link"));that.srcFieldButton.setAnchor(foundMarkup)}else{that.formatLinkButton.setPressed(false);that.srcFieldButton.setAnchor(null)}GENTICS.Aloha.FloatingMenu.doLayout()}})};GENTICS.Aloha.Link.findLinkMarkup=function(range){if(typeof range=="undefined"){var range=GENTICS.Aloha.Selection.getRangeObject()}return range.findMarkup(function(){return this.nodeName.toLowerCase()=="a"},GENTICS.Aloha.activeEditable.obj)};GENTICS.Aloha.Link.formatLink=function(){var that=this;var range=GENTICS.Aloha.Selection.getRangeObject();if(GENTICS.Aloha.activeEditable){if(that.findLinkMarkup(range)){that.removeLink()}else{that.insertLink()}}};GENTICS.Aloha.Link.insertLink=function(extendToWord){var that=this;if(that.findLinkMarkup(range)){return}GENTICS.Aloha.FloatingMenu.userActivatedTab=this.i18n("floatingmenu.tab.link");var range=GENTICS.Aloha.Selection.getRangeObject();if(range.isCollapsed()&&extendToWord!=false){GENTICS.Utils.Dom.extendToWord(range)}if(range.isCollapsed()){var linkText=this.i18n("newlink.defaulttext");var newLink=jQuery('<a href="#">'+linkText+"</a>");GENTICS.Utils.Dom.insertIntoDOM(newLink,range,jQuery(GENTICS.Aloha.activeEditable.obj));range.startContainer=range.endContainer=newLink.contents().get(0);range.startOffset=0;range.endOffset=linkText.length}else{var newLink=jQuery('<a href="#"></a>');GENTICS.Utils.Dom.addMarkup(range,newLink,false)}range.select();this.srcFieldButton.focus()};GENTICS.Aloha.Link.removeLink=function(){var that=this;var range=GENTICS.Aloha.Selection.getRangeObject();var foundMarkup=that.findLinkMarkup();if(foundMarkup){GENTICS.Utils.Dom.removeFromDOM(foundMarkup,range,true);GENTICS.Aloha.activeEditable.obj[0].focus();range.select()}};GENTICS.Aloha.Link.makeClean=function(obj){obj.find("a").each(function(){})};Ext.ux.LinkSrcButton=Ext.extend(Ext.Component,{wrapper:null,input:null,anchor:null,onRender:function(){var that=this;Ext.ux.LinkSrcButton.superclass.onRender.apply(this,arguments);this.wrapper=jQuery(this.el.dom);this.input=jQuery('<input id="GENTICS_Aloha_plugin_Link" type="text" style="width:300px">');if(GENTICS.Aloha.Link.settings.ressource||1==1){var data=[{id:1,text:"Link A",url:"/page1"},{id:2,text:"Link B",url:"/page2"},{id:3,text:"Link C",url:"/page3"},{id:4,text:"Link D",url:"/page4"}];this.input.autocomplete(data,{formatItem:function(item){return item.text+'<br /><i style="font-size:75%;color:#555">'+item.url+"</i>"}}).result(function(event,item){that.input.val(item.url);jQuery(that.anchor).attr("id",item.id)})}this.input.keyup(function(event){if(that.anchor){if(that.input.val().length>=2){jQuery(that.anchor).attr("href",that.input.val())}else{jQuery(that.anchor).attr("href","#")}}if(event.keyCode==13||event.keyCode==27){GENTICS.Aloha.activeEditable.obj[0].focus();GENTICS.Aloha.Selection.getRangeObject().select()}else{that.setAttribute(that.input.val(),"target",GENTICS.Aloha.Link.targetregex,GENTICS.Aloha.Link.target);that.setAttribute(that.input.val(),"class",GENTICS.Aloha.Link.cssclassregex,GENTICS.Aloha.Link.cssclass)}});this.input.blur(function(event){if(that.input.val()==""){GENTICS.Aloha.Link.removeLink()}});this.wrapper.append(this.input);if(this.getFocus){this.getFocus=undefined;this.input.select();this.input.focus()}},setAttribute:function(input,attr,regex,value){var that=this;if(typeof value!="undefined"){var setTarget=true;if(typeof regex!="undefined"){var regex=new RegExp(regex);if(input.match(regex)){setTarget=true}else{setTarget=false}}if(setTarget){jQuery(that.anchor).attr(attr,value)}else{jQuery(that.anchor).removeAttr(attr)}}},setAnchor:function(anchor){this.anchor=anchor;if(this.input){if(this.anchor){this.input.val(jQuery(this.anchor).attr("href"))}else{this.input.val("")}}},focus:function(){if(this.input){this.input.select();this.input.focus()}else{this.getFocus=true}}});Ext.reg("linksrcbutton",Ext.ux.LinkSrcButton);GENTICS.Aloha.Link.SrcField=function(){GENTICS.Aloha.ui.Button.apply(this,arguments)};GENTICS.Aloha.Link.SrcField.prototype=new GENTICS.Aloha.ui.Button();GENTICS.Aloha.Link.SrcField.prototype.getExtConfigProperties=function(){return{xtype:"linksrcbutton",id:this.id}};GENTICS.Aloha.Link.SrcField.prototype.setAnchor=function(anchor){if(this.extButton){this.extButton.setAnchor(anchor)}};GENTICS.Aloha.Link.SrcField.prototype.focus=function(){if(this.extButton){this.extButton.focus()}};
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Aloha Editor
3
+ * Author & Copyright (c) 2010 Gentics Software GmbH
4
+ * aloha-sales@gentics.com
5
+ * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
+ */
7
+ GENTICS.Aloha.Ressource=function(ressourcePrefix,basePath){this.prefix=ressourcePrefix;this.basePath=basePath?basePath:ressourcePrefix;GENTICS.Aloha.RessourceRegistry.register(this)};GENTICS.Aloha.Ressource.prototype.settings=null;GENTICS.Aloha.Ressource.prototype.init=function(){};GENTICS.Aloha.Ressource.prototype.query=function(attrs){return null};GENTICS.Aloha.Ressource.prototype.resolveRessource=function(obj){return null};
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Aloha Editor
3
+ * Author & Copyright (c) 2010 Gentics Software GmbH
4
+ * aloha-sales@gentics.com
5
+ * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
+ */
7
+ GENTICS.Aloha.Ressources.Dummy=new GENTICS.Aloha.Ressource("com.gentics.aloha.resources.Dummy");GENTICS.Aloha.Ressources.Dummy.init=function(){var data=[{id:1,text:"Link A",url:"/page1"},{id:2,text:"Link B",url:"/page2"},{id:3,text:"Link C",url:"/page3"},{id:4,text:"Link D",url:"/page4"}]};GENTICS.Aloha.Ressources.Dummy.query=function(attrs){return this.data};GENTICS.Aloha.Ressources.Dummy.resolve=function(obj){return null};
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Aloha Editor
3
+ * Author & Copyright (c) 2010 Gentics Software GmbH
4
+ * aloha-sales@gentics.com
5
+ * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
+ */
7
+ GENTICS.Aloha.RessourceRegistry=function(){this.ressources=new Array()};GENTICS.Aloha.RessourceRegistry.prototype.register=function(ressource){if(ressource instanceof GENTICS.Aloha.Ressource){this.ressources.push(ressource)}};GENTICS.Aloha.RessourceRegistry.prototype.init=function(){for(var i=0;i<this.ressources.length;i++){var ressource=this.ressources[i];if(GENTICS.Aloha.settings.ressources==undefined){GENTICS.Aloha.settings.ressources={}}ressource.settings=GENTICS.Aloha.settings.ressources[ressource.prefix];if(ressource.settings==undefined){ressource.settings={}}if(ressource.settings.enabled==undefined){ressource.settings.enabled=true}if(ressource.settings.enabled==true){this.ressources[i].init()}}};GENTICS.Aloha.RessourceRegistry.toString=function(){return"com.gentics.aloha.RessourceRegistry"};GENTICS.Aloha.RessourceRegistry=new GENTICS.Aloha.RessourceRegistry();GENTICS.Aloha.Ressources={};
@@ -4,4 +4,4 @@
4
4
  * aloha-sales@gentics.com
5
5
  * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
6
  */
7
- GENTICS.Aloha.ListPlugin=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.List");GENTICS.Aloha.ListPlugin.languages=["en","de","fr","eo","fi","ru","it"];GENTICS.Aloha.ListPlugin.config=["ul","ol"];GENTICS.Aloha.ListPlugin.transformableElements={p:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,ul:true,ol:true};GENTICS.Aloha.ListPlugin.init=function(){var that=this;this.createUnorderedListButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_ul",size:"small",tooltip:this.i18n("button.createulist.tooltip"),toggle:true,onclick:function(element,event){that.transformList(false)}});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.createUnorderedListButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1);this.createOrderedListButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_ol",size:"small",tooltip:this.i18n("button.createolist.tooltip"),toggle:true,onclick:function(element,event){that.transformList(true)}});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.createOrderedListButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1);GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(event,rangeObject){that.createUnorderedListButton.setPressed(false);that.createOrderedListButton.setPressed(false);for(var i=0;i<rangeObject.markupEffectiveAtStart.length;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(effectiveMarkup,jQuery("<ul></ul>"))){that.createUnorderedListButton.setPressed(true);break}if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(effectiveMarkup,jQuery("<ol></ol>"))){that.createOrderedListButton.setPressed(true);break}}if(GENTICS.Aloha.activeEditable){that.applyButtonConfig(GENTICS.Aloha.activeEditable.obj)}GENTICS.Aloha.FloatingMenu.doLayout()});GENTICS.Aloha.Markup.addKeyHandler(9,function(event){return that.processTab(event)})};GENTICS.Aloha.ListPlugin.applyButtonConfig=function(obj){var config=this.getEditableConfig(obj);if(GENTICS.Aloha.Selection.rangeObject.unmodifiableMarkupAtStart[0]){if(jQuery.inArray("ul",config)!=-1&&GENTICS.Aloha.Selection.canTag1WrapTag2(GENTICS.Aloha.Selection.rangeObject.unmodifiableMarkupAtStart[0].nodeName,"ul")!=-1){this.createUnorderedListButton.show()}else{this.createUnorderedListButton.hide()}if(jQuery.inArray("ol",config)!=-1&&GENTICS.Aloha.Selection.canTag1WrapTag2(GENTICS.Aloha.Selection.rangeObject.unmodifiableMarkupAtStart[0].nodeName,"ol")!=-1){this.createOrderedListButton.show()}else{this.createOrderedListButton.hide()}}};GENTICS.Aloha.ListPlugin.processTab=function(event){switch(event.keyCode){case 9:if(event.shiftKey){return this.outdentList()}else{return this.indentList()}}return true};GENTICS.Aloha.ListPlugin.getStartingDomObjectToTransform=function(){var rangeObject=GENTICS.Aloha.Selection.rangeObject;for(var i=0;i<rangeObject.markupEffectiveAtStart.length;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(this.transformableElements[effectiveMarkup.nodeName.toLowerCase()]){return effectiveMarkup}}return false};GENTICS.Aloha.ListPlugin.getNearestSelectedListItem=function(){var rangeObject=GENTICS.Aloha.Selection.rangeObject;for(var i=0;i<rangeObject.markupEffectiveAtStart.length;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(GENTICS.Utils.Dom.isListElement(effectiveMarkup)){return effectiveMarkup}}return false};GENTICS.Aloha.ListPlugin.transformList=function(ordered){var domToTransform=this.getStartingDomObjectToTransform();if(!domToTransform){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<p></p>"));domToTransform=this.getStartingDomObjectToTransform();if(!domToTransform){GENTICS.Aloha.Log.error(this,"Could not transform selection into a list");return}}var nodeName=domToTransform.nodeName.toLowerCase();if(nodeName=="ul"&&!ordered){var jqList=jQuery(domToTransform);var jqParentList=jqList.parent();if(jqParentList.length>0&&GENTICS.Utils.Dom.isListElement(jqParentList.get(0))){jqList.children().unwrap()}else{var jqToTransform=jQuery(domToTransform);jQuery.each(jqToTransform.children("li"),function(index,li){var newPara=GENTICS.Aloha.Markup.transformDomObject(li,"p");newPara.after(newPara.children("ol,ul"))});jqToTransform.children().unwrap()}}else{if(nodeName=="ul"&&ordered){GENTICS.Aloha.Markup.transformDomObject(domToTransform,"ol");this.mergeAdjacentLists(jQuery(domToTransform))}else{if(nodeName=="ol"&&!ordered){GENTICS.Aloha.Markup.transformDomObject(domToTransform,"ul");this.mergeAdjacentLists(jQuery(domToTransform))}else{if(nodeName=="ol"&&ordered){var jqList=jQuery(domToTransform);var jqParentList=jqList.parent();if(jqParentList.length>0&&GENTICS.Utils.Dom.isListElement(jqParentList.get(0))){jqList.children().unwrap()}else{var jqToTransform=jQuery(domToTransform);jQuery.each(jqToTransform.children("li"),function(index,li){var newPara=GENTICS.Aloha.Markup.transformDomObject(li,"p");newPara.after(newPara.children("ol,ul"))});jqToTransform.children().unwrap()}}else{var selectedSiblings=GENTICS.Aloha.Selection.rangeObject.getSelectedSiblings(domToTransform);var jqList=ordered?jQuery("<ol></ol>"):jQuery("<ul></ul>");var jqNewLi=jQuery("<li></li>");jqList.append(jqNewLi);jQuery(domToTransform).contents().appendTo(jqNewLi);jQuery(domToTransform).replaceWith(jqList);if(selectedSiblings){var lastLi=false;for(var i=0;i<selectedSiblings.length;++i){if(GENTICS.Utils.Dom.isBlockLevelElement(selectedSiblings[i])){if(lastLi){lastLi=false}jqNewLi=GENTICS.Aloha.Markup.transformDomObject(selectedSiblings[i],"li");jqList.append(jqNewLi)}else{if(selectedSiblings[i].nodeType==3&&jQuery.trim(selectedSiblings[i].data).length==0){continue}if(!lastLi){lastLi=jQuery("<li></li>");jqList.append(lastLi)}lastLi.append(selectedSiblings[i])}}}this.mergeAdjacentLists(jqList)}}}}this.refreshSelection()};GENTICS.Aloha.ListPlugin.indentList=function(){var listItem=this.getNearestSelectedListItem();if(listItem){var jqItemBefore=jQuery(listItem).prev("li");if(jqItemBefore.length==0){return false}var jqOldList=jQuery(listItem).parent();var selectedSiblings=GENTICS.Aloha.Selection.rangeObject.getSelectedSiblings(listItem);var jqNewList=jQuery(listItem).parent().clone(false).empty();jqNewList.append(listItem);jqItemBefore.append(jqNewList);if(selectedSiblings){for(var i=0;i<selectedSiblings.length;++i){jqNewList.append(jQuery(selectedSiblings[i]))}}this.mergeAdjacentLists(jqNewList);this.refreshSelection();return false}return true};GENTICS.Aloha.ListPlugin.outdentList=function(){var listItem=this.getNearestSelectedListItem();if(listItem){var jqListItem=jQuery(listItem);var jqList=jqListItem.parent();var jqParentList=jqList.parents("ul,ol");var wrappingLi=jqList.parent("li");if(jqParentList.length>0&&GENTICS.Utils.Dom.isListElement(jqParentList.get(0))){var selectedSiblings=GENTICS.Aloha.Selection.rangeObject.getSelectedSiblings(listItem);if(selectedSiblings&&selectedSiblings.length>0){var lastSelected=jQuery(selectedSiblings[selectedSiblings.length-1])}else{var lastSelected=jqListItem}if(lastSelected.nextAll("li").length>0){var jqNewPostList=jqList.clone(false).empty();jqNewPostList.append(lastSelected.nextAll())}if(wrappingLi.length>0){if(typeof jqNewPostList!=="undefined"){jqListItem.append(jqNewPostList)}wrappingLi.after(jqListItem)}else{jqList.before(jqListItem)}if(selectedSiblings&&selectedSiblings.length>0){for(var i=selectedSiblings.length-1;i>=0;--i){jqListItem.after(jQuery(selectedSiblings[i]))}}if(jqList.contents("li").length==0){jqList.remove()}if(wrappingLi.length>0&&wrappingLi.contents().length==0){wrappingLi.remove()}this.refreshSelection()}return false}return true};GENTICS.Aloha.ListPlugin.refreshSelection=function(){if(GENTICS.Aloha.activeEditable){GENTICS.Aloha.activeEditable.obj[0].focus()}GENTICS.Aloha.Selection.rangeObject.update();GENTICS.Aloha.Selection.rangeObject.select();GENTICS.Aloha.Selection.updateSelection()};GENTICS.Aloha.ListPlugin.mergeAdjacentLists=function(jqList){var firstList=jqList.get(0);while(firstList.previousSibling&&firstList.previousSibling.nodeType==1&&firstList.previousSibling.nodeName==firstList.nodeName){firstList=firstList.previousSibling}jqList=jQuery(firstList);while(firstList.nextSibling&&((firstList.nextSibling.nodeType==1&&firstList.nextSibling.nodeName==firstList.nodeName)||(firstList.nextSibling.nodeType==3&&jQuery.trim(firstList.nextSibling.data).length==0))){var jqNextList=jQuery(firstList.nextSibling);if(firstList.nextSibling.nodeType==1){jqNextList.contents().appendTo(jqList)}jqNextList.remove()}};
7
+ GENTICS.Aloha.ListPlugin=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.List");GENTICS.Aloha.ListPlugin.languages=["en","de","fr","eo","fi","ru","it"];GENTICS.Aloha.ListPlugin.config=["ul","ol"];GENTICS.Aloha.ListPlugin.transformableElements={p:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,ul:true,ol:true};GENTICS.Aloha.ListPlugin.init=function(){var that=this;this.createUnorderedListButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_ul",size:"small",tooltip:this.i18n("button.createulist.tooltip"),toggle:true,onclick:function(element,event){that.transformList(false)}});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.createUnorderedListButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1);this.createOrderedListButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_ol",size:"small",tooltip:this.i18n("button.createolist.tooltip"),toggle:true,onclick:function(element,event){that.transformList(true)}});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.createOrderedListButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1);GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(event,rangeObject){that.createUnorderedListButton.setPressed(false);that.createOrderedListButton.setPressed(false);for(var i=0;i<rangeObject.markupEffectiveAtStart.length;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(effectiveMarkup,jQuery("<ul></ul>"))){that.createUnorderedListButton.setPressed(true);break}if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(effectiveMarkup,jQuery("<ol></ol>"))){that.createOrderedListButton.setPressed(true);break}}if(GENTICS.Aloha.activeEditable){that.applyButtonConfig(GENTICS.Aloha.activeEditable.obj)}GENTICS.Aloha.FloatingMenu.doLayout()});GENTICS.Aloha.Markup.addKeyHandler(9,function(event){return that.processTab(event)})};GENTICS.Aloha.ListPlugin.applyButtonConfig=function(obj){var config=this.getEditableConfig(obj);if(jQuery.inArray("ul",config)!=-1&&GENTICS.Aloha.Selection.canTag1WrapTag2(GENTICS.Aloha.Selection.rangeObject.unmodifiableMarkupAtStart[0].nodeName,"ul")!=-1){this.createUnorderedListButton.show()}else{this.createUnorderedListButton.hide()}if(jQuery.inArray("ol",config)!=-1&&GENTICS.Aloha.Selection.canTag1WrapTag2(GENTICS.Aloha.Selection.rangeObject.unmodifiableMarkupAtStart[0].nodeName,"ol")!=-1){this.createOrderedListButton.show()}else{this.createOrderedListButton.hide()}};GENTICS.Aloha.ListPlugin.processTab=function(event){switch(event.keyCode){case 9:if(event.shiftKey){return this.outdentList()}else{return this.indentList()}}return true};GENTICS.Aloha.ListPlugin.getStartingDomObjectToTransform=function(){var rangeObject=GENTICS.Aloha.Selection.rangeObject;for(var i=0;i<rangeObject.markupEffectiveAtStart.length;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(this.transformableElements[effectiveMarkup.nodeName.toLowerCase()]){return effectiveMarkup}}return false};GENTICS.Aloha.ListPlugin.getNearestSelectedListItem=function(){var rangeObject=GENTICS.Aloha.Selection.rangeObject;for(var i=0;i<rangeObject.markupEffectiveAtStart.length;i++){var effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(GENTICS.Utils.Dom.isListElement(effectiveMarkup)){return effectiveMarkup}}return false};GENTICS.Aloha.ListPlugin.transformList=function(ordered){var domToTransform=this.getStartingDomObjectToTransform();if(!domToTransform){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<p></p>"));domToTransform=this.getStartingDomObjectToTransform();if(!domToTransform){GENTICS.Aloha.Log.error(this,"Could not transform selection into a list");return}}var nodeName=domToTransform.nodeName.toLowerCase();if(nodeName=="ul"&&!ordered){var jqList=jQuery(domToTransform);var jqParentList=jqList.parent();if(jqParentList.length>0&&GENTICS.Utils.Dom.isListElement(jqParentList.get(0))){jqList.children().unwrap()}else{var jqToTransform=jQuery(domToTransform);jQuery.each(jqToTransform.children("li"),function(index,li){var newPara=GENTICS.Aloha.Markup.transformDomObject(li,"p");newPara.after(newPara.children("ol,ul"))});jqToTransform.children().unwrap()}}else{if(nodeName=="ul"&&ordered){GENTICS.Aloha.Markup.transformDomObject(domToTransform,"ol");this.mergeAdjacentLists(jQuery(domToTransform))}else{if(nodeName=="ol"&&!ordered){GENTICS.Aloha.Markup.transformDomObject(domToTransform,"ul");this.mergeAdjacentLists(jQuery(domToTransform))}else{if(nodeName=="ol"&&ordered){var jqList=jQuery(domToTransform);var jqParentList=jqList.parent();if(jqParentList.length>0&&GENTICS.Utils.Dom.isListElement(jqParentList.get(0))){jqList.children().unwrap()}else{var jqToTransform=jQuery(domToTransform);jQuery.each(jqToTransform.children("li"),function(index,li){var newPara=GENTICS.Aloha.Markup.transformDomObject(li,"p");newPara.after(newPara.children("ol,ul"))});jqToTransform.children().unwrap()}}else{var selectedSiblings=GENTICS.Aloha.Selection.rangeObject.getSelectedSiblings(domToTransform);var jqList=ordered?jQuery("<ol></ol>"):jQuery("<ul></ul>");var jqNewLi=jQuery("<li></li>");jqList.append(jqNewLi);jQuery(domToTransform).contents().appendTo(jqNewLi);jQuery(domToTransform).replaceWith(jqList);if(selectedSiblings){var lastLi=false;for(var i=0;i<selectedSiblings.length;++i){if(GENTICS.Utils.Dom.isBlockLevelElement(selectedSiblings[i])){if(lastLi){lastLi=false}jqNewLi=GENTICS.Aloha.Markup.transformDomObject(selectedSiblings[i],"li");jqList.append(jqNewLi)}else{if(selectedSiblings[i].nodeType==3&&jQuery.trim(selectedSiblings[i].data).length==0){continue}if(!lastLi){lastLi=jQuery("<li></li>");jqList.append(lastLi)}lastLi.append(selectedSiblings[i])}}}this.mergeAdjacentLists(jqList)}}}}this.refreshSelection()};GENTICS.Aloha.ListPlugin.indentList=function(){var listItem=this.getNearestSelectedListItem();if(listItem){var jqItemBefore=jQuery(listItem).prev("li");if(jqItemBefore.length==0){return false}var jqOldList=jQuery(listItem).parent();var selectedSiblings=GENTICS.Aloha.Selection.rangeObject.getSelectedSiblings(listItem);var jqNewList=jQuery(listItem).parent().clone(false).empty();jqNewList.append(listItem);jqItemBefore.append(jqNewList);if(selectedSiblings){for(var i=0;i<selectedSiblings.length;++i){jqNewList.append(jQuery(selectedSiblings[i]))}}this.mergeAdjacentLists(jqNewList);this.refreshSelection();return false}return true};GENTICS.Aloha.ListPlugin.outdentList=function(){var listItem=this.getNearestSelectedListItem();if(listItem){var jqListItem=jQuery(listItem);var jqList=jqListItem.parent();var jqParentList=jqList.parents("ul,ol");var wrappingLi=jqList.parent("li");if(jqParentList.length>0&&GENTICS.Utils.Dom.isListElement(jqParentList.get(0))){var selectedSiblings=GENTICS.Aloha.Selection.rangeObject.getSelectedSiblings(listItem);if(selectedSiblings&&selectedSiblings.length>0){var lastSelected=jQuery(selectedSiblings[selectedSiblings.length-1])}else{var lastSelected=jqListItem}if(lastSelected.nextAll("li").length>0){var jqNewPostList=jqList.clone(false).empty();jqNewPostList.append(lastSelected.nextAll())}if(wrappingLi.length>0){if(typeof jqNewPostList!=="undefined"){jqListItem.append(jqNewPostList)}wrappingLi.after(jqListItem)}else{jqList.before(jqListItem)}if(selectedSiblings&&selectedSiblings.length>0){for(var i=selectedSiblings.length-1;i>=0;--i){jqListItem.after(jQuery(selectedSiblings[i]))}}if(jqList.contents("li").length==0){jqList.remove()}if(wrappingLi.length>0&&wrappingLi.contents().length==0){wrappingLi.remove()}this.refreshSelection()}return false}return true};GENTICS.Aloha.ListPlugin.refreshSelection=function(){if(GENTICS.Aloha.activeEditable){GENTICS.Aloha.activeEditable.obj[0].focus()}GENTICS.Aloha.Selection.rangeObject.update();GENTICS.Aloha.Selection.rangeObject.select();GENTICS.Aloha.Selection.updateSelection()};GENTICS.Aloha.ListPlugin.mergeAdjacentLists=function(jqList){var firstList=jqList.get(0);while(firstList.previousSibling&&firstList.previousSibling.nodeType==1&&firstList.previousSibling.nodeName==firstList.nodeName){firstList=firstList.previousSibling}jqList=jQuery(firstList);while(firstList.nextSibling&&((firstList.nextSibling.nodeType==1&&firstList.nextSibling.nodeName==firstList.nodeName)||(firstList.nextSibling.nodeType==3&&jQuery.trim(firstList.nextSibling.data).length==0))){var jqNextList=jQuery(firstList.nextSibling);if(firstList.nextSibling.nodeType==1){jqNextList.contents().appendTo(jqList)}jqNextList.remove()}};
@@ -1 +1 @@
1
- (function(){var deps=GENTICS.Aloha.TOC||{jQuery:jQuery},$=deps.jQuery;function last(a){return a[a.length-1]}function head(a){return a[0]}function tail(a){return a.slice(1)}function indexOf(a,item){return detect(a,function(cmp){return cmp===item})}function detect(a,f){for(var i=0;i<a.length;i++){if(f(a[i])){return a[i]}}return null}function map(a,f){var result=[];for(var i=0;i<a.length;i++){result.push(f(a[i]))}return result}function each(a,f){map(a,f)}var namespace="com.gentics.aloha.plugins.TOC";var TOC=GENTICS.Aloha.TOC=new GENTICS.Aloha.Plugin(namespace);GENTICS.Aloha.TOC.languages=["en","de"];var $containers=null;var allTocs=[];TOC.init=function(){var s=TOC.settings;s.updateInterval=s.updateInterval||5000;s.minEntries=s.minEntries||0;TOC.initButtons();$(document).ready(function(){TOC.spawn()})};TOC.initButtons=function(){TOC.insertTocButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_ul",size:"small",onclick:function(){TOC.insertAtSelection($containers)},tooltip:this.i18n("button.addtoc.tooltip"),toggle:false});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.insertTocButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1)};TOC.register=function($c){$containers=$c};TOC.generateId=function(elemOrText){var validId;if(typeof elemOrText=="object"){validId=$(elemOrText).text().replace(/[^a-zA-Z-]+/g,"-").replace(/^[^a-zA-Z]+/,"")}else{if(elemOrText){validId=elemOrText}}for(var uniquifier=0;;uniquifier++){var uniqueId=validId;if(uniquifier){uniqueId+="-"+uniquifier}var conflict=document.getElementById(uniqueId);if(!conflict||(typeof elemOrText=="object"&&conflict===elemOrText)){return uniqueId}}};TOC.outline=function(ctx){var rootNode=[$()];var potentialParents=[rootNode];TOC.headings(ctx).each(function(){var $heading=$(this);var nodeName=this.nodeName.toLowerCase();var hLevels=["h6","h5","h4","h3","h2","h1"];var currLevel=$.inArray(nodeName,hLevels);var higherEq=hLevels.slice(currLevel).join(",");var $section=$heading.nextUntil(higherEq).andSelf();var node=[$section];var parent=detect(potentialParents,function(parent){var parentSection=parent[0];return !parentSection.length||detect(parentSection,function(sectionElem){return $heading.get(0)===sectionElem||$.contains(sectionElem,$heading.get(0))})});parent.push(node);potentialParents.splice(0,indexOf(potentialParents,parent),node)});return rootNode};TOC.editableContainers=function(){return $(map(GENTICS.Aloha.editables,function(editable){return document.getElementById(editable.getId())}))};TOC.headings=function($ctx){return $ctx.find(":header").add($ctx.filter(":header"))};TOC.anchorFromLinkId=function($ctx,linkId){return linkId?$ctx.find('a[href $= "#'+linkId+'"]'):$()};TOC.linkIdFromAnchor=function($anchor){var href=$anchor.attr("href");return href?href.match(/#(.*?)$/)[1]:null};TOC.insertAtSelection=function($containers){$containers=$containers||TOC.editableContainers();var id=TOC.generateId("toc");var $tocElement=$("<ol class='toc_root'></ol>").attr("id",id).attr("contentEditable","false");var range=GENTICS.Aloha.Selection.getRangeObject();var tocEditable=GENTICS.Aloha.activeEditable;var $tocContainer=$(document.getElementById(tocEditable.getId()));GENTICS.Utils.Dom.insertIntoDOM($tocElement,range,$tocContainer);TOC.create(id).register($containers).update().tickTock()};TOC.spawn=function($ctx,$containers){$ctx=$ctx||$("body");$containers=$containers||TOC.editableContainers();$ctx.find("ol.toc_root").each(function(){var id=$(this).attr("id");if(!id){id=TOC.generateId("toc");$(this).attr("id",id)}TOC.create(id).register($containers).tickTock()})};TOC.create=function(id){allTocs.push(this);return{id:id,"$containers":$(),root:function(){return $(document.getElementById(this.id))},register:function($containers){var self=this;self.$containers=self.$containers.add($containers);self.$containers.filter(function(){return !$(this).data(namespace+"."+self.id+".listening")}).each(function(){var $container=$(this);$container.data(namespace+"."+self.id+".listening",true);$container.bind("blur",function(){self.cleanupIds($container.get(0));self.update($container)})});return self},tickTock:function(interval){var self=this;interval=interval||TOC.settings.updateInterval;if(!interval){return}window.setInterval(function(){self.register(TOC.editableContainers());self.update()},interval);return self},cleanupIds:function(ctx){var ids=[];TOC.headings(this.$containers).each(function(){var id=$(this).attr("id");if((id&&-1!=$.inArray(id,ids))||(ctx&&($.contains(ctx,this)||ctx===this))){$(this).attr("id",TOC.generateId(this))}ids.push(id)});return this},update:function($ctx){var self=this;$ctx=$ctx||self.$containers;var outline=TOC.outline(self.$containers);var ancestors=[self.root()];var prevSiblings=[];last(ancestors).empty();(function descend(outline){var prevSiblings=[];each(outline,function(node){var $section=head(node);var $entry=self.linkSection($section,ancestors,prevSiblings);ancestors.push($entry);descend(tail(node));ancestors.pop();prevSiblings.push($entry)})})(tail(outline));var minEntries=self.root().attr("data-TOC-minEntries")||TOC.settings.minEntries;if(self.root().find("li").length>=minEntries){self.root().show()}else{self.root().hide()}return this},linkSection:function($section,ancestors,prevSiblings){var linkId=$section.eq(0).attr("id");if(!linkId){linkId=TOC.generateId($section.get(0));$section.eq(0).attr("id",linkId)}var $root=this.root();var $entry=TOC.anchorFromLinkId($root,linkId);if(!$entry.length){$entry=$("<li><a/></li>")}$entry.find("a").attr("href","#"+linkId).text($section.eq(0).text());if(last(prevSiblings)){last(prevSiblings).after($entry)}else{if(last(ancestors).get(0)==$root.get(0)){$root.append($entry)}else{var $subToc=$("<ol/>").append($entry);last(ancestors).append($subToc)}}return $entry}}}}());
1
+ (function(){var deps=GENTICS.Aloha.TOC||{jQuery:jQuery},$=deps.jQuery;function last(a){return a[a.length-1]}function head(a){return a[0]}function tail(a){return a.slice(1)}function indexOf(a,item){return detect(a,function(cmp){return cmp===item})}function detect(a,f){for(var i=0;i<a.length;i++){if(f(a[i])){return a[i]}}return null}function map(a,f){var result=[];for(var i=0;i<a.length;i++){result.push(f(a[i]))}return result}function each(a,f){map(a,f)}var namespace="com.gentics.aloha.plugins.TOC";var TOC=GENTICS.Aloha.TOC=new GENTICS.Aloha.Plugin(namespace);var $containers=null;var allTocs=[];TOC.init=function(){var s=TOC.settings;s.updateInterval=s.updateInterval||5000;TOC.initButtons();TOC.spawn()};TOC.initButtons=function(){TOC.insertTocButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a",size:"small",onclick:function(){TOC.insertAtSelection($containers)},tooltip:this.i18n("button.addtoc.tooltip"),toggle:false});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.insertTocButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1)};TOC.register=function($c){$containers=$c};TOC.generateId=function(elemOrText){var validId;if(typeof elemOrText=="object"){validId=$(elemOrText).text().replace(/[^a-zA-Z-]+/g,"-").replace(/^[^a-zA-Z]+/,"")}else{if(elemOrText){validId=elemOrText}}for(var uniquifier=0;;uniquifier++){var uniqueId=validId;if(uniquifier){uniqueId+="-"+uniquifier}var conflict=document.getElementById(uniqueId);if(!conflict||(typeof elemOrText=="object"&&conflict===elemOrText)){return uniqueId}}};TOC.outline=function(ctx){var rootNode=[$()];var potentialParents=[rootNode];TOC.headings(ctx).each(function(){var $heading=$(this);var nodeName=this.nodeName.toLowerCase();var hLevels=["h6","h5","h4","h3","h2","h1"];var currLevel=$.inArray(nodeName,hLevels);var higherEq=hLevels.slice(currLevel).join(",");var $section=$heading.nextUntil(higherEq).andSelf();var node=[$section];var parent=detect(potentialParents,function(parent){var parentSection=parent[0];return !parentSection.length||detect(parentSection,function(sectionElem){return $heading.get(0)===sectionElem||$.contains(sectionElem,$heading.get(0))})});parent.push(node);potentialParents.splice(0,indexOf(potentialParents,parent),node)});return rootNode};TOC.editableContainers=function(){return $(map(GENTICS.Aloha.editables,function(editable){return document.getElementById(editable.getId())}))};TOC.headings=function($ctx){return $ctx.find(":header").add($ctx.filter(":header"))};TOC.anchorFromLinkId=function($ctx,linkId){return linkId?$ctx.find('a[href $= "#'+linkId+'"]'):$()};TOC.linkIdFromAnchor=function($anchor){var href=$anchor.attr("href");return href?href.match(/#(.*?)$/)[1]:null};TOC.insertAtSelection=function($containers){$containers=$containers||TOC.editableContainers();var id=TOC.generateId("toc");var $tocElement=$("<ol class='toc_root'></ol>").attr("id",id);var range=GENTICS.Aloha.Selection.getRangeObject();var tocEditable=GENTICS.Aloha.activeEditable;var $tocContainer=$(document.getElementById(tocEditable.getId()));GENTICS.Utils.Dom.insertIntoDOM($tocElement,range,$tocContainer);TOC.create(id).register($containers).update().tickTock()};TOC.spawn=function($ctx,$containers){$ctx=$ctx||$("body");$containers=$containers||TOC.editableContainers();$ctx.find("ol.toc_root").each(function(){var id=$(this).attr("id");if(!id){id=TOC.generateId("toc");$(this).attr("id",id)}TOC.create(id).register($containers).tickTock()})};TOC.create=function(id){allTocs.push(this);return{id:id,"$containers":$(),root:function(){return $(document.getElementById(this.id))},register:function($containers){var self=this;self.$containers=self.$containers.add($containers);self.$containers.filter(function(){return !$(this).data(namespace+"."+self.id+".listening")}).each(function(){var $container=$(this);$container.data(namespace+"."+self.id+".listening",true);$container.bind("blur",function(){self.cleanupIds($container.get(0));self.update($container)})});return self},tickTock:function(interval){var self=this;interval=interval||TOC.settings.updateInterval;if(!interval){return}window.setInterval(function(){self.update()},interval);return self},cleanupIds:function(ctx){var ids=[];TOC.headings(this.$containers).each(function(){var id=$(this).attr("id");if((id&&-1!=$.inArray(id,ids))||(ctx&&($.contains(ctx,this)||ctx===this))){$(this).attr("id",TOC.generateId(this))}ids.push(id)});return this},update:function($ctx){var self=this;$ctx=$ctx||self.$containers;var outline=TOC.outline(self.$containers);var ancestors=[self.root()];var prevSiblings=[];last(ancestors).empty();(function descend(outline){var prevSiblings=[];each(outline,function(node){var $section=head(node);var $entry=self.linkSection($section,ancestors,prevSiblings);ancestors.push($entry);descend(tail(node));ancestors.pop();prevSiblings.push($entry)})})(tail(outline));return this},linkSection:function($section,ancestors,prevSiblings){var linkId=$section.eq(0).attr("id");if(!linkId){linkId=TOC.generateId($section.get(0));$section.eq(0).attr("id",linkId)}var $root=this.root();var $entry=TOC.anchorFromLinkId($root,linkId);if(!$entry.length){$entry=$("<li><a/></li>")}$entry.find("a").attr("href","#"+linkId).text($section.eq(0).text());if(last(prevSiblings)){last(prevSiblings).after($entry)}else{if(last(ancestors).get(0)==$root.get(0)){$root.append($entry)}else{var $subToc=$("<ol/>").append($entry);last(ancestors).append($subToc)}}return $entry}}}}());
@@ -10,5 +10,3 @@ button.delcols.tooltip=Spalten löschen
10
10
  button.addrowbefore.tooltip=Zeile darüber einfügen
11
11
  button.addrowafter.tooltip=Zeile darunter einfügen
12
12
  button.delrows.tooltip=Zeilen löschen
13
- button.caption.tooltip=Tabellen Bezeichnung
14
- empty.caption=Tabellen Bezeichnung
@@ -10,5 +10,3 @@ button.delcols.tooltip=Delete Columns
10
10
  button.addrowbefore.tooltip=Add Row before
11
11
  button.addrowafter.tooltip=Add Row after
12
12
  button.delrows.tooltip=Delete Rows
13
- button.caption.tooltip=Table caption
14
- empty.caption=Table caption
@@ -4,4 +4,4 @@
4
4
  * aloha-sales@gentics.com
5
5
  * Licensed unter the terms of http://www.aloha-editor.com/license.html
6
6
  */
7
- GENTICS.Aloha.TablePlugin=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Table");GENTICS.Aloha.TablePlugin.createLayer=undefined;GENTICS.Aloha.TablePlugin.languages=["en","de","fr","eo","fi","ru","it","pl"];GENTICS.Aloha.TablePlugin.config=["table"];GENTICS.Aloha.TablePlugin.TableRegistry=new Array();GENTICS.Aloha.TablePlugin.activeTable=undefined;GENTICS.Aloha.TablePlugin.parameters={className:"GENTICS_Aloha_Table",classSelectionRow:"GENTICS_Aloha_Table_selectColumn",classSelectionColumn:"GENTICS_Aloha_Table_selectRow",classLeftUpperCorner:"GENTICS_Aloha_Table_leftUpperCorner",classTableWrapper:"GENTICS_Aloha_Table_wrapper",classCellSelected:"GENTICS_Aloha_Cell_selected",waiRed:"GENTICS_WAI_RED",waiGreen:"GENTICS_WAI_GREEN",selectionArea:10};GENTICS.Aloha.TablePlugin.init=function(){this.createLayer=new GENTICS.Aloha.Table.CreateLayer();var that=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableCreated",function(event,editable){editable.obj.bind("mousedown",function(jqEvent){GENTICS.Aloha.TablePlugin.setFocusedTable(undefined)});editable.obj.find("table").each(function(){if(that.isEditableTable(this)){var table=new GENTICS.Aloha.Table(this);table.parentEditable=editable;GENTICS.Aloha.TablePlugin.TableRegistry.push(table)}})});this.initTableButtons();GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(event,rangeObject){if(GENTICS.Aloha.activeEditable){var config=that.getEditableConfig(GENTICS.Aloha.activeEditable.obj);if(jQuery.inArray("table",config)!=-1&&GENTICS.Aloha.Selection.mayInsertTag("table")){that.createTableButton.show()}else{that.createTableButton.hide()}GENTICS.Aloha.TableHelper.unselectCells();var table=rangeObject.findMarkup(function(){return this.nodeName.toLowerCase()=="table"},GENTICS.Aloha.activeEditable.obj);if(table){GENTICS.Aloha.FloatingMenu.setScope(that.getUID(GENTICS.Aloha.TableHelper.selectionType))}else{if(that.activeTable){that.activeTable.focusOut()}}GENTICS.Aloha.FloatingMenu.doLayout()}});GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(event,props){props.editable.obj.find("table").each(function(){var tr=GENTICS.Aloha.TablePlugin.TableRegistry;for(var i=0;i<tr.length;i++){if(tr[i].obj.attr("id")==jQuery(this).attr("id")){tr[i].activate();return true}}if(that.isEditableTable(this)){var table=new GENTICS.Aloha.Table(this);table.parentEditable=props.editable;table.activate();GENTICS.Aloha.TablePlugin.TableRegistry.push(table)}})});GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableDeactivated",function(event,properties){GENTICS.Aloha.TablePlugin.setFocusedTable(undefined);GENTICS.Aloha.TableHelper.unselectCells();var tr=GENTICS.Aloha.TablePlugin.TableRegistry;for(var i=0;i<tr.length;i++){tr[i].deactivate()}})};GENTICS.Aloha.TablePlugin.isEditableTable=function(table){var parent=jQuery(table.parentNode);if(parent.contentEditable()=="true"){return true}else{return false}};GENTICS.Aloha.TablePlugin.initTableButtons=function(){var that=this;GENTICS.Aloha.FloatingMenu.createScope(this.getUID("row"),"GENTICS.Aloha.global");GENTICS.Aloha.FloatingMenu.createScope(this.getUID("column"),"GENTICS.Aloha.global");GENTICS.Aloha.FloatingMenu.createScope(this.getUID("cell"),"GENTICS.Aloha.continuoustext");this.createTableButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_table",size:"small",tooltip:this.i18n("button.createtable.tooltip"),onclick:function(element,event){GENTICS.Aloha.TablePlugin.createDialog(element.btnEl.dom)}});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.createTableButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("column"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addColumnLeft",size:"small",tooltip:this.i18n("button.addcolleft.tooltip"),onclick:function(){if(that.activeTable){that.activeTable.addColumnsLeft()}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("column"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addColumnRight",size:"small",tooltip:this.i18n("button.addcolright.tooltip"),onclick:function(){if(that.activeTable){that.activeTable.addColumnsRight()}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("column"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_deleteColumns",size:"small",tooltip:this.i18n("button.delcols.tooltip"),onclick:function(){if(that.activeTable){var aTable=that.activeTable;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(that,"Table"),text:GENTICS.Aloha.i18n(that,"deletecolumns.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(sel){if(sel=="yes"){aTable.deleteColumns()}}}))}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("row"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addRowBefore",size:"small",tooltip:this.i18n("button.addrowbefore.tooltip"),onclick:function(){if(that.activeTable){that.activeTable.addRowsBefore(true)}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("row"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addRowAfter",size:"small",tooltip:this.i18n("button.addrowafter.tooltip"),onclick:function(){if(that.activeTable){that.activeTable.addRowsAfter(true)}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("row"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_deleteRows",size:"small",tooltip:this.i18n("button.delrows.tooltip"),onclick:function(){if(that.activeTable){var aTable=that.activeTable;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(that,"Table"),text:GENTICS.Aloha.i18n(that,"deleterows.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(sel){if(sel=="yes"){aTable.deleteRows()}}}))}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);this.captionButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_table_caption",size:"small",tooltip:this.i18n("button.caption.tooltip"),toggle:true,onclick:function(){if(that.activeTable){if(that.activeTable.obj.children("caption").is("caption")){that.activeTable.obj.children("caption").remove()}else{var captionText=that.i18n("empty.caption");var c=jQuery("<caption></caption>");that.activeTable.obj.append(c);that.makeCaptionEditable(c,captionText);var cDiv=c.find("div").eq(0);var captionContent=cDiv.contents().eq(0);if(captionContent.length>0){var newRange=new GENTICS.Utils.RangeObject();newRange.startContainer=newRange.endContainer=captionContent.get(0);newRange.startOffset=0;newRange.endOffset=captionContent.text().length;that.activeTable.obj.find("div.GENTICS_Table_Cell_editable").blur();cDiv.focus();newRange.select();GENTICS.Aloha.Selection.updateSelection()}}}}});GENTICS.Aloha.FloatingMenu.addButton(this.getUID("cell"),this.captionButton,GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);this.summary=new GENTICS.Aloha.ui.AttributeField({width:350});this.summary.addListener("keyup",function(obj,event){that.activeTable.checkWai()});GENTICS.Aloha.FloatingMenu.addButton(this.getUID("cell"),this.summary,GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1)};GENTICS.Aloha.TablePlugin.makeCaptionEditable=function(caption,captionText){var that=this;var cSpan=caption.children("div").eq(0);if(cSpan.length==0){cSpan=jQuery("<div></div>");if(caption.contents().length>0){caption.contents().wrap(cSpan)}else{if(captionText){cSpan.text(captionText)}caption.append(cSpan)}}cSpan.contentEditable(true);cSpan.unbind("mousedown");cSpan.bind("mousedown",function(jqEvent){cSpan.focus();jqEvent.preventDefault();jqEvent.stopPropagation();return false})};GENTICS.Aloha.TablePlugin.createDialog=function(callingElement){this.createLayer.set("target",callingElement);this.createLayer.show()};GENTICS.Aloha.TablePlugin.createTable=function(cols,rows){if(GENTICS.Aloha.activeEditable!=null&&typeof GENTICS.Aloha.activeEditable.obj!="undefined"){var table=document.createElement("table");var tableId=table.id=GENTICS.Aloha.TableHelper.getNewTableID();var tbody=document.createElement("tbody");for(var i=0;i<rows;i++){var tr=document.createElement("tr");for(var j=0;j<cols;j++){var text=document.createTextNode("\u00a0");var td=document.createElement("td");td.appendChild(text);tr.appendChild(td)}tbody.appendChild(tr)}table.appendChild(tbody);GENTICS.Utils.Dom.insertIntoDOM(jQuery(table),GENTICS.Aloha.Selection.getRangeObject(),jQuery(GENTICS.Aloha.activeEditable.obj));var tableReloadedFromDOM=document.getElementById(tableId);var tableObj=new GENTICS.Aloha.Table(tableReloadedFromDOM);tableObj.parentEditable=GENTICS.Aloha.activeEditable;tableObj.activate();if(jQuery.browser.msie){window.setTimeout(function(){tableObj.cells[0].wrapper.get(0).focus()},20)}else{tableObj.cells[0].wrapper.get(0).focus()}GENTICS.Aloha.TablePlugin.TableRegistry.push(tableObj)}else{this.error("There is no active Editable where the table can be inserted!")}};GENTICS.Aloha.TablePlugin.setFocusedTable=function(focusTable){var that=this;for(var i=0;i<GENTICS.Aloha.TablePlugin.TableRegistry.length;i++){GENTICS.Aloha.TablePlugin.TableRegistry[i].hasFocus=false}if(typeof focusTable!="undefined"){this.summary.setTargetObject(focusTable.obj,"summary");if(focusTable.obj.children("caption").is("caption")){that.captionButton.setPressed(true);var c=focusTable.obj.children("caption");that.makeCaptionEditable(c)}focusTable.hasFocus=true}GENTICS.Aloha.TablePlugin.activeTable=focusTable};GENTICS.Aloha.TablePlugin.error=function(msg){GENTICS.Aloha.Log.error(this,msg)};GENTICS.Aloha.TablePlugin.debug=function(msg){GENTICS.Aloha.Log.debug(this,msg)};GENTICS.Aloha.TablePlugin.info=function(msg){GENTICS.Aloha.Log.info(this,msg)};GENTICS.Aloha.TablePlugin.log=function(msg){GENTICS.Aloha.log("log",this,msg)};GENTICS.Aloha.TablePlugin.get=function(property){if(this.config[property]){return this.config[property]}if(this.parameters[property]){return this.parameters[property]}return undefined};GENTICS.Aloha.TablePlugin.set=function(key,value){if(this.config[key]){this.config[key]=value}else{this.parameters[key]=value}};GENTICS.Aloha.TablePlugin.makeClean=function(obj){obj.find("table").each(function(){var table=new GENTICS.Aloha.Table(this);table.deactivate()})};GENTICS.Aloha.TablePlugin.toString=function(){return this.prefix};GENTICS.Aloha.Table=function(table){this.obj=jQuery(table);if(!this.obj.attr("id")){this.obj.attr("id",GENTICS.Utils.guid())}var rows=this.obj.find("tr");var firstRow=jQuery(rows.get(0));this.numCols=firstRow.children("td, th").length;this.numRows=rows.length;this.cells=new Array();var rows=this.obj.find("tr");for(var i=0;i<rows.length;i++){var row=jQuery(rows[i]);var cols=row.children();for(var j=0;j<cols.length;j++){var col=cols[j];var Cell=new GENTICS.Aloha.Table.Cell(col,this);this.cells.push(Cell)}}};GENTICS.Aloha.Table.prototype.obj=undefined;GENTICS.Aloha.Table.prototype.tableWrapper=undefined;GENTICS.Aloha.Table.prototype.cells=undefined;GENTICS.Aloha.Table.prototype.numRows=undefined;GENTICS.Aloha.Table.prototype.numCols=undefined;GENTICS.Aloha.Table.prototype.isActive=false;GENTICS.Aloha.Table.prototype.hasFocus=false;GENTICS.Aloha.Table.prototype.parentEditable=undefined;GENTICS.Aloha.Table.prototype.mousedown=false;GENTICS.Aloha.Table.prototype.clickedColumnId=-1;GENTICS.Aloha.Table.prototype.clickedRowId=-1;GENTICS.Aloha.Table.prototype.columnsToSelect=new Array();GENTICS.Aloha.Table.prototype.rowsToSelect=new Array();GENTICS.Aloha.Table.prototype.fmPluginId=undefined;GENTICS.Aloha.Table.prototype.get=function(property){return GENTICS.Aloha.TablePlugin.get(property)};GENTICS.Aloha.Table.prototype.set=function(key,value){GENTICS.Aloha.TablePlugin.set(key,value)};GENTICS.Aloha.Table.prototype.activate=function(){if(this.isActive){return}var that=this;this.obj.addClass(this.get("className"));this.obj.contentEditable(false);if(this.obj.attr("id")==""){this.obj.attr("id",GENTICS.Aloha.TableHelper.getNewTableID())}GENTICS.Aloha.TableHelper.selectionType=undefined;this.obj.bind("keydown",function(jqEvent){if(!jqEvent.ctrlKey&&!jqEvent.shiftKey){if(GENTICS.Aloha.TableHelper.selectedCells.length>0&&GENTICS.Aloha.TableHelper.selectedCells[0].length>0){GENTICS.Aloha.TableHelper.selectedCells[0][0].firstChild.focus()}}});this.obj.bind("mousedown",function(jqEvent){if(!that.hasFocus){that.focus()}jqEvent.stopPropagation();jqEvent.preventDefault();return false});var tableWrapper=jQuery('<div class="'+this.get("classTableWrapper")+'"></div>');tableWrapper.contentEditable(false);this.obj.wrap(tableWrapper);var htmlTableWrapper=this.obj.parents("."+this.get("classTableWrapper"));htmlTableWrapper.get(0).onresizestart=function(e){return false};htmlTableWrapper.get(0).oncontrolselect=function(e){return false};this.tableWrapper=this.obj.parents("."+this.get("classTableWrapper")).get(0);jQuery(this.cells).each(function(){this.activate()});this.attachSelectionColumn();this.attachSelectionRow();this.attachLastCellEvents();this.makeCaptionEditable();this.checkWai();this.isActive=true;GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("tableActivated",GENTICS.Aloha,[this]))};GENTICS.Aloha.Table.prototype.makeCaptionEditable=function(){var caption=this.obj.find("caption").eq(0);if(caption){GENTICS.Aloha.TablePlugin.makeCaptionEditable(caption)}};GENTICS.Aloha.Table.prototype.checkWai=function(){var w=this.wai;w.removeClass(this.get("waiGreen"));w.removeClass(this.get("waiRed"));if(this.obj[0].summary.length>5){w.addClass(this.get("waiGreen"))}else{w.addClass(this.get("waiRed"))}};GENTICS.Aloha.Table.prototype.attachSelectionColumn=function(){var emptyCell=jQuery("<td>");emptyCell.html("\u00a0");var that=this;var rows=this.obj.context.rows;for(var i=0;i<rows.length;i++){var rowObj=jQuery(rows[i]);var columnToInsert=emptyCell.clone();columnToInsert.addClass(this.get("classSelectionColumn"));columnToInsert.css("width",this.get("selectionArea")+"px");rowObj.find("td:first").before(columnToInsert);var rowIndex=i+1;this.attachRowSelectionEventsToCell(columnToInsert)}};GENTICS.Aloha.Table.prototype.attachRowSelectionEventsToCell=function(cell){var that=this;cell.unbind("mousedown");cell.unbind("mouseover");cell.get(0).onselectstart=function(){return false};cell.bind("mousedown",function(e){that.mousedown=true;return that.rowSelectionMouseDown(e)});cell.bind("mouseover",function(e){if(that.mousedown){return that.rowSelectionMouseOver(e)}})};GENTICS.Aloha.Table.prototype.rowSelectionMouseDown=function(jqEvent){this.focus();if(GENTICS.Aloha.TableHelper.selectedCells.length==0){this.rowsToSelect=new Array()}this.clickedRowId=jqEvent.currentTarget.parentNode.rowIndex;if(jqEvent.metaKey){var arrayIndex=jQuery.inArray(this.clickedRowId,this.rowsToSelect);if(arrayIndex>=0){this.rowsToSelect.splice(arrayIndex,1)}else{this.rowsToSelect.push(this.clickedRowId)}}else{if(jqEvent.shiftKey){this.rowsToSelect.sort(function(a,b){return a-b});var start=this.rowsToSelect[0];var end=this.clickedRowId;if(start>end){start=end;end=this.rowsToSelect[0]}this.rowsToSelect=new Array();for(var i=start;i<=end;i++){this.rowsToSelect.push(i)}}else{this.rowsToSelect=[this.clickedRowId]}}this.selectRows();jqEvent.preventDefault();jqEvent.stopPropagation();return false};GENTICS.Aloha.Table.prototype.rowSelectionMouseOver=function(jqEvent){var rowIndex=jqEvent.currentTarget.parentNode.rowIndex;if(this.mousedown&&this.clickedRowId>=0){var indexInArray=jQuery.inArray(rowIndex,this.rowsToSelect);var start=(rowIndex<this.clickedRowId)?rowIndex:this.clickedRowId;var end=(rowIndex<this.clickedRowId)?this.clickedRowId:rowIndex;this.rowsToSelect=new Array();for(var i=start;i<=end;i++){this.rowsToSelect.push(i)}this.selectRows();jqEvent.preventDefault();jqEvent.stopPropagation();return false}};GENTICS.Aloha.Table.prototype.attachSelectionRow=function(){var that=this;var emptyCell=jQuery("<td>");emptyCell.html("\u00a0");var numColumns=this.obj.context.rows[0].cells.length;var selectionRow=jQuery("<tr>");selectionRow.addClass(this.get("classSelectionRow"));selectionRow.css("height",this.get("selectionArea")+"px");for(var i=0;i<numColumns;i++){var columnToInsert=emptyCell.clone();if(i>0){this.attachColumnSelectEventsToCell(columnToInsert)}else{var columnToInsert=jQuery("<td>").clone();columnToInsert.addClass(this.get("classLeftUpperCorner"));this.wai=jQuery("<div/>");this.wai.width(25);this.wai.height(12);this.wai.click(function(e){that.focus();GENTICS.Aloha.FloatingMenu.userActivatedTab=GENTICS.Aloha.TablePlugin.i18n("floatingmenu.tab.table");GENTICS.Aloha.FloatingMenu.doLayout();GENTICS.Aloha.TablePlugin.summary.focus();e.stopPropagation();e.preventDefault();return false});columnToInsert.append(this.wai)}selectionRow.append(columnToInsert)}jQuery(document).bind("mouseup",function(e){that.mousedown=false;that.clickedColumnId=-1;that.clickedRowId=-1});this.obj.find("tr:first").before(selectionRow)};GENTICS.Aloha.Table.prototype.attachColumnSelectEventsToCell=function(cell){var that=this;cell.unbind("mousedown");cell.unbind("mouseover");cell.get(0).onselectstart=function(){return false};cell.bind("mousedown",function(e){that.mousedown=true;that.columnSelectionMouseDown(e)});cell.bind("mouseover",function(e){if(that.mousedown){that.columnSelectionMouseOver(e)}})};GENTICS.Aloha.Table.prototype.columnSelectionMouseDown=function(jqEvent){this.focus();if(GENTICS.Aloha.TableHelper.selectedCells.length==0){this.columnsToSelect=new Array()}this.clickedColumnId=jqEvent.currentTarget.cellIndex;if(jqEvent.metaKey){var arrayIndex=jQuery.inArray(this.clickedColumnId,this.columnsToSelect);if(arrayIndex>=0){this.columnsToSelect.splice(arrayIndex,1)}else{this.columnsToSelect.push(this.clickedColumnId)}}else{if(jqEvent.shiftKey){this.columnsToSelect.sort(function(a,b){return a-b});var start=this.columnsToSelect[0];var end=this.clickedColumnId;if(start>end){start=end;end=this.columnsToSelect[0]}this.columnsToSelect=new Array();for(var i=start;i<=end;i++){this.columnsToSelect.push(i)}}else{this.columnsToSelect=[this.clickedColumnId]}}this.selectColumns();jqEvent.preventDefault();jqEvent.stopPropagation();return false};GENTICS.Aloha.Table.prototype.columnSelectionMouseOver=function(jqEvent){var colIndex=jqEvent.currentTarget.cellIndex;if(this.mousedown&&this.clickedColumnId>0){var indexInArray=jQuery.inArray(colIndex,this.columnsToSelect);var start=(colIndex<this.clickedColumnId)?colIndex:this.clickedColumnId;var end=(colIndex<this.clickedColumnId)?this.clickedColumnId:colIndex;this.columnsToSelect=new Array();for(var i=start;i<=end;i++){this.columnsToSelect.push(i)}this.selectColumns()}};GENTICS.Aloha.Table.prototype.releaseLastCellEvents=function(){this.obj.find("tr:last td:last").unbind()};GENTICS.Aloha.Table.prototype.attachLastCellEvents=function(){var that=this;this.obj.find("tr:last td:last").bind("keydown",function(jqEvent){that.lastCellKeyDown(jqEvent)})};GENTICS.Aloha.Table.prototype.lastCellKeyDown=function(jqEvent){var KEYCODE_TAB=9;if(KEYCODE_TAB==jqEvent.keyCode&&!jqEvent.altKey&&!jqEvent.shiftKey&&!jqEvent.ctrlKey){this.addRowsAfter(false);jqEvent.stopPropagation();if(jQuery.browser.msie){this.obj.find("tr:last td:nth-child(1) div.GENTICS_Table_Cell_editable").get(0).focus();return false}}};GENTICS.Aloha.Table.prototype.deleteRows=function(){var rowIDs=new Array();var deleteTable=false;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){for(var i=0;i<GENTICS.Aloha.TableHelper.selectedCells.length;i++){rowIDs.push(GENTICS.Aloha.TableHelper.selectedCells[i][0].parentNode.rowIndex)}}else{if(typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"){rowIDs.push(GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.parentNode.rowIndex)}}if(rowIDs.length==this.numRows){deleteTable=true}if(deleteTable){var that=this;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"Table"),text:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"deletetable.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(sel){if(sel=="yes"){that.deleteTable()}}}))}else{rowIDs.sort(function(a,b){return a-b});var focusRowId=rowIDs[0];if(focusRowId>(this.numRows-rowIDs.length)){focusRowId--}this.releaseLastCellEvents();var rows=this.obj.find("tr");var rows2delete=new Array();for(var i=0;i<rowIDs.length;i++){rows2delete.push(jQuery(rows[rowIDs[i]]))}for(var i=0;i<rows2delete.length;i++){var cols=rows2delete[i].children("td").toArray();for(var j=0;j<cols.length;j++){for(var m=0;m<this.cells.length;m++){if(cols[j]==this.cells[m].obj.get(0)){this.cells.splice(m,1);m=this.cells.length}}}}for(var i=0;i<rows2delete.length;i++){rows2delete[i].remove()}this.numRows-=rows2delete.length;if(jQuery.browser.msie){setTimeout(this.obj.find("tr:nth-child("+(focusRowId+1)+") td:nth-child(2) div.GENTICS_Table_Cell_editable").get(0).focus,5)}else{this.obj.find("tr:nth-child("+(focusRowId+1)+") td:nth-child(2) div.GENTICS_Table_Cell_editable").get(0).focus()}this.attachLastCellEvents();GENTICS.Aloha.TableHelper.unselectCells()}};GENTICS.Aloha.Table.prototype.deleteColumns=function(){var colIDs=new Array();var deleteTable=false;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){for(var i=0;i<GENTICS.Aloha.TableHelper.selectedCells[0].length;i++){colIDs.push(GENTICS.Aloha.TableHelper.selectedCells[0][i].cellIndex)}}else{if(typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"){colIDs.push(GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.cellIndex)}}if(colIDs.length==this.numCols){deleteTable=true}if(deleteTable){var that=this;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"Table"),text:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"deletetable.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(sel){if(sel=="yes"){that.deleteTable()}}}))}else{colIDs.sort(function(a,b){return a-b});var focusColID=colIDs[0];if(focusColID>(this.numCols-colIDs.length)){focusColID--}this.releaseLastCellEvents();var rows=this.obj.find("tr");var cols2delete=new Array();for(var i=0;i<rows.length;i++){var cells=jQuery(rows[i]).children("td").toArray();for(var j=0;j<colIDs.length;j++){cols2delete.push(cells[colIDs[j]])}}for(var i=0;i<cols2delete.length;i++){for(var j=0;j<this.cells.length;j++){if(cols2delete[i]==this.cells[j].obj.get(0)){this.cells.splice(j,1);j=this.cells.length}}}for(var i=0;i<cols2delete.length;i++){jQuery(cols2delete[i]).remove()}this.numCols-=colIDs.length;if(jQuery.browser.msie){setTimeout(this.obj.find("tr:nth-child(2) td:nth-child("+(focusColID+1)+") div.GENTICS_Table_Cell_editable").get(0).focus,5)}else{this.obj.find("tr:nth-child(2) td:nth-child("+(focusColID+1)+") div.GENTICS_Table_Cell_editable").get(0).focus()}this.attachLastCellEvents();GENTICS.Aloha.TableHelper.unselectCells()}};GENTICS.Aloha.Table.prototype.deleteTable=function(){var deleteIndex=-1;for(var i=0;i<GENTICS.Aloha.TablePlugin.TableRegistry.length;i++){if(GENTICS.Aloha.TablePlugin.TableRegistry[i].obj.attr("id")==this.obj.attr("id")){deleteIndex=i;break}}if(deleteIndex>=0){this.deactivate();GENTICS.Aloha.TableHelper.selectionType=undefined;GENTICS.Aloha.TablePlugin.TableRegistry.splice(i,1);var newRange=GENTICS.Aloha.Selection.rangeObject;newRange.startContainer=newRange.endContainer=this.obj.get(0).parentNode;newRange.startOffset=newRange.endOffset=GENTICS.Utils.Dom.getIndexInParent(this.obj.get(0).parentNode);newRange.clearCaches();this.obj.remove();this.parentEditable.obj.focus();newRange.correctRange();newRange.select()}};GENTICS.Aloha.Table.prototype.addRowsBefore=function(highlightNewRows){this.addRows("before",highlightNewRows)};GENTICS.Aloha.Table.prototype.addRowsAfter=function(highlightNewRows){this.addRows("after",highlightNewRows)};GENTICS.Aloha.Table.prototype.addRows=function(position,highlightNewRows){if(typeof GENTICS.Aloha.TablePlugin.activeTable!="undefined"){this.releaseLastCellEvents();var that=this;var numCols=this.numCols;var rowsToInsert=1;var rowId=1;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){rowsToInsert=GENTICS.Aloha.TableHelper.selectedCells.length;switch(position){case"before":if(GENTICS.Aloha.TableHelper.selectedCells[0].length){rowId=GENTICS.Aloha.TableHelper.selectedCells[0][0].parentNode.rowIndex}break;case"after":var lastRow=GENTICS.Aloha.TableHelper.selectedCells.length-1;if(GENTICS.Aloha.TableHelper.selectedCells[lastRow].length){rowId=GENTICS.Aloha.TableHelper.selectedCells[lastRow][0].parentNode.rowIndex}break}}else{if(typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"){rowId=GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.parentNode.rowIndex}}var newRowIndex=rowId;if(position=="after"){newRowIndex+=1}var rowIdArray=new Array();for(var j=0;j<rowsToInsert;j++){rowIdArray.push(newRowIndex);var insertionRow=jQuery("<tr>");var selectionColumn=jQuery("<td>");selectionColumn.addClass(this.get("classSelectionColumn"));this.attachRowSelectionEventsToCell(selectionColumn);insertionRow.append(selectionColumn);for(i=0;i<numCols;i++){var newCol=jQuery("<td>");newCol.html("\u00a0");var cell=new GENTICS.Aloha.Table.Cell(newCol.get(0),GENTICS.Aloha.TablePlugin.activeTable);cell.activate();this.cells.push(cell);insertionRow.append(cell.obj)}var currentRow=jQuery(GENTICS.Aloha.TablePlugin.activeTable.obj.find("tr").get(rowId));switch(position){case"before":currentRow.before(insertionRow);break;case"after":currentRow.after(insertionRow);break;default:this.warn(this,"Wrong call of GENTICS.Aloha.Table.prototype.addRow!")}newRowIndex++;this.numRows++}GENTICS.Aloha.TableHelper.unselectCells();this.rowsToSelect=rowIdArray;if(highlightNewRows){this.selectRows()}this.attachLastCellEvents()}};GENTICS.Aloha.Table.prototype.addColumnsRight=function(){this.addColumns("right")};GENTICS.Aloha.Table.prototype.addColumnsLeft=function(){this.addColumns("left")};GENTICS.Aloha.Table.prototype.addColumns=function(position){if(typeof GENTICS.Aloha.TablePlugin.activeTable!="undefined"){this.releaseLastCellEvents();var that=this;var columnsToInsert=1;var colId=1;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){columnsToInsert=GENTICS.Aloha.TableHelper.selectedCells[0].length;switch(position){case"left":if(GENTICS.Aloha.TableHelper.selectedCells[0].length){colId=GENTICS.Aloha.TableHelper.selectedCells[0][0].cellIndex}break;case"right":var lastColumn=GENTICS.Aloha.TableHelper.selectedCells[0].length-1;if(GENTICS.Aloha.TableHelper.selectedCells[0].length){colId=GENTICS.Aloha.TableHelper.selectedCells[0][lastColumn].cellIndex}break}}else{if(typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"){colId=GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.cellIndex}}var newColId=colId;var emptyCell=jQuery("<td>");var rows=this.obj.find("tr");var colIdArray=new Array();for(var i=0;i<rows.length;i++){var currentColId=newColId;var row=rows[i];for(var j=0;j<columnsToInsert;j++){var cell=emptyCell.clone();cell.html("\u00a0");if(i==0){this.attachColumnSelectEventsToCell(cell)}else{cellObj=new GENTICS.Aloha.Table.Cell(cell.get(0),GENTICS.Aloha.TablePlugin.activeTable);this.cells.push(cellObj);cellObj.activate();cell=cellObj.obj}var insertionColumn=jQuery(jQuery(row).find("td").get(newColId));switch(position){case"left":if(jQuery.inArray(currentColId,colIdArray)<0){colIdArray.push(currentColId)}insertionColumn.before(cell);break;case"right":if(jQuery.inArray((currentColId+1),colIdArray)<0){colIdArray.push(currentColId+1)}insertionColumn.after(cell);break}currentColId++}}this.numCols+=columnsToInsert;GENTICS.Aloha.TableHelper.unselectCells();this.columnsToSelect=colIdArray;this.selectColumns();this.attachLastCellEvents()}};GENTICS.Aloha.Table.prototype.focus=function(){if(!this.hasFocus){if(!this.parentEditable.isActive){this.parentEditable.obj.focus()}GENTICS.Aloha.TablePlugin.setFocusedTable(this)}};GENTICS.Aloha.Table.prototype.focusOut=function(){if(this.hasFocus){GENTICS.Aloha.TablePlugin.setFocusedTable(undefined);GENTICS.Aloha.TableHelper.selectionType=undefined}};GENTICS.Aloha.Table.prototype.selectColumns=function(){var selectClass=this.get("classCellSelected");GENTICS.Aloha.TableHelper.unselectCells();GENTICS.Aloha.TableHelper.selectionType="column";GENTICS.Aloha.FloatingMenu.setScope(GENTICS.Aloha.TablePlugin.getUID("column"));this.columnsToSelect.sort(function(a,b){return a-b});var rows=this.obj.find("tr").toArray();rows.shift();var toSelect=new Array();for(var i=0;i<rows.length;i++){var rowCells=rows[i].cells;var selectedCellsInCol=new Array();for(var j=0;j<this.columnsToSelect.length;j++){var colIndex=this.columnsToSelect[j];var cell=rowCells[colIndex];toSelect.push(cell);selectedCellsInCol.push(cell)}GENTICS.Aloha.TableHelper.selectedCells.push(selectedCellsInCol)}this.obj.find("div.GENTICS_Table_Cell_editable").blur();jQuery(toSelect).addClass(selectClass)};GENTICS.Aloha.Table.prototype.selectRows=function(){var selectClass=this.get("classCellSelected");GENTICS.Aloha.TableHelper.unselectCells();this.rowsToSelect.sort(function(a,b){return a-b});for(var i=0;i<this.rowsToSelect.length;i++){var rowId=this.rowsToSelect[i];var rowCells=jQuery(this.obj.find("tr").get(rowId).cells).toArray();rowCells.shift();GENTICS.Aloha.TableHelper.selectedCells.push(rowCells);jQuery(rowCells).addClass(this.get("classCellSelected"))}GENTICS.Aloha.TableHelper.selectionType="row";GENTICS.Aloha.FloatingMenu.setScope(GENTICS.Aloha.TablePlugin.getUID("row"));this.obj.find("div.GENTICS_Table_Cell_editable").blur()};GENTICS.Aloha.Table.prototype.deactivate=function(){this.obj.removeClass(this.get("className"));if(GENTICS.Aloha.trim(this.obj.attr("class"))==""){this.obj.removeAttr("class")}if(this.obj.parents("."+this.get("classTableWrapper")).length){this.obj.unwrap()}this.obj.find("tr."+this.get("classSelectionRow")+":first").remove();var that=this;jQuery.each(this.obj.context.rows,function(){jQuery(this).children("td."+that.get("classSelectionColumn")).remove()});this.obj.find("td, th").removeClass(this.get("classCellSelected"));this.obj.unbind();for(var i=0;i<this.cells.length;i++){var Cell=this.cells[i];Cell.deactivate()}this.obj.find("caption div").each(function(){jQuery(this).contents().unwrap()});this.isActive=false};GENTICS.Aloha.Table.prototype.toString=function(){return"GENTICS.Aloha.Table"};GENTICS.Aloha.Table.Cell=function(originalTd,tableObj){this.obj=jQuery(originalTd);this.tableObj=tableObj};GENTICS.Aloha.Table.Cell.prototype.tableObj=undefined;GENTICS.Aloha.Table.Cell.prototype.obj=undefined;GENTICS.Aloha.Table.Cell.prototype.wrapper=undefined;GENTICS.Aloha.Table.Cell.prototype.hasFocus=false;GENTICS.Aloha.Table.Cell.activeCell=undefined;GENTICS.Aloha.Table.Cell.lastActiveCell=undefined;GENTICS.Aloha.Table.Cell.prototype.editableFocus=function(e){if(!this.hasFocus){this.tableObj.focus();GENTICS.Aloha.Table.Cell.activeCell=this;GENTICS.Aloha.Table.Cell.lastActiveCell=this;this.obj.addClass("GENTICS_Table_Cell_active");this.hasFocus=true;this.selectAll(this.wrapper.get(0));GENTICS.Aloha.TableHelper.selectionType="cell"}};GENTICS.Aloha.Table.Cell.prototype.editableBlur=function(jqEvent){GENTICS.Aloha.Table.Cell.activeCell=undefined;this.hasFocus=false;this.obj.removeClass("GENTICS_Table_Cell_active")};GENTICS.Aloha.Table.Cell.prototype.activate=function(){this.obj.wrapInner("<div/>");var wrapper=this.obj.children("div").eq(0);wrapper.contentEditable(true);wrapper.addClass("GENTICS_Table_Cell_editable");var that=this;wrapper.bind("focus",function(jqEvent){if(jqEvent.currentTarget){jqEvent.currentTarget.indexOf=function(){return -1}}that.editableFocus(jqEvent)});wrapper.bind("mousedown",function(jqEvent){if(jqEvent.currentTarget){jqEvent.currentTarget.indexOf=function(){return -1}}that.editableMouseDown(jqEvent)});wrapper.bind("blur",function(jqEvent){that.editableBlur(jqEvent)});wrapper.bind("keyup",function(jqEvent){that.editableKeyUp(jqEvent)});wrapper.bind("keydown",function(jqEvent){that.editableKeyDown(jqEvent)});wrapper.GENTICS_contentEditableSelectionChange(function(event){GENTICS.Aloha.Selection.onChange(wrapper,event);return wrapper});this.obj.bind("mousedown",function(jqEvent){setTimeout(function(){that.wrapper.trigger("focus")},1);GENTICS.Aloha.TableHelper.unselectCells();jqEvent.stopPropagation()});this.obj.get(0).onselectstart=function(jqEvent){return false};this.wrapper=this.obj.children();this.wrapper.get(0).onselectstart=function(){window.event.cancelBubble=true};return this};GENTICS.Aloha.Table.Cell.prototype.deactivate=function(){var wrapper=this.obj.children(".GENTICS_Table_Cell_editable");if(wrapper.length){var innerHtml=wrapper.html();wrapper.unbind();wrapper.remove();this.obj.unbind("click");if(GENTICS.Aloha.trim(this.obj.attr("class"))==""){this.obj.removeAttr("class")}this.obj.html(innerHtml)}};GENTICS.Aloha.Table.Cell.prototype.toString=function(){return"GENTICS.Aloha.Table.Cell"};GENTICS.Aloha.Table.Cell.prototype.selectAll=function(editableNode){var e=(editableNode.jquery)?editableNode.get(0):editableNode;if(!jQuery.browser.msie){var s=window.getSelection();if(s.setBaseAndExtent){s.setBaseAndExtent(e,0,e,e.innerText.length-1)}else{if(window.opera&&e.innerHTML.substring(e.innerHTML.length-4)=="<BR>"){e.innerHTML=e.innerHTML+"&#160;"}var r=document.createRange();r.selectNodeContents(e);s.removeAllRanges();s.addRange(r)}}else{if(document.getSelection){var s=document.getSelection();var r=document.createRange();r.selectNodeContents(e);s.removeAllRanges();s.addRange(r)}else{if(document.selection){var r=document.body.createTextRange();r.moveToElementText(e);r.select()}}}GENTICS.Aloha.Selection.updateSelection(editableNode)};GENTICS.Aloha.Table.Cell.prototype.editableMouseDown=function(jqEvent){GENTICS.Aloha.TableHelper.unselectCells();if(this.tableObj.hasFocus){jqEvent.stopPropagation()}};GENTICS.Aloha.Table.Cell.prototype.editableKeyUp=function(jqEvent){this.checkForEmptyEvent(jqEvent)};GENTICS.Aloha.Table.Cell.prototype.editableKeyDown=function(jqEvent){this.checkForEmptyEvent(jqEvent);if(!jqEvent.ctrlKey&&!jqEvent.shiftKey){if(GENTICS.Aloha.TableHelper.selectedCells.length>0&&GENTICS.Aloha.TableHelper.selectedCells[0].length>0){GENTICS.Aloha.TableHelper.selectedCells[0][0].firstChild.focus();GENTICS.Aloha.TableHelper.unselectCells();jqEvent.stopPropagation()}}else{if(jqEvent.shiftKey&&GENTICS.Aloha.TableHelper.selectedCells.length>0){var KEYCODE_ARROWLEFT=37;var KEYCODE_ARROWUP=38;var KEYCODE_ARROWRIGHT=39;var KEYCODE_ARROWDOWN=40;switch(GENTICS.Aloha.TableHelper.selectionType){case"row":switch(jqEvent.keyCode){case KEYCODE_ARROWUP:var firstSelectedRow=GENTICS.Aloha.TableHelper.selectedCells[0][0].parentNode.rowIndex;if(firstSelectedRow>1){this.tableObj.rowsToSelect.push(firstSelectedRow-1)}break;case KEYCODE_ARROWDOWN:var lastRowIndex=GENTICS.Aloha.TableHelper.selectedCells.length-1;var lastSelectedRow=GENTICS.Aloha.TableHelper.selectedCells[lastRowIndex][0].parentNode.rowIndex;if(lastSelectedRow<this.tableObj.numRows){this.tableObj.rowsToSelect.push(lastSelectedRow+1)}break}this.tableObj.selectRows();break;case"column":switch(jqEvent.keyCode){case KEYCODE_ARROWLEFT:var firstColSelected=GENTICS.Aloha.TableHelper.selectedCells[0][0].cellIndex;if(firstColSelected>1){this.tableObj.columnsToSelect.push(firstColSelected-1)}break;case KEYCODE_ARROWRIGHT:var lastColIndex=GENTICS.Aloha.TableHelper.selectedCells[0].length-1;var lastColSelected=GENTICS.Aloha.TableHelper.selectedCells[0][lastColIndex].cellIndex;if(lastColSelected<this.tableObj.numCols){this.tableObj.columnsToSelect.push(lastColSelected+1)}break}this.tableObj.selectColumns();break}jqEvent.stopPropagation();jqEvent.preventDefault();return false}}};GENTICS.Aloha.Table.Cell.prototype.checkForEmptyEvent=function(jqEvent){if(jQuery(this.wrapper).children().length>0){return}var text=this.wrapper.text();if(text==""){this.wrapper.text("\u00a0");this.wrapper.get(0).blur();this.wrapper.get(0).focus()}};GENTICS.Aloha.Table.CreateLayer=function(){};GENTICS.Aloha.Table.CreateLayer.prototype.parameters={elemId:"GENTICS_Aloha_Table_createLayer",className:"GENTICS_Table_Createdialog",numX:10,numY:10,layer:undefined,target:undefined};GENTICS.Aloha.Table.CreateLayer.prototype.config=new Object();GENTICS.Aloha.Table.CreateLayer.prototype.visible=false;GENTICS.Aloha.Table.CreateLayer.prototype.show=function(){var layer=this.get("layer");if(layer==null){this.create()}else{this.setPosition(layer);layer.find("td").removeClass("hover");layer.show()}this.visible=true};GENTICS.Aloha.Table.CreateLayer.prototype.create=function(){var that=this;var layer=jQuery("<div></div>");layer.id=this.get("elemId");layer.addClass(this.get("className"));var table=jQuery("<table></table>");table.css("width",(this.get("numX")+6)*15);var tr;var td;for(var i=0;i<this.get("numY");i++){tr=jQuery("<tr></tr>");for(var j=0;j<this.get("numX");j++){td=jQuery("<td>\u00a0</td>");if(i==0&&j==0){td.addClass("hover")}td.bind("mouseover",{rowId:i,colId:j},function(e){that.handleMouseOver(e,table)});td.bind("click",{rowId:i,colId:j},function(e){var rows=e.data.rowId+1;var cols=e.data.colId+1;GENTICS.Aloha.TablePlugin.createTable(cols,rows);that.hide()});tr.append(td)}table.append(tr)}layer.append(table);this.set("layer",layer);this.setPosition();layer.bind("click",function(e){e.stopPropagation()}).mousedown(function(e){e.stopPropagation()});jQuery("body").append(layer).bind("click",function(e){if(e.target!=that.get("target")&&that.visible){that.hide()}})};GENTICS.Aloha.Table.CreateLayer.prototype.handleMouseOver=function(e,table){var rowId=e.data.rowId;var colId=e.data.colId;var innerRows=table.find("tr");for(var n=0;n<=innerRows.length;n++){var innerCells=jQuery(innerRows[n]).find("td");for(var k=0;k<=innerCells.length;k++){if(n<=rowId&&k<=colId){jQuery(innerCells[k]).addClass("hover")}else{jQuery(innerCells[k]).removeClass("hover")}}}};GENTICS.Aloha.Table.CreateLayer.prototype.setPosition=function(){var targetObj=jQuery(this.get("target"));var pos=targetObj.offset();this.get("layer").css("left",pos.left+"px");this.get("layer").css("top",(pos.top+targetObj.height())+"px")};GENTICS.Aloha.Table.CreateLayer.prototype.hide=function(){this.get("layer").hide();this.visible=false};GENTICS.Aloha.Table.CreateLayer.prototype.get=function(property){if(this.config[property]){return this.config[property]}if(this.parameters[property]){return this.parameters[property]}return undefined};GENTICS.Aloha.Table.CreateLayer.prototype.set=function(key,value){if(this.config[key]){this.config[key]=value}else{this.parameters[key]=value}};GENTICS.Aloha.TableHelper=function(){};GENTICS.Aloha.TableHelper.prototype.selectionType=undefined;GENTICS.Aloha.TableHelper.prototype.selectedCells=new Array();GENTICS.Aloha.TableHelper.prototype.unselectCells=function(){if(this.selectedCells.length>0){for(var i=0;i<this.selectedCells.length;i++){jQuery(this.selectedCells[i]).removeClass(GENTICS.Aloha.TablePlugin.get("classCellSelected"))}this.selectedCells=new Array();this.selectionType=undefined}};GENTICS.Aloha.TableHelper.prototype.getNewTableID=function(){var idPrefix="GENTICS_Table_";var factor=1000000;for(this.tableCounter;true;this.tableCounter++){var id=idPrefix+(Math.ceil(Math.random()*factor));for(var j=id.length;j<idPrefix.length+factor.toString().length;j++){id+="0"}if(!jQuery("#"+id).length){return id}}};GENTICS.Aloha.TableHelper=new GENTICS.Aloha.TableHelper();
7
+ GENTICS.Aloha.TablePlugin=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Table");GENTICS.Aloha.TablePlugin.createLayer=undefined;GENTICS.Aloha.TablePlugin.languages=["en","de","fr","eo","fi","ru","it"];GENTICS.Aloha.TablePlugin.config=["table"];GENTICS.Aloha.TablePlugin.TableRegistry=new Array();GENTICS.Aloha.TablePlugin.activeTable=undefined;GENTICS.Aloha.TablePlugin.parameters={className:"GENTICS_Aloha_Table",classSelectionRow:"GENTICS_Aloha_Table_selectColumn",classSelectionColumn:"GENTICS_Aloha_Table_selectRow",classLeftUpperCorner:"GENTICS_Aloha_Table_leftUpperCorner",classTableWrapper:"GENTICS_Aloha_Table_wrapper",classCellSelected:"GENTICS_Aloha_Cell_selected",selectionArea:10};GENTICS.Aloha.TablePlugin.config=new Object();GENTICS.Aloha.TablePlugin.init=function(){this.createLayer=new GENTICS.Aloha.Table.CreateLayer();var that=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableCreated",function(event,editable){editable.obj.bind("mousedown",function(jqEvent){GENTICS.Aloha.TablePlugin.setFocusedTable(undefined)});editable.obj.find("table").each(function(){if(that.isEditableTable(this)){var table=new GENTICS.Aloha.Table(this);table.parentEditable=editable;table.activate();GENTICS.Aloha.TablePlugin.TableRegistry.push(table)}})});this.initTableButtons();GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(event,properties){if(GENTICS.Aloha.activeEditable){var config=that.getEditableConfig(GENTICS.Aloha.activeEditable.obj);if(jQuery.inArray("table",config)!=-1&&GENTICS.Aloha.Selection.mayInsertTag("table")){that.createTableButton.show()}else{that.createTableButton.hide()}if(typeof GENTICS.Aloha.TableHelper.selectionType!=undefined){GENTICS.Aloha.FloatingMenu.setScope(that.getUID(GENTICS.Aloha.TableHelper.selectionType))}GENTICS.Aloha.FloatingMenu.doLayout()}});GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableDeactivated",function(event,properties){GENTICS.Aloha.TablePlugin.setFocusedTable(undefined);GENTICS.Aloha.TableHelper.unselectCells()})};GENTICS.Aloha.TablePlugin.isEditableTable=function(table){var parent=jQuery(table.parentNode);if(parent.attr("contenteditable")=="true"){return true}else{return false}};GENTICS.Aloha.TablePlugin.initTableButtons=function(){var that=this;this.createTableButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_table",size:"small",tooltip:this.i18n("button.createtable.tooltip"),onclick:function(element,event){GENTICS.Aloha.TablePlugin.createDialog(element.btnEl.dom)}});GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.createTableButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1);GENTICS.Aloha.FloatingMenu.createScope(this.getUID("row"),"GENTICS.Aloha.global");GENTICS.Aloha.FloatingMenu.createScope(this.getUID("column"),"GENTICS.Aloha.global");GENTICS.Aloha.FloatingMenu.addButton(this.getUID("column"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addColumnLeft",size:"small",tooltip:this.i18n("button.addcolleft.tooltip"),onclick:function(){if(that.activeTable){that.activeTable.addColumnsLeft()}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("column"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addColumnRight",size:"small",tooltip:this.i18n("button.addcolright.tooltip"),onclick:function(){if(that.activeTable){that.activeTable.addColumnsRight()}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("column"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_deleteColumns",size:"small",tooltip:this.i18n("button.delcols.tooltip"),onclick:function(){if(that.activeTable){var aTable=that.activeTable;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(that,"Table"),text:GENTICS.Aloha.i18n(that,"deletecolumns.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(sel){if(sel=="yes"){aTable.deleteColumns()}}}))}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("row"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addRowBefore",size:"small",tooltip:this.i18n("button.addrowbefore.tooltip"),onclick:function(){if(that.activeTable){that.activeTable.addRowsBefore(true)}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("row"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addRowAfter",size:"small",tooltip:this.i18n("button.addrowafter.tooltip"),onclick:function(){if(that.activeTable){that.activeTable.addRowsAfter(true)}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1);GENTICS.Aloha.FloatingMenu.addButton(this.getUID("row"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_deleteRows",size:"small",tooltip:this.i18n("button.delrows.tooltip"),onclick:function(){if(that.activeTable){var aTable=that.activeTable;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(that,"Table"),text:GENTICS.Aloha.i18n(that,"deleterows.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(sel){if(sel=="yes"){aTable.deleteRows()}}}))}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1)};GENTICS.Aloha.TablePlugin.createDialog=function(callingElement){this.createLayer.set("target",callingElement);this.createLayer.show()};GENTICS.Aloha.TablePlugin.createTable=function(cols,rows){if(GENTICS.Aloha.activeEditable!=null&&typeof GENTICS.Aloha.activeEditable.obj!="undefined"){var table=document.createElement("table");var tableId=table.id=GENTICS.Aloha.TableHelper.getNewTableID();var tbody=document.createElement("tbody");for(var i=0;i<rows;i++){var tr=document.createElement("tr");for(var j=0;j<cols;j++){var text=document.createTextNode("\u00a0");var td=document.createElement("td");td.appendChild(text);tr.appendChild(td)}tbody.appendChild(tr)}table.appendChild(tbody);GENTICS.Utils.Dom.insertIntoDOM(jQuery(table),GENTICS.Aloha.Selection.getRangeObject(),jQuery(GENTICS.Aloha.activeEditable.obj));var tableReloadedFromDOM=document.getElementById(tableId);var tableObj=new GENTICS.Aloha.Table(tableReloadedFromDOM);tableObj.parentEditable=GENTICS.Aloha.activeEditable;tableObj.activate();if(jQuery.browser.msie){window.setTimeout(function(){tableObj.cells[0].wrapper.get(0).focus()},20)}else{tableObj.cells[0].wrapper.get(0).focus()}GENTICS.Aloha.TablePlugin.TableRegistry.push(tableObj)}else{this.error("There is no active Editable where the table can be inserted!")}};GENTICS.Aloha.TablePlugin.setFocusedTable=function(focusTable){for(var i=0;i<GENTICS.Aloha.TablePlugin.TableRegistry.length;i++){GENTICS.Aloha.TablePlugin.TableRegistry[i].hasFocus=false}if(typeof focusTable!="undefined"){focusTable.hasFocus=true}GENTICS.Aloha.TablePlugin.activeTable=focusTable};GENTICS.Aloha.TablePlugin.error=function(msg){GENTICS.Aloha.Log.error(this,msg)};GENTICS.Aloha.TablePlugin.debug=function(msg){GENTICS.Aloha.Log.debug(this,msg)};GENTICS.Aloha.TablePlugin.info=function(msg){GENTICS.Aloha.Log.info(this,msg)};GENTICS.Aloha.TablePlugin.log=function(msg){GENTICS.Aloha.log("log",this,msg)};GENTICS.Aloha.TablePlugin.get=function(property){if(this.config[property]){return this.config[property]}if(this.parameters[property]){return this.parameters[property]}return undefined};GENTICS.Aloha.TablePlugin.set=function(key,value){if(this.config[key]){this.config[key]=value}else{this.parameters[key]=value}};GENTICS.Aloha.TablePlugin.makeClean=function(obj){obj.find("table").each(function(){var table=new GENTICS.Aloha.Table(this);table.deactivate()})};GENTICS.Aloha.TablePlugin.toString=function(){return this.prefix};GENTICS.Aloha.Table=function(table){this.obj=jQuery(table);var rows=this.obj.find("tr");var firstRow=jQuery(rows.get(0));this.numCols=firstRow.children("td, th").length;this.numRows=rows.length;this.cells=new Array();var rows=this.obj.find("tr");for(var i=0;i<rows.length;i++){var row=jQuery(rows[i]);var cols=row.children();for(var j=0;j<cols.length;j++){var col=cols[j];var Cell=new GENTICS.Aloha.Table.Cell(col,this);this.cells.push(Cell)}}};GENTICS.Aloha.Table.prototype.obj=undefined;GENTICS.Aloha.Table.prototype.tableWrapper=undefined;GENTICS.Aloha.Table.prototype.cells=undefined;GENTICS.Aloha.Table.prototype.numRows=undefined;GENTICS.Aloha.Table.prototype.numCols=undefined;GENTICS.Aloha.Table.prototype.isActive=false;GENTICS.Aloha.Table.prototype.hasFocus=false;GENTICS.Aloha.Table.prototype.parentEditable=undefined;GENTICS.Aloha.Table.prototype.mousedown=false;GENTICS.Aloha.Table.prototype.clickedColumnId=-1;GENTICS.Aloha.Table.prototype.clickedRowId=-1;GENTICS.Aloha.Table.prototype.columnsToSelect=new Array();GENTICS.Aloha.Table.prototype.rowsToSelect=new Array();GENTICS.Aloha.Table.prototype.fmPluginId=undefined;GENTICS.Aloha.Table.prototype.get=function(property){return GENTICS.Aloha.TablePlugin.get(property)};GENTICS.Aloha.Table.prototype.set=function(key,value){GENTICS.Aloha.TablePlugin.set(key,value)};GENTICS.Aloha.Table.prototype.activate=function(){if(this.isActive){return}var that=this;this.obj.addClass(this.get("className"));this.obj.attr("contenteditable","false");if(this.obj.attr("id")==""){this.obj.attr("id",GENTICS.Aloha.TableHelper.getNewTableID())}GENTICS.Aloha.TableHelper.selectionType=undefined;this.obj.bind("keydown",function(jqEvent){if(!jqEvent.ctrlKey&&!jqEvent.shiftKey){if(GENTICS.Aloha.TableHelper.selectedCells.length>0&&GENTICS.Aloha.TableHelper.selectedCells[0].length>0){GENTICS.Aloha.TableHelper.selectedCells[0][0].firstChild.focus()}}});this.obj.bind("click",function(e){e.stopPropagation();return false});this.obj.bind("mousedown",function(jqEvent){if(!that.hasFocus){that.focus()}setTimeout(function(){var firstCell=that.obj.find("tr:nth-child(2) td:nth-child(2)").children("div[contenteditable=true]").get(0);GENTICS.Aloha.TableHelper.unselectCells();jQuery(firstCell).get(0).focus()},5);jqEvent.stopPropagation();jqEvent.preventDefault();return false});var tableWrapper=jQuery('<div class="'+this.get("classTableWrapper")+'" contenteditable="false"></div>');this.obj.wrap(tableWrapper);var htmlTableWrapper=this.obj.parents("."+this.get("classTableWrapper"));htmlTableWrapper.get(0).onresizestart=function(e){return false};htmlTableWrapper.get(0).oncontrolselect=function(e){return false};this.tableWrapper=this.obj.parents("."+this.get("classTableWrapper")).get(0);jQuery(this.cells).each(function(){this.activate()});this.attachSelectionColumn();this.attachSelectionRow();this.attachLastCellEvents();this.isActive=true;GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("tableActivated",GENTICS.Aloha,[this]))};GENTICS.Aloha.Table.prototype.attachSelectionColumn=function(){var emptyCell=jQuery("<td>");emptyCell.html("\u00a0");var that=this;var rows=this.obj.context.rows;for(var i=0;i<rows.length;i++){var rowObj=jQuery(rows[i]);var columnToInsert=emptyCell.clone();columnToInsert.addClass(this.get("classSelectionColumn"));columnToInsert.css("width",this.get("selectionArea")+"px");rowObj.find("td:first").before(columnToInsert);var rowIndex=i+1;this.attachRowSelectionEventsToCell(columnToInsert)}};GENTICS.Aloha.Table.prototype.attachRowSelectionEventsToCell=function(cell){var that=this;cell.unbind("mousedown");cell.unbind("mouseover");cell.get(0).onselectstart=function(){return false};cell.bind("mousedown",function(e){that.rowSelectionMouseDown(e);that.focus();e.stopPropagation()});cell.bind("mouseover",function(e){that.rowSelectionMouseOver(e);e.preventDefault()})};GENTICS.Aloha.Table.prototype.rowSelectionMouseDown=function(jqEvent){this.mousedown=true;if(GENTICS.Aloha.TableHelper.selectedCells.length==0){this.rowsToSelect=new Array()}this.clickedRowId=jqEvent.currentTarget.parentNode.rowIndex;if(jqEvent.ctrlKey){var arrayIndex=jQuery.inArray(this.clickedRowId,this.rowsToSelect);if(arrayIndex>=0){this.rowsToSelect.splice(arrayIndex,1)}else{this.rowsToSelect.push(this.clickedRowId)}}else{if(jqEvent.shiftKey){this.rowsToSelect.sort(function(a,b){return a-b});var start=this.rowsToSelect[0];var end=this.clickedRowId;if(start>end){start=end;end=this.rowsToSelect[0]}this.rowsToSelect=new Array();for(var i=start;i<=end;i++){this.rowsToSelect.push(i)}}else{this.rowsToSelect=[this.clickedRowId]}}this.selectRows();jqEvent.preventDefault()};GENTICS.Aloha.Table.prototype.rowSelectionMouseOver=function(jqEvent){var rowIndex=jqEvent.currentTarget.parentNode.rowIndex;if(this.mousedown&&this.clickedRowId>=0){var indexInArray=jQuery.inArray(rowIndex,this.rowsToSelect);var start=(rowIndex<this.clickedRowId)?rowIndex:this.clickedRowId;var end=(rowIndex<this.clickedRowId)?this.clickedRowId:rowIndex;this.rowsToSelect=new Array();for(var i=start;i<=end;i++){this.rowsToSelect.push(i)}this.selectRows()}};GENTICS.Aloha.Table.prototype.attachSelectionRow=function(){var that=this;var emptyCell=jQuery("<td>");emptyCell.html("\u00a0");var numColumns=this.obj.context.rows[0].cells.length;var selectionRow=jQuery("<tr>");selectionRow.addClass(this.get("classSelectionRow"));selectionRow.css("height",this.get("selectionArea")+"px");for(var i=0;i<numColumns;i++){var columnToInsert=emptyCell.clone();if(i>0){this.attachColumnSelectEventsToCell(columnToInsert)}selectionRow.append(columnToInsert)}jQuery(document).bind("mouseup",function(e){that.mousedown=false;that.clickedColumnId=-1;that.clickedRowId=-1});selectionRow.find("td:first").addClass(this.get("classLeftUpperCorner"));this.obj.find("tr:first").before(selectionRow)};GENTICS.Aloha.Table.prototype.attachColumnSelectEventsToCell=function(cell){var that=this;cell.unbind("mousedown");cell.unbind("mouseover");cell.get(0).onselectstart=function(){return false};cell.bind("mousedown",function(e){that.columnSelectionMouseDown(e);that.focus();e.stopPropagation();return false});cell.bind("mouseover",function(e){that.columnSelectionMouseOver(e)})};GENTICS.Aloha.Table.prototype.columnSelectionMouseDown=function(jqEvent){this.mousedown=true;if(GENTICS.Aloha.TableHelper.selectedCells.length==0){this.columnsToSelect=new Array()}this.clickedColumnId=jqEvent.currentTarget.cellIndex;if(jqEvent.ctrlKey){var arrayIndex=jQuery.inArray(this.clickedColumnId,this.columnsToSelect);if(arrayIndex>=0){this.columnsToSelect.splice(arrayIndex,1)}else{this.columnsToSelect.push(this.clickedColumnId)}}else{if(jqEvent.shiftKey){this.columnsToSelect.sort(function(a,b){return a-b});var start=this.columnsToSelect[0];var end=this.clickedColumnId;if(start>end){start=end;end=this.columnsToSelect[0]}this.columnsToSelect=new Array();for(var i=start;i<=end;i++){this.columnsToSelect.push(i)}}else{this.columnsToSelect=[this.clickedColumnId]}}this.selectColumns();jqEvent.preventDefault()};GENTICS.Aloha.Table.prototype.columnSelectionMouseOver=function(jqEvent){var colIndex=jqEvent.currentTarget.cellIndex;if(this.mousedown&&this.clickedColumnId>0){var indexInArray=jQuery.inArray(colIndex,this.columnsToSelect);var start=(colIndex<this.clickedColumnId)?colIndex:this.clickedColumnId;var end=(colIndex<this.clickedColumnId)?this.clickedColumnId:colIndex;this.columnsToSelect=new Array();for(var i=start;i<=end;i++){this.columnsToSelect.push(i)}this.selectColumns()}};GENTICS.Aloha.Table.prototype.releaseLastCellEvents=function(){this.obj.find("tr:last td:last").unbind()};GENTICS.Aloha.Table.prototype.attachLastCellEvents=function(){var that=this;this.obj.find("tr:last td:last").bind("keydown",function(jqEvent){that.lastCellKeyDown(jqEvent)})};GENTICS.Aloha.Table.prototype.lastCellKeyDown=function(jqEvent){var KEYCODE_TAB=9;if(KEYCODE_TAB==jqEvent.keyCode&&!jqEvent.altKey&&!jqEvent.shiftKey&&!jqEvent.ctrlKey){this.addRowsAfter(false);jqEvent.stopPropagation();if(jQuery.browser.msie){this.obj.find("tr:last td:nth-child(1) div.GENTICS_Table_Cell_editable").get(0).focus();return false}}};GENTICS.Aloha.Table.prototype.deleteRows=function(){var rowIDs=new Array();var deleteTable=false;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){for(var i=0;i<GENTICS.Aloha.TableHelper.selectedCells.length;i++){rowIDs.push(GENTICS.Aloha.TableHelper.selectedCells[i][0].parentNode.rowIndex)}}else{if(typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"){rowIDs.push(GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.parentNode.rowIndex)}}if(rowIDs.length==this.numRows){deleteTable=true}if(deleteTable){var that=this;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"Table"),text:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"deletetable.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(sel){if(sel=="yes"){that.deleteTable()}}}))}else{rowIDs.sort(function(a,b){return a-b});var focusRowId=rowIDs[0];if(focusRowId>(this.numRows-rowIDs.length)){focusRowId--}this.releaseLastCellEvents();var rows=this.obj.find("tr");var rows2delete=new Array();for(var i=0;i<rowIDs.length;i++){rows2delete.push(jQuery(rows[rowIDs[i]]))}for(var i=0;i<rows2delete.length;i++){var cols=rows2delete[i].children("td").toArray();for(var j=0;j<cols.length;j++){for(var m=0;m<this.cells.length;m++){if(cols[j]==this.cells[m].obj.get(0)){this.cells.splice(m,1);m=this.cells.length}}}}for(var i=0;i<rows2delete.length;i++){rows2delete[i].remove()}this.numRows-=rows2delete.length;if(jQuery.browser.msie){setTimeout(this.obj.find("tr:nth-child("+(focusRowId+1)+") td:nth-child(2) div.GENTICS_Table_Cell_editable").get(0).focus,5)}else{this.obj.find("tr:nth-child("+(focusRowId+1)+") td:nth-child(2) div.GENTICS_Table_Cell_editable").get(0).focus()}this.attachLastCellEvents();GENTICS.Aloha.TableHelper.unselectCells()}};GENTICS.Aloha.Table.prototype.deleteColumns=function(){var colIDs=new Array();var deleteTable=false;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){for(var i=0;i<GENTICS.Aloha.TableHelper.selectedCells[0].length;i++){colIDs.push(GENTICS.Aloha.TableHelper.selectedCells[0][i].cellIndex)}}else{if(typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"){colIDs.push(GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.cellIndex)}}if(colIDs.length==this.numCols){deleteTable=true}if(deleteTable){var that=this;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"Table"),text:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"deletetable.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(sel){if(sel=="yes"){that.deleteTable()}}}))}else{colIDs.sort(function(a,b){return a-b});var focusColID=colIDs[0];if(focusColID>(this.numCols-colIDs.length)){focusColID--}this.releaseLastCellEvents();var rows=this.obj.find("tr");var cols2delete=new Array();for(var i=0;i<rows.length;i++){var cells=jQuery(rows[i]).children("td").toArray();for(var j=0;j<colIDs.length;j++){cols2delete.push(cells[colIDs[j]])}}for(var i=0;i<cols2delete.length;i++){for(var j=0;j<this.cells.length;j++){if(cols2delete[i]==this.cells[j].obj.get(0)){this.cells.splice(j,1);j=this.cells.length}}}for(var i=0;i<cols2delete.length;i++){jQuery(cols2delete[i]).remove()}this.numCols-=colIDs.length;if(jQuery.browser.msie){setTimeout(this.obj.find("tr:nth-child(2) td:nth-child("+(focusColID+1)+") div.GENTICS_Table_Cell_editable").get(0).focus,5)}else{this.obj.find("tr:nth-child(2) td:nth-child("+(focusColID+1)+") div.GENTICS_Table_Cell_editable").get(0).focus()}this.attachLastCellEvents();GENTICS.Aloha.TableHelper.unselectCells()}};GENTICS.Aloha.Table.prototype.deleteTable=function(){var deleteIndex=-1;for(var i=0;i<GENTICS.Aloha.TablePlugin.TableRegistry.length;i++){if(GENTICS.Aloha.TablePlugin.TableRegistry[i].obj.attr("id")==this.obj.attr("id")){deleteIndex=i;break}}if(deleteIndex>=0){this.deactivate();GENTICS.Aloha.TableHelper.selectionType=undefined;GENTICS.Aloha.TablePlugin.TableRegistry.splice(i,1);var newRange=GENTICS.Aloha.Selection.rangeObject;newRange.startContainer=newRange.endContainer=this.obj.get(0).parentNode;newRange.startOffset=newRange.endOffset=GENTICS.Utils.Dom.getIndexInParent(this.obj.get(0).parentNode);newRange.clearCaches();this.obj.remove();this.parentEditable.obj.focus();newRange.correctRange();newRange.select()}};GENTICS.Aloha.Table.prototype.addRowsBefore=function(highlightNewRows){this.addRows("before",highlightNewRows)};GENTICS.Aloha.Table.prototype.addRowsAfter=function(highlightNewRows){this.addRows("after",highlightNewRows)};GENTICS.Aloha.Table.prototype.addRows=function(position,highlightNewRows){if(typeof GENTICS.Aloha.TablePlugin.activeTable!="undefined"){this.releaseLastCellEvents();var that=this;var numCols=this.numCols;var rowsToInsert=1;var rowId=1;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){rowsToInsert=GENTICS.Aloha.TableHelper.selectedCells.length;switch(position){case"before":if(GENTICS.Aloha.TableHelper.selectedCells[0].length){rowId=GENTICS.Aloha.TableHelper.selectedCells[0][0].parentNode.rowIndex}break;case"after":var lastRow=GENTICS.Aloha.TableHelper.selectedCells.length-1;if(GENTICS.Aloha.TableHelper.selectedCells[lastRow].length){rowId=GENTICS.Aloha.TableHelper.selectedCells[lastRow][0].parentNode.rowIndex}break}}else{if(typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"){rowId=GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.parentNode.rowIndex}}var newRowIndex=rowId;if(position=="after"){newRowIndex+=1}var rowIdArray=new Array();for(var j=0;j<rowsToInsert;j++){rowIdArray.push(newRowIndex);var insertionRow=jQuery("<tr>");var selectionColumn=jQuery("<td>");selectionColumn.addClass(this.get("classSelectionColumn"));this.attachRowSelectionEventsToCell(selectionColumn);insertionRow.append(selectionColumn);for(i=0;i<numCols;i++){var newCol=jQuery("<td>");newCol.html("\u00a0");var cell=new GENTICS.Aloha.Table.Cell(newCol.get(0),GENTICS.Aloha.TablePlugin.activeTable);cell.activate();this.cells.push(cell);insertionRow.append(cell.obj)}var currentRow=jQuery(GENTICS.Aloha.TablePlugin.activeTable.obj.find("tr").get(rowId));switch(position){case"before":currentRow.before(insertionRow);break;case"after":currentRow.after(insertionRow);break;default:this.warn(this,"Wrong call of GENTICS.Aloha.Table.prototype.addRow!")}newRowIndex++;this.numRows++}GENTICS.Aloha.TableHelper.unselectCells();this.rowsToSelect=rowIdArray;if(highlightNewRows){this.selectRows()}this.attachLastCellEvents()}};GENTICS.Aloha.Table.prototype.addColumnsRight=function(){this.addColumns("right")};GENTICS.Aloha.Table.prototype.addColumnsLeft=function(){this.addColumns("left")};GENTICS.Aloha.Table.prototype.addColumns=function(position){if(typeof GENTICS.Aloha.TablePlugin.activeTable!="undefined"){this.releaseLastCellEvents();var that=this;var columnsToInsert=1;var colId=1;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){columnsToInsert=GENTICS.Aloha.TableHelper.selectedCells[0].length;switch(position){case"left":if(GENTICS.Aloha.TableHelper.selectedCells[0].length){colId=GENTICS.Aloha.TableHelper.selectedCells[0][0].cellIndex}break;case"right":var lastColumn=GENTICS.Aloha.TableHelper.selectedCells[0].length-1;if(GENTICS.Aloha.TableHelper.selectedCells[0].length){colId=GENTICS.Aloha.TableHelper.selectedCells[0][lastColumn].cellIndex}break}}else{if(typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"){colId=GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.cellIndex}}var newColId=colId;var emptyCell=jQuery("<td>");var rows=this.obj.find("tr");var colIdArray=new Array();for(var i=0;i<rows.length;i++){var currentColId=newColId;var row=rows[i];for(var j=0;j<columnsToInsert;j++){var cell=emptyCell.clone();cell.html("\u00a0");if(i==0){this.attachColumnSelectEventsToCell(cell)}else{cellObj=new GENTICS.Aloha.Table.Cell(cell.get(0),GENTICS.Aloha.TablePlugin.activeTable);this.cells.push(cellObj);cellObj.activate();cell=cellObj.obj}var insertionColumn=jQuery(jQuery(row).find("td").get(newColId));switch(position){case"left":if(jQuery.inArray(currentColId,colIdArray)<0){colIdArray.push(currentColId)}insertionColumn.before(cell);break;case"right":if(jQuery.inArray((currentColId+1),colIdArray)<0){colIdArray.push(currentColId+1)}insertionColumn.after(cell);break}currentColId++}}this.numCols+=columnsToInsert;GENTICS.Aloha.TableHelper.unselectCells();this.columnsToSelect=colIdArray;this.selectColumns();this.attachLastCellEvents()}};GENTICS.Aloha.Table.prototype.focus=function(){if(!this.hasFocus){if(!this.parentEditable.isActive){this.parentEditable.obj.focus()}GENTICS.Aloha.TablePlugin.setFocusedTable(this)}setTimeout("GENTICS.Aloha.Selection.updateSelection(false, true)",50)};GENTICS.Aloha.Table.prototype.focusOut=function(){if(this.hasFocus){this.hasFocus=false;GENTICS.Aloha.TablePlugin.setFocusedTable(undefined)}};GENTICS.Aloha.Table.prototype.selectColumns=function(){var selectClass=this.get("classCellSelected");GENTICS.Aloha.TableHelper.unselectCells();GENTICS.Aloha.TableHelper.selectionType="column";this.columnsToSelect.sort(function(a,b){return a-b});var rows=this.obj.find("tr").toArray();rows.shift();var toSelect=new Array();for(var i=0;i<rows.length;i++){var rowCells=rows[i].cells;var selectedCellsInCol=new Array();for(var j=0;j<this.columnsToSelect.length;j++){var colIndex=this.columnsToSelect[j];var cell=rowCells[colIndex];toSelect.push(cell);selectedCellsInCol.push(cell)}GENTICS.Aloha.TableHelper.selectedCells.push(selectedCellsInCol)}this.obj.find("div.GENTICS_Table_Cell_editable").blur();jQuery(toSelect).addClass(selectClass)};GENTICS.Aloha.Table.prototype.selectRows=function(){var selectClass=this.get("classCellSelected");GENTICS.Aloha.TableHelper.unselectCells();this.rowsToSelect.sort(function(a,b){return a-b});for(var i=0;i<this.rowsToSelect.length;i++){var rowId=this.rowsToSelect[i];var rowCells=jQuery(this.obj.find("tr").get(rowId).cells).toArray();rowCells.shift();GENTICS.Aloha.TableHelper.selectedCells.push(rowCells);jQuery(rowCells).addClass(this.get("classCellSelected"))}GENTICS.Aloha.TableHelper.selectionType="row";this.obj.find("div.GENTICS_Table_Cell_editable").blur()};GENTICS.Aloha.Table.prototype.deactivate=function(){this.obj.removeClass(this.get("className"));if(GENTICS.Aloha.trim(this.obj.attr("class"))==""){this.obj.removeAttr("class")}this.obj.removeAttr("contenteditable");this.obj.removeAttr("id");if(this.obj.parents("."+this.get("classTableWrapper")).length){this.obj.unwrap()}this.obj.find("tr."+this.get("classSelectionRow")+":first").remove();var that=this;jQuery.each(this.obj.context.rows,function(){jQuery(this).children("td."+that.get("classSelectionColumn")).remove()});this.obj.find("td, th").removeClass(this.get("classCellSelected"));this.obj.unbind();for(var i=0;i<this.cells.length;i++){var Cell=this.cells[i];Cell.deactivate()}};GENTICS.Aloha.Table.prototype.toString=function(){return"GENTICS.Aloha.Table"};GENTICS.Aloha.Table.Cell=function(originalTd,tableObj){this.obj=jQuery(originalTd);this.tableObj=tableObj};GENTICS.Aloha.Table.Cell.prototype.tableObj=undefined;GENTICS.Aloha.Table.Cell.prototype.obj=undefined;GENTICS.Aloha.Table.Cell.prototype.wrapper=undefined;GENTICS.Aloha.Table.Cell.prototype.hasFocus=false;GENTICS.Aloha.Table.Cell.activeCell=undefined;GENTICS.Aloha.Table.Cell.lastActiveCell=undefined;GENTICS.Aloha.Table.Cell.prototype.editableFocus=function(e){if(!this.hasFocus){this.tableObj.focus();GENTICS.Aloha.Table.Cell.activeCell=this;GENTICS.Aloha.Table.Cell.lastActiveCell=this;this.obj.addClass("GENTICS_Table_Cell_active");this.hasFocus=true;this.selectAll(this.wrapper.get(0));GENTICS.Aloha.TableHelper.selectionType=undefined}};GENTICS.Aloha.Table.Cell.prototype.editableBlur=function(jqEvent){GENTICS.Aloha.Table.Cell.activeCell=undefined;this.hasFocus=false;this.obj.removeClass("GENTICS_Table_Cell_active")};GENTICS.Aloha.Table.Cell.prototype.activate=function(){this.obj.wrapInner("<div/>");var wrapper=this.obj.children("div").eq(0);wrapper.attr("contenteditable","true");wrapper.addClass("GENTICS_Table_Cell_editable");var that=this;wrapper.bind("focus",function(jqEvent){if(jqEvent.currentTarget){jqEvent.currentTarget.indexOf=function(){return -1}}that.editableFocus(jqEvent)});wrapper.bind("mousedown",function(jqEvent){if(jqEvent.currentTarget){jqEvent.currentTarget.indexOf=function(){return -1}}that.editableMouseDown(jqEvent)});wrapper.bind("blur",function(jqEvent){that.editableBlur(jqEvent)});wrapper.bind("keyup",function(jqEvent){that.editableKeyUp(jqEvent)});wrapper.bind("keydown",function(jqEvent){that.editableKeyDown(jqEvent)});wrapper.GENTICS_contentEditableSelectionChange(function(event){GENTICS.Aloha.Selection.onChange(wrapper,event);return wrapper});this.obj.bind("mousedown",function(jqEvent){setTimeout(function(){that.wrapper.trigger("focus")},1);GENTICS.Aloha.TableHelper.unselectCells();jqEvent.stopPropagation()});this.obj.get(0).onselectstart=function(jqEvent){return false};this.wrapper=this.obj.children();this.wrapper.get(0).onselectstart=function(){window.event.cancelBubble=true};return this};GENTICS.Aloha.Table.Cell.prototype.deactivate=function(){var wrapper=this.obj.children(".GENTICS_Table_Cell_editable");if(wrapper.length){var innerHtml=wrapper.html();wrapper.unbind();wrapper.remove();this.obj.unbind("click");if(GENTICS.Aloha.trim(this.obj.attr("class"))==""){this.obj.removeAttr("class")}this.obj.html(innerHtml)}};GENTICS.Aloha.Table.Cell.prototype.toString=function(){return"GENTICS.Aloha.Table.Cell"};GENTICS.Aloha.Table.Cell.prototype.selectAll=function(editableNode){var e=(editableNode.jquery)?editableNode.get(0):editableNode;if(!jQuery.browser.msie){var s=window.getSelection();if(s.setBaseAndExtent){s.setBaseAndExtent(e,0,e,e.innerText.length-1)}else{if(window.opera&&e.innerHTML.substring(e.innerHTML.length-4)=="<BR>"){e.innerHTML=e.innerHTML+"&#160;"}var r=document.createRange();r.selectNodeContents(e);s.removeAllRanges();s.addRange(r)}}else{if(document.getSelection){var s=document.getSelection();var r=document.createRange();r.selectNodeContents(e);s.removeAllRanges();s.addRange(r)}else{if(document.selection){var r=document.body.createTextRange();r.moveToElementText(e);r.select()}}}GENTICS.Aloha.Selection.updateSelection(editableNode)};GENTICS.Aloha.Table.Cell.prototype.editableMouseDown=function(jqEvent){GENTICS.Aloha.TableHelper.unselectCells();if(this.tableObj.hasFocus){jqEvent.stopPropagation()}};GENTICS.Aloha.Table.Cell.prototype.editableKeyUp=function(jqEvent){this.checkForEmptyEvent(jqEvent)};GENTICS.Aloha.Table.Cell.prototype.editableKeyDown=function(jqEvent){this.checkForEmptyEvent(jqEvent);if(!jqEvent.ctrlKey&&!jqEvent.shiftKey){if(GENTICS.Aloha.TableHelper.selectedCells.length>0&&GENTICS.Aloha.TableHelper.selectedCells[0].length>0){GENTICS.Aloha.TableHelper.selectedCells[0][0].firstChild.focus();GENTICS.Aloha.TableHelper.unselectCells();jqEvent.stopPropagation()}}else{if(jqEvent.shiftKey&&GENTICS.Aloha.TableHelper.selectedCells.length>0){var KEYCODE_ARROWLEFT=37;var KEYCODE_ARROWUP=38;var KEYCODE_ARROWRIGHT=39;var KEYCODE_ARROWDOWN=40;switch(GENTICS.Aloha.TableHelper.selectionType){case"row":switch(jqEvent.keyCode){case KEYCODE_ARROWUP:var firstSelectedRow=GENTICS.Aloha.TableHelper.selectedCells[0][0].parentNode.rowIndex;if(firstSelectedRow>1){this.tableObj.rowsToSelect.push(firstSelectedRow-1)}break;case KEYCODE_ARROWDOWN:var lastRowIndex=GENTICS.Aloha.TableHelper.selectedCells.length-1;var lastSelectedRow=GENTICS.Aloha.TableHelper.selectedCells[lastRowIndex][0].parentNode.rowIndex;if(lastSelectedRow<this.tableObj.numRows){this.tableObj.rowsToSelect.push(lastSelectedRow+1)}break}this.tableObj.selectRows();break;case"column":switch(jqEvent.keyCode){case KEYCODE_ARROWLEFT:var firstColSelected=GENTICS.Aloha.TableHelper.selectedCells[0][0].cellIndex;if(firstColSelected>1){this.tableObj.columnsToSelect.push(firstColSelected-1)}break;case KEYCODE_ARROWRIGHT:var lastColIndex=GENTICS.Aloha.TableHelper.selectedCells[0].length-1;var lastColSelected=GENTICS.Aloha.TableHelper.selectedCells[0][lastColIndex].cellIndex;if(lastColSelected<this.tableObj.numCols){this.tableObj.columnsToSelect.push(lastColSelected+1)}break}this.tableObj.selectColumns();break}jqEvent.stopPropagation();jqEvent.preventDefault();return false}}};GENTICS.Aloha.Table.Cell.prototype.checkForEmptyEvent=function(jqEvent){if(jQuery(this.wrapper).children().length>0){return}var text=this.wrapper.text();if(text==""){this.wrapper.text("\u00a0");this.wrapper.get(0).blur();this.wrapper.get(0).focus()}};GENTICS.Aloha.Table.CreateLayer=function(){};GENTICS.Aloha.Table.CreateLayer.prototype.parameters={elemId:"GENTICS_Aloha_Table_createLayer",className:"GENTICS_Table_Createdialog",numX:10,numY:10,layer:undefined,target:undefined};GENTICS.Aloha.Table.CreateLayer.prototype.config=new Object();GENTICS.Aloha.Table.CreateLayer.prototype.visible=false;GENTICS.Aloha.Table.CreateLayer.prototype.show=function(){var layer=this.get("layer");if(layer==null){this.create()}else{this.setPosition(layer);layer.find("td").removeClass("hover");layer.show()}this.visible=true};GENTICS.Aloha.Table.CreateLayer.prototype.create=function(){var that=this;var layer=jQuery("<div></div>");layer.id=this.get("elemId");layer.addClass(this.get("className"));var table=jQuery("<table></table>");table.css("width",(this.get("numX")+6)*15);var tr;var td;for(var i=0;i<this.get("numY");i++){tr=jQuery("<tr></tr>");for(var j=0;j<this.get("numX");j++){td=jQuery("<td>\u00a0</td>");if(i==0&&j==0){td.addClass("hover")}td.bind("mouseover",{rowId:i,colId:j},function(e){that.handleMouseOver(e,table)});td.bind("click",{rowId:i,colId:j},function(e){var rows=e.data.rowId+1;var cols=e.data.colId+1;GENTICS.Aloha.TablePlugin.createTable(cols,rows);that.hide()});tr.append(td)}table.append(tr)}layer.append(table);this.set("layer",layer);this.setPosition();layer.bind("click",function(e){e.stopPropagation()}).mousedown(function(e){e.stopPropagation()});jQuery("body").append(layer).bind("click",function(e){if(e.target!=that.get("target")&&that.visible){that.hide()}})};GENTICS.Aloha.Table.CreateLayer.prototype.handleMouseOver=function(e,table){var rowId=e.data.rowId;var colId=e.data.colId;var innerRows=table.find("tr");for(var n=0;n<=innerRows.length;n++){var innerCells=jQuery(innerRows[n]).find("td");for(var k=0;k<=innerCells.length;k++){if(n<=rowId&&k<=colId){jQuery(innerCells[k]).addClass("hover")}else{jQuery(innerCells[k]).removeClass("hover")}}}};GENTICS.Aloha.Table.CreateLayer.prototype.setPosition=function(){var targetObj=jQuery(this.get("target"));var pos=targetObj.offset();this.get("layer").css("left",pos.left+"px");this.get("layer").css("top",(pos.top+targetObj.height())+"px")};GENTICS.Aloha.Table.CreateLayer.prototype.hide=function(){this.get("layer").hide();this.visible=false};GENTICS.Aloha.Table.CreateLayer.prototype.get=function(property){if(this.config[property]){return this.config[property]}if(this.parameters[property]){return this.parameters[property]}return undefined};GENTICS.Aloha.Table.CreateLayer.prototype.set=function(key,value){if(this.config[key]){this.config[key]=value}else{this.parameters[key]=value}};GENTICS.Aloha.TableHelper=function(){};GENTICS.Aloha.TableHelper.prototype.selectionType=undefined;GENTICS.Aloha.TableHelper.prototype.selectedCells=new Array();GENTICS.Aloha.TableHelper.prototype.unselectCells=function(){if(this.selectedCells.length>0){for(var i=0;i<this.selectedCells.length;i++){jQuery(this.selectedCells[i]).removeClass(GENTICS.Aloha.TablePlugin.get("classCellSelected"))}this.selectedCells=new Array();this.selectionType=undefined}};GENTICS.Aloha.TableHelper.prototype.getNewTableID=function(){var idPrefix="GENTICS_Table_";var factor=1000000;for(this.tableCounter;true;this.tableCounter++){var id=idPrefix+(Math.ceil(Math.random()*factor));for(var j=id.length;j<idPrefix.length+factor.toString().length;j++){id+="0"}if(!jQuery("#"+id).length){return id}}};GENTICS.Aloha.TableHelper=new GENTICS.Aloha.TableHelper();
@@ -1,6 +1,23 @@
1
+ .GENTICS_Aloha_Table {
2
+ border: 0px solid #AFAFAF;
3
+ width: 100%;
4
+ box-sizing : none !important;
5
+ cursor: default;
6
+ }
7
+ .GENTICS_Aloha_Table td {
8
+ border: 1px solid #AFAFAF;
9
+ padding: 1px;
10
+ margin: 0;
11
+ vertical-align: top;
12
+ cursor: text;
13
+ }
14
+ .GENTICS_Aloha_Table td .GENTICS_Table_Cell_editable {
15
+ cursor: text !important;
16
+ }
17
+
1
18
  /**
2
19
  * Hide the border for contenteditables
3
- */
20
+ */
4
21
  .GENTICS_Table_Cell_editable,
5
22
  .GENTICS_Aloha_Table_wrapper {
6
23
  outline: 0px solid transparent;
@@ -27,36 +44,18 @@ td.GENTICS_Aloha_Table_selectRow {
27
44
  height: 10px;
28
45
  }
29
46
 
30
- .GENTICS_Aloha_Table td .GENTICS_Table_Cell_editable {
31
- cursor: text !important;
32
- }
33
-
34
47
  .GENTICS_Aloha_Table tr.GENTICS_Aloha_Table_selectColumn td {
35
- cursor: url(down.cur),default;
48
+ cursor: url(down.cur),url(../plugins/table/resources/down.cur),default;
36
49
  }
37
50
 
38
51
  /* :TODO: make custom cursors visible in IE */
39
52
  .GENTICS_Aloha_Table td.GENTICS_Aloha_Table_selectRow {
40
- cursor: url(left.cur),default;
41
- }
42
-
43
- .GENTICS_WAI_RED {
44
- background-image: url(wai_red.png);
45
- }
46
-
47
- .GENTICS_WAI_GREEN {
48
- background-image: url(wai_green.png);
49
- }
50
-
51
- .GENTICS_Aloha_Table td.GENTICS_Aloha_Table_leftUpperCorner div {
52
- cursor: pointer !important;
53
+ cursor: url(left.cur),url(../plugins/table/resources/left.cur),default;
53
54
  }
54
55
 
55
56
  .GENTICS_Aloha_Table td.GENTICS_Aloha_Table_selectRow,
56
57
  .GENTICS_Aloha_Table tr.GENTICS_Aloha_Table_selectColumn td {
57
58
  border: 0;
58
- margin:0;
59
- padding:0;
60
59
  background-color: #D0D0D0;
61
60
  font-size: 0.01em;
62
61
  }
@@ -74,9 +73,9 @@ td.GENTICS_Aloha_Table_selectRow {
74
73
  position: absolute;
75
74
  background-color: #F0F0F0;
76
75
  border: 1px solid #cccccc;
77
- -moz-border-radius: 2px;
78
- -webkit-border-radius: 2px;
79
- border-radius: 2px;
76
+ -moz-border-radius: 3px;
77
+ -webkit-border-radius: 3px;
78
+ border-radius: 3px;
80
79
  }
81
80
  .GENTICS_Table_Createdialog table {
82
81
  padding: 0px;
@@ -85,28 +84,111 @@ td.GENTICS_Aloha_Table_selectRow {
85
84
  .GENTICS_Table_Createdialog table td {
86
85
  margin: 0px;
87
86
  padding: 0px;
88
- border: 1px solid #AFAFAF;
87
+ border: 2px solid #AFAFAF;
89
88
  font-size: 8px;
90
89
  width: 15px;
91
90
  height: 15px;
91
+ -moz-border-radius: 3px;
92
+ -webkit-border-radius: 3px;
93
+ border-radius: 3px;
92
94
  }
93
95
  .GENTICS_Table_Createdialog table td.hover {
94
- background-color: #1c94c4;
96
+ border-color: #1c94c4;
95
97
  }
96
98
  .GENTICS_Table_Createdialog #table-size-info {
97
99
  text-align: center;
98
100
  font-size: 0.8em;
99
101
  }
102
+
100
103
  .GENTICS_Aloha_Cell_selected {
101
104
  background-color: #3399FF !important;
102
105
  color: #FFF;
103
106
  }
107
+
108
+ table td {
109
+ height: 100%;
110
+ min-height: 100%;
111
+ }
104
112
  div.GENTICS_Table_Cell_editable {
105
113
  height: 100%;
106
114
  min-height: 100%;
107
115
  width: 100%;
108
116
  z-index: 99999;
109
117
  }
110
- button.GENTICS_button_table_caption {
111
- background-position: -320px 0px !important;
118
+
119
+ /*
120
+
121
+ floating menu buttons
122
+
123
+ */
124
+ .GENTICS_floatingmenu a.GENTICS_Aloha_addColumnLeft {
125
+ background-position: -540px 0;
126
+ }
127
+
128
+ .GENTICS_floatingmenu a:hover.GENTICS_Aloha_addColumnLeft {
129
+ background-position: -540px -20px;
130
+ }
131
+
132
+ .GENTICS_floatingmenu .pressed a.GENTICS_Aloha_addColumnLeft {
133
+ background-position: -540px -40px;
134
+ }
135
+
136
+ .GENTICS_floatingmenu a.GENTICS_Aloha_addColumnRight {
137
+ background-position: -560px 0;
138
+ }
139
+
140
+ .GENTICS_floatingmenu a:hover.GENTICS_Aloha_addColumnRight {
141
+ background-position: -560px -20px;
142
+ }
143
+
144
+ .GENTICS_floatingmenu .pressed a.GENTICS_Aloha_addColumnRight {
145
+ background-position: -560px -40px;
146
+ }
147
+
148
+ .GENTICS_floatingmenu a.GENTICS_Aloha_addRowBefore {
149
+ background-position: -580px 0;
150
+ }
151
+
152
+ .GENTICS_floatingmenu a:hover.GENTICS_Aloha_addRowBefore {
153
+ background-position: -580px -20px;
154
+ }
155
+
156
+ .GENTICS_floatingmenu .pressed a.GENTICS_Aloha_addRowBefore {
157
+ background-position: -580px -40px;
158
+ }
159
+
160
+ .GENTICS_floatingmenu a.GENTICS_Aloha_addRowAfter {
161
+ background-position: -600px 0;
162
+ }
163
+
164
+ .GENTICS_floatingmenu a:hover.GENTICS_Aloha_addRowAfter {
165
+ background-position: -600px -20px;
166
+ }
167
+
168
+ .GENTICS_floatingmenu .pressed a.GENTICS_Aloha_addRowAfter {
169
+ background-position: -600px -40px;
170
+ }
171
+
172
+ .GENTICS_floatingmenu a.GENTICS_Aloha_deleteRows {
173
+ background-position: -620px 0;
174
+ }
175
+
176
+ .GENTICS_floatingmenu a:hover.GENTICS_Aloha_deleteRows {
177
+ background-position: -620px -20px;
178
+ }
179
+
180
+ .GENTICS_floatingmenu .pressed a.GENTICS_Aloha_deleteRows {
181
+ background-position: -620px -40px;
182
+ }
183
+
184
+ .GENTICS_floatingmenu a.GENTICS_Aloha_deleteColumns {
185
+ background-position: -640px 0;
186
+ }
187
+
188
+ .GENTICS_floatingmenu a:hover.GENTICS_Aloha_deleteColumns {
189
+ background-position: -640px -20px;
190
+ }
191
+
192
+ .GENTICS_floatingmenu .pressed a.GENTICS_Aloha_deleteColumns {
193
+ background-position: -640px -40px;
112
194
  }