From b1da435656b05f6ce9f045e9e5c7f5cc556504b8 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 15 Jan 2022 19:26:20 +0000 Subject: [PATCH 1/5] :bento: Adds new icon for copy-to-clipboard --- src/assets/interface-icons/open-clipboard.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/assets/interface-icons/open-clipboard.svg diff --git a/src/assets/interface-icons/open-clipboard.svg b/src/assets/interface-icons/open-clipboard.svg new file mode 100644 index 00000000..2f3bff6e --- /dev/null +++ b/src/assets/interface-icons/open-clipboard.svg @@ -0,0 +1 @@ + \ No newline at end of file From cd0673013b4abd0851c882510f073586953cff23 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 15 Jan 2022 19:27:13 +0000 Subject: [PATCH 2/5] :speech_balloon: Updates text for copy-to-clpiboard --- src/assets/locales/en.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index 70713065..2e25af9a 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -185,10 +185,12 @@ "newtab": "New Tab", "modal": "Pop-Up Modal", "workspace": "Workspace View", + "clipboard": "Copy to Clipboard", "options-section-title": "Options", "edit-item": "Edit", "move-item": "Copy or Move", - "remove-item": "Remove" + "remove-item": "Remove", + "copied-toast": "URL has been copied to clipboard" }, "section": { "open-section": "Open Section", @@ -281,4 +283,4 @@ "good-service-rest": "Good Service on all other Lines" } } -} +} \ No newline at end of file From ddf105ee65f3eb9d965f8c957107a59790ef7a34 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 15 Jan 2022 19:28:21 +0000 Subject: [PATCH 3/5] :card_file_box: Updates schema with new clipboard option --- src/utils/ConfigSchema.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json index 90c6e49c..f3aaa3e6 100644 --- a/src/utils/ConfigSchema.json +++ b/src/utils/ConfigSchema.json @@ -84,7 +84,8 @@ "parent", "top", "modal", - "workspace" + "workspace", + "clipboard" ], "default": "newtab", "description": "The default opening method for items. Only used if no item.target is specified" @@ -624,7 +625,6 @@ "title": "Show for Groups", "type": "array", "description": "Section will be hidden from all users except those with one or more of these groups", - "items": { "type": "string", "description": "Name of the group that will be able to view this section" @@ -651,7 +651,6 @@ "title": "Hide for Groups", "type": "array", "description": "Section will be hidden from users with any of these groups", - "items": { "type": "string", "description": "name of the group that will not be able to view this section" @@ -712,7 +711,8 @@ "parent", "top", "modal", - "workspace" + "workspace", + "clipboard" ], "default": "newtab", "description": "Where / how the item is opened when it's clicked" @@ -796,4 +796,4 @@ } } } -} +} \ No newline at end of file From 967daac95d1b7018ddcae0f2ff66f2d8a2287df2 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 15 Jan 2022 19:28:52 +0000 Subject: [PATCH 4/5] :memo: Updates docs with copy URL to clipboard option --- docs/configuring.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/configuring.md b/docs/configuring.md index 9c2a32c7..b50a105a 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -77,7 +77,7 @@ Tips: --- | --- | --- | --- **`language`** | `string` | _Optional_ | The 2 (or 4-digit) [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for your language, e.g. `en` or `en-GB`. This must be a language that the app has already been [translated](https://github.com/Lissy93/dashy/tree/master/src/assets/locales) into. If your language is unavailable, Dashy will fallback to English. By default Dashy will attempt to auto-detect your language, although this may not work on some privacy browsers. **`startingView`** | `enum` | _Optional_ | Which page to load by default, and on the base page or domain root. You can still switch to different views from within the UI. Can be either `default`, `minimal` or `workspace`. Defaults to `default` -**`defaultOpeningMethod`** | `enum` | _Optional_ | The default opening method for items, if no `target` is specified for a given item. Can be either `newtab`, `sametab`, `top`, `parent`, `modal` or `workspace`. Defaults to `newtab` +**`defaultOpeningMethod`** | `enum` | _Optional_ | The default opening method for items, if no `target` is specified for a given item. Can be either `newtab`, `sametab`, `modal`, `workspace`, `clipboard`, `top` or `parent`. Defaults to `newtab` **`statusCheck`** | `boolean` | _Optional_ | When set to `true`, Dashy will ping each of your services and display their status as a dot next to each item. This can be overridden by setting `statusCheck` under each item. Defaults to `false` **`statusCheckInterval`** | `boolean` | _Optional_ | The number of seconds between checks. If set to `0` then service will only be checked on initial page load, which is usually the desired functionality. If value is less than `10` you may experience a hit in performance. Defaults to `0` **`webSearch`** | `object` | _Optional_ | Configuration options for the web search feature, set your default search engine, opening method or disable web search. See [`webSearch`](#appconfigwebsearch-optional) @@ -186,7 +186,7 @@ For more info, see the **[Authentication Docs](/docs/authentication.md)** **`description`** | `string` | _Optional_ | Additional info about an item, which is shown in the tooltip on hover, or visible on large tiles **`url`** | `string` | Required | The URL / location of web address for when the item is clicked **`icon`** | `string` | _Optional_ | The icon for a given item. Can be a font-awesome icon, favicon, remote URL or local URL. See [`item.icon`](#sectionicon-and-sectionitemicon) -**`target`** | `string` | _Optional_ | The opening method for when the item is clicked, either `newtab`, `sametab`, `top`, `parent`, `modal` or `workspace`. Where `newtab` will open the link in a new tab, `sametab` will open it in the current tab, and `modal` will open a pop-up modal and `workspace` will open in the Workspace view. Defaults to `newtab` +**`target`** | `string` | _Optional_ | The opening method for when the item is clicked, either `newtab`, `sametab`, `modal`, `workspace`, `clipboard`, `top` or `parent`. Where `newtab` will open the link in a new tab, `sametab` will open it in the current tab, and `modal` will open a pop-up modal, `workspace` will open in the Workspace view and `clipboard` will copy the URL to system clipboard (but not launch app). Defaults to `newtab` **`hotkey`** | `number` | _Optional_ | Give frequently opened applications a numeric hotkey, between `0 - 9`. You can then just press that key to launch that application. **`tags`** | `string[]` | _Optional_ | A list of tags, which can be used for improved search **`statusCheck`** | `boolean` | _Optional_ | When set to `true`, Dashy will ping the URL associated with the current service, and display its status as a dot next to the item. The value here will override `appConfig.statusCheck` so you can turn off or on checks for a given service. Defaults to `appConfig.statusCheck`, falls back to `false` From 45700d7875fbfe619ec2757b70af38aded3ac874 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 15 Jan 2022 19:29:15 +0000 Subject: [PATCH 5/5] :sparkles: Adds option to copy item URL to clipboard --- src/components/LinkItems/Item.vue | 13 ++++++++++++- src/components/LinkItems/ItemContextMenu.vue | 6 ++++++ src/components/LinkItems/ItemOpenMethodIcon.vue | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/LinkItems/Item.vue b/src/components/LinkItems/Item.vue index 414706ef..024de6f2 100644 --- a/src/components/LinkItems/Item.vue +++ b/src/components/LinkItems/Item.vue @@ -141,7 +141,7 @@ export default { hyperLinkHref() { const nothing = '#'; if (this.isEditMode) return nothing; - const noAnchorNeeded = ['modal', 'workspace']; + const noAnchorNeeded = ['modal', 'workspace', 'clipboard']; return noAnchorNeeded.includes(this.accumulatedTarget) ? nothing : this.url; }, }, @@ -174,6 +174,9 @@ export default { this.$emit('triggerModal', this.url); } else if (this.accumulatedTarget === 'workspace') { router.push({ name: 'workspace', query: { url: this.url } }); + } else if (this.accumulatedTarget === 'clipboard') { + navigator.clipboard.writeText(this.url); + this.$toasted.show(this.$t('context-menus.item.copied-toast')); } else { this.$emit('itemClicked'); } @@ -226,6 +229,7 @@ export default { case 'top': return '"\\f102"'; case 'modal': return '"\\f2d0"'; case 'workspace': return '"\\f0b1"'; + case 'clipboard': return '"\\f0ea"'; default: return '"\\f054"'; } }, @@ -279,6 +283,10 @@ export default { case 'workspace': router.push({ name: 'workspace', query: { url } }); break; + case 'clipboard': + navigator.clipboard.writeText(url); + this.$toasted.show(this.$t('context-menus.item.copied-toast')); + break; default: window.open(url, '_blank'); } }, @@ -546,4 +554,7 @@ a.item.is-edit-mode { .disabled-link { pointer-events: none; } +.tooltip.item-description-tooltip { + z-index: 7; +} diff --git a/src/components/LinkItems/ItemContextMenu.vue b/src/components/LinkItems/ItemContextMenu.vue index 1d29a756..6fc9131f 100644 --- a/src/components/LinkItems/ItemContextMenu.vue +++ b/src/components/LinkItems/ItemContextMenu.vue @@ -23,6 +23,10 @@ {{ $t('context-menus.item.workspace') }} +
  • + + {{ $t('context-menus.item.clipboard') }} +