Groups were already being loaded for the collections list, so we might
as well just store them initially and let Zotero.Libraries.getName() be
a synchronous call.
- Moved ::_get() and _set() from Collection/Search into DataObject, and
disabled in Item
- Don't disable new items after save. We now put new objects into the
DataObjects cache from save() so that changes made post-save are
picked up by other code using .get().
- Added 'skipCache' save() option to avoid reloading data on new objects
and adding them to the cache. (This will be used in syncing, where
objects might be in another library where they're not needed right
away.) Objects created with this option are instead disabled to
prevent reuse.
- Modified some tests to try to make sure we're reloading everything properly
after a save.
- Documented save() options
- Fixes some saving and erasing issues with collections and searches
- Adds Zotero.DataObject::eraseTx() to automatically start transaction,
and have .erase() log a warning like .save()
- Adds createUnsavedDataObject() and createDataObject() helper functions
for tests
The sync cache will have pristine copies of the existing versions of
local objects for better conflict resolution, but downloads will get
saved to the sync cache first before processing, so the cache needs to
be able to hold more than one version.
Replace Z.DataObjects::diff() with Z.DataObjectUtilities.diff(). Instead
of just returning two objects with the differing fields, the new diff()
generates a changeset with operations to apply with applyChanges(),
including at the array member level for collections and tags. This,
combined with cached pristine copies of objects, will allow for vastly
better conflict resolution, with automatic merging of non-conflicting
changes.
Creators currently don't show granular changes, and ordering might make
it too tough to do so. Relations diffing isn't yet implemented.
Also:
- Make .mode == 'patch' optional if .patchBase is provided.
- Remove requirement for item to be unchanged, which hopefully wasn't there for
a good reason
- Add a few tests, though more are needed
This allows calling code to do something other than call Zotero.debug()
on errors (like, say, nothing, in order to avoid logging certain
expected errors) before throwing.
Store and check the last selected items in ZoteroPane.itemSelected() to
see if it's necessary to refresh the item pane. This prevents loss of
textbox focus if another write occurs while editing a field.
Also optimize row adding/removing in itemTreeView.js
Fix a couple cases of lost text field focus after an edit, including
focusing of the Title field after using New Item when a field is already
being edited and has a changed value.
Also, in tests, select My Library and wait for items to load when using
the loadZoteroPane() support function. We could add a parameter to skip
that or move it to a separate function, but the code to detect it is a
bit convoluted and it's a prerequisite for many tests, so it's handy to
have a function for it.
If a new item is created manually when a text field is already open, the
hideEditor is run first on the html:textarea before bubbling up to the
textbox. During a normal blur, the event only happens on the textbox,
though I haven't looked into the reason for the difference.
- Add an 'exclusive' option to transactions that causes them to block other
transactions and wait for other transactions to finish before starting,
instead of nesting
- Resolve Zotero.DB.waitForTransaction() promise before returning from
executeTransaction()
- A side effect of the above: wait for a newly created item to be selected in
the middle pane and rendered in the right-hand pane before returning from
executeTransaction()
- Don't save items multiple times when adding/removing a non-final creator in
the Info pane
- Use a simpler, non-recursive method for focusing the next field in the Info
pane; this prevents "too much recursion" errors if something causes the
right-hand pane not to be rendered when expected
This fixes an issue where two transactions started around the same time
could run separately instead of nesting, causing the statements from one
to end up running not within a transaction
And use 'version' instead of 'itemVersion' for object version for items
Also add deferred foreign key checking to system.sql so that DROP TABLE
commands don't fail mid-transaction
Show a wizard after items are dragged to My Publications choosing
whether to include files and notes and choosing sharing settings for the
items. Sharing options are Creative Commons licenses, CC0, "All rights
reserved", or keeping the existing Rights field if available.
Also blocks collections, searches, linked file attachments, and
top-level attachments/notes from My Publications at the data layer, but
not yet from the UI in all places (so it can crash if you try).
Todo:
- Block certain UI actions with nice messages
- Show a nice scrollable list of items in the wizard to allow selecting
specific files/notes, instead of just having checkboxes for files and
notes that apply to all dragged items
- Show an explanation of My Publications in the right-hand pane when no
items are selected
- Maybe adjust handling when no attached files/notes, since it might be
a bit alarming at the moment to see sharing options for metadata
entries
Previously, object identifiers were registered in a commit callback, but that
meant that they wouldn't be available to getLibraryAndKeyFromID/
getIDFromLibraryAndKey within a transaction. Instead, register them before
saving and clear them in a tranasction rollback if necessary.
This changes Zotero.DataObject to call its own _finalizeSave() in addition to a
descendent one.
Object contains 'libraryID' and 'key' properties
This is due to changed array destructuring behavior in Firefox. Previously,
`var [foo, bar] = maybeArrayMaybeFalse()` always worked, leaving foo and bar
undefined if the function returned false. Now (with ES6, I assume), if the
function returns false it results in a "false[Symbol.iterator] is not a
function" error. But `var {libraryID, key} = false` works as expected, leaving
both values undefined, so instead we can just return an object with those
properties from getLibraryAndKeyFromID(). To assign to different variables, use
`var {libraryID, key: parentItemKey} = ...`.
Search condition ids are now indexed from 0, and always saved
contiguously (no more 'fixGaps' option), since they're just in an array
in the API. (They're still returned as an object from
Zotero.Search.prototype.getConditions() because it's easier for the
advanced search window to not have to deal with shifting ids between
saves.)
Also:
- Return an object from `Zotero.Search.prototype.getConditions()`
instead of an array.
- Add support function `getPromiseError(promise)` to return the error
thrown from a chain of promises, or false if none. (We could make an
`assert.throwsAsync()`, but this allows testing of various properties
such as `.name`, which even the built-in `assert.throws()` can't
test.)
- Clarify some search save errors
'b' for *b*undled files
Translators and styles take a long time to install and initialize in
source installations, and they're unnecessary for many tests.
This shaves about 10 seconds off each test run for me on one system (and
that's with some help from filesystem caching).
This is just a wrapper around nsIPromptService.alert() that takes
Zotero.noUserInput into consideration, which avoids long timeouts during
testing (e.g., for lookup failures).
Previously, getItemURI and getCollectionURI had to check the libraryID
to determine whether to return a local URI, and were doing so using an
obsolete check.
To deal with issues running .vbs scripts on some systems. If the 3.02
binaries haven't been reinstalled since this version, reinstall them as
3.02a automatically or on manual upgrade to fix corrupted binaries from
previous gzip issue.
Other platforms unchanged
Previously, if an editor was entered before an author, it would sort by
the editor. Now, as long as there's an author, it will sort by that
first (and, with 2f3d865f, favor left-bound matches).
Addresses the second issue on
https://forums.zotero.org/discussion/48047/
Courtesy of Pastel SVG (2x famfamfam)
I didn't add 2x versions for any composite icons or any Fugue icons.
Also:
- Removed some unused/redundant images
- Switched to shadowless versions for a couple Fugue icons
Use stdout redirection scripts for pdfinfo and, on Windows, a script to
run pdftotext hidden, which together allow for all unmodified binaries
(including, probably, symlinked system ones, though I didn't test that).
On Windows, using a .vbs does cause a brief wait cursor. The stock
pdfinfo needs the redirection script anyway, so that's unavoidable, but
on the async branch I think we'll be able to switch to pdf.js for the
page count, at which point maybe I'll try to remember how I modified the
Windows binaries to be hidden and use a modified version of pdftotext to
avoid VBScript. (We use the stock pdftotext elsewhere already.)
If automatic translator/style updates are enabled, at least one of the
PDF tools is installed, and the repo returns a more recent version
number than what's installed, automatically upgrade the tools. (Version
3.02 counts as lower, since Poppler's version numbers are lower.)
If an error occurs, wait increasing amounts of time to try the downloads
again, up to one week.
Fixes regression from 37921b0910
cleanISBN/ISSN now return first valid ISBN/ISSN from a list of valid/invalid ISBNs/ISSNs, even if invalid ISBN/ISSN comes first
toISBN13 now corrects the check digit for ISBN13 input
It turns out that the Cygwin console, unlike -console, is actually
usable, so developers on Windows can use that. Since we sometimes need
real-time debug output from end users (who won't have Cygwin installed),
keep logging to the Browser Console if only the -ZoteroDebug flag is
passed.
- Use async DB and OS.File for bundled file updates
- Remove support for translator/style ZIP files -- the two options are
now non-unpacked XPIs with subfolders or unpacked source installations
- Now that we have async file access, don't store translator code in
database cache -- just store metadata so that it's available without
reading each translator file
- Change the (previously partially asyncified) Zotero.Styles/Translators
APIs a bit -- while the getAll/getVisible methods are asynchronous and
will wait for loading, the get() methods are synchronous and require
styles/translators to be initialized before they're called. Most
places that end up calling get() probably call getAll/getVisible first
and should therefore be async, but if there's any way to trigger a
get() first, that will need to be adjusted.
- Asyncify various other style/translator-related code
XPI support is untested, as is style/translator usage, so there are
almost certainly bugs. The latter depends on updated export format
support (#659), since toArray() no longer exists on this branch.
Addresses #529 and #520
I don't think there's any way for this to happen short of manual
preference editing, and the pane width would have to be exactly 250px,
and it's pretty harmless anyway, but might as well be safe.
There are hundreds more, but these are all the ones that generate warnings in
the console at startup. XPCOM/XBL ones don't seem to do so, so we can ignore
those for now (and hopefully not bother with them on 4.0). Instances in
translators do generate warnings.
Addresses #656
Note that this loses conflicting changes to translate_item.js from 849803473a,
so those will need to be reapplied if applicable. /cc @aurimasv, @mtd91429
Adds a "My Publications" source after "My Library", implemented as a
separate library. Top-level items can be dragged in and removed.
(This doesn't currently work without disabling Quick Copy.)
Also:
- Make "Group Libraries" an unselectable header instead of a container,
and don't indent group libraries
- Fix relation purging, which maybe never worked
- Pass only libraryID/key on deletes (which should speed them up)
- Fix async item cloning/copying
- Fix miscellaneous other bugs
To-do:
- Confirmation dialog on drag
- API support
0 allowed for some accidental behavior due to old code expecting NULL,
and it prevented easy checks (``if (!libraryID)``) for a passed
libraryID. Code now uses Zotero.Libraries.userLibraryID instead of a
hard-coded value (except in schema.js). Functions can still make
libraryID optional, but they should then use
Zotero.Libraries.userLibraryID if that's to mean the user library.
There might be some code that still expects 0 that I missed.
[and delete unused "#zotero-prefpane-keys checkbox" (there used to be a checkbox to "Try to override conflicting shortcuts", which has been definely removed by 5b34dce40f )]
- New dedicated Zotero button, available in the Customize palette
- Remove "16px" Z SVG and just render "32px" one at the smaller size
(there's a slight difference at the edges, but we should probably redo
it anyway so that dark lines reach all the way to the bottom)
- Change "Open Zotero" back to just "Zotero", since 1) it's for closing
too, 2) it can also just bring Standalone to the front, and 3) "Open
Zotero" looks weird and inconsistent in the menu panel next to things
like "Preferences"
- For now, show single large Z for combo buttons in customization
palette with "Zotero (Combo)", though we can probably do something
better.
- Fix some HiDPI bugs when moving items between areas
Still need a layout for the panel for the combo buttons
Previously, if you dragged a standalone attachment to a collection in another
library where the item already existed as a child item, it would crash Zotero
on a collection-item constraint.
Known issues:
- Hover doesn't work on the dropmarker alone, so instead of showing the
hover effect for each segment individually, the menu-button parts are
highlighted together, which at least looks like a choice
- When the menu-button is disabled, it still has some hover/active
effects.
- Tested only on Windows 7
The address bar icon now lives in a new combo buttonset containing the main Z, "Save to Zotero", and a dropmarker for the former save-icon right-click menu (which we could conceivably use more heavily going forward now that it's more accessible). There's also a separate dedicated Save to Zotero (+ dropmarker) button, not shown by default, that can be swapped in for people who don't want the Z.
The tooltip for the save icon also now shows the keyboard shortcut (though that unfortunately makes for a lot of parentheses).
Known issues:
- Untested on ESR
- Untested on Linux
- Might need refinement on Windows
- Weird 1px horizontal area at bottom of save button that highlights dropmarker (at least on OS X)
- Probably needs a third button option with just the Z icon so that the main button and the save button can be placed separately (e.g., save button in toolbar, Z in panel)
- Combo buttonset needs an inactive single-icon state for the palette and either needs a state for the panel (which might need to span all three columns?) or if possible should just move the other two icons in and put itself back in the palette
- The absurd amount of time and CSS it took to get the toolbar icons looking right on OS X, since apparently no one has put a menu-button inside a combined toolbar button before
- Add high-res webpage icon
- Show webpage icon in grayscale when no translator (except on hover, for fun)
- Remove pre-Australis icons
- Switch to CustomizableUI API for toolbar icon
- Move icon generation code to separate file
- Add Zotero.hiRes flag for Retina/etc. displays (available only after a window
has loaded)
Known issues:
- While the gray is mostly to be less distracting, the gray/color distinction
will probably be lost on most people. A separate guidance panel for the gray
icon might help.
- On pages with frames, the webpage icon appears first and then is replaced
with a translator icon.
The icon now will save using a translator if possible and otherwise fall back
to creating a web page item. This also removes the "Create Web Page Item from
Current Page" button.
Let's see how this feels. (Pushing it to the beta so more people can try it.) I
think we ultimately should do this, but my main concern with this
implementation is that it's just too distracting, since the icon disappears and
reappears on every page. A persistent, possibly monochrome icon that was just
sometimes disabled (as is the case for the Firefox bookmark toolbar icon) might
be better.
Regardless of the approach, there are some follow-up tweaks that should be made:
- The same thing in the connectors
- Context-menu options
- Different icons and descriptions for different file types (PDF, image)?
- Adjust guidance text? Have separate guidance panels for web vs. translation?