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` 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 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 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') }} +