From: Vincent Vanwaelscappel Date: Wed, 7 Jun 2023 09:31:36 +0000 (+0200) Subject: wait #5997 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=79936df2abd99013c86e985ac72eae0365a6c930;p=fluidbook-toolbox.git wait #5997 @1 --- diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index f617139de..6d9241a5b 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -288,7 +288,7 @@ class Base extends Form */ public static function getDepths(FluidbookPublication $fluidbook) { - $options = ['interactive', 'inline']; + $options = ['interactive', 'inline', 'target']; $combi = []; $configs = []; foreach (self::types() as $type) { diff --git a/package-lock.json b/package-lock.json index 097f0ab09..793ac3c75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "FluidbookToolboxDev", + "name": "FluidbookToolbox", "lockfileVersion": 3, "requires": true, "packages": { @@ -24,6 +24,7 @@ "select2": "^4.1.0-rc.0", "select2-bootstrap-theme": "^0.1.0-beta.10", "spectrum-colorpicker": "^1.8.1", + "tippy": "^0.0.0", "tippy.js": "^6.3.7" }, "devDependencies": { @@ -10068,6 +10069,11 @@ "node": ">=0.6.0" } }, + "node_modules/tippy": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tippy/-/tippy-0.0.0.tgz", + "integrity": "sha512-GOrE/mzoeL4t7Q2Bky+7efOZJKH3W95DZIUez+nUns37jHf8R9PEupuEx9F7HolxX+0fzzpKfas2N+LIlYHXAA==" + }, "node_modules/tippy.js": { "version": "6.3.7", "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", diff --git a/package.json b/package.json index f31ff8704..f44c93fac 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "select2": "^4.1.0-rc.0", "select2-bootstrap-theme": "^0.1.0-beta.10", "spectrum-colorpicker": "^1.8.1", + "tippy": "^0.0.0", "tippy.js": "^6.3.7" } } diff --git a/resources/linkeditor/js/linkeditor.js b/resources/linkeditor/js/linkeditor.js index 1e91c3efa..c16fba7f4 100644 --- a/resources/linkeditor/js/linkeditor.js +++ b/resources/linkeditor/js/linkeditor.js @@ -120,9 +120,10 @@ LinkEditor.prototype = { initTooltips: function () { $('[data-tooltip]:not(.init-tooltip)').each(function () { - tippy($(this).get(0), {content: $(this).data('tooltip')}); + let i = tippy($(this).get(0), {content: $(this).data('tooltip')}); + $(this).addClass('init-tooltip'); + $(this).data('tippyinstance', i) }); - $(this).addClass('init-tooltip'); }, initEvents: function () { diff --git a/resources/linkeditor/js/linkeditor.layers.js b/resources/linkeditor/js/linkeditor.layers.js index d3aa49264..a154ad415 100644 --- a/resources/linkeditor/js/linkeditor.layers.js +++ b/resources/linkeditor/js/linkeditor.layers.js @@ -22,6 +22,15 @@ LinkeditorLayers.prototype = { $this.linkeditor.form.updateLinkForm(); }); + $(document).on('click', '#linkeditor-panel-layers label span.uid', function () { + navigator.clipboard.writeText($(this).attr('fb-uid')); + let tippy=$(this).data('tippyinstance'); + console.log(tippy); + tippy.setContent(TRANSLATIONS.id_copied); + tippy.show(); + return false; + }); + this.update(); }, @@ -41,7 +50,7 @@ LinkeditorLayers.prototype = { if (dest === '') { dest = '' + TRANSLATIONS.empty + ''; } - var l = ''; + var l = ''; let level = Math.floor(parseInt($(this).attr('fb-calc-depth')) / 10); layers.push({ level: level, @@ -63,6 +72,7 @@ LinkeditorLayers.prototype = { this.updateSelection(); + this.linkeditor.initTooltips(); }, updateSelection() { diff --git a/resources/linkeditor/style/inc/_layers.sass b/resources/linkeditor/style/inc/_layers.sass index 9506bca51..ac571857c 100644 --- a/resources/linkeditor/style/inc/_layers.sass +++ b/resources/linkeditor/style/inc/_layers.sass @@ -9,10 +9,10 @@ padding: 3px 10px font-style: italic font-weight: 500 - background-color: rgba(0,0,0,0.45) + background-color: rgba(0, 0, 0, 0.45) color: $color-dark @include dark-theme - background-color: rgba(255,255,255,0.45) + background-color: rgba(255, 255, 255, 0.45) color: $color label @@ -20,6 +20,17 @@ border-bottom: 1px solid currentColor padding: 5px 10px cursor: pointer + position: relative + + span + display: inline-block + position: absolute + right: 4px + background-color: rgba(255, 255, 255, 0.5) + color: #000 + border-radius: 2px + padding: 2px + font-family: "Courier New", Courier, monospace input color: #fff diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index 7d4000ce2..b14fc69f6 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -65,6 +65,8 @@ 'cover_doublepage_1'=>__('Recouvrir la double-page avec une marge de :margin',['margin'=>'1px']), 'n_links_copied'=>__('%nb% liens copiés'), 'n_links_cut'=>__('%nb% liens coupés'), + 'click_to_copy_id'=>__('Cliquer pour copier l\'identifiant du lien'), + 'id_copied'=>__('Identifiant copié !'), ]; $rulers=!count($rulers)?'{}':json_encode($rulers);