Commit graph

86 commits

Author SHA1 Message Date
Simon Kornblith
5710fbc530 Don't initialize Zotero just to figure out if Standalone is running 2011-07-03 00:07:56 +00:00
Simon Kornblith
c40ba095ea Move command line handler to zotero-service.js so that it will have access to zContext even before Zotero is finished initializing. This is necessary for automatic connector switching on Windows. 2011-07-02 22:04:04 +00:00
Simon Kornblith
b114266fb3 - Closes #1832, Connectors should be able to retrieve translator data and code from server in the absence of Zotero Standalone
- Closes #1831, Connectors should be able to save via API in the absence of Zotero Standalone
- Fixes Zotero.Utilities.deepCopy() for arrays
- Fixes some circumstances where an error would not be saved for future error reporting
- Fixes connector status checking
2011-06-30 01:08:30 +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
Simon Kornblith
3f69b8b9c0 Don't allow functions queued with setTimeout() to execute during Zotero.wait()
Fixes fatal error during import
2011-05-31 19:59:07 +00:00
Dan Stillman
51f8c11ea0 Switch client code license to Affero GPL version 3 2011-05-18 18:34:22 +00:00
Simon Kornblith
5951768ada Fix compatibility with latest Minefield 2011-04-18 23:29:12 +00:00
Simon Kornblith
1486132626 Add flexible locate menu, based on a (very heavily modified) copy of the pubget patch. Documentation is forthcoming. 2011-02-09 03:22:06 +00:00
Dan Stillman
1747f19009 Don't load nsDragAndDrop.js 2010-12-26 19:05:52 +00:00
Simon Kornblith
ac9d524a9f update to citeproc-js 1.0.88
From 1.0.82:

Fixes to cs:if and cs:else-if logic.  Was failing to set the match
attribute on singleton nodes, among other things.

Treat greek letters as part of the "romanesque" character set,  for
name formatting purposes.

If cs:number input has numbers separated by spaces, but also
extraneous non-comma, non-ampersand, non-hyphen characters, then
render as literal.

From 1.0.83:

Use en-dash rather than hyphen in formatted page range joins.

From 1.0.84:

Preserve explicit double spaces in HTML output.

From 1.0.85:

Pass full suite of double space suppression tests.

Language switching within a style works, for both localized dates and
terms.  (This functionality is not yet valid in CSL.)

From 1.0.86:

Address bug that caused unreasonable delays with large namesets.

From 1.0.87:

Where et-al-min, et-al-subsequent-min or names-min are set to some
value larger than zero, and the number of names in a nameset exceeds
an arbitrary threshold of 50, truncate author lists that are longer
than the *-min value (plus a buffer value of 2), to raise performance
to a  reasonable level with large namesets.

From 1.0.88:

Adjustments to language condition logic, to use only the base language
name for matching, while applying the full locale specified in the
conditional to node children.

Refinements to the recently introduced handling of brace-enclosed
leading characters as initialized form of names.

Adjustments to print statement arbitration, with a view to playing
nice with various systems.
2010-12-10 07:12:08 +00:00
Simon Kornblith
3f2a8a39ab - Overhaul of Zotero.Translate instance. New code should use new Zotero.Translate.Web, Zotero.Translate.Import, etc. The core Translate class is now abstracted away from data access, read/write IO, and the sandbox API. This all needs more testing.
- Translators now use configOptions and displayOptions properties in their metadata instead of Zotero.configure() and Zotero.addOption() to specify interfaces.
- Replaced now broken Zotero.Utilities.inArray() appearances in MODS.js with proper indexOf() calls
2010-11-02 21:39:54 +00:00
Simon Kornblith
e61dd60024 move Zotero.Date and Zotero.OpenURL to independent files 2010-10-27 00:36:20 +00:00
Simon Kornblith
d22ccf2219 Zotero.Utilities changes:
- Zotero.Utilities is now a singleton
- Zotero.Utilities.HTTP is now Zotero.HTTP
- Zotero.Utilities.md5 and Zotero.Utilities.Base64 are now located under Zotero.Utilities.Internal
- Zotero.Utilities.AutoComplete has been eliminated

This needs testing to make sure there is no associated breakage.
2010-10-25 00:58:47 +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
Simon Kornblith
bd0a4a3b96 Use citeproc-js as CSL parser. There is an issue with multiple citations in numbered styles that I will probably need Frank's help to track down, but otherwise, this seems to work. Many things are completely untested, including EndNote style support. Currently requires CSL 1.0 styles. In the near future, I hope to use the XSLT stylesheet to transform CSL 0.8 to CSL 1.0.
closes #1650: suppress author does not work for multiple sources
closes #1505: Edit Biblography Button Strips Year Disambiguation
closes #1503: Editing a bibliography resets all reference numbers to 1 (new)
closes #1262: Broken pluralization with et al. + other issues
closes #1238: Localize quotation marks
closes #1191: Harmonize 'plural/pluralize' label attribute with CSL schema
closes #1154: Only one works page numbers are added to the citation are when citing multiple works by the same author
closes #1097: Disambiguation issues
closes #1083: Defect in IEEE CSL with Multiple Citations
closes #993: more sophisticated subsequent-author-substitute
closes #833: text-transform doesn't work with name
2010-05-30 11:25:25 +00:00
Dan Stillman
884e5474fe Zotero File Storage megacommit
- Group file sync via Zotero File Storage
- Split file syncing into separate modules for ZFS and WebDAV
- Dragging items between libraries copies child notes, snapshots/files, and links based on checkboxes for each (enabled by default) in the Zotero preferences
- Sync errors now trigger an exclamation/error icon separate from the sync icon, with a popup window displaying the error and an option to report it
- Various errors that could cause perpetual sync icon spinning now stop the sync properly
- Zotero.Utilities.md5(str) is now md5(strOrFile, base64)
- doPost(), doHead(), and retrieveSource() now takes a headers parameter instead of requestContentType
- doHead() can now accept an nsIURI (with login credentials), is a background request, and isn't cached
- When library access or file writing access is denied during sync, display a warning and then reset local group to server version
- Perform additional steps (e.g., removing local groups) when switching sync users to prevent errors
- Compare hash as well as mod time when checking for modified local files
- Don't trigger notifications when removing groups from the client
- Clear relation links to items in removed groups
- Zotero.Item.attachmentHash property to get file MD5
- importFromFile() now takes libraryID as a third parameter
- Zotero.Attachments.getNumFiles() returns the number of files in the attachment directory
- Zotero.Attachments.copyAttachmentToLibrary() copies an attachment item, including files, to another library
- Removed Zotero.File.getFileHash() in favor of updated Zotero.Utilities.md5()
- Zotero.File.copyDirectory(dir, newDir) copies all files from dir into newDir
- Preferences shuffling: OpenURL to Advanced, import/export character set options to Export, "Include URLs of paper articles in references" to Styles
- Other stuff I don't remember

Suffice it to say, this could use testing.
2009-09-13 07:23:29 +00:00
Simon Kornblith
136c47be5f Integration megacommit, part 2: Zotero code
Closes #884, final period missing when a citation is first added in note styles
Closes #1298, issues with footnotes and citations in OOo
Closes #1069, Use async HTTP calls for integration requests
Closes #1027, User-customizable integration port number
Closes #698, Migration away from VBA
Closes #1085, Migrate VBA plug-in to new XML-based API
Closes #792, Auto-updating of OO plugins
2009-08-20 05:02:55 +00:00
Ben Parr
ac79b1d05f Add Zotero Commons feature (integration between Zotero and Internet Archive).
- dropping Zotero items into a bucket puts them in that IA bucket
- double clicking a bucket takes you to that IA bucket

In order to enable Zotero Commons:
1) Get an access key and secret key at http://www.archive.org/account/s3.php
2) Go to about:config
3) Search "commons" (no quotes)
4) Set "extensions.zotero.commons.enabled" to true
5) Enter your S3 access key into "extensions.zotero.commons.accessKey"
6) Enter your S3 secret key into "extensions.zotero.commons.secretKey"
7) Enter your buckets into "extensions.zotero.commons.buckets" as a comma separated list

Note: Steps 4-7 take effect in new windows
2009-08-13 10:56:47 +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
41437738b0 - Add triggers for full sync on various errors
- Add Zotero.Error(message, error) constructor to create a throwable error object with an error code
- Allow only one automatic client reset between manual syncs
- Fix "Source item for keyed source doesn't exist in Zotero.Item.getSource()" error
- Object produced by item.serialize() now contains .sourceItemKey instead of .sourceItemID
- Better error logging for missing XPCOM files
2009-07-06 10:13:02 +00:00
Simon Kornblith
7da8c036d7 Use RDF store from Tabulator (http://www.w3.org/2005/ajar/tab) instead of Mozilla RDF support, along with a modified version of their RDF serializer. Our RDF export should now be much cleaner, but still backward compatible with 1.0. 2009-06-24 20:42:41 +00:00
Dan Stillman
91459f95f7 2.0b3 megacommit
- Support for group libraries
- General support for multiple libraries of different types
- Streamlined sync support
  - Using solely libraryID and key rather than itemID, and removed all itemID-changing code
  - Combined two requests for increased performance and decreased server load
  - Added warning on user account change
  - Provide explicit error message on SSL failure
- Removed snapshot and link toolbar buttons and changed browser context menu options and drags to create parent items + snapshots
- Closes #786, Add numPages field
- Fixes #1063, Duplicate item with tags broken in Sync Preview
- Added better purging of deleted tags
- Added local user key before first sync
- Add clientDateModified to all objects for more flexibility in syncing
- Added new triples-based Relation object type, currently used to store links between items copied between local and group libraries
- Updated zotero.org translator for groups
- Additional trigger-based consistency checks
- Fixed broken URL drag in Firefox 3.5
- Disabled zeroconf menu option (no longer functional)

Developer-specific changes:

- Overhauled data layer
  - Data object constructors no longer take arguments (return to 1.0-like API)
  - Existing objects can be retrieved by setting id or library/key properties
  - id/library/key must be set for new objects before other fields
- New methods:
  - ZoteroPane.getSelectedLibraryID()
  - ZoteroPane.getSelectedGroup(asID)
  - ZoteroPane.addItemFromDocument(doc, itemType, saveSnapshot)
  - ZoteroPane.addItemFromURL(url, itemType)
  - ZoteroPane.canEdit()
  - Zotero.CollectionTreeView.selectLibrary(libraryID)
  - New Zotero.URI methods
- Changed methods
  - Many data object methods now take a libraryID
  - ZoteroPane.addAttachmentFromPage(link, itemID)
- Removed saveItem and saveAttachments parameters from Zotero.Translate constructor
- translate() now takes a libraryID, null for local library, or false to not save items (previously on constructor)
- saveAttachments is now a translate() parameter
- Zotero.flattenArguments() better handles passed objects
- Zotero.File.getFileHash() (not currently used)
2009-05-14 18:23:40 +00:00
Dan Stillman
f96d5c1cac Addresses #1146, Check for duplicate items functionality
Actually load duplicate detection code
2009-03-06 21:45:49 +00:00
Simon Kornblith
bf8e4eae28 - implement Zotero.Styles.install, refine Zotero.Style.delete, and restore functionality to Styles prefpane
- allow deletion of multiple styles simultaneously
- split Zotero.Styles/Zotero.Style and Zotero.CSL into style.js and csl.js respectively
- add Zotero.File.getBinaryContents for binary-safe file reading
- add Zotero.MIMETypeHandler to provide a unified interface for registering observers and capturing MIME types with Zotero
2008-09-16 19:14:52 +00:00
Dan Stillman
a8bb8dae40 Adds WebDAV file sync
- Still experimental and incomplete, with no lock support and not much error handling

Also:

- New expiry date for sync functions
- Attachment character set was being dropped during syncing
- Possibly improves sizing issues with preferences window
- Fixes problems with attachment filenames with extended characters
- Fixes some problem with tags that I don't remember
- Makes XMLHTTPRequest calls are now background requests (no auth windows or other prompts)
- Z.U.HTTP.doOptions() now takes an nsIURI instead of a URL spec
- New methods:
  - Zotero.Utilities.rand(min, max)
  - Zotero.Utilities.probability(x)
  - Zotero.Utilities.Base64.encode(str) and decode(str)
  - Zotero.getTempDirectory()
  - Zotero.Date.dateToISO(date) - convert JS Date object to ISO 8601 UTC date/time
  - Zotero.Date.isoToDate(isoDate) - convert an ISO 8601 UTC date/time to a JS Date object
2008-08-31 23:36:01 +00:00
Dan Stillman
96e88bda1e - Change local key if remote item has different id but different key (which should mostly be with the Quick Start Guide)
- Moved common singleton data logic (for now, just getByKey()) into Zotero.DataObjects, and use that as template for other data objects
2008-08-13 06:38:47 +00:00
Simon Kornblith
09e8249db8 closes #743, Support non-EZproxy proxies
closes #831, transparent EZProxy support
adds a proxy pane to the preferences
asks before saving proxies to the DB (to avoid the potential phishing risk #831 would otherwise pose)
2008-07-28 11:11:12 +00:00
Simon Kornblith
5efeeb6089 remove support for old-style CSLs 2008-07-23 05:05:03 +00:00
Dan Stillman
ee589b0ed5 Addresses #1057, Won't start on Windows
I suspect this will fix the problem. It will also provide better error reporting for Zotero startup errors such as this one.
2008-07-03 16:44:52 +00:00
Dan Stillman
1bf13aaa1a Part of auto-sync support 2008-06-30 01:01:53 +00:00
Simon Kornblith
d8868cd9cb fixes #1030, CSL broken on trunk due to XML namespace change
closes #704, EndNote to Zotero style converter (won't actually convert styles due to copyright concerns, but will load them into the DB)
also adds CSL style manager
2008-06-20 06:40:05 +00:00
Dan Stillman
9bcdf021dd - Fixes tag editing
- Adds tag syncing
- Fixes a few other things

No tag CR yet
Requires new 1.0 DB upgrade
2008-06-16 05:46:10 +00:00
Dan Stillman
00c2b14d6c Adds rudimentary Zeroconf support to Zotero (a.k.a. "Z(ot)eroconf")
- Inspired by Dan Chudnov's Python/MODS-based Zeroconf demo at THATcamp
- Enabled by extensions.zotero.zeroconf.enabled (off by default)
- Currently supports only OS X (tested on Leopard, not sure about earlier versions)
- Uses Apple's dns-sd and mDNS command-client clients, but should be able to be extended to other clients, though a native library would be far superior
- Discovery is on-demand for now via Actions menu ("Search for Shared Libraries")
- Includes rudimentary web server (code copied from integration.js) that serves items as sync XML -- no authentication yet!
- Only supports top-level items
- Remote libraries show up in left pane (under remote computer name, for now)
- Items can be dragged into collections (but not the library yet, for some reason)
- On first run, might cause a long pause and the "This file was downloaded from the Internet" message on Leopard -- can't manage to get around the quarantine for the script file that we need to access stdout from Firefox
- Needs a lot of work, and without a real JS (or otherwise Mozilla-native) Zeroconf library we can't do proper discovery without intermittent polling
- But it works, at least for me

Also includes some data/sync-layer changes that I needed along the way (and that we'll need for shared collections of any type)
2008-06-03 05:26:30 +00:00
Dan Stillman
3de1789f26 Initial Zotero 1.5 Megacommit
Apologies for the massive (and, due to data_access.js splitting, difficult-to-follow) commit. Please note that external code that accesses the data layer may need to be tweaked for compatibility. Here's a comprehensive-as-possible changelog:

- Added server sync functionality (incomplete)
- Overhaul of data layer
  - Split data_access.js into separate files (item.js, items.js, creator.js, etc.)
  - Made creators and collections first-class objects, similar to items
  - Constructors now take id as first parameter, e.g. new Zotero.Item(1234, 'book'), to allow explicit id setting and id changing
  - Made various data layer operations (including attachment fields) require a save() rather than making direct DB changes
  - Better handling of unsaved objects
    - Item.setCreator() now takes creator objects instead of creator ids, and Item.save() will auto-save unsaved creators
    - clone() now works on unsaved objects
  - Newly created object instances are now disabled after save() to force refetch of globally accessible instance using Zotero.(Items|Creators|etc.).get()
  - Added secondary lookup key to data objects
  - Deprecated getID() and getItemType() methods in favor of .id and .itemTypeID properties
  - toArray() deprecated in favor of serialize(), which has a somewhat modified format
  - Added support for multiple creators with identical data -- currently unimplemented in interface and most of data layer
  - Added Item.diff() for comparing item metadata
- Database changes
  - Added SQLite triggers to enforce foreign key constraints
  - Added Zotero.DB.transactionVacuum flag to run a VACUUM after a transaction
  - Added Zotero.DB.transactionDate, .transactionDateTime, and transactionTimestamp to retrieve consistent timestamps for entire transaction
  - Properly store 64-bit integers
  - Set PRAGMA locking_mode=EXCLUSIVE on database
  - Set SQLite page size to 4096 on new databases
  - Set SQLite page cache to 8MB
  - Do some database cleanup and integrity checking on migration from 1.0 branch
  - Removed IF NOT EXISTS from userdata.sql CREATE statements -- userdata.sql is now processed only on DB initialization
  - Removed itemNoteTitles table and moved titles into itemNotes
- Abstracted metadata edit box and note box into flexible XBL bindings with various modes, including read-only states
- Massive speed-up of item tree view
- Several fixes from 1.0 branch for Fx3 compatibility
- Added Notifier observer to log delete events for syncing
- Zotero.Utilities changes
  - New methods getSQLDataType() and md5()
  - Removed onError from Zotero.Utilities.HTTP.doGet()
  - Don't display more than 1024 characters in doPost() debug output
  - Don't display passwords in doPost() debug output
- Added Zotero.Notifier.untrigger() -- currently unused
- Added Zotero.reloadDataObjects() to reset all in-memory objects
- Added |chars| parameter to Zotero.randomString(len, chars)
- Added Zotero.Date.getUnixTimestamp() and Date.toUnixTimestamp(JSDate)
- Adjusted zotero-service.js to simplify file inclusion

Various things (such as tags) are temporarily broken.
2008-05-04 08:32:48 +00:00
Dan Stillman
35ff52f2e8 Merged 1.0 branch back to trunk 2007-10-23 07:11:59 +00:00
Renamed from components/chnmIZoteroService.js (Browse further)