Fix Date Published in Timeline
This commit is contained in:
parent
30ff1bd2ae
commit
f94242f7ad
2 changed files with 12 additions and 15 deletions
|
@ -30,17 +30,19 @@ Zotero.Timeline = new function () {
|
|||
|
||||
function generateXMLDetails(items, dateType) {
|
||||
var escapeXML = Zotero.Utilities.htmlSpecialChars;
|
||||
|
||||
|
||||
var content = '<data>\n';
|
||||
for each(var arr in items) {
|
||||
if (arr[dateType]) {
|
||||
var item = Zotero.Items.get(arr.itemID);
|
||||
var theDate =(dateType == 'date') ? Zotero.Date.multipartToSQL(arr[dateType]):arr[dateType];
|
||||
content += '<event start="' + Zotero.Date.sqlToDate(theDate) + '" ';
|
||||
content += 'title=" ' + (arr.title ? escapeXML(arr.title) : '') + '" ';
|
||||
for each(var item in items) {
|
||||
var date = item.getField(dateType, true);
|
||||
if (date) {
|
||||
var sqlDate = (dateType == 'date') ? Zotero.Date.multipartToSQL(date) : date;
|
||||
sqlDate = sqlDate.replace("00-00", "01-01");
|
||||
content += '<event start="' + Zotero.Date.sqlToDate(sqlDate) + '" ';
|
||||
var title = item.getField('title');
|
||||
content += 'title=" ' + (title ? escapeXML(title) : '') + '" ';
|
||||
content += 'icon="' + item.getImageSrc() + '" ';
|
||||
content += 'color="black">';
|
||||
content += arr.itemID;
|
||||
content += item.id;
|
||||
content += '</event>\n';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -701,11 +701,6 @@ function ChromeExtensionHandler() {
|
|||
break generateContent;
|
||||
}
|
||||
|
||||
// Convert item objects to export arrays
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
items[i] = items[i].toArray();
|
||||
}
|
||||
|
||||
mimeType = 'application/xml';
|
||||
|
||||
var theDateTypes = new Object();
|
||||
|
@ -1060,8 +1055,8 @@ ChromeExtensionHandler.prototype = {
|
|||
// extensions that modify data are added
|
||||
// - https://www.zotero.org/trac/ticket/1156
|
||||
//
|
||||
//Components.interfaces.nsIProtocolHandler.URI_IS_LOCAL_FILE,
|
||||
Components.interfaces.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE,
|
||||
Components.interfaces.nsIProtocolHandler.URI_IS_LOCAL_FILE,
|
||||
//Components.interfaces.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE,
|
||||
|
||||
allowPort : function(port, scheme) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue