deckrb 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/README.md +17 -17
  2. data/lib/deck/version.rb +1 -1
  3. data/public/deck.js/GPL-license.txt +0 -0
  4. data/public/deck.js/MIT-license.txt +0 -0
  5. data/public/deck.js/README.md +1 -0
  6. data/public/deck.js/core/deck.core.css +0 -0
  7. data/public/deck.js/core/deck.core.html +0 -0
  8. data/public/deck.js/core/deck.core.js +0 -0
  9. data/public/deck.js/extensions/goto/deck.goto.css +0 -0
  10. data/public/deck.js/extensions/goto/deck.goto.html +0 -0
  11. data/public/deck.js/extensions/goto/deck.goto.js +62 -26
  12. data/public/deck.js/extensions/hash/deck.hash.css +0 -0
  13. data/public/deck.js/extensions/hash/deck.hash.html +0 -0
  14. data/public/deck.js/extensions/hash/deck.hash.js +0 -0
  15. data/public/deck.js/extensions/hash/deck.hash.scss +0 -0
  16. data/public/deck.js/extensions/menu/deck.menu.css +5 -5
  17. data/public/deck.js/extensions/menu/deck.menu.js +0 -0
  18. data/public/deck.js/extensions/menu/deck.menu.scss +5 -5
  19. data/public/deck.js/extensions/navigation/deck.navigation.css +0 -0
  20. data/public/deck.js/extensions/navigation/deck.navigation.html +0 -0
  21. data/public/deck.js/extensions/navigation/deck.navigation.js +0 -0
  22. data/public/deck.js/extensions/scale/deck.scale.css +18 -9
  23. data/public/deck.js/extensions/scale/deck.scale.js +62 -48
  24. data/public/deck.js/extensions/scale/deck.scale.scss +26 -16
  25. data/public/deck.js/extensions/status/deck.status.css +0 -0
  26. data/public/deck.js/extensions/status/deck.status.html +0 -0
  27. data/public/deck.js/extensions/status/deck.status.js +0 -0
  28. data/public/deck.js/introduction/index.html +18 -30
  29. data/public/deck.js/jquery-1.7.min.js +0 -0
  30. data/public/deck.js/modernizr.custom.js +0 -0
  31. data/public/deck.js/test/fixtures/complex.html +0 -0
  32. data/public/deck.js/test/fixtures/empty.html +0 -0
  33. data/public/deck.js/test/fixtures/iframe_simple.html +0 -0
  34. data/public/deck.js/test/fixtures/iframes.html +0 -0
  35. data/public/deck.js/test/fixtures/nesteds.html +1 -1
  36. data/public/deck.js/test/fixtures/standard.html +0 -0
  37. data/public/deck.js/test/index.html +0 -0
  38. data/public/deck.js/test/spec.goto.js +41 -18
  39. data/public/deck.js/test/spec.hash.js +0 -0
  40. data/public/deck.js/test/spec.menu.js +0 -0
  41. data/public/deck.js/test/spec.navigation.js +0 -0
  42. data/public/deck.js/test/spec.scale.js +0 -0
  43. data/public/deck.js/test/spec.status.js +0 -0
  44. data/public/deck.js/themes/style/neon.css +3 -0
  45. data/public/deck.js/themes/style/neon.scss +20 -14
  46. data/public/deck.js/themes/style/swiss.css +3 -0
  47. data/public/deck.js/themes/style/swiss.scss +14 -8
  48. data/public/deck.js/themes/style/web-2.0.css +3 -0
  49. data/public/deck.js/themes/style/web-2.0.scss +16 -12
  50. data/public/deck.js/themes/transition/fade.css +2 -3
  51. data/public/deck.js/themes/transition/fade.scss +2 -3
  52. data/public/deck.js/themes/transition/horizontal-slide.css +0 -3
  53. data/public/deck.js/themes/transition/horizontal-slide.scss +0 -4
  54. data/public/deck.js/themes/transition/vertical-slide.css +0 -3
  55. data/public/deck.js/themes/transition/vertical-slide.scss +0 -4
  56. metadata +18 -19
  57. data/public/deck.js/introduction/index.rb +0 -101
@@ -1,17 +1,27 @@
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;
1
+ .csstransforms .deck-container.deck-scale:not(.deck-menu) {
2
+ overflow:hidden;
3
+
4
+ > .slide {
5
+ -webkit-box-sizing: padding-box;
6
+ -moz-box-sizing: padding-box;
7
+ box-sizing: padding-box;
8
+ width:100%;
9
+ padding-bottom:20px;
10
+
11
+ > .deck-slide-scaler {
12
+ -webkit-transform-origin: 50% 0;
13
+ -moz-transform-origin: 50% 0;
14
+ -o-transform-origin: 50% 0;
15
+ -ms-transform-origin: 50% 0;
16
+ transform-origin: 50% 0;
17
+ }
16
18
  }
17
- }
19
+ }
20
+
21
+ .csstransforms .deck-container.deck-menu .deck-slide-scaler {
22
+ -webkit-transform:none !important;
23
+ -moz-transform:none !important;
24
+ -o-transform:none !important;
25
+ -ms-transform:none !important;
26
+ transform:none !important;
27
+ }
File without changes
File without changes
File without changes
@@ -21,38 +21,18 @@
21
21
  <link rel="stylesheet" href="../extensions/status/deck.status.css">
22
22
  <link rel="stylesheet" href="../extensions/hash/deck.hash.css">
23
23
 
24
- <!-- Theme CSS files (menu swaps these out) -->
25
- <link rel="stylesheet" id="style-theme-link" href="../themes/style/web-2.0.css">
26
- <link rel="stylesheet" id="transition-theme-link" href="../themes/transition/horizontal-slide.css">
24
+ <!-- Style theme. More available in /themes/style/ or create your own. -->
25
+ <link rel="stylesheet" href="../themes/style/web-2.0.css">
27
26
 
28
- <!-- Custom CSS just for this page -->
29
- <link rel="stylesheet" href="introduction.css">
27
+ <!-- Transition theme. More available in /themes/transition/ or create your own. -->
28
+ <link rel="stylesheet" href="../themes/transition/horizontal-slide.css">
30
29
 
31
30
  <script src="../modernizr.custom.js"></script>
32
31
  </head>
33
32
 
34
33
  <body class="deck-container">
35
34
 
36
- <div class="theme-picker">
37
- <h2>Themes</h2>
38
-
39
- <label for="style-themes">Style:</label>
40
- <select id="style-themes">
41
- <option selected="selected" value="../themes/style/web-2.0.css">Web 2.0</option>
42
- <option value="../themes/style/swiss.css">Swiss</option>
43
- <option value="../themes/style/neon.css">Neon</option>
44
- <option value="">None</option>
45
- </select>
46
-
47
- <label for="transition-themes">Transition:</label>
48
- <select id="transition-themes">
49
- <option selected="selected" value="../themes/transition/horizontal-slide.css">Horizontal Slide</option>
50
- <option value="../themes/transition/vertical-slide.css">Vertical Slide</option>
51
- <option value="../themes/transition/fade.css">Fade</option>
52
- <option value="">None</option>
53
- </select>
54
- </div>
55
-
35
+ <!-- Begin slides -->
56
36
  <section class="slide" id="title-slide">
57
37
  <h1>Getting Started with deck.js</h1>
58
38
  </section>
@@ -183,15 +163,18 @@
183
163
  <p>If you want to learn about making your own themes, extending deck.js, and more, check out the&nbsp;<a href="../docs/">documentation</a>.</p>
184
164
  </section>
185
165
 
166
+ <!-- deck.navigation snippet -->
186
167
  <a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
187
168
  <a href="#" class="deck-next-link" title="Next">&#8594;</a>
188
169
 
170
+ <!-- deck.status snippet -->
189
171
  <p class="deck-status">
190
172
  <span class="deck-status-current"></span>
191
173
  /
192
174
  <span class="deck-status-total"></span>
193
175
  </p>
194
176
 
177
+ <!-- deck.goto snippet -->
195
178
  <form action="." method="get" class="goto-form">
196
179
  <label for="goto-slide">Go to slide:</label>
197
180
  <input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
@@ -199,12 +182,13 @@
199
182
  <input type="submit" value="Go">
200
183
  </form>
201
184
 
185
+ <!-- deck.hash snippet -->
202
186
  <a href="." title="Permalink to this slide" class="deck-permalink">#</a>
203
187
 
204
188
 
205
- <!-- Grab CDN jQuery, with a protocol relative URL; fall back to local if offline -->
206
- <script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script>
207
- <script>window.jQuery || document.write('<script src="../jquery-1.7.min.js"><\/script>')</script>
189
+ <!-- Grab CDN jQuery, with a protocol relative URL; fall back to local if offline -->
190
+ <script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script>
191
+ <script>window.jQuery || document.write('<script src="../jquery-1.7.min.js"><\/script>')</script>
208
192
 
209
193
  <!-- Deck Core and extensions -->
210
194
  <script src="../core/deck.core.js"></script>
@@ -214,8 +198,12 @@
214
198
  <script src="../extensions/status/deck.status.js"></script>
215
199
  <script src="../extensions/navigation/deck.navigation.js"></script>
216
200
 
217
- <!-- Specific to this page -->
218
- <script src="introduction.js"></script>
201
+ <!-- Initialize the deck -->
202
+ <script>
203
+ $(function() {
204
+ $.deck('.slide');
205
+ });
206
+ </script>
219
207
 
220
208
  </body>
221
209
  </html>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
  </div>
18
18
 
19
- <div class="slide">
19
+ <div class="slide" id="after">
20
20
  </div>
21
21
 
22
22
  <div class="slide">
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  describe('Deck JS Quick Go-To', function() {
2
2
  var $d = $(document);
3
-
3
+
4
4
  beforeEach(function() {
5
5
  loadFixtures('standard.html');
6
6
  if (Modernizr.history) {
@@ -11,35 +11,35 @@ describe('Deck JS Quick Go-To', function() {
11
11
  }
12
12
  $.deck('.slide');
13
13
  });
14
-
14
+
15
15
  describe('showGoTo()', function() {
16
16
  it('should show the go-to helper', function() {
17
17
  expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
18
18
  $.deck('showGoTo');
19
19
  expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto);
20
20
  });
21
-
21
+
22
22
  it('should focus the go-to input', function() {
23
23
  $.deck('showGoTo');
24
24
  expect($(defaults.selectors.gotoInput)[0]).toEqual(document.activeElement);
25
25
  });
26
26
  });
27
-
27
+
28
28
  describe('hideGoTo()', function() {
29
29
  beforeEach(function() {
30
30
  $.deck('showGoTo');
31
31
  $.deck('hideGoTo');
32
32
  });
33
-
33
+
34
34
  it('should hide the go-to helper', function() {
35
35
  expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
36
36
  });
37
-
37
+
38
38
  it('should blur the go-to input', function() {
39
39
  expect($(defaults.selectors.gotoInput)[0]).not.toEqual(document.activeElement);
40
40
  });
41
41
  });
42
-
42
+
43
43
  describe('toggleGoTo()', function() {
44
44
  it('should toggle the go-to helper on and off', function() {
45
45
  expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
@@ -49,49 +49,49 @@ describe('Deck JS Quick Go-To', function() {
49
49
  expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
50
50
  });
51
51
  });
52
-
52
+
53
53
  describe('Go-To submit', function() {
54
54
  beforeEach(function() {
55
55
  $.deck('showGoTo');
56
56
  });
57
-
57
+
58
58
  it('should hide the go-to helper', function() {
59
59
  $(defaults.selectors.gotoInput).val('3');
60
60
  $(defaults.selectors.gotoForm).submit();
61
61
  expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
62
62
  });
63
-
63
+
64
64
  it('should go to the slide number entered', function() {
65
65
  $(defaults.selectors.gotoInput).val('3');
66
66
  $(defaults.selectors.gotoForm).submit();
67
67
  expect($.deck('getSlide')).toEqual($.deck('getSlide'), 2);
68
68
  });
69
-
69
+
70
70
  it('should go to the slide id entered', function() {
71
71
  $(defaults.selectors.gotoInput).val('custom-id');
72
72
  $(defaults.selectors.gotoForm).submit();
73
73
  expect($.deck('getSlide')).toEqual($.deck('getSlide'), 1);
74
74
  });
75
-
75
+
76
76
  it('should go nowhere if the number is negative', function() {
77
77
  $(defaults.selectors.gotoInput).val('-2');
78
78
  $(defaults.selectors.gotoForm).submit();
79
79
  expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0);
80
80
  });
81
-
81
+
82
82
  it('should go nowhere if the number is greater than the number of slides', function() {
83
83
  $(defaults.selectors.gotoInput).val('9');
84
84
  $(defaults.selectors.gotoForm).submit();
85
85
  expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0);
86
86
  });
87
-
87
+
88
88
  it('should go nowhere if the id does not exist', function() {
89
89
  $(defaults.selectors.gotoInput).val('do-not-exist');
90
90
  $(defaults.selectors.gotoForm).submit();
91
91
  expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0);
92
92
  });
93
93
  });
94
-
94
+
95
95
  describe('Datalist population', function() {
96
96
  it('should fill in options with all the slide ids', function() {
97
97
  var $dataOptions = $(defaults.selectors.gotoDatalist).find('option');
@@ -100,14 +100,14 @@ describe('Deck JS Quick Go-To', function() {
100
100
  expect($dataOptions.eq(1).attr('value')).toEqual('custom-id');
101
101
  });
102
102
  });
103
-
103
+
104
104
  describe('key bindings', function() {
105
105
  var e;
106
106
 
107
107
  beforeEach(function() {
108
108
  e = jQuery.Event('keydown.deckgoto');
109
109
  });
110
-
110
+
111
111
  it('should toggle the go-to helper if the specified key is pressed', function() {
112
112
  e.which = 71; // g
113
113
  $d.trigger(e);
@@ -116,4 +116,27 @@ describe('Deck JS Quick Go-To', function() {
116
116
  expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
117
117
  });
118
118
  });
119
- });
119
+
120
+ describe('countNested false', function() {
121
+ beforeEach(function() {
122
+ loadFixtures('nesteds.html');
123
+ $.deck('.slide', {
124
+ countNested: false
125
+ });
126
+ $.deck('showGoTo');
127
+ });
128
+
129
+ it('should ignore nested slides when given a slide number', function() {
130
+ $(defaults.selectors.gotoInput).val('4');
131
+ $(defaults.selectors.gotoForm).submit();
132
+ expect($.deck('getSlide')).toHaveId('after');
133
+ });
134
+
135
+ it('should respect top side of new slide range', function() {
136
+ $.deck('go', 0);
137
+ $(defaults.selectors.gotoInput).val('6');
138
+ $(defaults.selectors.gotoForm).submit();
139
+ expect($.deck('getSlide')).toHaveId('slide-0');
140
+ });
141
+ });
142
+ });
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -81,6 +81,9 @@
81
81
  -moz-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
82
82
  box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
83
83
  }
84
+ .deck-container > .slide .deck-before, .deck-container > .slide .deck-previous {
85
+ opacity: 0.4;
86
+ }
84
87
  .deck-container .deck-status {
85
88
  font-size: 0.6666em;
86
89
  }
@@ -3,10 +3,10 @@
3
3
  font-size:1.25em;
4
4
  color:#aaa;
5
5
  background:#000;
6
-
6
+
7
7
  .slide {
8
8
  background:#000;
9
-
9
+
10
10
  h1 {
11
11
  color:#0af;
12
12
  font-weight:normal;
@@ -76,18 +76,18 @@
76
76
  }
77
77
  }
78
78
  }
79
-
79
+
80
80
  .deck-prev-link, .deck-next-link {
81
81
  background:#f0a;
82
82
  text-shadow:0 0 3px #fff;
83
-
83
+
84
84
  &, &:hover, &:focus, &:active, &:visited {
85
85
  color:#fff;
86
86
  }
87
-
87
+
88
88
  &:hover, &:focus {
89
89
  text-decoration:none;
90
-
90
+
91
91
  .boxshadow & {
92
92
  -webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
93
93
  -moz-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
@@ -95,28 +95,34 @@
95
95
  }
96
96
  }
97
97
  }
98
-
98
+
99
+ > .slide {
100
+ .deck-before, .deck-previous {
101
+ opacity:0.4;
102
+ }
103
+ }
104
+
99
105
  .deck-status {
100
106
  font-size:0.6666em;
101
107
  }
102
-
108
+
103
109
  .goto-form {
104
110
  background:#000;
105
111
  border:1px solid #f0a;
106
-
112
+
107
113
  label {
108
114
  color:#fff;
109
115
  }
110
116
  }
111
-
117
+
112
118
  &.deck-menu {
113
119
  .slide {
114
120
  background:#333;
115
121
  }
116
-
122
+
117
123
  .deck-current {
118
124
  background:#444;
119
-
125
+
120
126
  .boxshadow & {
121
127
  background:#000;
122
128
  -webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
@@ -124,11 +130,11 @@
124
130
  box-shadow:0 0 20px #f0a, 0 0 5px #fff;
125
131
  }
126
132
  }
127
-
133
+
128
134
  .no-touch & .slide:hover {
129
135
  background:#444;
130
136
  }
131
-
137
+
132
138
  .no-touch.boxshadow & .slide:hover {
133
139
  background:#000;
134
140
  -webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
@@ -53,6 +53,9 @@
53
53
  .deck-container .slide a:hover, .deck-container .slide a:focus {
54
54
  text-decoration: underline;
55
55
  }
56
+ .deck-container > .slide .deck-before, .deck-container > .slide .deck-previous {
57
+ opacity: 0.4;
58
+ }
56
59
  .deck-container .deck-prev-link, .deck-container .deck-next-link {
57
60
  background: #ccc;
58
61
  font-family: serif;