Updated alert id

This commit is contained in:
Jiiks 2016-05-01 00:24:15 +03:00
parent d85fd95050
commit c8381267ed
1 changed files with 7 additions and 5 deletions

View File

@ -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 = '\
<div id=\''+id+'\' class=\'modal\' style=\'opacity:1\'>\
<div class=\'modal-inner\'>\