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,490 @@
1
+ /*
2
+ * # Semantic - Dropdown
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.sidebar = function(parameters) {
15
+ var
16
+ $allModules = $(this),
17
+
18
+ settings = ( $.isPlainObject(parameters) )
19
+ ? $.extend(true, {}, $.fn.sidebar.settings, parameters)
20
+ : $.fn.sidebar.settings,
21
+
22
+ selector = settings.selector,
23
+ className = settings.className,
24
+ namespace = settings.namespace,
25
+ error = settings.error,
26
+
27
+ eventNamespace = '.' + namespace,
28
+ moduleNamespace = 'module-' + namespace,
29
+ moduleSelector = $allModules.selector || '',
30
+
31
+ time = new Date().getTime(),
32
+ performance = [],
33
+
34
+ query = arguments[0],
35
+ methodInvoked = (typeof query == 'string'),
36
+ queryArguments = [].slice.call(arguments, 1),
37
+ invokedResponse
38
+ ;
39
+
40
+ $allModules
41
+ .each(function() {
42
+ var
43
+ $module = $(this),
44
+
45
+ $body = $('body'),
46
+ $head = $('head'),
47
+ $style = $('style[title=' + namespace + ']'),
48
+
49
+ element = this,
50
+ instance = $module.data(moduleNamespace),
51
+ module
52
+ ;
53
+
54
+ module = {
55
+
56
+ initialize: function() {
57
+ module.debug('Initializing sidebar', $module);
58
+ module.instantiate();
59
+ },
60
+
61
+ instantiate: function() {
62
+ module.verbose('Storing instance of module', module);
63
+ instance = module;
64
+ $module
65
+ .data(moduleNamespace, module)
66
+ ;
67
+ },
68
+
69
+ destroy: function() {
70
+ module.verbose('Destroying previous module for', $module);
71
+ $module
72
+ .off(eventNamespace)
73
+ .removeData(moduleNamespace)
74
+ ;
75
+ },
76
+
77
+ refresh: function() {
78
+ module.verbose('Refreshing selector cache');
79
+ $style = $('style[title=' + namespace + ']');
80
+ },
81
+
82
+ attachEvents: function(selector, event) {
83
+ var
84
+ $toggle = $(selector)
85
+ ;
86
+ event = $.isFunction(module[event])
87
+ ? module[event]
88
+ : module.toggle
89
+ ;
90
+ if($toggle.size() > 0) {
91
+ module.debug('Attaching sidebar events to element', selector, event);
92
+ $toggle
93
+ .off(eventNamespace)
94
+ .on('click' + eventNamespace, event)
95
+ ;
96
+ }
97
+ else {
98
+ module.error(error.notFound);
99
+ }
100
+ },
101
+
102
+
103
+ show: function() {
104
+ module.debug('Showing sidebar');
105
+ if(module.is.closed()) {
106
+ if(!settings.overlay) {
107
+ module.pushPage();
108
+ }
109
+ module.set.active();
110
+ }
111
+ else {
112
+ module.debug('Sidebar is already visible');
113
+ }
114
+ },
115
+
116
+ hide: function() {
117
+ if(module.is.open()) {
118
+ if(!settings.overlay) {
119
+ module.pullPage();
120
+ module.remove.pushed();
121
+ }
122
+ module.remove.active();
123
+ }
124
+ },
125
+
126
+ toggle: function() {
127
+ if(module.is.closed()) {
128
+ module.show();
129
+ }
130
+ else {
131
+ module.hide();
132
+ }
133
+ },
134
+
135
+ pushPage: function() {
136
+ var
137
+ direction = module.get.direction(),
138
+ distance = (module.is.vertical())
139
+ ? $module.outerHeight()
140
+ : $module.outerWidth()
141
+ ;
142
+ if(settings.useCSS) {
143
+ module.debug('Using CSS to animate body');
144
+ module.add.bodyCSS(direction, distance);
145
+ module.set.pushed();
146
+ }
147
+ else {
148
+ module.animatePage(direction, distance, module.set.pushed);
149
+ }
150
+ },
151
+
152
+ pullPage: function() {
153
+ var
154
+ direction = module.get.direction()
155
+ ;
156
+ if(settings.useCSS) {
157
+ module.debug('Resetting body position css');
158
+ module.remove.bodyCSS();
159
+ }
160
+ else {
161
+ module.debug('Resetting body position using javascript');
162
+ module.animatePage(direction, 0);
163
+ }
164
+ module.remove.pushed();
165
+ },
166
+
167
+ animatePage: function(direction, distance) {
168
+ var
169
+ animateSettings = {}
170
+ ;
171
+ animateSettings['padding-' + direction] = distance;
172
+ module.debug('Using javascript to animate body', animateSettings);
173
+ $body
174
+ .animate(animateSettings, settings.duration, module.set.pushed)
175
+ ;
176
+ },
177
+
178
+ add: {
179
+ bodyCSS: function(direction, distance) {
180
+ var
181
+ style
182
+ ;
183
+ if(direction !== className.bottom) {
184
+ style = ''
185
+ + '<style title="' + namespace + '">'
186
+ + 'body.pushed {'
187
+ + ' margin-' + direction + ': ' + distance + 'px !important;'
188
+ + '}'
189
+ + '</style>'
190
+ ;
191
+ }
192
+ $head.append(style);
193
+ module.debug('Adding body css to head', $style);
194
+ }
195
+ },
196
+
197
+ remove: {
198
+ bodyCSS: function() {
199
+ module.debug('Removing body css styles', $style);
200
+ module.refresh();
201
+ $style.remove();
202
+ },
203
+ active: function() {
204
+ $module.removeClass(className.active);
205
+ },
206
+ pushed: function() {
207
+ module.verbose('Removing body push state', module.get.direction());
208
+ $body
209
+ .removeClass(className[ module.get.direction() ])
210
+ .removeClass(className.pushed)
211
+ ;
212
+ }
213
+ },
214
+
215
+ set: {
216
+ active: function() {
217
+ $module.addClass(className.active);
218
+ },
219
+ pushed: function() {
220
+ module.verbose('Adding body push state', module.get.direction());
221
+ $body
222
+ .addClass(className[ module.get.direction() ])
223
+ .addClass(className.pushed)
224
+ ;
225
+ }
226
+ },
227
+
228
+ get: {
229
+ direction: function() {
230
+ if($module.hasClass(className.top)) {
231
+ return className.top;
232
+ }
233
+ else if($module.hasClass(className.right)) {
234
+ return className.right;
235
+ }
236
+ else if($module.hasClass(className.bottom)) {
237
+ return className.bottom;
238
+ }
239
+ else {
240
+ return className.left;
241
+ }
242
+ },
243
+ transitionEvent: function() {
244
+ var
245
+ element = document.createElement('element'),
246
+ transitions = {
247
+ 'transition' :'transitionend',
248
+ 'OTransition' :'oTransitionEnd',
249
+ 'MozTransition' :'transitionend',
250
+ 'WebkitTransition' :'webkitTransitionEnd'
251
+ },
252
+ transition
253
+ ;
254
+ for(transition in transitions){
255
+ if( element.style[transition] !== undefined ){
256
+ return transitions[transition];
257
+ }
258
+ }
259
+ }
260
+ },
261
+
262
+ is: {
263
+ open: function() {
264
+ return $module.is(':animated') || $module.hasClass(className.active);
265
+ },
266
+ closed: function() {
267
+ return !module.is.open();
268
+ },
269
+ vertical: function() {
270
+ return $module.hasClass(className.top);
271
+ }
272
+ },
273
+
274
+ setting: function(name, value) {
275
+ if(value !== undefined) {
276
+ if( $.isPlainObject(name) ) {
277
+ $.extend(true, settings, name);
278
+ }
279
+ else {
280
+ settings[name] = value;
281
+ }
282
+ }
283
+ else {
284
+ return settings[name];
285
+ }
286
+ },
287
+ internal: function(name, value) {
288
+ if(value !== undefined) {
289
+ if( $.isPlainObject(name) ) {
290
+ $.extend(true, module, name);
291
+ }
292
+ else {
293
+ module[name] = value;
294
+ }
295
+ }
296
+ else {
297
+ return module[name];
298
+ }
299
+ },
300
+ debug: function() {
301
+ if(settings.debug) {
302
+ if(settings.performance) {
303
+ module.performance.log(arguments);
304
+ }
305
+ else {
306
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
307
+ module.debug.apply(console, arguments);
308
+ }
309
+ }
310
+ },
311
+ verbose: function() {
312
+ if(settings.verbose && settings.debug) {
313
+ if(settings.performance) {
314
+ module.performance.log(arguments);
315
+ }
316
+ else {
317
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
318
+ module.verbose.apply(console, arguments);
319
+ }
320
+ }
321
+ },
322
+ error: function() {
323
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
324
+ module.error.apply(console, arguments);
325
+ },
326
+ performance: {
327
+ log: function(message) {
328
+ var
329
+ currentTime,
330
+ executionTime,
331
+ previousTime
332
+ ;
333
+ if(settings.performance) {
334
+ currentTime = new Date().getTime();
335
+ previousTime = time || currentTime;
336
+ executionTime = currentTime - previousTime;
337
+ time = currentTime;
338
+ performance.push({
339
+ 'Element' : element,
340
+ 'Name' : message[0],
341
+ 'Arguments' : [].slice.call(message, 1) || '',
342
+ 'Execution Time' : executionTime
343
+ });
344
+ }
345
+ clearTimeout(module.performance.timer);
346
+ module.performance.timer = setTimeout(module.performance.display, 100);
347
+ },
348
+ display: function() {
349
+ var
350
+ title = settings.name + ':',
351
+ totalTime = 0
352
+ ;
353
+ time = false;
354
+ clearTimeout(module.performance.timer);
355
+ $.each(performance, function(index, data) {
356
+ totalTime += data['Execution Time'];
357
+ });
358
+ title += ' ' + totalTime + 'ms';
359
+ if(moduleSelector) {
360
+ title += ' \'' + moduleSelector + '\'';
361
+ }
362
+ if($allModules.size() > 1) {
363
+ title += ' ' + '(' + $allModules.size() + ')';
364
+ }
365
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
366
+ console.groupCollapsed(title);
367
+ if(console.table) {
368
+ console.table(performance);
369
+ }
370
+ else {
371
+ $.each(performance, function(index, data) {
372
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
373
+ });
374
+ }
375
+ console.groupEnd();
376
+ }
377
+ performance = [];
378
+ }
379
+ },
380
+ invoke: function(query, passedArguments, context) {
381
+ var
382
+ maxDepth,
383
+ found,
384
+ response
385
+ ;
386
+ passedArguments = passedArguments || queryArguments;
387
+ context = element || context;
388
+ if(typeof query == 'string' && instance !== undefined) {
389
+ query = query.split(/[\. ]/);
390
+ maxDepth = query.length - 1;
391
+ $.each(query, function(depth, value) {
392
+ var camelCaseValue = (depth != maxDepth)
393
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
394
+ : query
395
+ ;
396
+ if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
397
+ instance = instance[value];
398
+ }
399
+ else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
400
+ instance = instance[camelCaseValue];
401
+ }
402
+ else if( instance[value] !== undefined ) {
403
+ found = instance[value];
404
+ return false;
405
+ }
406
+ else if( instance[camelCaseValue] !== undefined ) {
407
+ found = instance[camelCaseValue];
408
+ return false;
409
+ }
410
+ else {
411
+ module.error(error.method);
412
+ return false;
413
+ }
414
+ });
415
+ }
416
+ if ( $.isFunction( found ) ) {
417
+ response = found.apply(context, passedArguments);
418
+ }
419
+ else if(found !== undefined) {
420
+ response = found;
421
+ }
422
+ if($.isArray(invokedResponse)) {
423
+ invokedResponse.push(response);
424
+ }
425
+ else if(typeof invokedResponse == 'string') {
426
+ invokedResponse = [invokedResponse, response];
427
+ }
428
+ else if(response !== undefined) {
429
+ invokedResponse = response;
430
+ }
431
+ return found;
432
+ }
433
+ };
434
+ if(methodInvoked) {
435
+ if(instance === undefined) {
436
+ module.initialize();
437
+ }
438
+ module.invoke(query);
439
+ }
440
+ else {
441
+ if(instance !== undefined) {
442
+ module.destroy();
443
+ }
444
+ module.initialize();
445
+ }
446
+ })
447
+ ;
448
+
449
+ return (invokedResponse !== undefined)
450
+ ? invokedResponse
451
+ : this
452
+ ;
453
+ };
454
+
455
+ $.fn.sidebar.settings = {
456
+
457
+ name : 'Sidebar',
458
+ namespace : 'sidebar',
459
+
460
+ verbose : true,
461
+ debug : true,
462
+ performance : true,
463
+
464
+ useCSS : true,
465
+ overlay : false,
466
+ duration : 300,
467
+
468
+ side : 'left',
469
+
470
+ onChange : function(){},
471
+ onShow : function(){},
472
+ onHide : function(){},
473
+
474
+ className: {
475
+ active : 'active',
476
+ pushed : 'pushed',
477
+ top : 'top',
478
+ left : 'left',
479
+ right : 'right',
480
+ bottom : 'bottom'
481
+ },
482
+
483
+ error : {
484
+ method : 'The method you called is not defined.',
485
+ notFound : 'There were no elements that matched the specified selector'
486
+ }
487
+
488
+ };
489
+
490
+ })( jQuery, window , document );