coalla-cms 0.5.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (290) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +81 -0
  3. data/Gemfile +4 -0
  4. data/Gemfile.lock +198 -0
  5. data/Rakefile +29 -0
  6. data/app/assets/fonts/glyphicons/glyphicons-halflings-regular.eot +0 -0
  7. data/app/assets/fonts/glyphicons/glyphicons-halflings-regular.svg +229 -0
  8. data/app/assets/fonts/glyphicons/glyphicons-halflings-regular.ttf +0 -0
  9. data/app/assets/fonts/glyphicons/glyphicons-halflings-regular.woff +0 -0
  10. data/app/assets/images/ajax-loader.gif +0 -0
  11. data/app/assets/images/blank.gif +0 -0
  12. data/app/assets/images/bootstrap/glyphicons-halflings-white.png +0 -0
  13. data/app/assets/images/bootstrap/glyphicons-halflings.png +0 -0
  14. data/app/assets/javascripts/admin/admin.js +223 -0
  15. data/app/assets/javascripts/admin/custom_admin.js +0 -0
  16. data/app/assets/javascripts/admin/jquery-migrate.min.js +2 -0
  17. data/app/assets/javascripts/admin/photo_uploader.js +58 -0
  18. data/app/assets/javascripts/admin/vendor/bootstrap.min.js +7 -0
  19. data/app/assets/javascripts/admin/vendor/jquery-ui-timepicker-addon-ru.js +42 -0
  20. data/app/assets/javascripts/admin/vendor/jquery.tagsinput.js +365 -0
  21. data/app/assets/javascripts/admin/vendor/jquery.tokeninput.patched.js +875 -0
  22. data/app/assets/javascripts/admin/vendor/underscore-min.js +5 -0
  23. data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +209 -0
  24. data/app/assets/javascripts/ckeditor/plugins/mediaembed/icons/hidpi/mediaembed.png +0 -0
  25. data/app/assets/javascripts/ckeditor/plugins/mediaembed/icons/mediaembed.png +0 -0
  26. data/app/assets/javascripts/ckeditor/plugins/mediaembed/plugin.js +64 -0
  27. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/LICENSE.txt +303 -0
  28. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad-gallery-css-diff.htm +831 -0
  29. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad_next.png +0 -0
  30. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad_prev.png +0 -0
  31. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad_scroll_back.png +0 -0
  32. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad_scroll_forward.png +0 -0
  33. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/jquery.ad-gallery.css +185 -0
  34. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/jquery.ad-gallery.js +984 -0
  35. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/jquery.ad-gallery.min - ref.js +10 -0
  36. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/jquery.ad-gallery.min.js +1 -0
  37. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/loader.gif +0 -0
  38. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/opa75.png +0 -0
  39. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/placeholder.png +0 -0
  40. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/ad-gallery/trans.gif +0 -0
  41. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/blank.gif +0 -0
  42. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_loading.gif +0 -0
  43. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_loading@2x.gif +0 -0
  44. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_overlay.png +0 -0
  45. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_sprite.png +0 -0
  46. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_sprite@2x.png +0 -0
  47. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/fancybox_buttons.png +0 -0
  48. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-buttons.css +97 -0
  49. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-buttons.js +122 -0
  50. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-media.js +199 -0
  51. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-thumbs.css +55 -0
  52. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-thumbs.js +162 -0
  53. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/jquery.fancybox.css +274 -0
  54. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/jquery.fancybox.js +2020 -0
  55. data/app/assets/javascripts/ckeditor/plugins/slideshow/3rdParty/fancybox2/jquery.fancybox.pack.js +46 -0
  56. data/app/assets/javascripts/ckeditor/plugins/slideshow/README.md +66 -0
  57. data/app/assets/javascripts/ckeditor/plugins/slideshow/dialogs/slideshow.js +1396 -0
  58. data/app/assets/javascripts/ckeditor/plugins/slideshow/dialogs/slideshow.min.js +1 -0
  59. data/app/assets/javascripts/ckeditor/plugins/slideshow/icons/placeholder.png +0 -0
  60. data/app/assets/javascripts/ckeditor/plugins/slideshow/icons/slideshow.png +0 -0
  61. data/app/assets/javascripts/ckeditor/plugins/slideshow/lang/Serbian_translation.txt +9 -0
  62. data/app/assets/javascripts/ckeditor/plugins/slideshow/lang/el.js +37 -0
  63. data/app/assets/javascripts/ckeditor/plugins/slideshow/lang/en.js +35 -0
  64. data/app/assets/javascripts/ckeditor/plugins/slideshow/lang/fr.js +35 -0
  65. data/app/assets/javascripts/ckeditor/plugins/slideshow/lang/ru.js +35 -0
  66. data/app/assets/javascripts/ckeditor/plugins/slideshow/lang/sr-latn.js +35 -0
  67. data/app/assets/javascripts/ckeditor/plugins/slideshow/lang/sr.js +35 -0
  68. data/app/assets/javascripts/ckeditor/plugins/slideshow/plugin.js +217 -0
  69. data/app/assets/stylesheets/admin/admin.scss +306 -0
  70. data/app/assets/stylesheets/admin/custom_admin.scss +1 -0
  71. data/app/assets/stylesheets/admin/vendor/bootstrap.min.css +14 -0
  72. data/app/assets/stylesheets/admin/vendor/jquery.tagsinput.css +99 -0
  73. data/app/assets/stylesheets/admin/vendor/token-input-facebook.patched.css +126 -0
  74. data/app/assets/stylesheets/admin/vendor/token-input.patched.css +116 -0
  75. data/app/controllers/admin/autocomplete_controller.rb +14 -0
  76. data/app/controllers/admin/image_upload_controller.rb +27 -0
  77. data/app/controllers/admin/lookups_controller.rb +52 -0
  78. data/app/controllers/admin/notifier_controller.rb +7 -0
  79. data/app/controllers/admin/site_meta_tags_controller.rb +43 -0
  80. data/app/controllers/admin/sortable_controller.rb +26 -0
  81. data/app/controllers/concerns/admin/path_history.rb +39 -0
  82. data/app/controllers/concerns/page_meta_tags.rb +71 -0
  83. data/app/helpers/admin/lookup_helper.rb +23 -0
  84. data/app/helpers/admin/search_helper.rb +59 -0
  85. data/app/helpers/admin_helper.rb +29 -0
  86. data/app/helpers/common_helper.rb +22 -0
  87. data/app/helpers/lookup_helper.rb +72 -0
  88. data/app/helpers/nested_fields_helper.rb +12 -0
  89. data/app/helpers/static_text_formatter.rb +25 -0
  90. data/app/helpers/twitter_builder_helper.rb +253 -0
  91. data/app/helpers/twitter_form_builder.rb +202 -0
  92. data/app/models/file_upload.rb +19 -0
  93. data/app/models/lookup.rb +28 -0
  94. data/app/models/site_meta_tags.rb +16 -0
  95. data/app/uploaders/file_uploader.rb +10 -0
  96. data/app/uploaders/generic_image_uploader.rb +74 -0
  97. data/app/uploaders/meta_tags_image_uploader.rb +5 -0
  98. data/app/utils/admin_structure.rb +82 -0
  99. data/app/utils/bootstrap_link_renderer.rb +40 -0
  100. data/app/utils/table_helpers.rb +196 -0
  101. data/app/views/admin/base/_sort.haml +34 -0
  102. data/app/views/admin/common/_file_upload_template.haml +18 -0
  103. data/app/views/admin/common/_header.html.haml +28 -0
  104. data/app/views/admin/common/_image_upload_template.html.haml +40 -0
  105. data/app/views/admin/common/_menu.html.haml +2 -0
  106. data/app/views/admin/common/_menu_section.haml +10 -0
  107. data/app/views/admin/common/_menu_separator.haml +1 -0
  108. data/app/views/admin/common/_nested_fields_for.html.haml +5 -0
  109. data/app/views/admin/common/_nested_fields_for_element.html.haml +5 -0
  110. data/app/views/admin/common/_slide.haml +41 -0
  111. data/app/views/admin/common/_slides.html.haml +17 -0
  112. data/app/views/admin/common/_table_template.html.haml +14 -0
  113. data/app/views/admin/common/_upload_form.html.haml +5 -0
  114. data/app/views/admin/common/image_uploaded.js.haml +7 -0
  115. data/app/views/admin/common/upload_failed.js.erb +11 -0
  116. data/app/views/admin/common/upload_image.js.erb +6 -0
  117. data/app/views/admin/home/dashboard.html.haml +5 -0
  118. data/app/views/admin/lookups/_form.html.haml +10 -0
  119. data/app/views/admin/lookups/edit.html.haml +5 -0
  120. data/app/views/admin/lookups/index.html.haml +6 -0
  121. data/app/views/admin/lookups/types/_boolean.haml +1 -0
  122. data/app/views/admin/lookups/types/_enum.haml +1 -0
  123. data/app/views/admin/lookups/types/_file.haml +3 -0
  124. data/app/views/admin/lookups/types/_float.haml +1 -0
  125. data/app/views/admin/lookups/types/_integer.haml +1 -0
  126. data/app/views/admin/lookups/types/_memo.haml +1 -0
  127. data/app/views/admin/lookups/types/_string.haml +1 -0
  128. data/app/views/admin/lookups/types/_wysiwyg.haml +1 -0
  129. data/app/views/admin/site_meta_tags/_form.html.haml +22 -0
  130. data/app/views/admin/site_meta_tags/edit.html.haml +5 -0
  131. data/app/views/admin/site_meta_tags/index.html.haml +5 -0
  132. data/app/views/layouts/admin.html.haml +44 -0
  133. data/app/views/structure/_section.haml +17 -0
  134. data/coalla-cms.gemspec +42 -0
  135. data/config/locales/devise.ru.yml +59 -0
  136. data/config/locales/will_paginate.ru.yml +6 -0
  137. data/lib/coalla-cms.rb +17 -0
  138. data/lib/coalla/cms/engine.rb +16 -0
  139. data/lib/coalla/cms/version.rb +5 -0
  140. data/lib/coalla/ext/mapper.rb +14 -0
  141. data/lib/coalla/orm/page_slider.rb +55 -0
  142. data/lib/coalla/orm/relation.rb +35 -0
  143. data/lib/coalla/orm/sanitized.rb +16 -0
  144. data/lib/coalla/sanitize/config/default.rb +526 -0
  145. data/lib/generators/coalla/cms/create_admin_administrators_generator.rb +29 -0
  146. data/lib/generators/coalla/cms/create_admin_generator.rb +50 -0
  147. data/lib/generators/coalla/cms/create_admin_login_view_generator.rb +23 -0
  148. data/lib/generators/coalla/cms/create_markup_generator.rb +30 -0
  149. data/lib/generators/coalla/cms/file_uploads/install_generator.rb +35 -0
  150. data/lib/generators/coalla/cms/file_uploads/mount_generator.rb +34 -0
  151. data/lib/generators/coalla/cms/file_uploads/templates/add_column_migration.rb.erb +5 -0
  152. data/lib/generators/coalla/cms/file_uploads/templates/migration.rb +17 -0
  153. data/lib/generators/coalla/cms/image/install_generator.rb +39 -0
  154. data/lib/generators/coalla/cms/image/mount_generator.rb +50 -0
  155. data/lib/generators/coalla/cms/image/templates/migration.rb.erb +9 -0
  156. data/lib/generators/coalla/cms/image/templates/model.rb.erb +5 -0
  157. data/lib/generators/coalla/cms/image/templates/mount/migration.rb.erb +6 -0
  158. data/lib/generators/coalla/cms/image/templates/mount/uploader.rb.erb +3 -0
  159. data/lib/generators/coalla/cms/image/templates/uploader.rb.erb +3 -0
  160. data/lib/generators/coalla/cms/init_generator.rb +136 -0
  161. data/lib/generators/coalla/cms/lookups/install_generator.rb +54 -0
  162. data/lib/generators/coalla/cms/lookups/templates/migration.rb +17 -0
  163. data/lib/generators/coalla/cms/market/install_generator.rb +71 -0
  164. data/lib/generators/coalla/cms/market/templates/controllers/categories_controller.rb +47 -0
  165. data/lib/generators/coalla/cms/market/templates/controllers/products_controller.rb +50 -0
  166. data/lib/generators/coalla/cms/market/templates/controllers/properties_controller.rb +59 -0
  167. data/lib/generators/coalla/cms/market/templates/market.rb +5 -0
  168. data/lib/generators/coalla/cms/market/templates/market.ru.yml +53 -0
  169. data/lib/generators/coalla/cms/market/templates/migrations/create_categories.rb +15 -0
  170. data/lib/generators/coalla/cms/market/templates/migrations/create_product_properties.rb +18 -0
  171. data/lib/generators/coalla/cms/market/templates/migrations/create_products.rb +18 -0
  172. data/lib/generators/coalla/cms/market/templates/migrations/create_properties.rb +11 -0
  173. data/lib/generators/coalla/cms/market/templates/models/category.rb +36 -0
  174. data/lib/generators/coalla/cms/market/templates/models/product.rb +16 -0
  175. data/lib/generators/coalla/cms/market/templates/models/product_property.rb +14 -0
  176. data/lib/generators/coalla/cms/market/templates/models/property.rb +7 -0
  177. data/lib/generators/coalla/cms/market/templates/views/categories/_form.html.haml +10 -0
  178. data/lib/generators/coalla/cms/market/templates/views/categories/edit.html.haml +5 -0
  179. data/lib/generators/coalla/cms/market/templates/views/categories/index.html.haml +17 -0
  180. data/lib/generators/coalla/cms/market/templates/views/categories/new.html.haml +4 -0
  181. data/lib/generators/coalla/cms/market/templates/views/products/_form.html.haml +17 -0
  182. data/lib/generators/coalla/cms/market/templates/views/products/_product_property_fields.html.haml +13 -0
  183. data/lib/generators/coalla/cms/market/templates/views/products/edit.html.haml +5 -0
  184. data/lib/generators/coalla/cms/market/templates/views/products/index.html.haml +17 -0
  185. data/lib/generators/coalla/cms/market/templates/views/products/new.html.haml +4 -0
  186. data/lib/generators/coalla/cms/market/templates/views/properties/_form.html.haml +9 -0
  187. data/lib/generators/coalla/cms/market/templates/views/properties/edit.html.haml +5 -0
  188. data/lib/generators/coalla/cms/market/templates/views/properties/index.html.haml +15 -0
  189. data/lib/generators/coalla/cms/market/templates/views/properties/new.html.haml +4 -0
  190. data/lib/generators/coalla/cms/meta_tags/install_generator.rb +58 -0
  191. data/lib/generators/coalla/cms/meta_tags/templates/migration.rb +23 -0
  192. data/lib/generators/coalla/cms/news/scaffold_generator.rb +50 -0
  193. data/lib/generators/coalla/cms/news/templates/entity.rb.erb +10 -0
  194. data/lib/generators/coalla/cms/news/templates/entity_controller_template.rb.erb +47 -0
  195. data/lib/generators/coalla/cms/news/templates/entity_image_uploader.rb.erb +7 -0
  196. data/lib/generators/coalla/cms/news/templates/migration.rb.erb +15 -0
  197. data/lib/generators/coalla/cms/news/templates/views/_form.haml.erb +16 -0
  198. data/lib/generators/coalla/cms/news/templates/views/edit.haml.erb +5 -0
  199. data/lib/generators/coalla/cms/news/templates/views/index.haml.erb +18 -0
  200. data/lib/generators/coalla/cms/news/templates/views/new.haml.erb +5 -0
  201. data/lib/generators/coalla/cms/orm_helpers.rb +31 -0
  202. data/lib/generators/coalla/cms/scaffold_generator.rb +53 -0
  203. data/lib/generators/coalla/cms/scaffold_helper.rb +11 -0
  204. data/lib/generators/coalla/cms/setup_admin_generator.rb +63 -0
  205. data/lib/generators/coalla/cms/setup_routes_generator.rb +29 -0
  206. data/lib/generators/coalla/cms/slider/init_generator.rb +41 -0
  207. data/lib/generators/coalla/cms/slider/templates/migration.rb.erb +25 -0
  208. data/lib/generators/coalla/cms/slider/templates/slider_image.rb.erb +10 -0
  209. data/lib/generators/coalla/cms/slider/templates/slider_image_uploader.rb.erb +7 -0
  210. data/lib/generators/coalla/cms/slider/templates/slider_upload_controller.rb.erb +19 -0
  211. data/lib/generators/coalla/cms/templates/.gitattributes +4 -0
  212. data/lib/generators/coalla/cms/templates/.gitignore +86 -0
  213. data/lib/generators/coalla/cms/templates/assets.rb +11 -0
  214. data/lib/generators/coalla/cms/templates/controllers/admin/administrators_controller.rb +55 -0
  215. data/lib/generators/coalla/cms/templates/controllers/admin/base_controller.rb.erb +35 -0
  216. data/lib/generators/coalla/cms/templates/controllers/admin/home_controller.rb.erb +6 -0
  217. data/lib/generators/coalla/cms/templates/controllers/admin/scaffold_controller_template.rb.erb +45 -0
  218. data/lib/generators/coalla/cms/templates/controllers/home_controller.rb.erb +6 -0
  219. data/lib/generators/coalla/cms/templates/controllers/markup_controller.rb.erb +2 -0
  220. data/lib/generators/coalla/cms/templates/database.yml.erb +35 -0
  221. data/lib/generators/coalla/cms/templates/errors/404.html +39 -0
  222. data/lib/generators/coalla/cms/templates/errors/422.html +39 -0
  223. data/lib/generators/coalla/cms/templates/errors/500.html +39 -0
  224. data/lib/generators/coalla/cms/templates/initializers/carrierwave.rb +98 -0
  225. data/lib/generators/coalla/cms/templates/locales/activerecord.en.yml +16 -0
  226. data/lib/generators/coalla/cms/templates/locales/activerecord.ru.yml +29 -0
  227. data/lib/generators/coalla/cms/templates/locales/admin.en.yml +27 -0
  228. data/lib/generators/coalla/cms/templates/locales/admin.ru.yml +27 -0
  229. data/lib/generators/coalla/cms/templates/locales/devise.ru.yml +59 -0
  230. data/lib/generators/coalla/cms/templates/migration.rb +11 -0
  231. data/lib/generators/coalla/cms/templates/migration_existing.rb +15 -0
  232. data/lib/generators/coalla/cms/templates/schedule.rb +3 -0
  233. data/lib/generators/coalla/cms/templates/structure.rb +0 -0
  234. data/lib/generators/coalla/cms/templates/views/admin/administrators/_form.html.haml +9 -0
  235. data/lib/generators/coalla/cms/templates/views/admin/administrators/edit.html.haml +5 -0
  236. data/lib/generators/coalla/cms/templates/views/admin/administrators/index.html.haml +15 -0
  237. data/lib/generators/coalla/cms/templates/views/admin/administrators/new.html.haml +4 -0
  238. data/lib/generators/coalla/cms/templates/views/admin/scaffold_template/_form.html.haml.erb +14 -0
  239. data/lib/generators/coalla/cms/templates/views/admin/scaffold_template/edit.html.haml.erb +5 -0
  240. data/lib/generators/coalla/cms/templates/views/admin/scaffold_template/index.html.haml.erb +15 -0
  241. data/lib/generators/coalla/cms/templates/views/admin/scaffold_template/new.html.haml.erb +4 -0
  242. data/lib/generators/coalla/cms/templates/views/administrators/sessions/new.html.haml +19 -0
  243. data/lib/generators/coalla/cms/templates/views/home/index.html.haml.erb +1 -0
  244. data/lib/generators/coalla/cms/wysiwyg/ckeditor_generator.rb +17 -0
  245. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/mediaembed/icons/hidpi/mediaembed.png +0 -0
  246. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/mediaembed/icons/mediaembed.png +0 -0
  247. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/mediaembed/plugin.js +64 -0
  248. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/LICENSE.txt +303 -0
  249. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad-gallery-css-diff.htm +831 -0
  250. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad_next.png +0 -0
  251. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad_prev.png +0 -0
  252. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad_scroll_back.png +0 -0
  253. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/ad_scroll_forward.png +0 -0
  254. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/jquery.ad-gallery.css +185 -0
  255. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/jquery.ad-gallery.js +984 -0
  256. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/jquery.ad-gallery.min - ref.js +10 -0
  257. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/jquery.ad-gallery.min.js +1 -0
  258. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/loader.gif +0 -0
  259. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/opa75.png +0 -0
  260. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/placeholder.png +0 -0
  261. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/ad-gallery/trans.gif +0 -0
  262. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/blank.gif +0 -0
  263. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_loading.gif +0 -0
  264. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_loading@2x.gif +0 -0
  265. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_overlay.png +0 -0
  266. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_sprite.png +0 -0
  267. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/fancybox_sprite@2x.png +0 -0
  268. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/fancybox_buttons.png +0 -0
  269. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-buttons.css +97 -0
  270. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-buttons.js +122 -0
  271. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-media.js +199 -0
  272. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-thumbs.css +55 -0
  273. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/helpers/jquery.fancybox-thumbs.js +162 -0
  274. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/jquery.fancybox.css +274 -0
  275. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/jquery.fancybox.js +2020 -0
  276. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/3rdParty/fancybox2/jquery.fancybox.pack.js +46 -0
  277. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/README.md +66 -0
  278. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/dialogs/slideshow.js +1396 -0
  279. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/dialogs/slideshow.min.js +1 -0
  280. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/icons/placeholder.png +0 -0
  281. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/icons/slideshow.png +0 -0
  282. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/lang/Serbian_translation.txt +9 -0
  283. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/lang/el.js +37 -0
  284. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/lang/en.js +35 -0
  285. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/lang/fr.js +35 -0
  286. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/lang/ru.js +35 -0
  287. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/lang/sr-latn.js +35 -0
  288. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/lang/sr.js +35 -0
  289. data/lib/generators/coalla/cms/wysiwyg/templates/ckeditor/plugins/slideshow/plugin.js +217 -0
  290. metadata +613 -0
@@ -0,0 +1,46 @@
1
+ /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,
3
+ width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
4
+ keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
5
+ (I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
6
+ openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
7
+ isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
8
+ c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
9
+ k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
10
+ b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
11
+ setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;
12
+ d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=
13
+ a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),
14
+ b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),
15
+ y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;
16
+ if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
17
+ (h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,
18
+ {},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,
19
+ mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=
20
+ !0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");
21
+ "image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=
22
+ this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);
23
+ f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,
24
+ e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,
25
+ outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}",
26
+ g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll":
27
+ "no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?
28
+ h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth||
29
+ h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&
30
+ "iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width();
31
+ y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&&
32
+ !a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),
33
+ b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
34
+ a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
35
+ (c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
36
+ f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
37
+ {duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
38
+ b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=
39
+ f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?
40
+ b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),
41
+ p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===
42
+ f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=
43
+ b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,
44
+ e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+
45
+ ":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===
46
+ d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);
@@ -0,0 +1,66 @@
1
+ SlideShow
2
+ =========
3
+ SlideShow Plugin for CKEditor
4
+
5
+ A cool plugin which allow to create and manage SlideShow in CKEditor.
6
+ You can easily Add, Remove images to create the Slide Show.
7
+
8
+ Specification
9
+ -------------
10
+ The plugin has been designed to work with the "Ad-Gallery" javascript slidshow program available at the
11
+ following location : http://adgallery.codeplex.com, and with "FancyBox" java program available at the
12
+ following location : http://fancybox.net/.
13
+ For each slide show created with this plugin, you can adjust most of the available controls
14
+ available in ad-gallery :
15
+
16
+ Slide Effect.
17
+ Animation Speed.
18
+ Animation Delay.
19
+ Auto Start
20
+ Show / Hide Thumbnails.
21
+ Sho / Hide "Start - Stop" Buttons
22
+ Open Image on Click (with a FancyBox pop-up).
23
+ ...
24
+
25
+ Internationalization
26
+ -------------------------
27
+ Currently plugin supports 2 languages.
28
+
29
+ * en
30
+ * tr
31
+
32
+ *Translations are welcomed.*
33
+
34
+ Usage
35
+ -------------------------
36
+ 1. Download source files and place them on to be created "slideshow" folder under the CKeditor's plugin base.
37
+ 2. Define plugin in CKEDITOR config object.
38
+ CKEDITOR.config.extraPlugins = 'slideshow';
39
+ 3. Set your CKEDITOR language if you did not set it yet.
40
+ CKEDITOR.config.language = 'en';
41
+ 4. You're Done !! Just enjoy.
42
+
43
+ The needed files for "ad-gallery" and "fancybox" are located under the 3rdParty directory, in the plugin package.
44
+ They are just copy of the files from respective web sites (ad-gallery and fancybox), just a fews modifs have been made
45
+ in the as-gallery css file, for info, and for curious people, the diffs compared to the original are in the patch
46
+ file under this ad-gallery directory.
47
+ Normally, nothing special has too be done with these files. If you like to change their location, just edit the "slidesho.js"
48
+ and update the variables on top of this file.
49
+
50
+ Requirements
51
+ -------------------------
52
+ To correctly work, you need to have access to CKEditor, KCFinder (or any stuff to allow to upkoad images
53
+ on the server), ad-gallery javascript / css and fancybox javascript and css.
54
+
55
+ Demo
56
+ -------------------------
57
+ [View the live demo](http://www.slideshow.promo-stic.fr/).
58
+
59
+
60
+ Cheers
61
+ --------------------
62
+ Thanks to [CKeditor] [1] and [ad-gallery] [2] and [fancybox] [3] people for their good work.
63
+
64
+ [1]: http://ckeditor.com "CKeditor"
65
+ [2]: http://adgallery.codeplex.com "ad-gallery"
66
+ [3]: http://fancybox.net/ "fancybox"
@@ -0,0 +1,1396 @@
1
+ /**
2
+ * The slideshow dialog definition.
3
+ * Copyright (c) 2003-2013, Cricri042. All rights reserved.
4
+ * Targeted for "ad-gallery" JavaScript : http://adgallery.codeplex.com/
5
+ * And "Fancybox" : http://fancyapps.com/fancybox/
6
+ */
7
+ /**
8
+ * Debug : var_dump
9
+ *
10
+ * @var: Var
11
+ * @level: Level max
12
+ *
13
+ */
14
+
15
+ function removeDomainFromUrl(string) {
16
+ return string.replace(/^https?:\/\/[^\/]+/i, '');
17
+ }
18
+
19
+ var IMG_PARAM = {"URL":0, "TITLE":1, "ALT":2, "WIDTH":3, "HEIGHT":4},
20
+ pluginPath = removeDomainFromUrl(CKEDITOR.plugins.get( 'slideshow' ).path),
21
+ BASE_PATH = removeDomainFromUrl(CKEDITOR.basePath),
22
+ SCRIPT_JQUERY = "https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js",
23
+ SCRIPT_ADDGAL = pluginPath+"3rdParty/ad-gallery/jquery.ad-gallery.min.js",
24
+ CSS_ADDGAL = pluginPath+"3rdParty/ad-gallery/jquery.ad-gallery.css",
25
+ SCRIPT_FANCYBOX = pluginPath+'3rdParty/fancybox2/jquery.fancybox.pack.js?v=2.1.5',
26
+ CSS_FANCYBOX = pluginPath+"3rdParty/fancybox2/jquery.fancybox.css?v=2.1.5";
27
+
28
+ function var_dump(_var, _level) {
29
+ var dumped_text = "";
30
+ if(!_level) _level = 0;
31
+
32
+ //The padding given at the beginning of the line.
33
+ var level_padding = "";
34
+ for(var j=0; j<_level+1; j++) level_padding += " ";
35
+
36
+ if(typeof(_var) == 'object') { //Array/Hashes/Objects
37
+ for(var item in _var) {
38
+ var value = _var[item];
39
+
40
+ if(typeof(value) == 'object') { // If it is an array,
41
+ dumped_text += level_padding + "'" + item + "' ...\n";
42
+ dumped_text += var_dump(value, _level+1);
43
+ } else {
44
+ dumped_text += level_padding +"'"+ item +"' => \""+ value +"\"\n";
45
+ }
46
+ }
47
+ } else { //Stings/Chars/Numbers etc.
48
+ dumped_text = "===>"+ _var +"<===("+ typeof(_var) +")";
49
+ }
50
+ return dumped_text;
51
+ };
52
+
53
+ var listItem = function( node ) {
54
+ return node.type == CKEDITOR.NODE_ELEMENT && node.is( 'li' );
55
+ };
56
+
57
+ var ULItem = function( node ) {
58
+ return node.type == CKEDITOR.NODE_ELEMENT && node.is( 'ul' );
59
+ };
60
+
61
+ var iFrameItem = function( node ) {
62
+ return node.type == CKEDITOR.NODE_ELEMENT && node.is( 'iframe' );
63
+ };
64
+
65
+ Array.prototype.pushUnique = function (item){
66
+ for ( var i = 0; i < this.length ; i++ ) {
67
+ if (this[i][0] == item[0]) return -1;
68
+ }
69
+ this.push(item);
70
+ return this.length - 1;
71
+ };
72
+
73
+ Array.prototype.updateVal = function (item, data){
74
+ for ( var i = 0; i < this.length ; i++ ) {
75
+ if (this[i][0] == item) {
76
+ this[i] = [item, data];
77
+ return true;
78
+ };
79
+ };
80
+ this[i] = [item, data];
81
+ return false;
82
+ };
83
+
84
+ Array.prototype.getVal = function (item){
85
+ for ( var i = 0; i < this.length ; i++ ) {
86
+ if (this[i][0] == item) {
87
+ return this[i][1];
88
+ };
89
+ };
90
+ return null;
91
+ };
92
+
93
+
94
+ // Our dialog definition.
95
+ CKEDITOR.dialog.add( 'slideshowDialog', function( editor ) {
96
+ var lang = editor.lang.slideshow;
97
+
98
+ //----------------------------------------------------------------------------------------------------
99
+ // COMBO STUFF
100
+ //----------------------------------------------------------------------------------------------------
101
+ // Add a new option to a CHKBOX object (combo or list).
102
+ function addOption( combo, optionText, optionValue, documentObject, index )
103
+ {
104
+ combo = getSelect( combo );
105
+ var oOption;
106
+ if ( documentObject )
107
+ oOption = documentObject.createElement( "OPTION" );
108
+ else
109
+ oOption = document.createElement( "OPTION" );
110
+
111
+ if ( combo && oOption && oOption.getName() == 'option' )
112
+ {
113
+ if ( CKEDITOR.env.ie ) {
114
+ if ( !isNaN( parseInt( index, 10) ) )
115
+ combo.$.options.add( oOption.$, index );
116
+ else
117
+ combo.$.options.add( oOption.$ );
118
+
119
+ oOption.$.innerHTML = optionText.length > 0 ? optionText : '';
120
+ oOption.$.value = optionValue;
121
+ }
122
+ else
123
+ {
124
+ if ( index !== null && index < combo.getChildCount() )
125
+ combo.getChild( index < 0 ? 0 : index ).insertBeforeMe( oOption );
126
+ else
127
+ combo.append( oOption );
128
+
129
+ oOption.setText( optionText.length > 0 ? optionText : '' );
130
+ oOption.setValue( optionValue );
131
+ }
132
+ } else {
133
+ return false;
134
+ }
135
+ return oOption;
136
+ };
137
+ // Remove all selected options from a CHKBOX object.
138
+ function removeSelectedOptions( combo )
139
+ {
140
+ combo = getSelect( combo );
141
+ // Save the selected index
142
+ var iSelectedIndex = getSelectedIndex( combo );
143
+ // Remove all selected options.
144
+ for ( var i = combo.getChildren().count() - 1 ; i >= 0 ; i-- )
145
+ {
146
+ if ( combo.getChild( i ).$.selected )
147
+ combo.getChild( i ).remove();
148
+ }
149
+
150
+ // Reset the selection based on the original selected index.
151
+ setSelectedIndex( combo, iSelectedIndex );
152
+ };
153
+ //Modify option from a CHKBOX object.
154
+ function modifyOption( combo, index, title, value )
155
+ {
156
+ combo = getSelect( combo );
157
+ if ( index < 0 )
158
+ return false;
159
+ var child = combo.getChild( index );
160
+ child.setText( title );
161
+ child.setValue( value );
162
+ return child;
163
+ };
164
+ function removeAllOptions( combo )
165
+ {
166
+ combo = getSelect( combo );
167
+ while ( combo.getChild( 0 ) && combo.getChild( 0 ).remove() )
168
+ { /*jsl:pass*/ }
169
+ };
170
+ // Moves the selected option by a number of steps (also negative).
171
+ function changeOptionPosition( combo, steps, documentObject )
172
+ {
173
+ combo = getSelect( combo );
174
+ var iActualIndex = getSelectedIndex( combo );
175
+ if ( iActualIndex < 0 )
176
+ return false;
177
+
178
+ var iFinalIndex = iActualIndex + steps;
179
+ iFinalIndex = ( iFinalIndex < 0 ) ? 0 : iFinalIndex;
180
+ iFinalIndex = ( iFinalIndex >= combo.getChildCount() ) ? combo.getChildCount() - 1 : iFinalIndex;
181
+
182
+ if ( iActualIndex == iFinalIndex )
183
+ return false;
184
+
185
+ var oOption = combo.getChild( iActualIndex ),
186
+ sText = oOption.getText(),
187
+ sValue = oOption.getValue();
188
+
189
+ oOption.remove();
190
+
191
+ oOption = addOption( combo, sText, sValue, ( !documentObject ) ? null : documentObject, iFinalIndex );
192
+ setSelectedIndex( combo, iFinalIndex );
193
+ return oOption;
194
+ };
195
+ function getSelectedIndex( combo )
196
+ {
197
+ combo = getSelect( combo );
198
+ return combo ? combo.$.selectedIndex : -1;
199
+ };
200
+ function setSelectedIndex( combo, index )
201
+ {
202
+ combo = getSelect( combo );
203
+ if ( index < 0 )
204
+ return null;
205
+ var count = combo.getChildren().count();
206
+ combo.$.selectedIndex = ( index >= count ) ? ( count - 1 ) : index;
207
+ return combo;
208
+ };
209
+ function getOptions( combo )
210
+ {
211
+ combo = getSelect( combo );
212
+ return combo ? combo.getChildren() : false;
213
+ };
214
+ function getSelect( obj )
215
+ {
216
+ if ( obj && obj.domId && obj.getInputElement().$ )
217
+ return obj.getInputElement();
218
+ else if ( obj && obj.$ )
219
+ return obj;
220
+ return false;
221
+ };
222
+
223
+ function unselectAll(dialog) {
224
+ var editBtn = dialog.getContentElement( 'slideshowinfoid', 'editselectedbtn');
225
+ var deleteBtn = dialog.getContentElement( 'slideshowinfoid', 'removeselectedbtn');
226
+ editBtn = getSelect( editBtn );
227
+ editBtn.hide();
228
+ deleteBtn = getSelect( deleteBtn );
229
+ deleteBtn.hide();
230
+ var comboList = dialog.getContentElement( 'slideshowinfoid', 'imglistitemsid');
231
+ comboList = getSelect( comboList );
232
+ for ( var i = comboList.getChildren().count() - 1 ; i >= 0 ; i-- )
233
+ {
234
+ comboList.getChild( i ).$.selected = false;
235
+ }
236
+ };
237
+
238
+ function unselectIfNotUnique(combo) {
239
+ var dialog = combo.getDialog();
240
+ var selectefItem = null;
241
+ combo = getSelect( combo );
242
+ var cnt = 0;
243
+ var editBtn = dialog.getContentElement( 'slideshowinfoid', 'editselectedbtn');
244
+ var deleteBtn = dialog.getContentElement( 'slideshowinfoid', 'removeselectedbtn');
245
+ for ( var i = combo.getChildren().count() - 1 ; i >= 0 ; i-- )
246
+ {
247
+ var child = combo.getChild( i );
248
+ if ( child.$.selected ) {
249
+ cnt++;
250
+ selectefItem = child;
251
+ }
252
+ }
253
+ if (cnt > 1) {
254
+ unselectAll(dialog);
255
+ return null;
256
+ } else {
257
+ if (cnt == 1) {
258
+ editBtn = getSelect( editBtn );
259
+ editBtn.show();
260
+ deleteBtn = getSelect( deleteBtn );
261
+ deleteBtn.show();
262
+ displaySelected(dialog);
263
+ return selectefItem;
264
+ }
265
+ }
266
+ return null;
267
+ };
268
+
269
+ function displaySelected (dialog) {
270
+ if (dialog.openCloseStep == true) return;
271
+ var previewCombo = dialog.getContentElement( 'slideshowinfoid', 'framepreviewid');
272
+ if ( previewCombo.isVisible()) {
273
+ previewSlideShow(dialog);
274
+ } else {
275
+ editeSelected(dialog);
276
+ }
277
+ };
278
+
279
+ function selectFirstIfNotUnique(combo) {
280
+ var dialog = combo.getDialog();
281
+ combo = getSelect( combo );
282
+ var firstSelectedInd = 0;
283
+ for ( var i = 0; i < combo.getChildren().count() ; i++ )
284
+ {
285
+ var child = combo.getChild( i );
286
+ if ( child.$.selected ) {
287
+ selectefItem = child;
288
+ firstSelectedInd = i;
289
+ break;
290
+ }
291
+ }
292
+ setSelectedIndex(combo, firstSelectedInd);
293
+ displaySelected(dialog);
294
+ }
295
+
296
+ function getSlectedIndex(dialog) {
297
+ var combo = dialog.getContentElement( 'slideshowinfoid', 'imglistitemsid');
298
+ return getSelectedIndex( combo );
299
+ };
300
+
301
+ //----------------------------------------------------------------------------------------------------
302
+ //----------------------------------------------------------------------------------------------------
303
+
304
+ function removePlaceHolderImg(dialog) {
305
+ var urlPlaceHolder = BASE_PATH + 'plugins/slideshow/icons/placeholder.png' ;
306
+ if ((dialog.imagesList.length == 1) && (dialog.imagesList[0][IMG_PARAM.URL] == urlPlaceHolder)) {
307
+ // Remove the place Holder Image
308
+ var combo = dialog.getContentElement( 'slideshowinfoid', 'imglistitemsid');
309
+ combo = getSelect( combo );
310
+ var i = 0;
311
+ // Remove image from image Array
312
+ dialog.imagesList.splice(i, 1);
313
+ // Remove image from combo image list
314
+ combo.getChild( i ).remove();
315
+ }
316
+ }
317
+
318
+ function updateImgList(dialog) {
319
+ removePlaceHolderImg(dialog);
320
+ var preview = dialog.previewImage;
321
+ var url = preview.$.src;
322
+ var ratio = preview.$.width / preview.$.height;
323
+ var w = 50;
324
+ var h = 50;
325
+ if (ratio > 1) {
326
+ h = h/ratio;
327
+ } else {
328
+ w = w*ratio;
329
+ }
330
+ var ind = dialog.imagesList.pushUnique([url, '', '', w.toFixed(0), h.toFixed(0)]);
331
+ if (ind >= 0) {
332
+ oOption = addOption( combo, 'IMG_'+ind + ' : ' + url.substring(url.lastIndexOf('/')+1), url, dialog.getParentEditor().document );
333
+ // select index 0
334
+ setSelectedIndex(combo, ind);
335
+ // Update dialog
336
+ displaySelected(dialog);
337
+ }
338
+ };
339
+
340
+ function editeSelected(dialog) {
341
+ var combo = dialog.getContentElement( 'slideshowinfoid', 'imglistitemsid');
342
+ var iSelectedIndex = getSelectedIndex( combo );
343
+ var value = dialog.imagesList[iSelectedIndex];
344
+
345
+ combo = dialog.getContentElement( 'slideshowinfoid', 'imgtitleid');
346
+ combo = getSelect( combo );
347
+ combo.setValue(value[1]);
348
+ combo = dialog.getContentElement( 'slideshowinfoid', 'imgdescid');
349
+ combo = getSelect( combo );
350
+ combo.setValue(value[2]);
351
+ combo = dialog.getContentElement( 'slideshowinfoid', 'imgpreviewid');
352
+ combo = getSelect( combo );
353
+ //console.log( "VALUE IMG -> " + value[iSelectedIndex] );
354
+ var imgHtml = '<div style="text-align:center;"> <img src="'+ value[0] +
355
+ '" title="' + value[1] +
356
+ '" alt="' + value[2] +
357
+ '" style=" max-height: 200px; max-width: 350px;' + '"> </div>';
358
+ combo.setHtml(imgHtml);
359
+ var previewCombo = dialog.getContentElement( 'slideshowinfoid', 'framepreviewid');
360
+ var imgCombo = dialog.getContentElement( 'slideshowinfoid', 'imgparamsid');
361
+ previewCombo = getSelect( previewCombo );
362
+ previewCombo.hide();
363
+ imgCombo = getSelect( imgCombo );
364
+ imgCombo.show();
365
+ };
366
+
367
+ function removeSelected(dialog) {
368
+ var combo = dialog.getContentElement( 'slideshowinfoid', 'imglistitemsid');
369
+ combo = getSelect( combo );
370
+ var someRemoved = false;
371
+ // Remove all selected options.
372
+ for ( var i = combo.getChildren().count() - 1 ; i >= 0 ; i-- )
373
+ {
374
+ if ( combo.getChild( i ).$.selected ) {
375
+ // Remove image from image Array
376
+ dialog.imagesList.splice(i, 1);
377
+ // Remove image from combo image list
378
+ combo.getChild( i ).remove();
379
+ someRemoved = true;
380
+ }
381
+ }
382
+ if (someRemoved) {
383
+ if (dialog.imagesList.length == 0) {
384
+ var url = BASE_PATH + 'plugins/slideshow/icons/placeholder.png' ;
385
+ oOption = addOption( combo, 'IMG_0' + ' : ' + url.substring(url.lastIndexOf('/')+1) , url, dialog.getParentEditor().document );
386
+ dialog.imagesList.pushUnique([url, lang.imgTitle, lang.imgDesc, '50', '50']);
387
+ }
388
+ // select index 0
389
+ setSelectedIndex(combo, 0);
390
+ // Update dialog
391
+ displaySelected(dialog);
392
+ }
393
+ };
394
+
395
+ // To automatically get the dimensions of the poster image
396
+ var onImgLoadEvent = function() {
397
+ // Image is ready.
398
+ var preview = this.previewImage;
399
+ preview.removeListener( 'load', onImgLoadEvent );
400
+ preview.removeListener( 'error', onImgLoadErrorEvent );
401
+ preview.removeListener( 'abort', onImgLoadErrorEvent );
402
+ //console.log( "previewImage -> " + preview );
403
+ updateImgList(this);
404
+ };
405
+
406
+ var onImgLoadErrorEvent = function() {
407
+ // Error. Image is not loaded.
408
+ var preview = this.previewImage;
409
+ preview.removeListener( 'load', onImgLoadEvent );
410
+ preview.removeListener( 'error', onImgLoadErrorEvent );
411
+ preview.removeListener( 'abort', onImgLoadErrorEvent );
412
+ };
413
+
414
+ function updateTitle(dialog, val) {
415
+ dialog.imagesList[getSlectedIndex(dialog)][IMG_PARAM.TITLE] = val;
416
+ editeSelected(dialog);
417
+ }
418
+
419
+ function updateDescription(dialog, val) {
420
+ dialog.imagesList[getSlectedIndex(dialog)][IMG_PARAM.ALT] = val;
421
+ editeSelected(dialog);
422
+ }
423
+
424
+ function previewSlideShow(dialog) {
425
+ var previewCombo = dialog.getContentElement( 'slideshowinfoid', 'framepreviewid');
426
+ var imgCombo = dialog.getContentElement( 'slideshowinfoid', 'imgparamsid');
427
+ imgCombo = getSelect( imgCombo );
428
+ imgCombo.hide();
429
+ previewCombo = getSelect( previewCombo );
430
+ previewCombo.show();
431
+ updateFramePreview(dialog);
432
+ };
433
+
434
+ function feedFrame(frame, data) {
435
+ frame.open();
436
+ frame.writeln( data );
437
+ frame.close();
438
+ };
439
+
440
+ // function unprotectRealComments( html )
441
+ // {
442
+ // return html.replace( /<!--\{cke_protected\}\{C\}([\s\S]+?)-->/g,
443
+ // function( match, data )
444
+ // {
445
+ // return decodeURIComponent( data );
446
+ // });
447
+ // };
448
+ //
449
+ // function unprotectSource( html, editor )
450
+ // {
451
+ // return html.replace( /<!--\{cke_protected\}([\s\S]+?)-->/g, function( match, data )
452
+ // {
453
+ // return decodeURIComponent( data );
454
+ // });
455
+ // }
456
+
457
+ function updateFramePreview(dialog) {
458
+ var width = 436;
459
+ var height = 300;
460
+ if ( dialog.params.getVal('showthumbid') == true) {
461
+ height -= 120;
462
+ } else if ( dialog.params.getVal('showcontrolid') == true) {
463
+ height -= 30;
464
+ }
465
+ if (dialog.imagesList.length == 0) return;
466
+ var combo = dialog.getContentElement( 'slideshowinfoid', 'imglistitemsid');
467
+ var iSelectedIndex = getSelectedIndex( combo );
468
+ if (iSelectedIndex < 0) iSelectedIndex = 0;
469
+ var combo = dialog.getContentElement( 'slideshowinfoid', 'framepreviewid');
470
+ var strVar="";
471
+ strVar += "<head>";
472
+
473
+ strVar += '<script src="'+SCRIPT_JQUERY+'" type="text/javascript"></script>';
474
+ strVar += "<script type=\"text\/javascript\" src=\""+SCRIPT_ADDGAL+"\"><\/script>";
475
+ strVar += "<link rel=\"stylesheet\" type=\"text\/css\" href=\""+CSS_ADDGAL+"\" \/>";
476
+ if ( dialog.params.getVal('openOnClickId') == true) {
477
+ strVar += "<link rel=\"stylesheet\" type=\"text\/css\" href=\""+CSS_FANCYBOX+"\" \/>";
478
+ strVar += "<script type=\"text\/javascript\" src=\""+SCRIPT_FANCYBOX+"\"><\/script>";
479
+ strVar += "<script type=\"text\/javascript\">";
480
+ strVar += createScriptFancyBoxRun(dialog);
481
+ strVar += "<\/script>";
482
+ }
483
+
484
+ strVar += "<script type=\"text\/javascript\">";
485
+ strVar += createScriptAdGalleryRun(dialog, iSelectedIndex, width, height);
486
+ strVar += "<\/script>";
487
+
488
+ strVar += "<\/head>";
489
+ strVar += "<body>";
490
+ var domGallery = createDOMdGalleryRun(dialog);
491
+ strVar += domGallery.getOuterHtml();
492
+ strVar += "<\/body>";
493
+ strVar += "";
494
+
495
+ combo = getSelect( combo );
496
+ var theFrame = combo.getFirst( iFrameItem );
497
+ if (theFrame) theFrame.remove();
498
+ var ifr = null;
499
+
500
+ var w = width+60;
501
+ var h = height;
502
+ if ( dialog.params.getVal('showthumbid') == true) {
503
+ h += 120;
504
+ } else if ( dialog.params.getVal('showcontrolid') == true) {
505
+ h += 30;
506
+ }
507
+ var iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' +
508
+ ' style="width:'+w+'px;height:'+h+'px;background:azure; "'+
509
+ ' class="cke_pasteframe"' +
510
+ ' frameborder="10" ' +
511
+ ' allowTransparency="false"' +
512
+ // ' src="' + 'data:text/html;charset=utf-8,' + strVar + '"' +
513
+ ' role="region"' +
514
+ ' scrolling="no"' +
515
+ '></iframe>' );
516
+
517
+ iframe.setAttribute('name', 'totoFrame');
518
+ iframe.setAttribute('id', 'totoFrame');
519
+ iframe.on( 'load', function( event ) {
520
+ if (ifr != null) return;
521
+ ifr = this.$;
522
+ if (ifr.contentDocument)
523
+ iframedoc = ifr.contentDocument;
524
+ else if (ifr.contentWindow)
525
+ iframedoc = ifr.contentWindow.document;
526
+ if (iframedoc){
527
+ // Put the content in the iframe
528
+ feedFrame(iframedoc, strVar);
529
+ } else {
530
+ //just in case of browsers that don't support the above 3 properties.
531
+ //fortunately we don't come across such case so far.
532
+ alert('Cannot inject dynamic contents into iframe.');
533
+ }
534
+ });
535
+ combo.append(iframe);
536
+ };
537
+
538
+ function initImgListFromDOM(dialog, slideShowContainer) {
539
+ var i, image, src;
540
+ var imgW, imgH;
541
+ var arr = slideShowContainer.$.getElementsByTagName("img");
542
+ combo = dialog.getContentElement( 'slideshowinfoid', 'imglistitemsid');
543
+ for (i = 0; i < arr.length; i++) {
544
+ image = arr[i];
545
+ src = image.src;
546
+ // IE Seems sometime to return 0 !!, So natural Width and Height seems OK
547
+ // If not just pput 50, Not as good but not so bad !!
548
+ imgW = image.width;
549
+ if (imgW == 0) imgW = image.naturalWidth;
550
+ if (imgW == 0) {
551
+ imgW = 50;
552
+ imgH = 50;
553
+ } else {
554
+ imgH = image.height;
555
+ if (imgH == 0) imgH = image.naturalHeight;
556
+ if (imgH == 0) {
557
+ imgW = 50;
558
+ imgH = 50;
559
+ }
560
+ }
561
+ var ratio = imgW / imgH;
562
+ var w = 50;
563
+ var h = 50;
564
+ if (ratio > 1) {
565
+ h = h/ratio;
566
+ } else {
567
+ w = w*ratio;
568
+ }
569
+ var ind = dialog.imagesList.pushUnique([src, image.title, image.alt, w, h]);
570
+ if (ind >= 0) {
571
+ oOption = addOption( combo, 'IMG_'+ind + ' : ' + src.substring(src.lastIndexOf('/')+1), src, dialog.getParentEditor().document );
572
+ }
573
+ }
574
+ // select index 0
575
+ setSelectedIndex(combo, 0);
576
+ // Update dialog
577
+ displaySelected(dialog);
578
+ };
579
+
580
+ function initImgListFromFresh(dialog) {
581
+ combo = dialog.getContentElement( 'slideshowinfoid', 'imglistitemsid');
582
+ var url = BASE_PATH + 'plugins/slideshow/icons/placeholder.png' ;
583
+ oOption = addOption( combo, 'IMG_0' + ' : ' + url.substring(url.lastIndexOf('/')+1) , url, dialog.getParentEditor().document );
584
+ dialog.imagesList.pushUnique([url, lang.imgTitle, lang.imgDesc, '50', '50']);
585
+ // select index 0
586
+ setSelectedIndex(combo, 0);
587
+ // Update dialog
588
+ displaySelected(dialog);
589
+ };
590
+
591
+
592
+ function commitSlideShow(dialog) {
593
+ dialog.slideshowDOM.setAttribute('data-'+this.id, this.getValue());
594
+ };
595
+
596
+ function loadValue() {
597
+ var dialog = this.getDialog();
598
+ if (dialog.newSlideShowMode) {
599
+ // New fresh SlideShow so let's put dom data attributes from dialog default values
600
+ dialog.slideshowDOM.setAttribute('data-'+this.id, this.getValue());
601
+ switch ( this.type ) {
602
+ case 'checkbox':
603
+ break;
604
+ case 'text':
605
+ break;
606
+ case 'select':
607
+ break;
608
+ default:
609
+ }
610
+ } else {
611
+ // Loaded SlideShow, so update Dialog values from DOM data attributes
612
+
613
+ switch ( this.type ) {
614
+ case 'checkbox':
615
+ this.setValue(dialog.slideshowDOM.getAttribute('data-'+this.id) == 'true');
616
+ break;
617
+ case 'text':
618
+ this.setValue(dialog.slideshowDOM.getAttribute('data-'+this.id));
619
+ break;
620
+ case 'select':
621
+ this.setValue(dialog.slideshowDOM.getAttribute('data-'+this.id));
622
+ break;
623
+ default:
624
+ }
625
+ }
626
+ };
627
+
628
+ function commitValue() {
629
+ var dialog = this.getDialog();
630
+ dialog.params.updateVal(this.id, this.getValue());
631
+ switch ( this.type ) {
632
+ case 'checkbox':
633
+ break;
634
+ case 'text':
635
+ break;
636
+ case 'select':
637
+ break;
638
+ default:
639
+ }
640
+ displaySelected(dialog);
641
+ };
642
+
643
+ function cleanAll(dialog) {
644
+ if ( dialog.previewImage )
645
+ {
646
+ dialog.previewImage.removeListener( 'load', onImgLoadEvent );
647
+ dialog.previewImage.removeListener( 'error', onImgLoadErrorEvent );
648
+ dialog.previewImage.removeListener( 'abort', onImgLoadErrorEvent );
649
+ dialog.previewImage.remove();
650
+ dialog.previewImage = null; // Dialog is closed.
651
+ }
652
+ dialog.imagesList = null;
653
+ dialog.params = null;
654
+ dialog.slideshowDOM = null;
655
+ combo = dialog.getContentElement( 'slideshowinfoid', 'imglistitemsid');
656
+ removeAllOptions(combo);
657
+ dialog.openCloseStep = false;
658
+
659
+ };
660
+
661
+ function randomChars(len) {
662
+ var chars = '';
663
+ while (chars.length < len) {
664
+ chars += Math.random().toString(36).substring(2);
665
+ }
666
+ // Remove unnecessary additional characters.
667
+ return chars.substring(0, len);
668
+ }
669
+
670
+ var numbering = function( id ) {
671
+ //return CKEDITOR.tools.getNextId() + '_' + id;
672
+ return 'cke_' + randomChars(8) + '_' + id;
673
+ };
674
+
675
+ function getImagesContainerBlock(dialog, dom) {
676
+ var obj = dom.getElementsByTag("ul");
677
+ if (obj == null) return null;
678
+ if (obj.count() == 1) {
679
+ return obj.getItem(0);
680
+ };
681
+ return null;
682
+ };
683
+
684
+ function createScriptAdGalleryRun(dialog, iSelectedIndex, width, height) {
685
+ var slideshowid = dialog.params.getVal('slideshowid'),
686
+ galleryId = 'ad-gallery_' + slideshowid,
687
+ strVar = '(function($) {',
688
+ strHook = '';
689
+ strVar += "$(function() {";
690
+ if (width == 0) width = "false";
691
+ if (height == 0) height = dialog.params.getVal('pictheightid');
692
+ if (dialog.params.getVal('showtitleid') == false) {
693
+ strHook = ", hooks: { displayDescription: function(image) {}}";
694
+ }
695
+ var params = "loader_image: '"+pluginPath+"3rdParty/ad-gallery/loader.gif'," +
696
+ " width:" + width + ", height:" + height +
697
+ ", start_at_index: " + iSelectedIndex +
698
+ ", animation_speed: " + dialog.params.getVal('animspeedid') + strHook +
699
+ ", update_window_hash: false, effect: '" + dialog.params.getVal('transitiontypeid') +
700
+ "',";
701
+ var slideShowParams = " slideshow: { enable: true, autostart: " + dialog.params.getVal('autostartid') +
702
+ ", speed: " + dialog.params.getVal('speedid') * 1000 +
703
+ ",},";
704
+ strVar += " var galleries = $('#"+galleryId+"').adGallery({" + params + slideShowParams + "});";
705
+ strVar += "});";
706
+ strVar += "})(jQuery);";
707
+ //console.log(strVar);
708
+ // strVar += "});";
709
+ return strVar;
710
+ };
711
+
712
+ function createScriptFancyBoxRun(dialog) {
713
+ var slideshowid = dialog.params.getVal('slideshowid'),
714
+ galleryId = 'ad-gallery_' + slideshowid,
715
+ str = '(function($) {';
716
+ // str += "$(document).ready(function() {";
717
+ str += "$(function() {";
718
+ str += "$(\"#"+galleryId+"\").on(\"click\",\".ad-image\",function(){";
719
+ str += "var imgObj =$(this).find(\"img\");";
720
+ str += "var isrc=imgObj.attr(\"src\");";
721
+ str += "var ititle=null;";
722
+ str += "var idesc=null;";
723
+ str += "var iname=isrc.split('/');";
724
+ str += "iname=iname[iname.length-1];";
725
+ str += "var imgdescid=$(this).find(\".ad-image-description\");";
726
+ str += "if(imgdescid){";
727
+ str += "ititle=$(this).find(\".ad-description-title\");";
728
+ str += "if(ititle)ititle=ititle.text();";
729
+ str += "if(ititle!='')ititle='<big>'+ititle+'</big>';";
730
+ str += "idesc=$(this).find(\"span\");";
731
+ str += "if(idesc)idesc=idesc.text();";
732
+ str += "if(idesc!=''){";
733
+ str += "if(ititle!='')ititle=ititle+'<br>';";
734
+ str += "idesc='<i>'+idesc+'</i>';";
735
+ str += "}";
736
+ str += "}";
737
+ str += "$.fancybox.open({";
738
+ str += "href:isrc,";
739
+ str += "beforeLoad:function(){";
740
+ str += "this.title=ititle+idesc;";
741
+ str += "},";
742
+ str += "});";
743
+ str += "});";
744
+ str += "});";
745
+ str += "})(jQuery);";
746
+ // str += "});";
747
+ //console.log(str);
748
+ return str;
749
+ };
750
+
751
+ function feedUlWithImages(dialog, ulObj) {
752
+ for ( var i = 0; i < dialog.imagesList.length ; i++ ) {
753
+ var liObj = ulObj.append( 'li' );
754
+ liObj.setAttribute( 'contenteditable', 'false');
755
+ aObj = liObj.append( 'a' );
756
+ aObj.setAttribute( 'href', removeDomainFromUrl(dialog.imagesList[i][IMG_PARAM.URL]) );
757
+ aObj.setAttribute('contenteditable', 'false');
758
+ newImgDOM = aObj.append('img');
759
+ newImgDOM.setAttribute( 'src', removeDomainFromUrl(dialog.imagesList[i][IMG_PARAM.URL]) );
760
+ newImgDOM.setAttribute( 'title', dialog.imagesList[i][IMG_PARAM.TITLE]);
761
+ newImgDOM.setAttribute( 'alt', dialog.imagesList[i][IMG_PARAM.ALT]);
762
+ newImgDOM.setAttribute( 'contenteditable', 'false');
763
+ newImgDOM.setAttribute('width', dialog.imagesList[i][IMG_PARAM.WIDTH]);
764
+ newImgDOM.setAttribute('height', dialog.imagesList[i][IMG_PARAM.HEIGHT]);
765
+ }
766
+ };
767
+
768
+ function feelFrontendWithImages(dialog, ulObj) {
769
+ for ( var i = 0; i < dialog.imagesList.length ; i++ ) {
770
+ var liObj = ulObj.append( 'li' );
771
+ // liObj.setAttribute( 'contenteditable', 'false');
772
+ // aObj = liObj.append( 'a' );
773
+ // aObj.setAttribute( 'href', removeDomainFromUrl(dialog.imagesList[i][IMG_PARAM.URL]) );
774
+ // aObj.setAttribute('contenteditable', 'false');
775
+ newImgDOM = liObj.append('img');
776
+ newImgDOM.setAttribute( 'src', removeDomainFromUrl(dialog.imagesList[i][IMG_PARAM.URL]) );
777
+ newImgDOM.setAttribute( 'title', dialog.imagesList[i][IMG_PARAM.TITLE]);
778
+ newImgDOM.setAttribute( 'alt', dialog.imagesList[i][IMG_PARAM.ALT]);
779
+ // newImgDOM.setAttribute( 'contenteditable', 'false');
780
+ // newImgDOM.setAttribute('width', dialog.imagesList[i][IMG_PARAM.WIDTH]);
781
+ // newImgDOM.setAttribute('height', dialog.imagesList[i][IMG_PARAM.HEIGHT]);
782
+ }
783
+ };
784
+
785
+ function createDOMdGalleryRun(dialog) {
786
+ var slideshowid = dialog.params.getVal('slideshowid');
787
+ var galleryId = 'ad-gallery_' + slideshowid;
788
+ var displayThumbs = 'display: block;';
789
+ var displayControls = 'display: block;';
790
+ if ( dialog.params.getVal('showthumbid') == false) {
791
+ displayThumbs = 'display: none;';
792
+ }
793
+ if ( dialog.params.getVal('showcontrolid') == false) {
794
+ displayControls = 'visibility: hidden;';
795
+ }
796
+ var slideshowDOM = editor.document.createElement( 'div' );
797
+ slideshowDOM.setAttribute('id', slideshowid );
798
+ slideshowDOM.setAttribute( 'class', 'slideshowPlugin');
799
+ slideshowDOM.setAttribute( 'contenteditable', 'false');
800
+
801
+ var galleryDiv = slideshowDOM.append('div');
802
+ galleryDiv.setAttribute( 'class', 'ad-gallery');
803
+ galleryDiv.setAttribute( 'contenteditable', 'false');
804
+ galleryDiv.setAttribute( 'id', galleryId);
805
+
806
+ var wrapperObj = galleryDiv.append('div');
807
+ wrapperObj.setAttribute( 'class', 'ad-image-wrapper');
808
+ wrapperObj.setAttribute( 'contenteditable', 'false');
809
+
810
+ var controlObj = galleryDiv.append('div');
811
+ controlObj.setAttribute( 'class', 'ad-controls');
812
+ controlObj.setAttribute( 'contenteditable', 'false');
813
+ controlObj.setAttribute( 'style', displayControls);
814
+
815
+ var navObj = galleryDiv.append('div');
816
+ navObj.setAttribute( 'class', 'ad-nav');
817
+ navObj.setAttribute( 'style', displayThumbs);
818
+ navObj.setAttribute( 'contenteditable', 'false');
819
+
820
+ var thumbsObj = navObj.append('div');
821
+ thumbsObj.setAttribute( 'class', 'ad-thumbs');
822
+ thumbsObj.setAttribute( 'contenteditable', 'false');
823
+
824
+ var ulObj = thumbsObj.append('ul');
825
+ ulObj.setAttribute('class', 'ad-thumb-list');
826
+ ulObj.setAttribute( 'contenteditable', 'false');
827
+
828
+ feedUlWithImages(dialog, ulObj);
829
+ return slideshowDOM;
830
+ };
831
+
832
+ function createGalleryFrontend(dialog) {
833
+ var slideshowid = dialog.params.getVal('slideshowid');
834
+ // var galleryId = 'ad-gallery_' + slideshowid;
835
+ // var displayThumbs = 'display: block;';
836
+ // var displayControls = 'display: block;';
837
+ // if ( dialog.params.getVal('showthumbid') == false) {
838
+ // displayThumbs = 'display: none;';
839
+ // }
840
+ // if ( dialog.params.getVal('showcontrolid') == false) {
841
+ // displayControls = 'visibility: hidden;';
842
+ // }
843
+ var slideshowDOM = editor.document.createElement( 'div' );
844
+ slideshowDOM.setAttribute('id', slideshowid );
845
+ slideshowDOM.setAttribute( 'class', 'slideshowPlugin');
846
+ // slideshowDOM.setAttribute( 'contenteditable', 'false');
847
+ //
848
+ // var galleryDiv = slideshowDOM.append('div');
849
+ // galleryDiv.setAttribute( 'class', 'ad-gallery');
850
+ // galleryDiv.setAttribute( 'contenteditable', 'false');
851
+ // galleryDiv.setAttribute( 'id', galleryId);
852
+ //
853
+ // var wrapperObj = galleryDiv.append('div');
854
+ // wrapperObj.setAttribute( 'class', 'ad-image-wrapper');
855
+ // wrapperObj.setAttribute( 'contenteditable', 'false');
856
+ //
857
+ // var controlObj = galleryDiv.append('div');
858
+ // controlObj.setAttribute( 'class', 'ad-controls');
859
+ // controlObj.setAttribute( 'contenteditable', 'false');
860
+ // controlObj.setAttribute( 'style', displayControls);
861
+ //
862
+ // var navObj = galleryDiv.append('div');
863
+ // navObj.setAttribute( 'class', 'ad-nav');
864
+ // navObj.setAttribute( 'style', displayThumbs);
865
+ // navObj.setAttribute( 'contenteditable', 'false');
866
+ //
867
+ // var thumbsObj = navObj.append('div');
868
+ // thumbsObj.setAttribute( 'class', 'ad-thumbs');
869
+ // thumbsObj.setAttribute( 'contenteditable', 'false');
870
+
871
+ var ulObj = slideshowDOM.append('ul');
872
+ // ulObj.setAttribute('class', 'ad-thumb-list');
873
+ // ulObj.setAttribute( 'contenteditable', 'false');
874
+
875
+ feelFrontendWithImages(dialog, ulObj);
876
+ return slideshowDOM;
877
+ };
878
+
879
+ function ClickOkBtn(dialog) {
880
+ var extraStyles = {},
881
+ extraAttributes = {};
882
+
883
+ dialog.openCloseStep = true;
884
+
885
+ // Invoke the commit methods of all dialog elements, so the dialog.params array get Updated.
886
+ dialog.commitContent(dialog);
887
+
888
+ // Create a new DOM
889
+ var slideshowDOM = createGalleryFrontend(dialog);
890
+
891
+ // Add data tags to dom
892
+ for ( var i = 0; i < dialog.params.length ; i++ ) {
893
+ slideshowDOM.data(dialog.params[i][0], dialog.params[i][1]);
894
+ }
895
+
896
+ // // Add javascript for ""ad-gallery"
897
+ // // Be sure the path is correct and file is available !!
898
+ // var scriptAdGallery = CKEDITOR.document.createElement( 'script', {
899
+ // attributes: {
900
+ // type: 'text/javascript',
901
+ // src: SCRIPT_ADDGAL
902
+ // }
903
+ // });
904
+ // slideshowDOM.append(scriptAdGallery);
905
+ //
906
+ // if ( dialog.params.getVal('openOnClickId') == true) {
907
+ // // Dynamically add CSS for "fancyBox"
908
+ // // Be sure the path is correct and file is available !!
909
+ // var scriptFancyBoxCss = CKEDITOR.document.createElement( 'script', {
910
+ // attributes: {
911
+ // type: 'text/javascript'
912
+ // }
913
+ // });
914
+ // scriptFancyBoxCss.setText("(function($) { $('head').append('<link rel=\"stylesheet\" href=\""+CSS_FANCYBOX+"\" type=\"text/css\" />'); })(jQuery);");
915
+ // slideshowDOM.append(scriptFancyBoxCss);
916
+ //
917
+ // // Add javascript for ""fancyBox"
918
+ // // Be sure the path is correct and file is available !!
919
+ // var scriptFancyBox = CKEDITOR.document.createElement( 'script', {
920
+ // attributes: {
921
+ // type: 'text/javascript',
922
+ // src: SCRIPT_FANCYBOX
923
+ // }
924
+ // });
925
+ // slideshowDOM.append(scriptFancyBox);
926
+ //
927
+ // // Add RUN javascript for "fancybox"
928
+ // var scriptFancyboxRun = CKEDITOR.document.createElement( 'script', {
929
+ // attributes: {
930
+ // type: 'text/javascript',
931
+ // }
932
+ // });
933
+ // scriptFancyboxRun.setText(createScriptFancyBoxRun(dialog));
934
+ // slideshowDOM.append(scriptFancyboxRun);
935
+ // }
936
+ //
937
+ // // Dynamically add CSS for "ad-gallery"
938
+ // // Be sure the path is correct and file is available !!
939
+ // var scriptAdGalleryCss = CKEDITOR.document.createElement( 'script', {
940
+ // attributes: {
941
+ // type: 'text/javascript'
942
+ // }
943
+ // });
944
+ // scriptAdGalleryCss.setText("(function($) { $('head').append('<link rel=\"stylesheet\" href=\""+CSS_ADDGAL+"\" type=\"text/css\" />'); })(jQuery);");
945
+ // slideshowDOM.append(scriptAdGalleryCss);
946
+ //
947
+ // // Add RUN javascript for "ad-Gallery"
948
+ // var scriptAdGalleryRun = CKEDITOR.document.createElement( 'script', {
949
+ // attributes: {
950
+ // type: 'text/javascript',
951
+ // }
952
+ // });
953
+ // scriptAdGalleryRun.setText(createScriptAdGalleryRun(dialog, 0, 0, 0));
954
+ // slideshowDOM.append(scriptAdGalleryRun);
955
+
956
+ if (dialog.imagesList.length) {
957
+ extraStyles.backgroundImage = 'url("' + dialog.imagesList[0][IMG_PARAM.URL] + '")';
958
+ }
959
+ extraStyles.backgroundSize = '50%';
960
+ extraStyles.display = 'block';
961
+ // Create a new Fake Image
962
+ var newFakeImage = editor.createFakeElement( slideshowDOM, 'cke_slideShow', 'slideShow', false );
963
+ newFakeImage.setAttributes( extraAttributes );
964
+ newFakeImage.setStyles( extraStyles );
965
+
966
+ if ( dialog.fakeImage )
967
+ {
968
+ newFakeImage.replace( dialog.fakeImage );
969
+ editor.getSelection().selectElement( newFakeImage );
970
+ }
971
+ else
972
+ {
973
+ editor.insertElement( newFakeImage );
974
+ }
975
+
976
+ cleanAll(dialog);
977
+ dialog.hide();
978
+ return true;
979
+ };
980
+
981
+ return {
982
+ // Basic properties of the dialog window: title, minimum size.
983
+ title : lang.dialogTitle,
984
+ width: 500,
985
+ height: 600,
986
+ resizable: CKEDITOR.DIALOG_RESIZE_NONE,
987
+ buttons: [
988
+ CKEDITOR.dialog.okButton( editor, {
989
+ label: 'OkCK',
990
+ style : 'display:none;'
991
+ }),
992
+ CKEDITOR.dialog.cancelButton,
993
+
994
+ {
995
+ id: 'myokbtnid',
996
+ type: 'button',
997
+ label: 'OK',
998
+ title: 'Button description',
999
+ style : 'color:white;background:blue;',
1000
+ accessKey: 'C',
1001
+ disabled: false,
1002
+ onClick: function()
1003
+ {
1004
+ // code on click
1005
+ ClickOkBtn(this.getDialog());
1006
+ }
1007
+ },
1008
+ ],
1009
+ // Dialog window contents definition.
1010
+ contents: [
1011
+ {
1012
+ // Definition of the Basic Settings dialog (page).
1013
+ id: 'slideshowinfoid',
1014
+ label: 'Basic Settings',
1015
+ align : 'center',
1016
+ // The tab contents.
1017
+ elements: [
1018
+ {
1019
+ type : 'text',
1020
+ id : 'id',
1021
+ style : 'display:none;',
1022
+ onLoad : function()
1023
+ {
1024
+ this.getInputElement().setAttribute( 'readOnly', true );
1025
+ }
1026
+ },
1027
+ {
1028
+ type: 'text',
1029
+ id: 'txturlid',
1030
+ style : 'display:none;',
1031
+ label: lang.imgList,
1032
+ onChange: function() {
1033
+ var dialog = this.getDialog(),
1034
+ newUrl = this.getValue();
1035
+ if ( newUrl.length > 0 ) { //Prevent from load before onShow
1036
+ var preview = dialog.previewImage;
1037
+ preview.on( 'load', onImgLoadEvent, dialog );
1038
+ preview.on( 'error', onImgLoadErrorEvent, dialog );
1039
+ preview.on( 'abort', onImgLoadErrorEvent, dialog );
1040
+ preview.setAttribute( 'src', newUrl );
1041
+ };
1042
+ }
1043
+ },
1044
+ {
1045
+ type : 'button',
1046
+ id : 'browse',
1047
+ hidden : 'true',
1048
+ style : 'display:inline-block;margin-top:0px;',
1049
+ filebrowser :
1050
+ {
1051
+ action : 'Browse',
1052
+ target: 'slideshowinfoid:txturlid',
1053
+ url: editor.config.filebrowserImageBrowseUrl || editor.config.filebrowserBrowseUrl
1054
+ },
1055
+ label : lang.imgAdd
1056
+
1057
+ },
1058
+ {
1059
+ type: 'vbox',
1060
+ align: 'center',
1061
+ children: [
1062
+ {
1063
+ type: 'html',
1064
+ align : 'center',
1065
+ id: 'framepreviewtitleid',
1066
+ style: 'font-family: Amaranth; color: #1E66EB; font-size: 20px; font-weight: bold;',
1067
+ html: 'Preview'
1068
+ },
1069
+ {
1070
+ type: 'html',
1071
+ id: 'framepreviewid',
1072
+ align : 'center',
1073
+ style : 'width:500px;height:320px',
1074
+ html: ''
1075
+ },
1076
+ {
1077
+ type: 'hbox',
1078
+ id: 'imgparamsid',
1079
+ style : 'display:none;width:500px;',
1080
+ height: '325px',
1081
+ children :
1082
+ [
1083
+ {
1084
+ type : 'vbox',
1085
+ align : 'center',
1086
+ width : '400px',
1087
+ children :
1088
+ [
1089
+ {
1090
+ type : 'text',
1091
+ id : 'imgtitleid',
1092
+ label : lang.imgTitle,
1093
+ onChange: function() {
1094
+ if ( this.getValue() )
1095
+ {
1096
+ updateTitle(this.getDialog(), this.getValue());
1097
+ }
1098
+ }
1099
+ },
1100
+ {
1101
+ type : 'text',
1102
+ id : 'imgdescid',
1103
+ label : lang.imgDesc,
1104
+ onChange: function() {
1105
+ if ( this.getValue() )
1106
+ {
1107
+ updateDescription(this.getDialog(), this.getValue());
1108
+ }
1109
+ }
1110
+ },
1111
+ {
1112
+ type : 'html',
1113
+ id : 'imgpreviewid',
1114
+ style : 'width:400px;height:200px;',
1115
+ html: '<div>xx</div>'
1116
+ }
1117
+ ]
1118
+ },
1119
+ ]
1120
+ },
1121
+ {
1122
+ type : 'hbox',
1123
+ align: 'center',
1124
+ height: 110,
1125
+ widths: [ '75%', '25%'],
1126
+ children :
1127
+ [
1128
+ // {
1129
+ // type : 'vbox',
1130
+ // children :
1131
+ // [
1132
+ // {
1133
+ // type : 'checkbox',
1134
+ // id : 'autostartid',
1135
+ // label : lang.autoStart,
1136
+ // 'default' : 'checked',
1137
+ // style : 'margin-top:15px;',
1138
+ // onChange : commitValue,
1139
+ // commit : commitValue,
1140
+ // setup : loadValue
1141
+ // },
1142
+ // {
1143
+ // type : 'checkbox',
1144
+ // id : 'showtitleid',
1145
+ // label : lang.showTitle,
1146
+ // 'default' : 'checked',
1147
+ // onChange : commitValue,
1148
+ // commit : commitValue,
1149
+ // setup : loadValue
1150
+ // },
1151
+ // {
1152
+ // type : 'checkbox',
1153
+ // id : 'showcontrolid',
1154
+ // label : lang.showControls,
1155
+ // 'default' : 'checked',
1156
+ // onChange : commitValue,
1157
+ // commit : commitValue,
1158
+ // setup : loadValue
1159
+ // },
1160
+ // {
1161
+ // type : 'checkbox',
1162
+ // id : 'showthumbid',
1163
+ // label : lang.showThumbs,
1164
+ // 'default' : 'checked',
1165
+ // onChange : commitValue,
1166
+ // commit : commitValue,
1167
+ // setup : loadValue
1168
+ // },
1169
+ // {
1170
+ // type : 'checkbox',
1171
+ // id : 'openOnClickId',
1172
+ // label : lang.openOnClick,
1173
+ // 'default' : 'checked',
1174
+ // onChange : commitValue,
1175
+ // commit : commitValue,
1176
+ // setup : loadValue
1177
+ // },
1178
+ // ]
1179
+ // },
1180
+ {
1181
+ type: 'select',
1182
+ id: 'imglistitemsid',
1183
+ label: lang.picturesList,
1184
+ multiple: false,
1185
+ style : 'height:120px;width:400px',
1186
+ items: [],
1187
+ onChange : function( api ) {
1188
+ //unselectIfNotUnique(this);
1189
+ selectFirstIfNotUnique(this);
1190
+ }
1191
+ },
1192
+ {
1193
+ type : 'vbox',
1194
+ children :
1195
+ [
1196
+ // {
1197
+ // type : 'button',
1198
+ // id : 'previewbtn',
1199
+ // style : 'margin-top:15px;margin-left:25px;',
1200
+ // label : lang.previewMode,
1201
+ // onClick : function() {
1202
+ // previewSlideShow(this.getDialog());
1203
+ // }
1204
+ // },
1205
+ {
1206
+ type : 'button',
1207
+ id : 'removeselectedbtn',
1208
+ style : 'margin-left:25px;',
1209
+ //style : 'display:none;',
1210
+ label : lang.imgDelete,
1211
+ onClick : function() {
1212
+ removeSelected(this.getDialog());
1213
+ }
1214
+ },
1215
+ {
1216
+ type : 'button',
1217
+ id : 'editselectedbtn',
1218
+ style : 'margin-left:25px;',
1219
+ //style : 'display:none;',
1220
+ label : lang.imgEdit,
1221
+ onClick : function() {
1222
+ editeSelected(this.getDialog());
1223
+ }
1224
+ },
1225
+ ]
1226
+ },
1227
+ ]
1228
+ }
1229
+ // ,
1230
+ // {
1231
+ // type : 'hbox',
1232
+ // children :
1233
+ // [
1234
+ // {
1235
+ // type : 'text',
1236
+ // id : 'pictheightid',
1237
+ // label : lang.pictHeight,
1238
+ // maxLength : 3,
1239
+ // style : 'width:100px;',
1240
+ // 'default' : '300',
1241
+ // onChange : function( api ) {
1242
+ // var intRegex = /^\d+$/;
1243
+ // if(intRegex.test(this.getValue()) == false) {
1244
+ // this.setValue(300);
1245
+ // }
1246
+ // this.getDialog().params.updateVal(this.id, this.getValue());
1247
+ // displaySelected(this.getDialog());
1248
+ // },
1249
+ // commit : commitValue,
1250
+ // setup : loadValue,
1251
+ // },
1252
+ // {
1253
+ // type : 'text',
1254
+ // id : 'speedid',
1255
+ // label : lang.displayTime,
1256
+ // maxLength : 3,
1257
+ // style : 'width:100px;',
1258
+ // 'default' : '5',
1259
+ // onChange : function( api ) {
1260
+ // var intRegex = /^\d+$/;
1261
+ // if(intRegex.test(this.getValue()) == false) {
1262
+ // this.setValue(5);
1263
+ // }
1264
+ // this.getDialog().params.updateVal(this.id, this.getValue());
1265
+ // displaySelected(this.getDialog());
1266
+ // },
1267
+ // commit : commitValue,
1268
+ // setup : loadValue,
1269
+ // },
1270
+ // {
1271
+ // type : 'text',
1272
+ // id : 'animspeedid',
1273
+ // label : lang.transitionTime,
1274
+ // style : 'width:100px;',
1275
+ // maxLength : 4,
1276
+ // 'default' : '500',
1277
+ // onChange : function( api ) {
1278
+ // var intRegex = /^\d+$/;
1279
+ // if(intRegex.test(this.getValue()) == false) {
1280
+ // this.setValue(500);
1281
+ // }
1282
+ // this.getDialog().params.updateVal(this.id, this.getValue());
1283
+ // displaySelected(this.getDialog());
1284
+ // },
1285
+ // commit : commitValue,
1286
+ // setup : loadValue,
1287
+ // },
1288
+ // {
1289
+ // type : 'select',
1290
+ // id : 'transitiontypeid',
1291
+ // label : lang.transition,
1292
+ // // add-gallery effects 'slide-vert', 'resize', 'fade', 'none' or false
1293
+ // // effect: 'slide-hori',
1294
+ // items : [ [ lang.tr1, 'none' ], [ lang.tr2, 'resize' ], [ lang.tr3, 'slide-vert' ], [ lang.tr4, 'slide-hori' ], [lang.tr5, 'fade'] ],
1295
+ // 'default' : 'resize',
1296
+ // style : 'width:100px;',
1297
+ // commit : commitValue,
1298
+ // setup : loadValue,
1299
+ // onChange : commitValue,
1300
+ // },
1301
+ // ]
1302
+ // }
1303
+ ]
1304
+ },
1305
+ ]
1306
+ },
1307
+ ],
1308
+
1309
+
1310
+ onLoad: function() {
1311
+ },
1312
+ // Invoked when the dialog is loaded.
1313
+ onShow: function() {
1314
+ this.dialog = this;
1315
+ this.slideshowDOM = null;
1316
+ this.openCloseStep = true;
1317
+ this.fakeImage = null;
1318
+ var slideshowDOM = null;
1319
+ this.imagesList = new Array();
1320
+ this.params = new Array();
1321
+ // To get dimensions of poster image
1322
+ this.previewImage = editor.document.createElement( 'img' );
1323
+ this.okRefresh = true;
1324
+
1325
+
1326
+ var fakeImage = this.getSelectedElement();
1327
+ if ( fakeImage && fakeImage.data( 'cke-real-element-type' ) && fakeImage.data( 'cke-real-element-type' ) == 'slideShow' )
1328
+ {
1329
+ this.fakeImage = fakeImage;
1330
+ slideshowDOM = editor.restoreRealElement( fakeImage );
1331
+ }
1332
+
1333
+ // Create a new <slideshow> slideshowDOM if it does not exist.
1334
+ if ( !slideshowDOM) {
1335
+ this.params.push(['slideshowid', numbering( 'slideShow' )]);
1336
+
1337
+ // Insert placeHolder image
1338
+ initImgListFromFresh(this);
1339
+ // Invoke the commit methods of all dialog elements, so the dialog.params array get Updated.
1340
+ this.commitContent(this);
1341
+ // console.log( "Params New -> " + this.params );
1342
+ // console.log( "Images New -> " + this.imagesList );
1343
+ } else {
1344
+ this.slideshowDOM = slideshowDOM;
1345
+ // Get the reference of the slideSjow Images Container
1346
+ var slideShowContainer = getImagesContainerBlock(this, slideshowDOM);
1347
+ if (slideShowContainer == null) {
1348
+ alert("BIG Problem slideShowContainer !!");
1349
+ return false;
1350
+ }
1351
+ var slideshowid = slideshowDOM.getAttribute('id');
1352
+ if (slideshowid == null) {
1353
+ alert("BIG Problem slideshowid !!");
1354
+ return false;
1355
+ }
1356
+ this.params.push(['slideshowid', slideshowid]);
1357
+ // a DOM has been found updatet images List and Dialog box from this DOM
1358
+ initImgListFromDOM(this, slideShowContainer);
1359
+ // Init params Array from DOM
1360
+ // Copy all attributes to an array.
1361
+ var domDatas = slideshowDOM.$.dataset;
1362
+ for ( param in domDatas ) this.params.push( [ param, domDatas[ param ] ] );
1363
+
1364
+ // Invoke the setup methods of all dialog elements, to set dialog elements values with DOM input data.
1365
+ this.setupContent(this, true);
1366
+ //updateFramePreview(this);
1367
+ this.newSlideShowMode = false;
1368
+ // console.log( "Params Old -> " + this.params );
1369
+ // console.log( "Images Old -> " + this.imagesList );
1370
+ }
1371
+ this.openCloseStep = false;
1372
+ previewSlideShow(this);
1373
+ },
1374
+
1375
+ // This method is invoked once a user clicks the OK button, confirming the dialog.
1376
+ // I just will return false, as the real OK Button has been redefined
1377
+ // -This was the only way I found to avoid dialog popup to close when hitting the keyboard "ENTER" Key !!
1378
+ onOk: function() {
1379
+ // var okr = this.okRefresh;
1380
+ // if (this.okRefresh == true) {
1381
+ // console.log('OKOKOK 0 :'+this.okRefresh);
1382
+ // this.okRefresh = false;
1383
+ // this.commitContent(this);
1384
+ // myVar = setTimeout(
1385
+ // function(obj){
1386
+ // obj.okRefresh = true;
1387
+ // },500, this);
1388
+ // }
1389
+ return false;
1390
+ },
1391
+
1392
+ onHide: function() {
1393
+ cleanAll(this);
1394
+ }
1395
+ };
1396
+ });