]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Sep 2013 17:12:59 +0000 (17:12 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Sep 2013 17:12:59 +0000 (17:12 +0000)
js/libs/fluidbook/fluidbook.js
js/main.js

index 416b0e254c68e288de769ffae84e58b3ca27be52..845a28d6fd9155096253861768ba631854cebc7c 100644 (file)
@@ -1262,12 +1262,19 @@ Fluidbook.prototype = {
                                var offset = $(e).offset();\r
                                offset.left += ($(e).width() / 2);\r
                                offset.top += ($(e).height());\r
-                               ExternalFileUtil.openWith(url, types_ios[type], function() {\r
-                                       $this.hideLoader();\r
-                               }, function() {\r
+\r
+                               try {\r
+                                       ExternalFileUtil.openWith(url, types_ios[type], function() {\r
+                                               $this.hideLoader();\r
+                                       }, function() {\r
+                                               $this.wopen(url, "_blank", 'location=no');\r
+                                               $this.hideLoader();\r
+                                       }, offset);\r
+\r
+                               } catch (err) {\r
                                        $this.wopen(url, "_blank", 'location=no');\r
                                        $this.hideLoader();\r
-                               }, offset);\r
+                               }\r
                                return true;\r
                        }\r
                }\r
@@ -1394,3 +1401,4 @@ Fluidbook.prototype = {
                window.open(url, target, options);\r
        }\r
 }\r
+\r
index 617ad6bb9c4e39daaf47121824eadf9ba57662a6..12733061d2429603e7ac02312630be32292e01a6 100644 (file)
@@ -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() {