--- /dev/null
+function FluidbookPrivacy(fluidbook) {
+ this.fluidbook = fluidbook;
+ this.storageKey = 'cookieConsent';
+ if (location.host == 'workshop.fluidbook.com') {
+ this.storageKey = 'fluidbook.' + fluidbook.datas.id + this.storageKey;
+ }
+ if (!this.fluidbook.datas.cookieConsent) {
+ return;
+ }
+ this.init();
+}
+FluidbookPrivacy.prototype = {
+ init: function () {
+ if (localStorage.getItem(this.storageKey) == '1') {
+ return;
+ }
+
+ var $this = this;
+ $(this.fluidbook).on('fluidbookhidesplash', function () {
+ $this.displayCookieConsent();
+ });
+ },
+ displayCookieConsent: function () {
+ var $this = this;
+ $('body').append('<div id="cookieConsent"><a href="#" class="close"></a><p>' + this.fluidbook.datas.cookieConsentMessage + '</p></div>');
+ if (this.fluidbook.datas.cookieConsentAutoclose > 0) {
+ setTimeout(function () {
+ $this.close();
+ }, this.fluidbook.datas.cookieConsentAutoclose * 1000);
+ }
+ $("#cookieConsent a.close").on('touchend click', function () {
+ $this.close();
+ return false;
+ });
+ },
+ close: function () {
+ // hide
+ $('#cookieConsent').fadeOut();
+ // set the flag to avoid to display it for the next fisit
+ localStorage.setItem(this.storageKey, '1');
+ },
+}
\ No newline at end of file
+// Even if the support of this feature is very wide, this polyfill must be kept :\r
+// Safari & Android browsers disable the support of this feature when in private tab\r
try {\r
// Test webstorage existence.\r
if (!window.localStorage || !window.sessionStorage) throw "exception";\r
transform-origin: 0 0;
margin: 20px 0 0 -10px;
}
+/* Privacy settings */
+#cookieConsent {
+ background-color: rgba(0, 0, 0, 0.8);
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ padding: 20px 40px;
+ z-index: 20;
+}
+#cookieConsent a.close {
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ padding: 20px;
+ background-image: url("../images/close.svg");
+ background-size: 16px 16px;
+ background-repeat: no-repeat;
+ background-position: 20px 20px;
+ width: 56px;
+ height: 56px;
+}
+#cookieConsent p {
+ text-align: center;
+ color: #ffffff;
+ font-size: 15px;
+ margin: 0 auto;
+ max-width: 1100px;
+}
+#cookieConsent p a {
+ white-space: nowrap;
+ text-decoration: underline;
+}
+/* Zoom on double tap */
#zoomguides {
width: 100%;
height: 100%;
margin: 20px 0 0 -10px;
}
+/* Privacy settings */
+
+#cookieConsent {
+ background-color: rgba(0, 0, 0, 0.8);
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ padding: 20px 40px;
+ z-index: 20;
+ a.close {
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ padding: 20px;
+ background-image: url("../images/close.svg");
+ background-size: 16px 16px;
+ background-repeat: no-repeat;
+ background-position: 20px 20px;
+ width: 56px;
+ height: 56px;
+ }
+ p {
+ text-align: center;
+ color: #ffffff;
+ font-size: 15px;
+ margin: 0 auto;
+ max-width: 1100px;
+ a {
+ white-space: nowrap;
+ text-decoration: underline;
+ }
+ }
+
+}
+
+/* Zoom on double tap */
+
#zoomguides {
width: 100%;
height: 100%;