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!

:truck: Refactor form elemts

Alicia Sykes848b661c7690
diff --git a/src/components/FormElements/Button.vue b/src/components/FormElements/Button.vue
index 2c8f6279..54b3265b 100644
--- a/src/components/FormElements/Button.vue
+++ b/src/components/FormElements/Button.vue
@@ -1,5 +1,9 @@
<template>
- <button @click="click()" :disabled="disabled" :class="disallow ? 'disallowed': ''">
+ <button
+ @click="click ? click() : () => null"
+ :disabled="disabled"
+ :class="disallow ? 'disallowed': ''"
+ >
<slot></slot>
<slot name="text"></slot>
<slot name="icon"></slot>
diff --git a/src/components/LinkItems/Item.vue b/src/components/LinkItems/Item.vue
index bac34cfd..627ca919 100644
--- a/src/components/LinkItems/Item.vue
+++ b/src/components/LinkItems/Item.vue
@@ -273,8 +273,9 @@ export default {
&:focus {
outline: 2px solid var(--primary);
}
- &.short {
- height: 18px;
+ &.short:not(.size-large) {
+ height: 2rem;
+ .tile-title { overflow: visible; }
}
}
diff --git a/src/utils/MiscHelpers.js b/src/utils/MiscHelpers.js
index add6f457..d5233e54 100644
--- a/src/utils/MiscHelpers.js
+++ b/src/utils/MiscHelpers.js
@@ -11,3 +11,17 @@ export const asciiHash = (input) => {
const shortened = asciiSum.slice(0, 30) + asciiSum.slice(asciiSum.length - 30);
return window.btoa(shortened);
};
+
+/* Encode potentially malicious characters from string */
+export const sanitize = (string) => {
+ const map = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#x27;',
+ '/': '&#x2F;',
+ };
+ const reg = /[&<>"'/]/ig;
+ return string.replace(reg, (match) => (map[match]));
+};