diff --git a/js/main.js b/js/main.js index 8e79dbc..08c3739 100644 --- a/js/main.js +++ b/js/main.js @@ -70,6 +70,7 @@ Core.prototype.init = function() { } utils = new Utils(); + utils.getHash(); emoteModule = new EmoteModule(); quickEmoteMenu = new QuickEmoteMenu(); voiceMode = new VoiceMode(); @@ -694,6 +695,8 @@ SettingsPanel.prototype.handler = function(e){ * https://github.com/Jiiks/BetterDiscordApp */ +var _hash; + function Utils() { } @@ -706,6 +709,13 @@ Utils.prototype.jqDefer = function(fnc) { if(window.jQuery) { fnc(); } else { setTimeout(function() { this.jqDefer(fnc) }, 100) } }; +Utils.prototype.getHash = function() { + $.getJson("https://api.github.com/repos/Jiiks/BetterDiscordApp/commits/master", function(data) { + _hash = data.sha; + }); + +}; + /* BetterDiscordApp VoiceMode JavaScript * Version: 1.0 * Author: Jiiks | http://jiiks.net diff --git a/js/utils.js b/js/utils.js index 2e61cf6..cde135d 100644 --- a/js/utils.js +++ b/js/utils.js @@ -5,6 +5,8 @@ * https://github.com/Jiiks/BetterDiscordApp */ +var _hash; + function Utils() { } @@ -15,4 +17,11 @@ Utils.prototype.getTextArea = function() { Utils.prototype.jqDefer = function(fnc) { if(window.jQuery) { fnc(); } else { setTimeout(function() { this.jqDefer(fnc) }, 100) } +}; + +Utils.prototype.getHash = function() { + $.getJson("https://api.github.com/repos/Jiiks/BetterDiscordApp/commits/master", function(data) { + _hash = data.sha; + }); + }; \ No newline at end of file