Add .allowsLinkedFiles property to Zotero.Library objects
This commit is contained in:
parent
20df18636d
commit
bc141ce36b
|
@ -111,6 +111,10 @@ Zotero.defineProperty(Zotero.Feed.prototype, 'isFeed', {
|
||||||
value: true
|
value: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Zotero.defineProperty(Zotero.Feed.prototype, 'allowsLinkedFiles', {
|
||||||
|
value: false
|
||||||
|
});
|
||||||
|
|
||||||
Zotero.defineProperty(Zotero.Feed.prototype, 'libraryTypes', {
|
Zotero.defineProperty(Zotero.Feed.prototype, 'libraryTypes', {
|
||||||
value: Object.freeze(Zotero.Feed._super.prototype.libraryTypes.concat(['feed']))
|
value: Object.freeze(Zotero.Feed._super.prototype.libraryTypes.concat(['feed']))
|
||||||
});
|
});
|
||||||
|
|
|
@ -86,6 +86,10 @@ Zotero.defineProperty(Zotero.Group.prototype, 'id', {
|
||||||
set: function(v) { return this.groupID = v; }
|
set: function(v) { return this.groupID = v; }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Zotero.defineProperty(Zotero.Group.prototype, 'allowsLinkedFiles', {
|
||||||
|
value: false
|
||||||
|
});
|
||||||
|
|
||||||
// Create accessors
|
// Create accessors
|
||||||
(function() {
|
(function() {
|
||||||
let accessors = ['name', 'description', 'version'];
|
let accessors = ['name', 'description', 'version'];
|
||||||
|
|
|
@ -190,6 +190,10 @@ Zotero.defineProperty(Zotero.Library.prototype, 'hasTrash', {
|
||||||
value: true
|
value: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Zotero.defineProperty(Zotero.Library.prototype, 'allowsLinkedFiles', {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
|
||||||
// Create other accessors
|
// Create other accessors
|
||||||
(function() {
|
(function() {
|
||||||
let accessors = ['editable', 'filesEditable', 'storageVersion', 'archived'];
|
let accessors = ['editable', 'filesEditable', 'storageVersion', 'archived'];
|
||||||
|
|
|
@ -126,6 +126,17 @@ describe("Zotero.Library", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("#allowsLinkedFiles", function () {
|
||||||
|
it("should return true for personal library", function () {
|
||||||
|
assert.isTrue(Zotero.Libraries.userLibrary.allowsLinkedFiles);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should return false for group libraries", async function () {
|
||||||
|
var group = await getGroup();
|
||||||
|
assert.isFalse(group.allowsLinkedFiles);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("#archived", function() {
|
describe("#archived", function() {
|
||||||
it("should return archived status", function() {
|
it("should return archived status", function() {
|
||||||
let library = Zotero.Libraries.get(Zotero.Libraries.userLibraryID);
|
let library = Zotero.Libraries.get(Zotero.Libraries.userLibraryID);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user