Commit graph

484 commits

Author SHA1 Message Date
Dan Stillman
d456255b94 Allow multiple ids in notifier add/item events on interface side
(I didn't actually test this...)
2006-08-15 21:11:52 +00:00
Dan Stillman
844fcc0ee9 Run _loadChildItems() in Collection.loadFromRow() so that _childItems.length is calculated properly 2006-08-15 20:38:20 +00:00
Dan Stillman
7f13072ef4 Added Scholar.Notifier.enable() and disable() to turn on and off trigger() notifications (enabled at startup)
Changed 'smartcollection' notifier type to 'search' and reduced hash length to 2
2006-08-15 19:59:17 +00:00
Simon Kornblith
51108446e3 closes #187, make berkeley's library work
closes #186, stop translators from hanging

when a document loads inside a frameset, we now check whether we can scrape each individual frame.
all functions involving tabs have been vastly simplified, because in the process of figuring this out, i discovered Firefox 2's new tab events.
if a translator throws an exception inside loadDocument(), doGet(), doPost(), or processDocuments(), a translate error message will appear, and the translator will not hang
2006-08-15 19:46:42 +00:00
Dan Stillman
009a4ad520 Fix search brokenness from r453 2006-08-15 04:59:09 +00:00
Dan Stillman
3a18dcb70f Unsaved creators are no longer saved (e.g. on creator type change) if they don't have a firstName or a lastName
(Also fixes bug from r379 where changing creator type on a blank unsaved creator would actually insert "(first)" and "(last)")

Localized '(first)' and '(last)'


Refs #179, adding a new creator then clicking an existing creator makes the creator field disappear
2006-08-15 03:19:11 +00:00
Simon Kornblith
b35ba91c15 closes #185, Citations shouldn't add a period to reference titles that already end with punctuation marks 2006-08-15 01:26:14 +00:00
Simon Kornblith
37a6684546 write "?" if a character cannot be converted to UTF-8 (although i'm not sure how this would ever happen) 2006-08-15 01:09:06 +00:00
Simon Kornblith
52fe187328 closes #184, support non-ASCII characters in HTML and RTF. since we use the unicode features of RTF 1.5, this requires Word 97 or later on a PC (or presumably Word 98 or later on a Mac) to read.
fixes one last strict mode bug
2006-08-15 01:05:20 +00:00
Simon Kornblith
c18f75d667 show fewer warnings in strict mode 2006-08-14 22:28:22 +00:00
Simon Kornblith
ba1a383aa1 don't throw an error trying to make a bibliography with an item with no date (thanks Dan) 2006-08-14 22:05:58 +00:00
Simon Kornblith
dac5bbb3f3 closes #183, export bibliography to RTF 2006-08-14 21:54:45 +00:00
Simon Kornblith
feff0aa531 closes #53, export to footnote or bibliography
closes #180, make all contextual menu export/create bibliography options work right

also:
- add Chicago Note style output
- unregister RDF data sources from cache after import
2006-08-14 20:34:13 +00:00
Dan Stillman
46fa6484a5 Fix last unhelpful debug message in db.js 2006-08-14 18:44:28 +00:00
Dan Stillman
c92faace52 Fixes #179, adding a new creator then clicking an existing creator makes the creator field disappear
Fixed a number of creator-editing-related issues (mostly interface-side, with a little help from the data layer):

- New row no longer disappears when clicking "+" and then clicking the existing or new creator (removed onselect="ScholarItemPane.loadPane(this.selectedIndex)" on the <deck> (from r371, with changelog "Individual tabs don't load their content unless selected"), which doesn't seem to be necessary as far as I can tell)

- New row no longer disappears when changing creator before editing names (setting the creator type now triggers an Item.save() with an otherwise blank creator (now allowed by the data layer), which isn't entirely ideal but is probably OK for now)

- Clicking the minus button on an unsaved row (i.e. one just created with the plus button) no longer throws an error (new method Item.hasCreatorAt(pos), and ScholarItemPane.removeCreator() just deletes the label directly, since it doesn't get a notify() event to reload the pane)

- The plus button is disabled on unsaved rows, since allowing the user to create multiple unsaved rows and then edit one in the middle is problematic (and the other alternatives have their own problems); the minus button is also disabled on the default row that shows when there are no creators

- Creator type is no longer reset when editing a name field

- Name field is no longer erased when clicking directly on creator type popup and changing creator type without blurring textbox

- Comma is appended to last name when switching from <textbox> to <label> without saving changes (before it was just appended to labels when the pane was loaded)
2006-08-14 10:02:00 +00:00
Simon Kornblith
bb07710b34 okay, i actually tested it this time, so i'm pretty sure i got all the bugs out. no, i am not just cheating to get closer to the illusive r500. 2006-08-14 05:23:39 +00:00
Simon Kornblith
45f84fb31f actually fix the bug properly this time 2006-08-14 05:15:52 +00:00
Simon Kornblith
a67b8c8b95 oops. saw a bug looking over my diff. 2006-08-14 05:14:16 +00:00
Simon Kornblith
3195a1c382 closes #112, ingested items should be automatically added to selected project
references #178, changes to various date fields

- updates CSL to work with the latest schema. we can now (almost) generate completely valid APA style. the only issue is that there's no syntax for specifying short forms for page and creator type labels.
- updates scrapers to use date field rather than year field.
- removes now-unnecessary translation engine code pertaining to year field.
2006-08-14 05:12:28 +00:00
Dan Stillman
1ea0e14ad3 Fixes #182, Date Added/Modified is in UTC
Added isUTC parameter to Scholar.Date.sqlToDate() and now run the two columns through that

Side effect: now using toLocaleString() to format the date strings
2006-08-14 03:19:01 +00:00
Dan Stillman
496daebd8e Oops 2006-08-13 22:30:25 +00:00
Dan Stillman
cfc13ee9ac Closes #178, various changes to date fields
Closes #111, minor modifications to field list schema

Changes per above tickets and comments at http://chnm.grouphub.com/projects/310105/msg/cat/2333974/2995041/comments

- date, year and lastModified merged into date
- added date field to journalArticle
- added series, seriesTitle and seriesText to journalArticle
- added seriesNumber (along with series) to book and bookSection
2006-08-13 20:31:11 +00:00
Simon Kornblith
1ada4ddc00 add localized strings for CSL
closes #110, implement CSL for citation styling
2006-08-12 23:28:39 +00:00
Simon Kornblith
05edc2a08b rewrote citation support to support new version of CSL schema. bibliographic output is much improved. 2006-08-12 23:23:56 +00:00
Dan Stillman
bf96eca337 Use alternate method of differentiating between no network connection and invalid repository response in _updateScrapersRemoteCallback(), since xmlhttp.noNetwork property is no longer available
(xmlhttp.status seems to turn into a very large integer when there's a network error--I can't imagine this a fairly reliable test, but, then, neither was the previous one, and at least at the moment we're not actually using the test for anything other than an appropriate debug message)
2006-08-12 04:44:58 +00:00
Simon Kornblith
4284132db5 update scrapers.sql version 2006-08-12 04:29:59 +00:00
Simon Kornblith
ddb4fc872c remove the doStatus argument from Scholar.Utilities.HTTP 2006-08-12 04:27:49 +00:00
Dan Stillman
7e1a678f9b Addresses #136, Detect mime type and character set of local files when importing
Use new MIME type detection tricks when linking and importing files -- now for charset detection...
2006-08-12 03:54:13 +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
d0d1ed8c1d Scholar.File -- some methods to help with MIME type detection of local files (might be abstracted into MIME class later)
Methods:

getExtension(ext)
isExternalTextExtension(ext)
getSample(nsIFile)
sniffForMIMEType(nsIFile)
sniffForBinary(nsIFile)
getMIMETypeFromFile(nsIFile)
hasInternalHandler(nsIFile)
2006-08-12 01:41:48 +00:00
Dan Stillman
f07ff9ac2a Renamed "Files" to "Attachments" -- since Files could be links as well as actually files (or both, for web page snapshots), things were getting just about as confusing as when Items were called Objects.
If you have attachments to the old terminology, feel free to file a complaint.

Changed interface code too, since David is gone (or at the very least has more important things to do with his remaining time)
2006-08-12 00:18:20 +00:00
Simon Kornblith
36a402713c rename Scholar.Utilities.Ingester.HTTPUtilities to Scholar.Utilities.Ingester.HTTP for consistency 2006-08-11 16:34:22 +00:00
David Norton
e56abbc5f4 Closes #138, Ability to view files
Some minor fixes to editing creators.
2006-08-11 15:48:26 +00:00
Dan Stillman
1447b3be92 Item.getLocalFileURL() -- Return a file:/// URL path to files and snapshots 2006-08-11 15:34:06 +00:00
Simon Kornblith
064ecd17db removes unnecessary pieces of piggy bank API from utilities and updates translators to abide by current translator guidelines 2006-08-11 15:28:18 +00:00
Dan Stillman
1e8aa81c02 Fixes #108, Delay repository check by a few seconds if DB transaction is already in progress 2006-08-11 05:51:55 +00:00
Dan Stillman
9c7f33e21a Extended itemCreators primary key to include orderIndex and removed artificial restriction on adding the same creator/creatorType more than once for the same source -- who knows, maybe they just have the same name...
Properly ignore firstName for institutional creators in Item.setCreator() and Item.creatorExists() (which is now unused)
2006-08-11 05:15:56 +00:00
Dan Stillman
957b220cd3 Closes #56, add "institution" field in creators table to deal with institutional authors
- 'isInstitution' parameter added to Item.setCreator(), Creators.getID(), Creators.add()

- 'isInstitution' property added to return from Creators.get() and Item.getCreator()


var obj = Scholar.Items.getNewItemByType(1);
obj.setField('title', 'Digital History for Dummies');
obj.setCreator(0, '', 'Center for History and New Media', 1, true); // true == institutional creator
var id = obj.save();


Note: 'firstName' field is ignored when 'isInstitution' is true
2006-08-11 04:36:44 +00:00
Dan Stillman
8a56951c0b Moved comments from removed Database Architecture writeboard into schema.sql 2006-08-10 22:49:17 +00:00
Dan Stillman
9e75fc2589 Localized string for website accessDate 2006-08-10 22:46:44 +00:00
Dan Stillman
97628b0d2c More helpful debug error output in DB parameter handling and Notifier.trigger() 2006-08-10 22:46:00 +00:00
Dan Stillman
892478be2e Fixed bug that was breaking Scholar.Files.getFile() 2006-08-10 22:44:45 +00:00
David Norton
d815154efa Removing a saved search removes the item in the left pane.
Search dialog:
 - should work now.
 - Any/All control
 - All 8 operators
Add search button uses an icon
2006-08-10 22:39:21 +00:00
Dan Stillman
9c496770a6 Addresses #63, Add ECL license info to source code
Replaced GPL license.txt with ECL
2006-08-10 22:07:28 +00:00
Dan Stillman
7d48fdbeda Closes #175, Add ability to specify certain conditions as required in an ANY search
Conditions in ANY queries can be made required by passing 'true' as an extra parameter to addCondition() and updateCondition() -- this can be used for limiting ANY queries to particular collections (in place of the removed 'context' condition), but if there was an elegant way to expose it to the user for all ANY queries, it's something users might find very useful.
2006-08-10 21:05:28 +00:00
Dan Stillman
3a410c5acd Addresses #171, Add more conditions to advanced search architecture
- Implemented 'collectionID' and 'savedSearchID' conditions (a.k.a. search within a search) and removed special 'context' condition. Per my conversation with Dan, the 'recursive' flag is now a global flag that applies to all specified collectionIDs, which is less than ideal but probably better than the alternatives (e.g. having condition-specific recursive checkboxes). It does mean, however, that a "Search subfolders" checkbox is irrelevant if there are no collectionID conditions and should probably be greyed out until applicable.

Another side effect is that it's no longer possible to do an ANY search and return results only within a specific folder (though it can now be done by putting the ANY conditions in a subsearch). Since ANY searches are always annoying in this regard, what I might do is add a way to mark particular conditions as required even in ANY mode, which would allow for quite a lot of flexibility...

Note also that while 'collectionID' and 'savedSearchID' are standard conditions, they should probably be combined into a single condition on the interface side (like playlists and smart playlists under just 'Playlist' in iTunes).

- Now skips invalid/obsolete saved conditions in load()
2006-08-10 09:44:08 +00:00
Dan Stillman
4fe960d190 Search updates:
- Remaining searchConditionIDs are no longer affected by removeCondition() (i.e. they now act like autoincrements), which should make interface code simpler

- Changed default join mode to ALL

- Fixed loading of saved searches with no search conditions
2006-08-10 04:32:36 +00:00
Dan Stillman
0061a8d0df Fix problem with addCondition() overwriting existing search conditions (thanks David) 2006-08-10 02:52:29 +00:00
Simon Kornblith
3a1ffb6174 make LOC/WebVoyage scraper and other scrapers using Scholar.loadTranslator work again 2006-08-09 18:59:38 +00:00
Dan Stillman
f3a66085f5 Closes #173, Try to detect content type of linked pages without loading entire file
Closes #174, Don't load images and attached files when detecting content type in linkFromURL()

If mime type not provided, Scholar.Files.linkFromURL() now uses XMLHTTPRequest HEAD request to get the content type without loading file (thanks Simon for the idea)

If title not provided, try to figure it out from URL, though not particularly intelligently (last slash)

Note that order of title and mimeType parameters is now swapped

This code should be a bit smarter about unexpected conditions
2006-08-09 18:37:34 +00:00