Fix mascot and theme saving

This commit is contained in:
Zixaphir 2013-08-21 03:14:38 -07:00
parent c13b3731b7
commit 2f9e7a06d7
5 changed files with 29 additions and 15 deletions

View File

@ -1,5 +1,5 @@
/*
* appchan x - Version 2.3.5 - 2013-08-20
* appchan x - Version 2.3.5 - 2013-08-21
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE

View File

@ -20,7 +20,7 @@
// ==/UserScript==
/*
* appchan x - Version 2.3.5 - 2013-08-20
* appchan x - Version 2.3.5 - 2013-08-21
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@ -12136,10 +12136,10 @@
}
}
Mascots[name] = imported;
$.get("userMascots", {}, function(item) {
$.get("userMascots", {}, function(_arg) {
var userMascots;
userMascots = item['userMascots'];
userMascots = _arg.userMascots;
userMascots[name] = Mascots[name];
return $.set('userMascots', userMascots);
});
@ -15374,17 +15374,23 @@
};
}
$.extend(Conf, {
'userThemes': [],
'userMascots': [],
'Enabled Mascots': [],
'Enabled Mascots sfw': [],
'Enabled Mascots nsfw': [],
'Deleted Mascots': [],
'Hidden Categories': ["Questionable"],
'userThemes': {},
'userMascots': {},
'selectedArchives': {},
'CachedTitles': {}
});
return $.get(Conf, function(items) {
if (items.userMascots instanceof Array) {
$.set('userMascots', items.userMascots = {});
}
if (items.userThemes instanceof Array) {
$.set('userThemes', items.userThemes = {});
}
$.extend(Conf, items);
return Main.initFeatures();
});

View File

@ -1,6 +1,6 @@
// Generated by CoffeeScript
/*
* appchan x - Version 2.3.5 - 2013-08-20
* appchan x - Version 2.3.5 - 2013-08-21
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@ -12129,10 +12129,10 @@
}
}
Mascots[name] = imported;
$.get("userMascots", {}, function(item) {
$.get("userMascots", {}, function(_arg) {
var userMascots;
userMascots = item['userMascots'];
userMascots = _arg.userMascots;
userMascots[name] = Mascots[name];
return $.set('userMascots', userMascots);
});
@ -15359,17 +15359,23 @@
};
}
$.extend(Conf, {
'userThemes': [],
'userMascots': [],
'Enabled Mascots': [],
'Enabled Mascots sfw': [],
'Enabled Mascots nsfw': [],
'Deleted Mascots': [],
'Hidden Categories': ["Questionable"],
'userThemes': {},
'userMascots': {},
'selectedArchives': {},
'CachedTitles': {}
});
return $.get(Conf, function(items) {
if (items.userMascots instanceof Array) {
$.set('userMascots', items.userMascots = {});
}
if (items.userThemes instanceof Array) {
$.set('userThemes', items.userThemes = {});
}
$.extend(Conf, items);
if (!items) {
new Notice('error', $.el('span', {

View File

@ -18,17 +18,20 @@ Main =
Conf[db] = boards: {}
$.extend Conf,
'userThemes': []
'userMascots': []
'Enabled Mascots': []
'Enabled Mascots sfw': []
'Enabled Mascots nsfw': []
'Deleted Mascots': []
'Hidden Categories': ["Questionable"]
'userThemes': {}
'userMascots': {}
'selectedArchives': {}
'CachedTitles': {}
$.get Conf, (items) ->
# TempFix for accidental declaration as an array. Remove by 2.4.?
$.set 'userMascots', items.userMascots = {} if items.userMascots instanceof Array
$.set 'userThemes', items.userThemes = {} if items.userThemes instanceof Array
$.extend Conf, items
<% if (type === 'crx') { %>
unless items

View File

@ -315,8 +315,7 @@ MascotTools =
Mascots[name] = imported
$.get "userMascots", {}, (item) ->
userMascots = item['userMascots']
$.get "userMascots", {}, ({userMascots}) ->
userMascots[name] = Mascots[name]
$.set 'userMascots', userMascots