From a61d556421f505cbdec0067857c9bb54a088b3ab Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 25 Apr 2025 10:27:20 +0200 Subject: [PATCH] wip #7498 @3 --- app/SubForms/Link/Base.php | 3 +- config/app.php | 2 +- package-lock.json | 8 ++++- package.json | 1 + .../linkeditor-stable/js/linkeditor.form.js | 9 ++++-- resources/linkeditor-stable/js/linkeditor.js | 12 ++----- .../style/inc/_bunchmultiple.sass | 32 +++++++++++++++++++ .../linkeditor-stable/style/inc/_form.sass | 2 ++ resources/linkeditor-stable/style/style.sass | 11 ++++++- 9 files changed, 64 insertions(+), 16 deletions(-) create mode 100644 resources/linkeditor-stable/style/inc/_bunchmultiple.sass diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index 43ced01ee..2e1e115b6 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -246,8 +246,7 @@ class Base extends Form */ public function getFilesOrURLEntry() { - $res = ['entry_class' => FluidbookPublication::class, 'entry_id' => $this->getFluidbookId()]; - return $res; + return ['entry_class' => FluidbookPublication::class, 'entry_id' => $this->getFluidbookId()]; } public function addMultimediaFields() diff --git a/config/app.php b/config/app.php index 70c017884..9a3141cdd 100644 --- a/config/app.php +++ b/config/app.php @@ -39,7 +39,7 @@ return [ | */ - 'debug' => !isset($_SERVER['HTTP_X_REAL_IP']) || in_array($_SERVER['HTTP_X_REAL_IP'], ['130.180.213.67', '82.64.156.165']) ? env('APP_DEBUG') : false, + 'debug' => !isset($_SERVER['HTTP_X_REAL_IP']) || in_array($_SERVER['HTTP_X_REAL_IP'], ['176.134.43.17', '82.64.156.165']) ? env('APP_DEBUG') : false, /* |-------------------------------------------------------------------------- diff --git a/package-lock.json b/package-lock.json index ad5c885de..c0e2cf0d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "application", + "name": "FluidbookToolbox", "lockfileVersion": 3, "requires": true, "packages": { @@ -32,6 +32,7 @@ "select2-bootstrap-theme": "^0.1.0-beta.10", "semver": "^7.5.4", "simplebar": "^6.2.5", + "sortablejs": "^1.15.6", "spectrum-colorpicker": "^1.8.1", "split-type": "^0.3.4", "swiper": "^11.0.5", @@ -11176,6 +11177,11 @@ "node": ">= 14" } }, + "node_modules/sortablejs": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.6.tgz", + "integrity": "sha512-aNfiuwMEpfBM/CN6LY0ibyhxPfPbyFeBTYJKCvzkJ2GkUpazIt3H+QIPAMHwqQ7tMKaHz1Qj+rJJCqljnf4p3A==" + }, "node_modules/source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", diff --git a/package.json b/package.json index a0eb11b02..3ac00ed3f 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "select2-bootstrap-theme": "^0.1.0-beta.10", "semver": "^7.5.4", "simplebar": "^6.2.5", + "sortablejs": "^1.15.6", "spectrum-colorpicker": "^1.8.1", "split-type": "^0.3.4", "swiper": "^11.0.5", diff --git a/resources/linkeditor-stable/js/linkeditor.form.js b/resources/linkeditor-stable/js/linkeditor.form.js index 88782a380..6b86813b3 100644 --- a/resources/linkeditor-stable/js/linkeditor.form.js +++ b/resources/linkeditor-stable/js/linkeditor.form.js @@ -237,8 +237,12 @@ LinkeditorForm.prototype = { emptyForm: function () { $('#linkeditor-panel-form .select2_from_array').each(function () { - $(this).select2('close'); - $(this).select2('destroy'); + try { + $(this).select2('close'); + $(this).select2('destroy'); + }catch (e){ + + } }); $('#linkeditor-panel-form').html(''); }, @@ -265,6 +269,7 @@ LinkeditorForm.prototype = { this.initSelect2(); this.initSpectrum(); + $(".bunchmultiple").bunchmultiple(); if ($(link).is('.new')) { this.focusAndSelectDestinationField(); diff --git a/resources/linkeditor-stable/js/linkeditor.js b/resources/linkeditor-stable/js/linkeditor.js index 7eece39a1..6cd5be7a8 100644 --- a/resources/linkeditor-stable/js/linkeditor.js +++ b/resources/linkeditor-stable/js/linkeditor.js @@ -1,10 +1,6 @@ import tippy from 'tippy.js'; -import 'tippy.js/dist/tippy.css'; - +import '../../../vendor/cubist/cms-back/src/public/bunchmultiple/bunchmultiplemodule'; import Noty from "noty"; -import 'noty/lib/noty.css'; -import 'noty/lib/themes/mint.css'; - import GrahamScan from "@lucio/graham-scan"; import LinkeditorLinks from './linkeditor.links'; @@ -50,15 +46,13 @@ function keyfilter(event, disable = false) { require('jquery.scrollto'); require('jquery-contextmenu'); -import 'jquery-contextmenu/dist/jquery.contextMenu.css'; + require('jquery-form'); require('spectrum-colorpicker'); -import 'spectrum-colorpicker/spectrum.css'; require('select2'); -import 'select2/dist/css/select2.css'; -import 'select2-bootstrap-theme/dist/select2-bootstrap.css'; + import * as noty from "noty"; window.MD5 = require("crypto-js/md5"); diff --git a/resources/linkeditor-stable/style/inc/_bunchmultiple.sass b/resources/linkeditor-stable/style/inc/_bunchmultiple.sass new file mode 100644 index 000000000..f27dd89c8 --- /dev/null +++ b/resources/linkeditor-stable/style/inc/_bunchmultiple.sass @@ -0,0 +1,32 @@ +@import '../../../vendor/cubist/cms-back/src/public/bunchmultiple/bunchmultiple.css' + +.bunchmultiple + margin: 0 + + .bunchmultiple__wrapper .item + .legend + background-color: rgba(0, 0, 0, 0.15) + color: var(--form-text-color) + @include dark-theme + background-color: rgba(255, 255, 255, 0.15) + border-radius: 5px 5px 0 0 + + a.action + color: var(--form-text-color) + + + .subform + background-color: rgba(0, 0, 0, 0.08) + @include dark-theme + background-color: rgba(255, 255, 255, 0.08) + padding: 10px + border-radius: 0 0 5px 5px + + &.collapsed + .legend + border-radius: 5px + + button + .add_item + font-size: 12px + padding: 3px 6px diff --git a/resources/linkeditor-stable/style/inc/_form.sass b/resources/linkeditor-stable/style/inc/_form.sass index 9c6fe12f7..d880237a5 100644 --- a/resources/linkeditor-stable/style/inc/_form.sass +++ b/resources/linkeditor-stable/style/inc/_form.sass @@ -126,6 +126,8 @@ button padding-top: 15px border-top: 1px solid var(--form-text-color) margin-top: 20px + white-space: normal + p.help-block color: var(--form-text-color) diff --git a/resources/linkeditor-stable/style/style.sass b/resources/linkeditor-stable/style/style.sass index 48a0d47a5..5dc36d674 100644 --- a/resources/linkeditor-stable/style/style.sass +++ b/resources/linkeditor-stable/style/style.sass @@ -1,3 +1,12 @@ +@import 'tippy.js/dist/tippy.css' +@import 'noty/lib/noty.css' +@import 'noty/lib/themes/mint.css' +@import 'spectrum-colorpicker/spectrum.css' +@import 'jquery-contextmenu/dist/jquery.contextMenu.css' +@import 'select2/dist/css/select2.css' +@import 'select2-bootstrap-theme/dist/select2-bootstrap.css' +@import url('https://cdnjs.cloudflare.com/ajax/libs/line-awesome/1.3.0/line-awesome/css/line-awesome.min.css') + @import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap') @import "inc/_variables" @import "inc/_mixins" @@ -203,4 +212,4 @@ body, #linkeditor, html @import "inc/_popup" @import "inc/_contextmenu" @import "inc/_layers" - +@import "inc/_bunchmultiple" -- 2.39.5