adva-core 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. data/lib/bundler/repository.rb +118 -0
  2. metadata +68 -317
  3. data/app/controllers/admin/base_controller.rb +0 -21
  4. data/app/controllers/admin/pages_controller.rb +0 -7
  5. data/app/controllers/admin/sections_controller.rb +0 -39
  6. data/app/controllers/admin/sites_controller.rb +0 -21
  7. data/app/controllers/articles_controller.rb +0 -3
  8. data/app/controllers/base_controller.rb +0 -22
  9. data/app/controllers/installations_controller.rb +0 -28
  10. data/app/controllers/pages_controller.rb +0 -2
  11. data/app/controllers/sections_controller.rb +0 -3
  12. data/app/helpers/form_helper.rb +0 -13
  13. data/app/helpers/sections_helper.rb +0 -7
  14. data/app/helpers/url_helper.rb +0 -18
  15. data/app/models/account.rb +0 -3
  16. data/app/models/article.rb +0 -2
  17. data/app/models/content.rb +0 -4
  18. data/app/models/page.rb +0 -17
  19. data/app/models/section.rb +0 -59
  20. data/app/models/site.rb +0 -26
  21. data/app/views/admin/contents/_menu.html.rb +0 -17
  22. data/app/views/admin/pages/_menu.html.rb +0 -10
  23. data/app/views/admin/pages/new.html.rb +0 -19
  24. data/app/views/admin/pages/show.html.rb +0 -25
  25. data/app/views/admin/sections/_menu.html.rb +0 -45
  26. data/app/views/admin/sections/_section.html.rb +0 -7
  27. data/app/views/admin/sections/_select_type.html.rb +0 -16
  28. data/app/views/admin/sections/index.html.rb +0 -28
  29. data/app/views/admin/sites/_menu.html.rb +0 -2
  30. data/app/views/admin/sites/edit.html.rb +0 -22
  31. data/app/views/admin/sites/index.html.rb +0 -12
  32. data/app/views/admin/sites/new.html.rb +0 -39
  33. data/app/views/admin/sites/show.html.rb +0 -7
  34. data/app/views/installations/new.html.rb +0 -39
  35. data/app/views/installations/show.html.rb +0 -9
  36. data/app/views/layouts/_flash.html.rb +0 -9
  37. data/app/views/layouts/admin.rb +0 -38
  38. data/app/views/layouts/admin/_header.rb +0 -48
  39. data/app/views/layouts/admin/_tabs.html.rb +0 -18
  40. data/app/views/layouts/admin/_top.rb +0 -58
  41. data/app/views/layouts/base.rb +0 -58
  42. data/app/views/layouts/default.rb +0 -45
  43. data/app/views/layouts/default/_menu.rb +0 -19
  44. data/app/views/layouts/simple.rb +0 -16
  45. data/app/views/pages/show.html.rb +0 -7
  46. data/config/initializers/simple_form.rb +0 -53
  47. data/config/locales/en.yml +0 -129
  48. data/config/redirects.rb +0 -8
  49. data/config/routes.rb +0 -21
  50. data/lib/adva-core.rb +0 -1
  51. data/lib/adva.rb +0 -37
  52. data/lib/adva/active_record/has_options.rb +0 -55
  53. data/lib/adva/cli.rb +0 -16
  54. data/lib/adva/controller.rb +0 -7
  55. data/lib/adva/controller/abstract_actions.rb +0 -87
  56. data/lib/adva/controller/internal_redirect.rb +0 -26
  57. data/lib/adva/controller/references.rb +0 -28
  58. data/lib/adva/core.rb +0 -85
  59. data/lib/adva/engine.rb +0 -64
  60. data/lib/adva/engine/sliced_models.rb +0 -35
  61. data/lib/adva/generators.rb +0 -8
  62. data/lib/adva/generators/app.rb +0 -121
  63. data/lib/adva/generators/engine.rb +0 -58
  64. data/lib/adva/generators/gemfile.rb +0 -50
  65. data/lib/adva/generators/install.rb +0 -31
  66. data/lib/adva/generators/templates/app/app_template.rb +0 -3
  67. data/lib/adva/generators/templates/engine/Gemfile.erb +0 -3
  68. data/lib/adva/generators/templates/engine/all.rb +0 -1
  69. data/lib/adva/generators/templates/engine/en.yml.erb +0 -2
  70. data/lib/adva/generators/templates/engine/engine.rb.erb +0 -11
  71. data/lib/adva/generators/templates/engine/gemspec.erb +0 -21
  72. data/lib/adva/generators/templates/engine/migration.rb.erb +0 -11
  73. data/lib/adva/generators/templates/engine/redirects.rb.erb +0 -3
  74. data/lib/adva/generators/templates/engine/routes.rb.erb +0 -3
  75. data/lib/adva/generators/templates/engine/test_helper.rb.erb +0 -3
  76. data/lib/adva/i18n.rb +0 -73
  77. data/lib/adva/rack.rb +0 -5
  78. data/lib/adva/rack/static.rb +0 -50
  79. data/lib/adva/registry.rb +0 -62
  80. data/lib/adva/responder.rb +0 -21
  81. data/lib/adva/responder/redirect.rb +0 -31
  82. data/lib/adva/routing_filters/section_path.rb +0 -72
  83. data/lib/adva/routing_filters/section_root.rb +0 -65
  84. data/lib/adva/tasks/core.rake +0 -9
  85. data/lib/adva/tasks/core.rb +0 -160
  86. data/lib/adva/testing.rb +0 -57
  87. data/lib/adva/testing/engine.rb +0 -37
  88. data/lib/adva/view.rb +0 -7
  89. data/lib/adva/view/form.rb +0 -44
  90. data/lib/adva/view/form/tabs.rb +0 -46
  91. data/lib/adva/view/helper/i18n.rb +0 -26
  92. data/lib/adva/view/menu.rb +0 -73
  93. data/lib/adva/view/menu/admin.rb +0 -100
  94. data/lib/adva/view/menu/items.rb +0 -26
  95. data/lib/adva/view/tabs.rb +0 -28
  96. data/lib/adva_core/version.rb +0 -3
  97. data/lib/core_ext/rails/action_view/has_many_through_collection_helpers.rb +0 -27
  98. data/lib/core_ext/rails/active_record/skip_callbacks.rb +0 -51
  99. data/lib/core_ext/ruby/array/flatten_once.rb +0 -9
  100. data/lib/core_ext/ruby/kernel/silence_stream.rb +0 -17
  101. data/lib/core_ext/ruby/module/include_anonymous.rb +0 -36
  102. data/lib/core_ext/ruby/module/option_reader.rb +0 -9
  103. data/lib/patches/arel/table_initialization_fixes.rb +0 -68
  104. data/lib/patches/inherited_resources.rb +0 -34
  105. data/lib/patches/rails/arel_table_options_fix.rb +0 -13
  106. data/lib/patches/rails/asset_expansion_multiple_registrations.rb +0 -21
  107. data/lib/patches/rails/recognize_path_env.rb +0 -43
  108. data/lib/patches/rails/route_set_to_param.rb +0 -25
  109. data/lib/patches/rails/sti_associations.rb +0 -17
  110. data/lib/patches/rails/template_resolver_caching.rb +0 -9
  111. data/lib/patches/rails/url_for.rb +0 -60
  112. data/lib/patches/responders/flash_responder.rb +0 -17
  113. data/lib/patches/simple_form.rb +0 -37
  114. data/lib/patches/thor/core_ext/hash.rb +0 -7
  115. data/lib/patches/thor/group/symbolized_options.rb +0 -8
  116. data/lib/patches/webrat/links-data-method.rb +0 -19
  117. data/lib/patches/webrat/logger.rb +0 -19
  118. data/lib/patches/webrat/upload_file.rb +0 -28
  119. data/lib/testing/assertions.rb +0 -19
  120. data/lib/testing/factories.rb +0 -30
  121. data/lib/testing/helpers/global_helpers.rb +0 -9
  122. data/lib/testing/paths.rb +0 -54
  123. data/lib/testing/step_definitions/common_steps.rb +0 -279
  124. data/lib/testing/step_definitions/menu_steps.rb +0 -11
  125. data/lib/testing/step_definitions/routes_steps.rb +0 -18
  126. data/lib/testing/step_definitions/transforms.rb +0 -50
  127. data/lib/testing/step_definitions/webrat_steps.rb +0 -291
  128. data/lib/testing/step_definitions/within_steps.rb +0 -17
  129. data/lib/webrat/integrations/rails.rb +0 -33
  130. data/public/images/adva-core/admin/header_bg.png +0 -0
  131. data/public/images/adva-core/admin/menu_checkmark.png +0 -0
  132. data/public/images/adva-core/admin/section_menu_bg.png +0 -0
  133. data/public/images/adva-core/admin/tab_action_active.png +0 -0
  134. data/public/images/adva-core/admin/tab_main_active.png +0 -0
  135. data/public/images/adva-core/admin/tab_sidebar_active.png +0 -0
  136. data/public/images/adva-core/admin/tab_top_active.png +0 -0
  137. data/public/images/adva-core/asset_selected.png +0 -0
  138. data/public/images/adva-core/avatar.gif +0 -0
  139. data/public/images/adva-core/feed.mini.png +0 -0
  140. data/public/images/adva-core/filter-bg.png +0 -0
  141. data/public/images/adva-core/grid.png +0 -0
  142. data/public/images/adva-core/icons/accept.png +0 -0
  143. data/public/images/adva-core/icons/add.png +0 -0
  144. data/public/images/adva-core/icons/arrow_cross.png +0 -0
  145. data/public/images/adva-core/icons/arrow_cross_2.png +0 -0
  146. data/public/images/adva-core/icons/arrow_cross_3.png +0 -0
  147. data/public/images/adva-core/icons/arrow_up_down.png +0 -0
  148. data/public/images/adva-core/icons/assets/audio.png +0 -0
  149. data/public/images/adva-core/icons/assets/doc.png +0 -0
  150. data/public/images/adva-core/icons/assets/pdf.png +0 -0
  151. data/public/images/adva-core/icons/assets/video.png +0 -0
  152. data/public/images/adva-core/icons/attach.png +0 -0
  153. data/public/images/adva-core/icons/bin.png +0 -0
  154. data/public/images/adva-core/icons/bin_closed.png +0 -0
  155. data/public/images/adva-core/icons/bin_empty.png +0 -0
  156. data/public/images/adva-core/icons/bullet_black.png +0 -0
  157. data/public/images/adva-core/icons/bullet_delete.png +0 -0
  158. data/public/images/adva-core/icons/bullet_error.png +0 -0
  159. data/public/images/adva-core/icons/bullet_go.png +0 -0
  160. data/public/images/adva-core/icons/bullet_red.png +0 -0
  161. data/public/images/adva-core/icons/bullet_white.png +0 -0
  162. data/public/images/adva-core/icons/bullet_yellow.png +0 -0
  163. data/public/images/adva-core/icons/cancel.png +0 -0
  164. data/public/images/adva-core/icons/comment.gif +0 -0
  165. data/public/images/adva-core/icons/comment.png +0 -0
  166. data/public/images/adva-core/icons/comment_add.png +0 -0
  167. data/public/images/adva-core/icons/comment_blue.gif +0 -0
  168. data/public/images/adva-core/icons/comment_delete.png +0 -0
  169. data/public/images/adva-core/icons/comment_edit.png +0 -0
  170. data/public/images/adva-core/icons/comment_yellow.gif +0 -0
  171. data/public/images/adva-core/icons/cross.png +0 -0
  172. data/public/images/adva-core/icons/delete.png +0 -0
  173. data/public/images/adva-core/icons/eye.png +0 -0
  174. data/public/images/adva-core/icons/favorites.png +0 -0
  175. data/public/images/adva-core/icons/help.png +0 -0
  176. data/public/images/adva-core/icons/hourglass.png +0 -0
  177. data/public/images/adva-core/icons/icon_attachment.gif +0 -0
  178. data/public/images/adva-core/icons/icon_padlock.gif +0 -0
  179. data/public/images/adva-core/icons/link.png +0 -0
  180. data/public/images/adva-core/icons/lock.png +0 -0
  181. data/public/images/adva-core/icons/magnifier.png +0 -0
  182. data/public/images/adva-core/icons/minus.gif +0 -0
  183. data/public/images/adva-core/icons/page_add.png +0 -0
  184. data/public/images/adva-core/icons/page_delete.png +0 -0
  185. data/public/images/adva-core/icons/page_edit.png +0 -0
  186. data/public/images/adva-core/icons/page_favorites.png +0 -0
  187. data/public/images/adva-core/icons/page_go.png +0 -0
  188. data/public/images/adva-core/icons/page_green.png +0 -0
  189. data/public/images/adva-core/icons/page_red.png +0 -0
  190. data/public/images/adva-core/icons/page_white_add.png +0 -0
  191. data/public/images/adva-core/icons/page_white_delete.png +0 -0
  192. data/public/images/adva-core/icons/page_white_edit.png +0 -0
  193. data/public/images/adva-core/icons/page_white_go.png +0 -0
  194. data/public/images/adva-core/icons/page_white_link.png +0 -0
  195. data/public/images/adva-core/icons/page_white_magnify.png +0 -0
  196. data/public/images/adva-core/icons/pencil.png +0 -0
  197. data/public/images/adva-core/icons/star.png +0 -0
  198. data/public/images/adva-core/icons/stop.png +0 -0
  199. data/public/images/adva-core/icons/tag_green.png +0 -0
  200. data/public/images/adva-core/icons/tick.png +0 -0
  201. data/public/images/adva-core/icons/zoom.png +0 -0
  202. data/public/images/adva-core/indicator.gif +0 -0
  203. data/public/images/adva-core/lines.png +0 -0
  204. data/public/images/adva-core/preview.png +0 -0
  205. data/public/images/adva-core/theme_selected.png +0 -0
  206. data/public/javascripts/adva-core/admin.js +0 -22
  207. data/public/javascripts/adva-core/jquery/jquery-1.4.2.min.js +0 -154
  208. data/public/javascripts/adva-core/jquery/jquery.table_tree.js +0 -296
  209. data/public/javascripts/adva-core/jquery/jquery.tablednd_0_5.js +0 -386
  210. data/public/javascripts/adva-core/rails.js +0 -127
  211. data/public/javascripts/backup/admin/jquery.admin.js +0 -77
  212. data/public/javascripts/backup/admin/jquery.article.js +0 -22
  213. data/public/javascripts/backup/admin/jquery.cached_pages.js +0 -14
  214. data/public/javascripts/backup/admin/jquery.table_tree.backup.js +0 -279
  215. data/public/javascripts/backup/admin/jquery.table_tree.js +0 -10
  216. data/public/javascripts/backup/application.js +0 -38
  217. data/public/javascripts/backup/application.prototype.js +0 -135
  218. data/public/javascripts/backup/builder.js +0 -136
  219. data/public/javascripts/backup/controls.js +0 -965
  220. data/public/javascripts/backup/cookie.js +0 -49
  221. data/public/javascripts/backup/dragdrop.js +0 -975
  222. data/public/javascripts/backup/effects.js +0 -1130
  223. data/public/javascripts/backup/flash.js +0 -49
  224. data/public/javascripts/backup/jquery.dates.js +0 -49
  225. data/public/javascripts/backup/jquery.flash.js +0 -40
  226. data/public/javascripts/backup/jquery.roles.js +0 -23
  227. data/public/javascripts/backup/jquery/jquery-lowpro.js +0 -224
  228. data/public/javascripts/backup/jquery/jquery-ui.js +0 -273
  229. data/public/javascripts/backup/jquery/jquery.js +0 -19
  230. data/public/javascripts/backup/jquery/jquery.qtip.min.js +0 -15
  231. data/public/javascripts/backup/json.js +0 -139
  232. data/public/javascripts/backup/lowpro.js +0 -320
  233. data/public/javascripts/backup/parseuri.js +0 -39
  234. data/public/javascripts/backup/prototype.js +0 -4320
  235. data/public/javascripts/backup/roles.js +0 -16
  236. data/public/javascripts/backup/scriptaculous.js +0 -60
  237. data/public/javascripts/backup/slider.js +0 -275
  238. data/public/javascripts/backup/sound.js +0 -55
  239. data/public/javascripts/backup/unittest.js +0 -568
  240. data/public/stylesheets/adva-core/admin/forms.css +0 -172
  241. data/public/stylesheets/adva-core/admin/layout.css +0 -38
  242. data/public/stylesheets/adva-core/admin/lists.css +0 -54
  243. data/public/stylesheets/adva-core/admin/navigation.css +0 -234
  244. data/public/stylesheets/adva-core/admin/sidebar.css +0 -87
  245. data/public/stylesheets/adva-core/admin/styles.css +0 -136
  246. data/public/stylesheets/adva-core/common/forms.css +0 -174
  247. data/public/stylesheets/adva-core/common/layout.css +0 -93
  248. data/public/stylesheets/adva-core/common/reset.css +0 -42
  249. data/public/stylesheets/adva-core/common/styles.css +0 -41
  250. data/public/stylesheets/adva-core/default/layout.css +0 -0
  251. data/public/stylesheets/adva-core/default/styles.css +0 -30
  252. data/public/stylesheets/adva-core/simple/layout.css +0 -11
  253. data/public/stylesheets/backup/alternate/common.css +0 -76
  254. data/public/stylesheets/backup/alternate/forms.css +0 -121
  255. data/public/stylesheets/backup/alternate/header.css +0 -125
  256. data/public/stylesheets/backup/alternate/layout.css +0 -103
  257. data/public/stylesheets/backup/alternate/lists.css +0 -153
  258. data/public/stylesheets/backup/alternate/sidebar.css +0 -65
  259. data/public/stylesheets/backup/alternate/top.css +0 -123
  260. data/public/stylesheets/backup/content.css +0 -11
  261. data/public/stylesheets/backup/helptip.css +0 -35
  262. data/public/stylesheets/backup/jquery/alternate/jquery.tooltip.css +0 -13
  263. data/public/stylesheets/backup/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  264. data/public/stylesheets/backup/jquery/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  265. data/public/stylesheets/backup/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  266. data/public/stylesheets/backup/jquery/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  267. data/public/stylesheets/backup/jquery/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  268. data/public/stylesheets/backup/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  269. data/public/stylesheets/backup/jquery/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  270. data/public/stylesheets/backup/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  271. data/public/stylesheets/backup/jquery/images/ui-icons_222222_256x240.png +0 -0
  272. data/public/stylesheets/backup/jquery/images/ui-icons_2e83ff_256x240.png +0 -0
  273. data/public/stylesheets/backup/jquery/images/ui-icons_454545_256x240.png +0 -0
  274. data/public/stylesheets/backup/jquery/images/ui-icons_888888_256x240.png +0 -0
  275. data/public/stylesheets/backup/jquery/images/ui-icons_cd0a0a_256x240.png +0 -0
  276. data/public/stylesheets/backup/jquery/jquery-ui.css +0 -406
  277. data/public/stylesheets/backup/jquery/jquery.tooltip.css +0 -10
  278. data/public/stylesheets/backup/layout.css +0 -22
  279. data/public/stylesheets/backup/lists.css +0 -17
  280. data/public/stylesheets/backup/menu.css +0 -129
  281. data/public/stylesheets/backup/projection.css +0 -118
  282. data/public/stylesheets/backup/screen/top.css +0 -8
  283. data/public/stylesheets/backup/themes.css +0 -49
  284. data/public/stylesheets/backup/users.css +0 -40
@@ -1,49 +0,0 @@
1
- var Flash = {
2
- transferFromCookies: function() {
3
- var data = JSON.parse(unescape(Cookie.get("flash")).gsub(/\+/, ' '));
4
- if(!data) data = {};
5
- Flash.data = data;
6
- Cookie.erase("flash");
7
- },
8
- // When given an flash message, wrap it in a list and show it on the screen.
9
- // This message will auto-hide after a specified amount of milliseconds
10
- show: function(flashType, message) {
11
- // new Effect.ScrollTo('flash_' + flashType);
12
- $('flash_' + flashType).innerHTML = '';
13
- if(message.toString().match(/<li/)) message = "<ul>" + message + '</ul>'
14
- $('flash_' + flashType).innerHTML = message;
15
-
16
- if(Flash.applyEffects) {
17
- new Effect.Appear('flash_' + flashType, {duration: 0});
18
- setTimeout(Flash['fade' + flashType[0].toUpperCase() + flashType.slice(1, flashType.length)].bind(this), 5000)
19
- } else {
20
- var flash = $('flash_' + flashType)
21
- flash.show();
22
- Event.observe(flash, 'click', function() { new Effect.Fade(this, { duration: 0.5 }); });
23
- }
24
- },
25
- errors: function(message) {
26
- this.show('error', message);
27
- },
28
- notice: function(message) {
29
- this.show('notice', message);
30
- },
31
- // Responsible for fading notices level messages in the dom
32
- fadeNotice: function() {
33
- new Effect.Fade('flash_notice', {duration: 1});
34
- // new Effect.BlindUp('flash_notice', {duration: 1});
35
- },
36
- // Responsible for fading error messages in the DOM
37
- fadeError: function() {
38
- new Effect.Fade('flash_error', {duration: 1});
39
- }
40
- }
41
- Flash.data = {};
42
- Flash.applyEffects = false;
43
-
44
- Event.onReady(function() {
45
- Flash.transferFromCookies();
46
- ['notice', 'error'].each(function(type) {
47
- if(Flash.data[type]) Flash.show(type, Flash.data[type].toString().gsub(/\+/, ' '));
48
- })
49
- });
@@ -1,49 +0,0 @@
1
- /* Date functions */
2
- Date.UTCNow = function() {
3
- d = new Date();
4
- utc = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()));
5
- // we need to correct the timezone offset because JS sucks really bad with timezones ...
6
- return new Date(utc.getTime() + utc.getTimezoneOffset()*60000);
7
- }
8
-
9
- // parse an ISO8601 UTC date string (YYYY-mm-ddZHH:MM:SSZ)
10
- Date.parseISO8601 = function(iso8601_date) {
11
- return new Date(Date.parse(iso8601_date.replace(/-/g, '/').replace('T', ' ').substr(0, 19))); // always has exactly 19 chars
12
- }
13
-
14
- distanceOfTimeInWords = function(seconds) {
15
- d = seconds/60; // in minutes
16
-
17
- if (d < 1) return 'less than a minute';
18
-
19
- d = Math.ceil(d); // if it's more than a minute, ceil it
20
- if (d < 50) return (d + ' minute' + (d == 1 ? '' : 's'));
21
- if (d < 90) return 'about one hour';
22
- if (d < 1080) return (Math.round(d/60) + ' hours');
23
- if (d < 1440) return 'one day';
24
- if (d < 2880) return 'about one day';
25
- else return (Math.round(d/1440) + ' days');
26
- }
27
-
28
- timeAgoInWords = function(iso8601_date) {
29
- utc_date = Date.parseISO8601(iso8601_date);
30
- utc_now = Date.UTCNow();
31
- d = (utc_now.getTime() - utc_date.getTime())/1000; // in seconds
32
- if (d > 0) {
33
- return distanceOfTimeInWords(d) + ' ago';
34
- } else {
35
- return 'in '+ distanceOfTimeInWords(-d);
36
- }
37
- }
38
-
39
- createAndFormatDateSpan = function(abbr) {
40
- // create a new span element and set its title to the abbr's innerHTML and its value to the timeAgoInWords string
41
- abbr.html('<span title="' + abbr.html() + '">' + timeAgoInWords(abbr.attr('title')) + '</span>'); // only used for past dates right now so we can safely use time_ago_in_words here
42
- }
43
-
44
- $(document).ready(function() {
45
- // parse all microformatted dates and re-format them as time distance
46
- $('abbr.datetime').each(function() {
47
- createAndFormatDateSpan($(this));
48
- });
49
- });
@@ -1,40 +0,0 @@
1
- var Flash = {
2
- transferFromCookies: function() {
3
- var data = JSON.parse(unescape(Cookie.get('flash')).replace(/\+/g, ' '));
4
- if(!data) data = {};
5
- Flash.data = data;
6
- Cookie.erase('flash');
7
- },
8
- show: function(type, message) {
9
- if(!Flash.data || Flash.data == {}) Flash.transferFromCookies();
10
-
11
- var flash = $('#flash_' + type);
12
- // if no message is given, look it up in the hash
13
- if(!message) var message = Flash.data[type];
14
-
15
- if(!message) return;
16
-
17
- if(message.toString().match(/<li/)) message = "<ul>" + message + '</ul>'
18
- flash.html(message);
19
-
20
- flash.show();
21
- },
22
-
23
- showAll: function() {
24
- $.each(['notice', 'error'], function() {
25
- Flash.show(this.toString());
26
- })
27
- },
28
-
29
- error: function(message) {
30
- this.show('error', message);
31
- },
32
-
33
- notice: function(message) {
34
- this.show('notice', message);
35
- }
36
- }
37
-
38
- $(document).ready(function() {
39
- Flash.showAll();
40
- });
@@ -1,23 +0,0 @@
1
- authorize_elements = function(roles) {
2
- if($.inArray('superuser', roles) > -1) {
3
- var elements = $('.visible_for');
4
- } else {
5
- var elements = [];
6
- $.each(roles, function() {
7
- $.each($('.' + this.toString()), function() {
8
- elements.push(this);
9
- });
10
- });
11
- }
12
-
13
- $.each(elements, function() {
14
- element = $(this);
15
- if(element) {
16
- element.removeClass('visible_for');
17
- }
18
- })
19
- }
20
-
21
- $(document).ready(function() {
22
- authorize_elements(['anonymous']);
23
- });
@@ -1,224 +0,0 @@
1
- // http://github.com/danwrong/low-pro-for-jquery/
2
-
3
- (function($) {
4
-
5
- var addMethods = function(source) {
6
- var ancestor = this.superclass && this.superclass.prototype;
7
- var properties = $.keys(source);
8
-
9
- if (!$.keys({ toString: true }).length) properties.push("toString", "valueOf");
10
-
11
- for (var i = 0, length = properties.length; i < length; i++) {
12
- var property = properties[i], value = source[property];
13
- if (ancestor && $.isFunction(value) && $.argumentNames(value)[0] == "$super") {
14
-
15
- var method = value, value = $.extend($.wrap((function(m) {
16
- return function() { return ancestor[m].apply(this, arguments) };
17
- })(property), method), {
18
- valueOf: function() { return method },
19
- toString: function() { return method.toString() }
20
- });
21
- }
22
- this.prototype[property] = value;
23
- }
24
-
25
- return this;
26
- }
27
-
28
- $.extend({
29
- keys: function(obj) {
30
- var keys = [];
31
- for (var key in obj) keys.push(key);
32
- return keys;
33
- },
34
-
35
- argumentNames: function(func) {
36
- var names = func.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(/, ?/);
37
- return names.length == 1 && !names[0] ? [] : names;
38
- },
39
-
40
- bind: function(func, scope) {
41
- return function() {
42
- return func.apply(scope, $.makeArray(arguments));
43
- }
44
- },
45
-
46
- wrap: function(func, wrapper) {
47
- var __method = func;
48
- return function() {
49
- return wrapper.apply(this, [$.bind(__method, this)].concat($.makeArray(arguments)));
50
- }
51
- },
52
-
53
- klass: function() {
54
- var parent = null, properties = $.makeArray(arguments);
55
- if ($.isFunction(properties[0])) parent = properties.shift();
56
-
57
- var klass = function() {
58
- this.initialize.apply(this, arguments);
59
- };
60
-
61
- klass.superclass = parent;
62
- klass.subclasses = [];
63
- klass.addMethods = addMethods;
64
-
65
- if (parent) {
66
- var subclass = function() { };
67
- subclass.prototype = parent.prototype;
68
- klass.prototype = new subclass;
69
- parent.subclasses.push(klass);
70
- }
71
-
72
- for (var i = 0; i < properties.length; i++)
73
- klass.addMethods(properties[i]);
74
-
75
- if (!klass.prototype.initialize)
76
- klass.prototype.initialize = function() {};
77
-
78
- klass.prototype.constructor = klass;
79
-
80
- return klass;
81
- },
82
- delegate: function(rules) {
83
- return function(e) {
84
- var target = $(e.target), parent = null;
85
- for (var selector in rules) {
86
- if (target.is(selector) || ((parent = target.parents(selector)) && parent.length > 0)) {
87
- return rules[selector].apply(this, [parent || target].concat($.makeArray(arguments)));
88
- }
89
- parent = null;
90
- }
91
- }
92
- }
93
- });
94
-
95
- var bindEvents = function(instance) {
96
- for (var member in instance) {
97
- if (member.match(/^on(.+)/) && typeof instance[member] == 'function') {
98
- instance.element.bind(RegExp.$1, $.bind(instance[member], instance));
99
- }
100
- }
101
- }
102
-
103
- var behaviorWrapper = function(behavior) {
104
- return $.klass(behavior, {
105
- initialize: function($super, element, args) {
106
- this.element = $(element);
107
- if ($super) $super.apply(this, args);
108
- }
109
- });
110
- }
111
-
112
- var attachBehavior = function(el, behavior, args) {
113
- var wrapper = behaviorWrapper(behavior);
114
- instance = new wrapper(el, args);
115
-
116
- bindEvents(instance);
117
-
118
- if (!behavior.instances) behavior.instances = [];
119
-
120
- behavior.instances.push(instance);
121
-
122
- return instance;
123
- };
124
-
125
-
126
- $.fn.extend({
127
- attach: function() {
128
- var args = $.makeArray(arguments), behavior = args.shift();
129
-
130
- if ($.livequery && this.selector) {
131
- return this.livequery(function() {
132
- attachBehavior(this, behavior, args);
133
- });
134
- } else {
135
- return this.each(function() {
136
- attachBehavior(this, behavior, args);
137
- });
138
- }
139
- },
140
- attachAndReturn: function() {
141
- var args = $.makeArray(arguments), behavior = args.shift();
142
-
143
- return $.map(this, function(el) {
144
- return attachBehavior(el, behavior, args);
145
- });
146
- },
147
- delegate: function(type, rules) {
148
- return this.bind(type, $.delegate(rules));
149
- },
150
- attached: function(behavior) {
151
- var instances = [];
152
-
153
- if (!behavior.instances) return instances;
154
-
155
- this.each(function(i, element) {
156
- $.each(behavior.instances, function(i, instance) {
157
- if (instance.element.get(0) == element) instances.push(instance);
158
- });
159
- });
160
-
161
- return instances;
162
- },
163
- firstAttached: function(behavior) {
164
- return this.attached(behavior)[0];
165
- }
166
- });
167
-
168
- Remote = $.klass({
169
- initialize: function(options) {
170
- if (this.element.attr('nodeName') == 'FORM') this.element.attach(Remote.Form, options);
171
- else this.element.attach(Remote.Link, options);
172
- }
173
- });
174
-
175
- Remote.Base = $.klass({
176
- initialize : function(options) {
177
- this.options = $.extend({
178
-
179
- }, options || {});
180
- },
181
- _makeRequest : function(options) {
182
- $.ajax(options);
183
- return false;
184
- }
185
- });
186
-
187
- Remote.Link = $.klass(Remote.Base, {
188
- onclick: function() {
189
- var options = $.extend({ url: this.element.attr('href'), type: 'GET' }, this.options);
190
- return this._makeRequest(options);
191
- }
192
- });
193
-
194
- Remote.Form = $.klass(Remote.Base, {
195
- onclick: function(e) {
196
- var target = e.target;
197
-
198
- if ($.inArray(target.nodeName.toLowerCase(), ['input', 'button']) >= 0 && target.type.match(/submit|image/))
199
- this._submitButton = target;
200
- },
201
- onsubmit: function() {
202
- var data = this.element.serializeArray();
203
-
204
- if (this._submitButton) data.push({ name: this._submitButton.name, value: this._submitButton.value });
205
-
206
- var options = $.extend({
207
- url : this.element.attr('action'),
208
- type : this.element.attr('method') || 'GET',
209
- data : data
210
- }, this.options);
211
-
212
- this._makeRequest(options);
213
-
214
- return false;
215
- }
216
- });
217
-
218
- $.ajaxSetup({
219
- beforeSend: function(xhr) {
220
- xhr.setRequestHeader("Accept", "text/javascript, text/html, application/xml, text/xml, */*");
221
- }
222
- });
223
-
224
- })(jQuery);
@@ -1,273 +0,0 @@
1
- /*
2
- * jQuery UI 1.7.1
3
- *
4
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT (MIT-LICENSE.txt)
6
- * and GPL (GPL-LICENSE.txt) licenses.
7
- *
8
- * http://docs.jquery.com/UI
9
- */
10
- * jQuery UI Draggable 1.7.1
11
- *
12
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
13
- * Dual licensed under the MIT (MIT-LICENSE.txt)
14
- * and GPL (GPL-LICENSE.txt) licenses.
15
- *
16
- * http://docs.jquery.com/UI/Draggables
17
- *
18
- * Depends:
19
- * ui.core.js
20
- */
21
- * jQuery UI Droppable 1.7.1
22
- *
23
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
24
- * Dual licensed under the MIT (MIT-LICENSE.txt)
25
- * and GPL (GPL-LICENSE.txt) licenses.
26
- *
27
- * http://docs.jquery.com/UI/Droppables
28
- *
29
- * Depends:
30
- * ui.core.js
31
- * ui.draggable.js
32
- */
33
- * jQuery UI Resizable 1.7.1
34
- *
35
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
36
- * Dual licensed under the MIT (MIT-LICENSE.txt)
37
- * and GPL (GPL-LICENSE.txt) licenses.
38
- *
39
- * http://docs.jquery.com/UI/Resizables
40
- *
41
- * Depends:
42
- * ui.core.js
43
- */
44
- * jQuery UI Selectable 1.7.1
45
- *
46
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
47
- * Dual licensed under the MIT (MIT-LICENSE.txt)
48
- * and GPL (GPL-LICENSE.txt) licenses.
49
- *
50
- * http://docs.jquery.com/UI/Selectables
51
- *
52
- * Depends:
53
- * ui.core.js
54
- */
55
- * jQuery UI Sortable 1.7.1
56
- *
57
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
58
- * Dual licensed under the MIT (MIT-LICENSE.txt)
59
- * and GPL (GPL-LICENSE.txt) licenses.
60
- *
61
- * http://docs.jquery.com/UI/Sortables
62
- *
63
- * Depends:
64
- * ui.core.js
65
- */
66
- * jQuery UI Accordion 1.7.1
67
- *
68
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
69
- * Dual licensed under the MIT (MIT-LICENSE.txt)
70
- * and GPL (GPL-LICENSE.txt) licenses.
71
- *
72
- * http://docs.jquery.com/UI/Accordion
73
- *
74
- * Depends:
75
- * ui.core.js
76
- */
77
- * jQuery UI Dialog 1.7.1
78
- *
79
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
80
- * Dual licensed under the MIT (MIT-LICENSE.txt)
81
- * and GPL (GPL-LICENSE.txt) licenses.
82
- *
83
- * http://docs.jquery.com/UI/Dialog
84
- *
85
- * Depends:
86
- * ui.core.js
87
- * ui.draggable.js
88
- * ui.resizable.js
89
- */
90
- * jQuery UI Slider 1.7.1
91
- *
92
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
93
- * Dual licensed under the MIT (MIT-LICENSE.txt)
94
- * and GPL (GPL-LICENSE.txt) licenses.
95
- *
96
- * http://docs.jquery.com/UI/Slider
97
- *
98
- * Depends:
99
- * ui.core.js
100
- */
101
- * jQuery UI Tabs 1.7.1
102
- *
103
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
104
- * Dual licensed under the MIT (MIT-LICENSE.txt)
105
- * and GPL (GPL-LICENSE.txt) licenses.
106
- *
107
- * http://docs.jquery.com/UI/Tabs
108
- *
109
- * Depends:
110
- * ui.core.js
111
- */
112
- * jQuery UI Datepicker 1.7.1
113
- *
114
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
115
- * Dual licensed under the MIT (MIT-LICENSE.txt)
116
- * and GPL (GPL-LICENSE.txt) licenses.
117
- *
118
- * http://docs.jquery.com/UI/Datepicker
119
- *
120
- * Depends:
121
- * ui.core.js
122
- */
123
- * jQuery UI Progressbar 1.7.1
124
- *
125
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
126
- * Dual licensed under the MIT (MIT-LICENSE.txt)
127
- * and GPL (GPL-LICENSE.txt) licenses.
128
- *
129
- * http://docs.jquery.com/UI/Progressbar
130
- *
131
- * Depends:
132
- * ui.core.js
133
- */
134
- * jQuery UI Effects 1.7.1
135
- *
136
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
137
- * Dual licensed under the MIT (MIT-LICENSE.txt)
138
- * and GPL (GPL-LICENSE.txt) licenses.
139
- *
140
- * http://docs.jquery.com/UI/Effects/
141
- */
142
- * jQuery UI Effects Blind 1.7.1
143
- *
144
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
145
- * Dual licensed under the MIT (MIT-LICENSE.txt)
146
- * and GPL (GPL-LICENSE.txt) licenses.
147
- *
148
- * http://docs.jquery.com/UI/Effects/Blind
149
- *
150
- * Depends:
151
- * effects.core.js
152
- */
153
- * jQuery UI Effects Bounce 1.7.1
154
- *
155
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
156
- * Dual licensed under the MIT (MIT-LICENSE.txt)
157
- * and GPL (GPL-LICENSE.txt) licenses.
158
- *
159
- * http://docs.jquery.com/UI/Effects/Bounce
160
- *
161
- * Depends:
162
- * effects.core.js
163
- */
164
- * jQuery UI Effects Clip 1.7.1
165
- *
166
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
167
- * Dual licensed under the MIT (MIT-LICENSE.txt)
168
- * and GPL (GPL-LICENSE.txt) licenses.
169
- *
170
- * http://docs.jquery.com/UI/Effects/Clip
171
- *
172
- * Depends:
173
- * effects.core.js
174
- */
175
- * jQuery UI Effects Drop 1.7.1
176
- *
177
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
178
- * Dual licensed under the MIT (MIT-LICENSE.txt)
179
- * and GPL (GPL-LICENSE.txt) licenses.
180
- *
181
- * http://docs.jquery.com/UI/Effects/Drop
182
- *
183
- * Depends:
184
- * effects.core.js
185
- */
186
- * jQuery UI Effects Explode 1.7.1
187
- *
188
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
189
- * Dual licensed under the MIT (MIT-LICENSE.txt)
190
- * and GPL (GPL-LICENSE.txt) licenses.
191
- *
192
- * http://docs.jquery.com/UI/Effects/Explode
193
- *
194
- * Depends:
195
- * effects.core.js
196
- */
197
- * jQuery UI Effects Fold 1.7.1
198
- *
199
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
200
- * Dual licensed under the MIT (MIT-LICENSE.txt)
201
- * and GPL (GPL-LICENSE.txt) licenses.
202
- *
203
- * http://docs.jquery.com/UI/Effects/Fold
204
- *
205
- * Depends:
206
- * effects.core.js
207
- */
208
- * jQuery UI Effects Highlight 1.7.1
209
- *
210
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
211
- * Dual licensed under the MIT (MIT-LICENSE.txt)
212
- * and GPL (GPL-LICENSE.txt) licenses.
213
- *
214
- * http://docs.jquery.com/UI/Effects/Highlight
215
- *
216
- * Depends:
217
- * effects.core.js
218
- */
219
- * jQuery UI Effects Pulsate 1.7.1
220
- *
221
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
222
- * Dual licensed under the MIT (MIT-LICENSE.txt)
223
- * and GPL (GPL-LICENSE.txt) licenses.
224
- *
225
- * http://docs.jquery.com/UI/Effects/Pulsate
226
- *
227
- * Depends:
228
- * effects.core.js
229
- */
230
- * jQuery UI Effects Scale 1.7.1
231
- *
232
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
233
- * Dual licensed under the MIT (MIT-LICENSE.txt)
234
- * and GPL (GPL-LICENSE.txt) licenses.
235
- *
236
- * http://docs.jquery.com/UI/Effects/Scale
237
- *
238
- * Depends:
239
- * effects.core.js
240
- */
241
- * jQuery UI Effects Shake 1.7.1
242
- *
243
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
244
- * Dual licensed under the MIT (MIT-LICENSE.txt)
245
- * and GPL (GPL-LICENSE.txt) licenses.
246
- *
247
- * http://docs.jquery.com/UI/Effects/Shake
248
- *
249
- * Depends:
250
- * effects.core.js
251
- */
252
- * jQuery UI Effects Slide 1.7.1
253
- *
254
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
255
- * Dual licensed under the MIT (MIT-LICENSE.txt)
256
- * and GPL (GPL-LICENSE.txt) licenses.
257
- *
258
- * http://docs.jquery.com/UI/Effects/Slide
259
- *
260
- * Depends:
261
- * effects.core.js
262
- */
263
- * jQuery UI Effects Transfer 1.7.1
264
- *
265
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
266
- * Dual licensed under the MIT (MIT-LICENSE.txt)
267
- * and GPL (GPL-LICENSE.txt) licenses.
268
- *
269
- * http://docs.jquery.com/UI/Effects/Transfer
270
- *
271
- * Depends:
272
- * effects.core.js
273
- */