Permalink
Browse files

Fixes #26

  • Loading branch information...
ahmadnassri committed Sep 27, 2011
1 parent 41a29cc commit 842eb467a8506fbb6b49d2772e12df61f1c39117
Showing with 7 additions and 3 deletions.
  1. +1 −1 index.html
  2. +6 −2 js/app.js
View
@@ -350,7 +350,7 @@ <h1>Request</h1>
<label for="uri">Request URI</label>
<div class="input">
<input class="span8" type="text" name="uri" tabindex="2" autocomplete="on" placeholder="http://example.com/resources/ef7d-xj36p" required/>
- <span class="help-block">Universal Resource Identifier.</span>
+ <span class="help-block">Universal Resource Identifier. ex: https://www.sample.com:9000</span>
</div>
</div>
View
@@ -339,6 +339,12 @@ window.addEvent('domready', function() {
})
// request form actions
+ document.getElement('form[name="request"] input[name="uri"]').addEvent('change', function(event) {
+ if (this.get('value').length > 0 && this.get('value').substr(0, 4) != 'http') {
+ this.set('value', 'http://' + this.get('value'));
+ }
+ });
+
document.getElement('form[name="request"]').addEvents({
'click:relay(input[type="button"], input[type="submit"], input[type="reset"])': function(event) {
event.preventDefault();
@@ -489,8 +495,6 @@ window.addEvent('domready', function() {
if (missing) {
return false;
- } else if (data.uri == '' || !/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(data.uri)) {
- Error('Invalid Input', 'Please enter a valid URI', this.getElement('input[name="uri"]'));
} else {
if (data.encoding) {
// special condition for encoding

0 comments on commit 842eb46

Please sign in to comment.