Fix various settings tabs and dialogs

* Delete / Undelete Themes and Mascots
* Themes only add [custom] if they're not already User Themes
This commit is contained in:
Zixaphir 2013-05-08 04:48:23 -07:00
parent 7696301598
commit 6c4e4b6b9f
6 changed files with 266 additions and 186 deletions

View File

@ -11306,18 +11306,12 @@
ThemeTools = {
init: function(key) {
var colorInput, div, fileInput, header, input, item, layout, themecontent, _i, _j, _len, _len1, _ref;
var colorInput, div, fileInput, header, input, item, layout, nodes, themeContent, _i, _j, _len, _len1, _ref;
Conf['editMode'] = "theme";
if (Themes[key]) {
if (key) {
editTheme = JSON.parse(JSON.stringify(Themes[key]));
$.get("userThemes", {}, function(items) {
if (items[key]) {
return editTheme["Theme"] = key;
} else {
return editTheme["Theme"] = key += " [custom]";
}
});
editTheme["Theme"] = Conf['userThemes'][key] ? key : key += " [custom]";
} else {
editTheme = JSON.parse(JSON.stringify(Themes['Yotsuba B']));
editTheme["Theme"] = "Untitled";
@ -11341,7 +11335,8 @@
});
}
$.add($("#themebar", ThemeTools.dialog), header);
themecontent = $("#themecontent", ThemeTools.dialog);
themeContent = $("#themecontent", ThemeTools.dialog);
nodes = [];
for (_j = 0, _len1 = layout.length; _j < _len1; _j++) {
item = layout[_j];
if (!editTheme[item]) {
@ -11416,10 +11411,9 @@
}
return editTheme[this.name] = this.value;
});
Style.addStyle(editTheme);
$.add(themecontent, div);
nodes.push(div);
}
$.add(themecontent, div);
Style.addStyle(editTheme);
if (!editTheme["Custom CSS"]) {
editTheme["Custom CSS"] = "";
}
@ -11431,11 +11425,12 @@
editTheme["Custom CSS"] = this.value;
return Style.themeCSS.textContent = Style.theme(editTheme);
});
$.add(themecontent, div);
nodes.push(div);
$.on($('#save > a', ThemeTools.dialog), 'click', function() {
return ThemeTools.save(editTheme);
});
$.on($('#close > a', ThemeTools.dialog), 'click', ThemeTools.close);
$.add(themeContent, nodes);
$.add(d.body, ThemeTools.dialog);
return Style.themeCSS.textContent = Style.theme(editTheme);
},
@ -13694,19 +13689,20 @@
for (_i = 0, _len = keys.length; _i < _len; _i++) {
name = keys[_i];
theme = Themes[name];
if (!theme["Deleted"]) {
div = $.el('div', {
className: "theme " + (name === Conf['theme'] ? 'selectedtheme' : ''),
id: name,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div> <div style='cursor: pointer; width: 9px; height: 9px; margin: 2px 3px; display: inline-block; vertical-align: bottom; background: " + theme['Checkbox Background'] + "; border: 1px solid " + theme['Checkbox Border'] + ";'></div> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'> " + name + " </span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'> " + theme['Author'] + " </span> <span style='color:" + theme['Sage'] + "!important'> (SAGE) </span> <span style='color:" + theme['Tripcodes'] + "!important'> " + theme['Author Tripcode'] + " </span> <time style='color:" + theme['Timestamps'] + "'> 20XX.01.01 12:00 </time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'> No.27583594 </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=edit> &gt;&gt;edit </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=export> &gt;&gt;export </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=delete> &gt;&gt;delete </a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> Post content is right here. </blockquote> <h1 style='color: " + theme['Text'] + "'> Selected </h1></div>"
});
div.style.backgroundColor = theme['Background Color'];
$.on($('a.edit', div), 'click', cb.edit);
$.on($('a.export', div), 'click', cb["export"]);
$.on($('a.delete', div), 'click', cb["delete"]);
$.on(div, 'click', cb.select);
$.add(suboptions, div);
if (theme["Deleted"]) {
continue;
}
div = $.el('div', {
className: "theme " + (name === Conf['theme'] ? 'selectedtheme' : ''),
id: name,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div> <div style='cursor: pointer; width: 9px; height: 9px; margin: 2px 3px; display: inline-block; vertical-align: bottom; background: " + theme['Checkbox Background'] + "; border: 1px solid " + theme['Checkbox Border'] + ";'></div> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'> " + name + " </span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'> " + theme['Author'] + " </span> <span style='color:" + theme['Sage'] + "!important'> (SAGE) </span> <span style='color:" + theme['Tripcodes'] + "!important'> " + theme['Author Tripcode'] + " </span> <time style='color:" + theme['Timestamps'] + "'> 20XX.01.01 12:00 </time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'> No.27583594 </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=edit> &gt;&gt;edit </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=export> &gt;&gt;export </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=delete> &gt;&gt;delete </a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> Post content is right here. </blockquote> <h1 style='color: " + theme['Text'] + "'> Selected </h1></div>"
});
div.style.backgroundColor = theme['Background Color'];
$.on($('a.edit', div), 'click', cb.edit);
$.on($('a.export', div), 'click', cb["export"]);
$.on($('a.delete', div), 'click', cb["delete"]);
$.on(div, 'click', cb.select);
$.add(suboptions, div);
}
div = $.el('div', {
id: 'addthemes',
@ -13735,30 +13731,43 @@
return this.nextSibling.click();
});
$.on($('#tUndelete', div), 'click', function() {
var themes;
$.rm($.id("themeContainer"));
return Settings.openSection(themes, 'undelete');
themes = {
open: Settings.themes,
hyphenatedTitle: 'themes'
};
return Settings.openSection.apply(themes, ['undelete']);
});
} else {
for (_j = 0, _len1 = keys.length; _j < _len1; _j++) {
name = keys[_j];
theme = Themes[name];
if (theme["Deleted"]) {
div = $.el('div', {
id: name,
className: theme,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div style='padding: 3px 0px 0px 8px;'> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'>" + name + "</span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'>" + theme['Author'] + "</span> <span style='color:" + theme['Sage'] + "!important'>(SAGE)</span> <span style='color:" + theme['Tripcodes'] + "!important'>" + theme['Author Tripcode'] + "</span> <time style='color:" + theme['Timestamps'] + "'>20XX.01.01 12:00</time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'>No.27583594</a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> I forgive you for using VLC to open me. ;__; </blockquote></div>"
});
$.on(div, 'click', cb.restore);
$.add(suboptions, div);
if (!theme["Deleted"]) {
continue;
}
div = $.el('div', {
id: name,
className: theme,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div style='padding: 3px 0px 0px 8px;'> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'>" + name + "</span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'>" + theme['Author'] + "</span> <span style='color:" + theme['Sage'] + "!important'>(SAGE)</span> <span style='color:" + theme['Tripcodes'] + "!important'>" + theme['Author Tripcode'] + "</span> <time style='color:" + theme['Timestamps'] + "'>20XX.01.01 12:00</time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'>No.27583594</a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> I forgive you for using VLC to open me. ;__; </blockquote></div>"
});
$.on(div, 'click', cb.restore);
$.add(suboptions, div);
}
div = $.el('div', {
id: 'addthemes',
innerHTML: "<a href='javascript:;'>Return</a>"
});
$.on($('a', div), 'click', function() {
var themes;
themes = {
open: Settings.themes,
hyphenatedTitle: 'themes'
};
$.rm($.id("themeContainer"));
return Settings.openSection(themes);
return Settings.openSection.call(themes);
});
}
$.add(parentdiv, suboptions);
@ -13890,12 +13899,17 @@
return MascotTools.importMascot(e);
});
$.on($('#undelete', batchmascots), 'click', function() {
var mascots;
if (!(Conf["Deleted Mascots"].length > 0)) {
alert("No mascots have been deleted.");
return;
}
$.rm($.id("mascotContainer"));
return Settings.mascotTab.dialog(Settings.el, 'undelete');
mascots = {
open: Settings.mascots,
hyphenatedTitle: 'mascots'
};
return Settings.openSection.apply(mascots, ['restore']);
});
} else {
categories = $.el("div", {
@ -13922,8 +13936,13 @@
innerHTML: "<a href=\"javascript:;\" id=\"return\">Return</a>"
});
$.on($('#return', batchmascots), 'click', function() {
$.rm($.id("mascotContainer"));
return Settings.section('mascots');
var mascots;
mascots = {
open: Settings.mascots,
hyphenatedTitle: 'mascots'
};
return Settings.openSection.apply(mascots);
});
}
$.add(parentdiv, [suboptions, batchmascots, mascotHide]);
@ -14055,7 +14074,8 @@
}
},
"delete": function(e) {
var container, settheme;
var container, settheme,
_this = this;
e.preventDefault();
e.stopPropagation();
@ -14073,26 +14093,28 @@
}
}
Themes[this.name]["Deleted"] = true;
return $.get("userThemes", {}, function() {
return $.get("userThemes", {}, function(_arg) {
var userThemes;
userThemes = items['userThemes'];
userThemes[this.name] = Themes[this.name];
userThemes = _arg.userThemes;
userThemes[_this.name] = Themes[_this.name];
$.set('userThemes', userThemes);
return $.rm(container);
});
}
},
restore: function() {
var _this = this;
if (confirm("Are you sure you want to restore \"" + this.id + "\"?")) {
Themes[this.id]["Deleted"] = false;
return $.get("userThemes", {}, function(item) {
return $.get("userThemes", {}, function(_arg) {
var userThemes;
userThemes = item["userThemes"];
userThemes[this.id] = Themes[this.id];
userThemes = _arg.userThemes;
userThemes[_this.id] = Themes[_this.id];
$.set('userThemes', userThemes);
return $.rm(this);
return $.rm(_this);
});
}
}

View File

@ -11327,18 +11327,12 @@
ThemeTools = {
init: function(key) {
var colorInput, div, fileInput, header, input, item, layout, themecontent, _i, _j, _len, _len1, _ref;
var colorInput, div, fileInput, header, input, item, layout, nodes, themeContent, _i, _j, _len, _len1, _ref;
Conf['editMode'] = "theme";
if (Themes[key]) {
if (key) {
editTheme = JSON.parse(JSON.stringify(Themes[key]));
$.get("userThemes", {}, function(items) {
if (items[key]) {
return editTheme["Theme"] = key;
} else {
return editTheme["Theme"] = key += " [custom]";
}
});
editTheme["Theme"] = Conf['userThemes'][key] ? key : key += " [custom]";
} else {
editTheme = JSON.parse(JSON.stringify(Themes['Yotsuba B']));
editTheme["Theme"] = "Untitled";
@ -11362,7 +11356,8 @@
});
}
$.add($("#themebar", ThemeTools.dialog), header);
themecontent = $("#themecontent", ThemeTools.dialog);
themeContent = $("#themecontent", ThemeTools.dialog);
nodes = [];
for (_j = 0, _len1 = layout.length; _j < _len1; _j++) {
item = layout[_j];
if (!editTheme[item]) {
@ -11437,10 +11432,9 @@
}
return editTheme[this.name] = this.value;
});
Style.addStyle(editTheme);
$.add(themecontent, div);
nodes.push(div);
}
$.add(themecontent, div);
Style.addStyle(editTheme);
if (!editTheme["Custom CSS"]) {
editTheme["Custom CSS"] = "";
}
@ -11452,11 +11446,12 @@
editTheme["Custom CSS"] = this.value;
return Style.themeCSS.textContent = Style.theme(editTheme);
});
$.add(themecontent, div);
nodes.push(div);
$.on($('#save > a', ThemeTools.dialog), 'click', function() {
return ThemeTools.save(editTheme);
});
$.on($('#close > a', ThemeTools.dialog), 'click', ThemeTools.close);
$.add(themeContent, nodes);
$.add(d.body, ThemeTools.dialog);
return Style.themeCSS.textContent = Style.theme(editTheme);
},
@ -13713,19 +13708,20 @@
for (_i = 0, _len = keys.length; _i < _len; _i++) {
name = keys[_i];
theme = Themes[name];
if (!theme["Deleted"]) {
div = $.el('div', {
className: "theme " + (name === Conf['theme'] ? 'selectedtheme' : ''),
id: name,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div> <div style='cursor: pointer; width: 9px; height: 9px; margin: 2px 3px; display: inline-block; vertical-align: bottom; background: " + theme['Checkbox Background'] + "; border: 1px solid " + theme['Checkbox Border'] + ";'></div> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'> " + name + " </span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'> " + theme['Author'] + " </span> <span style='color:" + theme['Sage'] + "!important'> (SAGE) </span> <span style='color:" + theme['Tripcodes'] + "!important'> " + theme['Author Tripcode'] + " </span> <time style='color:" + theme['Timestamps'] + "'> 20XX.01.01 12:00 </time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'> No.27583594 </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=edit> &gt;&gt;edit </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=export> &gt;&gt;export </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=delete> &gt;&gt;delete </a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> Post content is right here. </blockquote> <h1 style='color: " + theme['Text'] + "'> Selected </h1></div>"
});
div.style.backgroundColor = theme['Background Color'];
$.on($('a.edit', div), 'click', cb.edit);
$.on($('a.export', div), 'click', cb["export"]);
$.on($('a.delete', div), 'click', cb["delete"]);
$.on(div, 'click', cb.select);
$.add(suboptions, div);
if (theme["Deleted"]) {
continue;
}
div = $.el('div', {
className: "theme " + (name === Conf['theme'] ? 'selectedtheme' : ''),
id: name,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div> <div style='cursor: pointer; width: 9px; height: 9px; margin: 2px 3px; display: inline-block; vertical-align: bottom; background: " + theme['Checkbox Background'] + "; border: 1px solid " + theme['Checkbox Border'] + ";'></div> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'> " + name + " </span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'> " + theme['Author'] + " </span> <span style='color:" + theme['Sage'] + "!important'> (SAGE) </span> <span style='color:" + theme['Tripcodes'] + "!important'> " + theme['Author Tripcode'] + " </span> <time style='color:" + theme['Timestamps'] + "'> 20XX.01.01 12:00 </time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'> No.27583594 </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=edit> &gt;&gt;edit </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=export> &gt;&gt;export </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=delete> &gt;&gt;delete </a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> Post content is right here. </blockquote> <h1 style='color: " + theme['Text'] + "'> Selected </h1></div>"
});
div.style.backgroundColor = theme['Background Color'];
$.on($('a.edit', div), 'click', cb.edit);
$.on($('a.export', div), 'click', cb["export"]);
$.on($('a.delete', div), 'click', cb["delete"]);
$.on(div, 'click', cb.select);
$.add(suboptions, div);
}
div = $.el('div', {
id: 'addthemes',
@ -13754,30 +13750,43 @@
return this.nextSibling.click();
});
$.on($('#tUndelete', div), 'click', function() {
var themes;
$.rm($.id("themeContainer"));
return Settings.openSection(themes, 'undelete');
themes = {
open: Settings.themes,
hyphenatedTitle: 'themes'
};
return Settings.openSection.apply(themes, ['undelete']);
});
} else {
for (_j = 0, _len1 = keys.length; _j < _len1; _j++) {
name = keys[_j];
theme = Themes[name];
if (theme["Deleted"]) {
div = $.el('div', {
id: name,
className: theme,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div style='padding: 3px 0px 0px 8px;'> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'>" + name + "</span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'>" + theme['Author'] + "</span> <span style='color:" + theme['Sage'] + "!important'>(SAGE)</span> <span style='color:" + theme['Tripcodes'] + "!important'>" + theme['Author Tripcode'] + "</span> <time style='color:" + theme['Timestamps'] + "'>20XX.01.01 12:00</time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'>No.27583594</a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> I forgive you for using VLC to open me. ;__; </blockquote></div>"
});
$.on(div, 'click', cb.restore);
$.add(suboptions, div);
if (!theme["Deleted"]) {
continue;
}
div = $.el('div', {
id: name,
className: theme,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div style='padding: 3px 0px 0px 8px;'> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'>" + name + "</span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'>" + theme['Author'] + "</span> <span style='color:" + theme['Sage'] + "!important'>(SAGE)</span> <span style='color:" + theme['Tripcodes'] + "!important'>" + theme['Author Tripcode'] + "</span> <time style='color:" + theme['Timestamps'] + "'>20XX.01.01 12:00</time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'>No.27583594</a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> I forgive you for using VLC to open me. ;__; </blockquote></div>"
});
$.on(div, 'click', cb.restore);
$.add(suboptions, div);
}
div = $.el('div', {
id: 'addthemes',
innerHTML: "<a href='javascript:;'>Return</a>"
});
$.on($('a', div), 'click', function() {
var themes;
themes = {
open: Settings.themes,
hyphenatedTitle: 'themes'
};
$.rm($.id("themeContainer"));
return Settings.openSection(themes);
return Settings.openSection.call(themes);
});
}
$.add(parentdiv, suboptions);
@ -13909,12 +13918,17 @@
return MascotTools.importMascot(e);
});
$.on($('#undelete', batchmascots), 'click', function() {
var mascots;
if (!(Conf["Deleted Mascots"].length > 0)) {
alert("No mascots have been deleted.");
return;
}
$.rm($.id("mascotContainer"));
return Settings.mascotTab.dialog(Settings.el, 'undelete');
mascots = {
open: Settings.mascots,
hyphenatedTitle: 'mascots'
};
return Settings.openSection.apply(mascots, ['restore']);
});
} else {
categories = $.el("div", {
@ -13941,8 +13955,13 @@
innerHTML: "<a href=\"javascript:;\" id=\"return\">Return</a>"
});
$.on($('#return', batchmascots), 'click', function() {
$.rm($.id("mascotContainer"));
return Settings.section('mascots');
var mascots;
mascots = {
open: Settings.mascots,
hyphenatedTitle: 'mascots'
};
return Settings.openSection.apply(mascots);
});
}
$.add(parentdiv, [suboptions, batchmascots, mascotHide]);
@ -14074,7 +14093,8 @@
}
},
"delete": function(e) {
var container, settheme;
var container, settheme,
_this = this;
e.preventDefault();
e.stopPropagation();
@ -14092,26 +14112,28 @@
}
}
Themes[this.name]["Deleted"] = true;
return $.get("userThemes", {}, function() {
return $.get("userThemes", {}, function(_arg) {
var userThemes;
userThemes = items['userThemes'];
userThemes[this.name] = Themes[this.name];
userThemes = _arg.userThemes;
userThemes[_this.name] = Themes[_this.name];
$.set('userThemes', userThemes);
return $.rm(container);
});
}
},
restore: function() {
var _this = this;
if (confirm("Are you sure you want to restore \"" + this.id + "\"?")) {
Themes[this.id]["Deleted"] = false;
return $.get("userThemes", {}, function(item) {
return $.get("userThemes", {}, function(_arg) {
var userThemes;
userThemes = item["userThemes"];
userThemes[this.id] = Themes[this.id];
userThemes = _arg.userThemes;
userThemes[_this.id] = Themes[_this.id];
$.set('userThemes', userThemes);
return $.rm(this);
return $.rm(_this);
});
}
}

Binary file not shown.

View File

@ -11310,18 +11310,12 @@
ThemeTools = {
init: function(key) {
var colorInput, div, fileInput, header, input, item, layout, themecontent, _i, _j, _len, _len1, _ref;
var colorInput, div, fileInput, header, input, item, layout, nodes, themeContent, _i, _j, _len, _len1, _ref;
Conf['editMode'] = "theme";
if (Themes[key]) {
if (key) {
editTheme = JSON.parse(JSON.stringify(Themes[key]));
$.get("userThemes", {}, function(items) {
if (items[key]) {
return editTheme["Theme"] = key;
} else {
return editTheme["Theme"] = key += " [custom]";
}
});
editTheme["Theme"] = Conf['userThemes'][key] ? key : key += " [custom]";
} else {
editTheme = JSON.parse(JSON.stringify(Themes['Yotsuba B']));
editTheme["Theme"] = "Untitled";
@ -11345,7 +11339,8 @@
});
}
$.add($("#themebar", ThemeTools.dialog), header);
themecontent = $("#themecontent", ThemeTools.dialog);
themeContent = $("#themecontent", ThemeTools.dialog);
nodes = [];
for (_j = 0, _len1 = layout.length; _j < _len1; _j++) {
item = layout[_j];
if (!editTheme[item]) {
@ -11420,10 +11415,9 @@
}
return editTheme[this.name] = this.value;
});
Style.addStyle(editTheme);
$.add(themecontent, div);
nodes.push(div);
}
$.add(themecontent, div);
Style.addStyle(editTheme);
if (!editTheme["Custom CSS"]) {
editTheme["Custom CSS"] = "";
}
@ -11435,11 +11429,12 @@
editTheme["Custom CSS"] = this.value;
return Style.themeCSS.textContent = Style.theme(editTheme);
});
$.add(themecontent, div);
nodes.push(div);
$.on($('#save > a', ThemeTools.dialog), 'click', function() {
return ThemeTools.save(editTheme);
});
$.on($('#close > a', ThemeTools.dialog), 'click', ThemeTools.close);
$.add(themeContent, nodes);
$.add(d.body, ThemeTools.dialog);
return Style.themeCSS.textContent = Style.theme(editTheme);
},
@ -13698,19 +13693,20 @@
for (_i = 0, _len = keys.length; _i < _len; _i++) {
name = keys[_i];
theme = Themes[name];
if (!theme["Deleted"]) {
div = $.el('div', {
className: "theme " + (name === Conf['theme'] ? 'selectedtheme' : ''),
id: name,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div> <div style='cursor: pointer; width: 9px; height: 9px; margin: 2px 3px; display: inline-block; vertical-align: bottom; background: " + theme['Checkbox Background'] + "; border: 1px solid " + theme['Checkbox Border'] + ";'></div> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'> " + name + " </span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'> " + theme['Author'] + " </span> <span style='color:" + theme['Sage'] + "!important'> (SAGE) </span> <span style='color:" + theme['Tripcodes'] + "!important'> " + theme['Author Tripcode'] + " </span> <time style='color:" + theme['Timestamps'] + "'> 20XX.01.01 12:00 </time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'> No.27583594 </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=edit> &gt;&gt;edit </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=export> &gt;&gt;export </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=delete> &gt;&gt;delete </a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> Post content is right here. </blockquote> <h1 style='color: " + theme['Text'] + "'> Selected </h1></div>"
});
div.style.backgroundColor = theme['Background Color'];
$.on($('a.edit', div), 'click', cb.edit);
$.on($('a.export', div), 'click', cb["export"]);
$.on($('a.delete', div), 'click', cb["delete"]);
$.on(div, 'click', cb.select);
$.add(suboptions, div);
if (theme["Deleted"]) {
continue;
}
div = $.el('div', {
className: "theme " + (name === Conf['theme'] ? 'selectedtheme' : ''),
id: name,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div> <div style='cursor: pointer; width: 9px; height: 9px; margin: 2px 3px; display: inline-block; vertical-align: bottom; background: " + theme['Checkbox Background'] + "; border: 1px solid " + theme['Checkbox Border'] + ";'></div> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'> " + name + " </span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'> " + theme['Author'] + " </span> <span style='color:" + theme['Sage'] + "!important'> (SAGE) </span> <span style='color:" + theme['Tripcodes'] + "!important'> " + theme['Author Tripcode'] + " </span> <time style='color:" + theme['Timestamps'] + "'> 20XX.01.01 12:00 </time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'> No.27583594 </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=edit> &gt;&gt;edit </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=export> &gt;&gt;export </a> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Backlinks'] + "!important;&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important;&quot;)' style='color:" + theme['Backlinks'] + "!important;' href='javascript:;' name='" + name + "' class=delete> &gt;&gt;delete </a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> Post content is right here. </blockquote> <h1 style='color: " + theme['Text'] + "'> Selected </h1></div>"
});
div.style.backgroundColor = theme['Background Color'];
$.on($('a.edit', div), 'click', cb.edit);
$.on($('a.export', div), 'click', cb["export"]);
$.on($('a.delete', div), 'click', cb["delete"]);
$.on(div, 'click', cb.select);
$.add(suboptions, div);
}
div = $.el('div', {
id: 'addthemes',
@ -13739,30 +13735,43 @@
return this.nextSibling.click();
});
$.on($('#tUndelete', div), 'click', function() {
var themes;
$.rm($.id("themeContainer"));
return Settings.openSection(themes, 'undelete');
themes = {
open: Settings.themes,
hyphenatedTitle: 'themes'
};
return Settings.openSection.apply(themes, ['undelete']);
});
} else {
for (_j = 0, _len1 = keys.length; _j < _len1; _j++) {
name = keys[_j];
theme = Themes[name];
if (theme["Deleted"]) {
div = $.el('div', {
id: name,
className: theme,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div style='padding: 3px 0px 0px 8px;'> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'>" + name + "</span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'>" + theme['Author'] + "</span> <span style='color:" + theme['Sage'] + "!important'>(SAGE)</span> <span style='color:" + theme['Tripcodes'] + "!important'>" + theme['Author Tripcode'] + "</span> <time style='color:" + theme['Timestamps'] + "'>20XX.01.01 12:00</time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'>No.27583594</a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> I forgive you for using VLC to open me. ;__; </blockquote></div>"
});
$.on(div, 'click', cb.restore);
$.add(suboptions, div);
if (!theme["Deleted"]) {
continue;
}
div = $.el('div', {
id: name,
className: theme,
innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div style='padding: 3px 0px 0px 8px;'> <span style='color:" + theme['Subjects'] + "!important; font-weight: 600 !important'>" + name + "</span> <span style='color:" + theme['Names'] + "!important; font-weight: 600 !important'>" + theme['Author'] + "</span> <span style='color:" + theme['Sage'] + "!important'>(SAGE)</span> <span style='color:" + theme['Tripcodes'] + "!important'>" + theme['Author Tripcode'] + "</span> <time style='color:" + theme['Timestamps'] + "'>20XX.01.01 12:00</time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important&quot;)' style='color:" + theme['Post Numbers'] + "!important;' href='javascript:;'>No.27583594</a> </div> <blockquote style='margin: 0; padding: 12px 40px 12px 38px'> <a style='color:" + theme['Quotelinks'] + "!important; text-shadow: none;'> &gt;&gt;27582902 </a> <br> I forgive you for using VLC to open me. ;__; </blockquote></div>"
});
$.on(div, 'click', cb.restore);
$.add(suboptions, div);
}
div = $.el('div', {
id: 'addthemes',
innerHTML: "<a href='javascript:;'>Return</a>"
});
$.on($('a', div), 'click', function() {
var themes;
themes = {
open: Settings.themes,
hyphenatedTitle: 'themes'
};
$.rm($.id("themeContainer"));
return Settings.openSection(themes);
return Settings.openSection.call(themes);
});
}
$.add(parentdiv, suboptions);
@ -13894,12 +13903,17 @@
return MascotTools.importMascot(e);
});
$.on($('#undelete', batchmascots), 'click', function() {
var mascots;
if (!(Conf["Deleted Mascots"].length > 0)) {
alert("No mascots have been deleted.");
return;
}
$.rm($.id("mascotContainer"));
return Settings.mascotTab.dialog(Settings.el, 'undelete');
mascots = {
open: Settings.mascots,
hyphenatedTitle: 'mascots'
};
return Settings.openSection.apply(mascots, ['restore']);
});
} else {
categories = $.el("div", {
@ -13926,8 +13940,13 @@
innerHTML: "<a href=\"javascript:;\" id=\"return\">Return</a>"
});
$.on($('#return', batchmascots), 'click', function() {
$.rm($.id("mascotContainer"));
return Settings.section('mascots');
var mascots;
mascots = {
open: Settings.mascots,
hyphenatedTitle: 'mascots'
};
return Settings.openSection.apply(mascots);
});
}
$.add(parentdiv, [suboptions, batchmascots, mascotHide]);
@ -14059,7 +14078,8 @@
}
},
"delete": function(e) {
var container, settheme;
var container, settheme,
_this = this;
e.preventDefault();
e.stopPropagation();
@ -14077,26 +14097,28 @@
}
}
Themes[this.name]["Deleted"] = true;
return $.get("userThemes", {}, function() {
return $.get("userThemes", {}, function(_arg) {
var userThemes;
userThemes = items['userThemes'];
userThemes[this.name] = Themes[this.name];
userThemes = _arg.userThemes;
userThemes[_this.name] = Themes[_this.name];
$.set('userThemes', userThemes);
return $.rm(container);
});
}
},
restore: function() {
var _this = this;
if (confirm("Are you sure you want to restore \"" + this.id + "\"?")) {
Themes[this.id]["Deleted"] = false;
return $.get("userThemes", {}, function(item) {
return $.get("userThemes", {}, function(_arg) {
var userThemes;
userThemes = item["userThemes"];
userThemes[this.id] = Themes[this.id];
userThemes = _arg.userThemes;
userThemes[_this.id] = Themes[_this.id];
$.set('userThemes', userThemes);
return $.rm(this);
return $.rm(_this);
});
}
}

View File

@ -107,7 +107,7 @@ Settings =
hyphenatedTitle = title.toLowerCase().replace /\s+/g, '-'
Settings.sections.push {title, hyphenatedTitle, open}
openSection: (mode)->
openSection: (mode) ->
if selected = $ '.tab-selected', Settings.dialog
$.rmClass selected, 'tab-selected'
$.addClass $(".tab-#{@hyphenatedTitle}", Settings.dialog), 'tab-selected'
@ -549,12 +549,12 @@ Settings =
for name in keys
theme = Themes[name]
unless theme["Deleted"]
continue if theme["Deleted"]
div = $.el 'div',
className: "theme #{if name is Conf['theme'] then 'selectedtheme' else ''}"
id: name
innerHTML: "
div = $.el 'div',
className: "theme #{if name is Conf['theme'] then 'selectedtheme' else ''}"
id: name
innerHTML: "
<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:#{theme['Reply Background']}!important;border:1px solid #{theme['Reply Border']}!important;color:#{theme['Text']}!important'>
<div>
<div style='cursor: pointer; width: 9px; height: 9px; margin: 2px 3px; display: inline-block; vertical-align: bottom; background: #{theme['Checkbox Background']}; border: 1px solid #{theme['Checkbox Border']};'></div>
@ -598,14 +598,14 @@ Settings =
</h1>
</div>"
div.style.backgroundColor = theme['Background Color']
div.style.backgroundColor = theme['Background Color']
$.on $('a.edit', div), 'click', cb.edit
$.on $('a.export', div), 'click', cb.export
$.on $('a.delete', div), 'click', cb.delete
$.on div, 'click', cb.select
$.on $('a.edit', div), 'click', cb.edit
$.on $('a.export', div), 'click', cb.export
$.on $('a.delete', div), 'click', cb.delete
$.on div, 'click', cb.select
$.add suboptions, div
$.add suboptions, div
div = $.el 'div',
id: 'addthemes'
@ -639,19 +639,24 @@ Settings =
$.on $('#tUndelete', div), 'click', ->
$.rm $.id "themeContainer"
Settings.openSection themes, 'undelete'
themes =
open: Settings.themes
hyphenatedTitle: 'themes'
Settings.openSection.apply themes, ['undelete']
else
for name in keys
theme = Themes[name]
if theme["Deleted"]
continue unless theme["Deleted"]
div = $.el 'div',
id: name
className: theme
innerHTML: "
div = $.el 'div',
id: name
className: theme
innerHTML: "
<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% !important; box-shadow: none !important; background:#{theme['Reply Background']}!important;border:1px solid #{theme['Reply Border']}!important;color:#{theme['Text']}!important'>
<div style='padding: 3px 0px 0px 8px;'>
<span style='color:#{theme['Subjects']}!important; font-weight: 600 !important'>#{name}</span>
@ -670,17 +675,21 @@ Settings =
</blockquote>
</div>"
$.on div, 'click', cb.restore
$.on div, 'click', cb.restore
$.add suboptions, div
$.add suboptions, div
div = $.el 'div',
id: 'addthemes'
innerHTML: "<a href='javascript:;'>Return</a>"
$.on $('a', div), 'click', ->
themes =
open: Settings.themes
hyphenatedTitle: 'themes'
$.rm $.id "themeContainer"
Settings.openSection themes
Settings.openSection.call themes
$.add parentdiv, suboptions
$.add parentdiv, div
@ -815,8 +824,10 @@ Settings =
unless Conf["Deleted Mascots"].length > 0
alert "No mascots have been deleted."
return
$.rm $.id "mascotContainer"
Settings.mascotTab.dialog Settings.el, 'undelete'
mascots =
open: Settings.mascots
hyphenatedTitle: 'mascots'
Settings.openSection.apply mascots, ['restore']
else
categories = $.el "div",
@ -845,8 +856,10 @@ Settings =
innerHTML: "<a href=\"javascript:;\" id=\"return\">Return</a>"
$.on $('#return', batchmascots), 'click', ->
$.rm $.id "mascotContainer"
Settings.section 'mascots'
mascots =
open: Settings.mascots
hyphenatedTitle: 'mascots'
Settings.openSection.apply mascots
$.add parentdiv, [suboptions, batchmascots, mascotHide]
@ -973,8 +986,7 @@ Settings =
$.set 'theme', Conf['theme']
Themes[@name]["Deleted"] = true
$.get "userThemes", {}, ->
userThemes = items['userThemes']
$.get "userThemes", {}, ({userThemes}) =>
userThemes[@name] = Themes[@name]
$.set 'userThemes', userThemes
$.rm container
@ -982,8 +994,8 @@ Settings =
restore: ->
if confirm "Are you sure you want to restore \"#{@id}\"?"
Themes[@id]["Deleted"] = false
$.get "userThemes", {}, (item) ->
userThemes = item["userThemes"]
$.get "userThemes", {}, ({userThemes}) =>
userThemes[@id] = Themes[@id]
$.set 'userThemes', userThemes
$.rm @

View File

@ -6,16 +6,15 @@ ThemeTools =
init: (key) ->
Conf['editMode'] = "theme"
if Themes[key]
if key
editTheme = JSON.parse(JSON.stringify(Themes[key]))
$.get "userThemes", {}, (items) ->
if items[key]
editTheme["Theme"] = key
else
editTheme["Theme"] = key += " [custom]"
editTheme["Theme"] = if Conf['userThemes'][key]
key
else
key += " [custom]"
else
editTheme = JSON.parse(JSON.stringify(Themes['Yotsuba B']))
editTheme["Theme"] = "Untitled"
editTheme["Theme"] = "Untitled"
editTheme["Author"] = "Author"
editTheme["Author Tripcode"] = "Unknown"
@ -102,8 +101,10 @@ ThemeTools =
$.on input, 'blur', ->
editTheme[@name] = @value
$.add $("#themebar", ThemeTools.dialog), header
themecontent = $("#themecontent", ThemeTools.dialog)
themeContent = $("#themecontent", ThemeTools.dialog)
nodes = []
for item in layout
unless editTheme[item]
editTheme[item] = ''
@ -168,11 +169,9 @@ ThemeTools =
editTheme[@name] = @value
Style.addStyle(editTheme)
nodes.push div
$.add themecontent, div
$.add themecontent, div
Style.addStyle(editTheme)
unless editTheme["Custom CSS"]
editTheme["Custom CSS"] = ""
@ -185,12 +184,15 @@ ThemeTools =
editTheme["Custom CSS"] = @value
Style.themeCSS.textContent = Style.theme editTheme
$.add themecontent, div
nodes.push div
$.on $('#save > a', ThemeTools.dialog), 'click', ->
ThemeTools.save editTheme
$.on $('#close > a', ThemeTools.dialog), 'click', ThemeTools.close
$.add themeContent, nodes
$.add d.body, ThemeTools.dialog
Style.themeCSS.textContent = Style.theme editTheme