deckrb 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/README.md +55 -20
  2. data/bin/deck +5 -10
  3. data/lib/deck.rb +1 -1
  4. data/lib/deck/noko.rb +15 -0
  5. data/lib/deck/rack_app.rb +61 -0
  6. data/lib/deck/slide.rb +50 -28
  7. data/lib/deck/{deck.rb → slide_deck.rb} +42 -41
  8. data/lib/deck/version.rb +1 -1
  9. data/spec/rack_app_spec.rb +177 -0
  10. data/spec/slide_deck_spec.rb +46 -0
  11. data/spec/slide_spec.rb +24 -21
  12. data/spec/spec_helper.rb +5 -0
  13. metadata +51 -81
  14. data/deck/GPL-license.txt +0 -278
  15. data/deck/MIT-license.txt +0 -21
  16. data/deck/README.md +0 -57
  17. data/deck/core/deck.core.css +0 -404
  18. data/deck/core/deck.core.html +0 -39
  19. data/deck/core/deck.core.js +0 -498
  20. data/deck/core/deck.core.scss +0 -447
  21. data/deck/extensions/goto/deck.goto.css +0 -41
  22. data/deck/extensions/goto/deck.goto.html +0 -7
  23. data/deck/extensions/goto/deck.goto.js +0 -134
  24. data/deck/extensions/goto/deck.goto.scss +0 -46
  25. data/deck/extensions/hash/deck.hash.css +0 -13
  26. data/deck/extensions/hash/deck.hash.html +0 -2
  27. data/deck/extensions/hash/deck.hash.js +0 -129
  28. data/deck/extensions/hash/deck.hash.scss +0 -15
  29. data/deck/extensions/menu/deck.menu.css +0 -47
  30. data/deck/extensions/menu/deck.menu.js +0 -187
  31. data/deck/extensions/menu/deck.menu.scss +0 -58
  32. data/deck/extensions/navigation/deck.navigation.css +0 -43
  33. data/deck/extensions/navigation/deck.navigation.html +0 -3
  34. data/deck/extensions/navigation/deck.navigation.js +0 -91
  35. data/deck/extensions/navigation/deck.navigation.scss +0 -56
  36. data/deck/extensions/scale/deck.scale.css +0 -16
  37. data/deck/extensions/scale/deck.scale.js +0 -155
  38. data/deck/extensions/scale/deck.scale.scss +0 -17
  39. data/deck/extensions/status/deck.status.css +0 -18
  40. data/deck/extensions/status/deck.status.html +0 -6
  41. data/deck/extensions/status/deck.status.js +0 -95
  42. data/deck/extensions/status/deck.status.scss +0 -22
  43. data/deck/extensions/theme-picker/deck.theme-picker.css +0 -55
  44. data/deck/extensions/theme-picker/deck.theme-picker.js +0 -13
  45. data/deck/introduction/index.html +0 -221
  46. data/deck/introduction/index.rb +0 -101
  47. data/deck/jquery-1.7.min.js +0 -4
  48. data/deck/modernizr.custom.js +0 -4
  49. data/deck/test/fixtures/complex.html +0 -24
  50. data/deck/test/fixtures/empty.html +0 -19
  51. data/deck/test/fixtures/iframe_simple.html +0 -10
  52. data/deck/test/fixtures/iframes.html +0 -32
  53. data/deck/test/fixtures/nesteds.html +0 -36
  54. data/deck/test/fixtures/standard.html +0 -42
  55. data/deck/test/index.html +0 -39
  56. data/deck/test/lib/jasmine-html.js +0 -190
  57. data/deck/test/lib/jasmine-jquery.js +0 -288
  58. data/deck/test/lib/jasmine.css +0 -166
  59. data/deck/test/lib/jasmine.js +0 -2477
  60. data/deck/test/settings.js +0 -3
  61. data/deck/test/spec.core.js +0 -434
  62. data/deck/test/spec.goto.js +0 -119
  63. data/deck/test/spec.hash.js +0 -81
  64. data/deck/test/spec.menu.js +0 -66
  65. data/deck/test/spec.navigation.js +0 -51
  66. data/deck/test/spec.scale.js +0 -57
  67. data/deck/test/spec.status.js +0 -58
  68. data/deck/themes/style/neon.css +0 -114
  69. data/deck/themes/style/neon.scss +0 -139
  70. data/deck/themes/style/swiss.css +0 -75
  71. data/deck/themes/style/swiss.scss +0 -91
  72. data/deck/themes/style/web-2.0.css +0 -205
  73. data/deck/themes/style/web-2.0.scss +0 -236
  74. data/deck/themes/transition/fade.css +0 -44
  75. data/deck/themes/transition/fade.scss +0 -70
  76. data/deck/themes/transition/horizontal-slide.css +0 -79
  77. data/deck/themes/transition/horizontal-slide.scss +0 -94
  78. data/deck/themes/transition/vertical-slide.css +0 -97
  79. data/deck/themes/transition/vertical-slide.scss +0 -116
  80. data/lib/deck/app.rb +0 -16
  81. data/spec/deck_spec.rb +0 -98
@@ -1,58 +0,0 @@
1
- .deck-menu {
2
- .slide {
3
- background:#eee;
4
- position:relative;
5
- left:0;
6
- top:0;
7
- visibility:visible;
8
- cursor:pointer;
9
- }
10
-
11
- > .slide {
12
- .no-csstransforms & {
13
- float:left;
14
- width:22%;
15
- height:22%;
16
- min-height:0;
17
- margin:1%;
18
- font-size:0.22em;
19
- overflow:hidden;
20
- padding:0 0.5%;
21
- }
22
-
23
- .csstransforms & {
24
- -webkit-transform:scale(.22);
25
- -moz-transform:scale(.22);
26
- -o-transform:scale(.22);
27
- -ms-transform:scale(.22);
28
- transform:scale(.22);
29
- -webkit-transform-origin:0 0;
30
- -moz-transform-origin:0 0;
31
- -o-transform-origin:0 0;
32
- -ms-transform-origin:0 0;
33
- transform-origin:0 0;
34
- -webkit-box-sizing: border-box;
35
- -moz-box-sizing: border-box;
36
- box-sizing: border-box;
37
- width:100%;
38
- height:100%;
39
- overflow:hidden;
40
- padding:0 48px;
41
- margin:12px;
42
- }
43
- }
44
-
45
- iframe, img, video {
46
- max-width:100%;
47
- }
48
-
49
- .deck-current, .no-touch & .slide:hover {
50
- background:#ddf;
51
- }
52
-
53
- &.deck-container:hover {
54
- .deck-prev-link, .deck-next-link {
55
- display:none;
56
- }
57
- }
58
- }
@@ -1,43 +0,0 @@
1
- .deck-container .deck-prev-link, .deck-container .deck-next-link {
2
- display: none;
3
- position: absolute;
4
- z-index: 3;
5
- top: 50%;
6
- width: 32px;
7
- height: 32px;
8
- margin-top: -16px;
9
- font-size: 20px;
10
- font-weight: bold;
11
- line-height: 32px;
12
- vertical-align: middle;
13
- text-align: center;
14
- text-decoration: none;
15
- color: #fff;
16
- background: #888;
17
- }
18
- .borderradius .deck-container .deck-prev-link, .borderradius .deck-container .deck-next-link {
19
- -webkit-border-radius: 16px;
20
- -moz-border-radius: 16px;
21
- border-radius: 16px;
22
- }
23
- .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited {
24
- color: #fff;
25
- }
26
- .deck-container .deck-prev-link {
27
- left: 8px;
28
- }
29
- .deck-container .deck-next-link {
30
- right: 8px;
31
- }
32
- .deck-container:hover .deck-prev-link, .deck-container:hover .deck-next-link {
33
- display: block;
34
- }
35
- .deck-container:hover .deck-prev-link.deck-nav-disabled, .touch .deck-container:hover .deck-prev-link, .deck-container:hover .deck-next-link.deck-nav-disabled, .touch .deck-container:hover .deck-next-link {
36
- display: none;
37
- }
38
-
39
- @media print {
40
- .deck-prev-link, .deck-next-link {
41
- display: none !important;
42
- }
43
- }
@@ -1,3 +0,0 @@
1
- <!-- Place the following snippet at the bottom of the deck container. -->
2
- <a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
3
- <a href="#" class="deck-next-link" title="Next">&#8594;</a>
@@ -1,91 +0,0 @@
1
- /*!
2
- Deck JS - deck.navigation
3
- Copyright (c) 2011 Caleb Troughton
4
- Dual licensed under the MIT license and GPL license.
5
- https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
6
- https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
7
- */
8
-
9
- /*
10
- This module adds clickable previous and next links to the deck.
11
- */
12
- (function($, deck, undefined) {
13
- var $d = $(document),
14
-
15
- /* Updates link hrefs, and disabled states if last/first slide */
16
- updateButtons = function(e, from, to) {
17
- var opts = $[deck]('getOptions'),
18
- last = $[deck]('getSlides').length - 1,
19
- prevSlide = $[deck]('getSlide', to - 1),
20
- nextSlide = $[deck]('getSlide', to + 1),
21
- prevId = prevSlide ? prevSlide.attr('id') : undefined;
22
- nextId = nextSlide ? nextSlide.attr('id') : undefined;
23
-
24
- $(opts.selectors.previousLink)
25
- .toggleClass(opts.classes.navDisabled, !to)
26
- .attr('href', '#' + (prevId ? prevId : ''));
27
- $(opts.selectors.nextLink)
28
- .toggleClass(opts.classes.navDisabled, to === last)
29
- .attr('href', '#' + (nextId ? nextId : ''));
30
- };
31
-
32
- /*
33
- Extends defaults/options.
34
-
35
- options.classes.navDisabled
36
- This class is added to a navigation link when that action is disabled.
37
- It is added to the previous link when on the first slide, and to the
38
- next link when on the last slide.
39
-
40
- options.selectors.nextLink
41
- The elements that match this selector will move the deck to the next
42
- slide when clicked.
43
-
44
- options.selectors.previousLink
45
- The elements that match this selector will move to deck to the previous
46
- slide when clicked.
47
- */
48
- $.extend(true, $[deck].defaults, {
49
- classes: {
50
- navDisabled: 'deck-nav-disabled'
51
- },
52
-
53
- selectors: {
54
- nextLink: '.deck-next-link',
55
- previousLink: '.deck-prev-link'
56
- }
57
- });
58
-
59
- $d.bind('deck.init', function() {
60
- var opts = $[deck]('getOptions'),
61
- slides = $[deck]('getSlides'),
62
- $current = $[deck]('getSlide'),
63
- ndx;
64
-
65
- // Setup prev/next link events
66
- $(opts.selectors.previousLink)
67
- .unbind('click.decknavigation')
68
- .bind('click.decknavigation', function(e) {
69
- $[deck]('prev');
70
- e.preventDefault();
71
- });
72
-
73
- $(opts.selectors.nextLink)
74
- .unbind('click.decknavigation')
75
- .bind('click.decknavigation', function(e) {
76
- $[deck]('next');
77
- e.preventDefault();
78
- });
79
-
80
- // Find where we started in the deck and set initial states
81
- $.each(slides, function(i, $slide) {
82
- if ($slide === $current) {
83
- ndx = i;
84
- return false;
85
- }
86
- });
87
- updateButtons(null, ndx, ndx);
88
- })
89
- .bind('deck.change', updateButtons);
90
- })(jQuery, 'deck');
91
-
@@ -1,56 +0,0 @@
1
- @mixin border-radius($r) {
2
- -webkit-border-radius:$r;
3
- -moz-border-radius:$r;
4
- border-radius:$r;
5
- }
6
-
7
- .deck-container {
8
- .deck-prev-link, .deck-next-link {
9
- display:none;
10
- position:absolute;
11
- z-index:3;
12
- top:50%;
13
- width:32px;
14
- height:32px;
15
- margin-top:-16px;
16
- font-size:20px;
17
- font-weight:bold;
18
- line-height:32px;
19
- vertical-align:middle;
20
- text-align:center;
21
- text-decoration:none;
22
- color:#fff;
23
- background:#888;
24
-
25
- .borderradius & {
26
- @include border-radius(16px);
27
- }
28
-
29
- &:hover, &:focus, &:active, &:visited {
30
- color:#fff;
31
- }
32
- }
33
-
34
- .deck-prev-link {
35
- left:8px;
36
- }
37
-
38
- .deck-next-link {
39
- right:8px;
40
- }
41
-
42
- &:hover .deck-prev-link, &:hover .deck-next-link {
43
- display:block;
44
-
45
- &.deck-nav-disabled, .touch & {
46
- display:none;
47
- }
48
- }
49
- }
50
-
51
-
52
- @media print {
53
- .deck-prev-link, .deck-next-link {
54
- display:none !important;
55
- }
56
- }
@@ -1,16 +0,0 @@
1
- .csstransforms .deck-container.deck-scale {
2
- width: auto;
3
- -webkit-transform-origin: 50% 0;
4
- -moz-transform-origin: 50% 0;
5
- -o-transform-origin: 50% 0;
6
- -ms-transform-origin: 50% 0;
7
- transform-origin: 50% 0;
8
- }
9
- .csstransforms .deck-container.deck-scale.deck-menu {
10
- width: 70%;
11
- -webkit-transform: none !important;
12
- -moz-transform: none !important;
13
- -o-transform: none !important;
14
- -ms-transform: none !important;
15
- transform: none !important;
16
- }
@@ -1,155 +0,0 @@
1
- /*!
2
- Deck JS - deck.scale
3
- Copyright (c) 2011 Caleb Troughton
4
- Dual licensed under the MIT license and GPL license.
5
- https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
6
- https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
7
- */
8
-
9
- /*
10
- This module adds automatic scaling to the deck. It should only be used on
11
- standalone decks where the body is the deck container. Slides are scaled down
12
- using CSS transforms to fit within the browser window. If the browser window
13
- is big enough to hold the slides without scaling, no scaling occurs. The user
14
- can disable and enable scaling with a keyboard shortcut.
15
-
16
- Note: CSS transforms make Flash videos render incorrectly. Presenters that
17
- need to use video will want to disable scaling to play them. HTML5 video
18
- works fine.
19
- */
20
- (function($, deck, window, undefined) {
21
- var $d = $(document),
22
- $w = $(window),
23
- baseHeight, // Value to scale against
24
- timer, // Timeout id for debouncing
25
-
26
- /*
27
- Internal function to do all the dirty work of scaling the deck container.
28
- */
29
- scaleDeck = function() {
30
- var obh = $[deck]('getOptions').baseHeight,
31
- $container = $[deck]('getContainer'),
32
- height = $w.height(),
33
- slides = $[deck]('getSlides'),
34
- scale,
35
- transform;
36
-
37
- // Don't scale if scaling disabled
38
- if (!$container.hasClass($[deck]('getOptions').classes.scale)) {
39
- scale = 1;
40
- }
41
- else {
42
- // Use tallest slide as base height if not set manually
43
- baseHeight = obh ? obh : (function() {
44
- var greatest = 0;
45
-
46
- $.each(slides, function(i, $slide) {
47
- greatest = Math.max(greatest, $slide.outerHeight());
48
- });
49
-
50
- return greatest;
51
- })();
52
-
53
- scale = height / baseHeight;
54
- }
55
-
56
- // Scale, but don't scale up
57
- transform = scale >= 1 ? 'none' : 'scale(' + scale + ')';
58
- $.each('Webkit Moz O ms Khtml'.split(' '), function(i, prefix) {
59
- $container.css(prefix + 'Transform', transform);
60
- });
61
- };
62
-
63
- /*
64
- Extends defaults/options.
65
-
66
- options.classes.scale
67
- This class is added to the deck container when scaling is enabled.
68
- It is enabled by default when the module is included.
69
-
70
- options.keys.scale
71
- The numeric keycode used to toggle enabling and disabling scaling.
72
-
73
- options.baseHeight
74
- When baseheight is falsy, as it is by default, the deck is scaled
75
- in proportion to the height of the slides. You may instead specify
76
- a height, and the deck will be scaled against this height regardless
77
- of the actual content height.
78
-
79
- options.scaleDebounce
80
- Scaling on the browser resize event is debounced. This number is the
81
- threshold in milliseconds. You can learn more about debouncing here:
82
- http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
83
-
84
- */
85
- $.extend(true, $[deck].defaults, {
86
- classes: {
87
- scale: 'deck-scale'
88
- },
89
-
90
- keys: {
91
- scale: 83 // s
92
- },
93
-
94
- baseHeight: null,
95
- scaleDebounce: 200
96
- });
97
-
98
- /*
99
- jQuery.deck('disableScale')
100
-
101
- Disables scaling and removes the scale class from the deck container.
102
- */
103
- $[deck]('extend', 'disableScale', function() {
104
- $[deck]('getContainer').removeClass($[deck]('getOptions').classes.scale);
105
- scaleDeck();
106
- });
107
-
108
- /*
109
- jQuery.deck('enableScale')
110
-
111
- Enables scaling and adds the scale class to the deck container.
112
- */
113
- $[deck]('extend', 'enableScale', function() {
114
- $[deck]('getContainer').addClass($[deck]('getOptions').classes.scale);
115
- scaleDeck();
116
- });
117
-
118
- /*
119
- jQuery.deck('toggleScale')
120
-
121
- Toggles between enabling and disabling scaling.
122
- */
123
- $[deck]('extend', 'toggleScale', function() {
124
- var $c = $[deck]('getContainer');
125
- $[deck]($c.hasClass($[deck]('getOptions').classes.scale) ?
126
- 'disableScale' : 'enableScale');
127
- });
128
-
129
- $d.bind('deck.init', function() {
130
- var opts = $[deck]('getOptions');
131
-
132
- // Scaling enabled at start
133
- $[deck]('getContainer').addClass(opts.classes.scale);
134
-
135
- // Debounce the resize scaling
136
- $w.unbind('resize.deckscale').bind('resize.deckscale', function() {
137
- window.clearTimeout(timer);
138
- timer = window.setTimeout(scaleDeck, opts.scaleDebounce);
139
- })
140
- // Scale once on load, in case images or something change layout
141
- .unbind('load.deckscale').bind('load.deckscale', scaleDeck);
142
-
143
- // Bind key events
144
- $d.unbind('keydown.deckscale').bind('keydown.deckscale', function(e) {
145
- if (e.which === opts.keys.scale || $.inArray(e.which, opts.keys.scale) > -1) {
146
- $[deck]('toggleScale');
147
- e.preventDefault();
148
- }
149
- });
150
-
151
- // Scale once on init
152
- scaleDeck();
153
- });
154
- })(jQuery, 'deck', this);
155
-
@@ -1,17 +0,0 @@
1
- .csstransforms .deck-container.deck-scale {
2
- width:auto;
3
- -webkit-transform-origin: 50% 0;
4
- -moz-transform-origin: 50% 0;
5
- -o-transform-origin: 50% 0;
6
- -ms-transform-origin: 50% 0;
7
- transform-origin: 50% 0;
8
-
9
- &.deck-menu {
10
- width:70%;
11
- -webkit-transform:none !important;
12
- -moz-transform:none !important;
13
- -o-transform:none !important;
14
- -ms-transform:none !important;
15
- transform:none !important;
16
- }
17
- }