var timeScale = 1;
$('body').addClass('perftest');
- if (this.fluidbook.shortLoading) {
+ this.performancesTestRunning=true;
+ if (this.fluidbook.shortLoading || this.performancesMode !== 'performancesTest') {
console.log('No perf test', (Date.now() - $this.fluidbook.splash.initDate) / 1000)
- callback();
- timeScale = 0.01;
_cb = function () {
+ callback();
console.log('After first fake turn', (Date.now() - $this.fluidbook.splash.initDate) / 1000)
- };
+ }
+ timeScale = 0;
} else {
- if (this.performancesMode !== 'performancesTest') {
- console.log('no perf test');
- _cb = function () {
- callback();
- }
- timeScale = 0.01;
- } else {
- _cb = function () {
- $this.performancesEndTime = new Date();
- $this.adjustPerformancesSettings(callback);
- }
+ _cb = function () {
+ $this.performancesEndTime = new Date();
+ $this.adjustPerformancesSettings(callback);
}
}
- this.prepareTurn({flip: [1, 2]}, function () {
+ let playTurn = function () {
+ console.log('First turn prepared', (Date.now() - $this.fluidbook.splash.initDate) / 1000)
$this.playTurn(1, function () {
+ console.log('First turn done', (Date.now() - $this.fluidbook.splash.initDate) / 1000);
_cb();
$('body').removeClass('perftest');
- }, timeScale);
- });
+ }, timeScale, 0);
+ };
+
+ if (this.fluidbook.shortLoading) {
+ playTurn();
+ } else {
+ this.prepareTurn({flip: [1, 2]}, function () {
+ playTurn();
+ });
+ }
},
adjustPerformancesSettings: function (callback) {
}, enter);
},
- initTurn: function (dir) {
+ initTurn: function (dir,quick) {
this.turnRunning = true;
this.tlname = dir === 1 ? 'right' : 'left';
this.progressAnimation(0);
this.animate(false);
+ console.log('First turn animated', (Date.now() - this.fluidbook.splash.initDate) / 1000);
+
this.resize();
},
playTurn: function (dir, callback, timeScale, delay) {
+ var $this = this;
+ console.log('First turn start', (Date.now() - $this.fluidbook.splash.initDate) / 1000);
+
+
if (!this.turnRunning) {
this.initTurn(dir);
}
+ console.log('First turn inited', (Date.now() - $this.fluidbook.splash.initDate) / 1000);
if (timeScale === undefined) {
timeScale = 1;
}
- var $this = this;
+ if (timeScale === 0) {
+ this.progressAnimation(0);
+ $this.progressAnimation(1);
+ callback();
+ console.log('First turn end', (Date.now() - $this.fluidbook.splash.initDate) / 1000);
+ return;
+ }
if (delay === undefined) {
delay = this.fluidbook.support.iOS ? 0.15 : 0.06;
setTimeout(function () {
$this.turnRunning = false;
}, 4);
- //$this._callbackAfterNextRender = callback;
}
});
},