Special handling of objects class for SyncedSettings

(Though maybe it should just be renamed Zotero.Settings, since
non-synced settings aren't used much and are just handled via DB
queries.)
This commit is contained in:
Dan Stillman 2015-06-16 20:33:18 -04:00
parent 78d62b5c7c
commit e45aabd03c
2 changed files with 5 additions and 0 deletions

View file

@ -69,6 +69,8 @@ Zotero.DataObjectUtilities = {
"getObjectsClassForObjectType": function(objectType) {
if (objectType == 'setting') objectType = 'syncedSetting';
var objectTypePlural = this.getObjectTypePlural(objectType);
var className = objectTypePlural[0].toUpperCase() + objectTypePlural.substr(1);
return Zotero[className]

View file

@ -31,6 +31,9 @@ Zotero.SyncedSettings = (function () {
// Public methods
//
var module = {
idColumn: "setting",
table: "syncedSettings",
get: Zotero.Promise.coroutine(function* (libraryID, setting) {
var sql = "SELECT value FROM syncedSettings WHERE setting=? AND libraryID=?";
var json = yield Zotero.DB.valueQueryAsync(sql, [setting, libraryID]);