js-options: adding getOptionKeys methods

This commit is contained in:
Eric van der Vlist 2021-04-29 12:33:53 +02:00
parent 03794da2ba
commit 7df5b13687
1 changed files with 21 additions and 4 deletions

View File

@ -32,11 +32,14 @@ Options.prototype.setOption = function (key, value) {
this.optionsStorage.setOption(key, value); this.optionsStorage.setOption(key, value);
} }
Options.prototype.getOptions = function () { Options.prototype.getOptionsKeys = function () {
var results = {
};
this.optionsStorage.setOptionsDoctypePrefix(Options.SYSTEM); this.optionsStorage.setOptionsDoctypePrefix(Options.SYSTEM);
var options = JSON.parse(this.optionsStorage.getOption(this.namespace, '{}')); return JSON.parse(this.optionsStorage.getOption(this.namespace, '{}'));
}
Options.prototype.getOptions = function () {
var results = {};
var options = this.getOptionsKeys();
for (var key in options) { for (var key in options) {
results[key] = this.getOption(key, ''); results[key] = this.getOption(key, '');
} }
@ -95,3 +98,17 @@ Options.prototype.getSystemIdOptions = function () {
} }
return this.systemIdOptions.getOptions(); return this.systemIdOptions.getOptions();
} }
Options.prototype.getSystemOptionKeys = function () {
if (this.systemIdOptions === undefined) {
this.setSystemId();
}
return this.systemIdOptions.getSystemOptionKeys();
}
Options.prototype.getSystemOptions = function () {
if (this.systemIdOptions === undefined) {
this.setSystemId();
}
return this.systemIdOptions.getSystemOptions();
}