Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shower-core

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shower-core - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

15

package.json
{
"name": "shower-core",
"description": "Core for Shower HTML presentation engine",
"version": "1.1.0",
"version": "1.2.0",
"author": {

@@ -17,8 +17,3 @@ "name": "Vadim Makeev",

},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/shower/shower/wiki/MIT-License"
}
],
"license": "MIT",
"keywords": [

@@ -34,10 +29,10 @@ "shower",

"grunt-contrib-connect": "^0.11.2",
"grunt-contrib-uglify": "^0.9.2",
"grunt-contrib-uglify": "^0.11.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-jscs": "^2.1.0",
"grunt-jscs": "^2.4.0",
"load-grunt-tasks": "^3.3.0"
},
"scripts": {
"test": "node -e \"require('grunt').tasks(['test'])\""
"test": "grunt test"
}
}
/**
* Core for Shower HTML presentation engine
* shower-core v1.0.7, https://github.com/shower/core
* shower-core v1.1.0, https://github.com/shower/core
* @copyright 2010–2015 Vadim Makeev, http://pepelsbey.net
* @license MIT license: github.com/shower/shower/wiki/MIT-License
*/
window.shower&&window.shower.init||(window.shower=function(a,b,c){function d(a){a=a||{},this._storageKey="shower",this._store=this._loadFromStorage()||a}function e(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b])}var f,g={},h=a.location,i=a.console,j=b.title,k=[],l=[],m={FULL:"full",LIST:"list"};g.debugMode=!1,d.prototype={set:function(a,b){return this._store[a]=b,this._saveToStorage(),this},unset:function(a){return delete this._store[a],this._saveToStorage(),this},get:function(a,b){var c=this._store[a];return"undefined"!=typeof c?c:b},_saveToStorage:function(){a.sessionStorage.setItem(this._storageKey,JSON.stringify(this._store))},_loadFromStorage:function(){var b=a.sessionStorage.getItem(this._storageKey);return b&&JSON.parse(b)}},g.state=new d({mode:m.LIST}),e.prototype={getSlideNumber:function(){return this.number},isLast:function(){return g.slideList.length===this.number+1},isFinished:function(){return this.innerComplete>=this.innerLength},process:function(a){return this.timing?(this.initTimer(a),this):(this.next(a),this)},initTimer:function(a){var b=this;return b.timing?(b.stopTimer(),f=b.isFinished()?setInterval(function(){b.stopTimer(),a.next()},b.timing*(b.innerLength||1)):setInterval(function(){b.isFinished()?(b.stopTimer(),a.next()):b.next(a)},b.timing),this):!1},stopTimer:function(){return f&&(clearInterval(f),f=!1),this},prev:function(a){var c,d=this;return!d.hasInnerNavigation||d.isFinished()||0===d.innerComplete?(a.prev(),!1):(c=b.getElementById(d.id).querySelectorAll(".next.active"),!c||c.length<1?!1:(d.innerComplete>0?(d.innerComplete--,c[c.length-1].classList.remove("active")):a.prev(),this))},next:function(a){var c,d=this;return!d.hasInnerNavigation||d.isFinished()?(a.next(),!1):(d.isFinished()||(c=b.getElementById(d.id).querySelectorAll(".next:not(.active)"),c[0].classList.add("active"),d.innerComplete++),this)}},g._getData=function(a,b){return a.dataset?a.dataset[b]:a.getAttribute("data-"+b)},g.slideList=[],g.init=function(a,c){var d;g.debugMode&&(b.body.classList.add("debug"),i.log("Debug mode on")),a=a||".slide",c=c||"div.progress div";var f=b.createElement("section");f.className="live-region",f.setAttribute("role","region"),f.setAttribute("aria-live","assertive"),f.setAttribute("aria-relevant","additions"),f.setAttribute("aria-label","Slide Content: Auto-updating"),b.body.appendChild(f),k=b.querySelectorAll(a),l=b.querySelector(c);for(var h=0;h<k.length;h++)k[h].id||(k[h].id=h+1),d=g._getData(k[h],"timing"),d&&/^(\d{1,2}:)?\d{1,3}$/.test(d)?(-1!==d.indexOf(":")?(d=d.split(":"),d=1e3*(60*parseInt(d[0],10)+parseInt(d[1],10))):d=1e3*parseInt(d,10),0===d&&(d=!1)):d=!1,g.slideList.push(new e({id:k[h].id,number:h,hasInnerNavigation:null!==k[h].querySelector(".next"),timing:d,innerLength:k[h].querySelectorAll(".next").length,innerComplete:0}));return g},g.run=function(){var a=g.getCurrentSlideNumber(),c=b.body.classList.contains("full")||g.isSlideMode();c&&-1===a?g.go(0):-1===a&&""!==h.hash&&g.go(0),a>=0&&g.go(a),c&&g.enterSlideMode()},g._getTransform=function(){var c=Math.max(b.body.clientWidth/a.innerWidth,b.body.clientHeight/a.innerHeight);return"scale("+1/c+")"},g._applyTransform=function(a){return["WebkitTransform","MozTransform","msTransform","OTransform","transform"].forEach(function(c){b.body.style[c]=a}),!0},g._isNumber=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},g._normalizeSlideNumber=function(a){if(!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");return 0>a&&(a=0),a>=g.slideList.length&&(a=g.slideList.length-1),a},g._getSlideIdByEl=function(a){for(;"BODY"!==a.nodeName&&"HTML"!==a.nodeName;){if(a.classList.contains("slide"))return a.id;a=a.parentNode}return""},g._checkInteractiveElement=function(a){return"A"===a.target.nodeName},g.getSlideNumber=function(a){var b,c=g.slideList.length-1;for(""===a&&(b=0);c>=0;--c)if(a===g.slideList[c].id){b=c;break}return b},g.go=function(a,b){var c;if(!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");return g.slideList[a]?(h.hash=g.getSlideHash(a),g.updateProgress(a),g.updateActiveAndVisitedSlides(a),g.isSlideMode()&&(g.showPresenterNotes(a),c=g.slideList[a],c.timing&&c.initTimer(g)),"function"==typeof b&&b(),a):!1},g.next=function(a){var b=g.getCurrentSlideNumber(),c=g.slideList[b+1];return c?(g.go(b+1),"function"==typeof a&&a(),this):!1},g._turnNextSlide=function(a){var b=g.getCurrentSlideNumber(),c=g.slideList[b];g.isSlideMode()?(c.stopTimer(),c.next(g)):g.go(b+1),"function"==typeof a&&a()},g.prev=g.previous=function(a){var b=g.getCurrentSlideNumber();return 1>b?!1:(g.go(b-1),"function"==typeof a&&a(),!0)},g._turnPreviousSlide=function(a){var b=g.getCurrentSlideNumber(),c=g.slideList[b];return c.stopTimer(),g.isSlideMode()?c.prev(g):g.go(b-1),"function"==typeof a&&a(),!0},g.first=function(a){var b=g.slideList[g.getCurrentSlideNumber()];b&&b.timing&&b.stopTimer(),g.go(0),"function"==typeof a&&a()},g.last=function(a){var b=g.slideList[g.getCurrentSlideNumber()];b&&b.timing&&b.stopTimer(),g.go(g.slideList.length-1),"function"==typeof a&&a()},g.enterSlideMode=function(a){g.getCurrentSlideNumber();return g.state.set("mode",m.FULL),b.body.classList.remove("list"),b.body.classList.add("full"),g._applyTransform(g._getTransform()),"function"==typeof a&&a(),!0},g.enterListMode=function(a){var c;return b.body.classList.remove("full"),b.body.classList.add("list"),g.clearPresenterNotes(),g._applyTransform("none"),g.isListMode()?!1:(c=g.getCurrentSlideNumber(),g.state.set("mode",m.LIST),g.slideList[c].stopTimer(),g.scrollToSlide(c),"function"==typeof a&&a(),!0)},g.toggleMode=function(a){return g.isListMode()?g.enterSlideMode():g.enterListMode(),"function"==typeof a&&a(),!0},g.getCurrentSlideNumber=function(){var a=g.slideList.length-1,b=h.hash.substr(1);if(""===b)return-1;for(;a>=0;--a)if(b===g.slideList[a].id)return a;return-1},g.scrollToSlide=function(c){var d,e=!1;if(!g._isNumber(c))throw new Error("Gimme slide number as Number, baby!");if(g.isSlideMode())throw new Error("You can't scroll to because you in slide mode. Please, switch to list mode.");if(-1===c)return e;if(!g.slideList[c])throw new Error("There is no slide with number "+c);return d=b.getElementById(g.slideList[c].id),a.scrollTo(0,d.offsetTop),e=!0,e},g.isListMode=function(){return g.state.get("mode")===m.LIST},g.isSlideMode=function(){return g.state.get("mode")===m.FULL},g.updateProgress=function(a){if(null===l)return!1;if(!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");return progressVal=(100/(g.slideList.length-1)*g._normalizeSlideNumber(a)).toFixed(2)+"%",l.style.width=progressVal,l.setAttribute("role","progressbar"),l.setAttribute("aria-valuenow",progressVal),l.setAttribute("aria-valuemin","0"),l.setAttribute("aria-valuemax","100"),l.setAttribute("aria-valuetext","Slideshow Progress: "+progressVal),!0},g.updateActiveAndVisitedSlides=function(a){var c,d,e=g.slideList.length;if(a=g._normalizeSlideNumber(a),!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");for(c=0;e>c;++c)d=b.getElementById(g.slideList[c].id),a>c?(d.classList.remove("active"),d.classList.add("visited")):c>a?(d.classList.remove("visited"),d.classList.remove("active")):(d.classList.remove("visited"),d.classList.add("active"),b.querySelector(".live-region").innerHTML=d.innerHTML);return!0},g.clearPresenterNotes=function(){g.isSlideMode()&&i&&i.clear&&g.debugMode&&i.clear()},g.showPresenterNotes=function(a){if(g.clearPresenterNotes(),i&&g.debugMode){a=g._normalizeSlideNumber(a);var c=g.slideList[a].id,d=b.getElementById(c).querySelector("footer");d&&d.innerHTML&&i.info(d.innerHTML.replace(/\n\s+/g,"\n"));var e=g._getSlideTitle(a+1);e&&i.info("NEXT: "+e)}},g._getSlideTitle=function(a){if(!g.slideList[a])return"";var c=g.slideList[a].id,d=b.getElementById(c).querySelector("h2");return d?d.textContent.replace(/\s+/g," ").replace(/^\s+|\s+$/g,""):void 0},g._setTitle=function(){var a=g.getCurrentSlideNumber();g.isSlideMode();g._getSlideTitle(a)?b.title=g._getSlideTitle(a)+" — "+j:b.title=j},g.getSlideHash=function(a){if(!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");return a=g._normalizeSlideNumber(a),"#"+g.slideList[a].id};for(var n in a.shower)g[n]=a.shower[n];return a.addEventListener("popstate",function(){var a=g.getCurrentSlideNumber();g._setTitle(),-1!==a||!g.isSlideMode()&&""===h.hash||g.go(0)},!1),a.addEventListener("DOMContentLoaded",function(){g.init().run()},!1),a.addEventListener("resize",function(){g.isSlideMode()&&g._applyTransform(g._getTransform())},!1),b.addEventListener("keydown",function(a){var b,c=g.getCurrentSlideNumber(),d=g.slideList[-1!==c?c:0];switch(a.which){case 80:g.isListMode()&&a.altKey&&a.metaKey&&(a.preventDefault(),b=d.number,g.go(b),g.enterSlideMode(),g.showPresenterNotes(b),d.timing&&d.initTimer(g));break;case 116:a.preventDefault(),g.isListMode()?(b=a.shiftKey?d.number:0,g.go(b),g.enterSlideMode(),g.showPresenterNotes(b),d.timing&&d.initTimer(g)):g.enterListMode();break;case 13:g.isListMode()&&-1!==c&&(a.preventDefault(),g.enterSlideMode(),g.showPresenterNotes(c),d.timing&&d.initTimer(g));break;case 27:g.isSlideMode()&&(a.preventDefault(),g.enterListMode());break;case 33:case 38:case 37:case 72:case 75:if(a.altKey||a.ctrlKey||a.metaKey)return;a.preventDefault(),g._turnPreviousSlide();break;case 34:case 40:case 39:case 76:case 74:if(a.altKey||a.ctrlKey||a.metaKey)return;a.preventDefault(),g._turnNextSlide();break;case 36:a.preventDefault(),g.first();break;case 35:a.preventDefault(),g.last();break;case 9:case 32:if(a.altKey||a.ctrlKey||a.metaKey)return;a.preventDefault(),g[a.shiftKey?"_turnPreviousSlide":"_turnNextSlide"]()}},!1),b.addEventListener("click",function(a){var b,c,d=g._getSlideIdByEl(a.target);d&&g.isListMode()&&(b=g.getSlideNumber(d),g.go(b),g.enterSlideMode(),g.showPresenterNotes(b),c=g.slideList[b],c.timing&&c.initTimer(g))},!1),b.addEventListener("touchstart",function(b){var c,d,e,f=g._getSlideIdByEl(b.target);f&&(g.isSlideMode()&&!g._checkInteractiveElement(b)&&(e=b.touches[0].pageX,e>a.innerWidth/2?g._turnNextSlide():g._turnPreviousSlide()),g.isListMode()&&(c=g.getSlideNumber(f),g.go(c),g.enterSlideMode(),g.showPresenterNotes(c),d=g.slideList[c],d.timing&&d.initTimer(g)))},!1),b.addEventListener("touchmove",function(a){g.isSlideMode()&&a.preventDefault()},!1),g}(this,this.document));
window.shower&&window.shower.init||(window.shower=function(a,b,c){function d(a){a=a||{},this._storageKey="shower",this._store=this._loadFromStorage()||a}function e(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b])}var f,g={},h=a.location,i=a.console,j=b.title,k=[],l=[],m={FULL:"full",LIST:"list"};g.debugMode=!1,d.prototype={set:function(a,b){return this._store[a]=b,this._saveToStorage(),this},unset:function(a){return delete this._store[a],this._saveToStorage(),this},get:function(a,b){var c=this._store[a];return"undefined"!=typeof c?c:b},_saveToStorage:function(){a.sessionStorage.setItem(this._storageKey,JSON.stringify(this._store))},_loadFromStorage:function(){var b=a.sessionStorage.getItem(this._storageKey);return b&&JSON.parse(b)}},g.state=new d({mode:m.LIST}),e.prototype={getSlideNumber:function(){return this.number},isLast:function(){return g.slideList.length===this.number+1},isFinished:function(){return this.innerComplete>=this.innerLength},process:function(a){return this.timing?(this.initTimer(a),this):(this.next(a),this)},initTimer:function(a){var b=this;return b.timing?(b.stopTimer(),f=b.isFinished()?setInterval(function(){b.stopTimer(),a.next()},b.timing*(b.innerLength||1)):setInterval(function(){b.isFinished()?(b.stopTimer(),a.next()):b.next(a)},b.timing),this):!1},stopTimer:function(){return f&&(clearInterval(f),f=!1),this},prev:function(a){var c,d=this;return!d.hasInnerNavigation||d.isFinished()||0===d.innerComplete?(a.prev(),!1):(c=b.getElementById(d.id).querySelectorAll(".next.active"),!c||c.length<1?!1:(d.innerComplete>0?(d.innerComplete--,c[c.length-1].classList.remove("active")):a.prev(),this))},next:function(a){var c,d=this;return!d.hasInnerNavigation||d.isFinished()?(a.next(),!1):(d.isFinished()||(c=b.getElementById(d.id).querySelectorAll(".next:not(.active)"),c[0].classList.add("active"),d.innerComplete++),this)}},g._getData=function(a,b){return a.dataset?a.dataset[b]:a.getAttribute("data-"+b)},g.slideList=[],g.init=function(a,c){var d;g.debugMode&&(b.body.classList.add("debug"),i.log("Debug mode on")),a=a||".slide",c=c||".progress";var f=b.createElement("section");f.className="region",f.setAttribute("role","region"),f.setAttribute("aria-live","assertive"),f.setAttribute("aria-relevant","additions"),f.setAttribute("aria-label","Slide Content: Auto-updating"),b.body.appendChild(f),k=b.querySelectorAll(a),l=b.querySelector(c);for(var h=0;h<k.length;h++)k[h].id||(k[h].id=h+1),d=g._getData(k[h],"timing"),d&&/^(\d{1,2}:)?\d{1,3}$/.test(d)?(-1!==d.indexOf(":")?(d=d.split(":"),d=1e3*(60*parseInt(d[0],10)+parseInt(d[1],10))):d=1e3*parseInt(d,10),0===d&&(d=!1)):d=!1,g.slideList.push(new e({id:k[h].id,number:h,hasInnerNavigation:null!==k[h].querySelector(".next"),timing:d,innerLength:k[h].querySelectorAll(".next").length,innerComplete:0}));return g},g.run=function(){var a=g.getCurrentSlideNumber(),c=b.body.classList.contains("full")||g.isSlideMode();c&&-1===a?g.go(0):-1===a&&""!==h.hash&&g.go(0),a>=0&&g.go(a),c&&g.enterSlideMode()},g._getTransform=function(){var c=Math.max(b.body.clientWidth/a.innerWidth,b.body.clientHeight/a.innerHeight);return"scale("+1/c+")"},g._applyTransform=function(a){return["WebkitTransform","MozTransform","msTransform","OTransform","transform"].forEach(function(c){b.body.style[c]=a}),!0},g._isNumber=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},g._normalizeSlideNumber=function(a){if(!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");return 0>a&&(a=0),a>=g.slideList.length&&(a=g.slideList.length-1),a},g._getSlideIdByEl=function(a){for(;"BODY"!==a.nodeName&&"HTML"!==a.nodeName;){if(a.classList.contains("slide"))return a.id;a=a.parentNode}return""},g._checkInteractiveElement=function(a){return"A"===a.target.nodeName},g.getSlideNumber=function(a){var b,c=g.slideList.length-1;for(""===a&&(b=0);c>=0;--c)if(a===g.slideList[c].id){b=c;break}return b},g.go=function(a,b){var c;if(!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");return g.slideList[a]?(h.hash=g.getSlideHash(a),g.updateProgress(a),g.updateActiveAndVisitedSlides(a),g.isSlideMode()&&(g.showPresenterNotes(a),c=g.slideList[a],c.timing&&c.initTimer(g)),"function"==typeof b&&b(),a):!1},g.next=function(a){var b=g.getCurrentSlideNumber(),c=g.slideList[b+1];return c?(g.go(b+1),"function"==typeof a&&a(),this):!1},g._turnNextSlide=function(a){var b=g.getCurrentSlideNumber(),c=g.slideList[b];g.isSlideMode()?(c.stopTimer(),c.next(g)):g.go(b+1),"function"==typeof a&&a()},g.prev=g.previous=function(a){var b=g.getCurrentSlideNumber();return 1>b?!1:(g.go(b-1),"function"==typeof a&&a(),!0)},g._turnPreviousSlide=function(a){var b=g.getCurrentSlideNumber(),c=g.slideList[b];return c.stopTimer(),g.isSlideMode()?c.prev(g):g.go(b-1),"function"==typeof a&&a(),!0},g.first=function(a){var b=g.slideList[g.getCurrentSlideNumber()];b&&b.timing&&b.stopTimer(),g.go(0),"function"==typeof a&&a()},g.last=function(a){var b=g.slideList[g.getCurrentSlideNumber()];b&&b.timing&&b.stopTimer(),g.go(g.slideList.length-1),"function"==typeof a&&a()},g.enterSlideMode=function(a){g.getCurrentSlideNumber();return g.state.set("mode",m.FULL),b.body.classList.remove("list"),b.body.classList.add("full"),g._applyTransform(g._getTransform()),"function"==typeof a&&a(),!0},g.enterListMode=function(a){var c;return b.body.classList.remove("full"),b.body.classList.add("list"),g.clearPresenterNotes(),g._applyTransform("none"),g.isListMode()?!1:(c=g.getCurrentSlideNumber(),g.state.set("mode",m.LIST),g.slideList[c].stopTimer(),g.scrollToSlide(c),"function"==typeof a&&a(),!0)},g.toggleMode=function(a){return g.isListMode()?g.enterSlideMode():g.enterListMode(),"function"==typeof a&&a(),!0},g.getCurrentSlideNumber=function(){var a=g.slideList.length-1,b=h.hash.substr(1);if(""===b)return-1;for(;a>=0;--a)if(b===g.slideList[a].id)return a;return-1},g.scrollToSlide=function(c){var d,e=!1;if(!g._isNumber(c))throw new Error("Gimme slide number as Number, baby!");if(g.isSlideMode())throw new Error("You can't scroll to because you in slide mode. Please, switch to list mode.");if(-1===c)return e;if(!g.slideList[c])throw new Error("There is no slide with number "+c);return d=b.getElementById(g.slideList[c].id),a.scrollTo(0,d.offsetTop),e=!0,e},g.isListMode=function(){return g.state.get("mode")===m.LIST},g.isSlideMode=function(){return g.state.get("mode")===m.FULL},g.updateProgress=function(a){if(null===l)return!1;if(!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");return progressVal=(100/(g.slideList.length-1)*g._normalizeSlideNumber(a)).toFixed(2)+"%",l.style.width=progressVal,l.setAttribute("role","progressbar"),l.setAttribute("aria-valuenow",progressVal),l.setAttribute("aria-valuemin","0"),l.setAttribute("aria-valuemax","100"),l.setAttribute("aria-valuetext","Slideshow Progress: "+progressVal),!0},g.updateActiveAndVisitedSlides=function(a){var c,d,e=g.slideList.length;if(a=g._normalizeSlideNumber(a),!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");for(c=0;e>c;++c)d=b.getElementById(g.slideList[c].id),a>c?(d.classList.remove("active"),d.classList.add("visited")):c>a?(d.classList.remove("visited"),d.classList.remove("active")):(d.classList.remove("visited"),d.classList.add("active"),b.querySelector(".region").innerHTML=d.innerHTML);return!0},g.clearPresenterNotes=function(){g.isSlideMode()&&i&&i.clear&&g.debugMode&&i.clear()},g.showPresenterNotes=function(a){if(g.clearPresenterNotes(),i&&g.debugMode){a=g._normalizeSlideNumber(a);var c=g.slideList[a].id,d=b.getElementById(c).querySelector("footer");d&&d.innerHTML&&i.info(d.innerHTML.replace(/\n\s+/g,"\n"));var e=g._getSlideTitle(a+1);e&&i.info("NEXT: "+e)}},g._getSlideTitle=function(a){if(!g.slideList[a])return"";var c=g.slideList[a].id,d=b.getElementById(c).querySelector("h2");return d?d.textContent.replace(/\s+/g," ").replace(/^\s+|\s+$/g,""):void 0},g._setTitle=function(){var a=g.getCurrentSlideNumber();g.isSlideMode();g._getSlideTitle(a)?b.title=g._getSlideTitle(a)+" — "+j:b.title=j},g.getSlideHash=function(a){if(!g._isNumber(a))throw new Error("Gimme slide number as Number, baby!");return a=g._normalizeSlideNumber(a),"#"+g.slideList[a].id};for(var n in a.shower)g[n]=a.shower[n];return a.addEventListener("popstate",function(){var a=g.getCurrentSlideNumber();g._setTitle(),-1!==a||!g.isSlideMode()&&""===h.hash||g.go(0)},!1),a.addEventListener("DOMContentLoaded",function(){g.init().run()},!1),a.addEventListener("resize",function(){g.isSlideMode()&&g._applyTransform(g._getTransform())},!1),b.addEventListener("keydown",function(a){var b,c=g.getCurrentSlideNumber(),d=g.slideList[-1!==c?c:0];switch(a.which){case 80:g.isListMode()&&a.altKey&&a.metaKey&&(a.preventDefault(),b=d.number,g.go(b),g.enterSlideMode(),g.showPresenterNotes(b),d.timing&&d.initTimer(g));break;case 116:a.preventDefault(),g.isListMode()?(b=a.shiftKey?d.number:0,g.go(b),g.enterSlideMode(),g.showPresenterNotes(b),d.timing&&d.initTimer(g)):g.enterListMode();break;case 13:g.isListMode()&&-1!==c&&(a.preventDefault(),g.enterSlideMode(),g.showPresenterNotes(c),d.timing&&d.initTimer(g));break;case 27:g.isSlideMode()&&(a.preventDefault(),g.enterListMode());break;case 33:case 38:case 37:case 72:case 75:if(a.altKey||a.ctrlKey||a.metaKey)return;a.preventDefault(),g._turnPreviousSlide();break;case 34:case 40:case 39:case 76:case 74:if(a.altKey||a.ctrlKey||a.metaKey)return;a.preventDefault(),g._turnNextSlide();break;case 36:a.preventDefault(),g.first();break;case 35:a.preventDefault(),g.last();break;case 9:case 32:if(a.altKey||a.ctrlKey||a.metaKey)return;a.preventDefault(),g[a.shiftKey?"_turnPreviousSlide":"_turnNextSlide"]()}},!1),b.addEventListener("click",function(a){var b,c,d=g._getSlideIdByEl(a.target);d&&g.isListMode()&&(b=g.getSlideNumber(d),g.go(b),g.enterSlideMode(),g.showPresenterNotes(b),c=g.slideList[b],c.timing&&c.initTimer(g))},!1),b.addEventListener("touchstart",function(b){var c,d,e,f=g._getSlideIdByEl(b.target);f&&(g.isSlideMode()&&!g._checkInteractiveElement(b)&&(e=b.touches[0].pageX,e>a.innerWidth/2?g._turnNextSlide():g._turnPreviousSlide()),g.isListMode()&&(c=g.getSlideNumber(f),g.go(c),g.enterSlideMode(),g.showPresenterNotes(c),d=g.slideList[c],d.timing&&d.initTimer(g)))},!1),b.addEventListener("touchmove",function(a){g.isSlideMode()&&a.preventDefault()},!1),g}(this,this.document));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc