resources/src/js/zotero.js
// create a link that points to the current document
create a link that points to the current document
create a link that points to the current document
function createDocumentLink(node) {
	type = 'item';
	if (node['node_type'] == 'item') {
	    var link;
	    if (type == 'doc') {
		var link = document.location.href;
		var idx = link.lastIndexOf('/');
		link = link.substring(0, idx);
		link = link + '/' + node.resource;
	    } else {
		var proto = window.location.protocol;
		var host = window.location.host;
		var path = window.location.pathname;
		link = proto + "//" + host + path + '?id=' + node['item-id'];
	    }
	    return link;
	}
    }
function createDocumentLink ( node ) { type = 'item' ; if ( node [ 'node_type' ] == 'item' ) { var link ; if ( type == 'doc' ) { var link = document . location . href ; var idx = link . lastIndexOf ( '/' ) ; link = link . substring ( 0 , idx ) ; link = link + '/' + node . resource ; } else { var proto = window . location . protocol ; var host = window . location . host ; var path = window . location . pathname ; link = proto + "//" + host + path + '?id=' + node [ 'item-id' ] ; } return link ; } }
create a link that points to the current document
create a link that points to the current document