semantic-ui-sass 0.19.3.1 → 1.7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +5 -6
- data/app/assets/fonts/semantic-ui/icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/icons.otf +0 -0
- data/app/assets/fonts/semantic-ui/icons.svg +472 -367
- data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff +0 -0
- data/app/assets/images/semantic-ui/flags.png +0 -0
- data/app/assets/javascripts/semantic-ui.js +9 -5
- data/app/assets/javascripts/semantic-ui/accordion.js +169 -102
- data/app/assets/javascripts/semantic-ui/api.js +840 -0
- data/app/assets/javascripts/semantic-ui/checkbox.js +203 -46
- data/app/assets/javascripts/semantic-ui/{behavior/colorize.js → colorize.js} +4 -2
- data/app/assets/javascripts/semantic-ui/dimmer.js +110 -76
- data/app/assets/javascripts/semantic-ui/dropdown.js +897 -285
- data/app/assets/javascripts/semantic-ui/{behavior/form.js → form.js} +127 -42
- data/app/assets/javascripts/semantic-ui/modal.js +294 -219
- data/app/assets/javascripts/semantic-ui/nag.js +120 -186
- data/app/assets/javascripts/semantic-ui/popup.js +491 -223
- data/app/assets/javascripts/semantic-ui/progress.js +779 -0
- data/app/assets/javascripts/semantic-ui/rating.js +66 -22
- data/app/assets/javascripts/semantic-ui/search.js +219 -99
- data/app/assets/javascripts/semantic-ui/shape.js +72 -29
- data/app/assets/javascripts/semantic-ui/sidebar.js +678 -142
- data/app/assets/javascripts/semantic-ui/site.js +487 -0
- data/app/assets/javascripts/semantic-ui/{behavior/state.js → state.js} +116 -151
- data/app/assets/javascripts/semantic-ui/sticky.js +771 -0
- data/app/assets/javascripts/semantic-ui/tab.js +680 -603
- data/app/assets/javascripts/semantic-ui/transition.js +269 -158
- data/app/assets/javascripts/semantic-ui/video.js +113 -32
- data/app/assets/javascripts/semantic-ui/visibility.js +970 -0
- data/app/assets/javascripts/semantic-ui/visit.js +513 -0
- data/app/assets/stylesheets/semantic-ui.scss +2 -0
- data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +58 -14
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +464 -372
- data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +1385 -533
- data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +482 -655
- data/app/assets/stylesheets/semantic-ui/collections/_message.scss +238 -139
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +631 -280
- data/app/assets/stylesheets/semantic-ui/elements/_all.scss +3 -2
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +1614 -657
- data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +143 -80
- data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +1018 -0
- data/app/assets/stylesheets/semantic-ui/elements/_header.scss +302 -145
- data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +1653 -1365
- data/app/assets/stylesheets/semantic-ui/elements/_image.scss +160 -59
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +247 -118
- data/app/assets/stylesheets/semantic-ui/elements/_label.scss +501 -470
- data/app/assets/stylesheets/semantic-ui/elements/_list.scss +888 -0
- data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +189 -98
- data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +125 -0
- data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +147 -212
- data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +328 -190
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +261 -185
- data/app/assets/stylesheets/semantic-ui/globals/_all.scss +2 -0
- data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +430 -0
- data/app/assets/stylesheets/semantic-ui/globals/_site.scss +128 -0
- data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +190 -106
- data/app/assets/stylesheets/semantic-ui/modules/_all.scss +2 -1
- data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +303 -201
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +72 -63
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +711 -331
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +262 -140
- data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +82 -71
- data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +163 -119
- data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +435 -0
- data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +163 -68
- data/app/assets/stylesheets/semantic-ui/modules/_search.scss +223 -150
- data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +39 -40
- data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +413 -147
- data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +80 -0
- data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +49 -20
- data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +542 -568
- data/app/assets/stylesheets/semantic-ui/modules/_video.scss +69 -37
- data/app/assets/stylesheets/semantic-ui/views/_ad.scss +265 -0
- data/app/assets/stylesheets/semantic-ui/views/_all.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_card.scss +758 -0
- data/app/assets/stylesheets/semantic-ui/views/_comment.scss +133 -92
- data/app/assets/stylesheets/semantic-ui/views/_feed.scss +200 -87
- data/app/assets/stylesheets/semantic-ui/views/_item.scss +298 -523
- data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +390 -12
- data/lib/semantic/ui/sass/version.rb +2 -2
- data/tasks/converter.rb +99 -216
- metadata +22 -27
- data/app/assets/fonts/semantic-ui/basic.icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/basic.icons.svg +0 -450
- data/app/assets/fonts/semantic-ui/basic.icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/basic.icons.woff +0 -0
- data/app/assets/images/semantic-ui/loader-large-inverted.gif +0 -0
- data/app/assets/images/semantic-ui/loader-large.gif +0 -0
- data/app/assets/images/semantic-ui/loader-medium-inverted.gif +0 -0
- data/app/assets/images/semantic-ui/loader-medium.gif +0 -0
- data/app/assets/images/semantic-ui/loader-mini-inverted.gif +0 -0
- data/app/assets/images/semantic-ui/loader-mini.gif +0 -0
- data/app/assets/images/semantic-ui/loader-small-inverted.gif +0 -0
- data/app/assets/images/semantic-ui/loader-small.gif +0 -0
- data/app/assets/javascripts/semantic-ui/behavior/api.js +0 -634
- data/app/assets/javascripts/semantic-ui/chatroom.js +0 -772
- data/app/assets/stylesheets/semantic-ui/depends/_basic.icon.scss +0 -4
- data/app/assets/stylesheets/semantic-ui/depends/_icon.scss +0 -4
- data/app/assets/stylesheets/semantic-ui/depends/_loader.scss +0 -8
- data/app/assets/stylesheets/semantic-ui/elements/_basic.icon.scss +0 -1124
- data/app/assets/stylesheets/semantic-ui/elements/_progress.scss +0 -280
- data/app/assets/stylesheets/semantic-ui/modules/_chatroom.scss +0 -299
- data/app/assets/stylesheets/semantic-ui/modules/_reveal.scss +0 -322
- data/app/assets/stylesheets/semantic-ui/views/_list.scss +0 -700
@@ -0,0 +1,513 @@
|
|
1
|
+
/*
|
2
|
+
* # Semantic - Visit
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Copyright 2014 Contributor
|
7
|
+
* Released under the MIT license
|
8
|
+
* http://opensource.org/licenses/MIT
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
|
12
|
+
;(function ($, window, document, undefined) {
|
13
|
+
|
14
|
+
$.visit = $.fn.visit = function(parameters) {
|
15
|
+
var
|
16
|
+
$allModules = $.isFunction(this)
|
17
|
+
? $(window)
|
18
|
+
: $(this),
|
19
|
+
moduleSelector = $allModules.selector || '',
|
20
|
+
|
21
|
+
time = new Date().getTime(),
|
22
|
+
performance = [],
|
23
|
+
|
24
|
+
query = arguments[0],
|
25
|
+
methodInvoked = (typeof query == 'string'),
|
26
|
+
queryArguments = [].slice.call(arguments, 1),
|
27
|
+
returnedValue
|
28
|
+
;
|
29
|
+
$allModules
|
30
|
+
.each(function() {
|
31
|
+
var
|
32
|
+
settings = $.extend(true, {}, $.fn.visit.settings, parameters),
|
33
|
+
|
34
|
+
error = settings.error,
|
35
|
+
namespace = settings.namespace,
|
36
|
+
|
37
|
+
eventNamespace = '.' + namespace,
|
38
|
+
moduleNamespace = namespace + '-module',
|
39
|
+
|
40
|
+
$module = $(this),
|
41
|
+
$displays = $(),
|
42
|
+
|
43
|
+
element = this,
|
44
|
+
instance = $module.data(moduleNamespace),
|
45
|
+
module
|
46
|
+
;
|
47
|
+
module = {
|
48
|
+
|
49
|
+
initialize: function() {
|
50
|
+
if(settings.count) {
|
51
|
+
module.store(settings.key.count, settings.count);
|
52
|
+
}
|
53
|
+
else if(settings.id) {
|
54
|
+
module.add.id(settings.id);
|
55
|
+
}
|
56
|
+
else if(settings.increment && methodInvoked !== 'increment') {
|
57
|
+
module.increment();
|
58
|
+
}
|
59
|
+
module.add.display($module);
|
60
|
+
module.instantiate();
|
61
|
+
},
|
62
|
+
|
63
|
+
instantiate: function() {
|
64
|
+
module.verbose('Storing instance of visit module', module);
|
65
|
+
instance = module;
|
66
|
+
$module
|
67
|
+
.data(moduleNamespace, module)
|
68
|
+
;
|
69
|
+
},
|
70
|
+
|
71
|
+
destroy: function() {
|
72
|
+
module.verbose('Destroying instance');
|
73
|
+
$module
|
74
|
+
.removeData(moduleNamespace)
|
75
|
+
;
|
76
|
+
},
|
77
|
+
|
78
|
+
increment: function(id) {
|
79
|
+
var
|
80
|
+
currentValue = module.get.count(),
|
81
|
+
newValue = +(currentValue) + 1
|
82
|
+
;
|
83
|
+
if(id) {
|
84
|
+
module.add.id(id);
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
if(newValue > settings.limit && !settings.surpass) {
|
88
|
+
newValue = settings.limit;
|
89
|
+
}
|
90
|
+
module.debug('Incrementing visits', newValue);
|
91
|
+
module.store(settings.key.count, newValue);
|
92
|
+
}
|
93
|
+
},
|
94
|
+
|
95
|
+
decrement: function(id) {
|
96
|
+
var
|
97
|
+
currentValue = module.get.count(),
|
98
|
+
newValue = +(currentValue) - 1
|
99
|
+
;
|
100
|
+
if(id) {
|
101
|
+
module.remove.id(id);
|
102
|
+
}
|
103
|
+
else {
|
104
|
+
module.debug('Removing visit');
|
105
|
+
module.store(settings.key.count, newValue);
|
106
|
+
}
|
107
|
+
},
|
108
|
+
|
109
|
+
get: {
|
110
|
+
count: function() {
|
111
|
+
return +(module.retrieve(settings.key.count)) || 0;
|
112
|
+
},
|
113
|
+
idCount: function(ids) {
|
114
|
+
ids = ids || module.get.ids();
|
115
|
+
return ids.length;
|
116
|
+
},
|
117
|
+
ids: function(delimitedIDs) {
|
118
|
+
var
|
119
|
+
idArray = []
|
120
|
+
;
|
121
|
+
delimitedIDs = delimitedIDs || module.retrieve(settings.key.ids);
|
122
|
+
if(typeof delimitedIDs === 'string') {
|
123
|
+
idArray = delimitedIDs.split(settings.delimiter);
|
124
|
+
}
|
125
|
+
module.verbose('Found visited ID list', idArray);
|
126
|
+
return idArray;
|
127
|
+
},
|
128
|
+
storageOptions: function(data) {
|
129
|
+
var
|
130
|
+
options = {}
|
131
|
+
;
|
132
|
+
if(settings.expires) {
|
133
|
+
options.expires = settings.expires;
|
134
|
+
}
|
135
|
+
if(settings.domain) {
|
136
|
+
options.domain = settings.domain;
|
137
|
+
}
|
138
|
+
if(settings.path) {
|
139
|
+
options.path = settings.path;
|
140
|
+
}
|
141
|
+
return options;
|
142
|
+
}
|
143
|
+
},
|
144
|
+
|
145
|
+
has: {
|
146
|
+
visited: function(id, ids) {
|
147
|
+
var
|
148
|
+
visited = false
|
149
|
+
;
|
150
|
+
ids = ids || module.get.ids();
|
151
|
+
if(id !== undefined && ids) {
|
152
|
+
$.each(ids, function(index, value){
|
153
|
+
if(value == id) {
|
154
|
+
visited = true;
|
155
|
+
}
|
156
|
+
});
|
157
|
+
}
|
158
|
+
return visited;
|
159
|
+
}
|
160
|
+
},
|
161
|
+
|
162
|
+
set: {
|
163
|
+
count: function(value) {
|
164
|
+
module.store(settings.key.count, value);
|
165
|
+
},
|
166
|
+
ids: function(value) {
|
167
|
+
module.store(settings.key.ids, value);
|
168
|
+
}
|
169
|
+
},
|
170
|
+
|
171
|
+
reset: function() {
|
172
|
+
module.store(settings.key.count, 0);
|
173
|
+
module.store(settings.key.ids, null);
|
174
|
+
},
|
175
|
+
|
176
|
+
add: {
|
177
|
+
id: function(id) {
|
178
|
+
var
|
179
|
+
currentIDs = module.retrieve(settings.key.ids),
|
180
|
+
newIDs = (currentIDs === undefined || currentIDs === '')
|
181
|
+
? id
|
182
|
+
: currentIDs + settings.delimiter + id
|
183
|
+
;
|
184
|
+
if( module.has.visited(id) ) {
|
185
|
+
module.debug('Unique content already visited, not adding visit', id, currentIDs);
|
186
|
+
}
|
187
|
+
else if(id === undefined) {
|
188
|
+
module.debug('ID is not defined');
|
189
|
+
}
|
190
|
+
else {
|
191
|
+
module.debug('Adding visit to unique content', id);
|
192
|
+
module.store(settings.key.ids, newIDs);
|
193
|
+
}
|
194
|
+
module.set.count( module.get.idCount() );
|
195
|
+
},
|
196
|
+
display: function(selector) {
|
197
|
+
var
|
198
|
+
$element = $(selector)
|
199
|
+
;
|
200
|
+
if($element.size() > 0 && !$.isWindow($element[0])) {
|
201
|
+
module.debug('Updating visit count for element', $element);
|
202
|
+
$displays = ($displays.size() > 0)
|
203
|
+
? $displays.add($element)
|
204
|
+
: $element
|
205
|
+
;
|
206
|
+
}
|
207
|
+
}
|
208
|
+
},
|
209
|
+
|
210
|
+
remove: {
|
211
|
+
id: function(id) {
|
212
|
+
var
|
213
|
+
currentIDs = module.get.ids(),
|
214
|
+
newIDs = []
|
215
|
+
;
|
216
|
+
if(id !== undefined && currentIDs !== undefined) {
|
217
|
+
module.debug('Removing visit to unique content', id, currentIDs);
|
218
|
+
$.each(currentIDs, function(index, value){
|
219
|
+
if(value !== id) {
|
220
|
+
newIDs.push(value);
|
221
|
+
}
|
222
|
+
});
|
223
|
+
newIDs = newIDs.join(settings.delimiter);
|
224
|
+
module.store(settings.key.ids, newIDs );
|
225
|
+
}
|
226
|
+
module.set.count( module.get.idCount() );
|
227
|
+
}
|
228
|
+
},
|
229
|
+
|
230
|
+
check: {
|
231
|
+
limit: function(value) {
|
232
|
+
value = value || module.get.count();
|
233
|
+
if(settings.limit) {
|
234
|
+
if(value >= settings.limit) {
|
235
|
+
module.debug('Pages viewed exceeded limit, firing callback', value, settings.limit);
|
236
|
+
$.proxy(settings.onLimit, element)(value);
|
237
|
+
}
|
238
|
+
module.debug('Limit not reached', value, settings.limit);
|
239
|
+
$.proxy(settings.onChange, element)(value);
|
240
|
+
}
|
241
|
+
module.update.display(value);
|
242
|
+
}
|
243
|
+
},
|
244
|
+
|
245
|
+
update: {
|
246
|
+
display: function(value) {
|
247
|
+
value = value || module.get.count();
|
248
|
+
if($displays.size() > 0) {
|
249
|
+
module.debug('Updating displayed view count', $displays);
|
250
|
+
$displays.html(value);
|
251
|
+
}
|
252
|
+
}
|
253
|
+
},
|
254
|
+
|
255
|
+
store: function(key, value) {
|
256
|
+
var
|
257
|
+
options = module.get.storageOptions(value)
|
258
|
+
;
|
259
|
+
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
|
260
|
+
window.localStorage.setItem(key, value);
|
261
|
+
module.debug('Value stored using local storage', key, value);
|
262
|
+
}
|
263
|
+
else if($.cookie !== undefined) {
|
264
|
+
$.cookie(key, value, options);
|
265
|
+
module.debug('Value stored using cookie', key, value, options);
|
266
|
+
}
|
267
|
+
else {
|
268
|
+
module.error(error.noCookieStorage);
|
269
|
+
return;
|
270
|
+
}
|
271
|
+
if(key == settings.key.count) {
|
272
|
+
module.check.limit(value);
|
273
|
+
}
|
274
|
+
},
|
275
|
+
retrieve: function(key, value) {
|
276
|
+
var
|
277
|
+
storedValue
|
278
|
+
;
|
279
|
+
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
|
280
|
+
storedValue = window.localStorage.getItem(key);
|
281
|
+
}
|
282
|
+
// get by cookie
|
283
|
+
else if($.cookie !== undefined) {
|
284
|
+
storedValue = $.cookie(key);
|
285
|
+
}
|
286
|
+
else {
|
287
|
+
module.error(error.noCookieStorage);
|
288
|
+
}
|
289
|
+
if(storedValue == 'undefined' || storedValue == 'null' || storedValue === undefined || storedValue === null) {
|
290
|
+
storedValue = undefined;
|
291
|
+
}
|
292
|
+
return storedValue;
|
293
|
+
},
|
294
|
+
|
295
|
+
setting: function(name, value) {
|
296
|
+
if( $.isPlainObject(name) ) {
|
297
|
+
$.extend(true, settings, name);
|
298
|
+
}
|
299
|
+
else if(value !== undefined) {
|
300
|
+
settings[name] = value;
|
301
|
+
}
|
302
|
+
else {
|
303
|
+
return settings[name];
|
304
|
+
}
|
305
|
+
},
|
306
|
+
internal: function(name, value) {
|
307
|
+
module.debug('Changing internal', name, value);
|
308
|
+
if(value !== undefined) {
|
309
|
+
if( $.isPlainObject(name) ) {
|
310
|
+
$.extend(true, module, name);
|
311
|
+
}
|
312
|
+
else {
|
313
|
+
module[name] = value;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
else {
|
317
|
+
return module[name];
|
318
|
+
}
|
319
|
+
},
|
320
|
+
debug: function() {
|
321
|
+
if(settings.debug) {
|
322
|
+
if(settings.performance) {
|
323
|
+
module.performance.log(arguments);
|
324
|
+
}
|
325
|
+
else {
|
326
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
327
|
+
module.debug.apply(console, arguments);
|
328
|
+
}
|
329
|
+
}
|
330
|
+
},
|
331
|
+
verbose: function() {
|
332
|
+
if(settings.verbose && settings.debug) {
|
333
|
+
if(settings.performance) {
|
334
|
+
module.performance.log(arguments);
|
335
|
+
}
|
336
|
+
else {
|
337
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
338
|
+
module.verbose.apply(console, arguments);
|
339
|
+
}
|
340
|
+
}
|
341
|
+
},
|
342
|
+
error: function() {
|
343
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
344
|
+
module.error.apply(console, arguments);
|
345
|
+
},
|
346
|
+
performance: {
|
347
|
+
log: function(message) {
|
348
|
+
var
|
349
|
+
currentTime,
|
350
|
+
executionTime,
|
351
|
+
previousTime
|
352
|
+
;
|
353
|
+
if(settings.performance) {
|
354
|
+
currentTime = new Date().getTime();
|
355
|
+
previousTime = time || currentTime;
|
356
|
+
executionTime = currentTime - previousTime;
|
357
|
+
time = currentTime;
|
358
|
+
performance.push({
|
359
|
+
'Name' : message[0],
|
360
|
+
'Arguments' : [].slice.call(message, 1) || '',
|
361
|
+
'Element' : element,
|
362
|
+
'Execution Time' : executionTime
|
363
|
+
});
|
364
|
+
}
|
365
|
+
clearTimeout(module.performance.timer);
|
366
|
+
module.performance.timer = setTimeout(module.performance.display, 100);
|
367
|
+
},
|
368
|
+
display: function() {
|
369
|
+
var
|
370
|
+
title = settings.name + ':',
|
371
|
+
totalTime = 0
|
372
|
+
;
|
373
|
+
time = false;
|
374
|
+
clearTimeout(module.performance.timer);
|
375
|
+
$.each(performance, function(index, data) {
|
376
|
+
totalTime += data['Execution Time'];
|
377
|
+
});
|
378
|
+
title += ' ' + totalTime + 'ms';
|
379
|
+
if(moduleSelector) {
|
380
|
+
title += ' \'' + moduleSelector + '\'';
|
381
|
+
}
|
382
|
+
if($allModules.size() > 1) {
|
383
|
+
title += ' ' + '(' + $allModules.size() + ')';
|
384
|
+
}
|
385
|
+
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
386
|
+
console.groupCollapsed(title);
|
387
|
+
if(console.table) {
|
388
|
+
console.table(performance);
|
389
|
+
}
|
390
|
+
else {
|
391
|
+
$.each(performance, function(index, data) {
|
392
|
+
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
393
|
+
});
|
394
|
+
}
|
395
|
+
console.groupEnd();
|
396
|
+
}
|
397
|
+
performance = [];
|
398
|
+
}
|
399
|
+
},
|
400
|
+
invoke: function(query, passedArguments, context) {
|
401
|
+
var
|
402
|
+
object = instance,
|
403
|
+
maxDepth,
|
404
|
+
found,
|
405
|
+
response
|
406
|
+
;
|
407
|
+
passedArguments = passedArguments || queryArguments;
|
408
|
+
context = element || context;
|
409
|
+
if(typeof query == 'string' && object !== undefined) {
|
410
|
+
query = query.split(/[\. ]/);
|
411
|
+
maxDepth = query.length - 1;
|
412
|
+
$.each(query, function(depth, value) {
|
413
|
+
var camelCaseValue = (depth != maxDepth)
|
414
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
415
|
+
: query
|
416
|
+
;
|
417
|
+
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
418
|
+
object = object[camelCaseValue];
|
419
|
+
}
|
420
|
+
else if( object[camelCaseValue] !== undefined ) {
|
421
|
+
found = object[camelCaseValue];
|
422
|
+
return false;
|
423
|
+
}
|
424
|
+
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
425
|
+
object = object[value];
|
426
|
+
}
|
427
|
+
else if( object[value] !== undefined ) {
|
428
|
+
found = object[value];
|
429
|
+
return false;
|
430
|
+
}
|
431
|
+
else {
|
432
|
+
return false;
|
433
|
+
}
|
434
|
+
});
|
435
|
+
}
|
436
|
+
if ( $.isFunction( found ) ) {
|
437
|
+
response = found.apply(context, passedArguments);
|
438
|
+
}
|
439
|
+
else if(found !== undefined) {
|
440
|
+
response = found;
|
441
|
+
}
|
442
|
+
if($.isArray(returnedValue)) {
|
443
|
+
returnedValue.push(response);
|
444
|
+
}
|
445
|
+
else if(returnedValue !== undefined) {
|
446
|
+
returnedValue = [returnedValue, response];
|
447
|
+
}
|
448
|
+
else if(response !== undefined) {
|
449
|
+
returnedValue = response;
|
450
|
+
}
|
451
|
+
return found;
|
452
|
+
}
|
453
|
+
};
|
454
|
+
if(methodInvoked) {
|
455
|
+
if(instance === undefined) {
|
456
|
+
module.initialize();
|
457
|
+
}
|
458
|
+
module.invoke(query);
|
459
|
+
}
|
460
|
+
else {
|
461
|
+
if(instance !== undefined) {
|
462
|
+
module.destroy();
|
463
|
+
}
|
464
|
+
module.initialize();
|
465
|
+
}
|
466
|
+
|
467
|
+
})
|
468
|
+
;
|
469
|
+
return (returnedValue !== undefined)
|
470
|
+
? returnedValue
|
471
|
+
: this
|
472
|
+
;
|
473
|
+
};
|
474
|
+
|
475
|
+
$.fn.visit.settings = {
|
476
|
+
|
477
|
+
name : 'Visit',
|
478
|
+
|
479
|
+
debug : false,
|
480
|
+
verbose : true,
|
481
|
+
performance : true,
|
482
|
+
|
483
|
+
namespace : 'visit',
|
484
|
+
|
485
|
+
increment : false,
|
486
|
+
surpass : false,
|
487
|
+
count : false,
|
488
|
+
limit : false,
|
489
|
+
|
490
|
+
delimiter : '&',
|
491
|
+
storageMethod : 'localstorage',
|
492
|
+
|
493
|
+
key : {
|
494
|
+
count : 'visit-count',
|
495
|
+
ids : 'visit-ids'
|
496
|
+
},
|
497
|
+
|
498
|
+
expires : 30,
|
499
|
+
domain : false,
|
500
|
+
path : '/',
|
501
|
+
|
502
|
+
onLimit : function() {},
|
503
|
+
onChange : function() {},
|
504
|
+
|
505
|
+
error : {
|
506
|
+
method : 'The method you called is not defined',
|
507
|
+
missingPersist : 'Using the persist setting requires the inclusion of PersistJS',
|
508
|
+
noCookieStorage : 'The default storage cookie requires $.cookie to be included.'
|
509
|
+
}
|
510
|
+
|
511
|
+
};
|
512
|
+
|
513
|
+
})( jQuery, window , document );
|