www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit e45aabd03cf216922db91bca2594a1a6ce79f3a1
parent 78d62b5c7c1a315fee2ff210cc0f58b21787a20b
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 16 Jun 2015 20:33:18 -0400

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.)

Diffstat:
Mchrome/content/zotero/xpcom/data/dataObjectUtilities.js | 2++
Mchrome/content/zotero/xpcom/syncedSettings.js | 3+++
2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/dataObjectUtilities.js b/chrome/content/zotero/xpcom/data/dataObjectUtilities.js @@ -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] diff --git a/chrome/content/zotero/xpcom/syncedSettings.js b/chrome/content/zotero/xpcom/syncedSettings.js @@ -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]);