3 Copyright (c) 2012 Daniel Knittl-Frank
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
10 This module adds the methods and key binding to show a blank page instead of
11 the slides in the deck. The deck menu state is indicated by the presence of
12 a class on the deck container.
14 (function($, deck, undefined) {
18 Extends defaults/options.
21 These classes are added to the deck container when blanking the screen.
25 The numeric keycodes used to toggle between a blank screen and slides.
27 $.extend(true, $[deck].defaults, {
30 black: 'deck-blank-black',
31 white: 'deck-blank-white'
35 black: [66, 190], // b, .
41 jQuery.deck('toggleBlank', color)
43 Shows a blank page (either black or white), or unhides the slides,
46 $[deck]('extend', 'toggleBlank', function(color) {
47 var $c = $[deck]('getContainer'),
48 opts = $[deck]('getOptions');
50 if ($c.hasClass(opts.classes.blank))
51 $c.removeClass([opts.classes.blank, opts.classes.black, opts.classes.white].join(' '));
53 $c.addClass([opts.classes.blank, opts.classes[color]].join(' '));
56 $d.bind('deck.init', function() {
57 var opts = $[deck]('getOptions');
59 $d.unbind('keydown.deckblank').bind('keydown.deckblank', function(e) {
60 if (e.ctrlKey) return;
61 if (e.which === opts.keys.black || $.inArray(e.which, opts.keys.black) > -1) {
62 $[deck]('toggleBlank', 'black');
64 } else if (e.which === opts.keys.white || $.inArray(e.which, opts.keys.white) > -1) {
65 $[deck]('toggleBlank', 'white');