sunrise-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. data/README.rdoc +46 -0
  2. data/Rakefile +44 -0
  3. data/app/controllers/manage/assets_controller.rb +70 -0
  4. data/app/controllers/manage/base_controller.rb +24 -0
  5. data/app/controllers/manage/pages_controller.rb +37 -0
  6. data/app/controllers/manage/settings_controller.rb +24 -0
  7. data/app/controllers/manage/structures_controller.rb +45 -0
  8. data/app/controllers/manage/users_controller.rb +78 -0
  9. data/app/controllers/pages_controller.rb +22 -0
  10. data/app/views/layouts/manage.html.erb +40 -0
  11. data/app/views/manage/assets/_collection.html.erb +32 -0
  12. data/app/views/manage/assets/_picture.html.erb +10 -0
  13. data/app/views/manage/assets/_swfscript.html.erb +51 -0
  14. data/app/views/manage/headers/_form.html.erb +14 -0
  15. data/app/views/manage/pages/_form.html.erb +11 -0
  16. data/app/views/manage/pages/edit.html.erb +6 -0
  17. data/app/views/manage/pages/new.html.erb +6 -0
  18. data/app/views/manage/settings/_form.html.erb +22 -0
  19. data/app/views/manage/settings/index.html.erb +14 -0
  20. data/app/views/manage/shared/_head.html.erb +41 -0
  21. data/app/views/manage/shared/_locale.html.erb +8 -0
  22. data/app/views/manage/shared/_notice.html.erb +7 -0
  23. data/app/views/manage/shared/_panel.html.erb +34 -0
  24. data/app/views/manage/structures/_form.html.erb +28 -0
  25. data/app/views/manage/structures/_structure.html.erb +34 -0
  26. data/app/views/manage/structures/edit.html.erb +6 -0
  27. data/app/views/manage/structures/index.html.erb +51 -0
  28. data/app/views/manage/structures/new.html.erb +6 -0
  29. data/app/views/manage/users/_form.html.erb +15 -0
  30. data/app/views/manage/users/_model_filter.html.erb +33 -0
  31. data/app/views/manage/users/_user.html.erb +55 -0
  32. data/app/views/manage/users/edit.html.erb +6 -0
  33. data/app/views/manage/users/index.html.erb +36 -0
  34. data/app/views/manage/users/new.html.erb +6 -0
  35. data/app/views/manage/users/show.html.erb +19 -0
  36. data/config/locales/defaults/en.yml +149 -0
  37. data/config/locales/defaults/pluralize.rb +6 -0
  38. data/config/locales/defaults/ru.yml +170 -0
  39. data/config/locales/defaults/uk.yml +238 -0
  40. data/config/locales/devise.en.yml +39 -0
  41. data/config/locales/devise.ru.yml +41 -0
  42. data/config/locales/devise.uk.yml +41 -0
  43. data/config/locales/manage/en.yml +248 -0
  44. data/config/locales/manage/ru.yml +248 -0
  45. data/config/locales/manage/uk.yml +248 -0
  46. data/config/routes.rb +24 -0
  47. data/lib/generators/sunrise/USAGE +7 -0
  48. data/lib/generators/sunrise/install_generator.rb +120 -0
  49. data/lib/generators/sunrise/templates/config/application.yml +4 -0
  50. data/lib/generators/sunrise/templates/config/database.yml +34 -0
  51. data/lib/generators/sunrise/templates/config/logrotate-config +9 -0
  52. data/lib/generators/sunrise/templates/config/nginx-config-passenger +51 -0
  53. data/lib/generators/sunrise/templates/config/seeds.rb +25 -0
  54. data/lib/generators/sunrise/templates/config/sunrise.rb +7 -0
  55. data/lib/generators/sunrise/templates/helpers/manage/assets_helper.rb +16 -0
  56. data/lib/generators/sunrise/templates/helpers/manage/base_helper.rb +81 -0
  57. data/lib/generators/sunrise/templates/helpers/manage/pages_helper.rb +2 -0
  58. data/lib/generators/sunrise/templates/helpers/manage/settings_helper.rb +2 -0
  59. data/lib/generators/sunrise/templates/helpers/manage/structures_helper.rb +12 -0
  60. data/lib/generators/sunrise/templates/helpers/manage/users_helper.rb +6 -0
  61. data/lib/generators/sunrise/templates/images/manage/add_post_bot.gif +0 -0
  62. data/lib/generators/sunrise/templates/images/manage/add_post_top.gif +0 -0
  63. data/lib/generators/sunrise/templates/images/manage/add_white_bot.gif +0 -0
  64. data/lib/generators/sunrise/templates/images/manage/add_white_top.gif +0 -0
  65. data/lib/generators/sunrise/templates/images/manage/arrow.png +0 -0
  66. data/lib/generators/sunrise/templates/images/manage/back_but_lc.gif +0 -0
  67. data/lib/generators/sunrise/templates/images/manage/back_but_rc.gif +0 -0
  68. data/lib/generators/sunrise/templates/images/manage/bot_corn.gif +0 -0
  69. data/lib/generators/sunrise/templates/images/manage/bot_duo_corn.gif +0 -0
  70. data/lib/generators/sunrise/templates/images/manage/but_bg.png +0 -0
  71. data/lib/generators/sunrise/templates/images/manage/but_block_lc.gif +0 -0
  72. data/lib/generators/sunrise/templates/images/manage/but_block_rc.gif +0 -0
  73. data/lib/generators/sunrise/templates/images/manage/but_freze_lc.gif +0 -0
  74. data/lib/generators/sunrise/templates/images/manage/but_freze_rc.gif +0 -0
  75. data/lib/generators/sunrise/templates/images/manage/but_gr.gif +0 -0
  76. data/lib/generators/sunrise/templates/images/manage/but_gr_l.gif +0 -0
  77. data/lib/generators/sunrise/templates/images/manage/but_gr_r.gif +0 -0
  78. data/lib/generators/sunrise/templates/images/manage/but_search.gif +0 -0
  79. data/lib/generators/sunrise/templates/images/manage/but_unfreze_lc.gif +0 -0
  80. data/lib/generators/sunrise/templates/images/manage/but_unfreze_rc.gif +0 -0
  81. data/lib/generators/sunrise/templates/images/manage/button_add_foto.gif +0 -0
  82. data/lib/generators/sunrise/templates/images/manage/button_add_foto_ru.gif +0 -0
  83. data/lib/generators/sunrise/templates/images/manage/button_add_foto_ua.gif +0 -0
  84. data/lib/generators/sunrise/templates/images/manage/button_add_foto_uk.gif +0 -0
  85. data/lib/generators/sunrise/templates/images/manage/cancelbutton.gif +0 -0
  86. data/lib/generators/sunrise/templates/images/manage/dark_arr.gif +0 -0
  87. data/lib/generators/sunrise/templates/images/manage/dark_arr_left.gif +0 -0
  88. data/lib/generators/sunrise/templates/images/manage/dark_cross_ico.gif +0 -0
  89. data/lib/generators/sunrise/templates/images/manage/dot.gif +0 -0
  90. data/lib/generators/sunrise/templates/images/manage/duo_bg.gif +0 -0
  91. data/lib/generators/sunrise/templates/images/manage/duo_bg_small.gif +0 -0
  92. data/lib/generators/sunrise/templates/images/manage/duo_bg_small_blocked.gif +0 -0
  93. data/lib/generators/sunrise/templates/images/manage/duo_bg_small_frozed.gif +0 -0
  94. data/lib/generators/sunrise/templates/images/manage/duo_bg_small_notact.gif +0 -0
  95. data/lib/generators/sunrise/templates/images/manage/duo_bot_small.gif +0 -0
  96. data/lib/generators/sunrise/templates/images/manage/duo_bot_small_blocked.gif +0 -0
  97. data/lib/generators/sunrise/templates/images/manage/duo_bot_small_frozed.gif +0 -0
  98. data/lib/generators/sunrise/templates/images/manage/duo_bot_small_notact.gif +0 -0
  99. data/lib/generators/sunrise/templates/images/manage/duo_top_small.gif +0 -0
  100. data/lib/generators/sunrise/templates/images/manage/duo_top_small_blocked.gif +0 -0
  101. data/lib/generators/sunrise/templates/images/manage/duo_top_small_frozed.gif +0 -0
  102. data/lib/generators/sunrise/templates/images/manage/duo_top_small_notact.gif +0 -0
  103. data/lib/generators/sunrise/templates/images/manage/edit_white_top.gif +0 -0
  104. data/lib/generators/sunrise/templates/images/manage/empty.gif +0 -0
  105. data/lib/generators/sunrise/templates/images/manage/filter_bot_bg.gif +0 -0
  106. data/lib/generators/sunrise/templates/images/manage/filter_top_bg.gif +0 -0
  107. data/lib/generators/sunrise/templates/images/manage/flag_en.gif +0 -0
  108. data/lib/generators/sunrise/templates/images/manage/flag_en_nonact.gif +0 -0
  109. data/lib/generators/sunrise/templates/images/manage/flag_ru.gif +0 -0
  110. data/lib/generators/sunrise/templates/images/manage/flag_ru_nonact.gif +0 -0
  111. data/lib/generators/sunrise/templates/images/manage/flag_ua.gif +0 -0
  112. data/lib/generators/sunrise/templates/images/manage/flag_ua_nonact.gif +0 -0
  113. data/lib/generators/sunrise/templates/images/manage/foto.jpg +0 -0
  114. data/lib/generators/sunrise/templates/images/manage/ico_add.gif +0 -0
  115. data/lib/generators/sunrise/templates/images/manage/ico_del.gif +0 -0
  116. data/lib/generators/sunrise/templates/images/manage/ico_down.gif +0 -0
  117. data/lib/generators/sunrise/templates/images/manage/ico_edit.gif +0 -0
  118. data/lib/generators/sunrise/templates/images/manage/ico_settings.gif +0 -0
  119. data/lib/generators/sunrise/templates/images/manage/ico_up.gif +0 -0
  120. data/lib/generators/sunrise/templates/images/manage/input_bg.gif +0 -0
  121. data/lib/generators/sunrise/templates/images/manage/l_but_corn.gif +0 -0
  122. data/lib/generators/sunrise/templates/images/manage/minimise_but.gif +0 -0
  123. data/lib/generators/sunrise/templates/images/manage/mp3.png +0 -0
  124. data/lib/generators/sunrise/templates/images/manage/page_arr_hover.png +0 -0
  125. data/lib/generators/sunrise/templates/images/manage/page_next_arr.gif +0 -0
  126. data/lib/generators/sunrise/templates/images/manage/page_num_hover.gif +0 -0
  127. data/lib/generators/sunrise/templates/images/manage/page_prev_arr.gif +0 -0
  128. data/lib/generators/sunrise/templates/images/manage/panel/l_but_corn.gif +0 -0
  129. data/lib/generators/sunrise/templates/images/manage/panel/maximise_but.gif +0 -0
  130. data/lib/generators/sunrise/templates/images/manage/panel/r_but_corn.gif +0 -0
  131. data/lib/generators/sunrise/templates/images/manage/panel/top_menu_arr.gif +0 -0
  132. data/lib/generators/sunrise/templates/images/manage/panel/user_pic.gif +0 -0
  133. data/lib/generators/sunrise/templates/images/manage/preloader.gif +0 -0
  134. data/lib/generators/sunrise/templates/images/manage/r_but_corn.gif +0 -0
  135. data/lib/generators/sunrise/templates/images/manage/select_bg.gif +0 -0
  136. data/lib/generators/sunrise/templates/images/manage/select_corn.gif +0 -0
  137. data/lib/generators/sunrise/templates/images/manage/struct_corn_lg.gif +0 -0
  138. data/lib/generators/sunrise/templates/images/manage/struct_corn_llg.gif +0 -0
  139. data/lib/generators/sunrise/templates/images/manage/struct_corn_lw.gif +0 -0
  140. data/lib/generators/sunrise/templates/images/manage/struct_corn_rg.gif +0 -0
  141. data/lib/generators/sunrise/templates/images/manage/struct_corn_rlg.gif +0 -0
  142. data/lib/generators/sunrise/templates/images/manage/struct_corn_rw.gif +0 -0
  143. data/lib/generators/sunrise/templates/images/manage/tab_gl.gif +0 -0
  144. data/lib/generators/sunrise/templates/images/manage/tab_gr.gif +0 -0
  145. data/lib/generators/sunrise/templates/images/manage/tab_wl.gif +0 -0
  146. data/lib/generators/sunrise/templates/images/manage/tab_wr.gif +0 -0
  147. data/lib/generators/sunrise/templates/images/manage/top_corn.gif +0 -0
  148. data/lib/generators/sunrise/templates/images/manage/top_duo_corn.gif +0 -0
  149. data/lib/generators/sunrise/templates/images/manage/top_menu_arr.gif +0 -0
  150. data/lib/generators/sunrise/templates/images/manage/transp_cross.png +0 -0
  151. data/lib/generators/sunrise/templates/images/manage/upload_progress.gif +0 -0
  152. data/lib/generators/sunrise/templates/images/manage/user_act_lc.gif +0 -0
  153. data/lib/generators/sunrise/templates/images/manage/user_act_rc.gif +0 -0
  154. data/lib/generators/sunrise/templates/images/manage/user_ico.gif +0 -0
  155. data/lib/generators/sunrise/templates/images/manage/user_pic.gif +0 -0
  156. data/lib/generators/sunrise/templates/images/manage/user_pic_small.gif +0 -0
  157. data/lib/generators/sunrise/templates/images/manage/user_pic_thumb.gif +0 -0
  158. data/lib/generators/sunrise/templates/javascripts/datepicker/jquery-ui-i18n.js +1176 -0
  159. data/lib/generators/sunrise/templates/javascripts/datepicker/jquery.ui.datepicker-ru.js +37 -0
  160. data/lib/generators/sunrise/templates/javascripts/datepicker/jquery.ui.datepicker-uk.js +37 -0
  161. data/lib/generators/sunrise/templates/javascripts/jquery-ui-timepicker-addon.js +911 -0
  162. data/lib/generators/sunrise/templates/javascripts/jquery.cookie.js +97 -0
  163. data/lib/generators/sunrise/templates/javascripts/jquery.fancybox-1.3.4.pack.js +46 -0
  164. data/lib/generators/sunrise/templates/javascripts/jquery.tmpl.min.js +10 -0
  165. data/lib/generators/sunrise/templates/javascripts/manage.js +290 -0
  166. data/lib/generators/sunrise/templates/javascripts/preloader.js +47 -0
  167. data/lib/generators/sunrise/templates/javascripts/swfupload/fileprogress.js +114 -0
  168. data/lib/generators/sunrise/templates/javascripts/swfupload/handlers.js +164 -0
  169. data/lib/generators/sunrise/templates/javascripts/swfupload/swfupload.js +1134 -0
  170. data/lib/generators/sunrise/templates/javascripts/swfupload/swfupload.queue.js +98 -0
  171. data/lib/generators/sunrise/templates/javascripts/swfupload/swfupload.swf +0 -0
  172. data/lib/generators/sunrise/templates/migrate/create_assets.rb +28 -0
  173. data/lib/generators/sunrise/templates/migrate/create_headers.rb +20 -0
  174. data/lib/generators/sunrise/templates/migrate/create_pages.rb +17 -0
  175. data/lib/generators/sunrise/templates/migrate/create_roles.rb +16 -0
  176. data/lib/generators/sunrise/templates/migrate/create_structures.rb +27 -0
  177. data/lib/generators/sunrise/templates/migrate/create_users.rb +29 -0
  178. data/lib/generators/sunrise/templates/models/defaults/ability.rb +38 -0
  179. data/lib/generators/sunrise/templates/models/defaults/asset.rb +7 -0
  180. data/lib/generators/sunrise/templates/models/defaults/attachment_file.rb +33 -0
  181. data/lib/generators/sunrise/templates/models/defaults/avatar.rb +36 -0
  182. data/lib/generators/sunrise/templates/models/defaults/header.rb +5 -0
  183. data/lib/generators/sunrise/templates/models/defaults/page.rb +5 -0
  184. data/lib/generators/sunrise/templates/models/defaults/picture.rb +34 -0
  185. data/lib/generators/sunrise/templates/models/defaults/position_type.rb +7 -0
  186. data/lib/generators/sunrise/templates/models/defaults/role.rb +20 -0
  187. data/lib/generators/sunrise/templates/models/defaults/role_type.rb +8 -0
  188. data/lib/generators/sunrise/templates/models/defaults/structure.rb +11 -0
  189. data/lib/generators/sunrise/templates/models/defaults/structure_type.rb +9 -0
  190. data/lib/generators/sunrise/templates/models/defaults/user.rb +51 -0
  191. data/lib/generators/sunrise/templates/stylesheets/application.css +1 -0
  192. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/blank.gif +0 -0
  193. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_close.png +0 -0
  194. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_loading.png +0 -0
  195. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_nav_left.png +0 -0
  196. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_nav_right.png +0 -0
  197. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_shadow_e.png +0 -0
  198. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_shadow_n.png +0 -0
  199. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_shadow_ne.png +0 -0
  200. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_shadow_nw.png +0 -0
  201. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_shadow_s.png +0 -0
  202. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_shadow_se.png +0 -0
  203. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_shadow_sw.png +0 -0
  204. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_shadow_w.png +0 -0
  205. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_title_left.png +0 -0
  206. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_title_main.png +0 -0
  207. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_title_over.png +0 -0
  208. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancy_title_right.png +0 -0
  209. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancybox-x.png +0 -0
  210. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancybox-y.png +0 -0
  211. data/lib/generators/sunrise/templates/stylesheets/fancybox/images/fancybox.png +0 -0
  212. data/lib/generators/sunrise/templates/stylesheets/fancybox/jquery.fancybox-1.3.4.css +359 -0
  213. data/lib/generators/sunrise/templates/stylesheets/manage/ie.css +16 -0
  214. data/lib/generators/sunrise/templates/stylesheets/manage/main.css +1074 -0
  215. data/lib/generators/sunrise/templates/stylesheets/manage/panel.css +126 -0
  216. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  217. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  218. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  219. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  220. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  221. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  222. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  223. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  224. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-icons_222222_256x240.png +0 -0
  225. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  226. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-icons_454545_256x240.png +0 -0
  227. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-icons_888888_256x240.png +0 -0
  228. data/lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  229. data/lib/generators/sunrise/templates/stylesheets/smoothness/jquery-ui-1.8.6.custom.css +572 -0
  230. data/lib/generators/sunrise/templates/sweepers/page_sweeper.rb +22 -0
  231. data/lib/generators/sunrise/templates/sweepers/structure_sweeper.rb +29 -0
  232. data/lib/generators/sunrise/templates/sweepers/user_sweeper.rb +17 -0
  233. data/lib/generators/sunrise/templates/views/layouts/application.html.erb +37 -0
  234. data/lib/generators/sunrise/templates/views/pages/show.html.erb +2 -0
  235. data/lib/generators/sunrise/templates/views/shared/_notice.html.erb +17 -0
  236. data/lib/sunrise/controllers/head_options.rb +40 -0
  237. data/lib/sunrise/core.rb +80 -0
  238. data/lib/sunrise/core_ext/array.rb +22 -0
  239. data/lib/sunrise/core_ext/i18n.rb +21 -0
  240. data/lib/sunrise/core_ext/string.rb +28 -0
  241. data/lib/sunrise/core_ext.rb +3 -0
  242. data/lib/sunrise/core_plugins.rb +32 -0
  243. data/lib/sunrise/engine.rb +45 -0
  244. data/lib/sunrise/model_filter.rb +158 -0
  245. data/lib/sunrise/models/asset.rb +102 -0
  246. data/lib/sunrise/models/header.rb +34 -0
  247. data/lib/sunrise/models/page.rb +27 -0
  248. data/lib/sunrise/models/position_type.rb +15 -0
  249. data/lib/sunrise/models/role.rb +28 -0
  250. data/lib/sunrise/models/role_type.rb +15 -0
  251. data/lib/sunrise/models/structure.rb +43 -0
  252. data/lib/sunrise/models/structure_type.rb +15 -0
  253. data/lib/sunrise/models/user.rb +124 -0
  254. data/lib/sunrise/plugin.rb +46 -0
  255. data/lib/sunrise/plugins.rb +56 -0
  256. data/lib/sunrise/system_settings.rb +65 -0
  257. data/lib/sunrise/utils/accessible_attributes.rb +32 -0
  258. data/lib/sunrise/utils/header.rb +29 -0
  259. data/lib/sunrise/utils/i18n_backend.rb +87 -0
  260. data/lib/sunrise/utils/mysql.rb +105 -0
  261. data/lib/sunrise/utils/settingslogic.rb +164 -0
  262. data/lib/sunrise/utils/transliteration.rb +72 -0
  263. data/lib/sunrise/version.rb +3 -0
  264. data/lib/sunrise/views/form_builder.rb +44 -0
  265. data/lib/sunrise/views/helpers.rb +190 -0
  266. data/lib/sunrise/views/inputs/date_time_input.rb +46 -0
  267. data/lib/sunrise-core.rb +2 -0
  268. metadata +492 -0
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Cookie plugin
3
+ *
4
+ * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
5
+ * Dual licensed under the MIT and GPL licenses:
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ * http://www.gnu.org/licenses/gpl.html
8
+ *
9
+ */
10
+
11
+ /**
12
+ * Create a cookie with the given name and value and other optional parameters.
13
+ *
14
+ * @example $.cookie('the_cookie', 'the_value');
15
+ * @desc Set the value of a cookie.
16
+ * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
17
+ * @desc Create a cookie with all available options.
18
+ * @example $.cookie('the_cookie', 'the_value');
19
+ * @desc Create a session cookie.
20
+ * @example $.cookie('the_cookie', null);
21
+ * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
22
+ * used when the cookie was set.
23
+ *
24
+ * @param String name The name of the cookie.
25
+ * @param String value The value of the cookie.
26
+ * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
27
+ * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
28
+ * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
29
+ * If set to null or omitted, the cookie will be a session cookie and will not be retained
30
+ * when the the browser exits.
31
+ * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
32
+ * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
33
+ * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
34
+ * require a secure protocol (like HTTPS).
35
+ * @type undefined
36
+ *
37
+ * @name $.cookie
38
+ * @cat Plugins/Cookie
39
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
40
+ */
41
+
42
+ /**
43
+ * Get the value of a cookie with the given name.
44
+ *
45
+ * @example $.cookie('the_cookie');
46
+ * @desc Get the value of a cookie.
47
+ *
48
+ * @param String name The name of the cookie.
49
+ * @return The value of the cookie.
50
+ * @type String
51
+ *
52
+ * @name $.cookie
53
+ * @cat Plugins/Cookie
54
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
55
+ */
56
+ jQuery.cookie = function(name, value, options) {
57
+ if (typeof value != 'undefined') { // name and value given, set cookie
58
+ options = options || {};
59
+ if (value === null) {
60
+ value = '';
61
+ options.expires = -1;
62
+ }
63
+ var expires = '';
64
+ if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
65
+ var date;
66
+ if (typeof options.expires == 'number') {
67
+ date = new Date();
68
+ date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
69
+ } else {
70
+ date = options.expires;
71
+ }
72
+ expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
73
+ }
74
+ // CAUTION: Needed to parenthesize options.path and options.domain
75
+ // in the following expressions, otherwise they evaluate to undefined
76
+ // in the packed version for some reason...
77
+ var path = options.path ? '; path=' + (options.path) : '';
78
+ var domain = options.domain ? '; domain=' + (options.domain) : '';
79
+ var secure = options.secure ? '; secure' : '';
80
+ document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
81
+ } else { // only name given, get cookie
82
+ var cookieValue = null;
83
+ if (document.cookie && document.cookie != '') {
84
+ var cookies = document.cookie.split(';');
85
+ for (var i = 0; i < cookies.length; i++) {
86
+ var cookie = jQuery.trim(cookies[i]);
87
+ // Does this cookie string begin with the name we want?
88
+ if (cookie.substring(0, name.length + 1) == (name + '=')) {
89
+ cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
90
+ break;
91
+ }
92
+ }
93
+ }
94
+ return cookieValue;
95
+ }
96
+ };
97
+
@@ -0,0 +1,46 @@
1
+ /*
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ ;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
19
+ F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
20
+ c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
21
+ false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
22
+ function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
23
+ '"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
24
+ "function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
25
+ ";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
26
+ opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
27
+ d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
28
+ y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
29
+ i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
30
+ f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
31
+ 37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
32
+ s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
33
+ f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
34
+ j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
35
+ "image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
36
+ 10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
37
+ b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
38
+ 0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
39
+ 1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
40
+ true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
41
+ b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
42
+ d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
43
+ D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
44
+ b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
45
+ b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
46
+ easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
@@ -0,0 +1,10 @@
1
+ /*
2
+ * jQuery Templates Plugin 1.0.0pre
3
+ * http://github.com/jquery/jquery-tmpl
4
+ * Requires jQuery 1.4.2
5
+ *
6
+ * Copyright Software Freedom Conservancy, Inc.
7
+ * Dual licensed under the MIT or GPL Version 2 licenses.
8
+ * http://jquery.org/license
9
+ */
10
+ (function(a){var r=a.fn.domManip,d="_tmplitem",q=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,b={},f={},e,p={key:0,data:{}},i=0,c=0,l=[];function g(g,d,h,e){var c={data:e||(e===0||e===false)?e:d?d.data:{},_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:u,nest:w,wrap:x,html:v,update:t};g&&a.extend(c,g,{nodes:[],parent:d});if(h){c.tmpl=h;c._ctnt=c._ctnt||c.tmpl(a,c);c.key=++i;(l.length?f:b)[i]=c}return c}a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,d){a.fn[f]=function(n){var g=[],i=a(n),k,h,m,l,j=this.length===1&&this[0].parentNode;e=b||{};if(j&&j.nodeType===11&&j.childNodes.length===1&&i.length===1){i[d](this[0]);g=this}else{for(h=0,m=i.length;h<m;h++){c=h;k=(h>0?this.clone(true):this).get();a(i[h])[d](k);g=g.concat(k)}c=0;g=this.pushStack(g,f,i.selector)}l=e;e=null;a.tmpl.complete(l);return g}});a.fn.extend({tmpl:function(d,c,b){return a.tmpl(this[0],d,c,b)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){return a.template(b,this[0])},domManip:function(d,m,k){if(d[0]&&a.isArray(d[0])){var g=a.makeArray(arguments),h=d[0],j=h.length,i=0,f;while(i<j&&!(f=a.data(h[i++],"tmplItem")));if(f&&c)g[2]=function(b){a.tmpl.afterManip(this,b,k)};r.apply(this,g)}else r.apply(this,arguments);c=0;!e&&a.tmpl.complete(b);return this}});a.extend({tmpl:function(d,h,e,c){var i,k=!c;if(k){c=p;d=a.template[d]||a.template(null,d);f={}}else if(!d){d=c.tmpl;b[c.key]=c;c.nodes=[];c.wrapped&&n(c,c.wrapped);return a(j(c,null,c.tmpl(a,c)))}if(!d)return[];if(typeof h==="function")h=h.call(c||{});e&&e.wrapped&&n(e,e.wrapped);i=a.isArray(h)?a.map(h,function(a){return a?g(e,c,d,a):null}):[g(e,c,d,h)];return k?a(j(c,null,i)):i},tmplItem:function(b){var c;if(b instanceof a)b=b[0];while(b&&b.nodeType===1&&!(c=a.data(b,"tmplItem"))&&(b=b.parentNode));return c||p},template:function(c,b){if(b){if(typeof b==="string")b=o(b);else if(b instanceof a)b=b[0]||{};if(b.nodeType)b=a.data(b,"tmpl")||a.data(b,"tmpl",o(b.innerHTML));return typeof c==="string"?(a.template[c]=b):b}return c?typeof c!=="string"?a.template(null,c):a.template[c]||a.template(null,q.test(c)?c:a(c)):null},encode:function(a){return(""+a).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});a.extend(a.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){b={}},afterManip:function(f,b,d){var e=b.nodeType===11?a.makeArray(b.childNodes):b.nodeType===1?[b]:[];d.call(f,b);m(e);c++}});function j(e,g,f){var b,c=f?a.map(f,function(a){return typeof a==="string"?e.key?a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+d+'="'+e.key+'" $2'):a:j(a,e,a._ctnt)}):e;if(g)return c;c=c.join("");c.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(f,c,e,d){b=a(e).get();m(b);if(c)b=k(c).concat(b);if(d)b=b.concat(k(d))});return b?b:k(c)}function k(c){var b=document.createElement("div");b.innerHTML=c;return a.makeArray(b.childNodes)}function o(b){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+a.trim(b).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(m,l,k,g,b,c,d){var j=a.tmpl.tag[k],i,e,f;if(!j)throw"Unknown template tag: "+k;i=j._default||[];if(c&&!/\w$/.test(b)){b+=c;c=""}if(b){b=h(b);d=d?","+h(d)+")":c?")":"";e=c?b.indexOf(".")>-1?b+h(c):"("+b+").call($item"+d:b;f=c?e:"(typeof("+b+")==='function'?("+b+").call($item):("+b+"))"}else f=e=i.$1||"null";g=h(g);return"');"+j[l?"close":"open"].split("$notnull_1").join(b?"typeof("+b+")!=='undefined' && ("+b+")!=null":"true").split("$1a").join(f).split("$1").join(e).split("$2").join(g||i.$2||"")+"__.push('"})+"');}return __;")}function n(c,b){c._wrap=j(c,true,a.isArray(b)?b:[q.test(b)?b:a(b).html()]).join("")}function h(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(b){var a=document.createElement("div");a.appendChild(b.cloneNode(true));return a.innerHTML}function m(o){var n="_"+c,k,j,l={},e,p,h;for(e=0,p=o.length;e<p;e++){if((k=o[e]).nodeType!==1)continue;j=k.getElementsByTagName("*");for(h=j.length-1;h>=0;h--)m(j[h]);m(k)}function m(j){var p,h=j,k,e,m;if(m=j.getAttribute(d)){while(h.parentNode&&(h=h.parentNode).nodeType===1&&!(p=h.getAttribute(d)));if(p!==m){h=h.parentNode?h.nodeType===11?0:h.getAttribute(d)||0:0;if(!(e=b[m])){e=f[m];e=g(e,b[h]||f[h]);e.key=++i;b[i]=e}c&&o(m)}j.removeAttribute(d)}else if(c&&(e=a.data(j,"tmplItem"))){o(e.key);b[e.key]=e;h=a.data(j.parentNode,"tmplItem");h=h?h.key:0}if(e){k=e;while(k&&k.key!=h){k.nodes.push(j);k=k.parent}delete e._ctnt;delete e._wrap;a.data(j,"tmplItem",e)}function o(a){a=a+n;e=l[a]=l[a]||g(e,b[e.parent.key+n]||e.parent)}}}function u(a,d,c,b){if(!a)return l.pop();l.push({_:a,tmpl:d,item:this,data:c,options:b})}function w(d,c,b){return a.tmpl(a.template(d),c,b,this)}function x(b,d){var c=b.options||{};c.wrapped=d;return a.tmpl(a.template(b.tmpl),b.data,c,b.item)}function v(d,c){var b=this._wrap;return a.map(a(a.isArray(b)?b.join(""):b).filter(d||"*"),function(a){return c?a.innerText||a.textContent:a.outerHTML||s(a)})}function t(){var b=this.nodes;a.tmpl(null,null,null,this).insertBefore(b[0]);a(b).remove()}})(jQuery);
@@ -0,0 +1,290 @@
1
+ /* ------------------------------------------------------------------------
2
+ * manage.js
3
+ * Copyright (c) 2007-2011 Aimbulance, LLC. All rights reserved.
4
+ * ------------------------------------------------------------------------ */
5
+
6
+ $(document).ready(function(){
7
+ //$("input[type='text']:first", document.forms[0]).focus();
8
+ var element = $('input:visible,select:visible,textarea:visible', document).get(0);
9
+ if (element) element.focus();
10
+ });
11
+
12
+ var Manage = {
13
+ fade_flash: function()
14
+ {
15
+ $('#manage_container div.message').slideUp('slow');
16
+ },
17
+
18
+ toggle_element: function(dom_id)
19
+ {
20
+ var element = $('#' + dom_id);
21
+
22
+ $.cookie(element.id, (element.is(':visible') ? 0 : 1), { expires: 3, path: '/manage' });
23
+
24
+ element.is(':visible') ? element.slideUp("slow") : element.slideDown("slow");
25
+ },
26
+
27
+ init_collection: function(dom_id, class_name)
28
+ {
29
+ var query = "#" + dom_id + " div." + class_name;
30
+
31
+ $(query)
32
+ .bind('mouseover', this.handle_over)
33
+ .bind('mouseout', this.handle_out);
34
+ },
35
+
36
+ handle_over: function(e)
37
+ {
38
+ $(this).find('div.dot-block').show();
39
+ $(this).find('div.act-bl').show();
40
+ },
41
+
42
+ handle_out: function(e)
43
+ {
44
+ $(this).find('div.dot-block').hide();
45
+ $(this).find('div.act-bl').hide();
46
+ },
47
+
48
+ append_node: function(sibling, element)
49
+ {
50
+ $(sibling).css({left: 0, top: 0});
51
+ $(element).css({left: 0, top: 0});
52
+
53
+ $(element).insertAfter(sibling);
54
+ },
55
+
56
+ move_node: function(dom_id, direction)
57
+ {
58
+ var element = $('#' + dom_id);
59
+ var sibling = null;
60
+ var node = null;
61
+
62
+ switch(direction)
63
+ {
64
+ case 'up':
65
+ sibling = element.prev();
66
+ node = element;
67
+ element = sibling;
68
+ sibling = node;
69
+ break;
70
+ case 'down':
71
+ sibling = element.next();
72
+ break;
73
+ }
74
+
75
+ if (sibling != null)
76
+ {
77
+ var element_height = element.height() + 10;
78
+ var sibling_height = sibling.height() + 10;
79
+
80
+ element.animate({left: 0, top: sibling_height}, { duration: "slow" });
81
+
82
+ sibling.animate({left: 0, top: -element_height}, {duration: "slow", complete: function(){
83
+ Manage.append_node(sibling, element);
84
+ }});
85
+ }
86
+ },
87
+
88
+ init_assets: function(query, url)
89
+ {
90
+ $(query + " a.fancybox").fancybox({
91
+ 'titleShow' : false,
92
+ 'transitionIn' : 'none',
93
+ 'transitionOut' : 'none'
94
+ });
95
+
96
+ $(query + ' a.del').live("ajax:complete", function(){
97
+ $(this).parents('div.asset').remove();
98
+ });
99
+
100
+ $(query).sortable({
101
+ revert: true,
102
+ update: function(event, ui){
103
+ var data = $(query).sortable('serialize');
104
+ $.ajax({
105
+ url: url,
106
+ data: data,
107
+ dataType: 'script',
108
+ type: 'POST'
109
+ });
110
+ }
111
+ });
112
+ }
113
+ };
114
+
115
+ var Tree = {
116
+ expand: function(e)
117
+ {
118
+ var event = e || window.event;
119
+ var target = event.target || event.srcElement;
120
+
121
+ var node = $(target).closest('a');
122
+ if (typeof(node) == 'undefined') return;
123
+
124
+ var item = node.parents('div.row-container');
125
+ var stage = $('#' + item.attr('id') + '_children');
126
+
127
+ if (stage != null)
128
+ {
129
+ var mode = stage.is(':visible') ? 1 : 0;
130
+ stage.toggle();
131
+ event.data.save(node.attr('id'), mode);
132
+ }
133
+
134
+ event.preventDefault();
135
+
136
+ return false;
137
+ },
138
+
139
+ init: function(tree)
140
+ {
141
+ this.tree = $(tree);
142
+ this.cookie_key = "mtree";
143
+
144
+ var links = this.tree.find("a.dark-arr");
145
+
146
+ for(var i = 0; i < links.length; i++)
147
+ {
148
+ node = $(links[i]);
149
+
150
+ if (typeof(node) != 'undefined')
151
+ {
152
+ node.bind('click', this, this.expand);
153
+
154
+ mode = !this.state(node.attr('id'));
155
+
156
+ var item = node.parents('div.row-container');
157
+ var stage = $(item.attr('id') + '_children');
158
+
159
+ if (stage != null)
160
+ {
161
+ if (mode) {stage.hide();} else {stage.show();}
162
+ }
163
+ }
164
+ }
165
+ },
166
+
167
+ save: function(node_key, value)
168
+ {
169
+ var str = $.cookie(this.cookie_key);
170
+ var mas = new Array();
171
+
172
+ if (str == null) str = '';
173
+
174
+ var arr = str.split(';');
175
+
176
+ mas.push(node_key + ":" + value);
177
+
178
+ for(var i = 0; i < arr.length; i++)
179
+ {
180
+ hash = arr[i].split(':');
181
+ if (hash[0] != node_key)
182
+ {
183
+ mas.push(arr[i]);
184
+ }
185
+ }
186
+
187
+ str = mas.join(';');
188
+ $.cookie(this.cookie_key, str, { expires: 3, path: '/manage' });
189
+ },
190
+
191
+ state: function(node_key)
192
+ {
193
+ var str = $.cookie(this.cookie_key);
194
+ if (str == null) str = '';
195
+ var value = 0;
196
+
197
+ var arr = str.split(';');
198
+ for(var i = 0; i < arr.length; i++)
199
+ {
200
+ hash = arr[i].split(':');
201
+ if (hash[0] == node_key)
202
+ {
203
+ value = parseInt(hash[1]);
204
+ break;
205
+ }
206
+ }
207
+
208
+ return value == 1;
209
+ }
210
+
211
+ };
212
+
213
+ var SelectList = {
214
+ show: function(element, list)
215
+ {
216
+ var size = { width: element.width(), height: element.height() };
217
+ var pos = element.offset();
218
+ var height = list.height();
219
+ var width = size.width + 20;
220
+
221
+ list.css({
222
+ width: ((width < 150) ? 150 : width) + "px",
223
+ left: pos.left + "px",
224
+ top: pos.top + size.height + "px",
225
+ height: ((height > 200) ? 200 : height) + 'px',
226
+ zIndex: 5000
227
+ });
228
+
229
+ list.slideDown();
230
+ },
231
+
232
+ hide: function(list)
233
+ {
234
+ list.slideUp();
235
+ },
236
+
237
+ toggle: function(e)
238
+ {
239
+ var event = e || window.event;
240
+ var target = event.target || event.srcElement;
241
+
242
+ var element = $(target).closest("a");
243
+ var list = $('#' + element.attr('id') + '_list');
244
+
245
+ list.is(':visible') ? this.hide(list) : this.show(element, list);
246
+
247
+ return false;
248
+ }
249
+ };
250
+
251
+ var TabPanel = {
252
+ click: function(e)
253
+ {
254
+ var event = e || window.event;
255
+ var target = event.target || event.srcElement;
256
+
257
+ var element = $(target).closest("a");
258
+ var container = $('#' + element.attr('id') + "_block");
259
+ var li = element.parents('li');
260
+ var parent_ul = li.parents('ul');
261
+
262
+ parent_ul.nextAll('div.add-white-bl').hide();
263
+ parent_ul.children('li').removeClass('active');
264
+ parent_ul.children('li').addClass('not-active');
265
+
266
+ li.toggleClass("not-active");
267
+ li.addClass('active');
268
+
269
+ container.show();
270
+ }
271
+ };
272
+
273
+ function insert_fields(link, method, content)
274
+ {
275
+ var new_id = new Date().getTime();
276
+ var regexp = new RegExp("new_" + method, "g")
277
+
278
+ $(link).before(content.replace(regexp, new_id));
279
+ }
280
+
281
+ function remove_fields(link)
282
+ {
283
+ var hidden_field = $(link).prev("input[type=hidden]");
284
+
285
+ if (hidden_field) {
286
+ hidden_field.val('1');
287
+ }
288
+
289
+ $(link).closest("div.elem-bl").hide();
290
+ }
@@ -0,0 +1,47 @@
1
+ // Ajax Preloader
2
+ var Preloader;
3
+
4
+ if (Preloader == undefined) {
5
+ Preloader = function(dom_id) {
6
+ this.show(dom_id);
7
+ };
8
+ }
9
+
10
+ Preloader.select = function(dom_id) {
11
+ var element_id = (dom_id == null) ? 'preloader' : dom_id;
12
+
13
+ if (this.element == null)
14
+ {
15
+ this.element = document.getElementById(element_id);
16
+ }
17
+ };
18
+
19
+ Preloader.show = function(dom_id) {
20
+ this.select(dom_id);
21
+ if (this.element == null) return;
22
+
23
+ this.draw();
24
+ };
25
+
26
+ Preloader.draw = function(){
27
+ if (this.element == null) return;
28
+
29
+ var client = window.innerHeight || document.documentElement.clientHeight;
30
+ var top = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
31
+ var prefix = top + (client / 2);
32
+
33
+ this.element.style.top = prefix + 'px';
34
+ this.element.style.display = '';
35
+ };
36
+
37
+ Preloader.hide = function(dom_id){
38
+ this.select(dom_id);
39
+ if (this.element == null) return;
40
+
41
+ this.element.style.display = 'none';
42
+ this.element.style.top = '0px';
43
+ };
44
+
45
+ Preloader.is_enable = function(){
46
+ return (document.getElementById('preloader') != null);
47
+ };
@@ -0,0 +1,114 @@
1
+ /* ******************************************
2
+ * FileProgress Object
3
+ * Control object for displaying file info
4
+ * ****************************************** */
5
+
6
+ function FileProgress(file, targetID) {
7
+ this.fileProgressID = "divFileProgress";
8
+
9
+ this.fileProgressWrapper = document.getElementById(this.fileProgressID);
10
+ if (!this.fileProgressWrapper) {
11
+ this.fileProgressWrapper = document.createElement("div");
12
+ this.fileProgressWrapper.className = "progress-container";
13
+ this.fileProgressWrapper.id = this.fileProgressID;
14
+
15
+ var progressStatus = document.createElement("div");
16
+ progressStatus.className = "status-message";
17
+ progressStatus.innerHTML = "&nbsp;";
18
+
19
+ this.fileProgressElement = document.createElement("div");
20
+ this.fileProgressElement.className = "progress-bar";
21
+
22
+ var progressBar = document.createElement("div");
23
+ progressBar.className = "progress";
24
+
25
+ this.fileProgressElement.appendChild(progressBar);
26
+
27
+ this.fileProgressWrapper.appendChild(progressStatus);
28
+ this.fileProgressWrapper.appendChild(this.fileProgressElement);
29
+
30
+ document.getElementById(targetID).appendChild(this.fileProgressWrapper);
31
+
32
+ } else {
33
+ this.fileProgressElement = this.fileProgressWrapper.childNodes[1];
34
+ //this.fileProgressElement.childNodes[1].firstChild.nodeValue = file.name;
35
+ }
36
+
37
+ this.height = this.fileProgressWrapper.offsetHeight;
38
+ }
39
+ FileProgress.prototype.setProgress = function(percentage) {
40
+ var value = parseInt((400 * percentage / 100));
41
+ this.fileProgressElement.childNodes[0].style.width = value + "px";
42
+ };
43
+ FileProgress.prototype.setComplete = function() {
44
+ /*this.fileProgressElement.className = "progressContainer blue";
45
+ this.fileProgressElement.childNodes[3].className = "progressBarComplete";
46
+ this.fileProgressElement.childNodes[3].style.width = "";*/
47
+
48
+ };
49
+ FileProgress.prototype.setError = function() {
50
+ /*this.fileProgressElement.className = "progressContainer red";
51
+ this.fileProgressElement.childNodes[3].className = "progressBarError";
52
+ this.fileProgressElement.childNodes[3].style.width = "";*/
53
+
54
+ };
55
+ FileProgress.prototype.setCancelled = function() {
56
+ /*this.fileProgressElement.className = "progressContainer";
57
+ this.fileProgressElement.childNodes[3].className = "progressBarError";
58
+ this.fileProgressElement.childNodes[3].style.width = "";*/
59
+
60
+ };
61
+ FileProgress.prototype.setStatus = function(status) {
62
+ this.fileProgressWrapper.childNodes[0].innerHTML = status;
63
+ };
64
+ FileProgress.prototype.parseXML = function(xml){
65
+ var xmlDoc = null;
66
+
67
+ if (window.ActiveXObject)
68
+ {
69
+ xmlDoc = Ajax.getTransport();
70
+ xmlDoc.async = false;
71
+ xmlDoc.loadXML(xml);
72
+ }
73
+ else
74
+ {
75
+ var parser = new DOMParser();
76
+ xmlDoc = parser.parseFromString(xml,"text/xml");
77
+ }
78
+
79
+ return xmlDoc;
80
+ };
81
+ FileProgress.prototype.setThumbnail = function(serverData, collection_id) {
82
+ var xml = this.parseXML(serverData);
83
+ var thumbnail = xml.getElementsByTagName('asset');
84
+ var collection = document.getElementById(collection_id);
85
+
86
+ thumbnail = (thumbnail[0] == null ? xml : thumbnail[0])
87
+
88
+ if (thumbnail != null)
89
+ {
90
+ var id_node = thumbnail.getElementsByTagName('id')[0];
91
+ var filename_node = thumbnail.getElementsByTagName('filename')[0];
92
+ var styles_node = thumbnail.getElementsByTagName('styles')[0];
93
+ var thumb_node = styles_node ? styles_node.getElementsByTagName('thumb')[0] : thumbnail.getElementsByTagName('thumb')[0];
94
+
95
+ var id = id_node.childNodes[0].nodeValue;
96
+ var filename = filename_node.childNodes[0].nodeValue;
97
+ var thumb = thumb_node.childNodes[0].nodeValue;
98
+
99
+ var picture = { id: id, link_path: thumb, image_path: thumb, image_title: filename };
100
+
101
+ $("#asset_tmpl").tmpl(picture).appendTo( collection );
102
+ }
103
+ };
104
+
105
+ FileProgress.prototype.toggleCancel = function (show, swfuploadInstance) {
106
+ /*this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden";
107
+ if (swfuploadInstance) {
108
+ var fileID = this.fileProgressID;
109
+ this.fileProgressElement.childNodes[0].onclick = function () {
110
+ swfuploadInstance.cancelUpload(fileID);
111
+ return false;
112
+ };
113
+ }*/
114
+ };