From 8cc34be19c43d5814b2aa09f5e57a08b13f541f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Emonet?= Date: Sat, 2 May 2015 00:05:14 +0200 Subject: [PATCH] fix #26: updated bundled deck.js, including the fix on browsercast this bundle is used also for browsecast-less presentations and thus browsercast should not unbind the space in this case and that's solved now --- css/deckjs-js/deckjs-custom.js | 65 ++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/css/deckjs-js/deckjs-custom.js b/css/deckjs-js/deckjs-custom.js index 41a0e5a..1ae9e00 100644 --- a/css/deckjs-js/deckjs-custom.js +++ b/css/deckjs-js/deckjs-custom.js @@ -1,6 +1,6 @@ /* This is a packed deck.js with some extensions and styles. - It has been generated from version d8c74bcc860ba175ab020fd69656abee3fc057f3 . + It has been generated from version 16322c026d0e5b6e9953e12362ca665d5d09304e . It includes: /home/twilight/projects/deck.browsercast.js-demo/tmpdeck/extensions/includedeck/load.js /home/twilight/projects/deck.browsercast.js-demo/tmpdeck//jquery.min.js @@ -297,7 +297,8 @@ function includedeck(m, c) { $(function() { var doIt = function() { cb.beforeInit(); - $.deck(conf); + window.defaultDeckCallIsAnError = true; + $.deck('init', conf); cb.afterInit(); cb.atExit(); }; @@ -638,11 +639,12 @@ that use the API provided by core. var setupHashBehaviors = function() { $fragmentLinks = $(); $.each(slides, function(i, $slide) { - var hash; + var hash, altHash; assignSlideId(i, $slide); hash = '#' + $slide.attr('id'); - if (hash === window.location.hash) { + altHash = '#/' + $slide.attr('id'); + if (hash === window.location.hash || altHash === window.location.hash) { setTimeout(function() { $.deck('go', i); }, 1); @@ -942,7 +944,12 @@ that use the API provided by core. return methods[method].apply(this, args); } else { - return methods.init(method, arg); + if (window.defaultDeckCallIsAnError) { + alert("'" + method + "' not found (or meant to be a parameter-less init)"); + } + else { + return methods.init(method, arg); + } } }; @@ -6504,7 +6511,9 @@ It also overrides the defaults keybinding and countNested value (so it is better // down arrow, nextTopLevel: [40], // key 'z' - nextEndOfTopLevel: [90] + nextEndOfTopLevel: [90], + // key 'a' + previousEndOfTopLevel: [65] }, countNested: false }); @@ -6573,6 +6582,14 @@ It also overrides the defaults keybinding and countNested value (so it is better $[deck]('go', icur-1); } }); + $[deck]('extend', 'previousEndOfTopLevelSlide', function() { + /* Find the current parent and take the previous slide (last of previous top level) */ + var current = $[deck]('getSlideIndex', $[deck]('getSlide')); + var currentParent = $[deck]('getToplevelSlideOfIndex', current).index; + if (currentParent > 0) { + $[deck]('go', currentParent - 1); + } + }); $d.bind('deck.init', function() { $d.unbind('keydown.decknexttoplevel').bind('keydown.decknexttoplevel', function(e) { var $opts = $[deck]('getOptions'); @@ -6598,6 +6615,14 @@ It also overrides the defaults keybinding and countNested value (so it is better $[deck]('previousTopLevelSlide'); } }); + $d.unbind('keydown.deckpreviousendoftoplevel').bind('keydown.deckpreviousendoftoplevel', function(e) { + var $opts = $[deck]('getOptions'); + var key = $opts.keys.previousEndOfTopLevel; + if (e.which === key || $.inArray(e.which, key) > -1) { + e.preventDefault(); + $[deck]('previousEndOfTopLevelSlide'); + } + }); }); // When jumping (not steping), we will init the subslides (in case they are animations), in a backward order, and then fast forward necessary animations var bigJump = function(from, to) { @@ -6740,16 +6765,16 @@ https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt fast: function(c) {c.all().animate({'opacity': 0.}, 0)} }); classical(o.selectors.animAddClass, { - init: function(c) {c.all().removeClass(c.classs())}, - undo: function(c) {c.all().removeClass(c.classs())}, - doit: function(c) {c.all().addClass(c.classs())}, - fast: function(c) {c.all().addClass(c.classs())} + init: function(c) {c.all().each(function() { this.classList.remove(c.classs()) })}, + undo: function(c) {c.all().each(function() { this.classList.remove(c.classs()) })}, + doit: function(c) {c.all().each(function() { this.classList.add(c.classs()) })}, + fast: function(c) {c.all().each(function() { this.classList.add(c.classs()) })} }); classical(o.selectors.animRemoveClass, { - init: function(c) {c.all().addClass(c.classs())}, - undo: function(c) {c.all().addClass(c.classs())}, - doit: function(c) {c.all().removeClass(c.classs())}, - fast: function(c) {c.all().removeClass(c.classs())} + init: function(c) {c.all().each(function() { this.classList.add(c.classs()) })}, + undo: function(c) {c.all().each(function() { this.classList.add(c.classs()) })}, + doit: function(c) {c.all().each(function() { this.classList.remove(c.classs()) })}, + fast: function(c) {c.all().each(function() { this.classList.remove(c.classs()) })} }); function svgRealAttrName(a) { if (startsWith(a, "svg")) { @@ -10237,7 +10262,8 @@ It also injects some default html for it if none is found (and styles it for the .append($('').attr('src', audioDataFile).attr('type', 'audio/'+ext))) .append($('').append($('