semantic-ui-rails 0.6.5 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/semantic/ui/rails/version.rb +1 -1
- data/vendor/assets/javascripts/semantic-ui/modules/accordion.js +13 -16
- data/vendor/assets/javascripts/semantic-ui/modules/behavior/api.js +18 -22
- data/vendor/assets/javascripts/semantic-ui/modules/behavior/form.js +18 -24
- data/vendor/assets/javascripts/semantic-ui/modules/behavior/state.js +8 -8
- data/vendor/assets/javascripts/semantic-ui/modules/chatroom.js +18 -14
- data/vendor/assets/javascripts/semantic-ui/modules/checkbox.js +26 -24
- data/vendor/assets/javascripts/semantic-ui/modules/dimmer.js +70 -48
- data/vendor/assets/javascripts/semantic-ui/modules/dropdown.js +47 -46
- data/vendor/assets/javascripts/semantic-ui/modules/modal.js +44 -30
- data/vendor/assets/javascripts/semantic-ui/modules/nag.js +13 -16
- data/vendor/assets/javascripts/semantic-ui/modules/popup.js +347 -261
- data/vendor/assets/javascripts/semantic-ui/modules/rating.js +18 -22
- data/vendor/assets/javascripts/semantic-ui/modules/search.js +18 -24
- data/vendor/assets/javascripts/semantic-ui/modules/shape.js +182 -173
- data/vendor/assets/javascripts/semantic-ui/modules/sidebar.js +65 -42
- data/vendor/assets/javascripts/semantic-ui/modules/tab.js +47 -30
- data/vendor/assets/javascripts/semantic-ui/modules/transition.js +23 -23
- data/vendor/assets/javascripts/semantic-ui/modules/video.js +18 -22
- data/vendor/assets/stylesheets/semantic-ui/collections/grid.less +1 -1
- data/vendor/assets/stylesheets/semantic-ui/collections/menu.less +8 -3
- data/vendor/assets/stylesheets/semantic-ui/collections/message.less +6 -7
- data/vendor/assets/stylesheets/semantic-ui/collections/table.less +76 -23
- data/vendor/assets/stylesheets/semantic-ui/elements/button.less +163 -167
- data/vendor/assets/stylesheets/semantic-ui/elements/header.less +1 -1
- data/vendor/assets/stylesheets/semantic-ui/elements/icon.less +8 -10
- data/vendor/assets/stylesheets/semantic-ui/elements/input.less +0 -2
- data/vendor/assets/stylesheets/semantic-ui/elements/label.less +54 -5
- data/vendor/assets/stylesheets/semantic-ui/elements/segment.less +0 -9
- data/vendor/assets/stylesheets/semantic-ui/modules/accordion.less +197 -198
- data/vendor/assets/stylesheets/semantic-ui/modules/checkbox.less +17 -21
- data/vendor/assets/stylesheets/semantic-ui/modules/dimmer.less +4 -27
- data/vendor/assets/stylesheets/semantic-ui/modules/dropdown.less +28 -28
- data/vendor/assets/stylesheets/semantic-ui/modules/popup.less +255 -255
- data/vendor/assets/stylesheets/semantic-ui/modules/rating.less +1 -1
- data/vendor/assets/stylesheets/semantic-ui/modules/shape.less +81 -7
- data/vendor/assets/stylesheets/semantic-ui/modules/sidebar.less +129 -28
- data/vendor/assets/stylesheets/semantic-ui/modules/transition.less +12 -10
- data/vendor/assets/stylesheets/semantic-ui/views/list.less +6 -6
- metadata +2 -2
@@ -13,16 +13,19 @@
|
|
13
13
|
|
14
14
|
$.fn.sidebar = function(parameters) {
|
15
15
|
var
|
16
|
-
$allModules
|
17
|
-
|
16
|
+
$allModules = $(this),
|
17
|
+
$body = $('body'),
|
18
|
+
$head = $('head'),
|
18
19
|
|
19
|
-
|
20
|
-
performance = [],
|
20
|
+
moduleSelector = $allModules.selector || '',
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
time = new Date().getTime(),
|
23
|
+
performance = [],
|
24
|
+
|
25
|
+
query = arguments[0],
|
26
|
+
methodInvoked = (typeof query == 'string'),
|
27
|
+
queryArguments = [].slice.call(arguments, 1),
|
28
|
+
returnedValue
|
26
29
|
;
|
27
30
|
|
28
31
|
$allModules
|
@@ -40,14 +43,11 @@ $.fn.sidebar = function(parameters) {
|
|
40
43
|
eventNamespace = '.' + namespace,
|
41
44
|
moduleNamespace = 'module-' + namespace,
|
42
45
|
|
43
|
-
$module
|
44
|
-
|
45
|
-
$body = $('body'),
|
46
|
-
$head = $('head'),
|
47
|
-
$style = $('style[title=' + namespace + ']'),
|
46
|
+
$module = $(this),
|
47
|
+
$style = $('style[title=' + namespace + ']'),
|
48
48
|
|
49
|
-
element
|
50
|
-
instance
|
49
|
+
element = this,
|
50
|
+
instance = $module.data(moduleNamespace),
|
51
51
|
module
|
52
52
|
;
|
53
53
|
|
@@ -99,30 +99,54 @@ $.fn.sidebar = function(parameters) {
|
|
99
99
|
}
|
100
100
|
},
|
101
101
|
|
102
|
-
|
103
|
-
|
104
|
-
|
102
|
+
show: function(callback) {
|
103
|
+
callback = $.isFunction(callback)
|
104
|
+
? callback
|
105
|
+
: function(){}
|
106
|
+
;
|
107
|
+
module.debug('Showing sidebar', callback);
|
105
108
|
if(module.is.closed()) {
|
106
109
|
if(!settings.overlay) {
|
110
|
+
if(settings.exclusive) {
|
111
|
+
module.hideAll();
|
112
|
+
}
|
107
113
|
module.pushPage();
|
108
114
|
}
|
109
115
|
module.set.active();
|
116
|
+
callback();
|
117
|
+
$.proxy(settings.onChange, element)();
|
118
|
+
$.proxy(settings.onShow, element)();
|
110
119
|
}
|
111
120
|
else {
|
112
121
|
module.debug('Sidebar is already visible');
|
113
122
|
}
|
114
123
|
},
|
115
124
|
|
116
|
-
hide: function() {
|
125
|
+
hide: function(callback) {
|
126
|
+
callback = $.isFunction(callback)
|
127
|
+
? callback
|
128
|
+
: function(){}
|
129
|
+
;
|
130
|
+
module.debug('Hiding sidebar', callback);
|
117
131
|
if(module.is.open()) {
|
118
132
|
if(!settings.overlay) {
|
119
133
|
module.pullPage();
|
120
134
|
module.remove.pushed();
|
121
135
|
}
|
122
136
|
module.remove.active();
|
137
|
+
callback();
|
138
|
+
$.proxy(settings.onChange, element)();
|
139
|
+
$.proxy(settings.onHide, element)();
|
123
140
|
}
|
124
141
|
},
|
125
142
|
|
143
|
+
hideAll: function() {
|
144
|
+
$(selector.sidebar)
|
145
|
+
.filter(':visible')
|
146
|
+
.sidebar('hide')
|
147
|
+
;
|
148
|
+
},
|
149
|
+
|
126
150
|
toggle: function() {
|
127
151
|
if(module.is.closed()) {
|
128
152
|
module.show();
|
@@ -272,26 +296,22 @@ $.fn.sidebar = function(parameters) {
|
|
272
296
|
},
|
273
297
|
|
274
298
|
setting: function(name, value) {
|
275
|
-
if(
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
settings[name] = value;
|
281
|
-
}
|
299
|
+
if( $.isPlainObject(name) ) {
|
300
|
+
$.extend(true, settings, name);
|
301
|
+
}
|
302
|
+
else if(value !== undefined) {
|
303
|
+
settings[name] = value;
|
282
304
|
}
|
283
305
|
else {
|
284
306
|
return settings[name];
|
285
307
|
}
|
286
308
|
},
|
287
309
|
internal: function(name, value) {
|
288
|
-
if(
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
module[name] = value;
|
294
|
-
}
|
310
|
+
if( $.isPlainObject(name) ) {
|
311
|
+
$.extend(true, module, name);
|
312
|
+
}
|
313
|
+
else if(value !== undefined) {
|
314
|
+
module[name] = value;
|
295
315
|
}
|
296
316
|
else {
|
297
317
|
return module[name];
|
@@ -419,14 +439,14 @@ $.fn.sidebar = function(parameters) {
|
|
419
439
|
else if(found !== undefined) {
|
420
440
|
response = found;
|
421
441
|
}
|
422
|
-
if($.isArray(
|
423
|
-
|
442
|
+
if($.isArray(returnedValue)) {
|
443
|
+
returnedValue.push(response);
|
424
444
|
}
|
425
|
-
else if(
|
426
|
-
|
445
|
+
else if(returnedValue !== undefined) {
|
446
|
+
returnedValue = [returnedValue, response];
|
427
447
|
}
|
428
448
|
else if(response !== undefined) {
|
429
|
-
|
449
|
+
returnedValue = response;
|
430
450
|
}
|
431
451
|
return found;
|
432
452
|
}
|
@@ -446,8 +466,8 @@ $.fn.sidebar = function(parameters) {
|
|
446
466
|
})
|
447
467
|
;
|
448
468
|
|
449
|
-
return (
|
450
|
-
?
|
469
|
+
return (returnedValue !== undefined)
|
470
|
+
? returnedValue
|
451
471
|
: this
|
452
472
|
;
|
453
473
|
};
|
@@ -462,11 +482,10 @@ $.fn.sidebar.settings = {
|
|
462
482
|
performance : true,
|
463
483
|
|
464
484
|
useCSS : true,
|
485
|
+
exclusive : true,
|
465
486
|
overlay : false,
|
466
487
|
duration : 300,
|
467
488
|
|
468
|
-
side : 'left',
|
469
|
-
|
470
489
|
onChange : function(){},
|
471
490
|
onShow : function(){},
|
472
491
|
onHide : function(){},
|
@@ -480,6 +499,10 @@ $.fn.sidebar.settings = {
|
|
480
499
|
bottom : 'bottom'
|
481
500
|
},
|
482
501
|
|
502
|
+
selector: {
|
503
|
+
sidebar: '.ui.sidebar'
|
504
|
+
},
|
505
|
+
|
483
506
|
error : {
|
484
507
|
method : 'The method you called is not defined.',
|
485
508
|
notFound : 'There were no elements that matched the specified selector'
|
@@ -47,7 +47,7 @@
|
|
47
47
|
queryArguments = [].slice.call(arguments, 1),
|
48
48
|
|
49
49
|
module,
|
50
|
-
|
50
|
+
returnedValue
|
51
51
|
;
|
52
52
|
|
53
53
|
module = {
|
@@ -65,18 +65,26 @@
|
|
65
65
|
|
66
66
|
// attach history events
|
67
67
|
if(settings.history) {
|
68
|
+
module.debug('Initializing page state');
|
68
69
|
if( $.address === undefined ) {
|
69
70
|
module.error(error.state);
|
70
71
|
return false;
|
71
72
|
}
|
72
|
-
else if(settings.path === false) {
|
73
|
-
module.error(error.path);
|
74
|
-
return false;
|
75
|
-
}
|
76
73
|
else {
|
77
|
-
|
74
|
+
if(settings.historyType == 'html5') {
|
75
|
+
module.debug('Using HTML5 to manage state');
|
76
|
+
if(settings.path !== false) {
|
77
|
+
$.address
|
78
|
+
.history(true)
|
79
|
+
.state(settings.path)
|
80
|
+
;
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
module.error(error.path);
|
84
|
+
return false;
|
85
|
+
}
|
86
|
+
}
|
78
87
|
$.address
|
79
|
-
.state(settings.path)
|
80
88
|
.unbind('change')
|
81
89
|
.bind('change', module.event.history.change)
|
82
90
|
;
|
@@ -110,15 +118,16 @@
|
|
110
118
|
|
111
119
|
event: {
|
112
120
|
click: function(event) {
|
113
|
-
module.debug('Navigation clicked');
|
114
121
|
var
|
115
122
|
tabPath = $(this).data(metadata.tab)
|
116
123
|
;
|
117
124
|
if(tabPath !== undefined) {
|
118
125
|
if(settings.history) {
|
126
|
+
module.verbose('Updating page state', event);
|
119
127
|
$.address.value(tabPath);
|
120
128
|
}
|
121
129
|
else {
|
130
|
+
module.verbose('Changing tab without state management', event);
|
122
131
|
module.changeTab(tabPath);
|
123
132
|
}
|
124
133
|
event.preventDefault();
|
@@ -172,6 +181,12 @@
|
|
172
181
|
}
|
173
182
|
},
|
174
183
|
|
184
|
+
set: {
|
185
|
+
state: function(url) {
|
186
|
+
$.address.value(url);
|
187
|
+
}
|
188
|
+
},
|
189
|
+
|
175
190
|
changeTab: function(tabPath) {
|
176
191
|
var
|
177
192
|
pushStateAvailable = (window.history && window.history.pushState),
|
@@ -234,6 +249,11 @@
|
|
234
249
|
else {
|
235
250
|
module.debug('Opened local tab', currentPath);
|
236
251
|
module.activate.all(currentPath);
|
252
|
+
if( !module.cache.read(currentPath) ) {
|
253
|
+
module.cache.add(currentPath, true);
|
254
|
+
module.debug('First time tab loaded calling tab init');
|
255
|
+
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
|
256
|
+
}
|
237
257
|
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
|
238
258
|
}
|
239
259
|
}
|
@@ -443,26 +463,22 @@
|
|
443
463
|
},
|
444
464
|
|
445
465
|
setting: function(name, value) {
|
446
|
-
if(
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
settings[name] = value;
|
452
|
-
}
|
466
|
+
if( $.isPlainObject(name) ) {
|
467
|
+
$.extend(true, settings, name);
|
468
|
+
}
|
469
|
+
else if(value !== undefined) {
|
470
|
+
settings[name] = value;
|
453
471
|
}
|
454
472
|
else {
|
455
473
|
return settings[name];
|
456
474
|
}
|
457
475
|
},
|
458
476
|
internal: function(name, value) {
|
459
|
-
if(
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
module[name] = value;
|
465
|
-
}
|
477
|
+
if( $.isPlainObject(name) ) {
|
478
|
+
$.extend(true, module, name);
|
479
|
+
}
|
480
|
+
else if(value !== undefined) {
|
481
|
+
module[name] = value;
|
466
482
|
}
|
467
483
|
else {
|
468
484
|
return module[name];
|
@@ -587,14 +603,14 @@
|
|
587
603
|
else if(found !== undefined) {
|
588
604
|
response = found;
|
589
605
|
}
|
590
|
-
if($.isArray(
|
591
|
-
|
606
|
+
if($.isArray(returnedValue)) {
|
607
|
+
returnedValue.push(response);
|
592
608
|
}
|
593
|
-
else if(
|
594
|
-
|
609
|
+
else if(returnedValue !== undefined) {
|
610
|
+
returnedValue = [returnedValue, response];
|
595
611
|
}
|
596
612
|
else if(response !== undefined) {
|
597
|
-
|
613
|
+
returnedValue = response;
|
598
614
|
}
|
599
615
|
return found;
|
600
616
|
}
|
@@ -613,8 +629,8 @@
|
|
613
629
|
module.initialize();
|
614
630
|
}
|
615
631
|
|
616
|
-
return (
|
617
|
-
?
|
632
|
+
return (returnedValue !== undefined)
|
633
|
+
? returnedValue
|
618
634
|
: this
|
619
635
|
;
|
620
636
|
|
@@ -644,7 +660,8 @@
|
|
644
660
|
|
645
661
|
// uses pjax style endpoints fetching content from same url with remote-content headers
|
646
662
|
auto : false,
|
647
|
-
history :
|
663
|
+
history : true,
|
664
|
+
historyType : 'hash',
|
648
665
|
path : false,
|
649
666
|
|
650
667
|
context : 'body',
|
@@ -30,7 +30,7 @@ $.fn.transition = function() {
|
|
30
30
|
|| window.msRequestAnimationFrame
|
31
31
|
|| function(callback) { setTimeout(callback, 0); },
|
32
32
|
|
33
|
-
|
33
|
+
returnedValue
|
34
34
|
;
|
35
35
|
$allModules
|
36
36
|
.each(function() {
|
@@ -146,10 +146,12 @@ $.fn.transition = function() {
|
|
146
146
|
if($module.hasClass(className.outward)) {
|
147
147
|
module.restore.conditions();
|
148
148
|
module.hide();
|
149
|
+
$.proxy(settings.onHide, this)();
|
149
150
|
}
|
150
151
|
else if($module.hasClass(className.inward)) {
|
151
152
|
module.restore.conditions();
|
152
153
|
module.show();
|
154
|
+
$.proxy(settings.onShow, this)();
|
153
155
|
}
|
154
156
|
else {
|
155
157
|
module.restore.conditions();
|
@@ -436,26 +438,22 @@ $.fn.transition = function() {
|
|
436
438
|
},
|
437
439
|
|
438
440
|
setting: function(name, value) {
|
439
|
-
if(
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
settings[name] = value;
|
445
|
-
}
|
441
|
+
if( $.isPlainObject(name) ) {
|
442
|
+
$.extend(true, settings, name);
|
443
|
+
}
|
444
|
+
else if(value !== undefined) {
|
445
|
+
settings[name] = value;
|
446
446
|
}
|
447
447
|
else {
|
448
448
|
return settings[name];
|
449
449
|
}
|
450
450
|
},
|
451
451
|
internal: function(name, value) {
|
452
|
-
if(
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
module[name] = value;
|
458
|
-
}
|
452
|
+
if( $.isPlainObject(name) ) {
|
453
|
+
$.extend(true, module, name);
|
454
|
+
}
|
455
|
+
else if(value !== undefined) {
|
456
|
+
module[name] = value;
|
459
457
|
}
|
460
458
|
else {
|
461
459
|
return module[name];
|
@@ -582,14 +580,14 @@ $.fn.transition = function() {
|
|
582
580
|
else if(found !== undefined) {
|
583
581
|
response = found;
|
584
582
|
}
|
585
|
-
if($.isArray(
|
586
|
-
|
583
|
+
if($.isArray(returnedValue)) {
|
584
|
+
returnedValue.push(response);
|
587
585
|
}
|
588
|
-
else if(
|
589
|
-
|
586
|
+
else if(returnedValue !== undefined) {
|
587
|
+
returnedValue = [returnedValue, response];
|
590
588
|
}
|
591
589
|
else if(response !== undefined) {
|
592
|
-
|
590
|
+
returnedValue = response;
|
593
591
|
}
|
594
592
|
return found || false;
|
595
593
|
}
|
@@ -597,8 +595,8 @@ $.fn.transition = function() {
|
|
597
595
|
module.initialize();
|
598
596
|
})
|
599
597
|
;
|
600
|
-
return (
|
601
|
-
?
|
598
|
+
return (returnedValue !== undefined)
|
599
|
+
? returnedValue
|
602
600
|
: this
|
603
601
|
;
|
604
602
|
};
|
@@ -622,12 +620,14 @@ $.fn.transition.settings = {
|
|
622
620
|
|
623
621
|
// animation complete event
|
624
622
|
complete : function() {},
|
623
|
+
onShow : function() {},
|
624
|
+
onHide : function() {},
|
625
625
|
|
626
626
|
// animation duration
|
627
627
|
animation : 'fade',
|
628
628
|
duration : '700ms',
|
629
629
|
|
630
|
-
//
|
630
|
+
// new animations will occur after previous ones
|
631
631
|
queue : true,
|
632
632
|
|
633
633
|
className : {
|