From e5fb668bd3cac70ed27c2111234e042e8f70fff8 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 17 Dec 2016 14:44:50 -0800 Subject: auto prefix http:// in sign-in form fixes #48 --- public/js/script.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'public/js') 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; +} -- cgit v1.2.3