Merge pull request #902 from adomasven/feature/feed-reader-UI
Feed Reader UI (I squashed a bunch of commits from the PR.)
This commit is contained in:
commit
6c43e75d26
63 changed files with 3349 additions and 501 deletions
|
@ -309,6 +309,24 @@ var createGroup = Zotero.Promise.coroutine(function* (props = {}) {
|
|||
return group;
|
||||
});
|
||||
|
||||
var createFeed = Zotero.Promise.coroutine(function* (props = {}) {
|
||||
var feed = new Zotero.Feed;
|
||||
feed.name = props.name || "Test " + Zotero.Utilities.randomString();
|
||||
feed.description = props.description || "";
|
||||
feed.url = props.url || 'http://www.' + Zotero.Utilities.randomString() + '.com/feed.rss';
|
||||
feed.refreshInterval = props.refreshInterval || 12;
|
||||
feed.cleanupAfter = props.cleanupAfter || 2;
|
||||
yield feed.saveTx();
|
||||
return feed;
|
||||
});
|
||||
|
||||
var clearFeeds = Zotero.Promise.coroutine(function* () {
|
||||
let feeds = Zotero.Feeds.getAll();
|
||||
for (let i=0; i<feeds.length; i++) {
|
||||
yield feeds[i].eraseTx();
|
||||
}
|
||||
});
|
||||
|
||||
//
|
||||
// Data objects
|
||||
//
|
||||
|
@ -371,11 +389,7 @@ function createUnsavedDataObject(objectType, params = {}) {
|
|||
|
||||
var createDataObject = Zotero.Promise.coroutine(function* (objectType, params = {}, saveOptions) {
|
||||
var obj = createUnsavedDataObject(objectType, params);
|
||||
if (objectType == 'feedItem') {
|
||||
yield obj.forceSaveTx(saveOptions);
|
||||
} else {
|
||||
yield obj.saveTx(saveOptions);
|
||||
}
|
||||
yield obj.saveTx(saveOptions);
|
||||
return obj;
|
||||
});
|
||||
|
||||
|
@ -439,6 +453,14 @@ function getTestDataDirectory() {
|
|||
QueryInterface(Components.interfaces.nsIFileURL).file;
|
||||
}
|
||||
|
||||
function getTestDataUrl(path) {
|
||||
path = path.split('/');
|
||||
if (path[0].length == 0) {
|
||||
path.splice(0, 1);
|
||||
}
|
||||
return "resource://zotero-unit-tests/data/" + path.join('/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an absolute path to an empty temporary directory
|
||||
* (i.e., test/tests/data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue