pre-release

This commit is contained in:
Jiiks 2015-08-29 11:48:20 +03:00
parent f1a125dbed
commit 9d4c4d0c69
4 changed files with 26 additions and 14 deletions

View File

@ -1,7 +1,8 @@
/* BetterDiscordApp Core JavaScript
* Version: 1.1
* Version: 1.2
* Author: Jiiks | http://jiiks.net
* Date: 27/08/2015 - 16:36
* Last Update: 29/08/2015 - 11:48
* https://github.com/Jiiks/BetterDiscordApp
*/
@ -33,7 +34,7 @@ var settings = {
var defaultCookie = {
"version":"1.1",
"version":jsVersion,
"bda-gs-0":false,
"bda-gs-1":true,
"bda-es-0":true,
@ -79,16 +80,16 @@ Core.prototype.init = function() {
}
Core.prototype.initSettings = function() {
if(typeof($.cookie("better-discord")) == undefined) {
if($.cookie("better-discord") == undefined) {
settingsCookie = defaultCookie;
$.cookie("better-discord", JSON.stringify(settingsCookie));
this.saveSettings();
} else {
settingsCookie = JSON.parse($.cookie("better-discord"));
this.loadSettigns();
for(var setting in defaultCookie) {
if(settingsCookie[setting] == undefined) {
settingsCookie = defaultCookie;
$.cookie("better-discord", JSON.stringify(settingsCookie));
this.saveSettings();
alert("BetterDiscord settings reset due to update/error");
break;
}
@ -96,6 +97,14 @@ Core.prototype.initSettings = function() {
}
}
Core.prototype.saveSettings = function() {
$.cookie("better-discord", JSON.stringify(settingsCookie), { expires: 365, path: '/' });
}
Core.prototype.loadSettings = function() {
settingsCookie = JSON.parse($.cookie("better-discord"));
}
Core.prototype.initObserver = function() {
mainObserver = new MutationObserver(function(mutations) {

View File

@ -1,7 +1,8 @@
/* BetterDiscordApp EmoteModule JavaScript
* Version: 1.2
* Version: 1.3
* Author: Jiiks | http://jiiks.net
* Date: 26/08/2015 - 15:29
* Last Update: 29/08/2015 - 11:46
* https://github.com/Jiiks/BetterDiscordApp
* Note: Due to conflicts autocapitalize only supports global emotes
*/
@ -84,9 +85,12 @@ EmoteModule.prototype.autoCapitalize = function() {
var self = this;
console.log("autocap");
$('body').delegate($(".channel-textarea-inner textarea"), 'keyup change paste', function() {
if(!autoCapitalize) return;
if(!settingsCookie["bda-es-4"]) return;
var text = $(".channel-textarea-inner textarea").val();
if(text == undefined) return;
var lastWord = text.split(" ").pop();
if(lastWord.length > 3) {
var ret = self.capitalize(lastWord.toLowerCase());

View File

@ -1,8 +1,8 @@
/* BetterDiscordApp QuickEmoteMenu JavaScript
* Version: 1.1
* Version: 1.2
* Author: Jiiks | http://jiiks.net
* Date: 26/08/2015 - 11:49
* Last Update: 27/08/2015 - 13:43
* Last Update: 29/08/2015 - 11:46
* https://github.com/Jiiks/BetterDiscordApp
*/

View File

@ -1,8 +1,8 @@
/* BetterDiscordApp Settings Panel JavaScript
* Version: 1.1
* Version: 1.2
* Author: Jiiks | http://jiiks.net
* Date: 26/08/2015 - 11:54
* Last Update: 26/08/2015 - 19:38
* Last Update: 29/08/2015 - 11:47
* https://github.com/Jiiks/BetterDiscordApp
*/
@ -80,7 +80,6 @@ SettingsPanel.prototype.handler = function(e){
swoff.addClass("active");
}
$.cookie("better-discord", JSON.stringify(settingsCookie));
if(settingsCookie["bda-es-0"]) {
$("#twitchcord-button-container").show();
@ -88,6 +87,6 @@ SettingsPanel.prototype.handler = function(e){
$("#twitchcord-button-container").hide();
}
autoCapitalize = settingsCookie["bda-es-4"];
core.saveSettings();
}