Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
22be208b57 | ||
![]() |
b796b22930 | ||
![]() |
14564eef27 | ||
![]() |
f429c4aafe |
6 changed files with 23 additions and 4 deletions
2
Makefile
2
Makefile
|
@ -10,7 +10,7 @@ build:
|
||||||
@./node_modules/.bin/handlebars templates/*.handlebars -f lib/templates.js
|
@./node_modules/.bin/handlebars templates/*.handlebars -f lib/templates.js
|
||||||
@echo "Compiling and minifying javascript..."
|
@echo "Compiling and minifying javascript..."
|
||||||
@mkdir -p comicbook/js/pixastic
|
@mkdir -p comicbook/js/pixastic
|
||||||
@cat lib/vendor/pixastic/pixastic.js lib/vendor/pixastic/pixastic.effects.js lib/vendor/pixastic/pixastic.worker.js lib/vendor/handlebars.runtime-1.0.rc.1.min.js lib/templates.js lib/ComicBook.js > comicbook/js/comicbook.js
|
@cat lib/vendor/pixastic/pixastic.js lib/vendor/pixastic/pixastic.effects.js lib/vendor/pixastic/pixastic.worker.js lib/vendor/handlebars.runtime-1.0.rc.1.min.js lib/vendor/quo.js lib/templates.js lib/ComicBook.js > comicbook/js/comicbook.js
|
||||||
@cp lib/vendor/pixastic/pixastic.js comicbook/js/pixastic
|
@cp lib/vendor/pixastic/pixastic.js comicbook/js/pixastic
|
||||||
@cp lib/vendor/pixastic/pixastic.effects.js comicbook/js/pixastic
|
@cp lib/vendor/pixastic/pixastic.effects.js comicbook/js/pixastic
|
||||||
@cp lib/vendor/pixastic/pixastic.worker.js comicbook/js/pixastic
|
@cp lib/vendor/pixastic/pixastic.worker.js comicbook/js/pixastic
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<script src="../lib/vendor/pixastic/pixastic.effects.js"></script>
|
<script src="../lib/vendor/pixastic/pixastic.effects.js"></script>
|
||||||
<script src="../lib/vendor/pixastic/pixastic.worker.js"></script>
|
<script src="../lib/vendor/pixastic/pixastic.worker.js"></script>
|
||||||
<script src="../lib/vendor/handlebars.runtime-1.0.rc.1.min.js"></script>
|
<script src="../lib/vendor/handlebars.runtime-1.0.rc.1.min.js"></script>
|
||||||
|
<script src="../lib/vendor/quo.js"></script>
|
||||||
<script src="../lib/templates.js"></script>
|
<script src="../lib/templates.js"></script>
|
||||||
<script src="../lib/ComicBook.js"></script>
|
<script src="../lib/ComicBook.js"></script>
|
||||||
<link rel="stylesheet" href="../css/reset.css">
|
<link rel="stylesheet" href="../css/reset.css">
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
"predef": [
|
"predef": [
|
||||||
"jQuery",
|
"jQuery",
|
||||||
"Handlebars",
|
"Handlebars",
|
||||||
"Pixastic"
|
"Pixastic",
|
||||||
|
"Quo"
|
||||||
],
|
],
|
||||||
"forin": true,
|
"forin": true,
|
||||||
"noarg": true,
|
"noarg": true,
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
- enhancement progress bar
|
- enhancement progress bar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var ComicBook = (function ($) {
|
var ComicBook = (function ($, $$) {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -93,8 +93,10 @@ var ComicBook = (function ($) {
|
||||||
|
|
||||||
// mobile enhancements
|
// mobile enhancements
|
||||||
if (navigator.userAgent.match(/mobile/i)) {
|
if (navigator.userAgent.match(/mobile/i)) {
|
||||||
|
|
||||||
this.isMobile = true;
|
this.isMobile = true;
|
||||||
document.body.classList.add('mobile');
|
document.body.classList.add('mobile');
|
||||||
|
|
||||||
defaults.displayMode = 'single';
|
defaults.displayMode = 'single';
|
||||||
|
|
||||||
window.addEventListener('load', function () {
|
window.addEventListener('load', function () {
|
||||||
|
@ -195,6 +197,7 @@ var ComicBook = (function ($) {
|
||||||
// add page controls
|
// add page controls
|
||||||
window.addEventListener('keydown', self.navigation, false);
|
window.addEventListener('keydown', self.navigation, false);
|
||||||
window.addEventListener('hashchange', checkHash, false);
|
window.addEventListener('hashchange', checkHash, false);
|
||||||
|
$$('body').swipeLeft(self.navigation).swipeRight(self.navigation);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('touchstart', function (e) {
|
window.addEventListener('touchstart', function (e) {
|
||||||
|
@ -843,12 +846,20 @@ var ComicBook = (function ($) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'swipeLeft':
|
||||||
|
side = 'right';
|
||||||
|
break;
|
||||||
|
case 'swipeRight':
|
||||||
|
side = 'left';
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw ComicBookException.INVALID_NAVIGATION_EVENT + ' ' + e.type;
|
throw ComicBookException.INVALID_NAVIGATION_EVENT + ' ' + e.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (side) {
|
if (side) {
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
// western style (left to right)
|
// western style (left to right)
|
||||||
|
@ -856,6 +867,7 @@ var ComicBook = (function ($) {
|
||||||
if (side === 'left') { self.drawPrevPage(); }
|
if (side === 'left') { self.drawPrevPage(); }
|
||||||
if (side === 'right') { self.drawNextPage(); }
|
if (side === 'right') { self.drawNextPage(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// manga style (right to left)
|
// manga style (right to left)
|
||||||
else {
|
else {
|
||||||
if (side === 'left') { self.drawNextPage(); }
|
if (side === 'left') { self.drawNextPage(); }
|
||||||
|
@ -894,4 +906,4 @@ var ComicBook = (function ($) {
|
||||||
|
|
||||||
return ComicBook;
|
return ComicBook;
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery, Quo);
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<script src="../vendor/pixastic/pixastic.effects.js"></script>
|
<script src="../vendor/pixastic/pixastic.effects.js"></script>
|
||||||
<script src="../vendor/pixastic/pixastic.worker.js"></script>
|
<script src="../vendor/pixastic/pixastic.worker.js"></script>
|
||||||
<script src="../vendor/handlebars.runtime-1.0.rc.1.min.js"></script>
|
<script src="../vendor/handlebars.runtime-1.0.rc.1.min.js"></script>
|
||||||
|
<script src="../vendor/quo.js"></script>
|
||||||
<script src="../templates.js"></script>
|
<script src="../templates.js"></script>
|
||||||
<script src="../ComicBook.js"></script>
|
<script src="../ComicBook.js"></script>
|
||||||
|
|
||||||
|
|
4
lib/vendor/quo.js
vendored
Executable file
4
lib/vendor/quo.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue