]> _ Git - fluidbook-html5.git/commitdiff
wip #2449 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 19 Dec 2018 15:49:14 +0000 (16:49 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 19 Dec 2018 15:49:14 +0000 (16:49 +0100)
js/libs/fluidbook/fluidbook.menu.js

index a503b909f890462dcced6ba51bfe323766020942..61570a2030c0f75a6997da6cc9be868669b90289 100644 (file)
@@ -60,11 +60,20 @@ FluidbookMenu.prototype = {
     },
     __openView: function (view, param1, param2, callback) {
 
-        if (typeof param1 === 'string') {
-            param1 = decodeURIComponent(param1);
+        try {
+            if (typeof param1 === 'string') {
+                param1 = decodeURIComponent(param1);
+            }
+        }catch (e) {
+            
         }
-        if (typeof param2 === 'string') {
-            param2 = decodeURIComponent(param2);
+        
+        try {
+            if (typeof param2 === 'string') {
+                param2 = decodeURIComponent(param2);
+            }
+        }catch (e) {
+            
         }
 
         var $this = this;
@@ -72,34 +81,34 @@ FluidbookMenu.prototype = {
         var cb = function () {
             $this.openingView(callback, view);
         };
-        if (view == 'index') {
+        if (view === 'index') {
             this.openIndex(this.fluidbook.l10n.__('overview'), undefined, true, cb);
-        } else if (view == 'video') {
+        } else if (view === 'video') {
             this.openVideo(param1, cb);
-        } else if (view == 'audio') {
+        } else if (view === 'audio') {
             this.openAudio(param1, cb);
-        } else if (view == 'webvideo') {
+        } else if (view === 'webvideo') {
             this.openWebVideo(param1, param2, cb);
-        } else if (view == 'multimedia') {
+        } else if (view === 'multimedia') {
             this.openMultimedia(param1, cb);
-        } else if (view == 'chapters') {
-            if (param1 == undefined || param1 == 'undefined' || param1 == null || param1 == '') {
+        } else if (view === 'chapters') {
+            if (param1 === undefined || param1 === 'undefined' || param1 === null || param1 === '') {
                 param1 = 'null';
             }
             this.openChapters(param1, cb);
-        } else if (view == 'archives') {
+        } else if (view === 'archives') {
             this.openArchives($("#nav #archives").data('tooltip'), cb);
-        } else if (view == 'text') {
+        } else if (view === 'text') {
             this.openText(param1, cb);
-        } else if (view == 'slideshow') {
+        } else if (view === 'slideshow') {
             this.openSlideshow(param1, cb);
-        } else if (view == 'iframe') {
+        } else if (view === 'iframe') {
             this.openIframe(param1, cb);
-        } else if (view == 'search') {
+        } else if (view === 'search') {
             this.openSearch(param1, cb);
-        } else if (view == 'print') {
+        } else if (view === 'print') {
             this.openPrint(cb);
-        } else if (view == 'download') {
+        } else if (view === 'download') {
             this.openDownload(cb);
         } else {
             this['open' + camelView](param1, param2, cb);