]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 4 Oct 2013 17:49:05 +0000 (17:49 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 4 Oct 2013 17:49:05 +0000 (17:49 +0000)
_index.html
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.l10n.js

index 64471236d88b8229f369fa997030969fb128f7f6..2bd28589b0dedcbd0da5d90e60e3dacb0f7fcda1 100644 (file)
@@ -12,7 +12,7 @@
                <!-- $script -->\r
                <!-- $ga -->\r
        </head>\r
-       <body>\r
+       <body style="background-color:#<!-- $bgcolor -->;">\r
                <div id="message"></div>\r
 \r
                <div id="main">\r
index db0ff92d7f85f0332392976fcc7ba5f3b5271b55..42ef1a0aa881237efedccddc72d00af6914258da 100644 (file)
@@ -98,16 +98,17 @@ Fluidbook.prototype = {
                if ($("#splash").length == 0) {\r
                        return;\r
                }\r
+               try {\r
+                       console.log('hide splash');\r
+                       navigator.splashscreen.hide();\r
+               } catch (err) {\r
+                       console.warn('error trying hide splash');\r
+               }\r
+\r
                this.loader.canPreload();\r
                var $this = this;\r
                setTimeout(function() {\r
                        $this._hideSplash();\r
-                       try {\r
-                               console.log('hide splash');\r
-                               navigator.splashscreen.hide();\r
-                       } catch (err) {\r
-                               console.warn('error trying hide splash');\r
-                       }\r
                }, 3000);\r
        },\r
        _hideSplash: function() {\r
index d86b7d43115984ba28343c44c0969ae3e19fccf3..ed83475af46442908888e3a0e12c6bc8e7074d6e 100644 (file)
@@ -36,11 +36,16 @@ FluidbookL10N.prototype = {
                var forceLocales = window.sessionStorage.getItem('locales');
                console.log('force Locales ' + forceLocales);
                var force = false;
-               if (forceLocales === null) {
+               if (forceLocales === undefined || forceLocales === null || forceLocales === 'undefined') {
                        force = false;
                } else {
                        force = true;
-                       forceLocales = JSON.parse(forceLocales);
+                       try {
+                               forceLocales = JSON.parse(forceLocales);
+                       } catch (err) {
+                               force = false;
+                               console.warn("error parsing forceLocales :: " + forceLocales);
+                       }
                }
 
                if (this.fluidbook.datas.multilang == '') {
@@ -66,14 +71,22 @@ FluidbookL10N.prototype = {
 
                        var url = l[2];
                        if (force) {
+                               var publications = forceLocales[l[0]];
+                               var pubid = publications[0];
+
                                try {
-                                       url = '../' + forceLocales[l[0]] + '/index.html';
+                                       url = window.location.toString();
+                                       url.replace(/\/this.fluidbook.datas.id\//, "/" + pubid + "/");
+
+                                       if (this.fluidbook.datas.id == pubid) {
+                                               url = '';
+                                       }
                                } catch (err) {
                                        url = '';
                                }
                        }
 
-                       var o = {lang: l[0], flag: l[1], url: l[2], langName: l[3], countryName: l[4]};
+                       var o = {lang: l[0], flag: l[1], url: url, langName: l[3], countryName: l[4]};
 
                        $this.multilang[$this.multilang.length] = o;
                });