pakunok 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. data/.gitignore +7 -0
  2. data/Gemfile +14 -0
  3. data/Gemfile.lock +98 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README.md +168 -0
  6. data/Rakefile +37 -0
  7. data/lib/pakunok.rb +4 -0
  8. data/lib/pakunok/version.rb +5 -0
  9. data/lib/tasks/pakunok_tasks.rake +4 -0
  10. data/pakunok.gemspec +24 -0
  11. data/spec/colorpicker_spec.rb +18 -0
  12. data/spec/dummy/Rakefile +7 -0
  13. data/spec/dummy/app/assets/javascripts/application.js +10 -0
  14. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  15. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  16. data/spec/dummy/app/controllers/pages_controller.rb +2 -0
  17. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  18. data/spec/dummy/app/mailers/.gitkeep +0 -0
  19. data/spec/dummy/app/models/.gitkeep +0 -0
  20. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  21. data/spec/dummy/app/views/pages/index.html.erb +20 -0
  22. data/spec/dummy/config.ru +4 -0
  23. data/spec/dummy/config/application.rb +47 -0
  24. data/spec/dummy/config/boot.rb +10 -0
  25. data/spec/dummy/config/database.yml +25 -0
  26. data/spec/dummy/config/environment.rb +5 -0
  27. data/spec/dummy/config/environments/development.rb +27 -0
  28. data/spec/dummy/config/environments/production.rb +51 -0
  29. data/spec/dummy/config/environments/test.rb +39 -0
  30. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  31. data/spec/dummy/config/initializers/inflections.rb +10 -0
  32. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  33. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  34. data/spec/dummy/config/initializers/session_store.rb +8 -0
  35. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  36. data/spec/dummy/config/locales/en.yml +5 -0
  37. data/spec/dummy/config/routes.rb +60 -0
  38. data/spec/dummy/lib/assets/.gitkeep +0 -0
  39. data/spec/dummy/log/.gitkeep +0 -0
  40. data/spec/dummy/public/404.html +26 -0
  41. data/spec/dummy/public/422.html +26 -0
  42. data/spec/dummy/public/500.html +26 -0
  43. data/spec/dummy/public/favicon.ico +0 -0
  44. data/spec/dummy/script/rails +6 -0
  45. data/spec/fileuploader_spec.rb +29 -0
  46. data/spec/jquery-ui_spec.rb +71 -0
  47. data/spec/jquery_spec.rb +10 -0
  48. data/spec/misc_spec.rb +23 -0
  49. data/spec/spec_helper.rb +10 -0
  50. data/spec/support/global.rb +12 -0
  51. data/spec/support/matchers.rb +64 -0
  52. data/vendor/assets/images/pakunok/colorpicker/colorpicker_background.png +0 -0
  53. data/vendor/assets/images/pakunok/colorpicker/colorpicker_hex.png +0 -0
  54. data/vendor/assets/images/pakunok/colorpicker/colorpicker_hsb_b.png +0 -0
  55. data/vendor/assets/images/pakunok/colorpicker/colorpicker_hsb_h.png +0 -0
  56. data/vendor/assets/images/pakunok/colorpicker/colorpicker_hsb_s.png +0 -0
  57. data/vendor/assets/images/pakunok/colorpicker/colorpicker_indic.gif +0 -0
  58. data/vendor/assets/images/pakunok/colorpicker/colorpicker_overlay.png +0 -0
  59. data/vendor/assets/images/pakunok/colorpicker/colorpicker_rgb_b.png +0 -0
  60. data/vendor/assets/images/pakunok/colorpicker/colorpicker_rgb_g.png +0 -0
  61. data/vendor/assets/images/pakunok/colorpicker/colorpicker_rgb_r.png +0 -0
  62. data/vendor/assets/images/pakunok/colorpicker/colorpicker_select.gif +0 -0
  63. data/vendor/assets/images/pakunok/colorpicker/colorpicker_submit.png +0 -0
  64. data/vendor/assets/images/pakunok/fileuploader/loading.gif +0 -0
  65. data/vendor/assets/javascripts/pakunok/colorpicker.js +484 -0
  66. data/vendor/assets/javascripts/pakunok/fileuploader.js +1247 -0
  67. data/vendor/assets/javascripts/pakunok/innershiv.js +87 -0
  68. data/vendor/assets/javascripts/pakunok/jquery-ui.js +20 -0
  69. data/vendor/assets/javascripts/pakunok/jquery-ui/accordion.js +1 -0
  70. data/vendor/assets/javascripts/pakunok/jquery-ui/autocomplete.js +1 -0
  71. data/vendor/assets/javascripts/pakunok/jquery-ui/button.js +1 -0
  72. data/vendor/assets/javascripts/pakunok/jquery-ui/core.js +1 -0
  73. data/vendor/assets/javascripts/pakunok/jquery-ui/datepicker.js +1 -0
  74. data/vendor/assets/javascripts/pakunok/jquery-ui/dialog.js +1 -0
  75. data/vendor/assets/javascripts/pakunok/jquery-ui/draggable.js +1 -0
  76. data/vendor/assets/javascripts/pakunok/jquery-ui/droppable.js +1 -0
  77. data/vendor/assets/javascripts/pakunok/jquery-ui/effects.js +14 -0
  78. data/vendor/assets/javascripts/pakunok/jquery-ui/mouse.js +1 -0
  79. data/vendor/assets/javascripts/pakunok/jquery-ui/order.txt +485 -0
  80. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/accordion.js +4 -0
  81. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/autocomplete.js +5 -0
  82. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/basic.js +5 -0
  83. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/button.js +4 -0
  84. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/datepicker.js +3 -0
  85. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/dialog.js +8 -0
  86. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/draggable.js +5 -0
  87. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/droppable.js +3 -0
  88. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/effects.js +1 -0
  89. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/progressbar.js +4 -0
  90. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/resizable.js +5 -0
  91. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/selectable.js +5 -0
  92. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/slider.js +5 -0
  93. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/sortable.js +5 -0
  94. data/vendor/assets/javascripts/pakunok/jquery-ui/pack/tabs.js +4 -0
  95. data/vendor/assets/javascripts/pakunok/jquery-ui/position.js +1 -0
  96. data/vendor/assets/javascripts/pakunok/jquery-ui/progressbar.js +1 -0
  97. data/vendor/assets/javascripts/pakunok/jquery-ui/resizable.js +1 -0
  98. data/vendor/assets/javascripts/pakunok/jquery-ui/selectable.js +1 -0
  99. data/vendor/assets/javascripts/pakunok/jquery-ui/slider.js +1 -0
  100. data/vendor/assets/javascripts/pakunok/jquery-ui/sortable.js +1 -0
  101. data/vendor/assets/javascripts/pakunok/jquery-ui/tabs.js +1 -0
  102. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery-ui-i18n.js +1379 -0
  103. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-af.js +23 -0
  104. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ar-DZ.js +23 -0
  105. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ar.js +23 -0
  106. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-az.js +23 -0
  107. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-bg.js +24 -0
  108. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-bs.js +23 -0
  109. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ca.js +23 -0
  110. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-cs.js +23 -0
  111. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-da.js +23 -0
  112. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-de.js +23 -0
  113. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-el.js +23 -0
  114. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-en-AU.js +23 -0
  115. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-en-GB.js +23 -0
  116. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-en-NZ.js +23 -0
  117. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-eo.js +23 -0
  118. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-es.js +23 -0
  119. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-et.js +23 -0
  120. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-eu.js +23 -0
  121. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-fa.js +23 -0
  122. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-fi.js +23 -0
  123. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-fo.js +23 -0
  124. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-fr-CH.js +23 -0
  125. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-fr.js +25 -0
  126. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-gl.js +23 -0
  127. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-he.js +23 -0
  128. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-hr.js +23 -0
  129. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-hu.js +23 -0
  130. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-hy.js +23 -0
  131. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-id.js +23 -0
  132. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-is.js +23 -0
  133. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-it.js +23 -0
  134. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ja.js +23 -0
  135. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ko.js +23 -0
  136. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-kz.js +23 -0
  137. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-lt.js +23 -0
  138. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-lv.js +23 -0
  139. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ml.js +23 -0
  140. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ms.js +23 -0
  141. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-nl.js +23 -0
  142. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-no.js +23 -0
  143. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-pl.js +23 -0
  144. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-pt-BR.js +23 -0
  145. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-pt.js +22 -0
  146. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-rm.js +21 -0
  147. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ro.js +26 -0
  148. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ru.js +23 -0
  149. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-sk.js +23 -0
  150. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-sl.js +24 -0
  151. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-sq.js +23 -0
  152. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-sr-SR.js +23 -0
  153. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-sr.js +23 -0
  154. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-sv.js +23 -0
  155. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-ta.js +23 -0
  156. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-th.js +23 -0
  157. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-tj.js +23 -0
  158. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-tr.js +23 -0
  159. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-uk.js +23 -0
  160. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-vi.js +23 -0
  161. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-zh-CN.js +23 -0
  162. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-zh-HK.js +23 -0
  163. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/i18n/jquery.ui.datepicker-zh-TW.js +23 -0
  164. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.blind.js +49 -0
  165. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.bounce.js +78 -0
  166. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.clip.js +54 -0
  167. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.core.js +746 -0
  168. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.drop.js +50 -0
  169. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.explode.js +79 -0
  170. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.fade.js +32 -0
  171. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.fold.js +56 -0
  172. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.highlight.js +50 -0
  173. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.pulsate.js +51 -0
  174. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.scale.js +178 -0
  175. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.shake.js +57 -0
  176. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.slide.js +50 -0
  177. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.effects.transfer.js +45 -0
  178. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.accordion.js +611 -0
  179. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.autocomplete.js +612 -0
  180. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.button.js +416 -0
  181. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.core.js +314 -0
  182. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.datepicker.js +1824 -0
  183. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.dialog.js +878 -0
  184. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.draggable.js +823 -0
  185. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.droppable.js +296 -0
  186. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.mouse.js +156 -0
  187. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.position.js +252 -0
  188. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.progressbar.js +109 -0
  189. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.resizable.js +842 -0
  190. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.selectable.js +266 -0
  191. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.slider.js +666 -0
  192. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.sortable.js +1077 -0
  193. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.tabs.js +758 -0
  194. data/vendor/assets/javascripts/pakunok/jquery-ui/ui/jquery.ui.widget.js +262 -0
  195. data/vendor/assets/javascripts/pakunok/jquery-ui/widget.js +1 -0
  196. data/vendor/assets/javascripts/pakunok/jquery.form.js +911 -0
  197. data/vendor/assets/javascripts/pakunok/jquery.js +1 -0
  198. data/vendor/assets/javascripts/pakunok/jquery.jscrollpane.js +1390 -0
  199. data/vendor/assets/javascripts/pakunok/jquery.mousewheel.js +78 -0
  200. data/vendor/assets/javascripts/pakunok/jquery.validate.js +1166 -0
  201. data/vendor/assets/javascripts/pakunok/jquery.validate/additional-methods.js +280 -0
  202. data/vendor/assets/javascripts/pakunok/jquery.viewport.js +58 -0
  203. data/vendor/assets/javascripts/pakunok/jquery/jquery-1.5.2.js +8374 -0
  204. data/vendor/assets/javascripts/pakunok/jquery/jquery-1.6.2.js +8981 -0
  205. data/vendor/assets/javascripts/pakunok/mwheelIntent.js +76 -0
  206. data/vendor/assets/stylesheets/pakunok/colorpicker.css.erb +161 -0
  207. data/vendor/assets/stylesheets/pakunok/fileuploader.css.erb +31 -0
  208. data/vendor/assets/stylesheets/pakunok/jquery.jscrollpane.css +120 -0
  209. metadata +292 -0
@@ -0,0 +1,416 @@
1
+ /*
2
+ * jQuery UI Button 1.8.15
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Button
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ * jquery.ui.widget.js
13
+ */
14
+ (function( $, undefined ) {
15
+
16
+ var lastActive, startXPos, startYPos, clickDragged,
17
+ baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
18
+ stateClasses = "ui-state-hover ui-state-active ",
19
+ typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
20
+ formResetHandler = function() {
21
+ var buttons = $( this ).find( ":ui-button" );
22
+ setTimeout(function() {
23
+ buttons.button( "refresh" );
24
+ }, 1 );
25
+ },
26
+ radioGroup = function( radio ) {
27
+ var name = radio.name,
28
+ form = radio.form,
29
+ radios = $( [] );
30
+ if ( name ) {
31
+ if ( form ) {
32
+ radios = $( form ).find( "[name='" + name + "']" );
33
+ } else {
34
+ radios = $( "[name='" + name + "']", radio.ownerDocument )
35
+ .filter(function() {
36
+ return !this.form;
37
+ });
38
+ }
39
+ }
40
+ return radios;
41
+ };
42
+
43
+ $.widget( "ui.button", {
44
+ options: {
45
+ disabled: null,
46
+ text: true,
47
+ label: null,
48
+ icons: {
49
+ primary: null,
50
+ secondary: null
51
+ }
52
+ },
53
+ _create: function() {
54
+ this.element.closest( "form" )
55
+ .unbind( "reset.button" )
56
+ .bind( "reset.button", formResetHandler );
57
+
58
+ if ( typeof this.options.disabled !== "boolean" ) {
59
+ this.options.disabled = this.element.propAttr( "disabled" );
60
+ }
61
+
62
+ this._determineButtonType();
63
+ this.hasTitle = !!this.buttonElement.attr( "title" );
64
+
65
+ var self = this,
66
+ options = this.options,
67
+ toggleButton = this.type === "checkbox" || this.type === "radio",
68
+ hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ),
69
+ focusClass = "ui-state-focus";
70
+
71
+ if ( options.label === null ) {
72
+ options.label = this.buttonElement.html();
73
+ }
74
+
75
+ if ( this.element.is( ":disabled" ) ) {
76
+ options.disabled = true;
77
+ }
78
+
79
+ this.buttonElement
80
+ .addClass( baseClasses )
81
+ .attr( "role", "button" )
82
+ .bind( "mouseenter.button", function() {
83
+ if ( options.disabled ) {
84
+ return;
85
+ }
86
+ $( this ).addClass( "ui-state-hover" );
87
+ if ( this === lastActive ) {
88
+ $( this ).addClass( "ui-state-active" );
89
+ }
90
+ })
91
+ .bind( "mouseleave.button", function() {
92
+ if ( options.disabled ) {
93
+ return;
94
+ }
95
+ $( this ).removeClass( hoverClass );
96
+ })
97
+ .bind( "click.button", function( event ) {
98
+ if ( options.disabled ) {
99
+ event.preventDefault();
100
+ event.stopImmediatePropagation();
101
+ }
102
+ });
103
+
104
+ this.element
105
+ .bind( "focus.button", function() {
106
+ // no need to check disabled, focus won't be triggered anyway
107
+ self.buttonElement.addClass( focusClass );
108
+ })
109
+ .bind( "blur.button", function() {
110
+ self.buttonElement.removeClass( focusClass );
111
+ });
112
+
113
+ if ( toggleButton ) {
114
+ this.element.bind( "change.button", function() {
115
+ if ( clickDragged ) {
116
+ return;
117
+ }
118
+ self.refresh();
119
+ });
120
+ // if mouse moves between mousedown and mouseup (drag) set clickDragged flag
121
+ // prevents issue where button state changes but checkbox/radio checked state
122
+ // does not in Firefox (see ticket #6970)
123
+ this.buttonElement
124
+ .bind( "mousedown.button", function( event ) {
125
+ if ( options.disabled ) {
126
+ return;
127
+ }
128
+ clickDragged = false;
129
+ startXPos = event.pageX;
130
+ startYPos = event.pageY;
131
+ })
132
+ .bind( "mouseup.button", function( event ) {
133
+ if ( options.disabled ) {
134
+ return;
135
+ }
136
+ if ( startXPos !== event.pageX || startYPos !== event.pageY ) {
137
+ clickDragged = true;
138
+ }
139
+ });
140
+ }
141
+
142
+ if ( this.type === "checkbox" ) {
143
+ this.buttonElement.bind( "click.button", function() {
144
+ if ( options.disabled || clickDragged ) {
145
+ return false;
146
+ }
147
+ $( this ).toggleClass( "ui-state-active" );
148
+ self.buttonElement.attr( "aria-pressed", self.element[0].checked );
149
+ });
150
+ } else if ( this.type === "radio" ) {
151
+ this.buttonElement.bind( "click.button", function() {
152
+ if ( options.disabled || clickDragged ) {
153
+ return false;
154
+ }
155
+ $( this ).addClass( "ui-state-active" );
156
+ self.buttonElement.attr( "aria-pressed", "true" );
157
+
158
+ var radio = self.element[ 0 ];
159
+ radioGroup( radio )
160
+ .not( radio )
161
+ .map(function() {
162
+ return $( this ).button( "widget" )[ 0 ];
163
+ })
164
+ .removeClass( "ui-state-active" )
165
+ .attr( "aria-pressed", "false" );
166
+ });
167
+ } else {
168
+ this.buttonElement
169
+ .bind( "mousedown.button", function() {
170
+ if ( options.disabled ) {
171
+ return false;
172
+ }
173
+ $( this ).addClass( "ui-state-active" );
174
+ lastActive = this;
175
+ $( document ).one( "mouseup", function() {
176
+ lastActive = null;
177
+ });
178
+ })
179
+ .bind( "mouseup.button", function() {
180
+ if ( options.disabled ) {
181
+ return false;
182
+ }
183
+ $( this ).removeClass( "ui-state-active" );
184
+ })
185
+ .bind( "keydown.button", function(event) {
186
+ if ( options.disabled ) {
187
+ return false;
188
+ }
189
+ if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) {
190
+ $( this ).addClass( "ui-state-active" );
191
+ }
192
+ })
193
+ .bind( "keyup.button", function() {
194
+ $( this ).removeClass( "ui-state-active" );
195
+ });
196
+
197
+ if ( this.buttonElement.is("a") ) {
198
+ this.buttonElement.keyup(function(event) {
199
+ if ( event.keyCode === $.ui.keyCode.SPACE ) {
200
+ // TODO pass through original event correctly (just as 2nd argument doesn't work)
201
+ $( this ).click();
202
+ }
203
+ });
204
+ }
205
+ }
206
+
207
+ // TODO: pull out $.Widget's handling for the disabled option into
208
+ // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
209
+ // be overridden by individual plugins
210
+ this._setOption( "disabled", options.disabled );
211
+ this._resetButton();
212
+ },
213
+
214
+ _determineButtonType: function() {
215
+
216
+ if ( this.element.is(":checkbox") ) {
217
+ this.type = "checkbox";
218
+ } else if ( this.element.is(":radio") ) {
219
+ this.type = "radio";
220
+ } else if ( this.element.is("input") ) {
221
+ this.type = "input";
222
+ } else {
223
+ this.type = "button";
224
+ }
225
+
226
+ if ( this.type === "checkbox" || this.type === "radio" ) {
227
+ // we don't search against the document in case the element
228
+ // is disconnected from the DOM
229
+ var ancestor = this.element.parents().filter(":last"),
230
+ labelSelector = "label[for=" + this.element.attr("id") + "]";
231
+ this.buttonElement = ancestor.find( labelSelector );
232
+ if ( !this.buttonElement.length ) {
233
+ ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
234
+ this.buttonElement = ancestor.filter( labelSelector );
235
+ if ( !this.buttonElement.length ) {
236
+ this.buttonElement = ancestor.find( labelSelector );
237
+ }
238
+ }
239
+ this.element.addClass( "ui-helper-hidden-accessible" );
240
+
241
+ var checked = this.element.is( ":checked" );
242
+ if ( checked ) {
243
+ this.buttonElement.addClass( "ui-state-active" );
244
+ }
245
+ this.buttonElement.attr( "aria-pressed", checked );
246
+ } else {
247
+ this.buttonElement = this.element;
248
+ }
249
+ },
250
+
251
+ widget: function() {
252
+ return this.buttonElement;
253
+ },
254
+
255
+ destroy: function() {
256
+ this.element
257
+ .removeClass( "ui-helper-hidden-accessible" );
258
+ this.buttonElement
259
+ .removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
260
+ .removeAttr( "role" )
261
+ .removeAttr( "aria-pressed" )
262
+ .html( this.buttonElement.find(".ui-button-text").html() );
263
+
264
+ if ( !this.hasTitle ) {
265
+ this.buttonElement.removeAttr( "title" );
266
+ }
267
+
268
+ $.Widget.prototype.destroy.call( this );
269
+ },
270
+
271
+ _setOption: function( key, value ) {
272
+ $.Widget.prototype._setOption.apply( this, arguments );
273
+ if ( key === "disabled" ) {
274
+ if ( value ) {
275
+ this.element.propAttr( "disabled", true );
276
+ } else {
277
+ this.element.propAttr( "disabled", false );
278
+ }
279
+ return;
280
+ }
281
+ this._resetButton();
282
+ },
283
+
284
+ refresh: function() {
285
+ var isDisabled = this.element.is( ":disabled" );
286
+ if ( isDisabled !== this.options.disabled ) {
287
+ this._setOption( "disabled", isDisabled );
288
+ }
289
+ if ( this.type === "radio" ) {
290
+ radioGroup( this.element[0] ).each(function() {
291
+ if ( $( this ).is( ":checked" ) ) {
292
+ $( this ).button( "widget" )
293
+ .addClass( "ui-state-active" )
294
+ .attr( "aria-pressed", "true" );
295
+ } else {
296
+ $( this ).button( "widget" )
297
+ .removeClass( "ui-state-active" )
298
+ .attr( "aria-pressed", "false" );
299
+ }
300
+ });
301
+ } else if ( this.type === "checkbox" ) {
302
+ if ( this.element.is( ":checked" ) ) {
303
+ this.buttonElement
304
+ .addClass( "ui-state-active" )
305
+ .attr( "aria-pressed", "true" );
306
+ } else {
307
+ this.buttonElement
308
+ .removeClass( "ui-state-active" )
309
+ .attr( "aria-pressed", "false" );
310
+ }
311
+ }
312
+ },
313
+
314
+ _resetButton: function() {
315
+ if ( this.type === "input" ) {
316
+ if ( this.options.label ) {
317
+ this.element.val( this.options.label );
318
+ }
319
+ return;
320
+ }
321
+ var buttonElement = this.buttonElement.removeClass( typeClasses ),
322
+ buttonText = $( "<span></span>" )
323
+ .addClass( "ui-button-text" )
324
+ .html( this.options.label )
325
+ .appendTo( buttonElement.empty() )
326
+ .text(),
327
+ icons = this.options.icons,
328
+ multipleIcons = icons.primary && icons.secondary,
329
+ buttonClasses = [];
330
+
331
+ if ( icons.primary || icons.secondary ) {
332
+ if ( this.options.text ) {
333
+ buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
334
+ }
335
+
336
+ if ( icons.primary ) {
337
+ buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
338
+ }
339
+
340
+ if ( icons.secondary ) {
341
+ buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
342
+ }
343
+
344
+ if ( !this.options.text ) {
345
+ buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
346
+
347
+ if ( !this.hasTitle ) {
348
+ buttonElement.attr( "title", buttonText );
349
+ }
350
+ }
351
+ } else {
352
+ buttonClasses.push( "ui-button-text-only" );
353
+ }
354
+ buttonElement.addClass( buttonClasses.join( " " ) );
355
+ }
356
+ });
357
+
358
+ $.widget( "ui.buttonset", {
359
+ options: {
360
+ items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)"
361
+ },
362
+
363
+ _create: function() {
364
+ this.element.addClass( "ui-buttonset" );
365
+ },
366
+
367
+ _init: function() {
368
+ this.refresh();
369
+ },
370
+
371
+ _setOption: function( key, value ) {
372
+ if ( key === "disabled" ) {
373
+ this.buttons.button( "option", key, value );
374
+ }
375
+
376
+ $.Widget.prototype._setOption.apply( this, arguments );
377
+ },
378
+
379
+ refresh: function() {
380
+ var ltr = this.element.css( "direction" ) === "ltr";
381
+
382
+ this.buttons = this.element.find( this.options.items )
383
+ .filter( ":ui-button" )
384
+ .button( "refresh" )
385
+ .end()
386
+ .not( ":ui-button" )
387
+ .button()
388
+ .end()
389
+ .map(function() {
390
+ return $( this ).button( "widget" )[ 0 ];
391
+ })
392
+ .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
393
+ .filter( ":first" )
394
+ .addClass( ltr ? "ui-corner-left" : "ui-corner-right" )
395
+ .end()
396
+ .filter( ":last" )
397
+ .addClass( ltr ? "ui-corner-right" : "ui-corner-left" )
398
+ .end()
399
+ .end();
400
+ },
401
+
402
+ destroy: function() {
403
+ this.element.removeClass( "ui-buttonset" );
404
+ this.buttons
405
+ .map(function() {
406
+ return $( this ).button( "widget" )[ 0 ];
407
+ })
408
+ .removeClass( "ui-corner-left ui-corner-right" )
409
+ .end()
410
+ .button( "destroy" );
411
+
412
+ $.Widget.prototype.destroy.call( this );
413
+ }
414
+ });
415
+
416
+ }( jQuery ) );
@@ -0,0 +1,314 @@
1
+ /*!
2
+ * jQuery UI 1.8.15
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI
9
+ */
10
+ (function( $, undefined ) {
11
+
12
+ // prevent duplicate loading
13
+ // this is only a problem because we proxy existing functions
14
+ // and we don't want to double proxy them
15
+ $.ui = $.ui || {};
16
+ if ( $.ui.version ) {
17
+ return;
18
+ }
19
+
20
+ $.extend( $.ui, {
21
+ version: "1.8.15",
22
+
23
+ keyCode: {
24
+ ALT: 18,
25
+ BACKSPACE: 8,
26
+ CAPS_LOCK: 20,
27
+ COMMA: 188,
28
+ COMMAND: 91,
29
+ COMMAND_LEFT: 91, // COMMAND
30
+ COMMAND_RIGHT: 93,
31
+ CONTROL: 17,
32
+ DELETE: 46,
33
+ DOWN: 40,
34
+ END: 35,
35
+ ENTER: 13,
36
+ ESCAPE: 27,
37
+ HOME: 36,
38
+ INSERT: 45,
39
+ LEFT: 37,
40
+ MENU: 93, // COMMAND_RIGHT
41
+ NUMPAD_ADD: 107,
42
+ NUMPAD_DECIMAL: 110,
43
+ NUMPAD_DIVIDE: 111,
44
+ NUMPAD_ENTER: 108,
45
+ NUMPAD_MULTIPLY: 106,
46
+ NUMPAD_SUBTRACT: 109,
47
+ PAGE_DOWN: 34,
48
+ PAGE_UP: 33,
49
+ PERIOD: 190,
50
+ RIGHT: 39,
51
+ SHIFT: 16,
52
+ SPACE: 32,
53
+ TAB: 9,
54
+ UP: 38,
55
+ WINDOWS: 91 // COMMAND
56
+ }
57
+ });
58
+
59
+ // plugins
60
+ $.fn.extend({
61
+ propAttr: $.fn.prop || $.fn.attr,
62
+
63
+ _focus: $.fn.focus,
64
+ focus: function( delay, fn ) {
65
+ return typeof delay === "number" ?
66
+ this.each(function() {
67
+ var elem = this;
68
+ setTimeout(function() {
69
+ $( elem ).focus();
70
+ if ( fn ) {
71
+ fn.call( elem );
72
+ }
73
+ }, delay );
74
+ }) :
75
+ this._focus.apply( this, arguments );
76
+ },
77
+
78
+ scrollParent: function() {
79
+ var scrollParent;
80
+ if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
81
+ scrollParent = this.parents().filter(function() {
82
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
83
+ }).eq(0);
84
+ } else {
85
+ scrollParent = this.parents().filter(function() {
86
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
87
+ }).eq(0);
88
+ }
89
+
90
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
91
+ },
92
+
93
+ zIndex: function( zIndex ) {
94
+ if ( zIndex !== undefined ) {
95
+ return this.css( "zIndex", zIndex );
96
+ }
97
+
98
+ if ( this.length ) {
99
+ var elem = $( this[ 0 ] ), position, value;
100
+ while ( elem.length && elem[ 0 ] !== document ) {
101
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
102
+ // This makes behavior of this function consistent across browsers
103
+ // WebKit always returns auto if the element is positioned
104
+ position = elem.css( "position" );
105
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
106
+ // IE returns 0 when zIndex is not specified
107
+ // other browsers return a string
108
+ // we ignore the case of nested elements with an explicit value of 0
109
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
110
+ value = parseInt( elem.css( "zIndex" ), 10 );
111
+ if ( !isNaN( value ) && value !== 0 ) {
112
+ return value;
113
+ }
114
+ }
115
+ elem = elem.parent();
116
+ }
117
+ }
118
+
119
+ return 0;
120
+ },
121
+
122
+ disableSelection: function() {
123
+ return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
124
+ ".ui-disableSelection", function( event ) {
125
+ event.preventDefault();
126
+ });
127
+ },
128
+
129
+ enableSelection: function() {
130
+ return this.unbind( ".ui-disableSelection" );
131
+ }
132
+ });
133
+
134
+ $.each( [ "Width", "Height" ], function( i, name ) {
135
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
136
+ type = name.toLowerCase(),
137
+ orig = {
138
+ innerWidth: $.fn.innerWidth,
139
+ innerHeight: $.fn.innerHeight,
140
+ outerWidth: $.fn.outerWidth,
141
+ outerHeight: $.fn.outerHeight
142
+ };
143
+
144
+ function reduce( elem, size, border, margin ) {
145
+ $.each( side, function() {
146
+ size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
147
+ if ( border ) {
148
+ size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
149
+ }
150
+ if ( margin ) {
151
+ size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
152
+ }
153
+ });
154
+ return size;
155
+ }
156
+
157
+ $.fn[ "inner" + name ] = function( size ) {
158
+ if ( size === undefined ) {
159
+ return orig[ "inner" + name ].call( this );
160
+ }
161
+
162
+ return this.each(function() {
163
+ $( this ).css( type, reduce( this, size ) + "px" );
164
+ });
165
+ };
166
+
167
+ $.fn[ "outer" + name] = function( size, margin ) {
168
+ if ( typeof size !== "number" ) {
169
+ return orig[ "outer" + name ].call( this, size );
170
+ }
171
+
172
+ return this.each(function() {
173
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
174
+ });
175
+ };
176
+ });
177
+
178
+ // selectors
179
+ function focusable( element, isTabIndexNotNaN ) {
180
+ var nodeName = element.nodeName.toLowerCase();
181
+ if ( "area" === nodeName ) {
182
+ var map = element.parentNode,
183
+ mapName = map.name,
184
+ img;
185
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
186
+ return false;
187
+ }
188
+ img = $( "img[usemap=#" + mapName + "]" )[0];
189
+ return !!img && visible( img );
190
+ }
191
+ return ( /input|select|textarea|button|object/.test( nodeName )
192
+ ? !element.disabled
193
+ : "a" == nodeName
194
+ ? element.href || isTabIndexNotNaN
195
+ : isTabIndexNotNaN)
196
+ // the element and all of its ancestors must be visible
197
+ && visible( element );
198
+ }
199
+
200
+ function visible( element ) {
201
+ return !$( element ).parents().andSelf().filter(function() {
202
+ return $.curCSS( this, "visibility" ) === "hidden" ||
203
+ $.expr.filters.hidden( this );
204
+ }).length;
205
+ }
206
+
207
+ $.extend( $.expr[ ":" ], {
208
+ data: function( elem, i, match ) {
209
+ return !!$.data( elem, match[ 3 ] );
210
+ },
211
+
212
+ focusable: function( element ) {
213
+ return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
214
+ },
215
+
216
+ tabbable: function( element ) {
217
+ var tabIndex = $.attr( element, "tabindex" ),
218
+ isTabIndexNaN = isNaN( tabIndex );
219
+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
220
+ }
221
+ });
222
+
223
+ // support
224
+ $(function() {
225
+ var body = document.body,
226
+ div = body.appendChild( div = document.createElement( "div" ) );
227
+
228
+ $.extend( div.style, {
229
+ minHeight: "100px",
230
+ height: "auto",
231
+ padding: 0,
232
+ borderWidth: 0
233
+ });
234
+
235
+ $.support.minHeight = div.offsetHeight === 100;
236
+ $.support.selectstart = "onselectstart" in div;
237
+
238
+ // set display to none to avoid a layout bug in IE
239
+ // http://dev.jquery.com/ticket/4014
240
+ body.removeChild( div ).style.display = "none";
241
+ });
242
+
243
+
244
+
245
+
246
+
247
+ // deprecated
248
+ $.extend( $.ui, {
249
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
250
+ plugin: {
251
+ add: function( module, option, set ) {
252
+ var proto = $.ui[ module ].prototype;
253
+ for ( var i in set ) {
254
+ proto.plugins[ i ] = proto.plugins[ i ] || [];
255
+ proto.plugins[ i ].push( [ option, set[ i ] ] );
256
+ }
257
+ },
258
+ call: function( instance, name, args ) {
259
+ var set = instance.plugins[ name ];
260
+ if ( !set || !instance.element[ 0 ].parentNode ) {
261
+ return;
262
+ }
263
+
264
+ for ( var i = 0; i < set.length; i++ ) {
265
+ if ( instance.options[ set[ i ][ 0 ] ] ) {
266
+ set[ i ][ 1 ].apply( instance.element, args );
267
+ }
268
+ }
269
+ }
270
+ },
271
+
272
+ // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
273
+ contains: function( a, b ) {
274
+ return document.compareDocumentPosition ?
275
+ a.compareDocumentPosition( b ) & 16 :
276
+ a !== b && a.contains( b );
277
+ },
278
+
279
+ // only used by resizable
280
+ hasScroll: function( el, a ) {
281
+
282
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
283
+ if ( $( el ).css( "overflow" ) === "hidden") {
284
+ return false;
285
+ }
286
+
287
+ var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
288
+ has = false;
289
+
290
+ if ( el[ scroll ] > 0 ) {
291
+ return true;
292
+ }
293
+
294
+ // TODO: determine which cases actually cause this to happen
295
+ // if the element doesn't have the scroll set, see if it's possible to
296
+ // set the scroll
297
+ el[ scroll ] = 1;
298
+ has = ( el[ scroll ] > 0 );
299
+ el[ scroll ] = 0;
300
+ return has;
301
+ },
302
+
303
+ // these are odd functions, fix the API or move into individual plugins
304
+ isOverAxis: function( x, reference, size ) {
305
+ //Determines when x coordinate is over "b" element axis
306
+ return ( x > reference ) && ( x < ( reference + size ) );
307
+ },
308
+ isOver: function( y, x, top, left, height, width ) {
309
+ //Determines when x, y coordinates is over "b" element
310
+ return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
311
+ }
312
+ });
313
+
314
+ })( jQuery );