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
Binary file
File without changes
@@ -0,0 +1,223 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require admin/jquery-migrate.min
15
+ //= require jquery-ui
16
+ //= require jquery-ui/datepicker-ru
17
+ //= require jquery-ui-timepicker-addon
18
+ //= require admin/vendor/jquery-ui-timepicker-addon-ru
19
+ //= require jquery_ujs
20
+ //= require admin/vendor/bootstrap.min
21
+ //= require jquery.remotipart
22
+ //= require admin/vendor/jquery.tokeninput.patched
23
+ //= require admin/vendor/jquery.tagsinput
24
+ //= require admin/vendor/underscore-min
25
+ //= require js-routes
26
+ //= require ckeditor/init
27
+ //= require admin/photo_uploader
28
+ //= require_self
29
+ //= require admin/custom_admin
30
+
31
+ var CMS = CMS || {};
32
+ CMS.config = CMS.config || {};
33
+ CMS.config.language = CMS.config.language || 'ru';
34
+
35
+ function injectNewSliderId(s, id) {
36
+ return s.replace(/NEW_RECORD/g, id);
37
+ }
38
+
39
+ (function ($) {
40
+ $.fn.stickyBar = function () {
41
+ if (this.length) {
42
+ var $bar = this,
43
+ barOffsetTop = $bar.offset().top,
44
+ barOuterHeight = $bar.outerHeight(),
45
+ windowScrollTop = $(window).scrollTop(),
46
+ windowHeight = $(window).height();
47
+
48
+ if (barOffsetTop + barOuterHeight > windowScrollTop + windowHeight) {
49
+ $bar.addClass('__sticky');
50
+ }
51
+
52
+ $(window).scroll(function () {
53
+ windowScrollTop = $(window).scrollTop();
54
+ windowHeight = $(window).height();
55
+
56
+ if (barOffsetTop + barOuterHeight > windowScrollTop + windowHeight) {
57
+ $bar.addClass('__sticky');
58
+ } else {
59
+ $bar.removeClass('__sticky');
60
+ }
61
+ });
62
+ }
63
+ }
64
+
65
+ })(jQuery);
66
+
67
+ $(function () {
68
+ $(document).on('click', '.pictograms__button_remove', function () {
69
+ var
70
+ $this = $(this),
71
+ container = '.' + $this.data('container');
72
+ var input = $this.prev(':hidden');
73
+ if (input.size() > 0) {
74
+ $(input[0]).attr("value", "1");
75
+ $this.closest(container).hide();
76
+ } else {
77
+ $(this).closest(container).remove();
78
+ }
79
+ return false;
80
+ });
81
+
82
+ $(document).on('click', '[data-image-remove-btn]', function () {
83
+ var container = $(this).closest('.upload-img-container');
84
+ container.find('[data-image-preview]').hide();
85
+ container.find('[data-image-placeholder]').show();
86
+ container.find('[data-image-remove-flag]').val(1);
87
+ return false;
88
+ });
89
+
90
+ $('.sortable').sortable();
91
+
92
+ function merge_datepicker_options($element) {
93
+ var options = {
94
+ dateFormat: 'yy-mm-dd',
95
+ changeMonth: true,
96
+ changeYear: true
97
+ };
98
+ var customOptions = $element.data('calendar-options');
99
+ if (customOptions) {
100
+ options = $.extend(options, customOptions);
101
+ }
102
+ return options;
103
+ }
104
+
105
+ function addDatePickers() {
106
+ $('input[data-calendar-date]').each(function () {
107
+ $this = $(this);
108
+ $this.datepicker(merge_datepicker_options($this));
109
+ });
110
+ }
111
+
112
+ addDatePickers();
113
+
114
+ function addDateTimePickers() {
115
+ $('input[data-calendar-datetime]').each(function () {
116
+ $this = $(this);
117
+ $this.datetimepicker(merge_datepicker_options($this));
118
+ });
119
+ }
120
+
121
+ addDateTimePickers();
122
+
123
+ function addTimePickers() {
124
+ $('input[data-calendar-time]').each(function () {
125
+ $this = $(this);
126
+ $this.timepicker(merge_datepicker_options($this));
127
+ });
128
+ }
129
+
130
+ addTimePickers();
131
+
132
+ $(document).on('click', '.close-popover-form', function () {
133
+ $('.pictograms__button_edit').popover('hide');
134
+ $('.popover').css('display', 'none');
135
+ });
136
+
137
+ $(document).on('click', '.submit-popover-form', function () {
138
+ var
139
+ $title = $(this).closest('.slide-form-group').find('input[type="text"]');
140
+ $('#' + $title.attr('id')).val($title.val());
141
+ $('.pictograms__button_edit').popover('hide');
142
+ $('.popover').css('display', 'none');
143
+ });
144
+
145
+ var $form = $('form');
146
+ $form.on('click', '.remove_field', function () {
147
+ $(this).prev('input[type=hidden]').val('1');
148
+ $(this).closest('.fields_container').hide();
149
+ return false;
150
+ });
151
+
152
+ $form.on('click', '.add_fields', function () {
153
+ var time = new Date().getTime();
154
+ var regexp = new RegExp($(this).data('id'), 'g');
155
+ $(this).before($(this).data('fields').replace(regexp, time));
156
+ window.NestedFormCallbacks = window.NestedFormCallbacks || [];
157
+ _.each(window.NestedFormCallbacks, function (callback) {
158
+ callback();
159
+ });
160
+ addDatePickers();
161
+ addDateTimePickers();
162
+ addTimePickers();
163
+ return false
164
+ });
165
+
166
+ $('[data-multi-field]').each(function () {
167
+ var options = {
168
+ crossDomain: false,
169
+ preventDuplicates: true,
170
+ theme: 'facebook',
171
+ showAllOnFocus: $(this).data('show-all-on-focus'),
172
+ useCache: $(this).data('use-cache')
173
+ };
174
+
175
+ if (CMS.config.language == 'ru') {
176
+ options.hintText = 'Введите строку для поиска';
177
+ options.noResultsText = 'Ничего не найдено';
178
+ options.searchingText = 'Поиск...';
179
+ }
180
+
181
+ var objectUrlName = $(this).data('object-url-name');
182
+ if (objectUrlName) {
183
+ var formatter_options = {
184
+ tokenFormatter: function (item) {
185
+ return "<li><p><a href='" + "/admin/" + objectUrlName + "/" + item['id'] + "/edit'>" + item[this.propertyToSearch] + "</a></p></li>"
186
+ }
187
+ };
188
+ options = $.extend(options, formatter_options);
189
+ }
190
+
191
+ $(this).tokenInput($(this).data('source'), options);
192
+ });
193
+
194
+ $('.action-bar').stickyBar();
195
+
196
+ $(document).on('change', '[data-file-upload]', function () {
197
+ var filename = $(this).val().replace(/.*(\/|\\)/, ''),
198
+ container = $(this).closest('[data-file-upload-container]');
199
+
200
+ container.find('[data-file-upload-title]').text(filename);
201
+
202
+ if (filename.length > 0) {
203
+ container.find('[data-file-remove-flag]').val(0);
204
+ }
205
+ });
206
+
207
+ $(document).on('click', '[data-file-remove-btn]', function () {
208
+ var container = $(this).closest('[data-file-upload-container]'),
209
+ title = container.find('[data-file-upload-title]');
210
+ title.text(title.data('label'));
211
+ container.find('[data-file-upload]').val('');
212
+ container.find('[data-file-remove-flag]').val(1);
213
+ return false;
214
+ });
215
+
216
+ $('[data-toggle="tooltip"]').tooltip({'trigger':'focus'});
217
+
218
+ });
219
+
220
+ CKEDITOR.config.extraPlugins = 'slideshow,mediaembed,autogrow';
221
+ CKEDITOR.config.removeButtons = 'About,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,BidiLtr,BidiRtl,Language,Scayt,Smiley,SpellChecker,Templates,Indent,CreateDiv,HorizontalRule,Flash,NewPage,PageBreak,Iframe,Styles,FontSize,Font,TextColor,BGColor,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock';
222
+ CKEDITOR.config.removePlugins = 'scayt,smiley';
223
+ CKEDITOR.config.language = 'ru';
File without changes
@@ -0,0 +1,2 @@
1
+ /*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
2
+ jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
@@ -0,0 +1,58 @@
1
+ function PhotoUploader(formTemplate) {
2
+ var selector = ('input[data-file="true"]');
3
+
4
+ this.addUploadListener = function () {
5
+ var fileInputSelector = $(selector);
6
+ fileInputSelector.each(function () {
7
+ var $fileInput = $(this);
8
+ var form = $(formTemplate.replace('###URL###', $fileInput.data("path"))
9
+ .replace('###CONTAINER###', $fileInput.data('container'))
10
+ .replace('###FREE_SIZE###', $fileInput.data('free_size'))
11
+ .replace('###VERSION###', $fileInput.data('version')));
12
+ $('body').append(form);
13
+
14
+ (function addChangeListener(fileInput) {
15
+ fileInput.change(function () {
16
+ var $c = $('#' + fileInput.data('container'));
17
+ $c.find("[data-image-loader]").addClass('visible');
18
+ $c.find('[data-image-preview]').hide();
19
+ $c.find('[data-image-placeholder]').hide();
20
+ $c.find('[data-image-remove-flag]').val(0);
21
+
22
+ // DO NOT REFACTOR!!! A bit of black magic
23
+ var clonedCopy = $(this).clone().appendTo($(this).parent());
24
+ clonedCopy.val('');
25
+ addChangeListener(clonedCopy);
26
+ form.find('input[type="file"]').remove();
27
+ $(this).detach().appendTo(form);
28
+ form.submit();
29
+ });
30
+ })($(this));
31
+ });
32
+
33
+ $('.upload-img-container').find('[data-image-tag]').load(function () {
34
+ var
35
+ $this = $(this),
36
+ $cnt = $this.closest('.img-polaroid'),
37
+ updateSizes = $this.closest('.upload-img-container').hasClass('manage-size'),
38
+ w = $this[0].width,
39
+ h = $this[0].height;
40
+
41
+ if (updateSizes) {
42
+ $this.css({width: w + "px", height: h + "px"});
43
+ $cnt.css({width: w + "px", height: h + "px"});
44
+ $cnt.find("[data-image-placeholder]").css({width: w + "px", height: h + "px", 'line-height': h + 'px'});
45
+ }
46
+
47
+ if (!$cnt.hasClass('init-placeholder')) {
48
+ $cnt.find('[data-image-loader]').removeClass('visible');
49
+ $cnt.find('[data-image-preview]').show();
50
+ } else {
51
+ if (updateSizes) {
52
+ $this.removeAttr('width').removeAttr('height');
53
+ }
54
+ }
55
+ });
56
+
57
+ };
58
+ }
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Bootstrap v3.0.3 (http://getbootstrap.com)
3
+ * Copyright 2013 Twitter, Inc.
4
+ * Licensed under http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+
7
+ if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]'),b=!0;if(a.length){var c=this.$element.find("input");"radio"===c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?b=!1:a.find(".active").removeClass("active")),b&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}b&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b),f.trigger(d=a.Event("show.bs.dropdown")),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown"),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",f);if(h.length){var i=h.index(h.filter(":focus"));38==b.keyCode&&i>0&&i--,40==b.keyCode&&i<h.length-1&&i++,~i||(i=0),h.eq(i).focus()}}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=f,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu]",f.prototype.keydown)}(jQuery),+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};b.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isShown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body),c.$element.show(),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulateTransitionEnd(300):c.$element.focus().trigger(e)}))},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},b.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.focus()},this))},b.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=a.support.transition&&c;if(this.$backdrop=a('<div class="modal-backdrop '+c+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focus",i="hover"==g?"mouseleave":"blur";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show),void 0):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide),void 0):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d="function"==typeof this.options.placement?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m="body"==this.options.container?window.innerWidth:j.outerWidth(),n="body"==this.options.container?window.innerHeight:j.outerHeight(),o="body"==this.options.container?0:j.offset().left;d="bottom"==d&&g.top+g.height+i-l>n?"top":"top"==d&&g.top-l-i<0?"bottom":"right"==d&&g.right+h>m?"left":"left"==d&&g.left-h<o?"right":d,c.removeClass(k).addClass(d)}var p=this.getCalculatedOffset(d,g,h,i);this.applyPlacement(p,d),this.$element.trigger("shown.bs."+this.type)}},b.prototype.applyPlacement=function(a,b){var c,d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),a.top=a.top+g,a.left=a.left+h,d.offset(a).addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;if("top"==b&&j!=f&&(c=!0,a.top=a.top+f-j),/bottom|top/.test(b)){var k=0;a.left<0&&(k=-2*a.left,a.left=0,d.offset(a),i=d[0].offsetWidth,j=d[0].offsetHeight),this.replaceArrow(k-e+i,i,"left")}else this.replaceArrow(j-f,j,"top");c&&d.offset(a)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach()}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,b).emulateTransitionEnd(150):b(),this.$element.trigger("hidden.bs."+this.type),this)},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof c&&c;e||d.data("bs.tooltip",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery);
@@ -0,0 +1,42 @@
1
+ $(function () {
2
+ if (CMS.config.language == 'ru') {
3
+ $.datepicker.regional['ru'] = {
4
+ closeText: 'Закрыть',
5
+ prevText: '<Пред',
6
+ nextText: 'След>',
7
+ currentText: 'Сегодня',
8
+ monthNames: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь',
9
+ 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
10
+ monthNamesShort: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн',
11
+ 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],
12
+ dayNames: ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'],
13
+ dayNamesShort: ['вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'сбт'],
14
+ dayNamesMin: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
15
+ weekHeader: 'Не',
16
+ dateFormat: 'dd.mm.yy',
17
+ firstDay: 1,
18
+ isRTL: false,
19
+ showMonthAfterYear: false,
20
+ yearSuffix: ''
21
+ };
22
+ $.datepicker.setDefaults($.datepicker.regional['ru']);
23
+
24
+
25
+ $.timepicker.regional['ru'] = {
26
+ timeOnlyTitle: 'Выберите время',
27
+ timeText: 'Время',
28
+ hourText: 'Часы',
29
+ minuteText: 'Минуты',
30
+ secondText: 'Секунды',
31
+ millisecText: 'Миллисекунды',
32
+ timezoneText: 'Часовой пояс',
33
+ currentText: 'Сейчас',
34
+ closeText: 'Закрыть',
35
+ timeFormat: 'HH:mm',
36
+ amNames: ['AM', 'A'],
37
+ pmNames: ['PM', 'P'],
38
+ isRTL: false
39
+ };
40
+ $.timepicker.setDefaults($.timepicker.regional['ru']);
41
+ }
42
+ });
@@ -0,0 +1,365 @@
1
+ /*
2
+
3
+ jQuery Tags Input Plugin 1.3.3
4
+
5
+ Copyright (c) 2011 XOXCO, Inc
6
+
7
+ Documentation for this plugin lives here:
8
+ http://xoxco.com/clickable/jquery-tags-input
9
+
10
+ Licensed under the MIT license:
11
+ http://www.opensource.org/licenses/mit-license.php
12
+
13
+ ben@xoxco.com
14
+
15
+ */
16
+
17
+ (function($) {
18
+
19
+ var delimiter = new Array();
20
+ var tags_callbacks = new Array();
21
+ $.fn.doAutosize = function(o){
22
+ var minWidth = $(this).data('minwidth'),
23
+ maxWidth = $(this).data('maxwidth'),
24
+ val = '',
25
+ input = $(this),
26
+ testSubject = $('#'+$(this).data('tester_id'));
27
+
28
+ if (val === (val = input.val())) {return;}
29
+
30
+ // Enter new content into testSubject
31
+ var escaped = val.replace(/&/g, '&amp;').replace(/\s/g,' ').replace(/</g, '&lt;').replace(/>/g, '&gt;');
32
+ testSubject.html(escaped);
33
+ // Calculate new width + whether to change
34
+ var testerWidth = testSubject.width(),
35
+ newWidth = (testerWidth + o.comfortZone) >= minWidth ? testerWidth + o.comfortZone : minWidth,
36
+ currentWidth = input.width(),
37
+ isValidWidthChange = (newWidth < currentWidth && newWidth >= minWidth)
38
+ || (newWidth > minWidth && newWidth < maxWidth);
39
+
40
+ // Animate width
41
+ if (isValidWidthChange) {
42
+ input.width(newWidth);
43
+ }
44
+
45
+
46
+ };
47
+ $.fn.resetAutosize = function(options){
48
+ // alert(JSON.stringify(options));
49
+ var minWidth = $(this).data('minwidth') || options.minInputWidth || $(this).width(),
50
+ maxWidth = $(this).data('maxwidth') || options.maxInputWidth || ($(this).closest('.tagsinput').width() - options.inputPadding),
51
+ val = '',
52
+ input = $(this),
53
+ testSubject = $('<tester/>').css({
54
+ position: 'absolute',
55
+ top: -9999,
56
+ left: -9999,
57
+ width: 'auto',
58
+ fontSize: input.css('fontSize'),
59
+ fontFamily: input.css('fontFamily'),
60
+ fontWeight: input.css('fontWeight'),
61
+ letterSpacing: input.css('letterSpacing'),
62
+ whiteSpace: 'nowrap'
63
+ }),
64
+ testerId = $(this).attr('id')+'_autosize_tester';
65
+ if(! $('#'+testerId).length > 0){
66
+ testSubject.attr('id', testerId);
67
+ testSubject.appendTo('body');
68
+ }
69
+
70
+ input.data('minwidth', minWidth);
71
+ input.data('maxwidth', maxWidth);
72
+ input.data('tester_id', testerId);
73
+ input.css('width', minWidth);
74
+ };
75
+
76
+ $.fn.addTag = function(value,options) {
77
+ options = jQuery.extend({focus:false,callback:true},options);
78
+ this.each(function() {
79
+ var id = $(this).attr('id');
80
+
81
+ var tagslist = $(this).val().split(delimiter[id]);
82
+ if (tagslist[0] == '') {
83
+ tagslist = new Array();
84
+ }
85
+
86
+ value = jQuery.trim(value);
87
+ if (options.callback && tags_callbacks[id] && tags_callbacks[id]['onBeforeAddTag']) {
88
+ var f = tags_callbacks[id]['onBeforeAddTag'];
89
+ var result = f.call(this, value);
90
+ if (result === false) return;
91
+ }
92
+
93
+ if (options.unique) {
94
+ var skipTag = $(this).tagExist(value);
95
+ if(skipTag == true) {
96
+ //Marks fake input as not_valid to let styling it
97
+ $(this).markAsInvalid();
98
+ }
99
+ } else {
100
+ var skipTag = false;
101
+ }
102
+
103
+ if (value !='' && skipTag != true) {
104
+ $('<span>').addClass('tag').append(
105
+ $('<span>').text(value).append('&nbsp;&nbsp;'),
106
+ $('<a>', {
107
+ href : '#',
108
+ title : 'Removing tag',
109
+ text : 'x'
110
+ }).click(function () {
111
+ return $('#' + id).removeTag(escape(value));
112
+ })
113
+ ).insertBefore('#' + id + '_addTag');
114
+
115
+ tagslist.push(value);
116
+
117
+ $('#'+id+'_tag').val('');
118
+ if (options.focus) {
119
+ $('#'+id+'_tag').focus();
120
+ } else {
121
+ $('#'+id+'_tag').blur();
122
+ }
123
+
124
+ $.fn.tagsInput.updateTagsField(this,tagslist);
125
+
126
+ if (options.callback && tags_callbacks[id] && tags_callbacks[id]['onAddTag']) {
127
+ var f = tags_callbacks[id]['onAddTag'];
128
+ f.call(this, value);
129
+ }
130
+ if(tags_callbacks[id] && tags_callbacks[id]['onChange'])
131
+ {
132
+ var i = tagslist.length;
133
+ var f = tags_callbacks[id]['onChange'];
134
+ f.call(this, $(this), tagslist[i-1]);
135
+ }
136
+ }
137
+
138
+ });
139
+
140
+ return false;
141
+ };
142
+
143
+ $.fn.markAsInvalid = function() {
144
+ var id = $(this).attr('id');
145
+ $('#'+id+'_tag').addClass('not_valid');
146
+ };
147
+
148
+ $.fn.removeTag = function(value) {
149
+ value = unescape(value);
150
+ this.each(function() {
151
+ var id = $(this).attr('id');
152
+
153
+ var old = $(this).val().split(delimiter[id]);
154
+
155
+ $('#'+id+'_tagsinput .tag').remove();
156
+ str = '';
157
+ for (i=0; i< old.length; i++) {
158
+ if (old[i]!=value) {
159
+ str = str + delimiter[id] +old[i];
160
+ }
161
+ }
162
+
163
+ $.fn.tagsInput.importTags(this,str);
164
+
165
+ if (tags_callbacks[id] && tags_callbacks[id]['onRemoveTag']) {
166
+ var f = tags_callbacks[id]['onRemoveTag'];
167
+ f.call(this, value);
168
+ }
169
+ });
170
+
171
+ return false;
172
+ };
173
+
174
+ $.fn.tagExist = function(val) {
175
+ var id = $(this).attr('id');
176
+ var tagslist = $(this).val().split(delimiter[id]);
177
+ return (jQuery.inArray(val, tagslist) >= 0); //true when tag exists, false when not
178
+ };
179
+
180
+ // clear all existing tags and import new ones from a string
181
+ $.fn.importTags = function(str) {
182
+ id = $(this).attr('id');
183
+ $('#'+id+'_tagsinput .tag').remove();
184
+ $.fn.tagsInput.importTags(this,str);
185
+ }
186
+
187
+ $.fn.tagsInput = function(options) {
188
+ var settings = jQuery.extend({
189
+ interactive:true,
190
+ defaultText:'add a tag',
191
+ minChars:0,
192
+ width:'300px',
193
+ height:'100px',
194
+ autocomplete: {selectFirst: false },
195
+ 'hide':true,
196
+ 'delimiter':',',
197
+ 'unique':true,
198
+ removeWithBackspace:true,
199
+ placeholderColor:'#666666',
200
+ autosize: true,
201
+ comfortZone: 20,
202
+ inputPadding: 6*2
203
+ },options);
204
+
205
+ this.each(function() {
206
+ if (settings.hide) {
207
+ $(this).hide();
208
+ }
209
+ var id = $(this).attr('id');
210
+ if (!id || delimiter[$(this).attr('id')]) {
211
+ id = $(this).attr('id', 'tags' + new Date().getTime()).attr('id');
212
+ }
213
+
214
+ var data = jQuery.extend({
215
+ pid:id,
216
+ real_input: '#'+id,
217
+ holder: '#'+id+'_tagsinput',
218
+ input_wrapper: '#'+id+'_addTag',
219
+ fake_input: '#'+id+'_tag'
220
+ },settings);
221
+
222
+ delimiter[id] = data.delimiter;
223
+
224
+ if (settings.onBeforeAddTag || settings.onAddTag || settings.onRemoveTag || settings.onChange) {
225
+ tags_callbacks[id] = new Array();
226
+ tags_callbacks[id]['onBeforeAddTag'] = settings.onBeforeAddTag;
227
+ tags_callbacks[id]['onAddTag'] = settings.onAddTag;
228
+ tags_callbacks[id]['onRemoveTag'] = settings.onRemoveTag;
229
+ tags_callbacks[id]['onChange'] = settings.onChange;
230
+ }
231
+
232
+ var markup = '<div id="'+id+'_tagsinput" class="tagsinput"><div id="'+id+'_addTag">';
233
+
234
+ if (settings.interactive) {
235
+ markup = markup + '<input id="'+id+'_tag" value="" data-default="'+settings.defaultText+'" />';
236
+ }
237
+
238
+ markup = markup + '</div><div class="tags_clear"></div></div>';
239
+
240
+ $(markup).insertAfter(this);
241
+
242
+ $(data.holder).css('width',settings.width);
243
+ $(data.holder).css('min-height',settings.height);
244
+ $(data.holder).css('height','100%');
245
+
246
+ if ($(data.real_input).val()!='') {
247
+ $.fn.tagsInput.importTags($(data.real_input),$(data.real_input).val());
248
+ }
249
+ if (settings.interactive) {
250
+ $(data.fake_input).val($(data.fake_input).attr('data-default'));
251
+ $(data.fake_input).css('color',settings.placeholderColor);
252
+ $(data.fake_input).resetAutosize(settings);
253
+
254
+ $(data.holder).bind('click',data,function(event) {
255
+ $(event.data.fake_input).focus();
256
+ });
257
+
258
+ $(data.fake_input).bind('focus',data,function(event) {
259
+ if ($(event.data.fake_input).val()==$(event.data.fake_input).attr('data-default')) {
260
+ $(event.data.fake_input).val('');
261
+ }
262
+ $(event.data.fake_input).css('color','#000000');
263
+ });
264
+
265
+ if (settings.autocomplete_url != undefined) {
266
+ autocomplete_options = {source: settings.autocomplete_url};
267
+ for (attrname in settings.autocomplete) {
268
+ autocomplete_options[attrname] = settings.autocomplete[attrname];
269
+ }
270
+
271
+ if (jQuery.Autocompleter !== undefined) {
272
+ $(data.fake_input).autocomplete(settings.autocomplete_url, settings.autocomplete);
273
+ $(data.fake_input).bind('result',data,function(event,data,formatted) {
274
+ if (data) {
275
+ $('#'+id).addTag(data[0] + "",{focus:true,unique:(settings.unique)});
276
+ }
277
+ });
278
+ } else if (jQuery.ui.autocomplete !== undefined) {
279
+ $(data.fake_input).autocomplete(autocomplete_options);
280
+ $(data.fake_input).bind('autocompleteselect',data,function(event,ui) {
281
+ $(event.data.real_input).addTag(ui.item.value,{focus:true,unique:(settings.unique)});
282
+ return false;
283
+ });
284
+ }
285
+
286
+
287
+ } else {
288
+ // if a user tabs out of the field, create a new tag
289
+ // this is only available if autocomplete is not used.
290
+ $(data.fake_input).bind('blur',data,function(event) {
291
+ var d = $(this).attr('data-default');
292
+ if ($(event.data.fake_input).val()!='' && $(event.data.fake_input).val()!=d) {
293
+ if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) )
294
+ $(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});
295
+ } else {
296
+ $(event.data.fake_input).val($(event.data.fake_input).attr('data-default'));
297
+ $(event.data.fake_input).css('color',settings.placeholderColor);
298
+ }
299
+ return false;
300
+ });
301
+
302
+ }
303
+ // if user types a comma, create a new tag
304
+ $(data.fake_input).bind('keypress',data,function(event) {
305
+ if (event.which==event.data.delimiter.charCodeAt(0) || event.which==13 ) {
306
+ event.preventDefault();
307
+ if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) )
308
+ $(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});
309
+ $(event.data.fake_input).resetAutosize(settings);
310
+ return false;
311
+ } else if (event.data.autosize) {
312
+ $(event.data.fake_input).doAutosize(settings);
313
+
314
+ }
315
+ });
316
+ //Delete last tag on backspace
317
+ data.removeWithBackspace && $(data.fake_input).bind('keydown', function(event)
318
+ {
319
+ if(event.keyCode == 8 && $(this).val() == '')
320
+ {
321
+ event.preventDefault();
322
+ var last_tag = $(this).closest('.tagsinput').find('.tag:last').text();
323
+ var id = $(this).attr('id').replace(/_tag$/, '');
324
+ last_tag = last_tag.replace(/[\s]+x$/, '');
325
+ $('#' + id).removeTag(escape(last_tag));
326
+ $(this).trigger('focus');
327
+ }
328
+ });
329
+ $(data.fake_input).blur();
330
+
331
+ //Removes the not_valid class when user changes the value of the fake input
332
+ if(data.unique) {
333
+ $(data.fake_input).keydown(function(event){
334
+ if(event.keyCode == 8 || String.fromCharCode(event.which).match(/\w+|[áéíóúÁÉÍÓÚñÑ,/]+/)) {
335
+ $(this).removeClass('not_valid');
336
+ }
337
+ });
338
+ }
339
+ } // if settings.interactive
340
+ });
341
+
342
+ return this;
343
+
344
+ };
345
+
346
+ $.fn.tagsInput.updateTagsField = function(obj,tagslist) {
347
+ var id = $(obj).attr('id');
348
+ $(obj).val(tagslist.join(delimiter[id]));
349
+ };
350
+
351
+ $.fn.tagsInput.importTags = function(obj,val) {
352
+ $(obj).val('');
353
+ var id = $(obj).attr('id');
354
+ var tags = val.split(delimiter[id]);
355
+ for (i=0; i<tags.length; i++) {
356
+ $(obj).addTag(tags[i],{focus:false,callback:false});
357
+ }
358
+ if(tags_callbacks[id] && tags_callbacks[id]['onChange'])
359
+ {
360
+ var f = tags_callbacks[id]['onChange'];
361
+ f.call(obj, obj, tags[i]);
362
+ }
363
+ };
364
+
365
+ })(jQuery);