this.l10n.__('click to call this number');
*/
-
function Fluidbook(datas) {
this.init(datas);
}
this.search = new FluidbookSearch(this);
this.pad = new FluidbookPad(this);
this.waiters = [];
+ this.viewport = new FluidbookViewport(this);
+ this.viewport.updateViewport();
if (Modernizr.ftouch && this.support.transitions2d && this.datas.mobileTransitions != 'none') {
this.touch = new FluidbookTouch(this);
}
this.background = new FluidbookBackground(this);
- this.viewport = new FluidbookViewport();
- this.viewport.updateViewport();
this.l10n = new FluidbookL10N(this, $_GET['lang']);
this.video = new FluidbookVideo(this);
this.bookmarks = new FluidbookBookmarks(this);
key('end', this.goLastPage.bind(this));
key('left', this.goPreviousPage.bind(this));
key('right', this.goNextPage.bind(this));
-
+
// See fluidbook.audiodescription.js for specific shortcuts
},
hideSplash: function () {
this.ready();
$("#main").css('visibility', 'visible');
this.hideLoader(0, true);
+ // See bug #610
+ if (this.touch !== undefined && this.support.android) {
+ this.touch.enableUserScale();
+ }
+
if (this.support.transitions2d) {
$("#splash").css('opacity', 0).one(this.support.getTransitionEndEvent(true), function () {
$(this).remove();
this.transitions2d = Modernizr.csstransforms && Modernizr.csstransitions;
this.transitions3d = Modernizr.csstransforms3d && Modernizr.preserve3d && this.transitions2d;
+ this.androidbrowser = this.android && this.userAgent.search(/applewebkit/i) > -1;
+
this.transitionendevent = null;
if (window.resolution == 'auto') {
this.init();
}
+
FluidbookTouch.prototype = {
init: function () {
this.reset();
this.reset();
},
enableUserScale: function () {
+ if (this.fluidbook.viewport === undefined) {
+ return;
+ }
if (this.fluidbook.pad.enabled) {
this.fluidbook.viewport.maxScale = 1;
this.fluidbook.viewport.userScalable = false;
} else {
- this.fluidbook.viewport.maxScale = 3;
+ this.fluidbook.viewport.maxScale = 5;
this.fluidbook.viewport.userScalable = true;
}
this.fluidbook.viewport.updateViewport();
-function FluidbookViewport() {
+function FluidbookViewport(fluidbook) {
this.width = 'device-width';
this.height = null;
this.minScale = 1;
- this.maxScale = 10;
+ this.maxScale = 5;
this.initialScale = 0;
- this.userScalable = false;
+ this.userScalable = true;
this.meta = $('meta[name="viewport"]');
+ this.fluidbook = fluidbook;
+ if (this.fluidbook.support.androidbrowser) {
+ this.userScalable = true;
+ }
}
FluidbookViewport.prototype = {
var us = this.userScalable == true ? '1' : '0';
var value = w + h + is + 'minimum-scale=' + Math.max(0.25, this.minScale) + ', maximum-scale=' + Math.min(10, this.maxScale) + ', user-scalable=' + us + ", shrink-to-fit=no";
this.meta.attr('content', value);
+
}
}
\ No newline at end of file