spiderfw 0.6.27 → 0.6.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/CHANGELOG +4 -0
  2. data/VERSION +1 -1
  3. data/apps/core/admin/admin.rb +6 -2
  4. data/apps/core/admin/controllers/admin_controller.rb +10 -3
  5. data/apps/core/admin/controllers/app_admin_controller.rb +15 -0
  6. data/apps/core/admin/public/css/sass/admin.css +29 -33
  7. data/apps/core/admin/public/css/sass/grid.css +14 -0
  8. data/apps/core/admin/public/sass/admin.scss +3 -2
  9. data/apps/core/admin/views/admin.layout.shtml +1 -0
  10. data/apps/core/auth/controllers/mixins/auth_helper.rb +15 -5
  11. data/apps/core/components/assets.rb +60 -41
  12. data/apps/core/components/public/js/jquery/jquery-1.8.3.js +9472 -0
  13. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/jquery.ui.core.js +1 -1
  14. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/button_bg.png +0 -0
  15. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/datepicker.gif +0 -0
  16. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/icon_sprite.png +0 -0
  17. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/progress_bar.gif +0 -0
  18. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/slider_h_bg.gif +0 -0
  19. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/slider_handles.png +0 -0
  20. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/slider_v_bg.gif +0 -0
  21. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/tab_bg.gif +0 -0
  22. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/the_gradient.gif +0 -0
  23. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-anim_basic_16x16.gif +0 -0
  24. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  25. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  26. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_flat_10_000000_40x100.png +0 -0
  27. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  28. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  29. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  30. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  31. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  32. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  33. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_222222_256x240.png +0 -0
  34. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_228ef1_256x240.png +0 -0
  35. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_ef8c08_256x240.png +0 -0
  36. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_ffd27a_256x240.png +0 -0
  37. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_ffffff_256x240.png +0 -0
  38. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/jquery-ui.custom.css +528 -0
  39. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-af.js +23 -0
  40. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ar-DZ.js +23 -0
  41. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ar.js +23 -0
  42. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-az.js +23 -0
  43. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-be.js +23 -0
  44. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-bg.js +24 -0
  45. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-bs.js +23 -0
  46. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ca.js +23 -0
  47. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-cs.js +23 -0
  48. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-cy-GB.js +23 -0
  49. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-da.js +23 -0
  50. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-de.js +23 -0
  51. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-el.js +23 -0
  52. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-en-AU.js +23 -0
  53. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-en-GB.js +23 -0
  54. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-en-NZ.js +23 -0
  55. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-eo.js +23 -0
  56. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-es.js +23 -0
  57. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-et.js +23 -0
  58. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-eu.js +23 -0
  59. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fa.js +59 -0
  60. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fi.js +23 -0
  61. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fo.js +23 -0
  62. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fr-CA.js +23 -0
  63. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fr-CH.js +23 -0
  64. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fr.js +25 -0
  65. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-gl.js +23 -0
  66. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-he.js +23 -0
  67. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-hi.js +23 -0
  68. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-hr.js +23 -0
  69. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-hu.js +23 -0
  70. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-hy.js +23 -0
  71. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-id.js +23 -0
  72. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-is.js +23 -0
  73. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-it.js +23 -0
  74. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ja.js +23 -0
  75. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ka.js +21 -0
  76. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-kk.js +23 -0
  77. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-km.js +23 -0
  78. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ko.js +23 -0
  79. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ky.js +24 -0
  80. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-lb.js +23 -0
  81. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-lt.js +23 -0
  82. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-lv.js +23 -0
  83. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-mk.js +23 -0
  84. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ml.js +23 -0
  85. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ms.js +23 -0
  86. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-nb.js +22 -0
  87. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-nl-BE.js +23 -0
  88. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-nl.js +23 -0
  89. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-nn.js +22 -0
  90. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-no.js +23 -0
  91. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-pl.js +23 -0
  92. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-pt-BR.js +23 -0
  93. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-pt.js +22 -0
  94. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-rm.js +21 -0
  95. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ro.js +26 -0
  96. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ru.js +23 -0
  97. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sk.js +23 -0
  98. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sl.js +24 -0
  99. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sq.js +23 -0
  100. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sr-SR.js +23 -0
  101. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sr.js +23 -0
  102. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sv.js +23 -0
  103. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ta.js +23 -0
  104. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-th.js +23 -0
  105. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-tj.js +23 -0
  106. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-tr.js +23 -0
  107. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-uk.js +24 -0
  108. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-vi.js +23 -0
  109. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-zh-CN.js +23 -0
  110. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-zh-HK.js +23 -0
  111. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-zh-TW.js +23 -0
  112. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.accordion.js +571 -0
  113. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.autocomplete.js +614 -0
  114. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.button.js +419 -0
  115. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.core.js +324 -0
  116. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.datepicker.js +2044 -0
  117. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.dialog.js +767 -0
  118. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.draggable.js +941 -0
  119. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.droppable.js +364 -0
  120. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-blind.js +82 -0
  121. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-bounce.js +113 -0
  122. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js +67 -0
  123. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js +65 -0
  124. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-explode.js +97 -0
  125. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-fade.js +30 -0
  126. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-fold.js +76 -0
  127. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-highlight.js +50 -0
  128. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-pulsate.js +63 -0
  129. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-scale.js +318 -0
  130. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-shake.js +74 -0
  131. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-slide.js +64 -0
  132. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-transfer.js +47 -0
  133. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect.js +1259 -0
  134. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.menu.js +621 -0
  135. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.mouse.js +169 -0
  136. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.position.js +497 -0
  137. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.progressbar.js +145 -0
  138. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.resizable.js +963 -0
  139. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.selectable.js +269 -0
  140. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.slider.js +641 -0
  141. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.sortable.js +1236 -0
  142. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.spinner.js +492 -0
  143. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.tabs.js +846 -0
  144. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.tooltip.js +400 -0
  145. data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.widget.js +521 -0
  146. data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.js +3 -1
  147. data/apps/core/components/public/js/plugins/sortable.js +5 -5
  148. data/apps/core/components/widgets/month_calendar/month_calendar.shtml +1 -1
  149. data/apps/core/components/widgets/table/table.rb +18 -5
  150. data/apps/core/forms/public/date_time.js +3 -0
  151. data/apps/core/forms/widgets/form/form.rb +1 -1
  152. data/apps/core/forms/widgets/inputs/date_time/date_time.rb +5 -0
  153. data/apps/core/forms/widgets/inputs/file_input/file_input.rb +1 -1
  154. data/apps/core/forms/widgets/inputs/select/select.rb +11 -16
  155. data/apps/messenger/config/options.rb +5 -5
  156. data/apps/messenger/controllers/messenger_admin_controller.rb +1 -1
  157. data/apps/messenger/controllers/messenger_controller.rb +1 -1
  158. data/apps/messenger/lib/backends/mobyt.rb +1 -1
  159. data/apps/messenger/messenger.rb +4 -2
  160. data/apps/messenger/views/admin/index.shtml +1 -1
  161. data/lib/spiderfw/controller/dispatcher.rb +5 -5
  162. data/lib/spiderfw/controller/mixins/visual.rb +10 -8
  163. data/lib/spiderfw/http/http.rb +1 -1
  164. data/lib/spiderfw/model/base_model.rb +2 -2
  165. data/lib/spiderfw/model/mappers/db_mapper.rb +4 -2
  166. data/lib/spiderfw/model/mixins/tree.rb +4 -5
  167. data/lib/spiderfw/model/model.rb +2 -1
  168. data/lib/spiderfw/model/storage/db/adapters/mysql.rb +18 -20
  169. data/lib/spiderfw/model/storage/db/adapters/oracle.rb +1 -1
  170. data/lib/spiderfw/spider.rb +5 -1
  171. data/lib/spiderfw/templates/blocks/layout_assets.rb +5 -2
  172. data/lib/spiderfw/templates/layout.rb +7 -3
  173. data/lib/spiderfw/templates/template.rb +8 -1
  174. data/lib/spiderfw/utils/monkey/date_time.rb +7 -5
  175. data/lib/spiderfw/utils/monkey/module.rb +12 -0
  176. metadata +373 -157
  177. data/lib/spiderfw/model/storage/db/connectors/mysql.rb +0 -16
  178. data/lib/spiderfw/model/storage/db/connectors/mysql2.rb +0 -9
  179. /data/apps/core/admin/public/img/{icons-s845a69dd9f.png → icons-s8b18557db6.png} +0 -0
@@ -0,0 +1,1259 @@
1
+ /*!
2
+ * jQuery UI Effects @VERSION
3
+ * http://jqueryui.com
4
+ *
5
+ * Copyright 2012 jQuery Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * http://jquery.org/license
8
+ *
9
+ * http://api.jqueryui.com/category/effects-core/
10
+ */
11
+ ;(jQuery.effects || (function($, undefined) {
12
+
13
+ var dataSpace = "ui-effects-";
14
+
15
+ $.effects = {
16
+ effect: {}
17
+ };
18
+
19
+ /*!
20
+ * jQuery Color Animations v2.1.1
21
+ * https://github.com/jquery/jquery-color
22
+ *
23
+ * Copyright 2012 jQuery Foundation and other contributors
24
+ * Released under the MIT license.
25
+ * http://jquery.org/license
26
+ *
27
+ * Date: Sun Oct 28 15:08:06 2012 -0400
28
+ */
29
+ (function( jQuery, undefined ) {
30
+
31
+ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
32
+
33
+ // plusequals test for += 100 -= 100
34
+ rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
35
+ // a set of RE's that can match strings and generate color tuples.
36
+ stringParsers = [{
37
+ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
38
+ parse: function( execResult ) {
39
+ return [
40
+ execResult[ 1 ],
41
+ execResult[ 2 ],
42
+ execResult[ 3 ],
43
+ execResult[ 4 ]
44
+ ];
45
+ }
46
+ }, {
47
+ re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
48
+ parse: function( execResult ) {
49
+ return [
50
+ execResult[ 1 ] * 2.55,
51
+ execResult[ 2 ] * 2.55,
52
+ execResult[ 3 ] * 2.55,
53
+ execResult[ 4 ]
54
+ ];
55
+ }
56
+ }, {
57
+ // this regex ignores A-F because it's compared against an already lowercased string
58
+ re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
59
+ parse: function( execResult ) {
60
+ return [
61
+ parseInt( execResult[ 1 ], 16 ),
62
+ parseInt( execResult[ 2 ], 16 ),
63
+ parseInt( execResult[ 3 ], 16 )
64
+ ];
65
+ }
66
+ }, {
67
+ // this regex ignores A-F because it's compared against an already lowercased string
68
+ re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
69
+ parse: function( execResult ) {
70
+ return [
71
+ parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
72
+ parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
73
+ parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
74
+ ];
75
+ }
76
+ }, {
77
+ re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
78
+ space: "hsla",
79
+ parse: function( execResult ) {
80
+ return [
81
+ execResult[ 1 ],
82
+ execResult[ 2 ] / 100,
83
+ execResult[ 3 ] / 100,
84
+ execResult[ 4 ]
85
+ ];
86
+ }
87
+ }],
88
+
89
+ // jQuery.Color( )
90
+ color = jQuery.Color = function( color, green, blue, alpha ) {
91
+ return new jQuery.Color.fn.parse( color, green, blue, alpha );
92
+ },
93
+ spaces = {
94
+ rgba: {
95
+ props: {
96
+ red: {
97
+ idx: 0,
98
+ type: "byte"
99
+ },
100
+ green: {
101
+ idx: 1,
102
+ type: "byte"
103
+ },
104
+ blue: {
105
+ idx: 2,
106
+ type: "byte"
107
+ }
108
+ }
109
+ },
110
+
111
+ hsla: {
112
+ props: {
113
+ hue: {
114
+ idx: 0,
115
+ type: "degrees"
116
+ },
117
+ saturation: {
118
+ idx: 1,
119
+ type: "percent"
120
+ },
121
+ lightness: {
122
+ idx: 2,
123
+ type: "percent"
124
+ }
125
+ }
126
+ }
127
+ },
128
+ propTypes = {
129
+ "byte": {
130
+ floor: true,
131
+ max: 255
132
+ },
133
+ "percent": {
134
+ max: 1
135
+ },
136
+ "degrees": {
137
+ mod: 360,
138
+ floor: true
139
+ }
140
+ },
141
+ support = color.support = {},
142
+
143
+ // element for support tests
144
+ supportElem = jQuery( "<p>" )[ 0 ],
145
+
146
+ // colors = jQuery.Color.names
147
+ colors,
148
+
149
+ // local aliases of functions called often
150
+ each = jQuery.each;
151
+
152
+ // determine rgba support immediately
153
+ supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
154
+ support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
155
+
156
+ // define cache name and alpha properties
157
+ // for rgba and hsla spaces
158
+ each( spaces, function( spaceName, space ) {
159
+ space.cache = "_" + spaceName;
160
+ space.props.alpha = {
161
+ idx: 3,
162
+ type: "percent",
163
+ def: 1
164
+ };
165
+ });
166
+
167
+ function clamp( value, prop, allowEmpty ) {
168
+ var type = propTypes[ prop.type ] || {};
169
+
170
+ if ( value == null ) {
171
+ return (allowEmpty || !prop.def) ? null : prop.def;
172
+ }
173
+
174
+ // ~~ is an short way of doing floor for positive numbers
175
+ value = type.floor ? ~~value : parseFloat( value );
176
+
177
+ // IE will pass in empty strings as value for alpha,
178
+ // which will hit this case
179
+ if ( isNaN( value ) ) {
180
+ return prop.def;
181
+ }
182
+
183
+ if ( type.mod ) {
184
+ // we add mod before modding to make sure that negatives values
185
+ // get converted properly: -10 -> 350
186
+ return (value + type.mod) % type.mod;
187
+ }
188
+
189
+ // for now all property types without mod have min and max
190
+ return 0 > value ? 0 : type.max < value ? type.max : value;
191
+ }
192
+
193
+ function stringParse( string ) {
194
+ var inst = color(),
195
+ rgba = inst._rgba = [];
196
+
197
+ string = string.toLowerCase();
198
+
199
+ each( stringParsers, function( i, parser ) {
200
+ var parsed,
201
+ match = parser.re.exec( string ),
202
+ values = match && parser.parse( match ),
203
+ spaceName = parser.space || "rgba";
204
+
205
+ if ( values ) {
206
+ parsed = inst[ spaceName ]( values );
207
+
208
+ // if this was an rgba parse the assignment might happen twice
209
+ // oh well....
210
+ inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
211
+ rgba = inst._rgba = parsed._rgba;
212
+
213
+ // exit each( stringParsers ) here because we matched
214
+ return false;
215
+ }
216
+ });
217
+
218
+ // Found a stringParser that handled it
219
+ if ( rgba.length ) {
220
+
221
+ // if this came from a parsed string, force "transparent" when alpha is 0
222
+ // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
223
+ if ( rgba.join() === "0,0,0,0" ) {
224
+ jQuery.extend( rgba, colors.transparent );
225
+ }
226
+ return inst;
227
+ }
228
+
229
+ // named colors
230
+ return colors[ string ];
231
+ }
232
+
233
+ color.fn = jQuery.extend( color.prototype, {
234
+ parse: function( red, green, blue, alpha ) {
235
+ if ( red === undefined ) {
236
+ this._rgba = [ null, null, null, null ];
237
+ return this;
238
+ }
239
+ if ( red.jquery || red.nodeType ) {
240
+ red = jQuery( red ).css( green );
241
+ green = undefined;
242
+ }
243
+
244
+ var inst = this,
245
+ type = jQuery.type( red ),
246
+ rgba = this._rgba = [];
247
+
248
+ // more than 1 argument specified - assume ( red, green, blue, alpha )
249
+ if ( green !== undefined ) {
250
+ red = [ red, green, blue, alpha ];
251
+ type = "array";
252
+ }
253
+
254
+ if ( type === "string" ) {
255
+ return this.parse( stringParse( red ) || colors._default );
256
+ }
257
+
258
+ if ( type === "array" ) {
259
+ each( spaces.rgba.props, function( key, prop ) {
260
+ rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
261
+ });
262
+ return this;
263
+ }
264
+
265
+ if ( type === "object" ) {
266
+ if ( red instanceof color ) {
267
+ each( spaces, function( spaceName, space ) {
268
+ if ( red[ space.cache ] ) {
269
+ inst[ space.cache ] = red[ space.cache ].slice();
270
+ }
271
+ });
272
+ } else {
273
+ each( spaces, function( spaceName, space ) {
274
+ var cache = space.cache;
275
+ each( space.props, function( key, prop ) {
276
+
277
+ // if the cache doesn't exist, and we know how to convert
278
+ if ( !inst[ cache ] && space.to ) {
279
+
280
+ // if the value was null, we don't need to copy it
281
+ // if the key was alpha, we don't need to copy it either
282
+ if ( key === "alpha" || red[ key ] == null ) {
283
+ return;
284
+ }
285
+ inst[ cache ] = space.to( inst._rgba );
286
+ }
287
+
288
+ // this is the only case where we allow nulls for ALL properties.
289
+ // call clamp with alwaysAllowEmpty
290
+ inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
291
+ });
292
+
293
+ // everything defined but alpha?
294
+ if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
295
+ // use the default of 1
296
+ inst[ cache ][ 3 ] = 1;
297
+ if ( space.from ) {
298
+ inst._rgba = space.from( inst[ cache ] );
299
+ }
300
+ }
301
+ });
302
+ }
303
+ return this;
304
+ }
305
+ },
306
+ is: function( compare ) {
307
+ var is = color( compare ),
308
+ same = true,
309
+ inst = this;
310
+
311
+ each( spaces, function( _, space ) {
312
+ var localCache,
313
+ isCache = is[ space.cache ];
314
+ if (isCache) {
315
+ localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
316
+ each( space.props, function( _, prop ) {
317
+ if ( isCache[ prop.idx ] != null ) {
318
+ same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
319
+ return same;
320
+ }
321
+ });
322
+ }
323
+ return same;
324
+ });
325
+ return same;
326
+ },
327
+ _space: function() {
328
+ var used = [],
329
+ inst = this;
330
+ each( spaces, function( spaceName, space ) {
331
+ if ( inst[ space.cache ] ) {
332
+ used.push( spaceName );
333
+ }
334
+ });
335
+ return used.pop();
336
+ },
337
+ transition: function( other, distance ) {
338
+ var end = color( other ),
339
+ spaceName = end._space(),
340
+ space = spaces[ spaceName ],
341
+ startColor = this.alpha() === 0 ? color( "transparent" ) : this,
342
+ start = startColor[ space.cache ] || space.to( startColor._rgba ),
343
+ result = start.slice();
344
+
345
+ end = end[ space.cache ];
346
+ each( space.props, function( key, prop ) {
347
+ var index = prop.idx,
348
+ startValue = start[ index ],
349
+ endValue = end[ index ],
350
+ type = propTypes[ prop.type ] || {};
351
+
352
+ // if null, don't override start value
353
+ if ( endValue === null ) {
354
+ return;
355
+ }
356
+ // if null - use end
357
+ if ( startValue === null ) {
358
+ result[ index ] = endValue;
359
+ } else {
360
+ if ( type.mod ) {
361
+ if ( endValue - startValue > type.mod / 2 ) {
362
+ startValue += type.mod;
363
+ } else if ( startValue - endValue > type.mod / 2 ) {
364
+ startValue -= type.mod;
365
+ }
366
+ }
367
+ result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
368
+ }
369
+ });
370
+ return this[ spaceName ]( result );
371
+ },
372
+ blend: function( opaque ) {
373
+ // if we are already opaque - return ourself
374
+ if ( this._rgba[ 3 ] === 1 ) {
375
+ return this;
376
+ }
377
+
378
+ var rgb = this._rgba.slice(),
379
+ a = rgb.pop(),
380
+ blend = color( opaque )._rgba;
381
+
382
+ return color( jQuery.map( rgb, function( v, i ) {
383
+ return ( 1 - a ) * blend[ i ] + a * v;
384
+ }));
385
+ },
386
+ toRgbaString: function() {
387
+ var prefix = "rgba(",
388
+ rgba = jQuery.map( this._rgba, function( v, i ) {
389
+ return v == null ? ( i > 2 ? 1 : 0 ) : v;
390
+ });
391
+
392
+ if ( rgba[ 3 ] === 1 ) {
393
+ rgba.pop();
394
+ prefix = "rgb(";
395
+ }
396
+
397
+ return prefix + rgba.join() + ")";
398
+ },
399
+ toHslaString: function() {
400
+ var prefix = "hsla(",
401
+ hsla = jQuery.map( this.hsla(), function( v, i ) {
402
+ if ( v == null ) {
403
+ v = i > 2 ? 1 : 0;
404
+ }
405
+
406
+ // catch 1 and 2
407
+ if ( i && i < 3 ) {
408
+ v = Math.round( v * 100 ) + "%";
409
+ }
410
+ return v;
411
+ });
412
+
413
+ if ( hsla[ 3 ] === 1 ) {
414
+ hsla.pop();
415
+ prefix = "hsl(";
416
+ }
417
+ return prefix + hsla.join() + ")";
418
+ },
419
+ toHexString: function( includeAlpha ) {
420
+ var rgba = this._rgba.slice(),
421
+ alpha = rgba.pop();
422
+
423
+ if ( includeAlpha ) {
424
+ rgba.push( ~~( alpha * 255 ) );
425
+ }
426
+
427
+ return "#" + jQuery.map( rgba, function( v ) {
428
+
429
+ // default to 0 when nulls exist
430
+ v = ( v || 0 ).toString( 16 );
431
+ return v.length === 1 ? "0" + v : v;
432
+ }).join("");
433
+ },
434
+ toString: function() {
435
+ return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
436
+ }
437
+ });
438
+ color.fn.parse.prototype = color.fn;
439
+
440
+ // hsla conversions adapted from:
441
+ // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
442
+
443
+ function hue2rgb( p, q, h ) {
444
+ h = ( h + 1 ) % 1;
445
+ if ( h * 6 < 1 ) {
446
+ return p + (q - p) * h * 6;
447
+ }
448
+ if ( h * 2 < 1) {
449
+ return q;
450
+ }
451
+ if ( h * 3 < 2 ) {
452
+ return p + (q - p) * ((2/3) - h) * 6;
453
+ }
454
+ return p;
455
+ }
456
+
457
+ spaces.hsla.to = function ( rgba ) {
458
+ if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
459
+ return [ null, null, null, rgba[ 3 ] ];
460
+ }
461
+ var r = rgba[ 0 ] / 255,
462
+ g = rgba[ 1 ] / 255,
463
+ b = rgba[ 2 ] / 255,
464
+ a = rgba[ 3 ],
465
+ max = Math.max( r, g, b ),
466
+ min = Math.min( r, g, b ),
467
+ diff = max - min,
468
+ add = max + min,
469
+ l = add * 0.5,
470
+ h, s;
471
+
472
+ if ( min === max ) {
473
+ h = 0;
474
+ } else if ( r === max ) {
475
+ h = ( 60 * ( g - b ) / diff ) + 360;
476
+ } else if ( g === max ) {
477
+ h = ( 60 * ( b - r ) / diff ) + 120;
478
+ } else {
479
+ h = ( 60 * ( r - g ) / diff ) + 240;
480
+ }
481
+
482
+ // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
483
+ // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
484
+ if ( diff === 0 ) {
485
+ s = 0;
486
+ } else if ( l <= 0.5 ) {
487
+ s = diff / add;
488
+ } else {
489
+ s = diff / ( 2 - add );
490
+ }
491
+ return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
492
+ };
493
+
494
+ spaces.hsla.from = function ( hsla ) {
495
+ if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
496
+ return [ null, null, null, hsla[ 3 ] ];
497
+ }
498
+ var h = hsla[ 0 ] / 360,
499
+ s = hsla[ 1 ],
500
+ l = hsla[ 2 ],
501
+ a = hsla[ 3 ],
502
+ q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
503
+ p = 2 * l - q;
504
+
505
+ return [
506
+ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
507
+ Math.round( hue2rgb( p, q, h ) * 255 ),
508
+ Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
509
+ a
510
+ ];
511
+ };
512
+
513
+
514
+ each( spaces, function( spaceName, space ) {
515
+ var props = space.props,
516
+ cache = space.cache,
517
+ to = space.to,
518
+ from = space.from;
519
+
520
+ // makes rgba() and hsla()
521
+ color.fn[ spaceName ] = function( value ) {
522
+
523
+ // generate a cache for this space if it doesn't exist
524
+ if ( to && !this[ cache ] ) {
525
+ this[ cache ] = to( this._rgba );
526
+ }
527
+ if ( value === undefined ) {
528
+ return this[ cache ].slice();
529
+ }
530
+
531
+ var ret,
532
+ type = jQuery.type( value ),
533
+ arr = ( type === "array" || type === "object" ) ? value : arguments,
534
+ local = this[ cache ].slice();
535
+
536
+ each( props, function( key, prop ) {
537
+ var val = arr[ type === "object" ? key : prop.idx ];
538
+ if ( val == null ) {
539
+ val = local[ prop.idx ];
540
+ }
541
+ local[ prop.idx ] = clamp( val, prop );
542
+ });
543
+
544
+ if ( from ) {
545
+ ret = color( from( local ) );
546
+ ret[ cache ] = local;
547
+ return ret;
548
+ } else {
549
+ return color( local );
550
+ }
551
+ };
552
+
553
+ // makes red() green() blue() alpha() hue() saturation() lightness()
554
+ each( props, function( key, prop ) {
555
+ // alpha is included in more than one space
556
+ if ( color.fn[ key ] ) {
557
+ return;
558
+ }
559
+ color.fn[ key ] = function( value ) {
560
+ var vtype = jQuery.type( value ),
561
+ fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
562
+ local = this[ fn ](),
563
+ cur = local[ prop.idx ],
564
+ match;
565
+
566
+ if ( vtype === "undefined" ) {
567
+ return cur;
568
+ }
569
+
570
+ if ( vtype === "function" ) {
571
+ value = value.call( this, cur );
572
+ vtype = jQuery.type( value );
573
+ }
574
+ if ( value == null && prop.empty ) {
575
+ return this;
576
+ }
577
+ if ( vtype === "string" ) {
578
+ match = rplusequals.exec( value );
579
+ if ( match ) {
580
+ value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
581
+ }
582
+ }
583
+ local[ prop.idx ] = value;
584
+ return this[ fn ]( local );
585
+ };
586
+ });
587
+ });
588
+
589
+ // add cssHook and .fx.step function for each named hook.
590
+ // accept a space separated string of properties
591
+ color.hook = function( hook ) {
592
+ var hooks = hook.split( " " );
593
+ each( hooks, function( i, hook ) {
594
+ jQuery.cssHooks[ hook ] = {
595
+ set: function( elem, value ) {
596
+ var parsed, curElem,
597
+ backgroundColor = "";
598
+
599
+ if ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) {
600
+ value = color( parsed || value );
601
+ if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
602
+ curElem = hook === "backgroundColor" ? elem.parentNode : elem;
603
+ while (
604
+ (backgroundColor === "" || backgroundColor === "transparent") &&
605
+ curElem && curElem.style
606
+ ) {
607
+ try {
608
+ backgroundColor = jQuery.css( curElem, "backgroundColor" );
609
+ curElem = curElem.parentNode;
610
+ } catch ( e ) {
611
+ }
612
+ }
613
+
614
+ value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
615
+ backgroundColor :
616
+ "_default" );
617
+ }
618
+
619
+ value = value.toRgbaString();
620
+ }
621
+ try {
622
+ elem.style[ hook ] = value;
623
+ } catch( e ) {
624
+ // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
625
+ }
626
+ }
627
+ };
628
+ jQuery.fx.step[ hook ] = function( fx ) {
629
+ if ( !fx.colorInit ) {
630
+ fx.start = color( fx.elem, hook );
631
+ fx.end = color( fx.end );
632
+ fx.colorInit = true;
633
+ }
634
+ jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
635
+ };
636
+ });
637
+
638
+ };
639
+
640
+ color.hook( stepHooks );
641
+
642
+ jQuery.cssHooks.borderColor = {
643
+ expand: function( value ) {
644
+ var expanded = {};
645
+
646
+ each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
647
+ expanded[ "border" + part + "Color" ] = value;
648
+ });
649
+ return expanded;
650
+ }
651
+ };
652
+
653
+ // Basic color names only.
654
+ // Usage of any of the other color names requires adding yourself or including
655
+ // jquery.color.svg-names.js.
656
+ colors = jQuery.Color.names = {
657
+ // 4.1. Basic color keywords
658
+ aqua: "#00ffff",
659
+ black: "#000000",
660
+ blue: "#0000ff",
661
+ fuchsia: "#ff00ff",
662
+ gray: "#808080",
663
+ green: "#008000",
664
+ lime: "#00ff00",
665
+ maroon: "#800000",
666
+ navy: "#000080",
667
+ olive: "#808000",
668
+ purple: "#800080",
669
+ red: "#ff0000",
670
+ silver: "#c0c0c0",
671
+ teal: "#008080",
672
+ white: "#ffffff",
673
+ yellow: "#ffff00",
674
+
675
+ // 4.2.3. "transparent" color keyword
676
+ transparent: [ null, null, null, 0 ],
677
+
678
+ _default: "#ffffff"
679
+ };
680
+
681
+ })( jQuery );
682
+
683
+
684
+ /******************************************************************************/
685
+ /****************************** CLASS ANIMATIONS ******************************/
686
+ /******************************************************************************/
687
+ (function() {
688
+
689
+ var classAnimationActions = [ "add", "remove", "toggle" ],
690
+ shorthandStyles = {
691
+ border: 1,
692
+ borderBottom: 1,
693
+ borderColor: 1,
694
+ borderLeft: 1,
695
+ borderRight: 1,
696
+ borderTop: 1,
697
+ borderWidth: 1,
698
+ margin: 1,
699
+ padding: 1
700
+ };
701
+
702
+ $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
703
+ $.fx.step[ prop ] = function( fx ) {
704
+ if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
705
+ jQuery.style( fx.elem, prop, fx.end );
706
+ fx.setAttr = true;
707
+ }
708
+ };
709
+ });
710
+
711
+ function getElementStyles( elem ) {
712
+ var key, len,
713
+ style = elem.ownerDocument.defaultView ?
714
+ elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
715
+ elem.currentStyle,
716
+ styles = {};
717
+
718
+ if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
719
+ len = style.length;
720
+ while ( len-- ) {
721
+ key = style[ len ];
722
+ if ( typeof style[ key ] === "string" ) {
723
+ styles[ $.camelCase( key ) ] = style[ key ];
724
+ }
725
+ }
726
+ // support: Opera, IE <9
727
+ } else {
728
+ for ( key in style ) {
729
+ if ( typeof style[ key ] === "string" ) {
730
+ styles[ key ] = style[ key ];
731
+ }
732
+ }
733
+ }
734
+
735
+ return styles;
736
+ }
737
+
738
+
739
+ function styleDifference( oldStyle, newStyle ) {
740
+ var diff = {},
741
+ name, value;
742
+
743
+ for ( name in newStyle ) {
744
+ value = newStyle[ name ];
745
+ if ( oldStyle[ name ] !== value ) {
746
+ if ( !shorthandStyles[ name ] ) {
747
+ if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
748
+ diff[ name ] = value;
749
+ }
750
+ }
751
+ }
752
+ }
753
+
754
+ return diff;
755
+ }
756
+
757
+ $.effects.animateClass = function( value, duration, easing, callback ) {
758
+ var o = $.speed( duration, easing, callback );
759
+
760
+ return this.queue( function() {
761
+ var animated = $( this ),
762
+ baseClass = animated.attr( "class" ) || "",
763
+ applyClassChange,
764
+ allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
765
+
766
+ // map the animated objects to store the original styles.
767
+ allAnimations = allAnimations.map(function() {
768
+ var el = $( this );
769
+ return {
770
+ el: el,
771
+ start: getElementStyles( this )
772
+ };
773
+ });
774
+
775
+ // apply class change
776
+ applyClassChange = function() {
777
+ $.each( classAnimationActions, function(i, action) {
778
+ if ( value[ action ] ) {
779
+ animated[ action + "Class" ]( value[ action ] );
780
+ }
781
+ });
782
+ };
783
+ applyClassChange();
784
+
785
+ // map all animated objects again - calculate new styles and diff
786
+ allAnimations = allAnimations.map(function() {
787
+ this.end = getElementStyles( this.el[ 0 ] );
788
+ this.diff = styleDifference( this.start, this.end );
789
+ return this;
790
+ });
791
+
792
+ // apply original class
793
+ animated.attr( "class", baseClass );
794
+
795
+ // map all animated objects again - this time collecting a promise
796
+ allAnimations = allAnimations.map(function() {
797
+ var styleInfo = this,
798
+ dfd = $.Deferred(),
799
+ opts = $.extend({}, o, {
800
+ queue: false,
801
+ complete: function() {
802
+ dfd.resolve( styleInfo );
803
+ }
804
+ });
805
+
806
+ this.el.animate( this.diff, opts );
807
+ return dfd.promise();
808
+ });
809
+
810
+ // once all animations have completed:
811
+ $.when.apply( $, allAnimations.get() ).done(function() {
812
+
813
+ // set the final class
814
+ applyClassChange();
815
+
816
+ // for each animated element,
817
+ // clear all css properties that were animated
818
+ $.each( arguments, function() {
819
+ var el = this.el;
820
+ $.each( this.diff, function(key) {
821
+ el.css( key, "" );
822
+ });
823
+ });
824
+
825
+ // this is guarnteed to be there if you use jQuery.speed()
826
+ // it also handles dequeuing the next anim...
827
+ o.complete.call( animated[ 0 ] );
828
+ });
829
+ });
830
+ };
831
+
832
+ $.fn.extend({
833
+ _addClass: $.fn.addClass,
834
+ addClass: function( classNames, speed, easing, callback ) {
835
+ return speed ?
836
+ $.effects.animateClass.call( this,
837
+ { add: classNames }, speed, easing, callback ) :
838
+ this._addClass( classNames );
839
+ },
840
+
841
+ _removeClass: $.fn.removeClass,
842
+ removeClass: function( classNames, speed, easing, callback ) {
843
+ return speed ?
844
+ $.effects.animateClass.call( this,
845
+ { remove: classNames }, speed, easing, callback ) :
846
+ this._removeClass( classNames );
847
+ },
848
+
849
+ _toggleClass: $.fn.toggleClass,
850
+ toggleClass: function( classNames, force, speed, easing, callback ) {
851
+ if ( typeof force === "boolean" || force === undefined ) {
852
+ if ( !speed ) {
853
+ // without speed parameter
854
+ return this._toggleClass( classNames, force );
855
+ } else {
856
+ return $.effects.animateClass.call( this,
857
+ (force ? { add: classNames } : { remove: classNames }),
858
+ speed, easing, callback );
859
+ }
860
+ } else {
861
+ // without force parameter
862
+ return $.effects.animateClass.call( this,
863
+ { toggle: classNames }, force, speed, easing );
864
+ }
865
+ },
866
+
867
+ switchClass: function( remove, add, speed, easing, callback) {
868
+ return $.effects.animateClass.call( this, {
869
+ add: add,
870
+ remove: remove
871
+ }, speed, easing, callback );
872
+ }
873
+ });
874
+
875
+ })();
876
+
877
+ /******************************************************************************/
878
+ /*********************************** EFFECTS **********************************/
879
+ /******************************************************************************/
880
+
881
+ (function() {
882
+
883
+ $.extend( $.effects, {
884
+ version: "@VERSION",
885
+
886
+ // Saves a set of properties in a data storage
887
+ save: function( element, set ) {
888
+ for( var i=0; i < set.length; i++ ) {
889
+ if ( set[ i ] !== null ) {
890
+ element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
891
+ }
892
+ }
893
+ },
894
+
895
+ // Restores a set of previously saved properties from a data storage
896
+ restore: function( element, set ) {
897
+ var val, i;
898
+ for( i=0; i < set.length; i++ ) {
899
+ if ( set[ i ] !== null ) {
900
+ val = element.data( dataSpace + set[ i ] );
901
+ // support: jQuery 1.6.2
902
+ // http://bugs.jquery.com/ticket/9917
903
+ // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
904
+ // We can't differentiate between "" and 0 here, so we just assume
905
+ // empty string since it's likely to be a more common value...
906
+ if ( val === undefined ) {
907
+ val = "";
908
+ }
909
+ element.css( set[ i ], val );
910
+ }
911
+ }
912
+ },
913
+
914
+ setMode: function( el, mode ) {
915
+ if (mode === "toggle") {
916
+ mode = el.is( ":hidden" ) ? "show" : "hide";
917
+ }
918
+ return mode;
919
+ },
920
+
921
+ // Translates a [top,left] array into a baseline value
922
+ // this should be a little more flexible in the future to handle a string & hash
923
+ getBaseline: function( origin, original ) {
924
+ var y, x;
925
+ switch ( origin[ 0 ] ) {
926
+ case "top": y = 0; break;
927
+ case "middle": y = 0.5; break;
928
+ case "bottom": y = 1; break;
929
+ default: y = origin[ 0 ] / original.height;
930
+ }
931
+ switch ( origin[ 1 ] ) {
932
+ case "left": x = 0; break;
933
+ case "center": x = 0.5; break;
934
+ case "right": x = 1; break;
935
+ default: x = origin[ 1 ] / original.width;
936
+ }
937
+ return {
938
+ x: x,
939
+ y: y
940
+ };
941
+ },
942
+
943
+ // Wraps the element around a wrapper that copies position properties
944
+ createWrapper: function( element ) {
945
+
946
+ // if the element is already wrapped, return it
947
+ if ( element.parent().is( ".ui-effects-wrapper" )) {
948
+ return element.parent();
949
+ }
950
+
951
+ // wrap the element
952
+ var props = {
953
+ width: element.outerWidth(true),
954
+ height: element.outerHeight(true),
955
+ "float": element.css( "float" )
956
+ },
957
+ wrapper = $( "<div></div>" )
958
+ .addClass( "ui-effects-wrapper" )
959
+ .css({
960
+ fontSize: "100%",
961
+ background: "transparent",
962
+ border: "none",
963
+ margin: 0,
964
+ padding: 0
965
+ }),
966
+ // Store the size in case width/height are defined in % - Fixes #5245
967
+ size = {
968
+ width: element.width(),
969
+ height: element.height()
970
+ },
971
+ active = document.activeElement;
972
+
973
+ // support: Firefox
974
+ // Firefox incorrectly exposes anonymous content
975
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
976
+ try {
977
+ active.id;
978
+ } catch( e ) {
979
+ active = document.body;
980
+ }
981
+
982
+ element.wrap( wrapper );
983
+
984
+ // Fixes #7595 - Elements lose focus when wrapped.
985
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
986
+ $( active ).focus();
987
+ }
988
+
989
+ wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
990
+
991
+ // transfer positioning properties to the wrapper
992
+ if ( element.css( "position" ) === "static" ) {
993
+ wrapper.css({ position: "relative" });
994
+ element.css({ position: "relative" });
995
+ } else {
996
+ $.extend( props, {
997
+ position: element.css( "position" ),
998
+ zIndex: element.css( "z-index" )
999
+ });
1000
+ $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
1001
+ props[ pos ] = element.css( pos );
1002
+ if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
1003
+ props[ pos ] = "auto";
1004
+ }
1005
+ });
1006
+ element.css({
1007
+ position: "relative",
1008
+ top: 0,
1009
+ left: 0,
1010
+ right: "auto",
1011
+ bottom: "auto"
1012
+ });
1013
+ }
1014
+ element.css(size);
1015
+
1016
+ return wrapper.css( props ).show();
1017
+ },
1018
+
1019
+ removeWrapper: function( element ) {
1020
+ var active = document.activeElement;
1021
+
1022
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
1023
+ element.parent().replaceWith( element );
1024
+
1025
+ // Fixes #7595 - Elements lose focus when wrapped.
1026
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
1027
+ $( active ).focus();
1028
+ }
1029
+ }
1030
+
1031
+
1032
+ return element;
1033
+ },
1034
+
1035
+ setTransition: function( element, list, factor, value ) {
1036
+ value = value || {};
1037
+ $.each( list, function( i, x ) {
1038
+ var unit = element.cssUnit( x );
1039
+ if ( unit[ 0 ] > 0 ) {
1040
+ value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
1041
+ }
1042
+ });
1043
+ return value;
1044
+ }
1045
+ });
1046
+
1047
+ // return an effect options object for the given parameters:
1048
+ function _normalizeArguments( effect, options, speed, callback ) {
1049
+
1050
+ // allow passing all options as the first parameter
1051
+ if ( $.isPlainObject( effect ) ) {
1052
+ options = effect;
1053
+ effect = effect.effect;
1054
+ }
1055
+
1056
+ // convert to an object
1057
+ effect = { effect: effect };
1058
+
1059
+ // catch (effect, null, ...)
1060
+ if ( options == null ) {
1061
+ options = {};
1062
+ }
1063
+
1064
+ // catch (effect, callback)
1065
+ if ( $.isFunction( options ) ) {
1066
+ callback = options;
1067
+ speed = null;
1068
+ options = {};
1069
+ }
1070
+
1071
+ // catch (effect, speed, ?)
1072
+ if ( typeof options === "number" || $.fx.speeds[ options ] ) {
1073
+ callback = speed;
1074
+ speed = options;
1075
+ options = {};
1076
+ }
1077
+
1078
+ // catch (effect, options, callback)
1079
+ if ( $.isFunction( speed ) ) {
1080
+ callback = speed;
1081
+ speed = null;
1082
+ }
1083
+
1084
+ // add options to effect
1085
+ if ( options ) {
1086
+ $.extend( effect, options );
1087
+ }
1088
+
1089
+ speed = speed || options.duration;
1090
+ effect.duration = $.fx.off ? 0 :
1091
+ typeof speed === "number" ? speed :
1092
+ speed in $.fx.speeds ? $.fx.speeds[ speed ] :
1093
+ $.fx.speeds._default;
1094
+
1095
+ effect.complete = callback || options.complete;
1096
+
1097
+ return effect;
1098
+ }
1099
+
1100
+ function standardSpeed( speed ) {
1101
+ // valid standard speeds
1102
+ if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
1103
+ return true;
1104
+ }
1105
+
1106
+ // invalid strings - treat as "normal" speed
1107
+ return typeof speed === "string" && !$.effects.effect[ speed ];
1108
+ }
1109
+
1110
+ $.fn.extend({
1111
+ effect: function( /* effect, options, speed, callback */ ) {
1112
+ var args = _normalizeArguments.apply( this, arguments ),
1113
+ mode = args.mode,
1114
+ queue = args.queue,
1115
+ effectMethod = $.effects.effect[ args.effect ];
1116
+
1117
+ if ( $.fx.off || !effectMethod ) {
1118
+ // delegate to the original method (e.g., .show()) if possible
1119
+ if ( mode ) {
1120
+ return this[ mode ]( args.duration, args.complete );
1121
+ } else {
1122
+ return this.each( function() {
1123
+ if ( args.complete ) {
1124
+ args.complete.call( this );
1125
+ }
1126
+ });
1127
+ }
1128
+ }
1129
+
1130
+ function run( next ) {
1131
+ var elem = $( this ),
1132
+ complete = args.complete,
1133
+ mode = args.mode;
1134
+
1135
+ function done() {
1136
+ if ( $.isFunction( complete ) ) {
1137
+ complete.call( elem[0] );
1138
+ }
1139
+ if ( $.isFunction( next ) ) {
1140
+ next();
1141
+ }
1142
+ }
1143
+
1144
+ // if the element is hiddden and mode is hide,
1145
+ // or element is visible and mode is show
1146
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
1147
+ done();
1148
+ } else {
1149
+ effectMethod.call( elem[0], args, done );
1150
+ }
1151
+ }
1152
+
1153
+ return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
1154
+ },
1155
+
1156
+ _show: $.fn.show,
1157
+ show: function( speed ) {
1158
+ if ( standardSpeed( speed ) ) {
1159
+ return this._show.apply( this, arguments );
1160
+ } else {
1161
+ var args = _normalizeArguments.apply( this, arguments );
1162
+ args.mode = "show";
1163
+ return this.effect.call( this, args );
1164
+ }
1165
+ },
1166
+
1167
+ _hide: $.fn.hide,
1168
+ hide: function( speed ) {
1169
+ if ( standardSpeed( speed ) ) {
1170
+ return this._hide.apply( this, arguments );
1171
+ } else {
1172
+ var args = _normalizeArguments.apply( this, arguments );
1173
+ args.mode = "hide";
1174
+ return this.effect.call( this, args );
1175
+ }
1176
+ },
1177
+
1178
+ // jQuery core overloads toggle and creates _toggle
1179
+ __toggle: $.fn.toggle,
1180
+ toggle: function( speed ) {
1181
+ if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {
1182
+ return this.__toggle.apply( this, arguments );
1183
+ } else {
1184
+ var args = _normalizeArguments.apply( this, arguments );
1185
+ args.mode = "toggle";
1186
+ return this.effect.call( this, args );
1187
+ }
1188
+ },
1189
+
1190
+ // helper functions
1191
+ cssUnit: function(key) {
1192
+ var style = this.css( key ),
1193
+ val = [];
1194
+
1195
+ $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
1196
+ if ( style.indexOf( unit ) > 0 ) {
1197
+ val = [ parseFloat( style ), unit ];
1198
+ }
1199
+ });
1200
+ return val;
1201
+ }
1202
+ });
1203
+
1204
+ })();
1205
+
1206
+ /******************************************************************************/
1207
+ /*********************************** EASING ***********************************/
1208
+ /******************************************************************************/
1209
+
1210
+ (function() {
1211
+
1212
+ // based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
1213
+
1214
+ var baseEasings = {};
1215
+
1216
+ $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
1217
+ baseEasings[ name ] = function( p ) {
1218
+ return Math.pow( p, i + 2 );
1219
+ };
1220
+ });
1221
+
1222
+ $.extend( baseEasings, {
1223
+ Sine: function ( p ) {
1224
+ return 1 - Math.cos( p * Math.PI / 2 );
1225
+ },
1226
+ Circ: function ( p ) {
1227
+ return 1 - Math.sqrt( 1 - p * p );
1228
+ },
1229
+ Elastic: function( p ) {
1230
+ return p === 0 || p === 1 ? p :
1231
+ -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
1232
+ },
1233
+ Back: function( p ) {
1234
+ return p * p * ( 3 * p - 2 );
1235
+ },
1236
+ Bounce: function ( p ) {
1237
+ var pow2,
1238
+ bounce = 4;
1239
+
1240
+ while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
1241
+ return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
1242
+ }
1243
+ });
1244
+
1245
+ $.each( baseEasings, function( name, easeIn ) {
1246
+ $.easing[ "easeIn" + name ] = easeIn;
1247
+ $.easing[ "easeOut" + name ] = function( p ) {
1248
+ return 1 - easeIn( 1 - p );
1249
+ };
1250
+ $.easing[ "easeInOut" + name ] = function( p ) {
1251
+ return p < 0.5 ?
1252
+ easeIn( p * 2 ) / 2 :
1253
+ 1 - easeIn( p * -2 + 2 ) / 2;
1254
+ };
1255
+ });
1256
+
1257
+ })();
1258
+
1259
+ })(jQuery));