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,727 @@
1
+ /*
2
+ * # Semantic - Popup
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.popup = function(parameters) {
15
+ var
16
+ $allModules = $(this),
17
+ $document = $(document),
18
+
19
+ settings = ( $.isPlainObject(parameters) )
20
+ ? $.extend(true, {}, $.fn.popup.settings, parameters)
21
+ : $.fn.popup.settings,
22
+
23
+ moduleSelector = $allModules.selector || '',
24
+
25
+ time = new Date().getTime(),
26
+ performance = [],
27
+
28
+ query = arguments[0],
29
+ methodInvoked = (typeof query == 'string'),
30
+ queryArguments = [].slice.call(arguments, 1),
31
+
32
+ invokedResponse
33
+ ;
34
+ $allModules
35
+ .each(function() {
36
+ var
37
+ $module = $(this),
38
+
39
+ $window = $(window),
40
+ $offsetParent = $module.offsetParent(),
41
+ $popup = (settings.inline)
42
+ ? $module.next(settings.selector.popup)
43
+ : $window.children(settings.selector.popup).last(),
44
+
45
+ searchDepth = 0,
46
+
47
+ eventNamespace = '.' + settings.namespace,
48
+ moduleNamespace = settings.namespace + '-module',
49
+
50
+ selector = settings.selector,
51
+ className = settings.className,
52
+ error = settings.error,
53
+ metadata = settings.metadata,
54
+ namespace = settings.namespace,
55
+
56
+ element = this,
57
+ instance = $module.data(moduleNamespace),
58
+ module
59
+ ;
60
+
61
+ module = {
62
+
63
+ // binds events
64
+ initialize: function() {
65
+ module.debug('Initializing module', $module);
66
+ if(settings.on == 'hover') {
67
+ $module
68
+ .on('mouseenter' + eventNamespace, module.event.mouseenter)
69
+ .on('mouseleave' + eventNamespace, module.event.mouseleave)
70
+ ;
71
+ }
72
+ else {
73
+ $module
74
+ .on(settings.on + '' + eventNamespace, module.event[settings.on])
75
+ ;
76
+ }
77
+ $window
78
+ .on('resize' + eventNamespace, module.event.resize)
79
+ ;
80
+ module.instantiate();
81
+ },
82
+
83
+ instantiate: function() {
84
+ module.verbose('Storing instance of module', module);
85
+ instance = module;
86
+ $module
87
+ .data(moduleNamespace, instance)
88
+ ;
89
+ },
90
+
91
+ refresh: function() {
92
+ $popup = (settings.inline)
93
+ ? $module.next(selector.popup)
94
+ : $window.children(selector.popup).last()
95
+ ;
96
+ $offsetParent = $module.offsetParent();
97
+ },
98
+
99
+ destroy: function() {
100
+ module.debug('Destroying previous module');
101
+ $module
102
+ .off(eventNamespace)
103
+ .removeData(moduleNamespace)
104
+ ;
105
+ },
106
+
107
+ event: {
108
+ mouseenter: function(event) {
109
+ var element = this;
110
+ module.timer = setTimeout(function() {
111
+ $.proxy(module.toggle, element)();
112
+ if( $(element).hasClass(className.visible) ) {
113
+ event.stopPropagation();
114
+ }
115
+ }, settings.delay);
116
+ },
117
+ mouseleave: function() {
118
+ clearTimeout(module.timer);
119
+ if( $module.is(':visible') ) {
120
+ module.hide();
121
+ }
122
+ },
123
+ click: function(event) {
124
+ $.proxy(module.toggle, this)();
125
+ if( $(this).hasClass(className.visible) ) {
126
+ event.stopPropagation();
127
+ }
128
+ },
129
+ resize: function() {
130
+ if( $popup.is(':visible') ) {
131
+ module.position();
132
+ }
133
+ }
134
+ },
135
+
136
+ // generates popup html from metadata
137
+ create: function() {
138
+ module.debug('Creating pop-up html');
139
+ var
140
+ html = $module.data(metadata.html) || settings.html,
141
+ variation = $module.data(metadata.variation) || settings.variation,
142
+ title = $module.data(metadata.title) || settings.title,
143
+ content = $module.data(metadata.content) || $module.attr('title') || settings.content
144
+ ;
145
+ if(html || content || title) {
146
+ if(!html) {
147
+ html = settings.template({
148
+ title : title,
149
+ content : content
150
+ });
151
+ }
152
+ $popup = $('<div/>')
153
+ .addClass(className.popup)
154
+ .addClass(variation)
155
+ .html(html)
156
+ ;
157
+ if(settings.inline) {
158
+ module.verbose('Inserting popup element inline');
159
+ $popup
160
+ .insertAfter($module)
161
+ ;
162
+ }
163
+ else {
164
+ module.verbose('Appending popup element to body');
165
+ $popup
166
+ .appendTo( $('body') )
167
+ ;
168
+ }
169
+ $.proxy(settings.onInit, $popup)();
170
+ }
171
+ else {
172
+ module.error(error.content);
173
+ }
174
+ },
175
+
176
+ remove: function() {
177
+ module.debug('Removing popup');
178
+ $popup
179
+ .remove()
180
+ ;
181
+ },
182
+
183
+ get: {
184
+ offstagePosition: function() {
185
+ var
186
+ boundary = {
187
+ top : $(window).scrollTop(),
188
+ bottom : $(window).scrollTop() + $(window).height(),
189
+ left : 0,
190
+ right : $(window).width()
191
+ },
192
+ popup = {
193
+ width : $popup.width(),
194
+ height : $popup.outerHeight(),
195
+ position : $popup.offset()
196
+ },
197
+ offstage = {},
198
+ offstagePositions = []
199
+ ;
200
+ if(popup.position) {
201
+ offstage = {
202
+ top : (popup.position.top < boundary.top),
203
+ bottom : (popup.position.top + popup.height > boundary.bottom),
204
+ right : (popup.position.left + popup.width > boundary.right),
205
+ left : (popup.position.left < boundary.left)
206
+ };
207
+ }
208
+ module.verbose('Checking if outside viewable area', popup.position);
209
+ // return only boundaries that have been surpassed
210
+ $.each(offstage, function(direction, isOffstage) {
211
+ if(isOffstage) {
212
+ offstagePositions.push(direction);
213
+ }
214
+ });
215
+ return (offstagePositions.length > 0)
216
+ ? offstagePositions.join(' ')
217
+ : false
218
+ ;
219
+ },
220
+ nextPosition: function(position) {
221
+ switch(position) {
222
+ case 'top left':
223
+ position = 'bottom left';
224
+ break;
225
+ case 'bottom left':
226
+ position = 'top right';
227
+ break;
228
+ case 'top right':
229
+ position = 'bottom right';
230
+ break;
231
+ case 'bottom right':
232
+ position = 'top center';
233
+ break;
234
+ case 'top center':
235
+ position = 'bottom center';
236
+ break;
237
+ case 'bottom center':
238
+ position = 'right center';
239
+ break;
240
+ case 'right center':
241
+ position = 'left center';
242
+ break;
243
+ case 'left center':
244
+ position = 'top center';
245
+ break;
246
+ }
247
+ return position;
248
+ }
249
+ },
250
+
251
+ // determines popup state
252
+ toggle: function() {
253
+ $module = $(this);
254
+ module.debug('Toggling pop-up');
255
+ // refresh state of module
256
+ module.refresh();
257
+ if( !$module.hasClass(className.visible) ) {
258
+ if(settings.on == 'click') {
259
+ module.hideAll();
260
+ }
261
+ module.show();
262
+ }
263
+ else {
264
+ // module.hide();
265
+ }
266
+ },
267
+
268
+ position: function(position, arrowOffset) {
269
+ var
270
+ windowWidth = $(window).width(),
271
+ windowHeight = $(window).height(),
272
+ width = $module.outerWidth(),
273
+ height = $module.outerHeight(),
274
+ popupWidth = $popup.width(),
275
+ popupHeight = $popup.outerHeight(),
276
+
277
+ offset = (settings.inline)
278
+ ? $module.position()
279
+ : $module.offset(),
280
+ parentWidth = (settings.inline)
281
+ ? $offsetParent.outerWidth()
282
+ : $window.outerWidth(),
283
+ parentHeight = (settings.inline)
284
+ ? $offsetParent.outerHeight()
285
+ : $window.outerHeight(),
286
+
287
+ positioning,
288
+ offstagePosition
289
+ ;
290
+ position = position || $module.data(metadata.position) || settings.position;
291
+ arrowOffset = arrowOffset || $module.data(metadata.arrowOffset) || settings.arrowOffset;
292
+ module.debug('Calculating offset for position', position);
293
+ switch(position) {
294
+ case 'top left':
295
+ positioning = {
296
+ bottom : parentHeight - offset.top + settings.distanceAway,
297
+ right : parentWidth - offset.left - width - arrowOffset,
298
+ top : 'auto',
299
+ left : 'auto'
300
+ };
301
+ break;
302
+ case 'top center':
303
+ positioning = {
304
+ bottom : parentHeight - offset.top + settings.distanceAway,
305
+ left : offset.left + (width / 2) - (popupWidth / 2) + arrowOffset,
306
+ top : 'auto',
307
+ right : 'auto'
308
+ };
309
+ break;
310
+ case 'top right':
311
+ positioning = {
312
+ top : 'auto',
313
+ bottom : parentHeight - offset.top + settings.distanceAway,
314
+ left : offset.left + arrowOffset
315
+ };
316
+ break;
317
+ case 'left center':
318
+ positioning = {
319
+ top : offset.top + (height / 2) - (popupHeight / 2),
320
+ right : parentWidth - offset.left + settings.distanceAway - arrowOffset,
321
+ left : 'auto',
322
+ bottom : 'auto'
323
+ };
324
+ break;
325
+ case 'right center':
326
+ positioning = {
327
+ top : offset.top + (height / 2) - (popupHeight / 2),
328
+ left : offset.left + width + settings.distanceAway + arrowOffset,
329
+ bottom : 'auto',
330
+ right : 'auto'
331
+ };
332
+ break;
333
+ case 'bottom left':
334
+ positioning = {
335
+ top : offset.top + height + settings.distanceAway,
336
+ right : parentWidth - offset.left - width - arrowOffset,
337
+ left : 'auto',
338
+ bottom : 'auto'
339
+ };
340
+ break;
341
+ case 'bottom center':
342
+ positioning = {
343
+ top : offset.top + height + settings.distanceAway,
344
+ left : offset.left + (width / 2) - (popupWidth / 2) + arrowOffset,
345
+ bottom : 'auto',
346
+ right : 'auto'
347
+ };
348
+ break;
349
+ case 'bottom right':
350
+ positioning = {
351
+ top : offset.top + height + settings.distanceAway,
352
+ left : offset.left + arrowOffset,
353
+ bottom : 'auto',
354
+ right : 'auto'
355
+ };
356
+ break;
357
+ }
358
+ // true width on popup, avoid rounding error
359
+ $.extend(positioning, {
360
+ width: $popup.width() + 1
361
+ });
362
+ // tentatively place on stage
363
+ $popup
364
+ .attr('class', position + ' ' + className.popup + ' ' + className.loading)
365
+ .css(positioning)
366
+ ;
367
+ // check if is offstage
368
+ offstagePosition = module.get.offstagePosition();
369
+ // recursively find new positioning
370
+ if(offstagePosition) {
371
+ module.debug('Element is outside boundaries ', offstagePosition);
372
+ if(searchDepth < settings.maxSearchDepth) {
373
+ position = module.get.nextPosition(position);
374
+ searchDepth++;
375
+ module.debug('Trying new position: ', position);
376
+ return module.position(position);
377
+ }
378
+ else {
379
+ module.error(error.recursion);
380
+ searchDepth = 0;
381
+ return false;
382
+ }
383
+ }
384
+ else {
385
+ module.debug('Position is on stage', position);
386
+ searchDepth = 0;
387
+ return true;
388
+ }
389
+ },
390
+
391
+ show: function() {
392
+ module.debug('Showing pop-up', settings.transition);
393
+ if($popup.size() === 0) {
394
+ module.create();
395
+ }
396
+ module.position();
397
+ $module
398
+ .addClass(className.visible)
399
+ ;
400
+ $popup
401
+ .removeClass(className.loading)
402
+ ;
403
+ if(settings.transition && $.fn.transition !== undefined) {
404
+ $popup
405
+ .transition(settings.transition + ' in', settings.duration)
406
+ ;
407
+ }
408
+ else {
409
+ $popup
410
+ .stop()
411
+ .fadeIn(settings.duration, settings.easing)
412
+ ;
413
+ }
414
+ if(settings.on == 'click' && settings.clicktoClose) {
415
+ module.debug('Binding popup close event');
416
+ $document
417
+ .on('click.' + namespace, module.gracefully.hide)
418
+ ;
419
+ }
420
+ $.proxy(settings.onShow, $popup)();
421
+ },
422
+
423
+ hideAll: function() {
424
+ $(selector.popup)
425
+ .filter(':visible')
426
+ .popup('hide')
427
+ ;
428
+ },
429
+
430
+ hide: function() {
431
+ $module
432
+ .removeClass(className.visible)
433
+ ;
434
+ if($popup.is(':visible') ) {
435
+ module.debug('Hiding pop-up');
436
+ if(settings.transition && $.fn.transition !== undefined) {
437
+ $popup
438
+ .transition(settings.transition + ' out', settings.duration, module.reset)
439
+ ;
440
+ }
441
+ else {
442
+ $popup
443
+ .stop()
444
+ .fadeOut(settings.duration, settings.easing, module.reset)
445
+ ;
446
+ }
447
+ }
448
+ if(settings.on == 'click' && settings.clicktoClose) {
449
+ $document
450
+ .off('click.' + namespace)
451
+ ;
452
+ }
453
+ $.proxy(settings.onHide, $popup)();
454
+ if(!settings.inline) {
455
+ module.remove();
456
+ }
457
+ },
458
+
459
+ reset: function() {
460
+ module.verbose('Resetting inline styles');
461
+ $popup
462
+ .attr('style', '')
463
+ .removeAttr('style')
464
+ ;
465
+ },
466
+
467
+ gracefully: {
468
+ hide: function(event) {
469
+ // don't close on clicks inside popup
470
+ if( $(event.target).closest(selector.popup).size() === 0) {
471
+ module.hide();
472
+ }
473
+ }
474
+ },
475
+
476
+ setting: function(name, value) {
477
+ if(value !== undefined) {
478
+ if( $.isPlainObject(name) ) {
479
+ $.extend(true, settings, name);
480
+ }
481
+ else {
482
+ settings[name] = value;
483
+ }
484
+ }
485
+ else {
486
+ return settings[name];
487
+ }
488
+ },
489
+ internal: function(name, value) {
490
+ if(value !== undefined) {
491
+ if( $.isPlainObject(name) ) {
492
+ $.extend(true, module, name);
493
+ }
494
+ else {
495
+ module[name] = value;
496
+ }
497
+ }
498
+ else {
499
+ return module[name];
500
+ }
501
+ },
502
+ debug: function() {
503
+ if(settings.debug) {
504
+ if(settings.performance) {
505
+ module.performance.log(arguments);
506
+ }
507
+ else {
508
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
509
+ module.debug.apply(console, arguments);
510
+ }
511
+ }
512
+ },
513
+ verbose: function() {
514
+ if(settings.verbose && settings.debug) {
515
+ if(settings.performance) {
516
+ module.performance.log(arguments);
517
+ }
518
+ else {
519
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
520
+ module.verbose.apply(console, arguments);
521
+ }
522
+ }
523
+ },
524
+ error: function() {
525
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
526
+ module.error.apply(console, arguments);
527
+ },
528
+ performance: {
529
+ log: function(message) {
530
+ var
531
+ currentTime,
532
+ executionTime,
533
+ previousTime
534
+ ;
535
+ if(settings.performance) {
536
+ currentTime = new Date().getTime();
537
+ previousTime = time || currentTime;
538
+ executionTime = currentTime - previousTime;
539
+ time = currentTime;
540
+ performance.push({
541
+ 'Element' : element,
542
+ 'Name' : message[0],
543
+ 'Arguments' : [].slice.call(message, 1) || '',
544
+ 'Execution Time' : executionTime
545
+ });
546
+ }
547
+ clearTimeout(module.performance.timer);
548
+ module.performance.timer = setTimeout(module.performance.display, 100);
549
+ },
550
+ display: function() {
551
+ var
552
+ title = settings.name + ':',
553
+ totalTime = 0
554
+ ;
555
+ time = false;
556
+ clearTimeout(module.performance.timer);
557
+ $.each(performance, function(index, data) {
558
+ totalTime += data['Execution Time'];
559
+ });
560
+ title += ' ' + totalTime + 'ms';
561
+ if(moduleSelector) {
562
+ title += ' \'' + moduleSelector + '\'';
563
+ }
564
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
565
+ console.groupCollapsed(title);
566
+ if(console.table) {
567
+ console.table(performance);
568
+ }
569
+ else {
570
+ $.each(performance, function(index, data) {
571
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
572
+ });
573
+ }
574
+ console.groupEnd();
575
+ }
576
+ performance = [];
577
+ }
578
+ },
579
+ invoke: function(query, passedArguments, context) {
580
+ var
581
+ maxDepth,
582
+ found,
583
+ response
584
+ ;
585
+ passedArguments = passedArguments || queryArguments;
586
+ context = element || context;
587
+ if(typeof query == 'string' && instance !== undefined) {
588
+ query = query.split(/[\. ]/);
589
+ maxDepth = query.length - 1;
590
+ $.each(query, function(depth, value) {
591
+ var camelCaseValue = (depth != maxDepth)
592
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
593
+ : query
594
+ ;
595
+ if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
596
+ instance = instance[value];
597
+ }
598
+ else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
599
+ instance = instance[camelCaseValue];
600
+ }
601
+ else if( instance[value] !== undefined ) {
602
+ found = instance[value];
603
+ return false;
604
+ }
605
+ else if( instance[camelCaseValue] !== undefined ) {
606
+ found = instance[camelCaseValue];
607
+ return false;
608
+ }
609
+ else {
610
+ module.error(error.method);
611
+ return false;
612
+ }
613
+ });
614
+ }
615
+ if ( $.isFunction( found ) ) {
616
+ response = found.apply(context, passedArguments);
617
+ }
618
+ else if(found !== undefined) {
619
+ response = found;
620
+ }
621
+ if($.isArray(invokedResponse)) {
622
+ invokedResponse.push(response);
623
+ }
624
+ else if(typeof invokedResponse == 'string') {
625
+ invokedResponse = [invokedResponse, response];
626
+ }
627
+ else if(response !== undefined) {
628
+ invokedResponse = response;
629
+ }
630
+ return found;
631
+ }
632
+ };
633
+
634
+ if(methodInvoked) {
635
+ if(instance === undefined) {
636
+ module.initialize();
637
+ }
638
+ module.invoke(query);
639
+ }
640
+ else {
641
+ if(instance !== undefined) {
642
+ module.destroy();
643
+ }
644
+ module.initialize();
645
+ }
646
+ })
647
+ ;
648
+
649
+ return (invokedResponse !== undefined)
650
+ ? invokedResponse
651
+ : this
652
+ ;
653
+ };
654
+
655
+ $.fn.popup.settings = {
656
+
657
+ name : 'Popup',
658
+ debug : true,
659
+ verbose : true,
660
+ performance : true,
661
+ namespace : 'popup',
662
+
663
+ onInit : function(){},
664
+ onShow : function(){},
665
+ onHide : function(){},
666
+
667
+ variation : '',
668
+ content : false,
669
+ html : false,
670
+ title : false,
671
+
672
+ on : 'hover',
673
+ clicktoClose : true,
674
+
675
+ position : 'top center',
676
+ delay : 150,
677
+ inline : true,
678
+
679
+ duration : 150,
680
+ easing : 'easeOutQuint',
681
+ transition : 'scale',
682
+
683
+ distanceAway : 0,
684
+ arrowOffset : 0,
685
+ maxSearchDepth : 10,
686
+
687
+ error: {
688
+ content : 'Your popup has no content specified',
689
+ method : 'The method you called is not defined.',
690
+ recursion : 'Popup attempted to reposition element to fit, but could not find an adequate position.'
691
+ },
692
+
693
+ metadata: {
694
+ arrowOffset : 'arrowOffset',
695
+ content : 'content',
696
+ html : 'html',
697
+ position : 'position',
698
+ title : 'title',
699
+ variation : 'variation'
700
+ },
701
+
702
+ className : {
703
+ popup : 'ui popup',
704
+ visible : 'visible',
705
+ loading : 'loading'
706
+ },
707
+
708
+ selector : {
709
+ popup : '.ui.popup'
710
+ },
711
+
712
+ template: function(text) {
713
+ var html = '';
714
+ if(typeof text !== undefined) {
715
+ if(typeof text.title !== undefined && text.title) {
716
+ html += '<div class="header">' + text.title + '</div class="header">';
717
+ }
718
+ if(typeof text.content !== undefined && text.content) {
719
+ html += '<div class="content">' + text.content + '</div>';
720
+ }
721
+ }
722
+ return html;
723
+ }
724
+
725
+ };
726
+
727
+ })( jQuery, window , document );