From c8381267ed7bdb0dcc8447f967802c9bfc053ec2 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Sun, 1 May 2016 00:24:15 +0300 Subject: [PATCH] Updated alert id --- lib/Utils.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/Utils.js b/lib/Utils.js index 4956d29..0d7441d 100644 --- a/lib/Utils.js +++ b/lib/Utils.js @@ -2,7 +2,7 @@ * Version: 1.4 * Author: Jiiks | http://jiiks.net * Date: 25/08/2015 - 09:19 - * Last Updated: 20/04/2016 + * Last Updated: 01/05/2016 * https://github.com/Jiiks/BetterDiscordApp */ @@ -24,7 +24,7 @@ function getMainWindow() { //Download using https Utils.prototype.download = function(host, path, callback) { - + this.log("Downloading Resource: " + host + path); var options = { host: host, path: path, @@ -45,6 +45,7 @@ Utils.prototype.download = function(host, path, callback) { } //Download using http Utils.prototype.downloadHttp = function(url, callback) { + this.log("Downloading Resource: " + url); http.get(url, function(result) { var data = ''; result.on('data', function(chunk) { @@ -92,6 +93,7 @@ Utils.prototype.jsLog = function(message, type) { } Utils.prototype.updateLoading = function(message, cur, max) { + this.log(message); this.execJs('document.getElementById("bd-status").innerHTML = "BetterDiscord - '+message+' : ";'); this.execJs('document.getElementById("bd-pbar").value = '+cur+';'); this.execJs('document.getElementById("bd-pbar").max = '+max+';'); @@ -155,11 +157,11 @@ Utils.prototype.injectVarRaw = function(variable, data) { this.execJs('var ' + variable + ' = ' + data + ';'); } -var alertCount = 0; //Alert Utils.prototype.alert = function(title, message) { - alertCount++; - var id = 'bdalert-' + alertCount; + var id = 'bdalert-'; + for( var i=0; i < 5; i++ ) + id += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random() * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".length)); var bdAlert = '\
\
\