« get me outta code hell

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:
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}
+        },
+    };
+}