Revision f932b578
b/snf-astakos-app/astakos/im/static/im/css/modules.css | ||
---|---|---|
389 | 389 |
form.quotas-form legend span.info span { width:400px; } |
390 | 390 |
.quotas-form .with-checkbox+.with-checkbox { width:196px; } |
391 | 391 |
|
392 |
.quotas-form .radios label { font-size:1.077em; } |
|
393 |
.quotas-form .radios .radio-wrap label { width:auto; margin-right:11px;} |
|
394 |
.quotas-form .radios .radio-wrap>.radio { float:left; margin:10px 10px 0 0; } |
|
395 |
.quotas-form .radios input[type="text"] { width:60px; margin:9px 15px -9px; padding:6px; display:none;} |
|
396 |
|
|
392 | 397 |
/* stats */ |
393 | 398 |
.stats ul { margin:0; padding:0; list-style:none outside none; } |
394 | 399 |
.stats ul li { margin:0 0 1em 0; padding:0 0 1em 0; list-style:none outside none; background:url(../images/stats-line.jpg) repeat-x left bottom} |
b/snf-astakos-app/astakos/im/static/im/css/uniform.default.css | ||
---|---|---|
1 |
/* |
|
2 |
|
|
3 |
Uniform Theme: Uniform Default |
|
4 |
Version: 1.6 |
|
5 |
By: Josh Pyles |
|
6 |
License: MIT License |
|
7 |
--- |
|
8 |
For use with the Uniform plugin: |
|
9 |
http://pixelmatrixdesign.com/uniform/ |
|
10 |
--- |
|
11 |
Generated by Uniform Theme Generator: |
|
12 |
http://pixelmatrixdesign.com/uniform/themer.html |
|
13 |
|
|
14 |
*/ |
|
15 |
|
|
16 |
/* Global Declaration */ |
|
17 |
|
|
18 |
div.selector, |
|
19 |
div.selector span, |
|
20 |
div.checker span, |
|
21 |
div.radio span, |
|
22 |
div.uploader, |
|
23 |
div.uploader span.action, |
|
24 |
div.button, |
|
25 |
div.button span { |
|
26 |
background-image: url(../images/sprite.png); |
|
27 |
background-repeat: no-repeat; |
|
28 |
-webkit-font-smoothing: antialiased; |
|
29 |
} |
|
30 |
|
|
31 |
.selector, |
|
32 |
.radio, |
|
33 |
.checker, |
|
34 |
.uploader, |
|
35 |
.button, |
|
36 |
.selector *, |
|
37 |
.radio *, |
|
38 |
.checker *, |
|
39 |
.uploader *, |
|
40 |
.button *{ |
|
41 |
margin: 0; |
|
42 |
padding: 0; |
|
43 |
} |
|
44 |
|
|
45 |
/* INPUT & TEXTAREA */ |
|
46 |
|
|
47 |
input.text, |
|
48 |
input.email, |
|
49 |
input.password, |
|
50 |
textarea.uniform { |
|
51 |
font-size: 12px; |
|
52 |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; |
|
53 |
font-weight: normal; |
|
54 |
padding: 3px; |
|
55 |
color: #777; |
|
56 |
background: url('../images/bg-input-focus.png') repeat-x 0px 0px; |
|
57 |
background: url('../images/bg-input.png') repeat-x 0px 0px; |
|
58 |
border-top: solid 1px #aaa; |
|
59 |
border-left: solid 1px #aaa; |
|
60 |
border-bottom: solid 1px #ccc; |
|
61 |
border-right: solid 1px #ccc; |
|
62 |
-webkit-border-radius: 3px; |
|
63 |
-moz-border-radius: 3px; |
|
64 |
border-radius: 3px; |
|
65 |
outline: 0; |
|
66 |
} |
|
67 |
|
|
68 |
input.text:focus, |
|
69 |
input.email:focus, |
|
70 |
input.password:focus, |
|
71 |
textarea.uniform:focus { |
|
72 |
-webkit-box-shadow: 0px 0px 4px rgba(0,0,0,0.3); |
|
73 |
-moz-box-shadow: 0px 0px 4px rgba(0,0,0,0.3); |
|
74 |
box-shadow: 0px 0px 4px rgba(0,0,0,0.3); |
|
75 |
border-color: #999; |
|
76 |
background: url('../images/bg-input-focus.png') repeat-x 0px 0px; |
|
77 |
} |
|
78 |
|
|
79 |
/* SPRITES */ |
|
80 |
|
|
81 |
/* Select */ |
|
82 |
|
|
83 |
div.selector { |
|
84 |
background-position: -483px -130px; |
|
85 |
line-height: 26px; |
|
86 |
height: 26px; |
|
87 |
} |
|
88 |
|
|
89 |
div.selector span { |
|
90 |
background-position: right 0px; |
|
91 |
height: 26px; |
|
92 |
line-height: 26px; |
|
93 |
} |
|
94 |
|
|
95 |
div.selector select { |
|
96 |
/* change these to adjust positioning of select element */ |
|
97 |
top: 0px; |
|
98 |
left: 0px; |
|
99 |
} |
|
100 |
|
|
101 |
div.selector:active, |
|
102 |
div.selector.active { |
|
103 |
background-position: -483px -156px; |
|
104 |
} |
|
105 |
|
|
106 |
div.selector:active span, |
|
107 |
div.selector.active span { |
|
108 |
background-position: right -26px; |
|
109 |
} |
|
110 |
|
|
111 |
div.selector.focus, div.selector.hover, div.selector:hover { |
|
112 |
background-position: -483px -182px; |
|
113 |
} |
|
114 |
|
|
115 |
div.selector.focus span, div.selector.hover span, div.selector:hover span { |
|
116 |
background-position: right -52px; |
|
117 |
} |
|
118 |
|
|
119 |
div.selector.focus:active, |
|
120 |
div.selector.focus.active, |
|
121 |
div.selector:hover:active, |
|
122 |
div.selector.active:hover { |
|
123 |
background-position: -483px -208px; |
|
124 |
} |
|
125 |
|
|
126 |
div.selector.focus:active span, |
|
127 |
div.selector:hover:active span, |
|
128 |
div.selector.active:hover span, |
|
129 |
div.selector.focus.active span { |
|
130 |
background-position: right -78px; |
|
131 |
} |
|
132 |
|
|
133 |
div.selector.disabled { |
|
134 |
background-position: -483px -234px; |
|
135 |
} |
|
136 |
|
|
137 |
div.selector.disabled span { |
|
138 |
background-position: right -104px; |
|
139 |
} |
|
140 |
|
|
141 |
/* Checkbox */ |
|
142 |
|
|
143 |
div.checker { |
|
144 |
width: 19px; |
|
145 |
height: 19px; |
|
146 |
} |
|
147 |
|
|
148 |
div.checker input { |
|
149 |
width: 19px; |
|
150 |
height: 19px; |
|
151 |
} |
|
152 |
|
|
153 |
div.checker span { |
|
154 |
background-position: 0px -260px; |
|
155 |
height: 19px; |
|
156 |
width: 19px; |
|
157 |
} |
|
158 |
|
|
159 |
div.checker:active span, |
|
160 |
div.checker.active span { |
|
161 |
background-position: -19px -260px; |
|
162 |
} |
|
163 |
|
|
164 |
div.checker.focus span, |
|
165 |
div.checker:hover span { |
|
166 |
background-position: -38px -260px; |
|
167 |
} |
|
168 |
|
|
169 |
div.checker.focus:active span, |
|
170 |
div.checker:active:hover span, |
|
171 |
div.checker.active:hover span, |
|
172 |
div.checker.focus.active span { |
|
173 |
background-position: -57px -260px; |
|
174 |
} |
|
175 |
|
|
176 |
div.checker span.checked { |
|
177 |
background-position: -76px -260px; |
|
178 |
} |
|
179 |
|
|
180 |
div.checker:active span.checked, |
|
181 |
div.checker.active span.checked { |
|
182 |
background-position: -95px -260px; |
|
183 |
} |
|
184 |
|
|
185 |
div.checker.focus span.checked, |
|
186 |
div.checker:hover span.checked { |
|
187 |
background-position: -114px -260px; |
|
188 |
} |
|
189 |
|
|
190 |
div.checker.focus:active span.checked, |
|
191 |
div.checker:hover:active span.checked, |
|
192 |
div.checker.active:hover span.checked, |
|
193 |
div.checker.active.focus span.checked { |
|
194 |
background-position: -133px -260px; |
|
195 |
} |
|
196 |
|
|
197 |
div.checker.disabled span, |
|
198 |
div.checker.disabled:active span, |
|
199 |
div.checker.disabled.active span { |
|
200 |
background-position: -152px -260px; |
|
201 |
} |
|
202 |
|
|
203 |
div.checker.disabled span.checked, |
|
204 |
div.checker.disabled:active span.checked, |
|
205 |
div.checker.disabled.active span.checked { |
|
206 |
background-position: -171px -260px; |
|
207 |
} |
|
208 |
|
|
209 |
/* Radio */ |
|
210 |
|
|
211 |
div.radio { |
|
212 |
width: 25px; |
|
213 |
height: 25px; |
|
214 |
|
|
215 |
} |
|
216 |
|
|
217 |
div.radio input { |
|
218 |
width: 25px; |
|
219 |
height: 25px; |
|
220 |
} |
|
221 |
|
|
222 |
div.radio span { |
|
223 |
height: 25px; |
|
224 |
width: 25px; |
|
225 |
background:transparent; |
|
226 |
|
|
227 |
} |
|
228 |
|
|
229 |
div.radio span span { |
|
230 |
border:1px solid grey; |
|
231 |
} |
|
232 |
div.radio:active span, |
|
233 |
div.radio.active span { |
|
234 |
background-image: url(../images/checkbox.png); |
|
235 |
background-position:top left; |
|
236 |
} |
|
237 |
|
|
238 |
div.radio.focus span, |
|
239 |
div.radio:hover span { |
|
240 |
background:transparent; |
|
241 |
} |
|
242 |
|
|
243 |
div.radio.focus:active span, |
|
244 |
div.radio:active:hover span, |
|
245 |
div.radio.active:hover span, |
|
246 |
div.radio.active.focus span { |
|
247 |
background-image: url(../images/checkbox.png); |
|
248 |
} |
|
249 |
|
|
250 |
div.radio span.checked { |
|
251 |
background-image: url(../images/checkbox.png); |
|
252 |
} |
|
253 |
|
|
254 |
div.radio:active span.checked, |
|
255 |
div.radio.active span.checked { |
|
256 |
background-image: url(../images/checkbox.png); |
|
257 |
} |
|
258 |
|
|
259 |
div.radio.focus span.checked, div.radio:hover span.checked { |
|
260 |
background-image: url(../images/checkbox.png); |
|
261 |
} |
|
262 |
|
|
263 |
div.radio.focus:active span.checked, |
|
264 |
div.radio:hover:active span.checked, |
|
265 |
div.radio.focus.active span.checked, |
|
266 |
div.radio.active:hover span.checked { |
|
267 |
background-image: url(../images/checkbox.png); |
|
268 |
} |
|
269 |
|
|
270 |
div.radio.disabled span, |
|
271 |
div.radio.disabled:active span, |
|
272 |
div.radio.disabled.active span { |
|
273 |
background-position: -144px -279px; |
|
274 |
} |
|
275 |
|
|
276 |
div.radio.disabled span.checked, |
|
277 |
div.radio.disabled:active span.checked, |
|
278 |
div.radio.disabled.active span.checked { |
|
279 |
background-position: -162px -279px; |
|
280 |
} |
|
281 |
|
|
282 |
/* Uploader */ |
|
283 |
|
|
284 |
div.uploader { |
|
285 |
background-position: 0px -297px; |
|
286 |
height: 28px; |
|
287 |
} |
|
288 |
|
|
289 |
div.uploader span.action { |
|
290 |
background-position: right -409px; |
|
291 |
height: 24px; |
|
292 |
line-height: 24px; |
|
293 |
} |
|
294 |
|
|
295 |
div.uploader span.filename { |
|
296 |
height: 24px; |
|
297 |
/* change this line to adjust positioning of filename area */ |
|
298 |
margin: 2px 0px 2px 2px; |
|
299 |
line-height: 24px; |
|
300 |
} |
|
301 |
|
|
302 |
div.uploader.focus, |
|
303 |
div.uploader.hover, |
|
304 |
div.uploader:hover { |
|
305 |
background-position: 0px -353px; |
|
306 |
} |
|
307 |
|
|
308 |
div.uploader.focus span.action, |
|
309 |
div.uploader.hover span.action, |
|
310 |
div.uploader:hover span.action { |
|
311 |
background-position: right -437px; |
|
312 |
} |
|
313 |
|
|
314 |
div.uploader.active span.action, |
|
315 |
div.uploader:active span.action { |
|
316 |
background-position: right -465px; |
|
317 |
} |
|
318 |
|
|
319 |
div.uploader.focus.active span.action, |
|
320 |
div.uploader:focus.active span.action, |
|
321 |
div.uploader.focus:active span.action, |
|
322 |
div.uploader:focus:active span.action { |
|
323 |
background-position: right -493px; |
|
324 |
} |
|
325 |
|
|
326 |
div.uploader.disabled { |
|
327 |
background-position: 0px -325px; |
|
328 |
} |
|
329 |
|
|
330 |
div.uploader.disabled span.action { |
|
331 |
background-position: right -381px; |
|
332 |
} |
|
333 |
|
|
334 |
div.button { |
|
335 |
background-position: 0px -523px; |
|
336 |
} |
|
337 |
|
|
338 |
div.button span { |
|
339 |
background-position: right -643px; |
|
340 |
} |
|
341 |
|
|
342 |
div.button.focus, |
|
343 |
div.button:focus, |
|
344 |
div.button:hover, |
|
345 |
div.button.hover { |
|
346 |
background-position: 0px -553px; |
|
347 |
} |
|
348 |
|
|
349 |
div.button.focus span, |
|
350 |
div.button:focus span, |
|
351 |
div.button:hover span, |
|
352 |
div.button.hover span { |
|
353 |
background-position: right -673px; |
|
354 |
} |
|
355 |
|
|
356 |
div.button.active, |
|
357 |
div.button:active { |
|
358 |
background-position: 0px -583px; |
|
359 |
} |
|
360 |
|
|
361 |
div.button.active span, |
|
362 |
div.button:active span { |
|
363 |
background-position: right -703px; |
|
364 |
color: #555; |
|
365 |
} |
|
366 |
|
|
367 |
div.button.disabled, |
|
368 |
div.button:disabled { |
|
369 |
background-position: 0px -613px; |
|
370 |
} |
|
371 |
|
|
372 |
div.button.disabled span, |
|
373 |
div.button:disabled span { |
|
374 |
background-position: right -733px; |
|
375 |
color: #bbb; |
|
376 |
cursor: default; |
|
377 |
} |
|
378 |
|
|
379 |
/* PRESENTATION */ |
|
380 |
|
|
381 |
/* Button */ |
|
382 |
|
|
383 |
div.button { |
|
384 |
height: 30px; |
|
385 |
} |
|
386 |
|
|
387 |
div.button span { |
|
388 |
margin-left: 13px; |
|
389 |
height: 22px; |
|
390 |
padding-top: 8px; |
|
391 |
font-weight: bold; |
|
392 |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; |
|
393 |
font-size: 12px; |
|
394 |
letter-spacing: 1px; |
|
395 |
text-transform: uppercase; |
|
396 |
padding-left: 2px; |
|
397 |
padding-right: 15px; |
|
398 |
} |
|
399 |
|
|
400 |
/* Select */ |
|
401 |
div.selector { |
|
402 |
width: 190px; |
|
403 |
font-size: 12px; |
|
404 |
} |
|
405 |
|
|
406 |
div.selector select { |
|
407 |
min-width: 190px; |
|
408 |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; |
|
409 |
font-size: 12px; |
|
410 |
border: solid 1px #fff; |
|
411 |
} |
|
412 |
|
|
413 |
div.selector span { |
|
414 |
padding: 0px 25px 0px 2px; |
|
415 |
cursor: pointer; |
|
416 |
} |
|
417 |
|
|
418 |
div.selector span { |
|
419 |
color: #666; |
|
420 |
width: 158px; |
|
421 |
text-shadow: 0 1px 0 #fff; |
|
422 |
} |
|
423 |
|
|
424 |
div.selector.disabled span { |
|
425 |
color: #bbb; |
|
426 |
} |
|
427 |
|
|
428 |
/* Checker */ |
|
429 |
div.checker { |
|
430 |
margin-right: 5px; |
|
431 |
} |
|
432 |
|
|
433 |
/* Radio */ |
|
434 |
div.radio { |
|
435 |
margin-right: 3px; |
|
436 |
} |
|
437 |
|
|
438 |
/* Uploader */ |
|
439 |
div.uploader { |
|
440 |
width: 190px; |
|
441 |
cursor: pointer; |
|
442 |
} |
|
443 |
|
|
444 |
div.uploader span.action { |
|
445 |
width: 85px; |
|
446 |
text-align: center; |
|
447 |
text-shadow: #fff 0px 1px 0px; |
|
448 |
background-color: #fff; |
|
449 |
font-size: 11px; |
|
450 |
font-weight: bold; |
|
451 |
} |
|
452 |
|
|
453 |
div.uploader span.filename { |
|
454 |
color: #777; |
|
455 |
width: 82px; |
|
456 |
border-right: solid 1px #bbb; |
|
457 |
font-size: 11px; |
|
458 |
} |
|
459 |
|
|
460 |
div.uploader input { |
|
461 |
width: 190px; |
|
462 |
} |
|
463 |
|
|
464 |
div.uploader.disabled span.action { |
|
465 |
color: #aaa; |
|
466 |
} |
|
467 |
|
|
468 |
div.uploader.disabled span.filename { |
|
469 |
border-color: #ddd; |
|
470 |
color: #aaa; |
|
471 |
} |
|
472 |
/* |
|
473 |
|
|
474 |
CORE FUNCTIONALITY |
|
475 |
|
|
476 |
Not advised to edit stuff below this line |
|
477 |
----------------------------------------------------- |
|
478 |
*/ |
|
479 |
|
|
480 |
.selector, |
|
481 |
.checker, |
|
482 |
.button, |
|
483 |
.radio, |
|
484 |
.uploader { |
|
485 |
display: -moz-inline-box; |
|
486 |
display: inline-block; |
|
487 |
vertical-align: middle; |
|
488 |
zoom: 1; |
|
489 |
*display: inline; |
|
490 |
} |
|
491 |
|
|
492 |
.selector select:focus, .radio input:focus, .checker input:focus, .uploader input:focus { |
|
493 |
outline: 0; |
|
494 |
} |
|
495 |
|
|
496 |
/* Button */ |
|
497 |
|
|
498 |
div.button a, |
|
499 |
div.button button, |
|
500 |
div.button input { |
|
501 |
position: absolute; |
|
502 |
} |
|
503 |
|
|
504 |
div.button { |
|
505 |
cursor: pointer; |
|
506 |
position: relative; |
|
507 |
} |
|
508 |
|
|
509 |
div.button span { |
|
510 |
display: -moz-inline-box; |
|
511 |
display: inline-block; |
|
512 |
line-height: 1; |
|
513 |
text-align: center; |
|
514 |
} |
|
515 |
|
|
516 |
/* Select */ |
|
517 |
|
|
518 |
div.selector { |
|
519 |
position: relative; |
|
520 |
padding-left: 10px; |
|
521 |
overflow: hidden; |
|
522 |
} |
|
523 |
|
|
524 |
div.selector span { |
|
525 |
display: block; |
|
526 |
overflow: hidden; |
|
527 |
text-overflow: ellipsis; |
|
528 |
white-space: nowrap; |
|
529 |
} |
|
530 |
|
|
531 |
div.selector select { |
|
532 |
position: absolute; |
|
533 |
opacity: 0; |
|
534 |
filter: alpha(opacity:0); |
|
535 |
height: 25px; |
|
536 |
border: none; |
|
537 |
background: none; |
|
538 |
} |
|
539 |
|
|
540 |
/* Checker */ |
|
541 |
|
|
542 |
div.checker { |
|
543 |
position: relative; |
|
544 |
} |
|
545 |
|
|
546 |
div.checker span { |
|
547 |
display: -moz-inline-box; |
|
548 |
display: inline-block; |
|
549 |
text-align: center; |
|
550 |
} |
|
551 |
|
|
552 |
div.checker input { |
|
553 |
opacity: 0; |
|
554 |
filter: alpha(opacity:0); |
|
555 |
display: inline-block; |
|
556 |
background: none; |
|
557 |
} |
|
558 |
|
|
559 |
/* Radio */ |
|
560 |
|
|
561 |
div.radio { |
|
562 |
position: relative; |
|
563 |
} |
|
564 |
|
|
565 |
div.radio span { |
|
566 |
display: -moz-inline-box; |
|
567 |
display: inline-block; |
|
568 |
text-align: center; |
|
569 |
} |
|
570 |
|
|
571 |
div.radio input { |
|
572 |
opacity: 0; |
|
573 |
filter: alpha(opacity:0); |
|
574 |
text-align: center; |
|
575 |
display: inline-block; |
|
576 |
background: none; |
|
577 |
} |
|
578 |
|
|
579 |
/* Uploader */ |
|
580 |
|
|
581 |
div.uploader { |
|
582 |
position: relative; |
|
583 |
overflow: hidden; |
|
584 |
cursor: default; |
|
585 |
} |
|
586 |
|
|
587 |
div.uploader span.action { |
|
588 |
float: left; |
|
589 |
display: inline; |
|
590 |
padding: 2px 0px; |
|
591 |
overflow: hidden; |
|
592 |
cursor: pointer; |
|
593 |
} |
|
594 |
|
|
595 |
div.uploader span.filename { |
|
596 |
padding: 0px 10px; |
|
597 |
float: left; |
|
598 |
display: block; |
|
599 |
overflow: hidden; |
|
600 |
text-overflow: ellipsis; |
|
601 |
white-space: nowrap; |
|
602 |
cursor: default; |
|
603 |
} |
|
604 |
|
|
605 |
div.uploader input { |
|
606 |
opacity: 0; |
|
607 |
filter: alpha(opacity:0); |
|
608 |
position: absolute; |
|
609 |
top: 0; |
|
610 |
right: 0; |
|
611 |
bottom: 0; |
|
612 |
float: right; |
|
613 |
height: 25px; |
|
614 |
border: none; |
|
615 |
cursor: default; |
|
616 |
} |
b/snf-astakos-app/astakos/im/static/im/js/forms.js | ||
---|---|---|
20 | 20 |
$(lbl).click(function(e){ |
21 | 21 |
var src = e.srcElement.nodeName; |
22 | 22 |
if (src == "LABEL" || src == "label") { |
23 |
el.toggleClass("checked"); |
|
24 |
|
|
23 |
el.toggleClass("checked");
|
|
24 |
$this.attr('checked', el.hasClass("checked")); |
|
25 | 25 |
}; |
26 |
if ($this.attr('checked')=='checked') { |
|
27 |
($this.removeAttr('checked')) |
|
28 |
} else { |
|
29 |
$this.attr('checked','checked') |
|
30 |
} |
|
26 |
|
|
31 | 27 |
}) |
32 | 28 |
} |
33 | 29 |
} |
... | ... | |
116 | 112 |
}; |
117 | 113 |
})( jQuery ); |
118 | 114 |
|
115 |
|
|
116 |
|
b/snf-astakos-app/astakos/im/static/im/js/jquery.uniform.js | ||
---|---|---|
1 |
/* |
|
2 |
|
|
3 |
Uniform v1.7.5 |
|
4 |
Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC |
|
5 |
http://pixelmatrixdesign.com |
|
6 |
|
|
7 |
Requires jQuery 1.4 or newer |
|
8 |
|
|
9 |
Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on this |
|
10 |
|
|
11 |
Disabling text selection is made possible by Mathias Bynens <http://mathiasbynens.be/> |
|
12 |
and his noSelect plugin. <http://github.com/mathiasbynens/noSelect-jQuery-Plugin> |
|
13 |
|
|
14 |
Also, thanks to David Kaneda and Eugene Bond for their contributions to the plugin |
|
15 |
|
|
16 |
License: |
|
17 |
MIT License - http://www.opensource.org/licenses/mit-license.php |
|
18 |
|
|
19 |
Enjoy! |
|
20 |
|
|
21 |
*/ |
|
22 |
|
|
23 |
(function($) { |
|
24 |
$.uniform = { |
|
25 |
options: { |
|
26 |
selectClass: 'selector', |
|
27 |
radioClass: 'radio', |
|
28 |
checkboxClass: 'checker', |
|
29 |
fileClass: 'uploader', |
|
30 |
filenameClass: 'filename', |
|
31 |
fileBtnClass: 'action', |
|
32 |
fileDefaultText: 'No file selected', |
|
33 |
fileBtnText: 'Choose File', |
|
34 |
checkedClass: 'checked', |
|
35 |
focusClass: 'focus', |
|
36 |
disabledClass: 'disabled', |
|
37 |
buttonClass: 'button', |
|
38 |
activeClass: 'active', |
|
39 |
hoverClass: 'hover', |
|
40 |
useID: true, |
|
41 |
idPrefix: 'uniform', |
|
42 |
resetSelector: false, |
|
43 |
autoHide: true |
|
44 |
}, |
|
45 |
elements: [] |
|
46 |
}; |
|
47 |
|
|
48 |
if($.browser.msie && $.browser.version < 7){ |
|
49 |
$.support.selectOpacity = false; |
|
50 |
}else{ |
|
51 |
$.support.selectOpacity = true; |
|
52 |
} |
|
53 |
|
|
54 |
$.fn.uniform = function(options) { |
|
55 |
|
|
56 |
options = $.extend($.uniform.options, options); |
|
57 |
|
|
58 |
var el = this; |
|
59 |
//code for specifying a reset button |
|
60 |
if(options.resetSelector != false){ |
|
61 |
$(options.resetSelector).mouseup(function(){ |
|
62 |
function resetThis(){ |
|
63 |
$.uniform.update(el); |
|
64 |
} |
|
65 |
setTimeout(resetThis, 10); |
|
66 |
}); |
|
67 |
} |
|
68 |
|
|
69 |
function doInput(elem){ |
|
70 |
$el = $(elem); |
|
71 |
$el.addClass($el.attr("type")); |
|
72 |
storeElement(elem); |
|
73 |
} |
|
74 |
|
|
75 |
function doTextarea(elem){ |
|
76 |
$(elem).addClass("uniform"); |
|
77 |
storeElement(elem); |
|
78 |
} |
|
79 |
|
|
80 |
function doButton(elem){ |
|
81 |
var $el = $(elem); |
|
82 |
|
|
83 |
var divTag = $("<div>"), |
|
84 |
spanTag = $("<span>"); |
|
85 |
|
|
86 |
divTag.addClass(options.buttonClass); |
|
87 |
|
|
88 |
if(options.useID && $el.attr("id") != "") divTag.attr("id", options.idPrefix+"-"+$el.attr("id")); |
|
89 |
|
|
90 |
var btnText; |
|
91 |
|
|
92 |
if($el.is("a") || $el.is("button")){ |
|
93 |
btnText = $el.text(); |
|
94 |
}else if($el.is(":submit") || $el.is(":reset") || $el.is("input[type=button]")){ |
|
95 |
btnText = $el.attr("value"); |
|
96 |
} |
|
97 |
|
|
98 |
btnText = btnText == "" ? $el.is(":reset") ? "Reset" : "Submit" : btnText; |
|
99 |
|
|
100 |
spanTag.html(btnText); |
|
101 |
|
|
102 |
$el.css("opacity", 0); |
|
103 |
$el.wrap(divTag); |
|
104 |
$el.wrap(spanTag); |
|
105 |
|
|
106 |
//redefine variables |
|
107 |
divTag = $el.closest("div"); |
|
108 |
spanTag = $el.closest("span"); |
|
109 |
|
|
110 |
if($el.is(":disabled")) divTag.addClass(options.disabledClass); |
|
111 |
|
|
112 |
divTag.bind({ |
|
113 |
"mouseenter.uniform": function(){ |
|
114 |
divTag.addClass(options.hoverClass); |
|
115 |
}, |
|
116 |
"mouseleave.uniform": function(){ |
|
117 |
divTag.removeClass(options.hoverClass); |
|
118 |
divTag.removeClass(options.activeClass); |
|
119 |
}, |
|
120 |
"mousedown.uniform touchbegin.uniform": function(){ |
|
121 |
divTag.addClass(options.activeClass); |
|
122 |
}, |
|
123 |
"mouseup.uniform touchend.uniform": function(){ |
|
124 |
divTag.removeClass(options.activeClass); |
|
125 |
}, |
|
126 |
"click.uniform touchend.uniform": function(e){ |
|
127 |
if($(e.target).is("span") || $(e.target).is("div")){ |
|
128 |
if(elem[0].dispatchEvent){ |
|
129 |
var ev = document.createEvent('MouseEvents'); |
|
130 |
ev.initEvent( 'click', true, true ); |
|
131 |
elem[0].dispatchEvent(ev); |
|
132 |
}else{ |
|
133 |
elem[0].click(); |
|
134 |
} |
|
135 |
} |
|
136 |
} |
|
137 |
}); |
|
138 |
|
|
139 |
elem.bind({ |
|
140 |
"focus.uniform": function(){ |
|
141 |
divTag.addClass(options.focusClass); |
|
142 |
}, |
|
143 |
"blur.uniform": function(){ |
|
144 |
divTag.removeClass(options.focusClass); |
|
145 |
} |
|
146 |
}); |
|
147 |
|
|
148 |
$.uniform.noSelect(divTag); |
|
149 |
storeElement(elem); |
|
150 |
|
|
151 |
} |
|
152 |
|
|
153 |
function doSelect(elem){ |
|
154 |
var $el = $(elem); |
|
155 |
|
|
156 |
var divTag = $('<div />'), |
|
157 |
spanTag = $('<span />'); |
|
158 |
|
|
159 |
if(!$el.css("display") == "none" && options.autoHide){ |
|
160 |
divTag.hide(); |
|
161 |
} |
|
162 |
|
|
163 |
divTag.addClass(options.selectClass); |
|
164 |
|
|
165 |
if(options.useID && elem.attr("id") != ""){ |
|
166 |
divTag.attr("id", options.idPrefix+"-"+elem.attr("id")); |
|
167 |
} |
|
168 |
|
|
169 |
var selected = elem.find(":selected:first"); |
|
170 |
if(selected.length == 0){ |
|
171 |
selected = elem.find("option:first"); |
|
172 |
} |
|
173 |
spanTag.html(selected.html()); |
|
174 |
|
|
175 |
elem.css('opacity', 0); |
|
176 |
elem.wrap(divTag); |
|
177 |
elem.before(spanTag); |
|
178 |
|
|
179 |
//redefine variables |
|
180 |
divTag = elem.parent("div"); |
|
181 |
spanTag = elem.siblings("span"); |
|
182 |
|
|
183 |
elem.bind({ |
|
184 |
"change.uniform": function() { |
|
185 |
spanTag.text(elem.find(":selected").html()); |
|
186 |
divTag.removeClass(options.activeClass); |
|
187 |
}, |
|
188 |
"focus.uniform": function() { |
|
189 |
divTag.addClass(options.focusClass); |
|
190 |
}, |
|
191 |
"blur.uniform": function() { |
|
192 |
divTag.removeClass(options.focusClass); |
|
193 |
divTag.removeClass(options.activeClass); |
|
194 |
}, |
|
195 |
"mousedown.uniform touchbegin.uniform": function() { |
|
196 |
divTag.addClass(options.activeClass); |
|
197 |
}, |
|
198 |
"mouseup.uniform touchend.uniform": function() { |
|
199 |
divTag.removeClass(options.activeClass); |
|
200 |
}, |
|
201 |
"click.uniform touchend.uniform": function(){ |
|
202 |
divTag.removeClass(options.activeClass); |
|
203 |
}, |
|
204 |
"mouseenter.uniform": function() { |
|
205 |
divTag.addClass(options.hoverClass); |
|
206 |
}, |
|
207 |
"mouseleave.uniform": function() { |
|
208 |
divTag.removeClass(options.hoverClass); |
|
209 |
divTag.removeClass(options.activeClass); |
|
210 |
}, |
|
211 |
"keyup.uniform": function(){ |
|
212 |
spanTag.text(elem.find(":selected").html()); |
|
213 |
} |
|
214 |
}); |
|
215 |
|
|
216 |
//handle disabled state |
|
217 |
if($(elem).attr("disabled")){ |
|
218 |
//box is checked by default, check our box |
|
219 |
divTag.addClass(options.disabledClass); |
|
220 |
} |
|
221 |
$.uniform.noSelect(spanTag); |
|
222 |
|
|
223 |
storeElement(elem); |
|
224 |
|
|
225 |
} |
|
226 |
|
|
227 |
function doCheckbox(elem){ |
|
228 |
var $el = $(elem); |
|
229 |
|
|
230 |
var divTag = $('<div />'), |
|
231 |
spanTag = $('<span />'); |
|
232 |
|
|
233 |
if(!$el.css("display") == "none" && options.autoHide){ |
|
234 |
divTag.hide(); |
|
235 |
} |
|
236 |
|
|
237 |
divTag.addClass(options.checkboxClass); |
|
238 |
|
|
239 |
//assign the id of the element |
|
240 |
if(options.useID && elem.attr("id") != ""){ |
|
241 |
divTag.attr("id", options.idPrefix+"-"+elem.attr("id")); |
|
242 |
} |
|
243 |
|
|
244 |
//wrap with the proper elements |
|
245 |
$(elem).wrap(divTag); |
|
246 |
$(elem).wrap(spanTag); |
|
247 |
|
|
248 |
//redefine variables |
|
249 |
spanTag = elem.parent(); |
|
250 |
divTag = spanTag.parent(); |
|
251 |
|
|
252 |
//hide normal input and add focus classes |
|
253 |
$(elem) |
|
254 |
.css("opacity", 0) |
|
255 |
.bind({ |
|
256 |
"focus.uniform": function(){ |
|
257 |
divTag.addClass(options.focusClass); |
|
258 |
}, |
|
259 |
"blur.uniform": function(){ |
|
260 |
divTag.removeClass(options.focusClass); |
|
261 |
}, |
|
262 |
"click.uniform touchend.uniform": function(){ |
|
263 |
if(!$(elem).attr("checked")){ |
|
264 |
//box was just unchecked, uncheck span |
|
265 |
spanTag.removeClass(options.checkedClass); |
|
266 |
}else{ |
|
267 |
//box was just checked, check span. |
|
268 |
spanTag.addClass(options.checkedClass); |
|
269 |
} |
|
270 |
}, |
|
271 |
"mousedown.uniform touchbegin.uniform": function() { |
|
272 |
divTag.addClass(options.activeClass); |
|
273 |
}, |
|
274 |
"mouseup.uniform touchend.uniform": function() { |
|
275 |
divTag.removeClass(options.activeClass); |
|
276 |
}, |
|
277 |
"mouseenter.uniform": function() { |
|
278 |
divTag.addClass(options.hoverClass); |
|
279 |
}, |
|
280 |
"mouseleave.uniform": function() { |
|
281 |
divTag.removeClass(options.hoverClass); |
|
282 |
divTag.removeClass(options.activeClass); |
|
283 |
} |
|
284 |
}); |
|
285 |
|
|
286 |
//handle defaults |
|
287 |
if($(elem).attr("checked")){ |
|
288 |
//box is checked by default, check our box |
|
289 |
spanTag.addClass(options.checkedClass); |
|
290 |
} |
|
291 |
|
|
292 |
//handle disabled state |
|
293 |
if($(elem).attr("disabled")){ |
|
294 |
//box is checked by default, check our box |
|
295 |
divTag.addClass(options.disabledClass); |
|
296 |
} |
|
297 |
|
|
298 |
storeElement(elem); |
|
299 |
} |
|
300 |
|
|
301 |
function doRadio(elem){ |
|
302 |
var $el = $(elem); |
|
303 |
|
|
304 |
var divTag = $('<div />'), |
|
305 |
spanTag = $('<span />'); |
|
306 |
|
|
307 |
if(!$el.css("display") == "none" && options.autoHide){ |
|
308 |
divTag.hide(); |
|
309 |
} |
|
310 |
|
|
311 |
divTag.addClass(options.radioClass); |
|
312 |
|
|
313 |
if(options.useID && elem.attr("id") != ""){ |
|
314 |
divTag.attr("id", options.idPrefix+"-"+elem.attr("id")); |
|
315 |
} |
|
316 |
|
|
317 |
//wrap with the proper elements |
|
318 |
$(elem).wrap(divTag); |
|
319 |
$(elem).wrap(spanTag); |
|
320 |
|
|
321 |
//redefine variables |
|
322 |
spanTag = elem.parent(); |
|
323 |
divTag = spanTag.parent(); |
|
324 |
|
|
325 |
//hide normal input and add focus classes |
|
326 |
$(elem) |
|
327 |
.css("opacity", 0) |
|
328 |
.bind({ |
|
329 |
"focus.uniform": function(){ |
|
330 |
divTag.addClass(options.focusClass); |
|
331 |
}, |
|
332 |
"blur.uniform": function(){ |
|
333 |
divTag.removeClass(options.focusClass); |
|
334 |
}, |
|
335 |
"click.uniform touchend.uniform": function(){ |
|
336 |
if(!$(elem).attr("checked")){ |
|
337 |
//box was just unchecked, uncheck span |
|
338 |
spanTag.removeClass(options.checkedClass); |
|
339 |
}else{ |
|
340 |
//box was just checked, check span |
|
341 |
var classes = options.radioClass.split(" ")[0]; |
|
342 |
$("." + classes + " span." + options.checkedClass + ":has([name='" + $(elem).attr('name') + "'])").removeClass(options.checkedClass); |
|
343 |
spanTag.addClass(options.checkedClass); |
|
344 |
} |
|
345 |
}, |
|
346 |
"mousedown.uniform touchend.uniform": function() { |
|
347 |
if(!$(elem).is(":disabled")){ |
|
348 |
divTag.addClass(options.activeClass); |
|
349 |
} |
|
350 |
}, |
|
351 |
"mouseup.uniform touchbegin.uniform": function() { |
|
352 |
divTag.removeClass(options.activeClass); |
|
353 |
}, |
|
354 |
"mouseenter.uniform touchend.uniform": function() { |
|
355 |
divTag.addClass(options.hoverClass); |
|
356 |
}, |
|
357 |
"mouseleave.uniform": function() { |
|
358 |
divTag.removeClass(options.hoverClass); |
|
359 |
divTag.removeClass(options.activeClass); |
|
360 |
} |
|
361 |
}); |
|
362 |
|
|
363 |
//handle defaults |
|
364 |
if($(elem).attr("checked")){ |
|
365 |
//box is checked by default, check span |
|
366 |
spanTag.addClass(options.checkedClass); |
|
367 |
} |
|
368 |
//handle disabled state |
|
369 |
if($(elem).attr("disabled")){ |
|
370 |
//box is checked by default, check our box |
|
371 |
divTag.addClass(options.disabledClass); |
|
372 |
} |
|
373 |
|
|
374 |
storeElement(elem); |
|
375 |
|
|
376 |
} |
|
377 |
|
|
378 |
function doFile(elem){ |
|
379 |
//sanitize input |
|
380 |
var $el = $(elem); |
|
381 |
|
|
382 |
var divTag = $('<div />'), |
|
383 |
filenameTag = $('<span>'+options.fileDefaultText+'</span>'), |
|
384 |
btnTag = $('<span>'+options.fileBtnText+'</span>'); |
|
385 |
|
|
386 |
if(!$el.css("display") == "none" && options.autoHide){ |
|
387 |
divTag.hide(); |
|
388 |
} |
|
389 |
|
|
390 |
divTag.addClass(options.fileClass); |
|
391 |
filenameTag.addClass(options.filenameClass); |
|
392 |
btnTag.addClass(options.fileBtnClass); |
|
393 |
|
|
394 |
if(options.useID && $el.attr("id") != ""){ |
|
395 |
divTag.attr("id", options.idPrefix+"-"+$el.attr("id")); |
|
396 |
} |
|
397 |
|
|
398 |
//wrap with the proper elements |
|
399 |
$el.wrap(divTag); |
|
400 |
$el.after(btnTag); |
|
401 |
$el.after(filenameTag); |
|
402 |
|
|
403 |
//redefine variables |
|
404 |
divTag = $el.closest("div"); |
|
405 |
filenameTag = $el.siblings("."+options.filenameClass); |
|
406 |
btnTag = $el.siblings("."+options.fileBtnClass); |
|
407 |
|
|
408 |
//set the size |
|
409 |
if(!$el.attr("size")){ |
|
410 |
var divWidth = divTag.width(); |
|
411 |
//$el.css("width", divWidth); |
|
412 |
$el.attr("size", divWidth/10); |
|
413 |
} |
|
414 |
|
|
415 |
//actions |
|
416 |
var setFilename = function() |
|
417 |
{ |
|
418 |
var filename = $el.val(); |
|
419 |
if (filename === '') |
|
420 |
{ |
|
421 |
filename = options.fileDefaultText; |
|
422 |
} |
|
423 |
else |
|
424 |
{ |
|
425 |
filename = filename.split(/[\/\\]+/); |
|
426 |
filename = filename[(filename.length-1)]; |
|
427 |
} |
|
428 |
filenameTag.text(filename); |
|
429 |
}; |
|
430 |
|
|
431 |
// Account for input saved across refreshes |
|
432 |
setFilename(); |
|
433 |
|
|
434 |
$el |
|
435 |
.css("opacity", 0) |
|
436 |
.bind({ |
|
437 |
"focus.uniform": function(){ |
|
438 |
divTag.addClass(options.focusClass); |
|
439 |
}, |
|
440 |
"blur.uniform": function(){ |
|
441 |
divTag.removeClass(options.focusClass); |
|
442 |
}, |
|
443 |
"mousedown.uniform": function() { |
|
444 |
if(!$(elem).is(":disabled")){ |
|
445 |
divTag.addClass(options.activeClass); |
|
446 |
} |
|
447 |
}, |
|
448 |
"mouseup.uniform": function() { |
|
449 |
divTag.removeClass(options.activeClass); |
|
450 |
}, |
|
451 |
"mouseenter.uniform": function() { |
|
452 |
divTag.addClass(options.hoverClass); |
|
453 |
}, |
|
454 |
"mouseleave.uniform": function() { |
|
455 |
divTag.removeClass(options.hoverClass); |
|
456 |
divTag.removeClass(options.activeClass); |
|
457 |
} |
|
458 |
}); |
|
459 |
|
|
460 |
// IE7 doesn't fire onChange until blur or second fire. |
|
461 |
if ($.browser.msie){ |
|
462 |
// IE considers browser chrome blocking I/O, so it |
|
463 |
// suspends tiemouts until after the file has been selected. |
|
464 |
$el.bind('click.uniform.ie7', function() { |
|
465 |
setTimeout(setFilename, 0); |
|
466 |
}); |
|
467 |
}else{ |
|
468 |
// All other browsers behave properly |
|
469 |
$el.bind('change.uniform', setFilename); |
|
470 |
} |
|
471 |
|
|
472 |
//handle defaults |
|
473 |
if($el.attr("disabled")){ |
|
474 |
//box is checked by default, check our box |
|
475 |
divTag.addClass(options.disabledClass); |
|
476 |
} |
|
477 |
|
|
478 |
$.uniform.noSelect(filenameTag); |
|
479 |
$.uniform.noSelect(btnTag); |
|
480 |
|
|
481 |
storeElement(elem); |
|
482 |
|
|
483 |
} |
|
484 |
|
|
485 |
$.uniform.restore = function(elem){ |
|
486 |
if(elem == undefined){ |
|
487 |
elem = $($.uniform.elements); |
|
488 |
} |
|
489 |
|
|
490 |
$(elem).each(function(){ |
|
491 |
if($(this).is(":checkbox")){ |
|
492 |
//unwrap from span and div |
|
493 |
$(this).unwrap().unwrap(); |
|
494 |
}else if($(this).is("select")){ |
|
495 |
//remove sibling span |
|
496 |
$(this).siblings("span").remove(); |
|
497 |
//unwrap parent div |
|
498 |
$(this).unwrap(); |
|
499 |
}else if($(this).is(":radio")){ |
|
500 |
//unwrap from span and div |
|
501 |
$(this).unwrap().unwrap(); |
|
502 |
}else if($(this).is(":file")){ |
|
503 |
//remove sibling spans |
|
504 |
$(this).siblings("span").remove(); |
|
505 |
//unwrap parent div |
|
506 |
$(this).unwrap(); |
|
507 |
}else if($(this).is("button, :submit, :reset, a, input[type='button']")){ |
|
508 |
//unwrap from span and div |
|
509 |
$(this).unwrap().unwrap(); |
|
510 |
} |
|
511 |
|
|
512 |
//unbind events |
|
513 |
$(this).unbind(".uniform"); |
|
514 |
|
|
515 |
//reset inline style |
|
516 |
$(this).css("opacity", "1"); |
|
517 |
|
|
518 |
//remove item from list of uniformed elements |
|
519 |
var index = $.inArray($(elem), $.uniform.elements); |
|
520 |
$.uniform.elements.splice(index, 1); |
|
521 |
}); |
|
522 |
}; |
|
523 |
|
|
524 |
function storeElement(elem){ |
|
525 |
//store this element in our global array |
|
526 |
elem = $(elem).get(); |
|
527 |
if(elem.length > 1){ |
|
528 |
$.each(elem, function(i, val){ |
|
529 |
$.uniform.elements.push(val); |
|
530 |
}); |
|
531 |
}else{ |
|
532 |
$.uniform.elements.push(elem); |
|
533 |
} |
|
534 |
} |
|
535 |
|
|
536 |
//noSelect v1.0 |
|
537 |
$.uniform.noSelect = function(elem) { |
|
538 |
function f() { |
|
539 |
return false; |
|
540 |
}; |
|
541 |
$(elem).each(function() { |
|
542 |
this.onselectstart = this.ondragstart = f; // Webkit & IE |
|
543 |
$(this) |
|
544 |
.mousedown(f) // Webkit & Opera |
|
545 |
.css({ MozUserSelect: 'none' }); // Firefox |
|
546 |
}); |
|
547 |
}; |
|
548 |
|
|
549 |
$.uniform.update = function(elem){ |
|
550 |
if(elem == undefined){ |
|
551 |
elem = $($.uniform.elements); |
|
552 |
} |
|
553 |
//sanitize input |
|
554 |
elem = $(elem); |
|
555 |
|
|
556 |
elem.each(function(){ |
|
557 |
//do to each item in the selector |
|
558 |
//function to reset all classes |
|
559 |
var $e = $(this); |
|
560 |
|
|
561 |
if($e.is("select")){ |
|
562 |
//element is a select |
|
563 |
var spanTag = $e.siblings("span"); |
|
564 |
var divTag = $e.parent("div"); |
|
565 |
|
|
566 |
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); |
|
567 |
|
|
568 |
//reset current selected text |
|
569 |
spanTag.html($e.find(":selected").html()); |
|
570 |
|
|
571 |
if($e.is(":disabled")){ |
|
572 |
divTag.addClass(options.disabledClass); |
|
573 |
}else{ |
|
574 |
divTag.removeClass(options.disabledClass); |
|
575 |
} |
|
576 |
|
|
577 |
}else if($e.is(":checkbox")){ |
|
578 |
//element is a checkbox |
|
579 |
var spanTag = $e.closest("span"); |
|
580 |
var divTag = $e.closest("div"); |
|
581 |
|
|
582 |
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); |
|
583 |
spanTag.removeClass(options.checkedClass); |
|
584 |
|
|
585 |
if($e.is(":checked")){ |
|
586 |
spanTag.addClass(options.checkedClass); |
|
587 |
} |
|
588 |
if($e.is(":disabled")){ |
|
589 |
divTag.addClass(options.disabledClass); |
|
590 |
}else{ |
|
591 |
divTag.removeClass(options.disabledClass); |
|
592 |
} |
|
593 |
|
|
594 |
}else if($e.is(":radio")){ |
|
595 |
//element is a radio |
|
596 |
var spanTag = $e.closest("span"); |
|
597 |
var divTag = $e.closest("div"); |
|
598 |
|
|
599 |
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); |
|
600 |
spanTag.removeClass(options.checkedClass); |
|
601 |
|
|
602 |
if($e.is(":checked")){ |
|
603 |
spanTag.addClass(options.checkedClass); |
|
604 |
} |
|
605 |
|
|
606 |
if($e.is(":disabled")){ |
|
607 |
divTag.addClass(options.disabledClass); |
|
608 |
}else{ |
|
609 |
divTag.removeClass(options.disabledClass); |
|
610 |
} |
|
611 |
}else if($e.is(":file")){ |
|
612 |
var divTag = $e.parent("div"); |
|
613 |
var filenameTag = $e.siblings(options.filenameClass); |
|
614 |
btnTag = $e.siblings(options.fileBtnClass); |
|
615 |
|
|
616 |
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); |
|
617 |
|
|
618 |
filenameTag.text($e.val()); |
|
619 |
|
|
620 |
if($e.is(":disabled")){ |
|
621 |
divTag.addClass(options.disabledClass); |
|
622 |
}else{ |
|
623 |
divTag.removeClass(options.disabledClass); |
|
624 |
} |
|
625 |
}else if($e.is(":submit") || $e.is(":reset") || $e.is("button") || $e.is("a") || elem.is("input[type=button]")){ |
|
626 |
var divTag = $e.closest("div"); |
|
627 |
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); |
|
628 |
|
|
629 |
if($e.is(":disabled")){ |
|
630 |
divTag.addClass(options.disabledClass); |
|
631 |
}else{ |
|
632 |
divTag.removeClass(options.disabledClass); |
|
633 |
} |
|
634 |
|
|
635 |
} |
|
636 |
|
|
637 |
}); |
|
638 |
}; |
|
639 |
|
|
640 |
return this.each(function() { |
|
641 |
if($.support.selectOpacity){ |
|
642 |
var elem = $(this); |
|
643 |
|
|
644 |
if(elem.is("select")){ |
|
645 |
//element is a select |
|
646 |
if(elem.attr("multiple") != true){ |
|
647 |
//element is not a multi-select |
|
648 |
if(elem.attr("size") == undefined || elem.attr("size") <= 1){ |
|
649 |
doSelect(elem); |
|
650 |
} |
|
651 |
} |
|
652 |
}else if(elem.is(":checkbox")){ |
|
653 |
//element is a checkbox |
|
654 |
doCheckbox(elem); |
|
655 |
}else if(elem.is(":radio")){ |
|
656 |
//element is a radio |
|
657 |
doRadio(elem); |
|
658 |
}else if(elem.is(":file")){ |
|
659 |
//element is a file upload |
|
660 |
doFile(elem); |
|
661 |
}else if(elem.is(":text, :password, input[type='email']")){ |
|
662 |
doInput(elem); |
|
663 |
}else if(elem.is("textarea")){ |
|
664 |
doTextarea(elem); |
|
665 |
}else if(elem.is("a") || elem.is(":submit") || elem.is(":reset") || elem.is("button") || elem.is("input[type=button]")){ |
|
666 |
doButton(elem); |
|
667 |
} |
|
668 |
|
|
669 |
} |
|
670 |
}); |
|
671 |
}; |
|
672 |
})(jQuery); |
b/snf-astakos-app/astakos/im/static/im/js/quotas.js | ||
---|---|---|
25 | 25 |
$(this).siblings('fieldset').find('input[type="checkbox"].limited').removeAttr('checked'); |
26 | 26 |
$(this).siblings('fieldset').find('input[type="checkbox"].unlimited').attr('checked','checked'); |
27 | 27 |
$(this).siblings('fieldset').find('.double-checks input[type="text"]').removeClass('hideshow'); |
28 |
$(this).parents('.group').hide('slow'); |
|
29 |
$(this).parents('.group').appendTo('.not-foo'); |
|
28 |
$(this).parents('.group').hide('slow', function() { |
|
29 |
$(this).appendTo('.not-foo'); |
|
30 |
}); |
|
30 | 31 |
groupClass = $(this).parents('.group').attr('class').replace('group ', ''); |
31 | 32 |
$('.quotas-form ul li a').each(function() { |
32 | 33 |
if($(this).attr('id')==groupClass) { |
... | ... | |
46 | 47 |
parentdiv = $(this).parents('.form-row').prev('.form-row'); |
47 | 48 |
parentdiv.find('input[type="checkbox"].unlimited').removeAttr('checked'); |
48 | 49 |
parentdiv.find('.checkbox-widget').removeClass('checked'); |
49 |
checkTextInput(); |
|
50 |
|
|
50 | 51 |
}); |
51 | 52 |
|
52 | 53 |
$('.quotas-form .checkbox-widget.unlimited').click(function(e){ |
53 | 54 |
parentdiv = $(this).parents('.form-row').next('.form-row'); |
54 |
parentdiv.find('.checkbox-widget').removeClass('checked'); |
|
55 |
parentdiv.find('input[type="checkbox"].limited').removeAttr('checked'); |
|
56 |
parentdiv.find('input[type="text"]').val(''); |
|
57 |
parentdiv.find('input[type="text"]').hide(); |
|
55 |
if (parentdiv.find('.checkbox-widget').hasClass('checked')){ |
|
56 |
parentdiv.find('.checkbox-widget').removeClass('checked'); |
|
57 |
parentdiv.find('input[type="checkbox"].limited').removeAttr('checked'); |
|
58 |
parentdiv.find('input[type="text"]').val(''); |
|
59 |
parentdiv.find('input[type="text"]').hide(); |
|
60 |
} |
|
61 |
|
|
58 | 62 |
|
59 | 63 |
|
60 | 64 |
}) |
61 | 65 |
|
62 |
|
|
66 |
$('input:radio').uniform(); |
|
67 |
$('.radio .radio span').each(function(index) { |
|
68 |
if ($(this).hasClass('checked')){ |
|
69 |
alert('f'); |
|
70 |
} |
|
71 |
}); |
|
72 |
|
|
63 | 73 |
|
64 | 74 |
|
65 | 75 |
}); |
b/snf-astakos-app/astakos/im/templates/im/astakosgroup_form_demo.html | ||
---|---|---|
4 | 4 |
|
5 | 5 |
{% block headjs %} |
6 | 6 |
{{ block.super }} |
7 |
<script src="{{ IM_STATIC_URL }}js/quotas.js"></script> |
|
7 |
|
|
8 |
<script src="{{ IM_STATIC_URL }}js/jquery.uniform.js"></script> |
|
9 |
<script src="{{ IM_STATIC_URL }}js/quotas.js"></script> |
|
10 |
<link rel="stylesheet" href="{{ IM_STATIC_URL }}css/uniform.default.css" type="text/css" media="screen"> |
|
8 | 11 |
{% endblock %} |
9 | 12 |
<form action="" method="post" class="withlabels quotas-form">{% csrf_token %} |
10 | 13 |
|
... | ... | |
85 | 88 |
</span> |
86 | 89 |
</p> |
87 | 90 |
</div> |
88 |
<div class="double-checks"> |
|
91 |
<div class="double-checks clearfix">
|
|
89 | 92 |
<label>Max users per group</label> |
90 | 93 |
<div class="form-row"> |
91 | 94 |
<p class="clearfix"> |
... | ... | |
103 | 106 |
</div> |
104 | 107 |
|
105 | 108 |
</div> |
109 |
<!--<div class="radios clearfix"> |
|
110 |
<label>Max users per group</label> |
|
111 |
<div class="radio-wrap"> |
|
112 |
|
|
113 |
<input type="radio" name="radio1" value="1" id="vm_radio_unlimited" checked="checked"> |
|
114 |
<label for="vm_radio_unlimited">Unlimited</label> |
|
115 |
<input type="radio" name="radio1" value="0" id="vm_radio_limited" > |
|
116 |
<label for="vm_radio_limited">Limited</label> |
|
117 |
<input type="text" id="vm_radio_limited_num" name="vm_radio_limited_num"/> |
|
118 |
</div> |
|
119 |
</div>--> |
|
106 | 120 |
</fieldset> |
107 | 121 |
<fieldset id="icons"> |
108 | 122 |
<legend> |
... | ... | |
153 | 167 |
<p class="clearfix"> |
154 | 168 |
<label for="vm_per_user_limited">Limited</label> |
155 | 169 |
<input type="checkbox" id="vm_per_user_limited" name="vm_per_user_limited" class="limited"> |
156 |
<input type="text" id="vm_user_limited_num"/> |
|
170 |
<input type="text" id="vm_per_user_limited_num" name="vm_per_user_limited_num"/>
|
|
157 | 171 |
|
158 | 172 |
</p> |
159 | 173 |
</div> |
... | ... | |
186 | 200 |
<p class="clearfix"> |
187 | 201 |
<label for="cpu_per_user_limited">Limited</label> |
188 | 202 |
<input type="checkbox" id="cpu_per_user_limited" name="cpu_per_user_limited" class="limited"> |
189 |
<input type="text" id="cpu_user_limited_num"/> |
|
203 |
<input type="text" id="cpu_user_limited_num" name="cpu_user_limited_num"/>
|
|
190 | 204 |
|
191 | 205 |
</p> |
192 | 206 |
</div> |
Also available in: Unified diff