« get me outta code hell

art tag data - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/thing
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-02-01 17:02:17 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-02-01 17:02:17 -0400
commit39d72767292803d62bd4ab01c4fcc4827a7f89d5 (patch)
tree7d0ab145035fd1df1d285b1675753ea32d0fa893 /src/thing
parent0ad3d3ce23b47eeccd46d063812372de8b9b190b (diff)
art tag data
Diffstat (limited to 'src/thing')
-rw-r--r--src/thing/art-tag.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/thing/art-tag.js b/src/thing/art-tag.js
new file mode 100644
index 00000000..4b09d885
--- /dev/null
+++ b/src/thing/art-tag.js
@@ -0,0 +1,37 @@
+import Thing from './thing.js';
+
+import {
+    isBoolean,
+    isColor,
+    isDirectory,
+    isName,
+} from './validators.js';
+
+export default class ArtTag extends Thing {
+    static [Thing.referenceType] = 'tag';
+
+    static propertyDescriptors = {
+        // Update & expose
+
+        name: {
+            flags: {update: true, expose: true},
+            update: {validate: isName}
+        },
+
+        directory: {
+            flags: {update: true, expose: true},
+            update: {validate: isDirectory},
+            expose: Thing.directoryExpose
+        },
+
+        color: {
+            flags: {update: true, expose: true},
+            update: {validate: isColor}
+        },
+
+        isContentWarning: {
+            flags: {update: true, expose: true},
+            update: {validate: isBoolean, default: false}
+        },
+    };
+}