mirror of
https://github.com/GuySandler/CanvasRefined.git
synced 2026-06-21 01:49:54 +02:00
fixed themes to only be local
This commit is contained in:
parent
5162c9dad6
commit
9ae4ef6e7d
@ -429,18 +429,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="position:relative">
|
<div style="position:relative">
|
||||||
<div id="opt-in">
|
<div id="premade-themes"></div>
|
||||||
<div id="opt-in-box" style="background:#0e0e0e;border-radius:10px;padding:24px;">
|
|
||||||
<p style="font-size:14px;font-weight:600;">The theme browser has been updated to allow you to like themes, see real-time submissions, and easily submit new themes!</p>
|
|
||||||
<p style="margin-top:6px;font-size:11px;color:#a4a4a4;font-weight:600">If you choose to use the new browser, an ID will be registered to you in order to save your likes, but your ID is anonymous for your privacy. <a target="_blank" href="https://diditupe.dev/bettercanvas/privacy">More info here</a></p>
|
|
||||||
<div style="display:flex;margin-top: 14px;gap: 5px;">
|
|
||||||
<button class="big-button" id="new_browser_in">Use new browser</button>
|
|
||||||
<button class="big-button" id="new_browser_out">Continue using old</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="premade-themes">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="option-container">
|
<div class="option-container">
|
||||||
@ -502,7 +491,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="option-container">
|
<!-- <div class="option-container">
|
||||||
<div class="theme-header">
|
<div class="theme-header">
|
||||||
<h3 class="header-small" style="margin:0;flex:100">Theme browser opt-in reset</h3>
|
<h3 class="header-small" style="margin:0;flex:100">Theme browser opt-in reset</h3>
|
||||||
</div>
|
</div>
|
||||||
@ -510,7 +499,7 @@
|
|||||||
<button id="reset-optin" class="customization-button">Reset opt-in status</button>
|
<button id="reset-optin" class="customization-button">Reset opt-in status</button>
|
||||||
<p style="color:#a7a7a7">This will bring back the opt-in message so you can select a different option.</p>
|
<p style="color:#a7a7a7">This will bring back the opt-in message so you can select a different option.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="customize-dark tab" style="display: none">
|
<div class="customize-dark tab" style="display: none">
|
||||||
@ -1087,8 +1076,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="../js/popup.js"></script>
|
|
||||||
<script type="text/javascript" src="../js/themes.js"></script>
|
<script type="text/javascript" src="../js/themes.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/popup.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
25
js/popup.js
25
js/popup.js
@ -545,12 +545,12 @@ function setup() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// activate theme browser opt out
|
// activate theme browser opt out
|
||||||
document.getElementById("new_browser_out").addEventListener("click", () => {
|
// document.getElementById("new_browser_out").addEventListener("click", () => {
|
||||||
chrome.storage.sync.set({ "new_browser": false });
|
chrome.storage.sync.set({ "new_browser": false });
|
||||||
current_page_num = 1;
|
current_page_num = 1;
|
||||||
displayThemeList(0);
|
displayThemeList(0);
|
||||||
displayAlert(false, "Success! You are now viewing the old theme browser. This one will no longer recieve updates, but there is still plenty to choose from.");
|
// displayAlert(false, "Success! You are now viewing the old theme browser. This one will no longer recieve updates, but there is still plenty to choose from.");
|
||||||
});
|
// });
|
||||||
|
|
||||||
// activate theme browser opt in
|
// activate theme browser opt in
|
||||||
// document.getElementById("new_browser_in").addEventListener("click", registerUser);
|
// document.getElementById("new_browser_in").addEventListener("click", registerUser);
|
||||||
@ -571,10 +571,10 @@ function setup() {
|
|||||||
document.getElementById("browser-settings-popup").classList.remove("open");
|
document.getElementById("browser-settings-popup").classList.remove("open");
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("reset-optin").addEventListener("click", () => {
|
// document.getElementById("reset-optin").addEventListener("click", () => {
|
||||||
chrome.storage.sync.set({ "new_browser": null });
|
// chrome.storage.sync.set({ "new_browser": null });
|
||||||
document.getElementById("opt-in").style.display = "block";
|
// document.getElementById("opt-in").style.display = "block";
|
||||||
});
|
// });
|
||||||
|
|
||||||
// document.getElementById("view-submissions-btn").addEventListener("click", displayMySubmissions);
|
// document.getElementById("view-submissions-btn").addEventListener("click", displayMySubmissions);
|
||||||
document.getElementById("submit-form-btn").addEventListener("click", displayThemeSubmissionForm);
|
document.getElementById("submit-form-btn").addEventListener("click", displayThemeSubmissionForm);
|
||||||
@ -829,10 +829,10 @@ async function submitTheme() { //TODO: remake
|
|||||||
|
|
||||||
const sync = await chrome.storage.sync.get(null);
|
const sync = await chrome.storage.sync.get(null);
|
||||||
|
|
||||||
if (sync["new_browser"] !== true) {
|
// if (sync["new_browser"] !== true) {
|
||||||
displayAlert(true, "You'll need to opt in to the new browser if you want to submit your theme. If you've opted out and want to opt in, you can scroll down to the bottom of this page and opt back in.");
|
// displayAlert(true, "You'll need to opt in to the new browser if you want to submit your theme. If you've opted out and want to opt in, you can scroll down to the bottom of this page and opt back in.");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const theme = await getExport(sync, ["custom_cards", "card_colors", "dark_preset", "custom_font", "gradient_cards", "disable_color_overlay"]);
|
const theme = await getExport(sync, ["custom_cards", "card_colors", "dark_preset", "custom_font", "gradient_cards", "disable_color_overlay"]);
|
||||||
const title = document.getElementById("submit-title");
|
const title = document.getElementById("submit-title");
|
||||||
@ -1215,6 +1215,7 @@ function displaySavedThemes() {
|
|||||||
function getTheme(name) {
|
function getTheme(name) {
|
||||||
|
|
||||||
// get localThemes from themes.js
|
// get localThemes from themes.js
|
||||||
|
console.log(themes);
|
||||||
|
|
||||||
if (name === "all") return themes;
|
if (name === "all") return themes;
|
||||||
for (const theme in themes) if (theme.title === name) return theme
|
for (const theme in themes) if (theme.title === name) return theme
|
||||||
@ -1429,7 +1430,7 @@ function displayAdvancedCards() {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
document.querySelector(".advanced-cards").innerHTML = `<div class="option-container"><h3>Couldn't find your cards!<br/>You may need to refresh your Canvas page and/or this menu page.<br/><br/>If you're having issues please contact me - ksucpea@gmail.com</h3></div>`;
|
document.querySelector(".advanced-cards").innerHTML = `<div class="option-container"><h3>Couldn't find your cards!<br/>You may need to refresh your Canvas page and/or this menu page.<br/><br/>If you're having issues please contact me - sandlerguy5@gmail.com</h3></div>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user