Timeline Update:

- HTML title now contains the name of the library / saved search / collection whose items are being displayed in the timeline
- Clearer notes for the changes made to bundle.js, timeline-api.js and timelineControls.js
This commit is contained in:
Ben Parr 2007-08-02 21:59:12 +00:00
parent 3491798be2
commit 8e8bd4dc9c
4 changed files with 50 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -81,6 +81,8 @@ Timeline.Platform = new Object();
Modified by Ben for Zotero
*/
// ISO-639 language codes, ISO-3166 country codes (2 characters)
var supportedLocales = [
"cs", // Czech
@ -255,6 +257,8 @@ Timeline.Platform = new Object();
Modified by Ben for Zotero
*/
Timeline.Platform.serverLocale = defaultServerLocale;
Timeline.Platform.clientLocale = defaultClientLocale;
} catch (e) {

View File

@ -61,7 +61,7 @@ function wasChanged(current) {
}
}
function doTheKeyPress(e)
function doKeyPress(e)
{
clearTimeout(jumpToYearTimer);
lastJumpToYearValue = document.getElementById('jumpYear').value;
@ -223,7 +223,7 @@ function setupOtherControls(div, timeline, url) {
}
}
}
var intervals = (theQueryValue['i']) ? theQueryValue['i'] : defaultQueryValue['i'];
if (intervals.length < 3) {
intervals += defaultQueryValue['i'].substr(intervals.length);
@ -256,7 +256,7 @@ function setupOtherControls(div, timeline, url) {
input.type = "text";
input.size = "15";
input.id = "jumpYear";
input.onkeypress=doTheKeyPress;
input.onkeypress=doKeyPress;
td.appendChild(input);
var options = new Array(localeHash["interval.day"], localeHash["interval.month"], localeHash["interval.year"],
@ -326,7 +326,7 @@ function setupOtherControls(div, timeline, url) {
}
/*
Everything below is from http://simile.mit.edu/timeline/examples/examples.js
Everything below is from http://simile.mit.edu/timeline/examples/examples.js unless noted otherwise
*/
function centerTimeline(date) {
@ -354,7 +354,7 @@ function setupFilterHighlightControls(div, timeline, bandIndices, theme) {
var input = document.createElement("input");
input.type = "text";
input.size = "18";
input.size = "18";//Added by Ben for Zotero
Timeline.DOM.registerEvent(input, "keypress", handler);
td.appendChild(input);
@ -365,7 +365,7 @@ function setupFilterHighlightControls(div, timeline, bandIndices, theme) {
input.type = "text";
Timeline.DOM.registerEvent(input, "keypress", handler);
td.appendChild(input);
input.size = "15";
input.size = "15";//Added by Ben for Zotero
var divColor = document.createElement("div");
divColor.style.height = "0.5em";
divColor.style.background = theme.event.highlightColors[i];

View File

@ -325,6 +325,18 @@ function ChromeExtensionHandler() {
var c = (theIntervals[intervals[2]]) ? theIntervals[intervals[2]] : 'Timeline.DateTime.DECADE';
content = content.replace(theTemp, theTemp + a + ',' + b + ',' + c + ',\'' + timelineDate + '\'');
theTemp = 'document.write("<title>';
if(type == 'collection') {
var theCollection = Zotero.Collections.get(id);
content = content.replace(theTemp, theTemp + theCollection.getName() + ' - ');
}
else if(type == 'search') {
var theSearch = Zotero.Searches.get(id);
content = content.replace(theTemp, theTemp + theSearch['name'] + ' - ');
}
else {
content = content.replace(theTemp, theTemp + Zotero.getString('pane.collections.library') + ' - ');
}
theTemp = 'Timeline.loadXML("zotero://timeline/data/';
var d = '';