Commit graph

5761 commits

Author SHA1 Message Date
Dan Stillman
06867d886e Fix note loading 2015-08-06 22:49:21 -04:00
Dan Stillman
536cd867d7 Fix toJSON for attachment items 2015-08-06 15:55:37 -04:00
Dan Stillman
f963413170 Handle conflict resolution for remote item deletions 2015-08-06 06:03:45 -04:00
Dan Stillman
51253fb933 Delete from sync cache when deleting object 2015-08-06 05:25:45 -04:00
Dan Stillman
b5b99672db Remove some obsolete sync code 2015-08-06 04:19:53 -04:00
Dan Stillman
0aecaad761 Update conflict resolution for API syncing
This will appear much less frequently, since non-conflicting field changes on
both sides can be resolved automatically, but genuine field conflicts still
require manual conflict resolution.

The merge pane is no longer editable, since the itembox code to do that is
async and can't run in a modal window, but it's not really necessary,
particularly with conflicts happening less frequently.

TODO:

- Remote item deletions
- File conflicts
- Maybe handle some edge cases where the conflicted items fail to save
2015-08-06 04:14:49 -04:00
Dan Stillman
7075300a17 Fix hasChanged() bug related to 'synced' 2015-08-02 05:26:02 -04:00
Dan Stillman
f02a9aa95e Check remote delete log during full sync
If an object is marked as synced locally and doesn't exist remotely but
is in the remote delete log, delete it locally
2015-08-02 03:44:14 -04:00
Dan Stillman
67f4a467ea Consolidate object erase methods into DataObjects::erase() 2015-08-02 03:40:14 -04:00
Dan Stillman
4600318ad7 Support 'successful' property in upload response
Save uploaded data to cache, and update local object if necessary (which
it mostly shouldn't be except for invalid characters and HTML filtering
in notes)

Also add some upload and JSON tests
2015-08-01 05:28:42 -04:00
Dan Stillman
70d9b9870c Fix a few small data layer bugs, and tidy up a little
I don't think these were triggered by any client code, but I found them while
porting code to the server.
2015-07-31 04:09:24 -04:00
Andrew Dunning
e6d1f31e46 Supply missing Œ/œ in diacriticsRemovalMap. 2015-07-21 18:08:16 -04:00
Dan Stillman
a452af6c3a Sort descendant collections alphabetically in advanced search window
https://forums.zotero.org/discussion/50679/
2015-07-21 00:45:30 -04:00
Dan Stillman
984789d304 API syncing megacommit
There's a lot more to do, and this isn't ready for actual usage, but the
basic functionality is mostly in place and has decent test coverage. It
can successfully upgrade a library last used with classic syncing and
pull down changes via the API. Uploading mostly works but is currently
disabled for safety until it has better test coverage.

Downloaded JSON is first saved to a cache table, which is then used to
populate other tables and later for generating PATCH requests and
automatically resolving conflicts (since it shows what was changed
locally and what was changed remotely). Objects with unmet dependencies
or unknown fields are skipped for now but don't block the rest of the
sync.

Some of the bigger remaining to-dos:

- Tests for uploading
- Re-do the preferences to get an API key
- File sync integration
- Full-text syncing integration
- Manual conflict resolution (though this already includes much smarter
  conflict handling that automatically resolves many conflicts)
2015-07-20 18:16:57 -04:00
Dan Stillman
b4a8083f2f Throw specific errors for missing objects or unknown fields
And add a bit more debugging info to other messages
2015-07-20 17:31:27 -04:00
Dan Stillman
258b70b455 Throw an error saving an empty item with no item type 2015-07-20 04:15:27 -04:00
Dan Stillman
cd4d084dd9 Support for automatically merging collections and searches 2015-07-20 02:12:14 -04:00
Dan Stillman
9d0d79c9c2 Take a promise-returning function in Utilities.Internal.forEachChunkAsync()
Instead of a promise-yielding generator
2015-07-20 02:12:14 -04:00
Dan Stillman
4f55f28e7d Honor .synced on data objects in all cases
Previously, if .synced was already true, setting it to true and saving
would result in .synced == false unless skipSyncedUpdate was passed. Now
the value assigned to .synced is always used on the next save. If the
value hasn't changed and no other values have changed, a save will be a
no-op.
2015-07-20 02:12:14 -04:00
Dan Stillman
93b5694420 Make editable/filesEditable required in Zotero.Libraries.add() 2015-07-20 02:12:14 -04:00
Dan Stillman
6c536fc784 Don't create Quick Start Guide item for new libraries
The default items cause problems with conflict resolution for existing
users (and not syncing them or ignoring conflicts for them is kind of
weird), and they require remote changes for new databases. I do like
there not being a completely empty library, but I think it's probably
better just to display a virtual welcome message with a link to the
Quick Start Guide somewhere else, such as in the right-hand pane. (A new
installation also opens the start page on zotero.org.)
2015-07-20 02:12:13 -04:00
Dan Stillman
d868f007e9 Don't select new groups in collections pane 2015-07-20 02:12:01 -04:00
Dan Stillman
5c523d8694 Merge branch '4.0' 2015-07-18 07:09:53 -04:00
Dan Stillman
7c9d25dad8 Fix excessive file sync mtime updates/checks?
Same as 1c2b2575f, but this time in code we actually still run
2015-07-18 04:58:10 -04:00
Dan Stillman
6a687e8c40 Fix "filename too long" sync error for missing files on OS X/Linux 2015-07-17 18:23:59 -04:00
Dan Stillman
a97e27a9f2 Fix CSS in snapshots of Reader View
Allow saving of CSS links over chrome://. We can scope this to
chrome://global/skin/aboutReader.css if anyone thinks of a reason why
this was disabled to begin with, but I'm not sure in what other
situations CSS it would apply.
2015-07-17 16:22:15 -04:00
rmzelle
d3ab296cf5 Check single items in selection window 2015-07-15 21:21:51 -04:00
Simon Kornblith
2c5bfd5d5a Disable disabling by reverse lookup on non-Mac/Windows/Linux
If this is the case, it's probably a BSD derivative, but I can't
guarantee the code won't segfault.
2015-07-13 19:28:37 -04:00
Simon Kornblith
f856df5222 Fix #460 using OS APIs 2015-07-13 19:24:26 -04:00
Simon Kornblith
7d87d70e92 Expose more integration pipe handling code
This should eventually reduce the amount of duplicated code needed to
handle Word 2016 for Mac
2015-07-12 13:46:55 -04:00
Aurimas Vinckevicius
d3bc1703c3 Update citeproc-js to 1.1.39
Re https://github.com/zotero/zotero/pull/794#issuecomment-120564983
2015-07-11 13:35:03 -05:00
Dan Stillman
bcef4819e8 Merge pull request #794 from aurimasv/citeproc-js-update
Update citeproc-js to 1.1.25
2015-07-10 19:53:09 -04:00
Dan Stillman
c72b112afd Use export.lastLocale before UI locale if none specified
This allows existing documents created before 4.0.27 with a
bibliographyLocale set to continue to use that value by default.

More details:

https://github.com/zotero/zotero/pull/795#issuecomment-120227051
2015-07-10 17:48:44 -04:00
Dan Stillman
b40c1d7e2e Remove redundant "Suppress Author" string
Refs #796
2015-07-10 15:56:25 -04:00
Aurimas Vinckevicius
9fcb87ca93 Remember style and locale when explicitly selected by the user 2015-07-09 23:38:25 -05:00
Aurimas Vinckevicius
b6c7ba6ea2 Fix saving style locale in documents 2015-07-09 23:38:25 -05:00
Dan Stillman
507ef011d8 Restore "without snapshot" option in Fx connector
Will be supported in upcoming Standalone release
2015-07-09 19:10:32 -04:00
Simon Kornblith
e92a54966c Restore ZoteroPane.destroy() on close
Seems like a good thing to do, if only because it ensures we persist
changes
2015-07-09 18:05:08 -04:00
Simon Kornblith
b931ca37d2 Undo accidental subproject commit change from 3420b4874a 2015-07-09 18:02:11 -04:00
Simon Kornblith
3420b4874a Tweaks for application menu on OS X
- Restore About Zotero item
- Fix Quit item
- Close Standalone when Standalone window is closed (we did this before,
  but apparently having our own hidden window breaks that mechanism)
2015-07-09 18:00:15 -04:00
Aurimas Vinckevicius
bf58de7e62 Update citeproc-js to 1.1.25
And split off Zotero additions
2015-07-09 16:31:57 -05:00
Simon Kornblith
b69e6fc3ab Fix Zotero menu on OS X, part 1
Create a hidden window with a menu bar, since it loads first
2015-07-09 16:52:04 -04:00
Aurimas Vinckevicius
3ca45be2c7 Add more debug logging for Recognize PDF 2015-07-08 12:50:10 -05:00
Dan Stillman
2a5b026f65 Wait for schema update before updating save icon
Technically rather than waiting for the schema update we should wait for
translator initialization, which should wait for the schema update
itself, but the schema update also needs to initialize the translators,
so avoiding a hang is tricky, particularly with the use of Zotero.lazy()
for Zotero.Translators.init(). For now, just wait for the schema update.
2015-07-07 17:39:06 -04:00
Dan Stillman
c590aa0eb4 Fix documentation for Zotero.DataObjects.getAsync() 2015-07-07 14:40:14 -04:00
Dan Stillman
5d9d8ae953 Fix passed 'window' property in Zotero.ProgressWindow
Though not currently used anywhere
2015-07-06 19:15:11 -04:00
Dan Stillman
b19cce1963 Fix issues with toolbar icons in multiple windows
Clicking the separate buttons would trigger actions in the first window
opened, and other things might not have been updating properly across
multiple windows.
2015-07-06 15:41:28 -04:00
Dan Stillman
238183a3fa Fix collapse library ("-") for collections
Broken in f5ce2d238e
2015-07-06 04:38:53 -04:00
Dan Stillman
41b772da4d Show the save button guidance panel again, now that it doesn't hide too easily 2015-07-06 00:49:35 -04:00
Dan Stillman
e3061289a5 Clarify main button guidance panel text
"Click here to open Zotero…" -> " Click the ‘Z’ button to open Zotero…"
2015-07-06 00:48:03 -04:00
Dan Stillman
db991743cd Trigger forward action with click anywhere on guidance panel
Previously, clicking directly on a noautohide guidance panel closed it, even if
there was a forward nav button. (In the case of the main and save button
guidance panels, the save button would appear on the next Firefox restart, but
this ensures that the save guidance panel will be shown to new users even if
they click on the panel instead of the not-particularly-noticeable forward
button.)
2015-07-06 00:46:36 -04:00
Dan Stillman
41fc082f6d Fix too-large icons in secondary toolbars on Linux
Plus a few other icon tweaks
2015-07-05 15:37:11 -04:00
Dan Stillman
0ba64b5194 Show guidance panel nav buttons on Linux 2015-07-05 12:58:36 -04:00
Dan Stillman
01716183d7 Prevent erroneous hiding of hideonpagechange guidance panels on complex pages 2015-07-04 17:09:26 -04:00
Dan Stillman
ebe08836e8 A little more Quick Copy safety 2015-07-03 23:53:43 -04:00
Dan Stillman
f07fe7184d Ignore trailing period in domain for Quick Copy
From @aurimasv
2015-07-03 23:46:39 -04:00
Dan Stillman
242581a270 Fix Quick Copy in tab mode, but for real 2015-07-03 22:06:12 -04:00
Dan Stillman
20f279043b Update submodules 2015-07-03 02:09:27 -04:00
Dan Stillman
208b4daf6e Update locales from Transifex 2015-07-03 02:06:59 -04:00
Dan Stillman
9d2b097605 Fix toolbar icons in non-nav-bar toolbars on OS X and Windows
...which only required redoing the entire styling.

Not yet done on Linux
2015-07-02 05:50:57 -04:00
Simon Kornblith
50ee61545a Kill code to ensure that our pipe is open before we write to the other
In practice, this appears to be both unnecessary and harmful. Although
the first write happens effectively instantaneously, we can take
several hundred milliseconds to read the second write, and Standalone
can decide we are dead.

This apparently fixes #783 for @dstillman, although I was never able to
reproduce locally.
2015-07-01 20:40:28 -04:00
Simon Kornblith
d104e4b106 More debugging for #783 2015-07-01 20:01:00 -04:00
Dan Stillman
15a0a33ac1 Fix Quick Copy in tab mode 2015-07-01 19:36:16 -04:00
Simon Kornblith
9574de752d Debugging for #783 2015-07-01 14:46:06 -04:00
Dan Stillman
7ccc48b4ae Don't show "without snapshot" save option in Fx connector for now
Option requires a new Standalone build with ba53f256d
2015-07-01 02:38:15 -04:00
Dan Stillman
ba53f256d6 Quick hack to fix "without snapshot" save option in Z4Fx via Standalone
(I don't see any obvious reason I can't do this. We should probably clean this
up later, not call the endpoint "saveSnapshot", etc. Also, is there a reason it
doesn't follow the snapshot pref by default?)
2015-07-01 01:03:04 -04:00
Dan Stillman
3cf1c3ccda Merge locales from Transifex 2015-06-30 23:41:48 -04:00
Dan Stillman
39f2021576 Include web page save option in toolbar menu on every page
Closes #644 and #775
2015-06-30 23:41:47 -04:00
Simon Kornblith
43e1c5c123 Fix setCookiesThenSaveItems in Firefox connector 2015-06-30 19:20:16 -04:00
Dan Stillman
796fb87a9b Fix some toolbar icon issues on HiDPI Linux 2015-06-30 17:58:32 -04:00
Dan Stillman
6841be09a1 Fix large save icon on HiDPI Windows, hopefully 2015-06-30 17:08:45 -04:00
Aurimas Vinckevicius
5334a09ee0 Fix institutional author export to CiteProcJS 2015-06-29 23:22:09 -05:00
Simon Kornblith
48e6eb93de Merge pull request #779 from aurimasv/proper-to-proxy
Fix properToProxy converter functions
2015-06-29 22:27:15 -04:00
Aurimas Vinckevicius
b03dcd3686 Fix properToProxy converter functions
Regression from 82998e986e and 9450d0797f
2015-06-29 17:55:10 -05:00
Simon Kornblith
64ff0e8b4e Fix #774 2015-06-29 18:03:09 -04:00
Dan Stillman
5545ea7847 Merge locales from Transifex 2015-06-29 07:12:55 -04:00
Dan Stillman
6c416e7ad2 Get rid of middle border radius in combo button on Windows 2015-06-29 07:06:20 -04:00
Dan Stillman
a9c6feb380 Additional toolbar overflow tweaks for Linux
Follow-up from 1d6483e68
2015-06-29 06:35:23 -04:00
Dan Stillman
1d6483e68a Fix #773, Zotero combo icons dispersed under more tools
And fix save button hover height on Windows, which somehow got out of
whack again.

Might need further tweaking on Linux

Need to find a better way to do these buttons...
2015-06-29 05:59:19 -04:00
Dan Stillman
ddf3ff9ba9 Don't try to set lastLocale pref in doc prefs unless locale was changed 2015-06-28 17:16:33 -04:00
Dan Stillman
99dd1c0697 Merge branch '4.0'
Since modal windows (e.g., the Create Bib window and the Quick Copy site
editor window) can't use yield, style retrieval
(Zotero.Styles.getVisible()/getAll()) is now synchronous, depending on a
previous async Zotero.Styles.init(). The translator list is generated in
the prefs window and passed into the Quick Copy site editor, but it's
possible the translators API should be changed to make getTranslators()
synchronous with a prior init() as well.
2015-06-27 16:59:58 -04:00
Dan Stillman
3a5854f49f Update versions and submodules 2015-06-26 02:40:18 -04:00
Dan Stillman
dd146557b7 Merge non-English strings 2015-06-26 02:13:24 -04:00
Dan Stillman
4868095820 Guidance panel for new save icon
For new installations, a panel will show for the Z icon with a ">"
button to go to a second panel for the save icon. For existing
installations, a panel will show just for the save icon. In both cases,
the panels are non-auto-hiding but are dismissed if clicked on or when a
new content page is loaded.

There's also a new close button, but it's not enabled currently. Might
be useful for panels with embedded links where an accidental click on
the panel alone shouldn't close the panel (like the Firefox customize
mode wizard).
2015-06-25 22:51:05 -04:00
Dan Stillman
a909951106 Merge locales from Transifex 2015-06-24 14:41:43 -04:00
Dan Stillman
233b9991f5 Merge pull request #623 from rmzelle/locale-selector
Add drop-down menu for bibliographyLocale
2015-06-24 14:34:47 -04:00
Aurimas Vinckevicius
6ac0403049 Reorganize and improve locale drop-down code 2015-06-24 14:10:33 -04:00
Dan Stillman
42673cb0a2 Merge non-English strings 2015-06-24 06:24:25 -04:00
Dan Stillman
dfb28ff3f6 File Issues: Greatest Hits, 2006-2015
- When relinking a missing stored file, copy it into the attachment's
  storage directory automatically
  - Previously, selecting a file outside the attachment subdir would
    just result in a missing attachment, since it only looks for stored
    files within the subdir
- Display an error message if a Windows shortcut (.lnk) is added via
  drag-and-drop or via a file dialog on non-Windows systems, until we
  can figure out how to determine the original file
  - Shortcuts can cause errors during syncing, for unclear reasons
  - Neither nsIFile::copyToFollowingLinks() nor nsIFile::target work for
    me to get the original file, even when nsIFile::isSymlink() returns
    true
  - Windows file dialogs seem to automatically resolve shortcuts, so
    it's only an issue there for drag-and-drop
- Disallow hidden files from being selected in relink dialog
  - I think some people on Windows with hidden files shown relink the
    .zotero* files that show up when they click Locate, which causes
    file sync errors. Which brings us to...
- Fix file sync errors for *.lnk and .zotero* files
- Ignore existing .zotero* attachment files, treating the files as
  missing instead to encourage relinking
- Strip leading period in getValidFileName() to prevent added files from
  being hidden
    - This allows hidden files to be added explicitly; they just won't
      stay that way in the storage directory

(These things should have tests, but that will have to happen on the 5.0
branch.)
2015-06-24 06:10:48 -04:00
Dan Stillman
0d1d4ee5cb Don't change selection unnecessarily when creating trashed item 2015-06-23 16:56:10 -04:00
Dan Stillman
27f6f018d3 Remove Zotero.suppressUIUpdates
Now handled by notifier flags
2015-06-23 16:31:40 -04:00
Dan Stillman
12bea4b7ea Notifier observer time logging 2015-06-23 16:03:05 -04:00
Dan Stillman
3ff1ff88a9 A couple search query optimizations
...which make very little difference, but they look better in the SQLite
query plan view.
2015-06-23 15:07:57 -04:00
Dan Stillman
33dedd1753 Tags overhaul [DB reupgrade]
- Simplified schema
- Tags are now added without reloading entire tag selector
  - On my system, adding 400 tags to an item (separately, with the tag
    selector updating each time) went from 59 seconds to 42. (Given that
    it takes only 13 seconds with the tag selector closed, though,
    there's clearly more work to be done.)
- Tag selector now uses HTML flexbox (in identical fashion, for now, but
  with the possibility of fancier changes later, and with streamlined
  logic thanks to the flexbox 'order' property)
- Various async fixes
- Tests
2015-06-23 05:21:58 -04:00
Dan Stillman
0511d37b07 Replace multiple spaces in platform names for full-text searches
Closes #770
2015-06-22 11:51:20 -04:00
Dan Stillman
a5403b7499 Always include 'note' property in item JSON for notes in 'new' mode 2015-06-19 16:00:51 -04:00
Dan Stillman
3f475f25b6 Include remotely added properties in relations diffs 2015-06-19 04:07:46 -04:00
Dan Stillman
2e76fd6584 Add Zotero.DataObjectUtilities.getTypes() 2015-06-19 04:04:56 -04:00
Dan Stillman
7ba54886a6 Add toJSON() for searches and make Collection::toJSON() async 2015-06-19 04:04:33 -04:00
Dan Stillman
79733c75f1 Throw error in Item::fromJSON() if itemType not provided and not set 2015-06-17 01:57:57 -04:00