Commit Graph

137 Commits

Author SHA1 Message Date
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
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
Dan Stillman
5cba06673e Add ids to actions menu for utility overlay hooks 2006-11-21 16:29:25 +00:00
Dan Stillman
c371dd7603 Fix old methods in Notifier 2006-11-21 16:24:33 +00:00
Dan Stillman
c72df62264 Fix saving of gzipped CSS files via nsIWebBrowserPersist -- this will fix some of the pages for which snapshots were losing the CSS, but it doesn't address the @import issue 2006-11-21 16:05:41 +00:00
Simon Kornblith
060e2942a0 actually commit the modified utilities.js this time 2006-11-21 07:46:38 +00:00
Simon Kornblith
445ff98277 - made doGet handle multiple urls, with processor/done style interface (as in processDocuments). this should be backwards compatible
- beginnings of mapping for new item types
- fixes for Word integration (because i was using it to write a paper)
2006-11-21 07:14:27 +00:00
Dan Stillman
3d6bfbe6d5 Fixes #386, Context menu option for creating a new subfolder
Fixes #226, Insert new collections and saved searches in the proper order

Also:

- Only display "New Collection..." and "New Saved Search..." in Library drop-down
- Sort collections and saved searches case-insensitively
2006-11-18 19:48:33 +00:00
Dan Stillman
fb220f6b7b Fixes #74, Add an "Update Now" button in the prefs to manually query the repository for updated scrapers 2006-11-17 23:49:39 +00:00
Dan Stillman
67f68194af Add overflow: hidden to z-pane, which isn't a great solution to anything but will help prevent overflowing the status bar
Reduce minimum tags selector height

Removed html:div in tags selector and just add display:block to vbox
2006-11-15 15:48:18 +00:00
Dan Stillman
4a8150203a Fix for startup error when trying to rebuild the fulltext index with a text file that doesn't have a charset (which shouldn't happen, but apparently it can if there's some undetermined error in the attaching process) 2006-11-11 19:17:16 +00:00
Dan Stillman
8090e04318 Deprecated Notifier.(un)register(Item|Collection)Observer() in favor of a single (un)registerObserver() method -- observers can still be limited to specific types by passing an array of types (or a single type as a string) as the second parameters to registerObserver()
e.g. registerObserver(callback, ['collection', 'search'])
2006-11-10 09:26:54 +00:00
Dan Stillman
54790c13d8 Purge tags on item delete 2006-11-10 09:23:33 +00:00
Dan Stillman
300c2f1f0f Tag conditions from tag selector should be required (though an option to find the union of selected tags might be worthwhile) 2006-11-10 05:18:28 +00:00
Dan Stillman
3f59f808e3 Tag Selector pane -- filter the current items view by one or many tags
Will be getting a lot more functionality (e.g. renaming, deleting, maybe assigning of tags from the pane), some UI changes, and possibly some modified behavior (e.g. should it only show the available tags for the items that you're viewing, show all and let you use the interface to assign tags (say, by batch drag and drop), or have a checkbox to toggle between the two modes)

Other notes:

- Implemented as XBL binding, so should be reusable elsewhere if necessary
- Needs a better icon and possibly different icon placement
- Doesn't handle live updating of modified tags yet -- will need a Notifier target
- New methods Tags.getAll() and Tags.search()
- I really wish I'd created a ticket for this so I could check it off
2006-11-09 13:33:49 +00:00
Dan Stillman
7bb4091110 Added 'noChildren' search condition and switched main items view to always use a search rather than getItems(), for reasons that will become clear soon 2006-11-09 11:12:53 +00:00
Dan Stillman
a871f8977a Error when repository can't be contacted 2006-11-08 04:30:51 +00:00
Dan Stillman
de3dd85016 Fix error when linking to plaintext file (caused wait cursor to stay active on Linux) 2006-11-08 04:30:23 +00:00
Dan Stillman
cdbe354b0b Don't show Add Note/Attach Snapshot options in context menu when multiple items are selected 2006-11-08 04:29:54 +00:00
Dan Stillman
d0d3f80a61 Much improved date handling in searches and autocomplete
Fixes #338, Dates in search window should be converted to UTC before searching
Addresses #220, Add a more friendly way to enter dates in search window and accessDate field

- Unless passed a full datetime, the search system automatically parses the string with strToDate(), so one can search for an accessDate, etc., using a freeform phrase. It will use the SQL parts where available and also search for remaining words individually, so "November 6, 2006" will find '2006-10-06 Nov. 6 2006' and "Summer 2006" will find '2006-00-00 Summer 2006". It will also properly handle SQL parts, so "August 2006" in the is/isNot operator will use "LIKE '2006-08-__'" (underscore being the single-character wildcard) and isBefore will use '2006-08-00'

- Stored UTC dates are converted to localtime in the search system when searching on just a date part, since otherwise searching for a local date with a UTC timestamp after midnight would be unsuccessful

- Date field autocomplete is now disabled in the search dialog, but on the off-chance that it's used somewhere, the autocomplete will now return just the user part of a multipart date field

- Access date autocomplete only returns date, not datetime

- Fix for Date Added and Date Modified showing as UTC

- Date.isSQLDateTime()


Known issues:

- accessDate field in metadata pane still requires SQL format

- Proper parsing of search dates with no years (e.g. searching for "August 25") depends on #389, "Date.strToDate() should return available parts even if no year"
2006-11-06 12:05:57 +00:00
Dan Stillman
d52a302bc0 A few more tiny glitches with search date age mode 2006-11-05 09:46:56 +00:00
Dan Stillman
989e79f9b1 Fix small problem in search dialog with saved string representation of isInLast value persisting to a regular textbox of another condition 2006-11-05 09:34:03 +00:00
Dan Stillman
de5b998139 Closes #388, Use relative paths for imported attachments
Also fixes breakage of linked files since multiple attachments update
2006-11-05 09:13:01 +00:00
Dan Stillman
bfe62046d1 Fixes #339, Saved search dialog doesn't expand when you add new conditions
Addresses #155, Localize strings

- Fixed flex/overflow issues with search dialog
- Localized "Name:" in search dialog
- Disabled hover color for disabled clicky buttons with CSS3 not() selector and removed "unclicky" class
2006-11-05 08:18:06 +00:00
Dan Stillman
f91134edd7 Added isInTheLast search condition and interface support 2006-11-05 06:54:22 +00:00
Dan Stillman
e73285ffc5 Improve date field handling
- Item.setField() stores dates in a multipart format beginning with an SQL date followed by the user's entry, so "November 3, 2006" becomes "2006-11-03 November 3, 2006" -- date field entries are parsed with Zotero.Date.strToDate() if not already in multipart format

- Item.getField() returns just the user part unless passed the new second parameter, _unformatted_, which returns the field directly from DB without processing (e.g. the full multipart string)

- Added SQLite triggers on the itemData table to enforce multipart format even if the table is modified outside the API

- Migration step to update existing dates

- Indicator next to date field to show what we've parsed and a tooltip over the date field to show the SQL date -- though I'm not sure how well the abbreviation part will localize (i.e. can you abbreviate 'month' in Chinese?)

One obvious problem is how to handle date ranges when sorting or searching, which may end up rendering this whole method fairly useless (though I guess the multipart format could begin with two SQL dates instead of just one, at the cost of some storage space...).


Other changes:

- Utilities.lpad() handling for undefined value parameter

- new Zotero.Date methods: strToMultipart(), isMultipart(), multipartToSQL(), multipartToStr(), isSQLDate(), sqlHasYear(), sqlHasMonth, sqlHasDay getLocaleDateOrder() (the last one unused for now)

- try/catch around manual itemData INSERT execute() statements in Item.save()
2006-11-03 09:23:24 +00:00
Dan Stillman
9172622c72 Closes #374, File attachment dialogs should accept multiple files at once 2006-11-01 07:39:13 +00:00
Dan Stillman
4ed836d7d0 Addresses #155, Localize strings
Localizing some remaining hard-coded strings and get rid of programmatically added colons

Also added .zero strings for various count properties, since plural logic from English won't apply to all languages
2006-11-01 01:27:20 +00:00
Dan Stillman
58558c37a3 Fix for error when creating new items or attachments with saved search selected
Item.getSource() no longer protests when called on a regular item (it just returns false)
2006-10-31 21:03:08 +00:00
Simon Kornblith
58150dd94e addresses #377, Problems scraping from Hubmed/PubMed
makes scrape icon disappear when navigating away from a page
2006-10-30 06:08:33 +00:00
Simon Kornblith
e1af280017 fix doc.domain errors on load 2006-10-30 05:44:48 +00:00
Dan Stillman
b7dacb664e Fix incorrect folder permissions breaking attachments on Linux 2006-10-29 19:39:21 +00:00
Dan Stillman
ef8cd4a5e6 We'll start without automatically adding quotes -- might be handy, but there's the problem of double-quoting text with existing double quotes, and without a manual collation function they all end up sorted to the top
We'll see what the feedback is.
2006-10-25 04:34:34 +00:00
Dan Stillman
65ef6a6926 A very quick little addition to please the masses
Add options to browser context menu, "Add Selection to Zotero Note" and "Create Zotero Note from Selection"

"Add Note" context menu option on items
2006-10-25 04:07:40 +00:00