summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2016-12-17 14:44:50 -0800
committerAaron Parecki <aaron@parecki.com>2016-12-17 14:44:50 -0800
commite5fb668bd3cac70ed27c2111234e042e8f70fff8 (patch)
treef910118e8308d6796badbb9b3878c7c3a91bff4e /public
parent2b98a4548e82f1133bf62918b0106ab99a21fa29 (diff)
auto prefix http:// in sign-in form
fixes #48
Diffstat (limited to 'public')
-rw-r--r--public/js/script.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/public/js/script.js b/public/js/script.js
index 50496d3..f6f3a48 100644
--- a/public/js/script.js
+++ b/public/js/script.js
@@ -39,3 +39,11 @@ $(function(){
});
})
+
+function auto_prefix_url_field(field) {
+ var str = field.value;
+ if(!/^https?:\/\//.test(str)) {
+ str = "http://" + str;
+ }
+ field.value = str;
+}