Updated alert id
This commit is contained in:
parent
d85fd95050
commit
c8381267ed
12
lib/Utils.js
12
lib/Utils.js
|
@ -2,7 +2,7 @@
|
||||||
* Version: 1.4
|
* Version: 1.4
|
||||||
* Author: Jiiks | http://jiiks.net
|
* Author: Jiiks | http://jiiks.net
|
||||||
* Date: 25/08/2015 - 09:19
|
* Date: 25/08/2015 - 09:19
|
||||||
* Last Updated: 20/04/2016
|
* Last Updated: 01/05/2016
|
||||||
* https://github.com/Jiiks/BetterDiscordApp
|
* https://github.com/Jiiks/BetterDiscordApp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ function getMainWindow() {
|
||||||
|
|
||||||
//Download using https
|
//Download using https
|
||||||
Utils.prototype.download = function(host, path, callback) {
|
Utils.prototype.download = function(host, path, callback) {
|
||||||
|
this.log("Downloading Resource: " + host + path);
|
||||||
var options = {
|
var options = {
|
||||||
host: host,
|
host: host,
|
||||||
path: path,
|
path: path,
|
||||||
|
@ -45,6 +45,7 @@ Utils.prototype.download = function(host, path, callback) {
|
||||||
}
|
}
|
||||||
//Download using http
|
//Download using http
|
||||||
Utils.prototype.downloadHttp = function(url, callback) {
|
Utils.prototype.downloadHttp = function(url, callback) {
|
||||||
|
this.log("Downloading Resource: " + url);
|
||||||
http.get(url, function(result) {
|
http.get(url, function(result) {
|
||||||
var data = '';
|
var data = '';
|
||||||
result.on('data', function(chunk) {
|
result.on('data', function(chunk) {
|
||||||
|
@ -92,6 +93,7 @@ Utils.prototype.jsLog = function(message, type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils.prototype.updateLoading = function(message, cur, max) {
|
Utils.prototype.updateLoading = function(message, cur, max) {
|
||||||
|
this.log(message);
|
||||||
this.execJs('document.getElementById("bd-status").innerHTML = "BetterDiscord - '+message+' : ";');
|
this.execJs('document.getElementById("bd-status").innerHTML = "BetterDiscord - '+message+' : ";');
|
||||||
this.execJs('document.getElementById("bd-pbar").value = '+cur+';');
|
this.execJs('document.getElementById("bd-pbar").value = '+cur+';');
|
||||||
this.execJs('document.getElementById("bd-pbar").max = '+max+';');
|
this.execJs('document.getElementById("bd-pbar").max = '+max+';');
|
||||||
|
@ -155,11 +157,11 @@ Utils.prototype.injectVarRaw = function(variable, data) {
|
||||||
this.execJs('var ' + variable + ' = ' + data + ';');
|
this.execJs('var ' + variable + ' = ' + data + ';');
|
||||||
}
|
}
|
||||||
|
|
||||||
var alertCount = 0;
|
|
||||||
//Alert
|
//Alert
|
||||||
Utils.prototype.alert = function(title, message) {
|
Utils.prototype.alert = function(title, message) {
|
||||||
alertCount++;
|
var id = 'bdalert-';
|
||||||
var id = 'bdalert-' + alertCount;
|
for( var i=0; i < 5; i++ )
|
||||||
|
id += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random() * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".length));
|
||||||
var bdAlert = '\
|
var bdAlert = '\
|
||||||
<div id=\''+id+'\' class=\'modal\' style=\'opacity:1\'>\
|
<div id=\''+id+'\' class=\'modal\' style=\'opacity:1\'>\
|
||||||
<div class=\'modal-inner\'>\
|
<div class=\'modal-inner\'>\
|
||||||
|
|
Loading…
Reference in New Issue