diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..f77d59e
Binary files /dev/null and b/.DS_Store differ
diff --git a/count_words_in_textarea/html.txt b/count_words_in_textarea/html.txt
new file mode 100644
index 0000000..d5053e7
--- /dev/null
+++ b/count_words_in_textarea/html.txt
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/count_words_in_textarea/js.txt b/count_words_in_textarea/js.txt
new file mode 100644
index 0000000..92690d9
--- /dev/null
+++ b/count_words_in_textarea/js.txt
@@ -0,0 +1,15 @@
+let dismissed = false;
+
+LSI.on("beforeSaveAnnotation", (store, annotation) => {
+ const textAreaResult = annotation.results.find(r => r.type === 'textarea' && r.from_name.name === 'textarea');
+ if (textAreaResult) {
+ words = textAreaResult.value.text[0]
+ word_count = words.split(/(\s+)/).length;
+ if (word_count > 10) {
+ Htx.showModal("Word count is " + word_count + ". Please reduce to 10 or less.");
+ dismissed = true;
+ return false;
+ }
+ }
+ return true;
+});
diff --git a/validate_json_in_textarea/data.json b/validate_json_in_textarea/data.json
new file mode 100644
index 0000000..3e30a61
--- /dev/null
+++ b/validate_json_in_textarea/data.json
@@ -0,0 +1,5 @@
+{
+ "data": {
+ "text": "The quick brown fox jumps over the lazy dog"
+ }
+}
diff --git a/validate_json_in_textarea/html.txt b/validate_json_in_textarea/html.txt
new file mode 100644
index 0000000..75d5a2f
--- /dev/null
+++ b/validate_json_in_textarea/html.txt
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/validate_json_in_textarea/js.txt b/validate_json_in_textarea/js.txt
new file mode 100644
index 0000000..db8f9fc
--- /dev/null
+++ b/validate_json_in_textarea/js.txt
@@ -0,0 +1,12 @@
+LSI.on("beforeSaveAnnotation", (store, annotation) => {
+ const textAreaResult = annotation.results.find(r => r.type === 'textarea' && r.from_name.name === 'textarea');
+ if (textAreaResult) {
+ try {
+ JSON.parse(textAreaResult.value.text[0]);
+ } catch (e) {
+ Htx.showModal("Invalid JSON format. Please correct the JSON and try again.", "error");
+ return false;
+ }
+ }
+ return true;
+});