Commit graph

7149 commits

Author SHA1 Message Date
Dan Stillman
45b3cd8a53 Replace non-breaking spaces in tested lines in recognizePDF
Fixes "PDF does not contain OCRed text" message for
http://pdfserver.amlaw.com/nlj/NSA_ca2_20150507.pdf
2015-05-07 13:41:13 -04:00
Dan Stillman
3587bb0f6b Fix error if a synced filename begins with a dot (".pdf") 2015-05-07 13:40:05 -04:00
Dan Stillman
3a995d64a4 Fix saving of tags 2015-05-06 04:23:31 -04:00
Dan Stillman
26e1372f46 Throw an error if item type isn't set when saving
And add a test for throwing from setField(), which already happens.
2015-05-06 04:20:47 -04:00
Dan Stillman
7879e5432a Fix new attachment charset saving, which I definitely didn't test before 2015-05-06 04:20:45 -04:00
Dan Stillman
33eaaffd83 Fix Date Modified handling when saving items 2015-05-06 04:19:20 -04:00
Dan Stillman
e5cbfb71a6 Throw ZoteroMissingObjectError for missing item errors
And don't log in DataObject.saveData() before rethrowing, since the
calling code will probably take care of it
2015-05-06 04:19:20 -04:00
Dan Stillman
d67fd9fda2 Don't send add notifications for collections if skipNotifier is passed 2015-05-05 15:57:37 -04:00
Dan Stillman
01f04802f0 Fix loadAllData() on regular items without notes
Set a flag when setting the item type that instructs loadAllData()
whether to attempt to call loadNote()
2015-05-05 15:57:37 -04:00
Dan Stillman
beb17436f8 Don't mark parentKey as changed when set to false for an unsaved item
And return undefined for search objects
2015-05-05 15:57:37 -04:00
Dan Stillman
b0f52a0f07 Allow attachmentLinkMode to be specified as a string ('linked_url') 2015-05-05 15:57:36 -04:00
Dan Stillman
93a6a4ffdb Don't mark an empty field set to an empty string as changed
And some tests
2015-05-05 15:57:36 -04:00
Dan Stillman
0cefa03827 Add initial Zotero.DataObject test 2015-05-05 03:17:51 -04:00
Dan Stillman
18714a4fcb Default to user library for saved searches
For consistency with collections and items
2015-05-05 03:17:51 -04:00
Dan Stillman
574f636683 Call next function in finally block in ConcurrentCaller 2015-05-05 02:58:22 -04:00
Dan Stillman
bb760707d4 Get id values directly in Zotero.DataObject.prototype.loadPrimaryData 2015-05-05 02:56:56 -04:00
Dan Stillman
c18f31aeab Show Firefox UI when using loadBrowserWindow() in tests
The window created by loadWindow() is still empty, but this removes the
'chrome' flag for loadBrowserWindow(), which causes the Firefox UI to be
shown.

I think openDialog calls are always chrome, but providing just the
chrome flag disables all other options (e.g., navbar).
2015-05-05 02:53:08 -04:00
Dan Stillman
7975835b5e Disable lookup and recognizePDF tests until they work 2015-05-05 02:53:08 -04:00
Dan Stillman
2313c1930d Get selected item ids directly in collection tests 2015-05-05 02:53:08 -04:00
Dan Stillman
09f08d63ea Skip default browser check 2015-05-05 02:53:08 -04:00
Dan Stillman
02a36eab9b Fix various issues with rapid UI/data changes due to asyncification 2015-05-05 02:53:06 -04:00
Dan Stillman
fc428f8e1b Insert new saved search rows without refreshing collections list
And some other selection-related tweaks
2015-05-05 02:52:26 -04:00
Dan Stillman
2ca53677f8 Don't resave collection with no parent after .parentKey = false 2015-05-05 02:52:26 -04:00
Dan Stillman
aa512f0f8d Miscellaneous data layer fixes and tweaks 2015-05-04 03:19:58 -04:00
Dan Stillman
53e40bb0f4 Miscellaneous tweaks 2015-05-04 02:46:40 -04:00
Dan Stillman
e96f091754 Remove delays after new collections in collectionTreeView tests
Since UI updates now happen before returning from save()
2015-05-04 02:46:39 -04:00
Dan Stillman
ef91299951 Asyncify Zotero.CollectionTreeCache.clear() 2015-05-04 02:46:39 -04:00
Dan Stillman
8ec248f7ec Remove some unnecessary asyncness in tree views
E.g., closing a container doesn't need to yield
2015-05-04 02:46:39 -04:00
Dan Stillman
d22f762bb6 Add new collection rows without reloading the collections list 2015-05-04 02:46:34 -04:00
Dan Stillman
6328d1f39b CollectionTreeView::selectLibrary() doesn't need to be async 2015-05-04 02:45:56 -04:00
Dan Stillman
16d79c5cbf Add missing sample file for attachment test 2015-05-04 02:45:55 -04:00
Dan Stillman
8fec5ace3a Fix post-save textbox focusing bugs in right-hand pane
Fix a couple cases of lost text field focus after an edit, including
focusing of the Title field after using New Item when a field is already
being edited and has a changed value.

Also, in tests, select My Library and wait for items to load when using
the loadZoteroPane() support function. We could add a parameter to skip
that or move it to a separate function, but the code to detect it is a
bit convoluted and it's a prerequisite for many tests, so it's handy to
have a function for it.
2015-05-04 02:45:55 -04:00
Dan Stillman
590649fd49 Ignore blur events from html:textarea
If a new item is created manually when a text field is already open, the
hideEditor is run first on the html:textarea before bubbling up to the
textbox. During a normal blur, the event only happens on the textbox,
though I haven't looked into the reason for the difference.
2015-05-04 02:45:55 -04:00
Dan Stillman
bdd44e9a44 DB isolation changes and item selection tweaks
- Add an 'exclusive' option to transactions that causes them to block other
  transactions and wait for other transactions to finish before starting,
  instead of nesting
- Resolve Zotero.DB.waitForTransaction() promise before returning from
  executeTransaction()
- A side effect of the above: wait for a newly created item to be selected in
  the middle pane and rendered in the right-hand pane before returning from
  executeTransaction()
- Don't save items multiple times when adding/removing a non-final creator in
  the Info pane
- Use a simpler, non-recursive method for focusing the next field in the Info
  pane; this prevents "too much recursion" errors if something causes the
  right-hand pane not to be rendered when expected
2015-05-04 02:45:55 -04:00
Dan Stillman
4a0018ec63 Fix transaction detection
This fixes an issue where two transactions started around the same time
could run separately instead of nesting, causing the statements from one
to end up running not within a transaction
2015-05-04 02:45:55 -04:00
Dan Stillman
43a2045aec Change computerProgram 'version' to 'versionNumber'
And use 'version' instead of 'itemVersion' for object version for items

Also add deferred foreign key checking to system.sql so that DROP TABLE
commands don't fail mid-transaction
2015-05-04 02:45:53 -04:00
Dan Stillman
5070c04af6 Ignore invalid fields in Zotero.ItemFields.isValidForType() 2015-05-04 02:45:28 -04:00
Dan Stillman
805df39869 Remove extra debugging in Zotero.ItemFields.getLocalizedString() 2015-05-04 02:45:28 -04:00
Dan Stillman
285995807d fromJSON() methods for data objects
Tests needed
2015-05-04 02:45:25 -04:00
Dan Stillman
afe0412c58 Collection/item tree view updates
- Pass .skipSelect option to data object .save() to prevent new objects
  from being selected
- Fix miscellaneous bugs
- Selection-related tests
2015-05-04 02:43:32 -04:00
Dan Stillman
322339876e Add Zotero.Date.isISODate() and Zotero.Date.isoToSQL() 2015-05-04 02:41:14 -04:00
Dan Stillman
e8d4b3e840 Add Zotero.Item.prototype.attachmentFilename 2015-05-04 02:41:14 -04:00
Dan Stillman
40e86147a4 Allow loadChildItems() to be called on note/attachment items
Otherwise loadAllData() doesn't work
2015-05-04 02:41:14 -04:00
Dan Stillman
51dd281e81 Merge pull request #709 from aurimasv/tests-translator-report
Don't report translator failures from tests
2015-05-02 19:28:53 -04:00
Dan Stillman
453e7bd090 Fix size of 2x icons in progress window 2015-05-02 19:00:42 -04:00
Aurimas Vinckevicius
2566ca27e0 Don't report translator failures from tests 2015-05-02 15:30:25 -05:00
Dan Stillman
fbef911cb7 Add wizard for My Publications
Show a wizard after items are dragged to My Publications choosing
whether to include files and notes and choosing sharing settings for the
items. Sharing options are Creative Commons licenses, CC0, "All rights
reserved", or keeping the existing Rights field if available.

Also blocks collections, searches, linked file attachments, and
top-level attachments/notes from My Publications at the data layer, but
not yet from the UI in all places (so it can crash if you try).

Todo:

- Block certain UI actions with nice messages
- Show a nice scrollable list of items in the wizard to allow selecting
  specific files/notes, instead of just having checkboxes for files and
  notes that apply to all dragged items
- Show an explanation of My Publications in the right-hand pane when no
  items are selected
- Maybe adjust handling when no attached files/notes, since it might be
  a bit alarming at the moment to see sharing options for metadata
  entries
2015-04-26 19:41:45 -04:00
Dan Stillman
944d298af7 Make retrieving transactionDate with no transaction fatal
I think the places where we retrieve it are always within transactions,
and this helps catch promises that aren't waited for.
2015-04-26 19:36:08 -04:00
Dan Stillman
8c32210507 Test for nested transaction failures 2015-04-26 18:08:26 -04:00
Dan Stillman
ba9adffa68 Use variables for temp table names in DB tests 2015-04-26 18:08:26 -04:00