]> _ Git - fluidbook-html5.git/commitdiff
wait #2687 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 16 May 2019 13:28:37 +0000 (15:28 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 16 May 2019 13:28:37 +0000 (15:28 +0200)
js/libs/fluidbook/fluidbook.share.js

index 0e7b8d2083ad556f912597d03d45ea429ed1bfa3..aaeaba83e1df16cd8ac68e4524f06f5257fbcd9d 100644 (file)
@@ -2,11 +2,11 @@ function FluidbookShare(fluidbook) {
     this.fluidbook = fluidbook;
     if (this.isEnabled()) {
         var $this = this;
-        if (this.fluidbook.datas.phonegap != 'android') {
+        if (this.fluidbook.datas.phonegap !== 'android') {
             $(document).on('click', '.share', function () {
                 var f = 'send' + ucfirst($(this).data('service'));
                 var url = $(this).data("url");
-                if (url == undefined || url == null || url == 'undefined') {
+                if (url === undefined || url === null || url === 'undefined') {
                     url = '';
                 }
                 $this[f](url);
@@ -35,7 +35,7 @@ function FluidbookShare(fluidbook) {
             }
         });
 
-        if (this.fluidbook.datas.phonegap == 'android') {
+        if (this.fluidbook.datas.phonegap === 'android') {
             $(document).on('click', '#shareLinks, #shareLinks a', function (e) {
                 e.stopPropagation();
                 e.stopImmediatePropagation();
@@ -54,6 +54,10 @@ FluidbookShare.prototype = {
 
     getFluidbookURL: function () {
         var l = window.location.toString();
+        if (this.fluidbook.datas.restrictPrintDownload !== "") {
+            l = l.replace('?' + this.fluidbook.datas.restrictPrintDownload, '');
+            l = l.replace(this.fluidbook.datas.restrictPrintDownload, '');
+        }
         var e = l.split("#");
         return e[0];
     },
@@ -66,7 +70,7 @@ FluidbookShare.prototype = {
         if (url == '') {
             var res = false;
             if (this.fluidbook.support.offline || this.fluidbook.datas.phonegap) {
-                if (this.fluidbook.datas.offlineLink != '' && this.fluidbook.datas.offlineLink != 'http://') {
+                if (this.fluidbook.datas.offlineLink !== '' && this.fluidbook.datas.offlineLink !== 'http://') {
                     res = this.fluidbook.datas.offlineLink;
                 }
             } else {
@@ -180,7 +184,7 @@ FluidbookShare.prototype = {
 
     openShare: function (url, p2, callback) {
         var view;
-        if (url == undefined || url == null || url == 'undefined' || !url) {
+        if (url === undefined || url === null || url === 'undefined' || !url) {
             url = '';
         }