From ddf3ff9ba96c1b771f4371ac6925d0e0497903ad Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 28 Jun 2015 17:16:33 -0400 Subject: [PATCH 01/62] Don't try to set lastLocale pref in doc prefs unless locale was changed --- chrome/content/zotero/bibliography.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js index aaf7713eb..038ebd781 100644 --- a/chrome/content/zotero/bibliography.js +++ b/chrome/content/zotero/bibliography.js @@ -264,6 +264,8 @@ var Zotero_File_Interface_Bibliography = new function() { } // save locale - Zotero.Prefs.set("export.lastLocale", lastSelectedLocale); + if (lastSelectedLocale) { + Zotero.Prefs.set("export.lastLocale", lastSelectedLocale); + } }; } From 1d6483e68af4ebe4f5182d77bc15e41c0655ca0c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 29 Jun 2015 05:59:19 -0400 Subject: [PATCH 02/62] Fix #773, Zotero combo icons dispersed under more tools And fix save button hover height on Windows, which somehow got out of whack again. Might need further tweaking on Linux Need to find a better way to do these buttons... --- .../content/zotero-platform/mac/overlay.css | 23 +++--- .../content/zotero-platform/unix/overlay.css | 40 +++++++--- .../content/zotero-platform/win/overlay.css | 76 +++++++++++-------- chrome/content/zotero/icon.js | 18 ++++- chrome/skin/default/zotero/zotero.css | 60 +++++++++++++++ 5 files changed, 166 insertions(+), 51 deletions(-) diff --git a/chrome/content/zotero-platform/mac/overlay.css b/chrome/content/zotero-platform/mac/overlay.css index ace263648..d091c926b 100644 --- a/chrome/content/zotero-platform/mac/overlay.css +++ b/chrome/content/zotero-platform/mac/overlay.css @@ -40,8 +40,9 @@ padding-right: 1px; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker { +/* Recreate standard hover effect (except in overflow list) */ +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker { border-width: 1px; border-style: solid; border-color: var(--toolbarbutton-hover-bordercolor) !important; @@ -50,36 +51,40 @@ border-bottom-left-radius: 0; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker::before { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker::before { background: none; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button { border-right: 1px solid transparent; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker { border-left: 1px solid transparent; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > .toolbarbutton-menubutton-dropmarker { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > .toolbarbutton-menubutton-dropmarker { background: inherit; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker:hover { +#zotero-toolbar-save-button[cui-areatype="toolbar"]:not([overflowedItem=true]) > .toolbarbutton-menubutton-dropmarker:hover { background: var(--toolbarbutton-hover-background); } #zotero-toolbar-main-button[cui-areatype="toolbar"] { border-right: 1px solid transparent; } -#zotero-toolbar-save-button[cui-areatype="toolbar"]:hover { +#zotero-toolbar-save-button[cui-areatype="toolbar"]:not([overflowedItem=true]):hover { border-left: 0 solid transparent; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button { border-left: 1px solid transparent; } +#zotero-toolbar-buttons[overflowedItem=true] { + margin-left: 3px !important; +} + /* Necessary in Fx36 to keep 32px icons from being rendered at full size */ #zotero-toolbar-main-button[cui-areatype="toolbar"] > .toolbarbutton-icon, #zotero-toolbar-main-button-single[cui-areatype="toolbar"] > .toolbarbutton-icon, diff --git a/chrome/content/zotero-platform/unix/overlay.css b/chrome/content/zotero-platform/unix/overlay.css index 3500fe859..c2295d516 100644 --- a/chrome/content/zotero-platform/unix/overlay.css +++ b/chrome/content/zotero-platform/unix/overlay.css @@ -70,31 +70,53 @@ box-shadow: var(--toolbarbutton-combined-boxshadow); } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-main-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-main-button .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .dropmarker-icon { border-color: var(--toolbarbutton-hover-bordercolor) !important; } -#zotero-toolbar-save-button[cui-areatype="toolbar"]:hover:not(:active) > .toolbarbutton-menubutton-button > .toolbarbutton-icon, -#zotero-toolbar-save-button[cui-areatype="toolbar"]:hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:not(:active) > .toolbarbutton-menubutton-button > .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { background: inherit; } -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button:hover:not(:active) > .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button:hover:not(:active) > .toolbarbutton-icon, /* This selector doesn't work, so the dropmarker doesn't get a hover effect. :hover doesn't seem to have an effect on either part of the dropmarker */ -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker:hover > .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker:hover > .dropmarker-icon { background: var(--toolbarbutton-hover-background) !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { background: var(--toolbarbutton-active-background); border-color: var(--toolbarbutton-active-bordercolor); box-shadow: var(--toolbarbutton-active-boxshadow); transition-duration: 10ms; } + +/* Alterations for overflow panel */ +#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon { + width: 16px; +} + +#zotero-toolbar-buttons[overflowedItem=true] { + margin-left: 0px !important; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { + padding-left: 0; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon { + width: 26px; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon { + margin-left: 1px; + padding-right: 0 !important; +} /* End toolbar buttons */ diff --git a/chrome/content/zotero-platform/win/overlay.css b/chrome/content/zotero-platform/win/overlay.css index 756291aee..4acc5fb95 100644 --- a/chrome/content/zotero-platform/win/overlay.css +++ b/chrome/content/zotero-platform/win/overlay.css @@ -5,19 +5,10 @@ width: 32px; } -#zotero-toolbar-save-button-single[cui-areatype="toolbar"] .toolbarbutton-icon { - width: 30px; -} - -#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon, -#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { +#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { width: 28px; } -#zotero-toolbar-main-button[cui-areatype="toolbar"] { - margin-right: -1px !important; -} - #zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { margin-left: 2px; margin-right: -1px; @@ -51,26 +42,25 @@ margin-bottom: 11px; } - -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > separator, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button:not([disabled]) > .toolbarbutton-menubutton-dropmarker::before { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > separator, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button:not([disabled]) > .toolbarbutton-menubutton-dropmarker::before { display: none; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-main-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button:not([disabled]) .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button:not([disabled]) .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-main-button .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button:not([disabled]) .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button:not([disabled]) .dropmarker-icon { border-color: var(--toolbarbutton-hover-bordercolor) !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-main-button:not(:active) .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-main-button:not(:active) .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .dropmarker-icon { background: var(--toolbarbutton-hover-background); } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .dropmarker-icon { box-shadow: none; } @@ -78,34 +68,56 @@ There are two hover effects: when the toolbaritem is hovered over, and when the button is hovered over. This applies the latter (and may not be right on different versions of Windows). */ -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-main-button:hover:not(:active):not([disabled]) > .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-main-button:hover:not(:active):not([disabled]) > .toolbarbutton-icon, /* The dropmarker doesn't honor :hover, so instead of showing the hover effect for each segment individually, do the menu-button parts together, which at least looks like a choice. */ -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button:hover .toolbarbutton-menubutton-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button:hover:not(:active):not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover .toolbarbutton-menubutton-button .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:not(:active):not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { background-color: hsla(210,48%,96%,.75) !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-main-button:hover > .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-main-button:hover > .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { border-color: hsla(210,54%,20%,.3) hsla(210,54%,20%,.35) hsla(210,54%,20%,.4) !important; box-shadow: 0 0 1px hsla(210,54%,20%,.03), 0 0 2px hsla(210,54%,20%,.1) !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { - background: var(--toolbarbutton-active-background); - border-color: var(--toolbarbutton-active-bordercolor); - box-shadow: var(--toolbarbutton-active-boxshadow); +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { + background: var(--toolbarbutton-active-background) !important; + border-color: var(--toolbarbutton-active-bordercolor) !important; + box-shadow: var(--toolbarbutton-active-boxshadow) !important; transition-duration: 10ms; } #zotero-toolbar-save-button[cui-areatype="toolbar"] > menupopup { margin-top: -5px; } + +/* Alterations for overflow panel */ +#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon { + width: 16px; +} + +#zotero-toolbar-buttons[overflowedItem=true] { + margin-left: 0px !important; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { + padding-left: 0; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon { + width: 26px; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon { + margin-left: 1px; + padding-right: 0 !important; +} /* End toolbar buttons */ @media (min-resolution: 1.5dppx) { diff --git a/chrome/content/zotero/icon.js b/chrome/content/zotero/icon.js index f5f401fc1..0cd77b138 100644 --- a/chrome/content/zotero/icon.js +++ b/chrome/content/zotero/icon.js @@ -71,6 +71,18 @@ CustomizableUI.addListener({ } }, + onWidgetOverflow: function (node, container) { + if (node.id == comboButtonsID) { + node.classList.add("toolbarbutton-1"); + } + }, + + onWidgetUnderflow: function (node, container) { + if (node.id == comboButtonsID) { + node.classList.remove("toolbarbutton-1"); + } + }, + onWidgetRemoved: function (id, area) { if (id == comboButtonsID) { var item = document.getElementById(id); @@ -135,7 +147,11 @@ CustomizableUI.createWidget({ item.appendChild(document.createElementNS(kNSXUL, "separator")); } let button = document.createElementNS(kNSXUL, "toolbarbutton"); - if (attribs.name == 'save') { + if (attribs.name == 'main') { + button.setAttribute('label', Zotero.clientName); + } + else if (attribs.name == 'save') { + button.setAttribute('label', Zotero.getString('ingester.saveToZotero')); button.setAttribute('disabled', 'true'); button.setAttribute('type', 'menu-button'); let menupopup = document.createElementNS(kNSXUL, "menupopup"); diff --git a/chrome/skin/default/zotero/zotero.css b/chrome/skin/default/zotero/zotero.css index 9d496e9cb..0352c4b21 100644 --- a/chrome/skin/default/zotero/zotero.css +++ b/chrome/skin/default/zotero/zotero.css @@ -52,6 +52,66 @@ toolbarpaletteitem[place="palette"] #zotero-toolbar-buttons #zotero-toolbar-save display:none; } +/* Alterations for overflow panel */ +#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-text, +#zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-text { + margin-left: 2px !important; +} + +#zotero-toolbar-buttons[overflowedItem=true] { + margin: 6px 4px; + max-height: 36px; +} + +#zotero-toolbar-buttons[overflowedItem=true]:not(:hover) { + border: 1px solid transparent; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-text { + display: none; + margin-left: 1px; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { + min-width: unset; + max-width: 30px; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button:hover { + background: unset; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button::before { + content: ""; + display: -moz-box; + width: 1px; + height: 18px; + -moz-margin-end: 0px; + background-image: linear-gradient(hsla(210,54%,20%,.2) 0, hsla(210,54%,20%,.2) 18px); + background-clip: padding-box; + background-position: center; + background-repeat: no-repeat; + background-size: 1px 18px; + box-shadow: 0 0 0 1px hsla(0,0%,100%,.2); +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button { + max-width: unset; + margin: 0 0 0 -1px !important; + background: unset; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button toolbarbutton { + margin-left: 8px; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker, +#zotero-toolbar-save-button-single[overflowedItem=true] > .toolbarbutton-menubutton-dropmarker { + padding-left: 3px; + padding-right: 6px; +} + + /* Show webpage icon in gray when no translators */ #zotero-toolbar-save-button:not(.translate), #zotero-toolbar-save-button-single:not(.translate), From a9c6feb38028efed1f4a27b7f0a0425bbb681066 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 29 Jun 2015 06:35:05 -0400 Subject: [PATCH 03/62] Additional toolbar overflow tweaks for Linux Follow-up from 1d6483e68 --- chrome/content/zotero-platform/unix/overlay.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero-platform/unix/overlay.css b/chrome/content/zotero-platform/unix/overlay.css index c2295d516..c19a6fb01 100644 --- a/chrome/content/zotero-platform/unix/overlay.css +++ b/chrome/content/zotero-platform/unix/overlay.css @@ -97,12 +97,14 @@ } /* Alterations for overflow panel */ -#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon { +#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon, +#zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-icon { width: 16px; } #zotero-toolbar-buttons[overflowedItem=true] { margin-left: 0px !important; + margin-bottom: 0px !important; } #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { @@ -116,6 +118,7 @@ #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon { margin-left: 1px; padding-right: 0 !important; + width: 22px !important; } /* End toolbar buttons */ From 6c416e7ad2ecdf09c6e0d999e5df81ffc974deba Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 29 Jun 2015 07:06:20 -0400 Subject: [PATCH 04/62] Get rid of middle border radius in combo button on Windows --- chrome/content/zotero-platform/win/overlay.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/chrome/content/zotero-platform/win/overlay.css b/chrome/content/zotero-platform/win/overlay.css index 4acc5fb95..d2ba621cb 100644 --- a/chrome/content/zotero-platform/win/overlay.css +++ b/chrome/content/zotero-platform/win/overlay.css @@ -64,6 +64,16 @@ box-shadow: none; } +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-main-button .toolbarbutton-icon { + border-top-right-radius: 0px !important; + border-bottom-right-radius: 0px !important; +} + +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .toolbarbutton-icon { + border-top-left-radius: 0px !important; + border-bottom-left-radius: 0px !important; +} + /* There are two hover effects: when the toolbaritem is hovered over, and when the button is hovered over. This applies the latter (and may not be right on different versions of Windows). From 5545ea7847d30e089ae1340a143c3eabe7179e14 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 29 Jun 2015 07:12:55 -0400 Subject: [PATCH 05/62] Merge locales from Transifex --- chrome/locale/de/zotero/preferences.dtd | 4 +- chrome/locale/de/zotero/zotero.dtd | 2 +- chrome/locale/de/zotero/zotero.properties | 34 +++++------ chrome/locale/es-ES/zotero/preferences.dtd | 4 +- chrome/locale/es-ES/zotero/zotero.dtd | 2 +- chrome/locale/es-ES/zotero/zotero.properties | 32 +++++----- chrome/locale/fr-FR/zotero/preferences.dtd | 8 +-- chrome/locale/fr-FR/zotero/zotero.dtd | 2 +- chrome/locale/fr-FR/zotero/zotero.properties | 26 ++++---- chrome/locale/pl-PL/zotero/preferences.dtd | 4 +- chrome/locale/pl-PL/zotero/zotero.dtd | 2 +- chrome/locale/pl-PL/zotero/zotero.properties | 22 +++---- chrome/locale/sk-SK/zotero/preferences.dtd | 4 +- chrome/locale/sk-SK/zotero/zotero.dtd | 2 +- chrome/locale/sk-SK/zotero/zotero.properties | 38 ++++++------ chrome/locale/sv-SE/zotero/preferences.dtd | 12 ++-- chrome/locale/sv-SE/zotero/zotero.dtd | 2 +- chrome/locale/sv-SE/zotero/zotero.properties | 32 +++++----- chrome/locale/tr-TR/zotero/preferences.dtd | 4 +- chrome/locale/tr-TR/zotero/zotero.dtd | 2 +- chrome/locale/tr-TR/zotero/zotero.properties | 26 ++++---- chrome/locale/uk-UA/zotero/preferences.dtd | 4 +- chrome/locale/uk-UA/zotero/zotero.dtd | 2 +- chrome/locale/uk-UA/zotero/zotero.properties | 62 ++++++++++---------- chrome/locale/zh-TW/zotero/preferences.dtd | 4 +- chrome/locale/zh-TW/zotero/zotero.dtd | 2 +- chrome/locale/zh-TW/zotero/zotero.properties | 38 ++++++------ 27 files changed, 188 insertions(+), 188 deletions(-) diff --git a/chrome/locale/de/zotero/preferences.dtd b/chrome/locale/de/zotero/preferences.dtd index 51f4e1963..b21297eed 100644 --- a/chrome/locale/de/zotero/preferences.dtd +++ b/chrome/locale/de/zotero/preferences.dtd @@ -107,7 +107,7 @@ - + @@ -145,7 +145,7 @@ - + diff --git a/chrome/locale/de/zotero/zotero.dtd b/chrome/locale/de/zotero/zotero.dtd index 58fb6ba8a..a34c39e6c 100644 --- a/chrome/locale/de/zotero/zotero.dtd +++ b/chrome/locale/de/zotero/zotero.dtd @@ -165,7 +165,7 @@ - + diff --git a/chrome/locale/de/zotero/zotero.properties b/chrome/locale/de/zotero/zotero.properties index f3acb8c68..fdb68c535 100644 --- a/chrome/locale/de/zotero/zotero.properties +++ b/chrome/locale/de/zotero/zotero.properties @@ -55,7 +55,7 @@ general.numMore=%S mehr... general.openPreferences=Einstellungen Öffnen general.keys.ctrlShift=Strg+Umschalt+ general.keys.cmdShift=Cmd+Shift+ -general.dontShowAgain=Don’t Show Again +general.dontShowAgain=Nicht mehr anzeigen general.operationInProgress=Zotero ist beschäftigt. general.operationInProgress.waitUntilFinished=Bitte warten Sie, bis der Vorgang abgeschlossen ist. @@ -678,22 +678,22 @@ citation.showEditor=Editor anzeigen... citation.hideEditor=Editor verbergen... citation.citations=Zitationen citation.notes=Notizen -citation.locator.page=Page -citation.locator.book=Book -citation.locator.chapter=Chapter -citation.locator.column=Column -citation.locator.figure=Figure +citation.locator.page=Seite +citation.locator.book=Buch +citation.locator.chapter=Kapitel +citation.locator.column=Spalte +citation.locator.figure=Abbildung citation.locator.folio=Folio -citation.locator.issue=Issue -citation.locator.line=Line -citation.locator.note=Note +citation.locator.issue=Ausgabe +citation.locator.line=Zeile +citation.locator.note=Fußnote citation.locator.opus=Opus -citation.locator.paragraph=Paragraph -citation.locator.part=Part -citation.locator.section=Section -citation.locator.subverbo=Sub verbo -citation.locator.volume=Volume -citation.locator.verse=Verse +citation.locator.paragraph=Absatz +citation.locator.part=Teil +citation.locator.section=Abschnitt +citation.locator.subverbo=Sub voce +citation.locator.volume=Band +citation.locator.verse=Vers report.title.default=Zotero-Bericht report.parentItem=Übergeordneter Eintrag: @@ -963,7 +963,7 @@ file.accessError.message.windows=Stellen Sie sicher, dass die Datei nicht verwen file.accessError.message.other=Stellen Sie sicher, dass die Datei nicht verwendet wird und dass Schreibberechtigungen vorliegen. file.accessError.restart=Ein Neustart Ihres Computers oder die Deaktivierung von Sicherheitssoftware könnte ebenfalls Abhilfe schaffen. file.accessError.showParentDir=Übergeordnetes Verzeichnis anzeigen -file.error.cannotAddShortcut=Shortcut files cannot be added directly. Please select the original file. +file.error.cannotAddShortcut=Shortcut-Dateien können nicht direkt hinzugefügt werden. Bitte wählen Sie die ursprüngliche Datei aus. lookup.failure.title=Nachschlagen fehlgeschlagen lookup.failure.description=Zotero konnte keinen Eintrag für den angegeben Identifier finden. Bitte überprüfen Sie den Identifier und versuchen Sie es erneut. @@ -1004,7 +1004,7 @@ firstRunGuidance.quickFormat=Geben Sie einen Titel oder Autor ein, um nach einer firstRunGuidance.quickFormatMac=Geben Sie einen Titel oder Autor ein, um nach einer Zitation zu suchen.\n\nNachdem Sie Ihre Auswahl getroffen haben, klicken Sie auf die Blase oder drücken Sie Cmd-\u2193, um Seitenzahlen, Präfixe oder Suffixe hinzuzufügen. Sie können die Seitenzahl auch zu Ihren Suchbegriffen hinzufügen, um diese direkt hinzuzufügen.\n\nSie können alle Zitationen direkt im Dokument bearbeiten. firstRunGuidance.toolbarButton.new=Klicken Sie hier oder verwenden Sie die %S Tastenkombination um Zotero zu öffnen. firstRunGuidance.toolbarButton.upgrade=Das Zotero Icon ist jetzt in der Firefox Symbolleiste. Klicken Sie das Icon oder verwenden Sie die %S Tastenkombination um Zotero zu öffnen. -firstRunGuidance.saveButton=Click this button to save any web page to your Zotero library. On some pages, Zotero will be able to save full details, including author and date. +firstRunGuidance.saveButton=Klicken Sie diesen Button, um beliebige Webseiten zu Zotero hinzuzufügen. Auf manchen Seiten kann Zotero sämtliche Details einschließlich des Autors/der Autorin und des Datums erfassen. styles.bibliography=Bibliografie styles.editor.save=Zitationsstil speichern diff --git a/chrome/locale/es-ES/zotero/preferences.dtd b/chrome/locale/es-ES/zotero/preferences.dtd index e487acd15..e9948043d 100644 --- a/chrome/locale/es-ES/zotero/preferences.dtd +++ b/chrome/locale/es-ES/zotero/preferences.dtd @@ -107,7 +107,7 @@ - + @@ -145,7 +145,7 @@ - + diff --git a/chrome/locale/es-ES/zotero/zotero.dtd b/chrome/locale/es-ES/zotero/zotero.dtd index 8d684fb3c..6a12b9b3a 100644 --- a/chrome/locale/es-ES/zotero/zotero.dtd +++ b/chrome/locale/es-ES/zotero/zotero.dtd @@ -165,7 +165,7 @@ - + diff --git a/chrome/locale/es-ES/zotero/zotero.properties b/chrome/locale/es-ES/zotero/zotero.properties index 152ae294e..893e0021e 100644 --- a/chrome/locale/es-ES/zotero/zotero.properties +++ b/chrome/locale/es-ES/zotero/zotero.properties @@ -55,7 +55,7 @@ general.numMore=%S más… general.openPreferences=Abrir preferencias general.keys.ctrlShift=Ctrl+Shift+ general.keys.cmdShift=Cmd+Shift+ -general.dontShowAgain=Don’t Show Again +general.dontShowAgain=No mostrar nuevamente general.operationInProgress=Una operación de Zotero se encuentra en progreso. general.operationInProgress.waitUntilFinished=Espera hasta que termine. @@ -678,22 +678,22 @@ citation.showEditor=Mostrar editor... citation.hideEditor=Ocultar editor... citation.citations=Citas citation.notes=Notas -citation.locator.page=Page -citation.locator.book=Book -citation.locator.chapter=Chapter -citation.locator.column=Column -citation.locator.figure=Figure +citation.locator.page=Página +citation.locator.book=Libro +citation.locator.chapter=Capítulo +citation.locator.column=Columna +citation.locator.figure=Figura citation.locator.folio=Folio -citation.locator.issue=Issue -citation.locator.line=Line -citation.locator.note=Note +citation.locator.issue=Ejemplar +citation.locator.line=Línea +citation.locator.note=Nota citation.locator.opus=Opus -citation.locator.paragraph=Paragraph -citation.locator.part=Part -citation.locator.section=Section +citation.locator.paragraph=Párrafo +citation.locator.part=Pieza +citation.locator.section=Sección citation.locator.subverbo=Sub verbo -citation.locator.volume=Volume -citation.locator.verse=Verse +citation.locator.volume=Volumen +citation.locator.verse=Versículo report.title.default=Informe de Zotero report.parentItem=Ítem contenedor: @@ -963,7 +963,7 @@ file.accessError.message.windows=Verifique que el archivo no está actualmente e file.accessError.message.other=Compruebe que el archivo no está actualmente en uso y que sus permisos incluyen acceso de escritura. file.accessError.restart=Reiniciar el ordenador o deshabilitar el software de seguridad también puede ayudar. file.accessError.showParentDir=Mostrar directorio padre -file.error.cannotAddShortcut=Shortcut files cannot be added directly. Please select the original file. +file.error.cannotAddShortcut=Archivos de atajo no pueden ser añadidos directamente. Por favor seleccione el archivo original. lookup.failure.title=Búsqueda fallida lookup.failure.description=Zotero no puede encontrar un registro del identificador especificado. Por favor, verifica el identificador e inténtalo nuevamente. @@ -1004,7 +1004,7 @@ firstRunGuidance.quickFormat=Escribe el título o el autor para buscar una refer firstRunGuidance.quickFormatMac=Escribe el título o el autor para buscar una referencia. \n\nDespués de que hayas hecho tu selección, haz clic en la burbuja o pulsa Cmd-\u2193 para agregar números de página, prefijos o sufijos. También puedes incluir un número de página junto con tus términos de búsqueda para añadirlo directamente.\n\nPuedes editar citas directamente en el documento del procesador de textos. firstRunGuidance.toolbarButton.new=Clic aquí para abrir Zotero o utilice el atajo de teclado %S firstRunGuidance.toolbarButton.upgrade=El ícono Zotero ahora se encuentra en la barra de Firefox. Clic en el ícono para abrir Zotero, o use el atajo de teclado %S. -firstRunGuidance.saveButton=Click this button to save any web page to your Zotero library. On some pages, Zotero will be able to save full details, including author and date. +firstRunGuidance.saveButton=Clic en este botón para guardar cualquier página de internet a su biblioteca Zotero. En algunas páginas, Zotero será capaz de guardar en detalle, incluyendo autor y fecha. styles.bibliography=Bibliografí­a styles.editor.save=Guardar estilo de cita diff --git a/chrome/locale/fr-FR/zotero/preferences.dtd b/chrome/locale/fr-FR/zotero/preferences.dtd index 06699769b..c023548f3 100644 --- a/chrome/locale/fr-FR/zotero/preferences.dtd +++ b/chrome/locale/fr-FR/zotero/preferences.dtd @@ -107,7 +107,7 @@ - + @@ -140,12 +140,12 @@ - - + + - + diff --git a/chrome/locale/fr-FR/zotero/zotero.dtd b/chrome/locale/fr-FR/zotero/zotero.dtd index e3cd7f219..a07fd15fb 100644 --- a/chrome/locale/fr-FR/zotero/zotero.dtd +++ b/chrome/locale/fr-FR/zotero/zotero.dtd @@ -165,7 +165,7 @@ - + diff --git a/chrome/locale/fr-FR/zotero/zotero.properties b/chrome/locale/fr-FR/zotero/zotero.properties index ce5f18a20..17507bdce 100644 --- a/chrome/locale/fr-FR/zotero/zotero.properties +++ b/chrome/locale/fr-FR/zotero/zotero.properties @@ -55,7 +55,7 @@ general.numMore=%S autres… general.openPreferences=Ouvrir les Préférences general.keys.ctrlShift=Ctrl+Maj+ general.keys.cmdShift=Cmd+Maj+ -general.dontShowAgain=Don’t Show Again +general.dontShowAgain=Ne plus afficher general.operationInProgress=Une opération Zotero est actuellement en cours. general.operationInProgress.waitUntilFinished=Veuillez attendre jusqu'à ce qu'elle soit terminée. @@ -679,21 +679,21 @@ citation.hideEditor=Cacher l'éditeur… citation.citations=Citations citation.notes=Notes citation.locator.page=Page -citation.locator.book=Book -citation.locator.chapter=Chapter -citation.locator.column=Column +citation.locator.book=Livre +citation.locator.chapter=Chapitre +citation.locator.column=Colonne citation.locator.figure=Figure citation.locator.folio=Folio -citation.locator.issue=Issue -citation.locator.line=Line +citation.locator.issue=Numéro +citation.locator.line=Ligne citation.locator.note=Note citation.locator.opus=Opus -citation.locator.paragraph=Paragraph -citation.locator.part=Part +citation.locator.paragraph=Paragraphe +citation.locator.part=Partie citation.locator.section=Section citation.locator.subverbo=Sub verbo citation.locator.volume=Volume -citation.locator.verse=Verse +citation.locator.verse=Verset report.title.default=Rapport Zotero report.parentItem=Document parent : @@ -925,8 +925,8 @@ proxies.error.scheme.noPath=Un schéma de serveur mandataire valide doit conteni proxies.error.host.proxyExists=Vous avez déjà défini un autre serveur mandataire pour l'hôte %1$S. proxies.error.scheme.invalid=Le schéma de serveur mandataire enregistré n'est pas valide ; il s'appliquerait à tous les hôtes. proxies.notification.recognized.label=Zotero a détecté que vous accédez à ce site via un serveur mandataire. Voulez-vous rediriger automatiquement les prochaines requêtes à %1$S via %2$S ? -proxies.notification.associated.label=Zotero a associé automatiquement ce site avec un serveur mandataire défini auparavant. Les prochaines requêtes à %1$S seront redirigées à %2$S. -proxies.notification.redirected.label=Zotero a redirigé automatiquement votre requêté vers %1$S via le serveur mandataire à %2$S. +proxies.notification.associated.label=Zotero a associé automatiquement ce site avec un serveur mandataire défini auparavant. Les prochaines requêtes vers %1$S seront redirigées via %2$S. +proxies.notification.redirected.label=Zotero a redirigé automatiquement votre requête vers %1$S via le serveur mandataire (proxy) %2$S. proxies.notification.enable.button=Activer… proxies.notification.settings.button=Paramètres du serveur mandataire… proxies.recognized.message=Ajouter ce serveur mandataire permettra à Zotero de reconnaître des documents à partir de ses pages et redirigera automatiquement les prochaines requêtes vers %1$S via %2$S. @@ -963,7 +963,7 @@ file.accessError.message.windows=Vérifiez que le fichier n'est pas utilisé act file.accessError.message.other=Vérifiez que le fichier n'est pas utilisé actuellement et que ses permissions autorisent l'accès en écriture. file.accessError.restart=Redémarrer votre ordinateur ou désactiver les logiciels de sécurité peut aussi aider. file.accessError.showParentDir=Localiser le répertoire parent -file.error.cannotAddShortcut=Shortcut files cannot be added directly. Please select the original file. +file.error.cannotAddShortcut=Les raccourcis ne peuvent pas être ajoutés directement. Veuillez sélectionner le fichier original. lookup.failure.title=La recherche a échoué lookup.failure.description=Zotero n'a pas trouvé d'enregistrement pour l'identifiant spécifié. Veuillez vérifier l'identifiant et réessayer. @@ -1004,7 +1004,7 @@ firstRunGuidance.quickFormat=Tapez son titre ou son auteur pour rechercher une r firstRunGuidance.quickFormatMac=Tapez son titre ou son auteur pour rechercher une référence.\n\nAprès l'avoir sélectionnée, cliquez sur la bulle ou appuyer sur Cmd-\u2193 pour ajouter les numéros des pages, un préfixe ou un suffixe. Vous pouvez aussi inclure un numéro de page en même temps que vos termes de recherche afin de l'ajouter directement.\n\nVous pouvez modifier les citations directement dans le document du traitement de texte. firstRunGuidance.toolbarButton.new=Cliquez ici pour ouvrir Zotero, ou utilisez le raccourci clavier %S. firstRunGuidance.toolbarButton.upgrade=L'icône Zotero est désormais dans la barre d'outils Firefox. Cliquez sur l'icône pour ouvrir Zotero, ou utilisez le raccourci clavier %S. -firstRunGuidance.saveButton=Click this button to save any web page to your Zotero library. On some pages, Zotero will be able to save full details, including author and date. +firstRunGuidance.saveButton=Cliquez sur ce bouton pour enregistrer n'importe quel page web dans votre bibliothèque Zotero. Sur certaines pages, Zotero pourra enregistrer tous les détails, y compris l'auteur et la date. styles.bibliography=Bibliographie styles.editor.save=Enregistrer le style de citation diff --git a/chrome/locale/pl-PL/zotero/preferences.dtd b/chrome/locale/pl-PL/zotero/preferences.dtd index b3dfdeb56..09059c02e 100644 --- a/chrome/locale/pl-PL/zotero/preferences.dtd +++ b/chrome/locale/pl-PL/zotero/preferences.dtd @@ -107,7 +107,7 @@ - + @@ -145,7 +145,7 @@ - + diff --git a/chrome/locale/pl-PL/zotero/zotero.dtd b/chrome/locale/pl-PL/zotero/zotero.dtd index 785a37cc2..2bf3f6fcb 100644 --- a/chrome/locale/pl-PL/zotero/zotero.dtd +++ b/chrome/locale/pl-PL/zotero/zotero.dtd @@ -165,7 +165,7 @@ - + diff --git a/chrome/locale/pl-PL/zotero/zotero.properties b/chrome/locale/pl-PL/zotero/zotero.properties index 070f4714d..8baf89f6d 100644 --- a/chrome/locale/pl-PL/zotero/zotero.properties +++ b/chrome/locale/pl-PL/zotero/zotero.properties @@ -55,7 +55,7 @@ general.numMore=%S więcej... general.openPreferences=Otwórz ustawienia general.keys.ctrlShift=Ctrl+Shift+ general.keys.cmdShift=Cmd+Shift+ -general.dontShowAgain=Don’t Show Again +general.dontShowAgain=Nie pokazuj ponownie general.operationInProgress=Operacja Zotero jest aktualnie w trakcie. general.operationInProgress.waitUntilFinished=Proszę poczekać na zakończenie. @@ -678,22 +678,22 @@ citation.showEditor=Wyświetl redaktora citation.hideEditor=Ukryj redaktora citation.citations=Cytowania citation.notes=Notatki -citation.locator.page=Page -citation.locator.book=Book -citation.locator.chapter=Chapter -citation.locator.column=Column -citation.locator.figure=Figure +citation.locator.page=Strona +citation.locator.book=Książka +citation.locator.chapter=Rozdział +citation.locator.column=Kolumna +citation.locator.figure=Ilustracja citation.locator.folio=Folio citation.locator.issue=Issue citation.locator.line=Line -citation.locator.note=Note +citation.locator.note=Notatka citation.locator.opus=Opus citation.locator.paragraph=Paragraph -citation.locator.part=Part -citation.locator.section=Section +citation.locator.part=Część +citation.locator.section=Sekcja citation.locator.subverbo=Sub verbo -citation.locator.volume=Volume -citation.locator.verse=Verse +citation.locator.volume=Tom +citation.locator.verse=Wers report.title.default=Raport Zotero report.parentItem=Element nadrzędny: diff --git a/chrome/locale/sk-SK/zotero/preferences.dtd b/chrome/locale/sk-SK/zotero/preferences.dtd index 8e98efb10..bf9334941 100644 --- a/chrome/locale/sk-SK/zotero/preferences.dtd +++ b/chrome/locale/sk-SK/zotero/preferences.dtd @@ -107,7 +107,7 @@ - + @@ -145,7 +145,7 @@ - + diff --git a/chrome/locale/sk-SK/zotero/zotero.dtd b/chrome/locale/sk-SK/zotero/zotero.dtd index 5c3ed4bfc..c8208f9d6 100644 --- a/chrome/locale/sk-SK/zotero/zotero.dtd +++ b/chrome/locale/sk-SK/zotero/zotero.dtd @@ -165,7 +165,7 @@ - + diff --git a/chrome/locale/sk-SK/zotero/zotero.properties b/chrome/locale/sk-SK/zotero/zotero.properties index f7d5ccedb..f7d87b3de 100644 --- a/chrome/locale/sk-SK/zotero/zotero.properties +++ b/chrome/locale/sk-SK/zotero/zotero.properties @@ -55,7 +55,7 @@ general.numMore=%S viac… general.openPreferences=Otvoriť predvoľby general.keys.ctrlShift=Ctrl+Shift+ general.keys.cmdShift=Cmd+Shift+ -general.dontShowAgain=Don’t Show Again +general.dontShowAgain=Nezobrazovať znova general.operationInProgress=Zotero práve vykonáva operáciu. general.operationInProgress.waitUntilFinished=Prosím počkajte, kým sa neukončí. @@ -678,22 +678,22 @@ citation.showEditor=Zobraziť editor... citation.hideEditor=Skryť editor... citation.citations=Citácie citation.notes=Poznámky -citation.locator.page=Page -citation.locator.book=Book -citation.locator.chapter=Chapter -citation.locator.column=Column -citation.locator.figure=Figure -citation.locator.folio=Folio -citation.locator.issue=Issue -citation.locator.line=Line -citation.locator.note=Note -citation.locator.opus=Opus -citation.locator.paragraph=Paragraph -citation.locator.part=Part -citation.locator.section=Section -citation.locator.subverbo=Sub verbo -citation.locator.volume=Volume -citation.locator.verse=Verse +citation.locator.page=Strana +citation.locator.book=Kniha +citation.locator.chapter=Kapitola +citation.locator.column=Stĺpec +citation.locator.figure=Obrázok +citation.locator.folio=List +citation.locator.issue=Číslo +citation.locator.line=Riadok +citation.locator.note=Poznámka +citation.locator.opus=Dielo +citation.locator.paragraph=Odstavec +citation.locator.part=Časť +citation.locator.section=Sekcia +citation.locator.subverbo=Pod heslom +citation.locator.volume=Zväzok +citation.locator.verse=Verš report.title.default=Výkaz Zotera report.parentItem=Nadradená položka: @@ -963,7 +963,7 @@ file.accessError.message.windows=Skontrolujte, že súbor sa aktuálne nepouží file.accessError.message.other=Skontrolujte, že súbor sa aktuálne nepoužíva a že jeho oprávnenia dovoľujú prístup zapisovať. file.accessError.restart=Reštartovanie počítača alebo vypnutie bezpečnostného softvéru môže tiež pomôcť. file.accessError.showParentDir=Zobraziť nadradený adresár -file.error.cannotAddShortcut=Shortcut files cannot be added directly. Please select the original file. +file.error.cannotAddShortcut=Súbory skratiek nemožno pridať priamo. Vyberte, prosím, pôvodný súbor. lookup.failure.title=Vyhľadávanie zlyhalo lookup.failure.description=Zotero nemohol nájsť záznam pre špecifikovaný identifikátor. Prosím skontrolujte identifikátor a skúste to znova. @@ -1004,7 +1004,7 @@ firstRunGuidance.quickFormat=Zadaním názvu alebo autora spustíte hľadanie od firstRunGuidance.quickFormatMac=Zadaním názvu alebo autora spustíte hľadanie odkazu.\n\nPo uskutočnení výberu, kliknite na bublinu alebo stlačte Ctrl-\u2193 na pridanie čísiel strán, predpôn alebo prípon. Môžete tiež pridať číslo strany spolu s hľadanými pojmamy, a tak ich môžete zadať priamo.\n\nCitácie môžete upravovať priamo v dokumente textového procesora. firstRunGuidance.toolbarButton.new=Otvorte Zotero kliknutím sem alebo pomocou klávesovej skratky %S. firstRunGuidance.toolbarButton.upgrade=Ikonu Zotera je teraz možné nájsť v nástrojovej lište Firefoxu. Otvorte Zotero kliknutím na ikonu alebo pomocou klávesovej skratky %S. -firstRunGuidance.saveButton=Click this button to save any web page to your Zotero library. On some pages, Zotero will be able to save full details, including author and date. +firstRunGuidance.saveButton=Kliknutím na toto tlačidlo uložte ľubovoľnú webstránku do svojej knižnice Zotera. Na niektorých stránkach bude Zotero schopné uložiť všetky podrobnosti, vrátane autora a dátumu. styles.bibliography=Bibliografia styles.editor.save=Uložiť citačný štýl diff --git a/chrome/locale/sv-SE/zotero/preferences.dtd b/chrome/locale/sv-SE/zotero/preferences.dtd index daf057822..79896dbff 100644 --- a/chrome/locale/sv-SE/zotero/preferences.dtd +++ b/chrome/locale/sv-SE/zotero/preferences.dtd @@ -63,7 +63,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -145,16 +145,16 @@ - + - + - + diff --git a/chrome/locale/sv-SE/zotero/zotero.dtd b/chrome/locale/sv-SE/zotero/zotero.dtd index bb1947aee..f5f052ab9 100644 --- a/chrome/locale/sv-SE/zotero/zotero.dtd +++ b/chrome/locale/sv-SE/zotero/zotero.dtd @@ -165,7 +165,7 @@ - + diff --git a/chrome/locale/sv-SE/zotero/zotero.properties b/chrome/locale/sv-SE/zotero/zotero.properties index 5d944402b..0d99412da 100644 --- a/chrome/locale/sv-SE/zotero/zotero.properties +++ b/chrome/locale/sv-SE/zotero/zotero.properties @@ -55,7 +55,7 @@ general.numMore=%S ytterligare… general.openPreferences=Öppna inställningar general.keys.ctrlShift=Ctrl+Shift+ general.keys.cmdShift=Cmd+Shift+ -general.dontShowAgain=Don’t Show Again +general.dontShowAgain=Visa inte igen general.operationInProgress=Zotero arbetar just nu. general.operationInProgress.waitUntilFinished=Vänta till åtgärden är klar. @@ -678,22 +678,22 @@ citation.showEditor=Visa redigeraren... citation.hideEditor=Göm redigeraren... citation.citations=Citeringar citation.notes=Anteckningar -citation.locator.page=Page -citation.locator.book=Book -citation.locator.chapter=Chapter -citation.locator.column=Column -citation.locator.figure=Figure +citation.locator.page=Sida +citation.locator.book=Bok +citation.locator.chapter=Kapitel +citation.locator.column=Kolumn +citation.locator.figure=Figur citation.locator.folio=Folio -citation.locator.issue=Issue -citation.locator.line=Line -citation.locator.note=Note +citation.locator.issue=Nummer +citation.locator.line=Rad +citation.locator.note=Anteckning citation.locator.opus=Opus -citation.locator.paragraph=Paragraph -citation.locator.part=Part -citation.locator.section=Section +citation.locator.paragraph=Stycke +citation.locator.part=Del +citation.locator.section=Avsnitt citation.locator.subverbo=Sub verbo -citation.locator.volume=Volume -citation.locator.verse=Verse +citation.locator.volume=Volym +citation.locator.verse=Vers report.title.default=Zotero-rapport report.parentItem=Överordnad källa: @@ -963,7 +963,7 @@ file.accessError.message.windows=Kontrollera att filen inte används, att skrivb file.accessError.message.other=Kontrollera att filen inte används och att skrivbehörighet finns. file.accessError.restart=En omstart av datorn eller att säkerhetsprogramvaran avaktiveras kan hjälpa. file.accessError.showParentDir=Visa överordnad katalog -file.error.cannotAddShortcut=Shortcut files cannot be added directly. Please select the original file. +file.error.cannotAddShortcut=Genvägsfilar inte kan läggas till direkt. Välj den ursprungliga filen. lookup.failure.title=Kontrollen misslyckades lookup.failure.description=Zotero kunde inte hitta något som passade detta registreringsnummer. Kolla registreringsnummret och försök igen. @@ -1004,7 +1004,7 @@ firstRunGuidance.quickFormat=Skriv in en titel eller författare för att söka firstRunGuidance.quickFormatMac=Skriv in en titel eller författare för att söka bland referenserna.\n\nEfter att du har gjort ditt val, klicka i rutan eller tryck Ctrl-\u2193 för att lägga till sidnummer, prefix eller suffix. Du kan också lägga in ett sidnummer tillsammans med din sökning för att lägga till det direkt.\n\nDu kan redigera citeringen direkt i ordbehandlaren. firstRunGuidance.toolbarButton.new=Klicka här för att öppna Zotero, eller använd %S kortkommandot. firstRunGuidance.toolbarButton.upgrade=Zotero-ikonen ligger nu i Firefoxs verktygsrad. Klicka på ikonen för att öppna Zotero, eller använd %S kortkommandot. -firstRunGuidance.saveButton=Click this button to save any web page to your Zotero library. On some pages, Zotero will be able to save full details, including author and date. +firstRunGuidance.saveButton=Klicka på denna knapp för att spara en webbsida i ditt Zotero-bibliotek. För vissa sidor kan Zotero spara alla uppgifter, inklusive författare och datum. styles.bibliography=Källförteckning styles.editor.save=Spara referensstil diff --git a/chrome/locale/tr-TR/zotero/preferences.dtd b/chrome/locale/tr-TR/zotero/preferences.dtd index fcc406e96..b4509d9f0 100644 --- a/chrome/locale/tr-TR/zotero/preferences.dtd +++ b/chrome/locale/tr-TR/zotero/preferences.dtd @@ -107,7 +107,7 @@ - + @@ -145,7 +145,7 @@ - + diff --git a/chrome/locale/tr-TR/zotero/zotero.dtd b/chrome/locale/tr-TR/zotero/zotero.dtd index ab14cde75..e31a3ffbf 100644 --- a/chrome/locale/tr-TR/zotero/zotero.dtd +++ b/chrome/locale/tr-TR/zotero/zotero.dtd @@ -165,7 +165,7 @@ - + diff --git a/chrome/locale/tr-TR/zotero/zotero.properties b/chrome/locale/tr-TR/zotero/zotero.properties index 6ae6d30f1..7004d1bcf 100644 --- a/chrome/locale/tr-TR/zotero/zotero.properties +++ b/chrome/locale/tr-TR/zotero/zotero.properties @@ -55,7 +55,7 @@ general.numMore=%S tane daha... general.openPreferences=Tercihleri Aç general.keys.ctrlShift=Ctrl+Shift+ general.keys.cmdShift=Cmd+Shift+ -general.dontShowAgain=Don’t Show Again +general.dontShowAgain=Tekrar Gösterme general.operationInProgress=Zotero işlemi çalışıyor. general.operationInProgress.waitUntilFinished=Lütfen bitene kadar bekleyiniz. @@ -678,22 +678,22 @@ citation.showEditor=Editörü Göster... citation.hideEditor=Editörü Gizle... citation.citations=Alıntılar citation.notes=Notlar -citation.locator.page=Page -citation.locator.book=Book +citation.locator.page=Sayfa +citation.locator.book=Kitap citation.locator.chapter=Chapter -citation.locator.column=Column -citation.locator.figure=Figure +citation.locator.column=Sütun +citation.locator.figure=Şekil citation.locator.folio=Folio citation.locator.issue=Issue -citation.locator.line=Line -citation.locator.note=Note +citation.locator.line=Satır +citation.locator.note=Not citation.locator.opus=Opus -citation.locator.paragraph=Paragraph +citation.locator.paragraph=Parağraf citation.locator.part=Part citation.locator.section=Section -citation.locator.subverbo=Sub verbo -citation.locator.volume=Volume -citation.locator.verse=Verse +citation.locator.subverbo=Bakınız +citation.locator.volume=Cilt +citation.locator.verse=Ayet report.title.default=Zotero Rapor report.parentItem=Üst Eser: @@ -963,7 +963,7 @@ file.accessError.message.windows=Dosyanın şu anda kullanımda olmadığından, file.accessError.message.other=Dosyanın şu anda kullanımda olmadığından ve dosyanın yazma erişimine izin verdiğinden emin olunuz. file.accessError.restart=Bilgisayarınızı yeniden başlatmak ya da güvenlik yazılımınızı etkinsizleştirmek işe yarayabilir. file.accessError.showParentDir=Ana Dizini Göster -file.error.cannotAddShortcut=Shortcut files cannot be added directly. Please select the original file. +file.error.cannotAddShortcut=Kısayol dosyaları direkt olarak eklenemez. Lütfen asıl dosyayı seçiniz. lookup.failure.title=Bakma Başarısız lookup.failure.description=Belirtilen tanımlayıcı için Zotero bir kayıt bulamadı. Lütfen tanımlayıcıyı kontrol edin ve tekrar deneyin. @@ -1004,7 +1004,7 @@ firstRunGuidance.quickFormat=Bir kaynak aramak için bir başlık ya da yazar ad firstRunGuidance.quickFormatMac=Bir kaynak aramak için bir başlık ya da yazar adı yazınız.\n\nSeçiminizi yaptıktan sonra, sayfa numaraları, önekler ve sonekler eklemek için kabarcığa tıklayınız veya Cmd-\u2193'ya basınız. Ayrıca arama terimlerinize sayfa numarasını katarak, onları doğrudan ekleyebilirsiniz.\n\nGöndermelerinizi sözcük işlemcisi belgesinde doğrudan değiştirebilirsiniz. firstRunGuidance.toolbarButton.new=Zotero'yu başlatmak için buraya tıklayınız, ya da klavye kısayolu olan %S'i kullanınız. firstRunGuidance.toolbarButton.upgrade=Zotero simgesi, artık Firefox araç çubuğunda buulunabilir. Zotero'yu başlatmak için bu simgeye tıklayınız, ya da klavye kısayolu olan %S'i kullanınız. -firstRunGuidance.saveButton=Click this button to save any web page to your Zotero library. On some pages, Zotero will be able to save full details, including author and date. +firstRunGuidance.saveButton=Bu düğmeye basarak herhangi bir web sayfasını Zotero kitaplığınıza ekleyiniz. Zotero, bazı sayfalarda, yazar ve tarih dahil olmak üzere, tüm detayları kaydedebilecektir. styles.bibliography=Bibliyografya styles.editor.save=Kaynakça Biçimini Kaydet diff --git a/chrome/locale/uk-UA/zotero/preferences.dtd b/chrome/locale/uk-UA/zotero/preferences.dtd index d113fed4e..7d77026e7 100644 --- a/chrome/locale/uk-UA/zotero/preferences.dtd +++ b/chrome/locale/uk-UA/zotero/preferences.dtd @@ -107,7 +107,7 @@ - + @@ -145,7 +145,7 @@ - + diff --git a/chrome/locale/uk-UA/zotero/zotero.dtd b/chrome/locale/uk-UA/zotero/zotero.dtd index 3fa97615f..a3022fedc 100644 --- a/chrome/locale/uk-UA/zotero/zotero.dtd +++ b/chrome/locale/uk-UA/zotero/zotero.dtd @@ -165,7 +165,7 @@ - + diff --git a/chrome/locale/uk-UA/zotero/zotero.properties b/chrome/locale/uk-UA/zotero/zotero.properties index b19dfd530..e918e9366 100644 --- a/chrome/locale/uk-UA/zotero/zotero.properties +++ b/chrome/locale/uk-UA/zotero/zotero.properties @@ -55,7 +55,7 @@ general.numMore=%S детальніше… general.openPreferences=Відкрити налаштування general.keys.ctrlShift=Ctrl+Shift+ general.keys.cmdShift=Cmd+Shift+ -general.dontShowAgain=Don’t Show Again +general.dontShowAgain=Не показувати знову general.operationInProgress=Наразі Zotero виконує операцію. general.operationInProgress.waitUntilFinished=Будь ласка, почекайте, поки вона закінчиться. @@ -207,7 +207,7 @@ pane.items.delete=Ви впевнені, що бажаєте видалити в pane.items.delete.multiple=Ви впевнені, що бажаєте видалити вибрані документи? pane.items.remove.title=Видалити документи з колекції pane.items.remove=Ви впевнені, що бажаєте видалити вибрані документи з колекції? -pane.items.remove.multiple=Are you sure you want to remove the selected items from this collection? +pane.items.remove.multiple=Ви впевнені, що бажаєте видалити вибрані документи з цієї колекції? pane.items.menu.remove=Видалити документ з колекції pane.items.menu.remove.multiple=Видалити документи з колекції pane.items.menu.moveToTrash=Перемістити документ до Кошику... @@ -567,15 +567,15 @@ zotero.preferences.export.quickCopy.exportFormats=Формат експорту zotero.preferences.export.quickCopy.instructions=Швидке копіювання дозволяє вам копіювати вибрані посилання в буфер обміну, натиснув гарячу клавішу %S, або перетягуючи документи в текстове поле веб-сторінки. zotero.preferences.export.quickCopy.citationInstructions=Для стилів списку літератури ви можете копіювати цитати або виноски, натиснувши %S або утримуючи Shift при перетягуванні документів. -zotero.preferences.wordProcessors.installationSuccess=Installation was successful. -zotero.preferences.wordProcessors.installationError=Installation could not be completed because an error occurred. Please ensure that %1$S is closed, and then restart %2$S. -zotero.preferences.wordProcessors.installed=The %S add-in is currently installed. -zotero.preferences.wordProcessors.notInstalled=The %S add-in is not currently installed. -zotero.preferences.wordProcessors.install=Install %S Add-in -zotero.preferences.wordProcessors.reinstall=Reinstall %S Add-in -zotero.preferences.wordProcessors.installing=Installing %S… -zotero.preferences.wordProcessors.incompatibleVersions1=%1$S %2$S is incompatible with versions of %3$S before %4$S. Please remove %3$S, or download the latest version from %5$S. -zotero.preferences.wordProcessors.incompatibleVersions2=%1$S %2$S requires %3$S %4$S or later to run. Please download the latest version of %3$S from %5$S. +zotero.preferences.wordProcessors.installationSuccess=Встановлення було успішним +zotero.preferences.wordProcessors.installationError=Установка не може бути завершена через помилку. Будь ласка, переконайтеся, що %1$S закритий, а потім перезапустіть %2$S. +zotero.preferences.wordProcessors.installed=Розширення %S наразі встановлене. +zotero.preferences.wordProcessors.notInstalled=Розширення %S наразі не встановлене. +zotero.preferences.wordProcessors.install=Встановити розширення %S +zotero.preferences.wordProcessors.reinstall=Перевстановити розширення %S +zotero.preferences.wordProcessors.installing=Встановлення %S... +zotero.preferences.wordProcessors.incompatibleVersions1=%1$S %2$S несумісний з версіями %3$S до %4$S. Будь ласка, видаліть %3$S, або завантажити останню версію з %5$S. +zotero.preferences.wordProcessors.incompatibleVersions2=%1$S %2$S потрібно принаймні %3$S %4$S для запуску. Будь ласка, завантажте останню версію %3$S з %5$S. zotero.preferences.styles.addStyle=Додати стиль @@ -678,22 +678,22 @@ citation.showEditor=Показати редактор... citation.hideEditor=Сховати редактор... citation.citations=Цитати citation.notes=Примітки -citation.locator.page=Page -citation.locator.book=Book -citation.locator.chapter=Chapter -citation.locator.column=Column -citation.locator.figure=Figure -citation.locator.folio=Folio -citation.locator.issue=Issue -citation.locator.line=Line -citation.locator.note=Note -citation.locator.opus=Opus -citation.locator.paragraph=Paragraph -citation.locator.part=Part -citation.locator.section=Section -citation.locator.subverbo=Sub verbo -citation.locator.volume=Volume -citation.locator.verse=Verse +citation.locator.page=Сторінка +citation.locator.book=Книга +citation.locator.chapter=Глава +citation.locator.column=Колонка +citation.locator.figure=Рисунок +citation.locator.folio=Фоліо +citation.locator.issue=Випуск +citation.locator.line=Рядок +citation.locator.note=Примітка +citation.locator.opus=Опус +citation.locator.paragraph=Параграф +citation.locator.part=Частина +citation.locator.section=Розділ +citation.locator.subverbo=Тлумачення +citation.locator.volume=Том +citation.locator.verse=Вірш report.title.default=Звіт Zotero report.parentItem=Батьківський документ: @@ -787,8 +787,8 @@ sync.removeGroupsAndSync=Обнулити групи і синхронізува sync.localObject=Локальний об'єкт sync.remoteObject=Видалений об'єкт sync.mergedObject=Об'єднаний об'єкт -sync.merge.resolveAllLocal=Use the local version for all remaining conflicts -sync.merge.resolveAllRemote=Use the remote version for all remaining conflicts +sync.merge.resolveAllLocal=Використовуйте локальну версію для всіх інших конфліктів +sync.merge.resolveAllRemote=Використовуйте віддалену версію для всіх інших конфліктів sync.error.usernameNotSet=Ім'я користувача не встановлено @@ -963,7 +963,7 @@ file.accessError.message.windows=Переконайтеся, що файл не file.accessError.message.other=Переконайтеся, що файл не використовуються в даний час, і що права запису для файлу не заблоковані. file.accessError.restart=Перезавантаження комп'ютера або відключення антивірусного програмного забезпечення також може допомогти. file.accessError.showParentDir=Показати батьківську папку -file.error.cannotAddShortcut=Shortcut files cannot be added directly. Please select the original file. +file.error.cannotAddShortcut=Приєднані файли не можуть бути додані безпосередньо. Будь ласка, виберіть вихідний файл. lookup.failure.title=Пошук не вдався lookup.failure.description=Zotero не зміг знайти запис для вказаного ідентифікатора. Будь ласка, перевірте ідентифікатор та спробуйте знову. @@ -1004,7 +1004,7 @@ firstRunGuidance.quickFormat=Введіть назву або автора дл firstRunGuidance.quickFormatMac=Введіть назву або автора для пошуку посилання. \n\nПісля того як ви зробили свій вибір, натисніть виноску або натисніть Cmd-↓ щоб додати номери сторінок, префікси або суфікси. Ви можете також включити номер сторінки разом з умовами пошуку, щоб додати його безпосередньо. \n\nВи можете редагувати цитати прямо в документі текстового реактора. firstRunGuidance.toolbarButton.new=Натисніть тут, щоб відкрити Zotero або використайте комбінацію клавіш %S. firstRunGuidance.toolbarButton.upgrade=Значок Zotero тепер можна знайти на панелі інструментів Firefox. Клацніть по значку, щоб відкрити Zotero або використовуйте комбінацію клавіш %S. -firstRunGuidance.saveButton=Click this button to save any web page to your Zotero library. On some pages, Zotero will be able to save full details, including author and date. +firstRunGuidance.saveButton=Натисніть цю кнопку, щоб зберегти будь-яку веб-сторінку в бібліотеку Zotero. На деяких сторінках, Zotero зможете зберегти повну інформацію, в тому числі автора і дати. styles.bibliography=Список літератури styles.editor.save=Зберегти стиль цитування diff --git a/chrome/locale/zh-TW/zotero/preferences.dtd b/chrome/locale/zh-TW/zotero/preferences.dtd index ca18ad9c5..ecd3bf7fa 100644 --- a/chrome/locale/zh-TW/zotero/preferences.dtd +++ b/chrome/locale/zh-TW/zotero/preferences.dtd @@ -107,7 +107,7 @@ - + @@ -145,7 +145,7 @@ - + diff --git a/chrome/locale/zh-TW/zotero/zotero.dtd b/chrome/locale/zh-TW/zotero/zotero.dtd index c5ceb7018..faea99962 100644 --- a/chrome/locale/zh-TW/zotero/zotero.dtd +++ b/chrome/locale/zh-TW/zotero/zotero.dtd @@ -165,7 +165,7 @@ - + diff --git a/chrome/locale/zh-TW/zotero/zotero.properties b/chrome/locale/zh-TW/zotero/zotero.properties index d30267db9..2228fccd9 100644 --- a/chrome/locale/zh-TW/zotero/zotero.properties +++ b/chrome/locale/zh-TW/zotero/zotero.properties @@ -55,7 +55,7 @@ general.numMore=更多 %S… general.openPreferences=開啟偏好設定 general.keys.ctrlShift=Ctrl+Shift+ general.keys.cmdShift=Cmd+Shift+ -general.dontShowAgain=Don’t Show Again +general.dontShowAgain=不再顯示 general.operationInProgress=Zotero 進行操作中。 general.operationInProgress.waitUntilFinished=請稍候至完成。 @@ -678,22 +678,22 @@ citation.showEditor=顯示編輯器… citation.hideEditor=隱藏編輯器… citation.citations=引用文獻條 citation.notes=筆記 -citation.locator.page=Page -citation.locator.book=Book -citation.locator.chapter=Chapter -citation.locator.column=Column -citation.locator.figure=Figure -citation.locator.folio=Folio -citation.locator.issue=Issue -citation.locator.line=Line -citation.locator.note=Note -citation.locator.opus=Opus -citation.locator.paragraph=Paragraph -citation.locator.part=Part -citation.locator.section=Section -citation.locator.subverbo=Sub verbo -citation.locator.volume=Volume -citation.locator.verse=Verse +citation.locator.page=頁 +citation.locator.book=書籍 +citation.locator.chapter=章節 +citation.locator.column=直欄 +citation.locator.figure=圖片 +citation.locator.folio=對開 +citation.locator.issue=期號 +citation.locator.line=行 +citation.locator.note=筆記 +citation.locator.opus=作品 +citation.locator.paragraph=段落 +citation.locator.part=部份 +citation.locator.section=章節 +citation.locator.subverbo=詞條名 +citation.locator.volume=卷次 +citation.locator.verse=詩詞 report.title.default=Zotero 報告 report.parentItem=上層項目: @@ -963,7 +963,7 @@ file.accessError.message.windows=確認檔案不是正在使用,且有允許 file.accessError.message.other=確認檔案不是正在使用,且有允許寫入之權限。 file.accessError.restart=重新啟動電腦,或停用安全軟體也可能有用。 file.accessError.showParentDir=顯示上層目錄 -file.error.cannotAddShortcut=Shortcut files cannot be added directly. Please select the original file. +file.error.cannotAddShortcut=無法直接儲存捷徑檔案,請選擇原始檔案 lookup.failure.title=查詢失敗 lookup.failure.description=Zotero 找不到含指定識別碼的記錄。請確認識別碼後再試。 @@ -1004,7 +1004,7 @@ firstRunGuidance.quickFormat=輸入標題或作者以找出參考文獻條。\n\ firstRunGuidance.quickFormatMac=輸入標題或作者以找出參考文獻條。\n\n選擇後,按橢圓泡或按 Ctrl-↓ 以加入頁碼或前綴或後綴。可在待找字後加上頁碼,產生無前後綴的引用文獻條。\n\n也可在文書處理器直接編輯引用文獻條。 firstRunGuidance.toolbarButton.new=按此以開啟 Zotero,或用 %S 快鍵。 firstRunGuidance.toolbarButton.upgrade=Firefox 工具列上可看到 Zotero 圖示了。按圖示以開啟 Zotero,或用 %S 快鍵。 -firstRunGuidance.saveButton=Click this button to save any web page to your Zotero library. On some pages, Zotero will be able to save full details, including author and date. +firstRunGuidance.saveButton=點擊此鈕可儲存任何網頁至您的Zotero資料庫中,且於某些網頁中Zotero可以儲存所有包含作者及日期的內容 styles.bibliography=參考文獻表 styles.editor.save=儲存文獻之樣式: From 64ff0e8b4e3d742a129b56e5774eac41e7b4d819 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 29 Jun 2015 18:03:09 -0400 Subject: [PATCH 06/62] Fix #774 --- chrome/content/zotero/browser.js | 1 - 1 file changed, 1 deletion(-) diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 594bbfcfb..b0771f35c 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -807,7 +807,6 @@ Zotero_Browser.Tab.prototype.clear = function() { Zotero_Browser.Tab.prototype.detectTranslators = function(rootDoc, doc) { if (doc instanceof HTMLDocument) { if (doc.documentURI.startsWith("about:")) { - this.page.saveEnabled = false; return; } From b03dcd3686c54e90c145634068c1e04c8bd5e2b5 Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Mon, 29 Jun 2015 17:43:48 -0500 Subject: [PATCH 07/62] Fix properToProxy converter functions Regression from 82998e986e079b932b534f97385e96238aefb1be and 9450d0797f648453288b1b59d9daa692dcba7e8a --- chrome/content/zotero/xpcom/connector/translator.js | 2 +- chrome/content/zotero/xpcom/translation/translator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/connector/translator.js b/chrome/content/zotero/xpcom/connector/translator.js index 609788fbc..603af97b6 100644 --- a/chrome/content/zotero/xpcom/connector/translator.js +++ b/chrome/content/zotero/xpcom/connector/translator.js @@ -203,7 +203,7 @@ Zotero.Translators = new function() { } else { // in Firefox, push the converterFunction converterFunctions.push(new function() { - var re = new RegExp('^https?://(?:[^/]\\.)?'+Zotero.Utilities.quotemeta(properHosts[j-1])+'/', "gi"); + var re = new RegExp('^https?://(?:[^/]\\.)?'+Zotero.Utilities.quotemeta(properHosts[j-1])+'(?=/)', "gi"); var proxyHost = proxyHosts[j-1].replace(/\$/g, "$$$$"); return function(uri) { return uri.replace(re, "$&."+proxyHost) }; }); diff --git a/chrome/content/zotero/xpcom/translation/translator.js b/chrome/content/zotero/xpcom/translation/translator.js index c4277658f..e63334f1d 100644 --- a/chrome/content/zotero/xpcom/translation/translator.js +++ b/chrome/content/zotero/xpcom/translation/translator.js @@ -254,7 +254,7 @@ Zotero.Translators = new function() { } } else { converterFunctions.push(new function() { - var re = new RegExp('^https?://(?:[^/]+\\.)?'+Zotero.Utilities.quotemeta(properHosts[j-1]+'/'), "gi"); + var re = new RegExp('^https?://(?:[^/]+\\.)?'+Zotero.Utilities.quotemeta(properHosts[j-1])+'(?=/)', "gi"); var proxyHost = proxyHosts[j-1].replace(/\$/g, "$$$$"); return function(uri) { return uri.replace(re, "$&."+proxyHost) }; }); From 4233d2ebbdaa1832a67fd911c6aa351f011dc367 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 30 Jun 2015 00:12:57 -0400 Subject: [PATCH 08/62] Update translators and repotime --- resource/schema/repotime.txt | 2 +- translators | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/schema/repotime.txt b/resource/schema/repotime.txt index a127a3a95..9fc1022cc 100644 --- a/resource/schema/repotime.txt +++ b/resource/schema/repotime.txt @@ -1 +1 @@ -2015-06-25 14:05:00 +2015-06-29 17:25:00 diff --git a/translators b/translators index e12d185b3..c2d8db56d 160000 --- a/translators +++ b/translators @@ -1 +1 @@ -Subproject commit e12d185b3418188a3f1221b5f87c33a1720c073c +Subproject commit c2d8db56d6d227e9aeead3db6cb0dec8a1dbae32 From e3ab3ab03e01684ff793ed59c5d7a90799cada57 Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Fri, 5 Jun 2015 16:31:57 -0500 Subject: [PATCH 09/62] Add institutional author to sample test data --- test/content/support.js | 17 ++- test/tests/data/allTypesAndFields.js | 170 ++++++++++++++++++++++ test/tests/data/citeProcJSExport.js | 102 ++++++++----- test/tests/data/itemJSON.js | 136 +++++++++++++++++ test/tests/data/translatorExport.js | 136 +++++++++++++++++ test/tests/data/translatorExportLegacy.js | 170 ++++++++++++++++++++++ 6 files changed, 696 insertions(+), 35 deletions(-) diff --git a/test/content/support.js b/test/content/support.js index dcab615f7..2f3ebf714 100644 --- a/test/content/support.js +++ b/test/content/support.js @@ -293,6 +293,16 @@ function generateAllTypesAndFieldsData() { lastName: typeName + 'Last' }); } + + // Also add a single-field mode author, which is valid for all types + let primaryCreatorType = Zotero.CreatorTypes.getName( + Zotero.CreatorTypes.getPrimaryIDForType(itemTypes[i].id) + ); + creators.push({ + creatorType: primaryCreatorType, + lastName: 'Institutional Author', + fieldMode: 1 + }); } return data; @@ -315,8 +325,13 @@ function populateDBWithSampleData(data) { let creators = item[itemField]; for (let i=0; i Date: Fri, 5 Jun 2015 17:54:16 -0500 Subject: [PATCH 10/62] Fix institutional author export to CiteProcJS --- chrome/content/zotero/xpcom/utilities.js | 7 +- test/tests/data/citeProcJSExport.js | 136 +++++++++++++++++------ 2 files changed, 108 insertions(+), 35 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 7b2f89dcb..bde5fa0c9 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1553,7 +1553,12 @@ Zotero.Utilities = { creatorType = CSL_NAMES_MAPPINGS[creatorType]; if(!creatorType) continue; - var nameObj = {'family':creator.lastName, 'given':creator.firstName}; + var nameObj; + if (creator.lastName || creator.firstName) { + nameObj = {'family': creator.lastName, 'given': creator.firstName}; + } else if (creator.name) { + nameObj = {'literal': creator.name}; + } if(cslItem[creatorType]) { cslItem[creatorType].push(nameObj); diff --git a/test/tests/data/citeProcJSExport.js b/test/tests/data/citeProcJSExport.js index 59eea2c68..3678e9909 100644 --- a/test/tests/data/citeProcJSExport.js +++ b/test/tests/data/citeProcJSExport.js @@ -18,7 +18,9 @@ "family": "artistLast", "given": "artistFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "dimensions": "Artwork size", @@ -60,7 +62,9 @@ "family": "performerLast", "given": "performerFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-title": "Series title", @@ -111,7 +115,9 @@ "family": "sponsorLast", "given": "sponsorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "authority": "Legislative body", "chapter-number": "Session", @@ -154,7 +160,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "container-title": "Publication title", "genre": "Type", @@ -194,7 +202,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-editor": [ @@ -261,7 +271,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-editor": [ @@ -332,7 +344,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "authority": "Court", "container-title": "Reporter", @@ -376,7 +390,9 @@ "family": "programmerLast", "given": "programmerFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-title": "Series title", @@ -423,7 +439,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-editor": [ @@ -489,7 +507,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-editor": [ @@ -556,7 +576,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "editor": [ @@ -612,7 +634,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "id": 48, "issued": { @@ -656,7 +680,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-editor": [ @@ -723,7 +749,9 @@ "family": "directorLast", "given": "directorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "dimensions": "1:22:33", @@ -764,7 +792,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "container-title": "Publication title", "genre": "Type", @@ -801,7 +831,9 @@ "family": "contributorLast", "given": "contributorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "authority": "Legislative body", "chapter-number": "Session", @@ -846,7 +878,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "id": 53, "issued": { @@ -889,7 +923,9 @@ "family": "intervieweeLast", "given": "intervieweeFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "id": 54, @@ -943,7 +979,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-title": "Series title", @@ -1006,7 +1044,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "genre": "Type", @@ -1053,7 +1093,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "container-title": "Publication title", @@ -1108,7 +1150,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "event-place": "Place", @@ -1158,7 +1202,9 @@ "family": "cartographerLast", "given": "cartographerFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-editor": [ @@ -1211,7 +1257,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "container-title": "Publication title", @@ -1266,7 +1314,9 @@ "family": "inventorLast", "given": "inventorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "authority": "Issuing authority", "call-number": "Application number", @@ -1320,7 +1370,9 @@ "family": "podcasterLast", "given": "podcasterFirst" }, - {} + { + "literal": "Institutional Author" + } ], "collection-title": "Series title", "dimensions": "1:22:33", @@ -1350,7 +1402,9 @@ "family": "presenterLast", "given": "presenterFirst" }, - {} + { + "literal": "Institutional Author" + } ], "event": "Meeting name", "event-place": "Place", @@ -1391,7 +1445,9 @@ "family": "directorLast", "given": "directorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "container-title": "Publication title", @@ -1437,7 +1493,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-editor": [ @@ -1493,7 +1551,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "chapter-number": "Session", "container-title": "Code", @@ -1537,7 +1597,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "event-place": "Place", @@ -1581,7 +1643,9 @@ "family": "directorLast", "given": "directorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "container-title": "Publication title", @@ -1628,7 +1692,9 @@ "family": "directorLast", "given": "directorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "call-number": "Call number", "collection-title": "Series title", @@ -1673,7 +1739,9 @@ "family": "authorLast", "given": "authorFirst" }, - {} + { + "literal": "Institutional Author" + } ], "container-title": "Publication title", "genre": "Type", From 6841be09a1a54cfedc85b948f56784ac2c74501f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 30 Jun 2015 16:54:59 -0400 Subject: [PATCH 11/62] Fix large save icon on HiDPI Windows, hopefully --- .../content/zotero-platform/win/overlay.css | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/chrome/content/zotero-platform/win/overlay.css b/chrome/content/zotero-platform/win/overlay.css index d2ba621cb..b688743a3 100644 --- a/chrome/content/zotero-platform/win/overlay.css +++ b/chrome/content/zotero-platform/win/overlay.css @@ -1,22 +1,27 @@ /* As of Fx36, the built-in styles don't properly handle a menu-button within combined buttons. */ -#zotero-toolbar-main-button-single[cui-areatype="toolbar"] .toolbarbutton-icon { +#zotero-toolbar-main-button-single[cui-areatype="toolbar"]:not([overflowedItem=true]) .toolbarbutton-icon { width: 32px; } -#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { width: 28px; } -#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { +#zotero-toolbar-save-button-single[cui-areatype="toolbar"]:not([overflowedItem=true]) .toolbarbutton-icon, +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { + height: 24px; +} + +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-main-button .toolbarbutton-icon { margin-left: 2px; margin-right: -1px; padding-left: 5px !important; padding-right: 5px !important; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-save-button .toolbarbutton-icon { padding-left: 6px !important; padding-right: 6px !important; } @@ -108,8 +113,11 @@ } /* Alterations for overflow panel */ -#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon { - width: 16px; +#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon, +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon, +#zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-icon, +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon { + height: 16px; } #zotero-toolbar-buttons[overflowedItem=true] { @@ -120,12 +128,8 @@ padding-left: 0; } -#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon { - width: 26px; -} - #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon { - margin-left: 1px; + margin-left: 6px; padding-right: 0 !important; } /* End toolbar buttons */ From 796fb87a9b730f4a41b9273c2219d0a29d12b88f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 30 Jun 2015 17:58:32 -0400 Subject: [PATCH 12/62] Fix some toolbar icon issues on HiDPI Linux --- .../content/zotero-platform/unix/overlay.css | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero-platform/unix/overlay.css b/chrome/content/zotero-platform/unix/overlay.css index c19a6fb01..90f546e91 100644 --- a/chrome/content/zotero-platform/unix/overlay.css +++ b/chrome/content/zotero-platform/unix/overlay.css @@ -11,7 +11,7 @@ width: 28px; } -#zotero-toolbar-main-button[cui-areatype="toolbar"] { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-main-button { margin-right: -1px; } @@ -46,7 +46,7 @@ margin-bottom: 0; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker .dropmarker-icon { +#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker .dropmarker-icon { padding-left: 14px !important; padding-right: 3px !important; } @@ -105,10 +105,12 @@ #zotero-toolbar-buttons[overflowedItem=true] { margin-left: 0px !important; margin-bottom: 0px !important; + margin-right: 0 !important; } #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { padding-left: 0; + padding-right: 5px; } #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon { @@ -120,6 +122,20 @@ padding-right: 0 !important; width: 22px !important; } + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-menubutton-button { + margin-left: 0; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-menubutton-dropmarker { + margin: 0; + margin-right: 2px !important; + padding-right: 5px; +} + +#zotero-toolbar-buttons[overflowedItem=true] > separator { + display: none; +} /* End toolbar buttons */ From 43e1c5c123fa9a2303d51c20bebe8ff8b1327c3e Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 30 Jun 2015 19:19:57 -0400 Subject: [PATCH 13/62] Fix setCookiesThenSaveItems in Firefox connector --- chrome/content/zotero/xpcom/connector/connector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/connector/connector.js b/chrome/content/zotero/xpcom/connector/connector.js index 0ea7301e6..d412047ab 100644 --- a/chrome/content/zotero/xpcom/connector/connector.js +++ b/chrome/content/zotero/xpcom/connector/connector.js @@ -222,7 +222,7 @@ Zotero.Connector = new function() { */ this.setCookiesThenSaveItems = function(data, callback, tab) { if(Zotero.isFx && !Zotero.isBookmarklet && data.uri) { - var host = Services.ios.newURI(data.uri, null, null).host; + var host = Services.io.newURI(data.uri, null, null).host; var cookieEnum = Services.cookies.getCookiesFromHost(host); var cookieHeader = ''; while(cookieEnum.hasMoreElements()) { From 39f20215766712bb21c7cc0341f1813ceef077cc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 30 Jun 2015 23:30:30 -0400 Subject: [PATCH 14/62] Include web page save option in toolbar menu on every page Closes #644 and #775 --- chrome/content/zotero/browser.js | 96 ++++++++++---------- chrome/locale/en-US/zotero/zotero.properties | 2 + 2 files changed, 51 insertions(+), 47 deletions(-) diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index b0771f35c..4f3d48281 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -150,8 +150,10 @@ var Zotero_Browser = new function() { } /** - * Scrapes a page (called when the capture icon is clicked - * @return void + * Saves from current page using translator (called when the capture icon is clicked) + * + * @param {String} [translator] + * @param {Event} [event] */ this.scrapeThisPage = function (translator, event) { // Perform translation @@ -161,19 +163,21 @@ var Zotero_Browser = new function() { Zotero_Browser.performTranslation(tab.page.translate); } else { - // Keep in sync with cmd_zotero_newItemFromCurrentPage - // - // DEBUG: Possible to just trigger command directly with event? Assigning it to the - // command property of the icon doesn't seem to work, and neither does goDoCommand() - // from chrome://global/content/globalOverlay.js. Getting the command by id and - // running doCommand() works but doesn't pass the event. - ZoteroPane.addItemFromPage( - 'temporaryPDFHack', + this.saveAsWebPage( (event && event.shiftKey) ? !Zotero.Prefs.get('automaticSnapshots') : null ); } } + // Keep in sync with cmd_zotero_newItemFromCurrentPage + this.saveAsWebPage = function (includeSnapshots) { + // DEBUG: Possible to just trigger command directly with event? Assigning it to the + // command property of the icon doesn't seem to work, and neither does goDoCommand() + // from chrome://global/content/globalOverlay.js. Getting the command by id and + // running doCommand() works but doesn't pass the event. + ZoteroPane.addItemFromPage('temporaryPDFHack', includeSnapshots); + } + /* * flags a page for annotation */ @@ -495,8 +499,8 @@ var Zotero_Browser = new function() { while(popup.hasChildNodes()) popup.removeChild(popup.lastChild); var tab = _getTabObject(this.tabbrowser.selectedBrowser); - - if (tab.getCaptureState() == tab.CAPTURE_STATE_TRANSLATABLE) { + var captureState = tab.getCaptureState(); + if (captureState == tab.CAPTURE_STATE_TRANSLATABLE) { let translators = tab.page.translators; for (var i=0, n = translators.length; i < n; i++) { let translator = translators[i]; @@ -514,7 +518,30 @@ var Zotero_Browser = new function() { }, false); popup.appendChild(menuitem); } - + } + + let webPageIcon = tab.getWebPageCaptureIcon(Zotero.hiDPI); + let menuitem = document.createElement("menuitem"); + menuitem.setAttribute("label", Zotero.getString('ingester.saveToZoteroAsWebPageWithSnapshot')); + menuitem.setAttribute("image", webPageIcon); + menuitem.setAttribute("class", "menuitem-iconic"); + menuitem.addEventListener("command", function (event) { + Zotero_Browser.saveAsWebPage(true); + event.stopPropagation(); + }); + popup.appendChild(menuitem); + + menuitem = document.createElement("menuitem"); + menuitem.setAttribute("label", Zotero.getString('ingester.saveToZoteroAsWebPageWithoutSnapshot')); + menuitem.setAttribute("image", webPageIcon); + menuitem.setAttribute("class", "menuitem-iconic"); + menuitem.addEventListener("command", function (event) { + Zotero_Browser.saveAsWebPage(false); + event.stopPropagation(); + }); + popup.appendChild(menuitem); + + if (captureState == tab.CAPTURE_STATE_TRANSLATABLE) { popup.appendChild(document.createElement("menuseparator")); let menuitem = document.createElement("menuitem"); @@ -535,38 +562,8 @@ var Zotero_Browser = new function() { var locateEngines = Zotero.LocateManager.getVisibleEngines(); Zotero_LocateMenu.addLocateEngines(popup, locateEngines, _constructLookupFunction(tab, function(e, obj) { - Zotero_LocateMenu.locateItem(e, obj.newItems); - }), true); - } - else { - let webPageIcon = tab.getCaptureIcon(Zotero.hiDPI); - let automaticSnapshots = Zotero.Prefs.get('automaticSnapshots'); - let snapshotEvent = { - shiftKey: !automaticSnapshots - }; - let noSnapshotEvent = { - shiftKey: automaticSnapshots - }; - - let menuitem = document.createElement("menuitem"); - menuitem.setAttribute("label", "Save to Zotero as Web Page (with snapshot)"); - menuitem.setAttribute("image", webPageIcon); - menuitem.setAttribute("class", "menuitem-iconic"); - menuitem.addEventListener("command", function (event) { - Zotero_Browser.scrapeThisPage(null, snapshotEvent); - event.stopPropagation(); - }); - popup.appendChild(menuitem); - - menuitem = document.createElement("menuitem"); - menuitem.setAttribute("label", "Save to Zotero as Web Page (without snapshot)"); - menuitem.setAttribute("image", webPageIcon); - menuitem.setAttribute("class", "menuitem-iconic"); - menuitem.addEventListener("command", function (event) { - Zotero_Browser.scrapeThisPage(null, noSnapshotEvent); - event.stopPropagation(); - }); - popup.appendChild(menuitem); + Zotero_LocateMenu.locateItem(e, obj.newItems); + }), true); } } @@ -902,12 +899,17 @@ Zotero_Browser.Tab.prototype.getCaptureIcon = function (hiDPI) { ? "chrome://zotero/skin/treesource-collection" + suffix + ".png" : Zotero.ItemTypes.getImageSrc(itemType)); - // TODO: Show icons for images, PDFs, etc.? default: - return "chrome://zotero/skin/treeitem-webpage" + suffix + ".png"; + return this.getWebPageCaptureIcon(hiDPI); } } +// TODO: Show icons for images, PDFs, etc.? +Zotero_Browser.Tab.prototype.getWebPageCaptureIcon = function (hiDPI) { + var suffix = hiDPI ? "@2x" : ""; + return "chrome://zotero/skin/treeitem-webpage" + suffix + ".png"; +} + Zotero_Browser.Tab.prototype.getCaptureTooltip = function() { switch (this.getCaptureState()) { case this.CAPTURE_STATE_DISABLED: diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index defa75cbc..ba3353075 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection = You cannot add files to the currently se ingester.saveToZotero = Save to Zotero ingester.saveToZoteroUsing = Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot = Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot = Save to Zotero as Web Page (without snapshot) ingester.scraping = Saving Item… ingester.scrapingTo = Saving to ingester.scrapeComplete = Item Saved From 3cf1c3ccda5d9da70d5e7a2210c617260998158c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 30 Jun 2015 23:39:18 -0400 Subject: [PATCH 15/62] Merge locales from Transifex --- chrome/locale/af-ZA/zotero/zotero.properties | 2 ++ chrome/locale/ar/zotero/zotero.properties | 2 ++ chrome/locale/bg-BG/zotero/zotero.properties | 2 ++ chrome/locale/ca-AD/zotero/zotero.properties | 2 ++ chrome/locale/cs-CZ/zotero/zotero.properties | 2 ++ chrome/locale/da-DK/zotero/zotero.properties | 2 ++ chrome/locale/de/zotero/zotero.properties | 2 ++ chrome/locale/el-GR/zotero/zotero.properties | 2 ++ chrome/locale/es-ES/zotero/zotero.properties | 2 ++ chrome/locale/et-EE/zotero/zotero.properties | 2 ++ chrome/locale/eu-ES/zotero/zotero.properties | 2 ++ chrome/locale/fa/zotero/zotero.properties | 2 ++ chrome/locale/fi-FI/zotero/zotero.properties | 2 ++ chrome/locale/fr-FR/zotero/zotero.properties | 2 ++ chrome/locale/gl-ES/zotero/zotero.properties | 2 ++ chrome/locale/he-IL/zotero/zotero.properties | 2 ++ chrome/locale/hr-HR/zotero/zotero.properties | 2 ++ chrome/locale/hu-HU/zotero/zotero.properties | 2 ++ chrome/locale/id-ID/zotero/zotero.properties | 2 ++ chrome/locale/is-IS/zotero/zotero.properties | 2 ++ chrome/locale/it-IT/zotero/zotero.properties | 2 ++ chrome/locale/ja-JP/zotero/zotero.properties | 2 ++ chrome/locale/km/zotero/zotero.properties | 2 ++ chrome/locale/ko-KR/zotero/zotero.properties | 2 ++ chrome/locale/lt-LT/zotero/zotero.properties | 2 ++ chrome/locale/mn-MN/zotero/zotero.properties | 2 ++ chrome/locale/nb-NO/zotero/zotero.properties | 2 ++ chrome/locale/nl-NL/zotero/zotero.properties | 2 ++ chrome/locale/nn-NO/zotero/zotero.properties | 2 ++ chrome/locale/pl-PL/zotero/zotero.properties | 2 ++ chrome/locale/pt-BR/zotero/zotero.properties | 2 ++ chrome/locale/pt-PT/zotero/zotero.properties | 2 ++ chrome/locale/ro-RO/zotero/zotero.properties | 2 ++ chrome/locale/ru-RU/zotero/zotero.properties | 2 ++ chrome/locale/sk-SK/zotero/zotero.properties | 2 ++ chrome/locale/sl-SI/zotero/zotero.properties | 2 ++ chrome/locale/sr-RS/zotero/zotero.properties | 2 ++ chrome/locale/sv-SE/zotero/zotero.properties | 2 ++ chrome/locale/th-TH/zotero/zotero.properties | 2 ++ chrome/locale/tr-TR/zotero/zotero.properties | 14 ++++++++------ chrome/locale/uk-UA/zotero/zotero.properties | 2 ++ chrome/locale/vi-VN/zotero/zotero.properties | 2 ++ chrome/locale/zh-CN/zotero/zotero.properties | 2 ++ chrome/locale/zh-TW/zotero/zotero.properties | 2 ++ 44 files changed, 94 insertions(+), 6 deletions(-) diff --git a/chrome/locale/af-ZA/zotero/zotero.properties b/chrome/locale/af-ZA/zotero/zotero.properties index 618e9b1b3..c41af1cf0 100644 --- a/chrome/locale/af-ZA/zotero/zotero.properties +++ b/chrome/locale/af-ZA/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Save to Zotero ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Saving Item... ingester.scrapingTo=Saving to ingester.scrapeComplete=Item Saved diff --git a/chrome/locale/ar/zotero/zotero.properties b/chrome/locale/ar/zotero/zotero.properties index 3dfcbda45..fcb2d56d2 100644 --- a/chrome/locale/ar/zotero/zotero.properties +++ b/chrome/locale/ar/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=لا يمكن اضافة ملفات لمج ingester.saveToZotero=حفظ في زوتيرو ingester.saveToZoteroUsing=احفظ في زتوروه باستخدام تحت اسم "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=حفظ العنصر... ingester.scrapingTo=Saving to ingester.scrapeComplete=تم حفظ العنصر diff --git a/chrome/locale/bg-BG/zotero/zotero.properties b/chrome/locale/bg-BG/zotero/zotero.properties index 3de520307..821089520 100644 --- a/chrome/locale/bg-BG/zotero/zotero.properties +++ b/chrome/locale/bg-BG/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Съхранява в Зотеро ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Съхранява записа... ingester.scrapingTo=Saving to ingester.scrapeComplete=Записа е съхранен. diff --git a/chrome/locale/ca-AD/zotero/zotero.properties b/chrome/locale/ca-AD/zotero/zotero.properties index 15e233ef1..cb531b6aa 100644 --- a/chrome/locale/ca-AD/zotero/zotero.properties +++ b/chrome/locale/ca-AD/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=No podeu afegir fitxers a la col·lecció ingester.saveToZotero=Desa al Zotero ingester.saveToZoteroUsing=Desa al Zotero amb "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Desant l'element... ingester.scrapingTo=Desa a ingester.scrapeComplete=Element desat. diff --git a/chrome/locale/cs-CZ/zotero/zotero.properties b/chrome/locale/cs-CZ/zotero/zotero.properties index a58f2f780..236a6ee26 100644 --- a/chrome/locale/cs-CZ/zotero/zotero.properties +++ b/chrome/locale/cs-CZ/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Do aktuálně vybrané kolekce nemůžete ingester.saveToZotero=Uložit do Zotera ingester.saveToZoteroUsing=Uložit do Zotera pomocí "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Ukládá se položka... ingester.scrapingTo=Ukládám do ingester.scrapeComplete=Položka uložena diff --git a/chrome/locale/da-DK/zotero/zotero.properties b/chrome/locale/da-DK/zotero/zotero.properties index 944e2230a..8246e10f9 100644 --- a/chrome/locale/da-DK/zotero/zotero.properties +++ b/chrome/locale/da-DK/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Du kan ikke tilføje filer til den valgte ingester.saveToZotero=Gem i Zotoro ingester.saveToZoteroUsing=Gem i Zotero med brug af "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Gemmer element... ingester.scrapingTo=Gemmer i ingester.scrapeComplete=Elementet er gemt diff --git a/chrome/locale/de/zotero/zotero.properties b/chrome/locale/de/zotero/zotero.properties index fdb68c535..c725faab6 100644 --- a/chrome/locale/de/zotero/zotero.properties +++ b/chrome/locale/de/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Sie können keine Dateien zur im Moment au ingester.saveToZotero=In Zotero speichern ingester.saveToZoteroUsing=In Zotero mit "%S" speichern +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Speichere Eintrag... ingester.scrapingTo=Speichern nach ingester.scrapeComplete=Eintrag gespeichert. diff --git a/chrome/locale/el-GR/zotero/zotero.properties b/chrome/locale/el-GR/zotero/zotero.properties index c08125624..69ec58a95 100644 --- a/chrome/locale/el-GR/zotero/zotero.properties +++ b/chrome/locale/el-GR/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Save to Zotero ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Saving Item... ingester.scrapingTo=Saving to ingester.scrapeComplete=Item Saved diff --git a/chrome/locale/es-ES/zotero/zotero.properties b/chrome/locale/es-ES/zotero/zotero.properties index 893e0021e..60e5e4fe9 100644 --- a/chrome/locale/es-ES/zotero/zotero.properties +++ b/chrome/locale/es-ES/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=No puedes agregar archivos a la actual col ingester.saveToZotero=Guardar en Zotero ingester.saveToZoteroUsing=Guardar en Zotero usando "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Guardando ítem... ingester.scrapingTo=Guardando en ingester.scrapeComplete=Ítem guardado diff --git a/chrome/locale/et-EE/zotero/zotero.properties b/chrome/locale/et-EE/zotero/zotero.properties index 8075ce62b..8aa794ca0 100644 --- a/chrome/locale/et-EE/zotero/zotero.properties +++ b/chrome/locale/et-EE/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Valitud teemasse ei ole võimalik kirjeid ingester.saveToZotero=Salvestada Zoterosse ingester.saveToZoteroUsing=Salvestada Zoterosse kasutades "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Kirje salvestamine... ingester.scrapingTo=Saving to ingester.scrapeComplete=Kirje salvestatud diff --git a/chrome/locale/eu-ES/zotero/zotero.properties b/chrome/locale/eu-ES/zotero/zotero.properties index f60c4ad7f..436ae1b4c 100644 --- a/chrome/locale/eu-ES/zotero/zotero.properties +++ b/chrome/locale/eu-ES/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Zotero-n gorde ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Itema gordetzen ari... ingester.scrapingTo=Saving to ingester.scrapeComplete=Itema gorde egin da. diff --git a/chrome/locale/fa/zotero/zotero.properties b/chrome/locale/fa/zotero/zotero.properties index 57c5d5f46..75476bf6a 100644 --- a/chrome/locale/fa/zotero/zotero.properties +++ b/chrome/locale/fa/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=شما نمی‌توانید به مجمو ingester.saveToZotero=ذخیره در زوترو ingester.saveToZoteroUsing=ذخیره در زوترور از طریق "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=در حال ذخیره... ingester.scrapingTo=Saving to ingester.scrapeComplete=ذخیره شد diff --git a/chrome/locale/fi-FI/zotero/zotero.properties b/chrome/locale/fi-FI/zotero/zotero.properties index eb2e0c62f..baa21ec53 100644 --- a/chrome/locale/fi-FI/zotero/zotero.properties +++ b/chrome/locale/fi-FI/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Et voi lisätä tiedostoja valittuun kokoe ingester.saveToZotero=Tallenna Zoteroon ingester.saveToZoteroUsing=Tallentaan Zoteroon käyttäen "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Saving Item... ingester.scrapingTo=Tallennuskohde: ingester.scrapeComplete=Nimike tallennettu diff --git a/chrome/locale/fr-FR/zotero/zotero.properties b/chrome/locale/fr-FR/zotero/zotero.properties index 17507bdce..5f20999a4 100644 --- a/chrome/locale/fr-FR/zotero/zotero.properties +++ b/chrome/locale/fr-FR/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Vous ne pouvez pas ajouter des fichiers à ingester.saveToZotero=Enregistrer dans Zotero ingester.saveToZoteroUsing=Enregistrer dans Zotero en utilisant "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Enregistrement du document en cours… ingester.scrapingTo=Enregistrer dans ingester.scrapeComplete=Document enregistré diff --git a/chrome/locale/gl-ES/zotero/zotero.properties b/chrome/locale/gl-ES/zotero/zotero.properties index 61da995e2..19736693b 100644 --- a/chrome/locale/gl-ES/zotero/zotero.properties +++ b/chrome/locale/gl-ES/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Non pode engadir ficheiros á colección q ingester.saveToZotero=Gardar en Zotero ingester.saveToZoteroUsing=Gardar en Zotero empregando «%S» +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Gardando o elemento... ingester.scrapingTo=Gardando en ingester.scrapeComplete=Gardouse o elemento diff --git a/chrome/locale/he-IL/zotero/zotero.properties b/chrome/locale/he-IL/zotero/zotero.properties index f691c64d5..1929e6670 100644 --- a/chrome/locale/he-IL/zotero/zotero.properties +++ b/chrome/locale/he-IL/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Save to Zotero ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Saving Item... ingester.scrapingTo=Saving to ingester.scrapeComplete=פריט נשמר. diff --git a/chrome/locale/hr-HR/zotero/zotero.properties b/chrome/locale/hr-HR/zotero/zotero.properties index 618e9b1b3..c41af1cf0 100644 --- a/chrome/locale/hr-HR/zotero/zotero.properties +++ b/chrome/locale/hr-HR/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Save to Zotero ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Saving Item... ingester.scrapingTo=Saving to ingester.scrapeComplete=Item Saved diff --git a/chrome/locale/hu-HU/zotero/zotero.properties b/chrome/locale/hu-HU/zotero/zotero.properties index c3f2ca9d5..855707d6e 100644 --- a/chrome/locale/hu-HU/zotero/zotero.properties +++ b/chrome/locale/hu-HU/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Nem adhat hozzá fájlokat a jelenleg kiv ingester.saveToZotero=Mentés a Zoteroba ingester.saveToZoteroUsing=Mentés Zotero-ba "%S" használatával +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Elem mentése... ingester.scrapingTo=Mentés ingester.scrapeComplete=Elem elmentve. diff --git a/chrome/locale/id-ID/zotero/zotero.properties b/chrome/locale/id-ID/zotero/zotero.properties index 441d0526b..a3e512785 100644 --- a/chrome/locale/id-ID/zotero/zotero.properties +++ b/chrome/locale/id-ID/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Anda tidak dapat menambahkan berkas ke dal ingester.saveToZotero=Menyimpan ke Zotero ingester.saveToZoteroUsing=Menyimpan ke Zotero menggunakan "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Menyimpan Item ingester.scrapingTo=Saving to ingester.scrapeComplete=Item Tersimpan diff --git a/chrome/locale/is-IS/zotero/zotero.properties b/chrome/locale/is-IS/zotero/zotero.properties index 5fbd874fa..8ad5b1d77 100644 --- a/chrome/locale/is-IS/zotero/zotero.properties +++ b/chrome/locale/is-IS/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Þú getur ekki bætt skrám við safnið ingester.saveToZotero=Vista í Zotero ingester.saveToZoteroUsing=Vista í Zotero með "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Vista færslu... ingester.scrapingTo=Vista á ingester.scrapeComplete=Færsla vistuð diff --git a/chrome/locale/it-IT/zotero/zotero.properties b/chrome/locale/it-IT/zotero/zotero.properties index 92690dfa5..21ab3fb49 100644 --- a/chrome/locale/it-IT/zotero/zotero.properties +++ b/chrome/locale/it-IT/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Non è possibile aggiungere file alla coll ingester.saveToZotero=Salva in Zotero ingester.saveToZoteroUsing=Salva in Zotero utilizzando "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Salvataggio elemento in corso... ingester.scrapingTo=Saving to ingester.scrapeComplete=Elemento salvato diff --git a/chrome/locale/ja-JP/zotero/zotero.properties b/chrome/locale/ja-JP/zotero/zotero.properties index 143ff7245..de4e9b197 100644 --- a/chrome/locale/ja-JP/zotero/zotero.properties +++ b/chrome/locale/ja-JP/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=現在選択中のコレクションへは ingester.saveToZotero=Zotero に保存 ingester.saveToZoteroUsing="%S"を使って Zotero に保存する +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=アイテムを保存しています... ingester.scrapingTo=保存先 ingester.scrapeComplete=アイテムを保存しました diff --git a/chrome/locale/km/zotero/zotero.properties b/chrome/locale/km/zotero/zotero.properties index 56f92f05b..7abe4026a 100644 --- a/chrome/locale/km/zotero/zotero.properties +++ b/chrome/locale/km/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=អ្នកមិនអាចបន្ថ ingester.saveToZotero=ទាញឯកសាររក្សាទុកក្នុងហ្ស៊ូតេរ៉ូ ingester.saveToZoteroUsing=ទាញឯកសាររក្សាទុកក្នុងហ្ស៊ូតេរ៉ូតាមរយៈ "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=កំពុងទាញឯកសាររក្សាទុក... ingester.scrapingTo=កំពុងរក្សាទុកទៅកាន់ ingester.scrapeComplete=ឯកសារត្រូវបានទាញរក្សាទុក diff --git a/chrome/locale/ko-KR/zotero/zotero.properties b/chrome/locale/ko-KR/zotero/zotero.properties index cbc7ef4a9..1ae4dd435 100644 --- a/chrome/locale/ko-KR/zotero/zotero.properties +++ b/chrome/locale/ko-KR/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=현재 선택된 컬렉션에 파일을 ingester.saveToZotero=Zotero로 저장 ingester.saveToZoteroUsing="%S"를 사용하여 Zotero로 저장 +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=항목 저장... ingester.scrapingTo=Saving to ingester.scrapeComplete=항목 저장됨. diff --git a/chrome/locale/lt-LT/zotero/zotero.properties b/chrome/locale/lt-LT/zotero/zotero.properties index d11f11051..0b7d8983c 100644 --- a/chrome/locale/lt-LT/zotero/zotero.properties +++ b/chrome/locale/lt-LT/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Prie dabar pasirinkto rinkinio negalite pr ingester.saveToZotero=Įrašyti į Zotero ingester.saveToZoteroUsing=Įrašyti į Zotero naudojant „%S“ +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Įrašomas elementas... ingester.scrapingTo=Įrašyti į ingester.scrapeComplete=Elementas įrašytas diff --git a/chrome/locale/mn-MN/zotero/zotero.properties b/chrome/locale/mn-MN/zotero/zotero.properties index a3b528754..a41fb542c 100644 --- a/chrome/locale/mn-MN/zotero/zotero.properties +++ b/chrome/locale/mn-MN/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Save to Zotero ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Бүтээлийг хадгалж... ingester.scrapingTo=Saving to ingester.scrapeComplete=бүтээл хадгалсан diff --git a/chrome/locale/nb-NO/zotero/zotero.properties b/chrome/locale/nb-NO/zotero/zotero.properties index 3390634d6..12d0e0431 100644 --- a/chrome/locale/nb-NO/zotero/zotero.properties +++ b/chrome/locale/nb-NO/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Lagre i Zotero ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Lagrer element... ingester.scrapingTo=Saving to ingester.scrapeComplete=Element lagret. diff --git a/chrome/locale/nl-NL/zotero/zotero.properties b/chrome/locale/nl-NL/zotero/zotero.properties index b6d257b88..d4c5d5ff3 100644 --- a/chrome/locale/nl-NL/zotero/zotero.properties +++ b/chrome/locale/nl-NL/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=U kunt geen bestanden toevoegen aan de nu ingester.saveToZotero=In Zotero opslaan ingester.saveToZoteroUsing=In Zotero opslaan met "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Item wordt opgeslagen… ingester.scrapingTo=Sla op naar ingester.scrapeComplete=Item is opgeslagen diff --git a/chrome/locale/nn-NO/zotero/zotero.properties b/chrome/locale/nn-NO/zotero/zotero.properties index 241802e46..23cdb7ee7 100644 --- a/chrome/locale/nn-NO/zotero/zotero.properties +++ b/chrome/locale/nn-NO/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Lagre i Zotero ingester.saveToZoteroUsing=Lagrar til Zotero med «%S» +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Lagrar element … ingester.scrapingTo=Saving to ingester.scrapeComplete=Element lagra. diff --git a/chrome/locale/pl-PL/zotero/zotero.properties b/chrome/locale/pl-PL/zotero/zotero.properties index 8baf89f6d..98e994fb8 100644 --- a/chrome/locale/pl-PL/zotero/zotero.properties +++ b/chrome/locale/pl-PL/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Nie możesz dodać plików do aktualnie wy ingester.saveToZotero=Zapisz w Zotero ingester.saveToZoteroUsing=Zapisz w Zotero używając "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Zapisywanie elementu... ingester.scrapingTo=Zapisywanie do ingester.scrapeComplete=Element zapisano. diff --git a/chrome/locale/pt-BR/zotero/zotero.properties b/chrome/locale/pt-BR/zotero/zotero.properties index bb3c57c41..a2c3ebf6a 100644 --- a/chrome/locale/pt-BR/zotero/zotero.properties +++ b/chrome/locale/pt-BR/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Você não pode adicionar arquivos à cole ingester.saveToZotero=Salvar em Zotero ingester.saveToZoteroUsing=Salvar Zotero utilizando "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Salvando item... ingester.scrapingTo=Salvar para ingester.scrapeComplete=Item salvo. diff --git a/chrome/locale/pt-PT/zotero/zotero.properties b/chrome/locale/pt-PT/zotero/zotero.properties index b62ebe051..5eb4acc09 100644 --- a/chrome/locale/pt-PT/zotero/zotero.properties +++ b/chrome/locale/pt-PT/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Não pode adicionar ficheiros à colecçã ingester.saveToZotero=Guardar no Zotero ingester.saveToZoteroUsing=Guarda no Zotero usando "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Guardando Item... ingester.scrapingTo=Guardando em ingester.scrapeComplete=Item Guardado diff --git a/chrome/locale/ro-RO/zotero/zotero.properties b/chrome/locale/ro-RO/zotero/zotero.properties index 0649c4086..274cb36b6 100644 --- a/chrome/locale/ro-RO/zotero/zotero.properties +++ b/chrome/locale/ro-RO/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Nu poți adăuga fișiere în colecția se ingester.saveToZotero=Salvează în Zotero ingester.saveToZoteroUsing=Salvezi în Zotero folosind "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Salvează înregistrarea... ingester.scrapingTo=Salvare în ingester.scrapeComplete=Înregistrare salvată diff --git a/chrome/locale/ru-RU/zotero/zotero.properties b/chrome/locale/ru-RU/zotero/zotero.properties index c1d096484..a5f3f93cf 100644 --- a/chrome/locale/ru-RU/zotero/zotero.properties +++ b/chrome/locale/ru-RU/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Вы не можете добавить ф ingester.saveToZotero=Сохранить в Zotero ingester.saveToZoteroUsing=Сохранить в Zotero, используя "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Сохранение документа… ingester.scrapingTo=Сохранение в ingester.scrapeComplete=Документ сохранен diff --git a/chrome/locale/sk-SK/zotero/zotero.properties b/chrome/locale/sk-SK/zotero/zotero.properties index f7d87b3de..545e608c6 100644 --- a/chrome/locale/sk-SK/zotero/zotero.properties +++ b/chrome/locale/sk-SK/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Nemôžete pridať súbory do práve vybra ingester.saveToZotero=Uložiť do Zotera ingester.saveToZoteroUsing=Uložiť do Zotera cez "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Ukladám položku... ingester.scrapingTo=Ukladá sa do ingester.scrapeComplete=Položka bola uložená diff --git a/chrome/locale/sl-SI/zotero/zotero.properties b/chrome/locale/sl-SI/zotero/zotero.properties index 3b6b33a08..a68f83fbb 100644 --- a/chrome/locale/sl-SI/zotero/zotero.properties +++ b/chrome/locale/sl-SI/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Trenutno izbrani zbirki ne morete dodajati ingester.saveToZotero=Shrani v Zotero ingester.saveToZoteroUsing=Shrani v Zotero s pomočjo »%S« +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Shranjevanje vnosa ... ingester.scrapingTo=Shranjevanje v ingester.scrapeComplete=Vnos shranjen diff --git a/chrome/locale/sr-RS/zotero/zotero.properties b/chrome/locale/sr-RS/zotero/zotero.properties index 21521a645..f116fd4e3 100644 --- a/chrome/locale/sr-RS/zotero/zotero.properties +++ b/chrome/locale/sr-RS/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Сачувај у Зотеру ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Чувам ставку... ingester.scrapingTo=Saving to ingester.scrapeComplete=Ставка сачувана. diff --git a/chrome/locale/sv-SE/zotero/zotero.properties b/chrome/locale/sv-SE/zotero/zotero.properties index 0d99412da..7a686e702 100644 --- a/chrome/locale/sv-SE/zotero/zotero.properties +++ b/chrome/locale/sv-SE/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Du kan inte lägga till filer i den valda ingester.saveToZotero=Spara i Zotero ingester.saveToZoteroUsing=Spara i Zotero med "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Sparar källa... ingester.scrapingTo=Spara till ingester.scrapeComplete=Källa sparad diff --git a/chrome/locale/th-TH/zotero/zotero.properties b/chrome/locale/th-TH/zotero/zotero.properties index 6a15b11fb..2108cfbbb 100644 --- a/chrome/locale/th-TH/zotero/zotero.properties +++ b/chrome/locale/th-TH/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=คุณไม่สามารถเพ ingester.saveToZotero=บันทึกใน Zotero ingester.saveToZoteroUsing=บันทึกใน Zotero โดยใช้ "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=กำลังบันทึกรายการ... ingester.scrapingTo=Saving to ingester.scrapeComplete=รายการถูกบันทึกแล้ว diff --git a/chrome/locale/tr-TR/zotero/zotero.properties b/chrome/locale/tr-TR/zotero/zotero.properties index 7004d1bcf..ff0aa6248 100644 --- a/chrome/locale/tr-TR/zotero/zotero.properties +++ b/chrome/locale/tr-TR/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Şu an seçili olan dermeye dosya ekleyeme ingester.saveToZotero=Zotero'ya Kaydet ingester.saveToZoteroUsing=Zotero'ya "%S"yı kullanarak kaydet +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Eser kaydediliyor... ingester.scrapingTo=Buraya kaydediyor: ingester.scrapeComplete=Eser Kaydedildi. @@ -656,7 +658,7 @@ searchConditions.annotation=Açıklama fulltext.indexState.indexed=İndekslendi fulltext.indexState.unavailable=Bilinmeyen -fulltext.indexState.partial=Bölümsel +fulltext.indexState.partial=Kısmi exportOptions.exportNotes=Notları Dışarı Aktar exportOptions.exportFileData=Dosyaları Dışarı Aktar @@ -680,17 +682,17 @@ citation.citations=Alıntılar citation.notes=Notlar citation.locator.page=Sayfa citation.locator.book=Kitap -citation.locator.chapter=Chapter +citation.locator.chapter=Bölüm citation.locator.column=Sütun citation.locator.figure=Şekil -citation.locator.folio=Folio -citation.locator.issue=Issue +citation.locator.folio=Yaprak +citation.locator.issue=Sayı citation.locator.line=Satır citation.locator.note=Not citation.locator.opus=Opus citation.locator.paragraph=Parağraf -citation.locator.part=Part -citation.locator.section=Section +citation.locator.part=Kısım +citation.locator.section=Bölüm citation.locator.subverbo=Bakınız citation.locator.volume=Cilt citation.locator.verse=Ayet diff --git a/chrome/locale/uk-UA/zotero/zotero.properties b/chrome/locale/uk-UA/zotero/zotero.properties index e918e9366..cdd002c58 100644 --- a/chrome/locale/uk-UA/zotero/zotero.properties +++ b/chrome/locale/uk-UA/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=Ви не можете додати фай ingester.saveToZotero=Зберегти в Zotero ingester.saveToZoteroUsing=Зберегти в Zotero використовуючи "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Збереження документу... ingester.scrapingTo=Зберегти в ingester.scrapeComplete=Документ збережено diff --git a/chrome/locale/vi-VN/zotero/zotero.properties b/chrome/locale/vi-VN/zotero/zotero.properties index 94865b2fb..f0ea9e12d 100644 --- a/chrome/locale/vi-VN/zotero/zotero.properties +++ b/chrome/locale/vi-VN/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=You cannot add files to the currently sele ingester.saveToZotero=Lưu vào Zotero ingester.saveToZoteroUsing=Save to Zotero using "%S" +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=Đang lưu giữ Biểu ghi... ingester.scrapingTo=Saving to ingester.scrapeComplete=Biểu ghi đã được lưu dữ diff --git a/chrome/locale/zh-CN/zotero/zotero.properties b/chrome/locale/zh-CN/zotero/zotero.properties index bb7ae14ba..3c8ff83cb 100644 --- a/chrome/locale/zh-CN/zotero/zotero.properties +++ b/chrome/locale/zh-CN/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=您无法在当前选中的分类中添加 ingester.saveToZotero=保存到Zotero ingester.saveToZoteroUsing=使用"%S"保存到 Zotero +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=保存条目... ingester.scrapingTo=保存到 ingester.scrapeComplete=条目已保存 diff --git a/chrome/locale/zh-TW/zotero/zotero.properties b/chrome/locale/zh-TW/zotero/zotero.properties index 2228fccd9..959b00eb6 100644 --- a/chrome/locale/zh-TW/zotero/zotero.properties +++ b/chrome/locale/zh-TW/zotero/zotero.properties @@ -484,6 +484,8 @@ save.error.cannotAddFilesToCollection=您不能將檔案加到目前所選的文 ingester.saveToZotero=儲存到 Zotero ingester.saveToZoteroUsing=用「%S」來存到 Zotero +ingester.saveToZoteroAsWebPageWithSnapshot=Save to Zotero as Web Page (with snapshot) +ingester.saveToZoteroAsWebPageWithoutSnapshot=Save to Zotero as Web Page (without snapshot) ingester.scraping=儲存項目中… ingester.scrapingTo=儲存至… ingester.scrapeComplete=項目己儲存 From 4c751740b4ea1ac188ebbd13c916b3e5d4f22399 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 30 Jun 2015 23:41:06 -0400 Subject: [PATCH 16/62] Update versions and translators --- install.rdf | 2 +- resource/config.js | 2 +- resource/schema/repotime.txt | 2 +- translators | 2 +- update.rdf | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install.rdf b/install.rdf index a439eea0c..1d3e80ec6 100644 --- a/install.rdf +++ b/install.rdf @@ -6,7 +6,7 @@ zotero@chnm.gmu.edu Zotero - 4.0.27.SOURCE + 4.0.27.1.SOURCE Center for History and New Media
George Mason University
Dan Cohen Sean Takats diff --git a/resource/config.js b/resource/config.js index 795b91236..4465e0ab2 100644 --- a/resource/config.js +++ b/resource/config.js @@ -14,7 +14,7 @@ var ZOTERO_CONFIG = { BOOKMARKLET_ORIGIN: 'https://www.zotero.org', HTTP_BOOKMARKLET_ORIGIN: 'http://www.zotero.org', BOOKMARKLET_URL: 'https://www.zotero.org/bookmarklet/', - VERSION: '4.0.27.SOURCE' + VERSION: '4.0.27.1.SOURCE' }; EXPORTED_SYMBOLS = ["ZOTERO_CONFIG"]; diff --git a/resource/schema/repotime.txt b/resource/schema/repotime.txt index 9fc1022cc..f4b4a34f5 100644 --- a/resource/schema/repotime.txt +++ b/resource/schema/repotime.txt @@ -1 +1 @@ -2015-06-29 17:25:00 +2015-06-30 15:36:00 diff --git a/translators b/translators index c2d8db56d..432580de9 160000 --- a/translators +++ b/translators @@ -1 +1 @@ -Subproject commit c2d8db56d6d227e9aeead3db6cb0dec8a1dbae32 +Subproject commit 432580de9ba2fc578d965d65686355246b5ed29e diff --git a/update.rdf b/update.rdf index ba8d7860a..6de60a3c4 100644 --- a/update.rdf +++ b/update.rdf @@ -7,7 +7,7 @@ - 4.0.27.SOURCE + 4.0.27.1.SOURCE {ec8030f7-c20a-464f-9b0e-13a3a9e97384} From ba53f256d6c7bb3b26d9bec8f6e35d2a399f8cf7 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 1 Jul 2015 00:53:20 -0400 Subject: [PATCH 17/62] Quick hack to fix "without snapshot" save option in Z4Fx via Standalone (I don't see any obvious reason I can't do this. We should probably clean this up later, not call the endpoint "saveSnapshot", etc. Also, is there a reason it doesn't follow the snapshot pref by default?) --- chrome/content/zotero/xpcom/server_connector.js | 2 +- chrome/content/zotero/zoteroPane.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/server_connector.js b/chrome/content/zotero/xpcom/server_connector.js index 8d4a4a7f8..703a7dcee 100644 --- a/chrome/content/zotero/xpcom/server_connector.js +++ b/chrome/content/zotero/xpcom/server_connector.js @@ -438,7 +438,7 @@ Zotero.Server.Connector.SaveSnapshot.prototype = { } // save snapshot - if(filesEditable) { + if (filesEditable && !data.skipSnapshot) { Zotero.Attachments.importFromDocument(doc, itemID); } diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 5fb81aa90..1787c20dc 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -3146,7 +3146,8 @@ var ZoteroPane = new function() // In connector, save page via Zotero Standalone var doc = window.content.document; Zotero.Connector.callMethod("saveSnapshot", {"url":doc.location.toString(), - "cookie":doc.cookie, "html":doc.documentElement.innerHTML}, + "cookie":doc.cookie, "html":doc.documentElement.innerHTML, + "skipSnapshot": saveSnapshot === false || (saveSnapshot === true ? false : undefined)}, function(returnValue, status) { _showPageSaveStatus(doc.title); }); From 7ccc48b4ae0dc19b3133a19644f3dd0dff6fa43d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 1 Jul 2015 02:38:15 -0400 Subject: [PATCH 18/62] Don't show "without snapshot" save option in Fx connector for now Option requires a new Standalone build with ba53f256d --- chrome/content/zotero/browser.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 4f3d48281..e13c682ae 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -531,15 +531,18 @@ var Zotero_Browser = new function() { }); popup.appendChild(menuitem); - menuitem = document.createElement("menuitem"); - menuitem.setAttribute("label", Zotero.getString('ingester.saveToZoteroAsWebPageWithoutSnapshot')); - menuitem.setAttribute("image", webPageIcon); - menuitem.setAttribute("class", "menuitem-iconic"); - menuitem.addEventListener("command", function (event) { - Zotero_Browser.saveAsWebPage(false); - event.stopPropagation(); - }); - popup.appendChild(menuitem); + // TEMP: Requires a new Standalone build + if (!Zotero.isConnector) { + menuitem = document.createElement("menuitem"); + menuitem.setAttribute("label", Zotero.getString('ingester.saveToZoteroAsWebPageWithoutSnapshot')); + menuitem.setAttribute("image", webPageIcon); + menuitem.setAttribute("class", "menuitem-iconic"); + menuitem.addEventListener("command", function (event) { + Zotero_Browser.saveAsWebPage(false); + event.stopPropagation(); + }); + popup.appendChild(menuitem); + } if (captureState == tab.CAPTURE_STATE_TRANSLATABLE) { popup.appendChild(document.createElement("menuseparator")); From 9574de752d750f8de5e036215e1f08b617ad1cc4 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 1 Jul 2015 14:45:39 -0400 Subject: [PATCH 19/62] Debugging for #783 --- chrome/content/zotero/xpcom/ipc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/ipc.js b/chrome/content/zotero/xpcom/ipc.js index 7ceff05f4..23fe6a458 100755 --- a/chrome/content/zotero/xpcom/ipc.js +++ b/chrome/content/zotero/xpcom/ipc.js @@ -260,11 +260,12 @@ Zotero.IPC = new function() { instancePipeOpen = true; } - // Try to write to the pipe once a ms for 100 ms - var timeout = Date.now()+100, wroteToPipe; + // Try to write to the pipe once a ms for 1000 ms + var timeout = Date.now()+1000, wroteToPipe; do { wroteToPipe = Zotero.IPC.safePipeWrite(pipe, msg+"\n"); } while(Date.now() < timeout && !wroteToPipe); + if (wroteToPipe) Zotero.debug('IPC: Pipe took '+(Date.now()-(timeout-1000))+' ms to become available'); success = success || wroteToPipe; defunct = !wroteToPipe; } From 15a0a33ac1b0f5d0b7e490cbe20a81d5dfe98dd8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 1 Jul 2015 19:36:16 -0400 Subject: [PATCH 20/62] Fix Quick Copy in tab mode --- chrome/content/zotero/xpcom/quickCopy.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js index 8cc8c9fd8..15b588fc8 100644 --- a/chrome/content/zotero/xpcom/quickCopy.js +++ b/chrome/content/zotero/xpcom/quickCopy.js @@ -111,11 +111,13 @@ Zotero.QuickCopy = new function() { var urlHostPort = nsIURI.hostPort; var urlPath = nsIURI.path; } - catch (e) { + catch (e) {} + + // Skip about:, chrome:, etc. + if (!urlHostPort) { return quickCopyPref; } - var matches = []; var sql = "SELECT key AS domainPath, value AS format FROM settings " From d104e4b10613b203b5778d0bd437d630bd59e01e Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 1 Jul 2015 20:00:47 -0400 Subject: [PATCH 21/62] More debugging for #783 --- chrome/content/zotero/xpcom/ipc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chrome/content/zotero/xpcom/ipc.js b/chrome/content/zotero/xpcom/ipc.js index 23fe6a458..bcb10f11f 100755 --- a/chrome/content/zotero/xpcom/ipc.js +++ b/chrome/content/zotero/xpcom/ipc.js @@ -256,7 +256,9 @@ Zotero.IPC = new function() { // make sure instance pipe is open and accepting input, so that we can receive // a response to whatever we're sending if(!instancePipeOpen && _instancePipe.exists()) { + var time = Date.now(); Zotero.IPC.safePipeWrite(_instancePipe, "test\n", true); + Zotero.debug("IPC: Pipe took "+(Date.now() - time)+" ms to receive a cross-thread write"); instancePipeOpen = true; } From 50ee61545aa8ef285ddc8577a4de90d74b32adf5 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 1 Jul 2015 20:34:54 -0400 Subject: [PATCH 22/62] Kill code to ensure that our pipe is open before we write to the other In practice, this appears to be both unnecessary and harmful. Although the first write happens effectively instantaneously, we can take several hundred milliseconds to read the second write, and Standalone can decide we are dead. This apparently fixes #783 for @dstillman, although I was never able to reproduce locally. --- chrome/content/zotero/xpcom/ipc.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/chrome/content/zotero/xpcom/ipc.js b/chrome/content/zotero/xpcom/ipc.js index bcb10f11f..cc7de5981 100755 --- a/chrome/content/zotero/xpcom/ipc.js +++ b/chrome/content/zotero/xpcom/ipc.js @@ -24,7 +24,7 @@ */ Zotero.IPC = new function() { - var _libc, _libcPath, _instancePipe, _user32, open, write, close, instancePipeOpen; + var _libc, _libcPath, _instancePipe, _user32, open, write, close; /** * Initialize pipe for communication with connector @@ -253,21 +253,12 @@ Zotero.IPC = new function() { } if(!defunct) { - // make sure instance pipe is open and accepting input, so that we can receive - // a response to whatever we're sending - if(!instancePipeOpen && _instancePipe.exists()) { - var time = Date.now(); - Zotero.IPC.safePipeWrite(_instancePipe, "test\n", true); - Zotero.debug("IPC: Pipe took "+(Date.now() - time)+" ms to receive a cross-thread write"); - instancePipeOpen = true; - } - - // Try to write to the pipe once a ms for 1000 ms - var timeout = Date.now()+1000, wroteToPipe; + // Try to write to the pipe for 100 ms + var time = Date.now(), timeout = time+100, wroteToPipe; do { wroteToPipe = Zotero.IPC.safePipeWrite(pipe, msg+"\n"); } while(Date.now() < timeout && !wroteToPipe); - if (wroteToPipe) Zotero.debug('IPC: Pipe took '+(Date.now()-(timeout-1000))+' ms to become available'); + if (wroteToPipe) Zotero.debug('IPC: Pipe took '+(Date.now()-time)+' ms to become available'); success = success || wroteToPipe; defunct = !wroteToPipe; } From 9d2b097605d4d235867f1c2a66667115a0e7e1ad Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 2 Jul 2015 05:46:28 -0400 Subject: [PATCH 23/62] Fix toolbar icons in non-nav-bar toolbars on OS X and Windows ...which only required redoing the entire styling. Not yet done on Linux --- .../content/zotero-platform/mac/overlay.css | 35 ++-- .../content/zotero-platform/win/overlay.css | 161 ++++++++++++------ chrome/skin/default/zotero/zotero.css | 25 +-- 3 files changed, 140 insertions(+), 81 deletions(-) diff --git a/chrome/content/zotero-platform/mac/overlay.css b/chrome/content/zotero-platform/mac/overlay.css index d091c926b..016661926 100644 --- a/chrome/content/zotero-platform/mac/overlay.css +++ b/chrome/content/zotero-platform/mac/overlay.css @@ -2,6 +2,14 @@ As of Fx36, the built-in Mac styles don't properly handle a menu-button within a combined button, so we need this ungodly mess. */ +/* Necessary to keep 32px icons from being rendered at full size */ +#zotero-toolbar-main-button[cui-areatype="toolbar"] > .toolbarbutton-icon, +#zotero-toolbar-main-button-single[cui-areatype="toolbar"] > .toolbarbutton-icon, +#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button > .toolbarbutton-icon, +#zotero-toolbar-save-button-single[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button > .toolbarbutton-icon { + height: 16px; +} + #zotero-toolbar-buttons[cui-areatype="toolbar"] > separator, #zotero-toolbar-save-button[cui-areatype="toolbar"]:not(:hover) > .toolbarbutton-menubutton-dropmarker::before, #zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button { @@ -9,12 +17,7 @@ } #zotero-toolbar-save-button[cui-areatype="toolbar"] { - margin-top: 3px !important; - margin-bottom: 3px !important; - border-right: 0; - border-width: 1px; - border-style: solid; - border-color: transparent; + border: 0; } #zotero-toolbar-main-button[cui-areatype="toolbar"] { @@ -26,8 +29,6 @@ } #zotero-toolbar-save-button[cui-areatype="toolbar"] { - margin-top: 3px; - margin-bottom: 3px; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; @@ -40,7 +41,9 @@ padding-right: 1px; } -/* Recreate standard hover effect (except in overflow list) */ +/* + * Recreate standard hover effect (except in overflow list) + */ #zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button, #zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker { border-width: 1px; @@ -81,17 +84,17 @@ border-left: 1px solid transparent; } +/* + * Alterations for overflow menu + */ #zotero-toolbar-buttons[overflowedItem=true] { - margin-left: 3px !important; + margin: 6px 4px 0; } -/* Necessary in Fx36 to keep 32px icons from being rendered at full size */ -#zotero-toolbar-main-button[cui-areatype="toolbar"] > .toolbarbutton-icon, -#zotero-toolbar-main-button-single[cui-areatype="toolbar"] > .toolbarbutton-icon, -#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button > .toolbarbutton-icon, -#zotero-toolbar-save-button-single[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button > .toolbarbutton-icon { - width: 16px; +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { + max-width: 16px; } + /* End toolbar icons */ #zotero-splitter diff --git a/chrome/content/zotero-platform/win/overlay.css b/chrome/content/zotero-platform/win/overlay.css index b688743a3..ec9ae40d8 100644 --- a/chrome/content/zotero-platform/win/overlay.css +++ b/chrome/content/zotero-platform/win/overlay.css @@ -1,80 +1,92 @@ /* As of Fx36, the built-in styles don't properly handle a menu-button within combined buttons. + + On Windows and Linux, the padding and hover effect (border and shading) are applied directly to + the .toolbarbutton-icon (image) instead of the toolbarbutton, so proper sizing of the SVG depends + on the total width including border and padding. */ -#zotero-toolbar-main-button-single[cui-areatype="toolbar"]:not([overflowedItem=true]) .toolbarbutton-icon { - width: 32px; -} -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { - width: 28px; -} - -#zotero-toolbar-save-button-single[cui-areatype="toolbar"]:not([overflowedItem=true]) .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { - height: 24px; -} - -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-main-button .toolbarbutton-icon { - margin-left: 2px; - margin-right: -1px; +/* + * Nav bar + */ +toolbar[id="nav-bar"] #zotero-toolbar-main-button .toolbarbutton-icon { + width: 28px; /* 16 + 1 + 1 + 5 + 5 */ padding-left: 5px !important; padding-right: 5px !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-save-button .toolbarbutton-icon { +toolbar[id="nav-bar"] #zotero-toolbar-save-button .toolbarbutton-icon { + width: 28px; /* 16 + 6 + 5 + 1 */ padding-left: 6px !important; - padding-right: 6px !important; + padding-right: 5px !important; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker .dropmarker-icon { - padding-left: 5px !important; - padding-right: 4px !important; +toolbar[id="nav-bar"] #zotero-toolbar-main-button-single .toolbarbutton-icon { + width: 32px; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-menubutton-button { - margin-left: -2px !important; +toolbar[id="nav-bar"] #zotero-toolbar-save-button-single .toolbarbutton-icon { + width: 31px; /* Compensate for border on only one side */ } -#zotero-toolbar-buttons[cui-areatype="toolbar"] > separator, -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker::before { +/* Fix size when dragged to nav bar in Customize mode */ +toolbar[id="nav-bar"] toolbarpaletteitem #zotero-toolbar-save-button .toolbarbutton-icon { + width: 29px; +} + +toolbar[id="nav-bar"] #zotero-toolbar-buttons #zotero-toolbar-main-button { + margin-right: -1px; +} + +toolbar[id="nav-bar"] #zotero-toolbar-buttons #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker .dropmarker-icon { + padding-left: 4px; + padding-right: 4px; +} + +toolbar[id="nav-bar"] #zotero-toolbar-buttons > separator { + margin-top: 11px; + margin-bottom: 11px; + -moz-margin-end: -3px; +} + +toolbar[id="nav-bar"] #zotero-toolbar-buttons > separator, +toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker::before { width: 1px; - -moz-margin-end: -1px; background-image: var(--toolbarbutton-combined-backgroundimage); } -#zotero-toolbar-buttons[cui-areatype="toolbar"] > separator { - margin-top: 11px; - margin-bottom: 11px; +toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker::before { + -moz-margin-end: -1px; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > separator, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button:not([disabled]) > .toolbarbutton-menubutton-dropmarker::before { - display: none; +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > separator, +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button:not([disabled]) > .toolbarbutton-menubutton-dropmarker::before { + background-image: none; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-main-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button:not([disabled]) .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button:not([disabled]) .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-main-button .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button:not([disabled]) .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button:not([disabled]) .dropmarker-icon { border-color: var(--toolbarbutton-hover-bordercolor) !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-main-button:not(:active) .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-main-button:not(:active) .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .dropmarker-icon { background: var(--toolbarbutton-hover-background); } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .dropmarker-icon { box-shadow: none; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-main-button .toolbarbutton-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-main-button .toolbarbutton-icon { border-top-right-radius: 0px !important; border-bottom-right-radius: 0px !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .toolbarbutton-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .toolbarbutton-icon { border-top-left-radius: 0px !important; border-bottom-left-radius: 0px !important; } @@ -83,36 +95,69 @@ There are two hover effects: when the toolbaritem is hovered over, and when the button is hovered over. This applies the latter (and may not be right on different versions of Windows). */ -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-main-button:hover:not(:active):not([disabled]) > .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-main-button:hover:not(:active):not([disabled]) > .toolbarbutton-icon, /* The dropmarker doesn't honor :hover, so instead of showing the hover effect for each segment individually, do the menu-button parts together, which at least looks like a choice. */ -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover .toolbarbutton-menubutton-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:not(:active):not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover .toolbarbutton-menubutton-button .toolbarbutton-icon, +toolbar[id="nav-bar"] > #zotero-toolbar-save-button:hover:not(:active):not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { background-color: hsla(210,48%,96%,.75) !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-main-button:hover > .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-main-button:hover > .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { border-color: hsla(210,54%,20%,.3) hsla(210,54%,20%,.35) hsla(210,54%,20%,.4) !important; box-shadow: 0 0 1px hsla(210,54%,20%,.03), 0 0 2px hsla(210,54%,20%,.1) !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { background: var(--toolbarbutton-active-background) !important; border-color: var(--toolbarbutton-active-bordercolor) !important; box-shadow: var(--toolbarbutton-active-boxshadow) !important; transition-duration: 10ms; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] > menupopup { - margin-top: -5px; +#zotero-toolbar-save-button[cui-areatype="toolbar"] > menupopup, +#zotero-toolbar-save-button-single[cui-areatype="toolbar"] > menupopup { + margin-top: -7px; } -/* Alterations for overflow panel */ + +/* + * Alterations for non-nav-bar toolbars + */ +toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button > .toolbarbutton-icon, +toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button-single > .toolbarbutton-icon, +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-button > .toolbarbutton-icon, +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-button > .toolbarbutton-icon { + height: 16px; + width: 16px; + padding: 0; +} + +toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button-single, +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-button, +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-button { + width: 24px; +} + +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker, +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-dropmarker { + padding-left: 2px; + padding-right: 3px; +} + +toolbar:not([id="nav-bar"]) #zotero-toolbar-buttons separator { + display: none; +} + + +/* + * Alterations for overflow panel + */ #zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon, #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon, #zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-icon, @@ -121,19 +166,25 @@ } #zotero-toolbar-buttons[overflowedItem=true] { - margin-left: 0px !important; + margin: 6px 0 0 0 !important; } #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { - padding-left: 0; + max-width: 18px; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button toolbarbutton { + margin-left: 0 !important; } #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon { - margin-left: 6px; + margin-left: 8px; padding-right: 0 !important; } + /* End toolbar buttons */ + @media (min-resolution: 1.5dppx) { #zotero-toolbar .toolbarbutton-icon { width: 16px; diff --git a/chrome/skin/default/zotero/zotero.css b/chrome/skin/default/zotero/zotero.css index 0352c4b21..884aadd01 100644 --- a/chrome/skin/default/zotero/zotero.css +++ b/chrome/skin/default/zotero/zotero.css @@ -26,6 +26,10 @@ * Toolbar icons * */ +#zotero-toolbar-buttons[cui-areatype=toolbar] { + height: 24px; +} + #zotero-toolbar-main-button, #zotero-toolbar-main-button-single { list-style-image: url("chrome://zotero/skin/zotero-z-32px-australis.svg"); @@ -53,30 +57,31 @@ toolbarpaletteitem[place="palette"] #zotero-toolbar-buttons #zotero-toolbar-save } /* Alterations for overflow panel */ +#zotero-toolbar-buttons[overflowedItem=true] { + padding: 0 6px; + height: 36px; +} + #zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-text, #zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-text { margin-left: 2px !important; } -#zotero-toolbar-buttons[overflowedItem=true] { - margin: 6px 4px; - max-height: 36px; -} - #zotero-toolbar-buttons[overflowedItem=true]:not(:hover) { border: 1px solid transparent; } +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { + min-width: unset; + margin-right: 8px; + padding: 0; +} + #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-text { display: none; margin-left: 1px; } -#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { - min-width: unset; - max-width: 30px; -} - #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button:hover { background: unset; } From 44accbadec80a21dd984bcf0853472f6f02af28c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Jul 2015 02:06:51 -0400 Subject: [PATCH 24/62] Update versions --- install.rdf | 2 +- resource/config.js | 2 +- update.rdf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install.rdf b/install.rdf index 1d3e80ec6..1732dc3cd 100644 --- a/install.rdf +++ b/install.rdf @@ -6,7 +6,7 @@ zotero@chnm.gmu.edu Zotero - 4.0.27.1.SOURCE + 4.0.27.2.SOURCE Center for History and New Media
George Mason University
Dan Cohen Sean Takats diff --git a/resource/config.js b/resource/config.js index 4465e0ab2..1f8b6c4d7 100644 --- a/resource/config.js +++ b/resource/config.js @@ -14,7 +14,7 @@ var ZOTERO_CONFIG = { BOOKMARKLET_ORIGIN: 'https://www.zotero.org', HTTP_BOOKMARKLET_ORIGIN: 'http://www.zotero.org', BOOKMARKLET_URL: 'https://www.zotero.org/bookmarklet/', - VERSION: '4.0.27.1.SOURCE' + VERSION: '4.0.27.2.SOURCE' }; EXPORTED_SYMBOLS = ["ZOTERO_CONFIG"]; diff --git a/update.rdf b/update.rdf index 6de60a3c4..d4537c82e 100644 --- a/update.rdf +++ b/update.rdf @@ -7,7 +7,7 @@ - 4.0.27.1.SOURCE + 4.0.27.2.SOURCE {ec8030f7-c20a-464f-9b0e-13a3a9e97384} From 208b4daf6ecca2f8c943d798d2b00dfbaedce600 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Jul 2015 02:06:59 -0400 Subject: [PATCH 25/62] Update locales from Transifex --- chrome/locale/et-EE/zotero/about.dtd | 2 +- chrome/locale/et-EE/zotero/preferences.dtd | 10 +- chrome/locale/et-EE/zotero/standalone.dtd | 8 +- chrome/locale/et-EE/zotero/zotero.dtd | 96 ++++++++++---------- chrome/locale/et-EE/zotero/zotero.properties | 12 +-- chrome/locale/fr-FR/zotero/zotero.dtd | 2 +- 6 files changed, 65 insertions(+), 65 deletions(-) diff --git a/chrome/locale/et-EE/zotero/about.dtd b/chrome/locale/et-EE/zotero/about.dtd index 5fe74439a..031d63da0 100644 --- a/chrome/locale/et-EE/zotero/about.dtd +++ b/chrome/locale/et-EE/zotero/about.dtd @@ -10,4 +10,4 @@ - + diff --git a/chrome/locale/et-EE/zotero/preferences.dtd b/chrome/locale/et-EE/zotero/preferences.dtd index 09e03e896..0e7af1845 100644 --- a/chrome/locale/et-EE/zotero/preferences.dtd +++ b/chrome/locale/et-EE/zotero/preferences.dtd @@ -107,7 +107,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -162,7 +162,7 @@ - + @@ -203,6 +203,6 @@ - - + + diff --git a/chrome/locale/et-EE/zotero/standalone.dtd b/chrome/locale/et-EE/zotero/standalone.dtd index 7f6380d62..33d86d86b 100644 --- a/chrome/locale/et-EE/zotero/standalone.dtd +++ b/chrome/locale/et-EE/zotero/standalone.dtd @@ -12,12 +12,12 @@ - + - + - + @@ -54,7 +54,7 @@ - + diff --git a/chrome/locale/et-EE/zotero/zotero.dtd b/chrome/locale/et-EE/zotero/zotero.dtd index ca52b4c09..343a2400e 100644 --- a/chrome/locale/et-EE/zotero/zotero.dtd +++ b/chrome/locale/et-EE/zotero/zotero.dtd @@ -5,19 +5,19 @@ - - - + + + - - + + - + @@ -47,7 +47,7 @@ - + @@ -62,22 +62,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -90,10 +90,10 @@ - + - - + + @@ -125,9 +125,9 @@ - - - + + + @@ -145,18 +145,18 @@ - + - - - - - + + + + + - + @@ -165,10 +165,10 @@ - - - - + + + + @@ -177,7 +177,7 @@ - + @@ -193,7 +193,7 @@ - + @@ -216,8 +216,8 @@ - - + + @@ -243,9 +243,9 @@ - + - + @@ -287,6 +287,6 @@ - + - + diff --git a/chrome/locale/et-EE/zotero/zotero.properties b/chrome/locale/et-EE/zotero/zotero.properties index 8aa794ca0..dceeed2dc 100644 --- a/chrome/locale/et-EE/zotero/zotero.properties +++ b/chrome/locale/et-EE/zotero/zotero.properties @@ -20,7 +20,7 @@ general.tryAgainLater=Please try again in a few minutes. general.serverError=The server returned an error. Please try again. general.restartFirefox=Palun Firefox alglaadida. general.restartFirefoxAndTryAgain=Palun Firefox alglaadida ja siis uuesti proovida. -general.checkForUpdate=Check for Update +general.checkForUpdate=Uuenduste kontrollimine general.actionCannotBeUndone=Seda ei saa tagasi võtta. general.install=Paigaldus general.updateAvailable=Uuendus saadaval @@ -85,7 +85,7 @@ errorReport.reportErrors=Andke vigadest teada... errorReport.reportInstructions=Sellest veast saate teatada valides "%S" Toimingute (hammasratas) menüüst. errorReport.followingReportWillBeSubmitted=The following report will be submitted: errorReport.noErrorsLogged=No errors have been logged since %S started. -errorReport.advanceMessage=Press %S to send the report to the Zotero developers. +errorReport.advanceMessage=Veateate saatmiseks Zotero arendajatele vajutage %S. errorReport.stepsToReproduce=Kuidas viga tekib: errorReport.expectedResult=Loodetud tulemus: errorReport.actualResult=Tegelik tulemus: @@ -208,8 +208,8 @@ pane.items.delete.multiple=Olete kindel, et soovite valitud kirjed kustutada? pane.items.remove.title=Remove from Collection pane.items.remove=Are you sure you want to remove the selected item from this collection? pane.items.remove.multiple=Are you sure you want to remove the selected items from this collection? -pane.items.menu.remove=Remove Item from Collection… -pane.items.menu.remove.multiple=Remove Items from Collection… +pane.items.menu.remove=Kirje eemaldamine teemast... +pane.items.menu.remove.multiple=Kirjete eemaldamine teemast... pane.items.menu.moveToTrash=Move Item to Trash… pane.items.menu.moveToTrash.multiple=Move Items to Trash… pane.items.menu.export=Valitud kirje eksportimine... @@ -491,7 +491,7 @@ ingester.scrapingTo=Saving to ingester.scrapeComplete=Kirje salvestatud ingester.scrapeError=Kirje salvestamine ei õnnestunud ingester.scrapeErrorDescription=Selle kirje salvestamisel tekkis viga. Lisainformatsiooniks vaadake %S. -ingester.scrapeErrorDescription.linkText=Troubleshooting Translator Issues +ingester.scrapeErrorDescription.linkText=Tõlkijate probleemide lahendamine ingester.scrapeErrorDescription.previousError=Salvestamine nurjus Zotero eelneva vea tõttu. ingester.importReferRISDialog.title=Zotero RIS/Refer import @@ -757,7 +757,7 @@ integration.missingItem.multiple=Kirje %1$S ei ole enam Zotero andmebaasis. Kas integration.missingItem.description=Vajutades "Ei" kustutate väljakoodid viidetele, mis sisaldavad seda kirjet. Tsiteeringu tekst säilib, aga bibliograafiast kirje kustutatakse. integration.removeCodesWarning=Väljakoodide eemaldamine ei luba Zoterol enam uuendada selles dokumendis viiteid ja bibliograafiaid. Olete selles toimingus kindel? integration.upgradeWarning=Your document must be permanently upgraded in order to work with Zotero 2.0b7 or later. It is recommended that you make a backup before proceeding. Are you sure you want to continue? -integration.error.newerDocumentVersion=Your document was created with a newer version of Zotero (%1$S) than the currently installed version (%2$S). Please upgrade Zotero before editing this document. +integration.error.newerDocumentVersion=Dokument on loodud uuema versiooniga Zoterost (%1$S) kui installeeritud versioon (%2$S). Palun uuendada Zotero viimasele versioonile. integration.corruptField=Zotero väljakood, mis vastab sellele kirjele, on vigane. Kas soovite kirje uuesti valida. integration.corruptField.description=Vajutades "Ei" kustutate väljakoodid viidetele, mis sisaldavad seda kirjet. Tsiteeringu tekst säilib, aga kirje bibliograafiast kirje võib kustuda. integration.corruptBibliography=Zotero väljakood, mis vastab sellele bibliograafiale, on vigane. Kas soovite bibliograafia taasluua? diff --git a/chrome/locale/fr-FR/zotero/zotero.dtd b/chrome/locale/fr-FR/zotero/zotero.dtd index a07fd15fb..d73dd2341 100644 --- a/chrome/locale/fr-FR/zotero/zotero.dtd +++ b/chrome/locale/fr-FR/zotero/zotero.dtd @@ -97,7 +97,7 @@ - + From 20f279043bdfc103ddd1de13c455c15d3e07c538 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Jul 2015 02:09:27 -0400 Subject: [PATCH 26/62] Update submodules --- chrome/content/zotero/locale/csl | 2 +- resource/schema/repotime.txt | 2 +- translators | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/locale/csl b/chrome/content/zotero/locale/csl index 6e3d49bb0..17bc27f4a 160000 --- a/chrome/content/zotero/locale/csl +++ b/chrome/content/zotero/locale/csl @@ -1 +1 @@ -Subproject commit 6e3d49bb0babc1715596b4be5f692450e92a8323 +Subproject commit 17bc27f4a1835b9f23e5daea98fb61ee2af94072 diff --git a/resource/schema/repotime.txt b/resource/schema/repotime.txt index f4b4a34f5..ed14d052d 100644 --- a/resource/schema/repotime.txt +++ b/resource/schema/repotime.txt @@ -1 +1 @@ -2015-06-30 15:36:00 +2015-07-03 01:25:00 diff --git a/translators b/translators index 432580de9..ec4e1cf84 160000 --- a/translators +++ b/translators @@ -1 +1 @@ -Subproject commit 432580de9ba2fc578d965d65686355246b5ed29e +Subproject commit ec4e1cf84824e1832ab4ec54f10557f6a30b4dbd From 242581a270daf602697dac7b74d8eced35a408b6 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Jul 2015 22:06:12 -0400 Subject: [PATCH 27/62] Fix Quick Copy in tab mode, but for real --- chrome/content/zotero/xpcom/quickCopy.js | 14 ++++++++---- test/tests/quickCopyTest.js | 28 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 test/tests/quickCopyTest.js diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js index 15b588fc8..a87768a1a 100644 --- a/chrome/content/zotero/xpcom/quickCopy.js +++ b/chrome/content/zotero/xpcom/quickCopy.js @@ -104,8 +104,9 @@ Zotero.QuickCopy = new function() { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); + var nsIURI; try { - var nsIURI = ioService.newURI(url, null, null); + nsIURI = ioService.newURI(url, null, null); // Accessing some properties may throw for URIs that do not support those // parts. E.g. hostPort throws NS_ERROR_FAILURE for about:blank var urlHostPort = nsIURI.hostPort; @@ -113,8 +114,8 @@ Zotero.QuickCopy = new function() { } catch (e) {} - // Skip about:, chrome:, etc. - if (!urlHostPort) { + // Skip non-HTTP URLs + if (!/^https?$/.test(nsIURI.scheme)) { return quickCopyPref; } @@ -122,7 +123,12 @@ Zotero.QuickCopy = new function() { var sql = "SELECT key AS domainPath, value AS format FROM settings " + "WHERE setting='quickCopySite' AND (key LIKE ? OR key LIKE ?)"; - var urlDomain = urlHostPort.match(/[^\.]+\.[^\.]+$/); + var urlDomain = urlHostPort.match(/(?:[^\.]+\.)?[^\.]+$/); + // Hopefully can't happen, but until we're sure + if (!urlDomain) { + Zotero.logError("Quick Copy host '" + urlHostPort + "' not matched"); + return quickCopyPref; + } var rows = Zotero.DB.query(sql, ['%' + urlDomain[0] + '%', '/%']); for (let i = 0; i < rows.length; i++) { let row = rows[i]; diff --git a/test/tests/quickCopyTest.js b/test/tests/quickCopyTest.js new file mode 100644 index 000000000..5abf79f51 --- /dev/null +++ b/test/tests/quickCopyTest.js @@ -0,0 +1,28 @@ +describe("Zotero.QuickCopy", function() { + var quickCopyPref = Zotero.Prefs.get("export.quickCopy.setting"); + quickCopyPref = JSON.stringify(Zotero.QuickCopy.unserializeSetting(quickCopyPref)); + + // TODO: These should set site-specific prefs and test the actual response against it, + // but that will need to wait for 5.0. For now, just make sure they don't fail. + describe("#getFormatFromURL()", function () { + it("should handle a domain", function () { + assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo.com/'), quickCopyPref); + }) + + it("should handle a domain and path", function () { + assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo.com/bar'), quickCopyPref); + }) + + it("should handle a local host", function () { + assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo/'), quickCopyPref); + }) + + it("should handle an about: URL", function () { + assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('about:blank'), quickCopyPref); + }) + + it("should handle a chrome URL", function () { + assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('chrome://zotero/content/tab.xul'), quickCopyPref); + }) + }) +}) From 899e33c9935766e8c0e13888bcba79042ff29239 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Jul 2015 22:14:08 -0400 Subject: [PATCH 28/62] Add a test to make sure HTTPS URLs aren't failing for Quick Copy --- test/tests/quickCopyTest.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/tests/quickCopyTest.js b/test/tests/quickCopyTest.js index 5abf79f51..d9d432a96 100644 --- a/test/tests/quickCopyTest.js +++ b/test/tests/quickCopyTest.js @@ -5,10 +5,14 @@ describe("Zotero.QuickCopy", function() { // TODO: These should set site-specific prefs and test the actual response against it, // but that will need to wait for 5.0. For now, just make sure they don't fail. describe("#getFormatFromURL()", function () { - it("should handle a domain", function () { + it("should handle an HTTP URL", function () { assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo.com/'), quickCopyPref); }) + it("should handle an HTTPS URL", function () { + assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('https://foo.com/'), quickCopyPref); + }) + it("should handle a domain and path", function () { assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo.com/bar'), quickCopyPref); }) From f07fe7184de1cc21a18cf0f9395e63ebd2b03421 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Jul 2015 23:46:39 -0400 Subject: [PATCH 29/62] Ignore trailing period in domain for Quick Copy From @aurimasv --- chrome/content/zotero/xpcom/quickCopy.js | 3 ++- test/tests/quickCopyTest.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js index a87768a1a..9a7f8bc92 100644 --- a/chrome/content/zotero/xpcom/quickCopy.js +++ b/chrome/content/zotero/xpcom/quickCopy.js @@ -123,7 +123,8 @@ Zotero.QuickCopy = new function() { var sql = "SELECT key AS domainPath, value AS format FROM settings " + "WHERE setting='quickCopySite' AND (key LIKE ? OR key LIKE ?)"; - var urlDomain = urlHostPort.match(/(?:[^\.]+\.)?[^\.]+$/); + // Match last one or two sections of domain, not counting trailing period + var urlDomain = urlHostPort.match(/(?:[^.]+\.)?[^.]+(?=\.?$)/); // Hopefully can't happen, but until we're sure if (!urlDomain) { Zotero.logError("Quick Copy host '" + urlHostPort + "' not matched"); diff --git a/test/tests/quickCopyTest.js b/test/tests/quickCopyTest.js index d9d432a96..44941b70b 100644 --- a/test/tests/quickCopyTest.js +++ b/test/tests/quickCopyTest.js @@ -21,6 +21,10 @@ describe("Zotero.QuickCopy", function() { assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo/'), quickCopyPref); }) + it("should handle a domain with a trailing period", function () { + assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo.com.'), quickCopyPref); + }) + it("should handle an about: URL", function () { assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('about:blank'), quickCopyPref); }) From ebe08836e80cde46b661199450eb8e482a1d4cbc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Jul 2015 23:52:30 -0400 Subject: [PATCH 30/62] A little more Quick Copy safety --- chrome/content/zotero/xpcom/quickCopy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js index 9a7f8bc92..2cc6d0cd3 100644 --- a/chrome/content/zotero/xpcom/quickCopy.js +++ b/chrome/content/zotero/xpcom/quickCopy.js @@ -115,7 +115,7 @@ Zotero.QuickCopy = new function() { catch (e) {} // Skip non-HTTP URLs - if (!/^https?$/.test(nsIURI.scheme)) { + if (!nsIURI || !/^https?$/.test(nsIURI.scheme)) { return quickCopyPref; } From a080e4090d4fc26b8b36cbf6e8e13c9e66dc03f5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 4 Jul 2015 00:02:05 -0400 Subject: [PATCH 31/62] Update version --- install.rdf | 2 +- resource/config.js | 2 +- update.rdf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install.rdf b/install.rdf index 1732dc3cd..5dce6834a 100644 --- a/install.rdf +++ b/install.rdf @@ -6,7 +6,7 @@ zotero@chnm.gmu.edu Zotero - 4.0.27.2.SOURCE + 4.0.27.3.SOURCE Center for History and New Media
George Mason University
Dan Cohen Sean Takats diff --git a/resource/config.js b/resource/config.js index 1f8b6c4d7..94d03ea0f 100644 --- a/resource/config.js +++ b/resource/config.js @@ -14,7 +14,7 @@ var ZOTERO_CONFIG = { BOOKMARKLET_ORIGIN: 'https://www.zotero.org', HTTP_BOOKMARKLET_ORIGIN: 'http://www.zotero.org', BOOKMARKLET_URL: 'https://www.zotero.org/bookmarklet/', - VERSION: '4.0.27.2.SOURCE' + VERSION: '4.0.27.3.SOURCE' }; EXPORTED_SYMBOLS = ["ZOTERO_CONFIG"]; diff --git a/update.rdf b/update.rdf index d4537c82e..01a778c85 100644 --- a/update.rdf +++ b/update.rdf @@ -7,7 +7,7 @@ - 4.0.27.2.SOURCE + 4.0.27.3.SOURCE {ec8030f7-c20a-464f-9b0e-13a3a9e97384} From 01716183d75b04adf12058242f33c6ab0b7a1791 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 4 Jul 2015 17:09:26 -0400 Subject: [PATCH 32/62] Prevent erroneous hiding of hideonpagechange guidance panels on complex pages --- chrome/content/zotero/bindings/guidancepanel.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/bindings/guidancepanel.xml b/chrome/content/zotero/bindings/guidancepanel.xml index 5a925e750..dc1ada8b2 100644 --- a/chrome/content/zotero/bindings/guidancepanel.xml +++ b/chrome/content/zotero/bindings/guidancepanel.xml @@ -119,7 +119,15 @@ self.removeEventListener("popupshown", popupShownListener); let appcontent = document.getElementById('appcontent'); - let pageHideListener = function () { + let pageHideListener = function (event) { + var doc = event.originalTarget; + if(!(doc instanceof HTMLDocument)) return; + + var rootDoc = doc.defaultView.top.document; + // Don't hide when frames and special URLs are unloaded + if (rootDoc != doc || !rootDoc.location.href.startsWith('http')) { + return; + } appcontent.removeEventListener("pagehide", pageHideListener); self.hide(); }; From 0ba64b5194428d72e626949f6076f104fb62c8e6 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 5 Jul 2015 12:58:36 -0400 Subject: [PATCH 33/62] Show guidance panel nav buttons on Linux --- chrome/skin/default/zotero/bindings/guidancepanel.css | 1 + 1 file changed, 1 insertion(+) diff --git a/chrome/skin/default/zotero/bindings/guidancepanel.css b/chrome/skin/default/zotero/bindings/guidancepanel.css index 97eb0acef..52fabaa4d 100644 --- a/chrome/skin/default/zotero/bindings/guidancepanel.css +++ b/chrome/skin/default/zotero/bindings/guidancepanel.css @@ -10,6 +10,7 @@ stack { } *[anonid=nav-buttons] > toolbarbutton { + -moz-appearance: none; /* Necessary on Linux for button to be shown */ width: 22px; height: 22px; border: 1px solid lightgray; From 41fc082f6d0e5ea323c4a71b5c09cb26367beaa0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 5 Jul 2015 15:37:11 -0400 Subject: [PATCH 34/62] Fix too-large icons in secondary toolbars on Linux Plus a few other icon tweaks --- .../content/zotero-platform/unix/overlay.css | 130 ++++++++++-------- 1 file changed, 76 insertions(+), 54 deletions(-) diff --git a/chrome/content/zotero-platform/unix/overlay.css b/chrome/content/zotero-platform/unix/overlay.css index 90f546e91..4a0f0531b 100644 --- a/chrome/content/zotero-platform/unix/overlay.css +++ b/chrome/content/zotero-platform/unix/overlay.css @@ -1,62 +1,78 @@ /* As of Fx36, the built-in styles don't properly handle a menu-button within combined buttons. + + On Windows and Linux, the padding and hover effect (border and shading) are applied directly to + the .toolbarbutton-icon (image) instead of the toolbarbutton, so proper sizing of the SVG depends + on the total width including border and padding. */ -#zotero-toolbar-main-button-single[cui-areatype="toolbar"] .toolbarbutton-icon, -#zotero-toolbar-save-button-single[cui-areatype="toolbar"] .toolbarbutton-icon { + +/* + * Nav bar + */ +toolbar[id="nav-bar"] #zotero-toolbar-main-button-single .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-save-button-single .toolbarbutton-icon { width: 32px; } -#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon, -#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { +toolbar[id="nav-bar"] #zotero-toolbar-main-button .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-save-button .toolbarbutton-icon { width: 28px; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-main-button { +toolbar[id="nav-bar"] #zotero-toolbar-buttons #zotero-toolbar-main-button { margin-right: -1px; } -#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { +toolbar[id="nav-bar"] #zotero-toolbar-main-button .toolbarbutton-icon { margin-left: 2px; margin-right: -3px; padding-left: 5px !important; padding-right: 5px !important; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { +toolbar[id="nav-bar"] #zotero-toolbar-save-button .toolbarbutton-icon { width: 30px !important; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button { +toolbar[id="nav-bar"] #zotero-toolbar-save-button > .toolbarbutton-menubutton-button { padding-left: 0; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button .toolbarbutton-icon { +toolbar[id="nav-bar"] #zotero-toolbar-save-button > .toolbarbutton-menubutton-button .toolbarbutton-icon { padding-left: 6px !important; padding-right: 6px !important; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker { +toolbar[id="nav-bar"] #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker { + width: 18px !important; margin-top: 6px; margin-bottom: 6px; } -#zotero-toolbar-save-button[cui-areatype="toolbar"]:hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon, -#zotero-toolbar-save-button[cui-areatype="toolbar"][open] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { - margin-top: 0; - margin-bottom: 0; -} - -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker .dropmarker-icon { padding-left: 14px !important; padding-right: 3px !important; } -#zotero-toolbar-save-button-single[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { + margin-top: 3px; + margin-bottom: 3px; + padding-left: 8px !important; + padding-right: 8px !important; +} + +toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon, +toolbar[id="nav-bar"] #zotero-toolbar-save-button[open] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { + margin-top: 0; + margin-bottom: 0; +} + +toolbar[id="nav-bar"] #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { margin-top: 3px; margin-bottom: 3px; } -#zotero-toolbar-buttons[cui-areatype="toolbar"] > separator { +toolbar[id="nav-bar"] #zotero-toolbar-buttons > separator { /* Copied from .toolbarbutton-menubutton-dropmarker::before */ display: -moz-box; width: 1px; @@ -70,71 +86,77 @@ box-shadow: var(--toolbarbutton-combined-boxshadow); } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-main-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-main-button .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .dropmarker-icon { border-color: var(--toolbarbutton-hover-bordercolor) !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:not(:active) > .toolbarbutton-menubutton-button > .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button:hover:not(:active) > .toolbarbutton-menubutton-button > .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button:hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { background: inherit; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button:hover:not(:active) > .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button:hover:not(:active) > .toolbarbutton-icon, /* This selector doesn't work, so the dropmarker doesn't get a hover effect. :hover doesn't seem to have an effect on either part of the dropmarker */ -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker:hover > .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker:hover > .dropmarker-icon { background: var(--toolbarbutton-hover-background) !important; } -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]) > #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { +toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon, +toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon { background: var(--toolbarbutton-active-background); border-color: var(--toolbarbutton-active-bordercolor); box-shadow: var(--toolbarbutton-active-boxshadow); transition-duration: 10ms; } + +/* + * Alterations for non-nav-bar toolbars + */ +toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button > .toolbarbutton-icon, +toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button-single > .toolbarbutton-icon, +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-button > .toolbarbutton-icon, +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-button > .toolbarbutton-icon { + height: 16px; + width: 16px; + padding: 0; +} + +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker, +toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-dropmarker { + margin-left: -1px; +} + +toolbar:not([id="nav-bar"]) #zotero-toolbar-buttons separator { + display: none; +} + + /* Alterations for overflow panel */ #zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon, -#zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-icon { +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon, +#zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-icon, +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon { width: 16px; } #zotero-toolbar-buttons[overflowedItem=true] { - margin-left: 0px !important; - margin-bottom: 0px !important; + margin-left: 0 !important; + margin-bottom: 0 !important; margin-right: 0 !important; + padding: 0 !important; } #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { - padding-left: 0; - padding-right: 5px; -} - -#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon { - width: 26px; -} - -#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon { - margin-left: 1px; - padding-right: 0 !important; - width: 22px !important; + max-width: 28px !important; + margin: 0 4px 0 0 !important; } #zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-menubutton-button { - margin-left: 0; -} - -#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-menubutton-dropmarker { - margin: 0; - margin-right: 2px !important; - padding-right: 5px; -} - -#zotero-toolbar-buttons[overflowedItem=true] > separator { - display: none; + margin-left: 8px; } /* End toolbar buttons */ From db991743cdd7552ccf379b30206465ee9f08de25 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 6 Jul 2015 00:41:42 -0400 Subject: [PATCH 35/62] Trigger forward action with click anywhere on guidance panel Previously, clicking directly on a noautohide guidance panel closed it, even if there was a forward nav button. (In the case of the main and save button guidance panels, the save button would appear on the next Firefox restart, but this ensures that the save guidance panel will be shown to new users even if they click on the panel instead of the not-particularly-noticeable forward button.) --- .../content/zotero/bindings/guidancepanel.xml | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/chrome/content/zotero/bindings/guidancepanel.xml b/chrome/content/zotero/bindings/guidancepanel.xml index dc1ada8b2..82e9bbdf5 100644 --- a/chrome/content/zotero/bindings/guidancepanel.xml +++ b/chrome/content/zotero/bindings/guidancepanel.xml @@ -34,6 +34,8 @@ + + + + + + + + %globalDTD; + %textcontextDTD; + %standaloneDTD; + %brandDTD; + %zoteroDTD; +]> + + + + + + + + + + + + + + + + + + From bf58de7e6200ff262583a18fda782debd6930e5f Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Fri, 5 Jun 2015 17:57:03 -0500 Subject: [PATCH 44/62] Update citeproc-js to 1.1.25 And split off Zotero additions --- .../content/zotero/xpcom/citeproc-prereqs.js | 390 ++++ chrome/content/zotero/xpcom/citeproc.js | 2049 ++++++++++------- components/zotero-service.js | 1 + 3 files changed, 1558 insertions(+), 882 deletions(-) create mode 100644 chrome/content/zotero/xpcom/citeproc-prereqs.js diff --git a/chrome/content/zotero/xpcom/citeproc-prereqs.js b/chrome/content/zotero/xpcom/citeproc-prereqs.js new file mode 100644 index 000000000..8f4bcd07d --- /dev/null +++ b/chrome/content/zotero/xpcom/citeproc-prereqs.js @@ -0,0 +1,390 @@ +var CSL_HOST = { + debug: function (str) { + Zotero.debug("CSL: " + str); + }, + error: function (str) { + Zotero.debug("CSL error: " + str); + } +}; +function DOMParser() { + return Components.classes["@mozilla.org/xmlextras/domparser;1"] + .createInstance(Components.interfaces.nsIDOMParser); +}; + +var CSL_IS_IE; +var CSL_CHROME = function () { + if ("undefined" == typeof DOMParser || CSL_IS_IE) { + CSL_IS_IE = true; + DOMParser = function() {}; + DOMParser.prototype.parseFromString = function(str, contentType) { + if ("undefined" != typeof ActiveXObject) { + var xmldata = new ActiveXObject('MSXML.DomDocument'); + xmldata.async = false; + xmldata.loadXML(str); + return xmldata; + } else if ("undefined" != typeof XMLHttpRequest) { + var xmldata = new XMLHttpRequest; + if (!contentType) { + contentType = 'text/xml'; + } + xmldata.open('GET', 'data:' + contentType + ';charset=utf-8,' + encodeURIComponent(str), false); + if(xmldata.overrideMimeType) { + xmldata.overrideMimeType(contentType); + } + xmldata.send(null); + return xmldata.responseXML; + } + }; + this.hasAttributes = function (node) { + var ret; + if (node.attributes && node.attributes.length) { + ret = true; + } else { + ret = false; + } + return ret; + }; + } else { + this.hasAttributes = function (node) { + var ret; + if (node.attributes && node.attributes.length) { + ret = true; + } else { + ret = false; + } + return ret; + }; + } + this.importNode = function (doc, srcElement) { + if ("undefined" == typeof doc.importNode) { + var ret = this._importNode(doc, srcElement, true); + } else { + var ret = doc.importNode(srcElement, true); + } + return ret; + }; + this._importNode = function(doc, node, allChildren) { + switch (node.nodeType) { + case 1: + var newNode = doc.createElement(node.nodeName); + if (node.attributes && node.attributes.length > 0) + for (var i = 0, il = node.attributes.length; i < il;) + newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i++].nodeName)); + if (allChildren && node.childNodes && node.childNodes.length > 0) + for (var i = 0, il = node.childNodes.length; i < il;) + newNode.appendChild(this._importNode(doc, node.childNodes[i++], allChildren)); + return newNode; + break; + case 3: + case 4: + case 8: + } + }; + this.parser = new DOMParser(); + var str = ""; + var inst_doc = this.parser.parseFromString(str, "text/xml"); + var inst_node = inst_doc.getElementsByTagName("institution"); + this.institution = inst_node.item(0); + var inst_part_node = inst_doc.getElementsByTagName("institution-part"); + this.institutionpart = inst_part_node.item(0); + this.ns = "http://purl.org/net/xbiblio/csl"; +}; +CSL_CHROME.prototype.clean = function (xml) { + xml = xml.replace(/<\?[^?]+\?>/g, ""); + xml = xml.replace(/]+>/g, ""); + xml = xml.replace(/^\s+/, ""); + xml = xml.replace(/\s+$/, ""); + xml = xml.replace(/^\n*/, ""); + return xml; +}; +CSL_CHROME.prototype.getStyleId = function (myxml, styleName) { + var text = ""; + var tagName = "id"; + if (styleName) { + tagName = "title"; + } + var node = myxml.getElementsByTagName(tagName); + if (node && node.length) { + node = node.item(0); + } + if (node) { + text = node.textContent; + } + if (!text) { + text = node.innerText; + } + if (!text) { + text = node.innerHTML; + } + return text; +}; +CSL_CHROME.prototype.children = function (myxml) { + var children, pos, len, ret; + if (myxml) { + ret = []; + children = myxml.childNodes; + for (pos = 0, len = children.length; pos < len; pos += 1) { + if (children[pos].nodeName != "#text") { + ret.push(children[pos]); + } + } + return ret; + } else { + return []; + } +}; +CSL_CHROME.prototype.nodename = function (myxml) { + var ret = myxml.nodeName; + return ret; +}; +CSL_CHROME.prototype.attributes = function (myxml) { + var ret, attrs, attr, key, xml, pos, len; + ret = new Object(); + if (myxml && this.hasAttributes(myxml)) { + attrs = myxml.attributes; + for (pos = 0, len=attrs.length; pos < len; pos += 1) { + attr = attrs[pos]; + ret["@" + attr.name] = attr.value; + } + } + return ret; +}; +CSL_CHROME.prototype.content = function (myxml) { + var ret; + if ("undefined" != typeof myxml.textContent) { + ret = myxml.textContent; + } else if ("undefined" != typeof myxml.innerText) { + ret = myxml.innerText; + } else { + ret = myxml.txt; + } + return ret; +}; +CSL_CHROME.prototype.namespace = { + "xml":"http://www.w3.org/XML/1998/namespace" +} +CSL_CHROME.prototype.numberofnodes = function (myxml) { + if (myxml) { + return myxml.length; + } else { + return 0; + } +}; +CSL_CHROME.prototype.getAttributeName = function (attr) { + var ret = attr.name; + return ret; +} +CSL_CHROME.prototype.getAttributeValue = function (myxml,name,namespace) { + var ret = ""; + if (namespace) { + name = namespace+":"+name; + } + if (myxml && this.hasAttributes(myxml) && myxml.getAttribute(name)) { + ret = myxml.getAttribute(name); + } + return ret; +} +CSL_CHROME.prototype.getNodeValue = function (myxml,name) { + var ret = null; + if (name){ + var vals = myxml.getElementsByTagName(name); + if (vals.length > 0) { + if ("undefined" != typeof vals[0].textContent) { + ret = vals[0].textContent; + } else if ("undefined" != typeof vals[0].innerText) { + ret = vals[0].innerText; + } else { + ret = vals[0].text; + } + } + } + if (ret === null && myxml && myxml.childNodes && (myxml.childNodes.length == 0 || (myxml.childNodes.length == 1 && myxml.firstChild.nodeName == "#text"))) { + if ("undefined" != typeof myxml.textContent) { + ret = myxml.textContent; + } else if ("undefined" != typeof myxml.innerText) { + ret = myxml.innerText; + } else { + ret = myxml.text; + } + } + if (ret === null) { + ret = myxml; + } + return ret; +} +CSL_CHROME.prototype.setAttributeOnNodeIdentifiedByNameAttribute = function (myxml,nodename,partname,attrname,val) { + var pos, len, xml, nodes, node; + if (attrname.slice(0,1) === '@'){ + attrname = attrname.slice(1); + } + nodes = myxml.getElementsByTagName(nodename); + for (pos = 0, len = nodes.length; pos < len; pos += 1) { + node = nodes[pos]; + if (node.getAttribute("name") != partname) { + continue; + } + node.setAttribute(attrname, val); + } +} +CSL_CHROME.prototype.deleteNodeByNameAttribute = function (myxml,val) { + var pos, len, node, nodes; + nodes = myxml.childNodes; + for (pos = 0, len = nodes.length; pos < len; pos += 1) { + node = nodes[pos]; + if (!node || node.nodeType == node.TEXT_NODE) { + continue; + } + if (this.hasAttributes(node) && node.getAttribute("name") == val) { + myxml.removeChild(nodes[pos]); + } + } +} +CSL_CHROME.prototype.deleteAttribute = function (myxml,attr) { + myxml.removeAttribute(attr); +} +CSL_CHROME.prototype.setAttribute = function (myxml,attr,val) { + if (!myxml.ownerDocument) { + myxml = myxml.firstChild; + } + if (["function", "unknown"].indexOf(typeof myxml.setAttribute) > -1) { + myxml.setAttribute(attr, val); + } + return false; +} +CSL_CHROME.prototype.nodeCopy = function (myxml) { + var cloned_node = myxml.cloneNode(true); + return cloned_node; +} +CSL_CHROME.prototype.getNodesByName = function (myxml,name,nameattrval) { + var ret, nodes, node, pos, len; + ret = []; + nodes = myxml.getElementsByTagName(name); + for (pos = 0, len = nodes.length; pos < len; pos += 1) { + node = nodes.item(pos); + if (nameattrval && !(this.hasAttributes(node) && node.getAttribute("name") == nameattrval)) { + continue; + } + ret.push(node); + } + return ret; +} +CSL_CHROME.prototype.nodeNameIs = function (myxml,name) { + if (name == myxml.nodeName) { + return true; + } + return false; +} +CSL_CHROME.prototype.makeXml = function (myxml) { + var ret, topnode; + if (!myxml) { + myxml = ""; + } + myxml = myxml.replace(/\s*<\?[^>]*\?>\s*\n*/g, ""); + var nodetree = this.parser.parseFromString(myxml, "application/xml"); + return nodetree.firstChild; +}; +CSL_CHROME.prototype.insertChildNodeAfter = function (parent,node,pos,datexml) { + var myxml, xml; + myxml = this.importNode(node.ownerDocument, datexml); + parent.replaceChild(myxml, node); + return parent; +}; +CSL_CHROME.prototype.insertPublisherAndPlace = function(myxml) { + var group = myxml.getElementsByTagName("group"); + for (var i = 0, ilen = group.length; i < ilen; i += 1) { + var node = group.item(i); + var skippers = []; + for (var j = 0, jlen = node.childNodes.length; j < jlen; j += 1) { + if (node.childNodes.item(j).nodeType !== 1) { + skippers.push(j); + } + } + if (node.childNodes.length - skippers.length === 2) { + var twovars = []; + for (var j = 0, jlen = 2; j < jlen; j += 1) { + if (skippers.indexOf(j) > -1) { + continue; + } + var child = node.childNodes.item(j); + var subskippers = []; + for (var k = 0, klen = child.childNodes.length; k < klen; k += 1) { + if (child.childNodes.item(k).nodeType !== 1) { + subskippers.push(k); + } + } + if (child.childNodes.length - subskippers.length === 0) { + twovars.push(child.getAttribute('variable')); + if (child.getAttribute('suffix') + || child.getAttribute('prefix')) { + twovars = []; + break; + } + } + } + if (twovars.indexOf("publisher") > -1 && twovars.indexOf("publisher-place") > -1) { + node.setAttribute('has-publisher-and-publisher-place', true); + } + } + } +}; +CSL_CHROME.prototype.addMissingNameNodes = function(myxml) { + var nameslist = myxml.getElementsByTagName("names"); + for (var i = 0, ilen = nameslist.length; i < ilen; i += 1) { + var names = nameslist.item(i); + var namelist = names.getElementsByTagName("name"); + if ((!namelist || namelist.length === 0) + && names.parentNode.tagName.toLowerCase() !== "substitute") { + var doc = names.ownerDocument; + var name = doc.createElement("name"); + names.appendChild(name); + } + } +}; +CSL_CHROME.prototype.addInstitutionNodes = function(myxml) { + var names, thenames, institution, theinstitution, name, thename, xml, pos, len; + names = myxml.getElementsByTagName("names"); + for (pos = 0, len = names.length; pos < len; pos += 1) { + thenames = names.item(pos); + name = thenames.getElementsByTagName("name"); + if (name.length == 0) { + continue; + } + institution = thenames.getElementsByTagName("institution"); + if (institution.length == 0) { + theinstitution = this.importNode(myxml.ownerDocument, this.institution); + theinstitutionpart = theinstitution.getElementsByTagName("institution-part").item(0); + thename = name.item(0); + thenames.insertBefore(theinstitution, thename.nextSibling); + for (var j = 0, jlen = CSL.INSTITUTION_KEYS.length; j < jlen; j += 1) { + var attrname = CSL.INSTITUTION_KEYS[j]; + var attrval = thename.getAttribute(attrname); + if (attrval) { + theinstitutionpart.setAttribute(attrname, attrval); + } + } + var nameparts = thename.getElementsByTagName("name-part"); + for (var j = 0, jlen = nameparts.length; j < jlen; j += 1) { + if ('family' === nameparts[j].getAttribute('name')) { + for (var k = 0, klen = CSL.INSTITUTION_KEYS.length; k < klen; k += 1) { + var attrname = CSL.INSTITUTION_KEYS[k]; + var attrval = nameparts[j].getAttribute(attrname); + if (attrval) { + theinstitutionpart.setAttribute(attrname, attrval); + } + } + } + } + } + } +}; +CSL_CHROME.prototype.flagDateMacros = function(myxml) { + var pos, len, thenode, thedate; + nodes = myxml.getElementsByTagName("macro"); + for (pos = 0, len = nodes.length; pos < len; pos += 1) { + thenode = nodes.item(pos); + thedate = thenode.getElementsByTagName("date"); + if (thedate.length) { + thenode.setAttribute('macro-has-date', 'true'); + } + } +}; \ No newline at end of file diff --git a/chrome/content/zotero/xpcom/citeproc.js b/chrome/content/zotero/xpcom/citeproc.js index ad318b1f6..30f3c945f 100644 --- a/chrome/content/zotero/xpcom/citeproc.js +++ b/chrome/content/zotero/xpcom/citeproc.js @@ -80,18 +80,17 @@ if (!Array.indexOf) { }; } var CSL = { - PROCESSOR_VERSION: "1.0.543", + PROCESSOR_VERSION: "1.1.25", CONDITION_LEVEL_TOP: 1, CONDITION_LEVEL_BOTTOM: 2, PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/, - LOCATOR_LABELS_REGEXP: new RegExp("^((art|ch|Ch|subch|col|fig|l|n|no|op|p|pp|para|subpara|pt|r|sec|subsec|Sec|sv|sch|tit|vrs|vol)\\.)\\s+(.*)"), - STATUTE_SUBDIV_GROUPED_REGEX: /((?:^| )(?:art|ch|Ch|subch|p|pp|para|subpara|pt|r|sec|subsec|Sec|sch|tit)\.)/g, - STATUTE_SUBDIV_PLAIN_REGEX: /(?:(?:^| )(?:art|ch|Ch|subch|p|pp|para|subpara|pt|r|sec|subsec|Sec|sch|tit)\.)/, + LOCATOR_LABELS_REGEXP: new RegExp("^((art|ch|subch|col|fig|l|n|no|op|p|pp|para|subpara|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\\.)\\s+(.*)"), + STATUTE_SUBDIV_GROUPED_REGEX: /((?:^| )(?:art|ch|subch|p|pp|para|subpara|pt|r|sec|subsec|sch|tit)\.)/g, + STATUTE_SUBDIV_PLAIN_REGEX: /(?:(?:^| )(?:art|ch|subch|p|pp|para|subpara|pt|r|sec|subsec|sch|tit)\.)/, STATUTE_SUBDIV_STRINGS: { "art.": "article", "bk.": "book", "ch.": "chapter", - "Ch.": "Chapter", "subch.": "subchapter", "p.": "page", "pp.": "page", @@ -101,7 +100,6 @@ var CSL = { "r.": "rule", "sec.": "section", "subsec.": "subsection", - "Sec.": "Section", "sch.": "schedule", "tit.": "title", "col.": "column", @@ -119,7 +117,6 @@ var CSL = { "article": "art.", "book": "bk.", "chapter": "ch.", - "Chapter": "Ch.", "subchapter": "subch.", "page": "p.", "paragraph": "para.", @@ -128,7 +125,6 @@ var CSL = { "rule": "r.", "section": "sec.", "subsection": "subsec.", - "Section": "Sec.", "schedule": "sch.", "title": "tit.", "column": "col.", @@ -147,7 +143,6 @@ var CSL = { "art": "article", "bk": "book", "ch": "chapter", - "Ch": "Chapter", "subch": "subchapter", "col": "column", "fig": "figure", @@ -162,15 +157,37 @@ var CSL = { "subpara": "subparagraph", "pt": "part", "r": "rule", - "sec": "section", - "subsec": "subsection", - "Sec": "Section", - "sv": "sub-verbo", + "sec": "section", + "subsec": "subsection", + "sv": "sub-verbo", "sch": "schedule", "tit": "title", "vrs": "verse", "vol": "volume" }, + MODULE_MACROS: { + "juris-title": true, + "juris-title-short": true, + "juris-main": true, + "juris-main-short": true, + "juris-comma-spotter": true, + "juris-default-spotter": true, + "juris-comma-spotter-short": true, + "juris-default-spotter-short": true, + "juris-locator": true, + "juris-locator-label": true, + "juris-tail": true, + "juris-tail-short": true + }, + MODULE_TYPES: { + "legal_case": true, + "legislation": true, + "bill": true, + "hearing": true, + "gazette": true, + "report": true, + "regulation": true + }, NestedBraces: [ ["(", "["], [")", "]"] @@ -235,7 +252,7 @@ var CSL = { POSITION_TEST_VARS: ["position", "first-reference-note-number", "near-note"], AREAS: ["citation", "citation_sort", "bibliography", "bibliography_sort"], MULTI_FIELDS: ["event", "publisher", "publisher-place", "event-place", "title", "container-title", "collection-title", "authority","edition","genre","title-short","medium","jurisdiction","archive","archive-place"], - CITE_FIELDS: ["first-reference-note-number", "locator", "locator-revision"], + CITE_FIELDS: ["first-reference-note-number", "locator", "locator-extra"], MINIMAL_NAME_FIELDS: ["literal", "family"], SWAPPING_PUNCTUATION: [".", "!", "?", ":", ","], TERMINAL_PUNCTUATION: [":", ".", ";", "!", "?", " "], @@ -375,7 +392,7 @@ var CSL = { ret[ret.length - 1] += str; return ret; }, - SKIP_WORDS: ["about","above","across","afore","after","against","along","alongside","amid","amidst","among","amongst","anenst","apropos","apud","around","as","aside","astride","at","athwart","atop","barring","before","behind","below","beneath","beside","besides","between","beyond","but","by","circa","despite","down","during","except","for","forenenst","from","given","in","inside","into","lest","like","modulo","near","next","notwithstanding","of","off","on","onto","out","over","per","plus","pro","qua","sans","since","than","through"," thru","throughout","thruout","till","to","toward","towards","under","underneath","until","unto","up","upon","versus","vs.","v.","vs","v","via","vis-à-vis","with","within","without","according to","ahead of","apart from","as for","as of","as per","as regards","aside from","back to","because of","close to","due to","except for","far from","inside of","instead of","near to","next to","on to","out from","out of","outside of","prior to","pursuant to","rather than","regardless of","such as","that of","up to","where as","or", "yet", "so", "for", "and", "nor", "a", "an", "the", "de", "d'", "von", "van", "c", "et", "ca"], + SKIP_WORDS: ["about","above","across","afore","after","against","along","alongside","amid","amidst","among","amongst","anenst","apropos","apud","around","as","aside","astride","at","athwart","atop","barring","before","behind","below","beneath","beside","besides","between","beyond","but","by","circa","despite","down","during","except","for","forenenst","from","given","in","inside","into","lest","like","modulo","near","next","notwithstanding","of","off","on","onto","out","over","per","plus","pro","qua","sans","since","than","through"," thru","throughout","thruout","till","to","toward","towards","under","underneath","until","unto","up","upon","versus","vs.","v.","vs","v","via","vis-à -vis","with","within","without","according to","ahead of","apart from","as for","as of","as per","as regards","aside from","back to","because of","close to","due to","except for","far from","inside of","instead of","near to","next to","on to","out from","out of","outside of","prior to","pursuant to","rather than","regardless of","such as","that of","up to","where as","or", "yet", "so", "for", "and", "nor", "a", "an", "the", "de", "d'", "von", "van", "c", "et", "ca"], FORMAT_KEY_SEQUENCE: [ "@strip-periods", "@font-style", @@ -442,7 +459,7 @@ var CSL = { "lt-LT":"Lithuanian", "lv-LV":"Latvian", "mn-MN":"Mongolian", - "nb-NO":"Norwegian (Bokmål)", + "nb-NO":"Norwegian (BokmÃ¥l)", "nl-NL":"Dutch", "nn-NO":"Norwegian (Nynorsk)", "pl-PL":"Polish", @@ -478,6 +495,7 @@ var CSL = { fi: "fi_FI", fr: "fr_FR", he: "he_IL", + hr: "hr-HR", hu: "hu_HU", is: "is_IS", it: "it_IT", @@ -485,6 +503,7 @@ var CSL = { km: "km_KH", ko: "ko_KR", lt: "lt_LT", + lv: "lv-LV", mn: "mn_MN", nb: "nb_NO", nl: "nl_NL", @@ -621,395 +640,19 @@ if (typeof require !== "undefined" && typeof module !== 'undefined' && "exports" } CSL.TERMINAL_PUNCTUATION_REGEXP = new RegExp("^([" + CSL.TERMINAL_PUNCTUATION.slice(0, -1).join("") + "])(.*)"); CSL.CLOSURES = new RegExp(".*[\\]\\)]"); -CSL.debug = function (str) { - Zotero.debug("CSL: " + str); -}; -CSL.error = function (str) { - Zotero.debug("CSL error: " + str); -}; -function DOMParser() { - return Components.classes["@mozilla.org/xmlextras/domparser;1"] - .createInstance(Components.interfaces.nsIDOMParser); -}; -if ("undefined" === typeof CSL_IS_IE) { - var CSL_IS_IE; -}; -var CSL_CHROME = function () { - if ("undefined" == typeof DOMParser || CSL_IS_IE) { - CSL_IS_IE = true; - DOMParser = function() {}; - DOMParser.prototype.parseFromString = function(str, contentType) { - if ("undefined" != typeof ActiveXObject) { - var xmldata = new ActiveXObject('MSXML.DomDocument'); - xmldata.async = false; - xmldata.loadXML(str); - return xmldata; - } else if ("undefined" != typeof XMLHttpRequest) { - var xmldata = new XMLHttpRequest; - if (!contentType) { - contentType = 'text/xml'; - } - xmldata.open('GET', 'data:' + contentType + ';charset=utf-8,' + encodeURIComponent(str), false); - if(xmldata.overrideMimeType) { - xmldata.overrideMimeType(contentType); - } - xmldata.send(null); - return xmldata.responseXML; - } - }; - this.hasAttributes = function (node) { - var ret; - if (node.attributes && node.attributes.length) { - ret = true; - } else { - ret = false; - } - return ret; - }; - } else { - this.hasAttributes = function (node) { - var ret; - if (node.attributes && node.attributes.length) { - ret = true; - } else { - ret = false; - } - return ret; - }; - } - this.importNode = function (doc, srcElement) { - if ("undefined" == typeof doc.importNode) { - var ret = this._importNode(doc, srcElement, true); - } else { - var ret = doc.importNode(srcElement, true); - } - return ret; +if ("object" === typeof console && "function" === typeof console.log) { + CSL.debug = function (str) { + console.log("CSL: " + str); }; - this._importNode = function(doc, node, allChildren) { - switch (node.nodeType) { - case 1: - var newNode = doc.createElement(node.nodeName); - if (node.attributes && node.attributes.length > 0) - for (var i = 0, il = node.attributes.length; i < il;) - newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i++].nodeName)); - if (allChildren && node.childNodes && node.childNodes.length > 0) - for (var i = 0, il = node.childNodes.length; i < il;) - newNode.appendChild(this._importNode(doc, node.childNodes[i++], allChildren)); - return newNode; - break; - case 3: - case 4: - case 8: - } + CSL.error = function (str) { + console.log("CSL error: " + str); + }; +} else { + CSL.debug = function () {}; + CSL.error = function (str) { + throw "CSL error: " + str; }; - this.parser = new DOMParser(); - var str = ""; - var inst_doc = this.parser.parseFromString(str, "text/xml"); - var inst_node = inst_doc.getElementsByTagName("institution"); - this.institution = inst_node.item(0); - var inst_part_node = inst_doc.getElementsByTagName("institution-part"); - this.institutionpart = inst_part_node.item(0); - this.ns = "http://purl.org/net/xbiblio/csl"; -}; -CSL_CHROME.prototype.clean = function (xml) { - xml = xml.replace(/<\?[^?]+\?>/g, ""); - xml = xml.replace(/]+>/g, ""); - xml = xml.replace(/^\s+/, ""); - xml = xml.replace(/\s+$/, ""); - xml = xml.replace(/^\n*/, ""); - return xml; -}; -CSL_CHROME.prototype.getStyleId = function (myxml, styleName) { - var text = ""; - var tagName = "id"; - if (styleName) { - tagName = "title"; - } - var node = myxml.getElementsByTagName(tagName); - if (node && node.length) { - node = node.item(0); - } - if (node) { - text = node.textContent; - } - if (!text) { - text = node.innerText; - } - if (!text) { - text = node.innerHTML; - } - return text; -}; -CSL_CHROME.prototype.children = function (myxml) { - var children, pos, len, ret; - if (myxml) { - ret = []; - children = myxml.childNodes; - for (pos = 0, len = children.length; pos < len; pos += 1) { - if (children[pos].nodeName != "#text") { - ret.push(children[pos]); - } - } - return ret; - } else { - return []; - } -}; -CSL_CHROME.prototype.nodename = function (myxml) { - var ret = myxml.nodeName; - return ret; -}; -CSL_CHROME.prototype.attributes = function (myxml) { - var ret, attrs, attr, key, xml, pos, len; - ret = new Object(); - if (myxml && this.hasAttributes(myxml)) { - attrs = myxml.attributes; - for (pos = 0, len=attrs.length; pos < len; pos += 1) { - attr = attrs[pos]; - ret["@" + attr.name] = attr.value; - } - } - return ret; -}; -CSL_CHROME.prototype.content = function (myxml) { - var ret; - if ("undefined" != typeof myxml.textContent) { - ret = myxml.textContent; - } else if ("undefined" != typeof myxml.innerText) { - ret = myxml.innerText; - } else { - ret = myxml.txt; - } - return ret; -}; -CSL_CHROME.prototype.namespace = { - "xml":"http://www.w3.org/XML/1998/namespace" } -CSL_CHROME.prototype.numberofnodes = function (myxml) { - if (myxml) { - return myxml.length; - } else { - return 0; - } -}; -CSL_CHROME.prototype.getAttributeName = function (attr) { - var ret = attr.name; - return ret; -} -CSL_CHROME.prototype.getAttributeValue = function (myxml,name,namespace) { - var ret = ""; - if (namespace) { - name = namespace+":"+name; - } - if (myxml && this.hasAttributes(myxml) && myxml.getAttribute(name)) { - ret = myxml.getAttribute(name); - } - return ret; -} -CSL_CHROME.prototype.getNodeValue = function (myxml,name) { - var ret = null; - if (name){ - var vals = myxml.getElementsByTagName(name); - if (vals.length > 0) { - if ("undefined" != typeof vals[0].textContent) { - ret = vals[0].textContent; - } else if ("undefined" != typeof vals[0].innerText) { - ret = vals[0].innerText; - } else { - ret = vals[0].text; - } - } - } - if (ret === null && myxml && myxml.childNodes && (myxml.childNodes.length == 0 || (myxml.childNodes.length == 1 && myxml.firstChild.nodeName == "#text"))) { - if ("undefined" != typeof myxml.textContent) { - ret = myxml.textContent; - } else if ("undefined" != typeof myxml.innerText) { - ret = myxml.innerText; - } else { - ret = myxml.text; - } - } - if (ret === null) { - ret = myxml; - } - return ret; -} -CSL_CHROME.prototype.setAttributeOnNodeIdentifiedByNameAttribute = function (myxml,nodename,partname,attrname,val) { - var pos, len, xml, nodes, node; - if (attrname.slice(0,1) === '@'){ - attrname = attrname.slice(1); - } - nodes = myxml.getElementsByTagName(nodename); - for (pos = 0, len = nodes.length; pos < len; pos += 1) { - node = nodes[pos]; - if (node.getAttribute("name") != partname) { - continue; - } - node.setAttribute(attrname, val); - } -} -CSL_CHROME.prototype.deleteNodeByNameAttribute = function (myxml,val) { - var pos, len, node, nodes; - nodes = myxml.childNodes; - for (pos = 0, len = nodes.length; pos < len; pos += 1) { - node = nodes[pos]; - if (!node || node.nodeType == node.TEXT_NODE) { - continue; - } - if (this.hasAttributes(node) && node.getAttribute("name") == val) { - myxml.removeChild(nodes[pos]); - } - } -} -CSL_CHROME.prototype.deleteAttribute = function (myxml,attr) { - myxml.removeAttribute(attr); -} -CSL_CHROME.prototype.setAttribute = function (myxml,attr,val) { - if (!myxml.ownerDocument) { - myxml = myxml.firstChild; - } - if (["function", "unknown"].indexOf(typeof myxml.setAttribute) > -1) { - myxml.setAttribute(attr, val); - } - return false; -} -CSL_CHROME.prototype.nodeCopy = function (myxml) { - var cloned_node = myxml.cloneNode(true); - return cloned_node; -} -CSL_CHROME.prototype.getNodesByName = function (myxml,name,nameattrval) { - var ret, nodes, node, pos, len; - ret = []; - nodes = myxml.getElementsByTagName(name); - for (pos = 0, len = nodes.length; pos < len; pos += 1) { - node = nodes.item(pos); - if (nameattrval && !(this.hasAttributes(node) && node.getAttribute("name") == nameattrval)) { - continue; - } - ret.push(node); - } - return ret; -} -CSL_CHROME.prototype.nodeNameIs = function (myxml,name) { - if (name == myxml.nodeName) { - return true; - } - return false; -} -CSL_CHROME.prototype.makeXml = function (myxml) { - var ret, topnode; - if (!myxml) { - myxml = ""; - } - myxml = myxml.replace(/\s*<\?[^>]*\?>\s*\n*/g, ""); - var nodetree = this.parser.parseFromString(myxml, "application/xml"); - return nodetree.firstChild; -}; -CSL_CHROME.prototype.insertChildNodeAfter = function (parent,node,pos,datexml) { - var myxml, xml; - myxml = this.importNode(node.ownerDocument, datexml); - parent.replaceChild(myxml, node); - return parent; -}; -CSL_CHROME.prototype.insertPublisherAndPlace = function(myxml) { - var group = myxml.getElementsByTagName("group"); - for (var i = 0, ilen = group.length; i < ilen; i += 1) { - var node = group.item(i); - var skippers = []; - for (var j = 0, jlen = node.childNodes.length; j < jlen; j += 1) { - if (node.childNodes.item(j).nodeType !== 1) { - skippers.push(j); - } - } - if (node.childNodes.length - skippers.length === 2) { - var twovars = []; - for (var j = 0, jlen = 2; j < jlen; j += 1) { - if (skippers.indexOf(j) > -1) { - continue; - } - var child = node.childNodes.item(j); - var subskippers = []; - for (var k = 0, klen = child.childNodes.length; k < klen; k += 1) { - if (child.childNodes.item(k).nodeType !== 1) { - subskippers.push(k); - } - } - if (child.childNodes.length - subskippers.length === 0) { - twovars.push(child.getAttribute('variable')); - if (child.getAttribute('suffix') - || child.getAttribute('prefix')) { - twovars = []; - break; - } - } - } - if (twovars.indexOf("publisher") > -1 && twovars.indexOf("publisher-place") > -1) { - node.setAttribute('has-publisher-and-publisher-place', true); - } - } - } -}; -CSL_CHROME.prototype.addMissingNameNodes = function(myxml) { - var nameslist = myxml.getElementsByTagName("names"); - for (var i = 0, ilen = nameslist.length; i < ilen; i += 1) { - var names = nameslist.item(i); - var namelist = names.getElementsByTagName("name"); - if ((!namelist || namelist.length === 0) - && names.parentNode.tagName.toLowerCase() !== "substitute") { - var doc = names.ownerDocument; - var name = doc.createElement("name"); - names.appendChild(name); - } - } -}; -CSL_CHROME.prototype.addInstitutionNodes = function(myxml) { - var names, thenames, institution, theinstitution, name, thename, xml, pos, len; - names = myxml.getElementsByTagName("names"); - for (pos = 0, len = names.length; pos < len; pos += 1) { - thenames = names.item(pos); - name = thenames.getElementsByTagName("name"); - if (name.length == 0) { - continue; - } - institution = thenames.getElementsByTagName("institution"); - if (institution.length == 0) { - theinstitution = this.importNode(myxml.ownerDocument, this.institution); - theinstitutionpart = theinstitution.getElementsByTagName("institution-part").item(0); - thename = name.item(0); - thenames.insertBefore(theinstitution, thename.nextSibling); - for (var j = 0, jlen = CSL.INSTITUTION_KEYS.length; j < jlen; j += 1) { - var attrname = CSL.INSTITUTION_KEYS[j]; - var attrval = thename.getAttribute(attrname); - if (attrval) { - theinstitutionpart.setAttribute(attrname, attrval); - } - } - var nameparts = thename.getElementsByTagName("name-part"); - for (var j = 0, jlen = nameparts.length; j < jlen; j += 1) { - if ('family' === nameparts[j].getAttribute('name')) { - for (var k = 0, klen = CSL.INSTITUTION_KEYS.length; k < klen; k += 1) { - var attrname = CSL.INSTITUTION_KEYS[k]; - var attrval = nameparts[j].getAttribute(attrname); - if (attrval) { - theinstitutionpart.setAttribute(attrname, attrval); - } - } - } - } - } - } -}; -CSL_CHROME.prototype.flagDateMacros = function(myxml) { - var pos, len, thenode, thedate; - nodes = myxml.getElementsByTagName("macro"); - for (pos = 0, len = nodes.length; pos < len; pos += 1) { - thenode = nodes.item(pos); - thedate = thenode.getElementsByTagName("date"); - if (thedate.length) { - thenode.setAttribute('macro-has-date', 'true'); - } - } -}; var XML_PARSING; if ("undefined" !== typeof CSL_IS_NODEJS) { XML_PARSING = CSL_NODEJS; @@ -1130,7 +773,7 @@ CSL.getMinVal = function () { return this.tmp["et-al-min"]; }; CSL.tokenExec = function (token, Item, item) { - var next, maybenext, exec, pos, len, debug; + var next, maybenext, exec, debug; debug = false; next = token.next; maybenext = false; @@ -1146,9 +789,8 @@ CSL.tokenExec = function (token, Item, item) { if (token.test) { next = record.call(this,token.test(Item, item)); } - len = token.execs.length; - for (pos = 0; pos < len; pos += 1) { - exec = token.execs[pos]; + for (var i=0,ilen=token.execs.length;i -1) { - throw "CSL processor error: call to macro \"" + mkey + "\" would cause an infinite loop"; - } else { - this.build.macro_stack.push(mkey); - } + var alt_macro = macro_key_token.alt_macro; + macro_key_token = new CSL.Token("group", CSL.START); var hasDate = false; var macroid = false; macro_nodes = this.sys.xml.getNodesByName(this.cslXml, 'macro', mkey); @@ -1172,6 +811,7 @@ CSL.expandMacro = function (macro_key_token) { hasDate = this.sys.xml.getAttributeValue(macro_nodes[0], "macro-has-date"); } if (hasDate) { + mkey = mkey + "@" + this.build.current_default_locale; func = function (state, Item) { if (state.tmp.extension) { state.tmp["doing-macro-with-date"] = true; @@ -1179,18 +819,53 @@ CSL.expandMacro = function (macro_key_token) { }; macro_key_token.execs.push(func); } - macro_key_token.tokentype = CSL.START; + if (this.build.macro_stack.indexOf(mkey) > -1) { + throw "CSL processor error: call to macro \"" + mkey + "\" would cause an infinite loop"; + } else { + this.build.macro_stack.push(mkey); + } macro_key_token.cslid = macroid; - CSL.Node.group.build.call(macro_key_token, this, this[this.build.area].tokens, true); + if (CSL.MODULE_MACROS[mkey]) { + macro_key_token.juris = mkey; + this.opt.update_mode = CSL.POSITION; + } + CSL.Node.group.build.call(macro_key_token, this, target); if (!this.sys.xml.getNodeValue(macro_nodes)) { throw "CSL style error: undefined macro \"" + mkey + "\""; } - var builder = CSL.makeBuilder(this); - builder(macro_nodes[0]); - end_of_macro = new CSL.Token("group", CSL.END); - if (macro_key_token.decorations) { - end_of_macro.decorations = macro_key_token.decorations.slice(); + var mytarget = CSL.getMacroTarget.call(this, mkey); + if (mytarget) { + CSL.buildMacro.call(this, mytarget, macro_nodes); + CSL.configureMacro.call(this, mytarget); } + if (!this.build.extension) { + var func = function(macro_name, alt_macro) { + return function (state, Item, item) { + var next = 0; + while (next < state.macros[macro_name].length) { + next = CSL.tokenExec.call(state, state.macros[macro_name][next], Item, item); + } + var flag = state.tmp.group_context.value(); + if (((flag[1] && !flag[2]) || (!flag[0] && !flag[1])) && alt_macro) { + flag[1] = false; + var mytarget = CSL.getMacroTarget.call(state, alt_macro); + if (mytarget) { + var macro_nodes = state.sys.xml.getNodesByName(state.cslXml, 'macro', alt_macro); + CSL.buildMacro.call(state, mytarget, macro_nodes); + CSL.configureMacro.call(state, mytarget); + } + var next = 0; + while (next < state.macros[alt_macro].length) { + next = CSL.tokenExec.call(state, state.macros[alt_macro][next], Item, item); + } + } + } + }(mkey, alt_macro); + var text_node = new CSL.Token("text", CSL.SINGLETON); + text_node.execs.push(func); + target.push(text_node); + } + end_of_macro = new CSL.Token("group", CSL.END); if (hasDate) { func = function (state, Item) { if (state.tmp.extension) { @@ -1199,10 +874,45 @@ CSL.expandMacro = function (macro_key_token) { }; end_of_macro.execs.push(func); } - CSL.Node.group.build.call(end_of_macro, this, this[this.build.area].tokens, true); + if (macro_key_token.juris) { + end_of_macro.juris = mkey; + if (alt_macro) { + end_of_macro.alt_macro = alt_macro; + } + } + CSL.Node.group.build.call(end_of_macro, this, target); this.build.macro_stack.pop(); }; -CSL.XmlToToken = function (state, tokentype) { +CSL.getMacroTarget = function (mkey) { + var mytarget; + if (this.build.extension) { + mytarget = this[this.build.root + this.build.extension].tokens; + } else { + if (!this.macros[mkey]) { + mytarget = []; + this.macros[mkey] = mytarget; + } else { + mytarget = false; + } + } + return mytarget; +} +CSL.buildMacro = function (mytarget, macro_nodes) { + var builder = CSL.makeBuilder(this, mytarget); + var mynode; + if ("undefined" === typeof macro_nodes.length) { + mynode = macro_nodes; + } else { + mynode = macro_nodes[0]; + } + builder(mynode); +} +CSL.configureMacro = function (mytarget) { + if (!this.build.extension) { + this.configureTokenList(mytarget); + } +} +CSL.XmlToToken = function (state, tokentype, explicitTarget) { var name, txt, attrfuncs, attributes, decorations, token, key, target; name = state.sys.xml.nodename(this); if (state.build.skip && state.build.skip !== name) { @@ -1246,7 +956,11 @@ CSL.XmlToToken = function (state, tokentype) { } else if (tokentype === CSL.END && attributes['@variable']) { token.hasVariable = true; } - target = state[state.build.area].tokens; + if (explicitTarget) { + target = explicitTarget; + } else { + target = state[state.build.area].tokens; + } CSL.Node[name].build.call(token, state, target); }; CSL.DateParser = function () { @@ -1391,7 +1105,7 @@ CSL.DateParser = function () { }; this.parse = function (txt) { var slash, dash, lst, l, m, number, note, thedate, slashcount, range_delim, date_delim, ret, delim_pos, delims, isrange, suff, date, breakme, item, delim, element, mm, slst, mmpos, i, ilen, j, jlen, k, klen; - if (txt) { + if (txt) { txt = "" + txt; txt = txt.replace(/\s*[0-9]{2}:[0-9]{2}(?::[0-9]+)/,""); m = txt.match(jmd); @@ -1433,7 +1147,7 @@ CSL.DateParser = function () { slash = txt.indexOf("/"); dash = txt.indexOf("-"); } - } + } txt = txt.replace(/([A-Za-z])\./g, "$1"); number = ""; note = ""; @@ -1639,9 +1353,15 @@ CSL.Engine = function (sys, style, lang, forceLang) { if ("undefined" === typeof CSL_JSON && "string" !== typeof style) { style = ""; } + if (CSL.retrieveStyleModule) { + this.sys.retrieveStyleModule = CSL.retrieveStyleModule; + } if (CSL.getAbbreviation) { this.sys.getAbbreviation = CSL.getAbbreviation; } + if (CSL.suppressJurisdictions) { + this.sys.suppressJurisdictions = CSL.suppressJurisdictions; + } if (this.sys.stringCompare) { CSL.stringCompare = this.sys.stringCompare; } @@ -1690,11 +1410,12 @@ CSL.Engine = function (sys, style, lang, forceLang) { this.opt["initialize-with-hyphen"] = true; this.setStyleAttributes(); this.opt.xclass = sys.xml.getAttributeValue(this.cslXml, "class"); + this.opt.class = this.opt.xclass; this.opt.styleID = this.sys.xml.getStyleId(this.cslXml); - this.opt.styleName = this.sys.xml.getStyleId(this.cslXml, true); - if (CSL.getSuppressJurisdictions) { - this.opt.suppressJurisdictions = CSL.getSuppressJurisdictions(this.opt.styleID); + if (CSL.setSuppressJurisdictions) { + CSL.setSuppressJurisdictions(this.opt.styleID); } + this.opt.styleName = this.sys.xml.getStyleId(this.cslXml, true); if (this.opt.version.slice(0,4) === "1.1m") { this.opt.development_extensions.static_statute_locator = true; this.opt.development_extensions.handle_parallel_articles = true; @@ -1741,8 +1462,14 @@ CSL.Engine = function (sys, style, lang, forceLang) { this.locale[this.opt.lang].opts["skip-words-regexp"] = makeRegExp(this.locale[this.opt.lang].opts["skip-words"]); this.output.adjust = new CSL.Output.Queue.adjust(this.getOpt('punctuation-in-quote')); this.registry = new CSL.Registry(this); - this.buildTokenLists("citation"); - this.buildTokenLists("bibliography"); + this.macros = {}; + this.build.area = "citation"; + var area_nodes = this.sys.xml.getNodesByName(this.cslXml, this.build.area); + this.buildTokenLists(area_nodes, this[this.build.area].tokens); + this.build.area = "bibliography"; + var area_nodes = this.sys.xml.getNodesByName(this.cslXml, this.build.area); + this.buildTokenLists(area_nodes, this[this.build.area].tokens); + this.juris = {}; this.configureTokenLists(); this.disambiguate = new CSL.Disambiguation(this); this.splice_delimiter = false; @@ -1764,15 +1491,15 @@ CSL.Engine.prototype.setCloseQuotesArray = function () { ret.push("'"); this.opt.close_quotes_array = ret; }; -CSL.makeBuilder = function (me) { +CSL.makeBuilder = function (me, target) { function enterFunc (node) { - CSL.XmlToToken.call(node, me, CSL.START); + CSL.XmlToToken.call(node, me, CSL.START, target); }; function leaveFunc (node) { - CSL.XmlToToken.call(node, me, CSL.END); + CSL.XmlToToken.call(node, me, CSL.END, target); }; function singletonFunc (node) { - CSL.XmlToToken.call(node, me, CSL.SINGLETON); + CSL.XmlToToken.call(node, me, CSL.SINGLETON, target); }; function buildStyle (node) { var starttag, origparent; @@ -1797,22 +1524,22 @@ CSL.makeBuilder = function (me) { } return buildStyle; }; -CSL.Engine.prototype.buildTokenLists = function (area) { - var builder = CSL.makeBuilder(this); - var area_nodes; - area_nodes = this.sys.xml.getNodesByName(this.cslXml, area); - if (!this.sys.xml.getNodeValue(area_nodes)) { - return; +CSL.Engine.prototype.buildTokenLists = function (area_nodes, target) { + if (!this.sys.xml.getNodeValue(area_nodes)) return; + var builder = CSL.makeBuilder(this, target); + var mynode; + if ("undefined" === typeof area_nodes.length) { + mynode = area_nodes; + } else { + mynode = area_nodes[0]; } - this.build.area = area; - var mynode = area_nodes[0]; builder(mynode); }; CSL.Engine.prototype.setStyleAttributes = function () { var dummy, attr, key, attributes, attrname; dummy = {}; var cslXml = this.cslXml; - var tagName = this.cslXml.tagName ? ("" + this.cslXml.tagName).toLowerCase() : ""; + var tagName = this.cslXml.tagName ? ("" + this.cslXml.tagName).toLowerCase() : ""; if (tagName !== 'style' && tagName !== 'cslstyle') { if (this.cslXml.getElementsByTagName) { var cslXml = this.cslXml.getElementsByTagName('style')[0]; @@ -1929,38 +1656,43 @@ CSL.Engine.getField = function (mode, hash, term, form, plural, gender) { }; CSL.Engine.prototype.configureTokenLists = function () { var dateparts_master, area, pos, token, dateparts, part, ppos, pppos, len, llen, lllen; - dateparts_master = ["year", "month", "day"]; len = CSL.AREAS.length; for (pos = 0; pos < len; pos += 1) { area = CSL.AREAS[pos]; - llen = this[area].tokens.length - 1; - for (ppos = llen; ppos > -1; ppos += -1) { - token = this[area].tokens[ppos]; - if ("date" === token.name && CSL.END === token.tokentype) { - dateparts = []; - } - if ("date-part" === token.name && token.strings.name) { - lllen = dateparts_master.length; - for (pppos = 0; pppos < lllen; pppos += 1) { - part = dateparts_master[pppos]; - if (part === token.strings.name) { - dateparts.push(token.strings.name); - } - } - } - if ("date" === token.name && CSL.START === token.tokentype) { - dateparts.reverse(); - token.dateparts = dateparts; - } - token.next = (ppos + 1); - if (token.name && CSL.Node[token.name].configure) { - CSL.Node[token.name].configure.call(token, this, ppos); - } - } + var tokens = this[area].tokens; + this.configureTokenList(tokens); } this.version = CSL.version; return this.state; }; +CSL.Engine.prototype.configureTokenList = function (tokens) { + var dateparts_master, area, pos, token, dateparts, part, ppos, pppos, len, llen, lllen; + dateparts_master = ["year", "month", "day"]; + llen = tokens.length - 1; + for (ppos = llen; ppos > -1; ppos += -1) { + token = tokens[ppos]; + if ("date" === token.name && CSL.END === token.tokentype) { + dateparts = []; + } + if ("date-part" === token.name && token.strings.name) { + lllen = dateparts_master.length; + for (pppos = 0; pppos < lllen; pppos += 1) { + part = dateparts_master[pppos]; + if (part === token.strings.name) { + dateparts.push(token.strings.name); + } + } + } + if ("date" === token.name && CSL.START === token.tokentype) { + dateparts.reverse(); + token.dateparts = dateparts; + } + token.next = (ppos + 1); + if (token.name && CSL.Node[token.name].configure) { + CSL.Node[token.name].configure.call(token, this, ppos); + } + } +} CSL.Engine.prototype.retrieveItems = function (ids) { var ret, pos, len; ret = []; @@ -2030,7 +1762,7 @@ CSL.Engine.prototype.retrieveItem = function (id) { if (Item.page) { Item["page-first"] = Item.page; var num = "" + Item.page; - m = num.split(/\s*(?:&|,|-|\u2013)\s*/); + m = num.split(/\s*(?:&|, |-|\u2013)\s*/); if (m[0].slice(-1) !== "\\") { Item["page-first"] = m[0]; } @@ -2072,26 +1804,26 @@ CSL.Engine.prototype.retrieveItem = function (id) { } } if (this.opt.development_extensions.static_statute_locator) { - if (Item.type && ["bill","gazette","legislation","treaty"].indexOf(Item.type) > -1) { + if (Item.type && ["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type) > -1) { var varname; var elements = ["type", "title", "jurisdiction", "genre", "volume", "container-title"]; var legislation_id = []; for (i = 0, ilen = elements.length; i < ilen; i += 1) { varname = elements[i]; - if (Item[varname]) { - legislation_id.push(Item[varname]); - } - } + if (Item[varname]) { + legislation_id.push(Item[varname]); + } + } elements = ["original-date", "issued"]; - for (i = 0, elements.length; i < ilen; i += 1) { + for (i = 0, elements.length; i < ilen; i += 1) { varname = elements[i]; - if (Item[varname] && Item[varname].year) { - var value = Item[varname].year; - legislation_id.push(value); - break; - } - } - Item.legislation_id = legislation_id.join("::"); + if (Item[varname] && Item[varname].year) { + var value = Item[varname].year; + legislation_id.push(value); + break; + } + } + Item.legislation_id = legislation_id.join("::"); } } if (!Item["title-short"]) { @@ -2106,10 +1838,21 @@ CSL.Engine.prototype.retrieveItem = function (id) { if (Item.title.slice(0,offset) === shortTitle && Item.title.slice(offset).match(/^\s*:/)) { Item["title-main"] = Item.title.slice(0,offset).replace(/\s+$/,""); Item["title-sub"] = Item.title.slice(offset).replace(/^\s*:\s*/,""); + if (this.opt.development_extensions.uppercase_subtitles && Item["title-sub"]) { + var subtitle = Item["title-sub"] + for (var i=0,ilen=subtitle.length;i -1; + var isLegalType = ["bill","legal_case","legislation","gazette","regulation"].indexOf(Item.type) > -1; if (!isLegalType && Item.title && this.sys.getAbbreviation) { var noHints = false; if (!Item.jurisdiction) { @@ -2161,7 +1904,7 @@ CSL.Engine.prototype.remapSectionVariable = function (inputList) { var section_label_count = 0; var later_label = false; var value = false; - if (["bill","gazette","legislation","treaty"].indexOf(Item.type) > -1) { + if (["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type) > -1) { item.force_pluralism = 0; if (!item.label) { item.label = "page" @@ -2241,7 +1984,7 @@ CSL.Engine.prototype.remapSectionVariable = function (inputList) { } CSL.Engine.prototype.setNumberLabels = function (Item) { if (Item.number - && ["bill", "gazette", "legislation", "treaty"].indexOf(Item.type) > -1 + && ["bill", "gazette", "legislation","regulation","treaty"].indexOf(Item.type) > -1 && this.opt.development_extensions.static_statute_locator && !this.tmp.shadow_numbers["number"]) { this.tmp.shadow_numbers["number"] = {}; @@ -2251,7 +1994,7 @@ CSL.Engine.prototype.setNumberLabels = function (Item) { this.tmp.shadow_numbers["number"].label = false; var value = "" + Item.number; value = value.replace("\\", "", "g"); - var firstword = value.split(/\s/)[0]; + var firstword = value.split(/\s+/)[0]; var firstlabel = CSL.STATUTE_SUBDIV_STRINGS[firstword]; if (firstlabel) { var m = value.match(CSL.STATUTE_SUBDIV_GROUPED_REGEX); @@ -2260,13 +2003,13 @@ CSL.Engine.prototype.setNumberLabels = function (Item) { var lst = []; for (var j=1, jlen=splt.length; j < jlen; j += 1) { var subdiv = m[j - 1].replace(/^\s*/, ""); - lst.push(subdiv.replace("sec.", "Sec.").replace("ch.", "Ch.")); lst.push(splt[j].replace(/\s*$/, "").replace(/^\s*/, "")); } value = lst.join(" "); } else { value = splt[0]; } + this.tmp.shadow_numbers["number"].label = firstlabel; this.tmp.shadow_numbers["number"].values.push(["Blob", value, false]); this.tmp.shadow_numbers["number"].numeric = false; } else { @@ -2763,7 +2506,10 @@ CSL.Output.Queue.prototype.append = function (str, tokname, notSerious, ignorePr if ("string" === typeof str && str.length) { str = str.replace(/ ([:;?!\u00bb])/g, "\u202f$1").replace(/\u00ab /g, "\u00ab\u202f"); this.last_char_rendered = str.slice(-1); - str = str.replace(/\s+'/g, " \'").replace(/^'/g, " \'"); + str = str.replace(/\s+'/g, " \'"); + if (!notSerious) { + str = str.replace(/^'/g, " \'"); + } if (!ignorePredecessor) { this.state.tmp.term_predecessor = true; } else if (notSerious) { @@ -3163,7 +2909,7 @@ CSL.Output.Queue.adjust = function (punctInQuote) { } } PUNCT_OR_SPACE[" "] = true; - PUNCT_OR_SPACE[" "] = true; + PUNCT_OR_SPACE[" "] = true; var RtoL_MAP = {}; for (var key in LtoR_MAP) { for (var subkey in LtoR_MAP[key]) { @@ -3211,6 +2957,19 @@ CSL.Output.Queue.adjust = function (punctInQuote) { if (blobHasDescendantQuotes(blob.blobs[blob.blobs.length-1])) return true; return false; } + function blobHasDescendantMergingPunctuation(parentChar,blob) { + var childChar = blob.strings.suffix.slice(-1); + if (!childChar && "string" === typeof blob.blobs) { + childChar = blob.blobs.slice(-1); + } + var mergedChars = RtoL_MAP[parentChar][childChar]; + if (mergedChars && mergedChars.length === 1) { + return true; + } + if ("object" !== typeof blob.blobs) return false; + if (blobHasDescendantMergingPunctuation(parentChar,blob.blobs[blob.blobs.length-1])) return true; + return false; + } function matchLastChar(blob, chr) { if (!PUNCT[chr]) { return false; @@ -3259,7 +3018,6 @@ CSL.Output.Queue.adjust = function (punctInQuote) { return RtoL_MAP[secondChar]; } function matchOnLeft () { - var chr = FirstStrings[first].slice(-1); return LtoR_MAP[firstChar]; } var match = merge_right ? matchOnLeft : matchOnRight; @@ -3386,7 +3144,9 @@ CSL.Output.Queue.adjust = function (punctInQuote) { var delimChar = parentStrings.delimiter.slice(0, 1); for (var i=parent.blobs.length-2;i>-1;i--) { var childStrings = parent.blobs[i].strings; - childStrings.suffix += delimChar; + if (childStrings.suffix.slice(-1) !== delimChar) { + childStrings.suffix += delimChar; + } } parentStrings.delimiter = parentStrings.delimiter.slice(1); } @@ -3400,20 +3160,28 @@ CSL.Output.Queue.adjust = function (punctInQuote) { var childIsNumber = blobIsNumber(child); if (i === (parent.blobs.length - 1)) { if (true || !someChildrenAreNumbers) { - if (!parentDecorations || blobHasDescendantQuotes(child)) { - var parentChar = parentStrings.suffix.slice(0, 1); + var parentChar = parentStrings.suffix.slice(0, 1); + var allowMigration = blobHasDescendantQuotes(child); + if (!allowMigration && PUNCT[parentChar]) { + allowMigration = blobHasDescendantMergingPunctuation(parentChar,child); + } + if (allowMigration) { if (PUNCT[parentChar]) { if (!blobEndsInNumber(child)) { - mergeChars(child, 'suffix', parent, 'suffix'); + if ("string" === typeof child.blobs) { + mergeChars(child, 'blobs', parent, 'suffix'); + } else { + mergeChars(child, 'suffix', parent, 'suffix'); + } if (parentStrings.suffix.slice(0,1) === ".") { childStrings.suffix += parentStrings.suffix.slice(0,1); parentStrings.suffix = parentStrings.suffix.slice(1); } } } - if (childStrings.suffix.slice(-1) === " " && parentStrings.suffix.slice(0,1)) { - parentStrings.suffix = parentStrings.suffix.slice(1); - } + } + if (childStrings.suffix.slice(-1) === " " && parentStrings.suffix.slice(0,1) === " ") { + parentStrings.suffix = parentStrings.suffix.slice(1); } if (PUNCT_OR_SPACE[childStrings.suffix.slice(0,1)]) { if ("string" === typeof child.blobs && child.blobs.slice(-1) === childStrings.suffix.slice(0,1)) { @@ -3448,6 +3216,35 @@ CSL.Output.Queue.adjust = function (punctInQuote) { this.downward(parent.blobs[i]); } }; + function swapToTheLeft (child) { + var childChar = child.strings.suffix.slice(0,1); + if ("string" === typeof child.blobs) { + while (SWAP_IN[childChar]) { + mergeChars(child, 'blobs', child, 'suffix'); + childChar = child.strings.suffix.slice(0,1); + } + } else { + while (SWAP_IN[childChar]) { + mergeChars(child.blobs[child.blobs.length-1], 'suffix', child, 'suffix'); + childChar = child.strings.suffix.slice(0,1); + } + } + } + function swapToTheRight (child) { + if ("string" === typeof child.blobs) { + var childChar = child.blobs.slice(-1); + while (SWAP_OUT[childChar]) { + mergeChars(child, 'blobs', child, 'suffix', true); + childChar = child.blobs.slice(-1); + } + } else { + var childChar = child.blobs[child.blobs.length-1].strings.suffix.slice(-1); + while (SWAP_OUT[childChar]) { + mergeChars(child.blobs[child.blobs.length-1], 'suffix', child, 'suffix', true); + childChar = child.blobs[child.blobs.length-1].strings.suffix.slice(-1); + } + } + } function fix (parent) { if ("object" !== typeof parent || "object" !== typeof parent.blobs || !parent.blobs.length) { return; @@ -3464,32 +3261,9 @@ CSL.Output.Queue.adjust = function (punctInQuote) { } if (quoteSwap) { if (punctInQuote) { - var childChar = child.strings.suffix.slice(0,1); - if ("string" === typeof child.blobs) { - while (SWAP_IN[childChar]) { - mergeChars(child, 'blobs', child, 'suffix'); - childChar = child.strings.suffix.slice(0,1); - } - } else { - while (SWAP_IN[childChar]) { - mergeChars(child.blobs[child.blobs.length-1], 'suffix', child, 'suffix'); - childChar = child.strings.suffix.slice(0,1); - } - } + swapToTheLeft(child); } else { - if ("string" === typeof child.blobs) { - var childChar = child.blobs.slice(-1); - while (SWAP_OUT[childChar]) { - mergeChars(child, 'blobs', child, 'suffix', true); - childChar = child.blobs.slice(-1); - } - } else { - var childChar = child.blobs[child.blobs.length-1].strings.suffix.slice(-1); - while (SWAP_OUT[childChar]) { - mergeChars(child.blobs[child.blobs.length-1], 'suffix', child, 'suffix', true); - childChar = child.blobs[child.blobs.length-1].strings.suffix.slice(-1); - } - } + swapToTheRight(child); } } lastChar = this.fix(parent.blobs[i]); @@ -3504,6 +3278,7 @@ CSL.Engine.Opt = function () { this.has_disambiguate = false; this.mode = "html"; this.dates = {}; + this.jurisdictions_seen = {}; this["locale-sort"] = []; this["locale-translit"] = []; this["locale-translat"] = []; @@ -3606,6 +3381,18 @@ CSL.Engine.Opt = function () { this["parse-names"] = true; this.citation_number_slug = false; this.trigraph = "Aaaa00:AaAa00:AaAA00:AAAA00"; + this.nodenames = []; + this.gender = {}; + this['cite-lang-prefs'] = { + persons:['orig'], + institutions:['orig'], + titles:['orig','translat'], + journals:['translit'], + publishers:['orig'], + places:['orig'], + number:['translat'] + }; + this.has_layout_locale = false; this.development_extensions = {}; this.development_extensions.field_hack = true; this.development_extensions.locator_date_and_revision = true; @@ -3624,24 +3411,14 @@ CSL.Engine.Opt = function () { this.development_extensions.thin_non_breaking_space_html_hack = false; this.development_extensions.apply_citation_wrapper = false; this.development_extensions.main_title_from_short_title = false; + this.development_extensions.uppercase_subtitles = false; this.development_extensions.normalize_lang_keys_to_lowercase = false; this.development_extensions.strict_text_case_locales = false; this.development_extensions.rtl_support = false; this.development_extensions.strict_page_numbers = false; this.development_extensions.expect_and_symbol_form = false; this.development_extensions.require_explicit_legal_case_title_short = false; - this.nodenames = []; - this.gender = {}; - this['cite-lang-prefs'] = { - persons:['orig'], - institutions:['orig'], - titles:['orig','translat'], - journals:['translit'], - publishers:['orig'], - places:['orig'], - number:['translat'] - }; - this.has_layout_locale = false; + this.development_extensions.spoof_institutional_affiliations = false; }; CSL.Engine.Tmp = function () { this.names_max = new CSL.Stack(); @@ -3687,6 +3464,7 @@ CSL.Engine.Tmp = function () { }; this.strip_periods = 0; this.shadow_numbers = {}; + this.authority_stop_last = 0; }; CSL.Engine.Fun = function (state) { this.match = new CSL.Util.Match; @@ -3834,7 +3612,6 @@ CSL.Engine.prototype.processCitationCluster = function (citation, citationsPre, if (Item.id) { this.transform.loadAbbreviation("default", "hereinafter", Item.id); } - this.remapSectionVariable([[Item,item]]); if (this.opt.development_extensions.locator_date_and_revision) { if (item.locator) { item.locator = "" + item.locator; @@ -3848,12 +3625,16 @@ CSL.Engine.prototype.processCitationCluster = function (citation, citationsPre, item["locator-date"] = this.fun.dateparser.parse(m[1]); raw_locator = raw_locator.slice(m[1].length); } - item["locator-revision"] = raw_locator.replace(/^\s+/, "").replace(/\s+$/, ""); + item["locator-extra"] = raw_locator.replace(/^\s+/, "").replace(/\s+$/, ""); } } } + if (item.locator) { + item.locator = ("" + item.locator).replace(/\s+$/, ''); + } + this.remapSectionVariable([[Item,item]]); if (this.opt.development_extensions.locator_label_parse) { - if (item.locator && ["bill","gazette","legislation","treaty"].indexOf(Item.type) === -1 && (!item.label || item.label === 'page')) { + if (item.locator && ["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type) === -1 && (!item.label || item.label === 'page')) { m = CSL.LOCATOR_LABELS_REGEXP.exec(item.locator); if (m) { item.label = CSL.LOCATOR_LABELS_MAP[m[2]]; @@ -4259,7 +4040,7 @@ CSL.Engine.prototype.makeCitationCluster = function (rawList) { } Item = this.retrieveItem("" + item.id); if (this.opt.development_extensions.locator_label_parse) { - if (item.locator && ["bill","gazette","legislation","treaty"].indexOf(Item.type) === -1 && (!item.label || item.label === 'page')) { + if (item.locator && ["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type) === -1 && (!item.label || item.label === 'page')) { var m = CSL.LOCATOR_LABELS_REGEXP.exec(item.locator); if (m) { item.label = CSL.LOCATOR_LABELS_MAP[m[2]]; @@ -4267,6 +4048,9 @@ CSL.Engine.prototype.makeCitationCluster = function (rawList) { } } } + if (item.locator) { + item.locator = ("" + item.locator).replace(/\s+$/, ''); + } newitem = [Item, item]; inputList.push(newitem); } @@ -4304,8 +4088,7 @@ CSL.getAmbiguousCite = function (Item, disambig, visualForm) { } } this.tmp.area = "citation"; - use_parallels = this.parallel.use_parallels; - this.parallel.use_parallels = false; + this.parallel.use_parallels = (this.parallel.use_parallels === true || this.parallel.use_parallels === null) ? null : false; this.tmp.suppress_decorations = true; this.tmp.just_looking = true; CSL.getCite.call(this, Item, itemSupp); @@ -4323,7 +4106,7 @@ CSL.getAmbiguousCite = function (Item, disambig, visualForm) { ret = this.output.string(this, this.output.queue); this.tmp.just_looking = false; this.tmp.suppress_decorations = false; - this.parallel.use_parallels = use_parallels; + this.parallel.use_parallels = this.parallel.use_parallels === null ? true : false; this.tmp.group_context.replace(oldTermSiblingLayer, "literal"); return ret; }; @@ -4668,6 +4451,7 @@ CSL.citeStart = function (Item, item) { this.tmp.shadow_numbers = {}; this.setNumberLabels(Item); this.tmp.first_name_string = false; + this.tmp.authority_stop_last = 0; if (this.opt.development_extensions.flip_parentheses_to_braces && item && item.prefix) { var openBrace = CSL.checkNestedBraceOpen.exec(item.prefix); var closeBrace = CSL.checkNestedBraceClose.exec(item.prefix); @@ -5123,11 +4907,11 @@ CSL.Engine.prototype.updateItems = function (idList, nosort, rerun_ambigs) { var debug = false; var oldArea = this.tmp.area; this.registry.init(idList); - if (rerun_ambigs) { - for (var ambig in this.registry.ambigcites) { - this.registry.ambigsTouched[ambig] = true; - } - } + if (rerun_ambigs) { + for (var ambig in this.registry.ambigcites) { + this.registry.ambigsTouched[ambig] = true; + } + } this.registry.dodeletes(this.registry.myhash); this.registry.doinserts(this.registry.mylist); this.registry.dorefreshes(); @@ -5413,6 +5197,9 @@ CSL.Engine.prototype.localeSet = function (myxml, lang_in, lang_out) { } else { this.locale[lang_out].opts[attrname.slice(1)] = false; } + } else if (attrname === "@jurisdiction-preference") { + var jurisdiction_preference = attributes[attrname].split(/\s*,\s*/); + this.locale[lang_out].opts[attrname.slice(1)] = jurisdiction_preference; } else if (attrname === "@skip-words") { var skip_words = attributes[attrname].split(/\s*,\s*/); this.locale[lang_out].opts[attrname.slice(1)] = skip_words; @@ -5906,6 +5693,9 @@ CSL.Node.group = { if (state.build.substitute_level.value()) { state.build.substitute_level.replace((state.build.substitute_level.value() + 1)); } + if (!this.juris) { + target.push(this); + } func = function (state, Item) { state.output.startTag("group", this); if (state.tmp.group_context.mystack.length) { @@ -5940,7 +5730,86 @@ CSL.Node.group = { }; this.execs.push(func); } - } else { + if (this.juris) { + for (var x=0,xlen=target.length;x -1) { + if (CSL.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(test_char) > -1 && item.prefix.trim().indexOf(" ") > -1) { state.tmp.term_predecessor = false; ignorePredecessor = true; } @@ -6687,19 +6577,24 @@ CSL.NameOutput.prototype.outputNames = function () { var v = variables[i]; var institution_sets = []; var institutions = false; - for (var j = 0, jlen = this.institutions[v].length; j < jlen; j += 1) { - institution_sets.push(this.joinPersonsAndInstitutions([this.persons[v][j], this.institutions[v][j]])); - } - if (this.institutions[v].length) { - var pos = this.nameset_base + this.variable_offset[v]; - if (this.freeters[v].length) { - pos += 1; + var varblob = null; + if (!this.state.opt.development_extensions.spoof_institutional_affiliations) { + varblob = this._join([this.freeters[v]], ""); + } else { + for (var j = 0, jlen = this.institutions[v].length; j < jlen; j += 1) { + institution_sets.push(this.joinPersonsAndInstitutions([this.persons[v][j], this.institutions[v][j]])); } - institutions = this.joinInstitutionSets(institution_sets, pos); + if (this.institutions[v].length) { + var pos = this.nameset_base + this.variable_offset[v]; + if (this.freeters[v].length) { + pos += 1; + } + institutions = this.joinInstitutionSets(institution_sets, pos); + } + var varblob = this.joinFreetersAndInstitutionSets([this.freeters[v], institutions]); } - var varblob = this.joinFreetersAndInstitutionSets([this.freeters[v], institutions]); if (varblob) { - if (this.state.tmp.area.slice(-5) !== "_sort") { + if (!this.state.tmp.extension) { varblob = this._applyLabels(varblob, v); } blob_list.push(varblob); @@ -6754,7 +6649,7 @@ CSL.NameOutput.prototype.outputNames = function () { this.state.tmp.done_vars.push("title"); this.state.output.append(this.state.transform.abbrevs["default"].classic[author_title], "empty", true); blob = this.state.output.pop(); - this.state.tmp.name_node.top.blobs.pop(); + this.state.tmp.name_node.top.blobs.pop(); this.state.tmp.name_node.top.blobs.push(blob); } } @@ -6789,8 +6684,7 @@ CSL.NameOutput.prototype._applyLabels = function (blob, v) { this.state.output.append(blob, "literal", true); this.state.output.closeLevel("empty"); blob = this.state.output.pop(); - } - if (this.label[v].after) { + } else if (this.label[v].after) { if ("number" === typeof this.label[v].after.strings.plural) { plural = this.label[v].after.strings.plural; } @@ -6922,15 +6816,15 @@ CSL.NameOutput.prototype.truncatePersonalNameLists = function () { this._please_chop = chopvar; } } - for (i = 0, ilen = this.persons[v].length; i < ilen; i += 1) { - if (this.persons[v][i].length) { + for (var j=0,jlen = this.persons[v].length;j 50 && lst.length > (this.state[this.state[this.state.tmp.area].root].opt.max_number_of_names + 2)) { - lst = lst.slice(0, this.state[this.state[this.state.tmp.area].root].opt.max_number_of_names + 2); + var limit = this.state[this.state[this.state.tmp.area].root].opt.max_number_of_names; + lst = lst.slice(0, limit+1).concat(lst.slice(-1)); } return lst; }; @@ -6999,29 +6894,36 @@ CSL.NameOutput.prototype.divideAndTransliterateNames = function () { } this._getFreeters(v, values); this._getPersonsAndInstitutions(v, values); - if (this.name.strings["suppress-min"] === 0) { - this.freeters[v] = []; - for (j = 0, jlen = this.persons[v].length; j < jlen; j += 1) { - this.persons[v][j] = []; - } - } else if (this.institution.strings["suppress-min"] === 0) { - this.institutions[v] = []; - this.freeters[v] = this.freeters[v].concat(this.persons[v]); - for (j = 0, jlen = this.persons[v].length; j < jlen; j += 1) { - for (var k = 0, klen = this.persons[v][j].length; k < klen; k += 1) { - this.freeters[v].push(this.persons[v][j][k]); + if (this.state.opt.development_extensions.spoof_institutional_affiliations) { + if (this.name.strings["suppress-min"] === 0) { + this.freeters[v] = []; + for (j = 0, jlen = this.persons[v].length; j < jlen; j += 1) { + this.persons[v][j] = []; } + } else if (this.institution.strings["suppress-min"] === 0) { + this.institutions[v] = []; + this.freeters[v] = this.freeters[v].concat(this.persons[v]); + for (j = 0, jlen = this.persons[v].length; j < jlen; j += 1) { + for (var k = 0, klen = this.persons[v][j].length; k < klen; k += 1) { + this.freeters[v].push(this.persons[v][j][k]); + } + } + this.persons[v] = []; } - this.persons[v] = []; } } }; CSL.NameOutput.prototype._normalizeVariableValue = function (Item, variable) { var names, name, i, ilen; - if ("string" === typeof Item[variable]) { - names = [{literal: Item[variable]}]; + if ("string" === typeof Item[variable] || "number" === typeof Item[variable]) { + CSL.debug("name variable \"" + variable + "\" is string or number, not array. Attempting to fix."); + names = [{literal: Item[variable] + ""}]; } else if (!Item[variable]) { names = []; + } else if ("number" !== typeof Item[variable].length) { + CSL.debug("name variable \"" + variable + "\" is object, not array. Attempting to fix."); + Item[variable] = [Item[variable]]; + names = Item[variable].slice(); } else { names = Item[variable].slice(); } @@ -7029,14 +6931,24 @@ CSL.NameOutput.prototype._normalizeVariableValue = function (Item, variable) { }; CSL.NameOutput.prototype._getFreeters = function (v, values) { this.freeters[v] = []; - for (var i = values.length - 1; i > -1; i += -1) { - if (this.isPerson(values[i])) { - var value = this._checkNickname(values.pop()); - if (value) { - this.freeters[v].push(value); + if (this.state.opt.development_extensions.spoof_institutional_affiliations) { + for (var i=values.length-1;i>-1;i--) { + if (this.isPerson(values[i])) { + var value = this._checkNickname(values.pop()); + if (value) { + this.freeters[v].push(value); + } + } else { + break; } - } else { - break; + } + } else { + for (var i=values.length-1;i>-1;i--) { + var value = values.pop(); + if (this.isPerson(value)) { + var value = this._checkNickname(value); + } + this.freeters[v].push(value); } } this.freeters[v].reverse(); @@ -7047,6 +6959,7 @@ CSL.NameOutput.prototype._getFreeters = function (v, values) { CSL.NameOutput.prototype._getPersonsAndInstitutions = function (v, values) { this.persons[v] = []; this.institutions[v] = []; + if (!this.state.opt.development_extensions.spoof_institutional_affiliations) return; var persons = []; var has_affiliates = false; var first = true; @@ -7097,25 +7010,28 @@ CSL.NameOutput.prototype._checkNickname = function (name) { } return name; }; -CSL.NameOutput.prototype.joinPersons = function (blobs, pos, j) { +CSL.NameOutput.prototype.joinPersons = function (blobs, pos, j, tokenname) { var ret; + if (!tokenname) { + tokenname = "name"; + } if ("undefined" === typeof j) { if (this.etal_spec[pos].freeters === 1) { - ret = this._joinEtAl(blobs, "name"); + ret = this._joinEtAl(blobs, tokenname); } else if (this.etal_spec[pos].freeters === 2) { - ret = this._joinEllipsis(blobs, "name"); + ret = this._joinEllipsis(blobs, tokenname); } else if (!this.state.tmp.sort_key_flag) { - ret = this._joinAnd(blobs, "name"); + ret = this._joinAnd(blobs, tokenname); } else { ret = this._join(blobs, " "); } } else { if (this.etal_spec[pos].persons[j] === 1) { - ret = this._joinEtAl(blobs, "name"); + ret = this._joinEtAl(blobs, tokenname); } else if (this.etal_spec[pos].persons[j] === 2) { - ret = this._joinEllipsis(blobs, "name"); + ret = this._joinEllipsis(blobs, tokenname); } else if (!this.state.tmp.sort_key_flag) { - ret = this._joinAnd(blobs, "name"); + ret = this._joinAnd(blobs, tokenname); } else { ret = this._join(blobs, " "); } @@ -7200,7 +7116,7 @@ CSL.NameOutput.prototype._join = function (blobs, delimiter, single, multiple, t blobs.push(blob); } } - this.state.output.openLevel(this._getToken(tokenname)); + this.state.output.openLevel(); if (single && multiple) { this.state.output.current.value().strings.delimiter = ""; } @@ -7529,10 +7445,10 @@ CSL.NameOutput.prototype.renderAllNames = function () { var v = this.variables[i]; pos = this.nameset_base + i; if (this.freeters[v].length) { - this.freeters[v] = this._renderPersonalNames(this.freeters[v], pos); + this.freeters[v] = this._renderNames(v, this.freeters[v], pos); } for (var j = 0, jlen = this.institutions[v].length; j < jlen; j += 1) { - this.persons[v][j] = this._renderPersonalNames(this.persons[v][j], pos, j); + this.persons[v][j] = this._renderNames(v, this.persons[v][j], pos, j); } } this.renderInstitutionNames(); @@ -7552,83 +7468,87 @@ CSL.NameOutput.prototype.renderInstitutionNames = function () { localesets = this.state.opt['cite-lang-prefs'].persons; } slot = {primary:'locale-orig',secondary:false,tertiary:false}; - if (localesets) { - var slotnames = ["primary", "secondary", "tertiary"]; - for (var k = 0, klen = slotnames.length; k < klen; k += 1) { - if (localesets.length - 1 < k) { - break; - } + if (localesets) { + var slotnames = ["primary", "secondary", "tertiary"]; + for (var k = 0, klen = slotnames.length; k < klen; k += 1) { + if (localesets.length - 1 < k) { + break; + } if (localesets[k]) { - slot[slotnames[k]] = 'locale-' + localesets[k]; + slot[slotnames[k]] = 'locale-' + localesets[k]; } - } - } else { - slot.primary = 'locale-translat'; - } - if (this.state.tmp.area !== "bibliography" - && !(this.state.tmp.area === "citation" - && this.state.opt.xclass === "note" - && this.item && !this.item.position)) { - slot.secondary = false; - slot.tertiary = false; - } + } + } else { + slot.primary = 'locale-translat'; + } + if (this.state.tmp.area !== "bibliography" + && !(this.state.tmp.area === "citation" + && this.state.opt.xclass === "note" + && this.item && !this.item.position)) { + slot.secondary = false; + slot.tertiary = false; + } var res; this.setRenderedName(name); - res = this.getName(name, slot.primary, true); - var primary = res.name; - var usedOrig = res.usedOrig; - if (primary) { - primary = this.fixupInstitution(primary, v, j); - } - secondary = false; - if (slot.secondary) { - res = this.getName(name, slot.secondary, false, usedOrig); - secondary = res.name; - usedOrig = res.usedOrig; - if (secondary) { - secondary = this.fixupInstitution(secondary, v, j); - } - } - tertiary = false; - if (slot.tertiary) { - res = this.getName(name, slot.tertiary, false, usedOrig); - tertiary = res.name; - if (tertiary) { - tertiary = this.fixupInstitution(tertiary, v, j); - } - } - switch (this.institution.strings["institution-parts"]) { - case "short": - if (primary["short"].length) { - short_style = this._getShortStyle(); - institution = [this._renderOneInstitutionPart(primary["short"], short_style)]; - } else { - long_style = this._getLongStyle(primary, v, j); - institution = [this._renderOneInstitutionPart(primary["long"], long_style)]; - } - break; - case "short-long": - long_style = this._getLongStyle(primary, v, j); - short_style = this._getShortStyle(); - institution_short = this._renderOneInstitutionPart(primary["short"], short_style); - institution_long = this._composeOneInstitutionPart([primary, secondary, tertiary], slot, long_style); - institution = [institution_short, institution_long]; - break; - case "long-short": - long_style = this._getLongStyle(primary, v, j); - short_style = this._getShortStyle(); - institution_short = this._renderOneInstitutionPart(primary["short"], short_style); - institution_long = this._composeOneInstitutionPart([primary, secondary, tertiary], slot, long_style, true); - institution = [institution_long, institution_short]; - break; - default: - long_style = this._getLongStyle(primary, v, j); - institution = [this._composeOneInstitutionPart([primary, secondary, tertiary], slot, long_style)]; - break; - } - this.institutions[v][j] = this._join(institution, ""); + var institution = this._renderInstitutionName(v, name, slot, j); + this.institutions[v][j] = institution; } } +} +CSL.NameOutput.prototype._renderInstitutionName = function (v, name, slot, j) { + res = this.getName(name, slot.primary, true); + var primary = res.name; + var usedOrig = res.usedOrig; + if (primary) { + primary = this.fixupInstitution(primary, v, j); + } + secondary = false; + if (slot.secondary) { + res = this.getName(name, slot.secondary, false, usedOrig); + secondary = res.name; + usedOrig = res.usedOrig; + if (secondary) { + secondary = this.fixupInstitution(secondary, v, j); + } + } + tertiary = false; + if (slot.tertiary) { + res = this.getName(name, slot.tertiary, false, usedOrig); + tertiary = res.name; + if (tertiary) { + tertiary = this.fixupInstitution(tertiary, v, j); + } + } + switch (this.institution.strings["institution-parts"]) { + case "short": + if (primary["short"].length) { + short_style = this._getShortStyle(); + institution = [this._renderOneInstitutionPart(primary["short"], short_style)]; + } else { + long_style = this._getLongStyle(primary, v, j); + institution = [this._renderOneInstitutionPart(primary["long"], long_style)]; + } + break; + case "short-long": + long_style = this._getLongStyle(primary, v, j); + short_style = this._getShortStyle(); + institution_short = this._renderOneInstitutionPart(primary["short"], short_style); + institution_long = this._composeOneInstitutionPart([primary, secondary, tertiary], slot, long_style); + institution = [institution_short, institution_long]; + break; + case "long-short": + long_style = this._getLongStyle(primary, v, j); + short_style = this._getShortStyle(); + institution_short = this._renderOneInstitutionPart(primary["short"], short_style); + institution_long = this._composeOneInstitutionPart([primary, secondary, tertiary], slot, long_style, true); + institution = [institution_long, institution_short]; + break; + default: + long_style = this._getLongStyle(primary, v, j); + institution = [this._composeOneInstitutionPart([primary, secondary, tertiary], slot, long_style)]; + break; + } + return this._join(institution, " "); }; CSL.NameOutput.prototype._composeOneInstitutionPart = function (names, slot, style) { var primary = false, secondary = false, tertiary = false; @@ -7699,7 +7619,7 @@ CSL.NameOutput.prototype._renderOneInstitutionPart = function (blobs, style) { } return this._join(blobs, this.institution.strings["part-separator"]); }; -CSL.NameOutput.prototype._renderPersonalNames = function (values, pos, j) { +CSL.NameOutput.prototype._renderNames = function (v, values, pos, j) { var ret = false; if (values.length) { var names = []; @@ -7714,73 +7634,82 @@ CSL.NameOutput.prototype._renderPersonalNames = function (values, pos, j) { localesets = this.state.opt['cite-lang-prefs'].persons; } slot = {primary:'locale-orig',secondary:false,tertiary:false}; - if (localesets) { - var slotnames = ["primary", "secondary", "tertiary"]; - for (var k = 0, klen = slotnames.length; k < klen; k += 1) { - if (localesets.length - 1 < k) { - break; - } - slot[slotnames[k]] = 'locale-' + localesets[k]; - } - } else { - slot.primary = 'locale-translat'; - } - if (this.state.tmp.sort_key_flag || (this.state.tmp.area !== "bibliography" - && !(this.state.tmp.area === "citation" - && this.state.opt.xclass === "note" - && this.item && !this.item.position))) { - slot.secondary = false; - slot.tertiary = false; - } + if (localesets) { + var slotnames = ["primary", "secondary", "tertiary"]; + for (var k = 0, klen = slotnames.length; k < klen; k += 1) { + if (localesets.length - 1 < k) { + break; + } + slot[slotnames[k]] = 'locale-' + localesets[k]; + } + } else { + slot.primary = 'locale-translat'; + } + if (this.state.tmp.sort_key_flag || (this.state.tmp.area !== "bibliography" + && !(this.state.tmp.area === "citation" + && this.state.opt.xclass === "note" + && this.item && !this.item.position))) { + slot.secondary = false; + slot.tertiary = false; + } this.setRenderedName(name); - var res = this.getName(name, slot.primary, true); - var primary = this._renderOnePersonalName(res.name, pos, i, j); - secondary = false; - if (slot.secondary) { - res = this.getName(name, slot.secondary, false, res.usedOrig); - if (res.name) { - secondary = this._renderOnePersonalName(res.name, pos, i, j); - } - } - tertiary = false; - if (slot.tertiary) { - res = this.getName(name, slot.tertiary, false, res.usedOrig); - if (res.name) { - tertiary = this._renderOnePersonalName(res.name, pos, i, j); - } - } - var personblob; - if (secondary || tertiary) { - this.state.output.openLevel("empty"); - this.state.output.append(primary); - secondary_tok = new CSL.Token(); - if (slot.secondary) { - secondary_tok.strings.prefix = this.state.opt.citeAffixes.persons[slot.secondary].prefix; - secondary_tok.strings.suffix = this.state.opt.citeAffixes.persons[slot.secondary].suffix; - if (!secondary_tok.strings.prefix) { - secondary_tok.strings.prefix = " "; - } - } - this.state.output.append(secondary, secondary_tok); - tertiary_tok = new CSL.Token(); - if (slot.tertiary) { - tertiary_tok.strings.prefix = this.state.opt.citeAffixes.persons[slot.tertiary].prefix; - tertiary_tok.strings.suffix = this.state.opt.citeAffixes.persons[slot.tertiary].suffix; - if (!tertiary_tok.strings.prefix) { - tertiary_tok.strings.prefix = " "; - } - } - this.state.output.append(tertiary, tertiary_tok); - this.state.output.closeLevel(); - personblob = this.state.output.pop(); + if (!name.literal && !name.isInstitution) { + var nameBlob = this._renderPersonalName(v, name, slot, pos, i, j); + this.state.output.append(nameBlob, this.name, true); + names.push(this.state.output.pop()); } else { - personblob = primary; + names.push(this._renderInstitutionName(v, name, slot, j)); } - names.push(personblob); } ret = this.joinPersons(names, pos, j); } - return ret; + return ret +} +CSL.NameOutput.prototype._renderPersonalName = function (v, name, slot, pos, i, j) { + var res = this.getName(name, slot.primary, true); + var primary = this._renderOnePersonalName(res.name, pos, i, j); + secondary = false; + if (slot.secondary) { + res = this.getName(name, slot.secondary, false, res.usedOrig); + if (res.name) { + secondary = this._renderOnePersonalName(res.name, pos, i, j); + } + } + tertiary = false; + if (slot.tertiary) { + res = this.getName(name, slot.tertiary, false, res.usedOrig); + if (res.name) { + tertiary = this._renderOnePersonalName(res.name, pos, i, j); + } + } + var personblob; + if (secondary || tertiary) { + this.state.output.openLevel("empty"); + this.state.output.append(primary); + secondary_tok = new CSL.Token(); + if (slot.secondary) { + secondary_tok.strings.prefix = this.state.opt.citeAffixes.persons[slot.secondary].prefix; + secondary_tok.strings.suffix = this.state.opt.citeAffixes.persons[slot.secondary].suffix; + if (!secondary_tok.strings.prefix) { + secondary_tok.strings.prefix = " "; + } + } + this.state.output.append(secondary, secondary_tok); + tertiary_tok = new CSL.Token(); + if (slot.tertiary) { + tertiary_tok.strings.prefix = this.state.opt.citeAffixes.persons[slot.tertiary].prefix; + tertiary_tok.strings.suffix = this.state.opt.citeAffixes.persons[slot.tertiary].suffix; + if (!tertiary_tok.strings.prefix) { + tertiary_tok.strings.prefix = " "; + } + } + this.state.output.append(tertiary, tertiary_tok); + this.state.output.closeLevel(); + personblob = this.state.output.pop(); + } else { + personblob = primary; + } + return personblob; }; CSL.NameOutput.prototype._isRomanesque = function (name) { var ret = 2; @@ -7825,7 +7754,7 @@ CSL.NameOutput.prototype._renderOnePersonalName = function (value, pos, i, j) { suffix_sep = " "; } var romanesque = this._isRomanesque(name); - var has_hyphenated_non_dropping_particle = non_dropping_particle && non_dropping_particle.blobs.slice(-1) === "-"; + var has_hyphenated_non_dropping_particle = (non_dropping_particle && ["\u2019", "\'", "-"].indexOf(non_dropping_particle.blobs.slice(-1)) > -1); var blob, merged, first, second; if (romanesque === 0) { blob = this._join([non_dropping_particle, family, given], ""); @@ -7885,7 +7814,7 @@ CSL.NameOutput.prototype._renderOnePersonalName = function (value, pos, i, j) { } } else { // plain vanilla if (name["dropping-particle"] && name.family && !name["non-dropping-particle"]) { - if (["'","\u02bc","\u2019"].indexOf(name["dropping-particle"].slice(-1)) > -1) { + if (["'","\u02bc","\u2019","-"].indexOf(name["dropping-particle"].slice(-1)) > -1) { family = this._join([dropping_particle, family], ""); dropping_particle = false; } @@ -7945,6 +7874,7 @@ CSL.NameOutput.prototype._normalizeNameInput = function (value) { "non-dropping-particle":value["non-dropping-particle"], "dropping-particle":value["dropping-particle"], "static-ordering":value["static-ordering"], + "static-particles":value["static-particles"], "reverse-ordering":value["reverse-ordering"], "full-form-always": value["full-form-always"], "parse-names":value["parse-names"], @@ -8030,8 +7960,10 @@ CSL.NameOutput.prototype._givenName = function (name, pos, i) { } } var str = this._stripPeriods("given", name.given); - if (this.state.output.append(str, this.given_decor, true)) { - return this.state.output.pop(); + var rendered = this.state.output.append(str, this.given_decor, true); + if (rendered) { + ret = this.state.output.pop(); + return ret; } return false; }; @@ -8041,8 +7973,16 @@ CSL.NameOutput.prototype._nameSuffix = function (name) { str = CSL.Util.Names.initializeWith(this.state, name.suffix, this.name.strings["initialize-with"], true); } str = this._stripPeriods("family", str); - if (this.state.output.append(str, "empty", true)) { - return this.state.output.pop(); + var toSuffix = ''; + if (str && str.slice(-1) === '.') { + str = str.slice(0, -1); + toSuffix = '.'; + } + var rendered = this.state.output.append(str, "empty", true); + if (rendered) { + ret = this.state.output.pop(); + ret.strings.suffix = toSuffix + ret.strings.suffix; + return ret; } return false; }; @@ -8092,10 +8032,8 @@ CSL.NameOutput.prototype._parseName = function (name) { noparse = false; } if (!name["non-dropping-particle"] && name.family && !noparse && name.given) { - m = name.family.match(/^((?:[\'\u2019a-z][ \'\u2019a-z]*[-\s\'\u2019]+|[ABDVL][^ ][-\s]+[a-z]*\s*|[ABDVL][^ ][^ ][-\s]+[a-z]*\s*))/); - if (m) { - name.family = name.family.slice(m[1].length); - name["non-dropping-particle"] = m[1].replace(/\s+$/, "").replace("'", "\u2019"); + if (!name["static-particles"]) { + CSL.parseParticles(name, true); } } if (!name.suffix && name.given) { @@ -8180,6 +8118,7 @@ CSL.NameOutput.prototype.getName = function (name, slotLocaleset, fallback, stop "dropping-particle":name["dropping-particle"], suffix:name.suffix, "static-ordering":name_params["static-ordering"], + "static-particles":name["static-particles"], "reverse-ordering":name_params["reverse-ordering"], "full-form-always": name_params["full-form-always"], "parse-names":name["parse-names"], @@ -8243,6 +8182,9 @@ CSL.NameOutput.prototype.setRenderedName = function (name) { } } CSL.NameOutput.prototype.fixupInstitution = function (name, varname, listpos) { + if (this.state.sys.getHumanForm && "legal_case" === this.Item.type && "authority" === varname) { + name.literal = this.state.sys.getHumanForm(this.Item.jurisdiction, name.literal); + } name = this._splitInstitution(name, varname, listpos); if (this.institution.strings["reverse-order"]) { name["long"].reverse(); @@ -8305,6 +8247,7 @@ CSL.NameOutput.prototype._splitInstitution = function (value, v, i) { } splitLst = splitLst.replace(/\s*\|\s*/g, "|"); splitInstitution = [splitLst]; + break; } } } @@ -8315,19 +8258,32 @@ CSL.NameOutput.prototype._splitInstitution = function (value, v, i) { CSL.NameOutput.prototype._trimInstitution = function (subunits, v, i) { var use_first = false; var append_last = false; - var stop_last = false; var s = subunits.slice(); + var stop_last = false; if (this.institution) { if ("undefined" !== typeof this.institution.strings["use-first"]) { use_first = this.institution.strings["use-first"]; } if ("undefined" !== typeof this.institution.strings["stop-last"]) { - s = s.slice(0, this.institution.strings["stop-last"]); - subunits = subunits.slice(0, this.institution.strings["stop-last"]); + stop_last = this.institution.strings["stop-last"]; + } else if ("authority" === v && this.state.tmp.authority_stop_last) { + stop_last = this.state.tmp.authority_stop_last; + } + if (stop_last) { + s = s.slice(0, stop_last); + subunits = subunits.slice(0, stop_last); } if ("undefined" !== typeof this.institution.strings["use-last"]) { append_last = this.institution.strings["use-last"]; } + if ("authority" === v) { + if (stop_last) { + this.state.tmp.authority_stop_last = stop_last; + } + if (append_last) { + this.state.tmp.authority_stop_last += (append_last * -1); + } + } } if (false === use_first) { if (this.persons[v].length === 0) { @@ -8347,9 +8303,6 @@ CSL.NameOutput.prototype._trimInstitution = function (subunits, v, i) { if (use_first > subunits.length - append_last) { use_first = subunits.length - append_last; } - if (stop_last) { - append_last = 0; - } subunits = subunits.slice(0, use_first); s = s.slice(use_first); if (append_last) { @@ -8455,7 +8408,7 @@ CSL.evaluateLabel = function (node, state, Item, item) { myterm = node.strings.term; } var plural = node.strings.plural; - if (item && "number" === typeof item.force_pluralism) { + if (item && "locator" === node.strings.term && "number" === typeof item.force_pluralism) { plural = item.force_pluralism; } else if ("number" !== typeof plural) { if ("locator" === node.strings.term) { @@ -8469,7 +8422,7 @@ CSL.evaluateLabel = function (node, state, Item, item) { plural = CSL.evaluateStringPluralism(item.locator); } } - } else if (["page", "page-first"].indexOf(node.variables[0]) > -1) { + } else if (["page", "page-first", "number"].indexOf(node.variables[0]) > -1) { state.processNumber(false, Item, myterm, Item.type); plural = state.tmp.shadow_numbers[myterm].plural; myterm = state.tmp.shadow_numbers[myterm].label; @@ -8869,12 +8822,12 @@ CSL.Node.number = { var blob; var newstr = ""; var rangeType = "page"; - if (["bill","gazette","legislation","legal_case","treaty"].indexOf(Item.type) > -1 + if (["bill","gazette","legal_case","legislation","regulation","treaty"].indexOf(Item.type) > -1 && varname === "collection-number") { rangeType = "year"; } if (((varname === "number" - && ["bill","gazette","legislation","treaty"].indexOf(Item.type) > -1) + && ["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type) > -1) || state.opt[rangeType + "-range-format"]) && !this.strings.prefix && !this.strings.suffix && !this.strings.form) { @@ -8884,7 +8837,7 @@ CSL.Node.number = { } if (newstr && !newstr.match(/^[\-.\u20130-9]+$/)) { if (varname === "number" - && ["bill","gazette","legislation","treaty"].indexOf(Item.type) > -1) { + && ["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type) > -1) { var firstword = newstr.split(/\s/)[0]; if (firstword) { newlst = []; @@ -8996,7 +8949,18 @@ CSL.Node.text = { build: function (state, target) { var variable, func, form, plural, id, num, number, formatter, firstoutput, specialdelimiter, label, myname, names, name, year, suffix, term, dp, len, pos, n, m, value, flag; if (this.postponed_macro) { - return CSL.expandMacro.call(state, this); + var group_start = CSL.Util.cloneToken(this); + group_start.name = "group"; + group_start.tokentype = CSL.START; + CSL.Node.group.build.call(group_start, state, target); + CSL.expandMacro.call(state, this, target); + var group_end = CSL.Util.cloneToken(this); + group_end.name = "group"; + group_end.tokentype = CSL.END; + if (this.postponed_macro === 'juris-locator-label') { + group_end.isJurisLocatorLabel = true; + } + CSL.Node.group.build.call(group_end, state, target); } else { CSL.Util.substituteStart.call(this, state, target); if (!this.variables_real) { @@ -9172,7 +9136,7 @@ CSL.Node.text = { } else { transfall = true; abbrfall = true; - } + } func = state.transform.getOutputFunction(this.variables, abbrevfam, abbrfall, altvar, transfall); } else { if (CSL.CITE_FIELDS.indexOf(this.variables_real[0]) > -1) { @@ -9182,8 +9146,8 @@ CSL.Node.text = { value = value.replace(/([^\\])--*/g,"$1"+state.getTerm("page-range-delimiter")); value = value.replace(/\\-/g,"-"); state.output.append(value, this, false, false, true); - if (this.variables[0] === "locator-revision") { - state.tmp.done_vars.push("locator-revision"); + if (this.variables[0] === "locator-extra") { + state.tmp.done_vars.push("locator-extra"); } } }; @@ -9326,7 +9290,7 @@ CSL.Attributes["@is-numeric"] = function (state, arg, joiner) { var maketest = function(variable) { return function (Item, item) { var myitem = Item; - if (["locator","locator-revision"].indexOf(variable) > -1) { + if (["locator","locator-extra"].indexOf(variable) > -1) { myitem = item; } if ("undefined" === typeof myitem) { @@ -9339,7 +9303,7 @@ CSL.Attributes["@is-numeric"] = function (state, arg, joiner) { if (myitem[variable] && state.tmp.shadow_numbers[variable].numeric) { return true; } - } else if (["title", "locator-revision","version"].indexOf(variable) > -1) { + } else if (["title", "locator-extra","version"].indexOf(variable) > -1) { if (myitem[variable]) { if (myitem[variable].slice(-1) === "" + parseInt(myitem[variable].slice(-1), 10)) { return true; @@ -9395,7 +9359,7 @@ CSL.Attributes["@locator"] = function (state, arg) { CSL.Attributes["@position"] = function (state, arg) { var tryposition; state.opt.update_mode = CSL.POSITION; - state.parallel.use_parallels = true; + state.parallel.use_parallels = null; var trypositions = arg.split(/\s+/); var maketest = function(tryposition) { return function (Item, item) { @@ -9435,6 +9399,13 @@ CSL.Attributes["@position"] = function (state, arg) { } return false; }); + } else if ("far-note" === tryposition) { + this.tests.push(function (Item, item) { + if (item && item.position == CSL.POSITION_SUBSEQUENT && !item["near-note"]) { + return true; + } + return false; + }); } else { this.tests.push(maketest(tryposition)); } @@ -9466,17 +9437,17 @@ CSL.Attributes["@variable"] = function (state, arg) { this.strings.term = this.variables[0]; } else if (["names", "date", "text", "number"].indexOf(this.name) > -1) { func = function (state, Item, item) { - variables = this.variables_real.slice(); for (var i = this.variables.length - 1; i > -1; i += -1) { this.variables.pop(); } - len = variables.length; - for (pos = 0; pos < len; pos += 1) { - if (state.tmp.done_vars.indexOf(variables[pos]) === -1 && !(item && Item.type === "legal_case" && item["suppress-author"] && variables[pos] === "title")) { - this.variables.push(variables[pos]); + for (var i=0,ilen=this.variables_real.length;i -1) { var maketest = function (variable) { return function(Item,item){ var myitem = Item; - if (item && ["locator", "locator-revision", "first-reference-note-number", "locator-date"].indexOf(variable) > -1) { + if (item && ["locator", "locator-extra", "first-reference-note-number", "locator-date"].indexOf(variable) > -1) { myitem = item; } if (variable === "hereinafter" && state.sys.getAbbreviation && myitem.id) { @@ -9650,23 +9623,48 @@ CSL.Attributes["@page"] = function (state, arg) { this.tests.push(maketest(trylabels[i])); } }; +CSL.Attributes["@number"] = function (state, arg) { + var trylabels = arg.replace("sub verbo", "sub-verbo"); + trylabels = trylabels.split(/\s+/); + var maketest = function(trylabel) { + return function (Item, item) { + var label; + state.processNumber(false, Item, "number", Item.type); + if (!state.tmp.shadow_numbers.number.label) { + label = "number"; + } else if (state.tmp.shadow_numbers.number.label === "sub verbo") { + label = "sub-verbo"; + } else { + label = state.tmp.shadow_numbers.number.label; + } + if (trylabel === label) { + return true; + } else { + return false; + } + } + } + for (var i=0,ilen=trylabels.length;i0;i+=-1) { - var tryjurisdictionStr = tryjurisdiction.slice(0,i).join(";"); - var jurisdiction = jurisdictions.slice(0,i).join(";"); + var tryjurisdictionStr = tryjurisdiction.slice(0,i).join(":"); + var jurisdiction = jurisdictions.slice(0,i).join(":"); if (tryjurisdictionStr !== jurisdiction) { return false; } @@ -9681,11 +9679,11 @@ CSL.Attributes["@jurisdiction"] = function (state, arg) { }; CSL.Attributes["@context"] = function (state, arg) { var func = function (Item, item) { - var area = state.tmp.area.slice(0, arg.length); - if (area === arg) { - return true; - } - return false; + var area = state.tmp.area.slice(0, arg.length); + if (area === arg) { + return true; + } + return false; }; this.tests.push(func); }; @@ -9742,7 +9740,7 @@ CSL.Attributes["@subjurisdictions"] = function (state, arg) { var func = function (Item, item) { var subjurisdictions = 0; if (Item.jurisdiction) { - subjurisdictions = Item.jurisdiction.split(";").length; + subjurisdictions = Item.jurisdiction.split(":").length; } if (subjurisdictions) { subjurisdictions += -1; @@ -9762,7 +9760,8 @@ CSL.Attributes["@is-plural"] = function (state, arg) { var institutions = 0; var last_is_person = false; for (var i = 0, ilen = nameList.length; i < ilen; i += 1) { - if (nameList[i].isInstitution && (nameList[i].literal || (nameList[i].family && !nameList[i].given))) { + if (state.opt.development_extensions.spoof_institutional_affiliations + && (nameList[i].literal || (nameList[i].isInstitution && nameList[i].family && !nameList[i].given))) { institutions += 1; last_is_person = false; } else { @@ -9848,6 +9847,22 @@ CSL.Attributes["@locale"] = function (state, arg) { this.tests.push(maketest(locale_list,locale_default,locale_bares)); } }; +CSL.Attributes["@authority-residue"] = function (state, arg) { + var maketest = function () { + var succeed = (arg === "true") ? true : false; + return function(Item, item) { + if (!Item.authority || !Item.authority[0] || !Item.authority[0].family) return !succeed; + var varLen = Item.authority[0].family.split("|").length; + var stopLast = state.tmp.authority_stop_last; + if ((varLen + stopLast) > 0) { + return succeed; + } else { + return !succeed; + } + } + } + this.tests.push(maketest()); +} CSL.Attributes["@locale-internal"] = function (state, arg) { var func, ret, len, pos, variable, myitem, langspec, lang, lst, i, ilen, fallback; lst = arg.split(/\s+/); @@ -9943,6 +9958,9 @@ CSL.Attributes["@value"] = function (state, arg) { CSL.Attributes["@name"] = function (state, arg) { this.strings.name = arg; }; +CSL.Attributes["@alternative-macro"] = function (state, arg) { + this.alt_macro = arg; +}; CSL.Attributes["@form"] = function (state, arg) { this.strings.form = arg; }; @@ -9991,8 +10009,8 @@ CSL.Attributes["@match"] = function (state, arg) { }; CSL.Attributes["@names-min"] = function (state, arg) { var val = parseInt(arg, 10); - if (state[state.tmp.area].opt.max_number_of_names < val) { - state[state.tmp.area].opt.max_number_of_names = val; + if (state[state.build.area].opt.max_number_of_names < val) { + state[state.build.area].opt.max_number_of_names = val; } this.strings["et-al-min"] = val; }; @@ -10020,34 +10038,6 @@ CSL.Attributes["@plural"] = function (state, arg) { this.strings.plural = false; } }; -CSL.Attributes["@number"] = function (state, arg) { - var func; - var trylabels = arg.replace("sub verbo", "sub-verbo"); - trylabels = trylabels.split(/\s+/); - if (["if", "else-if"].indexOf(this.name) > -1) { - func = function (state, Item, item) { - var ret = []; - var label; - state.processNumber(false, Item, "number", Item.type); - if (!state.tmp.shadow_numbers.number.label) { - label = "number"; - } else if (state.tmp.shadow_numbers.number.label === "sub verbo") { - label = "sub-verbo"; - } else { - label = state.tmp.shadow_numbers.number.label; - } - for (var i = 0, ilen = trylabels.length; i < ilen; i += 1) { - if (trylabels[i] === label) { - ret.push(true); - } else { - ret.push(false); - } - } - return ret; - }; - this.tests.push(func); - } -}; CSL.Attributes["@has-publisher-and-publisher-place"] = function (state, arg) { this.strings["has-publisher-and-publisher-place"] = true; }; @@ -10094,8 +10084,8 @@ CSL.Attributes["@name-delimiter"] = function (state, arg) { }; CSL.Attributes["@et-al-min"] = function (state, arg) { var val = parseInt(arg, 10); - if (state[state.tmp.area].opt.max_number_of_names < val) { - state[state.tmp.area].opt.max_number_of_names = val; + if (state[state.build.area].opt.max_number_of_names < val) { + state[state.build.area].opt.max_number_of_names = val; } state.setOpt(this, "et-al-min", val); }; @@ -10111,8 +10101,8 @@ CSL.Attributes["@et-al-use-last"] = function (state, arg) { }; CSL.Attributes["@et-al-subsequent-min"] = function (state, arg) { var val = parseInt(arg, 10); - if (state[state.tmp.area].opt.max_number_of_names < val) { - state[state.tmp.area].opt.max_number_of_names = val; + if (state[state.build.area].opt.max_number_of_names < val) { + state[state.build.area].opt.max_number_of_names = val; } state.setOpt(this, "et-al-subsequent-min", val); }; @@ -10384,8 +10374,12 @@ CSL.Parallel.prototype.StartCite = function (Item, item, prevItemID) { var basics_ok = true; var last_cite = this.sets.value().slice(-1)[0]; if (last_cite && last_cite.Item) { + var lastJuris = last_cite.Item.jurisdiction ? last_cite.Item.jurisdiction.split(":")[0] : ""; + var thisJuris = Item.jurisdiction ? Item.jurisdiction.split(":")[0] : ""; if (last_cite.Item.title !== Item.title) { basics_ok = false; + } else if (lastJuris !== thisJuris) { + basics_ok = false; } else if (last_cite.Item.type !== Item.type) { basics_ok = false; } else if (["article-journal","article-magazine"].indexOf(Item.type) > -1) { @@ -10877,6 +10871,13 @@ CSL.Transform = function (state) { if (["archive"].indexOf(myabbrev_family) > -1) { myabbrev_family = "collection-title"; } + if (variable === "jurisdiction" && basevalue && state.sys.getHumanForm) { + var jcode = basevalue; + basevalue = state.sys.getHumanForm(basevalue); + if (state.sys.suppressJurisdictions) { + basevalue = state.sys.suppressJurisdictions(jcode,basevalue); + } + } value = ""; if (state.sys.getAbbreviation) { var jurisdiction = state.transform.loadAbbreviation(Item.jurisdiction, myabbrev_family, basevalue, Item.type, noHints); @@ -10894,9 +10895,9 @@ CSL.Transform = function (state) { if (!value) { value = basevalue; } - if (value && value.slice(0, 10) === "!here>>>") { - if (variable === "jurisdiction" && ["treaty", "patent"].indexOf(variable) > -1) { - value = value.slice(10); + if (value && value.match(/^\!(?:[^>]+,)*here(?:,[^>]+)*>>>/)) { + if (variable === "jurisdiction" && ["treaty", "patent"].indexOf(Item.type) > -1) { + value = value.replace(/^\![^>]*>>>\s*/, ""); } else { value = false; } @@ -10978,11 +10979,12 @@ CSL.Transform = function (state) { if (state.sys.getAbbreviation) { var tryList = ['default']; if (jurisdiction !== 'default') { - var workLst = jurisdiction.split(/\s*;\s*/); + var workLst = jurisdiction.split(":"); for (var i=0, ilen=workLst.length; i < ilen; i += 1) { - tryList.push(workLst.slice(0,i+1).join(';')); + tryList.push(workLst.slice(0,i+1).join(":")); } } + var found = false; for (var i=tryList.length - 1; i > -1; i += -1) { if (!state.transform.abbrevs[tryList[i]]) { state.transform.abbrevs[tryList[i]] = new state.sys.AbbreviationSegments(); @@ -10990,11 +10992,11 @@ CSL.Transform = function (state) { if (!state.transform.abbrevs[tryList[i]][category][orig]) { state.sys.getAbbreviation(state.opt.styleID, state.transform.abbrevs, tryList[i], category, orig, itemType, noHints); } - if (state.transform.abbrevs[tryList[i]][category][orig]) { + if (!found && state.transform.abbrevs[tryList[i]][category][orig]) { if (i < tryList.length) { state.transform.abbrevs[jurisdiction][category][orig] = state.transform.abbrevs[tryList[i]][category][orig]; } - break; + found = true; } } } @@ -11035,12 +11037,6 @@ CSL.Transform = function (state) { if (!variables[0] || (!Item[variables[0]] && !Item[alternative_varname])) { return null; } - if (state.opt.suppressJurisdictions - && variables[0] === "jurisdiction" - && state.opt.suppressJurisdictions[Item.jurisdiction] - && ["legal_case","gazette","regulation","legislation"].indexOf(Item.type) > -1) { - return null; - } var slot = {primary:false, secondary:false, tertiary:false}; if (state.tmp.area.slice(-5) === "_sort") { slot.primary = 'locale-sort'; @@ -11443,7 +11439,7 @@ CSL.dateAsSortKey = function (state, Item, isMacro) { var dp, elem, value, e, yr, prefix, i, ilen, num; var variable = this.variables[0]; var macroFlag = "empty"; - if (isMacro) { + if (isMacro && state.tmp.extension) { macroFlag = "macro-with-date"; } dp = Item[variable]; @@ -11552,14 +11548,14 @@ CSL.Util.Names.initializeWith = function (state, name, terminator, normalizeOnly if (!name) { return ""; } + if (!terminator) { + terminator = ""; + } if (["Lord", "Lady"].indexOf(name) > -1 || (!name.match(CSL.STARTSWITH_ROMANESQUE_REGEXP) && !terminator.match("%s"))) { return name; } - if (!terminator) { - terminator = ""; - } var namelist = name; if (state.opt["initialize-with-hyphen"] === false) { namelist = namelist.replace(/\-/g, " "); @@ -12328,15 +12324,15 @@ CSL.Engine.prototype.processNumber = function (node, ItemObject, variable, type) } } if ("locator" === variable - && ["bill","gazette","legislation","treaty"].indexOf(type) > -1) { + && ["bill","gazette","legislation","regulation","treaty"].indexOf(type) > -1) { num = num.split(CSL.STATUTE_SUBDIV_PLAIN_REGEX)[0]; } var rangeType = "page"; - if (["bill","gazette","legislation","legal_case","treaty"].indexOf(type) > -1 + if (["bill","gazette","legislation","legal_case","regulation","treaty"].indexOf(type) > -1 && variable === "collection-number") { rangeType = "year"; } - if (["page", "page-first"].indexOf(variable) > -1) { + if (["page", "page-first", "number"].indexOf(variable) > -1) { var m = num.split(" ")[0].match(CSL.STATUTE_SUBDIV_GROUPED_REGEX); if (m){ if (this.opt.development_extensions.static_statute_locator) { @@ -12462,7 +12458,8 @@ CSL.Util.PageRangeMangler.getFunction = function (state, rangeType) { listify = function (str) { var m, lst, ret; var hyphens = "\\s+\\-\\s+"; - var delimRex = new RegExp("([^\\\\])[" + range_delimiter + "\\u2013]", "g"); + var this_range_delimiter = range_delimiter === "-" ? "" : range_delimiter; + var delimRex = new RegExp("([^\\\\])[-" + this_range_delimiter + "\\u2013]", "g"); str = str.replace(delimRex, "$1 - ").replace(/\s+-\s+/g, " - "); var rexm = new RegExp("([a-zA-Z]*[0-9]+" + hyphens + "[a-zA-Z]*[0-9]+)", "g"); var rexlst = new RegExp("[a-zA-Z]*[0-9]+" + hyphens + "[a-zA-Z]*[0-9]+"); @@ -12558,8 +12555,8 @@ CSL.Util.PageRangeMangler.getFunction = function (state, rangeType) { }; var sniff = function (str, func, minchars, isyear) { var ret; - str = "" + str; - var lst = expand(str); + str = "" + str; + var lst = expand(str); var ret = func(lst, minchars, isyear); return ret; } @@ -12696,7 +12693,7 @@ CSL.Util.FlipFlopper.prototype.init = function (str, blob) { }; CSL.Util.FlipFlopper.prototype._normalizeString = function (str) { var i, ilen; - str = str.replace(/\s+'\s+/g," ’ "); + str = str.replace(/\s+'\s+/g," ’ "); if (str.indexOf(this.quotechars[0]) > -1) { for (i = 0, ilen = 2; i < ilen; i += 1) { if (this.quotechars[i + 2]) { @@ -12980,11 +12977,11 @@ CSL.Output.Formatters["capitalize-all"] = function (state, string) { var strings = str.string.split(" "); for (var i = 0, ilen = strings.length; i < ilen; i += 1) { if (strings[i].length > 1) { - if (state.opt.development_extensions.allow_force_lowercase) { - strings[i] = strings[i].slice(0, 1).toUpperCase() + strings[i].substr(1).toLowerCase(); - } else { - strings[i] = strings[i].slice(0, 1).toUpperCase() + strings[i].substr(1); - } + if (state.opt.development_extensions.allow_force_lowercase) { + strings[i] = strings[i].slice(0, 1).toUpperCase() + strings[i].substr(1).toLowerCase(); + } else { + strings[i] = strings[i].slice(0, 1).toUpperCase() + strings[i].substr(1); + } } else if (strings[i].length === 1) { strings[i] = strings[i].toUpperCase(); } @@ -13000,7 +12997,7 @@ CSL.Output.Formatters.title = function (state, string) { } var doppel = CSL.Output.Formatters.doppelString(string, CSL.TAG_ESCAPE); function capitalise (word) { - var m = word.match(/([:?!]+\s+|-|^)(.)(.*)/); + var m = word.match(/([:?!]+\s+|-|^)([a-zA-Z])(.*)/); if (m) { return m[1] + m[2].toUpperCase() + m[3]; } @@ -13149,7 +13146,7 @@ CSL.Output.Formats.prototype.html = { "@quotes/false": false, "@cite/entry": function (state, str) { return state.sys.wrapCitationEntry(str, this.item_id, this.locator_txt, this.suffix_txt); - }, + }, "@bibliography/entry": function (state, str) { var insert = ""; if (state.sys.embedBibliographyEntry) { @@ -13239,8 +13236,8 @@ CSL.Output.Formats.prototype.text = { }, "@quotes/false": false, "@cite/entry": function (state, str) { - return state.sys.wrapCitationEntry(str, this.item_id, this.locator_txt, this.suffix_txt); - }, + return state.sys.wrapCitationEntry(str, this.item_id, this.locator_txt, this.suffix_txt); + }, "@bibliography/entry": function (state, str) { return str+"\n"; }, @@ -13315,10 +13312,10 @@ CSL.Output.Formats.prototype.rtf = { "@display/block": "\\line{}%%STRING%%\\line\r\n", "@cite/entry": function (state, str) { return str; - }, + }, "@cite/entry": function (state, str) { - return state.sys.wrapCitationEntry(str, this.item_id, this.locator_txt, this.suffix_txt); - }, + return state.sys.wrapCitationEntry(str, this.item_id, this.locator_txt, this.suffix_txt); + }, "@bibliography/entry": function(state,str){ return str; }, @@ -13326,10 +13323,10 @@ CSL.Output.Formats.prototype.rtf = { return str+"\\tab "; }, "@display/right-inline": function (state, str) { - return str+"\n"; + return str+"\\line\r\n"; }, "@display/indent": function (state, str) { - return "\n\\tab "+str; + return "\n\\tab "+str+"\\line\r\n"; }, "@showid/true": function (state, str, cslid) { if (!state.tmp.just_looking && ! state.tmp.suppress_decorations) { @@ -13710,12 +13707,11 @@ CSL.getSortKeys = function (Item, key_type) { this.tmp.extension = "_sort"; this.tmp.disambig_override = true; this.tmp.disambig_request = false; - use_parallels = this.parallel.use_parallels; - this.parallel.use_parallels = false; + this.parallel.use_parallels = (this.parallel.use_parallels === true || this.parallel.use_parallels === null) ? null : false; this.tmp.suppress_decorations = true; CSL.getCite.call(this, Item); this.tmp.suppress_decorations = false; - this.parallel.use_parallels = use_parallels; + this.parallel.use_parallels = this.parallel.use_parallels === null ? true : false; this.tmp.disambig_override = false; len = this[key_type].keys.length; for (pos = 0; pos < len; pos += 1) { @@ -14099,16 +14095,16 @@ CSL.Disambiguation.prototype.disYears = function () { tokens = []; var base = this.lists[this.listpos][0]; if (this.clashes[1]) { - for (var i = 0, ilen = this.state.registry.mylist.length; i < ilen; i += 1) { - var origid = this.state.registry.mylist[i]; - for (var j = 0, jlen = this.lists[this.listpos][1].length; j < jlen; j += 1) { - var token = this.lists[this.listpos][1][j]; - if (token.id == origid) { - tokens.push(this.registry[token.id]); - break; - } - } - } + for (var i = 0, ilen = this.state.registry.mylist.length; i < ilen; i += 1) { + var origid = this.state.registry.mylist[i]; + for (var j = 0, jlen = this.lists[this.listpos][1].length; j < jlen; j += 1) { + var token = this.lists[this.listpos][1][j]; + if (token.id == origid) { + tokens.push(this.registry[token.id]); + break; + } + } + } } tokens.sort(this.state.registry.sorter.compareKeys); for (pos = 0, len = tokens.length; pos < len; pos += 1) { @@ -14320,3 +14316,292 @@ CSL.Disambiguation.prototype.captureStepToBase = function() { } this.betterbase.names[this.gnameset] = this.base.names[this.gnameset]; }; +CSL.Engine.prototype.getJurisdictionList = function (jurisdiction) { + var jurisdictionList = []; + var jurisdictionElems = jurisdiction.split(":"); + for (var j=jurisdictionElems.length;j>0;j--) { + jurisdictionList.push(jurisdictionElems.slice(0,j).join(":")); + } + if (jurisdictionList.indexOf("us") === -1) { + jurisdictionList.push("us"); + } + return jurisdictionList; +} +CSL.Engine.prototype.retrieveAllStyleModules = function (jurisdictionList) { + var ret = {}; + var preferences = this.locale[this.opt.lang].opts["jurisdiction-preference"]; + preferences = preferences ? preferences : []; + preferences = [null].concat(preferences); + for (var i=preferences.length-1;i>-1;i--) { + var preference = preferences[i]; + for (var j=0,jlen=jurisdictionList.length;j -1) { + nospaceList.push(particle); + } else { + spaceList.push(particle); + } + } + function composeParticleLists () { + LIST = { + "family": { + "space": [], + "nospace": [] + }, + "given": { + "partial": {}, + "full": [] + } + } + REX = { + "family": null, + "given": { + "full_lower": null, + "full_comma": null, + "partial": {} + } + } + var FAM_SP = LIST.family.space; + var FAM_NSP = LIST.family.nospace; + var GIV_PART = LIST.given.partial; + var GIV_FULL = LIST.given.full; + for (var i=0,ilen=PARTICLES.length;ib.length) { + return -1; + } else { + return 0; + } + } + function composeRegularExpressions () { + composeParticleLists(); + REX.family = new RegExp("^((?:" + LIST.family.space.join("|") + ")(\\s+)|(?:" + LIST.family.nospace.join("|") + "([^\\s]))).*", "i"); + REX.given.full_comma = new RegExp(".*?(,[\\s]*)(" + LIST.given.full.join("|") + ")$", "i"); + REX.given.full_lower = new RegExp(".*?([ ]+)(" + LIST.given.full.join("|") + ")$"); + X = "Tom du".match(REX.given.full_lower) + var allInTheFamily = LIST.family.space + for (var key in LIST.given.partial) { + REX.given.partial[key] = new RegExp(".*?(\\s+)(" + LIST.given.partial[key].join("|") + ")$", "i"); + } + } + composeRegularExpressions(); + function matchRegularExpressions (name) { + var m = REX.family.exec(name.family); + var result = { + family: {match:null, str:null}, + given: {match:null, str:null} + } + if (m) { + result.family.match = m[2] ? m[1] : m[3] ? m[1].slice(0,-m[3].length) : m[1]; + result.family.str = (m[2] ? m[1].slice(0,-m[2].length) : m[3] ? m[1].slice(0,-m[3].length) : m[1]); + if (REX.given.partial[result.family.str.toLowerCase()]) { + var m = REX.given.partial[result.family.str.toLowerCase()].exec(name.given); + if (m) { + result.given.match = m[2] ? m[1] + m[2] : m[2]; + result.given.str = m[2]; + } + } + } else { + var m = REX.given.full_comma.exec(name.given); + if (!m) m = REX.given.full_lower.exec(name.given); + if (m) { + result.given.match = m[1] ? m[1] + m[2] : m[2]; + result.given.str = m[2]; + } + } + return result; + } + function apostropheNormalizer(name, reverse) { + var params = ["\u2019", "\'"] + if (reverse) params.reverse(); + if (name.family) { + name.family = name.family.replace(params[0], params[1]) + } + if (name.given) { + name.given = name.given.replace(params[0], params[1]) + } + } + return function (name, normalizeApostrophe) { + if (normalizeApostrophe) { + apostropheNormalizer(name); + } + var result = matchRegularExpressions(name); + var particles = []; + if (result.given.match) { + name.given = name.given.slice(0,-result.given.match.length); + particles.push(result.given.str); + } + if (result.family.match) { + name.family = name.family.slice(result.family.match.length); + particles.push(result.family.str); + } + particles = particles.join(" ").split(" "); + if (particles.length) { + var key = particles.join(" "); + var pInfo = CATEGORIZER[key.toLowerCase()]; + if (pInfo) { + for (var i=pInfo.length-1;i>-1;i--) { + var pSet = pInfo[i]; + if (!result.family.str) result.family.str = ""; + if (!result.given.str) result.given.str = ""; + if (result.given.str === pSet.strings[0] && result.family.str === pSet.strings[1]) { + break; + } + } + if (pSet.positions[0] !== null) { + name["dropping-particle"] = particles.slice(pSet.positions[0][0], pSet.positions[0][1]).join(" "); + } + if (pSet.positions[1] !== null) { + name["non-dropping-particle"] = particles.slice(pSet.positions[1][0], pSet.positions[1][1]).join(" "); + } + } + } + if (normalizeApostrophe) { + apostropheNormalizer(name, true); + } + } +}(); \ No newline at end of file diff --git a/components/zotero-service.js b/components/zotero-service.js index 6671661f5..edd62f49f 100644 --- a/components/zotero-service.js +++ b/components/zotero-service.js @@ -224,6 +224,7 @@ function makeZoteroContext(isConnector) { // Load CiteProc into Zotero.CiteProc namespace zContext.Zotero.CiteProc = {"Zotero":zContext.Zotero}; + subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/citeproc-prereqs.js", zContext.Zotero.CiteProc); subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/citeproc.js", zContext.Zotero.CiteProc); // Load XRegExp object into Zotero.XRegExp From 3420b4874af1d192db95b6cce80b9881dd1beaa4 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 9 Jul 2015 18:00:15 -0400 Subject: [PATCH 45/62] Tweaks for application menu on OS X - Restore About Zotero item - Fix Quit item - Close Standalone when Standalone window is closed (we did this before, but apparently having our own hidden window breaks that mechanism) --- chrome/content/zotero/locale/csl | 2 +- chrome/content/zotero/standalone/hiddenWindow.xul | 11 ++++++++--- chrome/content/zotero/standalone/standalone.js | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/locale/csl b/chrome/content/zotero/locale/csl index 17bc27f4a..d2b612f8a 160000 --- a/chrome/content/zotero/locale/csl +++ b/chrome/content/zotero/locale/csl @@ -1 +1 @@ -Subproject commit 17bc27f4a1835b9f23e5daea98fb61ee2af94072 +Subproject commit d2b612f8a6f764cbd66e67238636fac3888a7736 diff --git a/chrome/content/zotero/standalone/hiddenWindow.xul b/chrome/content/zotero/standalone/hiddenWindow.xul index a9bf7df7d..b34f6a173 100644 --- a/chrome/content/zotero/standalone/hiddenWindow.xul +++ b/chrome/content/zotero/standalone/hiddenWindow.xul @@ -36,11 +36,11 @@ %zoteroDTD; ]> - + +