diff --git a/.gitmodules b/.gitmodules index 5000d9dc7..4eac6535f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,9 @@ [submodule "styles"] path = styles url = git://github.com/zotero/bundled-styles.git +[submodule "test/resource/chai"] + path = test/resource/chai + url = https://github.com/chaijs/chai.git +[submodule "test/resource/mocha"] + path = test/resource/mocha + url = https://github.com/mochajs/mocha.git diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..4e0365777 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: cpp +compiler: + - gcc +env: + matrix: + - FIREFOXVERSION="36.0.1" + - FIREFOXVERSION="31.5.0esr" +notifications: + email: false +before_install: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - wget http://ftp.mozilla.org/pub/firefox/releases/${FIREFOXVERSION}/linux-x86_64/en-US/firefox-${FIREFOXVERSION}.tar.bz2 + - tar -xjf firefox-${FIREFOXVERSION}.tar.bz2 +script: + - test/runtests.sh -x firefox/firefox diff --git a/README.md b/README.md index 20183b735..b2c479cb4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ Zotero ====== +[![Build Status](https://travis-ci.org/zotero/zotero.svg?branch=4.0)](https://travis-ci.org/zotero/zotero) Zotero is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources. diff --git a/chrome/content/zotero-platform/mac/overlay.css b/chrome/content/zotero-platform/mac/overlay.css index 6d0d9eeee..ee9a7839d 100644 --- a/chrome/content/zotero-platform/mac/overlay.css +++ b/chrome/content/zotero-platform/mac/overlay.css @@ -1,3 +1,94 @@ +/* + 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. +*/ +#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 { + box-shadow: none; +} + +#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; +} + +#zotero-toolbar-main-button[cui-areatype="toolbar"] { + margin-right: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + padding-right: 2px; + padding-left: 2px; +} + +#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; + border-left: 0 solid transparent; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button { + min-width: 26px; + padding-left: 1px; + 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 { + border-width: 1px; + border-style: solid; + border-color: var(--toolbarbutton-hover-bordercolor) !important; + box-shadow: var(--toolbarbutton-hover-boxshadow) !important; + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +#zotero-toolbar-buttons[cui-areatype="toolbar"]: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 { + border-right: 1px solid transparent; +} + +#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker { + border-left: 1px solid transparent; +} + +#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > .toolbarbutton-menubutton-dropmarker { + background: inherit; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] > .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 { + border-left: 0 solid transparent; +} +#zotero-toolbar-buttons[cui-areatype="toolbar"]: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; +} +/* End toolbar icons */ + #zotero-splitter { border-top: none; @@ -255,10 +346,8 @@ background-color: #8b8b8b !important; } -#zotero-collections-splitter[state=collapsed], #zotero-items-splitter[state=collapsed] -{ - border-right: 1px; - border-color: #A5A5A5; +#zotero-collections-splitter[state=collapsed], #zotero-items-splitter[state=collapsed] { + border: 0 solid #d6d6d6 !important; max-width: 8px !important; min-width: 8px !important; width: 8px !important; @@ -267,6 +356,14 @@ padding: 0; } +#zotero-collections-splitter[state=collapsed] { + border-right-width: 1px !important; +} + +#zotero-items-splitter[state=collapsed] { + border-left-width: 1px !important; +} + #zotero-collections-splitter[state=collapsed] > grippy, #zotero-items-splitter[state=collapsed] > grippy { -moz-appearance: none; diff --git a/chrome/content/zotero-platform/unix/overlay.css b/chrome/content/zotero-platform/unix/overlay.css index 749487b2e..5518adfb4 100644 --- a/chrome/content/zotero-platform/unix/overlay.css +++ b/chrome/content/zotero-platform/unix/overlay.css @@ -1,3 +1,98 @@ +/* + As of Fx36, the built-in styles don't properly handle a menu-button within combined buttons. +*/ +#zotero-toolbar-main-button[cui-areatype="toolbar"] { + margin-right: -1px; +} + +#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { + width: 28px !important; + margin-left: 2px; + margin-right: -3px; + padding-left: 5px !important; + padding-right: 5px !important; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { + width: 30px !important; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button { + padding-left: 0; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button .toolbarbutton-icon { + padding-left: 6px !important; + padding-right: 6px !important; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker { + margin-top: 2px; + margin-bottom: 2px; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker .dropmarker-icon { + padding-left: 14px !important; + padding-right: 3px !important; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker { + margin-top: 6px; + margin-bottom: 6px; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"]:hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon, +#zotero-toolbar-save-button[cui-areatype="toolbar"][open] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { + margin-top: 0; + margin-bottom: 0; +} + +#zotero-toolbar-buttons[cui-areatype="toolbar"] > separator { + /* Copied from .toolbarbutton-menubutton-dropmarker::before */ + display: -moz-box; + width: 1px; + height: 18px; + -moz-margin-end: -1px; + background-image: var(--toolbarbutton-combined-backgroundimage); + background-clip: padding-box; + background-position: center; + background-repeat: no-repeat; + background-size: 1px 18px; + 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 { + 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 { + background: inherit; +} + +#zotero-toolbar-buttons[cui-areatype="toolbar"] > #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 { + 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 { + background: var(--toolbarbutton-active-background); + border-color: var(--toolbarbutton-active-bordercolor); + box-shadow: var(--toolbarbutton-active-boxshadow); + transition-duration: 10ms; +} + +#zotero-toolbar-main-button-single[cui-areatype="toolbar"] .toolbarbutton-icon { + width: 32px; +} +/* End toolbar buttons */ + + .zotero-tb-button:not([type=menu]) { margin-right: 4px; } diff --git a/chrome/content/zotero-platform/win/overlay.css b/chrome/content/zotero-platform/win/overlay.css index 5a384e911..73eb1ff8b 100644 --- a/chrome/content/zotero-platform/win/overlay.css +++ b/chrome/content/zotero-platform/win/overlay.css @@ -1,3 +1,105 @@ +/* + As of Fx36, the built-in styles don't properly handle a menu-button within combined buttons. +*/ +#zotero-toolbar-main-button[cui-areatype="toolbar"] { + margin-right: -1px !important; +} + +#zotero-toolbar-main-button[cui-areatype="toolbar"] .toolbarbutton-icon { + width: 28px; + margin-left: 2px; + margin-right: -1px; + padding-left: 5px !important; + padding-right: 5px !important; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-icon { + padding-left: 6px !important; + padding-right: 6px !important; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker .dropmarker-icon { + padding-left: 5px !important; + padding-right: 4px !important; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] .toolbarbutton-menubutton-button { + margin-left: -2px !important; +} + +#zotero-toolbar-buttons[cui-areatype="toolbar"] > separator, +#zotero-toolbar-buttons[cui-areatype="toolbar"] > #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; +} + + +#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; +} + +#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 { + 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 { + 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 { + box-shadow: none; +} + +/* + 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, +/* + 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 { + 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 { + 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); + transition-duration: 10ms; +} + +#zotero-toolbar-save-button[cui-areatype="toolbar"] > menupopup { + margin-top: -5px; +} + +#zotero-toolbar-main-button-single[cui-areatype="toolbar"] .toolbarbutton-icon { + width: 32px; +} +/* End toolbar buttons */ + #zotero-tb-search-menu-button { margin: 0 -1px 0 -4px; border: 0; diff --git a/chrome/content/zotero/attachLink.xul b/chrome/content/zotero/attachLink.xul index fd899a8bd..4e39dc7c3 100644 --- a/chrome/content/zotero/attachLink.xul +++ b/chrome/content/zotero/attachLink.xul @@ -14,7 +14,7 @@ > + - - -