Browse Source

auto prefix http:// in sign-in form

fixes #48
pull/64/head
Aaron Parecki 7 years ago
parent
commit
e5fb668bd3
No known key found for this signature in database GPG Key ID: 276C2817346D6056
2 changed files with 9 additions and 1 deletions
  1. +8
    -0
      public/js/script.js
  2. +1
    -1
      views/index.php

+ 8
- 0
public/js/script.js View File

@ -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;
}

+ 1
- 1
views/index.php View File

@ -8,7 +8,7 @@
<p>To use Quill, sign in with your domain. Your website will need to support <a href="http://indiewebcamp.com/micropub">Micropub</a> for creating new posts.</p> <p>To use Quill, sign in with your domain. Your website will need to support <a href="http://indiewebcamp.com/micropub">Micropub</a> for creating new posts.</p>
<form action="/auth/start" method="get" class="form-inline"> <form action="/auth/start" method="get" class="form-inline">
<input type="url" name="me" placeholder="http://example.com" value="" class="form-control">
<input type="url" name="me" placeholder="https://example.com" value="" class="form-control" onchange="auto_prefix_url_field(this)">
<input type="submit" value="Sign In" class="btn btn-primary"> <input type="submit" value="Sign In" class="btn btn-primary">
<input type="hidden" name="client_id" value="https://quill.p3k.io"> <input type="hidden" name="client_id" value="https://quill.p3k.io">
<input type="hidden" name="redirect_uri" value="https://quill.p3k.io/auth/callback"> <input type="hidden" name="redirect_uri" value="https://quill.p3k.io/auth/callback">

Loading…
Cancel
Save