Commits

Hideya OHASHI committed 6bf5b2e

use spaces for indent

  • Participants
  • Parent commits ccfe335

Comments (0)

Files changed (1)

 $(function() {
-	function hexstr2bin(str) {
-		var binstr = '';
-		for (var i = 0; i < str.length; i += 2) {
-			var i8 = parseInt('0x' + str.substr(i, 2));
-			binstr += String.fromCharCode(i8);
-		}
-		return binstr;
-	}
+  function hexstr2bin(str) {
+    var binstr = '';
+    for (var i = 0; i < str.length; i += 2) {
+      var i8 = parseInt('0x' + str.substr(i, 2));
+      binstr += String.fromCharCode(i8);
+    }
+    return binstr;
+  }
 
-	function getlinks() {
-		var html = "<table border=\"1\">\n";
-		html += "<tr>\n";
-		html += "<td>URL</td><td>ID</td><td>length</td><td>times</td>\n";
-		html += "<td>password</td>\n";
-		html += "</tr>\n";
-		for (var i = 0; i < accounts.length; i++) {
-			var account = accounts[i];
-			if (account == null) break;
-			var url = account[0];
-			var user = account[1];
-			var strlen = account[3];
-			var times = account[4];
-			times = times ? times : 0;
-			html += '<tr>';
-			html += '<td>';
-			html += '<a href="' + url + '">' + url + '</a>';
-			html += '</td>';
-			html += '<td>' + user + '</td>';
-			html += '<td>' + strlen + '</td>';
-			html += '<td>' + Math.pow(2, times) + '</td>';
-			html += '<td id="p' + i + '">?';
-			html += '</td>';
-			html += "</tr>\n";
-		}
-		html += "</table>\n";
-		return html;
-	}
+  function getlinks() {
+    var html = "<table border=\"1\">\n";
+    html += "<tr>\n";
+    html += "<td>URL</td><td>ID</td><td>length</td><td>times</td>\n";
+    html += "<td>password</td>\n";
+    html += "</tr>\n";
+    for (var i = 0; i < accounts.length; i++) {
+      var account = accounts[i];
+      if (account == null) break;
+      var url = account[0];
+      var user = account[1];
+      var strlen = account[3];
+      var times = account[4];
+      times = times ? times : 0;
+      html += '<tr>';
+      html += '<td>';
+      html += '<a href="' + url + '">' + url + '</a>';
+      html += '</td>';
+      html += '<td>' + user + '</td>';
+      html += '<td>' + strlen + '</td>';
+      html += '<td>' + Math.pow(2, times) + '</td>';
+      html += '<td id="p' + i + '">?';
+      html += '</td>';
+      html += "</tr>\n";
+    }
+    html += "</table>\n";
+    return html;
+  }
 
-	$('#master_pass').focus();
-	$('#password_table').html(getlinks());
-	for (var i = 0; i < accounts.length; i++) {
-		var account = accounts[i];
-		if (!accounts) break;
-		$('#p' + i).click(function() {
-			var master_pass = $('#master_pass').val();
-			if ($(this).text() != '?') return;
-			var no = $(this).attr('id').substr(1);
-			var account = accounts[no];
-			var url = account[0];
-			var user = account[1];
-			var salt = account[2];
-			var strlen = account[3];
-			var times = account[4];
-			var str = url + salt + user + master_pass;
-			if (times) {
-				for (var j = 0; j < times; j++) { str = str + str; }
-			}
-			var md5str = hex_md5(str);
-			var md5bin = hexstr2bin(md5str);
-			$(this).text(base64encode(md5bin).substr(0, strlen));
-		});
-	}
+  $('#master_pass').focus();
+  $('#password_table').html(getlinks());
+  for (var i = 0; i < accounts.length; i++) {
+    var account = accounts[i];
+    if (!accounts) break;
+    $('#p' + i).click(function() {
+      var master_pass = $('#master_pass').val();
+      if ($(this).text() != '?') return;
+      var no = $(this).attr('id').substr(1);
+      var account = accounts[no];
+      var url = account[0];
+      var user = account[1];
+      var salt = account[2];
+      var strlen = account[3];
+      var times = account[4];
+      var str = url + salt + user + master_pass;
+      if (times) {
+        for (var j = 0; j < times; j++) { str = str + str; }
+      }
+      var md5str = hex_md5(str);
+      var md5bin = hexstr2bin(md5str);
+      $(this).text(base64encode(md5bin).substr(0, strlen));
+    });
+  }
 });