semantic-ui-sass 1.8.1.0 → 1.11.4.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 +4 -0
- 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 +526 -465
- data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff +0 -0
- data/app/assets/javascripts/semantic-ui/accordion.js +63 -43
- data/app/assets/javascripts/semantic-ui/api.js +38 -18
- data/app/assets/javascripts/semantic-ui/checkbox.js +6 -4
- data/app/assets/javascripts/semantic-ui/colorize.js +3 -3
- data/app/assets/javascripts/semantic-ui/dimmer.js +57 -15
- data/app/assets/javascripts/semantic-ui/dropdown.js +65 -27
- data/app/assets/javascripts/semantic-ui/form.js +108 -29
- data/app/assets/javascripts/semantic-ui/modal.js +31 -31
- data/app/assets/javascripts/semantic-ui/nag.js +4 -4
- data/app/assets/javascripts/semantic-ui/popup.js +74 -37
- data/app/assets/javascripts/semantic-ui/progress.js +4 -4
- data/app/assets/javascripts/semantic-ui/rating.js +4 -4
- data/app/assets/javascripts/semantic-ui/search.js +67 -26
- data/app/assets/javascripts/semantic-ui/shape.js +4 -4
- data/app/assets/javascripts/semantic-ui/sidebar.js +22 -17
- data/app/assets/javascripts/semantic-ui/site.js +3 -3
- data/app/assets/javascripts/semantic-ui/state.js +30 -25
- data/app/assets/javascripts/semantic-ui/sticky.js +89 -72
- data/app/assets/javascripts/semantic-ui/tab.js +37 -22
- data/app/assets/javascripts/semantic-ui/transition.js +163 -61
- data/app/assets/javascripts/semantic-ui/video.js +4 -4
- data/app/assets/javascripts/semantic-ui/visibility.js +186 -124
- data/app/assets/javascripts/semantic-ui/visit.js +6 -4
- data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +6 -7
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +56 -40
- data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +100 -45
- data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +28 -16
- data/app/assets/stylesheets/semantic-ui/collections/_message.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +8 -7
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +11 -11
- data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +5 -8
- data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +11 -4
- data/app/assets/stylesheets/semantic-ui/elements/_header.scss +34 -10
- data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +391 -51
- data/app/assets/stylesheets/semantic-ui/elements/_image.scss +18 -5
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +33 -49
- data/app/assets/stylesheets/semantic-ui/elements/_label.scss +47 -14
- data/app/assets/stylesheets/semantic-ui/elements/_list.scss +7 -8
- data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +10 -5
- data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +52 -7
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/globals/_site.scss +20 -7
- data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +31 -13
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +9 -8
- data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +21 -9
- data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +6 -17
- data/app/assets/stylesheets/semantic-ui/modules/_search.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +15 -11
- data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +161 -323
- data/app/assets/stylesheets/semantic-ui/modules/_video.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/views/_ad.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/views/_card.scss +202 -51
- data/app/assets/stylesheets/semantic-ui/views/_comment.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/views/_feed.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/views/_item.scss +10 -12
- data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +5 -6
- data/lib/semantic/ui/sass/version.rb +2 -2
- metadata +3 -4
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Popup
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Popup
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -62,6 +62,9 @@ $.fn.popup = function(parameters) {
|
|
62
62
|
|
63
63
|
element = this,
|
64
64
|
instance = $module.data(moduleNamespace),
|
65
|
+
|
66
|
+
elementNamespace,
|
67
|
+
id,
|
65
68
|
module
|
66
69
|
;
|
67
70
|
|
@@ -69,24 +72,9 @@ $.fn.popup = function(parameters) {
|
|
69
72
|
|
70
73
|
// binds events
|
71
74
|
initialize: function() {
|
72
|
-
module.debug('Initializing
|
73
|
-
|
74
|
-
|
75
|
-
.on('click' + eventNamespace, module.toggle)
|
76
|
-
;
|
77
|
-
}
|
78
|
-
else if( module.get.startEvent() ) {
|
79
|
-
$module
|
80
|
-
.on(module.get.startEvent() + eventNamespace, module.event.start)
|
81
|
-
.on(module.get.endEvent() + eventNamespace, module.event.end)
|
82
|
-
;
|
83
|
-
}
|
84
|
-
if(settings.target) {
|
85
|
-
module.debug('Target set to element', $target);
|
86
|
-
}
|
87
|
-
$window
|
88
|
-
.on('resize' + eventNamespace, module.event.resize)
|
89
|
-
;
|
75
|
+
module.debug('Initializing', $module);
|
76
|
+
module.createID();
|
77
|
+
module.bind.events();
|
90
78
|
if( !module.exists() && settings.preserve) {
|
91
79
|
module.create();
|
92
80
|
}
|
@@ -94,7 +82,7 @@ $.fn.popup = function(parameters) {
|
|
94
82
|
},
|
95
83
|
|
96
84
|
instantiate: function() {
|
97
|
-
module.verbose('Storing instance
|
85
|
+
module.verbose('Storing instance', module);
|
98
86
|
instance = module;
|
99
87
|
$module
|
100
88
|
.data(moduleNamespace, instance)
|
@@ -143,11 +131,15 @@ $.fn.popup = function(parameters) {
|
|
143
131
|
|
144
132
|
destroy: function() {
|
145
133
|
module.debug('Destroying previous module');
|
134
|
+
// remove element only if was created dynamically
|
146
135
|
if($popup && !settings.preserve) {
|
147
136
|
module.removePopup();
|
148
137
|
}
|
138
|
+
// clear all timeouts
|
149
139
|
clearTimeout(module.hideTimer);
|
150
140
|
clearTimeout(module.showTimer);
|
141
|
+
// remove events
|
142
|
+
$window.off(elementNamespace);
|
151
143
|
$module
|
152
144
|
.off(eventNamespace)
|
153
145
|
.removeData(moduleNamespace)
|
@@ -207,6 +199,7 @@ $.fn.popup = function(parameters) {
|
|
207
199
|
$popup = $('<div/>')
|
208
200
|
.addClass(className.popup)
|
209
201
|
.addClass(variation)
|
202
|
+
.data(metadata.activator, $module)
|
210
203
|
.html(html)
|
211
204
|
;
|
212
205
|
if(variation) {
|
@@ -235,13 +228,14 @@ $.fn.popup = function(parameters) {
|
|
235
228
|
else if($target.next(selector.popup).length !== 0) {
|
236
229
|
module.verbose('Pre-existing popup found');
|
237
230
|
settings.inline = true;
|
238
|
-
settings.popup = $target.next(selector.popup);
|
231
|
+
settings.popup = $target.next(selector.popup).data(metadata.activator, $module);
|
239
232
|
module.refresh();
|
240
233
|
if(settings.hoverable) {
|
241
234
|
module.bind.popup();
|
242
235
|
}
|
243
236
|
}
|
244
237
|
else if(settings.popup) {
|
238
|
+
settings.popup.data(metadata.activator, $module);
|
245
239
|
module.verbose('Used popup specified in settings');
|
246
240
|
module.refresh();
|
247
241
|
if(settings.hoverable) {
|
@@ -253,13 +247,18 @@ $.fn.popup = function(parameters) {
|
|
253
247
|
}
|
254
248
|
},
|
255
249
|
|
250
|
+
createID: function() {
|
251
|
+
id = (Math.random().toString(16) + '000000000').substr(2,8);
|
252
|
+
elementNamespace = '.' + id;
|
253
|
+
module.verbose('Creating unique id for element', id);
|
254
|
+
},
|
255
|
+
|
256
256
|
// determines popup state
|
257
257
|
toggle: function() {
|
258
258
|
module.debug('Toggling pop-up');
|
259
259
|
if( module.is.hidden() ) {
|
260
260
|
module.debug('Popup is hidden, showing pop-up');
|
261
261
|
module.unbind.close();
|
262
|
-
module.hideAll();
|
263
262
|
module.show();
|
264
263
|
}
|
265
264
|
else {
|
@@ -279,6 +278,9 @@ $.fn.popup = function(parameters) {
|
|
279
278
|
}
|
280
279
|
if( $popup && module.set.position() ) {
|
281
280
|
module.save.conditions();
|
281
|
+
if(settings.exclusive) {
|
282
|
+
module.hideAll();
|
283
|
+
}
|
282
284
|
module.animate.show(callback);
|
283
285
|
}
|
284
286
|
},
|
@@ -296,8 +298,13 @@ $.fn.popup = function(parameters) {
|
|
296
298
|
|
297
299
|
hideAll: function() {
|
298
300
|
$(selector.popup)
|
299
|
-
.filter('
|
300
|
-
|
301
|
+
.filter('.' + className.visible)
|
302
|
+
.each(function() {
|
303
|
+
$(this)
|
304
|
+
.data(metadata.activator)
|
305
|
+
.popup('hide')
|
306
|
+
;
|
307
|
+
})
|
301
308
|
;
|
302
309
|
},
|
303
310
|
|
@@ -423,15 +430,27 @@ $.fn.popup = function(parameters) {
|
|
423
430
|
},
|
424
431
|
|
425
432
|
get: {
|
433
|
+
id: function() {
|
434
|
+
return id;
|
435
|
+
},
|
426
436
|
startEvent: function() {
|
427
437
|
if(settings.on == 'hover') {
|
428
|
-
return
|
438
|
+
return (hasTouch)
|
439
|
+
? 'touchstart mouseenter'
|
440
|
+
: 'mouseenter'
|
441
|
+
;
|
429
442
|
}
|
430
443
|
else if(settings.on == 'focus') {
|
431
444
|
return 'focus';
|
432
445
|
}
|
433
446
|
return false;
|
434
447
|
},
|
448
|
+
scrollEvent: function() {
|
449
|
+
return (hasTouch)
|
450
|
+
? 'touchmove scroll'
|
451
|
+
: 'scroll'
|
452
|
+
;
|
453
|
+
},
|
435
454
|
endEvent: function() {
|
436
455
|
if(settings.on == 'hover') {
|
437
456
|
return 'mouseleave';
|
@@ -741,7 +760,7 @@ $.fn.popup = function(parameters) {
|
|
741
760
|
}
|
742
761
|
else if(!settings.lastResort) {
|
743
762
|
module.debug('Popup could not find a position in view', $popup);
|
744
|
-
module.error(error.cannotPlace);
|
763
|
+
module.error(error.cannotPlace, element);
|
745
764
|
module.remove.attempts();
|
746
765
|
module.remove.loading();
|
747
766
|
module.reset();
|
@@ -782,6 +801,24 @@ $.fn.popup = function(parameters) {
|
|
782
801
|
},
|
783
802
|
|
784
803
|
bind: {
|
804
|
+
events: function() {
|
805
|
+
module.debug('Binding popup events to module');
|
806
|
+
if(settings.on == 'click') {
|
807
|
+
$module
|
808
|
+
.on('click' + eventNamespace, module.toggle)
|
809
|
+
;
|
810
|
+
}
|
811
|
+
else if( module.get.startEvent() ) {
|
812
|
+
$module
|
813
|
+
.on(module.get.startEvent() + eventNamespace, module.event.start)
|
814
|
+
.on(module.get.endEvent() + eventNamespace, module.event.end)
|
815
|
+
;
|
816
|
+
}
|
817
|
+
if(settings.target) {
|
818
|
+
module.debug('Target set to element', $target);
|
819
|
+
}
|
820
|
+
$window.on('resize' + elementNamespace, module.event.resize);
|
821
|
+
},
|
785
822
|
popup: function() {
|
786
823
|
module.verbose('Allowing hover events on popup to prevent closing');
|
787
824
|
if( $popup && module.has.popup() ) {
|
@@ -794,18 +831,16 @@ $.fn.popup = function(parameters) {
|
|
794
831
|
close:function() {
|
795
832
|
if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') {
|
796
833
|
$document
|
797
|
-
.one(
|
798
|
-
.one('scroll' + eventNamespace, module.hideGracefully)
|
834
|
+
.one(module.get.scrollEvent() + elementNamespace, module.hideGracefully)
|
799
835
|
;
|
800
836
|
$context
|
801
|
-
.one(
|
802
|
-
.one('scroll' + eventNamespace, module.hideGracefully)
|
837
|
+
.one(module.get.scrollEvent() + elementNamespace, module.hideGracefully)
|
803
838
|
;
|
804
839
|
}
|
805
840
|
if(settings.on == 'click' && settings.closable) {
|
806
841
|
module.verbose('Binding popup close event to document');
|
807
842
|
$document
|
808
|
-
.on('click' +
|
843
|
+
.on('click' + elementNamespace, function(event) {
|
809
844
|
module.verbose('Pop-up clickaway intent detected');
|
810
845
|
module.hideGracefully.call(element, event);
|
811
846
|
})
|
@@ -818,16 +853,16 @@ $.fn.popup = function(parameters) {
|
|
818
853
|
close: function() {
|
819
854
|
if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') {
|
820
855
|
$document
|
821
|
-
.off('scroll' +
|
856
|
+
.off('scroll' + elementNamespace, module.hide)
|
822
857
|
;
|
823
858
|
$context
|
824
|
-
.off('scroll' +
|
859
|
+
.off('scroll' + elementNamespace, module.hide)
|
825
860
|
;
|
826
861
|
}
|
827
862
|
if(settings.on == 'click' && settings.closable) {
|
828
863
|
module.verbose('Removing close event from document');
|
829
864
|
$document
|
830
|
-
.off('click' +
|
865
|
+
.off('click' + elementNamespace)
|
831
866
|
;
|
832
867
|
}
|
833
868
|
}
|
@@ -1036,7 +1071,7 @@ $.fn.popup = function(parameters) {
|
|
1036
1071
|
}
|
1037
1072
|
else {
|
1038
1073
|
if(instance !== undefined) {
|
1039
|
-
|
1074
|
+
instance.invoke('destroy');
|
1040
1075
|
}
|
1041
1076
|
module.initialize();
|
1042
1077
|
}
|
@@ -1074,6 +1109,7 @@ $.fn.popup.settings = {
|
|
1074
1109
|
on : 'hover',
|
1075
1110
|
closable : true,
|
1076
1111
|
hideOnScroll : 'auto',
|
1112
|
+
exclusive : true,
|
1077
1113
|
|
1078
1114
|
context : 'body',
|
1079
1115
|
|
@@ -1110,6 +1146,7 @@ $.fn.popup.settings = {
|
|
1110
1146
|
},
|
1111
1147
|
|
1112
1148
|
metadata: {
|
1149
|
+
activator : 'activator',
|
1113
1150
|
content : 'content',
|
1114
1151
|
html : 'html',
|
1115
1152
|
offset : 'offset',
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Progress
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Progress
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -693,7 +693,7 @@ $.fn.progress = function(parameters) {
|
|
693
693
|
}
|
694
694
|
else {
|
695
695
|
if(instance !== undefined) {
|
696
|
-
|
696
|
+
instance.invoke('destroy');
|
697
697
|
}
|
698
698
|
module.initialize();
|
699
699
|
}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Rating
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Rating
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -381,7 +381,7 @@ $.fn.rating = function(parameters) {
|
|
381
381
|
}
|
382
382
|
else {
|
383
383
|
if(instance !== undefined) {
|
384
|
-
|
384
|
+
instance.invoke('destroy');
|
385
385
|
}
|
386
386
|
module.initialize();
|
387
387
|
}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Search
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Search
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -68,6 +68,7 @@ $.fn.search = function(parameters) {
|
|
68
68
|
if(settings.automatic) {
|
69
69
|
$prompt
|
70
70
|
.on(inputEvent + eventNamespace, module.throttle)
|
71
|
+
.attr('autocomplete', 'off')
|
71
72
|
;
|
72
73
|
}
|
73
74
|
$prompt
|
@@ -303,14 +304,14 @@ $.fn.search = function(parameters) {
|
|
303
304
|
var
|
304
305
|
result = false
|
305
306
|
;
|
306
|
-
value
|
307
|
+
value = value || module.get.value();
|
307
308
|
results = results || module.get.results();
|
308
309
|
if(settings.type === 'category') {
|
309
|
-
module.debug('Finding result
|
310
|
+
module.debug('Finding result that matches', value);
|
310
311
|
$.each(results, function(index, category) {
|
311
|
-
if(category.results
|
312
|
+
if($.isArray(category.results)) {
|
312
313
|
result = module.search.object(value, category.results)[0];
|
313
|
-
if(result.length > 0) {
|
314
|
+
if(result && result.length > 0) {
|
314
315
|
return true;
|
315
316
|
}
|
316
317
|
}
|
@@ -334,6 +335,7 @@ $.fn.search = function(parameters) {
|
|
334
335
|
value: function(value) {
|
335
336
|
module.verbose('Setting search input value', value);
|
336
337
|
$prompt.val(value);
|
338
|
+
module.query();
|
337
339
|
},
|
338
340
|
buttonPressed: function() {
|
339
341
|
$searchButton.addClass(className.pressed);
|
@@ -355,11 +357,12 @@ $.fn.search = function(parameters) {
|
|
355
357
|
query: function() {
|
356
358
|
var
|
357
359
|
searchTerm = module.get.value(),
|
358
|
-
|
360
|
+
cache = module.read.cache(searchTerm)
|
359
361
|
;
|
360
|
-
if(
|
362
|
+
if(cache) {
|
361
363
|
module.debug('Reading result for ' + searchTerm + ' from cache');
|
362
|
-
module.
|
364
|
+
module.save.results(cache.results);
|
365
|
+
module.addResults(cache.html);
|
363
366
|
}
|
364
367
|
else {
|
365
368
|
module.debug('Querying for ' + searchTerm);
|
@@ -375,6 +378,9 @@ $.fn.search = function(parameters) {
|
|
375
378
|
module.debug('Searching with default search API endpoint');
|
376
379
|
module.search.remote(searchTerm);
|
377
380
|
}
|
381
|
+
else {
|
382
|
+
module.error(error.noEndpoint);
|
383
|
+
}
|
378
384
|
}
|
379
385
|
else {
|
380
386
|
module.error(error.source);
|
@@ -397,7 +403,10 @@ $.fn.search = function(parameters) {
|
|
397
403
|
results: searchResults
|
398
404
|
});
|
399
405
|
module.remove.loading();
|
400
|
-
module.write.
|
406
|
+
module.write.cache(searchTerm, {
|
407
|
+
html : searchHTML,
|
408
|
+
results : searchResults
|
409
|
+
});
|
401
410
|
module.addResults(searchHTML);
|
402
411
|
},
|
403
412
|
remote: function(searchTerm) {
|
@@ -429,8 +438,8 @@ $.fn.search = function(parameters) {
|
|
429
438
|
searchFields = $.isArray(settings.searchFields)
|
430
439
|
? settings.searchFields
|
431
440
|
: [settings.searchFields],
|
432
|
-
|
433
|
-
|
441
|
+
searchExp = searchTerm.replace(regExp.escape, '\\$&'),
|
442
|
+
searchRegExp = new RegExp(regExp.exact + searchExp, 'i')
|
434
443
|
;
|
435
444
|
|
436
445
|
source = source || settings.source;
|
@@ -452,7 +461,7 @@ $.fn.search = function(parameters) {
|
|
452
461
|
if( content[field].match(searchRegExp) ) {
|
453
462
|
results.push(content);
|
454
463
|
}
|
455
|
-
else if(
|
464
|
+
else if(settings.searchFullText && module.fuzzySearch(searchTerm, content[field]) ) {
|
456
465
|
fullTextResults.push(content);
|
457
466
|
}
|
458
467
|
}
|
@@ -462,6 +471,33 @@ $.fn.search = function(parameters) {
|
|
462
471
|
}
|
463
472
|
},
|
464
473
|
|
474
|
+
fuzzySearch: function(query, term) {
|
475
|
+
var
|
476
|
+
termLength = term.length,
|
477
|
+
queryLength = query.length
|
478
|
+
;
|
479
|
+
query = query.toLowerCase();
|
480
|
+
term = term.toLowerCase();
|
481
|
+
if(queryLength > termLength) {
|
482
|
+
return false;
|
483
|
+
}
|
484
|
+
if(queryLength === termLength) {
|
485
|
+
return (query === term);
|
486
|
+
}
|
487
|
+
search: for (var characterIndex = 0, nextCharacterIndex = 0; characterIndex < queryLength; characterIndex++) {
|
488
|
+
var
|
489
|
+
queryCharacter = query.charCodeAt(characterIndex)
|
490
|
+
;
|
491
|
+
while(nextCharacterIndex < termLength) {
|
492
|
+
if(term.charCodeAt(nextCharacterIndex++) === queryCharacter) {
|
493
|
+
continue search;
|
494
|
+
}
|
495
|
+
}
|
496
|
+
return false;
|
497
|
+
}
|
498
|
+
return true;
|
499
|
+
},
|
500
|
+
|
465
501
|
parse: {
|
466
502
|
response: function(response, searchTerm) {
|
467
503
|
var
|
@@ -469,13 +505,14 @@ $.fn.search = function(parameters) {
|
|
469
505
|
;
|
470
506
|
module.verbose('Parsing server response', response);
|
471
507
|
if(response !== undefined) {
|
472
|
-
if(searchTerm) {
|
473
|
-
module.write.
|
474
|
-
|
475
|
-
|
476
|
-
}
|
508
|
+
if(searchTerm !== undefined && response.results !== undefined) {
|
509
|
+
module.write.cache(searchTerm, {
|
510
|
+
html : searchHTML,
|
511
|
+
results : response.results
|
512
|
+
});
|
513
|
+
module.save.results(response.results);
|
514
|
+
module.addResults(searchHTML);
|
477
515
|
}
|
478
|
-
module.addResults(searchHTML);
|
479
516
|
}
|
480
517
|
}
|
481
518
|
},
|
@@ -509,7 +546,7 @@ $.fn.search = function(parameters) {
|
|
509
546
|
},
|
510
547
|
|
511
548
|
read: {
|
512
|
-
|
549
|
+
cache: function(name) {
|
513
550
|
var
|
514
551
|
cache = $module.data(metadata.cache)
|
515
552
|
;
|
@@ -532,7 +569,7 @@ $.fn.search = function(parameters) {
|
|
532
569
|
},
|
533
570
|
|
534
571
|
write: {
|
535
|
-
|
572
|
+
cache: function(name, value) {
|
536
573
|
var
|
537
574
|
cache = ($module.data(metadata.cache) !== undefined)
|
538
575
|
? $module.data(metadata.cache)
|
@@ -617,7 +654,9 @@ $.fn.search = function(parameters) {
|
|
617
654
|
if(isProperObject || isProperArray ) {
|
618
655
|
if(settings.maxResults > 0) {
|
619
656
|
if(isProperObject) {
|
620
|
-
|
657
|
+
if(settings.type == 'standard') {
|
658
|
+
module.error(error.maxResults);
|
659
|
+
}
|
621
660
|
}
|
622
661
|
else {
|
623
662
|
response.results = response.results.slice(0, settings.maxResults);
|
@@ -782,7 +821,7 @@ $.fn.search = function(parameters) {
|
|
782
821
|
}
|
783
822
|
});
|
784
823
|
}
|
785
|
-
if
|
824
|
+
if( $.isFunction( found ) ) {
|
786
825
|
response = found.apply(context, passedArguments);
|
787
826
|
}
|
788
827
|
else if(found !== undefined) {
|
@@ -808,7 +847,7 @@ $.fn.search = function(parameters) {
|
|
808
847
|
}
|
809
848
|
else {
|
810
849
|
if(instance !== undefined) {
|
811
|
-
|
850
|
+
instance.invoke('destroy');
|
812
851
|
}
|
813
852
|
module.initialize();
|
814
853
|
}
|
@@ -875,6 +914,7 @@ $.fn.search.settings = {
|
|
875
914
|
source : 'Cannot search. No source used, and Semantic API module was not included',
|
876
915
|
noResults : 'Your search returned no results',
|
877
916
|
logging : 'Error in debug logging, exiting.',
|
917
|
+
noEndpoint : 'No search endpoint was specified',
|
878
918
|
noTemplate : 'A valid template name was not specified.',
|
879
919
|
serverError : 'There was an issue with querying the server.',
|
880
920
|
maxResults : 'Results must be an array to use maxResults setting',
|
@@ -887,7 +927,8 @@ $.fn.search.settings = {
|
|
887
927
|
},
|
888
928
|
|
889
929
|
regExp: {
|
890
|
-
|
930
|
+
escape : /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
|
931
|
+
exact : '(?:\s|^)'
|
891
932
|
},
|
892
933
|
|
893
934
|
selector : {
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Shape
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Shape
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -764,7 +764,7 @@ $.fn.shape = function(parameters) {
|
|
764
764
|
}
|
765
765
|
else {
|
766
766
|
if(instance !== undefined) {
|
767
|
-
|
767
|
+
instance.invoke('destroy');
|
768
768
|
}
|
769
769
|
module.initialize();
|
770
770
|
}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Sidebar
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Sidebar
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -114,9 +114,9 @@ $.fn.sidebar = function(parameters) {
|
|
114
114
|
|
115
115
|
create: {
|
116
116
|
id: function() {
|
117
|
-
|
118
|
-
id = module.get.uniqueID();
|
117
|
+
id = (Math.random().toString(16) + '000000000').substr(2,8);
|
119
118
|
elementNamespace = '.' + id;
|
119
|
+
module.verbose('Creating unique id for element', id);
|
120
120
|
}
|
121
121
|
},
|
122
122
|
|
@@ -253,7 +253,7 @@ $.fn.sidebar = function(parameters) {
|
|
253
253
|
if(direction === 'left' || direction === 'right') {
|
254
254
|
module.debug('Adding CSS rules for animation distance', width);
|
255
255
|
style += ''
|
256
|
-
+ ' .ui.visible.' + direction + '.sidebar ~ .pusher:after {'
|
256
|
+
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher:after {'
|
257
257
|
+ ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
258
258
|
+ ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
259
259
|
+ ' }'
|
@@ -261,7 +261,7 @@ $.fn.sidebar = function(parameters) {
|
|
261
261
|
}
|
262
262
|
else if(direction === 'top' || direction == 'bottom') {
|
263
263
|
style += ''
|
264
|
-
+ ' .ui.visible.' + direction + '.sidebar ~ .pusher:after {'
|
264
|
+
+ ' body.pushable > .ui.visible.' + direction + '.sidebar ~ .pusher:after {'
|
265
265
|
+ ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
266
266
|
+ ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
267
267
|
+ ' }'
|
@@ -269,8 +269,8 @@ $.fn.sidebar = function(parameters) {
|
|
269
269
|
}
|
270
270
|
/* opposite sides visible forces content overlay */
|
271
271
|
style += ''
|
272
|
-
+ ' .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after,'
|
273
|
-
+ ' .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {'
|
272
|
+
+ ' body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after,'
|
273
|
+
+ ' body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {'
|
274
274
|
+ ' -webkit-transform: translate3d(0px, 0, 0);'
|
275
275
|
+ ' transform: translate3d(0px, 0, 0);'
|
276
276
|
+ ' }'
|
@@ -365,11 +365,20 @@ $.fn.sidebar = function(parameters) {
|
|
365
365
|
settings.transition = 'overlay';
|
366
366
|
}
|
367
367
|
module.refresh();
|
368
|
-
if(module.othersActive()
|
368
|
+
if(module.othersActive()) {
|
369
369
|
module.debug('Other sidebars currently visible');
|
370
|
-
settings.transition = 'overlay';
|
371
370
|
if(settings.exclusive) {
|
372
|
-
|
371
|
+
// if not overlay queue animation after hide
|
372
|
+
if(settings.transition != 'overlay') {
|
373
|
+
module.hideOthers(module.show);
|
374
|
+
return;
|
375
|
+
}
|
376
|
+
else {
|
377
|
+
module.hideOthers();
|
378
|
+
}
|
379
|
+
}
|
380
|
+
else {
|
381
|
+
settings.transition = 'overlay';
|
373
382
|
}
|
374
383
|
}
|
375
384
|
animateMethod(function() {
|
@@ -422,8 +431,7 @@ $.fn.sidebar = function(parameters) {
|
|
422
431
|
sidebarCount = $otherSidebars.length,
|
423
432
|
callbackCount = 0
|
424
433
|
;
|
425
|
-
callback
|
426
|
-
|
434
|
+
callback = callback || function(){};
|
427
435
|
$otherSidebars
|
428
436
|
.sidebar('hide', function() {
|
429
437
|
callbackCount++;
|
@@ -722,9 +730,6 @@ $.fn.sidebar = function(parameters) {
|
|
722
730
|
return transitions[transition];
|
723
731
|
}
|
724
732
|
}
|
725
|
-
},
|
726
|
-
uniqueID: function() {
|
727
|
-
return (Math.random().toString(16) + '000000000').substr(2,8);
|
728
733
|
}
|
729
734
|
},
|
730
735
|
|