|
|
|
@ -176,30 +176,12 @@ export default {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const item = goosemodScope.settings.items.find((x) => x[1] === goosemodScope.moduleStoreAPI.getSettingItemName(moduleInfo))[2].find((x) => x.subtext === moduleInfo.description);
|
|
|
|
|
|
|
|
|
|
item.buttonType = 'danger';
|
|
|
|
|
item.buttonText = '#terms.remove#';
|
|
|
|
|
item.showToggle = true;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// goosemodScope.logger.debug('import', 'Failed to change setting during MS importModule (likely during initial imports so okay)');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If themes / plugins open
|
|
|
|
|
if (document.querySelector(`#gm-settings-inject`)) {
|
|
|
|
|
const cardEls = [...document.querySelectorAll(`.title-2dsDLn + .colorStandard-1Xxp1s`)].filter((x) => x.textContent === moduleInfo.description).map((x) => x.parentElement);
|
|
|
|
|
|
|
|
|
|
if (cardEls.length === 0) return;
|
|
|
|
|
|
|
|
|
|
for (const cardEl of cardEls) {
|
|
|
|
|
const buttonEl = cardEl.querySelector(`.lookFilled-yCfaCM`);
|
|
|
|
|
|
|
|
|
|
buttonEl.className = buttonEl.className.replace('lookFilled-yCfaCM colorBrand-I6CyqQ', 'lookOutlined-3yKVGo colorRed-rQXKgM');
|
|
|
|
|
buttonEl.textContent = '#terms.remove#';
|
|
|
|
|
|
|
|
|
|
const toggleEl = cardEl.querySelector(`.container-2nx-BQ`);
|
|
|
|
|
toggleEl.classList.remove('hide-toggle');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// goosemodScope.showToast(`Failed to import module ${moduleName}`, { timeout: 2000, type: 'error', subtext: '#terms.goosemod.store#' });
|
|
|
|
|
console.error(e);
|
|
|
|
@ -208,29 +190,11 @@ export default {
|
|
|
|
|
|
|
|
|
|
moduleRemoved: (m) => {
|
|
|
|
|
let item = goosemodScope.settings.items.find((x) => x[1] === goosemodScope.moduleStoreAPI.getSettingItemName(m))[2].find((x) => x.subtext === m.description);
|
|
|
|
|
|
|
|
|
|
if (item === undefined) return;
|
|
|
|
|
|
|
|
|
|
item.buttonType = 'brand';
|
|
|
|
|
item.buttonText = '#terms.install#';
|
|
|
|
|
item.showToggle = false;
|
|
|
|
|
|
|
|
|
|
// If themes / plugins open
|
|
|
|
|
if (document.querySelector(`#gm-settings-inject`)) {
|
|
|
|
|
const cardEls = [...document.querySelectorAll(`.title-2dsDLn + .colorStandard-1Xxp1s`)].filter((x) => x.textContent === m.description).map((x) => x.parentElement);
|
|
|
|
|
|
|
|
|
|
if (cardEls.length === 0) return;
|
|
|
|
|
|
|
|
|
|
for (const cardEl of cardEls) {
|
|
|
|
|
const buttonEl = cardEl.querySelector(`.lookOutlined-3yKVGo`);
|
|
|
|
|
|
|
|
|
|
buttonEl.className = buttonEl.className.replace('lookOutlined-3yKVGo colorRed-rQXKgM', 'lookFilled-yCfaCM colorBrand-I6CyqQ');
|
|
|
|
|
buttonEl.textContent = '#terms.install#';
|
|
|
|
|
|
|
|
|
|
const toggleEl = cardEl.querySelector(`.container-2nx-BQ`);
|
|
|
|
|
toggleEl.classList.add('hide-toggle');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
parseAuthors: async (a) => {
|
|
|
|
@ -342,7 +306,7 @@ To continue importing this module the dependencies need to be imported.`,
|
|
|
|
|
goosemodScope.settings[`regen${type}`] = true;
|
|
|
|
|
|
|
|
|
|
if (checked) {
|
|
|
|
|
goosemodScope.modules[m.name] = Object.assign({}, goosemodScope.disabledModules[m.name]);
|
|
|
|
|
goosemodScope.modules[m.name] = goosemodScope.disabledModules[m.name];
|
|
|
|
|
delete goosemodScope.disabledModules[m.name];
|
|
|
|
|
|
|
|
|
|
await goosemodScope.modules[m.name].goosemodHandlers.onImport();
|
|
|
|
@ -355,7 +319,7 @@ To continue importing this module the dependencies need to be imported.`,
|
|
|
|
|
|
|
|
|
|
goosemodScope.moduleSettingsStore.enableModule(m.name);
|
|
|
|
|
} else {
|
|
|
|
|
goosemodScope.disabledModules[m.name] = Object.assign({}, goosemodScope.modules[m.name]);
|
|
|
|
|
goosemodScope.disabledModules[m.name] = goosemodScope.modules[m.name];
|
|
|
|
|
|
|
|
|
|
await goosemodScope.modules[m.name].goosemodHandlers.onRemove();
|
|
|
|
|
|
|
|
|
@ -363,20 +327,6 @@ To continue importing this module the dependencies need to be imported.`,
|
|
|
|
|
|
|
|
|
|
goosemodScope.moduleSettingsStore.disableModule(m.name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If themes / plugins open
|
|
|
|
|
if (document.querySelector(`#gm-settings-inject`)) {
|
|
|
|
|
const cardEls = [...document.querySelectorAll(`.title-2dsDLn + .colorStandard-1Xxp1s`)].filter((x) => x.textContent === m.description).map((x) => x.parentElement);
|
|
|
|
|
|
|
|
|
|
if (cardEls.length === 0) return;
|
|
|
|
|
|
|
|
|
|
for (const cardEl of cardEls) {
|
|
|
|
|
goosemodScope.settings.ignoreVisualToggle = true;
|
|
|
|
|
|
|
|
|
|
const toggleInputEl = cardEl.querySelector('.input-2XRLou');
|
|
|
|
|
toggleInputEl.click();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|