Permalink
Browse files

JS code cleanup

  • Loading branch information...
1 parent 0c712e0 commit b4cd2a4e9b634b5519a89fe2339c2f4e1c1cef96 @jedie committed May 16, 2012
@@ -100,7 +100,7 @@
if (salt=="") {
page_msg_info("{% trans 'Get the hash salt value from server...' %}");
var post_data = {
- "username": username,
+ "username": username
};
log("get user salt from server, send POST:" + $.param(post_data));
response = $.ajax({
@@ -150,15 +150,15 @@
sha_a2 = sha_hexdigest(challenge + sha_a);
if (sha_a2 == false) { return false; }
- // display SHA values
+ // display SHA values
$("#password_block").slideUp(1).delay(500);
- $("#sha_values_block").css("display", "block").slideDown();
- $("#id_password").val(""); // 'delete' plaintext password
- $("#id_sha_a2").val(sha_a2);
- $("#id_sha_b").val(sha_b);
+ $("#sha_values_block").css("display", "block").slideDown();
+ $("#id_password").val(""); // 'delete' plaintext password
+ $("#id_sha_a2").val(sha_a2);
+ $("#id_sha_b").val(sha_b);
var post_data = {
- "username": username, "sha_a2": sha_a2, "sha_b": sha_b,
+ "username": username, "sha_a2": sha_a2, "sha_b": sha_b
}
log("auth user, send POST:" + $.param(post_data));
page_msg_info("{% trans 'Send SHA-1 values to the server...' %}");
@@ -6,8 +6,15 @@ function log() {
// debug variable is undefined -> no debugging.
debug=false;
}
- if (debug && window.console && window.console.log)
- window.console.log(Array.prototype.join.call(arguments,''));
+ if (debug && window.console && window.console.log) {
+
+ try {
+ window.console.log(Array.prototype.join.call(arguments,''));
+ } catch (e) {
+ log("Error:" + e);
+ }
+
+ }
}
log("pylucid_js_tools.js loaded.");
@@ -170,7 +177,9 @@ function push_state(url, title) {
see also:
https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history#The_pushState%28%29.C2.A0method
*************************************************************************/
- if (typeof(title) === 'undefined') var title = "";
+ if (typeof(title) === 'undefined') {
+ var title = "";
+ }
if (window.history && window.history.pushState) {
try {
@@ -531,4 +540,5 @@ jQuery(document).ready(function($) {
}
$(this).nextAll().slideToggle("fast");
});
-});
+});
+

0 comments on commit b4cd2a4

Please sign in to comment.