User:Chlod/Scripts/Deputy.js: Difference between revisions

Content deleted Content added
(bot/CD)
(bot/CD)
Line 351:
 
var version = "0.5.1";
var gitAbbrevHash = "39ca6c55595767";
var gitBranch = "main";
var gitDate = "Wed, 14 Feb 2024 0912:5129:3022 +0800";
var gitVersion = "0.5.1+g39ca6c5g5595767";
 
/**
Line 12,443:
*/
class ConfigurationBase {
/**
* Creates a new Configuration.
*/
constructor() { }
// eslint-disable-next-line jsdoc/require-returns-check
/**
Line 12,454 ⟶ 12,450:
throw new Error('Unimplemented method.');
}
/**
* Creates a new Configuration.
*/
constructor() { }
/**
* Deserializes a JSON configuration into this configuration. This WILL overwrite
Line 12,509:
}
}
ConfigurationBase.configVersion = 1;
 
/**
Line 13,877 ⟶ 13,876:
// page was made, and we need to switch to it.
if (this.core.lastEdited.get() < liveWikiConfig.core.lastEdited) {
// Don't update if the config version is higher than ours. We don't want
// to load in the config of a newer version, as it may break things.
// Deputy should load in the newer version of the script soon enough,
// and the config will be parsed by a version that supports it.
if (liveWikiConfig.core.configVersion > this.core.configVersion.get()) {
// Don't update if the config version is higher than ours. We don't want
// to load in the config of a newer version, as it may break things.
// Deputy should load in the newer version of the script soon enough,
// and the config will be parsed by a version that supports it.
console.warn(`Deputy expects wiki configuration version ${this.core.configVersion.get()}, but found ${liveWikiConfig.core.configVersion}. New configuration will not be loaded.`);
return;
}
else if (liveWikiConfig.core.configVersion < this.core.configVersion.get()) {
// Version change detected.
// Do nothing... for now.
// HINT: Update configuration
console.warn(`Deputy expects wiki configuration version ${this.core.configVersion.get()}, but found ${liveWikiConfig.core.configVersion}. Proceeding anyway...`);
}
const onSuccess = () => {
Line 13,986 ⟶ 13,992:
}
}
WikiConfiguration.configVersion = 12;
WikiConfiguration.optionKey = 'userjs-deputy-wiki';
WikiConfiguration.configLocations = [