Commit graph

19 commits

Author SHA1 Message Date
Dan Stillman
c2ca70055c Merge branch 'electron' 2018-08-16 19:16:46 -04:00
Dan Stillman
bcf94942f9 Don't include "Zotero" in User-Agent sent to non-Zotero sites 2018-08-16 00:57:22 -04:00
Sylvester Keil
824e9c78d6
Move localeCompare tests to Zotero.Intl tests 2018-08-01 15:41:54 +02:00
Sylvester Keil
8e6896c27d
Move Zotero.getString() test to Zotero.Intl tests 2018-07-30 10:20:05 +02:00
Dan Stillman
4acd178819 Fix user-agent handling for faked UAs from connector 2018-05-15 20:18:41 -04:00
Dan Stillman
c7fd46e6b4 Don't ignore whitespace when sorting
Intl.Collator's ignorePunctuation ignores whitespace too, so stop using
it, since it produces much weirder results than sorting on punctuation does.
2017-11-16 01:17:24 -05:00
Dan Stillman
85776a99b2 Fix test 2016-12-11 02:55:47 -05:00
Dan Stillman
c61a9dc5f3 Localized plural form support for Zotero.getString()
Zotero.getString() now takes a third parameter, `num` (which should also
appear in `params`) to use when determining which plural form of the
string to use. Localized strings should include all forms in the order
specified in [1], separated by semicolons.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals
2016-12-11 02:30:34 -05:00
Dan Stillman
4c0abb6816 Point other profiles to new data dir after migration (+ code reorg)
Look for other profiles, from both apps (Firefox and Standalone), that
point to the data directory being migrated and update prefs.js in those
profiles to point to the new location.

Also reorganize code into Zotero.Profile and Zotero.DataDirectory
namespaces
2016-11-27 00:17:56 -05:00
Dan Stillman
412a7990b1 Don't perform automatic migration if there's an existing pipe
This prevents us from moving the data directory if the other app
(Firefox or Standalone) is running from the same directory.

Also clean up stub code in migration tests
2016-11-26 23:09:24 -05:00
Dan Stillman
acb1be97d0 More Travis debugging 2016-11-23 00:11:01 -05:00
Dan Stillman
935d48013b Travis debugging 2016-11-22 19:35:30 -05:00
Dan Stillman
ef3e098586 Migrate data directory automatically on macOS and Linux
If data directory is within the profile directory and we can move the
subdirectories instantaneously with /bin/mv, just do it silently at startup.
2016-11-22 02:33:05 -05:00
Dan Stillman
288d0c7c06 Create 'profile' and 'Zotero' directories in temp dir for tests 2016-11-22 01:45:07 -05:00
Dan Stillman
98e3a9addf Allow immediate retry on partial data dir migration failure
A common cause of this on Windows will likely be open attachment files,
so suggest closing those and make retrying the default action.
2016-11-21 05:19:18 -05:00
Dan Stillman
6c6a775be2 Fix migration tests in Fx45
`arguments` wasn't iterable until 46
2016-11-20 01:54:09 -05:00
Dan Stillman
249521f12b Enable debugging for Travis error 2016-11-20 01:40:39 -05:00
Dan Stillman
6d07cb44df Fix Travis errors due to broken DirectoryIterator 2016-11-19 18:52:10 -05:00
Dan Stillman
79700969e1 Data directory migration
This adds a new button to the Advanced prefs to migrate the data directory to
$HOME/Zotero. The button only appears if the data directory is set to the
default location within a profile directory (including the other program from
the one running, even though that's technically stored as a custom data
directory).

On Mac/Linux, directories within the data directory are moved with /bin/mv.  On
Windows, or if that fails, they're copied recursively using OS.File.move()
(which annoyingly doesn't reliably support directory moving). The former should
be instantaneous on most systems (unless the data directory or 'storage' were
on a different filesystem from $HOME).

If the database fails to transfer, migration fails and the data directory
setting remains on the old directory. If the database transfers but other files
fail, the data directory setting is updated. In both cases, the user is
encouraged to migrate remaining files manually with a button that reveals the
directories and quits the program.

This isn't yet tested on Linux or Windows, and migration isn't yet suggested
automatically.

Adds Zotero.File.reveal(), Zotero.File.directoryIsEmpty(), and
Zotero.File.moveDirectory().
2016-11-13 04:55:51 -05:00