]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5985 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 2 Jun 2023 04:59:17 +0000 (06:59 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 2 Jun 2023 04:59:17 +0000 (06:59 +0200)
app/Models/FluidbookPublication.php
public/packages/fluidbook/toolbox/css/style.less
resources/linkeditor/js/linkeditor.loader.js
resources/linkeditor/js/linkeditor.resize.js
resources/linkeditor/js/linkeditor.utils.js

index 302945d976d0e578be8b6e098af5a63fedef0910..2b83524c450c514afd815c0dbfa1460b296fdf8a 100644 (file)
@@ -108,10 +108,11 @@ class FluidbookPublication extends ToolboxSettingsModel
                 'type' => Hidden::class,
                 'read_only' => true,
                 'column' => true,
-                'column_type' => 'textwrap',
-                'column_view_namespace' => CubistBackpackServiceProvider::NAMESPACE . '::columns',
+                'column_type' => 'model_function',
+                'column_function_name' => 'getTitleForColumn',
                 'column_move_after' => 'id',
                 'column_limit' => 150,
+                'column_escape' => false,
             ],
             'c_pages' => [
                 'label' => __('Pages'),
@@ -640,6 +641,15 @@ class FluidbookPublication extends ToolboxSettingsModel
         return true;
     }
 
+    public function getTitleForColumn()
+    {
+        $more = '';
+        if ($this->mobileNavigationType === 'mobilefirst') {
+            $more .= '&nbsp;<i class="fluidbook-title-icon las la-mobile"></i>';
+        }
+        return '<span style="white-space: normal;">' . e($this->c_title) . $more . '</span>';
+    }
+
     public function allowsDownload()
     {
         if ($this->id < WorkshopMigration::WS3_BOOK_ID) {
index 55dbcb19e372dd22d41a543dff297c68d1b6f143..782aa9644657c17eee75c2cf67123a0331ce1f62 100644 (file)
@@ -479,3 +479,7 @@ table.dataTable thead > tr > th.sorting_asc::before, table.dataTable thead > tr
 }
 
 table.dataTable thead .sorting::before, table.dataTable thead .sorting::after, table.dataTable thead .sorting_asc::before, table.dataTable thead .sorting_asc::after, table.dataTable thead .sorting_desc::before, table.dataTable thead .sorting_desc::after, table.dataTabl
+
+.fluidbook-title-icon{
+    font-size: 120%;
+}
index cdcd27d4305028d1d128221c42dc010a510bdc67..b45a6a830adf9105e1aead7873540952b5ad2da4 100644 (file)
@@ -16,15 +16,6 @@ LinkeditorLoader.prototype = {
     loadPage: function (p, side) {
         var container = $("#linkeditor-page-" + side);
         $(container).attr('data-page', p);
-        if (this.linkeditor.utils.isSpecialPage(p)) {
-            var dim = this.linkeditor.utils.getPageDimensions(p);
-            $("#linkeditor-fluidbook").css({width: dim[0], height: dim[1]});
-            $(container).css({width: dim[0], height: dim[1]});
-        } else if (this.linkeditor.mobileFirst) {
-            let h = this.linkeditor.utils.getPageDimensions(p)[1];
-            $("#linkeditor-fluidbook").css('height', h);
-            $(container).css('height', h);
-        }
 
         if (p === 0 || p > FLUIDBOOK_DATA.settings.pages) {
             $(container).html('');
@@ -32,6 +23,8 @@ LinkeditorLoader.prototype = {
             this._loadPage(p, container);
         }
 
+        this.linkeditor.resize.resizePages();
+
         this.linkeditor.links.loadLinks(p, side);
         this.linkeditor.rulers.loadRulers(p, side);
     },
index 4729effd8e8a4b3e4f61855b4004c99034266807..9d93171ffd4a9b8b77eff30cdaa15fe862a01fda 100644 (file)
@@ -30,22 +30,7 @@ LinkeditorResize.prototype = {
             $("#linkeditor").addClass('double').removeClass('single');
         }
 
-        if (special) {
-            var dim = this.linkeditor.utils.getPageDimensions();
-            $('.linkeditor-page,#linkeditor-fluidbook').css({
-                width: dim[0], height: dim[1]
-            });
-        } else {
-            $('.linkeditor-page').css({
-                width: this.linkeditor.pw, height: this.linkeditor.ph
-            });
-
-            $("#linkeditor-page-right").css({left: this.linkeditor.pw})
-            $('#linkeditor-fluidbook').css({
-                width: this.linkeditor.fw, height: this.linkeditor.ph
-            });
-        }
-
+        this.resizePages();
         this.updateWindowDimensions();
         this.resizeMain();
         this.resizeCanvas();
@@ -58,6 +43,29 @@ LinkeditorResize.prototype = {
         }
     },
 
+    resizePages: function () {
+        let $this = this;
+        let dimCover = $this.linkeditor.utils.getPageDimensions(1);
+
+        $(".linkeditor-page[data-page]").each(function () {
+            let p = $(this).attr('data-page');
+            let dim = $this.linkeditor.utils.getPageDimensions(p);
+            let pw = dim[0];
+            let ph = dim[1];
+            if ($this.linkeditor.utils.isSpecialPage(p)) {
+
+            } else if ($this.linkeditor.mobileFirst) {
+                pw = dimCover[0];
+            } else {
+                pw = dimCover[0];
+                ph = dimCover[1];
+            }
+            $("#linkeditor-fluidbook").css({width: pw, height: ph});
+            $(this).css({width: pw, height: ph});
+        });
+
+    },
+
     resizeMain: function () {
         $("#linkeditor-main").css('width', this.ww - $('#linkeditor-left').outerWidth() - $('#linkeditor-right').outerWidth());
     },
index 2642c1c2d313ec97cbc5f839b164da6b20958a6a..00e5c175838e9dd88cb7847a8e2f1f597adfd01c 100644 (file)
@@ -41,6 +41,8 @@ LinkeditorUtils.prototype = {
             } else {
                 return THEME[page]['dim'];
             }
+        } else {
+            page = parseInt(page);
         }
         return FLUIDBOOK_DATA.page_dimensions[page];
     },