zotero/chrome/content/zotero/timelineInterface.js

53 lines
1.6 KiB
JavaScript
Raw Normal View History

2007-10-23 07:11:59 +00:00
/*
***** BEGIN LICENSE BLOCK *****
2009-12-28 09:47:49 +00:00
Copyright © 2009 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://zotero.org
2007-10-23 07:11:59 +00:00
2009-12-28 09:47:49 +00:00
This file is part of Zotero.
2007-10-23 07:11:59 +00:00
2009-12-28 09:47:49 +00:00
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
2009-12-28 09:47:49 +00:00
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
2007-10-23 07:11:59 +00:00
2009-12-28 09:47:49 +00:00
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
2009-12-28 09:47:49 +00:00
You should have received a copy of the GNU Affero General Public License
2009-12-28 09:47:49 +00:00
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
2007-10-23 07:11:59 +00:00
***** END LICENSE BLOCK *****
*/
var Zotero_Timeline_Interface = new function() {
/*
* Load a timeline for the currently selected collection
*/
this.loadTimeline = function () {
2007-10-23 07:11:59 +00:00
var uri = 'zotero://timeline/';
var col = ZoteroPane_Local.getSelectedCollection();
if (col) {
uri += Zotero.API.getLibraryPrefix(col.libraryID) + '/collections/' + col.key;
2007-10-23 07:11:59 +00:00
}
else {
var s = ZoteroPane_Local.getSelectedSavedSearch();
if (s) {
uri += Zotero.API.getLibraryPrefix(s.libraryID) + '/searches/' + s.key;
}
else {
let libraryID = ZoteroPane_Local.getSelectedLibraryID();
if (libraryID) {
uri += Zotero.API.getLibraryPrefix(libraryID);
}
}
2011-03-05 05:14:06 +00:00
}
Zotero.openInViewer(uri);
2007-10-23 07:11:59 +00:00
}
}