aboutsummaryrefslogtreecommitdiffstats
path: root/src/chrome/content/dialogs/editcommon.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/chrome/content/dialogs/editcommon.js')
-rw-r--r--src/chrome/content/dialogs/editcommon.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/chrome/content/dialogs/editcommon.js b/src/chrome/content/dialogs/editcommon.js
new file mode 100644
index 0000000..c24b619
--- /dev/null
+++ b/src/chrome/content/dialogs/editcommon.js
@@ -0,0 +1,18 @@
+//Has Special Chars
+// + returns true if it only
+// + contains allowed chars
+function mproxy_allowedChars(str){
+ //var regex = new RegExp("[\\s\\.a-zA-Z0-9_]", "g"); //This does not allow utf-8 text!
+ var regex = new RegExp("[(){}\\\[\\\]<>,;:/~`'\"*?^$#&\\t\\n\\r\\\\]", "g");
+ return !regex.test(str);
+}
+
+// Used to test strings
+// + converts space to underscore
+// + and converts to lowercase
+function mproxy_simplify(str){
+ str = str.replace(new RegExp("\\s{2,}", "g"), " ");
+ str = str.replace(new RegExp("\\s", "g"), "_");
+ str = str.toLowerCase();
+ return str;
+} \ No newline at end of file