Adapt some existing IIFEs to match

main
Isaiah Odhner 2022-01-18 22:52:59 -05:00
parent 355fba3ee2
commit a0e119ba8e
4 changed files with 13 additions and 11 deletions

View File

@ -88,4 +88,4 @@
if (cleanUp) { cleanUp(); }
});
})();
}());

View File

@ -1,10 +1,10 @@
(() => {
((exports) => {
const looksLikeChrome = !!(window.chrome && (window.chrome.loadTimes || window.chrome.csi));
// NOTE: Microsoft Edge includes window.chrome.app
// (also this browser detection logic could likely use some more nuance)
window.menus = {
const menus = {
[localize("&File")]: [
{
item: localize("&New"),
@ -1238,4 +1238,6 @@
add_literal_navigation_speech_recognition(menu, top_level_menu_name);
}
})();
exports.menus = menus;
})(window);

View File

@ -2,7 +2,7 @@
// or maybe replace this module with localforage actually
// (but need to address asynchronous concerns if doing that)
(() => {
((exports) => {
let localStore = {
get(key, callback) {
let i, item, len, obj, keys, keys_obj;
@ -68,6 +68,6 @@
}
};
window.storage = localStore;
exports.storage = localStore;
})();
})(window);

View File

@ -1,4 +1,4 @@
(() => {
((exports) => {
const default_theme = "classic.css";
const theme_storage_key = "jspaint theme";
const disable_seasonal_theme_key = "jspaint disable seasonal theme";
@ -46,9 +46,9 @@
update_not_for_modern_theme();
window.get_theme = () => current_theme;
exports.get_theme = () => current_theme;
window.set_theme = theme => {
exports.set_theme = theme => {
current_theme = theme;
try {
@ -176,4 +176,4 @@
document.body.appendChild(button);
grinch_button = button;
}
})();
})(window);