From 7feb7995d76f5cfab63df39a9b4e90d09371fe54 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 15 Aug 2007 08:06:33 +0000 Subject: [PATCH] Fixes #694, Problems with zotero://select - Custom protocol handler extensions like zotero://select can now not return a channel and the request will be automatically cancelled without throwing an error - Switched Timeline code to use the stringbundle methods to access timeline.properties - Even though zotero://select now works properly, switched Timeline to access ZoteroPane directly and call selectItem() (calling toggleDisplay() first to open the Zotero pane if necessary) - Now getting some localized strings from Zotero ("Date Added" and the short month names) --- .../locale/en-US/zotero/timeline.properties | 16 +--- chrome/skin/default/zotero/timeline/bundle.js | 8 +- .../default/zotero/timeline/timeline.html | 11 ++- .../zotero/timeline/timelineControls.js | 91 +++++++++++-------- components/zotero-protocol-handler.js | 19 ++-- 5 files changed, 81 insertions(+), 64 deletions(-) diff --git a/chrome/locale/en-US/zotero/timeline.properties b/chrome/locale/en-US/zotero/timeline.properties index 2e41c88e7..7f27cd8db 100644 --- a/chrome/locale/en-US/zotero/timeline.properties +++ b/chrome/locale/en-US/zotero/timeline.properties @@ -18,18 +18,4 @@ interval.century = Century interval.millennium = Millennium dateType.published = Date Published -dateType.added = Date Added -dateType.modified = Date Modified - -shortName.january = Jan -shortName.february = Feb -shortName.march = Mar -shortName.april = Apr -shortName.may = May -shortName.june = Jun -shortName.july = Jul -shortName.august = Aug -shortName.september = Sep -shortName.october = Oct -shortName.november = Nov -shortName.december = Dec \ No newline at end of file +dateType.modified = Date Modified \ No newline at end of file diff --git a/chrome/skin/default/zotero/timeline/bundle.js b/chrome/skin/default/zotero/timeline/bundle.js index b665bed8c..48a6da1ad 100644 --- a/chrome/skin/default/zotero/timeline/bundle.js +++ b/chrome/skin/default/zotero/timeline/bundle.js @@ -232,9 +232,11 @@ Timeline.GregorianDateLabeller=function(locale,timeZone){this._locale=locale;thi /* Modified by Ben for Zotero */ -Timeline.GregorianDateLabeller.monthNames = [localeHash["shortName.january"], localeHash["shortName.february"], localeHash["shortName.march"], localeHash["shortName.april"], localeHash["shortName.may"], - localeHash["shortName.june"], localeHash["shortName.july"], localeHash["shortName.august"], localeHash["shortName.september"], localeHash["shortName.october"], localeHash["shortName.november"], localeHash["shortName.december"]]; -Timeline.GregorianDateLabeller.getMonthName=function(month,locale){return Timeline.GregorianDateLabeller.monthNames[month];}; + +Timeline.GregorianDateLabeller.monthNames = Zotero.CSL.Global.getMonthStrings("short"); +Timeline.GregorianDateLabeller.getMonthName=function(month,locale) { + return Timeline.GregorianDateLabeller.monthNames[month]; +}; diff --git a/chrome/skin/default/zotero/timeline/timeline.html b/chrome/skin/default/zotero/timeline/timeline.html index 2fc0458bf..7fe58c9f3 100644 --- a/chrome/skin/default/zotero/timeline/timeline.html +++ b/chrome/skin/default/zotero/timeline/timeline.html @@ -15,6 +15,7 @@ } +