deckrb 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +17 -17
- data/lib/deck/version.rb +1 -1
- data/public/deck.js/GPL-license.txt +0 -0
- data/public/deck.js/MIT-license.txt +0 -0
- data/public/deck.js/README.md +1 -0
- data/public/deck.js/core/deck.core.css +0 -0
- data/public/deck.js/core/deck.core.html +0 -0
- data/public/deck.js/core/deck.core.js +0 -0
- data/public/deck.js/extensions/goto/deck.goto.css +0 -0
- data/public/deck.js/extensions/goto/deck.goto.html +0 -0
- data/public/deck.js/extensions/goto/deck.goto.js +62 -26
- data/public/deck.js/extensions/hash/deck.hash.css +0 -0
- data/public/deck.js/extensions/hash/deck.hash.html +0 -0
- data/public/deck.js/extensions/hash/deck.hash.js +0 -0
- data/public/deck.js/extensions/hash/deck.hash.scss +0 -0
- data/public/deck.js/extensions/menu/deck.menu.css +5 -5
- data/public/deck.js/extensions/menu/deck.menu.js +0 -0
- data/public/deck.js/extensions/menu/deck.menu.scss +5 -5
- data/public/deck.js/extensions/navigation/deck.navigation.css +0 -0
- data/public/deck.js/extensions/navigation/deck.navigation.html +0 -0
- data/public/deck.js/extensions/navigation/deck.navigation.js +0 -0
- data/public/deck.js/extensions/scale/deck.scale.css +18 -9
- data/public/deck.js/extensions/scale/deck.scale.js +62 -48
- data/public/deck.js/extensions/scale/deck.scale.scss +26 -16
- data/public/deck.js/extensions/status/deck.status.css +0 -0
- data/public/deck.js/extensions/status/deck.status.html +0 -0
- data/public/deck.js/extensions/status/deck.status.js +0 -0
- data/public/deck.js/introduction/index.html +18 -30
- data/public/deck.js/jquery-1.7.min.js +0 -0
- data/public/deck.js/modernizr.custom.js +0 -0
- data/public/deck.js/test/fixtures/complex.html +0 -0
- data/public/deck.js/test/fixtures/empty.html +0 -0
- data/public/deck.js/test/fixtures/iframe_simple.html +0 -0
- data/public/deck.js/test/fixtures/iframes.html +0 -0
- data/public/deck.js/test/fixtures/nesteds.html +1 -1
- data/public/deck.js/test/fixtures/standard.html +0 -0
- data/public/deck.js/test/index.html +0 -0
- data/public/deck.js/test/spec.goto.js +41 -18
- data/public/deck.js/test/spec.hash.js +0 -0
- data/public/deck.js/test/spec.menu.js +0 -0
- data/public/deck.js/test/spec.navigation.js +0 -0
- data/public/deck.js/test/spec.scale.js +0 -0
- data/public/deck.js/test/spec.status.js +0 -0
- data/public/deck.js/themes/style/neon.css +3 -0
- data/public/deck.js/themes/style/neon.scss +20 -14
- data/public/deck.js/themes/style/swiss.css +3 -0
- data/public/deck.js/themes/style/swiss.scss +14 -8
- data/public/deck.js/themes/style/web-2.0.css +3 -0
- data/public/deck.js/themes/style/web-2.0.scss +16 -12
- data/public/deck.js/themes/transition/fade.css +2 -3
- data/public/deck.js/themes/transition/fade.scss +2 -3
- data/public/deck.js/themes/transition/horizontal-slide.css +0 -3
- data/public/deck.js/themes/transition/horizontal-slide.scss +0 -4
- data/public/deck.js/themes/transition/vertical-slide.css +0 -3
- data/public/deck.js/themes/transition/vertical-slide.scss +0 -4
- metadata +18 -19
- data/public/deck.js/introduction/index.rb +0 -101
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
*slides in markdown, using deck.js*
|
4
4
|
|
5
|
+
Home: <http://github.com/alexch/deck.rb>
|
5
6
|
|
6
7
|
## Installation
|
7
8
|
|
@@ -28,7 +29,7 @@ Put this in a file named `meals.md`:
|
|
28
29
|
|
29
30
|
then run this:
|
30
31
|
|
31
|
-
deck meals.md
|
32
|
+
deck run meals.md
|
32
33
|
|
33
34
|
and you'll get a web server running on `http://localhost:4333` serving up a slide presentation with four slides:
|
34
35
|
|
@@ -43,22 +44,21 @@ and you'll get a web server running on `http://localhost:4333` serving up a slid
|
|
43
44
|
|
44
45
|
* clean(ish) page skeleton allows you to focus on your slides, not the HTML/CSS infrastructure
|
45
46
|
* multiple slide source formats, including
|
46
|
-
* Markdown
|
47
|
-
*
|
47
|
+
* [Markdown](http://daringfireball.net/projects/markdown/)
|
48
|
+
* should be easy to add other formats
|
49
|
+
* presentations can span several source files, and can be assembled piecemeal
|
48
50
|
* source files look good as source, built HTML, preview HTML, or as a deck doc
|
49
|
-
* each H1 designates the beginning of a new slide
|
50
|
-
* explicit `!SLIDE` or `<!SLIDE>` directives can split slides too
|
51
|
-
*
|
51
|
+
* each H1 (single hash) designates the beginning of a new slide
|
52
|
+
* explicit `!SLIDE` or `<!SLIDE>` directives can split slides too -- use `<!SLIDE>` so they look like comments when rendered into normal HTML
|
53
|
+
* links to image files are resolved relative to the source file -- no more broken images in markdown previews, and no need to put all your images in a separate directory!
|
54
|
+
* add CSS classes to slides inside the slide directive - - e.g. `<!SLIDE center>` gives `<section class="slide center">`
|
52
55
|
* generated HTML is pretty-printed for easier "view source"
|
53
|
-
|
54
|
-
* add CSS classes to slides inside the slide directive -- e.g. `<!SLIDE center>` gives `<section class="slide center">`
|
55
|
-
* uses deck.js` "swiss" theme and several extensions, including `goto`, `menu`, `navigation`, `status`, `hash`, and `scale`
|
56
|
+
* uses deck.js' "swiss" theme and several extensions, including `goto`, `menu`, `navigation`, `status`, `hash`, and `scale`
|
56
57
|
* uses RedCarpet markdown extensions, including
|
57
58
|
* tables <http://michelf.com/projects/php-markdown/extra/#table>
|
58
59
|
* fenced code blocks <http://michelf.com/projects/php-markdown/extra/#fenced-code-blocks>
|
59
|
-
* mostly compatible with Showoff
|
60
|
-
|
61
|
-
* if the parameter starts with '# ' then it's parsed as literal markdown, not a file
|
60
|
+
* mostly backwards-compatible with Showoff, i.e. you can specify a `showoff.json` file on the command line
|
61
|
+
* if the parameter (or 'sections' entry) starts with '# ' then it's parsed as literal markdown, not a file
|
62
62
|
* code syntax highlighting using Coderay
|
63
63
|
* specify language at the top of the block using either ::: or @@@
|
64
64
|
* e.g. `@@@ ruby`
|
@@ -98,8 +98,9 @@ and you'll get a web server running on `http://localhost:4333` serving up a slid
|
|
98
98
|
|
99
99
|
### See Also
|
100
100
|
|
101
|
-
*
|
102
|
-
*
|
101
|
+
* [Web Slide Show GGroup](https://groups.google.com/group/webslideshow)
|
102
|
+
* [Showoff](https://github.com/schacon/showoff) by Scott Chacon
|
103
|
+
* [Keydown](https://github.com/infews/keydown) by Davis Frank
|
103
104
|
|
104
105
|
## Bugs and Limitations
|
105
106
|
|
@@ -110,12 +111,12 @@ and you'll get a web server running on `http://localhost:4333` serving up a slid
|
|
110
111
|
* we use RedCarpet to process markdown, which doesn't work exactly the same as RDiscount... for example:
|
111
112
|
* indented code blocks under a bullet point may need to be indented more
|
112
113
|
* code blocks must be separated from the previous text by a newline
|
114
|
+
* slide scaling isn't perfect; sometimes either resizing or reloading will improve the layout
|
113
115
|
|
114
116
|
## TODO
|
115
117
|
|
116
118
|
* fix title tag (base it off of presentation name or something)
|
117
119
|
* scale images to fit on the page
|
118
|
-
|
119
120
|
* if no files are specified, use either './showoff.json' or all `.md` files under current directory
|
120
121
|
* deck.json config file
|
121
122
|
* config options:
|
@@ -146,12 +147,11 @@ and you'll get a web server running on `http://localhost:4333` serving up a slid
|
|
146
147
|
* some way to build/rebuild a project that is deployable to heroku
|
147
148
|
* PDF
|
148
149
|
* rewrite internal links to files and serve them relative to current dir, not slide dir
|
150
|
+
* custom `.css`, `.scss`, and `.js` files, which will get imported into all slides
|
149
151
|
|
150
152
|
## TODO (community)
|
151
153
|
|
152
154
|
* submit theme-picker extension to deck.js
|
153
|
-
* add to deck.js wiki https://github.com/imakewebthings/deck.js/wiki
|
154
|
-
* announce on https://groups.google.com/forum/#!forum/webslideshow
|
155
155
|
* mix with keydown https://github.com/infews/keydown
|
156
156
|
* gh-pages documentation site
|
157
157
|
* integrate with slideshow https://github.com/geraldb/slideshow-deck.js
|
data/lib/deck/version.rb
CHANGED
File without changes
|
File without changes
|
data/public/deck.js/README.md
CHANGED
@@ -42,6 +42,7 @@ Core includes stripped down black and white print styles for the standard slide
|
|
42
42
|
- [dougireton](https://github.com/dougireton)
|
43
43
|
- [awirick](https://github.com/awirick)
|
44
44
|
- Daniel Knittl-Frank
|
45
|
+
- [alexch](https://github.com/alexch)
|
45
46
|
|
46
47
|
If you would like to contribute a patch to deck.js please do as much as you can of the following:
|
47
48
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -14,51 +14,57 @@ the deck container.
|
|
14
14
|
*/
|
15
15
|
(function($, deck, undefined) {
|
16
16
|
var $d = $(document);
|
17
|
-
|
17
|
+
|
18
18
|
/*
|
19
19
|
Extends defaults/options.
|
20
|
-
|
20
|
+
|
21
21
|
options.classes.goto
|
22
22
|
This class is added to the deck container when showing the Go To Slide
|
23
23
|
form.
|
24
|
-
|
24
|
+
|
25
25
|
options.selectors.gotoDatalist
|
26
26
|
The element that matches this selector is the datalist element that will
|
27
27
|
be populated with options for each of the slide ids. In browsers that
|
28
28
|
support the datalist element, this provides a drop list of slide ids to
|
29
29
|
aid the user in selecting a slide.
|
30
|
-
|
30
|
+
|
31
31
|
options.selectors.gotoForm
|
32
32
|
The element that matches this selector is the form that is submitted
|
33
33
|
when a user hits enter after typing a slide number/id in the gotoInput
|
34
34
|
element.
|
35
|
-
|
35
|
+
|
36
36
|
options.selectors.gotoInput
|
37
37
|
The element that matches this selector is the text input field for
|
38
38
|
entering a slide number/id in the Go To Slide form.
|
39
|
-
|
39
|
+
|
40
40
|
options.keys.goto
|
41
41
|
The numeric keycode used to show the Go To Slide form.
|
42
|
+
|
43
|
+
options.countNested
|
44
|
+
If false, only top level slides will be counted when entering a
|
45
|
+
slide number.
|
42
46
|
*/
|
43
47
|
$.extend(true, $[deck].defaults, {
|
44
48
|
classes: {
|
45
49
|
goto: 'deck-goto'
|
46
50
|
},
|
47
|
-
|
51
|
+
|
48
52
|
selectors: {
|
49
53
|
gotoDatalist: '#goto-datalist',
|
50
54
|
gotoForm: '.goto-form',
|
51
55
|
gotoInput: '#goto-slide'
|
52
56
|
},
|
53
|
-
|
57
|
+
|
54
58
|
keys: {
|
55
59
|
goto: 71 // g
|
56
|
-
}
|
60
|
+
},
|
61
|
+
|
62
|
+
countNested: true
|
57
63
|
});
|
58
64
|
|
59
65
|
/*
|
60
66
|
jQuery.deck('showGoTo')
|
61
|
-
|
67
|
+
|
62
68
|
Shows the Go To Slide form by adding the class specified by the goto class
|
63
69
|
option to the deck container.
|
64
70
|
*/
|
@@ -69,7 +75,7 @@ the deck container.
|
|
69
75
|
|
70
76
|
/*
|
71
77
|
jQuery.deck('hideGoTo')
|
72
|
-
|
78
|
+
|
73
79
|
Hides the Go To Slide form by removing the class specified by the goto class
|
74
80
|
option from the deck container.
|
75
81
|
*/
|
@@ -80,50 +86,80 @@ the deck container.
|
|
80
86
|
|
81
87
|
/*
|
82
88
|
jQuery.deck('toggleGoTo')
|
83
|
-
|
89
|
+
|
84
90
|
Toggles between showing and hiding the Go To Slide form.
|
85
91
|
*/
|
86
92
|
$[deck]('extend', 'toggleGoTo', function() {
|
87
93
|
$[deck]($[deck]('getContainer').hasClass($[deck]('getOptions').classes.goto) ? 'hideGoTo' : 'showGoTo');
|
88
94
|
});
|
89
|
-
|
95
|
+
|
90
96
|
$d.bind('deck.init', function() {
|
91
97
|
var opts = $[deck]('getOptions'),
|
92
|
-
$datalist = $(opts.selectors.gotoDatalist)
|
93
|
-
|
98
|
+
$datalist = $(opts.selectors.gotoDatalist),
|
99
|
+
slideTest = $.map([
|
100
|
+
opts.classes.before,
|
101
|
+
opts.classes.previous,
|
102
|
+
opts.classes.current,
|
103
|
+
opts.classes.next,
|
104
|
+
opts.classes.after
|
105
|
+
], function(el, i) {
|
106
|
+
return '.' + el;
|
107
|
+
}).join(', '),
|
108
|
+
rootCounter = 1;
|
109
|
+
|
94
110
|
// Bind key events
|
95
111
|
$d.unbind('keydown.deckgoto').bind('keydown.deckgoto', function(e) {
|
96
112
|
var key = $[deck]('getOptions').keys.goto;
|
97
|
-
|
113
|
+
|
98
114
|
if (e.which === key || $.inArray(e.which, key) > -1) {
|
99
115
|
e.preventDefault();
|
100
116
|
$[deck]('toggleGoTo');
|
101
117
|
}
|
102
118
|
});
|
103
|
-
|
104
|
-
/* Populate datalist */
|
119
|
+
|
120
|
+
/* Populate datalist and work out countNested*/
|
105
121
|
$.each($[deck]('getSlides'), function(i, $slide) {
|
106
|
-
var id = $slide.attr('id')
|
107
|
-
|
122
|
+
var id = $slide.attr('id'),
|
123
|
+
$parentSlides = $slide.parentsUntil(opts.selectors.container, slideTest);
|
124
|
+
|
108
125
|
if (id) {
|
109
126
|
$datalist.append('<option value="' + id + '">');
|
110
127
|
}
|
128
|
+
|
129
|
+
if ($parentSlides.length) {
|
130
|
+
$slide.removeData('rootIndex');
|
131
|
+
}
|
132
|
+
else if (!opts.countNested) {
|
133
|
+
$slide.data('rootIndex', rootCounter);
|
134
|
+
++rootCounter;
|
135
|
+
}
|
111
136
|
});
|
112
|
-
|
137
|
+
|
113
138
|
// Process form submittal, go to the slide entered
|
114
139
|
$(opts.selectors.gotoForm)
|
115
140
|
.unbind('submit.deckgoto')
|
116
141
|
.bind('submit.deckgoto', function(e) {
|
117
142
|
var $field = $($[deck]('getOptions').selectors.gotoInput),
|
118
|
-
|
119
|
-
|
120
|
-
|
143
|
+
ndx = parseInt($field.val(), 10);
|
144
|
+
|
145
|
+
if (!$[deck]('getOptions').countNested) {
|
146
|
+
if (ndx >= rootCounter) return false;
|
147
|
+
$.each($[deck]('getSlides'), function(i, $slide) {
|
148
|
+
if ($slide.data('rootIndex') === ndx) {
|
149
|
+
ndx = i + 1;
|
150
|
+
return false;
|
151
|
+
}
|
152
|
+
});
|
153
|
+
}
|
154
|
+
|
155
|
+
$[deck]('go', isNaN(ndx) ? $field.val() : ndx - 1);
|
121
156
|
$[deck]('hideGoTo');
|
122
157
|
$field.val('');
|
123
|
-
|
158
|
+
|
124
159
|
e.preventDefault();
|
125
160
|
});
|
126
|
-
|
161
|
+
|
162
|
+
// Dont let keys in the input trigger deck actions
|
127
163
|
$(opts.selectors.gotoInput)
|
128
164
|
.unbind('keydown.deckgoto')
|
129
165
|
.bind('keydown.deckgoto', function(e) {
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -17,11 +17,11 @@
|
|
17
17
|
padding: 0 0.5%;
|
18
18
|
}
|
19
19
|
.csstransforms .deck-menu > .slide {
|
20
|
-
-webkit-transform: scale(0.22);
|
21
|
-
-moz-transform: scale(0.22);
|
22
|
-
-o-transform: scale(0.22);
|
23
|
-
-ms-transform: scale(0.22);
|
24
|
-
transform: scale(0.22);
|
20
|
+
-webkit-transform: scale(0.22) !important;
|
21
|
+
-moz-transform: scale(0.22) !important;
|
22
|
+
-o-transform: scale(0.22) !important;
|
23
|
+
-ms-transform: scale(0.22) !important;
|
24
|
+
transform: scale(0.22) !important;
|
25
25
|
-webkit-transform-origin: 0 0;
|
26
26
|
-moz-transform-origin: 0 0;
|
27
27
|
-o-transform-origin: 0 0;
|
File without changes
|
@@ -21,11 +21,11 @@
|
|
21
21
|
}
|
22
22
|
|
23
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);
|
24
|
+
-webkit-transform:scale(.22) !important;
|
25
|
+
-moz-transform:scale(.22) !important;
|
26
|
+
-o-transform:scale(.22) !important;
|
27
|
+
-ms-transform:scale(.22) !important;
|
28
|
+
transform:scale(.22) !important;
|
29
29
|
-webkit-transform-origin:0 0;
|
30
30
|
-moz-transform-origin:0 0;
|
31
31
|
-o-transform-origin:0 0;
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,13 +1,22 @@
|
|
1
|
-
.csstransforms .deck-container.deck-scale
|
2
|
-
|
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;
|
1
|
+
.csstransforms .deck-container.deck-scale:not(.deck-menu) {
|
2
|
+
overflow: hidden;
|
8
3
|
}
|
9
|
-
.csstransforms .deck-container.deck-scale.deck-menu {
|
10
|
-
|
4
|
+
.csstransforms .deck-container.deck-scale:not(.deck-menu) > .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
|
+
.csstransforms .deck-container.deck-scale:not(.deck-menu) > .slide > .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
|
+
}
|
18
|
+
|
19
|
+
.csstransforms .deck-container.deck-menu .deck-slide-scaler {
|
11
20
|
-webkit-transform: none !important;
|
12
21
|
-moz-transform: none !important;
|
13
22
|
-o-transform: none !important;
|
@@ -1,20 +1,19 @@
|
|
1
1
|
/*!
|
2
2
|
Deck JS - deck.scale
|
3
|
-
Copyright (c) 2011 Caleb Troughton
|
3
|
+
Copyright (c) 2011-2012 Caleb Troughton
|
4
4
|
Dual licensed under the MIT license and GPL license.
|
5
5
|
https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
|
6
6
|
https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
|
7
7
|
*/
|
8
8
|
|
9
9
|
/*
|
10
|
-
This module adds automatic scaling to the deck.
|
11
|
-
|
12
|
-
|
13
|
-
is big enough to hold the slides without scaling, no scaling occurs. The user
|
10
|
+
This module adds automatic scaling to the deck. Slides are scaled down
|
11
|
+
using CSS transforms to fit within the deck container. If the container is
|
12
|
+
big enough to hold the slides without scaling, no scaling occurs. The user
|
14
13
|
can disable and enable scaling with a keyboard shortcut.
|
15
14
|
|
16
|
-
Note: CSS transforms make Flash videos render incorrectly. Presenters
|
17
|
-
need to use video
|
15
|
+
Note: CSS transforms may make Flash videos render incorrectly. Presenters
|
16
|
+
that need to use video may want to disable scaling to play them. HTML5 video
|
18
17
|
works fine.
|
19
18
|
*/
|
20
19
|
(function($, deck, window, undefined) {
|
@@ -22,44 +21,35 @@ works fine.
|
|
22
21
|
$w = $(window),
|
23
22
|
baseHeight, // Value to scale against
|
24
23
|
timer, // Timeout id for debouncing
|
24
|
+
rootSlides,
|
25
25
|
|
26
26
|
/*
|
27
|
-
Internal function to do all the dirty work of scaling the
|
27
|
+
Internal function to do all the dirty work of scaling the slides.
|
28
28
|
*/
|
29
29
|
scaleDeck = function() {
|
30
|
-
var
|
30
|
+
var opts = $[deck]('getOptions'),
|
31
|
+
obh = opts.baseHeight,
|
31
32
|
$container = $[deck]('getContainer'),
|
32
|
-
|
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 window height as base height if not set manually
|
43
|
-
baseHeight = obh ? obh : (function() {
|
44
|
-
var slop = 40; /* for padding */
|
45
|
-
var windowHeight = $(window).height();
|
46
|
-
return windowHeight - slop;
|
47
|
-
})();
|
48
|
-
}
|
33
|
+
baseHeight = obh ? obh : $container.height();
|
49
34
|
|
50
35
|
// Scale each slide down if necessary (but don't scale up)
|
51
|
-
$.each(
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
36
|
+
$.each(rootSlides, function(i, $slide) {
|
37
|
+
var slideHeight = $slide.innerHeight(),
|
38
|
+
$scaler = $slide.find('.' + opts.classes.scaleSlideWrapper),
|
39
|
+
scale = $container.hasClass(opts.classes.scale) ?
|
40
|
+
baseHeight / slideHeight :
|
41
|
+
1;
|
42
|
+
|
43
|
+
$.each('Webkit Moz O ms Khtml'.split(' '), function(i, prefix) {
|
44
|
+
if (scale === 1) {
|
45
|
+
$scaler.css(prefix + 'Transform', '');
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
$scaler.css(prefix + 'Transform', 'scale(' + scale + ')');
|
49
|
+
}
|
50
|
+
});
|
51
|
+
});
|
52
|
+
}
|
63
53
|
|
64
54
|
/*
|
65
55
|
Extends defaults/options.
|
@@ -68,14 +58,18 @@ works fine.
|
|
68
58
|
This class is added to the deck container when scaling is enabled.
|
69
59
|
It is enabled by default when the module is included.
|
70
60
|
|
61
|
+
options.classes.scaleSlideWrapper
|
62
|
+
Scaling is done using a wrapper around the contents of each slide. This
|
63
|
+
class is applied to that wrapper.
|
64
|
+
|
71
65
|
options.keys.scale
|
72
66
|
The numeric keycode used to toggle enabling and disabling scaling.
|
73
67
|
|
74
68
|
options.baseHeight
|
75
|
-
When
|
76
|
-
|
77
|
-
a height, and
|
78
|
-
of the
|
69
|
+
When baseHeight is falsy, as it is by default, the deck is scaled in
|
70
|
+
proportion to the height of the deck container. You may instead specify
|
71
|
+
a height as a number of px, and slides will be scaled against this
|
72
|
+
height regardless of the container size.
|
79
73
|
|
80
74
|
options.scaleDebounce
|
81
75
|
Scaling on the browser resize event is debounced. This number is the
|
@@ -85,7 +79,8 @@ works fine.
|
|
85
79
|
*/
|
86
80
|
$.extend(true, $[deck].defaults, {
|
87
81
|
classes: {
|
88
|
-
scale: 'deck-scale'
|
82
|
+
scale: 'deck-scale',
|
83
|
+
scaleSlideWrapper: 'deck-slide-scaler'
|
89
84
|
},
|
90
85
|
|
91
86
|
keys: {
|
@@ -128,10 +123,29 @@ works fine.
|
|
128
123
|
});
|
129
124
|
|
130
125
|
$d.bind('deck.init', function() {
|
131
|
-
var opts = $[deck]('getOptions')
|
126
|
+
var opts = $[deck]('getOptions'),
|
127
|
+
slideTest = $.map([
|
128
|
+
opts.classes.before,
|
129
|
+
opts.classes.previous,
|
130
|
+
opts.classes.current,
|
131
|
+
opts.classes.next,
|
132
|
+
opts.classes.after
|
133
|
+
], function(el, i) {
|
134
|
+
return '.' + el;
|
135
|
+
}).join(', ');
|
136
|
+
|
137
|
+
// Build top level slides array
|
138
|
+
rootSlides = [];
|
139
|
+
$.each($[deck]('getSlides'), function(i, $el) {
|
140
|
+
if (!$el.parentsUntil(opts.selectors.container, slideTest).length) {
|
141
|
+
rootSlides.push($el);
|
142
|
+
}
|
143
|
+
});
|
132
144
|
|
133
|
-
//
|
134
|
-
|
145
|
+
// Use a wrapper on each slide to handle content scaling
|
146
|
+
$.each(rootSlides, function(i, $slide) {
|
147
|
+
$slide.children().wrapAll('<div class="' + opts.classes.scaleSlideWrapper + '"/>');
|
148
|
+
});
|
135
149
|
|
136
150
|
// Debounce the resize scaling
|
137
151
|
$w.unbind('resize.deckscale').bind('resize.deckscale', function() {
|
@@ -149,8 +163,8 @@ works fine.
|
|
149
163
|
}
|
150
164
|
});
|
151
165
|
|
152
|
-
//
|
153
|
-
|
166
|
+
// Enable scale on init
|
167
|
+
$[deck]('enableScale');
|
154
168
|
});
|
155
169
|
})(jQuery, 'deck', this);
|
156
170
|
|