semantic-ui-sass 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43548f63a28e7e11f587faf299202548528b327f
4
- data.tar.gz: 7efdd6a498a980adbb31e8ec372de93243bf60db
3
+ metadata.gz: 0beaebdf83162f8358d6ad8178442f818464ae5f
4
+ data.tar.gz: 140e77d6cabe8dda07a9b9edfe3f7ce2747e57d7
5
5
  SHA512:
6
- metadata.gz: af2ca59c8266fe91899a2767637c712de8e40d877f6b6e6737a831b46bbf52e98ab0b1c59b5fbb9ecf6390a361014ac763d3d2642609466cb4cc184be2c9a62e
7
- data.tar.gz: 3e314de76d1e3ff90864a148a1ee7a542057bc848233bbc19d088ce44ff96ee5324092dbb1b3bd0207c4fa3699db61386096c11390616301d4337816da75e4f1
6
+ metadata.gz: bf60549210270ba9e69f932089f7a17247aa6d8d1126d1e403ac022b91176f6445fb21b6c40ff84d69fda4a55f5a14d9934363310028121c5c9c702d1d227431
7
+ data.tar.gz: 413af6a38bd92eec963c94fe357870a699a9f11f4b33b231b3ffe0623dfb5f6005fa9586582da8cefa82073814a8de5622efce9b2d3513cbeccdb349ad88a690
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.0.3
2
+
3
+ * Fix typo in semantic-ui.js
4
+
5
+ * Update Semantic UI
6
+
1
7
  ## 0.0.2
2
8
 
3
9
  ### Features
@@ -13,8 +13,7 @@
13
13
  //= require semantic-ui/tab
14
14
  //= require semantic-ui/transition
15
15
  //= require semantic-ui/video
16
-
17
- //= require semantic-ui/behavior//api
16
+ //= require semantic-ui/behavior/api
18
17
  //= require semantic-ui/behavior/colorize
19
18
  //= require semantic-ui/behavior/form
20
- //= require semantic-ui/behavior/state
19
+ //= require semantic-ui/behavior/state
@@ -15,19 +15,6 @@ $.fn.accordion = function(parameters) {
15
15
  var
16
16
  $allModules = $(this),
17
17
 
18
- settings = ( $.isPlainObject(parameters) )
19
- ? $.extend(true, {}, $.fn.accordion.settings, parameters)
20
- : $.fn.accordion.settings,
21
-
22
- className = settings.className,
23
- namespace = settings.namespace,
24
- selector = settings.selector,
25
- error = settings.error,
26
-
27
- eventNamespace = '.' + namespace,
28
- moduleNamespace = 'module-' + namespace,
29
- moduleSelector = $allModules.selector || '',
30
-
31
18
  time = new Date().getTime(),
32
19
  performance = [],
33
20
 
@@ -39,6 +26,19 @@ $.fn.accordion = function(parameters) {
39
26
  $allModules
40
27
  .each(function() {
41
28
  var
29
+ settings = ( $.isPlainObject(parameters) )
30
+ ? $.extend(true, {}, $.fn.accordion.settings, parameters)
31
+ : $.fn.accordion.settings,
32
+
33
+ className = settings.className,
34
+ namespace = settings.namespace,
35
+ selector = settings.selector,
36
+ error = settings.error,
37
+
38
+ eventNamespace = '.' + namespace,
39
+ moduleNamespace = 'module-' + namespace,
40
+ moduleSelector = $allModules.selector || '',
41
+
42
42
  $module = $(this),
43
43
  $title = $module.find(selector.title),
44
44
  $content = $module.find(selector.content),
@@ -290,9 +290,6 @@ $.fn.accordion = function(parameters) {
290
290
  if(moduleSelector) {
291
291
  title += ' \'' + moduleSelector + '\'';
292
292
  }
293
- if($allModules.size() > 1) {
294
- title += ' ' + '(' + $allModules.size() + ')';
295
- }
296
293
  if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
297
294
  console.groupCollapsed(title);
298
295
  if(console.table) {
@@ -393,8 +390,8 @@ $.fn.accordion.settings = {
393
390
  exclusive : true,
394
391
  collapsible : true,
395
392
 
396
- duration : 300,
397
- easing : 'linear',
393
+ duration : 500,
394
+ easing : 'easeInOutQuint',
398
395
 
399
396
  onOpen : function(){},
400
397
  onClose : function(){},
@@ -416,4 +413,13 @@ $.fn.accordion.settings = {
416
413
 
417
414
  };
418
415
 
416
+ // Adds easing
417
+ $.extend( $.easing, {
418
+ easeInOutQuint: function (x, t, b, c, d) {
419
+ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
420
+ return c/2*((t-=2)*t*t*t*t + 2) + b;
421
+ }
422
+ });
423
+
419
424
  })( jQuery, window , document );
425
+
@@ -13,19 +13,19 @@
13
13
 
14
14
  $.fn.chatroom = function(parameters) {
15
15
  var
16
- settings = $.extend(true, {}, $.fn.chatroom.settings, parameters),
17
-
18
- className = settings.className,
19
- namespace = settings.namespace,
20
- selector = settings.selector,
21
- error = settings.error,
22
-
23
16
  // hoist arguments
24
17
  moduleArguments = arguments || false
25
18
  ;
26
19
  $(this)
27
20
  .each(function() {
28
21
  var
22
+ settings = $.extend(true, {}, $.fn.chatroom.settings, parameters),
23
+
24
+ className = settings.className,
25
+ namespace = settings.namespace,
26
+ selector = settings.selector,
27
+ error = settings.error,
28
+
29
29
  $module = $(this),
30
30
 
31
31
  $expandButton = $module.find(selector.expandButton),
@@ -14,16 +14,6 @@
14
14
  $.fn.checkbox = function(parameters) {
15
15
  var
16
16
  $allModules = $(this),
17
-
18
- settings = $.extend(true, {}, $.fn.checkbox.settings, parameters),
19
-
20
- className = settings.className,
21
- namespace = settings.namespace,
22
- error = settings.error,
23
-
24
- eventNamespace = '.' + namespace,
25
- moduleNamespace = 'module-' + namespace,
26
-
27
17
  moduleSelector = $allModules.selector || '',
28
18
 
29
19
  time = new Date().getTime(),
@@ -38,6 +28,15 @@ $.fn.checkbox = function(parameters) {
38
28
  $allModules
39
29
  .each(function() {
40
30
  var
31
+ settings = $.extend(true, {}, $.fn.checkbox.settings, parameters),
32
+
33
+ className = settings.className,
34
+ namespace = settings.namespace,
35
+ error = settings.error,
36
+
37
+ eventNamespace = '.' + namespace,
38
+ moduleNamespace = 'module-' + namespace,
39
+
41
40
  $module = $(this),
42
41
  $label = $(this).next(settings.selector.label).first(),
43
42
  $input = $(this).find(settings.selector.input),
@@ -15,28 +15,12 @@ $.fn.dimmer = function(parameters) {
15
15
  var
16
16
  $allModules = $(this),
17
17
 
18
- settings = ( $.isPlainObject(parameters) )
19
- ? $.extend(true, {}, $.fn.dimmer.settings, parameters)
20
- : $.fn.dimmer.settings,
21
-
22
- selector = settings.selector,
23
- namespace = settings.namespace,
24
- className = settings.className,
25
- error = settings.error,
26
-
27
- eventNamespace = '.' + namespace,
28
- moduleNamespace = 'module-' + namespace,
29
- moduleSelector = $allModules.selector || '',
30
-
31
18
  time = new Date().getTime(),
32
19
  performance = [],
33
20
 
34
21
  query = arguments[0],
35
22
  methodInvoked = (typeof query == 'string'),
36
23
  queryArguments = [].slice.call(arguments, 1),
37
- clickEvent = ('ontouchstart' in document.documentElement)
38
- ? 'touchstart'
39
- : 'click',
40
24
 
41
25
  invokedResponse
42
26
  ;
@@ -44,6 +28,23 @@ $.fn.dimmer = function(parameters) {
44
28
  $allModules
45
29
  .each(function() {
46
30
  var
31
+ settings = ( $.isPlainObject(parameters) )
32
+ ? $.extend(true, {}, $.fn.dimmer.settings, parameters)
33
+ : $.fn.dimmer.settings,
34
+
35
+ selector = settings.selector,
36
+ namespace = settings.namespace,
37
+ className = settings.className,
38
+ error = settings.error,
39
+
40
+ eventNamespace = '.' + namespace,
41
+ moduleNamespace = 'module-' + namespace,
42
+ moduleSelector = $allModules.selector || '',
43
+
44
+ clickEvent = ('ontouchstart' in document.documentElement)
45
+ ? 'touchstart'
46
+ : 'click',
47
+
47
48
  $module = $(this),
48
49
  $dimmer,
49
50
  $dimmable,
@@ -66,7 +67,7 @@ $.fn.dimmer = function(parameters) {
66
67
  $dimmer = $dimmable.children(selector.dimmer).first();
67
68
  }
68
69
  else {
69
- module.create();
70
+ $dimmer = module.create();
70
71
  }
71
72
  }
72
73
  },
@@ -141,8 +142,7 @@ $.fn.dimmer = function(parameters) {
141
142
  },
142
143
 
143
144
  create: function() {
144
- $dimmer = $( settings.template.dimmer() );
145
- return $dimmer.appendTo($dimmable);
145
+ return $( settings.template.dimmer() ).appendTo($dimmable);
146
146
  },
147
147
 
148
148
  animate: {
@@ -8,7 +8,6 @@
8
8
  * http://opensource.org/licenses/MIT
9
9
  *
10
10
  */
11
-
12
11
  ;(function ( $, window, document, undefined ) {
13
12
 
14
13
  $.fn.dropdown = function(parameters) {
@@ -16,19 +15,7 @@ $.fn.dropdown = function(parameters) {
16
15
  $allModules = $(this),
17
16
  $document = $(document),
18
17
 
19
- settings = ( $.isPlainObject(parameters) )
20
- ? $.extend(true, {}, $.fn.dropdown.settings, parameters)
21
- : $.fn.dropdown.settings,
22
-
23
- className = settings.className,
24
- metadata = settings.metadata,
25
- namespace = settings.namespace,
26
- selector = settings.selector,
27
- error = settings.error,
28
-
29
- eventNamespace = '.' + namespace,
30
- dropdownNamespace = 'module-' + namespace,
31
- dropdownSelector = $allModules.selector || '',
18
+ moduleSelector = $allModules.selector || '',
32
19
 
33
20
  time = new Date().getTime(),
34
21
  performance = [],
@@ -42,17 +29,30 @@ $.fn.dropdown = function(parameters) {
42
29
  $allModules
43
30
  .each(function() {
44
31
  var
45
- $module = $(this),
46
- $item = $module.find(selector.item),
47
- $text = $module.find(selector.text),
48
- $input = $module.find(selector.input),
32
+ settings = ( $.isPlainObject(parameters) )
33
+ ? $.extend(true, {}, $.fn.dropdown.settings, parameters)
34
+ : $.fn.dropdown.settings,
35
+
36
+ className = settings.className,
37
+ metadata = settings.metadata,
38
+ namespace = settings.namespace,
39
+ selector = settings.selector,
40
+ error = settings.error,
49
41
 
50
- $menu = $module.children(selector.menu),
42
+ eventNamespace = '.' + namespace,
43
+ dropdownNamespace = 'module-' + namespace,
44
+ isTouchDevice = ('ontouchstart' in document.documentElement),
51
45
 
52
- isTouchDevice = ('ontouchstart' in document.documentElement),
46
+ $module = $(this),
47
+ $item = $module.find(selector.item),
48
+ $text = $module.find(selector.text),
49
+ $input = $module.find(selector.input),
53
50
 
54
- element = this,
55
- instance = $module.data(dropdownNamespace),
51
+ $menu = $module.children(selector.menu),
52
+
53
+
54
+ element = this,
55
+ instance = $module.data(dropdownNamespace),
56
56
  module
57
57
  ;
58
58
 
@@ -112,10 +112,6 @@ $.fn.dropdown = function(parameters) {
112
112
 
113
113
  event: {
114
114
 
115
- stopPropagation: function(event) {
116
- event.stopPropagation();
117
- },
118
-
119
115
  test: {
120
116
  toggle: function(event) {
121
117
  module.determine.intent(event, module.toggle);
@@ -173,7 +169,6 @@ $.fn.dropdown = function(parameters) {
173
169
  ;
174
170
  module.determine.selectAction(text, value);
175
171
  $.proxy(settings.onChange, element)(value, text);
176
- event.stopPropagation();
177
172
  }
178
173
  }
179
174
 
@@ -601,8 +596,8 @@ $.fn.dropdown = function(parameters) {
601
596
  totalTime += data['Execution Time'];
602
597
  });
603
598
  title += ' ' + totalTime + 'ms';
604
- if(dropdownSelector) {
605
- title += ' \'' + dropdownSelector + '\'';
599
+ if(moduleSelector) {
600
+ title += ' \'' + moduleSelector + '\'';
606
601
  }
607
602
  if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
608
603
  console.groupCollapsed(title);
@@ -622,7 +617,8 @@ $.fn.dropdown = function(parameters) {
622
617
  invoke: function(query, passedArguments, context) {
623
618
  var
624
619
  maxDepth,
625
- found
620
+ found,
621
+ response
626
622
  ;
627
623
  passedArguments = passedArguments || queryArguments;
628
624
  context = element || context;
@@ -630,21 +626,46 @@ $.fn.dropdown = function(parameters) {
630
626
  query = query.split(/[\. ]/);
631
627
  maxDepth = query.length - 1;
632
628
  $.each(query, function(depth, value) {
629
+ var camelCaseValue = (depth != maxDepth)
630
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
631
+ : query
632
+ ;
633
633
  if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
634
634
  instance = instance[value];
635
635
  }
636
+ else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
637
+ instance = instance[camelCaseValue];
638
+ }
636
639
  else if( instance[value] !== undefined ) {
637
640
  found = instance[value];
641
+ return false;
642
+ }
643
+ else if( instance[camelCaseValue] !== undefined ) {
644
+ found = instance[camelCaseValue];
645
+ return false;
638
646
  }
639
647
  else {
640
648
  module.error(error.method);
649
+ return false;
641
650
  }
642
651
  });
643
652
  }
644
653
  if ( $.isFunction( found ) ) {
645
- return found.apply(context, passedArguments);
654
+ response = found.apply(context, passedArguments);
655
+ }
656
+ else if(found !== undefined) {
657
+ response = found;
658
+ }
659
+ if($.isArray(invokedResponse)) {
660
+ invokedResponse.push(response);
661
+ }
662
+ else if(typeof invokedResponse == 'string') {
663
+ invokedResponse = [invokedResponse, response];
664
+ }
665
+ else if(response !== undefined) {
666
+ invokedResponse = response;
646
667
  }
647
- return found || false;
668
+ return found;
648
669
  }
649
670
  };
650
671
 
@@ -17,19 +17,6 @@ $.fn.modal = function(parameters) {
17
17
  $window = $(window),
18
18
  $document = $(document),
19
19
 
20
- settings = ( $.isPlainObject(parameters) )
21
- ? $.extend(true, {}, $.fn.modal.settings, parameters)
22
- : $.fn.modal.settings,
23
-
24
- selector = settings.selector,
25
- className = settings.className,
26
- namespace = settings.namespace,
27
- error = settings.error,
28
-
29
- eventNamespace = '.' + namespace,
30
- moduleNamespace = 'module-' + namespace,
31
- moduleSelector = $allModules.selector || '',
32
-
33
20
  time = new Date().getTime(),
34
21
  performance = [],
35
22
 
@@ -44,12 +31,26 @@ $.fn.modal = function(parameters) {
44
31
  $allModules
45
32
  .each(function() {
46
33
  var
34
+ settings = ( $.isPlainObject(parameters) )
35
+ ? $.extend(true, {}, $.fn.modal.settings, parameters)
36
+ : $.fn.modal.settings,
37
+
38
+ selector = settings.selector,
39
+ className = settings.className,
40
+ namespace = settings.namespace,
41
+ error = settings.error,
42
+
43
+ eventNamespace = '.' + namespace,
44
+ moduleNamespace = 'module-' + namespace,
45
+ moduleSelector = $allModules.selector || '',
46
+
47
47
  $module = $(this),
48
48
  $context = $(settings.context),
49
49
  $otherModals = $allModules.not($module),
50
50
  $close = $module.find(selector.close),
51
51
 
52
52
  $focusedElement,
53
+ $dimmable,
53
54
  $dimmer,
54
55
 
55
56
  element = this,
@@ -62,8 +63,10 @@ $.fn.modal = function(parameters) {
62
63
  initialize: function() {
63
64
  module.verbose('Initializing dimmer', $context);
64
65
 
65
- $dimmer = $context
66
+ $dimmable = $context
66
67
  .dimmer('add content', $module)
68
+ ;
69
+ $dimmer = $context
67
70
  .dimmer('get dimmer')
68
71
  ;
69
72
 
@@ -107,7 +110,7 @@ $.fn.modal = function(parameters) {
107
110
  ;
108
111
  event = $.isFunction(module[event])
109
112
  ? module[event]
110
- : module.show
113
+ : module.toggle
111
114
  ;
112
115
  if($toggle.size() > 0) {
113
116
  module.debug('Attaching modal events to element', selector, event);
@@ -124,7 +127,14 @@ $.fn.modal = function(parameters) {
124
127
  event: {
125
128
  close: function() {
126
129
  module.verbose('Close button pressed');
127
- $context.dimmer('hide');
130
+ module.hide();
131
+ },
132
+ click: function(event) {
133
+ module.verbose('Determining if event occured on dimmer', event);
134
+ if( $dimmer.find(event.target).size() === 0 ) {
135
+ module.hide();
136
+ event.stopImmediatePropagation();
137
+ }
128
138
  },
129
139
  debounce: function(method, delay) {
130
140
  clearTimeout(module.timer);
@@ -137,12 +147,12 @@ $.fn.modal = function(parameters) {
137
147
  ;
138
148
  if(keyCode == escapeKey) {
139
149
  module.debug('Escape key pressed hiding modal');
140
- $context.dimmer('hide');
150
+ module.hide();
141
151
  event.preventDefault();
142
152
  }
143
153
  },
144
154
  resize: function() {
145
- if( $context.dimmer('is active') ) {
155
+ if( $dimmable.dimmer('is active') ) {
146
156
  module.refresh();
147
157
  }
148
158
  }
@@ -164,20 +174,12 @@ $.fn.modal = function(parameters) {
164
174
  module.hideAll();
165
175
  if(settings.transition && $.fn.transition !== undefined) {
166
176
  $module
167
- .transition(settings.transition + ' in', settings.duration, function() {
168
- module.set.active();
169
- module.save.focus();
170
- module.set.type();
171
- })
177
+ .transition(settings.transition + ' in', settings.duration, module.set.active)
172
178
  ;
173
179
  }
174
180
  else {
175
181
  $module
176
- .fadeIn(settings.duration, settings.easing, function() {
177
- module.set.active();
178
- module.save.focus();
179
- module.set.type();
180
- })
182
+ .fadeIn(settings.duration, settings.easing, module.set.active)
181
183
  ;
182
184
  }
183
185
  module.debug('Triggering dimmer');
@@ -187,18 +189,35 @@ $.fn.modal = function(parameters) {
187
189
  showDimmer: function() {
188
190
  module.debug('Showing modal');
189
191
  module.set.dimmerSettings();
190
- $context.dimmer('show');
192
+ $dimmable.dimmer('show');
191
193
  },
194
+
195
+ hide: function() {
196
+ if(settings.closable) {
197
+ $dimmer
198
+ .off('click' + eventNamespace)
199
+ ;
200
+ }
201
+ if( $dimmable.dimmer('is active') ) {
202
+ $dimmable.dimmer('hide');
203
+ }
204
+ if( module.is.active() ) {
205
+ module.hideModal();
206
+ $.proxy(settings.onHide, element)();
207
+ }
208
+ else {
209
+ module.debug('Cannot hide modal, modal is not visible');
210
+ }
211
+ },
212
+
192
213
  hideDimmer: function() {
193
- $context.dimmer('hide');
214
+ module.debug('Hiding dimmer');
215
+ $dimmable.dimmer('hide');
194
216
  },
195
217
 
196
- hide: function() {
218
+ hideModal: function() {
197
219
  module.debug('Hiding modal');
198
- // remove keyboard detection
199
- $document
200
- .off('keyup.' + eventNamespace)
201
- ;
220
+ module.remove.keyboardShortcuts();
202
221
  if(settings.transition && $.fn.transition !== undefined) {
203
222
  $module
204
223
  .transition(settings.transition + ' out', settings.duration, function() {
@@ -215,7 +234,6 @@ $.fn.modal = function(parameters) {
215
234
  })
216
235
  ;
217
236
  }
218
- $.proxy(settings.onHide, element)();
219
237
  },
220
238
 
221
239
  hideAll: function() {
@@ -242,7 +260,9 @@ $.fn.modal = function(parameters) {
242
260
 
243
261
  restore: {
244
262
  focus: function() {
245
- $focusedElement.focus();
263
+ if($focusedElement.size() > 0) {
264
+ $focusedElement.focus();
265
+ }
246
266
  }
247
267
  },
248
268
 
@@ -257,7 +277,7 @@ $.fn.modal = function(parameters) {
257
277
  ;
258
278
  },
259
279
  scrolling: function() {
260
- $dimmer.removeClass(className.scrolling);
280
+ $dimmable.removeClass(className.scrolling);
261
281
  $module.removeClass(className.scrolling);
262
282
  }
263
283
  },
@@ -267,7 +287,7 @@ $.fn.modal = function(parameters) {
267
287
  height : $module.outerHeight() + settings.offset,
268
288
  contextHeight : (settings.context == 'body')
269
289
  ? $(window).height()
270
- : $context.height()
290
+ : $dimmable.height()
271
291
  };
272
292
  module.debug('Caching modal and container sizes', module.cache);
273
293
  },
@@ -286,27 +306,33 @@ $.fn.modal = function(parameters) {
286
306
 
287
307
  set: {
288
308
  active: function() {
289
- $module.addClass(className.active);
309
+ module.save.focus();
310
+ module.set.type();
311
+ $module
312
+ .addClass(className.active)
313
+ ;
314
+ if(settings.closable) {
315
+ $dimmer
316
+ .on('click' + eventNamespace, module.event.click)
317
+ ;
318
+ }
290
319
  },
291
320
  dimmerSettings: function() {
292
- module.debug('Setting dimmer settings', settings.closable);
293
- $context
294
- .dimmer('setting', 'closable', settings.closable)
321
+ module.debug('Setting dimmer settings', $dimmable);
322
+ $dimmable
323
+ .dimmer('setting', 'closable', false)
295
324
  .dimmer('setting', 'duration', {
296
325
  show : settings.duration * 0.95,
297
326
  hide : settings.duration * 1.05
298
327
  })
299
328
  .dimmer('setting', 'onShow' , module.add.keyboardShortcuts)
300
- .dimmer('setting', 'onHide', function() {
301
- module.hide();
302
- module.remove.keyboardShortcuts();
303
- })
329
+ // destory after changing settings in order to reattach events
304
330
  .dimmer('destroy')
305
331
  .dimmer('initialize')
306
332
  ;
307
333
  },
308
334
  scrolling: function() {
309
- $dimmer.addClass(className.scrolling);
335
+ $dimmable.addClass(className.scrolling);
310
336
  $module.addClass(className.scrolling);
311
337
  },
312
338
  type: function() {