]> _ Git - fluidbook-html5.git/commitdiff
wait #2687 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 7 May 2019 14:31:56 +0000 (16:31 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 7 May 2019 14:31:56 +0000 (16:31 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.secure.js [new file with mode: 0644]

index 80626b7b1716fc9ea87d3acc73f97c674e6fd9ca..0a1335f49b5ccd0a6e131901f74c5dce2cb328b5 100644 (file)
@@ -32,6 +32,7 @@ Fluidbook.prototype = {
         if (this.datas.landingPage != undefined && this.datas.landingPage != '') {
             this.landingpage = new FluidbookLandingPage(this);
         }
+        this.secure = new FluidbookSecure(this);
         this.contentlock = new FluidbookContentLock(this);
         this.menu = new FluidbookMenu(this);
         this.support = new FluidbookSupport(this);
diff --git a/js/libs/fluidbook/fluidbook.secure.js b/js/libs/fluidbook/fluidbook.secure.js
new file mode 100644 (file)
index 0000000..4b432b4
--- /dev/null
@@ -0,0 +1,23 @@
+function FluidbookSecure(fluidbook) {
+    this.fluidbook = fluidbook;
+    this.init();
+}
+
+FluidbookSecure.prototype = {
+    init: function () {
+        if (this.fluidbook.datas.restrictPrintDownload !== '') {
+            if (window.location.search.indexOf(this.fluidbook.datas.restrictPrintDownload) === -1) {
+                if (this.fluidbook.datas.restrictPrint) {
+                    this.fluidbook.datas.print = false;
+                }
+                if (this.fluidbook.datas.restrictDownload) {
+                    this.fluidbook.datas.pdf = false;
+                }
+
+                if (this.fluidbook.datas.restrictSendBookmark) {
+                    this.fluidbook.datas.bookmarkSendEnable = false;
+                }
+            }
+        }
+    },
+};
\ No newline at end of file