lib
This commit is contained in:
parent
274e4a8f60
commit
2220ed748c
File diff suppressed because one or more lines are too long
|
@ -365,7 +365,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
BDFDB.creationTime = 0;
|
BDFDB.creationTime = 0;
|
||||||
var newversion = result.match(/['"][0-9]+\.[0-9]+\.[0-9]+['"]/i);
|
var newversion = result.match(/['"][0-9]+\.[0-9]+\.[0-9]+['"]/i);
|
||||||
newversion = newversion.toString().replace(/['"]/g, '');
|
newversion = newversion.toString().replace(/['"]/g, '');
|
||||||
LibraryRequires.fs.writeFileSync(LibraryRequires.path.join(BDFDB.getPluginsFolder(), (bdplugins[plugname] ? bdplugins[plugname].filename : url.split("/").slice(-1)[0])), result);
|
LibraryRequires.fs.writeFileSync(LibraryRequires.path.join(BDFDB.getPluginsFolder(), url.split("/").slice(-1)[0]), result);
|
||||||
BDFDB.showToast(`${plugname} v${window.PluginUpdates.plugins[url].version} has been replaced by ${plugname} v${newversion}.`, {nopointer:true, selector:'plugin-updated-toast'});
|
BDFDB.showToast(`${plugname} v${window.PluginUpdates.plugins[url].version} has been replaced by ${plugname} v${newversion}.`, {nopointer:true, selector:'plugin-updated-toast'});
|
||||||
var updatenotice = document.querySelector('#pluginNotice');
|
var updatenotice = document.querySelector('#pluginNotice');
|
||||||
if (updatenotice) {
|
if (updatenotice) {
|
||||||
|
@ -3483,7 +3483,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
return swatch ? swatch.gradient || BDFDB.colorCONVERT(swatch.style.getPropertyValue('background-color'), 'RGBCOMP') : null;
|
return swatch ? swatch.gradient || BDFDB.colorCONVERT(swatch.style.getPropertyValue('background-color'), 'RGBCOMP') : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
BDFDB.openColorPicker = function (container, target, color, options = {gradient: true, comp: false, alpha: true, callback}) {
|
BDFDB.openColorPicker = function (container, target, color, options = {gradient: true, comp: false, alpha: true, callback: () => {}}) {
|
||||||
if (!container || !target) return;
|
if (!container || !target) return;
|
||||||
var isswatches = BDFDB.containsClass(container, 'swatches');
|
var isswatches = BDFDB.containsClass(container, 'swatches');
|
||||||
var isgradient = color && BDFDB.isObject(color);
|
var isgradient = color && BDFDB.isObject(color);
|
||||||
|
@ -3740,16 +3740,21 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
};
|
};
|
||||||
|
|
||||||
BDFDB.isPluginEnabled = function (plugname) {
|
BDFDB.isPluginEnabled = function (plugname) {
|
||||||
if (!BDFDB.isBDv2()) return window.bdplugins[plugname] && window.pluginCookie[plugname];
|
if (!BDFDB.isBDv2()) return BdApi.isPluginEnabled(plugname);
|
||||||
else return BDFDB.Plugins[plugname.toLowerCase()] ? BDFDB.Plugins[plugname.toLowerCase()].enabled : null;
|
else return BDFDB.Plugins[plugname.toLowerCase()] ? BDFDB.Plugins[plugname.toLowerCase()].enabled : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
BDFDB.getPlugin = function (plugname) {
|
||||||
|
if (BDFDB.isPluginEnabled(plugname)) return BdApi.getPlugin(plugname);
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
BDFDB.isRestartNoMoreEnabled = function () {
|
BDFDB.isRestartNoMoreEnabled = function () {
|
||||||
return window.settingsCookie['fork-ps-5'] && window.settingsCookie['fork-ps-5'] === true || BDFDB.isPluginEnabled('Restart-No-More') || BDFDB.isPluginEnabled('Restart No More');
|
return window.settingsCookie['fork-ps-5'] && window.settingsCookie['fork-ps-5'] === true || BDFDB.isPluginEnabled('Restart-No-More') || BDFDB.isPluginEnabled('Restart No More');
|
||||||
};
|
};
|
||||||
|
|
||||||
BDFDB.isThemeEnabled = function (themename) {
|
BDFDB.isThemeEnabled = function (themename) {
|
||||||
if (!BDFDB.isBDv2()) return window.bdthemes[themename] && window.themeCookie[themename];
|
if (!BDFDB.isBDv2()) return BdApi.isThemeEnabled(themename)
|
||||||
else return BDFDB.Themes[themename.toLowerCase()] ? BDFDB.Themes[themename.toLowerCase()].enabled : null;
|
else return BDFDB.Themes[themename.toLowerCase()] ? BDFDB.Themes[themename.toLowerCase()].enabled : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue