www

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

timelineInterface.js (1651B)


      1 /*
      2     ***** BEGIN LICENSE BLOCK *****
      3     
      4     Copyright © 2009 Center for History and New Media
      5                      George Mason University, Fairfax, Virginia, USA
      6                      http://zotero.org
      7     
      8     This file is part of Zotero.
      9     
     10     Zotero is free software: you can redistribute it and/or modify
     11     it under the terms of the GNU Affero General Public License as published by
     12     the Free Software Foundation, either version 3 of the License, or
     13     (at your option) any later version.
     14     
     15     Zotero is distributed in the hope that it will be useful,
     16     but WITHOUT ANY WARRANTY; without even the implied warranty of
     17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18     GNU Affero General Public License for more details.
     19     
     20     You should have received a copy of the GNU Affero General Public License
     21     along with Zotero.  If not, see <http://www.gnu.org/licenses/>.
     22     
     23     ***** END LICENSE BLOCK *****
     24 */
     25 
     26 
     27 var Zotero_Timeline_Interface = new function() {
     28 	/*
     29 	 * Load a timeline for the currently selected collection
     30 	 */
     31 	this.loadTimeline = function () {
     32 		var uri = 'zotero://timeline/';
     33 		
     34 		var col = ZoteroPane_Local.getSelectedCollection();
     35 		if (col) {
     36 			uri += Zotero.API.getLibraryPrefix(col.libraryID) + '/collections/' + col.key;
     37 		}
     38 		else {
     39 			var s = ZoteroPane_Local.getSelectedSavedSearch();
     40 			if (s) {
     41 				uri += Zotero.API.getLibraryPrefix(s.libraryID) + '/searches/' + s.key;
     42 			}
     43 			else {
     44 				let libraryID = ZoteroPane_Local.getSelectedLibraryID();
     45 				if (libraryID) {
     46 					uri += Zotero.API.getLibraryPrefix(libraryID);
     47 				}
     48 			}
     49 		}
     50 		ZoteroPane_Local.loadURI(uri);
     51 	}
     52 }