mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 06:37:10 -04:00
added listAllPads API command, renamed listPads(GroupID) for Group Pads to listGroupPads(GroupID)
This commit is contained in:
parent
ecd486e440
commit
8fbc96dd7a
4 changed files with 54 additions and 3 deletions
|
@ -380,7 +380,19 @@ Class('Pad', {
|
|||
else
|
||||
{
|
||||
var firstChangeset = Changeset.makeSplice("\n", 0, 0, exports.cleanText(text));
|
||||
|
||||
db.get("allpads",function(err,data)
|
||||
{
|
||||
if(err) callback(err);
|
||||
if(data){
|
||||
data.push(_this.id);
|
||||
db.set("allpads",data);
|
||||
|
||||
}
|
||||
else {
|
||||
db.set("allpads",[_this.id]);
|
||||
}
|
||||
|
||||
});
|
||||
_this.appendRevision(firstChangeset, '');
|
||||
}
|
||||
|
||||
|
@ -471,6 +483,21 @@ Class('Pad', {
|
|||
{
|
||||
db.remove("pad:"+padID);
|
||||
padManager.unloadPad(padID);
|
||||
|
||||
// delete entry from allpads
|
||||
db.get("allpads",function(err,data)
|
||||
{
|
||||
if(err) callback(err);
|
||||
if(data){
|
||||
delete data[padID];
|
||||
db.set("allpads",data);
|
||||
}
|
||||
else{
|
||||
//nothing to do, although there should be an entry
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
callback();
|
||||
}
|
||||
], function(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue