瀏覽代碼

Use openNotification instead of alert (main.js)

Marien Fressinaud 11 年之前
父節點
當前提交
c0d0279b03
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      p/scripts/main.js

+ 4 - 4
p/scripts/main.js

@@ -1012,7 +1012,7 @@ function init_crypto_form() {
 			async: false
 		}).done(function (data) {
 			if (data.salt1 == '' || data.nonce == '') {
-				alert('Invalid user!');
+				openNotification('Invalid user!', 'bad');
 			} else {
 				try {
 					var strong = window.Uint32Array && window.crypto && (typeof window.crypto.getRandomValues === 'function'),
@@ -1020,16 +1020,16 @@ function init_crypto_form() {
 						c = dcodeIO.bcrypt.hashSync(data.nonce + s, strong ? 4 : poormanSalt());
 					$('#challenge').val(c);
 					if (s == '' || c == '') {
-						alert('Crypto error!');
+						openNotification('Crypto error!', 'bad');
 					} else {
 						success = true;
 					}
 				} catch (e) {
-					alert('Crypto exception! ' + e);
+					openNotification('Crypto exception! ' + e, 'bad');
 				}
 			}
 		}).fail(function() {
-			alert('Communication error!');
+			openNotification('Communication error!', 'bad');
 		});
 
 		$submit_button.removeAttr('disabled');