]> _ Git - fluidbook-html5.git/commitdiff
wait #7473 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Apr 2025 17:47:28 +0000 (19:47 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Apr 2025 17:47:28 +0000 (19:47 +0200)
js/libs/fluidbook/fluidbook.bookmarks.js
js/libs/fluidbook/fluidbook.links.js

index 3c9eb3b69ce871821011dba9ea994fae68f789ea..2ef3155d0933f447d52106bb98cdc744efe6e4bb 100644 (file)
@@ -135,7 +135,7 @@ FluidbookBookmarks.prototype = {
     },
 
     getPDF: function () {
-        return this.fluidbook.service.getBaseURL(true) + 'e/'+this.fluidbook.settings.id+'-' +this.fluidbook.settings.cid + '/' + this.getBookmarksCompacted();
+        return this.fluidbook.service.getBaseURL(true) + 'e/' + this.fluidbook.settings.id + '-' + this.fluidbook.settings.cid + '/' + this.getBookmarksCompacted();
     },
 
     getBookmarksCompacted: function () {
@@ -364,7 +364,9 @@ FluidbookBookmarks.prototype = {
             this.bookmarks = arrayRemove(this.bookmarks, pages[i]);
         }
         this.updateBookmarks();
-    }, updateBookmarks: function () {
+    },
+
+    updateBookmarks: function () {
         this.saveBookmarks();
         var $this = this;
 
@@ -372,9 +374,13 @@ FluidbookBookmarks.prototype = {
         $.each(this.bookmarks, function (k, v) {
             $this.setCornersEnabled(v, true);
         });
-    }, saveBookmarks: function () {
+    },
+
+    saveBookmarks: function () {
         this.fluidbook.cache.set('bookmarks', this.bookmarks);
-    }, getSavedBookmarks: function () {
+    },
+
+    getSavedBookmarks: function () {
         var res = [];
         if (this.fluidbook.cache.isset('bookmarks')) {
             res = this.fluidbook.cache.get('bookmarks');
@@ -383,14 +389,20 @@ FluidbookBookmarks.prototype = {
             }
         }
         return res;
-    }, isBookmarked: function (page) {
+    },
+
+    isBookmarked: function (page) {
         return this.areBookmarksAllowedOn(page) && this.bookmarks.indexOf(page) > -1;
-    }, areBookmarksAllowedOn: function (pageNr) {
+    },
+
+    areBookmarksAllowedOn: function (pageNr) {
         if (pageNr === 0 || pageNr > this.fluidbook.settings.pages) {
             return false;
         }
         return this.fluidbook.settings.bookmarkDisablePages.indexOf(pageNr) === -1;
-    }, getBookmarkForPage: function (pageNr, allwaysAtRight, permanentIcon) {
+    },
+
+    getBookmarkForPage: function (pageNr, allwaysAtRight, permanentIcon, keyboardShortcut) {
         if (!this.areBookmarksAllowedOn(pageNr)) {
             return '';
         }
@@ -427,7 +439,10 @@ FluidbookBookmarks.prototype = {
 
         var virtual = this.fluidbook.physicalToVirtual(pageNr);
         bookmarks += "<a href=\"#\" class=\"bookmark " + side + "\" data-page=\"" + pageNr + "\"";
-        bookmarks += ' aria-keyshortcuts="' + shortcut + '" role="button"'
+        if (keyboardShortcut===true) {
+            bookmarks += ' aria-keyshortcuts="' + shortcut + '"';
+        }
+        bookmarks += ' role="button"';
         if (this.isBookmarked(pageNr)) {
             bookmarks += " data-enabled=\"enabled\"";
             bookmarks += " data-tooltip=\"" + this._txtRemove + "\"";
@@ -440,7 +455,9 @@ FluidbookBookmarks.prototype = {
         bookmarks += '>' + getSpriteIcon('bookmark-corner') + '</a>';
 
         return bookmarks;
-    }, getView: function (title, downloadLabel) {
+    },
+
+    getView: function (title, downloadLabel) {
         var c = this.getIndex(false, false, downloadLabel);
         if (c === false) {
             return c;
@@ -453,7 +470,9 @@ FluidbookBookmarks.prototype = {
         index += c;
         index += '</div>';
         return index;
-    }, hasBookmarkedPages: function (all) {
+    },
+
+    hasBookmarkedPages: function (all) {
         if (all === undefined) {
             all = false;
         }
@@ -468,7 +487,9 @@ FluidbookBookmarks.prototype = {
             return false;
         }
         return true;
-    }, getIndex: function (all, onlyGroup, downloadLabel) {
+    },
+
+    getIndex: function (all, onlyGroup, downloadLabel) {
         if (all === undefined) {
             all = false;
         }
@@ -555,7 +576,7 @@ FluidbookBookmarks.prototype = {
                 index += '<div class="doubleThumb simple left"' + dim.doublethumb + ' page="' + group.page + '" data-pages="' + pages.join(',') + '">';
                 index += this.fluidbook.menu.index._thumb(group.page, 'left', this.fluidbook.mobilefirst.enabled ? undefined : 100, group.name);
                 if (this.fluidbook.bookmarks.enabled) {
-                    index += this.fluidbook.bookmarks.getBookmarkForPage(group.page, true, true);
+                    index += this.fluidbook.bookmarks.getBookmarkForPage(group.page, true, true,false);
                 }
                 index += '</div></div>';
             }
index e03b155311245f1931e9622027d03fa40b01815b..9293dc003b06d2aaade0486765d409f81dbe6cd0 100644 (file)
@@ -759,7 +759,7 @@ FluidbookLinks.prototype = {
             container.addClass('empty');
         }
         if (this.fluidbook.settings.bookmark) {
-            let b = this.fluidbook.bookmarks.getBookmarkForPage(page, this.fluidbook.displayOnePage, this.fluidbook.settings.bookmarkPermanentIcon);
+            let b = this.fluidbook.bookmarks.getBookmarkForPage(page, this.fluidbook.displayOnePage, this.fluidbook.settings.bookmarkPermanentIcon, true);
             if (this.fluidbook.settings.bookmarkPosition === 'page') {
                 container.append(b);
             } else {