speedo 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/speedo.js +12 -12
- data/app/views/layouts/speedo/application.html.haml +2 -2
- data/lib/speedo/sass.rb +1 -1
- data/lib/speedo/version.rb +1 -1
- data/test/dummy/log/development.log +889 -0
- data/test/dummy/tmp/cache/assets/BC8/350/sprockets%2F3357f02a74351649de62769431854154 +0 -0
- data/test/dummy/tmp/cache/assets/BFD/090/sprockets%2F50267839603d9c7384477250f0169f0e +0 -0
- data/test/dummy/tmp/cache/assets/C4F/220/sprockets%2F19a6a3539a4ed0526c356691798032a3 +0 -0
- data/test/dummy/tmp/cache/assets/C55/E10/sprockets%2F9da121566709335e3081059e7774a9bb +957 -0
- data/test/dummy/tmp/cache/assets/C5F/4E0/sprockets%2F4c17092a9c628e66645a4586e9b50717 +57 -0
- data/test/dummy/tmp/cache/assets/C82/BB0/sprockets%2F904cd2f9283528b32d94a1d2a6711489 +41 -0
- data/test/dummy/tmp/cache/assets/CDE/600/sprockets%2F205a8cce7806d7c77117f1dc263146a8 +0 -0
- data/test/dummy/tmp/cache/assets/CE0/930/sprockets%2Fb6670296cd6b3ce81034c8d5d31e5725 +8 -0
- data/test/dummy/tmp/cache/assets/CE1/3B0/sprockets%2Fe8865654d2d075e6bba1074193e443dc +350 -0
- data/test/dummy/tmp/cache/assets/CF5/F40/sprockets%2F72637ea0f394f68dcc931527509e79ec +0 -0
- data/test/dummy/tmp/cache/assets/CF9/7C0/sprockets%2F488b6dcdeb1301268a65202e7101ed2a +974 -0
- data/test/dummy/tmp/cache/assets/D0C/C60/sprockets%2F39d93fba83bb3b50a75826703c5a28c5 +311 -0
- data/test/dummy/tmp/cache/assets/D1D/D50/sprockets%2F5b87bedce3ae871f14e41e2479290866 +0 -0
- data/test/dummy/tmp/cache/assets/D2A/5C0/sprockets%2Fe12edc211b1935a76d3aab4e8716006d +394 -0
- data/test/dummy/tmp/cache/assets/D3A/090/sprockets%2F0d24039ad1b8ef3525e367fe51905fbb +11635 -0
- data/test/dummy/tmp/cache/assets/D3B/1E0/sprockets%2Fe5f2362b8b1eb8273f1a7764cbb15e35 +11618 -0
- data/test/dummy/tmp/cache/assets/D3D/F80/sprockets%2Fadfc8f7271b3a873f3462e149a6a34e0 +374 -0
- data/test/dummy/tmp/cache/assets/D3F/0A0/sprockets%2Fc4574a4ea12e8efe636123e1a17f7d66 +11773 -0
- data/test/dummy/tmp/cache/assets/D42/CB0/sprockets%2F6c01eb50fe79d82720a649960dee5dd0 +20 -0
- data/test/dummy/tmp/cache/assets/D49/2B0/sprockets%2F34363288c95affbe232a199c6938ceab +391 -0
- data/test/dummy/tmp/cache/assets/D5B/120/sprockets%2F525577d56abcec9969e805ddc2997fd0 +332 -0
- data/test/dummy/tmp/cache/assets/D65/820/sprockets%2F4e91290eae5edd2f4d287ca2952be000 +327 -0
- data/test/dummy/tmp/cache/assets/D6C/3D0/sprockets%2Fa62ebc5f479b52c204f4c71ea65594ca +55 -0
- data/test/dummy/tmp/cache/assets/D71/D90/sprockets%2F7bb9508df3d877f853823addd4b0a22b +19 -0
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/test/dummy/tmp/cache/assets/D97/830/sprockets%2Fd55ede995a2705ab74db22acf510dd90 +0 -0
- data/test/dummy/tmp/cache/assets/D9B/400/sprockets%2Fec83dc0dc78764b460a3ffc063df25e0 +11789 -0
- data/test/dummy/tmp/cache/assets/DA1/670/sprockets%2Fb71f32bbfb530e59ad7a177cf54a888b +0 -0
- data/test/dummy/tmp/cache/assets/DA8/760/sprockets%2F1359bb83c703a91d57cfebdaf879a4d7 +9288 -0
- data/test/dummy/tmp/cache/assets/DB3/C60/sprockets%2F1ff86e3b1c5bf1c179ac719fced99829 +53 -0
- data/test/dummy/tmp/cache/assets/DBE/F80/sprockets%2F8647fc3439abdaa0eb161dadf2fc4304 +694 -0
- data/test/dummy/tmp/cache/assets/DC3/CC0/sprockets%2Fa04ece65c59a7a325cab61861da2be7e +0 -0
- data/test/dummy/tmp/cache/assets/DC5/290/sprockets%2F1c5dee9b02ab66fbf6e62627a13e27ba +37 -0
- data/test/dummy/tmp/cache/assets/DE9/520/sprockets%2Fe9f8259c99da2f355198dc4bcdebb69d +0 -0
- data/test/dummy/tmp/cache/assets/DEA/500/sprockets%2F485fc5ba3f81b49ccdd788885ea8de5e +0 -0
- data/test/dummy/tmp/cache/assets/DF2/CB0/sprockets%2F4500acae993e0fa07bd48dceee07e2b3 +0 -0
- data/test/dummy/tmp/cache/assets/DF9/EB0/sprockets%2Ffcaa51a13d86ac9cf245f2a5d70c9d8c +256 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E7F/BB0/sprockets%2Ffdeefdc424a13a04addae542356dffae +678 -0
- data/test/dummy/tmp/cache/assets/E82/D20/sprockets%2Fcdce4acb88dcbeaba64a06a254a9e09f +0 -0
- metadata +192 -88
- /data/vendor/assets/javascripts/{chosen.jquery.js → speedo/chosen.jquery.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.autoSuggest.js → speedo/jquery.autoSuggest.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.autogrow.js → speedo/jquery.autogrow.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.dataTables.js → speedo/jquery.dataTables.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.livequery.js → speedo/jquery.livequery.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.mousewheel-3.0.4.pack.js → speedo/jquery.mousewheel-3.0.4.pack.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.placeholder.min.js → speedo/jquery.placeholder.min.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.spin.js → speedo/jquery.spin.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.timeago.js → speedo/jquery.timeago.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.tools.min.js → speedo/jquery.tools.min.js} +0 -0
- /data/vendor/assets/javascripts/{jquery.uniform.js → speedo/jquery.uniform.js} +0 -0
- /data/vendor/assets/javascripts/{modernizr.min.js → speedo/modernizr.min.js} +0 -0
- /data/vendor/assets/javascripts/{respond.js → speedo/respond.js} +0 -0
- /data/vendor/assets/javascripts/{spin.js → speedo/spin.js} +0 -0
- /data/vendor/assets/stylesheets/{autoSuggest.css → speedo/autoSuggest.css} +0 -0
- /data/vendor/assets/stylesheets/{chosen-sprite.png → speedo/chosen-sprite.png} +0 -0
- /data/vendor/assets/stylesheets/{chosen.css → speedo/chosen.css} +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/Sorting icons.psd +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/back_disabled.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/back_enabled.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/back_enabled_hover.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/favicon.ico +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/forward_disabled.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/forward_enabled.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/forward_enabled_hover.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/sort_asc.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/sort_asc_disabled.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/sort_both.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/sort_desc.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/sort_desc_disabled.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-bg_glass_65_ffffff_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-bg_glass_75_dadada_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-bg_glass_75_ffffff_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-icons_222222_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-icons_2e83ff_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-icons_454545_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-icons_888888_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{dataTables → speedo/dataTables}/ui-icons_cd0a0a_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{formtastic-buttonless.css → speedo/formtastic-buttonless.css} +0 -0
- /data/vendor/assets/stylesheets/{gh-buttons.css → speedo/gh-buttons.css} +0 -0
- /data/vendor/assets/stylesheets/{gh-icons.png → speedo/gh-icons.png} +0 -0
- /data/vendor/assets/stylesheets/{jquery-ui-1.8.18.custom.css → speedo/jquery-ui-1.8.18.custom.css} +0 -0
- /data/vendor/assets/stylesheets/{jquery.dataTables.css → speedo/jquery.dataTables.css} +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-bg_glass_65_ffffff_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-bg_glass_75_dadada_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-bg_glass_75_ffffff_1x400.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-icons_222222_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-icons_2e83ff_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-icons_454545_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-icons_888888_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{jqueryui → speedo/jqueryui}/ui-icons_cd0a0a_256x240.png +0 -0
- /data/vendor/assets/stylesheets/{normalize.css → speedo/normalize.css} +0 -0
- /data/vendor/assets/stylesheets/{uniform → speedo/uniform}/bg-input-focus.png +0 -0
- /data/vendor/assets/stylesheets/{uniform → speedo/uniform}/bg-input.png +0 -0
- /data/vendor/assets/stylesheets/{uniform → speedo/uniform}/sprite-aristo.png +0 -0
- /data/vendor/assets/stylesheets/{uniform → speedo/uniform}/sprite.png +0 -0
- /data/vendor/assets/stylesheets/{uniform.default.css → speedo/uniform.default.css} +0 -0
@@ -0,0 +1,678 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1339771360.157384:@value{ I"length:EFi�LI"digest;
|
2
|
+
F"%b4b1f9449a301e14df9fcec42e34f2edI"source;
|
3
|
+
FI"�L/*
|
4
|
+
|
5
|
+
Uniform v1.7.5
|
6
|
+
Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC
|
7
|
+
http://pixelmatrixdesign.com
|
8
|
+
|
9
|
+
Requires jQuery 1.4 or newer
|
10
|
+
|
11
|
+
Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on this
|
12
|
+
|
13
|
+
Disabling text selection is made possible by Mathias Bynens <http://mathiasbynens.be/>
|
14
|
+
and his noSelect plugin. <http://github.com/mathiasbynens/noSelect-jQuery-Plugin>
|
15
|
+
|
16
|
+
Also, thanks to David Kaneda and Eugene Bond for their contributions to the plugin
|
17
|
+
|
18
|
+
License:
|
19
|
+
MIT License - http://www.opensource.org/licenses/mit-license.php
|
20
|
+
|
21
|
+
Enjoy!
|
22
|
+
|
23
|
+
*/
|
24
|
+
|
25
|
+
|
26
|
+
(function($) {
|
27
|
+
$.uniform = {
|
28
|
+
options: {
|
29
|
+
selectClass: 'uni-selector',
|
30
|
+
radioClass: 'uni-radio',
|
31
|
+
checkboxClass: 'uni-checker',
|
32
|
+
fileClass: 'uni-uploader',
|
33
|
+
filenameClass: 'uni-filename',
|
34
|
+
fileBtnClass: 'uni-action',
|
35
|
+
fileDefaultText: 'No file selected',
|
36
|
+
fileBtnText: 'Choose File',
|
37
|
+
checkedClass: 'uni-checked',
|
38
|
+
focusClass: 'uni-focus',
|
39
|
+
disabledClass: 'uni-disabled',
|
40
|
+
buttonClass: 'uni-button',
|
41
|
+
activeClass: 'uni-active',
|
42
|
+
hoverClass: 'uni-hover',
|
43
|
+
useID: true,
|
44
|
+
idPrefix: 'uniform',
|
45
|
+
resetSelector: false,
|
46
|
+
autoHide: true
|
47
|
+
},
|
48
|
+
elements: []
|
49
|
+
};
|
50
|
+
|
51
|
+
if($.browser.msie && $.browser.version < 7){
|
52
|
+
$.support.selectOpacity = false;
|
53
|
+
}else{
|
54
|
+
$.support.selectOpacity = true;
|
55
|
+
}
|
56
|
+
|
57
|
+
$.fn.uniform = function(options) {
|
58
|
+
|
59
|
+
options = $.extend($.uniform.options, options);
|
60
|
+
|
61
|
+
var el = this;
|
62
|
+
//code for specifying a reset button
|
63
|
+
if(options.resetSelector != false){
|
64
|
+
$(options.resetSelector).mouseup(function(){
|
65
|
+
function resetThis(){
|
66
|
+
$.uniform.update(el);
|
67
|
+
}
|
68
|
+
setTimeout(resetThis, 10);
|
69
|
+
});
|
70
|
+
}
|
71
|
+
|
72
|
+
function doInput(elem){
|
73
|
+
$el = $(elem);
|
74
|
+
$el.addClass($el.attr("type"));
|
75
|
+
storeElement(elem);
|
76
|
+
}
|
77
|
+
|
78
|
+
function doTextarea(elem){
|
79
|
+
$(elem).addClass("uniform");
|
80
|
+
storeElement(elem);
|
81
|
+
}
|
82
|
+
|
83
|
+
function doButton(elem){
|
84
|
+
var $el = $(elem);
|
85
|
+
|
86
|
+
var divTag = $("<div>"),
|
87
|
+
spanTag = $("<span>");
|
88
|
+
|
89
|
+
divTag.addClass(options.buttonClass);
|
90
|
+
|
91
|
+
if(options.useID && $el.attr("id") != "") divTag.attr("id", options.idPrefix+"-"+$el.attr("id"));
|
92
|
+
|
93
|
+
var btnText;
|
94
|
+
|
95
|
+
if($el.is("a") || $el.is("button")){
|
96
|
+
btnText = $el.text();
|
97
|
+
}else if($el.is(":submit") || $el.is(":reset") || $el.is("input[type=button]")){
|
98
|
+
btnText = $el.attr("value");
|
99
|
+
}
|
100
|
+
|
101
|
+
btnText = btnText == "" ? $el.is(":reset") ? "Reset" : "Submit" : btnText;
|
102
|
+
|
103
|
+
spanTag.html(btnText);
|
104
|
+
|
105
|
+
$el.css("opacity", 0);
|
106
|
+
$el.wrap(divTag);
|
107
|
+
$el.wrap(spanTag);
|
108
|
+
|
109
|
+
//redefine variables
|
110
|
+
divTag = $el.closest("div");
|
111
|
+
spanTag = $el.closest("span");
|
112
|
+
|
113
|
+
if($el.is(":disabled")) divTag.addClass(options.disabledClass);
|
114
|
+
|
115
|
+
divTag.bind({
|
116
|
+
"mouseenter.uniform": function(){
|
117
|
+
divTag.addClass(options.hoverClass);
|
118
|
+
},
|
119
|
+
"mouseleave.uniform": function(){
|
120
|
+
divTag.removeClass(options.hoverClass);
|
121
|
+
divTag.removeClass(options.activeClass);
|
122
|
+
},
|
123
|
+
"mousedown.uniform touchbegin.uniform": function(){
|
124
|
+
divTag.addClass(options.activeClass);
|
125
|
+
},
|
126
|
+
"mouseup.uniform touchend.uniform": function(){
|
127
|
+
divTag.removeClass(options.activeClass);
|
128
|
+
},
|
129
|
+
"click.uniform touchend.uniform": function(e){
|
130
|
+
if($(e.target).is("span") || $(e.target).is("div")){
|
131
|
+
if(elem[0].dispatchEvent){
|
132
|
+
var ev = document.createEvent('MouseEvents');
|
133
|
+
ev.initEvent( 'click', true, true );
|
134
|
+
elem[0].dispatchEvent(ev);
|
135
|
+
}else{
|
136
|
+
elem[0].click();
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
});
|
141
|
+
|
142
|
+
elem.bind({
|
143
|
+
"focus.uniform": function(){
|
144
|
+
divTag.addClass(options.focusClass);
|
145
|
+
},
|
146
|
+
"blur.uniform": function(){
|
147
|
+
divTag.removeClass(options.focusClass);
|
148
|
+
}
|
149
|
+
});
|
150
|
+
|
151
|
+
$.uniform.noSelect(divTag);
|
152
|
+
storeElement(elem);
|
153
|
+
|
154
|
+
}
|
155
|
+
|
156
|
+
function doSelect(elem){
|
157
|
+
var $el = $(elem);
|
158
|
+
|
159
|
+
var divTag = $('<div />'),
|
160
|
+
spanTag = $('<span />');
|
161
|
+
|
162
|
+
if(!$el.css("display") == "none" && options.autoHide){
|
163
|
+
divTag.hide();
|
164
|
+
}
|
165
|
+
|
166
|
+
divTag.addClass(options.selectClass);
|
167
|
+
|
168
|
+
if(options.useID && elem.attr("id") != ""){
|
169
|
+
divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
|
170
|
+
}
|
171
|
+
|
172
|
+
var selected = elem.find(":selected:first");
|
173
|
+
if(selected.length == 0){
|
174
|
+
selected = elem.find("option:first");
|
175
|
+
}
|
176
|
+
spanTag.html(selected.html());
|
177
|
+
|
178
|
+
elem.css('opacity', 0);
|
179
|
+
elem.wrap(divTag);
|
180
|
+
elem.before(spanTag);
|
181
|
+
|
182
|
+
//redefine variables
|
183
|
+
divTag = elem.parent("div");
|
184
|
+
spanTag = elem.siblings("span");
|
185
|
+
|
186
|
+
elem.bind({
|
187
|
+
"change.uniform": function() {
|
188
|
+
spanTag.text(elem.find(":selected").html());
|
189
|
+
divTag.removeClass(options.activeClass);
|
190
|
+
},
|
191
|
+
"focus.uniform": function() {
|
192
|
+
divTag.addClass(options.focusClass);
|
193
|
+
},
|
194
|
+
"blur.uniform": function() {
|
195
|
+
divTag.removeClass(options.focusClass);
|
196
|
+
divTag.removeClass(options.activeClass);
|
197
|
+
},
|
198
|
+
"mousedown.uniform touchbegin.uniform": function() {
|
199
|
+
divTag.addClass(options.activeClass);
|
200
|
+
},
|
201
|
+
"mouseup.uniform touchend.uniform": function() {
|
202
|
+
divTag.removeClass(options.activeClass);
|
203
|
+
},
|
204
|
+
"click.uniform touchend.uniform": function(){
|
205
|
+
divTag.removeClass(options.activeClass);
|
206
|
+
},
|
207
|
+
"mouseenter.uniform": function() {
|
208
|
+
divTag.addClass(options.hoverClass);
|
209
|
+
},
|
210
|
+
"mouseleave.uniform": function() {
|
211
|
+
divTag.removeClass(options.hoverClass);
|
212
|
+
divTag.removeClass(options.activeClass);
|
213
|
+
},
|
214
|
+
"keyup.uniform": function(){
|
215
|
+
spanTag.text(elem.find(":selected").html());
|
216
|
+
}
|
217
|
+
});
|
218
|
+
|
219
|
+
//handle disabled state
|
220
|
+
if($(elem).attr("disabled")){
|
221
|
+
//box is checked by default, check our box
|
222
|
+
divTag.addClass(options.disabledClass);
|
223
|
+
}
|
224
|
+
$.uniform.noSelect(spanTag);
|
225
|
+
|
226
|
+
storeElement(elem);
|
227
|
+
|
228
|
+
}
|
229
|
+
|
230
|
+
function doCheckbox(elem){
|
231
|
+
var $el = $(elem);
|
232
|
+
|
233
|
+
var divTag = $('<div />'),
|
234
|
+
spanTag = $('<span />');
|
235
|
+
|
236
|
+
if(!$el.css("display") == "none" && options.autoHide){
|
237
|
+
divTag.hide();
|
238
|
+
}
|
239
|
+
|
240
|
+
divTag.addClass(options.checkboxClass);
|
241
|
+
|
242
|
+
//assign the id of the element
|
243
|
+
if(options.useID && elem.attr("id") != ""){
|
244
|
+
divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
|
245
|
+
}
|
246
|
+
|
247
|
+
//wrap with the proper elements
|
248
|
+
$(elem).wrap(divTag);
|
249
|
+
$(elem).wrap(spanTag);
|
250
|
+
|
251
|
+
//redefine variables
|
252
|
+
spanTag = elem.parent();
|
253
|
+
divTag = spanTag.parent();
|
254
|
+
|
255
|
+
//hide normal input and add focus classes
|
256
|
+
$(elem)
|
257
|
+
.css("opacity", 0)
|
258
|
+
.bind({
|
259
|
+
"focus.uniform": function(){
|
260
|
+
divTag.addClass(options.focusClass);
|
261
|
+
},
|
262
|
+
"blur.uniform": function(){
|
263
|
+
divTag.removeClass(options.focusClass);
|
264
|
+
},
|
265
|
+
"click.uniform touchend.uniform": function(){
|
266
|
+
if(!$(elem).attr("checked")){
|
267
|
+
//box was just unchecked, uncheck span
|
268
|
+
spanTag.removeClass(options.checkedClass);
|
269
|
+
}else{
|
270
|
+
//box was just checked, check span.
|
271
|
+
spanTag.addClass(options.checkedClass);
|
272
|
+
}
|
273
|
+
},
|
274
|
+
"mousedown.uniform touchbegin.uniform": function() {
|
275
|
+
divTag.addClass(options.activeClass);
|
276
|
+
},
|
277
|
+
"mouseup.uniform touchend.uniform": function() {
|
278
|
+
divTag.removeClass(options.activeClass);
|
279
|
+
},
|
280
|
+
"mouseenter.uniform": function() {
|
281
|
+
divTag.addClass(options.hoverClass);
|
282
|
+
},
|
283
|
+
"mouseleave.uniform": function() {
|
284
|
+
divTag.removeClass(options.hoverClass);
|
285
|
+
divTag.removeClass(options.activeClass);
|
286
|
+
}
|
287
|
+
});
|
288
|
+
|
289
|
+
//handle defaults
|
290
|
+
if($(elem).attr("checked")){
|
291
|
+
//box is checked by default, check our box
|
292
|
+
spanTag.addClass(options.checkedClass);
|
293
|
+
}
|
294
|
+
|
295
|
+
//handle disabled state
|
296
|
+
if($(elem).attr("disabled")){
|
297
|
+
//box is checked by default, check our box
|
298
|
+
divTag.addClass(options.disabledClass);
|
299
|
+
}
|
300
|
+
|
301
|
+
storeElement(elem);
|
302
|
+
}
|
303
|
+
|
304
|
+
function doRadio(elem){
|
305
|
+
var $el = $(elem);
|
306
|
+
|
307
|
+
var divTag = $('<div />'),
|
308
|
+
spanTag = $('<span />');
|
309
|
+
|
310
|
+
if(!$el.css("display") == "none" && options.autoHide){
|
311
|
+
divTag.hide();
|
312
|
+
}
|
313
|
+
|
314
|
+
divTag.addClass(options.radioClass);
|
315
|
+
|
316
|
+
if(options.useID && elem.attr("id") != ""){
|
317
|
+
divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
|
318
|
+
}
|
319
|
+
|
320
|
+
//wrap with the proper elements
|
321
|
+
$(elem).wrap(divTag);
|
322
|
+
$(elem).wrap(spanTag);
|
323
|
+
|
324
|
+
//redefine variables
|
325
|
+
spanTag = elem.parent();
|
326
|
+
divTag = spanTag.parent();
|
327
|
+
|
328
|
+
//hide normal input and add focus classes
|
329
|
+
$(elem)
|
330
|
+
.css("opacity", 0)
|
331
|
+
.bind({
|
332
|
+
"focus.uniform": function(){
|
333
|
+
divTag.addClass(options.focusClass);
|
334
|
+
},
|
335
|
+
"blur.uniform": function(){
|
336
|
+
divTag.removeClass(options.focusClass);
|
337
|
+
},
|
338
|
+
"click.uniform touchend.uniform": function(){
|
339
|
+
if(!$(elem).attr("checked")){
|
340
|
+
//box was just unchecked, uncheck span
|
341
|
+
spanTag.removeClass(options.checkedClass);
|
342
|
+
}else{
|
343
|
+
//box was just checked, check span
|
344
|
+
var classes = options.radioClass.split(" ")[0];
|
345
|
+
$("." + classes + " span." + options.checkedClass + ":has([name='" + $(elem).attr('name') + "'])").removeClass(options.checkedClass);
|
346
|
+
spanTag.addClass(options.checkedClass);
|
347
|
+
}
|
348
|
+
},
|
349
|
+
"mousedown.uniform touchend.uniform": function() {
|
350
|
+
if(!$(elem).is(":disabled")){
|
351
|
+
divTag.addClass(options.activeClass);
|
352
|
+
}
|
353
|
+
},
|
354
|
+
"mouseup.uniform touchbegin.uniform": function() {
|
355
|
+
divTag.removeClass(options.activeClass);
|
356
|
+
},
|
357
|
+
"mouseenter.uniform touchend.uniform": function() {
|
358
|
+
divTag.addClass(options.hoverClass);
|
359
|
+
},
|
360
|
+
"mouseleave.uniform": function() {
|
361
|
+
divTag.removeClass(options.hoverClass);
|
362
|
+
divTag.removeClass(options.activeClass);
|
363
|
+
}
|
364
|
+
});
|
365
|
+
|
366
|
+
//handle defaults
|
367
|
+
if($(elem).attr("checked")){
|
368
|
+
//box is checked by default, check span
|
369
|
+
spanTag.addClass(options.checkedClass);
|
370
|
+
}
|
371
|
+
//handle disabled state
|
372
|
+
if($(elem).attr("disabled")){
|
373
|
+
//box is checked by default, check our box
|
374
|
+
divTag.addClass(options.disabledClass);
|
375
|
+
}
|
376
|
+
|
377
|
+
storeElement(elem);
|
378
|
+
|
379
|
+
}
|
380
|
+
|
381
|
+
function doFile(elem){
|
382
|
+
//sanitize input
|
383
|
+
var $el = $(elem);
|
384
|
+
|
385
|
+
var divTag = $('<div />'),
|
386
|
+
filenameTag = $('<span>'+options.fileDefaultText+'</span>'),
|
387
|
+
btnTag = $('<span>'+options.fileBtnText+'</span>');
|
388
|
+
|
389
|
+
if(!$el.css("display") == "none" && options.autoHide){
|
390
|
+
divTag.hide();
|
391
|
+
}
|
392
|
+
|
393
|
+
divTag.addClass(options.fileClass);
|
394
|
+
filenameTag.addClass(options.filenameClass);
|
395
|
+
btnTag.addClass(options.fileBtnClass);
|
396
|
+
|
397
|
+
if(options.useID && $el.attr("id") != ""){
|
398
|
+
divTag.attr("id", options.idPrefix+"-"+$el.attr("id"));
|
399
|
+
}
|
400
|
+
|
401
|
+
//wrap with the proper elements
|
402
|
+
$el.wrap(divTag);
|
403
|
+
$el.after(btnTag);
|
404
|
+
$el.after(filenameTag);
|
405
|
+
|
406
|
+
//redefine variables
|
407
|
+
divTag = $el.closest("div");
|
408
|
+
filenameTag = $el.siblings("."+options.filenameClass);
|
409
|
+
btnTag = $el.siblings("."+options.fileBtnClass);
|
410
|
+
|
411
|
+
//set the size
|
412
|
+
if(!$el.attr("size")){
|
413
|
+
var divWidth = divTag.width();
|
414
|
+
//$el.css("width", divWidth);
|
415
|
+
$el.attr("size", divWidth/10);
|
416
|
+
}
|
417
|
+
|
418
|
+
//actions
|
419
|
+
var setFilename = function()
|
420
|
+
{
|
421
|
+
var filename = $el.val();
|
422
|
+
if (filename === '')
|
423
|
+
{
|
424
|
+
filename = options.fileDefaultText;
|
425
|
+
}
|
426
|
+
else
|
427
|
+
{
|
428
|
+
filename = filename.split(/[\/\\]+/);
|
429
|
+
filename = filename[(filename.length-1)];
|
430
|
+
}
|
431
|
+
filenameTag.text(filename);
|
432
|
+
};
|
433
|
+
|
434
|
+
// Account for input saved across refreshes
|
435
|
+
setFilename();
|
436
|
+
|
437
|
+
$el
|
438
|
+
.css("opacity", 0)
|
439
|
+
.bind({
|
440
|
+
"focus.uniform": function(){
|
441
|
+
divTag.addClass(options.focusClass);
|
442
|
+
},
|
443
|
+
"blur.uniform": function(){
|
444
|
+
divTag.removeClass(options.focusClass);
|
445
|
+
},
|
446
|
+
"mousedown.uniform": function() {
|
447
|
+
if(!$(elem).is(":disabled")){
|
448
|
+
divTag.addClass(options.activeClass);
|
449
|
+
}
|
450
|
+
},
|
451
|
+
"mouseup.uniform": function() {
|
452
|
+
divTag.removeClass(options.activeClass);
|
453
|
+
},
|
454
|
+
"mouseenter.uniform": function() {
|
455
|
+
divTag.addClass(options.hoverClass);
|
456
|
+
},
|
457
|
+
"mouseleave.uniform": function() {
|
458
|
+
divTag.removeClass(options.hoverClass);
|
459
|
+
divTag.removeClass(options.activeClass);
|
460
|
+
}
|
461
|
+
});
|
462
|
+
|
463
|
+
// IE7 doesn't fire onChange until blur or second fire.
|
464
|
+
if ($.browser.msie){
|
465
|
+
// IE considers browser chrome blocking I/O, so it
|
466
|
+
// suspends tiemouts until after the file has been selected.
|
467
|
+
$el.bind('click.uniform.ie7', function() {
|
468
|
+
setTimeout(setFilename, 0);
|
469
|
+
});
|
470
|
+
}else{
|
471
|
+
// All other browsers behave properly
|
472
|
+
$el.bind('change.uniform', setFilename);
|
473
|
+
}
|
474
|
+
|
475
|
+
//handle defaults
|
476
|
+
if($el.attr("disabled")){
|
477
|
+
//box is checked by default, check our box
|
478
|
+
divTag.addClass(options.disabledClass);
|
479
|
+
}
|
480
|
+
|
481
|
+
$.uniform.noSelect(filenameTag);
|
482
|
+
$.uniform.noSelect(btnTag);
|
483
|
+
|
484
|
+
storeElement(elem);
|
485
|
+
|
486
|
+
}
|
487
|
+
|
488
|
+
$.uniform.restore = function(elem){
|
489
|
+
if(elem == undefined){
|
490
|
+
elem = $($.uniform.elements);
|
491
|
+
}
|
492
|
+
|
493
|
+
$(elem).each(function(){
|
494
|
+
if($(this).is(":checkbox")){
|
495
|
+
//unwrap from span and div
|
496
|
+
$(this).unwrap().unwrap();
|
497
|
+
}else if($(this).is("select")){
|
498
|
+
//remove sibling span
|
499
|
+
$(this).siblings("span").remove();
|
500
|
+
//unwrap parent div
|
501
|
+
$(this).unwrap();
|
502
|
+
}else if($(this).is(":radio")){
|
503
|
+
//unwrap from span and div
|
504
|
+
$(this).unwrap().unwrap();
|
505
|
+
}else if($(this).is(":file")){
|
506
|
+
//remove sibling spans
|
507
|
+
$(this).siblings("span").remove();
|
508
|
+
//unwrap parent div
|
509
|
+
$(this).unwrap();
|
510
|
+
}else if($(this).is("button, :submit, :reset, a, input[type='button']")){
|
511
|
+
//unwrap from span and div
|
512
|
+
$(this).unwrap().unwrap();
|
513
|
+
}
|
514
|
+
|
515
|
+
//unbind events
|
516
|
+
$(this).unbind(".uniform");
|
517
|
+
|
518
|
+
//reset inline style
|
519
|
+
$(this).css("opacity", "1");
|
520
|
+
|
521
|
+
//remove item from list of uniformed elements
|
522
|
+
var index = $.inArray($(elem), $.uniform.elements);
|
523
|
+
$.uniform.elements.splice(index, 1);
|
524
|
+
});
|
525
|
+
};
|
526
|
+
|
527
|
+
function storeElement(elem){
|
528
|
+
//store this element in our global array
|
529
|
+
elem = $(elem).get();
|
530
|
+
if(elem.length > 1){
|
531
|
+
$.each(elem, function(i, val){
|
532
|
+
$.uniform.elements.push(val);
|
533
|
+
});
|
534
|
+
}else{
|
535
|
+
$.uniform.elements.push(elem);
|
536
|
+
}
|
537
|
+
}
|
538
|
+
|
539
|
+
//noSelect v1.0
|
540
|
+
$.uniform.noSelect = function(elem) {
|
541
|
+
function f() {
|
542
|
+
return false;
|
543
|
+
};
|
544
|
+
$(elem).each(function() {
|
545
|
+
this.onselectstart = this.ondragstart = f; // Webkit & IE
|
546
|
+
$(this)
|
547
|
+
.mousedown(f) // Webkit & Opera
|
548
|
+
.css({ MozUserSelect: 'none' }); // Firefox
|
549
|
+
});
|
550
|
+
};
|
551
|
+
|
552
|
+
$.uniform.update = function(elem){
|
553
|
+
if(elem == undefined){
|
554
|
+
elem = $($.uniform.elements);
|
555
|
+
}
|
556
|
+
//sanitize input
|
557
|
+
elem = $(elem);
|
558
|
+
|
559
|
+
elem.each(function(){
|
560
|
+
//do to each item in the selector
|
561
|
+
//function to reset all classes
|
562
|
+
var $e = $(this);
|
563
|
+
|
564
|
+
if($e.is("select")){
|
565
|
+
//element is a select
|
566
|
+
var spanTag = $e.siblings("span");
|
567
|
+
var divTag = $e.parent("div");
|
568
|
+
|
569
|
+
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
|
570
|
+
|
571
|
+
//reset current selected text
|
572
|
+
spanTag.html($e.find(":selected").html());
|
573
|
+
|
574
|
+
if($e.is(":disabled")){
|
575
|
+
divTag.addClass(options.disabledClass);
|
576
|
+
}else{
|
577
|
+
divTag.removeClass(options.disabledClass);
|
578
|
+
}
|
579
|
+
|
580
|
+
}else if($e.is(":checkbox")){
|
581
|
+
//element is a checkbox
|
582
|
+
var spanTag = $e.closest("span");
|
583
|
+
var divTag = $e.closest("div");
|
584
|
+
|
585
|
+
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
|
586
|
+
spanTag.removeClass(options.checkedClass);
|
587
|
+
|
588
|
+
if($e.is(":checked")){
|
589
|
+
spanTag.addClass(options.checkedClass);
|
590
|
+
}
|
591
|
+
if($e.is(":disabled")){
|
592
|
+
divTag.addClass(options.disabledClass);
|
593
|
+
}else{
|
594
|
+
divTag.removeClass(options.disabledClass);
|
595
|
+
}
|
596
|
+
|
597
|
+
}else if($e.is(":radio")){
|
598
|
+
//element is a radio
|
599
|
+
var spanTag = $e.closest("span");
|
600
|
+
var divTag = $e.closest("div");
|
601
|
+
|
602
|
+
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
|
603
|
+
spanTag.removeClass(options.checkedClass);
|
604
|
+
|
605
|
+
if($e.is(":checked")){
|
606
|
+
spanTag.addClass(options.checkedClass);
|
607
|
+
}
|
608
|
+
|
609
|
+
if($e.is(":disabled")){
|
610
|
+
divTag.addClass(options.disabledClass);
|
611
|
+
}else{
|
612
|
+
divTag.removeClass(options.disabledClass);
|
613
|
+
}
|
614
|
+
}else if($e.is(":file")){
|
615
|
+
var divTag = $e.parent("div");
|
616
|
+
var filenameTag = $e.siblings(options.filenameClass);
|
617
|
+
btnTag = $e.siblings(options.fileBtnClass);
|
618
|
+
|
619
|
+
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
|
620
|
+
|
621
|
+
filenameTag.text($e.val());
|
622
|
+
|
623
|
+
if($e.is(":disabled")){
|
624
|
+
divTag.addClass(options.disabledClass);
|
625
|
+
}else{
|
626
|
+
divTag.removeClass(options.disabledClass);
|
627
|
+
}
|
628
|
+
}else if($e.is(":submit") || $e.is(":reset") || $e.is("button") || $e.is("a") || elem.is("input[type=button]")){
|
629
|
+
var divTag = $e.closest("div");
|
630
|
+
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
|
631
|
+
|
632
|
+
if($e.is(":disabled")){
|
633
|
+
divTag.addClass(options.disabledClass);
|
634
|
+
}else{
|
635
|
+
divTag.removeClass(options.disabledClass);
|
636
|
+
}
|
637
|
+
|
638
|
+
}
|
639
|
+
|
640
|
+
});
|
641
|
+
};
|
642
|
+
|
643
|
+
return this.each(function() {
|
644
|
+
if($.support.selectOpacity){
|
645
|
+
var elem = $(this);
|
646
|
+
|
647
|
+
if(elem.is("select")){
|
648
|
+
//element is a select
|
649
|
+
if(elem.attr("multiple") != true){
|
650
|
+
//element is not a multi-select
|
651
|
+
if(elem.attr("size") == undefined || elem.attr("size") <= 1){
|
652
|
+
doSelect(elem);
|
653
|
+
}
|
654
|
+
}
|
655
|
+
}else if(elem.is(":checkbox")){
|
656
|
+
//element is a checkbox
|
657
|
+
doCheckbox(elem);
|
658
|
+
}else if(elem.is(":radio")){
|
659
|
+
//element is a radio
|
660
|
+
doRadio(elem);
|
661
|
+
}else if(elem.is(":file")){
|
662
|
+
//element is a file upload
|
663
|
+
doFile(elem);
|
664
|
+
}else if(elem.is(":text, :password, input[type='email']")){
|
665
|
+
doInput(elem);
|
666
|
+
}else if(elem.is("textarea")){
|
667
|
+
doTextarea(elem);
|
668
|
+
}else if(elem.is("a") || elem.is(":submit") || elem.is(":reset") || elem.is("button") || elem.is("input[type=button]")){
|
669
|
+
doButton(elem);
|
670
|
+
}
|
671
|
+
|
672
|
+
}
|
673
|
+
});
|
674
|
+
};
|
675
|
+
})(jQuery);
|
676
|
+
;
|
677
|
+
TI"
|
678
|
+
F"%5c314c432c0e5a1786975f73981811da
|