-
@@ -212,78 +226,51 @@ class ThemeRepo {
width: 100vw !important;
height: 100vh !important;
position: absolute !important;
- z-index: 3400 !important;
+ z-index: 999 !important;
}
.discordPreview ~ ${BDFDB.dotCN.appmount} {
position: absolute !important;
top: 0 !important;
}
- .themerepo-sort-popout,
- .themerepo-order-popout,
- .themerepo-favicon-tooltip,
- .themerepo-giticon-tooltip {
- z-index: 3600 !important;
- }
- .themerepo-modal {
- position: relative !important;
- z-index: 3500 !important;
+ .discordPreview ~ ${BDFDB.dotCNS.appmount + BDFDB.dotCN.app} {
+ opacity: 0 !important;
+ visibility: hidden !important;
}
.themerepo-modal ${BDFDB.dotCN.modalinner} {
min-height: 100%;
+ min-width: 800px;
+ width: 50%;
}
- .themerepo-modal .themeEntry {
+ .themerepo-modal .themeEntry,
+ .themerepo-modal .themeEntry .bda-header {
overflow: visible !important;
}
.themerepo-modal .themeEntry .gitIcon,
- .themerepo-modal .themeEntry .favIcon,
+ .themerepo-modal .themeEntry ${BDFDB.dotCN.giffavoritebutton},
.themerepo-modal .themeEntry .trashIcon {
- margin-right: 5px;
- cursor: pointer;
+ position: relative !important;
+ transform: none !important;
+ opacity: 1 !important;
+ margin-right: 5px !important;
+ cursor: pointer !important;
+ }
+ .themerepo-modal .themeEntry .gitIcon,
+ .themerepo-modal .themeEntry ${BDFDB.dotCN.giffavoritebutton}:not(${BDFDB.dotCN.giffavoriteselected}),
+ .themerepo-modal .themeEntry .trashIcon {
+ color: #4f545c !important;
+ }
+ ${BDFDB.dotCN.themedark} .themerepo-modal .themeEntry .gitIcon,
+ ${BDFDB.dotCN.themedark} .themerepo-modal .themeEntry ${BDFDB.dotCN.giffavoritebutton}:not(${BDFDB.dotCN.giffavoriteselected}),
+ ${BDFDB.dotCN.themedark} .themerepo-modal .themeEntry .trashIcon {
+ color: #fff !important;
}
.themerepo-modal .themeEntry .trashIcon,
- .themerepo-modal .themeEntry .favIcon {
- margin-left: auto;
- }
- .themerepo-modal .themeEntry .favIcon path {
- stroke: yellow;
- fill: none;
- }
- .themerepo-modal .themeEntry .favIcon.favorized path {
- stroke: yellow;
- fill: yellow;
- }
- .themerepo-modal .themeEntry.downloadable .trashIcon {
- display: none;
- }
- .themerepo-modal .themeEntry.downloadable .btn-download {
- background-color: rgb(114, 137, 218) !important;
+ .themerepo-modal .themeEntry ${BDFDB.dotCN.giffavoritebutton} {
margin-left: auto !important;
}
- .themerepo-modal .themeEntry.outdated .btn-download {
- background-color: rgb(240, 71, 71) !important;
- margin-left: 0 !important;
- }
- .themerepo-modal .themeEntry.updated .btn-download {
- background-color: rgb(67, 181, 129) !important;
- margin-left: 0 !important;
- }
- .themerepo-trashicon-tooltip{
- z-index: 3500!important;
- }
- .themerepo-modal .themeEntry.jiiks .bda-right {
- flex: 1 1 auto;
- }
- .themerepo-modal .themeEntry.jiiks .bda-header,
- .themerepo-modal .themeEntry.jiiks .bda-footer {
- display: flex;
- align-items: center;
- margin: 0 !important;
- }
- .themerepo-modal .themeEntry.jiiks .bda-footer {
- margin-top: 33% !important;
- }
- .themerepo-modal .themeEntry.jiiks .previewCheckboxWrapper {
- margin-right: 5px;
+ .themerepo-modal .themeEntry.downloadable .trashIcon {
+ opacity: 0 !important;
+ pointer-events: none !important;
}`;
}
@@ -291,7 +278,7 @@ class ThemeRepo {
getDescription () {return "Allows you to preview all themes from the theme repo and download them on the fly. Repo button is in the theme settings.";}
- getVersion () {return "1.5.9";}
+ getVersion () {return "1.6.4";}
getAuthor () {return "DevilBro";}
@@ -416,7 +403,7 @@ class ThemeRepo {
clearInterval(this.updateInterval);
clearTimeout(this.loading.timeout);
- $(".discordPreview, .themerepo-modal, .bd-themerepobutton, .themerepo-loadingicon").remove();
+ $(".discordPreview, .themerepo-modal, .themerepo-notice, .bd-themerepobutton, .themerepo-loadingicon").remove();
$(BDFDB.dotCN.app + " > .repo-loadingwrapper:empty").remove();
BDFDB.unloadMessage(this);
@@ -526,7 +513,7 @@ class ThemeRepo {
var themeRepoModal = $(this.themeRepoModalMarkup);
themeRepoModal.updateModal = true;
themeRepoModal.enableSearch = false;
- var hiddenSettings = BDFDB.loadAllData(this, "hidden");
+ var hiddenSettings = Object.assign({},BDFDB.loadAllData(this, "hidden"));
themeRepoModal.find("#input-darklight").prop("checked", lightTheme);
themeRepoModal.find("#input-customcss").prop("checked", false);
themeRepoModal.find("#input-themefixer").prop("checked", false);
@@ -570,15 +557,17 @@ class ThemeRepo {
this.createThemeFile("ThemeFixer.theme.css", `//META{"name":"ThemeFixer","description":"ThemeFixerCSS for transparent themes","author":"DevilBro","version":"1.0.1"}*//\n\n` + this.themeFixerCSS);
})
.on("change." + this.getName(), ".hide-checkbox", (e) => {
- var hideButton = $(e.currentTarget);
- hiddenSettings[hideButton.val()] = hideButton.prop("checked");
- BDFDB.saveAllData(hiddenSettings, this, "hidden");
+ BDFDB.saveData(e.currentTarget.value, e.currentTarget.checked, this, "hidden");
})
.on("change." + this.getName(), "#input-rnmstart", (e) => {
- BDFDB.saveData("RNMstart", $(e.currentTarget).prop("checked"), this, "settings");
+ BDFDB.saveData("RNMstart", e.currentTarget.checked, this, "settings");
})
.on("click." + this.getName(), ".tab[tab=themes]:not(.selected)", (e) => {
- this.addThemeEntries(themeRepoModal, frame);
+ var newHiddenSettings = BDFDB.loadAllData(this, "hidden");
+ if (!BDFDB.equals(newHiddenSettings, hiddenSettings)) {
+ hiddenSettings = Object.assign({},newHiddenSettings);
+ this.addThemeEntries(themeRepoModal, frame);
+ }
});
$(document).off("keyup." + this.getName())
@@ -658,34 +647,17 @@ class ThemeRepo {
for (let url in this.loadedThemes) {
let theme = this.loadedThemes[url];
let div = $(this.themeEntryMarkup);
-
var installedTheme = window.bdthemes[this.loadedThemes[url].name];
if (installedTheme && installedTheme.author.toUpperCase() == theme.author.toUpperCase()) {
- if (installedTheme.version != theme.version) {
- theme.state = 1;
- div.addClass("outdated")
- .find(".btn-download").text("Outdated");
- }
- else {
- theme.state = 0;
- div.addClass("updated")
- .find(".btn-download").text("Updated");
- }
+ theme.state = installedTheme.version != theme.version ? 1 : 0;
}
else {
theme.state = 2;
- div.addClass("downloadable")
- .find(".btn-download").text("Download");
}
- if (favorites[url]) {
- theme.fav = 0;
- div.find(".favIcon")[0].classList.add("favorized");
- }
- else {
- theme.fav = 1;
- div.find(".favIcon")[0].classList.remove("favorized");
- }
-
+ this.setEntryDivState(div, theme.state);
+ theme.fav = !!favorites[url] ? 0 : 1;
+ div.find(BDFDB.dotCN.giffavoritebutton).toggleClass(BDFDB.disCN.giffavoriteselected, !!favorites[url]);
+
modal.entries.push({
div: div,
url: theme.url,
@@ -740,16 +712,11 @@ class ThemeRepo {
});
frame.contentWindow.postMessage({origin:"ThemeRepo",reason:"NewTheme",checked:$(e.target).prop("checked"),css:entry.css},"*");
})
- .on("click." + this.getName(), ".favIcon", (e) => {
- e.currentTarget.classList.toggle("favorized");
- if (e.currentTarget.classList.contains("favorized")) {
- entry.fav = 0;
- BDFDB.saveData(entry.url, true, this, "favorites");
- }
- else {
- entry.fav = 1;
- BDFDB.removeData(entry.url, this, "favorites");
- }
+ .on("click." + this.getName(), BDFDB.dotCN.giffavoritebutton, (e) => {
+ let favorize = entry.fav == 1;
+ entry.fav = favorize ? 0 : 1;
+ if (favorize) BDFDB.saveData(entry.url, true, this, "favorites");
+ else BDFDB.removeData(entry.url, this, "favorites");
})
.on("click." + this.getName(), ".gitIcon", (e) => {
var giturl = null;
@@ -761,20 +728,23 @@ class ThemeRepo {
else if (entry.url.indexOf("https://gist.githubusercontent.com/") == 0) {
giturl = entry.url.replace("//gist.githubusercontent", "//gist.github").split("/raw/")[0];
}
- if (giturl) {
- window.open(giturl, "_blank");
- }
+ if (giturl) window.open(giturl, "_blank");
})
.on("click." + this.getName(), ".trashIcon", () => {
if (div.hasClass("outdated") || div.hasClass("updated")) {
entry.state = 2;
- div.removeClass("outdated").removeClass("updated").addClass("downloadable")
- .find(".btn-download").text("Download");
+ this.setEntryDivState(div, entry.state);
this.deleteThemeFile(entry);
if (!BDFDB.isRestartNoMoreEnabled()) this.removeTheme(entry);
}
})
- .on("mouseenter." + this.getName(), ".favIcon", (e) => {
+ .on("click." + this.getName(), ".btn-download", () => {
+ entry.state = 0;
+ this.setEntryDivState(div, entry.state);
+ this.downloadTheme(entry);
+ if (modal.find("#input-rnmstart").prop("checked")) setTimeout(() => {this.applyTheme(entry);},3000);
+ })
+ .on("mouseenter." + this.getName(), BDFDB.dotCN.giffavoritebutton, (e) => {
BDFDB.createTooltip("Favorize", e.currentTarget, {type:"top",selector:"themerepo-favicon-tooltip"});
})
.on("mouseenter." + this.getName(), ".gitIcon", (e) => {
@@ -782,19 +752,22 @@ class ThemeRepo {
})
.on("mouseenter." + this.getName(), ".trashIcon", (e) => {
BDFDB.createTooltip("Delete Themefile", e.currentTarget, {type:"top",selector:"themerepo-trashicon-tooltip"});
- })
- .on("click." + this.getName(), ".btn-download", () => {
- entry.state = 0;
- this.downloadTheme(entry);
- div.removeClass("downloadable").removeClass("outdated").addClass("updated")
- .find(".btn-download").text("Updated");
- if (modal.find("#input-rnmstart").prop("checked")) setTimeout(() => {this.applyTheme(entry);},3000);
});
container.append(div);
});
}
+ setEntryDivState (div, state) {
+ div
+ .toggleClass("downloadable", state > 1)
+ .toggleClass("outdated", state == 1)
+ .toggleClass("updated", state < 1)
+ .find(".btn-download")
+ .text(state < 1 ? "Updated" : (state > 1 ? "Download" : "Outdated"))
+ .get(0).style.setProperty("background-color", "rgb(" + (state < 1 ? "67,181,129" : (state > 1 ? "114,137,218" : "241,71,71")) + ")", "important");
+ }
+
loadThemes () {
var getThemeInfo, outdated = 0, i = 0;
var tags = ["name","description","author","version"];
@@ -844,7 +817,7 @@ class ThemeRepo {
let wrongUrls = [];
for (let url of this.foundThemes) if (url && !this.loadedThemes[url] && !wrongUrls.includes(url)) wrongUrls.push(url);
if (wrongUrls.length > 0) {
- var bar = BDFDB.createNotificationsBar(`ThemeRepo: ${wrongUrls.length} Theme${wrongUrls.length > 1 ? "s" : ""} could not be loaded.`, {type:"danger",btn:"List"});
+ var bar = BDFDB.createNotificationsBar(`ThemeRepo: ${wrongUrls.length} Theme${wrongUrls.length > 1 ? "s" : ""} could not be loaded.`, {type:"danger",btn:"List",selector:"themerepo-notice"});
$(bar).on("click." + this.getName(), BDFDB.dotCN.noticebutton, (e) => {
var toast = BDFDB.showToast(wrongUrls.join("\n"),{type:"error"});
toast.style.overflow = "hidden";