]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5468 @4
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 13 Oct 2022 16:04:40 +0000 (18:04 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 13 Oct 2022 16:04:40 +0000 (18:04 +0200)
resources/linkeditor/js/linkeditor.js
resources/linkeditor/js/linkeditor.resize.js
resources/linkeditor/js/linkeditor.toolbar.js
resources/linkeditor/style/panels.sass [new file with mode: 0644]
resources/linkeditor/style/style.sass
resources/linkeditor/style/variables.sass
resources/views/fluidbook_publication/link_editor.blade.php

index b57653b2c550d96f05e785b0d8fb274de86f2ef6..21e54b9461d4e6e34a7f964a0e3c2de632a38e2d 100644 (file)
@@ -53,6 +53,13 @@ LinkEditor.prototype = {
         this.save = new LinkeditorSave(this);
 
         this.initEvents();
+        this.initIcons();
+    },
+
+    initIcons:function(){
+        $("#linkeditor [data-icon]").each(function () {
+            $(this).append(getSpriteIcon('linkeditor-' + $(this).data('icon')));
+        });
     },
 
     initEvents: function () {
index 7f3aa4495fa1041b2a366c6ba5768fba6265d597..bbde620d72ed7079f47c7619c92ca9220559cb0a 100644 (file)
@@ -12,10 +12,17 @@ LinkeditorResize.prototype = {
     },
 
     resize: function () {
+        this.ww = $(window).outerWidth();
+        this.hh = $(window).outerHeight();
+        this.resizeMain();
         this.resizeCanvas();
         this.linkeditor.rulers.updateRulers();
     },
 
+    resizeMain: function () {
+        $("#linkeditor-main").css('width', this.ww - $('#linkeditor-left').outerWidth() - $('#linkeditor-right').outerWidth());
+    },
+
     resizeCanvas: function () {
         this.linkeditor.canvasRect = $("#linkeditor-canvas").get(0).getBoundingClientRect();
         this.linkeditor.editorRect = $("#linkeditor-editor").get(0).getBoundingClientRect();
index 4c4e705f636f204766407e5cd425e92e6fa4194f..3c7dac2deac19e43c3f65f2d084d006cd73f8d3a 100644 (file)
@@ -12,10 +12,6 @@ LinkeditorToolbar.prototype = {
             return false;
         });
 
-        $("#linkeditor-toolbar [data-icon]").each(function () {
-            $(this).append(getSpriteIcon('linkeditor-' + $(this).data('icon')));
-        });
-
         $("[data-key]").each(function () {
             let e = $(this);
             key($(this).data('key'), function () {
diff --git a/resources/linkeditor/style/panels.sass b/resources/linkeditor/style/panels.sass
new file mode 100644 (file)
index 0000000..237a54d
--- /dev/null
@@ -0,0 +1,70 @@
+.linkeditor-sidebar
+    min-width: $sidebar-icons-width
+    background-color: #EBECEE
+    position: relative
+
+    @media (prefers-color-scheme: dark)
+        background-color: #333
+
+    nav
+        position: absolute
+        width: $sidebar-icons-width
+        height: 100%
+
+        [data-icon]
+            display: inline-block
+            vertical-align: top
+            height: 30px
+            min-width: 30px
+            padding: 5px
+            border-radius: 5px
+            margin: 6px 0 0 7px
+            text-align: center
+            color: $toolbar-color
+            @media (prefers-color-scheme: dark)
+                color: $toolbar-color-dark
+
+            &:hover, &.hover
+                background-color: #fff
+                @media (prefers-color-scheme: dark)
+                    background-color: #000
+
+            svg
+                position: relative
+                top: 1px
+                height: 18px
+                width: auto
+
+
+    .handle
+        position: absolute
+        right: 0
+        width: 2px
+        height: 100%
+        background-color: #aaa
+        @media (prefers-color-scheme: dark)
+            background-color: #666
+        cursor: col-resize
+
+    .linkeditor-panel
+        display: none
+        margin-left: $sidebar-icons-width
+
+        background: $panel-background
+        height: 100%
+        @media (prefers-color-scheme: dark)
+            background-color: #111
+
+    &#linkeditor-right
+        border-width: 0 0 0 2px
+
+        [data-icon]
+            margin-left: 9px
+
+        .handle
+            right: auto
+            left: 0
+
+        .linkeditor-panel
+            margin-left: 0
+            margin-right: $sidebar-icons-width
index 26e8092add6dfc02cf5f0d5e7ac0bbcdbb6d051f..2164e156509773733fd8255b6d324066f61418c9 100644 (file)
@@ -24,21 +24,13 @@ body, #linkeditor, html
     font-size: 0
     overflow: hidden
 
-    aside, #linkeditor-main
+    .linkeditor-sidebar, #linkeditor-main
         display: inline-block
         height: 100%
         vertical-align: top
         text-align: left
 
-    aside
-        width: $sidebar-width
-        background-color: #EBECEE
-        @media (prefers-color-scheme: dark)
-            background-color: #333
-
     #linkeditor-main
-        width: calc(100% - $sidebar-width - $sidebar-width)
-
         &.grab
             cursor: grab
 
@@ -148,6 +140,7 @@ body, #linkeditor, html
 #linkeditor-preload
     display: none
 
+@import "panels"
 @import "toolbar"
 @import "rulers"
 @import "links"
index 06908ce24def761b8a2ec42c1451fb437322ac7b..ab1fc21e221fb530f6ff29867e48a52f5f4e1d02 100644 (file)
@@ -1,8 +1,10 @@
 $font-size: 16px
-$sidebar-width: 40px
+$sidebar-icons-width: 46px
 $rulers-size: 16px
 $ruler-margin: 2px
 
 $toolbar-height: 40px
 $toolbar-color: #5d5d5d
 $toolbar-color-dark: #bbb
+
+$panel-background: #ebecee
index 307ac6b404d18976052fb14f041cb0fd2c689258..94232c4dcc0a848aa2228bc421db8a9de7b59701 100644 (file)
 @section('content')
     @include('fluidbook_publication.link_editor_icons')
     <div draggable="false" id="linkeditor">
-        <aside id="linkeditor-left"></aside>
+        <aside id="linkeditor-left" class="linkeditor-sidebar">
+            <nav id="linkeditor-left-icons">
+                <a href="#" data-icon="layers" data-action="panel.toggle.layers" data-tooltip="{{__('Liste des liens')}} (F7)"
+                   data-key="F7"></a>
+            </nav>
+            <div id="linkeditor-left-panel" class="linkeditor-panel open">
+
+            </div>
+            <div class="handle"></div>
+        </aside>
         <div id="linkeditor-main">
             <div draggable="false" id="linkeditor-toolbar">
                 <nav id="linkeditor-toolbar-left">
                 </div>
             </div>
         </div>
-        <aside id="linkeditor-right"></aside>
+        <aside id="linkeditor-right" class="linkeditor-sidebar">
+            <nav id="linkeditor-left-icons">
+                <a href="#" data-icon="settings" data-action="panel.toggle.form" data-tooltip="{{__('Afficher le formulaire')}} (F8)"
+                   data-key="F8"></a>
+            </nav>
+            <div id="linkeditor-left-panel" class="linkeditor-panel open"></div>
+            <div class="handle"></div>
+        </aside>
     </div>
     <div id="linkeditor-preload"></div>
 @endsection