Commit Graph

794 Commits

Author SHA1 Message Date
Simon Kornblith
cf7e7e3ca6 - adds support for SpringerLink
- fixes a bug in line reading interface when called from another scraper
2006-12-16 06:05:51 +00:00
Dan Stillman
3988bce5ac Closes #446, either add icons for new item types or implement a function to get the image src for a given item type
Adds Item.getImageSrc() and ItemTypes.getImageSrc(string itemType)
2006-12-15 23:06:36 +00:00
Dan Stillman
c58b8f245d Fix bug introduced in r958 with creating a new saved search 2006-12-15 22:26:37 +00:00
Dan Stillman
edfe4b73be Closes #331, Allow phrase searching from quicksearch
Closes #318, Use word index if available to narrow search scope of fulltext scanner
Closes #420, Delete local version of remote scrapers with priority 0 on update

- Changed ZoteroPane.buildItemContextMenu() to make updates easier
- Changed inTransaction repository update delay to 10 minutes
- Fix fulltext search of text files with MIME types that don't begin with 'text/'
- ZoteroPane.setItemsPaneMessage(msg) and ZoteroPane.clearItemsPaneMessage()
- New textbox binding conditional-timed-textbox to run a test (e.g. on the value) before triggering command
- Fulltext content search now supports ANY/ALL instead of just AND (I think)
2006-12-15 21:29:40 +00:00
Simon Kornblith
1fe4cbac92 adds scaffold, an extension to assist in translator development. scaffold is currently functional, but far from finished. to use, first install (the ID is scaffold@zotero.org), then write a translator in the "Code" tab and press the execute button. scaffold will execute the code in the last selected browser window, reporting any debug output or new items in the pane below. if an error occurs, the line at which the error took place is selected. besides that, the only other functionality implemented is the GUID generator. 2006-12-15 11:32:29 +00:00
Simon Kornblith
3982e1aabf - changed Zotero.Utilities.debug() to Zotero.debug(), for consistency and for the upcoming in-browser translator development tool
- various other preparations
2006-12-15 08:54:31 +00:00
Simon Kornblith
91492910ad addresses #427, Add abstract support to translators.
-translators may now attach abstracts simply by assigning a value to item.abstractNote
-added abstract support to PubMed translator
2006-12-14 22:58:00 +00:00
Simon Kornblith
148ddfaa45 -closes #301, COinS bugs/enhancements. adds support for patents in COinS. we still can't make much use of this, since no patent icon will show up in the URL bar until we resolve #446.
-adds strToISO, to convert a natural language date to an ISO-style date
2006-12-14 22:06:48 +00:00
Simon Kornblith
5127801160 - closes #434, remove SOAP dependency on Windows
- fixes a bug that could result in truncation of the bibliography by two characters
2006-12-14 20:57:50 +00:00
Simon Kornblith
e705bc21e5 closes #389, Date.strToDate() should return available parts even if no year 2006-12-13 07:13:35 +00:00
Simon Kornblith
0bdbfb12ee closes #432, Add hidden pref to enable clipboard export on Mac. The pref is extensions.zotero.enableMacClipboard
closes #312, Optional subdomains should be optional in scraper regular expressions.
2006-12-13 05:56:16 +00:00
Simon Kornblith
c6d4cdd57b - closes #391, Second export to same location with attached files fails
- removes extraneous debug code from Zotero RDF export
2006-12-13 05:23:39 +00:00
Simon Kornblith
857f0a907c closes #369, scrapers should store Repository field. the label is automatically used as the repository field, unless a translator explicitly sets the item's repository property to a value. if a translator sets the item's repository property to "false," no value is stored. 2006-12-13 05:05:03 +00:00
Simon Kornblith
6c2c33fc6d - closes #391, second export to same location with attached files fails (I think)
- improves RDF error handling
2006-12-13 03:37:58 +00:00
Simon Kornblith
986fea0b03 -closes #365, update import/export/bibliography to handle new item types. any fields I couldn't find in an existing RDF ontology use the Zotero namespace. we still have to decide if primary creators should be mapped to "author" in the RDF, and translated back out later (currently they aren't).
-adds Zotero.Utilities.getCreatorsForType to Zotero utilities
-makes CiteBase search translator error more gracefully
2006-12-13 03:18:57 +00:00
Simon Kornblith
2e05aacd8e use the correct names for imported URLs 2006-12-12 20:38:03 +00:00
Dan Stillman
2dc7a29af0 Closes #436, ability to force title when using Zotero.Attachments.importFromURL() 2006-12-12 20:06:13 +00:00
Simon Kornblith
bedd302bb3 addresses #365, update import/export/bibliography to handle new item types
Dan S's recommendations for handling the bibliography are now implemented. "article" is the default type mapping, and we use Zotero.CreatorTypes.getPrimaryIDForType to determine which type to treat as the author.
2006-12-12 19:53:26 +00:00
Simon Kornblith
c5ec016ed9 - closes #327, scrapers should either take snapshots or use URL field
- closes #351, scrapers with PDF downloads should use downloadAssociatedFiles instead of automaticSnapshots

there are some problems with snapshot titles. see bug #436.
2006-12-12 00:28:49 +00:00
Simon Kornblith
6c80c879da - closes #407, error in EBSCOhost translator
- closes #430, Amazon translator causing utilities.js to throw exception
- officially deprecated Zotero.Utilities.getNodeString() (use doc.evaluate and nodeValue or textContent instead, or access attributes directly; these options take the nearly the same amount of code, should be faster, and don't unnecessarily bloat our utilities)
- updated word integration to the latest version
2006-12-11 20:54:22 +00:00
Simon Kornblith
654f9c205d attempt to be better about preserving EZProxy URL. unfortunately, this won't fix everything, since if the domain of the saved URL is different from the domain of the accessed URL, there is no way to map the proxy. as far as I know, this only happens with JSTOR (where the stable URL domain is links.jstor.org instead of jstor.org). 2006-12-11 16:12:12 +00:00
Dan Stillman
a9cb13710c Fix error changing item type when fields don't exist in new type 2006-12-11 01:49:49 +00:00
Dan Stillman
77b631f04e Closes #299, Method for viewing a child item that shows up in a search in its hierarchical context
Right-click option "Show in Library" for items in collections and saved searches

Other changes:

- Fixed error when focusing a collection with no items
- selectItem() now takes an inLibrary option to always use the Library even if the item is in the current collection
- Reworked buildCollectionContextMenu() to be much easier to change (will do the same for buildItemContextMenu() eventually) -- this required moving some DTD strings to properties, which I only did for en-US now, but I'll do it for the other locales we have as well
2006-12-09 22:33:45 +00:00
Dan Stillman
5ad86d2f50 Add conference paper item type 2006-12-09 17:29:00 +00:00
Dan Stillman
fe92dd2cf0 Addresses #401, Add keyboard shortcuts
Improves tabbing between UI panes, including into metadata fields

Still some quirks and things that don't work but should (e.g. ctrl-tab to cycle through tabs in metadata pane and ability to add new creators via the keyboard), but better
2006-12-09 02:46:25 +00:00
Dan Stillman
1395432f87 Move CSS for item pane into separate file 2006-12-08 21:53:53 +00:00
Dan Stillman
8520125d6e Taking advantage of the new Notifier queuing, group item deletes into a single Notifier event queue -- this makes multi-item deletes much, much faster
I'm doing this manually with Notifier.begin(true)/commit(unlock) instead of putting them all in a DB transaction since Item.erase() erases files too, so rolling back previous deletes would be bad

Notice the finally {...} block -- this ensures that the event queue is unlocked even if there's an error deleting (or else notifications would break until Firefox was restarted)

Other changes:

- Zotero.Items.erase() now supports multiple items and the recursive flag to erase children
- Fixed a few JS strict warnings in the items view
2006-12-08 19:50:44 +00:00
Dan Stillman
b7b5ff2933 Closes #431, Add Notifier trigger hook to DB.commitTransaction() and queue notifications during transactions
unlock = Zotero.Notifier.begin(lock)
Zotero.Notifier.commit(unlock)
Zotero.Notifier.reset()
Zotero.DB.addCallback(type, callback)

begin(), commit() and reset() are added to beginTransaction(), commitTransaction() and rollbackTransaction(), respectively, on startup, so notifications are now automatically queued during DB transactions -- this has the potential to make complex operations dramatically faster

begin() can also be called manually -- pass true to indicate that intermediate commit()'s (e.g. called from commitTransaction()) shouldn't run the event queue, and pass the value returned to the matching commit() call. (The return value of commit() will be true if it is the first begin() to request a lock and false otherwise -- this allows multiple begin(true) calls to be nested without the nested ones triggering notification.

This does make trigger() order a bit less predictable, but I'm ordering events and types (e.g. calling modify events after add and before delete) in an attempt to avoid problems. We'll see if this works or we need a more sophisticated ordering/grouping scheme.
2006-12-08 19:40:54 +00:00
Dan Stillman
4bf390341a JS strict warning 2006-12-08 18:24:33 +00:00
Dan Stillman
a26bc9728d Workaround for nsIFile.launch() and reveal() not working on Linux/Unix
For launch(), we just send the file through the Firefox's external helper app dialog. For reveal(), we display the path pre-selected in a window so the user can quickly copy it into another window (e.g. a terminal).
2006-12-07 16:46:13 +00:00
Dan Stillman
b383fb6aa7 More snapshot-related tweaks:
- Only use saveDocument() for text/html snapshots

- Add 'application/xhtml+xml' and 'application/xml' as native MIME types

- When loading attachment, check recorded MIME type first before detecting
2006-12-07 14:12:00 +00:00
Dan Stillman
0d145cd47b Closes #416, Right-click to add attachment
Added "Save Link As Zotero Snapshot" and "Save Image As Zotero Snapshot" options to the browser content context menu where appropriate


Other fixes:

- Implemented standalone image and plugin snapshots the right way (as opposed to the fairly broken way from yesterday)
- Only natively handled files are loaded into a hidden browser when using importFromURL() -- plugin files are now saved directly with saveURI()
- indexDocument() doesn't try to index non-text files


Notes:

- There's no feedback when saving large files, which will likely be a bit confusing for users -- one option would be to put the transfer into the downloads window, though that's a little weird.

- I suspect this will fix the reported JSTOR PDF download issue (http://forums.zotero.org/discussion/217/), though I don't currently have a way of testing it.
2006-12-07 13:39:30 +00:00
Dan Stillman
afaa22d169 Fixes #429, Fails to build new db
Sorry about that
2006-12-07 03:41:23 +00:00
Dan Stillman
5876debd36 Closes #362, Support abstracts
N.B.: Some changes from plan on ticket

New methods:

Item.setAbstract(true|false) -- make a note an abstract (and clear existing abstract if there is one for source item) or clear abstract status
Item.isAbstract() -- returns true if note is an abstract, false if not
Item.getAbstract() - get itemID of child abstract note or false if none
ZoteroPane.toggleAbstractForSelectedItem()

Changed methods:

Item.updateNoteCache(text, isAbstract)
Notes.add(note, sourceItemID, isAbstract)
Item.setSource() -- moving abstract note to another source with an existing abstract or setting as an independent note will make note not abstract

Other changes:

- Context menu options in items pane: "Set note as abstract" and "Unset note as abstract"
- Child notes are now displayed before child attachments so that abstract will be first
2006-12-07 00:45:41 +00:00
Dan Stillman
f87d29a6b9 Zotero.MIME fixes:
- Don't try to get MIME type from extension if extension is blank
- Add text/css to native text types, even if snapshots add some html tags (why is that?)
- Get rid of extraneous "this." prefixes
2006-12-06 00:08:38 +00:00
Dan Stillman
be5ddb1505 Add support for taking snapshots of files handled by plugins (e.g. Flash, QuickTime, PDFs) with importDocument()
Apparently nsIWebBrowserPersist's nsIWebProgressListener never reaches STOP_STOP and STATE_IS_NETWORK in onStateChange() for plugin-handled files, so the import process wasn't completing. I'm now using onProgressChange() for such files.

Also:

- Moved DB commits out of callbacks so that transactions aren't left open if the progress listener never completes
- Blocked attempts to call snapshots on plugin files with file:// URLs, since they're one case where the listener doesn't work properly 
- Added Zotero.MIME.hasNativeHandler() to be able to distinguish between natively handled files and plugin-handled files.
- Fixed a couple bugs that might have made prevented snapshots from working properly
2006-12-05 23:23:01 +00:00
Dan Stillman
9bc8d1356a Another attachment error recovery improvement 2006-12-05 16:57:12 +00:00
Dan Stillman
023e755eb6 Allow a DB.rollbackTransaction() even if a transaction isn't in progress 2006-12-05 16:50:47 +00:00
Dan Stillman
02f205e919 Fix snapshots of pages without extensions on Linux -- nsIMIMEService::getPrimaryExtension() doesn't work on Linux
Better error recovery in attachment methods
2006-12-05 16:49:31 +00:00
Dan Stillman
a16552cd72 Fixes #423, show/hide keyboard shortcut doesn't work unless Zotero pane is de-selected
I believe this should fix the problem without any ill effects.
2006-12-04 08:17:05 +00:00
Dan Stillman
b92830fb28 Might as well not go out of our way not to work in IE... More CSS fixes coming. 2006-12-01 19:44:59 +00:00
Dan Stillman
d3e29108a8 Addresses #400, Report generation
A work in progress:

- Implemented zotero:// custom protocol handler, which will likely be useful for other things too
- First version of XHTML/CSS detail view -- definitely needs feedback, work, and refinement but is more or less functional
- Added XUL-side interface and context menu options for loading report URLs

Going forward:

- Other formats (RTF, CSV)
- Other views (list view, annotated bibliography, etc.)
- Report options window (let the user which fields to include (with saved templates?))
- Ability to specify custom CSS files?
- Extension of Zotero protocol handler to trigger Zotero events? This would allow more interactive reports with the ability to click to select items in the Z pane, run searches by clicking on tags, etc., but would have to be limited to idempotent actions.

Other changes:

- ZoteroPane.getSortField() and ZoteroPane.getSortDirection() 
- Zotero.Utilities.htmlSpecialChars(str)
- Fixed sort direction in items pane (triangle icon now goes the right direction, though the default direction on clicking a new column is incorrect)
- firstCreator now included in toArray(), though it's not particularly correct (#287, more or less)
- ZoteroPane.getSelectedCollection/SavedSearch/Items now take asIDs parameter to return ids instead of objects
2006-12-01 06:01:26 +00:00
Dan Stillman
ab7f618a3e Allow loading of saved search in constructor 2006-12-01 05:37:21 +00:00
Dan Stillman
412bf73a3c Fix broken tag selector 2006-11-29 05:08:20 +00:00
Dan Stillman
2ccdd3a51d Added prefs extensions.zotero.debug.log and extensions.zotero.debug.level to determine terminal logging, defaulting to off 2006-11-28 19:34:56 +00:00
Dan Stillman
edccbe4ad8 Zotero.safeDebug() -- for displaying objects without worrying about recursion or errors 2006-11-26 23:55:12 +00:00
Dan Stillman
361a1e4bc6 Add minVersion/maxVersion to translators schema and schema update mechanisms (local and remote) -- these aren't really necessary on the client but let us use the same SQL to update the repo, and we probably should include them in error reports (instead of relying on different timestamps to differentiate versions)
Added minVersion and maxVersion times to existing scrapers, setting 1.0.0b3.r1 as minVersion for any >4096 characters; these could theoretically now be added back to the repository without problems, but there's not really much reason to test that theory at the moment
2006-11-26 09:19:07 +00:00
Dan Stillman
cc8ef0b93d Fixes #377, Problems scraping from Hubmed/PubMed
Fixes #381, SIRSI scraper no longer working at William & Mary

And new Amazon scraper. And a few COinS errors. And possibly some others.

It turns out Firefox has a bug in which DOM nodeValues greater than 4096 characters are split into multiple nodes, and so any scrapers pulled from the repository with 'code' fields greater than 4K were being truncated. We didn't see it during testing of repo code because most are smaller.

Calling normalize() on the node combines the nodes, so future releases won't have the problem regardless of when it's fixed in Firefox. For existing installs, I managed to get PubMed, COinS, SIRSI 2003+, and, with quite a lot of effort, Amazon, under 4096 characters, hopefully without breaking anything. I removed all other scrapers from the repository for now.
2006-11-24 06:09:17 +00:00
Dan Stillman
7a1339158a Display a warning sign over the Zotero logo in the status bar if there's a startup error 2006-11-22 15:51:55 +00:00
Dan Stillman
a5594cb4dc Added a hidden separator in the actions menu that utilities can unhide and add a menu option after -- this will allow for a section for utility options without having a menuseparator for each one
<menupopup id="zotero-tb-actions-popup">
	<menuseparator id="zotero-tb-actions-utilities-separator" hidden="false"/>
	<menuitem insertafter="zotero-tb-actions-utilities-separator" label="Hello world"/>
</menupopup>
2006-11-21 16:40:44 +00:00