Fluidbook.TOP = 8;
Fluidbook.BOTTOM = 9;
Fluidbook.prototype = {
- init: function(datas) {
+ init: function (datas) {
this.datas = datas;
this.junk = datas.cacheDate;
this.cache = new FluidbookCache(datas);
}
this.initLoading();
},
- initLoading: function() {
+ initLoading: function () {
this.displayLoader();
},
- reloadErrorImages: function() {
- $('img').each(function() {
+ reloadErrorImages: function () {
+ $('img').each(function () {
});
},
- hideSplash: function() {
+ hideSplash: function () {
if ($("#splash").length == 0) {
return;
}
this.loader.canPreload();
var $this = this;
- setTimeout(function() {
+ setTimeout(function () {
$this._hideSplash();
}, 3000);
},
- _hideSplash: function() {
+ _hideSplash: function () {
this.ready();
$("#main").css('visibility', 'visible');
this.hideLoader(0, true);
if (this.support.transitions2d) {
- $("#splash").css('opacity', 0).one(this.support.getTransitionEndEvent(true), function() {
+ $("#splash").css('opacity', 0).one(this.support.getTransitionEndEvent(true), function () {
$(this).remove();
});
} else {
- $("#splash").fadeOut(500, function() {
+ $("#splash").fadeOut(500, function () {
$(this.remove());
})
}
},
- ready: function() {
+ ready: function () {
if (this.isReady) {
return;
}
resize();
$(this).trigger('fluidbookready');
},
- loadPlugins: function() {
- $.each(this.datas.plugins, function(k, plugin) {
+ loadPlugins: function () {
+ $.each(this.datas.plugins, function (k, plugin) {
try {
var functionName = plugin.replace(/\./g, '_');
eval(functionName + '();');
} catch (err) {
}
});
- $.each(this.datas.htmlmultimedia, function(k, code) {
+ $.each(this.datas.htmlmultimedia, function (k, code) {
try {
eval(code);
} catch (err) {
}
});
},
- resetZoom: function() {
+ resetZoom: function () {
var $this = this;
if (this.support.iOS) {
} else if (!this.support.isMobile) {
}
},
- setZoom: function(zoom) {
+ setZoom: function (zoom) {
if (zoom) {
$("#pages").addClass('zoom');
} else {
$("#pages").removeClass('zoom');
}
},
- initPage: function(pageNr, doublePage, position) {
+ initPage: function (pageNr, doublePage, position) {
if ($("#page_" + pageNr).length > 0) {
return;
}
var page = '<div class="page ' + position + '" id="page_' + pageNr + '" data-page="' + pageNr + '"><div class="background" page="' + pageNr + '"></div><div class="clinks"></div><div class="texts" highlight=""></div><div class="shade"></div></div>';
$(doublePage).append(page);
},
- hidePage: function(position) {
+ hidePage: function (position) {
$("#pages ." + position).hide();
},
- initLinks: function(pageNr) {
+ initLinks: function (pageNr) {
if (pageNr == undefined) {
pageNr = this.currentPage;
}
if (this.datas.linkBlinkTime > 0) {
///this.animateLinks();
}
- setTimeout(function() {
+ setTimeout(function () {
$this.initVideos();
}, 1000);
},
- animateLinks: function() {
+ animateLinks: function () {
var links = $(".link a.displayArea");
var bookmarks = $("#links .bookmark:not([data-enabled])");
if (Modernizr.csstransitions) {
$(links).addClass('animating');
$(bookmarks).css('opacity', 1).addClass('animating');
- setTimeout(function() {
+ setTimeout(function () {
$(links).css('opacity', 0);
$(bookmarks).css('opacity', 0);
- setTimeout(function() {
+ setTimeout(function () {
$(links).removeClass('animating').css('opacity', 1);
$(bookmarks).removeClass('animating').css('opacity', "");
}, 1100);
}, 50);
} else {
- $(links).addClass('animating').fadeOut(1000, function() {
+ $(links).addClass('animating').fadeOut(1000, function () {
$(links).removeClass('animating').show();
- }).mouseover(function() {
+ }).mouseover(function () {
$(links).stop().removeClass('animating').css('opacity', 1).show();
return true;
});
}
},
- initVideos: function() {
+ initVideos: function () {
var $this = this;
- $(".videoContainer").each(function() {
+ $(".videoContainer").each(function () {
$this.video.initVideo(this);
});
},
- getNextOffset: function() {
+ getNextOffset: function () {
var offset = 2;
if (this.displayOnePage) {
offset = 1;
this.transitionAxis = 'x';
return offset;
},
- goNextPage: function() {
+ goNextPage: function () {
if (this.transitionning) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(this.normalizePage(this.currentPage) + this.getNextOffset());
},
- goFirstPage: function() {
+ goFirstPage: function () {
if (this.transitionning) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(1);
},
- goPreviousPage: function() {
+ goPreviousPage: function () {
if (this.transitionning) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(this.normalizePage(this.currentPage) - this.getNextOffset());
},
- goLastPage: function() {
+ goLastPage: function () {
if (this.transitionning) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(this.datas.pages);
},
- goNextChapter: function() {
+ goNextChapter: function () {
if (this.transitionning) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(this.normalizePage(next));
},
- goPreviousChapter: function() {
+ goPreviousChapter: function () {
if (this.transitionning) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(this.normalizePage(prev));
},
- goNextChapterPage: function() {
+ goNextChapterPage: function () {
if (this.transitionning) {
return;
}
this.transitionAxis = 'y';
this.setCurrentPage(this.normalizePage(next));
},
- goPreviousChapterPage: function() {
+ goPreviousChapterPage: function () {
if (this.transitionning) {
return;
}
this.transitionAxis = 'y';
this.setCurrentPage(this.normalizePage(prev));
},
- normalizePage: function(page) {
+ normalizePage: function (page) {
page = Math.max(1, Math.min(page, this.datas.pages));
if (!this.displayOnePage && page % 2 == 1) {
page--;
}
return page;
},
- setCurrentPage: function(page) {
+ setCurrentPage: function (page) {
window.location.hash = "#/page/" + this.normalizePage(page);
},
- changeAddress: function() {
+ changeAddress: function () {
var $this = this;
var page;
var args = window.location.hash.split('/');
}
$($this).trigger('changePage', [page]);
- this.closeView(function() {
+ this.closeView(function () {
$this.pageTransition(page);
$this.resetZoom();
$this.stats.track(0, page);
}, true);
}
else {
- this.openView(args[1], args[2], args[3], function() {
+ this.openView(args[1], args[2], args[3], function () {
$this.hideSplash();
});
this.resetZoom();
return;
},
- pageTransition: function(pageNr) {
+ pageTransition: function (pageNr) {
this.tooltip.hideTooltip();
if (pageNr == undefined) {
pageNr = this.currentPage;
return this.pageTransition3D(pageNr);
},
- pageTransition3D: function(pageNr) {
+ pageTransition3D: function (pageNr) {
var $this = this;
if ($("#pages").hasClass('_3dtransition')) {
var doublePage = $("#nextDoublePage");
var currentDoublePage = $("#currentDoublePage");
this.displayLoader();
- this.loader.preloadPagesBeforeTransition([turning.currentLeft, turning.currentRight], function() {
+ this.loader.preloadPagesBeforeTransition([turning.currentLeft, turning.currentRight], function () {
$("#pages").addClass('_3dtransition');
- $this.loader.setContentsInDoublePage(currentDoublePage, turning.flat, true, function() {
- $this.loader.setContentsInDoublePage(doublePage, turning.flip, true, function() {
+ $this.loader.setContentsInDoublePage(currentDoublePage, turning.flat, true, function () {
+ $this.loader.setContentsInDoublePage(doublePage, turning.flip, true, function () {
$this.beforeTransition(pageNr, 3);
- $(doublePage).addClass(turning.nextFromClass + 'end').one($this.support.getTransitionEndEvent(), function() {
+ $(doublePage).addClass(turning.nextFromClass + 'end').one($this.support.getTransitionEndEvent(), function () {
if ($this.transitionning == false) {
return;
}
}
// Set the flat contents with the new page
- $this.loader.setContentsInDoublePage(doublePage, turning.end, false, function() {
+ $this.loader.setContentsInDoublePage(doublePage, turning.end, false, function () {
$(doublePage).removeClass('_3d').removeClass(turning.nextFromClass + 'start').removeClass(turning.nextFromClass + 'end');
// Remove former part
$("#currentDoublePage").remove();
});
});
},
- getTurningPages: function(newPage) {
+ getTurningPages: function (newPage) {
var res = {};
res.dir = 1;
if (newPage < this.currentPage) {
res.loading = [res.currentLeft, res.currentRight];
return json_parse(JSON.stringify(res));
},
- reloadCurrentPage: function() {
+ reloadCurrentPage: function () {
this.pageTransition(this.currentPage);
},
- readingPage: function(side) {
+ readingPage: function (side) {
if (!this.displayOnePage) {
var page = this.currentPage;
var change = false;
}
}
},
- hideUnnecessaryButtons: function(page) {
+ hideUnnecessaryButtons: function (page) {
var speed = 500;
if (page == undefined) {
page = this.currentPage;
}
}
},
- updateShadows: function(page, animationDuration) {
+ updateShadows: function (page, animationDuration) {
if (animationDuration == undefined) {
animationDuration = 0;
}
$("#shadow>.right:visible").fadeOut(duration);
}
},
- showAllButtons: function() {
+ showAllButtons: function () {
$("#next,#previous").addClass('help').show();
},
- pageTransition2D: function(pageNr) {
+ pageTransition2D: function (pageNr) {
this.transitionning = true;
var $this = this;
var turning = this.getTurningPages(pageNr);
$("#pages").append('<div id="nextDoublePage" class="doublePage _2d axis_' + this.transitionAxis + ' ' + turning.nextFromClass + '"></div>');
var doublePage = $("#nextDoublePage");
this.displayLoader();
- this.loader.preloadPagesBeforeTransition(turning.end, function() {
- $this.loader.setContentsInDoublePage(doublePage, turning.end, true, function() {
+ this.loader.preloadPagesBeforeTransition(turning.end, function () {
+ $this.loader.setContentsInDoublePage(doublePage, turning.end, true, function () {
$this.beforeTransition(pageNr, 2);
$("#currentDoublePage").addClass('_2d').addClass('axis_' + $this.transitionAxis).addClass(turning.currentToClass);
- $(doublePage).removeClass(turning.nextFromClass).one($this.support.getTransitionEndEvent(), function(event) {
+ $(doublePage).removeClass(turning.nextFromClass).one($this.support.getTransitionEndEvent(), function (event) {
if ($this.transitionning == false) {
return;
}
});
});
},
- pageTransition2DPortrait: function(pageNr) {
+ pageTransition2DPortrait: function (pageNr) {
this.transitionning = true;
var $this = this;
var turning = this.getTurningPages(pageNr);
}
this.displayLoader();
- this.loader.preloadPagesBeforeTransition(turning.end, function() {
- $this.loader.setContentsInDoublePage(doublePage, turning.end, true, function() {
+ this.loader.preloadPagesBeforeTransition(turning.end, function () {
+ $this.loader.setContentsInDoublePage(doublePage, turning.end, true, function () {
$this.beforeTransition(pageNr, 2);
$("#currentDoublePage").addClass('axis_' + $this.transitionAxis).addClass('_2d').addClass(turning.currentToClass);
- $(doublePage).removeClass(turning.nextFromClass).one($this.support.getTransitionEndEvent(), function() {
+ $(doublePage).removeClass(turning.nextFromClass).one($this.support.getTransitionEndEvent(), function () {
fb('received event');
if ($this.transitionning == false) {
return;
});
});
},
- pageTransition1D: function(pageNr) {
+ pageTransition1D: function (pageNr) {
var page = pageNr;
var doublePage = $("#currentDoublePage");
var $this = this;
}
var turning = this.getTurningPages(pageNr);
this.beforeTransition(pageNr);
- this.loader.setContentsInDoublePage(doublePage, turning.end, true, function() {
+ this.loader.setContentsInDoublePage(doublePage, turning.end, true, function () {
$this.afterTransition(page);
});
},
- beforeTransition: function(page, d) {
+ beforeTransition: function (page, d) {
if (d == undefined) {
d = 1;
}
this.updateShadows(page, animationDuration);
fb('beforeTransition ' + page);
},
- afterTransition: function(page) {
+ afterTransition: function (page) {
if (this.transitionning === false) {
//return;
}
var $this = this;
this.currentPage = page;
this.setPageNumbers();
- setTimeout(function() {
+ setTimeout(function () {
$this.loader.preloadAround(page);
}, 1000);
this.initLinks();
}
},
- setPageNumbers: function() {
+ setPageNumbers: function () {
$("#pagesnumbers .left").html(this.getPageNumberOfSide('left'));
$("#pagesnumbers .right").html(this.getPageNumberOfSide('right'));
},
- getPageNumberOfSide: function(side) {
+ getPageNumberOfSide: function (side) {
var p = $("#currentDoublePage").find('.' + side);
if (p.length == 0) {
return '';
}
return this.physicalToVirtual($(p).data('page'));
},
- clickLogo: function() {
+ clickLogo: function () {
if (this.datas.url_link == '' || this.datas.url_link == 'http://') {
return;
}
this.wopen(this.datas.url_link, '_blank');
},
- viewMode: function() {
+ viewMode: function () {
return $("#view .mview").length > 0;
},
- openView: function(view, param1, param2, callback) {
+ openView: function (view, param1, param2, callback) {
var $this = this;
this.displayLoader();
this.resetWaiters();
- setTimeout(function() {
+ setTimeout(function () {
$this._openView(view, param1, param2, callback);
}, 20);
},
- addWaiter: function(reset) {
+ addWaiter: function (reset) {
if (reset == undefined) {
reset = false;
}
this.waiters.push(rand);
return rand;
},
- waiterActive: function(id) {
+ waiterActive: function (id) {
return this.waiters.indexOf(id) > -1;
},
- resetWaiters: function() {
+ resetWaiters: function () {
this.waiters = [];
},
- _openView: function(view, param1, param2, callback) {
+ _openView: function (view, param1, param2, callback) {
var $this = this;
var preload = {index: 'thumbnails',
search: 'thumbnails',
video: 'extras'};
if (!OFFLINEAPP && this.gal != null && preload[view] != undefined) {
var w = this.addWaiter(true);
- this.gal.downloadAndCall(preload[view], function() {
+ this.gal.downloadAndCall(preload[view], function () {
if ($this.waiterActive(w)) {
$this.__openView(view, param1, param2, callback);
}
this.__openView(view, param1, param2, callback);
}
},
- __openView: function(view, param1, param2, callback) {
+ __openView: function (view, param1, param2, callback) {
var $this = this;
var camelView = view.charAt(0).toUpperCase() + view.substr(1);
- var cb = function() {
+ var cb = function () {
$this.openingView(callback);
};
if (view == 'index') {
this.searchString = param1;
var group = param2;
$("#q").val(param1);
- this.search.find(param1, function(r) {
+ this.search.find(param1, function (r) {
$this.displayResults(r, group, cb);
});
if (group == undefined) {
this['open' + camelView](param1, param2, cb);
}
},
- openingView: function(callback) {
+ openingView: function (callback) {
var $this = this;
this.resize.resizeView();
this.tooltip.hideTooltip();
}
$(mview).show().removeClass('animate').transform(from);
- setTimeout(function() {
- $(mview).one($this.support.getTransitionEndEvent(), function() {
+ setTimeout(function () {
+ $(mview).one($this.support.getTransitionEndEvent(), function () {
$("#main").hide();
$('body').addClass('view');
$(mview).removeClass('animate');
resize();
}
},
- displayResults: function(data, group, callback) {
+ displayResults: function (data, group, callback) {
var $this = this;
var results = data.results;
var hideNoResults = !this.datas.searchShowNoResultsPages;
return;
}
- this.openIndex(this.l10n.__('search results for') + ' « ' + this.searchString + " »", group, false, function() {
+ this.openIndex(this.l10n.__('search results for') + ' « ' + this.searchString + " »", group, false, function () {
var hits = [];
for (var i = 0; i <= $this.datas.pages; i++) {
hits[i] = 0;
}
- $.each(results, function(k, v) {
+ $.each(results, function (k, v) {
hits[k] += v;
});
var e = encodeURIComponent($this.searchString);
- $(".doubleThumb").each(function() {
+ $(".doubleThumb").each(function () {
var pages = $(this).data('pages').toString().split(',');
var hitsp = 0;
var pagesWithHits = [];
}
});
},
- openMultimedia: function(multimedia, callback) {
+ openMultimedia: function (multimedia, callback) {
var a = $('a[href="#/multimedia/' + multimedia + '"]');
var markup = decodeURIComponent($(a).attr('data-multimedia'));
var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a></div>';
callback();
}
},
- openVideo: function(video, callback) {
+ openVideo: function (video, callback) {
var a = $('a[href="#/video/' + video + '"]');
var markup = decodeURIComponent($(a).attr('data-video'));
var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a></div>';
this.initVideos();
var $this = this;
var times = [250, 500, 750, 1000, 1250];
- $.each(times, function(k, v) {
- setTimeout(function() {
+ $.each(times, function (k, v) {
+ setTimeout(function () {
$this.resize.resizePopupVideos();
}, v);
});
callback();
}
},
- openAudio: function(audio, callback) {
+ openAudio: function (audio, callback) {
var a = $('a[href="#/audio/' + audio + '"]');
var markup = decodeURIComponent($(a).attr('data-audio'));
var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a></div>';
this.stats.track(11);
var $this = this;
var times = [250, 500, 750, 1000, 1250];
- $.each(times, function(k, v) {
- setTimeout(function() {
+ $.each(times, function (k, v) {
+ setTimeout(function () {
$this.resize.resizePopupAudios();
}, v);
});
callback();
}
},
- openWebVideo: function(service, video, callback) {
+ openWebVideo: function (service, video, callback) {
var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a></div>';
view += '<div class="content">';
}
view += '</div>';
$("#view").append('<div class="mview">' + view + '</div>');
- $("#view .mview:last iframe").each(function() {
+ $("#view .mview:last iframe").each(function () {
$(this).attr('height', ($(this).width() * 9) / 16);
});
this.stats.track(11);
callback();
}
},
- openLocales: function(p1, p2, callback) {
+ openLocales: function (p1, p2, callback) {
var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a><h2>Select language</h2></div>';
view += '<div class="content">';
view += '<ul class="chapters localesList">';
var $this = this;
- $.each(this.l10n.multilang, function(k, v) {
+ $.each(this.l10n.multilang, function (k, v) {
var url = v.url;
if (url.substr(0, 3) == '../' && !$this.datas.standalone) {
url = '../' + url;
callback();
}
},
- openShare: function(p1, p2, callback) {
+ openShare: function (p1, p2, callback) {
var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a><h2>' + this.l10n.__('share') + '</h2></div>';
view += '<div class="content">';
view += '<ul class="chapters shareList">';
callback();
}
},
- openBookmark: function(p1, p2, callback) {
+ openBookmark: function (p1, p2, callback) {
var view = this.bookmarks.getView();
if (view !== false) {
$("#view").append('<div class="mview">' + view + '</div>');
} else {
var message = this.l10n.__("you don't have any bookmarks");
if (this.datas.phonegap) {
- navigator.notification.alert(message, function() {
+ navigator.notification.alert(message, function () {
}, this.l10n.__('bookmarks'));
} else {
this.hideLoader();
}
},
- openChapters: function(callback) {
+ openChapters: function (callback) {
if (this.chapters == undefined) {
this.chapters = new FluidbookChapters(this, this.datas.chapters);
}
callback();
}
},
- openIndex: function(title, group, closeAll, callback) {
+ openIndex: function (title, group, closeAll, callback) {
var c = !closeAll ? ' one' : '';
var index = '<div class="caption"><a href="#" class="back' + c + '">' + this.l10n.__('back') + '</a><h2>' + title + '</h2></div>';
index += this.index.getView(group);
callback();
}
},
- openArchives: function(title, callback) {
+ openArchives: function (title, callback) {
var archives = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a><h2>' + title + '</h2></div>';
archives += '<div class="image" id="archivesview"><img src="data/images/' + this.datas.externalArchives + '" /><div class="links">' + this.datas.links.archives + '</div></div>';
$("#view").append('<div class="mview archives">' + archives + '</div>');
callback();
}
},
- physicalToVirtual: function(page) {
+ physicalToVirtual: function (page) {
return this.datas.numerotation[page - 1];
},
- virtualToPhysical: function(page) {
+ virtualToPhysical: function (page) {
return this.datas.numerotation.indexOf(page) + 1;
},
- closeView: function(callback, all, animate) {
+ closeView: function (callback, all, animate) {
var $this = this;
if (all == undefined) {
all = false;
animate = true;
}
if ($('.mview').scrollTop() > 0) {
- $('.mview').scrollTo(0, 500, function() {
+ $('.mview').scrollTo(0, 500, function () {
$this.closeView(callback, all, animate);
});
return;
}
if (animate && this.support.transitions2d) {
- setTimeout(function() {
- $(mview).one($this.support.getTransitionEndEvent(), function() {
+ setTimeout(function () {
+ $(mview).one($this.support.getTransitionEndEvent(), function () {
$(this).remove();
callback();
}).addClass('animate').transform(to);
}
resize();
},
- getSearchHints: function(q) {
+ getSearchHints: function (q) {
var $this = this;
this.killLastSearchHint();
- this.search.getHints(q, function(r) {
+ this.search.getHints(q, function (r) {
$this.displaySearchHints(r);
});
},
- displaySearchHints: function(hints) {
+ displaySearchHints: function (hints) {
this.hideSearchHints();
if (hints.length == 0) {
return;
}
- $.each(hints, function(k, v) {
+ $.each(hints, function (k, v) {
$("#searchHints").append('<a class="hint" term="' + v[0] + '" href="#/search/' + v[0] + '">' + v[0] + ' <em>(' + v[1] + ')</em></a>');
});
var qoffset = $("#q").offset();
}
$("#searchHints").css({top: top, left: left}).show();
},
- killLastSearchHint: function() {
+ killLastSearchHint: function () {
this.search.kill();
},
- hideSearchHints: function() {
+ hideSearchHints: function () {
this.killLastSearchHint();
$("#searchHints").html('');
$("#searchHints").hide();
},
- getLocationToShare: function() {
+ getLocationToShare: function () {
if (this.datas.phonegap) {
return this.datas.offlineLink;
} else {
return e[0];
}
},
- sendEmail: function() {
+ sendEmail: function () {
window.location = 'mailto:?subject=' + this.datas.title + '&body=' + this.datas.title + ' : ' + this.getLocationToShare();
this.stats.track(5);
},
- sendTwitter: function() {
+ sendTwitter: function () {
this.service.open('twitterShare', {
url: this.getLocationToShare(),
post: this.datas.twitter_description.replace('%title%', this.datas.title)
});
this.stats.track(13);
},
- sendFacebook: function() {
+ sendFacebook: function () {
this.service.open('facebookShare', {
url: this.getLocationToShare()
});
this.stats.track(12);
},
- sendGoogleplus: function() {
+ sendGoogleplus: function () {
this.service.open('googleplusShare', {
url: this.getLocationToShare()
});
this.stats.track(12);
},
- sendLinkedin: function() {
+ sendLinkedin: function () {
this.service.open('linkedinShare', {
url: this.getLocationToShare()
});
this.stats.track(12);
},
- sendViadeo: function() {
+ sendViadeo: function () {
this.service.open('viadeoShare', {
url: this.getLocationToShare()
});
this.stats.track(12);
},
- print: function() {
+ print: function () {
var $this = this;
var pdf;
var pdfName;
pdfName = e.pop();
if (this.gal && !OFFLINEAPP) {
this.displayLoader();
- this.gal.downloadAndCall('extras', function() {
+ this.gal.downloadAndCall('extras', function () {
$this._openFile(pdf, $("#print"), 'pdf', pdfName);
});
} else {
this._openFile(pdf, $("#print"), 'pdf', pdfName);
}
},
- _openFile: function(url, e, type, localname) {
+ _openFile: function (url, e, type, localname) {
var $this = this;
if (this.datas.phonegap != false) {
}
this.wopen(url, '_blank');
},
- _downloadFilePhonegap: function(url, localname, fs, callback, callbackArgs) {
+ _downloadFilePhonegap: function (url, localname, fs, callback, callbackArgs) {
var $this = this;
if (fs == undefined) {
fs = LocalFileSystem.PERSISTENT;
}
- window.requestFileSystem(fs, 0, function(fileSystem) {
- fileSystem.root.getFile("dummy.html", {create: true, exclusive: false}, function(fileEntry) {
+ window.requestFileSystem(fs, 0, function (fileSystem) {
+ fileSystem.root.getFile("dummy.html", {create: true, exclusive: false}, function (fileEntry) {
var filePath = fileEntry.fullPath.replace("dummy.html", "") + localname;
var fileTransfer = new FileTransfer();
var uri = encodeURI(url);
fileTransfer.download(
uri,
filePath,
- function(entry) {
+ function (entry) {
if (callback != undefined) {
if (callbackArgs == undefined) {
callbackArgs = [];
callback.apply($this, callbackArgs);
}
},
- function(error) {
+ function (error) {
}
);
});
- }, function() {
+ }, function () {
});
},
- _openFilePhonegap: function(url, e, type) {
+ _openFilePhonegap: function (url, e, type) {
var $this = this;
var types_ios = {pdf: 'com.adobe.pdf'};
var types_android = {pdf: 'application/pdf'};
offset.left += ($(e).width() / 2);
offset.top += ($(e).height());
try {
- ExternalFileUtil.openWith(url, types_ios[type], function() {
+ ExternalFileUtil.openWith(url, types_ios[type], function () {
$this.hideLoader();
- }, function() {
+ }, function () {
$this.wopen(url, "_blank", 'location=no');
$this.hideLoader();
}, offset);
if (this.datas.phonegap == 'android') {
if (types_android[type] != undefined) {
this.displayLoader();
- setTimeout(function() {
+ setTimeout(function () {
CDV.WEBINTENT.startActivity({
action: CDV.WEBINTENT.ACTION_VIEW,
type: types_android[type],
url: url
- }, function(args) {
+ }, function (args) {
$this.hideLoader(5);
- }, function(args) {
+ }, function (args) {
$this.hideLoader(5);
});
}, 100);
}
return false;
},
- highlightSearchTerms: function(pageNr) {
+ highlightSearchTerms: function (pageNr) {
return;
},
- touchOffset: function(offset) {
+ touchOffset: function (offset) {
offset *= $("#currentDoublePage").width();
$("#currentDoublePage").addClass('sliding');
$("#currentDoublePage").css({
translateX: offset
});
},
- displayLoader: function() {
+ displayLoader: function () {
this.coquillette.show();
if (!this.support.isMobile) {
$('body').addClass('loading');
}
},
- hideLoader: function(delay, force) {
+ hideLoader: function (delay, force) {
if (force == undefined) {
force = false;
}
if (delay == 0) {
return this._hideLoader(force);
}
- setTimeout(function() {
+ setTimeout(function () {
$this._hideLoader(force);
}, delay * 1000);
},
- _hideLoader: function(force) {
+ _hideLoader: function (force) {
if (force == undefined) {
force = false;
}
$('body').removeClass('loading');
}
},
- pollZoom: function() {
+ pollZoom: function () {
var z = this.support.getZoomLevel();
//console.log(z);
$('html').attr('data-zoom', z);
$("html").addClass('pan');
}
},
- intentShare: function(subject, body) {
+ intentShare: function (subject, body) {
if (subject == undefined) {
subject = this.datas.title;
}
action: CDV.WEBINTENT.ACTION_SEND,
type: 'text/plain',
extras: extras
- }, function(args) {
- }, function(args) {
+ }, function (args) {
+ }, function (args) {
});
} else {
window.location = 'mailto:?subject=' + subject + '&body=' + body;
}
this.stats.track(5);
},
- wopen: function(url, target, options) {
+ wopen: function (url, target, options) {
if (target == undefined) {
target = '_self';
}
}
window.open(url, target, options);
}
-}
-
+}
\ No newline at end of file