Commit 4c253743 authored by Slava Oliyanchik's avatar Slava Oliyanchik

Merge with upstream

parents 4de39ea3 de1d6fa5
[submodule "themes/ribbon"]
path = themes/ribbon
url = git@github.com:shower/ribbon.git
url = git://github.com/shower/ribbon.git
[submodule "themes/bright"]
path = themes/bright
url = git://github.com/shower/bright.git
The MIT License
# The MIT License
Copyright © 2010–2013 Vadim Makeev, http://pepelsbey.net/
......@@ -6,4 +6,16 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
# Лицензия MIT
Copyright © 2010–2013 Вадим Макеев, http://pepelsbey.net/
Данная лицензия разрешает лицам, получившим копию данного программного обеспечения и сопутствующей документации (в дальнейшем именуемыми «Программное Обеспечение»), безвозмездно использовать Программное Обеспечение без ограничений, включая неограниченное право на использование, копирование, изменение, добавление, публикацию, распространение, сублицензирование и/или продажу копий Программного Обеспечения, также как и лицам, которым предоставляется данное Программное Обеспечение, при соблюдении следующих условий:
Указанное выше уведомление об авторском праве и данные условия должны быть включены во все копии или значимые части данного Программного Обеспечения.
ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, ВКЛЮЧАЯ, НО НЕ ОГРАНИЧИВАЯСЬ ГАРАНТИЯМИ ТОВАРНОЙ ПРИГОДНОСТИ, СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И ОТСУТСТВИЯ НАРУШЕНИЙ ПРАВ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ ОТВЕТСТВЕННОСТИ ПО ИСКАМ О ВОЗМЕЩЕНИИ УЩЕРБА, УБЫТКОВ ИЛИ ДРУГИХ ТРЕБОВАНИЙ ПО ДЕЙСТВУЮЩИМ КОНТРАКТАМ, ДЕЛИКТАМ ИЛИ ИНОМУ, ВОЗНИКШИМ ИЗ, ИМЕЮЩИМ ПРИЧИНОЙ ИЛИ СВЯЗАННЫМ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ ИЛИ ИСПОЛЬЗОВАНИЕМ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫМИ ДЕЙСТВИЯМИ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ.
\ No newline at end of file
......@@ -9,17 +9,16 @@ To see Shower in action:
- Use arrow keys to navigate
- Press `Esc` to exit presentation mode
See more details on [using keyboard](shower/wiki/Shortcuts) to control Shower.
See more details on [using keyboard](https://github.com/shower/shower/wiki/Shortcuts) to control Shower.
## Using Shower
There are two ways of using Shower: you can get full template [ZIP 1.4 MB](http://shwr.me/template.zip) or just an engine [ZIP 650 KB](http://shwr.me/shower.zip). See more details for beginners and advanced techniques in [Quick Start](shower/wiki/Quick-Start) instructions.
There are two ways of using Shower: you can get full template [ZIP 1.7 MB](http://shwr.me/template.zip) or just an engine [ZIP 915 KB](http://shwr.me/shower.zip). See more details for beginners and advanced techniques in [Quick Start](https://github.com/shower/shower/wiki/Quick-Start) instructions.
## Printing to PDF
You can print your presentation to PDF using Google Chrome “Print to PDF” option in print dialog, [wkhtmltopdf](http://code.google.com/p/wkhtmltopdf) or [Prince](http://princexml.com). Print styles should be supplied to a theme for proper results. Please see [print styles](https://github.com/shower/ribbon/blob/master/styles/print.scss) for the Ribbon theme as example.
Example of Shower template printed by Prince: [PDF 435 KB](https://github.com/shower/template/blob/master/index.pdf?raw=true). See more detais on printing in [documentation](shower/wiki/Print).
You can print your presentation to PDF using Google Chrome “Print to PDF” option in print dialog or [wkhtmltopdf](http://code.google.com/p/wkhtmltopdf) or [Prince](http://princexml.com).
Example of Shower template printed by Prince: [PDF 435 KB](https://github.com/shower/template/blob/master/index.pdf?raw=true). See more detais on printing in [documentation](https://github.com/shower/shower/wiki/Print).
## Usage examples
......@@ -37,9 +36,9 @@ Supported desktop browsers: Chrome, Internet Explorer, Firefox, Opera, Safari. O
## Contributing
You're always welcome to contibute. Fork project, make changes and send it as pull request. But it's better to file an [issue](http://github.com/shower/shower/issues) with your idea first. Read [contributing rules](https://github.com/shower/shower/blob/master/Contributing.md) for more details.
You're always welcome to contibute. Fork project, make changes and send it as pull request. But it's better to file an [issue](https://github.com/shower/shower/issues) with your idea first. Read [contributing rules](https://github.com/shower/shower/blob/master/Contributing.md) for more details.
Main contributors: [pepelsbey](http://github.com/pepelsbey), [jahson](http://github.com/jahson), [miripiruni](http://github.com/miripiruni), [kizu](http://github.com/kizu).
Main contributors: [pepelsbey](https://github.com/pepelsbey), [jahson](https://github.com/jahson), [miripiruni](https://github.com/miripiruni), [kizu](https://github.com/kizu).
---
Licensed under [MIT License](http://en.wikipedia.org/wiki/MIT_License), see [license page](shower/wiki/MIT-License) for details.
\ No newline at end of file
Licensed under [MIT License](http://en.wikipedia.org/wiki/MIT_License), see [license page](https://github.com/shower/shower/wiki/MIT-License) for details.
\ No newline at end of file
......@@ -3,16 +3,14 @@
* @copyright 2010–2013 Vadim Makeev, pepelsbey.net
* @license MIT license: github.com/shower/shower/wiki/MIT-License
*/
window.shower = (function(window, document, undefined) {
window.shower = window.shower || (function(window, document, undefined) {
var shower = {},
url = window.location,
body = document.body,
slides = document.querySelectorAll('.slide'),
progress = document.querySelector('div.progress div'),
slides = [],
progress = [],
timer,
timing = 0,
isHistoryApiSupported = !!(window.history && history.pushState),
l = slides.length, i;
isHistoryApiSupported = !!(window.history && history.pushState);
function Slide(opts) {
......@@ -161,36 +159,55 @@ window.shower = (function(window, document, undefined) {
return element.dataset ? element.dataset[name] : element.getAttribute('data-' + name);
};
shower.slideList = [];
for (i = 0; i < l; i++) {
// Slide IDs are optional. In case of missing ID we set it to the
// slide number
if ( ! slides[i].id) {
slides[i].id = 'slide_' + (i + 1);
}
/**
* Shower initialization
* @param {String} [slideSelector]
* @param {String} [progressSelector]
* @returns {Object} shower
*/
shower.init = function(slideSelector, progressSelector) {
var timing;
slideSelector = slideSelector || '.slide';
progressSelector = progressSelector || 'div.progress div';
slides = document.querySelectorAll(slideSelector);
progress = document.querySelector(progressSelector);
for (var i = 0; i < slides.length; i++) {
// Slide IDs are optional. In case of missing ID we set it to the
// slide number
if ( ! slides[i].id) {
slides[i].id = i + 1;
}
timing = shower._getData(slides[i], 'timing');
timing = shower._getData(slides[i], 'timing');
if (timing && timing.indexOf(':') !== -1) {
timing = timing.split(':');
// Compute number of milliseconds from format "mm:ss"
timing = (parseInt(timing[0], 10) * 60 + parseInt(timing[1], 10)) * 1000;
if (timing && timing.indexOf(':') !== -1) {
timing = timing.split(':');
// Compute number of milliseconds from format "mm:ss"
timing = (parseInt(timing[0], 10) * 60 + parseInt(timing[1], 10)) * 1000;
if (slides[i].querySelector('.next')) {
timing = timing / (slides[i].querySelectorAll('.next').length + 1);
}
}
if (slides[i].querySelector('.next')) {
timing = timing / (slides[i].querySelectorAll('.next').length + 1);
}
}
shower.slideList.push(new Slide({
id : slides[i].id,
number : i,
hasInnerNavigation : null !== slides[i].querySelector('.next'),
timing : timing,
innerLength : slides[i].querySelectorAll('.next').length,
innerComplete : 0
}));
}
shower.slideList.push(new Slide({
id : slides[i].id,
number : i,
hasInnerNavigation : null !== slides[i].querySelector('.next'),
timing : timing,
innerLength : slides[i].querySelectorAll('.next').length,
innerComplete : 0
}));
}
return shower;
};
/**
* Get slide scale value.
......@@ -849,6 +866,8 @@ window.shower = (function(window, document, undefined) {
}
}, false);
shower.init();
document.addEventListener('click', function(e) {
var slideNumber = shower.getSlideNumber(shower._getSlideIdByEl(e.target)),
slide;
......
......@@ -3,4 +3,4 @@
* @copyright 2010–2013 Vadim Makeev, pepelsbey.net
* @license MIT license: github.com/shower/shower/wiki/MIT-License
*/
window.shower=function(e,t,r){var i={},n=e.location,s=t.body,o=t.querySelectorAll(".slide"),a=t.querySelector("div.progress div"),l=[],u,d=!!(e.history&&history.pushState),f=o.length,c;i._getData=function(e,t){return e.dataset?e.dataset[t]:e.getAttribute("data-"+t)};for(c=0;c<f;c++){if(!o[c].id){o[c].id=c+1}l.push({id:o[c].id,hasInnerNavigation:null!==o[c].querySelector(".next"),hasTiming:i._getData(o[c],"timing")&&i._getData(o[c],"timing").indexOf(":")!==-1})}i._getTransform=function(){var t=Math.max(s.clientWidth/e.innerWidth,s.clientHeight/e.innerHeight);return"scale("+1/t+")"};i._applyTransform=function(e){s.style.WebkitTransform=e;s.style.MozTransform=e;s.style.msTransform=e;s.style.OTransform=e;s.style.transform=e;return true};i._isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};i._normalizeSlideNumber=function(e){if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}if(e<0){e=0}if(e>=l.length){e=l.length-1}return e};i._getSlideIdByEl=function(e){while("BODY"!==e.nodeName&&"HTML"!==e.nodeName){if(e.classList.contains("slide")){return e.id}else{e=e.parentNode}}return""};i._checkInteractiveElement=function(e){return"A"===e.target.nodeName};i.getSlideNumber=function(e){var t=l.length-1,r;if(e===""){r=0}for(;t>=0;--t){if(e===l[t].id){r=t;break}}return r};i.go=function(e,t){if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}n.hash=i.getSlideHash(e);i.updateProgress(e);i.updateActiveAndVisitedSlides(e);if(i.isSlideMode()){i.showPresenterNotes(e);i.runInnerNavigation(e)}if(typeof t==="function"){t()}return e};i.next=function(e){var t=i.getCurrentSlideNumber(),r=false;if((-1===t||!l[t].hasInnerNavigation||!i.increaseInnerNavigation(t))&&t+2<=l.length){i.go(t+1);r=t+2}if(i.isSlideMode()){i.runInnerNavigation(t+1)}if(typeof e==="function"){e()}return r};i.previous=function(e){var t=i.getCurrentSlideNumber(),r=false;if(t>0){r=t;i.go(t-1);if(typeof e==="function"){e()}}return r};i.first=function(e){if(typeof e==="function"){e()}return i.go(0)};i.last=function(e){if(typeof e==="function"){e()}return i.go(l.length-1)};i.enterSlideMode=function(e){var t=i.getCurrentSlideNumber();s.classList.remove("list");s.classList.add("full");if(i.isListMode()&&d){history.pushState(null,null,n.pathname+"?full"+i.getSlideHash(t))}i._applyTransform(i._getTransform());if(typeof e==="function"){e()}return true};i.enterListMode=function(e){s.classList.remove("full");s.classList.add("list");i.clearPresenterNotes();if(i.isListMode()){return false}var t=i.getCurrentSlideNumber();clearTimeout(u);if(i.isSlideMode()&&d){history.pushState(null,null,n.pathname+i.getSlideHash(t))}i.scrollToSlide(t);i._applyTransform("none");if(typeof e==="function"){e()}return true};i.toggleMode=function(e){if(i.isListMode()){i.enterSlideMode()}else{i.enterListMode()}if(typeof e==="function"){e()}return true};i.getCurrentSlideNumber=function(){var e=l.length-1,t=n.hash.substr(1);for(;e>=0;--e){if(t===l[e].id){return e}}return-1};i.scrollToSlide=function(r){var n,s=false;if(!i._isNumber(r)){throw new Error("Gimme slide number as Number, baby!")}if(i.isSlideMode()){throw new Error("You can't scroll to because you in slide mode. Please, switch to list mode.")}if(-1===r){return s}if(l[r]){n=t.getElementById(l[r].id);e.scrollTo(0,n.offsetTop);s=true}else{throw new Error("There is no slide with number "+r)}return s};i.isListMode=function(){return d?!/^full.*/.test(n.search.substr(1)):s.classList.contains("list")};i.isSlideMode=function(){return d?/^full.*/.test(n.search.substr(1)):s.classList.contains("full")};i.updateProgress=function(e){if(null===a){return false}if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}a.style.width=(100/(l.length-1)*i._normalizeSlideNumber(e)).toFixed(2)+"%";return true};i.updateActiveAndVisitedSlides=function(e){var r,n,s=l.length;e=i._normalizeSlideNumber(e);if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}for(r=0;r<s;++r){n=t.getElementById(l[r].id);if(r<e){n.classList.remove("active");n.classList.add("visited")}else if(r>e){n.classList.remove("visited");n.classList.remove("active")}else{n.classList.remove("visited");n.classList.add("active")}}return true};i.clearPresenterNotes=function(){if(e.console&&e.console.clear){console.clear()}};i.showPresenterNotes=function(r){i.clearPresenterNotes();if(e.console){r=i._normalizeSlideNumber(r);var n=l[r].id,s=l[r+1]?l[r+1].id:null,o=t.getElementById(n).querySelector("footer");if(o&&o.innerHTML){console.info(o.innerHTML.replace(/\n\s+/g,"\n"))}if(s){var a=t.getElementById(s).querySelector("h2");if(a){a=a.innerHTML.replace(/^\s+|<[^>]+>/g,"");console.info("NEXT: "+a)}}}};i.getSlideHash=function(e){if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}e=i._normalizeSlideNumber(e);return"#"+l[e].id};i.runInnerNavigation=function(e){if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}e=i._normalizeSlideNumber(e);clearTimeout(u);if(l[e].hasTiming){var r=i._getData(t.getElementById(l[e].id),"timing").split(":");r=parseInt(r[0],10)*60*1e3+parseInt(r[1],10)*1e3;u=setTimeout(function(){i.next()},r)}return true};i.increaseInnerNavigation=function(e){var r,n;if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}if(l[e].hasInnerNavigation){r=t.getElementById(l[e].id).querySelectorAll(".next:not(.active)");if(0!==r.length){n=r[0];n.classList.add("active");return true}}return false};e.addEventListener("DOMContentLoaded",function(){if(s.classList.contains("full")||i.isSlideMode()){i.go(i.getCurrentSlideNumber());i.enterSlideMode()}},false);e.addEventListener("popstate",function(){if(i.isListMode()){i.enterListMode()}else{i.enterSlideMode()}},false);e.addEventListener("resize",function(){if(i.isSlideMode()){i._applyTransform(i._getTransform())}},false);t.addEventListener("keydown",function(e){if(e.altKey||e.ctrlKey||e.metaKey){return}var t=i.getCurrentSlideNumber(),r=true;switch(e.which){case 116:e.preventDefault();if(i.isListMode()){var n=e.shiftKey?t:0;i.go(n);i.enterSlideMode();i.showPresenterNotes(n)}else{i.enterListMode()}break;case 13:if(i.isListMode()&&-1!==t){e.preventDefault();i.enterSlideMode()}break;case 27:if(i.isSlideMode()){e.preventDefault();i.enterListMode()}break;case 33:case 38:case 37:case 72:case 75:e.preventDefault();i.previous();break;case 34:case 40:case 39:case 76:case 74:e.preventDefault();i.next();break;case 36:e.preventDefault();i.first();break;case 35:e.preventDefault();i.last();break;case 9:case 32:e.preventDefault();i[e.shiftKey?"previous":"next"]();break;default:}},false);t.addEventListener("click",function(e){var t=i.getSlideNumber(i._getSlideIdByEl(e.target));if(i.isListMode()&&i._getSlideIdByEl(e.target)){i.go(t);i.enterSlideMode();i.showPresenterNotes(t)}},false);t.addEventListener("touchstart",function(t){if(i._getSlideIdByEl(t.target)){if(i.isSlideMode()&&!i._checkInteractiveElement(t)){var r=t.touches[0].pageX;if(r>e.innerWidth/2){i.next()}else{i.previous()}}if(i.isListMode()){i.go(i.getSlideNumber(i._getSlideIdByEl(t.target)));i.enterSlideMode()}}},false);t.addEventListener("touchmove",function(e){if(i.isSlideMode()){e.preventDefault()}},false);return i}(this,this.document);
\ No newline at end of file
window.shower=window.shower||function(e,t,r){var i={},n=e.location,s=t.body,o=[],a=[],l=[],u,d=!!(e.history&&history.pushState);i._getData=function(e,t){return e.dataset?e.dataset[t]:e.getAttribute("data-"+t)};i.init=function(e,r){e=e||".slide";r=r||"div.progress div";o=t.querySelectorAll(e);a=t.querySelector(r);l=[];for(var n=0;n<o.length;n++){if(!o[n].id){o[n].id=n+1}l.push({id:o[n].id,hasInnerNavigation:null!==o[n].querySelector(".next"),hasTiming:i._getData(o[n],"timing")&&i._getData(o[n],"timing").indexOf(":")!==-1})}return i};i._getTransform=function(){var t=Math.max(s.clientWidth/e.innerWidth,s.clientHeight/e.innerHeight);return"scale("+1/t+")"};i._applyTransform=function(e){s.style.WebkitTransform=e;s.style.MozTransform=e;s.style.msTransform=e;s.style.OTransform=e;s.style.transform=e;return true};i._isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};i._normalizeSlideNumber=function(e){if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}if(e<0){e=0}if(e>=l.length){e=l.length-1}return e};i._getSlideIdByEl=function(e){while("BODY"!==e.nodeName&&"HTML"!==e.nodeName){if(e.classList.contains("slide")){return e.id}else{e=e.parentNode}}return""};i._checkInteractiveElement=function(e){return"A"===e.target.nodeName};i.getSlideNumber=function(e){var t=l.length-1,r;if(e===""){r=0}for(;t>=0;--t){if(e===l[t].id){r=t;break}}return r};i.go=function(e,t){if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}n.hash=i.getSlideHash(e);i.updateProgress(e);i.updateActiveAndVisitedSlides(e);if(i.isSlideMode()){i.showPresenterNotes(e);i.runInnerNavigation(e)}if(typeof t==="function"){t()}return e};i.next=function(e){var t=i.getCurrentSlideNumber(),r=false;if((-1===t||!l[t].hasInnerNavigation||!i.increaseInnerNavigation(t))&&t+2<=l.length){i.go(t+1);r=t+2}if(i.isSlideMode()){i.runInnerNavigation(t+1)}if(typeof e==="function"){e()}return r};i.previous=function(e){var t=i.getCurrentSlideNumber(),r=false;if(t>0){r=t;i.go(t-1);if(typeof e==="function"){e()}}return r};i.first=function(e){if(typeof e==="function"){e()}return i.go(0)};i.last=function(e){if(typeof e==="function"){e()}return i.go(l.length-1)};i.enterSlideMode=function(e){var t=i.getCurrentSlideNumber();s.classList.remove("list");s.classList.add("full");if(i.isListMode()&&d){history.pushState(null,null,n.pathname+"?full"+i.getSlideHash(t))}i._applyTransform(i._getTransform());if(typeof e==="function"){e()}return true};i.enterListMode=function(e){s.classList.remove("full");s.classList.add("list");i.clearPresenterNotes();if(i.isListMode()){return false}var t=i.getCurrentSlideNumber();clearTimeout(u);if(i.isSlideMode()&&d){history.pushState(null,null,n.pathname+i.getSlideHash(t))}i.scrollToSlide(t);i._applyTransform("none");if(typeof e==="function"){e()}return true};i.toggleMode=function(e){if(i.isListMode()){i.enterSlideMode()}else{i.enterListMode()}if(typeof e==="function"){e()}return true};i.getCurrentSlideNumber=function(){var e=l.length-1,t=n.hash.substr(1);for(;e>=0;--e){if(t===l[e].id){return e}}return-1};i.scrollToSlide=function(r){var n,s=false;if(!i._isNumber(r)){throw new Error("Gimme slide number as Number, baby!")}if(i.isSlideMode()){throw new Error("You can't scroll to because you in slide mode. Please, switch to list mode.")}if(-1===r){return s}if(l[r]){n=t.getElementById(l[r].id);e.scrollTo(0,n.offsetTop);s=true}else{throw new Error("There is no slide with number "+r)}return s};i.isListMode=function(){return d?!/^full.*/.test(n.search.substr(1)):s.classList.contains("list")};i.isSlideMode=function(){return d?/^full.*/.test(n.search.substr(1)):s.classList.contains("full")};i.updateProgress=function(e){if(null===a){return false}if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}a.style.width=(100/(l.length-1)*i._normalizeSlideNumber(e)).toFixed(2)+"%";return true};i.updateActiveAndVisitedSlides=function(e){var r,n,s=l.length;e=i._normalizeSlideNumber(e);if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}for(r=0;r<s;++r){n=t.getElementById(l[r].id);if(r<e){n.classList.remove("active");n.classList.add("visited")}else if(r>e){n.classList.remove("visited");n.classList.remove("active")}else{n.classList.remove("visited");n.classList.add("active")}}return true};i.clearPresenterNotes=function(){if(e.console&&e.console.clear){console.clear()}};i.showPresenterNotes=function(r){i.clearPresenterNotes();if(e.console){r=i._normalizeSlideNumber(r);var n=l[r].id,s=l[r+1]?l[r+1].id:null,o=t.getElementById(n).querySelector("footer");if(o&&o.innerHTML){console.info(o.innerHTML.replace(/\n\s+/g,"\n"))}if(s){var a=t.getElementById(s).querySelector("h2");if(a){a=a.innerHTML.replace(/^\s+|<[^>]+>/g,"");console.info("NEXT: "+a)}}}};i.getSlideHash=function(e){if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}e=i._normalizeSlideNumber(e);return"#"+l[e].id};i.runInnerNavigation=function(e){if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}e=i._normalizeSlideNumber(e);clearTimeout(u);if(l[e].hasTiming){var r=i._getData(t.getElementById(l[e].id),"timing").split(":");r=parseInt(r[0],10)*60*1e3+parseInt(r[1],10)*1e3;u=setTimeout(function(){i.next()},r)}return true};i.increaseInnerNavigation=function(e){var r,n;if(!i._isNumber(e)){throw new Error("Gimme slide number as Number, baby!")}if(l[e].hasInnerNavigation){r=t.getElementById(l[e].id).querySelectorAll(".next:not(.active)");if(0!==r.length){n=r[0];n.classList.add("active");return true}}return false};e.addEventListener("DOMContentLoaded",function(){if(s.classList.contains("full")||i.isSlideMode()){i.go(i.getCurrentSlideNumber());i.enterSlideMode()}},false);e.addEventListener("popstate",function(){if(i.isListMode()){i.enterListMode()}else{i.enterSlideMode()}},false);e.addEventListener("resize",function(){if(i.isSlideMode()){i._applyTransform(i._getTransform())}},false);t.addEventListener("keydown",function(e){if(e.altKey||e.ctrlKey||e.metaKey){return}var t=i.getCurrentSlideNumber(),r=true;switch(e.which){case 116:e.preventDefault();if(i.isListMode()){var n=e.shiftKey?t:0;i.go(n);i.enterSlideMode();i.showPresenterNotes(n)}else{i.enterListMode()}break;case 13:if(i.isListMode()&&-1!==t){e.preventDefault();i.enterSlideMode();i.showPresenterNotes(t);i.runInnerNavigation(t)}break;case 27:if(i.isSlideMode()){e.preventDefault();i.enterListMode()}break;case 33:case 38:case 37:case 72:case 75:e.preventDefault();i.previous();break;case 34:case 40:case 39:case 76:case 74:e.preventDefault();i.next();break;case 36:e.preventDefault();i.first();break;case 35:e.preventDefault();i.last();break;case 9:case 32:e.preventDefault();i[e.shiftKey?"previous":"next"]();break;default:}},false);i.init();t.addEventListener("click",function(e){var t=i.getSlideNumber(i._getSlideIdByEl(e.target));if(i.isListMode()&&i._getSlideIdByEl(e.target)){i.go(t);i.enterSlideMode();i.showPresenterNotes(t)}},false);t.addEventListener("touchstart",function(t){if(i._getSlideIdByEl(t.target)){if(i.isSlideMode()&&!i._checkInteractiveElement(t)){var r=t.touches[0].pageX;if(r>e.innerWidth/2){i.next()}else{i.previous()}}if(i.isListMode()){i.go(i.getSlideNumber(i._getSlideIdByEl(t.target)));i.enterSlideMode()}}},false);t.addEventListener("touchmove",function(e){if(i.isSlideMode()){e.preventDefault()}},false);return i}(this,this.document);
\ No newline at end of file
Subproject commit 7846bbef1debed0aa42b4b415e699ebb93e779d7
Subproject commit 41e17a628fd092271fded46304e6c009bc0ba1e0
Subproject commit e1a38b6cc6079bfd1f94f6db4b7904fb2276d538
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment