Permalink
Browse files

Cleaned up first two JavaScript files. Added missing semi-colons and …

…added != where should have been !== in only two cases. No other changes were made to code.
  • Loading branch information...
1 parent b6ed1c0 commit a3c25c94471496ddcbdd079ad26d7e29227b6b5f @dainmiller dainmiller committed with Sep 15, 2012
Showing with 27 additions and 27 deletions.
  1. +15 −15 webapp/assets/js/appconfig.js
  2. +12 −12 webapp/assets/js/grid_search.js
View
30 webapp/assets/js/appconfig.js
@@ -52,7 +52,7 @@ var TUApplicationSettings = function() {
if (tu_app_settings.DEBUG) {
console.debug("app settings tab selected");
}
- tu_app_settings.load_settings()
+ tu_app_setteings.load_settings();
});
});
@@ -76,14 +76,14 @@ var TUApplicationSettings = function() {
if (document.location.href.match(/#app_settings/)) {
if (tu_app_settings.DEBUG) {
console
- .debug("app settings tab loaded with hash #app_settings");
+ .debug("app settings tab loaded with hash #app_settings");
}
setTimeout(function() {
tu_app_settings.load_settings();
}, 1000);
}
- }
+ };
this.save_settings = function() {
$('#settings_error_message_error').hide();
@@ -98,7 +98,7 @@ var TUApplicationSettings = function() {
};
for (key in this.settings_data.app_config_settings) {
var setting = this.settings_data.app_config_settings[key];
- var id = '#' + key
+ var id = '#' + key;
if (setting.type == 'checkbox') {
id += ':checked';
if ($(id).val()) {
@@ -139,11 +139,11 @@ var TUApplicationSettings = function() {
$('#settings_error_message_error').show();
},
success : function(data) {
- tu_app_settings._save_settings(data)
+ tu_app_settings._save_settings(data);
}
});
- }
+ };
this._save_settings = function(data) {
$('#app-settings-save').show();
@@ -154,7 +154,7 @@ var TUApplicationSettings = function() {
for (key in data.required) {
error_mess += '<li>' + data.required[key] + '</li>';
}
- error_mess += '</ul>'
+ error_mess += '</ul>';
$('#settings_error_message').html(error_mess);
$('#settings_error_message_error').show();
}
@@ -165,7 +165,7 @@ var TUApplicationSettings = function() {
});
}, 500);
}
- }
+ };
this.load_settings = function() {
if (!tu_app_settings.TAB_LOADED) {
if (this.DEBUG) {
@@ -185,15 +185,15 @@ var TUApplicationSettings = function() {
$('#settings_error_message_error').show();
},
success : function(data) {
- tu_app_settings._load_settings(data)
+ tu_app_settings._load_settings(data);
}
});
} else {
if (this.DEBUG) {
console.debug("app settings already loaded, not loading...");
}
}
- }
+ };
this._load_settings = function(data) {
this.settings_data = data;
@@ -205,7 +205,7 @@ var TUApplicationSettings = function() {
});
for (key in data.app_config_settings) {
var setting = data.app_config_settings[key];
- var id = '#' + key
+ var id = '#' + key;
if (data.values[key]) {
if (this.DEBUG) {
console.debug("loading %s with value %s", key,
@@ -215,7 +215,7 @@ var TUApplicationSettings = function() {
&& data.values[key]['option_value'] != 'false') {
if (this.DEBUG) {
console.debug("%s is a checkbox with value %s", key,
- data.values[key]['option_value'])
+ data.values[key]['option_value']);
}
$(id).attr('checked', true);
} else {
@@ -237,15 +237,15 @@ var TUApplicationSettings = function() {
}
}
if (setting.dependencies && data.values[key]
- && data.values[key] != '') {
+ && data.values[key] !== '') {
var id = '#' + key + '_deps';
if ($(id)) {
$(id).show();
}
}
}
- }
-}
+ };
+};
var tu_app_settings = new TUApplicationSettings();
tu_app_settings.init();
View
24 webapp/assets/js/grid_search.js
@@ -40,7 +40,7 @@ var TUGridSearch = function() {
}
});
// self.load_iframe();
- }
+ };
/**
* @param Object
@@ -162,20 +162,20 @@ var TUGridSearch = function() {
self.searchString = this.value;
self.dataView.refresh();
}
- }
+ };
/**
* search filter
*/
this.myFilter = function (item) {
if(item['id'] == -1 || item['text'] == null) { return false; }
- if (self.searchString != "" &&
+ if (self.searchString !== "" &&
item["text"].toLowerCase().indexOf(self.searchString.toLowerCase()) == -1) {
return false;
} else {
return true;
}
- }
+ };
/**
*
@@ -185,9 +185,9 @@ var TUGridSearch = function() {
// close grid search with escape key
$(document).keyup( this.keyup );
- if(self.loading) { return; };
+ if(self.loading) { return; }
// close top 20 words if needed
- if(typeof(tu_word_freq) != 'undefined') { tu_word_freq.close(); };
+ if(typeof(tu_word_freq) != 'undefined') { tu_word_freq.close(); }
self.loading = true;
if(window.GRID_TYPE && GRID_TYPE==1) {
window.scroll(0,0);
@@ -208,7 +208,7 @@ var TUGridSearch = function() {
query_string = document.location.search;
query_string = query_string.replace(/^\?/, '').replace(/^v/, 'd');
}
- if(typeof(post_username) != 'undefined') { query_string+= '&u=' + escape(post_username); }
+ if(typeof(post_username) != 'undefined') { query_string+= '&u=' + escape(post_username); }
$('#grid_iframe').attr('src',
path + 'assets/html/grid.html?' + query_string + '&nolimit=' + nolimit
+ '&cb=' + (new Date()).getTime());
@@ -217,7 +217,7 @@ var TUGridSearch = function() {
}
self.loading = false;
});
- }
+ };
/**
*
*/
@@ -235,7 +235,7 @@ var TUGridSearch = function() {
$('#older-posts-div').show();
}
$(document).unbind('keyup', this.keyup);
- }
+ };
/**
* load xss script with post data callback
@@ -248,7 +248,7 @@ var TUGridSearch = function() {
script.setAttribute("src", url);
script.setAttribute("type", "text/javascript");
document.getElementsByTagName('head')[0].appendChild(script);
- }
+ };
/**
* Format numeric string with commas
@@ -263,7 +263,7 @@ var TUGridSearch = function() {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
- }
-}
+ };
+};
var tu_grid_search = new TUGridSearch();
tu_grid_search.init();

0 comments on commit a3c25c9

Please sign in to comment.