Merge branch '3.0'

Conflicts:
	chrome/content/zotero/xpcom/cite.js
This commit is contained in:
Simon Kornblith 2012-11-08 09:40:18 -05:00
commit 73f775950d
51 changed files with 120 additions and 128 deletions

View file

@ -176,13 +176,13 @@ var Zotero_File_Interface_Bibliography = new function() {
//
// Change label to "Citation" or "Note" depending on style class
if(document.getElementById("citation")) {
if(document.getElementById("citations")) {
if(Zotero.Styles.get(selectedStyle).class == "note") {
var label = Zotero.getString('citation.note');
var label = Zotero.getString('citation.notes');
} else {
var label = Zotero.getString('citation.citation');
var label = Zotero.getString('citation.citations');
}
document.getElementById("citation").label = label;
document.getElementById("citations").label = label;
}
}

View file

@ -19,7 +19,7 @@
<groupbox>
<caption label="&zotero.bibliography.outputMode;"/>
<radiogroup id="output-mode-radio">
<radio id="citation"/>
<radio id="citations"/>
<radio id="bibliography" label="&zotero.bibliography.bibliography;"/>
</radiogroup>
</groupbox>

View file

@ -432,7 +432,7 @@ var Zotero_File_Interface = new function() {
*
* Does not check that items are actual references (and not notes or attachments)
*/
function copyItemsToClipboard(items, style, asHTML) {
function copyItemsToClipboard(items, style, asHTML, asCitations) {
// copy to clipboard
var transferable = Components.classes["@mozilla.org/widget/transferable;1"].
createInstance(Components.interfaces.nsITransferable);
@ -441,7 +441,7 @@ var Zotero_File_Interface = new function() {
var style = Zotero.Styles.get(style);
// add HTML
var bibliography = Zotero.Cite.makeFormattedBibliographyOrCitationList(style, items, "html");
var bibliography = Zotero.Cite.makeFormattedBibliographyOrCitationList(style, items, "html", asCitations);
var str = Components.classes["@mozilla.org/supports-string;1"].
createInstance(Components.interfaces.nsISupportsString);
str.data = bibliography;
@ -450,7 +450,7 @@ var Zotero_File_Interface = new function() {
// add text (or HTML source)
if(!asHTML) {
var bibliography = Zotero.Cite.makeFormattedBibliographyOrCitationList(style, items, "text");
var bibliography = Zotero.Cite.makeFormattedBibliographyOrCitationList(style, items, "text", asCitations);
}
var str = Components.classes["@mozilla.org/supports-string;1"].
createInstance(Components.interfaces.nsISupportsString);
@ -532,25 +532,12 @@ var Zotero_File_Interface = new function() {
// generate bibliography
try {
if(io.method == 'copy-to-clipboard') {
if (io.mode == 'citation') {
copyCitationToClipboard(items, io.style);
}
else {
copyItemsToClipboard(items, io.style);
}
return;
copyItemsToClipboard(items, io.style, false, io.mode === "citation");
}
else {
if (io.mode == 'citation') {
var csl = Zotero.Styles.get(format).csl;
csl.updateItems([item.id for each(item in items)]);
var citation = {citationItems:[{id:item.id} for each(item in items)], properties:{}};
var bibliography = csl.previewCitationCluster(citation, [], [], "html");
}
else {
var style = Zotero.Styles.get(io.style);
var bibliography = Zotero.Cite.makeFormattedBibliographyOrCitationList(style, items, format);
}
var style = Zotero.Styles.get(io.style);
var bibliography = Zotero.Cite.makeFormattedBibliographyOrCitationList(style,
items, format, io.mode === "citation");
}
} catch(e) {
window.alert(Zotero.getString("fileInterface.bibliographyGenerationError"));

View file

@ -69,13 +69,15 @@ Zotero.Cite = {
* @param {String} format The format of the output (html, text, or rtf)
* @return {String} Bibliography or item list in specified format
*/
"makeFormattedBibliographyOrCitationList":function(style, items, format) {
"makeFormattedBibliographyOrCitationList":function(style, items, format, asCitationList) {
var cslEngine = style.csl;
cslEngine.setOutputFormat(format);
cslEngine.updateItems([item.id for each(item in items)]);
var bibliography = Zotero.Cite.makeFormattedBibliography(cslEngine, format);
if(bibliography) return bibliography;
if(!asCitationList) {
var bibliography = Zotero.Cite.makeFormattedBibliography(cslEngine, format);
if(bibliography) return bibliography;
}
var styleClass = style.class;
var citations = [cslEngine.appendCitationCluster({"citationItems":[{"id":item.id}], "properties":{}}, true)[0][1]
@ -478,4 +480,4 @@ Zotero.Cite.System = {
"getAbbreviations":function getAbbreviations() {
return {};
}
};
};

View file

@ -626,7 +626,8 @@ Zotero.HTTP = new function() {
// (Approximately) how many seconds to wait if the document is left in the loading state and
// pageshow is called before we call pageshow with an incomplete document
const LOADING_STATE_TIMEOUT = 120;
var firedLoadEvent = 0;
var firedLoadEvent = 0,
loaded = false;
/**
* Loads the next page
@ -637,6 +638,7 @@ Zotero.HTTP = new function() {
var url = urls[currentURL],
hiddenBrowser = hiddenBrowsers[currentURL];
firedLoadEvent = 0;
loaded = false;
currentURL++;
try {
Zotero.debug("Zotero.HTTP.processDocuments: Loading "+url);
@ -646,10 +648,9 @@ Zotero.HTTP = new function() {
exception(e);
return;
} else {
if(!dontDelete) Zotero.Browser.deleteHiddenBrowser(hiddenBrowsers);
throw(e);
}
} finally {
doLoad();
}
} else {
if(!dontDelete) Zotero.Browser.deleteHiddenBrowser(hiddenBrowsers);
@ -662,19 +663,21 @@ Zotero.HTTP = new function() {
* @inner
*/
var onLoad = function(e) {
if(loaded) return;
var hiddenBrowser = e.currentTarget,
doc = hiddenBrowser.contentDocument;
if(!doc || doc !== e.target) return;
var url = doc.location.href.toString();
if(!doc) return;
var url = doc.documentURI;
if(url === "about:blank") return;
if(doc.readyState === "loading" && (firedLoadEvent++) < 120) {
// Try again in a second
Zotero.setTimeout(onLoad.bind(this, e), 1000);
Zotero.setTimeout(onLoad.bind(this, {"currentTarget":hiddenBrowser}), 1000);
return;
}
Zotero.debug("Zotero.HTTP.processDocuments: "+url+" loaded");
hiddenBrowser.removeEventListener("pageshow", onLoad, true);
loaded = true;
try {
processor(doc);

View file

@ -2418,6 +2418,8 @@ Zotero.DragDrop = {
* Functions for creating and destroying hidden browser objects
**/
Zotero.Browser = new function() {
var nBrowsers = 0;
this.createHiddenBrowser = createHiddenBrowser;
this.deleteHiddenBrowser = deleteHiddenBrowser;
@ -2445,21 +2447,19 @@ Zotero.Browser = new function() {
hiddenBrowser.docShell.allowJavascript = true;
hiddenBrowser.docShell.allowMetaRedirects = false;
hiddenBrowser.docShell.allowPlugins = false;
Zotero.debug("Created hidden browser ("
+ (win.document.getElementsByTagName('browser').length - 1) + ")");
Zotero.debug("Created hidden browser (" + (nBrowsers++) + ")");
return hiddenBrowser;
}
function deleteHiddenBrowser(myBrowsers) {
if(!myBrowsers instanceof Array) myBrowsers = [myBrowsers];
if(!(myBrowsers instanceof Array)) myBrowsers = [myBrowsers];
for(var i=0; i<myBrowsers.length; i++) {
var myBrowser = myBrowsers[i];
myBrowser.stop();
myBrowser.destroy();
myBrowser.parentNode.removeChild(myBrowser);
myBrowser = null;
Zotero.debug("Deleted hidden browser ("
+ (win.document.getElementsByTagName('browser').length - 1) + ")");
Zotero.debug("Deleted hidden browser (" + (--nBrowsers) + ")");
}
}
}

View file

@ -567,8 +567,8 @@ citation.multipleSources=Multiple Sources...
citation.singleSource=Single Source...
citation.showEditor=Show Editor...
citation.hideEditor=Hide Editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero Report
report.parentItem=Parent Item:

View file

@ -567,8 +567,8 @@ citation.multipleSources=مصادر متعددة...
citation.singleSource=مصدر واحد...
citation.showEditor=عرض المحرر...
citation.hideEditor=إخفاء المحرر...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=تقرير زوتيرو
report.parentItem=عنصر رئيسي:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Много източници...
citation.singleSource=Един източник...
citation.showEditor=Показва редактора...
citation.hideEditor=Скрива редактора...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Зотеро отчет
report.parentItem=Родителски запис:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Múltiples fonts...
citation.singleSource=Única font...
citation.showEditor=Mostra editor...
citation.hideEditor=Oculta editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Informe de Zotero
report.parentItem=Element pare:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Více zdrojů...
citation.singleSource=Jednotlivý zdroj...
citation.showEditor=Zobrazit editor...
citation.hideEditor=Skrýt editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero report
report.parentItem=Rodičovská položka:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Flere kilder...
citation.singleSource=En enkelt kilde...
citation.showEditor=Vis Editor...
citation.hideEditor=Skjul Editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero-rapport
report.parentItem=Overordnet Element

View file

@ -567,8 +567,8 @@ citation.multipleSources=Mehrere Quellen...
citation.singleSource=Einzelne Quelle...
citation.showEditor=Editor anzeigen...
citation.hideEditor=Editor verbergen...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero-Bericht
report.parentItem=Übergeordneter Eintrag:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Multiple Sources...
citation.singleSource=Single Source...
citation.showEditor=Show Editor...
citation.hideEditor=Hide Editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero Report
report.parentItem=Parent Item:

View file

@ -569,8 +569,8 @@ citation.multipleSources = Multiple Sources…
citation.singleSource = Single Source…
citation.showEditor = Show Editor…
citation.hideEditor = Hide Editor…
citation.citation = Citation
citation.note = Note
citation.citations = Citations
citation.notes = Notes
report.title.default = Zotero Report
report.parentItem = Parent Item:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Fuentes múltiples...
citation.singleSource=Fuente única...
citation.showEditor=Mostrar editor...
citation.hideEditor=Ocultar editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Informe de Zotero
report.parentItem=Ítem contenedor:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Mitmed allikad...
citation.singleSource=Üks allikas...
citation.showEditor=Toimetaja näidata...
citation.hideEditor=Toimetaja peita...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero raport
report.parentItem=Ülemkirje:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Iturri ugariak...
citation.singleSource=Iturri bakarra...
citation.showEditor=Erakutsi Editorea...
citation.hideEditor=Ezkutatu Editorea...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero Txostena
report.parentItem=Item Gurasoa:

View file

@ -567,8 +567,8 @@ citation.multipleSources=چند مرجع ...
citation.singleSource=یک مرجع ...
citation.showEditor=نمایش ویرایشگر...
citation.hideEditor=نهفتن ویرایشگر ...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=گزارش زوترو
report.parentItem=آیتم‌ مادر:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Multiple Sources...
citation.singleSource=Single Source...
citation.showEditor=Show Editor...
citation.hideEditor=Hide Editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero-raportti
report.parentItem=Ylänimike:

View file

@ -29,7 +29,7 @@
<!ENTITY quitApplicationCmd.accesskey "Q">
<!ENTITY editMenu.label "Edit">
<!ENTITY editMenu.label "Édition">
<!ENTITY editMenu.accesskey "n">
<!ENTITY undoCmd.label "Annuler">
<!ENTITY undoCmd.key "Z">

View file

@ -567,8 +567,8 @@ citation.multipleSources=Sources multiples…
citation.singleSource=Source unique…
citation.showEditor=Montrer l'éditeur…
citation.hideEditor=Cacher l'éditeur…
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Rapport Zotero
report.parentItem=Document parent :

View file

@ -567,8 +567,8 @@ citation.multipleSources=Multiples Fontes...
citation.singleSource=Fonte Única....
citation.showEditor=Mostrar Editor
citation.hideEditor=Agochar Editor
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Informe Zotero
report.parentItem=Artigo Pai:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Multiple Sources...
citation.singleSource=מקור בודד...
citation.showEditor=הצג עורך...
citation.hideEditor=הסתר עורך...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero Report
report.parentItem=Parent Item:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Multiple Sources...
citation.singleSource=Single Source...
citation.showEditor=Show Editor...
citation.hideEditor=Hide Editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero Report
report.parentItem=Parent Item:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Több forrás...
citation.singleSource=Egy forrás...
citation.showEditor=Szerkesztő megjelenítése...
citation.hideEditor=Szerkesztő elrejtése...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero jelentés
report.parentItem=Szülő elem:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Multiple Sources...
citation.singleSource=Single Source...
citation.showEditor=Show Editor...
citation.hideEditor=Hide Editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero skýrsla
report.parentItem=Parent Item:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Fonti multiple...
citation.singleSource=Fonte singola...
citation.showEditor=Visualizza editor...
citation.hideEditor=Nascondi editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Rapporto Zotero
report.parentItem=Elemento principale:

View file

@ -567,8 +567,8 @@ citation.multipleSources=複数の参照データ...
citation.singleSource=単一の参照データ...
citation.showEditor=編集者名を表示する...
citation.hideEditor=編集者名を表示しない...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero レポート
report.parentItem=親アイテム:

View file

@ -567,8 +567,8 @@ citation.multipleSources=ពហុប្រភព...
citation.singleSource=ឯកប្រភព...
citation.showEditor=បង្ហាញកំណែតម្រូវ...
citation.hideEditor=លាក់កំណែតម្រូវ...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=របាយការណ៍ហ្ស៊ូតេរ៉ូ
report.parentItem=តត្តកម្មៈ

View file

@ -567,8 +567,8 @@ citation.multipleSources=복수의 출처...
citation.singleSource=단일 출처...
citation.showEditor=편집기 표시...
citation.hideEditor=편집기 감추기...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero 보고서
report.parentItem=근원 항목:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Multiple Sources...
citation.singleSource=Single Source...
citation.showEditor=Show Editor...
citation.hideEditor=Hide Editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero Report
report.parentItem=Parent Item:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Flere kilder...
citation.singleSource=Enkeltkilde...
citation.showEditor=Vis behandler...
citation.hideEditor=Skjul behandler...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero-rapport
report.parentItem=Overordnet element:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Meerdere bronnen…
citation.singleSource=Enkele bron…
citation.showEditor=Editor tonen…
citation.hideEditor=Editor verbergen…
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero-rapport
report.parentItem=Moederobject:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Fleire kjelder.. …
citation.singleSource=Enkeltkjelde …
citation.showEditor=Vis handsamar …
citation.hideEditor=Skjul handsamar …
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero-rapport
report.parentItem=Overordna element:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Wiele źródeł
citation.singleSource=Pojedyncze źródło
citation.showEditor=Wyświetl redaktora
citation.hideEditor=Ukryj redaktora
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Raport Zotero
report.parentItem=Element nadrzędny:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Fontes múltiplas...
citation.singleSource=Fonte única...
citation.showEditor=Mostrar editor...
citation.hideEditor=Esconder editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Relatório Zotero
report.parentItem=Item no nível acima:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Fontes Múltiplas...
citation.singleSource=Fonte Única...
citation.showEditor=Mostrar Editor...
citation.hideEditor=Esconder Editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Relatório Zotero
report.parentItem=Item Pai:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Surse multiple...
citation.singleSource=O singură sursă...
citation.showEditor=Afișează editor...
citation.hideEditor=Ascunde editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Raport Zotero
report.parentItem=Înregistrare părinte:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Много источников…
citation.singleSource=Один источник…
citation.showEditor=Показать редактор…
citation.hideEditor=Спрятать редактор…
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Отчет Zotero
report.parentItem=Родительский документ:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Viaceré zdroje...
citation.singleSource=Jeden zdroj...
citation.showEditor=Zobraziť editor...
citation.hideEditor=Skryť editor...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Hlásenie Zotera
report.parentItem=Nadradená položka:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Več virov ...
citation.singleSource=En vir ...
citation.showEditor=Pokaži urejevalnik ...
citation.hideEditor=Skrij urejevalnik ...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Poročilo Zotero
report.parentItem=Starševski vnos:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Вишеструки извори...
citation.singleSource=Један извор...
citation.showEditor=Прикажи уређивач...
citation.hideEditor=Сакриј уређивач...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Зотеро извештај
report.parentItem=Родитељски предмет:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Flera källor...
citation.singleSource=En källa...
citation.showEditor=Visa redigeraren...
citation.hideEditor=Göm redigeraren...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero-rapport
report.parentItem=Överordnad källa:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Multiple Sources...
citation.singleSource=Single Source...
citation.showEditor=แสดงโปรแกรมจัดการข้อมูล...
citation.hideEditor=ซ่อนโปรแกรมจัดการข้อมูล...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=รายงานของ Zotero
report.parentItem=รายการแม่:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Çoklu Kaynaklar...
citation.singleSource=Tek Kaynak...
citation.showEditor=Editörü Göster...
citation.hideEditor=Editörü Gizle...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero Rapor
report.parentItem=Üst Eser:

View file

@ -567,8 +567,8 @@ citation.multipleSources=Nhiều Tài liệu nguồn...
citation.singleSource=Một Tài liệu nguồn...
citation.showEditor=Hiện Cửa sổ Soạn Thảo...
citation.hideEditor=Dấu Cửa sổ Soạn thảo...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Báo cáo Zotero
report.parentItem=Biểu ghi Mẹ:

View file

@ -567,8 +567,8 @@ citation.multipleSources=多重来源...
citation.singleSource=单一来源...
citation.showEditor=显示编辑(Editor)...
citation.hideEditor=隐藏编辑(Editor)...
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero 报告
report.parentItem=父项:

View file

@ -567,8 +567,8 @@ citation.multipleSources=多重來源…
citation.singleSource=單一來源…
citation.showEditor=顯示編輯器…
citation.hideEditor=隱藏編輯器…
citation.citation=Citation
citation.note=Note
citation.citations=Citations
citation.notes=Notes
report.title.default=Zotero 報告
report.parentItem=母項目:

View file

@ -1 +1 @@
2012-07-03 23:35:00
2012-11-05 20:05:00

@ -1 +1 @@
Subproject commit a685b279c61b5c1b1368ea7997fc2b4914eedf8a
Subproject commit fc00df4eec4c4b9fa3d1e52d17eb46ff0cdfb50a