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,545 @@
1
+ /*
2
+ * # Semantic - Nag
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.nag = function(parameters) {
15
+ var
16
+ $allModules = $(this),
17
+ settings = $.extend(true, {}, $.fn.nag.settings, parameters),
18
+
19
+ className = settings.className,
20
+ selector = settings.selector,
21
+ error = settings.error,
22
+ namespace = settings.namespace,
23
+
24
+ eventNamespace = '.' + namespace,
25
+ moduleNamespace = namespace + '-module',
26
+ moduleSelector = $allModules.selector || '',
27
+
28
+ time = new Date().getTime(),
29
+ performance = [],
30
+
31
+ query = arguments[0],
32
+ methodInvoked = (typeof query == 'string'),
33
+ queryArguments = [].slice.call(arguments, 1),
34
+ invokedResponse
35
+ ;
36
+ $(this)
37
+ .each(function() {
38
+ var
39
+ $module = $(this),
40
+
41
+ $close = $module.find(selector.close),
42
+ $context = $(settings.context),
43
+
44
+
45
+ element = this,
46
+ instance = $module.data(moduleNamespace),
47
+
48
+ moduleOffset,
49
+ moduleHeight,
50
+
51
+ contextWidth,
52
+ contextHeight,
53
+ contextOffset,
54
+
55
+ yOffset,
56
+ yPosition,
57
+
58
+ timer,
59
+ module,
60
+
61
+ requestAnimationFrame = window.requestAnimationFrame
62
+ || window.mozRequestAnimationFrame
63
+ || window.webkitRequestAnimationFrame
64
+ || window.msRequestAnimationFrame
65
+ || function(callback) { setTimeout(callback, 0); }
66
+ ;
67
+ module = {
68
+
69
+ initialize: function() {
70
+ module.verbose('Initializing element');
71
+ // calculate module offset once
72
+ moduleOffset = $module.offset();
73
+ moduleHeight = $module.outerHeight();
74
+ contextWidth = $context.outerWidth();
75
+ contextHeight = $context.outerHeight();
76
+ contextOffset = $context.offset();
77
+
78
+ $module
79
+ .data(moduleNamespace, module)
80
+ ;
81
+ $close
82
+ .on('click' + eventNamespace, module.dismiss)
83
+ ;
84
+ // lets avoid javascript if we dont need to reposition
85
+ if(settings.context == window && settings.position == 'fixed') {
86
+ $module
87
+ .addClass(className.fixed)
88
+ ;
89
+ }
90
+ if(settings.sticky) {
91
+ module.verbose('Adding scroll events');
92
+ // retrigger on scroll for absolute
93
+ if(settings.position == 'absolute') {
94
+ $context
95
+ .on('scroll' + eventNamespace, module.event.scroll)
96
+ .on('resize' + eventNamespace, module.event.scroll)
97
+ ;
98
+ }
99
+ // fixed is always relative to window
100
+ else {
101
+ $(window)
102
+ .on('scroll' + eventNamespace, module.event.scroll)
103
+ .on('resize' + eventNamespace, module.event.scroll)
104
+ ;
105
+ }
106
+ // fire once to position on init
107
+ $.proxy(module.event.scroll, this)();
108
+ }
109
+
110
+ if(settings.displayTime > 0) {
111
+ setTimeout(module.hide, settings.displayTime);
112
+ }
113
+ if(module.should.show()) {
114
+ if( !$module.is(':visible') ) {
115
+ module.show();
116
+ }
117
+ }
118
+ else {
119
+ module.hide();
120
+ }
121
+ },
122
+
123
+ destroy: function() {
124
+ module.verbose('Destroying instance');
125
+ $module
126
+ .removeData(moduleNamespace)
127
+ .off(eventNamespace)
128
+ ;
129
+ if(settings.sticky) {
130
+ $context
131
+ .off(eventNamespace)
132
+ ;
133
+ }
134
+ },
135
+
136
+ refresh: function() {
137
+ module.debug('Refreshing cached calculations');
138
+ moduleOffset = $module.offset();
139
+ moduleHeight = $module.outerHeight();
140
+ contextWidth = $context.outerWidth();
141
+ contextHeight = $context.outerHeight();
142
+ contextOffset = $context.offset();
143
+ },
144
+
145
+ show: function() {
146
+ module.debug('Showing nag', settings.animation.show);
147
+ if(settings.animation.show == 'fade') {
148
+ $module
149
+ .fadeIn(settings.duration, settings.easing)
150
+ ;
151
+ }
152
+ else {
153
+ $module
154
+ .slideDown(settings.duration, settings.easing)
155
+ ;
156
+ }
157
+ },
158
+
159
+ hide: function() {
160
+ module.debug('Showing nag', settings.animation.hide);
161
+ if(settings.animation.show == 'fade') {
162
+ $module
163
+ .fadeIn(settings.duration, settings.easing)
164
+ ;
165
+ }
166
+ else {
167
+ $module
168
+ .slideUp(settings.duration, settings.easing)
169
+ ;
170
+ }
171
+ },
172
+
173
+ onHide: function() {
174
+ module.debug('Removing nag', settings.animation.hide);
175
+ $module.remove();
176
+ if (settings.onHide) {
177
+ settings.onHide();
178
+ }
179
+ },
180
+
181
+ stick: function() {
182
+ module.refresh();
183
+
184
+ if(settings.position == 'fixed') {
185
+ var
186
+ windowScroll = $(window).prop('pageYOffset') || $(window).scrollTop(),
187
+ fixedOffset = ( $module.hasClass(className.bottom) )
188
+ ? contextOffset.top + (contextHeight - moduleHeight) - windowScroll
189
+ : contextOffset.top - windowScroll
190
+ ;
191
+ $module
192
+ .css({
193
+ position : 'fixed',
194
+ top : fixedOffset,
195
+ left : contextOffset.left,
196
+ width : contextWidth - settings.scrollBarWidth
197
+ })
198
+ ;
199
+ }
200
+ else {
201
+ $module
202
+ .css({
203
+ top : yPosition
204
+ })
205
+ ;
206
+ }
207
+ },
208
+ unStick: function() {
209
+ $module
210
+ .css({
211
+ top : ''
212
+ })
213
+ ;
214
+ },
215
+ dismiss: function(event) {
216
+ if(settings.storageMethod) {
217
+ module.storage.set(settings.storedKey, settings.storedValue);
218
+ }
219
+ module.hide();
220
+ event.stopImmediatePropagation();
221
+ event.preventDefault();
222
+ },
223
+
224
+ should: {
225
+ show: function() {
226
+ if(settings.persist) {
227
+ module.debug('Persistent nag is set, can show nag');
228
+ return true;
229
+ }
230
+ if(module.storage.get(settings.storedKey) != settings.storedValue) {
231
+ module.debug('Stored value is not set, can show nag', module.storage.get(settings.storedKey));
232
+ return true;
233
+ }
234
+ module.debug('Stored value is set, cannot show nag', module.storage.get(settings.storedKey));
235
+ return false;
236
+ },
237
+ stick: function() {
238
+ yOffset = $context.prop('pageYOffset') || $context.scrollTop();
239
+ yPosition = ( $module.hasClass(className.bottom) )
240
+ ? (contextHeight - $module.outerHeight() ) + yOffset
241
+ : yOffset
242
+ ;
243
+ // absolute position calculated when y offset met
244
+ if(yPosition > moduleOffset.top) {
245
+ return true;
246
+ }
247
+ else if(settings.position == 'fixed') {
248
+ return true;
249
+ }
250
+ return false;
251
+ }
252
+ },
253
+
254
+ storage: {
255
+
256
+ set: function(key, value) {
257
+ module.debug('Setting stored value', key, value, settings.storageMethod);
258
+ if(settings.storageMethod == 'local' && window.store !== undefined) {
259
+ window.store.set(key, value);
260
+ }
261
+ // store by cookie
262
+ else if($.cookie !== undefined) {
263
+ $.cookie(key, value);
264
+ }
265
+ else {
266
+ module.error(error.noStorage);
267
+ }
268
+ },
269
+ get: function(key) {
270
+ module.debug('Getting stored value', key, settings.storageMethod);
271
+ if(settings.storageMethod == 'local' && window.store !== undefined) {
272
+ return window.store.get(key);
273
+ }
274
+ // get by cookie
275
+ else if($.cookie !== undefined) {
276
+ return $.cookie(key);
277
+ }
278
+ else {
279
+ module.error(error.noStorage);
280
+ }
281
+ }
282
+
283
+ },
284
+
285
+ event: {
286
+ scroll: function() {
287
+ if(timer !== undefined) {
288
+ clearTimeout(timer);
289
+ }
290
+ timer = setTimeout(function() {
291
+ if(module.should.stick() ) {
292
+ requestAnimationFrame(module.stick);
293
+ }
294
+ else {
295
+ module.unStick();
296
+ }
297
+ }, settings.lag);
298
+ }
299
+ },
300
+ setting: function(name, value) {
301
+ module.debug('Changing setting', name, value);
302
+ if(value !== undefined) {
303
+ if( $.isPlainObject(name) ) {
304
+ $.extend(true, settings, name);
305
+ }
306
+ else {
307
+ settings[name] = value;
308
+ }
309
+ }
310
+ else {
311
+ return settings[name];
312
+ }
313
+ },
314
+ internal: function(name, value) {
315
+ module.debug('Changing internal', name, value);
316
+ if(value !== undefined) {
317
+ if( $.isPlainObject(name) ) {
318
+ $.extend(true, module, name);
319
+ }
320
+ else {
321
+ module[name] = value;
322
+ }
323
+ }
324
+ else {
325
+ return module[name];
326
+ }
327
+ },
328
+ debug: function() {
329
+ if(settings.debug) {
330
+ if(settings.performance) {
331
+ module.performance.log(arguments);
332
+ }
333
+ else {
334
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
335
+ module.debug.apply(console, arguments);
336
+ }
337
+ }
338
+ },
339
+ verbose: function() {
340
+ if(settings.verbose && settings.debug) {
341
+ if(settings.performance) {
342
+ module.performance.log(arguments);
343
+ }
344
+ else {
345
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
346
+ module.verbose.apply(console, arguments);
347
+ }
348
+ }
349
+ },
350
+ error: function() {
351
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
352
+ module.error.apply(console, arguments);
353
+ },
354
+ performance: {
355
+ log: function(message) {
356
+ var
357
+ currentTime,
358
+ executionTime,
359
+ previousTime
360
+ ;
361
+ if(settings.performance) {
362
+ currentTime = new Date().getTime();
363
+ previousTime = time || currentTime;
364
+ executionTime = currentTime - previousTime;
365
+ time = currentTime;
366
+ performance.push({
367
+ 'Element' : element,
368
+ 'Name' : message[0],
369
+ 'Arguments' : [].slice.call(message, 1) || '',
370
+ 'Execution Time' : executionTime
371
+ });
372
+ }
373
+ clearTimeout(module.performance.timer);
374
+ module.performance.timer = setTimeout(module.performance.display, 100);
375
+ },
376
+ display: function() {
377
+ var
378
+ title = settings.name + ':',
379
+ totalTime = 0
380
+ ;
381
+ time = false;
382
+ clearTimeout(module.performance.timer);
383
+ $.each(performance, function(index, data) {
384
+ totalTime += data['Execution Time'];
385
+ });
386
+ title += ' ' + totalTime + 'ms';
387
+ if(moduleSelector) {
388
+ title += ' \'' + moduleSelector + '\'';
389
+ }
390
+ if($allModules.size() > 1) {
391
+ title += ' ' + '(' + $allModules.size() + ')';
392
+ }
393
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
394
+ console.groupCollapsed(title);
395
+ if(console.table) {
396
+ console.table(performance);
397
+ }
398
+ else {
399
+ $.each(performance, function(index, data) {
400
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
401
+ });
402
+ }
403
+ console.groupEnd();
404
+ }
405
+ performance = [];
406
+ }
407
+ },
408
+ invoke: function(query, passedArguments, context) {
409
+ var
410
+ maxDepth,
411
+ found,
412
+ response
413
+ ;
414
+ passedArguments = passedArguments || queryArguments;
415
+ context = element || context;
416
+ if(typeof query == 'string' && instance !== undefined) {
417
+ query = query.split(/[\. ]/);
418
+ maxDepth = query.length - 1;
419
+ $.each(query, function(depth, value) {
420
+ var camelCaseValue = (depth != maxDepth)
421
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
422
+ : query
423
+ ;
424
+ if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
425
+ instance = instance[value];
426
+ }
427
+ else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
428
+ instance = instance[camelCaseValue];
429
+ }
430
+ else if( instance[value] !== undefined ) {
431
+ found = instance[value];
432
+ return false;
433
+ }
434
+ else if( instance[camelCaseValue] !== undefined ) {
435
+ found = instance[camelCaseValue];
436
+ return false;
437
+ }
438
+ else {
439
+ module.error(error.method);
440
+ return false;
441
+ }
442
+ });
443
+ }
444
+ if ( $.isFunction( found ) ) {
445
+ response = found.apply(context, passedArguments);
446
+ }
447
+ else if(found !== undefined) {
448
+ response = found;
449
+ }
450
+ if($.isArray(invokedResponse)) {
451
+ invokedResponse.push(response);
452
+ }
453
+ else if(typeof invokedResponse == 'string') {
454
+ invokedResponse = [invokedResponse, response];
455
+ }
456
+ else if(response !== undefined) {
457
+ invokedResponse = response;
458
+ }
459
+ return found;
460
+ }
461
+ };
462
+ if(methodInvoked) {
463
+ if(instance === undefined) {
464
+ module.initialize();
465
+ }
466
+ module.invoke(query);
467
+ }
468
+ else {
469
+ if(instance !== undefined) {
470
+ module.destroy();
471
+ }
472
+ module.initialize();
473
+ }
474
+
475
+ })
476
+ ;
477
+ return (invokedResponse !== undefined)
478
+ ? invokedResponse
479
+ : this
480
+ ;
481
+ };
482
+
483
+ $.fn.nag.settings = {
484
+
485
+ name : 'Nag',
486
+
487
+ verbose : true,
488
+ debug : true,
489
+ performance : true,
490
+
491
+ namespace : 'Nag',
492
+
493
+ // allows cookie to be overriden
494
+ persist : false,
495
+
496
+ // set to zero to manually dismiss, otherwise hides on its own
497
+ displayTime : 0,
498
+
499
+ animation : {
500
+ show: 'slide',
501
+ hide: 'slide'
502
+ },
503
+
504
+ // method of stickyness
505
+ position : 'fixed',
506
+ scrollBarWidth : 18,
507
+
508
+ // type of storage to use
509
+ storageMethod : 'cookie',
510
+
511
+ // value to store in dismissed localstorage/cookie
512
+ storedKey : 'nag',
513
+ storedValue : 'dismiss',
514
+
515
+ // need to calculate stickyness on scroll
516
+ sticky : false,
517
+
518
+ // how often to check scroll event
519
+ lag : 0,
520
+
521
+ // context for scroll event
522
+ context : window,
523
+
524
+ error: {
525
+ noStorage : 'Neither $.cookie or store is defined. A storage solution is required for storing state',
526
+ method : 'The method you called is not defined.'
527
+ },
528
+
529
+ className : {
530
+ bottom : 'bottom',
531
+ fixed : 'fixed'
532
+ },
533
+
534
+ selector : {
535
+ close: '.icon.close'
536
+ },
537
+
538
+ speed : 500,
539
+ easing : 'easeOutQuad',
540
+
541
+ onHide: function() {}
542
+
543
+ };
544
+
545
+ })( jQuery, window , document );