semantic-ui-sass 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +51 -0
  6. data/Rakefile +5 -0
  7. data/app/assets/fonts/semantic-ui/basic.icons.eot +0 -0
  8. data/app/assets/fonts/semantic-ui/basic.icons.svg +450 -0
  9. data/app/assets/fonts/semantic-ui/basic.icons.ttf +0 -0
  10. data/app/assets/fonts/semantic-ui/basic.icons.woff +0 -0
  11. data/app/assets/fonts/semantic-ui/icons.eot +0 -0
  12. data/app/assets/fonts/semantic-ui/icons.otf +0 -0
  13. data/app/assets/fonts/semantic-ui/icons.svg +399 -0
  14. data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
  15. data/app/assets/fonts/semantic-ui/icons.woff +0 -0
  16. data/app/assets/images/semantic-ui/loader-large-inverted.gif +0 -0
  17. data/app/assets/images/semantic-ui/loader-large.gif +0 -0
  18. data/app/assets/images/semantic-ui/loader-medium-inverted.gif +0 -0
  19. data/app/assets/images/semantic-ui/loader-medium.gif +0 -0
  20. data/app/assets/images/semantic-ui/loader-mini-inverted.gif +0 -0
  21. data/app/assets/images/semantic-ui/loader-mini.gif +0 -0
  22. data/app/assets/images/semantic-ui/loader-small-inverted.gif +0 -0
  23. data/app/assets/images/semantic-ui/loader-small.gif +0 -0
  24. data/app/assets/javascripts/semantic-ui.js +20 -0
  25. data/app/assets/javascripts/semantic-ui/accordion.js +419 -0
  26. data/app/assets/javascripts/semantic-ui/behavior/api.js +638 -0
  27. data/app/assets/javascripts/semantic-ui/behavior/colorize.js +270 -0
  28. data/app/assets/javascripts/semantic-ui/behavior/form.js +702 -0
  29. data/app/assets/javascripts/semantic-ui/behavior/state.js +725 -0
  30. data/app/assets/javascripts/semantic-ui/chatroom.js +769 -0
  31. data/app/assets/javascripts/semantic-ui/checkbox.js +344 -0
  32. data/app/assets/javascripts/semantic-ui/dimmer.js +564 -0
  33. data/app/assets/javascripts/semantic-ui/dropdown.js +724 -0
  34. data/app/assets/javascripts/semantic-ui/modal.js +553 -0
  35. data/app/assets/javascripts/semantic-ui/nag.js +545 -0
  36. data/app/assets/javascripts/semantic-ui/popup.js +727 -0
  37. data/app/assets/javascripts/semantic-ui/rating.js +403 -0
  38. data/app/assets/javascripts/semantic-ui/search.js +772 -0
  39. data/app/assets/javascripts/semantic-ui/shape.js +778 -0
  40. data/app/assets/javascripts/semantic-ui/sidebar.js +490 -0
  41. data/app/assets/javascripts/semantic-ui/tab.js +689 -0
  42. data/app/assets/javascripts/semantic-ui/transition.js +654 -0
  43. data/app/assets/javascripts/semantic-ui/video.js +457 -0
  44. data/app/assets/stylesheets/semantic-ui.scss +4 -0
  45. data/app/assets/stylesheets/semantic-ui/collections/_all.scss +6 -0
  46. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +77 -0
  47. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +569 -0
  48. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +643 -0
  49. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +1767 -0
  50. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +347 -0
  51. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +524 -0
  52. data/app/assets/stylesheets/semantic-ui/elements/_all.scss +12 -0
  53. data/app/assets/stylesheets/semantic-ui/elements/_basic.icon.scss +479 -0
  54. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +1187 -0
  55. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +199 -0
  56. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +342 -0
  57. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +772 -0
  58. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +181 -0
  59. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +338 -0
  60. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +827 -0
  61. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +185 -0
  62. data/app/assets/stylesheets/semantic-ui/elements/_progress.scss +352 -0
  63. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +464 -0
  64. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +293 -0
  65. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +199 -0
  66. data/app/assets/stylesheets/semantic-ui/modules/_all.scss +16 -0
  67. data/app/assets/stylesheets/semantic-ui/modules/_chatroom.scss +281 -0
  68. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +481 -0
  69. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +236 -0
  70. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +548 -0
  71. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +217 -0
  72. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +173 -0
  73. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +255 -0
  74. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +179 -0
  75. data/app/assets/stylesheets/semantic-ui/modules/_reveal.scss +365 -0
  76. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +273 -0
  77. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +113 -0
  78. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +150 -0
  79. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +63 -0
  80. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +1096 -0
  81. data/app/assets/stylesheets/semantic-ui/modules/_video.scss +98 -0
  82. data/app/assets/stylesheets/semantic-ui/views/_all.scss +5 -0
  83. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +221 -0
  84. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +152 -0
  85. data/app/assets/stylesheets/semantic-ui/views/_item.scss +651 -0
  86. data/app/assets/stylesheets/semantic-ui/views/_list.scss +555 -0
  87. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +27 -0
  88. data/lib/semantic/ui/sass.rb +10 -0
  89. data/lib/semantic/ui/sass/engine.rb +13 -0
  90. data/lib/semantic/ui/sass/version.rb +8 -0
  91. data/semantic-ui-sass.gemspec +24 -0
  92. data/tasks/converter.rb +237 -0
  93. metadata +177 -0
@@ -0,0 +1,553 @@
1
+ /*
2
+ * # Semantic - Modal
3
+ * http://github.com/jlukic/semantic-ui/
4
+ *
5
+ *
6
+ * Copyright 2013 Contributors
7
+ * Released under the MIT license
8
+ * http://opensource.org/licenses/MIT
9
+ *
10
+ */
11
+
12
+ ;(function ( $, window, document, undefined ) {
13
+
14
+ $.fn.modal = function(parameters) {
15
+ var
16
+ $allModules = $(this),
17
+ $window = $(window),
18
+ $document = $(document),
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
+ time = new Date().getTime(),
34
+ performance = [],
35
+
36
+ query = arguments[0],
37
+ methodInvoked = (typeof query == 'string'),
38
+ queryArguments = [].slice.call(arguments, 1),
39
+
40
+ invokedResponse
41
+ ;
42
+
43
+
44
+ $allModules
45
+ .each(function() {
46
+ var
47
+ $module = $(this),
48
+ $context = $(settings.context),
49
+ $otherModals = $allModules.not($module),
50
+ $close = $module.find(selector.close),
51
+
52
+ $focusedElement,
53
+ $dimmer,
54
+
55
+ element = this,
56
+ instance = $module.data(moduleNamespace),
57
+ module
58
+ ;
59
+
60
+ module = {
61
+
62
+ initialize: function() {
63
+ module.verbose('Initializing dimmer', $context);
64
+
65
+ $dimmer = $context
66
+ .dimmer('add content', $module)
67
+ .dimmer('get dimmer')
68
+ ;
69
+
70
+ module.verbose('Attaching close events', $close);
71
+ $close
72
+ .on('click' + eventNamespace, module.event.close)
73
+ ;
74
+ $window
75
+ .on('resize', function() {
76
+ module.event.debounce(module.refresh, 50);
77
+ })
78
+ ;
79
+ module.instantiate();
80
+ },
81
+
82
+ instantiate: function() {
83
+ module.verbose('Storing instance of modal');
84
+ instance = module;
85
+ $module
86
+ .data(moduleNamespace, instance)
87
+ ;
88
+ },
89
+
90
+ destroy: function() {
91
+ module.verbose('Destroying previous modal');
92
+ $module
93
+ .off(eventNamespace)
94
+ ;
95
+ },
96
+
97
+ refresh: function() {
98
+ module.remove.scrolling();
99
+ module.cacheSizes();
100
+ module.set.type();
101
+ module.set.position();
102
+ },
103
+
104
+ attachEvents: function(selector, event) {
105
+ var
106
+ $toggle = $(selector)
107
+ ;
108
+ event = $.isFunction(module[event])
109
+ ? module[event]
110
+ : module.show
111
+ ;
112
+ if($toggle.size() > 0) {
113
+ module.debug('Attaching modal events to element', selector, event);
114
+ $toggle
115
+ .off(eventNamespace)
116
+ .on('click' + eventNamespace, event)
117
+ ;
118
+ }
119
+ else {
120
+ module.error(error.notFound);
121
+ }
122
+ },
123
+
124
+ event: {
125
+ close: function() {
126
+ module.verbose('Close button pressed');
127
+ $context.dimmer('hide');
128
+ },
129
+ debounce: function(method, delay) {
130
+ clearTimeout(module.timer);
131
+ module.timer = setTimeout(method, delay);
132
+ },
133
+ keyboard: function(event) {
134
+ var
135
+ keyCode = event.which,
136
+ escapeKey = 27
137
+ ;
138
+ if(keyCode == escapeKey) {
139
+ module.debug('Escape key pressed hiding modal');
140
+ $context.dimmer('hide');
141
+ event.preventDefault();
142
+ }
143
+ },
144
+ resize: function() {
145
+ if( $context.dimmer('is active') ) {
146
+ module.refresh();
147
+ }
148
+ }
149
+ },
150
+
151
+ toggle: function() {
152
+ if( module.is.active() ) {
153
+ module.hide();
154
+ }
155
+ else {
156
+ module.show();
157
+ }
158
+ },
159
+
160
+ show: function() {
161
+ module.showDimmer();
162
+ module.cacheSizes();
163
+ module.set.position();
164
+ module.hideAll();
165
+ if(settings.transition && $.fn.transition !== undefined) {
166
+ $module
167
+ .transition(settings.transition + ' in', settings.duration, function() {
168
+ module.set.active();
169
+ module.save.focus();
170
+ module.set.type();
171
+ })
172
+ ;
173
+ }
174
+ else {
175
+ $module
176
+ .fadeIn(settings.duration, settings.easing, function() {
177
+ module.set.active();
178
+ module.save.focus();
179
+ module.set.type();
180
+ })
181
+ ;
182
+ }
183
+ module.debug('Triggering dimmer');
184
+ $.proxy(settings.onShow, element)();
185
+ },
186
+
187
+ showDimmer: function() {
188
+ module.debug('Showing modal');
189
+ module.set.dimmerSettings();
190
+ $context.dimmer('show');
191
+ },
192
+ hideDimmer: function() {
193
+ $context.dimmer('hide');
194
+ },
195
+
196
+ hide: function() {
197
+ module.debug('Hiding modal');
198
+ // remove keyboard detection
199
+ $document
200
+ .off('keyup.' + eventNamespace)
201
+ ;
202
+ if(settings.transition && $.fn.transition !== undefined) {
203
+ $module
204
+ .transition(settings.transition + ' out', settings.duration, function() {
205
+ module.remove.active();
206
+ module.restore.focus();
207
+ })
208
+ ;
209
+ }
210
+ else {
211
+ $module
212
+ .fadeOut(settings.duration, settings.easing, function() {
213
+ module.remove.active();
214
+ module.restore.focus();
215
+ })
216
+ ;
217
+ }
218
+ $.proxy(settings.onHide, element)();
219
+ },
220
+
221
+ hideAll: function() {
222
+ $otherModals
223
+ .filter(':visible')
224
+ .modal('hide')
225
+ ;
226
+ },
227
+
228
+ add: {
229
+ keyboardShortcuts: function() {
230
+ module.verbose('Adding keyboard shortcuts');
231
+ $document
232
+ .on('keyup' + eventNamespace, module.event.keyboard)
233
+ ;
234
+ }
235
+ },
236
+
237
+ save: {
238
+ focus: function() {
239
+ $focusedElement = $(document.activeElement).blur();
240
+ }
241
+ },
242
+
243
+ restore: {
244
+ focus: function() {
245
+ $focusedElement.focus();
246
+ }
247
+ },
248
+
249
+ remove: {
250
+ active: function() {
251
+ $module.removeClass(className.active);
252
+ },
253
+ keyboardShortcuts: function() {
254
+ module.verbose('Removing keyboard shortcuts');
255
+ $document
256
+ .off('keyup' + eventNamespace)
257
+ ;
258
+ },
259
+ scrolling: function() {
260
+ $dimmer.removeClass(className.scrolling);
261
+ $module.removeClass(className.scrolling);
262
+ }
263
+ },
264
+
265
+ cacheSizes: function() {
266
+ module.cache = {
267
+ height : $module.outerHeight() + settings.offset,
268
+ contextHeight : (settings.context == 'body')
269
+ ? $(window).height()
270
+ : $context.height()
271
+ };
272
+ module.debug('Caching modal and container sizes', module.cache);
273
+ },
274
+
275
+ can: {
276
+ fit: function() {
277
+ return (module.cache.height < module.cache.contextHeight);
278
+ }
279
+ },
280
+
281
+ is: {
282
+ active: function() {
283
+ return $module.hasClass(className.active);
284
+ }
285
+ },
286
+
287
+ set: {
288
+ active: function() {
289
+ $module.addClass(className.active);
290
+ },
291
+ dimmerSettings: function() {
292
+ module.debug('Setting dimmer settings', settings.closable);
293
+ $context
294
+ .dimmer('setting', 'closable', settings.closable)
295
+ .dimmer('setting', 'duration', {
296
+ show : settings.duration * 0.95,
297
+ hide : settings.duration * 1.05
298
+ })
299
+ .dimmer('setting', 'onShow' , module.add.keyboardShortcuts)
300
+ .dimmer('setting', 'onHide', function() {
301
+ module.hide();
302
+ module.remove.keyboardShortcuts();
303
+ })
304
+ .dimmer('destroy')
305
+ .dimmer('initialize')
306
+ ;
307
+ },
308
+ scrolling: function() {
309
+ $dimmer.addClass(className.scrolling);
310
+ $module.addClass(className.scrolling);
311
+ },
312
+ type: function() {
313
+ if(module.can.fit()) {
314
+ module.verbose('Modal fits on screen');
315
+ module.remove.scrolling();
316
+ }
317
+ else {
318
+ module.verbose('Modal cannot fit on screen setting to scrolling');
319
+ module.set.scrolling();
320
+ }
321
+ },
322
+ position: function() {
323
+ module.verbose('Centering modal on page', module.cache, module.cache.height / 2);
324
+ if(module.can.fit()) {
325
+ $module
326
+ .css({
327
+ top: '',
328
+ marginTop: -(module.cache.height / 2)
329
+ })
330
+ ;
331
+ }
332
+ else {
333
+ $module
334
+ .css({
335
+ marginTop : '1em',
336
+ top : $document.scrollTop()
337
+ })
338
+ ;
339
+ }
340
+ }
341
+ },
342
+
343
+ setting: function(name, value) {
344
+ if(value !== undefined) {
345
+ if( $.isPlainObject(name) ) {
346
+ $.extend(true, settings, name);
347
+ }
348
+ else {
349
+ settings[name] = value;
350
+ }
351
+ }
352
+ else {
353
+ return settings[name];
354
+ }
355
+ },
356
+ internal: function(name, value) {
357
+ if(value !== undefined) {
358
+ if( $.isPlainObject(name) ) {
359
+ $.extend(true, module, name);
360
+ }
361
+ else {
362
+ module[name] = value;
363
+ }
364
+ }
365
+ else {
366
+ return module[name];
367
+ }
368
+ },
369
+ debug: function() {
370
+ if(settings.debug) {
371
+ if(settings.performance) {
372
+ module.performance.log(arguments);
373
+ }
374
+ else {
375
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
376
+ module.debug.apply(console, arguments);
377
+ }
378
+ }
379
+ },
380
+ verbose: function() {
381
+ if(settings.verbose && settings.debug) {
382
+ if(settings.performance) {
383
+ module.performance.log(arguments);
384
+ }
385
+ else {
386
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
387
+ module.verbose.apply(console, arguments);
388
+ }
389
+ }
390
+ },
391
+ error: function() {
392
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
393
+ module.error.apply(console, arguments);
394
+ },
395
+ performance: {
396
+ log: function(message) {
397
+ var
398
+ currentTime,
399
+ executionTime,
400
+ previousTime
401
+ ;
402
+ if(settings.performance) {
403
+ currentTime = new Date().getTime();
404
+ previousTime = time || currentTime;
405
+ executionTime = currentTime - previousTime;
406
+ time = currentTime;
407
+ performance.push({
408
+ 'Element' : element,
409
+ 'Name' : message[0],
410
+ 'Arguments' : [].slice.call(message, 1) || '',
411
+ 'Execution Time' : executionTime
412
+ });
413
+ }
414
+ clearTimeout(module.performance.timer);
415
+ module.performance.timer = setTimeout(module.performance.display, 100);
416
+ },
417
+ display: function() {
418
+ var
419
+ title = settings.name + ':',
420
+ totalTime = 0
421
+ ;
422
+ time = false;
423
+ clearTimeout(module.performance.timer);
424
+ $.each(performance, function(index, data) {
425
+ totalTime += data['Execution Time'];
426
+ });
427
+ title += ' ' + totalTime + 'ms';
428
+ if(moduleSelector) {
429
+ title += ' \'' + moduleSelector + '\'';
430
+ }
431
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
432
+ console.groupCollapsed(title);
433
+ if(console.table) {
434
+ console.table(performance);
435
+ }
436
+ else {
437
+ $.each(performance, function(index, data) {
438
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
439
+ });
440
+ }
441
+ console.groupEnd();
442
+ }
443
+ performance = [];
444
+ }
445
+ },
446
+ invoke: function(query, passedArguments, context) {
447
+ var
448
+ maxDepth,
449
+ found,
450
+ response
451
+ ;
452
+ passedArguments = passedArguments || queryArguments;
453
+ context = element || context;
454
+ if(typeof query == 'string' && instance !== undefined) {
455
+ query = query.split(/[\. ]/);
456
+ maxDepth = query.length - 1;
457
+ $.each(query, function(depth, value) {
458
+ var camelCaseValue = (depth != maxDepth)
459
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
460
+ : query
461
+ ;
462
+ if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
463
+ instance = instance[value];
464
+ }
465
+ else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
466
+ instance = instance[camelCaseValue];
467
+ }
468
+ else if( instance[value] !== undefined ) {
469
+ found = instance[value];
470
+ return false;
471
+ }
472
+ else if( instance[camelCaseValue] !== undefined ) {
473
+ found = instance[camelCaseValue];
474
+ return false;
475
+ }
476
+ else {
477
+ module.error(error.method);
478
+ return false;
479
+ }
480
+ });
481
+ }
482
+ if ( $.isFunction( found ) ) {
483
+ response = found.apply(context, passedArguments);
484
+ }
485
+ else if(found !== undefined) {
486
+ response = found;
487
+ }
488
+ if($.isArray(invokedResponse)) {
489
+ invokedResponse.push(response);
490
+ }
491
+ else if(typeof invokedResponse == 'string') {
492
+ invokedResponse = [invokedResponse, response];
493
+ }
494
+ else if(response !== undefined) {
495
+ invokedResponse = response;
496
+ }
497
+ return found;
498
+ }
499
+ };
500
+
501
+ if(methodInvoked) {
502
+ if(instance === undefined) {
503
+ module.initialize();
504
+ }
505
+ module.invoke(query);
506
+ }
507
+ else {
508
+ if(instance !== undefined) {
509
+ module.destroy();
510
+ }
511
+ module.initialize();
512
+ }
513
+ })
514
+ ;
515
+
516
+ return (invokedResponse !== undefined)
517
+ ? invokedResponse
518
+ : this
519
+ ;
520
+ };
521
+
522
+ $.fn.modal.settings = {
523
+
524
+ name : 'Modal',
525
+ namespace : 'modal',
526
+ verbose : true,
527
+ debug : true,
528
+ performance : true,
529
+
530
+ closable : true,
531
+ context : 'body',
532
+ duration : 500,
533
+ easing : 'easeOutExpo',
534
+ offset : 0,
535
+ transition : 'scale',
536
+
537
+ onShow : function(){},
538
+ onHide : function(){},
539
+
540
+ selector : {
541
+ close : '.close, .actions .button'
542
+ },
543
+ error : {
544
+ method : 'The method you called is not defined.'
545
+ },
546
+ className : {
547
+ active : 'active',
548
+ scrolling : 'scrolling'
549
+ },
550
+ };
551
+
552
+
553
+ })( jQuery, window , document );