Tags overhaul [DB reupgrade]

- Simplified schema
- Tags are now added without reloading entire tag selector
  - On my system, adding 400 tags to an item (separately, with the tag
    selector updating each time) went from 59 seconds to 42. (Given that
    it takes only 13 seconds with the tag selector closed, though,
    there's clearly more work to be done.)
- Tag selector now uses HTML flexbox (in identical fashion, for now, but
  with the possibility of fancier changes later, and with streamlined
  logic thanks to the flexbox 'order' property)
- Various async fixes
- Tests
This commit is contained in:
Dan Stillman 2015-06-23 04:35:45 -04:00
parent b602cc4bd2
commit 33dedd1753
24 changed files with 951 additions and 689 deletions

View file

@ -73,8 +73,9 @@ ZoteroAutoComplete.prototype.startSearch = Zotero.Promise.coroutine(function* (s
case 'tag':
var sql = "SELECT DISTINCT name AS val, NULL AS comment FROM tags WHERE name LIKE ?";
var sqlParams = [searchString + '%'];
if (typeof searchParams.libraryID != 'undefined') {
sql += " AND libraryID=?";
if (searchParams.libraryID !== undefined) {
sql += " AND tagID IN (SELECT tagID FROM itemTags JOIN items USING (itemID) "
+ "WHERE libraryID=?)";
sqlParams.push(searchParams.libraryID);
}
if (searchParams.itemID) {