Commit graph

320 commits

Author SHA1 Message Date
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
Dan Stillman
156f4eb160 Allow items to be moved (not copied) between collections w/modifier key
Cmd on OS X, Shift on Windows/Linux

How do I not get to close a ticket for this?

Unfortunately on Windows it doesn't seem possible to set the cursor
effect to arbitrary states (see note in libraryTreeView.js::
_setDropEffect() for the gory details), so this just uses the default
cursor there. On OS X and Linux the cursor reflects the requested
action.
2014-05-03 11:52:38 -04:00
Dan Stillman
60e5ab8124 Merge branch '4.0'
Conflicts:
	chrome/content/zotero/xpcom/db.js
	chrome/content/zotero/xpcom/fulltext.js
	chrome/content/zotero/xpcom/zotero.js
	chrome/content/zotero/zoteroPane.js
	components/zotero-service.js
	install.rdf
	update.rdf
2014-04-08 18:47:32 -04:00
Simon Kornblith
1ee015317f Don't restart in connector mode on Zotero.init() failure
I broke this in a723c85999
2013-12-11 14:50:48 -05:00
Dan Stillman
6ff0ea6d18 Add -zoterodebug command-line flag to force debug output
This should make it much easier to debug startup errors, particularly in
Standalone.

This also adds a general mechanism to set Zotero initialization options via
command-line flags.
2013-11-30 01:55:48 -05:00
Dan Stillman
5d32fb90ea Merge branch '4.0'
Conflicts:
	chrome/content/zotero/fileInterface.js
	chrome/content/zotero/overlay.js
	chrome/content/zotero/xpcom/schema.js
	chrome/content/zotero/xpcom/zotero.js
	chrome/content/zotero/zoteroPane.js
	install.rdf
	update.rdf
2013-11-24 16:08:46 -05:00
Simon Kornblith
0b92ad0037 Modify behavior on Zotero Standalone launch to account for failure
- Close Zotero pane before database is closed prior to reload, instead
  of waiting until reload is complete
- Show an error message if Zotero Standalone is not accessible when it
  should be
2013-11-05 15:52:40 -05:00
Dan Stillman
d318bca7a4 Allow items to be moved (not copied) between collections w/modifier key
Cmd on OS X, Shift on Windows/Linux

How do I not get to close a ticket for this?

Unfortunately on Windows it doesn't seem possible to set the cursor
effect to arbitrary states (see note in libraryTreeView.js::
_setDropEffect() for the gory details), so this just uses the default
cursor there. On OS X and Linux the cursor reflects the requested
action.
2013-09-06 15:30:37 -04:00
Simon Kornblith
526441c3ca Make translator loading asynchronous
Other changes:
- Factored out Zotero.Translators from Zotero.Translator. The latter
  should be usable in the bookmarklet and connectors without changes.
- configOptions, displayOptions, and hiddenPrefs no longer copy on
  read. I don't think this actually affects any existing code.
- Zotero.Translate._loadTranslator() now returns a promise
2013-08-17 03:15:43 -04:00
Dan Stillman
5787b230f7 Use asynchronous DB and file access for schema checks/updates
This change should improve Firefox startup time. If the Zotero pane is
opened before Zotero has initialized, the pane will be blocked with a
progress bar until it's done. Standalone currently does the same, but it
should be changed to just delay opening the window if possible.

The upgrade wizard has been disabled for schema upgrades, in the hope
that upgrades can be done in a way that won't break compatibility with
earlier versions (or that can at least be done in a way such that we can
put out point releases of the last major version that provide
compatibility during beta/post-upgrade periods).

This patch likely breaks many things, and definitely breaks connector
mode.

This change also removes upgrade steps for databases from Zotero 2.1b2
and earlier. Users with such databases will need to upgrade via Zotero
4.0.x first or delete their data directories and start anew. This should
only affect users who haven't opened Zotero since Nov. 2010.
2013-08-11 21:53:41 -04:00
Simon Kornblith
a723c85999 Return a promise from Zotero.shutdown() 2013-08-09 11:11:01 -04:00
Simon Kornblith
2069b5b396 Fix switching in and out of connector mode
Broken by 9d3f55be51
2013-08-09 10:55:56 -04:00
Dan Stillman
7572eebcd1 Offer autocomplete of same creator for different creator types
If a creator exists on an item but is a different creator type than the
one being entered, show creator in autocomplete list.
2013-08-07 15:25:15 -04:00
Dan Stillman
9d3f55be51 Use async DB for autocomplete
This was probably hanging previously because I was passing a JS function for
onProgress, which apparently isn't allowed.
2013-08-07 11:01:12 -04:00
Dan Stillman
10e9c5e0b7 Restore ZFS quota warning
Possible that this hasn't shown since 4.0?
2013-07-08 20:13:47 -04:00
Dan Stillman
65c7a5988b Limit autocomplete for tags and fields to current library
Not done for advanced search

Should be easy for saved search, but not yet done
2013-04-19 15:10:05 -04:00
Simon Kornblith
946c754ae7 Remove redundant line 2013-03-18 20:33:09 -04:00
Dan Stillman
d2f028d797 Tag colors, synced settings, and (stopgap) silent DB upgrades
- New tag colors support, with the ability to assign colors to up to 6
  tags per library. Tags with colors assigned will show up at the top of
  the tag selector and can be added to (and removed from) selected items
  by pressing the 1-6 keys on the keyboard. The tags will show up as
  color swatches before an item's title in the items list.
- Synced settings, with Notifier triggers when they change and
  accessible via the API (currently restricted on the server to
  'tagColors', but available for other things upon request)
- Silent DB upgrades for backwards-compatible changes. We'll do
  something fancier with async DB queries in 4.0, but this will work for
  changes that can be made without breaking compatibility with older
  clients, like the creation of new tables. The 'userdata' value is
  capped at 76, while further increments go to 'userdata2'.

TODO:

- Try to avoid jitter when redrawing swatches
- Optimize tag color images for retina displays
- Redo attachment dots in flat style?
- Clear all colors from an item with 0 (as in Thunderbird), but I don't
  think we can do this without undo
2013-03-03 06:23:25 -05:00
Dan Stillman
0061ff3ca5 Merge branch '3.0'
Conflicts:
	chrome/content/zotero/preferences/preferences.xul
	chrome/content/zotero/xpcom/data/item.js
	chrome/content/zotero/xpcom/utilities_translate.js
2013-02-04 07:02:38 -05:00
Dan Stillman
46e3e7293e Fix "results.sort is not a function" in tags autocomplete
This occured if there were no autocomplete results for an entered tag
string.
2013-02-04 05:03:12 -05:00
Simon Kornblith
dbf2bc265f Merge branch '3.0'
Conflicts:
	chrome/content/zotero/recognizePDF.js
	chrome/content/zotero/xpcom/utilities.js
2013-01-21 02:01:08 -05:00
Simon Kornblith
94619403ca Tweak loading process 2013-01-21 01:58:01 -05:00
Dan Stillman
596c6da3ee Remove Commons code, which contains E4X
Some items pane code is still in place, since it's a decent example of
dynamic items pane loading.
2013-01-15 03:23:37 -05:00
aurimasv
b1cc6e260e Load XRegExp into Zotero.XRegExp and Zotero.Utilities.XRegExp and make it accessible from translators. 2012-12-19 06:36:08 -06:00
Dan Stillman
bb93f019dc File sync overhaul
- New promise-based architecture
- Library-specific file sync queues, allowing other libraries to
  continue if there's an error in one library
- Library-specific sync errors, with error icons next to each library
- Changed file uploading in on-demand download mode, which had been missing
- On-demand download progress indicator in middle pane
- More accurate progress indicator
- Various tweaks and bug fixes
- Various future tweaks and bug fixes
2012-12-11 15:16:40 -05:00
Dan Stillman
4caae896cf Merge branch '3.0'
Conflicts:
	chrome/content/zotero/xpcom/attachments.js
	chrome/content/zotero/xpcom/translation/translate_item.js
	install.rdf
	update.rdf
2012-11-23 01:49:32 -05: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
585e5981f6 Merge branch '3.0'
Conflicts:
	chrome/content/zotero/xpcom/storage/webdav.js
	chrome/content/zotero/xpcom/storage/zfs.js
2012-11-12 16:04:39 -05:00
Simon Kornblith
f6c3f58bc2 Merge commit '920df48d1da4f9bf33bf1a01c60a2131e589d29c' into 3.0 2012-11-12 00:09:23 -05:00
Simon Kornblith
bd367dcd85 Merge branch '3.0' 2012-11-11 17:15:30 -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
61c36b0523 Add ZoteroPaneOpen command line argument to open Zotero automatically 2012-11-10 19:38:22 -05:00
Simon Kornblith
57c3d190b4 Merge branch 'kill-e4x'
Conflicts:
	chrome/content/zotero/xpcom/integration.js
2012-06-25 00:42:32 -04:00
Simon Kornblith
66815c118f Kill E4X in Zotero.Style
Also kill enstyle.js, since it no longer works
2012-06-24 23:32:08 -04:00
Simon Kornblith
ac19b0490a Merge branch 'no-new-collection-on-import' 2012-06-10 22:39:41 -04:00
Simon Kornblith
68365e2297 Allow user to control whether files are imported into a new collection.
Adds three new preferences controlling whether a new collection is created upon import:
- extensions.zotero.import.createNewCollection.fromFile
	Controls whether a new collection is created by import from cog menu
- extensions.zotero.import.createNewCollection.fromClipboard
	Controls whether a new collection is created by import from clipboard
- extensions.zotero.import.createNewCollection.fromFileOpenHandler
	Controls whether a new collection is created when import is initiated by
	double-clicking a file or by dragging it over Zotero. This preference applies only to
	Zotero Standalone, and is configurable in the dialog that appears asking the user
	to confirm the import.

Closes #19, [papercuts] (26) Clipboard import into an open collection
2012-06-10 11:05:39 -04:00
Simon Kornblith
4e5d4281f1 Merge branch '3.0' 2012-05-26 18:24:52 -04:00
Dan Stillman
66bfaaae13 Fix sorting of autocomplete tags dropdown (since Fx9 or so) 2012-05-10 18:55:17 -04:00
Simon Kornblith
5894a9511d Tweak RDF loading code 2012-05-05 16:53:00 -04:00
Simon Kornblith
6e3dfc45ee Merge pull request #103 from aurimasv/tabulator
Tabulator v0.8 RDF Parser
2012-05-05 12:35:24 -07:00
Dan Stillman
d456117ebe Merge branch '3.0' 2012-05-03 17:56:32 -04:00
aurimasv
1942fb6762 Remove compatibility hack from rdf.js. Fix Zotero code instead. Move all setup to init.js 2012-04-29 20:30:37 -05:00
aurimasv
ea767e5647 Set up environment for RDF parser 2012-04-26 17:36:35 -05:00
Dan Stillman
5b267b4264 Fix sorting of base-mapped fields in reports 2012-04-26 16:28:55 -04:00
Dan Stillman
f1aa68f82b Simplify the file sync code a bit
Just call Zotero.Sync.Storage.[ZFS/WebDAV] directly

This probably breaks some things.
2012-03-21 19:39:40 -04:00
Simon Kornblith
09813b145d Merge branch '3.0' 2012-02-14 15:00:07 -05:00
Simon Kornblith
a01fcd360f Remove redundant code 2012-02-12 23:35:39 -05:00
Simon Kornblith
703d18ecb9 Remove antiquated code 2012-02-11 00:39:58 -05:00
Simon Kornblith
ef9040c46d Revert "Remove antiquated code"
This reverts commit d5fc04485b.
2012-02-11 00:38:21 -05:00
Simon Kornblith
d5fc04485b Remove antiquated code 2012-02-11 00:34:05 -05:00
Dan Stillman
6c5e155ba7 Merge branch '3.0' 2012-02-09 02:18:15 -05:00
Simon Kornblith
564d27f51c Allow add-ons to be updated via addons.mozilla.org in Zotero Standalone, part 1 2012-02-08 23:06:50 -05:00
Simon Kornblith
a78cd2cf18 Fix WPD leak by loading into a local scope 2012-02-05 18:58:15 -05:00
Simon Kornblith
39c86a791e Use Zotero.debug() instead of dump() in WPD 2012-02-05 18:46:49 -05:00
Dan Stillman
7c4a69b9e1 Merge branch '3.0' 2012-01-17 01:16:47 -05:00
Dan Stillman
2bf4c81a62 Make creator-based report sorting slightly less broken 2012-01-11 19:02:57 -05:00
Dan Stillman
059460a5d2 Merge branch '3.0'
Conflicts:
	chrome/content/zotero/xpcom/storage/webdav.js
	chrome/content/zotero/zoteroPane.js
	chrome/skin/default/zotero/preferences.css
2011-12-17 16:25:58 -05:00
Simon Kornblith
f0bd8beebc Don't load date.js twice. 2011-12-08 04:27:25 -05:00
Dan Stillman
758216638f On-demand download support
Can choose to download files "at sync time" or "as needed"

On-demand defaults to on, but remains off for existing users

To-do:

- Handling of local and remote file changes on on-demand download
  (currently if a file exists it isn't downloaded, which means a
  remotely modified file won't be redownloaded in on-demand mode)
- Additional control over file downloading and retention

Other changes:

- Overhauled entire file syncing architecture
- Replaced numAttachments column with Note and Attachment columns with
  dynamic icons to indicate status
- Double-clicking a parent with a missing best attachment and on-demand
  downloading off no longer loads the parent URL
- Bugs
2011-11-26 03:45:55 -05:00
Simon Kornblith
4666ae972c - Move Zotero.Utilities.Internal and Zotero.Utilities.Translate to separate files
- IE compatibility for translation core
2011-08-31 23:25:48 +00:00
Simon Kornblith
440fc95942 Move startup timing to zotero-service.js 2011-08-24 01:59:56 +00:00
Simon Kornblith
cf0e1e6972 Ask before importing files on double-click 2011-08-18 15:29:13 +00:00
Simon Kornblith
580d0df56d Set toolkit.singletonWindowType pref instead of preventing default command line actions to prevent opening new windows 2011-08-17 08:31:34 +00:00
Simon Kornblith
05f9d2cd6f Open reference formats and CSL files on double-click (currently only on OS X) 2011-08-17 04:51:43 +00: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
b5b3d0a135 Don't package zoteroIntegration typelib after all (reverts r10002) 2011-08-08 17:44:23 +00:00
Simon Kornblith
6b5a3b71f2 Put zoteroIntegration typelib in Zotero trunk. 2011-08-03 23:46:31 +00:00
Dan Stillman
56c7afc47e Duplicate detection:
- Adds a per-library "Duplicate Items" virtual search to the source list -- shows up by default for "My Library" but can be added to and removed from all libraries
- Current matching algorithm is very basic: finds exact title matches (after normalizing case/diacritics/punctuation/spacing) and DOI/ISBN matches (untested)
- In duplicates view, sets are selected automatically; in other views, duplicate items can be selected manually and the merge interface can be brought up with "Merge Items" in the context menu
- Can select a master item and individual fields to merge from other versions
- Word processor integration code will automatically find mapped replacements and update documents with new item keys

Possible future improvements:

- Improved detection algorithms
- UI tweaks
- Currently if any items differ, all available versions will be shown as master item options, even if only one item is different; probably the earliest equivalent item should be shown for each distinct version
- Caching of results for performance
- Confidence scale
- Creator version selection (currently the creators from the chosen master item are kept)
- Merging of matching child items
- Better sorting of duplicates if not clustered together by the selected sort column
- Relation path compression when merging items that are already mapped to previously removed duplicates

Other changes in this commit:

- Don't show Trash in word processor integration windows
- Consider items in trash to be missing in word processor documents
- Selection of special views (Trash, Unfiled, Duplicates) is now restored properly in new windows
- Disabled field transform context menu when item isn't editable
- Left/right arrow now expands/collapses all selected items instead of just the last-selected row
- Relation deletions are now synced
- The same items row is now reselected after item deletion
- (dev) Zotero.Item.getNotes(), Zotero.Item.getAttachments(), and Zotero.Item.getTags() now return empty arrays rather than FALSE if no matches -- tests on those return values in third-party code will need to be changed
- (dev) New function Zotero.Utilities.removeDiacritics(str, lowercaseOnly) -- could be used to generate ASCII BibTeX keys
- (dev) New 'tempTable' search condition can take a table to join against -- useful for implementing virtual source lists
- (dev) Significant UI code cleanup
- (dev) Moved all item pane content into itemPane.xul
- Probably various other things


Needless to say, this needs testing.
2011-07-22 21:24:38 +00:00
Simon Kornblith
c24aad3af4 Add incompatible version message to Firefox 2011-07-20 03:35:21 +00:00
Simon Kornblith
4067a1b820 Fix cookie sandboxing in connector 2011-07-19 03:52:02 +00:00
Simon Kornblith
67c81db102 Fix IPC on Windows by making SendMessage() call return immediately 2011-07-03 03:07:01 +00:00
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
00fdeb3bf9 Focus window in command line handler 2011-07-02 20:36:44 +00:00
Simon Kornblith
7b41d76b75 Move standalone.xul to separate standalone directory 2011-07-02 04:27:57 +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
acfd317de9 - Addresses #1828, Ensure any code that uses nsITimer directly maintains a global reference until callback executes
- Adds an optional runWhenWaiting argument to Zotero.setTimeout(), so that code can be set to run even if Zotero.wait() is in progress
2011-06-14 21:26:48 +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
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
Simon Kornblith
5951768ada Fix compatibility with latest Minefield 2011-04-18 23:29:12 +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
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
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
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
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
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
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
Dan Stillman
84cf9d8cbe Closes #1037, Remove Firefox 2.0/3.0–specific code 2010-07-09 20:10:43 +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
303f980954 Fix for "The command is not available because no document is open" error (part 2) 2010-06-20 10:48:38 +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
8560710463 - Fix autocomplete date searches (broken since autocomplete speedup)
- Fix search for January dates
- Support 'yesterday'/'today'/'tomorrow' and localized equivalents (case-insensitive) in date searches (e.g., [Date Added] [is] ['yesterday'])
2010-01-12 23:06:26 +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
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
Dan Stillman
a7ef8f2339 Disable asynchronous autocomplete for now, because it causes hangs (sorry Elena) 2009-09-01 19:50:50 +00:00
Dan Stillman
ae88cbd0ce - Workaround for apparent async DB call brokenness in autocomplete -- and only occasionally permanently hang Firefox
- Restore (non-asynchronous) Fx3.0 support
2009-08-28 05:56:29 +00:00
Dan Stillman
4912e9d09c Asynchronous DB queries for autocomplete -- for Elena, although I'm not sure this actually speeds things up. Needs testing with massive databases on slow machines. 2009-08-25 01:44:04 +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
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
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
Ben Parr
8437a55e3e Fixes #1470 and makes sure the requested XML url is clean. 2009-05-18 15:48:45 +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
Dan Stillman
337b16361a Merge [3617-3838] from branch to trunk 2008-11-30 20:18:48 +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
d662466ff6 Merged revisions 3306,3309 from 1.0 branch via svnmerge 2008-09-01 06:09:56 +00:00
Dan Stillman
f37d724a9e Merged revisions 3080-3081,3084,3087-3088,3090,3092,3099-3103,3113-3114,3132,3134-3143,3145,3148-3151,3154-3159,3165,3174,3194,3234-3235,3239-3240,3244,3246-3254,3258-3262,3268,3270,3274,3279,3286-3288,3294-3295 from 1.0 branch via svnmerge 2008-09-01 01:54:00 +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
0f71fdbc35 Merged revisions 2989,2994,2996-2999,3001,3003-3004,3007,3010,3012,3015-3016,3026-3029,3036-3038,3040-3041,3046,3048,3050,3052,3054-3055,3057-3058,3066,3069-3073 from 1.0 branch via svnmerge 2008-07-22 05:45:32 +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
8214d7ac60 Fix tag autocomplete
Also fixed to not display tags twice if both manual and automatic and to not display automatic tags if manual versions of the same tags are already linked to the current item
2008-06-16 15:11:59 +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
97f214c9dc Merged revisions 2710-2712,2714-2716,2718-2728,2730-2731,2734,2736-2738,2740-2750,2752-2753,2755,2758-2768,2770-2779,2782,2789-2790,2794,2797-2802,2804,2808-2810,2812,2814-2824,2826-2832,2834-2835 via svnmerge from 1.0 branch 2008-06-11 08:55:59 +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
200cca74a6 Merged revisions 1986,1988-1990,1996,1998,2000-2004,2006,2008-2010,2013,2020-2028,2032-2034,2037,2039,2044-2049,2052-2056,2059,2065-2066,2068-2072,2075,2077-2079,2081,2083-2084,2086,2088-2094,2096,2099,2101,2103-2104,2107-2110,2115,2118,2120-2122,2126-2128,2131,2140,2142-2145,2149-2153,2155-2159,2165,2167-2168,2170-2171,2173-2176,2179-2183,2185-2186 via svnmerge from
https://www.zotero.org/svn/extension/branches/1.0
2008-01-30 09:53:19 +00:00
Dan Stillman
35ff52f2e8 Merged 1.0 branch back to trunk 2007-10-23 07:11:59 +00:00
Dan Stillman
cd26267afe Closes #340, Change isInstitution to fieldMode everywhere
Including in the DB, which it turns out isn't really all that bad (thanks, among other things, to SQLite's ability to DROP tables within transactions without autocommitting (which MySQL can't do))
2006-10-05 00:59:26 +00:00
Dan Stillman
026b37169a Closes #63, Add ECL license info to source code
Added on all non-trivial files -- be sure to copy over XML or JS version as appropriate for new files
2006-10-04 17:16:56 +00:00
Dan Stillman
9f959bf3e0 Display and save multiple-field selections in the creator autocomplete
In other words, show both "Shakespeare" and "Shakespeare, William" in the drop-down, and if the latter is chosen, save both fields

One issue is that since the autocomplete is by default limited to the width of the textbox, longer entries get truncated (though you can see them with a mouseover), and that may not be easy to fix.
2006-10-03 08:38:49 +00:00
Dan Stillman
c97b4b0bc0 OK, this might be it, assuming I got the build script right 2006-10-03 00:29:42 +00:00
Dan Stillman
1cd51be497 Sorry, it was now or never, and now is better:
Changed "Scholar" to "Zotero", everywhere

Apologies to anyone with working copy changes, but there are probably the fewer at this moment than there will be again.

Hopefully this won't break anything, though existing prefs will be lost. I avoided scholar.google.com--if you know any other legitimate "scholar"s in the code, be sure to fix them once I'm done here.

This is a multi-commit change--there's at least one more coming. *Do not update to this version! It won't work!*
2006-10-02 23:15:27 +00:00
Dan Stillman
ace0d17ccb Moving Scholar.Attachments to its own file 2006-10-02 21:41:38 +00:00
Dan Stillman
2682ac0ee3 A rather important part of the last commit
Refs #260
2006-10-01 09:47:00 +00:00
Dan Stillman
da5e74a06a Autocomplete for creators in item pane
Differentiates between single and double fields for the search, but there's a problem in the current implementation in that only one field is editable at once, so displaying two-field names in a drop-down is a little problematic. While I could display the full names, comma-delimited, and get the discrete parts (which is what Scholar.Utilities.AutoComplete.getResultComment(), included in this commit, is for--the creatorID for the row would be hidden in the autocomplete drop-down comment field), it's a bit unclear what should happen when a user selects a comma-separated name from the drop-down of one of the fields. One option would be to have a row for the last name (in case that's all they want to complete) and other rows for "last, first" matches, and selecting one of the two-part names would replace whatever's in the opposite name field with the appropriate text (and save it to the DB, I'm afraid, unless I change how the creator fields work), keeping the focus in the current textbox for easy tabbing. Not great, but it might work.

Other ideas?
2006-09-25 06:38:47 +00:00
Dan Stillman
237db5ed58 Copied out scraping progress window for general use -- I'll use this for fulltext indexing notification, and ideally the scraper will use this instead now (Simon, let me know if there's any problem with that)
Example usage:

var windowWatcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].
					getService(Components.interfaces.nsIWindowWatcher);
var progress = new Scholar.ProgressWindow(windowWatcher.activeWindow);
progress.changeHeadline('Indexing item...');
progress.addLines(['All About Foo'], ['chrome://scholar/skin/treeitem-book.png']);
progress.addDescription('Bar bar bar bar bar');
progress.show();
progress.fade();
2006-09-21 07:54:18 +00:00
Dan Stillman
ab13c3980a Fulltext search support
There are currently two types of fulltext searching: an SQL-based word index and a file scanner. They each have their advantages and drawbacks.

The word index is very fast to search and is currently used for the find-as-you-type quicksearch. However, indexing files takes some time, so we should probably offer a preference to turn it off ("Index attachment content for quicksearch" or something). There's also an issue with Chinese characters (which are indexed by character rather than word, since there are no spaces to go by, so a search for a word with common characters could produce erroneous results). The quicksearch doesn't use a left-bound index (since that would probably upset German speakers searching for "musik" in "nachtmusik," though I don't know for sure how they think of words) but still seems pretty fast.

* Note: There will be a potentially long delay when you start Firefox with this revision as it builds a fulltext word index of your existing items. We obviously need a notification/option for this. *

The file scanner, used in the Attachment Content condition of the search dialog, offers phrase searching as well as regex support (both case-sensitive and not, and defaulting to multiline). It doesn't require an index, though it should probably be optimized to use the word index, if available, for narrowing the results when not in regex mode. (It does only scan files that pass all the other search conditions, which speeds it up considerably for multi-condition searches, and skips non-text files unless instructed otherwise, but it's still relatively slow.)

Both convert HTML to text before searching (with the exception of the binary file scanning mode).

There are some issues with which files get indexed and which don't that we can't do much about and that will probably confuse users immensely. Dan C. suggested some sort of indicator (say, a green dot) to show which files are indexed.

Also added (very ugly) charset detection (anybody want to figure out getCharsetFromString(str)?), a setTimeout() replacement in the XPCOM service, an arrayToHash() method, and a new header to timedtextarea.xml, since it's really not copyright CHNM (it's really just a few lines off from the toolkit timed-textbox binding--I tried to change it to extend timed-textbox and just ignore Return keypress events so that we didn't need to duplicate the Mozilla code, but timed-textbox's reliance on html:input instead of html:textarea made things rather difficult).

To do:

- Pref/buttons to disable/clear/rebuild fulltext index
- Hidden prefs to set maximum file size to index/scan
- Don't index words of fewer than 3 non-Asian characters
- MRU cache for saved searches
- Use word index if available to narrow search scope of fulltext scanner
- Cache attachment info methods
- Show content excerpt in search results (at least in advanced search window, when it exists)
- Notification window (a la scraping) to show when indexing
- Indicator of indexed status
- Context menu option to index
- Indicator that a file scanning search is in progress, if possible
- Find other ways to make it index the NYT front page in under 10 seconds
- Probably fix lots of bugs, which you will likely start telling me about...now.
2006-09-21 00:10:29 +00:00
Dan Stillman
14b24f3638 Closes #259, auto-complete of tags
Addresses #260, Add auto-complete to search window

- New XPCOM autocomplete component for Zotero data -- can be used by setting the autocompletesearch attribute of a textbox to 'zotero' and passing a search scope with the autocompletesearchparam attribute. Additional parameters can be passed by appending them to the autocompletesearchparam value with a '/', e.g. 'tag/2732' (to exclude tags that show up in item 2732)

- Tag entry now uses more or less the same interface as metadata -- no more popup window -- note that tab isn't working properly yet, and there's no way to quickly enter multiple tags (though it's now considerably quicker than it was before)

- Autocomplete for tags, excluding any tags already set for the current item

- Standalone note windows now register with the Notifier (since tags needed item modification notifications to work properly), which will help with #282, "Notes opened in separate windows need item notification"

- Tags are now retrieved in alphabetical order

- Scholar.Item.replaceTag(oldTagID, newTag), with a single notify

- Scholar.getAncestorByTagName(elem, tagName) -- walk up the DOM tree from an element until an element with the specified tag name is found (also checks with 'xul:' prefix, for use in XBL), or false if not found -- probably shouldn't be used too widely, since it's doing string comparisons, but better than specifying, say, nine '.parentNode' properties, and makes for more resilient code


A few notes:

- Autocomplete in Minefield seems to self-destruct after using it in the same field a few times, taking down saving of the field with it -- this may or may not be my fault, but it makes Zotero more or less unusable in 3.0 at the moment. Sorry. (I use 3.0 myself for development, so I'll work on it.)

- This would have been much, much easier if having an autocomplete textbox (which uses an XBL-generated popup for the suggestions) within a popup (as it is in the independent note edit panes) didn't introduce all sorts of crazy bugs that had to be defeated with annoying hackery -- one side effect of this is that at the moment you can't close the tags popup with the Escape key

- Independent note windows now need to pull in itemPane.js to function properly, which is a bit messy and not ideal, but less messy and more ideal than duplicating all the dual-state editor and tabindex logic would be

- Hitting tab in a tag field not only doesn't work but also breaks things until the next window refresh.

- There are undoubtedly other bugs.
2006-09-07 08:07:48 +00:00
Dan Stillman
19763cc78a - Updated outward-facing "Scholar" references to "Zotero", along with a few of the internal ones that could be problematic to change later (DB, directory, GUID) -- let me know if I missed any
- About panel now gets version number automatically

- Change version from 1.0a1 to 1.0b1


* Important: If you're on an SVN install, you need to rename the scholar@chnm.gmu.edu text file in your profile extension directory to zotero@chnm.gmu.edu *

XPI installs will (I think) update automatically, since I kept an entry in updates.rdf with the old GUID
2006-08-30 07:05:57 +00:00
Simon Kornblith
c2c82e3c54 add basic Word integration. to see it in action, copy Zotero.dot to Microsoft Office 2004/Office/Startup/Word. if the gods are with you, you should see a new toolbar the next time you open Word.
not yet implemented:
- formatted in-text citations, rather than placeholders
- footnotes
- selection of citation style (for now, only APA is available)
- support for non-ASCII characters
- exclusion of notes from select items window
- Windows support (although it shouldn't be difficult)
- probably much more...
2006-08-28 05:38:37 +00:00
Simon Kornblith
62ffea9542 closes #209, Scholar does not refresh the item pane when a new collection is clicked
it's possible that this fix will introduce some bugs, but it appears to work fine
2006-08-25 19:15:03 +00:00
Dan Stillman
89acdf101c Fix #191, calling Scholar.Attachments.importFromURL on a PDF without PDF plug-in installed results in a prompt to save the file to the disk
Attachments.importFromURL() now first does a HEAD request to get the MIME type and passes that through Scholar.MIME.hasInternalHandler() (now abstracted from Scholar.File, along with the other MIME functions) -- if it can handle the MIME type, it uses a hidden browser; otherwise, it use a remote web page persist to save the file directly
2006-08-19 20:51:01 +00:00
Dan Stillman
794238c23f - Added file.js to chnmIScholarService.js
- Fixed bug in File.hasInternalHandler() (no access to navigator from XPCOM)

- Changed "View Attachment" action to check File.hasInternalHandler() and use window.loadURI() for internally handled files and nsIFile.launch() for external -- this prevents the user from getting a helper app dialog when they try to view external files. I basically had to duplicate most of Mozilla's content detection logic and "guess" whether or not it will be able to handle the file internally, which seems a little silly, but, while I feel there are probably better ways to do various parts of this, what's here seems to do the trick. Let me know if you notice it guessing incorrectly (i.e. you get a helper app dialog rather than having a file just open or it launches a file that should've just been loaded into the window). Also look for text files that should be launched rather than opened, especially XML-based data files, as this is a chance for Scholar to be smarter than Firefox itself--for example, OmniGraffle files, which are actually just XML files, normally open up in Firefox as an XML tree, but Scholar will launch them instead. (I imagine the same will need to be done for OmniOutliner, among other things...)
2006-08-12 03:45:57 +00:00
Dan Stillman
d67d96c321 Closes #7, Add advanced search functionality to data layer
Implemented advanced/saved search architecture -- to use, you create a new search with var search = new Scholar.Search(), add conditions to it with addCondition(condition, operator, value), and run it with search(). The standard conditions with their respective operators can be retrieved with Scholar.SearchConditions.getStandardConditions(). Others are for special search flags and can be specified as follows (condition, operator, value):

'context', null, collectionIDToSearchWithin
'recursive', 'true'|'false' (as strings!--defaults to false if not specified, though, so should probably just be removed if not wanted), null
'joinMode', 'any'|'all', null

For standard conditions, currently only 'title' and the itemData fields are supported -- more coming soon.

Localized strings created for the standard search operators


API:

search.setName(name) -- must be called before save() on new searches
search.load(savedSearchID)
search.save() -- saves search to DB and returns a savedSearchID
search.addCondition(condition, operator, value)
search.updateCondition(searchConditionID, condition, operator, value)
search.removeCondition(searchConditionID)
search.getSearchCondition(searchConditionID) -- returns a specific search condition used in the search
search.getSearchConditions() -- returns search conditions used in the search
search.search() -- runs search and returns an array of item ids for results
search.getSQL() -- will be used by Dan for search-within-search

Scholar.Searches.getAll() -- returns an array of saved searches with 'id' and 'name', in alphabetical order
Scholar.Searches.erase(savedSearchID) -- deletes a given saved search from the DB

Scholar.SearchConditions.get(condition) -- get condition data (operators, etc.)
Scholar.SearchConditions.getStandardConditions() -- retrieve conditions for use in drop-down menu (as opposed to special search flags)
Scholar.SearchConditions.hasOperator() -- used by Dan for error-checking
2006-08-08 02:04:02 +00:00
Simon Kornblith
cbe3611182 references #110, implement CSL for citation styling
add Scholar.Cite and Scholar.CSL for parsing items into a bibliography using CSL. unfortunately, the output is not very good at the moment, and the format likely needs some changes, but I'm working with a few other people on getting it to that point.
2006-07-22 01:25:46 +00:00
Simon Kornblith
c64e5c841f closes #78, figure out import/export architecture
closes #100, migrate ingester to Scholar.Translate
closes #88, migrate scrapers away from RDF
closes #9, pull out LC subject heading tags
references #87, add fromArray() and toArray() methods to item objects

API changes:
all translation (import/export/web) now goes through Scholar.Translate
all Scholar-specific functions in scrapers start with "Scholar." rather than the jumbled up piggy bank un-namespaced confusion
scrapers now longer specify items through RDF (the beginning of an item.fromArray()-like function exists in Scholar.Translate.prototype._itemDone())
scrapers can be any combination of import, export, and web (type is the sum of 1/2/4 respectively)
scrapers now contain functions (doImport, doExport, doWeb) rather than loose code
scrapers can call functions in other scrapers or just call the function to translate itself
export accesses items item-by-item, rather than accepting a huge array of items
MARC functions are now in the MARC import translator, and accessed by the web translators

new features:
import now works
rudimentary RDF (unqualified dublin core only), RIS, and MARC import translators are implemented (although they are a little picky with respect to file extensions at the moment)
items appear as they are scraped
MARC import translator pulls out tags, although this seems to slow things down
no icon appears next to a the URL when Scholar hasn't detected metadata, since this seemed somewhat confusing

apologizes for the size of this diff. i figured if i was going to re-write the API, i might as well do it all at once and get everything working right.
2006-07-17 04:06:58 +00:00
Simon Kornblith
45b9234996 addresses #78, figure out import/export architecture
- changes scrapers table to translators table; all import/export/web translators now belong in this table
- adds Scholar.Translate to handle translation issues. eventually, Scholar.Ingester.Document will become part of this interface
- adds Scholar_File_Interface (in fileInterface.js) to handle UI for export and eventually import. (David, when you have time, please connect Scholar_File_Interface.exportFile to a button.)
- adds an export translator for MODS. all of our metadata, but not our hierarchy (projects, etc.) translates directly and unambiguously into valid MODS. eventually, we can use RDF or another format to handle hierarchy.
- adds utilities.getVersion() and utilities.inArray() for simplified scraper coding
- fixes minor interface issues with the nifty chrome scraping status window
2006-06-29 00:56:50 +00:00
Simon Kornblith
7148852955 make generic Scholar.Utilities class and HTTP-dependent Scholar.Utilities.Ingester and Scholar.Utilities.HTTP classes in preparation for import/export filters; split off into separate javascript file 2006-06-26 14:46:57 +00:00
Dan Stillman
97940c7470 Replaced all instances of "Firefox Scholar" (not counting the repository URL) with "Scholar for Firefox" for now 2006-06-24 09:08:12 +00:00
Dan Stillman
726364d091 Scholar.History -- i.e. undo/redo functionality
Partially integrated into data layer, but I'm waiting to commit that part until I'm sure it won't break everything
2006-06-22 14:01:54 +00:00
Dan Stillman
448fde9ff1 Made the schema update system moderately less convoluted
- Broke schema functions into separate object and got rid of DB_VERSION config constant in favor of a toVersion variable in the _migrateSchema command (which isn't technically necessary either, since the version number at the top of schema.sql is now always compared to the DB version at startup) but will help reduce the chance that someone will update the schema file without adding migration steps)

- Removed Amazon scraper from schema.sql, as it will be loaded with the rest of the scrapers
2006-06-07 01:02:59 +00:00
Simon Kornblith
85d8153024 Add library, hooks for scraping MARC records. 2006-06-03 22:26:01 +00:00
Simon Kornblith
639a006efb XPCOM-ize ingester, fix swapped first and last name in ingested info, stop ingesting pages field (this should be for pages of the source used, not the total number of pages, right?) 2006-06-02 03:19:12 +00:00
Dan Stillman
d323df4a2d window.confirm() replacement for XPCOM 2006-06-01 21:57:12 +00:00
Dan Stillman
38d87463af Item.inCollection(collectionID) -- test if an item belongs to a given collection (currently uses a DB call--I'll optimize that later)
Scholar.Notifier framework to handle update notifications between data layer and interface

 - Notifier.registerColumnTree(ref) and Notifier.registerItemTree(ref) pass back a unique hash that can be used to unregister the tree later with unregister*(hash) (and must be, lest we leak treeViews and probably entire browser windows if the browser window is closed without unregistering the treeView)

 - Data layer calls Scholar.Notify.trigger(event, type, id) after various events (only two calls in the data layer at the moment--more coming later)

 - Notify.trigger() calls notify(event, type, id) on all registered trees of the appropriate type -- the data layer usually knows what collection the action pertains to, but we decided that it's cleaner to just let the tree decide what it wants to do rather than add all that logic into the data layer)

 (Note: Item collection adds appear to be buggy on the interface side, but removes seem to be working)
2006-06-01 20:03:53 +00:00
Dan Stillman
bc0463774f Move XPCOM-included files into subdirectory to keep separate from chrome files and rename overlay.js to scholar.js 2006-05-27 00:44:24 +00:00
Dan Stillman
f09def19f7 - Implemented singleton XPCOM component to store core Scholar objects
More details coming on Basecamp: http://chnm.grouphub.com/W161222

*** Important note: after checking out this code, be sure to delete the compreg.dat and xpti.dat files in your FF profile directory or else the extension will not load. They'll be regenerated when you start FF again, and you won't have to do it again unless we add interfaces or other components. Once I set up the XPI packaging system, this step won't be necessary. ***

- Localization properties are now loaded directly via nsIStringBundleService and available via Scholar.getString(name) -- removed stringbundle from XUL

- Updated status line in bottom right to reflect whether Scholar is loaded correctly or not (temporary, obviously)
2006-05-27 00:20:27 +00:00