=0&&!h[a]);return a}function n(a){while(++a<=k&&!h[a]);return a}var f=a(this),l=a.map(d.split(""),function(a,b){if(a!="?")return g[a]?e.placeholder:a}),m=f.val();f.data(a.mask.dataName,function(){return a.map(l,function(a,b){return h[b]&&a!=e.placeholder?a:null}).join("")}),f.attr("readonly")||f.one("unmask",function(){f.unbind(".mask").removeData(a.mask.dataName)}).bind("focus.mask",function(){m=f.val();var b=v();u();var c=function(){b==d.length?f.caret(0,b):f.caret(b)};(a.browser.msie?c:function(){setTimeout(c,0)})()}).bind("blur.mask",function(){v(),f.val()!=m&&f.change()}).bind("keydown.mask",r).bind("keypress.mask",s).bind(b,function(){setTimeout(function(){f.caret(v(!0))},0)}),v()})}})})(jQuery)
--------------------------------------------------------------------------------
/docs/widgets/masked.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ui:masked widget
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
33 |
44 |
45 |
46 | ui:masked widget
47 |
48 | msk1 [9999]:
49 |
50 |
51 | msk1a [9999] - allow invalid:
52 |
53 |
54 | msk2 [999-999-999]:
55 |
56 |
57 | msk3 [(99) 999-999-999? / 999]:
58 |
59 |
60 | msk4 [aaaa]:
61 |
62 |
63 | msk5 [aaa999999]:
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/docs/widgets/datepicker.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ui:datepicker widget
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
31 |
32 |
33 |
34 | ui:datepicker widget
35 | date1:
36 | date1 (dd/mm/yy):
37 | date1 (max date: +2m):
38 | date1 + 2y:
39 | date1 + 1y + 4m + 5d:
40 | date1 + 10d:
41 | date1 + 1m:
42 |
43 | date2:
44 | date2 + 10d:
45 | date2 + (1y + 5d) + (1y + 1m):
46 | date2 (disabled):
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/docs/widgets/toggle.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ui:toggle widget
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
28 |
29 |
30 | ui:toggle widget
31 |
32 |
33 |
34 | a button
35 |
36 |
37 |
38 |
39 | another button
40 |
41 |
42 |
43 |
44 | icon button
45 |
46 |
47 |
48 |
49 | another icon button
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | two icons button
60 |
61 |
62 |
63 | inversion:
64 |
65 | check me
66 | uncheck me
67 |
68 |
69 |
70 |
71 |
72 | disabled toggle: another icon button
73 |
74 |
75 |
76 |
77 | simple list:
78 |
79 |
80 | press
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/css/tasks.css:
--------------------------------------------------------------------------------
1 | .ui-widget {
2 | font-family: Verdana,Arial,sans-serif;
3 | font-size: .7em;
4 | }
5 |
6 | body{
7 | font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
8 | }
9 |
10 |
11 | input, textarea{
12 | border:1px solid #888888;
13 | -webkit-border-radius: 3px;
14 | -khtml-border-radius: 3px;
15 | -moz-border-radius: 3px;
16 | border-radius: 3px;
17 | padding:4px;
18 | }
19 |
20 | input:focus, textarea:focus {
21 | outline:none;
22 | border-color:#7eaadd;
23 | box-shadow:0 0 10px #9ecaed;
24 | }
25 |
26 | textarea{
27 | font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
28 | }
29 |
30 | h1{
31 | font-family:verdana, arial;
32 | font-size:40px;
33 | text-transform:uppercase;
34 | margin:0px 0px 10px 30px;
35 | }
36 |
37 | .json{
38 | border:1px solid #888888;
39 | font-size:9px;
40 | background-color: #eeeeee;
41 | padding:10px;
42 | margin:10px;
43 | clear:both;
44 | }
45 |
46 |
47 | table.list
48 | {
49 | border-collapse:collapse;
50 | margin:0px;
51 | }
52 |
53 | table.list tbody tr:hover
54 | {
55 | background-color: #eeeeee;
56 | cursor: pointer;
57 | }
58 |
59 | div#form{
60 | border:3px solid #EEEEEE;
61 | padding:10px;
62 | }
63 |
64 |
65 | .selected
66 | {
67 | background-color: #ffdddd;
68 | }
69 |
70 | .progress-body
71 | {
72 | -webkit-border-radius: 5px;
73 | -khtml-border-radius: 5px;
74 | -moz-border-radius: 5px;
75 | border-radius: 5px;
76 | border:1px solid #333333;
77 | height:14px;
78 | width:150px;
79 | margin:3px;
80 | position:relative;
81 | }
82 |
83 | .progress-bar
84 | {
85 | background: #444; /* for non-css3 browsers */
86 |
87 | width:43%;
88 | height:100%;
89 | position:absolute;
90 | top:0px;
91 | left:0px;
92 | z-index:1;
93 | }
94 |
95 | .progress-text
96 | {
97 | position:absolute;
98 | top:0px;
99 | left:0px;
100 | z-index:2;
101 | text-align:center;
102 | font-size:.7em;
103 | width:100%;
104 | vertical-align: middle;
105 | }
106 |
107 | .emblem
108 | {
109 | width:14px;
110 | height:14px;
111 | background: url(/images/stars.png) -90px 0px no-repeat;
112 | }
113 |
114 | .emblem-star
115 | {
116 | background: url(/images/stars.png) -30px 0px no-repeat;
117 | }
118 |
119 | .emblem-star-blue
120 | {
121 | background: url(/images/stars.png) -60px 0px no-repeat;
122 | }
123 |
124 | .emblem-star-red
125 | {
126 | background: url(/images/stars.png) -0px 0px no-repeat;
127 | }
128 |
129 | .emblem-star-green
130 | {
131 | background: url(/images/stars.png) -45px 0px no-repeat;
132 | }
133 |
134 | .emblem-excl-yellow
135 | {
136 | background: url(/images/stars.png) -30px -15px no-repeat;
137 | }
138 |
139 | .emblem-excl
140 | {
141 | background: url(/images/stars.png) 0px -15px no-repeat;
142 | }
143 |
144 | .emblem-ok
145 | {
146 | background: url(/images/stars.png) -45px -15px no-repeat;
147 | }
148 |
149 | .emblem-info
150 | {
151 | background: url(/images/stars.png) -60px -15px no-repeat;
152 | }
153 |
154 | .tokens
155 | {
156 | font-size: 11px;
157 | border:2px solid #888888;
158 | -webkit-border-radius: 3px;
159 | -khtml-border-radius: 3px;
160 | -moz-border-radius: 3px;
161 | border-radius: 3px;
162 | padding:4px;
163 | margin:2px;
164 | clear:both;
165 | display:block;
166 | cursor: text;
167 | }
168 |
169 | .token
170 | {
171 | border:1px solid #888888;
172 | background-color: #cccccc;
173 | -webkit-border-radius: 2px;
174 | -khtml-border-radius: 2px;
175 | -moz-border-radius: 2px;
176 | border-radius: 2px;
177 | padding:1px;
178 | margin:2px;
179 | float:left;
180 | }
181 |
182 | #add-token, #add-token2{
183 | display:inline-block;
184 | padding: 0px;
185 | margin: 0px;
186 | }
187 |
188 |
189 |
190 | #add-token:focus, #add-token2:focus{
191 | border: none;
192 | box-shadow:0 0 0;
193 | }
194 |
195 | .tokens::after {
196 | content: ".";
197 | display: block;
198 | height: 0;
199 | clear: both;
200 | visibility: hidden;
201 | }
--------------------------------------------------------------------------------
/docs/widgets/autocomplete.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ui:autocomplete widget
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
54 |
55 |
56 |
57 | ui:autocomplete widget
58 |
59 | employee1:
60 |
61 | employee1 (delay 1200ms):
62 |
63 | employee2 (no highlight):
64 | employee3 (clear input):
65 |
66 | presets:
67 | employee4 - employee:
68 | employee6 - fast:
69 | employee7 - slow:
70 | employees list:
71 |
72 |
{{i.firstName}} {{i.lastName}} x
73 |
74 |
75 |
76 | wages:
77 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/js/lib/date.format.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Date Format 1.2.3
3 | * (c) 2007-2009 Steven Levithan
4 | * MIT license
5 | *
6 | * Includes enhancements by Scott Trenda
7 | * and Kris Kowal
8 | *
9 | * Accepts a date, a mask, or a date and a mask.
10 | * Returns a formatted version of the given date.
11 | * The date defaults to the current date/time.
12 | * The mask defaults to dateFormat.masks.default.
13 | */
14 |
15 | var dateFormat = function () {
16 | var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
17 | timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
18 | timezoneClip = /[^-+\dA-Z]/g,
19 | pad = function (val, len) {
20 | val = String(val);
21 | len = len || 2;
22 | while (val.length < len) val = "0" + val;
23 | return val;
24 | };
25 |
26 | // Regexes and supporting functions are cached through closure
27 | return function (date, mask, utc) {
28 | var dF = dateFormat;
29 |
30 | // You can't provide utc if you skip other args (use the "UTC:" mask prefix)
31 | if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
32 | mask = date;
33 | date = undefined;
34 | }
35 |
36 | // Passing date through Date applies Date.parse, if necessary
37 | date = date ? new Date(date) : new Date;
38 | if (isNaN(date)) throw SyntaxError("invalid date");
39 |
40 | mask = String(dF.masks[mask] || mask || dF.masks["default"]);
41 |
42 | // Allow setting the utc argument via the mask
43 | if (mask.slice(0, 4) == "UTC:") {
44 | mask = mask.slice(4);
45 | utc = true;
46 | }
47 |
48 | var _ = utc ? "getUTC" : "get",
49 | d = date[_ + "Date"](),
50 | D = date[_ + "Day"](),
51 | m = date[_ + "Month"](),
52 | y = date[_ + "FullYear"](),
53 | H = date[_ + "Hours"](),
54 | M = date[_ + "Minutes"](),
55 | s = date[_ + "Seconds"](),
56 | L = date[_ + "Milliseconds"](),
57 | o = utc ? 0 : date.getTimezoneOffset(),
58 | flags = {
59 | d: d,
60 | dd: pad(d),
61 | ddd: dF.i18n.dayNames[D],
62 | dddd: dF.i18n.dayNames[D + 7],
63 | m: m + 1,
64 | mm: pad(m + 1),
65 | mmm: dF.i18n.monthNames[m],
66 | mmmm: dF.i18n.monthNames[m + 12],
67 | yy: String(y).slice(2),
68 | yyyy: y,
69 | h: H % 12 || 12,
70 | hh: pad(H % 12 || 12),
71 | H: H,
72 | HH: pad(H),
73 | M: M,
74 | MM: pad(M),
75 | s: s,
76 | ss: pad(s),
77 | l: pad(L, 3),
78 | L: pad(L > 99 ? Math.round(L / 10) : L),
79 | t: H < 12 ? "a" : "p",
80 | tt: H < 12 ? "am" : "pm",
81 | T: H < 12 ? "A" : "P",
82 | TT: H < 12 ? "AM" : "PM",
83 | Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
84 | o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
85 | S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
86 | };
87 |
88 | return mask.replace(token, function ($0) {
89 | return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
90 | });
91 | };
92 | }();
93 |
94 | // Some common format strings
95 | dateFormat.masks = {
96 | "default": "ddd mmm dd yyyy HH:MM:ss",
97 | shortDate: "m/d/yy",
98 | mediumDate: "mmm d, yyyy",
99 | longDate: "mmmm d, yyyy",
100 | fullDate: "dddd, mmmm d, yyyy",
101 | shortTime: "h:MM TT",
102 | mediumTime: "h:MM:ss TT",
103 | longTime: "h:MM:ss TT Z",
104 | isoDate: "yyyy-mm-dd",
105 | isoTime: "HH:MM:ss",
106 | isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
107 | isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
108 | };
109 |
110 | // Internationalization strings
111 | dateFormat.i18n = {
112 | dayNames: [
113 | "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
114 | "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
115 | ],
116 | monthNames: [
117 | "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
118 | "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
119 | ]
120 | };
121 |
122 | // For convenience...
123 | Date.prototype.format = function (mask, utc) {
124 | return dateFormat(this, mask, utc);
125 | };
126 |
127 |
--------------------------------------------------------------------------------
/docs/widgets/selectable.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ui:selectable directive
5 |
6 |
7 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
129 |
130 |
131 | ui:selectable directive
132 |
133 |
134 |
135 |
cities (list):
136 |
142 |
143 |
144 |
145 |
cities (grid):
146 |
147 |
148 |
149 |
{{i.name}}
150 |
state : {{i.state}}
151 |
pop: : {{i.population}}
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
--------------------------------------------------------------------------------
/css/main.css:
--------------------------------------------------------------------------------
1 | .ui-widget {
2 | font-family: Verdana,Arial,sans-serif;
3 | font-size: .7em;
4 | }
5 |
6 | body{
7 | font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
8 | padding:0px;
9 | margin:20px;
10 | background-color: #DDD;
11 | background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 950, from(#fff), to(#bbb));
12 | background-image: -moz-radial-gradient(center 45deg, circle closest-corner, #fff, #bbb);
13 | }
14 |
15 |
16 | input, textarea{
17 | border:1px solid #888888;
18 | -webkit-border-radius: 3px;
19 | -khtml-border-radius: 3px;
20 | -moz-border-radius: 3px;
21 | border-radius: 3px;
22 | padding:4px;
23 | }
24 |
25 | input:focus, textarea:focus {
26 | outline:none;
27 | border-color:#7eaadd;
28 | box-shadow:0 0 10px #9ecaed;
29 | }
30 |
31 | textarea{
32 | font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
33 | }
34 |
35 | h1{
36 | font-size:45px;
37 | margin:60px 20px;
38 | color:#444;
39 | text-shadow: #777 0px 0px 4px;
40 | text-align:center;
41 | }
42 |
43 | footer
44 | {
45 | display:block;
46 | width:100%;
47 | position:fixed;
48 | text-align:center;
49 | bottom:0px;
50 | left:0px;
51 | color:#999;
52 | text-shadow: #ccc 0px 0px 2px;
53 | font-size:11px;
54 | padding:5px 0px;
55 | }
56 |
57 | footer a
58 | {
59 | text-decoration:none;
60 | color:#777;
61 |
62 |
63 | }
64 |
65 | ul.items li
66 | {
67 | margin:5px;
68 | }
69 |
70 | ul.items li a
71 | {
72 | text-decoration:none;
73 | color:#444;
74 | text-shadow: #777 0px 0px 1px;
75 | padding:0px 3px;
76 | margin:5px;
77 | background-color:#ccc;
78 | border:solid 1px #bbb;
79 | }
80 |
81 | ul.items li a:hover
82 | {
83 | color:#333;
84 | text-shadow: #555 0px 0px 3px;
85 | background-color:#bbb;
86 | border:solid 1px #aaa;
87 | }
88 |
89 |
90 |
91 | .json{
92 | border:1px solid #888888;
93 | font-size:9px;
94 | background-color: #eeeeee;
95 | padding:10px;
96 | margin:10px;
97 | clear:both;
98 | }
99 |
100 |
101 | table.list
102 | {
103 | border-collapse:collapse;
104 | margin:0px;
105 | }
106 |
107 | table.list tbody tr:hover
108 | {
109 | background-color: #eeeeee;
110 | cursor: pointer;
111 | }
112 |
113 | div#form{
114 | border:3px solid #EEEEEE;
115 | padding:10px;
116 | }
117 |
118 |
119 | .selected
120 | {
121 | background-color: #ffdddd;
122 | }
123 |
124 | .progress-body
125 | {
126 | -webkit-border-radius: 5px;
127 | -khtml-border-radius: 5px;
128 | -moz-border-radius: 5px;
129 | border-radius: 5px;
130 | border:1px solid #333333;
131 | height:14px;
132 | width:150px;
133 | margin:3px;
134 | position:relative;
135 | }
136 |
137 | .progress-bar
138 | {
139 | background: #444; /* for non-css3 browsers */
140 |
141 | width:43%;
142 | height:100%;
143 | position:absolute;
144 | top:0px;
145 | left:0px;
146 | z-index:1;
147 | }
148 |
149 | .progress-text
150 | {
151 | position:absolute;
152 | top:0px;
153 | left:0px;
154 | z-index:2;
155 | text-align:center;
156 | font-size:.7em;
157 | width:100%;
158 | vertical-align: middle;
159 | }
160 |
161 | .emblem
162 | {
163 | width:14px;
164 | height:14px;
165 | background: url(../images/stars.png) -90px 0px no-repeat;
166 | }
167 |
168 | .emblem-star
169 | {
170 | background: url(../images/stars.png) -30px 0px no-repeat;
171 | }
172 |
173 | .emblem-star-blue
174 | {
175 | background: url(../images/stars.png) -60px 0px no-repeat;
176 | }
177 |
178 | .emblem-star-red
179 | {
180 | background: url(../images/stars.png) -0px 0px no-repeat;
181 | }
182 |
183 | .emblem-star-green
184 | {
185 | background: url(../images/stars.png) -45px 0px no-repeat;
186 | }
187 |
188 | .emblem-excl-yellow
189 | {
190 | background: url(../images/stars.png) -30px -15px no-repeat;
191 | }
192 |
193 | .emblem-excl
194 | {
195 | background: url(../images/stars.png) 0px -15px no-repeat;
196 | }
197 |
198 | .emblem-ok
199 | {
200 | background: url(../images/stars.png) -45px -15px no-repeat;
201 | }
202 |
203 | .emblem-info
204 | {
205 | background: url(../images/stars.png) -60px -15px no-repeat;
206 | }
207 |
208 | .tokens
209 | {
210 | font-size: 11px;
211 | border:2px solid #888888;
212 | -webkit-border-radius: 3px;
213 | -khtml-border-radius: 3px;
214 | -moz-border-radius: 3px;
215 | border-radius: 3px;
216 | padding:4px;
217 | margin:2px;
218 | clear:both;
219 | display:block;
220 | cursor: text;
221 | }
222 |
223 | .token
224 | {
225 | border:1px solid #888888;
226 | background-color: #cccccc;
227 | -webkit-border-radius: 2px;
228 | -khtml-border-radius: 2px;
229 | -moz-border-radius: 2px;
230 | border-radius: 2px;
231 | padding:1px;
232 | margin:2px;
233 | float:left;
234 | }
235 |
236 | #add-token, #add-token2{
237 | display:inline-block;
238 | padding: 0px;
239 | margin: 0px;
240 | }
241 |
242 |
243 |
244 | #add-token:focus, #add-token2:focus{
245 | border: none;
246 | box-shadow:0 0 0;
247 | }
248 |
249 | .tokens::after {
250 | content: ".";
251 | display: block;
252 | height: 0;
253 | clear: both;
254 | visibility: hidden;
255 | }
256 |
257 | div.new{
258 | display:inline;
259 | border:1px solid #A66363;
260 | -webkit-border-radius: 3px;
261 | -khtml-border-radius: 3px;
262 | -moz-border-radius: 3px;
263 | background-color: #B07F7F;
264 | color:#fff;
265 | font-size:10px;
266 | padding:1px 3px;
267 | box-shadow:0 0 4px #A66363;
268 | vertical-align: middle;
269 | }
270 |
--------------------------------------------------------------------------------
/js/lib/jquery.maskedinput-1.3.js:
--------------------------------------------------------------------------------
1 | /*
2 | Masked Input plugin for jQuery
3 | Copyright (c) 2007-2011 Josh Bush (digitalbush.com)
4 | Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
5 | Version: 1.3
6 | */
7 | (function($) {
8 | var pasteEventName = ($.browser.msie ? 'paste' : 'input') + ".mask";
9 | var iPhone = (window.orientation != undefined);
10 |
11 | $.mask = {
12 | //Predefined character definitions
13 | definitions: {
14 | '9': "[0-9]",
15 | 'a': "[A-Za-z]",
16 | '*': "[A-Za-z0-9]"
17 | },
18 | dataName:"rawMaskFn"
19 | };
20 |
21 | $.fn.extend({
22 | //Helper Function for Caret positioning
23 | caret: function(begin, end) {
24 | if (this.length == 0) return;
25 | if (typeof begin == 'number') {
26 | end = (typeof end == 'number') ? end : begin;
27 | return this.each(function() {
28 | if (this.setSelectionRange) {
29 | this.setSelectionRange(begin, end);
30 | } else if (this.createTextRange) {
31 | var range = this.createTextRange();
32 | range.collapse(true);
33 | range.moveEnd('character', end);
34 | range.moveStart('character', begin);
35 | range.select();
36 | }
37 | });
38 | } else {
39 | if (this[0].setSelectionRange) {
40 | begin = this[0].selectionStart;
41 | end = this[0].selectionEnd;
42 | } else if (document.selection && document.selection.createRange) {
43 | var range = document.selection.createRange();
44 | begin = 0 - range.duplicate().moveStart('character', -100000);
45 | end = begin + range.text.length;
46 | }
47 | return { begin: begin, end: end };
48 | }
49 | },
50 | unmask: function() { return this.trigger("unmask"); },
51 | isMaskValid: function(){
52 | return $(this).data('mask-isvalid');
53 | },
54 | mask: function(mask, settings) {
55 | if (!mask && this.length > 0) {
56 | var input = $(this[0]);
57 | return input.data($.mask.dataName)();
58 | }
59 | settings = $.extend({
60 | placeholder: "_",
61 | completed: null
62 | }, settings);
63 |
64 | var defs = $.mask.definitions;
65 | var tests = [];
66 | var partialPosition = mask.length;
67 | var firstNonMaskPos = null;
68 | var len = mask.length;
69 |
70 | $.each(mask.split(""), function(i, c) {
71 | if (c == '?') {
72 | len--;
73 | partialPosition = i;
74 | } else if (defs[c]) {
75 | tests.push(new RegExp(defs[c]));
76 | if(firstNonMaskPos==null)
77 | firstNonMaskPos = tests.length - 1;
78 | } else {
79 | tests.push(null);
80 | }
81 | });
82 |
83 | return this.trigger("unmask").each(function() {
84 | var input = $(this);
85 | var buffer = $.map(mask.split(""), function(c, i) { if (c != '?') return defs[c] ? settings.placeholder : c });
86 | var focusText = input.val();
87 |
88 | function seekNext(pos) {
89 | while (++pos <= len && !tests[pos]);
90 | return pos;
91 | };
92 | function seekPrev(pos) {
93 | while (--pos >= 0 && !tests[pos]);
94 | return pos;
95 | };
96 |
97 | function shiftL(begin,end) {
98 | if(begin<0)
99 | return;
100 | for (var i = begin,j = seekNext(end); i < len; i++) {
101 | if (tests[i]) {
102 | if (j < len && tests[i].test(buffer[j])) {
103 | buffer[i] = buffer[j];
104 | buffer[j] = settings.placeholder;
105 | } else
106 | break;
107 | j = seekNext(j);
108 | }
109 | }
110 | writeBuffer();
111 | input.caret(Math.max(firstNonMaskPos, begin));
112 | };
113 |
114 | function shiftR(pos) {
115 | for (var i = pos, c = settings.placeholder; i < len; i++) {
116 | if (tests[i]) {
117 | var j = seekNext(i);
118 | var t = buffer[i];
119 | buffer[i] = c;
120 | if (j < len && tests[j].test(t))
121 | c = t;
122 | else
123 | break;
124 | }
125 | }
126 | };
127 |
128 | function keydownEvent(e) {
129 | var k=e.which;
130 |
131 | //backspace, delete, and escape get special treatment
132 | if(k == 8 || k == 46 || (iPhone && k == 127)){
133 | var pos = input.caret(),
134 | begin = pos.begin,
135 | end = pos.end;
136 |
137 | if(end-begin==0){
138 | begin=k!=46?seekPrev(begin):(end=seekNext(begin-1));
139 | end=k==46?seekNext(end):end;
140 | }
141 | clearBuffer(begin, end);
142 | shiftL(begin,end-1);
143 | isValid(); //twarogowski
144 |
145 | return false;
146 | } else if (k == 27) {//escape
147 | input.val(focusText);
148 | input.caret(0, checkVal());
149 | return false;
150 | }
151 | };
152 |
153 | function keypressEvent(e) {
154 | var k = e.which,
155 | pos = input.caret();
156 | if (e.ctrlKey || e.altKey || e.metaKey || k<32) {//Ignore
157 | return true;
158 | } else if (k) {
159 | if(pos.end-pos.begin!=0){
160 | clearBuffer(pos.begin, pos.end);
161 | shiftL(pos.begin, pos.end-1);
162 | isValid(); //twarogowski
163 | }
164 |
165 | var p = seekNext(pos.begin - 1);
166 | if (p < len) {
167 | var c = String.fromCharCode(k);
168 | if (tests[p].test(c)) {
169 | shiftR(p);
170 | buffer[p] = c;
171 | writeBuffer();
172 | var next = seekNext(p);
173 | input.caret(next);
174 | isValid(); //twarogowski
175 | if (settings.completed && next >= len)
176 | settings.completed.call(input);
177 | }
178 | }
179 | return false;
180 | }
181 | };
182 |
183 | function clearBuffer(start, end) {
184 | for (var i = start; i < end && i < len; i++) {
185 | if (tests[i])
186 | buffer[i] = settings.placeholder;
187 | }
188 | };
189 |
190 | function writeBuffer() { return input.val(buffer.join('')).val(); };
191 |
192 | function isValid(){
193 | var test = input.val();
194 | var lastMatch = -1;
195 | for (var i = 0, pos = 0; i < len; i++) {
196 | if (tests[i]) {
197 | buffer[i] = settings.placeholder;
198 | while (pos++ < test.length) {
199 | var c = test.charAt(pos - 1);
200 | if (tests[i].test(c)) {
201 | buffer[i] = c;
202 | lastMatch = i;
203 | break;
204 | }
205 | }
206 | if (pos > test.length)
207 | break;
208 | } else if (buffer[i] == test.charAt(pos) && i!=partialPosition) {
209 | pos++;
210 | lastMatch = i;
211 | }
212 | }
213 | var valid = (lastMatch + 1 >= partialPosition);
214 | input.data('mask-isvalid',valid);
215 | return valid;
216 | }
217 |
218 | function checkVal(allow) {
219 | //try to place characters where they belong
220 | var test = input.val();
221 | var lastMatch = -1;
222 | for (var i = 0, pos = 0; i < len; i++) {
223 | if (tests[i]) {
224 | buffer[i] = settings.placeholder;
225 | while (pos++ < test.length) {
226 | var c = test.charAt(pos - 1);
227 | if (tests[i].test(c)) {
228 | buffer[i] = c;
229 | lastMatch = i;
230 | break;
231 | }
232 | }
233 | if (pos > test.length)
234 | break;
235 | } else if (buffer[i] == test.charAt(pos) && i!=partialPosition) {
236 | pos++;
237 | lastMatch = i;
238 | }
239 | }
240 | if (!allow && lastMatch + 1 < partialPosition) {
241 | input.val("");
242 | clearBuffer(0, len);
243 | } else if (allow || lastMatch + 1 >= partialPosition) {
244 | writeBuffer();
245 | if (!allow) input.val(input.val().substring(0, lastMatch + 1));
246 | }
247 | return (partialPosition ? i : firstNonMaskPos);
248 | };
249 |
250 | input.data($.mask.dataName,function(){
251 | return $.map(buffer, function(c, i) {
252 | return tests[i]&&c!=settings.placeholder ? c : null;
253 | }).join('');
254 | })
255 |
256 | if (!input.attr("readonly"))
257 | input
258 | .one("unmask", function() {
259 | input
260 | .unbind(".mask")
261 | .removeData($.mask.dataName);
262 | })
263 | .bind("focus.mask", function() {
264 | focusText = input.val();
265 | var pos = checkVal();
266 | writeBuffer();
267 | var moveCaret=function(){
268 | if (pos == mask.length)
269 | input.caret(0, pos);
270 | else
271 | input.caret(pos);
272 | };
273 | ($.browser.msie ? moveCaret:function(){setTimeout(moveCaret,0)})();
274 | })
275 | .bind("blur.mask", function() {
276 | checkVal();
277 | if (input.val() != focusText)
278 | input.change();
279 | })
280 | .bind("keydown.mask", keydownEvent)
281 | .bind("keypress.mask", keypressEvent)
282 | .bind(pasteEventName, function() {
283 | setTimeout(function() { input.caret(checkVal(true)); }, 0);
284 | });
285 |
286 | checkVal(); //Perform initial check for existing values
287 | });
288 | }
289 | });
290 | })(jQuery);
291 |
--------------------------------------------------------------------------------
/js/lib/underscore-min.js:
--------------------------------------------------------------------------------
1 | // Underscore.js 1.1.6
2 | // (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
3 | // Underscore is freely distributable under the MIT license.
4 | // Portions of Underscore are inspired or borrowed from Prototype,
5 | // Oliver Steele's Functional, and John Resig's Micro-Templating.
6 | // For all details and documentation:
7 | // http://documentcloud.github.com/underscore
8 | (function(){var p=this,C=p._,m={},i=Array.prototype,n=Object.prototype,f=i.slice,D=i.unshift,E=n.toString,l=n.hasOwnProperty,s=i.forEach,t=i.map,u=i.reduce,v=i.reduceRight,w=i.filter,x=i.every,y=i.some,o=i.indexOf,z=i.lastIndexOf;n=Array.isArray;var F=Object.keys,q=Function.prototype.bind,b=function(a){return new j(a)};typeof module!=="undefined"&&module.exports?(module.exports=b,b._=b):p._=b;b.VERSION="1.1.6";var h=b.each=b.forEach=function(a,c,d){if(a!=null)if(s&&a.forEach===s)a.forEach(c,d);else if(b.isNumber(a.length))for(var e=
9 | 0,k=a.length;e=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,
13 | c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};h(a,function(a,b,f){b=c?c.call(d,a,b,f):a;bd?1:0}),"value")};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.zip=function(){for(var a=f.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),
16 | e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}};b.keys=F||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],d;for(d in a)l.call(a,d)&&(b[b.length]=d);return b};b.values=function(a){return b.map(a,
20 | b.identity)};b.functions=b.methods=function(a){return b.filter(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a){h(f.call(arguments,1),function(b){for(var d in b)b[d]!==void 0&&(a[d]=b[d])});return a};b.defaults=function(a){h(f.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,c){if(a===c)return!0;var d=typeof a;if(d!=
21 | typeof c)return!1;if(a==c)return!0;if(!a&&c||a&&!c)return!1;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return!1;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return!1;if(a.length&&a.length!==c.length)return!1;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return!1;
22 | for(var f in a)if(!(f in c)||!b.isEqual(a[f],c[f]))return!1;return!0};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(l.call(a,c))return!1;return!0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=n||function(a){return E.call(a)==="[object Array]"};b.isArguments=function(a){return!(!a||!l.call(a,"callee"))};b.isFunction=function(a){return!(!a||!a.constructor||!a.call||!a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};
23 | b.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===!0||a===!1};b.isDate=function(a){return!(!a||!a.getTimezoneOffset||!a.setUTCFullYear)};b.isRegExp=function(a){return!(!a||!a.test||!a.exec||!(a.ignoreCase||a.ignoreCase===!1))};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.noConflict=function(){p._=C;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=
24 | 0;e/g,interpolate:/<%=([\s\S]+?)%>/g};b.template=function(a,c){var d=b.templateSettings;d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(d.evaluate||
25 | null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');";d=new Function("obj",d);return c?d(c):d};var j=function(a){this._wrapped=a};b.prototype=j.prototype;var r=function(a,c){return c?b(a).chain():a},H=function(a,c){j.prototype[a]=function(){var a=f.call(arguments);D.call(a,this._wrapped);return r(c.apply(b,a),this._chain)}};b.mixin(b);h(["pop","push","reverse","shift","sort",
26 | "splice","unshift"],function(a){var b=i[a];j.prototype[a]=function(){b.apply(this._wrapped,arguments);return r(this._wrapped,this._chain)}});h(["concat","join","slice"],function(a){var b=i[a];j.prototype[a]=function(){return r(b.apply(this._wrapped,arguments),this._chain)}});j.prototype.chain=function(){this._chain=!0;return this};j.prototype.value=function(){return this._wrapped}})();
27 |
--------------------------------------------------------------------------------
/js/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | false
109 |
110 |
111 |
112 | 1310156913729
113 | 1310156913729
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
--------------------------------------------------------------------------------
/angular-contrib.sublime-project:
--------------------------------------------------------------------------------
1 | {
2 | "auto_complete":
3 | {
4 | "selected_items":
5 | [
6 | [
7 | "ve",
8 | "vertical"
9 | ],
10 | [
11 | "ali",
12 | "align"
13 | ],
14 | [
15 | "ver",
16 | "vertical: vertical-align: type"
17 | ],
18 | [
19 | "he",
20 | "height"
21 | ],
22 | [
23 | "bot",
24 | "bottom"
25 | ],
26 | [
27 | "mar",
28 | "margin: margin: all"
29 | ],
30 | [
31 | "a",
32 | "align"
33 | ],
34 | [
35 | "i",
36 | "isString"
37 | ],
38 | [
39 | "dis",
40 | "display: display: block"
41 | ],
42 | [
43 | "s",
44 | "size"
45 | ],
46 | [
47 | "back",
48 | "background: background-color: hex"
49 | ],
50 | [
51 | "parse",
52 | "parseExpr"
53 | ],
54 | [
55 | "wi",
56 | "width"
57 | ],
58 | [
59 | "sty",
60 | "style"
61 | ],
62 | [
63 | "bor",
64 | "border: border-width: size"
65 | ],
66 | [
67 | "div",
68 | "div"
69 | ],
70 | [
71 | "li",
72 | "list: list-style-type: other"
73 | ],
74 | [
75 | "display",
76 | "display: display: block"
77 | ],
78 | [
79 | "backgro",
80 | "background: background-color: hex"
81 | ],
82 | [
83 | "border",
84 | "border: border-width: size"
85 | ],
86 | [
87 | "h4",
88 | "h4"
89 | ],
90 | [
91 | "ch",
92 | "checkbox"
93 | ],
94 | [
95 | "but",
96 | "buttonOptions"
97 | ],
98 | [
99 | "hover",
100 | "hover (pseudo-class)"
101 | ],
102 | [
103 | "overflo",
104 | "overflow: overflow: type"
105 | ],
106 | [
107 | "margin",
108 | "margin: margin-right: length"
109 | ],
110 | [
111 | "posi",
112 | "position: position: type"
113 | ],
114 | [
115 | "hei",
116 | "height: (property)"
117 | ],
118 | [
119 | "width",
120 | "width: (property)"
121 | ],
122 | [
123 | "bod",
124 | "body (element)"
125 | ],
126 | [
127 | "for",
128 | "for: for (…) {…}"
129 | ],
130 | [
131 | "ex",
132 | "expression"
133 | ],
134 | [
135 | "item",
136 | "itemExpr"
137 | ],
138 | [
139 | "at",
140 | "attrName"
141 | ],
142 | [
143 | "padd",
144 | "padding: padding: all"
145 | ],
146 | [
147 | "font",
148 | "font: font: size font"
149 | ],
150 | [
151 | "ja",
152 | "javascript"
153 | ],
154 | [
155 | "text",
156 | "text"
157 | ],
158 | [
159 | "ty",
160 | "type"
161 | ],
162 | [
163 | "backgrou",
164 | "background: background-color: hex"
165 | ],
166 | [
167 | "si",
168 | "size"
169 | ],
170 | [
171 | "ul",
172 | "ul"
173 | ],
174 | [
175 | "h1",
176 | "h1"
177 | ],
178 | [
179 | "lo",
180 | "load"
181 | ],
182 | [
183 | "label",
184 | "label"
185 | ],
186 | [
187 | "pi",
188 | "pinDraggable"
189 | ],
190 | [
191 | "attrEx",
192 | "attrExpr"
193 | ],
194 | [
195 | "attr",
196 | "attrExpr"
197 | ],
198 | [
199 | "att",
200 | "attrExpr"
201 | ],
202 | [
203 | "backgr",
204 | "background: background-color: hex"
205 | ],
206 | [
207 | "tex",
208 | "text"
209 | ],
210 | [
211 | "bo",
212 | "bold"
213 | ],
214 | [
215 | "fon",
216 | "font: font-family: family"
217 | ],
218 | [
219 | "fun",
220 | "fun: Function"
221 | ]
222 | ]
223 | },
224 | "buffers":
225 | [
226 | {
227 | "file": "/opt/node/apps/angular-contrib/js/angular-widgets.js",
228 | "settings":
229 | {
230 | "buffer_size": 18561,
231 | "line_ending": "Unix"
232 | }
233 | },
234 | {
235 | "file": "/opt/node/apps/angular-contrib/docs/widgets/masked.html",
236 | "settings":
237 | {
238 | "buffer_size": 1964,
239 | "line_ending": "Unix"
240 | }
241 | },
242 | {
243 | "file": "/opt/node/apps/angular-contrib/js/lib/jquery.maskedinput-1.3.js",
244 | "settings":
245 | {
246 | "buffer_size": 6823,
247 | "line_ending": "Unix"
248 | }
249 | }
250 | ],
251 | "build_system": "",
252 | "command_palette":
253 | {
254 | "height": 192,
255 | "selected_items":
256 | [
257 | [
258 | "clo",
259 | "File: Close All"
260 | ],
261 | [
262 | "sa",
263 | "File: Save All"
264 | ],
265 | [
266 | "save",
267 | "File: Save All"
268 | ],
269 | [
270 | "close",
271 | "File: Close All"
272 | ],
273 | [
274 | "sav",
275 | "File: Save All"
276 | ],
277 | [
278 | "",
279 | "Snippet: Lorem ipsum"
280 | ]
281 | ],
282 | "width": 467
283 | },
284 | "distraction_free":
285 | {
286 | "menu_visible": true,
287 | "show_minimap": false,
288 | "show_tabs": false,
289 | "side_bar_visible": false,
290 | "status_bar_visible": false
291 | },
292 | "file_history":
293 | [
294 | "/home/lukasz/Switch_Scrpts_/CountI.xml",
295 | "/home/lukasz/Switch_Scrpts_/CountI.js",
296 | "/home/lukasz/Switch_Scrpts_/CountI.sfixture",
297 | "/opt/node/apps/angular-contrib/docs/widgets/progress.html",
298 | "/opt/node/apps/angular-contrib/docs/widgets/map.html",
299 | "/opt/node/apps/angular-contrib/docs/widgets/masked.html",
300 | "/opt/node/apps/angular-contrib/css/main.css",
301 | "/opt/node/apps/angular-contrib/docs/widgets.html",
302 | "/opt/node/apps/angular-contrib/index.html",
303 | "/opt/node/apps/angular-contrib/docs/widgets/button.html",
304 | "/opt/node/apps/angular-contrib/js/angular-formatters.js",
305 | "/opt/node/apps/angular-contrib/js/angular-services.js",
306 | "/opt/node/apps/angular-contrib/js/angular-widgets.js",
307 | "/opt/node/apps/angular-contrib/docs/widgets/autocomplete.html",
308 | "/opt/node/apps/angular-contrib/docs/widgets/datepicker.html",
309 | "/opt/node/apps/angular-contrib/docs/widgets/emblem.html",
310 | "/opt/node/apps/angular-contrib/docs/widgets/enter.html",
311 | "/opt/node/apps/angular-contrib/docs/widgets/selectable.html",
312 | "/opt/node/apps/angular-contrib/docs/widgets/toggle.html",
313 | "/opt/node/apps/twarogowski.github.com/css/main.css",
314 | "/opt/node/apps/angular-contrib/css/tasks.css",
315 | "/opt/node/apps/angular-contrib/json/employees.json",
316 | "/opt/node/apps/angular-contrib/autocomplete.html",
317 | "/opt/node/apps/angular-contrib/selectable.html",
318 | "/opt/node/apps/twarogowski.github.com/index.html",
319 | "/opt/node/apps/angular-contrib/emblem.html",
320 | "/opt/node/apps/angular-contrib/button.html",
321 | "/opt/node/apps/angular-contrib/enter.html",
322 | "/opt/node/apps/angular-contrib/map.html",
323 | "/opt/node/apps/angular-contrib/progress.html",
324 | "/opt/node/apps/angular-contrib/toggle.html",
325 | "/opt/node/apps/angular-contrib/datepicker.html",
326 | "/etc/nginx/nginx.conf",
327 | "/opt/node/apps/Invoices/public/javascripts/task-controller.js",
328 | "/opt/node/apps/Invoices/public/javascripts/angular-services.js",
329 | "/opt/node/apps/Invoices/public/javascripts/angular-formatters.js",
330 | "/opt/node/apps/Invoices/public/tests/angular/progress.html",
331 | "/opt/node/apps/Invoices/public/tests/angular/selectable.html",
332 | "/opt/node/apps/Invoices/public/javascripts/angular-widgets.js",
333 | "/opt/node/apps/Invoices/public/tests/angular/toggle.html",
334 | "/opt/node/apps/Invoices/public/tests/angular/button.html",
335 | "/opt/node/apps/Invoices/public/stylesheets/tasks.css",
336 | "/home/lukasz/.config/sublime-text-2/Packages/Default/Base File.sublime-settings",
337 | "/home/lukasz/.config/sublime-text-2/Packages/User/Base File.sublime-settings",
338 | "/opt/node/apps/Invoices/public/tests/angular/emblem.html",
339 | "/opt/node/apps/Invoices/public/tests/angular/index.html",
340 | "/opt/node/apps/Invoices/public/javascripts/angular-0.9.16.min.js",
341 | "/home/lukasz/.gvfs/ftp as axiomcom on axiomcomputing.pl/public_html/bolesc.pl/index.html",
342 | "/opt/node/apps/Invoices/public/tests/angular/autocomplete.html",
343 | "/opt/node/apps/Invoices/public/tests/angular/datepicker.html",
344 | "/opt/node/apps/Invoices/public/tests/angular/enter.html",
345 | "/opt/node/apps/Invoices/public/tests/angular/map.html",
346 | "/opt/node/apps/Invoices/public/tasks.html",
347 | "/opt/node/apps/Invoices/public/index.html",
348 | "/opt/node/apps/Invoices/push.sh",
349 | "/opt/node/apps/Invoices/public/javascripts/angular-0.9.16.js",
350 | "/opt/node/apps/Invoices/public/stylesheets/style.css",
351 | "/opt/node/apps/Invoices/controllers/task.js",
352 | "/opt/node/apps/Invoices/controllers/customer.js",
353 | "/opt/node/apps/Invoices/public/angular-datepicker-tests.html",
354 | "/opt/node/apps/Invoices/public/images/stars.png",
355 | "/opt/node/apps/Invoices/public/cache.manifest_",
356 | "/opt/node/apps/Invoices/public/cache.manifest",
357 | "/opt/node/apps/Invoices/public/stylesheets/smoothness/jquery-ui-1.8.13.custom.css",
358 | "/home/lukasz/.config/sublime-text-2/Packages/Zen/Default.sublime-keymap",
359 | "/home/lukasz/.config/sublime-text-2/Packages/Zen/zencoding/tags",
360 | "/home/lukasz/.config/sublime-text-2/Packages/Zen/README.txt",
361 | "/home/lukasz/.config/sublime-text-2/Packages/Default/Global.sublime-settings",
362 | "/opt/node/apps/Invoices/public/stylesheets/forms.css",
363 | "/opt/node/apps/Invoices/public/javascripts/jquery-1.6.min.js",
364 | "/opt/node/apps/Invoices/model/model.js"
365 | ],
366 | "find_in_files":
367 | {
368 | "include_history":
369 | [
370 | ],
371 | "location_history":
372 | [
373 | ]
374 | },
375 | "find_state":
376 | {
377 | "case_sensitive": false,
378 | "find_history":
379 | [
380 | " href=\"/stylesheets/",
381 | "');
81 | $(el).append(d1);
82 | $(d1).mask(maskExpr.expression);
83 |
84 | function handleEvent(){
85 | var um = d1.mask();
86 | var valid = d1.isMaskValid();
87 | if(!options.allowInvalid && !valid)
88 | um='';
89 | if(valid)
90 | d1.addClass('mask-valid').removeClass('mask-invalid');
91 | else
92 | d1.addClass('mask-invalid').removeClass('mask-valid');
93 | if(isvalidExpr)
94 | widgetUtils.setValue(currentScope, isvalidExpr, valid);
95 | widgetUtils.setValue(currentScope, valExpr, um);
96 | }
97 |
98 | d1.keypress(handleEvent).keydown(handleEvent);
99 | currentScope.$watch(valExpr.expression, function(val){
100 | var d = widgetUtils.formatValue(val, valExpr, currentScope);
101 | var old = d1.mask();
102 | if(old!=d)
103 | d1.val(d).trigger('blur.mask');
104 | }, null, true);
105 | };
106 | });
107 |
108 |
109 |
110 |
111 |
112 | // ui:button widget
113 | // simple jQuery styled button
114 | angular.widget('ui:button', function(el) {
115 | var compiler = this;
116 | var defaults = {};
117 | var clickExpr = widgetUtils.parseAttrExpr(el, 'ui:click');
118 | var iconsExpr = widgetUtils.parseAttrExpr(el, 'ui:icons');
119 | var disabledExpr = widgetUtils.parseAttrExpr(el, 'ui:disabled');
120 | var icons = null;
121 | var elTxt = $(el).text();
122 | var inHtml = $(el).html()
123 | var viewTxt = (inHtml && inHtml!='') ? angular.compile('' + inHtml + ' ') : null;
124 | if(iconsExpr){
125 | icons = {};
126 | var arr = iconsExpr.expression.split(',');
127 | if(arr.length > 0)
128 | icons.primary = arr[0];
129 | if(arr.length > 1)
130 | icons.secondary = arr[1];
131 | }
132 | var buttonOptions = {};
133 | if(icons)
134 | buttonOptions.icons = icons;
135 | if(!elTxt || elTxt == '')
136 | buttonOptions.text = false;
137 | return function(el) {
138 | var currentScope = this;
139 | var b = $(' ');
140 | if(viewTxt)
141 | g = viewTxt(currentScope);
142 | if(elTxt && elTxt != '')
143 | b.text(elTxt);
144 | else
145 | b.text('_');
146 | el.text('').append(b);
147 | $(b).button(buttonOptions);
148 | if(clickExpr)
149 | $(b).click(function(){ currentScope.$tryEval(clickExpr.expression, el); });
150 | if(disabledExpr)
151 | currentScope.$watch(disabledExpr.expression, function(val){
152 | var d = widgetUtils.formatValue(val, disabledExpr, currentScope);
153 | $(b).button('option','disabled', d);
154 | }, null, true);
155 | };
156 | });
157 |
158 |
159 |
160 | // ui:toggle widget
161 | // simple jQuery styled 2-state button
162 | angular.widget('ui:toggle', function(el) {
163 | var compiler = this;
164 | var defaults = {};
165 | var iconsExpr = widgetUtils.parseAttrExpr(el, 'ui:icons');
166 | var disabledExpr = widgetUtils.parseAttrExpr(el, 'ui:disabled');
167 | var valExpr = widgetUtils.parseAttrExpr(el, 'ui:value');
168 | var icons = null;
169 | var elTxt = $(el).text();
170 | var inHtml = $(el).html()
171 | var viewTxt = (inHtml && inHtml!='') ? angular.compile('' + inHtml + ' ') : null;
172 | if(iconsExpr){
173 | icons = {};
174 | var arr = iconsExpr.expression.split(',');
175 | if(arr.length > 0)
176 | icons.primary = arr[0];
177 | if(arr.length > 1)
178 | icons.secondary = arr[1];
179 | }
180 | var buttonOptions = {};
181 | if(icons)
182 | buttonOptions.icons = icons;
183 | if(!elTxt || elTxt == '')
184 | buttonOptions.text = false;
185 | return function(el) {
186 | var currentScope = this;
187 | var rnd = 'tog_'+(((1+Math.random())*0x10000000)|0).toString(16).substring(1)
188 | var b = $(' ');
189 | var l = $(' ');
190 | if(viewTxt)
191 | g = viewTxt(currentScope);
192 | if(elTxt && elTxt != '')
193 | l.text(elTxt);
194 | else
195 | l.text('_');
196 | el.text('').append(b).append(l);
197 | $(b).button(buttonOptions);
198 | if(valExpr){
199 | $(b).click(function(){
200 | var checked = $(b).attr('checked') == 'checked';
201 | widgetUtils.setValue(currentScope, valExpr, checked);
202 | });
203 | currentScope.$watch(valExpr.expression, function(val){
204 | var ch = widgetUtils.formatValue(val, valExpr, currentScope);
205 | $(b).attr('checked', ch).button('refresh');
206 | }, null, true);
207 | }
208 |
209 | if(disabledExpr)
210 | currentScope.$watch(disabledExpr.expression, function(val){
211 | var d = widgetUtils.formatValue(val, disabledExpr, currentScope);
212 | $(b).button('option','disabled', d);
213 | }, null, true);
214 | };
215 | });
216 |
217 |
218 |
219 | // ui:progess widget
220 | // progress bar
221 | angular.widget('ui:progress', function(el) {
222 | var compiler = this;
223 | var defaults = {minValue: 0, maxValue: 100, showText: true, minColor: '#cccccc', maxColor: '#1aad0c'};
224 | var options = widgetUtils.getOptions(el, defaults);
225 | var valueExpr = widgetUtils.parseAttrExpr(el, 'ui:value');
226 | return function(el) {
227 | var currentScope = this;
228 | var d1 = $('
');
229 | $(el).append(d1);
230 | var d2 = $('
');
231 | $(d1).append(d2);
232 | if(options.showText){
233 | var d3 = $('
');
234 | $(d1).append(d3);
235 | }
236 | currentScope.$watch(valueExpr.expression, function(val) {
237 | var v = parseFloat(widgetUtils.formatValue(val, valueExpr, currentScope)) || 0, r0 = parseFloat(options.minValue), r1=parseFloat(options.maxValue);
238 | var perc = Math.max(Math.min(Math.round(Math.min((v - r0) / (r1 - r0), r1) * 100), 100), 0);
239 | $(d3).html(perc + '%');
240 | $(d2).css('width', perc+'%');
241 | if($.xcolor){
242 | var c = $.xcolor.gradientlevel(options.minColor, options.maxColor, perc, 100);
243 | (d2).css('background-color', c.getCSS());
244 | }
245 | }, null, true);
246 | };
247 | });
248 |
249 |
250 |
251 | // ui:emblem widget
252 | // clickable emblem widget, sort of 'multiple state checkbox'
253 | angular.widget('ui:emblem', function(el) {
254 | var compiler = this;
255 | var defaults = {emblems: ['', 'star', 'excl']};
256 | var options = widgetUtils.getOptions(el, defaults);
257 | var symbolExpr = widgetUtils.parseAttrExpr(el, 'ui:symbol');
258 | return function(el) {
259 | var currentScope = this;
260 | var d1 = $('
').click(function(){
261 | var s0 = $(el).data('symbol');
262 | var i = 0;
263 | if(s0)
264 | i = _(options.emblems).indexOf(s0);
265 | i++;
266 | if(i>options.emblems.length-1)
267 | i=0;
268 | var emblem = options.emblems[i];
269 | $(d1).removeClass('emblem-' + s0).addClass('emblem-' + emblem);
270 | $(el).data('symbol', emblem);
271 | widgetUtils.setValue(currentScope, symbolExpr, emblem);
272 | });
273 | $(el).append(d1);
274 | currentScope.$watch(symbolExpr.expression, function(val) {
275 | var v = widgetUtils.formatValue(val, symbolExpr, currentScope);
276 | var s0 = $(el).data('symbol');
277 | $(el).data('symbol', v);
278 | $(d1).removeClass('emblem-' + s0).addClass('emblem-' + v);
279 | }, null, true);
280 | };
281 | });
282 |
283 |
284 |
285 | // ui:autocomplete widget
286 | // jQuery UI autocomplete
287 | angular.widget('@ui:autocomplete', function(expr, el, val) {
288 |
289 | var compiler = this;
290 | var defaults = {
291 | renderName: function(item){ return item.firstName + ' ' + item.lastName;},
292 | renderItem: function(term, item){
293 | var hl = this.highlight ? (this.highlightFunction || widgetUtils.highlight) : widgetUtils.noHighlight;
294 | return $(' ').append(hl(term, options.renderName(item)));
295 | },
296 | clearOnSelect: false,
297 | delay: 50,
298 | highlight: true
299 | };
300 | var opt = widgetUtils.getOptions(el, {});
301 | var options = {};
302 | var presetName = $(el).attr('ui:preset');
303 | var itemExpr = widgetUtils.parseAttrExpr(el, 'ui:item');
304 | var linkFn = function($xhr, $log, presets, el) {
305 | var currentScope = this;
306 | var preset = null;
307 | if(presets && presetName)
308 | preset = presets.get(presetName) || {};
309 | var ac;
310 |
311 | $.extend(options, defaults, preset, opt);
312 | var events = {
313 | source: function(req, res){
314 | $xhr('GET', options.urls.list + req.term, function(code, response){
315 | res(response);
316 | });
317 | },
318 | select: function(event, ui){
319 | var txt = '';
320 | if(!options.clearOnSelect)
321 | txt = (options.renderText || options.renderName)(ui.item);
322 | $(el).val(txt).blur();
323 | if(options.onSelect)
324 | options.onSelect(ui.item);
325 | if(itemExpr)
326 | widgetUtils.setValue(currentScope, itemExpr, ui.item);
327 | return options.clearOnSelect;
328 | },
329 | focus: function(event, ui){
330 | var txt = (options.renderText || options.renderName)(ui.item);
331 | $(el).val(txt);
332 | return false;
333 | }
334 | };
335 |
336 | var renderFn = {
337 | _renderItem: function(ul, item){
338 | $(' ').data('item.autocomplete', item).append(options.renderItem(this.term, item)).appendTo(ul);
339 | }
340 | };
341 |
342 | $.extend(options, events);
343 | ac = $(el).autocomplete(options).data('autocomplete');
344 | $.extend(ac, renderFn);
345 |
346 | if(itemExpr && itemExpr.expression)
347 | currentScope.$watch(itemExpr.expression, function(val){
348 | var txt;
349 | if(val)
350 | txt = (options.renderText || options.renderName)(val);
351 | $(el).val(txt).blur();
352 | }, null, true);
353 |
354 | };
355 | linkFn.$inject = ['$xhr', '$log', 'autocompletePresets'];
356 | return linkFn;
357 | });
358 |
359 |
360 |
361 | // ui:datepicker widget
362 | // jQuery UI datepicker
363 | angular.widget('@ui:datepicker', function(expr, el, val) {
364 | if(!$.datepicker)
365 | return;
366 | var compiler = this;
367 | var defaults = {dateFormat: 'dd-mm-yy'};
368 | var options = widgetUtils.getOptions(el, defaults);
369 | var events = {};
370 | var dateExpr = widgetUtils.parseAttrExpr(el, 'ui:date');
371 | return function(el) {
372 | var currentScope = this
373 | var tagName = $(el)[0].tagName.toLowerCase();
374 | if(tagName == 'input' || tagName == 'textarea')
375 | events.onClose = function(date, ui){
376 | var dt = $(el).datepicker('getDate');
377 | widgetUtils.setValue(currentScope, dateExpr, dt);
378 | };
379 | else
380 | events.onSelect = function(date, ui){
381 | var dt = $(el).datepicker('getDate');
382 | widgetUtils.setValue(currentScope, dateExpr, dt);
383 | };
384 | $.extend(options, events);
385 | $(el).datepicker(options);
386 | currentScope.$watch(dateExpr.expression, function(val){
387 | if(val && val instanceof Date)
388 | $(el).datepicker('setDate', widgetUtils.formatValue(val, dateExpr, currentScope));
389 | }, null, true);
390 | };
391 | });
392 |
393 |
394 |
395 | // ui:map widget
396 | // Google Maps API v. 3.5
397 | angular.widget('ui:map', function(el) {
398 | if(!google || !google.maps)
399 | return;
400 | var compiler = this;
401 | var elem = el;
402 | var pinExpr = widgetUtils.parseAttrExpr(el, 'ui:pin');
403 | var viewExpr = widgetUtils.parseAttrExpr(el, 'ui:view');
404 | var defaults = {bindZoom : false, bindMapType: false, center: {lat:0, lng:0}, pinDraggable: true, map: {zoom: 4, mapTypeId: google.maps.MapTypeId.ROADMAP}};
405 | var options = widgetUtils.getOptions(el, defaults);
406 | defaults.map.center = new google.maps.LatLng(defaults.center.lat, defaults.center.lng);
407 | return function(el) {
408 | var currentScope = this;
409 | $(elem).append('
')
410 | var div = ('div', elem).get(0);
411 | var map = new google.maps.Map(div,options.map);
412 | var marker = new google.maps.Marker({ position: map.center, map: map});
413 | marker.setDraggable(options.pinDraggable);
414 |
415 | google.maps.event.addListener(map, 'click', function(e) {
416 | marker.setPosition(e.latLng);
417 | marker.setVisible(true);
418 | var o = widgetUtils.getValue(currentScope, pinExpr) || {};
419 | $.extend(o, {lat:e.latLng.lat(), lng:e.latLng.lng()});
420 | widgetUtils.setValue(currentScope, pinExpr, o);
421 | });
422 |
423 | google.maps.event.addListener(marker, 'dragend', function(e) {
424 | var o = widgetUtils.getValue(currentScope, pinExpr) || {};
425 | $.extend(o, {lat: e.latLng.lat(), lng: e.latLng.lng()});
426 | widgetUtils.setValue(currentScope, pinExpr, o);
427 | });
428 |
429 | google.maps.event.addListener(map, 'dragend', function() {
430 | var c = map.getCenter();
431 | var o = widgetUtils.getValue(currentScope, viewExpr) || {};
432 | $.extend(o, {lat: c.lat(), lng: c.lng()});
433 | widgetUtils.setValue(currentScope, viewExpr, o);
434 | });
435 |
436 | if(defaults.bindZoom)
437 | google.maps.event.addListener(map, 'zoom_changed', function() {
438 | var c = map.getCenter();
439 | var z = map.getZoom();
440 | var o = widgetUtils.getValue(currentScope, viewExpr) || {};
441 | $.extend(o, {lat: c.lat(), lng: c.lng(), zoom: z});
442 | widgetUtils.setValue(currentScope, viewExpr, o);
443 | });
444 |
445 | if(defaults.bindMapType)
446 | google.maps.event.addListener(map, 'maptypeid_changed', function() {
447 | var t = map.getMapTypeId();
448 | var o = widgetUtils.getValue(currentScope, viewExpr) || {};
449 | $.extend(o, {mapType: t});
450 | widgetUtils.setValue(currentScope, viewExpr, o);
451 | });
452 |
453 | $(elem).data('map', map);
454 | $(elem).data('marker', marker);
455 |
456 | currentScope.$watch(pinExpr.expression + '.lat', function() {
457 | var map = $(elem).data('map');
458 | var marker = $(elem).data('marker');
459 | var newPos = widgetUtils.getValue(currentScope, pinExpr);
460 | if(!newPos || !newPos.lat || !newPos.lng){
461 | marker.setVisible(false);
462 | return;
463 | }
464 | marker.setPosition(new google.maps.LatLng(newPos.lat, newPos.lng));
465 | marker.setVisible(true);
466 | }, null, true);
467 |
468 | currentScope.$watch(pinExpr.expression + '.lng', function() {
469 | var map = $(elem).data('map');
470 | var marker = $(elem).data('marker');
471 | var newPos = widgetUtils.getValue(currentScope, pinExpr);
472 | if(!newPos || !newPos.lat || !newPos.lng){
473 | marker.setVisible(false);
474 | return;
475 | }
476 | marker.setPosition(new google.maps.LatLng(newPos.lat, newPos.lng));
477 | marker.setVisible(true);
478 | }, null, true);
479 |
480 | currentScope.$watch(viewExpr.expression + '.lng', function() {
481 | var map = $(elem).data('map');
482 | var newPos = widgetUtils.getValue(currentScope, viewExpr);
483 | if(newPos)
484 | map.setCenter(new google.maps.LatLng(newPos.lat, newPos.lng));
485 | }, null, true);
486 |
487 | currentScope.$watch(viewExpr.expression + '.lat', function() {
488 | var map = $(elem).data('map');
489 | var newPos = widgetUtils.getValue(currentScope, viewExpr);
490 | if(newPos)
491 | map.setCenter(new google.maps.LatLng(newPos.lat, newPos.lng));
492 | }, null, true);
493 |
494 | if(defaults.bindMapType)
495 | currentScope.$watch(viewExpr.expression + '.mapType', function(val) {
496 | var map = $(elem).data('map');
497 | if(val)
498 | map.setMapTypeId(val);
499 | }, null, true);
500 |
501 | if(defaults.bindZoom)
502 | currentScope.$watch(viewExpr.expression + '.zoom', function(val) {
503 | var map = $(elem).data('map');
504 | if(val)
505 | map.setZoom(val);
506 | }, null, true);
507 |
508 | };
509 | });
510 |
511 |
512 |
513 | // ui:enter directive
514 | // calls a function when ENTER is pressed
515 | angular.directive('ui:enter', function(expr, el) {
516 | return function(el) {
517 | var compiler = this;
518 | $(el).keyup(function(event){
519 | if(event.keyCode == 13){
520 | compiler.$tryEval(expr, el);
521 | $(el).val('');
522 | compiler.$parent.$eval();
523 | event.stopPropagation();
524 | }
525 | });
526 | };
527 | });
528 |
529 |
530 |
531 | // handy widgets functions
532 | var widgetUtils = {
533 | highlight: function(term, text){
534 | if(!text)
535 | return null;
536 | var rx = new RegExp("("+$.ui.autocomplete.escapeRegex(term)+")", "ig" );
537 | return text.replace(rx, "$1 ");
538 | },
539 | noHighlight: function(term, text){
540 | return text;
541 | },
542 | getOptions : function (el, defaults, attrName){
543 | attrName = attrName || 'ui:options';
544 | var opts = $(el).attr(attrName);
545 | defaults = defaults || {};
546 | if(!opts)
547 | return defaults;
548 | var options = angular.fromJson('['+opts+']')[0];
549 | return $.extend(defaults, options);
550 | },
551 | parseExpr: function(val){
552 | if(!val || val=='')
553 | return null;
554 | var expr = {formatters:[]};
555 | var pts = val.split('|');
556 | expr.expression = pts[0];
557 | if(pts.length==1)
558 | return expr;
559 | for (var i = 0; i < pts.length; i++){
560 | var args = pts[i].split(':');
561 | var name = args.shift();
562 | var frmt = angular.formatter[name];
563 | if(frmt)
564 | expr.formatters.push({name: name, parse: frmt.parse, format: frmt.format, arguments: args});
565 | }
566 | return expr;
567 | },
568 | parseAttrExpr: function (el, attrName){
569 | if(!attrName)
570 | return null;
571 | var attr = $(el).attr(attrName);
572 | return this.parseExpr(attr);
573 | },
574 | setValue: function (scope, attrExpr, value){
575 | if(!attrExpr || !attrExpr.expression)
576 | return;
577 | var v = value;
578 | v = this.parseValue(v, attrExpr, scope);
579 | scope.$set(attrExpr.expression, v);
580 | scope.$parent.$eval();
581 | },
582 | getValue: function (scope, attrExpr){
583 | if(!attrExpr || !attrExpr.expression)
584 | return null;
585 | var val = scope.$get(attrExpr.expression);
586 | val = this.formatValue(val, attrExpr, scope);
587 | return val;
588 | },
589 | parseValue: function (value, attrExpr, scope){
590 | if(!attrExpr || !attrExpr.formatters || attrExpr.formatters.length==0)
591 | return value;
592 | var v = value;
593 | for (var i = 0; i < attrExpr.formatters.length; i++) {
594 | var fm = attrExpr.formatters[i];
595 | if(fm && fm.parse)
596 | v = fm.parse.apply(scope, [v].concat(fm.arguments));
597 | };
598 | return v;
599 | },
600 | formatValue: function (value, attrExpr, scope){
601 | if(!attrExpr || !attrExpr.formatters || attrExpr.formatters.length==0)
602 | return value;
603 | var v = value;
604 | for (var i = 0; i < attrExpr.formatters.length; i++) {
605 | var fm = attrExpr.formatters[i];
606 | if(fm && fm.format)
607 | v = fm.format.apply(scope, [v].concat(fm.arguments));
608 | };
609 | return v;
610 | }
611 | };
612 |
--------------------------------------------------------------------------------
/css/smoothness/jquery-ui-1.8.14.custom.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI CSS Framework 1.8.14
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/Theming/API
9 | */
10 |
11 | /* Layout helpers
12 | ----------------------------------*/
13 | .ui-helper-hidden { display: none; }
14 | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17 | .ui-helper-clearfix { display: inline-block; }
18 | /* required comment for clearfix to work in Opera \*/
19 | * html .ui-helper-clearfix { height:1%; }
20 | .ui-helper-clearfix { display:block; }
21 | /* end clearfix */
22 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23 |
24 |
25 | /* Interaction Cues
26 | ----------------------------------*/
27 | .ui-state-disabled { cursor: default !important; }
28 |
29 |
30 | /* Icons
31 | ----------------------------------*/
32 |
33 | /* states and images */
34 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35 |
36 |
37 | /* Misc visuals
38 | ----------------------------------*/
39 |
40 | /* Overlays */
41 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42 |
43 |
44 | /*
45 | * jQuery UI CSS Framework 1.8.14
46 | *
47 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
48 | * Dual licensed under the MIT or GPL Version 2 licenses.
49 | * http://jquery.org/license
50 | *
51 | * http://docs.jquery.com/UI/Theming/API
52 | *
53 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
54 | */
55 |
56 |
57 | /* Component containers
58 | ----------------------------------*/
59 | .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
60 | .ui-widget .ui-widget { font-size: 1em; }
61 | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
62 | .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
63 | .ui-widget-content a { color: #222222; }
64 | .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
65 | .ui-widget-header a { color: #222222; }
66 |
67 | /* Interaction states
68 | ----------------------------------*/
69 | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
70 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
71 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
72 | .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
73 | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
74 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
75 | .ui-widget :active { outline: none; }
76 |
77 | /* Interaction Cues
78 | ----------------------------------*/
79 | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
80 | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
81 | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
82 | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
83 | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
84 | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
85 | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
86 | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
87 |
88 | /* Icons
89 | ----------------------------------*/
90 |
91 | /* states and images */
92 | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
93 | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
94 | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
95 | .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
96 | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
97 | .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
98 | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
99 | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
100 |
101 | /* positioning */
102 | .ui-icon-carat-1-n { background-position: 0 0; }
103 | .ui-icon-carat-1-ne { background-position: -16px 0; }
104 | .ui-icon-carat-1-e { background-position: -32px 0; }
105 | .ui-icon-carat-1-se { background-position: -48px 0; }
106 | .ui-icon-carat-1-s { background-position: -64px 0; }
107 | .ui-icon-carat-1-sw { background-position: -80px 0; }
108 | .ui-icon-carat-1-w { background-position: -96px 0; }
109 | .ui-icon-carat-1-nw { background-position: -112px 0; }
110 | .ui-icon-carat-2-n-s { background-position: -128px 0; }
111 | .ui-icon-carat-2-e-w { background-position: -144px 0; }
112 | .ui-icon-triangle-1-n { background-position: 0 -16px; }
113 | .ui-icon-triangle-1-ne { background-position: -16px -16px; }
114 | .ui-icon-triangle-1-e { background-position: -32px -16px; }
115 | .ui-icon-triangle-1-se { background-position: -48px -16px; }
116 | .ui-icon-triangle-1-s { background-position: -64px -16px; }
117 | .ui-icon-triangle-1-sw { background-position: -80px -16px; }
118 | .ui-icon-triangle-1-w { background-position: -96px -16px; }
119 | .ui-icon-triangle-1-nw { background-position: -112px -16px; }
120 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
121 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
122 | .ui-icon-arrow-1-n { background-position: 0 -32px; }
123 | .ui-icon-arrow-1-ne { background-position: -16px -32px; }
124 | .ui-icon-arrow-1-e { background-position: -32px -32px; }
125 | .ui-icon-arrow-1-se { background-position: -48px -32px; }
126 | .ui-icon-arrow-1-s { background-position: -64px -32px; }
127 | .ui-icon-arrow-1-sw { background-position: -80px -32px; }
128 | .ui-icon-arrow-1-w { background-position: -96px -32px; }
129 | .ui-icon-arrow-1-nw { background-position: -112px -32px; }
130 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
131 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
132 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
133 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
134 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
135 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
136 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
137 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
138 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
139 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
140 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
141 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
142 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
143 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
144 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
145 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
146 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
147 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
148 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
149 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
150 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
151 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
152 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
153 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
154 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
155 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
156 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
157 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
158 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
159 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
160 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
161 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
162 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
163 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
164 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
165 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
166 | .ui-icon-arrow-4 { background-position: 0 -80px; }
167 | .ui-icon-arrow-4-diag { background-position: -16px -80px; }
168 | .ui-icon-extlink { background-position: -32px -80px; }
169 | .ui-icon-newwin { background-position: -48px -80px; }
170 | .ui-icon-refresh { background-position: -64px -80px; }
171 | .ui-icon-shuffle { background-position: -80px -80px; }
172 | .ui-icon-transfer-e-w { background-position: -96px -80px; }
173 | .ui-icon-transferthick-e-w { background-position: -112px -80px; }
174 | .ui-icon-folder-collapsed { background-position: 0 -96px; }
175 | .ui-icon-folder-open { background-position: -16px -96px; }
176 | .ui-icon-document { background-position: -32px -96px; }
177 | .ui-icon-document-b { background-position: -48px -96px; }
178 | .ui-icon-note { background-position: -64px -96px; }
179 | .ui-icon-mail-closed { background-position: -80px -96px; }
180 | .ui-icon-mail-open { background-position: -96px -96px; }
181 | .ui-icon-suitcase { background-position: -112px -96px; }
182 | .ui-icon-comment { background-position: -128px -96px; }
183 | .ui-icon-person { background-position: -144px -96px; }
184 | .ui-icon-print { background-position: -160px -96px; }
185 | .ui-icon-trash { background-position: -176px -96px; }
186 | .ui-icon-locked { background-position: -192px -96px; }
187 | .ui-icon-unlocked { background-position: -208px -96px; }
188 | .ui-icon-bookmark { background-position: -224px -96px; }
189 | .ui-icon-tag { background-position: -240px -96px; }
190 | .ui-icon-home { background-position: 0 -112px; }
191 | .ui-icon-flag { background-position: -16px -112px; }
192 | .ui-icon-calendar { background-position: -32px -112px; }
193 | .ui-icon-cart { background-position: -48px -112px; }
194 | .ui-icon-pencil { background-position: -64px -112px; }
195 | .ui-icon-clock { background-position: -80px -112px; }
196 | .ui-icon-disk { background-position: -96px -112px; }
197 | .ui-icon-calculator { background-position: -112px -112px; }
198 | .ui-icon-zoomin { background-position: -128px -112px; }
199 | .ui-icon-zoomout { background-position: -144px -112px; }
200 | .ui-icon-search { background-position: -160px -112px; }
201 | .ui-icon-wrench { background-position: -176px -112px; }
202 | .ui-icon-gear { background-position: -192px -112px; }
203 | .ui-icon-heart { background-position: -208px -112px; }
204 | .ui-icon-star { background-position: -224px -112px; }
205 | .ui-icon-link { background-position: -240px -112px; }
206 | .ui-icon-cancel { background-position: 0 -128px; }
207 | .ui-icon-plus { background-position: -16px -128px; }
208 | .ui-icon-plusthick { background-position: -32px -128px; }
209 | .ui-icon-minus { background-position: -48px -128px; }
210 | .ui-icon-minusthick { background-position: -64px -128px; }
211 | .ui-icon-close { background-position: -80px -128px; }
212 | .ui-icon-closethick { background-position: -96px -128px; }
213 | .ui-icon-key { background-position: -112px -128px; }
214 | .ui-icon-lightbulb { background-position: -128px -128px; }
215 | .ui-icon-scissors { background-position: -144px -128px; }
216 | .ui-icon-clipboard { background-position: -160px -128px; }
217 | .ui-icon-copy { background-position: -176px -128px; }
218 | .ui-icon-contact { background-position: -192px -128px; }
219 | .ui-icon-image { background-position: -208px -128px; }
220 | .ui-icon-video { background-position: -224px -128px; }
221 | .ui-icon-script { background-position: -240px -128px; }
222 | .ui-icon-alert { background-position: 0 -144px; }
223 | .ui-icon-info { background-position: -16px -144px; }
224 | .ui-icon-notice { background-position: -32px -144px; }
225 | .ui-icon-help { background-position: -48px -144px; }
226 | .ui-icon-check { background-position: -64px -144px; }
227 | .ui-icon-bullet { background-position: -80px -144px; }
228 | .ui-icon-radio-off { background-position: -96px -144px; }
229 | .ui-icon-radio-on { background-position: -112px -144px; }
230 | .ui-icon-pin-w { background-position: -128px -144px; }
231 | .ui-icon-pin-s { background-position: -144px -144px; }
232 | .ui-icon-play { background-position: 0 -160px; }
233 | .ui-icon-pause { background-position: -16px -160px; }
234 | .ui-icon-seek-next { background-position: -32px -160px; }
235 | .ui-icon-seek-prev { background-position: -48px -160px; }
236 | .ui-icon-seek-end { background-position: -64px -160px; }
237 | .ui-icon-seek-start { background-position: -80px -160px; }
238 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
239 | .ui-icon-seek-first { background-position: -80px -160px; }
240 | .ui-icon-stop { background-position: -96px -160px; }
241 | .ui-icon-eject { background-position: -112px -160px; }
242 | .ui-icon-volume-off { background-position: -128px -160px; }
243 | .ui-icon-volume-on { background-position: -144px -160px; }
244 | .ui-icon-power { background-position: 0 -176px; }
245 | .ui-icon-signal-diag { background-position: -16px -176px; }
246 | .ui-icon-signal { background-position: -32px -176px; }
247 | .ui-icon-battery-0 { background-position: -48px -176px; }
248 | .ui-icon-battery-1 { background-position: -64px -176px; }
249 | .ui-icon-battery-2 { background-position: -80px -176px; }
250 | .ui-icon-battery-3 { background-position: -96px -176px; }
251 | .ui-icon-circle-plus { background-position: 0 -192px; }
252 | .ui-icon-circle-minus { background-position: -16px -192px; }
253 | .ui-icon-circle-close { background-position: -32px -192px; }
254 | .ui-icon-circle-triangle-e { background-position: -48px -192px; }
255 | .ui-icon-circle-triangle-s { background-position: -64px -192px; }
256 | .ui-icon-circle-triangle-w { background-position: -80px -192px; }
257 | .ui-icon-circle-triangle-n { background-position: -96px -192px; }
258 | .ui-icon-circle-arrow-e { background-position: -112px -192px; }
259 | .ui-icon-circle-arrow-s { background-position: -128px -192px; }
260 | .ui-icon-circle-arrow-w { background-position: -144px -192px; }
261 | .ui-icon-circle-arrow-n { background-position: -160px -192px; }
262 | .ui-icon-circle-zoomin { background-position: -176px -192px; }
263 | .ui-icon-circle-zoomout { background-position: -192px -192px; }
264 | .ui-icon-circle-check { background-position: -208px -192px; }
265 | .ui-icon-circlesmall-plus { background-position: 0 -208px; }
266 | .ui-icon-circlesmall-minus { background-position: -16px -208px; }
267 | .ui-icon-circlesmall-close { background-position: -32px -208px; }
268 | .ui-icon-squaresmall-plus { background-position: -48px -208px; }
269 | .ui-icon-squaresmall-minus { background-position: -64px -208px; }
270 | .ui-icon-squaresmall-close { background-position: -80px -208px; }
271 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
272 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
273 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
274 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
275 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
276 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
277 |
278 |
279 | /* Misc visuals
280 | ----------------------------------*/
281 |
282 | /* Corner radius */
283 | .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
284 | .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
285 | .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
286 | .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
287 |
288 | /* Overlays */
289 | .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
290 | .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
291 | * jQuery UI Selectable 1.8.14
292 | *
293 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
294 | * Dual licensed under the MIT or GPL Version 2 licenses.
295 | * http://jquery.org/license
296 | *
297 | * http://docs.jquery.com/UI/Selectable#theming
298 | */
299 | .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
300 | /*
301 | * jQuery UI Autocomplete 1.8.14
302 | *
303 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
304 | * Dual licensed under the MIT or GPL Version 2 licenses.
305 | * http://jquery.org/license
306 | *
307 | * http://docs.jquery.com/UI/Autocomplete#theming
308 | */
309 | .ui-autocomplete { position: absolute; cursor: default; }
310 |
311 | /* workarounds */
312 | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
313 |
314 | /*
315 | * jQuery UI Menu 1.8.14
316 | *
317 | * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
318 | * Dual licensed under the MIT or GPL Version 2 licenses.
319 | * http://jquery.org/license
320 | *
321 | * http://docs.jquery.com/UI/Menu#theming
322 | */
323 | .ui-menu {
324 | list-style:none;
325 | padding: 2px;
326 | margin: 0;
327 | display:block;
328 | float: left;
329 | }
330 | .ui-menu .ui-menu {
331 | margin-top: -3px;
332 | }
333 | .ui-menu .ui-menu-item {
334 | margin:0;
335 | padding: 0;
336 | zoom: 1;
337 | float: left;
338 | clear: left;
339 | width: 100%;
340 | }
341 | .ui-menu .ui-menu-item a {
342 | text-decoration:none;
343 | display:block;
344 | padding:.2em .4em;
345 | line-height:1.5;
346 | zoom:1;
347 | }
348 | .ui-menu .ui-menu-item a.ui-state-hover,
349 | .ui-menu .ui-menu-item a.ui-state-active {
350 | font-weight: normal;
351 | margin: -1px;
352 | }
353 | /*
354 | * jQuery UI Button 1.8.14
355 | *
356 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
357 | * Dual licensed under the MIT or GPL Version 2 licenses.
358 | * http://jquery.org/license
359 | *
360 | * http://docs.jquery.com/UI/Button#theming
361 | */
362 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
363 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
364 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
365 | .ui-button-icons-only { width: 3.4em; }
366 | button.ui-button-icons-only { width: 3.7em; }
367 |
368 | /*button text element */
369 | .ui-button .ui-button-text { display: block; line-height: 1.4; }
370 | .ui-button-text-only .ui-button-text { padding: .4em 1em; }
371 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
372 | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
373 | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
374 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
375 | /* no icon support for input elements, provide padding by default */
376 | input.ui-button { padding: .4em 1em; }
377 |
378 | /*button icon element(s) */
379 | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
380 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
381 | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
382 | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
383 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
384 |
385 | /*button sets*/
386 | .ui-buttonset { margin-right: 7px; }
387 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
388 |
389 | /* workarounds */
390 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
391 | /*
392 | * jQuery UI Datepicker 1.8.14
393 | *
394 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
395 | * Dual licensed under the MIT or GPL Version 2 licenses.
396 | * http://jquery.org/license
397 | *
398 | * http://docs.jquery.com/UI/Datepicker#theming
399 | */
400 | .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
401 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
402 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
403 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
404 | .ui-datepicker .ui-datepicker-prev { left:2px; }
405 | .ui-datepicker .ui-datepicker-next { right:2px; }
406 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
407 | .ui-datepicker .ui-datepicker-next-hover { right:1px; }
408 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
409 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
410 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
411 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
412 | .ui-datepicker select.ui-datepicker-month,
413 | .ui-datepicker select.ui-datepicker-year { width: 49%;}
414 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
415 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
416 | .ui-datepicker td { border: 0; padding: 1px; }
417 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
418 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
419 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
420 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
421 |
422 | /* with multiple calendars */
423 | .ui-datepicker.ui-datepicker-multi { width:auto; }
424 | .ui-datepicker-multi .ui-datepicker-group { float:left; }
425 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
426 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
427 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
428 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
429 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
430 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
431 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
432 | .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
433 |
434 | /* RTL support */
435 | .ui-datepicker-rtl { direction: rtl; }
436 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
437 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
438 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
439 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
440 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
441 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
442 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
443 | .ui-datepicker-rtl .ui-datepicker-group { float:right; }
444 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
445 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
446 |
447 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
448 | .ui-datepicker-cover {
449 | display: none; /*sorry for IE5*/
450 | display/**/: block; /*sorry for IE5*/
451 | position: absolute; /*must have*/
452 | z-index: -1; /*must have*/
453 | filter: mask(); /*must have*/
454 | top: -4px; /*must have*/
455 | left: -4px; /*must have*/
456 | width: 200px; /*must have*/
457 | height: 200px; /*must have*/
458 | }
--------------------------------------------------------------------------------
/js/lib/jquery.xcolor.js:
--------------------------------------------------------------------------------
1 | /**
2 | * jQuery xcolor plugin
3 | * Copyright (c) 2010, Robert Eisele (robert@xarg.org)
4 | * Dual licensed under the MIT or GPL Version 2 licenses.
5 | * Date: 06/21/2010
6 | *
7 | * @author Robert Eisele
8 | * @version 1.6
9 | *
10 | * @see http://www.xarg.org/project/jquery-color-plugin-xcolor/
11 | **/
12 |
13 | (function ($) {
14 |
15 | // http://www.w3.org/TR/css3-color/#svg-color
16 | var color_names = {
17 | transparent: 16777216,
18 | aliceblue: 15792383,
19 | antiquewhite: 16444375,
20 | aqua: 65535,
21 | aquamarine: 8388564,
22 | azure: 15794175,
23 | beige: 16119260,
24 | bisque: 16770244,
25 | black: 0,
26 | blanchedalmond: 16772045,
27 | blue: 255,
28 | blueviolet: 9055202,
29 | brown: 10824234,
30 | burlywood: 14596231,
31 | cadetblue: 6266528,
32 | chartreuse: 8388352,
33 | chocolate: 13789470,
34 | coral: 16744272,
35 | cornflowerblue: 6591981,
36 | cornsilk: 16775388,
37 | crimson: 14423100,
38 | cyan: 65535,
39 | darkblue: 139,
40 | darkcyan: 35723,
41 | darkgoldenrod: 12092939,
42 | darkgray: 11119017,
43 | darkgreen: 25600,
44 | darkgrey: 11119017,
45 | darkkhaki: 12433259,
46 | darkmagenta: 9109643,
47 | darkolivegreen: 5597999,
48 | darkorange: 16747520,
49 | darkorchid: 10040012,
50 | darkred: 9109504,
51 | darksalmon: 15308410,
52 | darkseagreen: 9419919,
53 | darkslateblue: 4734347,
54 | darkslategray: 3100495,
55 | darkslategrey: 3100495,
56 | darkturquoise: 52945,
57 | darkviolet: 9699539,
58 | deeppink: 16716947,
59 | deepskyblue: 49151,
60 | dimgray: 6908265,
61 | dimgrey: 6908265,
62 | dodgerblue: 2003199,
63 | firebrick: 11674146,
64 | floralwhite: 16775920,
65 | forestgreen: 2263842,
66 | fuchsia: 16711935,
67 | gainsboro: 14474460,
68 | ghostwhite: 16316671,
69 | gold: 16766720,
70 | goldenrod: 14329120,
71 | gray: 8421504,
72 | green: 32768,
73 | greenyellow: 11403055,
74 | grey: 8421504,
75 | honeydew: 15794160,
76 | hotpink: 16738740,
77 | indianred: 13458524,
78 | indigo: 4915330,
79 | ivory: 16777200,
80 | khaki: 15787660,
81 | lavender: 15132410,
82 | lavenderblush: 16773365,
83 | lawngreen: 8190976,
84 | lemonchiffon: 16775885,
85 | lightblue: 11393254,
86 | lightcoral: 15761536,
87 | lightcyan: 14745599,
88 | lightgoldenrodyellow: 16448210,
89 | lightgray: 13882323,
90 | lightgreen: 9498256,
91 | lightgrey: 13882323,
92 | lightpink: 16758465,
93 | lightsalmon: 16752762,
94 | lightseagreen: 2142890,
95 | lightskyblue: 8900346,
96 | lightslategray: 7833753,
97 | lightslategrey: 7833753,
98 | lightsteelblue: 11584734,
99 | lightyellow: 16777184,
100 | lime: 65280,
101 | limegreen: 3329330,
102 | linen: 16445670,
103 | magenta: 16711935,
104 | maroon: 8388608,
105 | mediumaquamarine: 6737322,
106 | mediumblue: 205,
107 | mediumorchid: 12211667,
108 | mediumpurple: 9662683,
109 | mediumseagreen: 3978097,
110 | mediumslateblue: 8087790,
111 | mediumspringgreen: 64154,
112 | mediumturquoise: 4772300,
113 | mediumvioletred: 13047173,
114 | midnightblue: 1644912,
115 | mintcream: 16121850,
116 | mistyrose: 16770273,
117 | moccasin: 16770229,
118 | navajowhite: 16768685,
119 | navy: 128,
120 | oldlace: 16643558,
121 | olive: 8421376,
122 | olivedrab: 7048739,
123 | orange: 16753920,
124 | orangered: 16729344,
125 | orchid: 14315734,
126 | palegoldenrod: 15657130,
127 | palegreen: 10025880,
128 | paleturquoise: 11529966,
129 | palevioletred: 14381203,
130 | papayawhip: 16773077,
131 | peachpuff: 16767673,
132 | peru: 13468991,
133 | pink: 16761035,
134 | plum: 14524637,
135 | powderblue: 11591910,
136 | purple: 8388736,
137 | red: 16711680,
138 | rosybrown: 12357519,
139 | royalblue: 4286945,
140 | saddlebrown: 9127187,
141 | salmon: 16416882,
142 | sandybrown: 16032864,
143 | seagreen: 3050327,
144 | seashell: 16774638,
145 | sienna: 10506797,
146 | silver: 12632256,
147 | skyblue: 8900331,
148 | slateblue: 6970061,
149 | slategray: 7372944,
150 | slategrey: 7372944,
151 | snow: 16775930,
152 | springgreen: 65407,
153 | steelblue: 4620980,
154 | tan: 13808780,
155 | teal: 32896,
156 | thistle: 14204888,
157 | tomato: 16737095,
158 | turquoise: 4251856,
159 | violet: 15631086,
160 | wheat: 16113331,
161 | white: 16777215,
162 | whitesmoke: 16119285,
163 | yellow: 16776960,
164 | yellowgreen: 10145074
165 | };
166 |
167 | /**
168 | * @constructor
169 | */
170 | function xColor(color) {
171 |
172 | function _normalize(n, s) {
173 |
174 | var m;
175 |
176 | if (void 0 !== n) {
177 | n = parseFloat(n);
178 | }
179 |
180 | if (void 0 === s) {
181 | s = 255;
182 | m = 255;
183 | } else if (1 === s) {
184 |
185 | if (void 0 === n || 1 === n) {
186 | return 1;
187 | }
188 | s = 100;
189 | m = 1;
190 | } else {
191 | m = s;
192 | }
193 |
194 | if (isNaN(n) || n <= 0) {
195 | return 0;
196 | }
197 |
198 | if (s < n) {
199 | return m;
200 | }
201 |
202 | if (n < 1 || 1 === s) {
203 | if (m === 1) {
204 | return n;
205 | } else {
206 | return (n * m) | 0;
207 | }
208 | }
209 | return n * m / s;
210 | }
211 |
212 | function _hsl(h,s,l) {
213 |
214 | h = _normalize(h, 360) / 360;
215 | s = _normalize(s, 1);
216 | l = _normalize(l, 1);
217 |
218 | if (0 === s) {
219 | l = Math.round(l * 255);
220 | return [l, l, l];
221 | }
222 |
223 | function _hue(v1, v2, h) {
224 | if (h < 0) ++h;
225 | if (h > 1) --h;
226 | if (6 * h < 1) return v1 + (v2 - v1) * 6 * h;
227 | if (2 * h < 1) return v2;
228 | if (3 * h < 2) return v1 + (v2 - v1) * (4 - 6 * h);
229 | return v1;
230 | }
231 |
232 | var v = l < 0.5 ? (l + l * s) : (l + s - l * s);
233 | var m = l + l - v;
234 |
235 | return [
236 | Math.round(255 *_hue(m, v, h + 1 / 3)),
237 | Math.round(255 *_hue(m, v, h)),
238 | Math.round(255 *_hue(m, v, h - 1 / 3)) ];
239 | }
240 |
241 | function _hsv(h,s,v) {
242 |
243 | h = _normalize(h, 360) / 60;
244 | s = _normalize(s, 1);
245 | v = _normalize(v, 1);
246 |
247 | var hi = h|0;
248 | var f = h - hi;
249 |
250 | f = (h & 1) ? f : 1 - f;
251 |
252 | var m = Math.round(255 * (v * (1 - s)));
253 | var n = Math.round(255 * (v * (1 - s * f)));
254 |
255 | v = Math.round(255 * v);
256 |
257 | switch (hi) {
258 | case 6:
259 | case 0:
260 | return [v, n, m];
261 | case 1:
262 | return [n, v, m];
263 | case 2:
264 | return [m, v, n];
265 | case 3:
266 | return [m, n, v];
267 | case 4:
268 | return [n, m, v];
269 | case 5:
270 | return [v, m, n];
271 | }
272 | }
273 |
274 | this.setColor = function (color) {
275 |
276 | this.success = true;
277 |
278 | if (typeof color === "number") {
279 |
280 | this.a =((color >> 24) & 0xff) / 255;
281 | this.r = (color >> 16) & 0xff;
282 | this.g = (color >> 8) & 0xff;
283 | this.b = (color ) & 0xff;
284 | return;
285 | }
286 |
287 | while (typeof color === "object") {
288 |
289 | if (0 in color && 1 in color && 2 in color) {
290 | this.a = _normalize(color[3], 1);
291 | this.r = _normalize(color[0]);
292 | this.g = _normalize(color[1]);
293 | this.b = _normalize(color[2]);
294 | return;
295 | } else if ('r' in color && 'g' in color && 'b' in color) {
296 | this.a = _normalize(color.a, 1);
297 | this.r = _normalize(color.r);
298 | this.g = _normalize(color.g);
299 | this.b = _normalize(color.b);
300 | return;
301 | } else if ('h' in color && 's' in color) {
302 |
303 | var rgb;
304 |
305 | if ('l' in color) {
306 | rgb = _hsl(color.h, color.s, color.l);
307 | } else if ('v' in color) {
308 | rgb = _hsv(color.h, color.s, color.v);
309 | } else if ('b' in color) {
310 | rgb = _hsv(color.h, color.s, color.b);
311 | } else {
312 | break;
313 | }
314 |
315 | this.a = _normalize(color.a, 1);
316 | this.r = rgb[0];
317 | this.g = rgb[1];
318 | this.b = rgb[2];
319 | return;
320 | }
321 | break;
322 | }
323 |
324 | if (typeof color !== "string") {
325 | this.success = false;
326 | return;
327 | }
328 |
329 | color = color.toLowerCase().replace(/[^a-z0-9,.()#%]/g, '');
330 |
331 | var part, c;
332 |
333 | if (color in color_names) {
334 |
335 | c = color_names[color];
336 |
337 | this.a =(!((c >> 24) & 0xff))|0;
338 | this.r = ((c >> 16) & 0xff);
339 | this.g = ((c >> 8) & 0xff);
340 | this.b = ((c ) & 0xff);
341 | return;
342 | }
343 |
344 | // 53892983
345 | if (part = /^([1-9]\d*)$/.exec(color)) {
346 |
347 | c = parseInt(part[1], 10);
348 |
349 | this.a =(((c >> 24) & 0xff) || 255) / 255;
350 | this.r = ((c >> 16) & 0xff);
351 | this.g = ((c >> 8) & 0xff);
352 | this.b = ((c ) & 0xff);
353 | return;
354 | }
355 |
356 | // #ff9000, #ff0000
357 | if (part = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color)) {
358 | this.a = 1;
359 | this.r = parseInt(part[1], 16);
360 | this.g = parseInt(part[2], 16);
361 | this.b = parseInt(part[3], 16);
362 | return;
363 | }
364 |
365 | // #f00, fff
366 | if (part = /^#?([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color)) {
367 | this.a = 1;
368 | this.r = parseInt(part[1] + part[1], 16);
369 | this.g = parseInt(part[2] + part[2], 16);
370 | this.b = parseInt(part[3] + part[3], 16);
371 | return;
372 | }
373 |
374 | // rgb(1, 234, 56)
375 | if (part = /^rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,([0-9.]+))?\)$/.exec(color)) {
376 | this.a = _normalize(part[5], 1);
377 | this.r = _normalize(part[1]);
378 | this.g = _normalize(part[2]);
379 | this.b = _normalize(part[3]);
380 | return;
381 | }
382 |
383 | // rgb(66%, 55%, 44%) in [0,100]%, [0,100]%, [0,100]%
384 | if (part = /^rgba?\(([0-9.]+\%),([0-9.]+\%),([0-9.]+\%)(,([0-9.]+)\%?)?\)$/.exec(color)) {
385 | this.a = _normalize(part[5], 1);
386 | this.r = Math.round(_normalize(part[1], 100) * 2.55);
387 | this.g = Math.round(_normalize(part[2], 100) * 2.55);
388 | this.b = Math.round(_normalize(part[3], 100) * 2.55);
389 | return;
390 | }
391 |
392 | // hsv(64, 40, 16) in [0, 360], [0,100], [0,100]
393 | if (part = /^hs([bvl])a?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,([0-9.]+))?\)$/.exec(color)) {
394 | var func;
395 | if (part[1] === "l") {
396 | func = _hsl;
397 | } else {
398 | func = _hsv;
399 | }
400 |
401 | c = func(parseInt(part[2], 10), parseInt(part[3], 10), parseInt(part[4], 10));
402 |
403 | this.a = _normalize(part[6], 1);
404 | this.r = c[0];
405 | this.g = c[1];
406 | this.b = c[2];
407 | return;
408 | }
409 |
410 | // 1, 234, 56
411 | if (part = /^(\d{1,3}),(\d{1,3}),(\d{1,3})(,([0-9.]+))?$/.exec(color)) {
412 | this.a = _normalize(part[5], 1);
413 | this.r = _normalize(part[1]);
414 | this.g = _normalize(part[2]);
415 | this.b = _normalize(part[3]);
416 | return;
417 | }
418 |
419 | this.success = false;
420 | }
421 |
422 | this.getColor = function (type) {
423 |
424 | if (void 0 !== type) switch (type.toLowerCase()) {
425 | case "rgb":
426 | return this.getRGB();
427 | case "hsv":
428 | case "hsb":
429 | return this.getHSV();
430 | case "hsl":
431 | return this.getHSL();
432 | case "int":
433 | return this.getInt();
434 | case "array":
435 | return this.getArray();
436 | case "fraction":
437 | return this.getFraction();
438 | case "css":
439 | case "style":
440 | return this.getCSS();
441 | case "name":
442 | return this.getName();
443 | }
444 | return this.getHex();
445 | }
446 |
447 | this.getRGB = function () {
448 |
449 | if (this.success) {
450 |
451 | return {
452 | r: this.r,
453 | g: this.g,
454 | b: this.b,
455 | a: this.a
456 | };
457 | }
458 | return null;
459 | }
460 |
461 | this.getCSS = function () {
462 |
463 | if (this.success) {
464 |
465 | if (this.a == 1) {
466 | return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
467 | }
468 | return 'rgba(' + this.r + ', ' + this.g + ', ' + this.b + ', ' + this.a + ')';
469 | }
470 | return null;
471 | }
472 |
473 | this.getArray = function () {
474 |
475 | if (this.success) {
476 | return [this.r, this.g, this.b, this.a * 100 | 0];
477 | }
478 | return null;
479 | }
480 |
481 | this.getName = function () {
482 |
483 | if (this.success) {
484 |
485 | var lowest = null;
486 | var lowest_ndx;
487 |
488 | var table = color_names;
489 |
490 | var a = this.getHSL();
491 |
492 | for (var i in table) {
493 |
494 | /* We do not handle transparency */
495 | var b = new xColor(table[i]).getHSL();
496 |
497 | var tmp = Math.sqrt(0.5 * (a.h - b.h) * (a.h - b.h) + 0.5 * (a.s - b.s) * (a.s - b.s) + (a.l - b.l) * (a.l - b.l));
498 |
499 | if (null === lowest || tmp < lowest) {
500 | lowest = tmp;
501 | lowest_ndx = i;
502 | }
503 | }
504 | return lowest_ndx;
505 | }
506 | return null;
507 | }
508 |
509 | this.getFraction = function () {
510 |
511 | if (this.success) {
512 |
513 | return {
514 | r: this.r / 255,
515 | g: this.g / 255,
516 | b: this.b / 255,
517 | a: this.a
518 | };
519 | }
520 | return null;
521 | }
522 |
523 | this.getHSL = function () {
524 |
525 | // inspiration: http://130.113.54.154/~monger/hsl-rgb.html
526 | if (this.success) {
527 |
528 | var r = this.r / 255;
529 | var g = this.g / 255;
530 | var b = this.b / 255;
531 |
532 | var min = Math.min(r, g, b);
533 | var max = Math.max(r, g, b);
534 | var delta = max - min;
535 |
536 | var h, s, l = (max + min) / 2;
537 |
538 | if (0 == delta) {
539 | h = 0;
540 | s = 0;
541 | } else {
542 |
543 | if (max == r) {
544 | h = (g - b) / delta;
545 | } else if (max == g) {
546 | h = 2 + (b - r) / delta;
547 | } else if (max == b) {
548 | h = 4 + (r - g) / delta;
549 | }
550 |
551 | if (h < 0) {
552 | h+= 6;
553 | }
554 | s = delta / (l < 0.5 ? max + min : 2 - max - min);
555 | }
556 | return {
557 | h: Math.round(h * 60),
558 | s: Math.round(s * 100),
559 | l: Math.round(l * 100),
560 | a: this.a
561 | };
562 | }
563 | return null;
564 | }
565 |
566 | this.getHSV = function () {
567 |
568 | if (this.success) {
569 |
570 | var r = this.r / 255;
571 | var g = this.g / 255;
572 | var b = this.b / 255;
573 |
574 | var min = Math.min(r, g, b);
575 | var max = Math.max(r, g, b);
576 | var delta = max - min;
577 |
578 | var h, s, v = max;
579 |
580 | if (0 == delta) {
581 | h = 0;
582 | s = 0;
583 | } else {
584 | s = delta / max;
585 |
586 | delta*= 6;
587 |
588 | var dR = .5 + (max - r) / delta;
589 | var dG = .5 + (max - g) / delta;
590 | var dB = .5 + (max - b) / delta;
591 |
592 | if (r == max) {
593 | h = dB - dG;
594 | } else if (g == max) {
595 | h = 1 / 3 + dR - dB;
596 | } else if (b == max) {
597 | h = 2 / 3 + dG - dR;
598 | }
599 |
600 | if (h < 0) ++h;
601 | if (h > 1) --h;
602 | }
603 |
604 | return {
605 | h: Math.round(h * 360),
606 | s: Math.round(s * 100),
607 | v: Math.round(v * 100),
608 | a: this.a
609 | };
610 | }
611 | return null;
612 | }
613 |
614 | this.getHex = function () {
615 |
616 | if (this.success) {
617 |
618 | var chars = "0123456789abcdef";
619 |
620 | var r1 = this.r >> 4;
621 | var g1 = this.g >> 4;
622 | var b1 = this.b >> 4;
623 |
624 | var r2 = this.r & 0xf;
625 | var g2 = this.g & 0xf;
626 | var b2 = this.b & 0xf;
627 |
628 | if (0 === ((r1 ^ r2) | (g1 ^ g2) | (b1 ^ b2))) {
629 | return '#' + chars.charAt(r1) + chars.charAt(g1) + chars.charAt(b1);
630 | }
631 | return '#'
632 | + chars.charAt(r1) + chars.charAt(r2)
633 | + chars.charAt(g1) + chars.charAt(g2)
634 | + chars.charAt(b1) + chars.charAt(b2);
635 | }
636 | return null;
637 | }
638 |
639 | this.getInt = function (alpha) {
640 |
641 | if (this.success) {
642 | if (void 0 !== alpha) {
643 | return ((this.a * 100 | 0) << 24 ^ this.r << 16 ^ this.g << 8 ^ this.b);
644 | }
645 | return (this.r << 16 ^ this.g << 8 ^ this.b) & 0xffffff;
646 | }
647 | return null;
648 | }
649 |
650 | this.toString = function () {
651 | return this.getHex();
652 | }
653 |
654 | this.setColor(color);
655 | }
656 |
657 | $.each(['color', 'backgroundColor', 'borderColor', 'borderTopColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'outlineColor'], function(i, attr) {
658 |
659 | $.fx.step[attr] = function(fx) {
660 |
661 | if (fx.xinit === void 0) {
662 |
663 | if (typeof fx.end === "string" && -1 !== fx.end.indexOf(";")) {
664 |
665 | var x, arr = fx.end.split(";");
666 |
667 | if (arr.length > 2) {
668 |
669 | for (x in arr) {
670 | if (-1 === arr[x].indexOf('native')) {
671 | arr[x] = new xColor(arr[x]);
672 | } else {
673 | arr[x] = findColor(fx.elem, attr);
674 | }
675 | }
676 | fx.start = null;
677 | fx.end = arr;
678 | } else {
679 | fx.start = new xColor(arr[0]);
680 | fx.end = new xColor(arr[1]);
681 | }
682 | } else {
683 | fx.start = findColor(fx.elem, attr);
684 | fx.end = new xColor(fx.end);
685 | }
686 |
687 | fx.xinit = 1;
688 | }
689 |
690 | var S = fx.start;
691 | var E = fx.end;
692 | var P = fx.pos;
693 |
694 | if (null === S) {
695 | var m = P * (E.length - 1), n = P < 1 ? m | 0 : E.length - 2;
696 | S = E[n];
697 | E = E[n + 1];
698 | P = m - n;
699 | }
700 |
701 | if ($.support.opacity) {
702 | fx.elem.style[attr] = "rgba("
703 | + ((S.r + (E.r - S.r) * P)|0) + ","
704 | + ((S.g + (E.g - S.g) * P)|0) + ","
705 | + ((S.b + (E.b - S.b) * P)|0) + ","
706 | + ((S.a + (E.a - S.a) * P)) + ")";
707 | } else {
708 | fx.elem.style[attr] = "rgb("
709 | + ((S.r + (E.r - S.r) * P)|0) + ","
710 | + ((S.g + (E.g - S.g) * P)|0) + ","
711 | + ((S.b + (E.b - S.b) * P)|0) + ")";
712 | }
713 | }
714 | });
715 |
716 | function findColor(elem, attr) {
717 |
718 | var color = "";
719 |
720 | do {
721 | color = $.curCSS(elem, attr);
722 |
723 | if ("" !== color && "transparent" !== color && "rgba(0, 0, 0, 0)" !== color || $.nodeName(elem, "body")) break;
724 |
725 | } while (elem = elem.parentNode);
726 |
727 | if ("" === color) {
728 |
729 | if ($.support.opacity) {
730 | color = "transparent";
731 | } else if ("backgroundColor" === attr) {
732 | color = "white";
733 | } else {
734 | color = "black";
735 | }
736 | }
737 | return new xColor(color);
738 | }
739 |
740 | /**
741 | * @constructor
742 | */
743 | function xColorMix() {
744 |
745 | this.test = function (col) {
746 |
747 | var c = new xColor(col);
748 |
749 | if (c.success) {
750 | return c;
751 | }
752 | return null;
753 | }
754 |
755 | this.red = function (col) {
756 |
757 | var c = new xColor(col);
758 |
759 | if (c.success) {
760 | c.g = 0xff;
761 | c.b = 0xff;
762 | return c;
763 | }
764 | return null;
765 | }
766 |
767 | this.blue = function (col) {
768 |
769 | var c = new xColor(col);
770 |
771 | if (c.success) {
772 | c.r = 0xff;
773 | c.g = 0xff;
774 | return c;
775 | }
776 | return null;
777 | }
778 |
779 | this.green = function (col) {
780 |
781 | var c = new xColor(col);
782 |
783 | if (c.success) {
784 | c.r = 0xff;
785 | c.b = 0xff;
786 | return c;
787 | }
788 | return null;
789 | }
790 |
791 | this.sepia = function(col) {
792 |
793 | var c = new xColor(col);
794 |
795 | // Microsoft's sepia function http://msdn.microsoft.com/en-us/magazine/cc163866.aspx
796 | if (c.success) {
797 |
798 | var r = c.r, g = c.g, b = c.b;
799 |
800 | c.r = Math.round(r * 0.393 + g * 0.769 + b * 0.189);
801 | c.g = Math.round(r * 0.349 + g * 0.686 + b * 0.168);
802 | c.b = Math.round(r * 0.272 + g * 0.534 + b * 0.131);
803 |
804 | return c;
805 | }
806 | return null;
807 | }
808 |
809 | this.random = function () {
810 |
811 | return new xColor([
812 | (255 * Math.random())|0,
813 | (255 * Math.random())|0,
814 | (255 * Math.random())|0
815 | ]);
816 | }
817 |
818 | this.inverse = function (col) {
819 |
820 | var c = new xColor(col);
821 |
822 | if (c.success) {
823 | c.r^= 0xff;
824 | c.g^= 0xff;
825 | c.b^= 0xff;
826 | return c;
827 | }
828 | return null;
829 | }
830 |
831 | this.opacity = function (x, y, o) {
832 |
833 | var a = new xColor(x);
834 | var b = new xColor(y);
835 |
836 | if (a.success & b.success) {
837 |
838 | if (o > 1) {
839 | o/= 100;
840 | }
841 |
842 | o = Math.max(o - 1 + b.a, 0);
843 |
844 | a.r = Math.round((b.r - a.r) * o + a.r);
845 | a.g = Math.round((b.g - a.g) * o + a.g);
846 | a.b = Math.round((b.b - a.b) * o + a.b);
847 |
848 | return a;
849 | }
850 | return null;
851 | }
852 |
853 | this.greyfilter = function (col, formula) {
854 |
855 | var v, c = new xColor(col);
856 |
857 | if (c.success) {
858 | switch (formula) {
859 | case 1:
860 | // My own formula
861 | v = .35 + 13 * (c.r + c.g + c.b) / 60;
862 | break;
863 | case 2:
864 | // Sun's formula: (1 - avg) / (100 / 35) + avg)
865 | v = (13 * (c.r + c.g + c.b) + 5355) / 60;
866 | break;
867 | default:
868 | v = c.r * .3 + c.g * .59 + c.b * .11;
869 | }
870 | c.r = c.g = c.b = Math.min(v|0, 255);
871 |
872 | return c;
873 | }
874 | return null;
875 | }
876 |
877 | this.webround = function (col) {
878 |
879 | var c = new xColor(col);
880 |
881 | if (c.success) {
882 | if ((c.r+= 0x33 - c.r % 0x33) > 0xff) c.r = 0xff;
883 | if ((c.g+= 0x33 - c.g % 0x33) > 0xff) c.g = 0xff;
884 | if ((c.b+= 0x33 - c.b % 0x33) > 0xff) c.b = 0xff;
885 | return c;
886 | }
887 | return null;
888 | }
889 |
890 | this.distance = function (x, y) {
891 |
892 | var a = new xColor(x);
893 | var b = new xColor(y);
894 |
895 | if (a.success & b.success) {
896 | // Approximation attempt of http://www.compuphase.com/cmetric.htm
897 | return Math.sqrt(3 * (b.r - a.r) * (b.r - a.r) + 4 * (b.g - a.g) * (b.g - a.g) + 2 * (b.b - a.b) * (b.b - a.b));
898 | }
899 | return null;
900 | }
901 |
902 | this.readable = function (bg, col) {
903 |
904 | var a = new xColor(col);
905 | var b = new xColor(bg);
906 |
907 | if (a.success & b.success) {
908 | return (
909 | (b.r - a.r) * (b.r - a.r) +
910 | (b.g - a.g) * (b.g - a.g) +
911 | (b.b - a.b) * (b.b - a.b)) > 0x28A4;
912 | }
913 | return null;
914 | }
915 |
916 | this.combine = function (x, y) {
917 |
918 | var a = new xColor(x);
919 | var b = new xColor(y);
920 |
921 | if (a.success & b.success) {
922 | a.r^= b.r;
923 | a.g^= b.g;
924 | a.b^= b.b;
925 | return a;
926 | }
927 | return null;
928 | }
929 |
930 | this.breed = function (x, y) {
931 |
932 | var a = new xColor(x);
933 | var b = new xColor(y);
934 |
935 | var mask = 0;
936 |
937 | if (a.success & b.success) {
938 |
939 | for (var i = 0; i < 6; ++i) {
940 | if (Math.random() < .5) {
941 | mask|= 0x0f << (i << 2);
942 | }
943 | }
944 |
945 | a.r = (a.r & ((mask >> 0x10) & 0xff)) | (b.r & (((mask >> 0x10) & 0xff) ^ 0xff));
946 | a.g = (a.g & ((mask >> 0x08) & 0xff)) | (b.g & (((mask >> 0x08) & 0xff) ^ 0xff));
947 | a.b = (a.b & ((mask >> 0x00) & 0xff)) | (b.b & (((mask >> 0x00) & 0xff) ^ 0xff));
948 | return a;
949 | }
950 | return null;
951 | }
952 |
953 | this.additive = function (x, y) {
954 |
955 | var a = new xColor(x);
956 | var b = new xColor(y);
957 |
958 | if (a.success & b.success) {
959 |
960 | if ((a.r+= b.r) > 0xff) a.r = 0xff;
961 | if ((a.g+= b.g) > 0xff) a.g = 0xff;
962 | if ((a.b+= b.b) > 0xff) a.b = 0xff;
963 |
964 | return a;
965 | }
966 | return null;
967 | }
968 |
969 | this.subtractive = function (x, y) {
970 |
971 | var a = new xColor(x);
972 | var b = new xColor(y);
973 |
974 | if (a.success & b.success) {
975 |
976 | if ((a.r+= b.r - 0xff) < 0) a.r = 0;
977 | if ((a.g+= b.g - 0xff) < 0) a.g = 0;
978 | if ((a.b+= b.b - 0xff) < 0) a.b = 0;
979 |
980 | return a;
981 | }
982 | return null;
983 | }
984 |
985 | this.subtract = function (x, y) {
986 |
987 | var a = new xColor(x);
988 | var b = new xColor(y);
989 |
990 | if (a.success & b.success) {
991 |
992 | if ((a.r-= b.r) < 0) a.r = 0;
993 | if ((a.g-= b.g) < 0) a.g = 0;
994 | if ((a.b-= b.b) < 0) a.b = 0;
995 |
996 | return a;
997 | }
998 | return null;
999 | }
1000 |
1001 | this.multiply = function (x, y) {
1002 |
1003 | var a = new xColor(x);
1004 | var b = new xColor(y);
1005 |
1006 | if (a.success & b.success) {
1007 | a.r = (a.r / 255 * b.r)|0;
1008 | a.g = (a.g / 255 * b.g)|0;
1009 | a.b = (a.b / 255 * b.b)|0;
1010 | return a;
1011 | }
1012 | return null;
1013 | }
1014 |
1015 | this.average = function (x, y) {
1016 |
1017 | var a = new xColor(x);
1018 | var b = new xColor(y);
1019 |
1020 | if (a.success & b.success) {
1021 | a.r = (a.r + b.r) >> 1;
1022 | a.g = (a.g + b.g) >> 1;
1023 | a.b = (a.b + b.b) >> 1;
1024 | return a;
1025 | }
1026 | return null;
1027 | }
1028 |
1029 | this.triad = function (col) {
1030 |
1031 | var c = new xColor(col);
1032 |
1033 | if (c.success) {
1034 |
1035 | return [c,
1036 | new xColor([c.b, c.r, c.g]),
1037 | new xColor([c.g, c.b, c.r])];
1038 | }
1039 | return null;
1040 | }
1041 |
1042 | this.tetrad = function (col) {
1043 |
1044 | var c = new xColor(col);
1045 |
1046 | if (c.success) {
1047 |
1048 | return [c,
1049 | new xColor([c.b, c.r, c.b]),
1050 | new xColor([c.b, c.g, c.r]),
1051 | new xColor([c.r, c.b, c.r])];
1052 | }
1053 | return null;
1054 | }
1055 |
1056 | this.gradientlevel = function (x, y, level, deg) {
1057 |
1058 | if (void 0 === deg) deg = 1;
1059 |
1060 | if (level > deg) return null;
1061 |
1062 | var a = new xColor(x);
1063 | var b = new xColor(y);
1064 |
1065 | if (a.success & b.success) {
1066 |
1067 | a.r = (a.r + ((b.r - a.r) / deg) * level)|0;
1068 | a.g = (a.g + ((b.g - a.g) / deg) * level)|0;
1069 | a.b = (a.b + ((b.b - a.b) / deg) * level)|0;
1070 |
1071 | return a;
1072 | }
1073 | return null;
1074 | }
1075 |
1076 | this.gradientarray = function (arr, ndx, size) {
1077 |
1078 | if (ndx > size) return null;
1079 |
1080 | var e = (ndx * (arr.length - 1) / size)|0;
1081 | var m = (ndx - size * e / (arr.length - 1)) / size;
1082 |
1083 | var a = new xColor(arr[e]);
1084 | var b = new xColor(arr[e + 1]);
1085 |
1086 | if (a.success & b.success) {
1087 |
1088 | a.r = (a.r + arr.length * (b.r - a.r) * m)|0;
1089 | a.g = (a.g + arr.length * (b.g - a.g) * m)|0;
1090 | a.b = (a.b + arr.length * (b.b - a.b) * m)|0;
1091 |
1092 | return a;
1093 | }
1094 | return null;
1095 | }
1096 |
1097 | this.nearestname = function (a) {
1098 |
1099 | a = new xColor(a);
1100 |
1101 | if (a.success) {
1102 | return a.getName();
1103 | }
1104 | return null;
1105 | }
1106 |
1107 | this.darken = function (col, by, shade) {
1108 |
1109 | if (by === void 0) {
1110 | by = 1;
1111 | } else if (by < 0) return this.lighten(col, -by, shade);
1112 |
1113 | if (shade === void 0) {
1114 | shade = 32;
1115 | }
1116 |
1117 | var c = new xColor(col);
1118 |
1119 | if (c.success) {
1120 | if ((c.r-= shade * by) < 0) c.r = 0;
1121 | if ((c.g-= shade * by) < 0) c.g = 0;
1122 | if ((c.b-= shade * by) < 0) c.b = 0;
1123 | return c;
1124 | }
1125 | return null;
1126 | }
1127 |
1128 | this.lighten = function (col, by, shade) {
1129 |
1130 | if (by === void 0) {
1131 | by = 1;
1132 | } else if (by < 0) return this.darken(col, -by, shade);
1133 |
1134 | if (shade === void 0) {
1135 | shade = 32;
1136 | }
1137 |
1138 | var c = new xColor(col);
1139 |
1140 | if (c.success) {
1141 | if ((c.r+= shade * by) > 0xff) c.r = 0xff;
1142 | if ((c.g+= shade * by) > 0xff) c.g = 0xff;
1143 | if ((c.b+= shade * by) > 0xff) c.b = 0xff;
1144 | return c;
1145 | }
1146 | return null;
1147 | }
1148 |
1149 | this.analogous = function (col, results, slices) {
1150 |
1151 | if (results === void 0) {
1152 | results = 8;
1153 | }
1154 |
1155 | if (slices === void 0) {
1156 | slices = 30;
1157 | }
1158 |
1159 | var c = new xColor(col);
1160 |
1161 | if (c.success) {
1162 |
1163 | var hsv = c.getHSV();
1164 | var part = 360 / slices, ret = [ c ];
1165 |
1166 | for (hsv.h = ((hsv.h - (part * results >> 1)) + 720) % 360; --results; ) {
1167 | hsv.h+= part;
1168 | hsv.h%= 360;
1169 | ret.push(new xColor(hsv));
1170 | }
1171 | return ret;
1172 | }
1173 | return null;
1174 | }
1175 |
1176 | this.complementary = function(col) {
1177 |
1178 | var c = new xColor(col);
1179 |
1180 | if(c.success) {
1181 |
1182 | var hsl = c.getHSL();
1183 |
1184 | hsl.h = (hsl.h + 180) % 360;
1185 |
1186 | return new xColor(hsl);
1187 | }
1188 | return null;
1189 | }
1190 |
1191 | this.splitcomplement = function (col) {
1192 |
1193 | var c = new xColor(col);
1194 |
1195 | if (c.success) {
1196 |
1197 | var hsv = c.getHSV();
1198 | var ret = [ c ];
1199 |
1200 | hsv.h+= 72;
1201 | hsv.h%= 360;
1202 | ret.push(new xColor(hsv));
1203 |
1204 | hsv.h+= 144;
1205 | hsv.h%= 360;
1206 | ret.push(new xColor(hsv));
1207 |
1208 | return ret;
1209 | }
1210 | return null;
1211 | }
1212 |
1213 | this.monochromatic = function (col, results) {
1214 |
1215 | if (results === void 0) {
1216 | results = 6;
1217 | }
1218 |
1219 | var c = new xColor(col);
1220 |
1221 | if (c.success) {
1222 |
1223 | var hsv = c.getHSV();
1224 | var ret = [ c ];
1225 |
1226 | while (--results) {
1227 | hsv.v+= 20;
1228 | hsv.v%= 100;
1229 | ret.push(new xColor(hsv));
1230 | }
1231 | return ret;
1232 | }
1233 | return null;
1234 | }
1235 | }
1236 |
1237 | $.xcolor = new xColorMix();
1238 |
1239 | $.fn.isReadable = function () {
1240 |
1241 | var elem = this[0];
1242 | var f = "";
1243 | var b = "";
1244 |
1245 | do {
1246 |
1247 | if ("" === f && ("transparent" === (f = $.curCSS(elem, "color")) || "rgba(0, 0, 0, 0)" === f)) {
1248 | f = "";
1249 | }
1250 |
1251 | if ("" === b && ("transparent" === (b = $.curCSS(elem, "backgroundColor")) || "rgba(0, 0, 0, 0)" === b)) {
1252 | b = "";
1253 | }
1254 |
1255 | if ("" !== f && "" !== b || $.nodeName(elem, "body")) {
1256 | break;
1257 | }
1258 |
1259 | } while (elem = elem.parentNode);
1260 |
1261 | if ("" === f) {
1262 | f = "black";
1263 | }
1264 |
1265 | if ("" === b) {
1266 | b = "white";
1267 | }
1268 |
1269 | // todo: if alpha != 1, use opacity() to calculate correct color on certain element and it's parent
1270 | return $.xcolor.readable(b, f);
1271 | }
1272 |
1273 | })(jQuery);
1274 |
--------------------------------------------------------------------------------