Commit graph

58 commits

Author SHA1 Message Date
Dan Stillman
255320656f Fix extended characters in reports (since 5236d01791) 2017-01-26 01:53:27 -05:00
Dan Stillman
5236d01791 Fix mangled large reports
https://forums.zotero.org/discussion/64022/5-0-beta-generate-report-is-often-garbled

Records are being truncated, though I'm not sure why. But just read the input
stream into a string for now.
2017-01-21 06:33:36 -05:00
Tom Najdek
54a2126b7d Remove non-standard syntax for conditional exception handling 2016-12-21 08:04:57 -05:00
Tom Najdek
269e2f8bff Replace legacy syntax for each...in with for...of 2016-12-21 08:04:09 -05:00
Dan Stillman
b109279a17 Avoid errors for some invalid requests viewing attachments 2016-05-13 15:45:51 -04:00
Dan Stillman
72c8711cd3 String::contains() -> indexOf() for Firefox 48 (and 38) compatibility
.contains() was removed in Firefox 48, but .includes() wasn't available until
40, so use indexOf() for now. We can start using .contains() once we no longer
need to support 38 ESR.
2016-05-03 12:08:38 -04:00
Dan Stillman
9fea9608f6 Disable debug output for AsyncChannel loading 2016-04-16 16:51:51 -04:00
Dan Stillman
1c92fe3268 Fix getFile() deprecation warning for zotero://attachment URLs 2016-04-16 16:50:27 -04:00
Dan Stillman
79504df5f8 Remove "/report.html" in report URLs
Firefox saves as Zotero Report.html (localized) without it, which is
fine.
2016-04-12 18:59:46 -04:00
Dan Stillman
daf4a8fe4d Deasyncification 🔙 😢
While trying to get translation and citing working with asynchronously
generated data, we realized that drag-and-drop support was going to
be...problematic. Firefox only supports synchronous methods for
providing drag data (unlike, it seems, the DataTransferItem interface
supported by Chrome), which means that we'd need to preload all relevant
data on item selection (bounded by export.quickCopy.dragLimit) and keep
the translate/cite methods synchronous (or maintain two separate
versions).

What we're trying instead is doing what I said in #518 we weren't going
to do: loading most object data on startup and leaving many more
functions synchronous. Essentially, this takes the various load*()
methods described in #518, moves them to startup, and makes them operate
on entire libraries rather than individual objects.

The obvious downside here (other than undoing much of the work of the
last many months) is that it increases startup time, potentially quite a
lot for larger libraries. On my laptop, with a 3,000-item library, this
adds about 3 seconds to startup time. I haven't yet tested with larger
libraries. But I'm hoping that we can optimize this further to reduce
that delay. Among other things, this is loading data for all libraries,
when it should be able to load data only for the library being viewed.
But this is also fundamentally just doing some SELECT queries and
storing the results, so it really shouldn't need to be that slow (though
performance may be bounded a bit here by XPCOM overhead).

If we can make this fast enough, it means that third-party plugins
should be able to remain much closer to their current designs. (Some
things, including saving, will still need to be made asynchronous.)
2016-03-07 17:03:58 -05:00
Dan Stillman
ec72dd3909 Fix debug output viewing 2016-01-04 15:48:56 -05:00
Dan Stillman
f6e0b8a8b0 Fix error in Zotero protocol handler when viewing snapshots 2015-12-30 05:14:51 -05:00
Adomas Venčkauskas
2de0ed7871 Recognizes and opens files even without extensions.
Closes #842
Also:
Changes AsyncChannel to be a coroutine.
2015-11-20 16:14:55 +00:00
Dan Stillman
32abbe7c25 Load groups at startup, and make Zotero.Groups functions synchronous
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.
2015-05-22 04:52:05 -04:00
Dan Stillman
293f7c6dd4 Zotero.Search.prototype.addCondition() doesn't need to be async 2015-04-16 20:48:59 -04:00
Dan Stillman
828f3f5024 Fix report generation 2015-03-17 00:05:08 -04:00
Dan Stillman
1c8abf3841 Change user library from 0 to 1
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.
2015-03-16 12:16:05 -04:00
Dan Stillman
e2d3cc3f0d Update zotero://select to use new URLs and wait for items list load
Closes #541
2014-09-23 01:13:38 -04:00
Dan Stillman
755ead2119 Update zotero:// extensions (report, timeline, etc.) for async DB, and more
- Protocol handler extensions can now handle promises and can also make
  data available as it's ready instead of all at once (e.g., reports now
  output one entry at a time)
- zotero:// URL syntaxes are now more consistent and closer to the web
  API (old URLs should work, but some may currently be broken)

Also:

- Code to generate server API, currently available for testing via
  zotero://data URLs but eventually moving to HTTP -- zotero://data URLs match
  web API URLs, with a different prefix for the personal library (/library vs.
  /users/12345)
- Miscellaneous fixes to data objects

Under the hood:

- Extensions now return an AsyncChannel, which is an nsIChannel implementation
  that takes a promise-yielding generator that returns a string,
  nsIAsyncInputStream, or file that will be used for the channel's data
- New function Zotero.Utilities.Internal.getAsyncInputStream() takes a
  generator that yields either promises or strings and returns an async input
  stream filled with the yielded strings
- Zotero.Router parsers URLs and extract parameters
- Zotero.Item.toResponseJSON()
2014-09-09 00:36:29 -04:00
Dan Stillman
db0fa3c33e Async DB megacommit
Promise-based rewrite of most of the codebase, with asynchronous database and file access -- see https://github.com/zotero/zotero/issues/518 for details.

WARNING: This includes backwards-incompatible schema changes.

An incomplete list of other changes:

- Schema overhaul
  - Replace main tables with new versions with updated schema
  - Enable real foreign key support and remove previous triggers
  - Don't use NULLs for local libraryID, which broke the UNIQUE index
    preventing object key duplication. All code (Zotero and third-party)
    using NULL for the local library will need to be updated to use 0
    instead (already done for Zotero code)
  - Add 'compatibility' DB version that can be incremented manually to break DB
    compatibility with previous versions. 'userdata' upgrades will no longer
    automatically break compatibility.
  - Demote creators and tags from first-class objects to item properties
- New API syncing properties
  - 'synced'/'version' properties to data objects
  - 'etag' to groups
  - 'version' to libraries
- Create Zotero.DataObject that other objects inherit from
- Consolidate data object loading into Zotero.DataObjects
- Change object reloading so that only the loaded and changed parts of objects are reloaded, instead of reloading all data from the database (with some exceptions, including item primary data)
- Items and collections now have .parentItem and .parentKey properties, replacing item.getSource() and item.getSourceKey()
- New function Zotero.serial(fn), to wrap an async function such that all calls are run serially
- New function Zotero.Utilities.Internal.forEachChunkAsync(arr, chunkSize, func)
- Add tag selector loading message
- Various API and name changes, since everything was breaking anyway

Known broken things:

- Syncing (will be completely rewritten for API syncing)
- Translation architecture (needs promise-based rewrite)
- Duplicates view
- DB integrity check (from schema changes)
- Dragging (may be difficult to fix)

Lots of other big and little things are certainly broken, particularly with the UI, which can be affected by async code in all sorts of subtle ways.
2014-08-06 22:59:37 -04:00
Dan Stillman
4ea5e2d426 Update code to use 0 instead of NULL for libraryID 2014-08-06 22:14:59 -04:00
Simon Kornblith
946c754ae7 Remove redundant line 2013-03-18 20:33:09 -04:00
Dan Stillman
9665e67042 Fix reports for notes with " " displaying as HTML markup
Reports are now always served as text/html
2012-11-21 19:42:47 -05:00
Simon Kornblith
f6c3f58bc2 Merge commit '920df48d1da4f9bf33bf1a01c60a2131e589d29c' into 3.0 2012-11-12 00:09:23 -05:00
Simon Kornblith
425b2161cc Fix saving snapshots with Gecko 17 2012-11-11 17:14:05 -05:00
aurimasv
025eed93be Fix CSS url() links when served from zotero:// protocol 2012-11-11 01:50:26 -06:00
Dan Stillman
5b267b4264 Fix sorting of base-mapped fields in reports 2012-04-26 16:28:55 -04:00
Dan Stillman
2bf4c81a62 Make creator-based report sorting slightly less broken 2012-01-11 19:02:57 -05:00
Simon Kornblith
bbbc8991f2 - Fix failure to save snapshots, caused by failure to add and remove our request from loadGroup
- Fix a few other issues in ConnectorChannel
2011-08-12 18:10:53 +00:00
Simon Kornblith
7b41d76b75 Move standalone.xul to separate standalone directory 2011-07-02 04:27:57 +00:00
Simon Kornblith
8268d1b01c Zotero Everywhere megacommit
- Implement connector for Firefox (should switch in/out of connector mode automatically when Standalone is launched or closed, although this has only been tested extensively on OS X)
- Share core translation code between Zotero and connectors

Still to be done:

- Run translators in non-Fx connectors (this works in theory, but it's not currently enabled for any translators)
- Show translation results in non-Fx connectors
- Ability to translate to server when Zotero Standalone is not running
2011-06-14 00:36:21 +00:00
Dan Stillman
51f8c11ea0 Switch client code license to Affero GPL version 3 2011-05-18 18:34:22 +00:00
Dan Stillman
824eb06c73 Add temporary workaround for XML parsing errors on imported notes in generated reports
Still invalid XML, but serve as text/html to avoid error
2011-04-27 21:33:01 +00:00
Dan Stillman
ab9ae36135 Fix date-based sorting in reports 2011-04-12 14:47:44 +00:00
Dan Stillman
6b2b08cd1b Group library support for Timeline 2011-03-05 04:28:54 +00:00
Dan Stillman
f94242f7ad Fix Date Published in Timeline 2011-03-05 04:10:29 +00:00
Simon Kornblith
3fd0523b6e - fix preference links
- fix tab mode tooltip
- zotero://fullscreen opens standalone
2011-02-09 06:42:08 +00:00
Simon Kornblith
90b7380563 more tab code changes 2011-02-03 07:17:55 +00:00
Simon Kornblith
ecf0f3397c Zotero as a tab. This may need to be backed out for 2.1 depending on the amount of trouble it generates. 2011-01-30 09:44:01 +00:00
Simon Kornblith
a1f52aede4 slightly less ugly hack for opening cite preferences 2010-11-07 04:36:39 +00:00
Simon Kornblith
a1f327a97a tweaks to prefs window opening 2010-11-07 04:18:58 +00:00
Simon Kornblith
5c88810ec0 add zotero://preferences URI scheme to allow links to prefs from add-ons 2010-10-18 23:12:04 +00:00
Simon Kornblith
d06a19b6a8 add Zotero Connector 2010-09-23 04:14:19 +00:00
Simon Kornblith
63e08cd714 addresses #1690, Modify all XPCOM components for Firefox 4.0b2+ 2010-07-06 09:02:35 +00:00
Dan Stillman
94e279e034 ECL 1.0 -> GPLv3 2009-12-28 09:47:49 +00:00
Dan Stillman
01e9bea66e Support library-key hashes in zotero://timeline and zotero://select URLs 2009-12-05 20:16:42 +00:00
Dan Stillman
f6c8494a6b - Use keys rather than ids for report URLs
- Collection report sorting was backwards (since Fx3.5, probably)
- Return full Zotero.Search objects from Zotero.Searches.getAll()
2009-12-05 04:26:22 +00:00
Dan Stillman
5f9e39f959 In-memory debug logging, configurable in Advanced pane of preferences, with ability to send output to zotero.org 2009-08-10 16:44:15 +00:00
Dan Stillman
9b7070ad38 zotero://fullscreen patch from Ben Parr, with a tweak to properly restore unmaximized Zotero pane height when using as home page
Known issue: Window title isn't set correctly

Says Ben:

===========================================

Some uses for this feature include:
- people who don't want to use Firefox as their main browser could set their Firefox homepage to zotero://fullscreen, making Zotero act as a standalone application
- people who do use Firefox could add the link to their Bookmarks Toolbar, and simply Shift-click it to have a Zotero "standalone application"

===========================================
2009-07-27 11:12:42 +00:00
Ben Parr
8437a55e3e Fixes #1470 and makes sure the requested XML url is clean. 2009-05-18 15:48:45 +00:00