Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

πŸ”₯ Code cleanup around opening methods

Alicia Sykes7c2c2a8a7095
diff --git a/src/components/LinkItems/SubItem.vue b/src/components/LinkItems/SubItem.vue
index 22aba4e0..8a80dbdf 100644
--- a/src/components/LinkItems/SubItem.vue
+++ b/src/components/LinkItems/SubItem.vue
@@ -33,7 +33,6 @@
import Icon from '@/components/LinkItems/ItemIcon.vue';
import ContextMenu from '@/components/LinkItems/ItemContextMenu';
import ItemMixin from '@/mixins/ItemMixin';
-// import { targetValidator } from '@/utils/ConfigHelpers';
export default {
name: 'Item',
diff --git a/src/components/PageStrcture/Nav.vue b/src/components/PageStrcture/Nav.vue
index 781d776f..8fcc53c0 100644
--- a/src/components/PageStrcture/Nav.vue
+++ b/src/components/PageStrcture/Nav.vue
@@ -70,9 +70,10 @@ export default {
switch (link.target) {
case 'sametab': return '_self';
case 'newtab': return '_blank';
+ case 'newwindow': return '_blank';
case 'parent': return '_parent';
case 'top': return '_top';
- default: return undefined;
+ default: return '_blank';
}
},
},
diff --git a/src/utils/ConfigHelpers.js b/src/utils/ConfigHelpers.js
index 4ea7ffda..a4ceb2c0 100644
--- a/src/utils/ConfigHelpers.js
+++ b/src/utils/ConfigHelpers.js
@@ -7,8 +7,6 @@ import {
localStorageKeys,
language as defaultLanguage,
} from '@/utils/defaults';
-import ErrorHandler from '@/utils/ErrorHandler';
-import ConfigSchema from '@/utils/ConfigSchema.json';
/* Given a page name, converts to lowercase, removes special characters and extension */
export const makePageName = (pageName) => {
@@ -101,17 +99,3 @@ export const getUsersLanguage = () => {
const langObj = languages.find(lang => lang.code === resolvedCode);
return langObj;
};
-
-/**
- * validator for item target attribute
- * Uses enum values from config schema, and shows warning if invalid
- * @param {String} target
- * @returns {Boolean} isValid
- */
-export const targetValidator = (target) => {
- const acceptedTargets = ConfigSchema.properties.sections.items
- .properties.items.items.properties.target.enum;
- const isTargetValid = acceptedTargets.indexOf(target) !== -1;
- if (!isTargetValid) ErrorHandler(`Unknown target value: ${target}`);
- return isTargetValid;
-};
diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json
index 5a593884..5597b0d2 100644
--- a/src/utils/ConfigSchema.json
+++ b/src/utils/ConfigSchema.json
@@ -393,7 +393,6 @@
"enum": [
"newtab",
"sametab",
- "modal",
"workspace"
],
"default": "newtab",
diff --git a/src/views/Workspace.vue b/src/views/Workspace.vue
index bbeb4e6c..2599c500 100644
--- a/src/views/Workspace.vue
+++ b/src/views/Workspace.vue
@@ -19,6 +19,7 @@ import WebContent from '@/components/Workspace/WebContent';
import WidgetView from '@/components/Workspace/WidgetView';
import MultiTaskingWebComtent from '@/components/Workspace/MultiTaskingWebComtent';
import Defaults from '@/utils/defaults';
+import ErrorHandler from '@/utils/ErrorHandler';
export default {
name: 'Workspace',
@@ -56,6 +57,7 @@ export default {
navigator.clipboard.writeText(options.url);
this.$toasted.show(this.$t('context-menus.item.copied-toast'), { className: 'toast-success' });
} else {
+ ErrorHandler('Clipboard access requires HTTPS. See: https://bit.ly/3N5WuAA');
this.$toasted.show('Unable to copy, see log', { className: 'toast-error' });
}
return;