Permalink
Browse files

clean up sloppy js

  • Loading branch information...
1 parent 9902e70 commit dbb1a86afcfd3efcc6385872978f3532d82f6f62 @defunkt defunkt committed Mar 20, 2011
Showing with 7 additions and 7 deletions.
  1. +6 −6 public/js/hurl.headers.js
  2. +1 −1 public/js/hurl.js
View
@@ -1,16 +1,16 @@
(function() {
- Hurl.autocompleteHeaders = function(el) {
- $(el).autocompleteArray(keyNames( Hurl.Headers ), {
+ $.fn.hurlHeaders = function(el) {
+ $(el).autocompleteArray(keyNames( Headers ), {
delay: 40,
onItemSelect: function(e) {
var header = $(e).text(), next = $(el).siblings('input')
- var more = Hurl.Headers[header]
+ var more = Headers[header]
if ( header == "User-Agent" ) {
- next.autocompleteArray(keyNames( Hurl.Headers['User-Agent'] ), {
+ next.autocompleteArray(keyNames( Headers['User-Agent'] ), {
delay: 40,
onItemSelect: function(row) {
- next.val( Hurl.Headers['User-Agent'][$(row).text()] )
+ next.val( Headers['User-Agent'][$(row).text()] )
}
})
} else if ( more == "date" ) {
@@ -32,7 +32,7 @@
return names
}
- Hurl.Headers = {
+ var Headers = {
"Accept": ["*/*", "text/plain", "text/html, text/plain", "application/xml", "application/json"],
"Accept-Encoding": [ "compress", "deflate", "gzip", "compress, gzip", "gzip, deflate"],
"Accept-Language": [ "en", "es", "de", "fr", "*" ],
View
@@ -168,7 +168,7 @@ $(document).ready(function() {
$('#add-header').click(function() {
var newField = $('#header-fields').clone()
newField.toggle().attr('id', '')
- Hurl.autocompleteHeaders( newField.find('.form-alpha') )
+ newField.find('.form-alpha').hurlHeaders()
newField.find('.form-alpha').attr('title', 'name')
newField.find('.form-beta').attr('title', 'value')
Hurl.labelHints( newField.find('input[title]') )

0 comments on commit dbb1a86

Please sign in to comment.