From e5fb668bd3cac70ed27c2111234e042e8f70fff8 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 17 Dec 2016 14:44:50 -0800 Subject: [PATCH] auto prefix http:// in sign-in form fixes #48 --- public/js/script.js | 8 ++++++++ views/index.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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; +} diff --git a/views/index.php b/views/index.php index 3ed34c2..b06f097 100644 --- a/views/index.php +++ b/views/index.php @@ -8,7 +8,7 @@

To use Quill, sign in with your domain. Your website will need to support Micropub for creating new posts.

- +