Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a presentations module to remoteStorage GH-8
- Loading branch information
Showing
6 changed files
with
55 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
remoteStorage.defineModule('presentations', function(myPrivateBaseClient, myPublicBaseClient) { | ||
var type = 'presentation'; | ||
function PresentationStorage(client) { | ||
this.client = client; | ||
} | ||
|
||
PresentationStorage.prototype = { | ||
list: function(directory) { | ||
return this.client.getListing(directory + '/'); // TODO: do I need to do any trimming of /'s? | ||
}, | ||
|
||
get: function(path) { | ||
return this.client.getObject(path); | ||
}, | ||
|
||
set: function(path, presentation) { | ||
this.client.storeObject(type, path, presentation); | ||
return this; | ||
}, | ||
|
||
remove: function(path) { | ||
this.client.remove(path); // TODO: directory removal? | ||
return this; | ||
} | ||
}; | ||
|
||
return { | ||
name: 'presentations', | ||
dataVersion: '0.1', | ||
dataHints: { | ||
"module": "Presentations are things that you present or talk about to a group", | ||
|
||
"objectType presentation": "Work to be presented", | ||
|
||
"directory presentations/": "Default location for private presentations", | ||
"directory public/presentations/": "Default location for public presentations" | ||
}, | ||
codeVersion: '0.1.0', | ||
exports: { | ||
public: new PresentationStorage(myPublicBaseClient), | ||
private: new PresentationStorage(myPrivateBaseClient) | ||
} | ||
}; | ||
}); |
This file was deleted.
Oops, something went wrong.