groundworkcss-rails 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/lib/groundworkcss/rails/version.rb +1 -1
  2. data/lib/groundworkcss/rails/version.rb~ +1 -1
  3. data/vendor/assets/javascripts/groundwork-hook.js +1 -1
  4. data/vendor/assets/javascripts/groundworkcss/groundwork.all.js +654 -0
  5. data/vendor/assets/javascripts/groundworkcss/groundwork.js +1 -430
  6. data/vendor/assets/javascripts/groundworkcss/plugins/jquery.tooltip.js +1 -1
  7. data/vendor/assets/stylesheets/groundworkcss-scss/_classes.scss +72 -78
  8. data/vendor/assets/stylesheets/groundworkcss-scss/_helpers.scss +78 -0
  9. data/vendor/assets/stylesheets/groundworkcss-scss/_mixins.scss +40 -0
  10. data/vendor/assets/stylesheets/groundworkcss-scss/_reset.scss +2 -3
  11. data/vendor/assets/stylesheets/groundworkcss-scss/_responsive.scss +26 -9
  12. data/vendor/assets/stylesheets/groundworkcss-scss/_tabs.scss +1 -1
  13. data/vendor/assets/stylesheets/groundworkcss-scss/_typography.scss +6 -6
  14. data/vendor/assets/stylesheets/groundworkcss-scss/groundwork.scss +9 -4
  15. metadata +296 -319
  16. data/app/helpers/breadcrumbs_helper.rb~ +0 -5
  17. data/app/helpers/flash_block_helper.rb~ +0 -18
  18. data/app/helpers/flash_helper.rb~ +0 -21
  19. data/app/helpers/groundwork_flash_helper.rb~ +0 -21
  20. data/app/helpers/modal_helper.rb~ +0 -42
  21. data/app/helpers/social_glyph_helper.rb~ +0 -12
  22. data/lib/generators/groundworkcss/install/install_generator.rb~ +0 -44
  23. data/lib/generators/groundworkcss/install/templates/application.css.scss~ +0 -8
  24. data/lib/generators/groundworkcss/install/templates/application.css~ +0 -7
  25. data/lib/generators/groundworkcss/install/templates/application.js~ +0 -10
  26. data/lib/generators/groundworkcss/install/templates/groundwork-and-overrides.scss~ +0 -12
  27. data/lib/generators/groundworkcss/install/templates/groundwork-overrides.scss~ +0 -7
  28. data/lib/generators/groundworkcss/install/templates/groundwork.coffee~ +0 -0
  29. data/lib/generators/groundworkcss/install/templates/groundwork.js~ +0 -1
  30. data/lib/generators/groundworkcss/layout/layout_generator.rb~ +0 -21
  31. data/lib/generators/groundworkcss/layout/templates/_header.html.erb~ +0 -24
  32. data/lib/generators/groundworkcss/layout/templates/_sidebar.html.erb~ +0 -18
  33. data/lib/generators/groundworkcss/layout/templates/layout.html.erb~ +0 -44
  34. data/lib/groundworkcss/rails/bootstrap.rb~ +0 -2
  35. data/lib/groundworkcss/rails/engine.rb~ +0 -30
  36. data/lib/twitter-bootstrap-rails.rb~ +0 -10
  37. data/vendor/assets/javascripts/groundwork.js~ +0 -8
  38. data/vendor/assets/javascripts/groundworkcss/groundwork.js~ +0 -7
  39. data/vendor/assets/stylesheets/groundworkcss-scss/_font-awesome.scss~ +0 -534
  40. data/vendor/assets/stylesheets/groundworkcss-scss/_social-icons.scss~ +0 -92
@@ -1,5 +1,5 @@
1
1
  module Groundworkcss
2
2
  module Rails
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Groundworkcss
2
2
  module Rails
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  //= require_tree ./groundworkcss/libs
2
2
  //= require_tree ./groundworkcss/plugins
3
- //= require ./groundworkcss/groundwork.js
3
+ //= require ./groundworkcss/groundwork.all.js
@@ -0,0 +1,654 @@
1
+ // Generated by CoffeeScript 1.6.1
2
+
3
+ /*
4
+ *
5
+ * GroundworkCSS JS by Gary Hepting - https://github.com/groundworkcss/groundwork
6
+ *
7
+ * Open source under the BSD License.
8
+ *
9
+ * Copyright © 2013 Gary Hepting. All rights reserved.
10
+ *
11
+ */
12
+
13
+
14
+ (function() {
15
+ var limitPaginationItems;
16
+
17
+ $(document).ready(function() {
18
+ var delay;
19
+ delay = '';
20
+ $('nav > ul > li.menu').on({
21
+ mouseenter: function(e) {
22
+ if ($(window).width() > 768) {
23
+ clearTimeout(delay);
24
+ $('nav > ul > li').removeClass('on');
25
+ $('nav > ul > li > ul').hide();
26
+ return $(this).addClass('on');
27
+ }
28
+ },
29
+ mouseleave: function(e) {
30
+ if ($(window).width() > 768) {
31
+ return delay = setTimeout((function() {
32
+ $('nav > ul > li').removeClass('on');
33
+ return $('nav > ul > li > ul').hide();
34
+ }), 350);
35
+ }
36
+ },
37
+ click: function(e) {
38
+ var $this;
39
+ if ($(window).width() < 768) {
40
+ if ($(e.target).parent('li.menu').size() > 0) {
41
+ $this = $(this);
42
+ $(this).children('ul').slideToggle(300, function() {
43
+ return $this.toggleClass('on');
44
+ });
45
+ e.preventDefault();
46
+ return false;
47
+ }
48
+ }
49
+ },
50
+ tap: function(e) {
51
+ var $this;
52
+ if ($(e.target).parent('li.menu').size() > 0) {
53
+ $this = $(this);
54
+ $(this).children('ul').slideToggle(300, function() {
55
+ return $this.toggleClass('on');
56
+ });
57
+ e.preventDefault();
58
+ return false;
59
+ }
60
+ }
61
+ });
62
+ limitPaginationItems();
63
+ $('.pagination ul > li:not(.next, .prev) a').on('click', (function(e) {
64
+ $('.pagination ul > li:not(.next, .prev)').removeClass('active');
65
+ $(this).parent('li').addClass('active');
66
+ if ($(this).parent('li').hasClass('first')) {
67
+ $('.pagination ul > li.prev').addClass('disabled');
68
+ } else {
69
+ $('.pagination ul > li.prev').removeClass('disabled');
70
+ }
71
+ if ($(this).parent('li').hasClass('last')) {
72
+ $('.pagination ul > li.next').addClass('disabled');
73
+ } else {
74
+ $('.pagination ul > li.next').removeClass('disabled');
75
+ }
76
+ limitPaginationItems();
77
+ e.preventDefault();
78
+ return false;
79
+ }));
80
+ $('.pagination ul > li.prev:not(.disabled)').on('click', (function(e) {
81
+ var el;
82
+ $('.pagination ul > li.next').removeClass('disabled');
83
+ el = $('.pagination ul > li.active');
84
+ if (!el.hasClass('first')) {
85
+ el.removeClass('active');
86
+ el.prev().addClass('active');
87
+ limitPaginationItems();
88
+ }
89
+ if ($('.pagination ul > li.active').hasClass('first')) {
90
+ $(this).addClass('disabled');
91
+ }
92
+ e.preventDefault();
93
+ return false;
94
+ }));
95
+ $('.pagination ul > li.next:not(.disabled)').on('click', (function(e) {
96
+ var el;
97
+ $('.pagination ul > li.prev').removeClass('disabled');
98
+ el = $('.pagination ul > li.active');
99
+ if (!el.hasClass('last')) {
100
+ el.removeClass('active');
101
+ el.next().addClass('active');
102
+ limitPaginationItems();
103
+ }
104
+ if ($('.pagination ul > li.active').hasClass('last')) {
105
+ $(this).addClass('disabled');
106
+ }
107
+ e.preventDefault();
108
+ return false;
109
+ }));
110
+ $('.pagination ul > li.disabled a').on('click', (function(e) {
111
+ e.preventDefault();
112
+ return false;
113
+ }));
114
+ $('.error input, .error textarea, \
115
+ .invalid input, .invalid textarea, \
116
+ input.error, textarea.error, \
117
+ input.invalid, textarea.invalid').on({
118
+ click: function() {
119
+ $(this).focus();
120
+ return $(this).select();
121
+ }
122
+ });
123
+ $('span.select select').each(function() {
124
+ if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
125
+ return $(this).addClass('unselected');
126
+ } else {
127
+ return $(this).removeClass('unselected');
128
+ }
129
+ });
130
+ $('span.select select').on({
131
+ change: function() {
132
+ if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
133
+ return $(this).addClass('unselected');
134
+ } else {
135
+ return $(this).removeClass('unselected');
136
+ }
137
+ }
138
+ });
139
+ $('.tabs > ul > li > a').not('.disabled').on('click', function(e) {
140
+ var tabs;
141
+ tabs = $(this).parents('.tabs');
142
+ tabs.find('> ul li a').removeClass('active');
143
+ $(this).addClass('active');
144
+ tabs.children('div').removeClass('active');
145
+ tabs.children($(this).attr('href')).addClass('active');
146
+ e.preventDefault();
147
+ return false;
148
+ });
149
+ $('.responsive').not('table').each(function(index, object) {
150
+ var compression, max, min;
151
+ compression = 10;
152
+ min = 10;
153
+ max = 200;
154
+ compression = parseFloat($(this).attr('data-compression') || compression);
155
+ min = parseFloat($(this).attr('data-min') || min);
156
+ max = parseFloat($(this).attr('data-max') || max);
157
+ return $(object).responsiveText({
158
+ compressor: compression,
159
+ minSize: min,
160
+ maxSize: max
161
+ });
162
+ });
163
+ $('table.responsive').each(function(index, object) {
164
+ var compression, max, min, padding;
165
+ compression = 30;
166
+ min = 8;
167
+ max = 13;
168
+ padding = 0;
169
+ compression = parseFloat($(this).attr('data-compression') || compression);
170
+ min = parseFloat($(this).attr('data-min') || min);
171
+ max = parseFloat($(this).attr('data-max') || max);
172
+ padding = parseFloat($(this).attr('data-padding') || padding);
173
+ return $(object).responsiveTable({
174
+ compressor: compression,
175
+ minSize: min,
176
+ maxSize: max,
177
+ padding: padding
178
+ });
179
+ });
180
+ $('.tooltip[title]').tooltip();
181
+ return $('div.modal').modal();
182
+ });
183
+
184
+ $(window).load(function() {
185
+ return $('.slider').orbit();
186
+ });
187
+
188
+ $(window).resize(function() {
189
+ return limitPaginationItems();
190
+ });
191
+
192
+ limitPaginationItems = function() {
193
+ return $('.pagination ul').each(function() {
194
+ var pagination, visibleItemsWidth, visibleSpace, _results;
195
+ pagination = $(this);
196
+ visibleSpace = pagination.outerWidth() - pagination.children('li.prev').outerWidth() - pagination.children('li.next').outerWidth();
197
+ pagination.children('li').not('.prev, .next, .active').hide();
198
+ visibleItemsWidth = 0;
199
+ pagination.children('li:visible').each(function() {
200
+ return visibleItemsWidth += $(this).outerWidth();
201
+ });
202
+ _results = [];
203
+ while ((visibleItemsWidth + 29) < visibleSpace) {
204
+ pagination.children('li:visible').not('.next').last().next().show();
205
+ visibleItemsWidth = 0;
206
+ pagination.children('li:visible').each(function() {
207
+ return visibleItemsWidth += $(this).outerWidth();
208
+ });
209
+ if ((visibleItemsWidth + 29) <= visibleSpace) {
210
+ pagination.children('li:visible').not('.prev').first().prev().show();
211
+ visibleItemsWidth = 0;
212
+ pagination.children('li:visible').each(function() {
213
+ return visibleItemsWidth += $(this).outerWidth();
214
+ });
215
+ }
216
+ visibleItemsWidth = 0;
217
+ _results.push(pagination.children('li:visible').each(function() {
218
+ return visibleItemsWidth += $(this).outerWidth();
219
+ }));
220
+ }
221
+ return _results;
222
+ });
223
+ };
224
+
225
+ /* --------------------------------------------
226
+ Begin jquery.tooltip.coffee
227
+ --------------------------------------------
228
+ */
229
+
230
+
231
+ /*
232
+ *
233
+ * jQuery Tooltips by Gary Hepting - https://github.com/ghepting/jquery-tooltips
234
+ *
235
+ * Open source under the BSD License.
236
+ *
237
+ * Copyright © 2013 Gary Hepting. All rights reserved.
238
+ *
239
+ */
240
+
241
+
242
+ (function($) {
243
+ return $.fn.tooltip = function(options) {
244
+ var closetooltip, defaults, delayShow, getElementPosition, resettooltip, setPosition, showtooltip, tooltip, trigger;
245
+ defaults = {
246
+ topOffset: 0,
247
+ delay: 100,
248
+ speed: 100
249
+ };
250
+ options = $.extend(defaults, options);
251
+ tooltip = $('#tooltip');
252
+ delayShow = '';
253
+ trigger = '';
254
+ if ($('#tooltip').length !== 1) {
255
+ tooltip = $("<div id=\"tooltip\"></div>");
256
+ tooltip.appendTo("body").hide();
257
+ }
258
+ getElementPosition = function(el) {
259
+ var bottom, left, offset, right, top, win;
260
+ offset = el.offset();
261
+ win = $(window);
262
+ return {
263
+ top: top = offset.top - win.scrollTop(),
264
+ left: left = offset.left - win.scrollLeft(),
265
+ bottom: bottom = win.height() - top - el.outerHeight(),
266
+ right: right = win.width() - left - el.outerWidth()
267
+ };
268
+ };
269
+ setPosition = function(trigger) {
270
+ var attrs, coords, height, width;
271
+ coords = getElementPosition(trigger);
272
+ if (tooltip.outerWidth() > ($(window).width() - 20)) {
273
+ tooltip.css('width', $(window).width() - 20);
274
+ }
275
+ attrs = {};
276
+ tooltip.css('max-width', Math.min($(window).width() - parseInt($('body').css('padding-left')) - parseInt($('body').css('padding-right')), parseInt(tooltip.css('max-width'))));
277
+ width = tooltip.outerWidth();
278
+ height = tooltip.outerHeight();
279
+ if (coords.left <= coords.right) {
280
+ tooltip.addClass('left');
281
+ attrs.left = coords.left;
282
+ } else {
283
+ tooltip.addClass('right');
284
+ attrs.right = coords.right;
285
+ }
286
+ if ((coords.top - options.topOffset) > (height + 20)) {
287
+ tooltip.addClass('top');
288
+ attrs.top = (trigger.offset().top - height) - 20;
289
+ } else {
290
+ tooltip.addClass('bottom');
291
+ attrs.top = trigger.offset().top + trigger.outerHeight() - 4;
292
+ }
293
+ return tooltip.css(attrs);
294
+ };
295
+ resettooltip = function() {
296
+ return tooltip.text('').removeClass('left right top bottom').css({
297
+ left: 'auto',
298
+ right: 'auto',
299
+ top: 'auto',
300
+ bottom: 'auto',
301
+ width: 'auto',
302
+ 'padding-left': 'auto',
303
+ 'padding-right': 'auto'
304
+ });
305
+ };
306
+ closetooltip = function() {
307
+ tooltip.stop().hide();
308
+ resettooltip();
309
+ return $('[role=tooltip]').removeClass('on');
310
+ };
311
+ showtooltip = function(trigger) {
312
+ clearTimeout(delayShow);
313
+ return delayShow = setTimeout(function() {
314
+ tooltip.css({
315
+ "opacity": 0,
316
+ "display": "block"
317
+ }).text(trigger.attr('data-title'));
318
+ setPosition(trigger);
319
+ trigger.addClass('on');
320
+ console.log(tooltip.css('display'));
321
+ return tooltip.animate({
322
+ top: "+=10",
323
+ opacity: 1
324
+ }, options.speed);
325
+ }, options.delay);
326
+ };
327
+ this.each(function() {
328
+ var $this;
329
+ $this = $(this);
330
+ $this.attr('role', 'tooltip').attr('data-title', $this.attr('title'));
331
+ return $this.removeAttr("title");
332
+ });
333
+ $('body').on('focus', '[role=tooltip]', function() {
334
+ return showtooltip($(this));
335
+ }).on('blur', '[role=tooltip]', function() {
336
+ clearTimeout(delayShow);
337
+ return closetooltip();
338
+ }).on('mouseenter', '[role=tooltip]:not(input,select,textarea)', function() {
339
+ return showtooltip($(this));
340
+ }).on('mouseleave', '[role=tooltip]:not(input,select,textarea)', function() {
341
+ clearTimeout(delayShow);
342
+ return closetooltip();
343
+ });
344
+ return $(window).on({
345
+ scroll: function() {
346
+ trigger = $('[role=tooltip].on');
347
+ if (trigger.length) {
348
+ setPosition(trigger);
349
+ return $('#tooltip').css({
350
+ top: "+=10"
351
+ });
352
+ }
353
+ }
354
+ });
355
+ };
356
+ })(jQuery);
357
+
358
+ /* --------------------------------------------
359
+ Begin jquery.responsiveText.coffee
360
+ --------------------------------------------
361
+ */
362
+
363
+
364
+ /*
365
+ *
366
+ * jQuery ResponsiveText by Gary Hepting - https://github.com/ghepting/responsiveText
367
+ *
368
+ * Open source under the BSD License.
369
+ *
370
+ * Copyright © 2013 Gary Hepting. All rights reserved.
371
+ *
372
+ */
373
+
374
+
375
+ (function($) {
376
+ var elems;
377
+ elems = [];
378
+ $.fn.responsiveText = function(options) {
379
+ var settings;
380
+ settings = {
381
+ compressor: options.compressor || 10,
382
+ minSize: options.minSize || Number.NEGATIVE_INFINITY,
383
+ maxSize: options.maxSize || Number.POSITIVE_INFINITY
384
+ };
385
+ return this.each(function() {
386
+ var elem;
387
+ elem = $(this);
388
+ elem.attr('data-compression', settings.compressor);
389
+ elem.attr('data-min', settings.minSize);
390
+ elem.attr('data-max', settings.maxSize);
391
+ elem.css("font-size", Math.floor(Math.max(Math.min(elem.width() / settings.compressor, parseFloat(settings.maxSize)), parseFloat(settings.minSize))));
392
+ return elems.push(elem);
393
+ });
394
+ };
395
+ return $(window).on("resize", function() {
396
+ return $(elems).each(function() {
397
+ var elem;
398
+ elem = $(this);
399
+ return elem.css("font-size", Math.floor(Math.max(Math.min(elem.width() / (elem.attr('data-compression')), parseFloat(elem.attr('data-max'))), parseFloat(elem.attr('data-min')))));
400
+ });
401
+ });
402
+ })(jQuery);
403
+
404
+ /* --------------------------------------------
405
+ Begin jquery.responsiveTables.coffee
406
+ --------------------------------------------
407
+ */
408
+
409
+
410
+ /*
411
+ *
412
+ * jQuery ResponsiveTables by Gary Hepting - https://github.com/ghepting/responsiveTables
413
+ *
414
+ * Open source under the BSD License.
415
+ *
416
+ * Copyright © 2013 Gary Hepting. All rights reserved.
417
+ *
418
+ */
419
+
420
+
421
+ (function($) {
422
+ var elems;
423
+ elems = [];
424
+ $.fn.responsiveTable = function(options) {
425
+ var settings;
426
+ settings = {
427
+ compressor: options.compressor || 10,
428
+ minSize: options.minSize || Number.NEGATIVE_INFINITY,
429
+ maxSize: options.maxSize || Number.POSITIVE_INFINITY,
430
+ padding: 2,
431
+ height: "auto",
432
+ adjust_parents: true
433
+ };
434
+ return this.each(function() {
435
+ var columns, elem, fontSize, rows;
436
+ elem = $(this);
437
+ elem.attr('data-compression', settings.compressor);
438
+ elem.attr('data-min', settings.minSize);
439
+ elem.attr('data-max', settings.maxSize);
440
+ elem.attr('data-padding', settings.padding);
441
+ columns = $("tr", elem).first().children("th, td").length;
442
+ rows = $("tr", elem).length;
443
+ if (settings.height !== "auto") {
444
+ $this.css("height", settings.height);
445
+ if (settings.adjust_parents) {
446
+ $this.parents().each(function() {
447
+ return $(this).css("height", "100%");
448
+ });
449
+ }
450
+ }
451
+ $("tr th, tr td", elem).css("width", Math.floor(100 / columns) + "%");
452
+ $("tr th, tr td", elem).css("height", Math.floor(100 / rows) + "%");
453
+ fontSize = Math.floor(Math.max(Math.min(elem.width() / settings.compressor, parseFloat(settings.maxSize)), parseFloat(settings.minSize)));
454
+ $("tr th, tr td", elem).css("font-size", fontSize + "px");
455
+ return elems.push(elem);
456
+ });
457
+ };
458
+ return $(window).on("resize", function() {
459
+ return $(elems).each(function() {
460
+ var elem, fontSize;
461
+ elem = $(this);
462
+ fontSize = Math.floor(Math.max(Math.min(elem.width() / (elem.attr('data-compression')), parseFloat(elem.attr('data-max'))), parseFloat(elem.attr('data-min'))));
463
+ return $("tr th, tr td", elem).css("font-size", fontSize + "px");
464
+ });
465
+ });
466
+ })(jQuery);
467
+
468
+ /* --------------------------------------------
469
+ Begin jquery.modals.coffee
470
+ --------------------------------------------
471
+ */
472
+
473
+
474
+ /*
475
+ *
476
+ * jQuery Modals by Gary Hepting
477
+ * https://github.com/ghepting/modal
478
+ *
479
+ * Based on Avgrund by Hakim El Hattab <3
480
+ *
481
+ */
482
+
483
+
484
+ (function($) {
485
+ var elems, modals;
486
+ if ($('div#iframeModal').length < 1) {
487
+ $('body').append('<div class="iframe modal" id="iframeModal"><iframe marginheight="0" marginwidth="0" frameborder="0"></iframe></div>');
488
+ $('div#iframeModal').prepend('<i class="close icon-remove"></i>').prepend('<i class="fullscreen icon-resize-full"></i>');
489
+ }
490
+ $('a.modal').each(function() {
491
+ $(this).attr('data-url', $(this).attr('href'));
492
+ return $(this).attr('href', '#iframeModal');
493
+ });
494
+ $('a.modal').on("click", function(e) {
495
+ $('div#iframeModal iframe').replaceWith('<iframe marginheight="0" marginwidth="0" frameborder="0" width="100%" height="100%" src="' + $(this).attr('data-url') + '"></iframe>');
496
+ e.preventDefault();
497
+ return false;
498
+ });
499
+ elems = [];
500
+ $.fn.modal = function() {
501
+ this.each(function() {
502
+ $(this).not('#iframeModal').wrapInner('<div class="modal-content"></div>');
503
+ $(this).prepend('<i class="close icon-remove"></i>').prepend('<i class="fullscreen icon-resize-full"></i>').appendTo('body');
504
+ return $('[href=#' + $(this).attr('id') + ']').on("click", function(e) {
505
+ modals.open($(this).attr('href'));
506
+ e.preventDefault();
507
+ return false;
508
+ });
509
+ });
510
+ $('div.modal .close').on("click", function() {
511
+ return modals.close();
512
+ });
513
+ return $('div.modal .fullscreen').on("click", function() {
514
+ return modals.fullscreen($(this).parent('div.modal'));
515
+ });
516
+ };
517
+ modals = (function() {
518
+ var close, fullscreen, open;
519
+ $('html').addClass('modal-ready');
520
+ if ($("#overlay").length < 1) {
521
+ $('body').append('<div id="overlay"></div>');
522
+ }
523
+ $('#overlay, div.modal .close').bind("click", function(e) {
524
+ return close();
525
+ });
526
+ open = function(elem) {
527
+ $(window).bind("keydown", function(e) {
528
+ var keyCode;
529
+ keyCode = (e.which ? e.which : e.keyCode);
530
+ if (keyCode === 27) {
531
+ return close();
532
+ }
533
+ });
534
+ $(elem).addClass("active");
535
+ if (!$(elem).hasClass('iframe')) {
536
+ $(elem).css({
537
+ width: 'auto',
538
+ height: 'auto'
539
+ });
540
+ $(elem).css({
541
+ height: $(elem).outerHeight()
542
+ });
543
+ }
544
+ $(elem).css({
545
+ top: '50%',
546
+ left: '50%',
547
+ 'margin-top': ($(elem).outerHeight() / -2) + 'px',
548
+ 'margin-left': ($(elem).outerWidth() / -2) + 'px'
549
+ });
550
+ setTimeout(function() {
551
+ return $('html').addClass("modal-active");
552
+ }, 0);
553
+ setTimeout(function() {
554
+ return $('html').removeClass('modal-ready');
555
+ }, 400);
556
+ };
557
+ close = function() {
558
+ var modal;
559
+ modal = $('div.modal.active');
560
+ $(window).unbind("keydown");
561
+ $('html').removeClass("modal-active").addClass('modal-ready');
562
+ if (modal.hasClass('iframe')) {
563
+ $('div#iframeModal iframe').replaceWith('<iframe marginheight="0" marginwidth="0" frameborder="0"></iframe>');
564
+ modal.css({
565
+ width: '80%',
566
+ height: '80%'
567
+ });
568
+ } else {
569
+ modal.css({
570
+ width: 'auto',
571
+ height: 'auto'
572
+ });
573
+ }
574
+ modal.css({
575
+ top: '10%',
576
+ left: '10%',
577
+ 'max-width': '80%',
578
+ 'max-height': '80%',
579
+ 'margin-top': 0,
580
+ 'margin-left': 0
581
+ });
582
+ modal.removeClass("active").removeClass("fullscreen");
583
+ $('i.fullscreen', modal).removeClass('icon-resize-small').addClass('icon-resize-full');
584
+ };
585
+ fullscreen = function(elem) {
586
+ if ($('div.modal.active').hasClass('fullscreen')) {
587
+ $('div.modal i.fullscreen').removeClass('icon-resize-small').addClass('icon-resize-full');
588
+ if ($('div.modal.active').hasClass('iframe')) {
589
+ $('div.modal.active').css({
590
+ width: '80%',
591
+ height: '80%'
592
+ });
593
+ } else {
594
+ $('div.modal.active').css({
595
+ width: 'auto',
596
+ height: 'auto'
597
+ });
598
+ $('div.modal.active').css({
599
+ height: $('div.modal.active').outerHeight()
600
+ });
601
+ }
602
+ $('div.modal.active').removeClass('fullscreen').css({
603
+ 'max-width': '80%',
604
+ 'max-height': '80%'
605
+ });
606
+ $('div.modal.active').delay(100).css({
607
+ top: '50%',
608
+ left: '50%',
609
+ 'margin-top': ($('div.modal.active').outerHeight() / -2) + 'px',
610
+ 'margin-left': ($('div.modal.active').outerWidth() / -2) + 'px'
611
+ });
612
+ } else {
613
+ $('div.modal i.fullscreen').addClass('icon-resize-small').removeClass('icon-resize-full');
614
+ $('div.modal.active').addClass('fullscreen').css({
615
+ top: 0,
616
+ left: 0,
617
+ 'margin-top': 0,
618
+ 'margin-left': 0,
619
+ width: '100%',
620
+ height: '100%',
621
+ 'max-width': '100%',
622
+ 'max-height': '100%'
623
+ });
624
+ }
625
+ };
626
+ return {
627
+ open: open,
628
+ close: close,
629
+ fullscreen: fullscreen
630
+ };
631
+ })();
632
+ return $(window).resize(function() {
633
+ return $('div.modal.active').each(function() {
634
+ if (!$(this).hasClass('fullscreen')) {
635
+ $(this).removeClass('active').css({
636
+ top: '50%',
637
+ left: '50%',
638
+ 'margin-top': ($(this).outerHeight() / -2) + 'px',
639
+ 'margin-left': ($(this).outerWidth() / -2) + 'px'
640
+ }).addClass('active');
641
+ if (!$(this).hasClass('iframe')) {
642
+ $(this).css({
643
+ height: 'auto'
644
+ });
645
+ return $(this).css({
646
+ height: $(this).outerHeight()
647
+ });
648
+ }
649
+ }
650
+ });
651
+ });
652
+ })(jQuery);
653
+
654
+ }).call(this);