diff --git a/chrome/content/zotero/addCitationDialog.xul b/chrome/content/zotero/addCitationDialog.xul
index 7b4ea4d0cd..1dfdb628a8 100644
--- a/chrome/content/zotero/addCitationDialog.xul
+++ b/chrome/content/zotero/addCitationDialog.xul
@@ -37,8 +37,8 @@
ondialogcancel="Zotero_Citation_Dialog.cancel();"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- style="padding: 0"
- persist="screenX screenY">
+ style="padding: 0 5px"
+ persist="screenX screenY width height">
diff --git a/chrome/content/zotero/bindings/relatedbox.xml b/chrome/content/zotero/bindings/relatedbox.xml
index 9f0ab20eb2..b2a5d9c103 100644
--- a/chrome/content/zotero/bindings/relatedbox.xml
+++ b/chrome/content/zotero/bindings/relatedbox.xml
@@ -139,10 +139,8 @@
+ style="padding: 0 5px 15px"
+ persist="screenX screenY width height">
diff --git a/chrome/content/zotero/selectItemsDialog.js b/chrome/content/zotero/selectItemsDialog.js
index bff07b766c..d7512cb353 100644
--- a/chrome/content/zotero/selectItemsDialog.js
+++ b/chrome/content/zotero/selectItemsDialog.js
@@ -40,10 +40,10 @@ function doLoad()
collectionsView = new Zotero.CollectionTreeView();
document.getElementById('zotero-collections-tree').view = collectionsView;
- // Center popup manually after a delay on Windows, since window
- // isn't resizable and there might be a persisted position
+ // Center citation popups manually after a delay on Windows, since windows
+ // aren't resizable and there might be persisted positions
if (Zotero.isWin &&
- window.document.activeElement.id != 'zotero-select-items-dialog') {
+ window.document.documentURI != 'chrome://zotero/content/selectItemsDialog.xul') {
setTimeout(function () {
window.centerWindowOnScreen();
}, 1);
diff --git a/chrome/content/zotero/selectItemsDialog.xul b/chrome/content/zotero/selectItemsDialog.xul
index e11b1ac13a..9a258d4f35 100644
--- a/chrome/content/zotero/selectItemsDialog.xul
+++ b/chrome/content/zotero/selectItemsDialog.xul
@@ -36,7 +36,7 @@
onunload="doUnload();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="padding:2em"
- persist="screenX screenY">
+ persist="screenX screenY width height">
diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js
index 2c4ca7a765..7bcc506825 100644
--- a/chrome/content/zotero/xpcom/integration.js
+++ b/chrome/content/zotero/xpcom/integration.js
@@ -743,6 +743,28 @@ Zotero.Integration.Session.prototype.unserializeCitation = function(arg, index)
// get JSON
var object = Zotero.JSON.unserialize(arg);
+ // Fix uppercase citation codes
+ if(object.CITATIONITEMS) {
+ object.citationItems = [];
+ for (var i=0; i/g, "")), "recipient"));
+ var from = text.match(/\nFrom:\s+([^\n]+)\n/)[1];
+ item.creators.push(Zotero.Utilities.cleanAuthor(Zotero.Utilities.trimInternal(from.replace(/<.*>/g, "")), "author"));
+ item.date = text.match(/\nDate:\s+(.*,\s+\d+\s+\w+\s+\d{4})/)[1];
+ item.subject = text.match(/\nSubject:\s+([^\n]+)/)[1];
+ if (item.subject == "") item.subject = "";
+ item.title = item.subject;
+ item.complete();
+ });
+ Zotero.wait();
+}');
+
+REPLACE INTO translators VALUES ('490909d7-7d79-4c7a-a136-77df618d4db2', '1.0.0b4.r5', '', '2008-06-13 20:10:00', '0', '100', '4', 'Worldcat.org', 'Michael Berkowitz', 'http://(www.)?worldcat.org/',
+'function detectWeb(doc, url) {
+ if (url.match(/search?/)) {
+ return "multiple";
+ } else if (url.match(/oclc/)) {
+ var type = doc.evaluate(''//tbody/tr/td[2][img]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent.toLowerCase().match(/(\w+);/)[1];
+ switch (type) {
+ case "book": return "book";
+ case "article": return "journalArticle";
+ case "recording":
+ case "disc": return "audioRecording";
+ case "tape": return "videoRecording";
+ }
+ }
+}',
+'function ENify(str) {
+ return str.match(/^[^&]+/)[0] + ''?page=endnote&client=worldcat.org-detailed_record'';
+}
+function doWeb(doc, url) {
+ var n = doc.documentElement.namespaceURI;
+ var ns = n ? function(prefix) {
+ if (prefix == ''x'') return n; else return null;
+ } : null;
+
+ var books = new Array();
+ if (detectWeb(doc, url) == "multiple") {
+ var items = new Object();
+ var titles = doc.evaluate(''//div[@class="name"]/a'', doc, ns, XPathResult.ANY_TYPE, null);
+ var title;
+ while (title = titles.iterateNext()) {
+ items[title.href] = Zotero.Utilities.trimInternal(title.textContent);
+ }
+ items = Zotero.selectItems(items);
+ for (var i in items) {
+ books.push(ENify(i));
+ }
+ } else {
+ books = [ENify(url)]
+ }
+ for each (var book in books) {
+ Zotero.Utilities.HTTP.doGet(book, function(text) {
+ text = text.replace("MUSIC", "PAMP");
+ var translator = Zotero.loadTranslator("import");
+ translator.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7");
+ translator.setString(text);
+ translator.translate();
+ });
+ Zotero.wait();
+ }
+}');
+
+REPLACE INTO translators VALUES ('2943d7fc-3ce8-401c-afd5-ee1f70b7aae0', '1.0.0b4.r5', '', '2008-06-12 19:00:00', '0', '100', '4', 'Helsinki University of Technology', 'Michael Berkowitz', 'https?://teemu.linneanet.fi/',
+'function detectWeb(doc, url) {
+ if (url.match(/v\d+=\d+/)) {
+ return "book";
+ } else if (url.match(/Search_Arg/)) {
+ return "multiple";
+ }
+}',
+'function MARCify(str) {
+ return str.replace(/v\d+=([^&]+)/, "v3=$1");
+}
+
+function doWeb(doc, url) {
+ var n = doc.documentElement.namespaceURI;
+ var ns = n ? function(prefix) {
+ if (prefix == ''x'') return n; else return null;
+ } : null;
+
+ var books = new Array();
+ if (detectWeb(doc, url) == "multiple") {
+ var titles = doc.evaluate(''/html/body/form/table/tbody/tr/td[3]/a'', doc, ns, XPathResult.ANY_TYPE, null);
+ var title;
+ var items = new Object();
+ while (title = titles.iterateNext()) {
+ items[title.href] = Zotero.Utilities.trimInternal(title.textContent);
+ }
+ items = Zotero.selectItems(items);
+ for (var i in items) {
+ books.push(MARCify(i));
+ }
+ } else {
+ books = [MARCify(url)];
+ }
+ var translator = Zotero.loadTranslator("import");
+ translator.setTranslator("a6ee60df-1ddc-4aae-bb25-45e0537be973");
+ var marc = translator.getTranslatorObject();
+ Zotero.Utilities.processDocuments(books, function(doc) {
+ var elmts = doc.evaluate(''/html/body/form/table/tbody/tr[th]'', doc, ns, XPathResult.ANY_TYPE, null);
+ var record = new marc.record();
+ var elmt;
+ while (elmt = elmts.iterateNext()) {
+ var field = Zotero.Utilities.superCleanString(doc.evaluate(''./th'', elmt, ns, XPathResult.ANY_TYPE, null).iterateNext().textContent);
+ if (field) {
+ var value = doc.evaluate(''./td[1]'', elmt, ns, XPathResult.ANY_TYPE, null).iterateNext().textContent;
+ if (value.split(/\n/)[1]) value = Zotero.Utilities.trimInternal(value.split(/\n/)[1]);
+ if(field == "LDR") {
+ record.leader = value;
+ } else if(field != "FMT") {
+ value = value.replace(/\|([a-z]) /g, marc.subfieldDelimiter+"$1");
+ var code = field.substring(0, 3);
+ var ind = "";
+ if(field.length > 3) {
+ ind = field[3];
+ if(field.length > 4) {
+ ind += field[4];
+ }
+ }
+
+ record.addField(code, ind, value);
+ }
+ }
+ }
+ var item = new Zotero.Item("book");
+ record.translate(item);
+ item.complete();
+ }, function() {Zotero.done;});
+ Zotero.wait();
+}');
+
+REPLACE INTO translators VALUES ('b662c6eb-e478-46bd- bad4-23cdfd0c9d67', '1.0.0b4.r5', '', '2008-06-12 19:30:00', '0', '100', '4', 'JurPC', 'Oliver Vivell and Michael Berkowitz', 'http://www.jurpc.de/',
'function detectWeb(doc, url) {
var doctype = doc.evaluate(''//meta/@doctype'', doc, null,XPathResult.ANY_TYPE, null).iterateNext().textContent;
@@ -2102,7 +2260,7 @@ function parseDoc(xpath, doc) {
return content;
}');
-REPLACE INTO translators VALUES ('cae7d3ec-bc8d-465b-974f-8b0dcfe24290', '1.0.0b4.r5', '', '2008-06-10 22:30:00', '0', '100', '4', 'BIUM', 'Michael Berkowitz', 'http://hip.bium.univ-paris5.fr/',
+REPLACE INTO translators VALUES ('cae7d3ec-bc8d-465b-974f-8b0dcfe24290', '1.0.0b4.r5', '', '2008-06-12 19:30:00', '0', '100', '4', 'BIUM', 'Michael Berkowitz', 'http://hip.bium.univ-paris5.fr/',
'function detectWeb(doc, url) {
if (doc.evaluate(''//td/a[@class="itemTitle"]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
return "multiple";
@@ -12293,7 +12451,7 @@ function doWeb(doc, url) {
Zotero.wait();
}');
-REPLACE INTO translators VALUES ('add7c71c-21f3-ee14-d188-caf9da12728b', '1.0.0b3.r1', '', '2008-05-27 20:00:00', '1', '100', '4', 'Library Catalog (SIRSI)', 'Sean Takats', '/uhtbin/cgisirsi',
+REPLACE INTO translators VALUES ('add7c71c-21f3-ee14-d188-caf9da12728b', '1.0.0b3.r1', '', '2008-06-12 19:30:00', '1', '100', '4', 'Library Catalog (SIRSI)', 'Sean Takats', '/uhtbin/cgisirsi',
'function detectWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
@@ -14142,7 +14300,7 @@ REPLACE INTO translators VALUES ('c54d1932-73ce-dfd4-a943-109380e06574', '1.0.0b
}
}');
-REPLACE INTO translators VALUES ('fcf41bed-0cbc-3704-85c7-8062a0068a7a', '1.0.0b3.r1', '', '2008-06-11 05:00:00', '1', '100', '4', 'NCBI PubMed', 'Simon Kornblith and Michael Berkowitz', 'http://[^/]*www\.ncbi\.nlm\.nih\.gov[^/]*/(pubmed|sites/entrez|entrez/query\.fcgi\?.*db=PubMed)',
+REPLACE INTO translators VALUES ('fcf41bed-0cbc-3704-85c7-8062a0068a7a', '1.0.0b3.r1', '', '2008-06-12 19:00:00', '1', '100', '4', 'NCBI PubMed', 'Simon Kornblith and Michael Berkowitz', 'http://[^/]*www\.ncbi\.nlm\.nih\.gov[^/]*/(pubmed|sites/entrez|entrez/query\.fcgi\?.*db=PubMed)',
'function detectWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
@@ -14195,7 +14353,6 @@ function detectSearch(item) {
var citation = xml.PubmedArticle[i].MedlineCitation;
var PMID = citation.PMID.text().toString();
-// newItem.accessionNumber = "PMID "+PMID;
newItem.extra = "PMID: "+PMID;
// add attachments
if(doc) {
@@ -14225,7 +14382,7 @@ function detectSearch(item) {
newItem.ISSN = issn;
}
- newItem.journalAbbreviation = Zotero.Utilities.superCleanString(citation.MedlineJournalInfo.MedlineTA.text().toString());
+ newItem.journalAbbreviation = Zotero.Utilities.superCleanString(citation.Article.Journal.ISOAbbreviation.text().toString());
if(article.Journal.Title.length()) {
newItem.publicationTitle = Zotero.Utilities.superCleanString(article.Journal.Title.text().toString());
} else if(citation.MedlineJournalInfo.MedlineTA.length()) {
@@ -14271,7 +14428,6 @@ function detectSearch(item) {
newItem.abstractNote = article.Abstract.AbstractText.toString()
newItem.DOI = xml.PubmedArticle[i].PubmedData.ArticleIdList.ArticleId[0].text().toString();
- newItem.journalAbbreviation = newItem.journalAbbreviation.replace(/(\w\b)/g, "$1.");
newItem.publicationTitle = Zotero.Utilities.capitalizeTitle(newItem.publicationTitle);
newItem.complete();
}
@@ -14861,7 +15017,7 @@ REPLACE INTO translators VALUES ('a326fc49-60c2-405b-8f44-607e5d18b9ad', '1.0.0b
Zotero.wait();
}');
-REPLACE INTO translators VALUES ('c3edb423-f267-47a1-a8c2-158c247f87c2', '1.0.0b4.r5', '', '2008-05-06 08:15:00', '0', '100', '4', 'Common-Place', 'Frederick Gibbs', 'http://www.common-place\.|historycooperative\.org/journals/cp',
+REPLACE INTO translators VALUES ('c3edb423-f267-47a1-a8c2-158c247f87c2', '1.0.0b4.r5', '', '2008-06-12 19:30:00', '0', '100', '4', 'Common-Place', 'Frederick Gibbs', 'http://www.common-place\.|historycooperative\.org/journals/cp',
'function detectWeb(doc, url) {
if(doc.title.indexOf("Previous Issues") != -1 || doc.title.indexOf("Search Site") != -1 ) {
return "multiple";
@@ -16073,7 +16229,7 @@ function doWeb(doc, url) {
Zotero.wait();
}');
-REPLACE INTO translators VALUES ('d0b1914a-11f1-4dd7-8557-b32fe8a3dd47', '1.0.0b3.r1', '', '2008-05-22 20:30:00', '1', '100', '4', 'EBSCOhost', 'Simon Kornblith', 'https?://[^/]+/(?:bsi|ehost)/(?:results|detail|folder)',
+REPLACE INTO translators VALUES ('d0b1914a-11f1-4dd7-8557-b32fe8a3dd47', '1.0.0b3.r1', '', '2008-06-12 19:30:00', '1', '100', '4', 'EBSCOhost', 'Simon Kornblith', 'https?://[^/]+/(?:bsi|ehost)/(?:results|detail|folder)',
'function detectWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
@@ -17268,12 +17424,12 @@ REPLACE INTO translators VALUES ('fe728bc9-595a-4f03-98fc-766f1d8d0936', '1.0.0b
Zotero.wait();
}');
-REPLACE INTO translators VALUES ('b6d0a7a-d076-48ae-b2f0-b6de28b194e', '1.0.0b3.r1', '', '2008-05-27 17:30:00', '1', '100', '4', 'ScienceDirect', 'Michael Berkowitz', 'https?://www\.sciencedirect\.com[^/]*/science(\/article)?\?(?:.+\&|)_ob=(?:ArticleURL|ArticleListURL|PublicationURL)',
+REPLACE INTO translators VALUES ('b6d0a7a-d076-48ae-b2f0-b6de28b194e', '1.0.0b3.r1', '', '2008-06-15 17:10:00', '1', '100', '4', 'ScienceDirect', 'Michael Berkowitz', 'https?://www\.sciencedirect\.com[^/]*/science(\/article)?(\?(?:.+\&|)ob=(?:ArticleURL|ArticleListURL|PublicationURL))?',
'function detectWeb(doc, url) {
if ((url.indexOf("_ob=DownloadURL") != -1) || doc.title == "ScienceDirect Login") {
return false;
}
- if(url.indexOf("_ob=ArticleURL") == -1 || url.indexOf("/journal/") != -1) {
+ if((url.indexOf("_ob=ArticleURL") == -1 && url.indexOf("/article/") == -1) || url.indexOf("/journal/") != -1) {
return "multiple";
} else {
return "journalArticle";
@@ -19441,7 +19597,7 @@ function doWeb(doc, url) {
Zotero.wait();
}');
-REPLACE INTO translators VALUES ('72cb2536-3211-41e0-ae8b-974c0385e085', '1.0.0b4.r1', '', '2007-06-21 07:00:00', '0', '100', '4', 'ARTFL Encyclopedie', 'Sean Takats', '/cgi-bin/philologic31/(getobject\.pl\?c\.[0-9]+:[0-9]+\.encyclopedie|search3t\?dbname=encyclopedie0507)',
+REPLACE INTO translators VALUES ('72cb2536-3211-41e0-ae8b-974c0385e085', '1.0.0b4.r1', '', '2008-06-12 19:30:00', '0', '100', '4', 'ARTFL Encyclopedie', 'Sean Takats', '/cgi-bin/philologic31/(getobject\.pl\?c\.[0-9]+:[0-9]+\.encyclopedie|search3t\?dbname=encyclopedie0507)',
'function detectWeb(doc, url) {
if (url.indexOf("getobject.pl") != -1){
return "encyclopediaArticle";