From 43bc7238761460dc068c671399cd5d2dbd0f3d91 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 23 Oct 2006 23:24:11 +0000 Subject: [PATCH] Addresses #161, interface with CSL repository Client-side updates (Note that translator updates were broken anyway, since the translator table was changed and the update mechanism wasn't, so that's fixed now too, and <=1.0.0b2.r1 won't be served updates via the repository.) --- chrome/content/zotero/xpcom/schema.js | 81 +++++++++++++++++---------- 1 file changed, 52 insertions(+), 29 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 6f9b784d0..e74177cb8 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -401,7 +401,8 @@ Zotero.Schema = new function(){ var currentTime = xmlhttp.responseXML. getElementsByTagName('currentTime')[0].firstChild.nodeValue; - var updates = xmlhttp.responseXML.getElementsByTagName('translator'); + var translatorUpdates = xmlhttp.responseXML.getElementsByTagName('translator'); + var styleUpdates = xmlhttp.responseXML.getElementsByTagName('style'); Zotero.DB.beginTransaction(); @@ -412,29 +413,32 @@ Zotero.Schema = new function(){ var d = new Date(); _updateDBVersion('lastcheck', Math.round(d.getTime()/1000)); // JS uses ms - if (!updates.length){ - Zotero.debug('All scrapers are up-to-date'); + if (!translatorUpdates.length && !styleUpdates.length){ + Zotero.debug('All translators and styles are up-to-date'); Zotero.DB.commitTransaction(); _setRepositoryTimer(ZOTERO_CONFIG['REPOSITORY_CHECK_INTERVAL']); return false; } - for (var i=0, len=updates.length; i