www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 5c523d869412cbf842377e711703c89d87cd5fb0
parent 2a5b026f65c93008d9ddc8681181c080aa8a3471
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat, 18 Jul 2015 07:09:53 -0400

Merge branch '4.0'

Diffstat:
Mchrome/content/zotero-platform/mac/overlay.css | 54+++++++++++++++++++++++++++++++-----------------------
Mchrome/content/zotero-platform/mac/standalone/menuOverlay.xul | 2+-
Mchrome/content/zotero-platform/unix/overlay.css | 119++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------
Mchrome/content/zotero-platform/win/overlay.css | 183++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------
Mchrome/content/zotero/bibliography.js | 31++++++++++++++++++-------------
Mchrome/content/zotero/bindings/guidancepanel.xml | 42+++++++++++++++++++++++++++++++-----------
Mchrome/content/zotero/browser.js | 97++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mchrome/content/zotero/icon.js | 61+++++++++++++++++++++++++++++++++++++------------------------
Mchrome/content/zotero/ingester/selectitems.js | 5+++++
Mchrome/content/zotero/recognizePDF.js | 12++++++++++--
Achrome/content/zotero/standalone/hiddenWindow.xul | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mchrome/content/zotero/standalone/standalone.js | 1+
Mchrome/content/zotero/tools/csledit.xul | 2+-
Mchrome/content/zotero/webpagedump/domsaver.js | 3++-
Achrome/content/zotero/xpcom/citeproc-prereqs.js | 391+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mchrome/content/zotero/xpcom/citeproc.js | 2216+++++++++++++++++++++++++++++++++++++++++++++----------------------------------
Mchrome/content/zotero/xpcom/connector/connector.js | 2+-
Mchrome/content/zotero/xpcom/connector/translator.js | 2+-
Achrome/content/zotero/xpcom/dns_worker.js | 234+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mchrome/content/zotero/xpcom/integration.js | 68++++++++++++++++++++++++++++++++++++++------------------------------
Mchrome/content/zotero/xpcom/ipc.js | 14++++----------
Mchrome/content/zotero/xpcom/progressWindow.js | 3+--
Mchrome/content/zotero/xpcom/proxy.js | 147++++++++++++++++++-------------------------------------------------------------
Mchrome/content/zotero/xpcom/quickCopy.js | 16+++++++++++++---
Mchrome/content/zotero/xpcom/server_connector.js | 2+-
Mchrome/content/zotero/xpcom/storage.js | 7+++++--
Mchrome/content/zotero/xpcom/style.js | 2+-
Mchrome/content/zotero/xpcom/translation/translators.js | 2+-
Mchrome/content/zotero/xpcom/utilities.js | 7++++++-
Mchrome/content/zotero/xpcom/zotero.js | 10+++++++++-
Mchrome/content/zotero/zoteroPane.js | 3++-
Mchrome/locale/af-ZA/zotero/zotero.properties | 2++
Mchrome/locale/ar/zotero/zotero.properties | 2++
Mchrome/locale/bg-BG/zotero/zotero.properties | 2++
Mchrome/locale/ca-AD/zotero/zotero.properties | 2++
Mchrome/locale/cs-CZ/zotero/zotero.properties | 2++
Mchrome/locale/da-DK/zotero/zotero.properties | 2++
Mchrome/locale/de/zotero/preferences.dtd | 4++--
Mchrome/locale/de/zotero/zotero.dtd | 2+-
Mchrome/locale/de/zotero/zotero.properties | 36+++++++++++++++++++-----------------
Mchrome/locale/el-GR/zotero/zotero.properties | 2++
Mchrome/locale/en-US/zotero/csledit.dtd | 1-
Mchrome/locale/en-US/zotero/zotero.properties | 4+++-
Mchrome/locale/es-ES/zotero/preferences.dtd | 4++--
Mchrome/locale/es-ES/zotero/zotero.dtd | 2+-
Mchrome/locale/es-ES/zotero/zotero.properties | 34++++++++++++++++++----------------
Mchrome/locale/et-EE/zotero/about.dtd | 2+-
Mchrome/locale/et-EE/zotero/preferences.dtd | 10+++++-----
Mchrome/locale/et-EE/zotero/standalone.dtd | 8++++----
Mchrome/locale/et-EE/zotero/zotero.dtd | 96++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mchrome/locale/et-EE/zotero/zotero.properties | 14++++++++------
Mchrome/locale/eu-ES/zotero/zotero.properties | 2++
Mchrome/locale/fa/zotero/zotero.properties | 2++
Mchrome/locale/fi-FI/zotero/zotero.properties | 2++
Mchrome/locale/fr-FR/zotero/preferences.dtd | 8++++----
Mchrome/locale/fr-FR/zotero/zotero.dtd | 4++--
Mchrome/locale/fr-FR/zotero/zotero.properties | 28+++++++++++++++-------------
Mchrome/locale/gl-ES/zotero/zotero.properties | 2++
Mchrome/locale/he-IL/zotero/zotero.properties | 2++
Mchrome/locale/hr-HR/zotero/zotero.properties | 2++
Mchrome/locale/hu-HU/zotero/zotero.properties | 2++
Mchrome/locale/id-ID/zotero/zotero.properties | 2++
Mchrome/locale/is-IS/zotero/zotero.properties | 2++
Mchrome/locale/it-IT/zotero/zotero.properties | 2++
Mchrome/locale/ja-JP/zotero/zotero.properties | 2++
Mchrome/locale/km/zotero/zotero.properties | 2++
Mchrome/locale/ko-KR/zotero/zotero.properties | 2++
Mchrome/locale/lt-LT/zotero/zotero.properties | 2++
Mchrome/locale/mn-MN/zotero/zotero.properties | 2++
Mchrome/locale/nb-NO/zotero/zotero.properties | 2++
Mchrome/locale/nl-NL/zotero/zotero.properties | 2++
Mchrome/locale/nn-NO/zotero/zotero.properties | 2++
Mchrome/locale/pl-PL/zotero/preferences.dtd | 4++--
Mchrome/locale/pl-PL/zotero/zotero.dtd | 2+-
Mchrome/locale/pl-PL/zotero/zotero.properties | 24+++++++++++++-----------
Mchrome/locale/pt-BR/zotero/zotero.properties | 2++
Mchrome/locale/pt-PT/zotero/zotero.properties | 2++
Mchrome/locale/ro-RO/zotero/zotero.properties | 2++
Mchrome/locale/ru-RU/zotero/zotero.properties | 2++
Mchrome/locale/sk-SK/zotero/preferences.dtd | 4++--
Mchrome/locale/sk-SK/zotero/zotero.dtd | 2+-
Mchrome/locale/sk-SK/zotero/zotero.properties | 40+++++++++++++++++++++-------------------
Mchrome/locale/sl-SI/zotero/zotero.properties | 2++
Mchrome/locale/sr-RS/zotero/zotero.properties | 2++
Mchrome/locale/sv-SE/zotero/preferences.dtd | 12++++++------
Mchrome/locale/sv-SE/zotero/zotero.dtd | 2+-
Mchrome/locale/sv-SE/zotero/zotero.properties | 34++++++++++++++++++----------------
Mchrome/locale/th-TH/zotero/zotero.properties | 2++
Mchrome/locale/tr-TR/zotero/preferences.dtd | 4++--
Mchrome/locale/tr-TR/zotero/zotero.dtd | 2+-
Mchrome/locale/tr-TR/zotero/zotero.properties | 40+++++++++++++++++++++-------------------
Mchrome/locale/uk-UA/zotero/preferences.dtd | 4++--
Mchrome/locale/uk-UA/zotero/zotero.dtd | 2+-
Mchrome/locale/uk-UA/zotero/zotero.properties | 64+++++++++++++++++++++++++++++++++-------------------------------
Mchrome/locale/vi-VN/zotero/zotero.properties | 2++
Mchrome/locale/zh-CN/zotero/zotero.properties | 2++
Mchrome/locale/zh-TW/zotero/preferences.dtd | 4++--
Mchrome/locale/zh-TW/zotero/zotero.dtd | 2+-
Mchrome/locale/zh-TW/zotero/zotero.properties | 40+++++++++++++++++++++-------------------
Mchrome/skin/default/zotero/bindings/guidancepanel.css | 1+
Mchrome/skin/default/zotero/zotero.css | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mcomponents/zotero-service.js | 1+
Mresource/schema/repotime.txt | 2+-
Mtest/content/support.js | 10++++++++++
Mtest/tests/data/allTypesAndFields.js | 170+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtest/tests/data/citeProcJSExport.js | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtest/tests/data/itemJSON.js | 136+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtest/tests/data/translatorExport.js | 136+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtest/tests/data/translatorExportLegacy.js | 170+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atest/tests/quickCopyTest.js | 36++++++++++++++++++++++++++++++++++++
110 files changed, 3657 insertions(+), 1581 deletions(-)

diff --git 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,8 +41,11 @@ 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,43 +54,47 @@ 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; } -/* 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; +/* + * Alterations for overflow menu + */ +#zotero-toolbar-buttons[overflowedItem=true] { + margin: 6px 4px 0; } + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { + max-width: 16px; +} + /* End toolbar icons */ #zotero-splitter diff --git a/chrome/content/zotero-platform/mac/standalone/menuOverlay.xul b/chrome/content/zotero-platform/mac/standalone/menuOverlay.xul @@ -84,7 +84,7 @@ <menuitem id="menu_preferences" label="&preferencesCmdMac.label;" key="key_preferencesCmdMac" - oncommand="ZoteroPane.openPreferences();"/> + oncommand="Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('navigator:browser').ZoteroPane.openPreferences();"/> <menuitem id="menu_mac_services" label="&servicesMenuMac.label;"/> <menuitem id="menu_mac_hide_app" diff --git 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-main-button[cui-areatype="toolbar"] { +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-save-button[cui-areatype="toolbar"] > .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,31 +86,78 @@ 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 { +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-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 { +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"] > #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"] > #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"] > #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 { +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-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: 0 !important; + margin-bottom: 0 !important; + margin-right: 0 !important; + padding: 0 !important; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { + max-width: 28px !important; + margin: 0 4px 0 0 !important; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-menubutton-button { + margin-left: 8px; +} /* End toolbar buttons */ diff --git a/chrome/content/zotero-platform/win/overlay.css b/chrome/content/zotero-platform/win/overlay.css @@ -1,113 +1,190 @@ /* 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 { - width: 32px; + +/* + * 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-save-button-single[cui-areatype="toolbar"] .toolbarbutton-icon { - width: 30px; +toolbar[id="nav-bar"] #zotero-toolbar-save-button .toolbarbutton-icon { + width: 28px; /* 16 + 6 + 5 + 1 */ + padding-left: 6px !important; + padding-right: 5px !important; } -#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon, -#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { - width: 28px; +toolbar[id="nav-bar"] #zotero-toolbar-main-button-single .toolbarbutton-icon { + width: 32px; } -#zotero-toolbar-main-button[cui-areatype="toolbar"] { - margin-right: -1px !important; +toolbar[id="nav-bar"] #zotero-toolbar-save-button-single .toolbarbutton-icon { + width: 31px; /* Compensate for border on only one side */ } -#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { - margin-left: 2px; - margin-right: -1px; - padding-left: 5px !important; - padding-right: 5px !important; +/* Fix size when dragged to nav bar in Customize mode */ +toolbar[id="nav-bar"] toolbarpaletteitem #zotero-toolbar-save-button .toolbarbutton-icon { + width: 29px; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { - padding-left: 6px !important; - padding-right: 6px !important; +toolbar[id="nav-bar"] #zotero-toolbar-buttons #zotero-toolbar-main-button { + margin-right: -1px; } -#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-buttons #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker .dropmarker-icon { + padding-left: 4px; + padding-right: 4px; } -#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-menubutton-button { - margin-left: -2px !important; +toolbar[id="nav-bar"] #zotero-toolbar-buttons > separator { + margin-top: 11px; + margin-bottom: 11px; + -moz-margin-end: -3px; } -#zotero-toolbar-buttons[cui-areatype="toolbar"] > separator, -#zotero-toolbar-buttons[cui-areatype="toolbar"] > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker::before { +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"]:hover > separator, -#zotero-toolbar-buttons[cui-areatype="toolbar"]: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"]: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 { +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"]: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 { +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"]:hover > #zotero-toolbar-save-button .toolbarbutton-icon, -#zotero-toolbar-buttons[cui-areatype="toolbar"]: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; } +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; +} + +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; +} + /* 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, +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"] > #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 { +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"] > #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 { +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"] > #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); +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 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, +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon { + height: 16px; +} + +#zotero-toolbar-buttons[overflowedItem=true] { + margin: 6px 0 0 0 !important; +} + +#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button { + 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: 8px; + padding-right: 0 !important; +} + /* End toolbar buttons */ + @media (min-resolution: 1.5dppx) { #zotero-toolbar .toolbarbutton-icon { width: 16px; diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js @@ -33,8 +33,11 @@ // Used by rtfScan.xul, integrationDocPrefs.xul, and bibliography.xul var Zotero_File_Interface_Bibliography = new function() { - var _io, _saveStyle; - var lastSelectedLocale; // Only changes when explicitly selected + var _io; + + // Only changes when explicitly selected + var lastSelectedStyle, + lastSelectedLocale; /* * Initialize some variables and prepare event listeners for when chrome is done @@ -60,7 +63,6 @@ var Zotero_File_Interface_Bibliography = new function() { // if no style is requested, get the last style used if(!_io.style) { _io.style = Zotero.Prefs.get("export.lastStyle"); - _saveStyle = true; } // add styles to list @@ -175,8 +177,8 @@ var Zotero_File_Interface_Bibliography = new function() { */ this.styleChanged = function () { var selectedItem = document.getElementById("style-listbox").selectedItem; - var selectedStyle = selectedItem.getAttribute('value'); - var selectedStyleObj = Zotero.Styles.get(selectedStyle); + lastSelectedStyle = selectedItem.getAttribute('value'); + var selectedStyleObj = Zotero.Styles.get(lastSelectedStyle); updateLocaleMenu(selectedStyleObj); @@ -210,7 +212,7 @@ var Zotero_File_Interface_Bibliography = new function() { // Change label to "Citation" or "Note" depending on style class if(document.getElementById("citations")) { let label = ""; - if(Zotero.Styles.get(selectedStyle).class == "note") { + if(Zotero.Styles.get(lastSelectedStyle).class == "note") { label = Zotero.getString('citation.notes'); } else { label = Zotero.getString('citation.citations'); @@ -235,7 +237,10 @@ var Zotero_File_Interface_Bibliography = new function() { this.acceptSelection = function () { // collect code _io.style = document.getElementById("style-listbox").value; - _io.locale = document.getElementById("locale-menu").value; + + let localeMenu = document.getElementById("locale-menu"); + _io.locale = localeMenu.disabled ? undefined : localeMenu.value; + if(document.getElementById("output-method-radio")) { // collect settings _io.mode = document.getElementById("output-mode-radio").selectedItem.id; @@ -249,7 +254,7 @@ var Zotero_File_Interface_Bibliography = new function() { if(document.getElementById("displayAs")) { var automaticJournalAbbreviationsEl = document.getElementById("automaticJournalAbbreviations-checkbox"); _io.automaticJournalAbbreviations = automaticJournalAbbreviationsEl.checked; - if(!automaticJournalAbbreviationsEl.hidden && _saveStyle) { + if(!automaticJournalAbbreviationsEl.hidden && lastSelectedStyle) { Zotero.Prefs.set("cite.automaticJournalAbbreviations", _io.automaticJournalAbbreviations); } _io.useEndnotes = document.getElementById("displayAs").selectedIndex; @@ -257,13 +262,13 @@ var Zotero_File_Interface_Bibliography = new function() { _io.storeReferences = document.getElementById("storeReferences").checked; } - // save style (this happens only for "Export Bibliography," or Word - // integration when no bibliography style was previously selected) - if(_saveStyle) { + // remember style and locale if user selected these explicitly + if(lastSelectedStyle) { Zotero.Prefs.set("export.lastStyle", _io.style); } - // save locale - Zotero.Prefs.set("export.lastLocale", lastSelectedLocale); + if (lastSelectedLocale) { + Zotero.Prefs.set("export.lastLocale", lastSelectedLocale); + } }; } diff --git a/chrome/content/zotero/bindings/guidancepanel.xml b/chrome/content/zotero/bindings/guidancepanel.xml @@ -34,6 +34,8 @@ </resources> <implementation> + <property name="panel" onget="return document.getAnonymousNodes(this)[0]"/> + <!-- @param {Object} [options] @param {String} [options.text] - Text to use in place of firstRunGuidance.<about> @@ -77,8 +79,7 @@ var x = this.getAttribute("x"), y = this.getAttribute("y"), - position = this.getAttribute("position"), - panel = document.getAnonymousNodes(this)[0]; + position = this.getAttribute("position"); if (!useLastText) { if (!text) { @@ -119,7 +120,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(); }; @@ -129,7 +138,7 @@ } self.hidden = false; - panel.openPopup(forEl, position ? position : "after_start", + self.panel.openPopup(forEl, position ? position : "after_start", x ? parseInt(x, 10) : 0, y ? parseInt(y, 10) : 0, false, false, null); if (pref) { Zotero.Prefs.set(pref, true); @@ -142,12 +151,13 @@ f(); } - if (this.hasAttribute("noautohide")) { + if (this.getAttribute("noautohide") == 'true' + && !this.hasAttribute('forward')) { let listener = function () { - panel.removeEventListener("click", listener); - panel.hidePopup(); - }; - panel.addEventListener("click", listener); + this.panel.removeEventListener("click", listener); + this.panel.hidePopup(); + }.bind(this); + this.panel.addEventListener("click", listener); } ]]> </body> @@ -174,8 +184,18 @@ var nextElem = document.getElementById(nextID); button = this.id(dir + '-button'); button.hidden = false; + var target; + // If there's a forward action and no back action, the whole panel triggers + // the forward in noautohide mode + if (dir == 'forward' && !this.hasAttribute('back') + && this.getAttribute('noautohide') == 'true') { + target = this.panel; + } + else { + target = button; + } var listener = function (event) { - button.removeEventListener("click", listener); + target.removeEventListener("click", listener); this.hide(); var data = { force: true @@ -189,7 +209,7 @@ nextElem.show(data); event.stopPropagation(); }.bind(this); - button.addEventListener("click", listener); + target.addEventListener("click", listener); ]]></body> </method> diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js @@ -146,8 +146,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 @@ -157,19 +159,21 @@ var Zotero_Browser = new function() { Zotero_Browser.performTranslation(tab.page.translate); // TODO: async } 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 */ @@ -501,8 +505,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]; @@ -520,7 +524,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"); @@ -541,38 +568,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); } } @@ -805,7 +802,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; } @@ -901,12 +897,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/content/zotero/icon.js b/chrome/content/zotero/icon.js @@ -47,12 +47,6 @@ CustomizableUI.addListener({ return; } - var item = document.getElementById(id); - // Element may not exist yet if it was added to the panel - if (item) { - updateItemForArea(item, area); - } - var isUpgrade = false; try { isUpgrade = Zotero.Prefs.get("firstRunGuidanceShown.saveIcon"); @@ -61,25 +55,36 @@ CustomizableUI.addListener({ var shortcut = Zotero.getString( Zotero.isMac ? "general.keys.cmdShift" : "general.keys.ctrlShift" ) + Zotero.Prefs.get("keys.openZotero"); - document.getElementById("zotero-main-button-guidance").show({ - text: Zotero.getString(property, shortcut) - }); - document.getElementById("zotero-save-button-guidance").show(); + + let widget = CustomizableUI.getWidget(id); + for (let instance of widget.instances) { + let doc = instance.node.ownerDocument; + + updateItemForArea(instance.node, area); + + doc.getElementById("zotero-main-button-guidance").show({ + text: Zotero.getString(property, shortcut) + }); + doc.getElementById("zotero-save-button-guidance").show(); + } } else if (id == getSingleID('save')) { - Zotero_Browser.updateStatus(); + let widget = CustomizableUI.getWidget(id); + for (let instance of widget.instances) { + instance.node.ownerDocument.defaultView.Zotero_Browser.updateStatus(); + } } }, - onWidgetRemoved: function (id, area) { - if (id == comboButtonsID) { - var item = document.getElementById(id); - updateItemForArea(item, null); + onWidgetOverflow: function (node, container) { + if (node.id == comboButtonsID) { + node.classList.add("toolbarbutton-1"); } - // Clear dynamic image from save icon and revert to CSS - else if (id == getSingleID('save')) { - let button = document.getElementById(id); - button.image = ""; + }, + + onWidgetUnderflow: function (node, container) { + if (node.id == comboButtonsID) { + node.classList.remove("toolbarbutton-1"); } }, @@ -90,17 +95,21 @@ CustomizableUI.addListener({ if (area == CustomizableUI.AREA_PANEL) { var placement = CustomizableUI.getPlacementOfWidget(comboButtonsID) var update = false; + let singleID = getSingleID('save'); if (placement && placement.area == CustomizableUI.AREA_PANEL) { update = true; } else { - placement = CustomizableUI.getPlacementOfWidget(getSingleID('save')); + placement = CustomizableUI.getPlacementOfWidget(singleID); if (placement && placement.area == CustomizableUI.AREA_PANEL) { update = true; } } if (update) { - Zotero_Browser.updateStatus(); + let widget = CustomizableUI.getWidget(singleID); + for (let instance of widget.instances) { + instance.node.ownerDocument.defaultView.Zotero_Browser.updateStatus(); + } } } } @@ -135,7 +144,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"); @@ -160,7 +173,7 @@ CustomizableUI.createWidget({ tooltiptext: getTooltipText('main'), defaultArea: false, onCommand: function (event) { - ZoteroOverlay.toggleDisplay(); + event.target.ownerDocument.defaultView.ZoteroOverlay.toggleDisplay(); } }); @@ -171,7 +184,7 @@ CustomizableUI.createWidget({ tooltiptext: getTooltipText('save'), defaultArea: false, onCommand: function (event) { - Zotero_Browser.scrapeThisPage(null, event); + event.target.ownerDocument.defaultView.Zotero_Browser.scrapeThisPage(null, event); }, onCreated: function (button) { const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; diff --git a/chrome/content/zotero/ingester/selectitems.js b/chrome/content/zotero/ingester/selectitems.js @@ -64,6 +64,11 @@ Zotero_Ingester_Interface_SelectItems.init = function() { itemNode.setAttribute("checked", checked); listbox.appendChild(itemNode); } + + // Check item if there is only one + if (listbox.itemCount === 1) { + listbox.getItemAtIndex(0).setAttribute("checked", true); + } } /** diff --git a/chrome/content/zotero/recognizePDF.js b/chrome/content/zotero/recognizePDF.js @@ -722,7 +722,10 @@ var Zotero_RecognizePDF = new function() { throw new Zotero.Exception.Alert('recognizePDF.stopped'); } + Zotero.debug("RecognizePDF: (" + xmlhttp.status + ") Got page with title " + xmlhttp.response.title); + if(Zotero.Utilities.xpath(xmlhttp.response, "//form[@action='Captcha']").length) { + Zotero.debug("RecognizePDF: Found CAPTCHA on page."); return _solveCaptcha(xmlhttp, tries); } return xmlhttp; @@ -742,19 +745,24 @@ var Zotero_RecognizePDF = new function() { throw new Zotero.Exception.Alert('recognizePDF.stopped'); } + Zotero.debug("RecognizePDF: Checking for CAPTCHA on Google Scholar error page (" + e.status + ")"); + // Check for captcha on error page if(e instanceof Zotero.HTTP.UnexpectedStatusException && (e.status == 403 || e.status == 503) && e.xmlhttp.response) { if(_extractCaptchaFormData(e.xmlhttp.response)) { + Zotero.debug("RecognizePDF: CAPTCHA found"); return _solveCaptcha(e.xmlhttp, tries); } else if(!dontClearCookies && e.xmlhttp.channel) { // Make sure we can obtain original URL // AFAICT, for 403 errors, GS just says "sorry, try later", // but if you clear cookies, you get a CAPTCHA + Zotero.debug("RecognizePDF: No CAPTCHA detected on page. Clearing cookies."); if(!_clearGSCookies(e.xmlhttp.channel.originalURI.host)) { //user said no or no cookies removed throw new Zotero.Exception.Alert('recognizePDF.limit'); } // Redo GET request + Zotero.debug("RecognizePDF: Reloading page after clearing cookies."); return Zotero.HTTP.promise("GET", e.xmlhttp.channel.originalURI.spec, {"responseType":"document"}) .then(function(xmlhttp) { return _checkCaptchaOK(xmlhttp, tries); @@ -809,6 +817,7 @@ var Zotero_RecognizePDF = new function() { throw new Zotero.Exception.Alert('recognizePDF.limit'); } + Zotero.debug('RecognizePDF: User entered "' + io.dataOut.captcha + '" for CAPTCHA'); formData.input.captcha = io.dataOut.captcha; var url = '', prop; for(prop in formData.input) { @@ -894,4 +903,4 @@ var Zotero_RecognizePDF = new function() { return removed; } }; -} -\ No newline at end of file +} diff --git a/chrome/content/zotero/standalone/hiddenWindow.xul b/chrome/content/zotero/standalone/hiddenWindow.xul @@ -0,0 +1,60 @@ +<?xml version="1.0"?> +<!-- + ***** BEGIN LICENSE BLOCK ***** + + Copyright © 2009 Center for History and New Media + George Mason University, Fairfax, Virginia, USA + http://zotero.org + + This file is part of Zotero. + + Zotero is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Zotero is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with Zotero. If not, see <http://www.gnu.org/licenses/>. + + ***** END LICENSE BLOCK ***** +--> + + +<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> +<?xul-overlay href="chrome://zotero-platform/content/standalone/menuOverlay.xul"?> + +<!DOCTYPE window [ + <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> %globalDTD; + <!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd" > %textcontextDTD; + <!ENTITY % standaloneDTD SYSTEM "chrome://zotero/locale/standalone.dtd" > %standaloneDTD; + <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" > %brandDTD; + <!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd"> %zoteroDTD; +]> + +<window id="main-window" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/> + <commandset id="mainCommandSet"> + <!--FILE--> + <command id="cmd_quitApplication" oncommand="goQuitApplication();"/> + </commandset> + + <keyset id="mainKeyset"> + <key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/> + </keyset> + + <menubar id="main-menubar"> + <menu id="fileMenu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;"> + <menupopup id="menu_FilePopup"> + <menuitem id="aboutName" + accesskey="&aboutProduct.accesskey;" + label="&aboutProduct.label;" + oncommand="Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('navigator:browser').ZoteroPane.openAboutDialog();"/> + </menupopup> + </menu> + </menubar> +</window> diff --git a/chrome/content/zotero/standalone/standalone.js b/chrome/content/zotero/standalone/standalone.js @@ -157,6 +157,7 @@ const ZoteroStandalone = new function() { */ this.onUnload = function() { ZoteroPane.destroy(); + goQuitApplication(); } } diff --git a/chrome/content/zotero/tools/csledit.xul b/chrome/content/zotero/tools/csledit.xul @@ -47,7 +47,7 @@ <menulist id="zotero-csl-page-type" style="min-height: 1.6em; min-width: 50px" oncommand="Zotero_CSL_Editor.refresh()" /> <label value=":" /> <textbox size="5" id="preview-pages" type="timed" timeout="250" oncommand="Zotero_CSL_Editor.refresh()"/> - <checkbox oncommand="Zotero_CSL_Editor.refresh()" id="preview-suppress-author" label="&styles.editor.suppressAuthor;" /> + <checkbox oncommand="Zotero_CSL_Editor.refresh()" id="preview-suppress-author" label="&zotero.citation.suppressAuthor.label;" /> <label value="&styles.editor.citePosition;" /> <menulist id="zotero-ref-position" oncommand="Zotero_CSL_Editor.refresh()"> <menupopup> diff --git a/chrome/content/zotero/webpagedump/domsaver.js b/chrome/content/zotero/webpagedump/domsaver.js @@ -639,7 +639,8 @@ var wpdDOMSaver = { if (medium != "" && medium.indexOf("screen") < 0 && medium.indexOf("all") < 0) { return ""; } - if (aCSS.href != null && aCSS.href.indexOf("chrome") == 0) return ""; + // Disabled by Dan S. to fix CSS on snapshots of Reader View + //if (aCSS.href != null && aCSS.href.indexOf("chrome") == 0) return ""; var flag = ""; // Added by Dan S. for Zotero diff --git a/chrome/content/zotero/xpcom/citeproc-prereqs.js 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 = "<docco><institution institution-parts=\"long\" delimiter=\", \" substitute-use-first=\"1\" use-last=\"1\"><institution-part name=\"long\"/></institution></docco>"; + 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 = "<docco><bogus/></docco>"; + } + 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 @@ -80,18 +80,17 @@ if (!Array.indexOf) { }; } var CSL = { - PROCESSOR_VERSION: "1.0.543", + PROCESSOR_VERSION: "1.1.39", 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,30 +157,59 @@ 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: [ ["(", "["], [")", "]"] ], checkNestedBraceOpen: new RegExp(".*\\("), checkNestedBraceClose: new RegExp(".*\\)"), + MULTI_FIELDS: ["event", "publisher", "publisher-place", "event-place", "title", "container-title", "collection-title", "authority","edition","genre","title-short","medium","jurisdiction","archive","archive-place"], LangPrefsMap: { "title":"titles", "title-short":"titles", + "event":"titles", + "genre":"titles", + "medium":"titles", "container-title":"journals", "collection-title":"journals", + "archive":"journals", "publisher":"publishers", "authority":"publishers", "publisher-place": "places", "event-place": "places", + "archive-place": "places", + "jurisdiction": "places", "number": "number", "edition":"number", "issue":"number", @@ -234,8 +258,7 @@ var CSL = { MARK_TRAILING_NAMES: true, 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 +398,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 +465,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 +501,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 +509,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 +646,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 = "<docco><institution institution-parts=\"long\" delimiter=\", \" substitute-use-first=\"1\" use-last=\"1\"><institution-part name=\"long\"/></institution></docco>"; - 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 = "<docco><bogus/></docco>"; - } - 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 +779,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 +795,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<ilen;i++) { + exec = token.execs[i]; maybenext = exec.call(token, this, Item, item); if (maybenext) { next = maybenext; @@ -1156,14 +804,11 @@ CSL.tokenExec = function (token, Item, item) { } return next; }; -CSL.expandMacro = function (macro_key_token) { +CSL.expandMacro = function (macro_key_token, target) { var mkey, start_token, key, end_token, navi, macro_nodes, newoutput, mergeoutput, end_of_macro, func; mkey = macro_key_token.postponed_macro; - 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); - } + 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 +817,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 +825,41 @@ 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; + macro_key_token.alt_macro = alt_macro; + 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); + } + CSL.runAltMacro(state, alt_macro, 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 +868,57 @@ 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 = false; + if (this.build.extension) { + mytarget = this[this.build.root + this.build.extension].tokens; + } else if (!this.macros[mkey]) { + mytarget = []; + this.macros[mkey] = mytarget; + } + return mytarget; +} +CSL.runAltMacro = function (state, alt_macro, 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); + } + } +} +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 +962,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 +1111,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 +1153,7 @@ CSL.DateParser = function () { slash = txt.indexOf("/"); dash = txt.indexOf("-"); } - } + } txt = txt.replace(/([A-Za-z])\./g, "$1"); number = ""; note = ""; @@ -1639,9 +1359,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 +1416,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; @@ -1735,14 +1462,20 @@ CSL.Engine = function (sys, style, lang, forceLang) { this.localeConfigure(langspec); function makeRegExp(lst) { var lst = lst.slice(); - var ret = new RegExp( "((?:[?!:]*\\s+|-|^)(?:" + lst.join("|") + ")(?=[!?:]*\\s+|-|$))" ); + var ret = new RegExp( "(?:(?:[?!:]*\\s+|-|^)(?:" + lst.join("|") + ")(?=[!?:]*\\s+|-|$))", "g"); return ret; } 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 +1497,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 +1530,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 +1662,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 = []; @@ -2027,10 +1765,28 @@ CSL.Engine.prototype.retrieveItem = function (id) { } } } + if (this.sys.getLanguageName && Item.language) { + if (Item.language) { + Item.language = Item.language.toLowerCase(); + var lst = Item.language.split("<"); + if (lst.length > 0) { + var languageName = this.sys.getLanguageName(lst[0]); + if (languageName) { + Item["language-name"] = languageName; + } + } + if (lst.length === 2) { + var originalLanguage = this.sys.getLanguageName(lst[1]); + if (originalLanguage) { + Item["language-name-original"] = originalLanguage; + } + } + } + } 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 +1828,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 +1862,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<ilen;i++) { + if (subtitle.charAt(i).toLowerCase() !== subtitle.charAt(i).toUpperCase()) { + Item["title-sub"] = subtitle.slice(0,i) + subtitle.charAt(i).toUpperCase() + subtitle.slice(i+1); + break + } + } + } + var mainPlusJoinOffset = offset + Item.title.length - Item["title-main"].length - Item["title-sub"].length; + Item.title = Item.title.slice(0,mainPlusJoinOffset) + Item["title-sub"]; } } } - var isLegalType = ["legal_case","legislation","gazette","regulation"].indexOf(Item.type) > -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 +1928,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 +2008,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 +2018,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 +2027,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 { @@ -2687,7 +2454,7 @@ CSL.Output.Queue.prototype.startTag = function (name, token) { this.openLevel(name); }; CSL.Output.Queue.prototype.endTag = function (name) { - this.closeLevel(); + this.closeLevel(name); this.popFormats(); }; CSL.Output.Queue.prototype.openLevel = function (token, ephemeral) { @@ -2763,7 +2530,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 +2933,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 +2981,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 +3042,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 +3168,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 +3184,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 +3240,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 +3285,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 +3302,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 +3405,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 +3435,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 +3488,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 +3636,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 +3649,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 +4064,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 +4072,9 @@ CSL.Engine.prototype.makeCitationCluster = function (rawList) { } } } + if (item.locator) { + item.locator = ("" + item.locator).replace(/\s+$/, ''); + } newitem = [Item, item]; inputList.push(newitem); } @@ -4304,8 +4112,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 +4130,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 +4475,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); @@ -4944,23 +4752,6 @@ CSL.getBibliographyEntries = function (bibsection) { } else { topblobs = this.output.queue[0].blobs[0].blobs; } - for (j = topblobs.length - 1; j > -1; j += -1) { - if (topblobs[j].blobs && topblobs[j].blobs.length !== 0) { - var last_locale = this.tmp.cite_locales[this.tmp.cite_locales.length - 1]; - var suffix; - if (this.tmp.cite_affixes[this.tmp.area][last_locale]) { - suffix = this.tmp.cite_affixes[this.tmp.area][last_locale].suffix; - } else { - suffix = this.bibliography.opt.layout_suffix; - } - chr = suffix.slice(0, 1); - if (chr && topblobs[j].strings.suffix.slice(-1) === chr) { - topblobs[j].strings.suffix = topblobs[j].strings.suffix.slice(0, -1); - } - topblobs[j].strings.suffix += suffix; - break; - } - } topblobs[0].strings.prefix = this.bibliography.opt.layout_prefix + topblobs[0].strings.prefix; } for (var j=0,jlen=this.output.queue.length;j<jlen;j+=1) { @@ -5123,11 +4914,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 +5204,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 +5700,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 +5737,88 @@ CSL.Node.group = { }; this.execs.push(func); } - } else { + if (this.juris) { + for (var x=0,xlen=target.length;x<xlen;x++) { + var token = target[x]; + } + var choose_start = new CSL.Token("choose", CSL.START); + CSL.Node.choose.build.call(choose_start, state, target); + var if_start = new CSL.Token("if", CSL.START); + func = function (macroName) { + return function (Item) { + if (!state.sys.retrieveStyleModule || !CSL.MODULE_MACROS[macroName] || !Item.jurisdiction) return false; + var jurisdictionList = state.getJurisdictionList(Item.jurisdiction); + if (!state.opt.jurisdictions_seen[jurisdictionList[0]]) { + var res = state.retrieveAllStyleModules(jurisdictionList); + for (var jurisdiction in res) { + var macroCount = 0; + state.juris[jurisdiction] = {}; + var myXml = state.sys.xml.makeXml(res[jurisdiction]); + var myNodes = state.sys.xml.getNodesByName(myXml, "law-module"); + for (var i=0,ilen=myNodes.length;i<ilen;i++) { + var myTypes = state.sys.xml.getAttributeValue(myNodes[i],"types"); + if (myTypes) { + state.juris[jurisdiction].types = {}; + myTypes = myTypes.split(/\s+/); + for (var j=0,jlen=myTypes.length;j<jlen;j++) { + state.juris[jurisdiction].types[myTypes[j]] = true; + } + } + } + if (!state.juris[jurisdiction].types) { + state.juris[jurisdiction].types = CSL.MODULE_TYPES; + } + var myNodes = state.sys.xml.getNodesByName(myXml, "macro"); + for (var i=0,ilen=myNodes.length;i<ilen;i++) { + var myName = state.sys.xml.getAttributeValue(myNodes[i], "name"); + if (!CSL.MODULE_MACROS[myName]) { + CSL.debug("CSL: skipping non-modular macro name \"" + myName + "\" in module context"); + continue; + }; + macroCount++; + state.juris[jurisdiction][myName] = []; + state.buildTokenLists(myNodes[i], state.juris[jurisdiction][myName]); + state.configureTokenList(state.juris[jurisdiction][myName]); + } + if (macroCount < Object.keys(state.juris[jurisdiction].types).length) { + throw "CSL ERROR: Incomplete jurisdiction style module for: " + jurisdiction; + } + } + } + for (var i=0,ilen=jurisdictionList.length;i<ilen;i++) { + var jurisdiction = jurisdictionList[i]; + if(state.juris[jurisdiction] && state.juris[jurisdiction].types[Item.type]) { + Item["best-jurisdiction"] = jurisdiction; + return true; + } + } + return false; + }; + }(this.juris); + if_start.tests.push(func); + if_start.test = state.fun.match.any(if_start, state, if_start.tests); + target.push(if_start); + var text_node = new CSL.Token("text", CSL.SINGLETON); + func = function (state, Item, item) { + var next = 0; + if (state.juris[Item["best-jurisdiction"]][this.juris]) { + while (next < state.juris[Item["best-jurisdiction"]][this.juris].length) { + next = CSL.tokenExec.call(state, state.juris[Item["best-jurisdiction"]][this.juris][next], Item, item); + } + CSL.runAltMacro(state, this.alt_macro, Item, item); + } + } + text_node.juris = this.juris; + text_node.alt_macro = this.alt_macro; + text_node.execs.push(func); + target.push(text_node); + var if_end = new CSL.Token("if", CSL.END); + CSL.Node.if.build.call(if_end, state, target); + var else_start = new CSL.Token("else", CSL.START); + CSL.Node.else.build.call(else_start, state, target); + } + } + if (this.tokentype === CSL.END) { if (state.build["publisher-special"]) { state.build["publisher-special"] = false; if ("string" === typeof state[state.build.root].opt["name-delimiter"]) { @@ -5961,7 +5839,9 @@ CSL.Node.group = { state.tmp.group_context.value()[1] = true; } if (flag[2] || (flag[0] && !flag[1])) { - state.tmp.group_context.value()[2] = true; + if (!this.isJurisLocatorLabel) { + state.tmp.group_context.value()[2] = true; + } var blobs = state.output.current.value().blobs; var pos = state.output.current.value().blobs.length - 1; if (!state.tmp.just_looking && "undefined" !== typeof flag[6]) { @@ -5983,9 +5863,17 @@ CSL.Node.group = { } }; this.execs.push(func); + if (this.juris) { + var else_end = new CSL.Token("else", CSL.END); + CSL.Node.else.build.call(else_end, state, target); + var choose_end = new CSL.Token("choose", CSL.END); + CSL.Node.choose.build.call(choose_end, state, target); + } } - target.push(this); if (this.tokentype === CSL.END) { + if (!this.juris) { + target.push(this); + } if (state.build.substitute_level.value()) { state.build.substitute_level.replace((state.build.substitute_level.value() - 1)); } @@ -6180,6 +6068,7 @@ CSL.Node["institution-part"] = { }; CSL.Node.key = { build: function (state, target) { + target = state[state.build.root + "_sort"].tokens; var func, i, ilen; var debug = false; var start_key = new CSL.Token("key", CSL.START); @@ -6293,7 +6182,7 @@ CSL.Node.key = { } else { // macro var token = new CSL.Token("text", CSL.SINGLETON); token.postponed_macro = this.postponed_macro; - CSL.expandMacro.call(state, token); + CSL.expandMacro.call(state, token, target); } var end_key = new CSL.Token("key", CSL.END); func = function (state, Item) { @@ -6308,7 +6197,7 @@ CSL.Node.key = { keystring = undefined; state.tmp.empty_date = false; } - state[state.tmp.area].keys.push(keystring); + state[state[state.tmp.area].root + "_sort"].keys.push(keystring); state.tmp.value = []; }; end_key.execs.push(func); @@ -6352,6 +6241,11 @@ CSL.Node.label = { state.parallel.AppendToVariable(item.label); item.section_form_override = this.strings.form; } + if (termtxt) { + flag = state.tmp.group_context.value(); + flag[0] = true; + state.tmp.group_context.replace(flag); + } state.output.append(termtxt, this); if (item && this.strings.term === "locator") { state.parallel.CloseVariable(); @@ -6384,7 +6278,39 @@ CSL.Node.label = { CSL.Node.layout = { build: function (state, target) { var func, prefix_token, suffix_token, tok; + function setSuffix() { + if (state.build.area === "bibliography") { + suffix_token = new CSL.Token("text", CSL.SINGLETON); + func = function(state, Item, item) { + var last_locale = state.tmp.cite_locales[state.tmp.cite_locales.length - 1]; + var suffix; + if (state.tmp.cite_affixes[state.tmp.area][state.tmp.last_cite_locale]) { + suffix = state.tmp.cite_affixes[state.tmp.area][state.tmp.last_cite_locale].suffix; + } else { + suffix = state.bibliography.opt.layout_suffix; + } + var chr = suffix.slice(0, 1); + var topblobs = state.output.current.value().blobs; + if (topblobs.length) { + if (chr && topblobs[topblobs.length-1].strings.suffix.slice(-1) === chr) { + topblobs[topblobs.length-1].strings.suffix = topblobs[topblobs.length-1].strings.suffix.slice(0, -1); + } + topblobs[topblobs.length-1].strings.suffix += suffix; + } + if (state.bibliography.opt["second-field-align"]) { + state.output.endTag("bib_other"); + } + }; + suffix_token.execs.push(func); + target.push(suffix_token); + } + } if (this.tokentype === CSL.START) { + if (this.locale_raw) { + state.build.current_default_locale = this.locale_raw; + } else { + state.build.current_default_locale = state.opt["default-locale"]; + } func = function (state, Item, item) { if (state.opt.development_extensions.apply_citation_wrapper && state.sys.wrapCitationEntry @@ -6454,7 +6380,7 @@ CSL.Node.layout = { sp = " "; } var ignorePredecessor = false; - if (CSL.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(test_char) > -1) { + if (CSL.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(test_char) > -1 && item.prefix.trim().indexOf(" ") > -1) { state.tmp.term_predecessor = false; ignorePredecessor = true; } @@ -6509,6 +6435,7 @@ CSL.Node.layout = { } if (this.tokentype === CSL.END) { if (this.locale_raw) { + setSuffix(); if (!state.build.layout_locale_flag) { my_tok.name = "if"; my_tok.tokentype = CSL.END; @@ -6523,6 +6450,7 @@ CSL.Node.layout = { } } if (!this.locale_raw) { + setSuffix(); if (state.tmp.cite_affixes[state.build.area]) { if (state.build.layout_locale_flag) { tok = new CSL.Token("else", CSL.END); @@ -6549,12 +6477,7 @@ CSL.Node.layout = { target.push(suffix_token); } func = function (state, Item) { - if (state.tmp.area === "bibliography") { - if (state.bibliography.opt["second-field-align"]) { - state.output.endTag(); - } - } - state.output.closeLevel(); + state.output.closeLevel("empty"); }; this.execs.push(func); func = function (state, Item) { @@ -6686,20 +6609,25 @@ CSL.NameOutput.prototype.outputNames = function () { for (i = 0, ilen = variables.length; i < ilen; i += 1) { 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 institutions = false; + 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]])); + } + 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); } - 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 +6682,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 +6717,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 +6849,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<jlen;j++) { + if (this.persons[v][j].length) { if (this._please_chop === v) { - this.persons[v][i] = this.persons[v][i].slice(1); - this.persons_count[v][i] += -1; + this.persons[v][j] = this.persons[v][j].slice(1); + this.persons_count[v][j] += -1; this._please_chop = false; break; } else if (chopvar && !this._please_chop) { - this.freeters[v] = this.persons[v][i].slice(0, 1); + this.freeters[v] = this.persons[v][j].slice(0, 1); this.freeters_count[v] = 1; this.institutions[v] = []; this.persons[v] = []; @@ -6958,8 +6885,8 @@ CSL.NameOutput.prototype.truncatePersonalNameLists = function () { if (this.institutions[v].length) { this.nameset_offset += 1; } - 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<jlen;j++) { + if (this.persons[v][j].length) { this.nameset_offset += 1; } } @@ -6975,7 +6902,8 @@ CSL.NameOutput.prototype._truncateNameList = function (container, variable, inde if (this.state[this.state[this.state.tmp.area].root].opt.max_number_of_names && lst.length > 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 +6927,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 +6964,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 +6992,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 +7043,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 +7149,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 +7478,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 +7501,88 @@ 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]; - } - } - } 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; - } + 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; + } 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_long = this._composeOneInstitutionPart([primary, secondary, tertiary], slot, long_style); + institution = [institution_long]; + } + 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 +7653,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 +7668,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 +7788,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], ""); @@ -7861,11 +7824,6 @@ CSL.NameOutput.prototype._renderOnePersonalName = function (value, pos, i, j) { merged = this._join([family, second], sort_sep); blob = this._join([merged, suffix], sort_sep); } else { - if (this.state.tmp.area === "bibliography" && !this.state.tmp.term_predecessor && non_dropping_particle) { - if (!has_hyphenated_non_dropping_particle) { - non_dropping_particle.blobs = CSL.Output.Formatters["capitalize-first"](this.state, non_dropping_particle.blobs) - } - } if (has_hyphenated_non_dropping_particle) { first = this._join([non_dropping_particle, family], ""); } else { @@ -7885,21 +7843,12 @@ 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; } } if (!this.state.tmp.term_predecessor) { - if (!given && this.state.tmp.area === "bibliography") { - if (!dropping_particle && non_dropping_particle) { - if (!has_hyphenated_non_dropping_particle) { - non_dropping_particle.blobs = CSL.Output.Formatters["capitalize-first"](this.state, non_dropping_particle.blobs) - } - } else if (dropping_particle) { - dropping_particle.blobs = CSL.Output.Formatters["capitalize-first"](this.state, dropping_particle.blobs) - } - } } if (has_hyphenated_non_dropping_particle) { second = this._join([non_dropping_particle, family], ""); @@ -7945,6 +7894,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 +7980,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 +7993,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 +8052,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) { @@ -8145,7 +8103,9 @@ CSL.NameOutput.prototype.getName = function (name, slotLocaleset, fallback, stop langTag = langTags[i]; if (name.multi._key[langTag]) { foundTag = true; + var isInstitution = name.isInstitution; name = name.multi._key[langTag]; + name.isInstitution = isInstitution; name_params = this.getNameParams(langTag); name_params.transliterated = true; break; @@ -8180,6 +8140,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,22 +8204,31 @@ 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(); } var long_form = name["long"]; - var short_form = long_form.slice(); + var short_form = name["long"].slice(); + var use_short_form = false; if (this.state.sys.getAbbreviation) { var jurisdiction = this.Item.jurisdiction; for (var j = 0, jlen = long_form.length; j < jlen; j += 1) { jurisdiction = this.state.transform.loadAbbreviation(jurisdiction, "institution-part", long_form[j]); if (this.state.transform.abbrevs[jurisdiction]["institution-part"][long_form[j]]) { short_form[j] = this.state.transform.abbrevs[jurisdiction]["institution-part"][long_form[j]]; + use_short_form = true; } } } - name["short"] = short_form; + if (use_short_form) { + name["short"] = short_form; + } else { + name["short"] = []; + } return name; } CSL.NameOutput.prototype.getStaticOrder = function (name, refresh) { @@ -8305,6 +8275,7 @@ CSL.NameOutput.prototype._splitInstitution = function (value, v, i) { } splitLst = splitLst.replace(/\s*\|\s*/g, "|"); splitInstitution = [splitLst]; + break; } } } @@ -8315,19 +8286,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 +8331,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 +8436,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 +8450,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 +8850,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 +8865,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 +8977,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) { @@ -9153,7 +9145,8 @@ CSL.Node.text = { state.parallel.AppendToVariable(Item[parallel_variable],parallel_variable); }; this.execs.push(func); - if (CSL.MULTI_FIELDS.indexOf(this.variables_real[0]) > -1) { + if (CSL.MULTI_FIELDS.indexOf(this.variables_real[0]) > -1 + || ["language-name", "language-name-original"].indexOf(this.variables_real[0]) > -1) { var abbrevfam = this.variables[0]; var abbrfall = false; var altvar = false; @@ -9172,7 +9165,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 +9175,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 +9319,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 +9332,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 +9388,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 +9428,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 +9466,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<ilen;i++) { + if (state.tmp.done_vars.indexOf(this.variables_real[i]) === -1 + && !(item && Item.type === "legal_case" && item["suppress-author"] && this.variables_real[i] === "title") + ) { + this.variables.push(this.variables_real[i]); } if (state.tmp.can_block_substitute) { - state.tmp.done_vars.push(variables[pos]); + state.tmp.done_vars.push(this.variables_real[i]); } } }; @@ -9484,24 +9484,21 @@ CSL.Attributes["@variable"] = function (state, arg) { func = function (state, Item, item) { var mydate; output = false; - len = this.variables.length; - for (pos = 0; pos < len; pos += 1) { - variable = this.variables[pos]; - if (variable === "authority" + for (var i=0,ilen=this.variables.length;i<ilen;i++) { + var variable = this.variables[i]; + if (["authority", "committee"].indexOf(variable) > -1 && "string" === typeof Item[variable] && "names" === this.name) { var creatorParent = { - family:Item[variable], - isInstitution:true, + literal:Item[variable], multi:{ _key:{} } }; if (Item.multi && Item.multi._keys && Item.multi._keys[variable]) { for (var langTag in Item.multi._keys[variable]) { - creatorChild = { - family:Item.multi._keys[variable][langTag], - isInstitution:true + var creatorChild = { + literal:Item.multi._keys[variable][langTag] } creatorParent.multi._key[langTag] = creatorChild; } @@ -9542,8 +9539,8 @@ CSL.Attributes["@variable"] = function (state, arg) { output = true; } break; - } else if ("locator-revision" === variable) { - if (item && item["locator-revision"]) { + } else if ("locator-extra" === variable) { + if (item && item["locator-extra"]) { output = true; } break; @@ -9579,27 +9576,30 @@ CSL.Attributes["@variable"] = function (state, arg) { } flag = state.tmp.group_context.value(); if (output) { - if (variable !== "citation-number" || state.tmp.area !== "bibliography") { - state.tmp.cite_renders_content = true; - } - flag[2] = true; - state.tmp.group_context.replace(flag); - if (state.tmp.can_substitute.value() - && state.tmp.area === "bibliography" - && "string" === typeof Item[variable]) { - state.tmp.rendered_name.push(Item[variable]); + for (var i=0,ilen=this.variables_real.length;i<ilen;i++) { + var variable = this.variables_real[i]; + if (variable !== "citation-number" || state.tmp.area !== "bibliography") { + state.tmp.cite_renders_content = true; + } + flag[2] = true; + if (state.tmp.can_substitute.value() + && state.tmp.area === "bibliography" + && "string" === typeof Item[variable]) { + state.tmp.rendered_name.push(Item[variable]); + } } state.tmp.can_substitute.replace(false, CSL.LITERAL); } else { flag[1] = true; } + state.tmp.group_context.replace(flag); }; this.execs.push(func); } else if (["if", "else-if", "condition"].indexOf(this.name) > -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 +9650,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;i<ilen;i+=1) { + this.tests.push(maketest(trylabels[i])); + } +}; CSL.Attributes["@jurisdiction"] = function (state, arg) { var tryjurisdictions = arg.split(/\s+/); for (var i=0,ilen=tryjurisdictions.length;i<ilen;i+=1) { - tryjurisdictions[i] = tryjurisdictions[i].split(";"); + tryjurisdictions[i] = tryjurisdictions[i].split(":"); } var maketests = function (tryjurisdiction) { return function(Item,item){ if (!Item.jurisdiction) { return false; } - var jurisdictions = Item.jurisdiction.split(";"); + var jurisdictions = Item.jurisdiction.split(":"); for (var i=0,ilen=jurisdictions.length;i<ilen;i+=1) { - jurisdictions[i] = jurisdictions[i].split(";"); + jurisdictions[i] = jurisdictions[i].split(":"); } for (i=tryjurisdiction.length;i>0;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 +9706,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 +9767,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 +9787,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 +9874,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 +9985,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 +10036,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 +10065,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 +10111,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 +10128,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 +10401,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) { @@ -10865,7 +10886,7 @@ CSL.Transform = function (state) { if (CSL.NUMERIC_VARIABLES.indexOf(myabbrev_family) > -1) { myabbrev_family = "number"; } - if (["publisher-place", "event-place", "jurisdiction", "archive-place"].indexOf(myabbrev_family) > -1) { + if (["publisher-place", "event-place", "jurisdiction", "archive-place", "language-name", "language-name-original"].indexOf(myabbrev_family) > -1) { myabbrev_family = "place"; } if (["publisher", "authority"].indexOf(myabbrev_family) > -1) { @@ -10877,6 +10898,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 +10922,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 +11006,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 +11019,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 +11064,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 +11466,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 +11575,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, " "); @@ -12044,7 +12067,7 @@ CSL.Util.substituteEnd = function (state, target) { bib_first_end = new CSL.Token("group", CSL.END); func = function (state, Item) { if (!state.tmp.render_seen) { - state.output.endTag(); // closes bib_first + state.output.endTag("bib_first"); // closes bib_first } }; bib_first_end.execs.push(func); @@ -12328,15 +12351,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 +12485,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 +12582,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 +12720,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 +13004,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,20 +13024,34 @@ 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]; } return word; } + function splitme (str, rex) { + var res, seps = str.match(rex); + if (seps) { + var splits = str.split(rex); + res = [splits[0]]; + for (var i=0; i<seps.length; i++) { + res.push(seps[i]); + res.push(splits[i+1]); + } + } else { + res = [str]; + } + return res; + } var str = doppel.string; - var lst = str.split(state.locale[state.opt.lang].opts["skip-words-regexp"]) + var lst = splitme(str, state.locale[state.opt.lang].opts["skip-words-regexp"]); for (i=1,ilen=lst.length;i<ilen;i+=2) { if (lst[i].match(/^[:?!]/)) { lst[i] = capitalise(lst[i]); } } - if (!lst[0]) { + if (!lst[0] && lst[1]) { lst[1] = capitalise(lst[1]); } if (lst.length > 2 && !lst[lst.length-1]) { @@ -13149,7 +13187,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 +13277,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"; }, @@ -13282,16 +13320,16 @@ CSL.Output.Formats.prototype.rtf = { .replace("\t", "\\tab{}", "g"); }, "@passthrough/true": CSL.Output.Formatters.passthrough, - "@font-style/italic":"\\i %%STRING%%\\i0{}", - "@font-style/normal":"\\i0{}%%STRING%%\\i{}", - "@font-style/oblique":"\\i %%STRING%%\\i0{}", - "@font-variant/small-caps":"\\scaps %%STRING%%\\scaps0{}", - "@font-variant/normal":"\\scaps0{}%%STRING%%\\scaps{}", - "@font-weight/bold":"\\b %%STRING%%\\b0{}", - "@font-weight/normal":"\\b0{}%%STRING%%\\b{}", + "@font-style/italic":"{\\i{}%%STRING%%}", + "@font-style/normal":"{\\i0{}%%STRING%%}", + "@font-style/oblique":"{\\i{}%%STRING%%}", + "@font-variant/small-caps":"{\\scaps %%STRING%%}", + "@font-variant/normal":"{\\scaps0{}%%STRING%%}", + "@font-weight/bold":"{\\b{}%%STRING%%}", + "@font-weight/normal":"{\\b0{}%%STRING%%}", "@font-weight/light":false, "@text-decoration/none":false, - "@text-decoration/underline":"\\ul %%STRING%%\\ul0{}", + "@text-decoration/underline":"{\\ul{}%%STRING%%}", "@vertical-align/baseline":false, "@vertical-align/sup":"\\super %%STRING%%\\nosupersub{}", "@vertical-align/sub":"\\sub %%STRING%%\\nosupersub{}", @@ -13315,10 +13353,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 +13364,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 +13748,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 +14136,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 +14357,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<jlen;j++) { + var jurisdiction = jurisdictionList[j]; + if (this.opt.jurisdictions_seen[jurisdiction]) continue; + var res = this.sys.retrieveStyleModule(jurisdiction, preference); + this.opt.jurisdictions_seen[jurisdiction] = true; + if (!res) continue; + ret[jurisdiction] = res; + } + } + return ret; +} +CSL.parseParticles = function(){ + var PARTICLES = [ + ["'s-", [[[0,1], null]]], + ["'t", [[[0,1], null]]], + ["abbé d'", [[[0,2], null]]], + ["af", [[[0,1], null]]], + ["al", [[[0,1], null]]], + ["al-", [[[0,1], null]],[[null,[0,1]]]], + ["auf den", [[[0,2], null]]], + ["auf der", [[[0,1], null]]], + ["aus der", [[[0,1], null]]], + ["aus'm", [[null, [0,1]]]], + ["ben", [[null, [0,1]]]], + ["bin", [[null, [0,1]]]], + ["d'", [[[0,1], null]],[[null,[0,1]]]], + ["da", [[null, [0,1]]]], + ["dall'", [[null, [0,1]]]], + ["das", [[[0,1], null]]], + ["de", [[null, [0,1]],[[0,1],null]]], + ["de la", [[[0,1], [1,2]]]], + ["de las", [[[0,1], [1,2]]]], + ["de li", [[[0,1], null]]], + ["de'", [[[0,1], null]]], + ["degli", [[[0,1], null]]], + ["dei", [[[0,1], null]]], + ["del", [[null, [0,1]]]], + ["dela", [[[0,1], null]]], + ["della", [[[0,1], null]]], + ["dello", [[[0,1], null]]], + ["den", [[[0,1], null]]], + ["der", [[[0,1], null]]], + ["des", [[null, [0,1]],[[0,1], null]]], + ["di", [[null, [0,1]]]], + ["do", [[null, [0,1]]]], + ["dos", [[[0,1], null]]], + ["du", [[[0,1], null]]], + ["el", [[[0,1], null]]], + ["il", [[[0,1], null]]], + ["in 't", [[[0,2], null]]], + ["in de", [[[0,2], null]]], + ["in der", [[[0,1], null]]], + ["in het", [[[0,2], null]]], + ["lo", [[[0,1], null]]], + ["les", [[[0,1], null]]], + ["l'", [[null, [0,1]]]], + ["la", [[null, [0,1]]]], + ["le", [[null, [0,1]]]], + ["lou", [[null, [0,1]]]], + ["mac", [[null, [0,1]]]], + ["op de", [[[0,2], null]]], + ["pietro", [[null, [0,1]]]], + ["saint", [[null, [0,1]]]], + ["sainte", [[null, [0,1]]]], + ["sen", [[[0,1], null]]], + ["st.", [[null, [0,1]]]], + ["ste.", [[null, [0,1]]]], + ["te", [[[0,1], null]]], + ["ten", [[[0,1], null]]], + ["ter", [[[0,1], null]]], + ["uit de", [[[0,2], null]]], + ["uit den", [[[0,2], null]]], + ["v.d.", [[null, [0,1]]]], + ["van", [[null, [0,1]]]], + ["van de", [[null, [0,2]]]], + ["van den", [[null, [0,2]]]], + ["van der", [[null, [0,2]]]], + ["van het", [[null, [0,2]]]], + ["vander", [[null, [0,1]]]], + ["vd", [[null, [0,1]]]], + ["ver", [[null, [0,1]]]], + ["von", [[[0,1], null]],[[null,[0,1]]]], + ["von der", [[[0,2], null]]], + ["von dem",[[[0,2], null]]], + ["von und zu", [[[0,1], null]]], + ["von zu", [[[0,2], null]]], + ["v.", [[[0,1], null]]], + ["v", [[[0,1], null]]], + ["vom", [[[0,1], null]]], + ["vom und zum", [[[0,1], null]]], + ["z", [[[0,1], null]]], + ["ze", [[[0,1], null]]], + ["zum", [[[0,1], null]]], + ["zur", [[[0,1], null]]] + ] + var CATEGORIZER = null; + function createCategorizer () { + CATEGORIZER = {}; + for (var i=0,ilen=PARTICLES.length;i<ilen;i++) { + var tLst = PARTICLES[i][0].split(" "); + var pInfo = []; + for (var j=0,jlen=PARTICLES[i][1].length;j<jlen;j++) { + var pParams = PARTICLES[i][1][j]; + var str1 = pParams[0] ? tLst.slice(pParams[0][0], pParams[0][1]).join(" ") : ""; + var str2 = pParams[1] ? tLst.slice(pParams[1][0], pParams[1][1]).join(" ") : ""; + pInfo.push({ + strings: [str1, str2], + positions: [pParams[0], pParams[1]] + }); + } + CATEGORIZER[PARTICLES[i][0]] = pInfo; + } + } + createCategorizer(); + var LIST = null; + var REX = null; + function assignToList (nospaceList, spaceList, particle) { + if (["\'", "-"].indexOf(particle.slice(-1)) > -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;i<ilen;i++) { + var info = PARTICLES[i]; + var particle = info[0].split(" "); + if (particle.length === 1) { + assignToList(FAM_NSP, FAM_SP, particle[0]); + GIV_FULL.push(particle[0]); + if (!GIV_PART[particle[0]]) { + GIV_PART[particle[0]] = []; + } + GIV_PART[particle[0]].push(""); + } else if (particle.length === 2) { + assignToList(FAM_NSP, FAM_SP, particle[1]); + if (!GIV_PART[particle[1]]) { + GIV_PART[particle[1]] = []; + } + GIV_PART[particle[1]].push(particle[0]); + particle = particle.join(" "); + assignToList(FAM_NSP, FAM_SP, particle); + GIV_FULL.push(particle); + } + } + FAM_SP.sort(byLength); + FAM_NSP.sort(byLength); + GIV_FULL.sort(byLength); + for (var key in GIV_PART) { + GIV_PART[key].sort(byLength); + } + } + function byLength(a,b) { + if (a.length<b.length) { + return 1; + } else if (a.length>b.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); + } + } +}(); diff --git 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()) { diff --git 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/dns_worker.js b/chrome/content/zotero/xpcom/dns_worker.js @@ -0,0 +1,233 @@ +/* + ***** BEGIN LICENSE BLOCK ***** + + Copyright © 2015 Center for History and New Media + George Mason University, Fairfax, Virginia, USA + http://zotero.org + + This file is part of Zotero. + + Zotero is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Zotero is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with Zotero. If not, see <http://www.gnu.org/licenses/>. + + ***** END LICENSE BLOCK ***** +*/ + +function getIPForLookup(ip) { + if (ip.indexOf(".") != -1) { + // IPv4 + x = ip.split(".").reverse().join(".")+".in-addr.arpa"; + } else { + if (ip.indexOf("%") != -1) ip = ip.substr(0, ip.indexOf("%")); + // IPv6 + var parts = ip.split(":"); + x = "ip6.arpa" + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + for (var j = 0; j < (part.length == 0 ? 4*(9-parts.length) : 4-part.length); j++) x = "0." + x; + for (var j = 0; j < part.length; j++) x = part[j] + "." + x; + } + } + return x; +} + +function isLocalIP(ip) { + return ip.startsWith("169.254.") || ip.startsWith("192.168.") || ip.startsWith("10.") || + /^172\.(?:1[6-9]|2[0-9]|3[01])\./.test(ip) || + ip.startsWith("fe80:") || ip.startsWith("fd00:") || ip == ""; +} + +onmessage = function (e) { + var libc, reverseLookup, getIPs, getnameinfo; + var sockaddr = new ctypes.StructType("sockaddr"); + platform = e.data; + + if (platform == "win") { + libc = ctypes.open("Ws2_32.dll"); + var addrinfo = new ctypes.StructType("arrinfo"); + addrinfo.define([{"ai_flags":ctypes.int}, {"ai_family":ctypes.int}, {"ai_socktype":ctypes.int}, + {"ai_protocol":ctypes.int}, {"ai_addrlen":ctypes.int}, {"ai_canonname":ctypes.char.ptr}, + {"ai_addr":sockaddr.ptr}, {"ai_next":addrinfo.ptr}]); + var gethostname = libc.declare("gethostname", ctypes.default_abi, ctypes.int, ctypes.char.ptr, ctypes.size_t); + var getaddrinfo = libc.declare("getaddrinfo", ctypes.default_abi, ctypes.int, ctypes.char.ptr, ctypes.char.ptr, + addrinfo.ptr, addrinfo.ptr.ptr); + var freeaddrinfo = libc.declare("freeaddrinfo", ctypes.default_abi, ctypes.void_t, addrinfo.ptr); + getnameinfo = libc.declare("getnameinfo", ctypes.default_abi, ctypes.int, sockaddr.ptr, ctypes.int, + ctypes.char.ptr, ctypes.int, ctypes.char.ptr, ctypes.int, ctypes.int); + getIPs = function () { + var buf = new new ctypes.ArrayType(ctypes.char, 1025); + var status = gethostname(buf, 1025); + if (status != 0) throw new Error("could not get hostname: "+status); + + var ips = []; + var out = new addrinfo.ptr(); + status = getaddrinfo(buf, null, null, out.address()); + if (status != 0) throw new Error("could not get addrinfo: "+status); + var rec = out; + try { + while (!rec.isNull()) { + status = getnameinfo(rec.contents.ai_addr, rec.contents.ai_addrlen, buf, 1025, null, 0, 2); + if (status != 0) throw new Error("could not get IP address: "+status); + var ip = buf.readString(); + if (!isLocalIP(ip)) ips.push(ip); + rec = rec.contents.ai_next; + } + } finally { + freeaddrinfo(out); + } + return ips; + }; + + var dnsapi = ctypes.open("Dnsapi.dll"); + var DNS_RECORD = new ctypes.StructType("DNS_RECORD"); + DNS_RECORD.define([{"pNext":DNS_RECORD.ptr}, {"pName":ctypes.char.ptr}, {"wType":ctypes.unsigned_short}, + {"wDataLength":ctypes.unsigned_short}, {"DW":ctypes.unsigned_long}, {"dwTtl":ctypes.unsigned_long}, + {"dwReserved":ctypes.unsigned_long}, {"pNameHost":ctypes.char.ptr}]); + var DnsQuery = dnsapi.declare("DnsQuery_A", ctypes.winapi_abi, ctypes.int, ctypes.char.ptr, ctypes.unsigned_short, + ctypes.unsigned_long, ctypes.voidptr_t, DNS_RECORD.ptr, ctypes.voidptr_t); + var DnsRecordListFree = dnsapi.declare("DnsRecordListFree", ctypes.winapi_abi, ctypes.void_t, DNS_RECORD.ptr, + ctypes.int); + reverseLookup = function (ip) { + var record = new DNS_RECORD(); + var status = DnsQuery(getIPForLookup(ip), 12 /*DNS_TYPE_PTR*/, 32 /*DNS_QUERY_NO_LOCAL_NAME*/, null, record.address(), null); + if (status != 0 || record.pNext.isNull()) return null; + var retval = record.pNext.contents.pNameHost.readString(); + DnsRecordListFree(record.pNext, 1); + return retval; + }; + } else { + if (platform == "mac") { + libc = ctypes.open("libc.dylib"); + } else { + var possibleLibcs = [ + "libc.so.6", + "libc.so.6.1", + "libc.so" + ]; + for(var i = 0; i < possibleLibcs.length; i++) { + try { + libc = ctypes.open(possibleLibcs[i]); + break; + } catch(e) {} + } + } + + var AF_INET = 2, AF_INET6, NI_NUMERICHOST, sockaddr_size, libresolv; + if (platform == "linux") { + libresolv = ctypes.open("libresolv.so"); + sockaddr.define([{"sa_family":ctypes.unsigned_short}]); + sockaddrSize = function (x) { return x.sa_family == 10 ? 28 : 16; }; + AF_INET6 = 10; + NI_NUMERICHOST = 1; + } else { + libresolv = libc; + sockaddr.define([{"sa_len":ctypes.uint8_t}, {"sa_family":ctypes.uint8_t}]); + sockaddrSize = function (x) { return x.sa_len; }; + AF_INET6 = 30; + NI_NUMERICHOST = 2; + } + + var ifaddrs = new ctypes.StructType("ifaddrs"); + ifaddrs.define([{"ifa_next":ifaddrs.ptr}, {"ifa_name":ctypes.char.ptr}, {"ifa_flags":ctypes.unsigned_int}, + {"ifa_addr":sockaddr.ptr}]); + var getifaddrs = libc.declare("getifaddrs", ctypes.default_abi, ctypes.int, ifaddrs.ptr.ptr); + var freeifaddrs = libc.declare("freeifaddrs", ctypes.default_abi, ctypes.void_t, ifaddrs.ptr); + getnameinfo = libc.declare("getnameinfo", ctypes.default_abi, ctypes.int, sockaddr.ptr, ctypes.int, + ctypes.char.ptr, ctypes.int, ctypes.char.ptr, ctypes.int, ctypes.int); + getIPs = function () { + var buf = new new ctypes.ArrayType(ctypes.char, 1025); + var out = new ifaddrs.ptr(); + var status = getifaddrs(out.address()); + if (status != 0) throw new Error("could not get ifaddrs: "+status); + var ips = []; + var rec = out; + try { + while (!rec.isNull()) { + if (!rec.contents.ifa_name.readString().startsWith("lo")) { + var family = rec.contents.ifa_addr.contents.sa_family; + if (family == AF_INET || family == AF_INET6) { + status = getnameinfo(rec.contents.ifa_addr, sockaddrSize(rec.contents.ifa_addr.contents), + buf, 1025, null, 0, NI_NUMERICHOST); + if (status != 0) throw new Error("could not get IP address: "+status); + var ip = buf.readString(); + if (!isLocalIP(ip)) ips.push(ip); + } + } + rec = rec.contents.ifa_next; + } + } finally { + freeifaddrs(out); + } + return ips; + }; + + var res_query; + try { + res_query = libresolv.declare("res_query", ctypes.default_abi, ctypes.int, ctypes.char.ptr, ctypes.int, + ctypes.int, ctypes.uint8_t.ptr, ctypes.int); + } catch(e) { + res_query = libresolv.declare("__res_query", ctypes.default_abi, ctypes.int, ctypes.char.ptr, ctypes.int, + ctypes.int, ctypes.uint8_t.ptr, ctypes.int); + } + let response = new new ctypes.ArrayType(ctypes.uint8_t, 1025); + var skipName = function(response, offset) { + var len = response[offset++]; + if ((len & 192) == 192) return offset+1; // compressed + while (len != 0) { + offset += len; + len = response[offset++]; + }; + return offset; + }; + var reverseLookup = function(ip) { + var len = res_query(getIPForLookup(ip), 1, 12, response, 1025); + if (len <= 0) return null; + + var offset = 4; + var qdCount = (response[offset++] << 8) + response[offset++]; + var anCount = (response[offset++] << 8) + response[offset++]; + offset += 4; + for (var i=0; i<qdCount; i++) { + offset = skipName(response, offset)+4; + } + var domain = []; + if (anCount >= 1) { + offset = skipName(response, offset); + offset += 8; + var rdLength = (response[offset++] << 8) + response[offset++]; // RDLENGTH + var endOfData = offset+rdLength; + while(offset < endOfData) { + if(offset > endOfData) break; + var len = response[offset++]; + if(offset+len > endOfData) break; + var str = ""; + for(var i = 0; i < len; i++) { + str += String.fromCharCode(response[offset++]); + } + domain.push(str); + } + domain.pop(); + } + return domain.join(".") + }; + } + + var ips = getIPs(); + var hosts = []; + for (var i = 0; i < ips.length; i++) { + var host = reverseLookup(ips[i]); + if(host) hosts.push(host); + } + + postMessage(hosts); +}; +\ No newline at end of file diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js @@ -88,7 +88,7 @@ Zotero.Integration = new function() { sharedPipe.append(".zoteroIntegrationPipe_"+logname); if(sharedPipe.exists()) { - if(_deletePipe(sharedPipe) && sharedDir.isWritable()) { + if(this.deletePipe(sharedPipe) && sharedDir.isWritable()) { pipe = sharedPipe; } } else if(sharedDir.isWritable()) { @@ -104,36 +104,44 @@ Zotero.Integration = new function() { pipe.append(".zoteroIntegrationPipe"); // destroy old pipe, if one exists - if(!_deletePipe(pipe)) return; + if(!this.deletePipe(pipe)) return; } // try to initialize pipe try { - Zotero.IPC.Pipe.initPipeListener(pipe, function(string) { - if(string != "") { - // exec command if possible - var parts = string.match(/^([^ \n]*) ([^ \n]*)(?: ([^\n]*))?\n?$/); - if(parts) { - var agent = parts[1].toString(); - var cmd = parts[2].toString(); - var document = parts[3] ? parts[3].toString() : null; - Zotero.Integration.execCommand(agent, cmd, document); - } else { - Components.utils.reportError("Zotero: Invalid integration input received: "+string); - } - } - }); + this.initPipe(pipe); } catch(e) { Zotero.logError(e); } Zotero.Promise.delay(1000).then(_checkPluginVersions); } + + /** + * Begin listening for integration commands on the given pipe + * @param {String} pipe The path to the pipe + */ + this.initPipe = function(pipe) { + Zotero.IPC.Pipe.initPipeListener(pipe, function(string) { + if(string != "") { + // exec command if possible + var parts = string.match(/^([^ \n]*) ([^ \n]*)(?: ([^\n]*))?\n?$/); + if(parts) { + var agent = parts[1].toString(); + var cmd = parts[2].toString(); + var document = parts[3] ? parts[3].toString() : null; + Zotero.Integration.execCommand(agent, cmd, document); + } else { + Components.utils.reportError("Zotero: Invalid integration input received: "+string); + } + } + }); + } /** * Deletes a defunct pipe on OS X */ - function _deletePipe(pipe) { + this.deletePipe = function(pipe) { try { if(pipe.exists()) { Zotero.IPC.safePipeWrite(pipe, "Zotero shutdown\n"); @@ -2029,7 +2037,7 @@ Zotero.Integration.Session.prototype.resetRequest = function(doc) { * @param data {Zotero.Integration.DocumentData} * @param resetStyle {Boolean} Whether to force the style to be reset * regardless of whether it has changed. This is desirable if the - * automaticJournalAbbreviations has changed. + * automaticJournalAbbreviations or locale has changed. */ Zotero.Integration.Session.prototype.setData = function(data, resetStyle) { var oldStyle = (this.data && this.data.style ? this.data.style : false); @@ -2039,7 +2047,7 @@ Zotero.Integration.Session.prototype.setData = function(data, resetStyle) { try { var getStyle = Zotero.Styles.get(data.style.styleID); data.style.hasBibliography = getStyle.hasBibliography; - this.style = getStyle.getCiteProc(data.locale, data.prefs.automaticJournalAbbreviations); + this.style = getStyle.getCiteProc(data.style.locale, data.prefs.automaticJournalAbbreviations); this.style.setOutputFormat("rtf"); this.styleClass = getStyle.class; this.dateModified = new Object(); @@ -2069,7 +2077,7 @@ Zotero.Integration.Session.prototype.setDocPrefs = function(doc, primaryFieldTyp if(this.data) { io.style = this.data.style.styleID; - io.locale = this.data.locale; + io.locale = this.data.style.locale; io.useEndnotes = this.data.prefs.noteType == 0 ? 0 : this.data.prefs.noteType-1; io.fieldType = this.data.prefs.fieldType; io.primaryFieldType = primaryFieldType; @@ -2092,19 +2100,17 @@ Zotero.Integration.Session.prototype.setDocPrefs = function(doc, primaryFieldTyp var data = new Zotero.Integration.DocumentData(); data.sessionID = oldData.sessionID; data.style.styleID = io.style; - data.locale = io.locale; + data.style.locale = io.locale; data.prefs.fieldType = io.fieldType; data.prefs.storeReferences = io.storeReferences; data.prefs.automaticJournalAbbreviations = io.automaticJournalAbbreviations; - - var localeChanged = false; - if (!oldData.locale || (oldData.locale != io.locale)) { - localeChanged = true; - } - - me.setData(data, oldData && - (oldData.prefs.automaticJournalAbbreviations != - data.prefs.automaticJournalAbbreviations || localeChanged)); + + var forceStyleReset = oldData + && ( + oldData.prefs.automaticJournalAbbreviations != data.prefs.automaticJournalAbbreviations + || oldData.style.locale != io.locale + ); + me.setData(data, forceStyleReset); // need to do this after setting the data so that we know if it's a note style me.data.prefs.noteType = me.style && me.styleClass == "note" ? io.useEndnotes+1 : 0; @@ -2986,6 +2992,7 @@ Zotero.Integration.DocumentData.prototype.serializeXML = function() { 'zotero-version="'+Zotero.Utilities.htmlSpecialChars(Zotero.version)+'">'+ '<session id="'+Zotero.Utilities.htmlSpecialChars(this.sessionID)+'"/>'+ '<style id="'+Zotero.Utilities.htmlSpecialChars(this.style.styleID)+'" '+ + (this.style.locale ? 'locale="' + Zotero.Utilities.htmlSpecialChars(this.style.locale) + '" ': '') + 'hasBibliography="'+(this.style.hasBibliography ? "1" : "0")+'" '+ 'bibliographyStyleHasBeenSet="'+(this.style.bibliographyStyleHasBeenSet ? "1" : "0")+'"/>'+ (prefs ? '<prefs>'+prefs+'</prefs>' : '<prefs/>')+'</data>'; @@ -3001,6 +3008,7 @@ Zotero.Integration.DocumentData.prototype.unserializeXML = function(xmlData) { this.sessionID = Zotero.Utilities.xpathText(doc, '/data/session[1]/@id'); this.style = {"styleID":Zotero.Utilities.xpathText(doc, '/data/style[1]/@id'), + "locale":Zotero.Utilities.xpathText(doc, '/data/style[1]/@locale'), "hasBibliography":(Zotero.Utilities.xpathText(doc, '/data/style[1]/@hasBibliography') == 1), "bibliographyStyleHasBeenSet":(Zotero.Utilities.xpathText(doc, '/data/style[1]/@bibliographyStyleHasBeenSet') == 1)}; this.prefs = {}; diff --git 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,18 +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()) { - Zotero.IPC.safePipeWrite(_instancePipe, "test\n", true); - 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 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()-time)+' ms to become available'); success = success || wroteToPipe; defunct = !wroteToPipe; } diff --git a/chrome/content/zotero/xpcom/progressWindow.js b/chrome/content/zotero/xpcom/progressWindow.js @@ -106,9 +106,8 @@ Zotero.ProgressWindowSet = new function() { * * Pass the active window into the constructor */ -Zotero.ProgressWindow = function(_window){ +Zotero.ProgressWindow = function(_window = null) { var self = this, - _window = null, _progressWindow = null, _windowLoaded = false, _windowLoading = false, diff --git a/chrome/content/zotero/xpcom/proxy.js b/chrome/content/zotero/xpcom/proxy.js @@ -178,26 +178,31 @@ Zotero.Proxies = new function() { // IP update interval is every 15 minutes if((now - Zotero.Proxies.lastIPCheck) > 900000) { - Zotero.debug("Proxies: Retrieving IPs"); - var ips = Zotero.Proxies.DNS.getIPs(); - var ipString = ips.join(","); - if(ipString != Zotero.Proxies.lastIPs) { - // if IPs have changed, run reverse lookup - Zotero.Proxies.lastIPs = ipString; - // TODO IPv6 - var domains = [Zotero.Proxies.DNS.reverseLookup(ip) for each(ip in ips) if(ip.indexOf(":") == -1)]; - + var notificationCallbacks = channel.notificationCallbacks; + Zotero.Proxies.DNS.getHostnames().then(function (hosts) { // if domains necessitate disabling, disable them - Zotero.Proxies.disabledByDomain = domains.join(",").indexOf(Zotero.Proxies.disableByDomain) != -1; - } + Zotero.Proxies.disabledByDomain = false; + for (var host of hosts) { + Zotero.Proxies.disabledByDomain = host.toLowerCase().indexOf(Zotero.Proxies.disableByDomain) != -1; + if (Zotero.Proxies.disabledByDomain) return; + } + _maybeRedirect(channel, notificationCallbacks, proxied); + }, function(e) { + _maybeRedirect(channel, notificationCallbacks, proxied); + }); + Zotero.Proxies.lastIPCheck = now; + return; } - Zotero.Proxies.lastIPCheck = now; if(Zotero.Proxies.disabledByDomain) return; } + _maybeRedirect(channel, channel.notificationCallbacks, proxied); + } + + function _maybeRedirect(channel, notificationCallbacks, proxied) { // try to find a corresponding browser object - var bw = _getBrowserAndWindow(channel.notificationCallbacks); + var bw = _getBrowserAndWindow(notificationCallbacks); if(!bw) return; var browser = bw[0]; var window = bw[1]; @@ -927,106 +932,20 @@ Zotero.Proxies.Detectors.Juniper = function(channel) { Zotero.Proxies.DNS = new function() { var _callbacks = []; - this.getIPs = function() { - var dns = Components.classes["@mozilla.org/network/dns-service;1"] - .getService(Components.interfaces.nsIDNSService); - myHostName = dns.myHostName; - try { - var record = dns.resolve(myHostName, null); - } catch(e) { - return []; - } - - // get IPs - var ips = []; - while(record.hasMore()) { - ips.push(record.getNextAddrAsString()); - } - - return ips; - } - - this.reverseLookup = function(ip) { - Zotero.debug("Proxies: Performing reverse lookup for IP "+ip); - - // build DNS query - var bytes = Zotero.randomString(2)+"\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00"; - - var ipParts = ip.split("."); - ipParts.reverse(); - for each(var ipPart in ipParts) { - bytes += String.fromCharCode(ipPart.length); - bytes += ipPart; - } - for each(var subdomain in ["in-addr", "arpa"]) { - bytes += String.fromCharCode(subdomain.length); - bytes += subdomain; - } - bytes += "\x00\x00\x0c\x00\x01"; - - var sts = Components.classes["@mozilla.org/network/socket-transport-service;1"] - .getService(Components.interfaces.nsISocketTransportService); - var transport = sts.createTransport(["udp"], 1, "8.8.8.8", 53, null); - var rawinStream = transport.openInputStream(Components.interfaces.nsITransport.OPEN_BLOCKING, null, null); - var rawoutStream = transport.openOutputStream(Components.interfaces.nsITransport.OPEN_BLOCKING, null, null); - - var outStream = Components.classes["@mozilla.org/binaryoutputstream;1"] - .createInstance(Components.interfaces.nsIBinaryOutputStream); - outStream.setOutputStream(rawoutStream); - outStream.writeBytes(bytes, bytes.length); - outStream.close(); - - Zotero.debug("Proxies: Sent reverse lookup request"); - - var inStream = Components.classes["@mozilla.org/binaryinputstream;1"] - .createInstance(Components.interfaces.nsIBinaryInputStream); - var sinStream = Components.classes["@mozilla.org/scriptableinputstream;1"] - .createInstance(Components.interfaces.nsIScriptableInputStream); - inStream.setInputStream(rawinStream); - sinStream.init(rawinStream); - - var stuff = inStream.read32(); - var qdCount = inStream.read16(); - var anCount = inStream.read16(); - var nsCount = inStream.read16(); - var arCount = inStream.read16(); - - // read queries back out - for(var i=0; i<qdCount; i++) { - var len = inStream.read8(); - while(len != 0) { - sinStream.read(len); - len = inStream.read8(); - } - inStream.read16(); // QTYPE - inStream.read16(); // QCLASS - } - - // get reverse lookup domains - var domain = []; - if(anCount == 1) { - inStream.read16(); // HOST - inStream.read16(); // TYPE - inStream.read16(); // CLASS - inStream.read32(); // TTL - var rdLength = inStream.read16(); // RDLENGTH - var bc = 0; - domain = []; - while(bc < rdLength) { - bc += 1; - if(bc > rdLength) break; - var len = inStream.read8(); - bc += len; - if(bc > rdLength) break; - domain.push(sinStream.read(len)); - } - domain.pop(); - } - - domain = domain.join(".").toLowerCase(); - Zotero.debug("Proxies: "+ip+" PTR "+domain); - - inStream.close(); - return domain; + this.getHostnames = function() { + if (!Zotero.isWin && !Zotero.isMac && !Zotero.isLinux) return Q([]); + var deferred = Q.defer(); + var worker = new ChromeWorker("chrome://zotero/content/xpcom/dns_worker.js"); + Zotero.debug("Proxies.DNS: Performing reverse lookup"); + worker.onmessage = function(e) { + Zotero.debug("Proxies.DNS: Got hostnames "+e.data); + deferred.resolve(e.data); + }; + worker.onerror = function(e) { + Zotero.debug("Proxies.DNS: Reverse lookup failed"); + deferred.reject(e.message); + }; + worker.postMessage(Zotero.isWin ? "win" : Zotero.isMac ? "mac" : Zotero.isLinux ? "linux" : "unix"); + return deferred.promise; } }; \ No newline at end of file diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js @@ -113,14 +113,18 @@ 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; var urlPath = nsIURI.path; } - catch (e) { + catch (e) {} + + // Skip non-HTTP URLs + if (!nsIURI || !/^https?$/.test(nsIURI.scheme)) { return quickCopyPref; } @@ -129,7 +133,13 @@ Zotero.QuickCopy = new function() { } var matches = []; - 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"); + return quickCopyPref; + } for (let i=0; i<_siteSettings.length; i++) { let row = _siteSettings[i]; diff --git a/chrome/content/zotero/xpcom/server_connector.js b/chrome/content/zotero/xpcom/server_connector.js @@ -443,7 +443,7 @@ Zotero.Server.Connector.SaveSnapshot.prototype = { } // save snapshot - if(filesEditable) { + if (filesEditable && !data.skipSnapshot) { // TODO: async Zotero.Attachments.importFromDocument({ document: doc, diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js @@ -867,7 +867,8 @@ Zotero.Sync.Storage = new function () { return; } - Zotero.debug("Marking attachment " + lk + " for download"); + Zotero.debug("Marking attachment " + lk + " for download " + + "(stored mtime: " + itemModTimes[item.id] + ")"); updatedStates[item.id] = Zotero.Sync.Storage.SYNC_STATE_FORCE_DOWNLOAD; } @@ -939,7 +940,9 @@ Zotero.Sync.Storage = new function () { // This can happen if a path is too long on Windows, // e.g. a file is being accessed on a VM through a share // (and probably in other cases). - || (e.winLastError && e.winLastError == 3))) { + || (e.winLastError && e.winLastError == 3) + // Handle long filenames on OS X/Linux + || (e.unixErrno && e.unixErrno == 63))) { Zotero.debug("Marking attachment " + lk + " as missing"); updatedStates[item.id] = Zotero.Sync.Storage.SYNC_STATE_TO_DOWNLOAD; return; diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js @@ -632,7 +632,7 @@ Zotero.Style = function (style, path) { */ Zotero.Style.prototype.getCiteProc = function(locale, automaticJournalAbbreviations) { if(!locale) { - var locale = Zotero.locale; + var locale = Zotero.Prefs.get('export.lastLocale') || Zotero.locale; if(!locale) { var locale = 'en-US'; } diff --git a/chrome/content/zotero/xpcom/translation/translators.js b/chrome/content/zotero/xpcom/translation/translators.js @@ -308,7 +308,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) }; }); diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js @@ -1638,7 +1638,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/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -2227,7 +2227,7 @@ Zotero.Prefs = new function(){ if (!fromVersion) { fromVersion = 0; } - var toVersion = 1; + var toVersion = 2; if (fromVersion < toVersion) { for (var i = fromVersion + 1; i <= toVersion; i++) { switch (i) { @@ -2243,6 +2243,14 @@ Zotero.Prefs = new function(){ this.set('sync.storage.downloadMode.groups', 'on-sync'); } } + break; + + case 2: + // Re-show saveButton guidance panel (and clear old saveIcon pref). + // The saveButton guidance panel initially could auto-hide too easily. + this.clear('firstRunGuidanceShown.saveIcon'); + this.clear('firstRunGuidanceShown.saveButton'); + break; } } this.set('prefVersion', toVersion); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js @@ -3276,7 +3276,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); }); diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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/preferences.dtd b/chrome/locale/de/zotero/preferences.dtd @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "Domain/Pfad"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(z. B. wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "Ausgabeformat"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Sprache"> <!ENTITY zotero.preferences.quickCopy.dragLimit "Quick-Copy deaktiveren, wenn mehr als ... Einträge aktiv sind"> <!ENTITY zotero.preferences.prefpane.cite "Zitieren"> @@ -145,7 +145,7 @@ <!ENTITY zotero.preferences.proxies.desc_after_link "für weitere Informationen"> <!ENTITY zotero.preferences.proxies.transparent "Proxy-Weiterleitung aktivieren"> <!ENTITY zotero.preferences.proxies.autoRecognize "Proxy-Ressourcen automatisch erkennen"> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "Benachrichtigung anzeigen, wenn Proxy benutzt wird"> <!ENTITY zotero.preferences.proxies.disableByDomain "Proxy-Weiterleitung de-aktivieren bei diesen Domain-Bestandteilen:"> <!ENTITY zotero.preferences.proxies.configured "Definierte Proxies"> <!ENTITY zotero.preferences.proxies.hostname "Hostname"> diff --git a/chrome/locale/de/zotero/zotero.dtd b/chrome/locale/de/zotero/zotero.dtd @@ -165,7 +165,7 @@ <!ENTITY zotero.bibliography.title "Literaturverzeichnis erstellen"> <!ENTITY zotero.bibliography.style.label "Zitierstil:"> -<!ENTITY zotero.bibliography.locale.label "Language:"> +<!ENTITY zotero.bibliography.locale.label "Sprache:"> <!ENTITY zotero.bibliography.outputMode "Ausgabemodus:"> <!ENTITY zotero.bibliography.bibliography "Bibliografie"> <!ENTITY zotero.bibliography.outputMethod "Ausgabemethode:"> diff --git 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. @@ -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. @@ -678,22 +680,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 +965,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 +1006,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/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/en-US/zotero/csledit.dtd b/chrome/locale/en-US/zotero/csledit.dtd @@ -1,4 +1,3 @@ <!ENTITY styles.editor "Zotero Style Editor"> -<!ENTITY styles.editor.suppressAuthor "Suppress Author"> <!ENTITY styles.editor.citePosition "Cite Position:"> diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties @@ -487,6 +487,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 @@ -1005,7 +1007,7 @@ connector.loadInProgress = Zotero Standalone was launched but is not accessibl firstRunGuidance.authorMenu = Zotero lets you specify editors and translators, too. You can turn an author into an editor or translator by selecting from this menu. firstRunGuidance.quickFormat = Type a title or author to search for a reference.\n\nAfter you've made your selection, click the bubble or press Ctrl-\u2193 to add page numbers, prefixes, or suffixes. You can also include a page number along with your search terms to add it directly.\n\nYou can edit citations directly in the word processor document. firstRunGuidance.quickFormatMac = Type a title or author to search for a reference.\n\nAfter you've made your selection, click the bubble or press Cmd-\u2193 to add page numbers, prefixes, or suffixes. You can also include a page number along with your search terms to add it directly.\n\nYou can edit citations directly in the word processor document. -firstRunGuidance.toolbarButton.new = Click here to open Zotero, or use the %S keyboard shortcut. +firstRunGuidance.toolbarButton.new = Click the ‘Z’ button to open Zotero, or use the %S keyboard shortcut. firstRunGuidance.toolbarButton.upgrade = The Zotero icon can now be found in the Firefox toolbar. Click the icon to open Zotero, or use the %S keyboard shortcut. 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. diff --git a/chrome/locale/es-ES/zotero/preferences.dtd b/chrome/locale/es-ES/zotero/preferences.dtd @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "Dominio/ruta"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(p.ej. wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "Formato de salida"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Idioma"> <!ENTITY zotero.preferences.quickCopy.dragLimit "Desactivar Copia rápida cuando arrastre más de"> <!ENTITY zotero.preferences.prefpane.cite "Citar"> @@ -145,7 +145,7 @@ <!ENTITY zotero.preferences.proxies.desc_after_link "para mayor información."> <!ENTITY zotero.preferences.proxies.transparent "Habilitar el redireccionamiento del servidor proxy"> <!ENTITY zotero.preferences.proxies.autoRecognize "Automáticamente reconocer recursos proxificados"> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "Mostrar notificación al redirigir a través de un servidor proxy"> <!ENTITY zotero.preferences.proxies.disableByDomain "Deshabilitar el redireccionamiento del servidor proxy cuando el nombre del dominio contenga"> <!ENTITY zotero.preferences.proxies.configured "Servidores proxies configurados"> <!ENTITY zotero.preferences.proxies.hostname "Nombre del sistema"> diff --git a/chrome/locale/es-ES/zotero/zotero.dtd b/chrome/locale/es-ES/zotero/zotero.dtd @@ -165,7 +165,7 @@ <!ENTITY zotero.bibliography.title "Crear bibliografía"> <!ENTITY zotero.bibliography.style.label "Estilo de cita:"> -<!ENTITY zotero.bibliography.locale.label "Language:"> +<!ENTITY zotero.bibliography.locale.label "Idioma:"> <!ENTITY zotero.bibliography.outputMode "Modo de salida:"> <!ENTITY zotero.bibliography.bibliography "Bibliografía"> <!ENTITY zotero.bibliography.outputMethod "Método de salida:"> diff --git 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. @@ -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 @@ -678,22 +680,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 +965,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 +1006,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/et-EE/zotero/about.dtd b/chrome/locale/et-EE/zotero/about.dtd @@ -10,4 +10,4 @@ <!ENTITY zotero.thanks "Tänud:"> <!ENTITY zotero.about.close "Sulge"> <!ENTITY zotero.moreCreditsAndAcknowledgements "Veel autoreid ja tänusõnu"> -<!ENTITY zotero.citationProcessing "Citation &amp; Bibliography Processing"> +<!ENTITY zotero.citationProcessing "Tsiteeringute ja bibliograafia töötlemine"> diff --git a/chrome/locale/et-EE/zotero/preferences.dtd b/chrome/locale/et-EE/zotero/preferences.dtd @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "Domeen/aadress"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(nt wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "Väljundformaat"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Keel"> <!ENTITY zotero.preferences.quickCopy.dragLimit "Peatada kiirkopeerimine juhul kui lohistatakse rohkem kui"> <!ENTITY zotero.preferences.prefpane.cite "Viitamine"> @@ -145,7 +145,7 @@ <!ENTITY zotero.preferences.proxies.desc_after_link "."> <!ENTITY zotero.preferences.proxies.transparent "Pidada meeles prokside kaudu kasutatavad allikad"> <!ENTITY zotero.preferences.proxies.autoRecognize "Tuvastada prokside kaudu külastatavad lehed automaatselt"> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "Teate näitamine, kui toimub ligipääs proxy kaudu"> <!ENTITY zotero.preferences.proxies.disableByDomain "Proksile ümbersuunamine peatada, kui domeeninimi sisaldab "> <!ENTITY zotero.preferences.proxies.configured "Konfigureeritud proksid"> <!ENTITY zotero.preferences.proxies.hostname "Hostinimi"> @@ -162,7 +162,7 @@ <!ENTITY zotero.preferences.prefpane.advanced "Täpsemalt"> <!ENTITY zotero.preferences.advanced.filesAndFolders "Failid ja kataloogid"> -<!ENTITY zotero.preferences.advanced.keys "Shortcuts"> +<!ENTITY zotero.preferences.advanced.keys "Kiirvaliku klahvid"> <!ENTITY zotero.preferences.prefpane.locate "Otsing"> <!ENTITY zotero.preferences.locate.locateEngineManager "Artikli otsingumootori haldaja"> @@ -203,6 +203,6 @@ <!ENTITY zotero.preferences.debugOutputLogging.submitToServer "Saata Zotero serverisse"> <!ENTITY zotero.preferences.openAboutConfig "Avada about:config"> -<!ENTITY zotero.preferences.openCSLEdit "Open Style Editor"> -<!ENTITY zotero.preferences.openCSLPreview "Open Style Preview"> +<!ENTITY zotero.preferences.openCSLEdit "Avada stiilide redaktor"> +<!ENTITY zotero.preferences.openCSLPreview "Avada stiilide eelvaade"> <!ENTITY zotero.preferences.openAboutMemory "Avada about:memory"> diff --git a/chrome/locale/et-EE/zotero/standalone.dtd b/chrome/locale/et-EE/zotero/standalone.dtd @@ -12,12 +12,12 @@ <!ENTITY fileMenu.label "Fail"> <!ENTITY fileMenu.accesskey "F"> -<!ENTITY saveCmd.label "Save…"> +<!ENTITY saveCmd.label "Salvestamine..."> <!ENTITY saveCmd.key "S"> <!ENTITY saveCmd.accesskey "A"> -<!ENTITY pageSetupCmd.label "Page Setup…"> +<!ENTITY pageSetupCmd.label "Lehekülje seaded..."> <!ENTITY pageSetupCmd.accesskey "U"> -<!ENTITY printCmd.label "Print…"> +<!ENTITY printCmd.label "Trükkida..."> <!ENTITY printCmd.key "P"> <!ENTITY printCmd.accesskey "P"> <!ENTITY closeCmd.label "Sulgeda"> @@ -54,7 +54,7 @@ <!ENTITY selectAllCmd.label "Valida kõik"> <!ENTITY selectAllCmd.key "A"> <!ENTITY selectAllCmd.accesskey "A"> -<!ENTITY preferencesCmd.label "Preferences"> +<!ENTITY preferencesCmd.label "Eelistused"> <!ENTITY preferencesCmd.accesskey "O"> <!ENTITY preferencesCmdUnix.label "Eelistused"> <!ENTITY preferencesCmdUnix.accesskey "n"> diff --git a/chrome/locale/et-EE/zotero/zotero.dtd b/chrome/locale/et-EE/zotero/zotero.dtd @@ -5,19 +5,19 @@ <!ENTITY zotero.general.edit "Toimetada"> <!ENTITY zotero.general.delete "Kustutada"> <!ENTITY zotero.general.ok "OK"> -<!ENTITY zotero.general.cancel "Cancel"> -<!ENTITY zotero.general.refresh "Refresh"> -<!ENTITY zotero.general.saveAs "Save As…"> +<!ENTITY zotero.general.cancel "Tühistada"> +<!ENTITY zotero.general.refresh "Värskenda"> +<!ENTITY zotero.general.saveAs "Salvestada kui..."> -<!ENTITY zotero.errorReport.title "Zotero Error Report"> -<!ENTITY zotero.errorReport.unrelatedMessages "This may include messages unrelated to Zotero."> +<!ENTITY zotero.errorReport.title "Zotero vearaport"> +<!ENTITY zotero.errorReport.unrelatedMessages "Vealogi võib sisaldada teateid, mis ei puutu Zoterosse."> <!ENTITY zotero.errorReport.submissionInProgress "Palun oodake kuni veateadet saadetakse."> <!ENTITY zotero.errorReport.submitted "Teie veateade on saadetud."> <!ENTITY zotero.errorReport.reportID "Veateate ID:"> <!ENTITY zotero.errorReport.postToForums "Palun postitage teade foorumisse (forums.zotero.org) koos veateate ID-ga ja kirjeldusega, millistel asjaoludel probleem esineb ning mis seda iseloomustab."> <!ENTITY zotero.errorReport.notReviewed "Veateadetega, millest ei ole foorumites teada antud, üldjuhul ei tegeleta."> -<!ENTITY zotero.upgrade.title "Zotero Upgrade Wizard"> +<!ENTITY zotero.upgrade.title "Zotero uuendamishaldur"> <!ENTITY zotero.upgrade.newVersionInstalled "Paigaldasite uue Zotero versiooni."> <!ENTITY zotero.upgrade.upgradeRequired "Et Zotero andmebaas töötaks uue versiooniga on seda tarvis uuendada."> <!ENTITY zotero.upgrade.autoBackup "Enne muudatuste tegemist varundatakse olemasolev andmebaas automaatselt."> @@ -47,7 +47,7 @@ <!ENTITY zotero.collections.showUnfiledItems "Teemata kirjed"> <!ENTITY zotero.items.itemType "Kirje tüüp"> -<!ENTITY zotero.items.type_column "Item Type"> +<!ENTITY zotero.items.type_column "Kirje tüüp"> <!ENTITY zotero.items.title_column "Pealkiri"> <!ENTITY zotero.items.creator_column "Autor"> <!ENTITY zotero.items.date_column "Kuupäev"> @@ -62,22 +62,22 @@ <!ENTITY zotero.items.rights_column "Õigused"> <!ENTITY zotero.items.dateAdded_column "Lisamise kuupäev"> <!ENTITY zotero.items.dateModified_column "Muutmise kuupäev"> -<!ENTITY zotero.items.extra_column "Extra"> -<!ENTITY zotero.items.archive_column "Archive"> -<!ENTITY zotero.items.archiveLocation_column "Loc. in Archive"> -<!ENTITY zotero.items.place_column "Place"> -<!ENTITY zotero.items.volume_column "Volume"> -<!ENTITY zotero.items.edition_column "Edition"> -<!ENTITY zotero.items.pages_column "Pages"> -<!ENTITY zotero.items.issue_column "Issue"> -<!ENTITY zotero.items.series_column "Series"> -<!ENTITY zotero.items.seriesTitle_column "Series Title"> -<!ENTITY zotero.items.court_column "Court"> -<!ENTITY zotero.items.medium_column "Medium/Format"> -<!ENTITY zotero.items.genre_column "Genre"> -<!ENTITY zotero.items.system_column "System"> -<!ENTITY zotero.items.moreColumns.label "More Columns"> -<!ENTITY zotero.items.restoreColumnOrder.label "Restore Column Order"> +<!ENTITY zotero.items.extra_column "Lisa"> +<!ENTITY zotero.items.archive_column "Arhiiv"> +<!ENTITY zotero.items.archiveLocation_column "Asukoht arhiivis"> +<!ENTITY zotero.items.place_column "Koht"> +<!ENTITY zotero.items.volume_column "Köide"> +<!ENTITY zotero.items.edition_column "Trükk"> +<!ENTITY zotero.items.pages_column "Leheküljed"> +<!ENTITY zotero.items.issue_column "Väljalase"> +<!ENTITY zotero.items.series_column "Seeria"> +<!ENTITY zotero.items.seriesTitle_column "Seeria pealkiri"> +<!ENTITY zotero.items.court_column "Kohus"> +<!ENTITY zotero.items.medium_column "Kandja/formaat"> +<!ENTITY zotero.items.genre_column "Žanr"> +<!ENTITY zotero.items.system_column "Süsteem"> +<!ENTITY zotero.items.moreColumns.label "Rohkem tulpasid"> +<!ENTITY zotero.items.restoreColumnOrder.label "Taastada tulpade järjekord"> <!ENTITY zotero.items.menu.showInLibrary "Näidata raamatukogus"> <!ENTITY zotero.items.menu.attach.note "Märkuse lisamine"> @@ -90,10 +90,10 @@ <!ENTITY zotero.items.menu.restoreToLibrary "Taasta raamatukokku"> <!ENTITY zotero.items.menu.duplicateItem "Valitud kirje duplitseerimine"> -<!ENTITY zotero.items.menu.mergeItems "Merge Items…"> +<!ENTITY zotero.items.menu.mergeItems "Kirjete liitmine..."> -<!ENTITY zotero.duplicatesMerge.versionSelect "Choose the version of the item to use as the master item:"> -<!ENTITY zotero.duplicatesMerge.fieldSelect "Select fields to keep from other versions of the item:"> +<!ENTITY zotero.duplicatesMerge.versionSelect "Palun valida aluskirje, millele liidetakse teise kirje andmed:"> +<!ENTITY zotero.duplicatesMerge.fieldSelect "Valida väljad, mida säilitada teistest versioonidest:"> <!ENTITY zotero.toolbar.newItem.label "Uus kirje"> <!ENTITY zotero.toolbar.moreItemTypes.label "Veel"> @@ -125,9 +125,9 @@ <!ENTITY zotero.item.textTransform "Teksti muutmine"> <!ENTITY zotero.item.textTransform.titlecase "Suurteks Algustähtedeks"> <!ENTITY zotero.item.textTransform.sentencecase "Lause tõst"> -<!ENTITY zotero.item.creatorTransform.nameSwap "Swap First/Last Names"> -<!ENTITY zotero.item.viewOnline "View Online"> -<!ENTITY zotero.item.copyAsURL "Copy as URL"> +<!ENTITY zotero.item.creatorTransform.nameSwap "Vahetada Eesnimi/Perekonnanimi"> +<!ENTITY zotero.item.viewOnline "Online vaade"> +<!ENTITY zotero.item.copyAsURL "Kopeerida URL kujul"> <!ENTITY zotero.toolbar.newNote "Uus märkus"> <!ENTITY zotero.toolbar.note.standalone "Uus sõltumatu märkus"> @@ -145,18 +145,18 @@ <!ENTITY zotero.tagSelector.selectVisible "Valida nähtav"> <!ENTITY zotero.tagSelector.clearVisible "Nähtava valiku eemaldamine"> <!ENTITY zotero.tagSelector.clearAll "Ära vali midagi"> -<!ENTITY zotero.tagSelector.assignColor "Assign Color…"> +<!ENTITY zotero.tagSelector.assignColor "Värvi valik..."> <!ENTITY zotero.tagSelector.renameTag "Lipiku ümbernimetamine..."> <!ENTITY zotero.tagSelector.deleteTag "Lipiku kustutamine..."> -<!ENTITY zotero.tagColorChooser.title "Choose a Tag Color and Position"> -<!ENTITY zotero.tagColorChooser.color "Color:"> -<!ENTITY zotero.tagColorChooser.position "Position:"> -<!ENTITY zotero.tagColorChooser.setColor "Set Color"> -<!ENTITY zotero.tagColorChooser.removeColor "Remove Color"> +<!ENTITY zotero.tagColorChooser.title "Lipiku värvi valik ja asukoht"> +<!ENTITY zotero.tagColorChooser.color "Värv:"> +<!ENTITY zotero.tagColorChooser.position "Asukoht:"> +<!ENTITY zotero.tagColorChooser.setColor "Värvi valimine:"> +<!ENTITY zotero.tagColorChooser.removeColor "Värvi eemaldamine"> <!ENTITY zotero.lookup.description "Sisestada otsitava ISBN, DOI või PMID allolevasse lahtrisse."> -<!ENTITY zotero.lookup.button.search "Search"> +<!ENTITY zotero.lookup.button.search "Otsing"> <!ENTITY zotero.selectitems.title "Kirjete valimine"> <!ENTITY zotero.selectitems.intro.label "Valida millised kirjeid soovite lisada raamatukokku"> @@ -165,10 +165,10 @@ <!ENTITY zotero.bibliography.title "Bibliograafia loomine"> <!ENTITY zotero.bibliography.style.label "Viite stiil:"> -<!ENTITY zotero.bibliography.locale.label "Language:"> -<!ENTITY zotero.bibliography.outputMode "Output Mode:"> -<!ENTITY zotero.bibliography.bibliography "Bibliography"> -<!ENTITY zotero.bibliography.outputMethod "Output Method:"> +<!ENTITY zotero.bibliography.locale.label "Keel"> +<!ENTITY zotero.bibliography.outputMode "Väljundi tüüp:"> +<!ENTITY zotero.bibliography.bibliography "Biblograafia"> +<!ENTITY zotero.bibliography.outputMethod "Väljundi meetod:"> <!ENTITY zotero.bibliography.saveAsRTF.label "Salvestada RTF-ina"> <!ENTITY zotero.bibliography.saveAsHTML.label "Salvestada HTML-ina"> <!ENTITY zotero.bibliography.copyToClipboard.label "Lõikepuhvrisse kopeerimine"> @@ -177,7 +177,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokumendi sätted"> <!ENTITY zotero.integration.addEditCitation.title "Lisa/toimeta viidet"> <!ENTITY zotero.integration.editBibliography.title "Toimeta bibliograafiat"> -<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> +<!ENTITY zotero.integration.quickFormatDialog.title "Viidete kiirformateering"> <!ENTITY zotero.progress.title "Progress"> @@ -193,7 +193,7 @@ <!ENTITY zotero.citation.suppressAuthor.label "Peida autor"> <!ENTITY zotero.citation.prefix.label "Prefiks:"> <!ENTITY zotero.citation.suffix.label "Sufiks:"> -<!ENTITY zotero.citation.editorWarning.label "Warning: If you edit a citation in the editor it will no longer update to reflect changes in your database or the citation style."> +<!ENTITY zotero.citation.editorWarning.label "Hoiatus: kui te redigeerite tsiteeringut siis see ei hakka enam peegeldama muutuseid, mida teete selle kirje zotero andmebaasi või kui muudate seadetes tsiteeringu stiili."> <!ENTITY zotero.richText.italic.label "Kaldkiri"> <!ENTITY zotero.richText.bold.label "Rasvane"> @@ -216,8 +216,8 @@ <!ENTITY zotero.integration.prefs.bookmarks.caption "Järjehoidjad toimivad nii MS Wordi kui ka OpenOffice puhul, kuid võib juhtuda, et neid kogemata muudetakse. Ühilduvuse huvides ei ole võimalik lisada viiteid allmärkustele ja lõppmärkustele, kui see võimalus on aktiveeritud."> -<!ENTITY zotero.integration.prefs.automaticJournalAbbeviations.label "Automatically abbreviate journal titles"> -<!ENTITY zotero.integration.prefs.automaticJournalAbbeviations.caption "MEDLINE journal abbreviations will be automatically generated using journal titles. The “Journal Abbr” field will be ignored."> +<!ENTITY zotero.integration.prefs.automaticJournalAbbeviations.label "Lühendada ajakirjade pealkirju automaatselt"> +<!ENTITY zotero.integration.prefs.automaticJournalAbbeviations.caption "MEDLINE ajakirjade lühendid luuakse automaatselt kasutades ajakirjade pealkirju. “Ajakirja lühend” välja ignoreeritakse."> <!ENTITY zotero.integration.prefs.storeReferences.label "Säilita viited dokumendiga koos"> <!ENTITY zotero.integration.prefs.storeReferences.caption "Viidete salvestamine dokumendi sisse suurendab veidi failisuurust, kuid võimaldab teil seda dokumenti teiste Zotero kasutajatega jagada ilma Zotero gruppi kasutamata. Et sellist dokumenti redigeerida on vajalik Zotero 3.0 või hilisem verisoon."> @@ -243,9 +243,9 @@ <!ENTITY zotero.sync.longTagFixer.uncheckedTagsNotSaved "Valimata lipikuid ei salvestata."> <!ENTITY zotero.sync.longTagFixer.tagWillBeDeleted "Lipik kustutatakse kõigilt kirjetelt."> -<!ENTITY zotero.merge.title "Conflict Resolution"> +<!ENTITY zotero.merge.title "Konflikti lahendamine"> <!ENTITY zotero.merge.of "of"> -<!ENTITY zotero.merge.deleted "Deleted"> +<!ENTITY zotero.merge.deleted "Kustututatud"> <!ENTITY zotero.proxy.recognized.title "Proksi omaks võetud."> <!ENTITY zotero.proxy.recognized.warning "Lisage vaid oma raamatukogust, koolist või firmast lähtuvaid proksisid"> @@ -287,6 +287,6 @@ <!ENTITY zotero.downloadManager.saveToLibrary.description "Valitud raamatukokku ei ole võimalik manuseid salvestada. See kirje salvestatakse teie isiklikku raamatukokku."> <!ENTITY zotero.downloadManager.noPDFTools.description "Selle funktsiooni kasutamiseks on kõigepealt tarvis paigaldada PDF tööriistad Zotero seadetes."> -<!ENTITY zotero.attachLink.title "Attach Link to URI"> +<!ENTITY zotero.attachLink.title "Seonda link URI-ga…"> <!ENTITY zotero.attachLink.label.link "Link:"> -<!ENTITY zotero.attachLink.label.title "Title:"> +<!ENTITY zotero.attachLink.label.title "Pealkiri:"> diff --git 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... @@ -484,12 +484,14 @@ 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 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 @@ -755,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/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 @@ -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 @@ -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/preferences.dtd b/chrome/locale/fr-FR/zotero/preferences.dtd @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "Domaine/Chemin"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(ex. wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "Format de sortie"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Langue"> <!ENTITY zotero.preferences.quickCopy.dragLimit "Désactiver la copie rapide lorsqu'on fait glisser plus de"> <!ENTITY zotero.preferences.prefpane.cite "Citer"> @@ -140,12 +140,12 @@ <!ENTITY zotero.preferences.prefpane.proxies "Serveurs mandataires"> <!ENTITY zotero.preferences.proxies.proxyOptions "Options des serveurs mandataires"> -<!ENTITY zotero.preferences.proxies.desc_before_link "Zotero redirigera les requêtes de manière transparente à travers les serveurs mandataires enregistrés. Consultez la"> -<!ENTITY zotero.preferences.proxies.desc_link "documentation concernant les serveurs mandataires"> +<!ENTITY zotero.preferences.proxies.desc_before_link "Zotero redirigera automatiquement les requêtes via les serveurs mandataires (proxy) enregistrés. Consultez la"> +<!ENTITY zotero.preferences.proxies.desc_link "documentation relative aux serveurs mandataires"> <!ENTITY zotero.preferences.proxies.desc_after_link "pour plus d'information."> <!ENTITY zotero.preferences.proxies.transparent "Activer la redirection par un serveur mandataire (proxy)"> <!ENTITY zotero.preferences.proxies.autoRecognize "Reconnaître automatiquement les ressources passant par un serveur mandataire"> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "Afficher une notification lors d'une redirection par un serveur mandataire"> <!ENTITY zotero.preferences.proxies.disableByDomain "Désactiver la redirection par un serveur mandataire lorsque mon nom de domaine contient "> <!ENTITY zotero.preferences.proxies.configured "Serveurs mandataires configurés"> <!ENTITY zotero.preferences.proxies.hostname "Adresse Internet"> diff --git a/chrome/locale/fr-FR/zotero/zotero.dtd b/chrome/locale/fr-FR/zotero/zotero.dtd @@ -97,7 +97,7 @@ <!ENTITY zotero.toolbar.newItem.label "Nouveau document"> <!ENTITY zotero.toolbar.moreItemTypes.label "Plus"> -<!ENTITY zotero.toolbar.newItemFromPage.label "Créer un nouveau document à partir de la page courante"> +<!ENTITY zotero.toolbar.newItemFromPage.label "Créer un document Page Web à partir de la page courante"> <!ENTITY zotero.toolbar.lookup.label "Ajouter un document par son identifiant"> <!ENTITY zotero.toolbar.removeItem.label "Supprimer le document…"> <!ENTITY zotero.toolbar.newCollection.label "Nouvelle collection…"> @@ -165,7 +165,7 @@ <!ENTITY zotero.bibliography.title "Créer une citation/bibliographie"> <!ENTITY zotero.bibliography.style.label "Style de citation :"> -<!ENTITY zotero.bibliography.locale.label "Language:"> +<!ENTITY zotero.bibliography.locale.label "Langue :"> <!ENTITY zotero.bibliography.outputMode "Mode de création :"> <!ENTITY zotero.bibliography.bibliography "Bibliographie"> <!ENTITY zotero.bibliography.outputMethod "Méthode de création :"> diff --git 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. @@ -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é @@ -679,21 +681,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 +927,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 +965,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 +1006,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/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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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/preferences.dtd b/chrome/locale/pl-PL/zotero/preferences.dtd @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "Domena/Ścieżka dostępu"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(np. wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "Format wyjściowy"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Język"> <!ENTITY zotero.preferences.quickCopy.dragLimit "Wyłącz Szybką kopię jeśli przeciągane jest więcej niż"> <!ENTITY zotero.preferences.prefpane.cite "Cytowanie"> @@ -145,7 +145,7 @@ <!ENTITY zotero.preferences.proxies.desc_after_link "aby uzyskać więcej informacji."> <!ENTITY zotero.preferences.proxies.transparent "Niewidocznie przekierowuj żądania za pomocą poprzednio używanych serwerów proxy"> <!ENTITY zotero.preferences.proxies.autoRecognize "Automatycznie rozpoznaj zasoby proxy"> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "Pokaż powiadomienie podczas przekierowania przez serwer proxy"> <!ENTITY zotero.preferences.proxies.disableByDomain "Wyłącz przekierowanie proxy jeśli moja nazwa domeny zawiera "> <!ENTITY zotero.preferences.proxies.configured "Skonfigurowane serwery proxy"> <!ENTITY zotero.preferences.proxies.hostname "Nazwa hosta"> diff --git a/chrome/locale/pl-PL/zotero/zotero.dtd b/chrome/locale/pl-PL/zotero/zotero.dtd @@ -165,7 +165,7 @@ <!ENTITY zotero.bibliography.title "Utwórz bibliografię"> <!ENTITY zotero.bibliography.style.label "Styl cytowania:"> -<!ENTITY zotero.bibliography.locale.label "Language:"> +<!ENTITY zotero.bibliography.locale.label "Język:"> <!ENTITY zotero.bibliography.outputMode "Tryb wyjścia:"> <!ENTITY zotero.bibliography.bibliography "Bibliografia"> <!ENTITY zotero.bibliography.outputMethod "Metoda wyjścia:"> diff --git 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. @@ -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. @@ -678,22 +680,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/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 @@ -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 @@ -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 @@ -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/preferences.dtd b/chrome/locale/sk-SK/zotero/preferences.dtd @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "doména/cesta"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(napr. wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "výstupný formát"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Jazyk"> <!ENTITY zotero.preferences.quickCopy.dragLimit "Zakázať rýchle kopírovanie pri presúvaní viac než"> <!ENTITY zotero.preferences.prefpane.cite "Citovanie"> @@ -145,7 +145,7 @@ <!ENTITY zotero.preferences.proxies.desc_after_link "."> <!ENTITY zotero.preferences.proxies.transparent "Transparentne presmerovať požiadavky cez v minulosti použité proxy"> <!ENTITY zotero.preferences.proxies.autoRecognize "Automaticky rozpoznať proxy zdroje "> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "Zobraziť upozornenia pri presmerovaní cez proxy"> <!ENTITY zotero.preferences.proxies.disableByDomain "Vypnúť presmerovanie proxy, ak názov mojej domény obsahuje "> <!ENTITY zotero.preferences.proxies.configured "Nastavené proxy"> <!ENTITY zotero.preferences.proxies.hostname "Názov sídla"> diff --git a/chrome/locale/sk-SK/zotero/zotero.dtd b/chrome/locale/sk-SK/zotero/zotero.dtd @@ -165,7 +165,7 @@ <!ENTITY zotero.bibliography.title "Vytvoriť bibliografiu"> <!ENTITY zotero.bibliography.style.label "Citačný štýl:"> -<!ENTITY zotero.bibliography.locale.label "Language:"> +<!ENTITY zotero.bibliography.locale.label "Jazyk:"> <!ENTITY zotero.bibliography.outputMode "Výstupný režim:"> <!ENTITY zotero.bibliography.bibliography "Bibliografia"> <!ENTITY zotero.bibliography.outputMethod "Výstupná metóda:"> diff --git 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čí. @@ -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á @@ -678,22 +680,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 +965,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 +1006,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/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 @@ -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/preferences.dtd b/chrome/locale/sv-SE/zotero/preferences.dtd @@ -63,7 +63,7 @@ <!ENTITY zotero.preferences.sync.fileSyncing.download "Ladda ner filer"> <!ENTITY zotero.preferences.sync.fileSyncing.download.atSyncTime "vid synkronisering"> <!ENTITY zotero.preferences.sync.fileSyncing.download.onDemand "efter behov"> -<!ENTITY zotero.preferences.sync.fileSyncing.tos1 "Genom att använda Zotero Storage går du med på tjänstens"> +<!ENTITY zotero.preferences.sync.fileSyncing.tos1 "Genom att använda Zotero Storage godtar du tjänstens"> <!ENTITY zotero.preferences.sync.fileSyncing.tos2 "avtalsvillkor"> <!ENTITY zotero.preferences.sync.reset.warning1 "Följande åtgärder är endast till för sällsynta, särskilda situationer och ska inte användas för vanlig felsökning. I många fall kan en återställning istället orsaka nya problem. Se"> <!ENTITY zotero.preferences.sync.reset.warning2 "Återställningsalternativ för synkronisering"> @@ -96,7 +96,7 @@ <!ENTITY zotero.preferences.prefpane.export "Exportera"> <!ENTITY zotero.preferences.citationOptions.caption "Inställningar för källhänvisningar"> -<!ENTITY zotero.preferences.export.citePaperJournalArticleURL "Länka till papperstidningars webbsida i källförteckningen"> +<!ENTITY zotero.preferences.export.citePaperJournalArticleURL "Ta med URL:er för forskningsartiklar i källförteckningen"> <!ENTITY zotero.preferences.export.citePaperJournalArticleURL.description "När detta är bortvalt lägger Zotero bara till webblänken om artikeln inte har ett sidintervall specificerat."> <!ENTITY zotero.preferences.quickCopy.caption "Snabbkopiera"> @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "Domän/sökväg"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(t.ex. wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "Utdataformat"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Språk"> <!ENTITY zotero.preferences.quickCopy.dragLimit "Stäng av snabbkopiering om fler än ... filer är markerade."> <!ENTITY zotero.preferences.prefpane.cite "Källhänvisa"> @@ -145,16 +145,16 @@ <!ENTITY zotero.preferences.proxies.desc_after_link "för mer information."> <!ENTITY zotero.preferences.proxies.transparent "Kom ihåg tidigare proxyservrar automatiskt"> <!ENTITY zotero.preferences.proxies.autoRecognize "Upptäck proxytjänster automatiskt"> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "Visa meddelande vid omdirigering via en proxy."> <!ENTITY zotero.preferences.proxies.disableByDomain "Inaktivera proxy-omdirigering när mitt domännamn innehåller"> <!ENTITY zotero.preferences.proxies.configured "Inställda proxyservrar"> -<!ENTITY zotero.preferences.proxies.hostname "Hostnamn"> +<!ENTITY zotero.preferences.proxies.hostname "Värdnamn"> <!ENTITY zotero.preferences.proxies.scheme "Inställningar"> <!ENTITY zotero.preferences.proxies.multiSite "Multisajt"> <!ENTITY zotero.preferences.proxies.autoAssociate "Associera nya värdar automatiskt"> <!ENTITY zotero.preferences.proxies.variables "Du kan använda följande inställningar för din proxyserver:"> -<!ENTITY zotero.preferences.proxies.h_variable "&#37;h - Proxysajtens hostnamn (t.ex., www.zotero.org)"> +<!ENTITY zotero.preferences.proxies.h_variable "&#37;h - Proxysajtens värdnamn (t.ex., www.zotero.org)"> <!ENTITY zotero.preferences.proxies.p_variable "&#37;p - Sökvägen till proxysidan utan föregående / (t.ex., about/index.html)"> <!ENTITY zotero.preferences.proxies.d_variable "&#37;d - Mappnamnet (t.ex., about/)"> <!ENTITY zotero.preferences.proxies.f_variable "&#37;f - Filnamnet (t.ex., index.html)"> diff --git a/chrome/locale/sv-SE/zotero/zotero.dtd b/chrome/locale/sv-SE/zotero/zotero.dtd @@ -165,7 +165,7 @@ <!ENTITY zotero.bibliography.title "Skapa citering/källförteckning"> <!ENTITY zotero.bibliography.style.label "Referensstil"> -<!ENTITY zotero.bibliography.locale.label "Language:"> +<!ENTITY zotero.bibliography.locale.label "Språk:"> <!ENTITY zotero.bibliography.outputMode "Utmatningsläge"> <!ENTITY zotero.bibliography.bibliography "Källförteckning"> <!ENTITY zotero.bibliography.outputMethod "Utmatningsmetod"> diff --git 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. @@ -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 @@ -678,22 +680,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 +965,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 +1006,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/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/preferences.dtd b/chrome/locale/tr-TR/zotero/preferences.dtd @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "Etki alanı/Yol"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(ör. wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "Çıktı Biçimi"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Dil"> <!ENTITY zotero.preferences.quickCopy.dragLimit "Bu kadardan daha fazla sürüklendiğinde Çabuk Kopyalamayı seçilemez kıl:"> <!ENTITY zotero.preferences.prefpane.cite "Gönderme Yapmak"> @@ -145,7 +145,7 @@ <!ENTITY zotero.preferences.proxies.desc_after_link "bakınız."> <!ENTITY zotero.preferences.proxies.transparent "Vekil sunucu kaynaklarını kendiliğinden hatırla"> <!ENTITY zotero.preferences.proxies.autoRecognize "Vekil sunuculu kaynakları kendiliğinden tanı"> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "Bir vekil sunucu aracılığıyla yönlendirirken mesaj göster."> <!ENTITY zotero.preferences.proxies.disableByDomain "Etki alanı adı bunları içeriyorsa vekil sunucuya yönlendirme: "> <!ENTITY zotero.preferences.proxies.configured "Ayarlanmış Vekil Sunucular"> <!ENTITY zotero.preferences.proxies.hostname "Ana Sunucu"> diff --git a/chrome/locale/tr-TR/zotero/zotero.dtd b/chrome/locale/tr-TR/zotero/zotero.dtd @@ -165,7 +165,7 @@ <!ENTITY zotero.bibliography.title "Bibliyografya Oluştur"> <!ENTITY zotero.bibliography.style.label "Gönderme Stili:"> -<!ENTITY zotero.bibliography.locale.label "Language:"> +<!ENTITY zotero.bibliography.locale.label "Dil:"> <!ENTITY zotero.bibliography.outputMode "Çıktı Biçimi"> <!ENTITY zotero.bibliography.bibliography "Bibliyografya"> <!ENTITY zotero.bibliography.outputMethod "Çıktı Metodu:"> diff --git 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. @@ -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 @@ -678,22 +680,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.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.page=Sayfa +citation.locator.book=Kitap +citation.locator.chapter=Bölüm +citation.locator.column=Sütun +citation.locator.figure=Şekil +citation.locator.folio=Yaprak +citation.locator.issue=Sayı +citation.locator.line=Satır +citation.locator.note=Not 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=Parağraf +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 report.title.default=Zotero Rapor report.parentItem=Üst Eser: @@ -963,7 +965,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 +1006,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 @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "Домен/шлях"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(наприклад, wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "Формат виводу"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Мова"> <!ENTITY zotero.preferences.quickCopy.dragLimit "Включити швидке копіювання при перетаскуванні більш ніж"> <!ENTITY zotero.preferences.prefpane.cite "Цитування"> @@ -145,7 +145,7 @@ <!ENTITY zotero.preferences.proxies.desc_after_link "для додаткової інформації."> <!ENTITY zotero.preferences.proxies.transparent "Використати перенаправлення"> <!ENTITY zotero.preferences.proxies.autoRecognize "Автоматично розпізнвати проксі, що використовується"> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "Показувати сповіщення при перенаправленні через проксі-сервер"> <!ENTITY zotero.preferences.proxies.disableByDomain "Відключити перенаправлення, коли моє доменне ім'я містить"> <!ENTITY zotero.preferences.proxies.configured "Налаштовані проксі"> <!ENTITY zotero.preferences.proxies.hostname "Ім'я хоста"> diff --git a/chrome/locale/uk-UA/zotero/zotero.dtd b/chrome/locale/uk-UA/zotero/zotero.dtd @@ -165,7 +165,7 @@ <!ENTITY zotero.bibliography.title "Створити цитування/список літератури"> <!ENTITY zotero.bibliography.style.label "Стиль цитування:"> -<!ENTITY zotero.bibliography.locale.label "Language:"> +<!ENTITY zotero.bibliography.locale.label "Мова:"> <!ENTITY zotero.bibliography.outputMode "Режим вводу:"> <!ENTITY zotero.bibliography.bibliography "Список літератури"> <!ENTITY zotero.bibliography.outputMethod "Метод вводу:"> diff --git 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=Перемістити документ до Кошику... @@ -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=Документ збережено @@ -567,15 +569,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 +680,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 +789,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 +965,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 +1006,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/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 @@ -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/preferences.dtd b/chrome/locale/zh-TW/zotero/preferences.dtd @@ -107,7 +107,7 @@ <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath "網域/路徑"> <!ENTITY zotero.preferences.quickCopy.siteEditor.domainPath.example "(例如 wikipedia.org)"> <!ENTITY zotero.preferences.quickCopy.siteEditor.outputFormat "輸出格式"> -<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "Language"> +<!ENTITY zotero.preferences.quickCopy.siteEditor.locale "語言"> <!ENTITY zotero.preferences.quickCopy.dragLimit "拖放超過多少項目時,停用快速複製:"> <!ENTITY zotero.preferences.prefpane.cite "引用"> @@ -145,7 +145,7 @@ <!ENTITY zotero.preferences.proxies.desc_after_link "以得更多資訊。"> <!ENTITY zotero.preferences.proxies.transparent "啟用代理伺服器轉導向"> <!ENTITY zotero.preferences.proxies.autoRecognize "自動識別接受透過代理伺服器的資源"> -<!ENTITY zotero.preferences.proxies.showRedirectNotification "Show notification when redirecting through a proxy"> +<!ENTITY zotero.preferences.proxies.showRedirectNotification "當由伺服器重新導向時顯示通知訊息"> <!ENTITY zotero.preferences.proxies.disableByDomain "停用代理伺服器轉導向,若我的網域名稱含 "> <!ENTITY zotero.preferences.proxies.configured "已設定的代理伺服器"> <!ENTITY zotero.preferences.proxies.hostname "主機名稱"> diff --git a/chrome/locale/zh-TW/zotero/zotero.dtd b/chrome/locale/zh-TW/zotero/zotero.dtd @@ -165,7 +165,7 @@ <!ENTITY zotero.bibliography.title "建立參考文獻條/表"> <!ENTITY zotero.bibliography.style.label "引用文獻條之樣式:"> -<!ENTITY zotero.bibliography.locale.label "Language:"> +<!ENTITY zotero.bibliography.locale.label "語言:"> <!ENTITY zotero.bibliography.outputMode "*輸出模式:"> <!ENTITY zotero.bibliography.bibliography "參考文獻表"> <!ENTITY zotero.bibliography.outputMethod "*輸出方法:"> diff --git 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=請稍候至完成。 @@ -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=項目己儲存 @@ -678,22 +680,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 +965,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 +1006,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=儲存文獻之樣式: diff --git 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; diff --git 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"); @@ -52,6 +56,67 @@ toolbarpaletteitem[place="palette"] #zotero-toolbar-buttons #zotero-toolbar-save display:none; } +/* 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]: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: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), diff --git a/components/zotero-service.js b/components/zotero-service.js @@ -226,6 +226,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 diff --git a/resource/schema/repotime.txt b/resource/schema/repotime.txt @@ -1 +1 @@ -2015-06-25 14:05:00 +2015-07-12 15:40:00 diff --git a/test/content/support.js b/test/content/support.js @@ -472,6 +472,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; diff --git a/test/tests/data/allTypesAndFields.js b/test/tests/data/allTypesAndFields.js @@ -16,6 +16,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "artist", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -56,6 +61,11 @@ "creatorType": "wordsBy", "firstName": "wordsByFirst", "lastName": "wordsByLast" + }, + { + "creatorType": "performer", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -94,6 +104,11 @@ "creatorType": "cosponsor", "firstName": "cosponsorFirst", "lastName": "cosponsorLast" + }, + { + "creatorType": "sponsor", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -130,6 +145,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -175,6 +195,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -232,6 +257,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -272,6 +302,11 @@ "creatorType": "counsel", "firstName": "counselFirst", "lastName": "counselLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -305,6 +340,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "programmer", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -356,6 +396,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -406,6 +451,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -458,6 +508,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -489,6 +544,11 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -532,6 +592,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -579,6 +644,11 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -608,6 +678,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -630,6 +705,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "contributor", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -667,6 +747,11 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -704,6 +789,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "interviewee", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -750,6 +840,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -791,6 +886,11 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -831,6 +931,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -868,6 +973,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -905,6 +1015,11 @@ "creatorType": "seriesEditor", "firstName": "seriesEditorFirst", "lastName": "seriesEditorLast" + }, + { + "creatorType": "cartographer", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -950,6 +1065,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -988,6 +1108,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "inventor", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1025,6 +1150,11 @@ "creatorType": "guest", "firstName": "guestFirst", "lastName": "guestLast" + }, + { + "creatorType": "podcaster", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "extra": "Extra", @@ -1052,6 +1182,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "presenter", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1102,6 +1237,11 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1146,6 +1286,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1179,6 +1324,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1211,6 +1361,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1263,6 +1418,11 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1313,6 +1473,11 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1350,6 +1515,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", diff --git a/test/tests/data/citeProcJSExport.js b/test/tests/data/citeProcJSExport.js @@ -17,6 +17,9 @@ { "family": "artistLast", "given": "artistFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -58,6 +61,9 @@ { "family": "performerLast", "given": "performerFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -108,6 +114,9 @@ { "family": "sponsorLast", "given": "sponsorFirst" + }, + { + "literal": "Institutional Author" } ], "authority": "Legislative body", @@ -150,6 +159,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "container-title": "Publication title", @@ -189,6 +201,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -255,6 +270,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -325,6 +343,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "authority": "Court", @@ -368,6 +389,9 @@ { "family": "programmerLast", "given": "programmerFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -414,6 +438,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -479,6 +506,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -545,6 +575,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -600,6 +633,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "id": 48, @@ -643,6 +679,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -709,6 +748,9 @@ { "family": "directorLast", "given": "directorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -749,6 +791,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "container-title": "Publication title", @@ -785,6 +830,9 @@ { "family": "contributorLast", "given": "contributorFirst" + }, + { + "literal": "Institutional Author" } ], "authority": "Legislative body", @@ -829,6 +877,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "id": 53, @@ -871,6 +922,9 @@ { "family": "intervieweeLast", "given": "intervieweeFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -924,6 +978,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -986,6 +1043,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1032,6 +1092,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1086,6 +1149,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1135,6 +1201,9 @@ { "family": "cartographerLast", "given": "cartographerFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1187,6 +1256,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1241,6 +1313,9 @@ { "family": "inventorLast", "given": "inventorFirst" + }, + { + "literal": "Institutional Author" } ], "authority": "Issuing authority", @@ -1294,6 +1369,9 @@ { "family": "podcasterLast", "given": "podcasterFirst" + }, + { + "literal": "Institutional Author" } ], "collection-title": "Series title", @@ -1323,6 +1401,9 @@ { "family": "presenterLast", "given": "presenterFirst" + }, + { + "literal": "Institutional Author" } ], "event": "Meeting name", @@ -1363,6 +1444,9 @@ { "family": "directorLast", "given": "directorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1408,6 +1492,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1463,6 +1550,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "chapter-number": "Session", @@ -1506,6 +1596,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1549,6 +1642,9 @@ { "family": "directorLast", "given": "directorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1595,6 +1691,9 @@ { "family": "directorLast", "given": "directorFirst" + }, + { + "literal": "Institutional Author" } ], "call-number": "Call number", @@ -1639,6 +1738,9 @@ { "family": "authorLast", "given": "authorFirst" + }, + { + "literal": "Institutional Author" } ], "container-title": "Publication title", diff --git a/test/tests/data/itemJSON.js b/test/tests/data/itemJSON.js @@ -18,6 +18,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "artist", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -65,6 +69,10 @@ "creatorType": "wordsBy", "firstName": "wordsByFirst", "lastName": "wordsByLast" + }, + { + "creatorType": "performer", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -112,6 +120,10 @@ "creatorType": "cosponsor", "firstName": "cosponsorFirst", "lastName": "cosponsorLast" + }, + { + "creatorType": "sponsor", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -153,6 +165,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -204,6 +220,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -269,6 +289,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -316,6 +340,10 @@ "creatorType": "counsel", "firstName": "counselFirst", "lastName": "counselLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "dateAdded": "2015-04-12T09:00:22Z", @@ -356,6 +384,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "programmer", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -413,6 +445,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -470,6 +506,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -529,6 +569,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -567,6 +611,10 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -617,6 +665,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -671,6 +723,10 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -707,6 +763,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -736,6 +796,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "contributor", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -780,6 +844,10 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -824,6 +892,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "interviewee", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -877,6 +949,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -925,6 +1001,10 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -972,6 +1052,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1016,6 +1100,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1060,6 +1148,10 @@ "creatorType": "seriesEditor", "firstName": "seriesEditorFirst", "lastName": "seriesEditorLast" + }, + { + "creatorType": "cartographer", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1112,6 +1204,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1157,6 +1253,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "inventor", + "name": "Institutional Author" } ], "dateAdded": "2015-04-12T09:00:22Z", @@ -1202,6 +1302,10 @@ "creatorType": "guest", "firstName": "guestFirst", "lastName": "guestLast" + }, + { + "creatorType": "podcaster", + "name": "Institutional Author" } ], "dateAdded": "2015-04-12T09:00:22Z", @@ -1235,6 +1339,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "presenter", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1293,6 +1401,10 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1343,6 +1455,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1383,6 +1499,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "dateAdded": "2015-04-12T09:00:22Z", @@ -1422,6 +1542,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1481,6 +1605,10 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1538,6 +1666,10 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1582,6 +1714,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", diff --git a/test/tests/data/translatorExport.js b/test/tests/data/translatorExport.js @@ -19,6 +19,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "artist", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -68,6 +72,10 @@ "creatorType": "wordsBy", "firstName": "wordsByFirst", "lastName": "wordsByLast" + }, + { + "creatorType": "performer", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -117,6 +125,10 @@ "creatorType": "cosponsor", "firstName": "cosponsorFirst", "lastName": "cosponsorLast" + }, + { + "creatorType": "sponsor", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -160,6 +172,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -213,6 +229,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -280,6 +300,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -329,6 +353,10 @@ "creatorType": "counsel", "firstName": "counselFirst", "lastName": "counselLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "dateAdded": "2015-04-12T05:45:15Z", @@ -371,6 +399,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "programmer", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -430,6 +462,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -489,6 +525,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -550,6 +590,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -590,6 +634,10 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -642,6 +690,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -698,6 +750,10 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -736,6 +792,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -767,6 +827,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "contributor", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -813,6 +877,10 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -859,6 +927,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "interviewee", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -914,6 +986,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -964,6 +1040,10 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1013,6 +1093,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1059,6 +1143,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1105,6 +1193,10 @@ "creatorType": "seriesEditor", "firstName": "seriesEditorFirst", "lastName": "seriesEditorLast" + }, + { + "creatorType": "cartographer", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1159,6 +1251,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1206,6 +1302,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "inventor", + "name": "Institutional Author" } ], "dateAdded": "2015-04-12T05:45:15Z", @@ -1253,6 +1353,10 @@ "creatorType": "guest", "firstName": "guestFirst", "lastName": "guestLast" + }, + { + "creatorType": "podcaster", + "name": "Institutional Author" } ], "dateAdded": "2015-04-12T05:45:15Z", @@ -1288,6 +1392,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "presenter", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1348,6 +1456,10 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1400,6 +1512,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1442,6 +1558,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "dateAdded": "2015-04-12T05:45:15Z", @@ -1483,6 +1603,10 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1544,6 +1668,10 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1603,6 +1731,10 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "name": "Institutional Author" } ], "date": "1999-12-31", @@ -1649,6 +1781,10 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "name": "Institutional Author" } ], "date": "1999-12-31", diff --git a/test/tests/data/translatorExportLegacy.js b/test/tests/data/translatorExportLegacy.js @@ -19,6 +19,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "artist", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -89,6 +94,11 @@ "creatorType": "wordsBy", "firstName": "wordsByFirst", "lastName": "wordsByLast" + }, + { + "creatorType": "performer", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -166,6 +176,11 @@ "creatorType": "cosponsor", "firstName": "cosponsorFirst", "lastName": "cosponsorLast" + }, + { + "creatorType": "sponsor", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -234,6 +249,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -305,6 +325,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -399,6 +424,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -477,6 +507,11 @@ "creatorType": "counsel", "firstName": "counselFirst", "lastName": "counselLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -544,6 +579,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "programmer", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -628,6 +668,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -715,6 +760,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -805,6 +855,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -864,6 +919,11 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -931,6 +991,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1016,6 +1081,11 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1079,6 +1149,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1128,6 +1203,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "contributor", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1198,6 +1278,11 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1258,6 +1343,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "interviewee", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1333,6 +1423,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1411,6 +1506,11 @@ "creatorType": "recipient", "firstName": "recipientFirst", "lastName": "recipientLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1480,6 +1580,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1549,6 +1654,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1617,6 +1727,11 @@ "creatorType": "seriesEditor", "firstName": "seriesEditorFirst", "lastName": "seriesEditorLast" + }, + { + "creatorType": "cartographer", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1697,6 +1812,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1768,6 +1888,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "inventor", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1842,6 +1967,11 @@ "creatorType": "guest", "firstName": "guestFirst", "lastName": "guestLast" + }, + { + "creatorType": "podcaster", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "dateAdded": "2015-04-26 06:40:48", @@ -1896,6 +2026,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "presenter", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -1974,6 +2109,11 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -2054,6 +2194,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -2123,6 +2268,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -2188,6 +2338,11 @@ "creatorType": "contributor", "firstName": "contributorFirst", "lastName": "contributorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -2273,6 +2428,11 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -2360,6 +2520,11 @@ "creatorType": "scriptwriter", "firstName": "scriptwriterFirst", "lastName": "scriptwriterLast" + }, + { + "creatorType": "director", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", @@ -2434,6 +2599,11 @@ "creatorType": "translator", "firstName": "translatorFirst", "lastName": "translatorLast" + }, + { + "creatorType": "author", + "fieldMode": 1, + "lastName": "Institutional Author" } ], "date": "1999-12-31", diff --git a/test/tests/quickCopyTest.js b/test/tests/quickCopyTest.js @@ -0,0 +1,36 @@ +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 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); + }) + + it("should handle a local host", 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); + }) + + it("should handle a chrome URL", function () { + assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('chrome://zotero/content/tab.xul'), quickCopyPref); + }) + }) +})