bmstu-mt-wp/shower.js

725 lines
17 KiB
JavaScript
Raw Normal View History

2013-01-20 01:13:21 +04:00
/**
* Shower HTML presentation engine: github.com/shower/shower
* @copyright 20102013 Vadim Makeev, pepelsbey.net
* @license MIT license: github.com/shower/shower/wiki/MIT-License
*/
2012-12-01 13:47:28 +04:00
window.shower = (function(window, document, undefined) {
var shower = {},
url = window.location,
body = document.body,
2012-12-01 13:47:28 +04:00
slides = document.querySelectorAll('.slide'),
2010-11-15 16:45:40 +03:00
progress = document.querySelector('div.progress div'),
2011-07-20 22:08:31 +04:00
slideList = [],
2012-12-01 13:47:28 +04:00
timer,
isHistoryApiSupported = !!(window.history && history.pushState),
l = slides.length, i;
2010-10-30 04:16:19 +04:00
2012-12-01 13:47:28 +04:00
/**
* Get value at named data store for the DOM element.
* @private
2013-01-20 03:40:59 +04:00
* @param {HTMLElement} element
* @param {String} name
* @returns {String}
2012-12-01 13:47:28 +04:00
*/
shower._getData = function(element, name) {
return element.dataset ? element.dataset[name] : element.getAttribute('data-' + name);
2012-12-30 15:54:16 +04:00
};
2012-12-01 13:47:28 +04:00
2011-07-20 22:08:31 +04:00
for (i = 0; i < l; i++) {
2013-01-20 01:13:21 +04:00
// Slide IDs are optional. In case of missing ID we set it to the
2012-12-01 13:47:28 +04:00
// slide number
if ( ! slides[i].id) {
slides[i].id = i + 1;
}
slideList.push({
id: slides[i].id,
2012-12-01 13:47:28 +04:00
hasInnerNavigation: null !== slides[i].querySelector('.next'),
hasTiming: (shower._getData(slides[i], 'timing') && shower._getData(slides[i], 'timing').indexOf(':') !== -1)
});
}
2011-07-16 05:13:35 +04:00
2012-12-01 13:47:28 +04:00
/**
* Get slide scale value
* @private
* @returns {String}
*/
shower._getTransform = function() {
2011-07-20 22:08:31 +04:00
var denominator = Math.max(
body.clientWidth / window.innerWidth,
body.clientHeight / window.innerHeight
);
return 'scale(' + (1 / denominator) + ')';
2012-12-01 13:47:28 +04:00
};
/**
* Set CSS transform with prefixes to body
* @private
* @returns {Boolean}
2012-12-01 13:47:28 +04:00
*/
shower._applyTransform = function(transform) {
2011-07-12 15:08:29 +04:00
body.style.WebkitTransform = transform;
2011-12-12 21:13:08 +04:00
body.style.MozTransform = transform;
2011-07-12 15:08:29 +04:00
body.style.msTransform = transform;
2011-12-12 21:13:08 +04:00
body.style.OTransform = transform;
2011-07-12 15:08:29 +04:00
body.style.transform = transform;
2011-07-12 15:18:02 +04:00
2012-12-01 13:47:28 +04:00
return true;
};
/**
* Check if arg is number.
* @private
* @param {String|Number} arg
* @returns {Boolean}
*/
shower._isNumber = function(arg) {
2013-01-20 03:15:29 +04:00
return ! isNaN(parseFloat(arg)) && isFinite(arg);
};
/**
* Normalize slide number.
* @private
* @param {Number} slideNumber slide number (sic!)
* @returns {Number}
*/
shower._normalizeSlideNumber = function(slideNumber) {
if ( ! shower._isNumber(slideNumber)) {
throw new Error('Gimme slide number as Number, baby!');
}
if (slideNumber < 0) {
slideNumber = 0;
}
if (slideNumber >= slideList.length) {
slideNumber = slideList.length - 1;
}
return slideNumber;
};
/**
* Get slide id from HTML element.
* @private
2013-01-20 03:40:59 +04:00
* @param {HTMLElement} el
* @returns {String}
*/
shower._getSlideIdByEl = function(el) {
while ('BODY' !== el.nodeName && 'HTML' !== el.nodeName) {
if (el.classList.contains('slide')) {
return el.id;
} else {
el = el.parentNode;
}
}
return '';
};
/**
* For touch devices: check if click on links...
*
* @TODO: add support for textareas/inputs/...
*
* @private
2013-01-20 03:40:59 +04:00
* @param {HTMLElement} e
* @returns {Boolean}
*/
shower._checkInteractiveElement = function(e) {
return 'A' === e.target.nodeName;
};
/**
* Get slide number by slideId
* @param {String} slideId (HTML id or position in slideList)
* @returns {Number}
*/
shower.getSlideNumber = function(slideId) {
var i = slideList.length - 1,
slideNumber;
if (slideId === '') {
2013-01-20 01:13:21 +04:00
slideNumber = 0;
}
2013-01-20 01:13:21 +04:00
// As fast as you can ;-)
// http://jsperf.com/for-vs-foreach/46
for (; i >= 0; --i) {
if (slideId === slideList[i].id) {
slideNumber = i;
break;
}
}
return slideNumber;
};
2012-12-01 13:47:28 +04:00
/**
* Show next slide. If slide is last returns false, otherwise return slide
* number which been shown.
2013-01-20 03:24:58 +04:00
* @param {Function} [callback] runs only if shower.next() complete successfully
* @returns {Number|Boolean}
2012-12-01 13:47:28 +04:00
*/
shower.next = function(callback) {
2012-12-01 13:47:28 +04:00
var currentSlideNumber = shower.getCurrentSlideNumber(),
ret = false;
// Only go to next slide if current slide have no inner
// navigation or inner navigation is fully shown
// NOTE: But first of all check if there is no current slide
if (
-1 === currentSlideNumber ||
!slideList[currentSlideNumber].hasInnerNavigation ||
2012-12-01 13:47:28 +04:00
-1 === shower.increaseInnerNavigation(currentSlideNumber)
) {
2012-12-01 13:47:28 +04:00
shower.go(currentSlideNumber + 1);
// slides starts from 0
ret = currentSlideNumber + 2;
2013-01-20 01:13:21 +04:00
if (typeof(callback) === 'function') {
callback();
}
}
2012-12-01 13:47:28 +04:00
return ret;
};
/**
* Show previous slide. If slide is first returns false, otherwise return slide
* number which been shown.
2013-01-20 03:24:58 +04:00
* @param {Function} [callback] runs only if shower.previous() complete successfully
* @returns {Number|Boolean}
2012-12-01 13:47:28 +04:00
*/
shower.previous = function(callback) {
2012-12-01 13:47:28 +04:00
var currentSlideNumber = shower.getCurrentSlideNumber(),
ret = false;
2012-12-01 13:47:28 +04:00
// slides starts from 0
if (currentSlideNumber > 0) {
ret = currentSlideNumber;
shower.go(currentSlideNumber - 1);
2013-01-20 01:13:21 +04:00
if (typeof(callback) === 'function') {
callback();
}
2012-12-01 13:47:28 +04:00
}
2011-07-20 22:08:31 +04:00
2012-12-01 13:47:28 +04:00
return ret;
};
/**
* Show first slide.
2013-01-20 03:24:58 +04:00
* @param {Function} [callback]
* @returns {Number}
2012-12-01 13:47:28 +04:00
*/
shower.first = function(callback) {
2013-01-20 01:13:21 +04:00
if (typeof(callback) === 'function') {
callback();
}
2012-12-01 13:47:28 +04:00
return shower.go(0);
};
/**
* Show last slide.
2013-01-20 03:24:58 +04:00
* @param {Function} [callback]
* @returns {Number}
2012-12-01 13:47:28 +04:00
*/
shower.last = function(callback) {
2013-01-20 01:13:21 +04:00
if (typeof(callback) === 'function') {
callback();
}
2012-12-01 13:47:28 +04:00
return shower.go(slideList.length - 1);
};
/**
* Switch to slide view.
2013-01-20 03:24:58 +04:00
* @param {Function} [callback] runs only if shower.enterSlideMode() complete successfully
* @returns {Boolean}
2012-12-01 13:47:28 +04:00
*/
shower.enterSlideMode = function(callback) {
var currentSlideNumber = shower.getCurrentSlideNumber();
if (currentSlideNumber === -1) {
currentSlideNumber = 0;
}
shower.go(currentSlideNumber);
shower.showPresenterNotes(currentSlideNumber);
if (shower.isListMode() && isHistoryApiSupported) {
history.pushState(null, null, url.pathname + '?full' + shower.getSlideHash(currentSlideNumber));
}
2012-12-30 15:54:16 +04:00
2012-12-01 13:47:28 +04:00
body.classList.remove('list');
body.classList.add('full');
2012-12-30 15:54:16 +04:00
if (window.console && window.console.clear) {
console.clear();
}
shower.updateProgress(currentSlideNumber);
shower.updateCurrentAndPassedSlides(currentSlideNumber);
shower.runInnerNavigation(currentSlideNumber);
2012-12-30 15:54:16 +04:00
2013-01-20 01:13:21 +04:00
if (typeof(callback) === 'function') {
callback();
}
2012-12-01 13:47:28 +04:00
return shower._applyTransform(shower._getTransform());
};
/**
* Switch to list view.
2013-01-20 03:24:58 +04:00
* @param {Function} [callback] runs only if shower.enterListMode() complete successfully
* @returns {Boolean}
2012-12-01 13:47:28 +04:00
*/
shower.enterListMode = function(callback) {
var currentSlideNumber = shower.getCurrentSlideNumber();
2012-12-30 15:54:16 +04:00
2012-12-01 13:47:28 +04:00
body.classList.remove('full');
body.classList.add('list');
if (shower.isSlideMode() && isHistoryApiSupported) {
history.pushState(null, null, url.pathname + shower.getSlideHash(currentSlideNumber));
}
shower.scrollToSlide(currentSlideNumber);
2013-01-20 01:13:21 +04:00
if (typeof(callback) === 'function') {
callback();
}
2012-12-01 13:47:28 +04:00
return shower._applyTransform('none');
};
/**
* Toggle Mode: Slide and List
2013-01-20 03:24:58 +04:00
* @param {Function} [callback]
*/
shower.toggleMode = function(callback) {
if (shower.isListMode()) {
shower.enterSlideMode();
} else {
shower.enterListMode();
}
2013-01-20 01:13:21 +04:00
if (typeof(callback) === 'function') {
callback();
}
return true;
};
2012-12-01 13:47:28 +04:00
/**
* Get current slide number. Starts from zero. Warning: when in url you have
* slide number 1 this method will return 0.
* If something wrong return -1.
* @returns {Number}
2012-12-01 13:47:28 +04:00
*/
shower.getCurrentSlideNumber = function() {
var i = slideList.length - 1,
currentSlideId = url.hash.substr(1);
2012-12-01 13:47:28 +04:00
// As fast as you can ;-)
// http://jsperf.com/for-vs-foreach/46
for (; i >= 0; --i) {
if (currentSlideId === slideList[i].id) {
return i;
}
}
return -1;
2012-12-01 13:47:28 +04:00
};
/**
* Scroll to slide.
* @param {Number} slideNumber slide number (sic!)
* @returns {Boolean}
2012-12-01 13:47:28 +04:00
*/
shower.scrollToSlide = function(slideNumber) {
var currentSlide,
ret = false;
2011-07-20 22:08:31 +04:00
2013-01-18 15:34:02 +04:00
if ( ! shower._isNumber(slideNumber)) {
throw new Error('Gimme slide number as Number, baby!');
2011-07-20 22:08:31 +04:00
}
2011-07-16 05:13:35 +04:00
if (shower.isSlideMode()) {
throw new Error('You can\'t scroll to because you in slide mode. Please, switch to list mode.');
2012-12-01 13:47:28 +04:00
}
// @TODO: WTF?
if (-1 === slideNumber) {
return ret;
2012-12-01 13:47:28 +04:00
}
2011-07-12 15:08:29 +04:00
2012-12-01 13:47:28 +04:00
if (slideList[slideNumber]) {
currentSlide = document.getElementById(slideList[slideNumber].id);
window.scrollTo(0, currentSlide.offsetTop);
ret = true;
2011-07-20 22:08:31 +04:00
} else {
2012-12-01 13:47:28 +04:00
throw new Error('There is no slide with number ' + slideNumber);
2011-07-20 22:08:31 +04:00
}
2012-12-01 13:47:28 +04:00
return ret;
};
/**
* Check if it's List mode.
* @returns {Boolean}
2012-12-01 13:47:28 +04:00
*/
shower.isListMode = function() {
return isHistoryApiSupported ? ! /^full.*/.test(url.search.substr(1)) : body.classList.contains('list');
2012-12-01 13:47:28 +04:00
};
/**
* Check if it's Slide mode.
* @returns {Boolean}
*/
shower.isSlideMode = function() {
return isHistoryApiSupported ? /^full.*/.test(url.search.substr(1)) : body.classList.contains('full');
};
2012-12-01 13:47:28 +04:00
/**
* Update progress bar.
* @param {Number} slideNumber slide number (sic!)
* @returns {Boolean}
2012-12-01 13:47:28 +04:00
*/
shower.updateProgress = function(slideNumber) {
// if progress bar doesn't exist
if (null === progress) {
return false;
2011-07-20 22:08:31 +04:00
}
2013-01-18 15:34:02 +04:00
if ( ! shower._isNumber(slideNumber)) {
throw new Error('Gimme slide number as Number, baby!');
2012-12-01 13:47:28 +04:00
}
2012-12-01 13:47:28 +04:00
progress.style.width = (100 / (slideList.length - 1) * shower._normalizeSlideNumber(slideNumber)).toFixed(2) + '%';
return true;
};
/**
* Update current and passed slides.
* @param {Number} slideNumber slide number (sic!)
* @returns {Boolean}
2012-12-01 13:47:28 +04:00
*/
shower.updateCurrentAndPassedSlides = function(slideNumber) {
var i,
slide,
l = slideList.length;
slideNumber = shower._normalizeSlideNumber(slideNumber);
2013-01-18 15:34:02 +04:00
if ( ! shower._isNumber(slideNumber)) {
throw new Error('Gimme slide number as Number, baby!');
2012-12-01 13:47:28 +04:00
}
for (i = 0; i < l; ++i) {
slide = document.getElementById(slideList[i].id);
if (i < slideNumber) {
slide.classList.remove('active');
slide.classList.add('visited');
2012-12-01 13:47:28 +04:00
} else if (i > slideNumber) {
slide.classList.remove('visited');
slide.classList.remove('active');
2012-12-01 13:47:28 +04:00
} else {
slide.classList.remove('visited');
slide.classList.add('active');
2012-12-01 13:47:28 +04:00
}
}
return true;
};
2012-12-30 15:54:16 +04:00
/**
* Show presenter notes in console.
* @param {Number} slideNumber slide number (sic!). Attention: starts from zero.
2012-12-30 15:54:16 +04:00
*/
shower.showPresenterNotes = function(slideNumber) {
if (window.console) {
2013-01-01 19:46:52 +04:00
slideNumber = shower._normalizeSlideNumber(slideNumber);
2012-12-30 15:54:16 +04:00
2013-01-20 01:13:21 +04:00
var slideId = slideList[slideNumber].id,
nextSlideId = slideList[slideNumber + 1] ? slideList[slideNumber + 1].id : null,
notes = document.getElementById(slideId).querySelector('footer');
2013-01-01 19:46:52 +04:00
2012-12-30 15:54:16 +04:00
if (notes) {
console.info(notes.innerHTML.replace(/\n\s+/g,'\n'));
}
2013-01-20 01:13:21 +04:00
2013-01-01 19:46:52 +04:00
if (nextSlideId) {
var next = document.getElementById(nextSlideId).querySelector('h2');
2013-01-20 01:13:21 +04:00
2012-12-30 15:54:16 +04:00
if (next) {
next = next.innerHTML.replace(/^\s+|<[^>]+>/g,'');
console.info('NEXT: ' + next);
}
}
}
};
2012-12-01 13:47:28 +04:00
/**
* Get slide hash.
* @param {Number} slideNumber slide number (sic!). Attention: starts from zero.
* @returns {String}
2012-12-01 13:47:28 +04:00
*/
shower.getSlideHash = function(slideNumber) {
2013-01-18 15:34:02 +04:00
if ( ! shower._isNumber(slideNumber)) {
throw new Error('Gimme slide number as Number, baby!');
2012-12-01 13:47:28 +04:00
}
slideNumber = shower._normalizeSlideNumber(slideNumber);
return '#' + slideList[slideNumber].id;
};
/**
* Go to slide number...
* @param {Number} slideNumber slide number (sic!). Attention: starts from zero.
2013-01-20 03:24:58 +04:00
* @param {Function} [callback] runs only if you not in List mode
* @returns {Number}
2012-12-01 13:47:28 +04:00
*/
shower.go = function(slideNumber, callback) {
2013-01-18 15:34:02 +04:00
if ( ! shower._isNumber(slideNumber)) {
throw new Error('Gimme slide number as Number, baby!');
2012-12-01 13:47:28 +04:00
}
url.hash = shower.getSlideHash(slideNumber);
if (shower.isSlideMode()) {
2012-12-01 13:47:28 +04:00
shower.updateProgress(slideNumber);
shower.updateCurrentAndPassedSlides(slideNumber);
2012-12-30 15:54:16 +04:00
shower.showPresenterNotes(slideNumber);
2013-01-20 01:13:21 +04:00
if (typeof(callback) === 'function') {
callback();
2012-12-09 16:23:47 +04:00
}
}
2011-07-20 22:08:31 +04:00
return slideNumber;
2012-12-01 13:47:28 +04:00
};
/**
* Run slide show if presented.
* @param {Number} slideNumber
* @returns {Boolean}
2012-12-01 13:47:28 +04:00
*/
shower.runInnerNavigation = function(slideNumber) {
2013-01-18 15:34:02 +04:00
if ( ! shower._isNumber(slideNumber)) {
throw new Error('Gimme slide number as Number, baby!');
2012-12-01 13:47:28 +04:00
}
2012-12-01 13:47:28 +04:00
slideNumber = shower._normalizeSlideNumber(slideNumber);
2012-12-01 13:47:28 +04:00
clearTimeout(timer);
if (slideList[slideNumber].hasTiming) {
// Compute number of milliseconds from format "X:Y", where X is
// number of minutes, and Y is number of seconds
var timing = shower._getData(document.getElementById(slideList[slideNumber].id), 'timing').split(':');
timing = parseInt(timing[0], 10) * 60 * 1000 + parseInt(timing[1], 10) * 1000;
timer = setTimeout(function() {
shower.go(slideNumber + 1);
shower.runInnerNavigation(slideNumber + 1);
2012-12-01 13:47:28 +04:00
},
timing);
}
return true;
2012-12-01 13:47:28 +04:00
};
/**
* Increases inner navigation by adding 'active' class to next inactive inner navigation item
* @param {Number} slideNumber
* @returns {Number}
2012-12-01 13:47:28 +04:00
*/
shower.increaseInnerNavigation = function(slideNumber) {
var nextNodes,
node,
ret = -1;
2013-01-18 15:34:02 +04:00
if ( ! shower._isNumber(slideNumber)) {
throw new Error('Gimme slide number as Number, baby!');
2012-12-01 13:47:28 +04:00
}
// If inner navigation in this slide...
if (slideList[slideNumber].hasInnerNavigation) {
nextNodes = document.getElementById(slideList[slideNumber].id).querySelectorAll('.next:not(.active)');
if (0 !== nextNodes.length) {
node = nextNodes[0];
node.classList.add('active');
ret = nextNodes.length - 1;
}
}
2012-12-01 13:47:28 +04:00
return ret;
};
// Event handlers
2013-01-18 15:34:02 +04:00
window.addEventListener('DOMContentLoaded', function() {
if (body.classList.contains('full')) {
2012-12-01 13:47:28 +04:00
shower.enterSlideMode();
2011-07-20 22:08:31 +04:00
}
}, false);
2013-01-20 03:45:45 +04:00
window.addEventListener('popstate', function() {
2012-12-01 13:47:28 +04:00
if (shower.isListMode()) {
shower.enterListMode();
2011-07-20 22:08:31 +04:00
} else {
2012-12-01 13:47:28 +04:00
shower.enterSlideMode();
2011-07-20 22:08:31 +04:00
}
}, false);
2013-01-20 03:45:45 +04:00
window.addEventListener('resize', function() {
if (shower.isSlideMode()) {
2012-12-01 13:47:28 +04:00
shower._applyTransform(shower._getTransform());
2011-07-20 22:08:31 +04:00
}
}, false);
2011-07-20 22:08:31 +04:00
2013-01-18 15:34:02 +04:00
document.addEventListener('keydown', function(e) {
2012-12-08 16:45:00 +04:00
// Shortcut for alt, ctrl and meta keys
if (e.altKey || e.ctrlKey || e.metaKey) { return; }
2012-12-01 13:47:28 +04:00
var currentSlideNumber = shower.getCurrentSlideNumber(),
innerNavigationCompleted = true;
2011-07-20 22:08:31 +04:00
switch (e.which) {
case 116: // F5
2012-12-08 16:45:00 +04:00
e.preventDefault();
if (shower.isListMode()) {
var slideNumber = e.shiftKey ? currentSlideNumber : 0;
shower.go(slideNumber);
shower.enterSlideMode();
} else {
shower.enterListMode();
}
break;
2011-07-20 22:08:31 +04:00
case 13: // Enter
2012-12-01 13:47:28 +04:00
if (shower.isListMode() && -1 !== currentSlideNumber) {
2011-07-20 22:08:31 +04:00
e.preventDefault();
2012-12-01 13:47:28 +04:00
shower.enterSlideMode();
2011-07-20 22:08:31 +04:00
}
break;
case 27: // Esc
if (shower.isSlideMode()) {
2011-07-20 22:08:31 +04:00
e.preventDefault();
2012-12-01 13:47:28 +04:00
shower.enterListMode();
2011-07-20 22:08:31 +04:00
}
break;
case 33: // PgUp
case 38: // Up
case 37: // Left
case 72: // h
2011-07-20 22:08:31 +04:00
case 75: // k
e.preventDefault();
2012-12-01 13:47:28 +04:00
shower.previous();
2011-07-20 22:08:31 +04:00
break;
case 34: // PgDown
case 40: // Down
case 39: // Right
case 76: // l
2011-07-20 22:08:31 +04:00
case 74: // j
e.preventDefault();
if (shower.isSlideMode()) {
2012-12-01 13:47:28 +04:00
// Inner navigation is "completed" if current slide have
// no inner navigation or inner navigation is fully shown
innerNavigationCompleted = !slideList[currentSlideNumber].hasInnerNavigation ||
-1 === shower.increaseInnerNavigation(currentSlideNumber);
} else {
// Also inner navigation is always "completed" if we are in
// list mode
innerNavigationCompleted = true;
}
// NOTE: First of all check if there is no current slide
if (
-1 === currentSlideNumber || innerNavigationCompleted
) {
currentSlideNumber++;
shower.go(currentSlideNumber);
// We must run slideshow only in full mode
if (shower.isSlideMode()) {
shower.runInnerNavigation(currentSlideNumber);
2012-12-01 13:47:28 +04:00
}
}
2011-07-20 22:08:31 +04:00
break;
case 36: // Home
e.preventDefault();
2012-12-01 13:47:28 +04:00
shower.first();
2011-07-20 22:08:31 +04:00
break;
case 35: // End
e.preventDefault();
2012-12-01 13:47:28 +04:00
shower.last();
2011-07-20 22:08:31 +04:00
break;
case 9: // Tab = +1; Shift + Tab = -1
2011-07-20 22:08:31 +04:00
case 32: // Space = +1; Shift + Space = -1
e.preventDefault();
2012-12-01 13:47:28 +04:00
shower[e.shiftKey ? 'previous' : 'next']();
2011-07-20 22:08:31 +04:00
break;
default:
// Behave as usual
}
2011-07-18 13:39:47 +04:00
}, false);
document.addEventListener('click', function(e) {
if (shower.isListMode() && shower._getSlideIdByEl(e.target)) {
e.preventDefault();
shower.go(shower.getSlideNumber(shower._getSlideIdByEl(e.target)));
shower.enterSlideMode();
}
}, false);
2011-07-20 22:08:31 +04:00
2013-01-18 15:34:02 +04:00
document.addEventListener('touchstart', function(e) {
if (shower._getSlideIdByEl(e.target)) {
if (shower.isSlideMode() && ! shower._checkInteractiveElement(e)) {
var x = e.touches[0].pageX;
if (x > window.innerWidth / 2) {
shower.next();
} else {
shower.previous();
}
}
if (shower.isListMode()) {
shower.go(shower.getSlideNumber(shower._getSlideIdByEl(e.target)));
shower.enterSlideMode();
}
}
}, false);
2011-07-20 22:08:31 +04:00
2013-01-18 15:34:02 +04:00
document.addEventListener('touchmove', function(e) {
if (shower.isSlideMode()) {
e.preventDefault();
2011-07-20 22:08:31 +04:00
}
}, false);
2010-11-08 02:26:01 +03:00
2012-12-01 13:47:28 +04:00
return shower;
})(this, this.document);