From 6f4fdbc9d6ac0d929e7a48681337227efa14be45 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 17 Sep 2013 17:12:59 +0000 Subject: [PATCH] --- js/libs/fluidbook/fluidbook.js | 16 ++++++++++++---- js/main.js | 10 ++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 416b0e25..845a28d6 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -1262,12 +1262,19 @@ Fluidbook.prototype = { var offset = $(e).offset(); offset.left += ($(e).width() / 2); offset.top += ($(e).height()); - ExternalFileUtil.openWith(url, types_ios[type], function() { - $this.hideLoader(); - }, function() { + + try { + ExternalFileUtil.openWith(url, types_ios[type], function() { + $this.hideLoader(); + }, function() { + $this.wopen(url, "_blank", 'location=no'); + $this.hideLoader(); + }, offset); + + } catch (err) { $this.wopen(url, "_blank", 'location=no'); $this.hideLoader(); - }, offset); + } return true; } } @@ -1394,3 +1401,4 @@ Fluidbook.prototype = { window.open(url, target, options); } } + diff --git a/js/main.js b/js/main.js index 617ad6bb..12733061 100644 --- a/js/main.js +++ b/js/main.js @@ -71,6 +71,16 @@ function onDeviceReady() { var manifest = window.sessionStorage.getItem('manifest.' + DATAS.id); var fsprefix = window.sessionStorage.getItem('galfsprefix'); + if (DATAS.phonegap == 'ios') { + window.ExternalFileUtil = { + openWith: function(path, uti, success, fail, offset) { + return cordova.exec(success, fail, "ExternalFileUtil", "openWith", [path, uti, offset.left, offset.top]); + } + }; + } else if (DATAS.phonegap == 'android') { + + } + if (navigator.onLine && manifest) { gal = new GameAssetLoader(JSON.parse(manifest), fsprefix); gal.init(function() { -- 2.39.5