Commit graph

688 commits

Author SHA1 Message Date
Dan Stillman
7eceb4e724 Intermediate step to get rid of chromeFiles -- we have a build script anyway
Not done yet
2006-10-02 23:38:33 +00:00
Dan Stillman
8d71c09d40 Renaming scholar directory to zotero
Not done yet
2006-10-02 23:30:22 +00:00
Dan Stillman
b3dd7dfa18 Renaming scholar directory to zotero
Not done yet
2006-10-02 23:25:11 +00:00
Dan Stillman
8351c81299 Renaming scholar directory to zotero
Not done yet
2006-10-02 23:23:49 +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
eccc2159c1 Oops--CSL table needs to be defined in scrapers.sql too.
(The problem with the current system is that any local translators or styles will be wiped out on upgrades (though not auto-updates), but the solution for that is probably to just offer an SQL file that the user can put custom SQL statements in to be run on upgrades (sorta the same idea as user.js in Firefox). Will deal with that at a later date, though.)
2006-10-02 21:25:47 +00:00
Dan Stillman
0246e79538 Stop appending ".html" to snapshots that already have it (incorrect substr) 2006-10-02 19:21:25 +00:00
Dan Stillman
40c9e620e7 - Note icon in toolbar no longer opens a new window by default, though it does if you hold down the shift key when clicking (let's hear it for undocumented features)
- Removed Note from New Item (+) menu
- Replaced "#" column with "+", at Dan C.'s suggestion
2006-10-02 06:44:16 +00:00
Dan Stillman
f27d748246 Fix broken scraping and indexing 2006-10-02 01:29:09 +00:00
Dan Stillman
508b35f6d1 1) By "Scrapers don't save metadata properly" in my last commit, I meant only URL and accessDate, though on second thought they probably will work.
1b) However, I also did, in fact, break scraping completely, so my previous statement was actually correct. Fix for that coming right up.

2) Fixed problem with translators table getting wiped out completely whenever system.sql was updated (from r671, I believe). Right. Moved the DROP and CREATE statements for translators into translators.sql.
2006-10-02 01:07:56 +00:00
Dan Stillman
b684e97366 Closes #252, Metadata not displaying for page snapshots
Closes #304, change references to "website" to "web page"

More changes as per discussions with Dan:

- Linked URLs have been given a second chance at life, though they still shouldn't be used for (most, if any) scrapers (which should use snapshots or the URL field instead)
- Renamed the "website" item type to "webpage"
- Removed "web page" from the New Item menu
- Added Save Link To Current Page toolbar button
- Added toolbar separator between New Item buttons and link/attachment/note to differentiate
- Added limited metadata (URL and accessDate) for attachments
- URL for attachments now stored in itemData (itemAttachments.originalPath is no longer used, but I'm probably not gonna worry about it and just wait for SQLite to support dropping columns with ALTER TABLE) -- getURL() removed in favor of getField('url')
- Snapshots now say "View Snapshot"
- Added Show File button to file attachments to show in filesystem
- Added timed note field to attachments for single notes and adjusted Item.updateNote(), etc. to work with attachments
- Fixed bug with manually bound params in fulltext indexer and Item.save() (execute() vs. executeStep()) -- any recently added items probably aren't in the fulltext index because of this


Known bugs/issues:

- Attachment metadata and notes probably aren't properly imported/exported now (and accessDate definitely isn't)
- Scrapers don't save metadata properly
- Attachment title should be editable
- File attachments could probably use some more metadata (#275, more or less, though they won't be getting tabs)
2006-10-02 00:00:50 +00:00
Dan Stillman
100bf182da Fixed regression from r696 -- snapshots not getting saved to the current collection 2006-10-01 19:59:34 +00:00
Dan Stillman
d4e2b42d46 Fix typo in itemTypeManager createDumpSQL() 2006-10-01 09:47:44 +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
a972a035c7 Closes #260, Add auto-complete to search window
And fixed a bug that caused the text of some search conditions to not display when editing a previously saved search

Also added autocomplete to more fields in metadata pane:

- creator
- publisher
- place
- publicationTitle
- journalAbbreviation
- seriesTitle
- seriesText

It should also do the type and medium fields, but they need to be separated out first--e.g. artworkType, interviewMedium--since they're describing different data
2006-10-01 08:09:53 +00:00
Dan Stillman
66729ed1e2 Fix error that breaks the item tree after creating a new empty note from the new item menu
(ItemTreeView's getField() had a bug -- switched to just use Item.getField(), which already handles notes properly)
2006-09-30 22:53:01 +00:00
Dan Stillman
7fed86b389 Closes #295, Dragging an independent file/note over an item should turn the file/note into a child item
Overhaul of the item drag and drop functionality, allowing dragging notes and attachments into and out of other items and addressing all the related issues that arise when that's possible.

Should also be generally smarter about deciding what can be dragged and dropped where and in what modes.

Let me know if something doesn't work as you expect.
2006-09-29 20:35:19 +00:00
Dan Stillman
4fcddf42ec Closes #297, Toolbar button 'S' needs to be replaced with 'Z'
Icons from Ken

Of course, I realized just now that this is really quite similar to the stop sign, and anyone who puts this to the left of their URL bar and doesn't have a Home icon in their toolbar will get the two next to each other... Looks good otherwise, though.
2006-09-27 20:24:39 +00:00
Dan Stillman
20c46cf1e1 Fixes #263, view page button overflows window 2006-09-27 17:35:27 +00:00
Dan Stillman
610f5b2c3a Update Item.save() to use manually bound parameters for itemData
This should theoretically speed up large imports a bit.
2006-09-27 17:11:38 +00:00
Dan Stillman
c490020031 Merge DB.statementQuery(sql, [params]) and DB.getStatement(sql), since they're actually the same when _params_ is left out -- replaced all calls to statementQuery() with getStatement() 2006-09-27 17:09:43 +00:00
Dan Stillman
68e9806ec3 Missed file for "web page" change
Refs #304, change references to "website" to "web page"
2006-09-27 16:39:34 +00:00
Dan Stillman
27f89fac5e Cross-posting to BC for discussion: http://chnm.grouphub.com/projects/310105/msg/cat/2114872/3538662/comments
Changes as per my discussions with Dan:

- Separated snapshot functionality into two individual buttons, Create New Item From Current Page and Take Snapshot of Current page
- Updated schema to support primary, secondary and hidden item types (and future user customizations)
- Reorganized New Item menu, moving secondary items into sub-menu
- Removed ability to create link attachments, since it never really made much sense -- will simply use the webpage item type instead. Underlying functionality still exists for the time being, as people have existing links in their libraries--I think we're gonna have to just warn beta testers and delete them in a transition step, as converting nested links really wouldn't be worth the effort.
- Moved file link/add functions into new item menu and removed attachment drop-down
- Large, prominent View and Locate buttons in edit pane for going to an associated URL and looking up in OpenURL, respectively -- buttons gray out as appropriate
- New Item from Page stores the URL and access date (Item.save() checks for the string "CURRENT_TIMESTAMP" for accessDate and doesn't bind it as a string)
- "Website" to "Web Page" (do we prefer "Webpage"? they both look a bit funky in uppercase)

More coming.


Bugs/Known Issues:

- Since snapshots from the toolbar are now top-level in the current collection, there needs to be a way to drag them into items
- The camera icon for adding snapshots, despite being a famfamfam icon, really doesn't read too well (or perhaps just clashes with the rest of our icons). Anybody have a better one? (It also may be able to just be lightened up a bit.)
- Trying the large View/Locate buttons after discussions with Dan, but this approach may not work -- 1) a large View button for the URL makes a lot less sense when you have a parent item with a child snapshot, since people will end up clicking it all the time when they really want to view the snapshot, and 2) the Locate button is awfully big for something that only applies to certain types of items, may not get used very often when it does, and probably won't work when it is
- The access date is stored in UTC and displayed with toLocaleString() like Date Added and Date Modified, but, unlike those two, it's also user-editable. This is clearly a problem. Probably need to parse to Date on blur() with strToDate() and insert as UTC, discarding anything left over. 
- Item type itself is still "website" -- should probably change that while we still can


Closes #253, OpenURL arrow should provide visual feedback on mouseover and/or look more button-like
Addresses #304, change references to "website" to "web page"
Addresses #207, openurl arrow functionality
2006-09-27 08:12:09 +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
70b2772381 Fixes #284, Hitting Tab in a tag field causes the field to remain open until the next load
Adds tab handling to tags interface, which also addresses beta tester requests for a quicker way to enter multiple tags

This is getting pretty messy, but it's still probably better than repeating all the itemPane.js in tagsbox.xml.

One known issue is that, since it resorts the list of tags after a change, if you change an existing tag to a name that alters its current position and then tab away, you don't necessarily end up in the field you expect.
2006-09-25 00:43:40 +00:00
Dan Stillman
13104590d2 Array test in DB.statementQuery() didn't work if array was passed from the autocomplete service 2006-09-24 08:22:19 +00:00
Dan Stillman
3b55fe520c Fixes #288, Add back comma after last name in item edit pane 2006-09-23 23:40:10 +00:00
Dan Stillman
73ff76aa39 Use active window if non specified in Scholar.ProgressWindow() 2006-09-23 09:09:55 +00:00
Dan Stillman
27d1d63bfc Sped up fulltext indexing (of loaded documents, at least) by about 75%
- Switched to manually repeated bound parameters in indexWords()
- Switched to the innerHTML regex used elsewhere instead of a more proper but nevertheless misguided DOM traverser to split elements in indexDocument

This may invalidate the fulltext progress indicator ticket
2006-09-23 09:05:01 +00:00
Dan Stillman
3f0fb0e4e6 Fix broken item deleting (fulltext regression) 2006-09-23 08:00:01 +00:00
Dan Stillman
9bc5c4435e Cloess #221, Add status line in preferences pane to indicate if preferences don't take effect immediately 2006-09-23 00:22:29 +00:00
Dan Stillman
8303028a85 Closes #228, Use a unique default "Untitled" name for new saved searches
Collections too

- Also fixed JS strict warning in Item.erase()
2006-09-22 23:53:16 +00:00
Dan Stillman
fc2be86681 Closes #292, "Delete From Library" context menu option in collections
Library or Saved Search:

"Delete Selected Item From Library..."

Collection:

"Remove Selected Item"
"Delete Selected Item From Library..."
2006-09-22 09:01:25 +00:00
Dan Stillman
f5e55d21bf Closes #296, Delete from collection doesn't need warning
Still need #292, "Delete From Library" context menu option in collections

This may or may not help people understand that deleting from a collection doesn't by design delete from the library, but, regardless, this is the same behavior as iTunes.
2006-09-22 08:26:54 +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
93c15fc061 Allow for single objects as bound parameters without wrapping in array (e.g. DB.query(sql, {string:isbn})) 2006-09-20 23:20:11 +00:00
Dan Stillman
302f0105bf Fixes #311, after deleting database, no new database is created
Well that probably would've been mildly frustrating for new users.
2006-09-20 02:15:49 +00:00
Simon Kornblith
0f8c3e7669 - makes proxy detection work with domain-based EZProxies (I think)
- fixes Word Integration bugs
2006-09-14 02:51:45 +00:00
Dan Stillman
fe319f033b Schema and Item Type Manager updates to handle item type templates
Note that there's no code for user types and fields yet -- just the schema (actually there's a tiny bit of code in the item type manager, since we'll probably use some of the same methods for managing user types, but not much)

Templates for primary item types are currently only used by the item type manager to make creating new types easier and to prevent the removal of fields from an item type that are associated with its template item type -- the fields are all still recorded in itemTypeFields, since they might have different orders or default visibility settings from their templates
2006-09-13 22:04:54 +00:00
Dan Stillman
287e082805 Changed schema update system yet again -- removed DROP TABLE IF EXIST's from user.sql in favor of CREATE TABLE IF NOT EXIST's and changed schema.js to automatically migrate and then reload user.js if the version number has gone up
This lets us add tables to user.sql without writing migration steps for them yet still have the ability to change existing user tables and migrate data if necessary.

Also added _getDropCommands() to do a regex on the SQL file and create the DROP TABLE|INDEX steps necessary to use the DB_REBUILD flag without DROP commands in the SQL file itself, before I realized that it probably made the most sense to just delete the SQL file and storage directory. Changed _initializeSchema() to do that instead. Leaving _getDropCommands() in, in case there's ever a need for it.
2006-09-13 21:34:37 +00:00
Dan Stillman
91def29078 Closes #189, "extra" field should allow multiple lines
Using Shift-Enter as the save keystroke within the Extra textbox so that people can use Enter to create multiple lines of text. Shift-Enter would normally be the newline command, but that's probably a convention that non-technical users of Zotero wouldn't know... Tab (and other triggers for blur()) also saves, and since Extra is the last field, tabbing away functions the same as hitting Enter does for other fields, so it's probably not that big of a deal.
2006-09-12 08:47:24 +00:00
Dan Stillman
b84181766d Fix bug in db.js::statementQuery() that prevented binding a single string parameter without putting it in an array
Also fixed array detection in flattenArguments() to handle a null value
2006-09-12 06:53:48 +00:00
Dan Stillman
cc726ef333 Not that it should happen, but survive an item with an item type of 0 or undefined (and more importantly, let you delete or change it) 2006-09-12 05:20:43 +00:00
Simon Kornblith
7c3e054ebc addresses #301, COinS bugs/enhancements; remaining issue blocked by #3 (add as many item types as possible) 2006-09-11 22:34:39 +00:00
Simon Kornblith
ecfff1393f - closes #225, ability to cite a specific page/paragraph/etc in Word integration. the output isn't quite right at the moment, but the interface works.
- removes net icons that haven't been used in months
- fixes another date bug (the last one, i hope)
- renames CSL class to Scholar.CSL
2006-09-11 01:05:26 +00:00
Dan Stillman
b6f78acfd8 Don't reuse item type and field ids in the item type manager anymore 2006-09-10 20:16:48 +00:00
Dan Stillman
14e3b05ca4 Separated schema into two files, system.sql and user.sql -- the former contains tables that can be wiped and reinitialized at any time *as long as ids are kept the same* (like scrapers.sql), whereas the latter contains user data that has to be migrated from one version to the other with transition steps
This should make development much easier, as we can, for example, add 80 item types without having to write transition steps

Pretty sure this won't delete anyone's data. Might want to test that theory, though.
2006-09-10 20:08:59 +00:00
Simon Kornblith
3dfca25879 - closes #277, disambiguation and notifier updates for Word integration
- closes #217, ability to exclude notes/attachments from select items window
- closes #244, ability to quick search from select items window
- fixes a bug with footnotes in Word integration
- fixes a bug in InnoPAC translator where items would sometimes appear twice
2006-09-10 17:38:17 +00:00