mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 14:47:12 -04:00
fix duble error checking
fix whitespace coding convention
This commit is contained in:
parent
8bff85cdb2
commit
f7d8f68c13
3 changed files with 49 additions and 53 deletions
|
@ -473,36 +473,36 @@ Example returns:
|
|||
*/
|
||||
exports.listAllPads = function(callback)
|
||||
{
|
||||
allPads = [];
|
||||
|
||||
var defaultGroup = "g.defaultGroupName";
|
||||
|
||||
//get all groups
|
||||
groupManager.listGroups(function (err, groups)
|
||||
{
|
||||
groups=groups["groupIDs"];
|
||||
// if defaultGroup exists add this too, becaus ists not listed in groupManager.listGroups
|
||||
groupManager.doesGroupExist(defaultGroup, function(err, exists)
|
||||
{
|
||||
if(exists)
|
||||
{
|
||||
groups.push(defaultGroup);
|
||||
}
|
||||
});
|
||||
allPads = [];
|
||||
|
||||
for(var group in groups)
|
||||
{
|
||||
groupManager.listPads(groups[group], function(err, pads)
|
||||
{
|
||||
for(var pad in pads["padIDs"])
|
||||
{
|
||||
allPads.push(pads["padIDs"][pad]);
|
||||
}
|
||||
});
|
||||
}
|
||||
var defaultGroup = "g.defaultGroupName";
|
||||
|
||||
//get all groups
|
||||
groupManager.listGroups(function (err, groups)
|
||||
{
|
||||
groups=groups["groupIDs"];
|
||||
// if defaultGroup exists add this too, becaus ists not listed in groupManager.listGroups
|
||||
groupManager.doesGroupExist(defaultGroup, function(err, exists)
|
||||
{
|
||||
if(exists)
|
||||
{
|
||||
groups.push(defaultGroup);
|
||||
}
|
||||
});
|
||||
|
||||
callback(null, {padIDs: allPads});
|
||||
for(var group in groups)
|
||||
{
|
||||
groupManager.listPads(groups[group], function(err, pads)
|
||||
{
|
||||
for(var pad in pads["padIDs"])
|
||||
{
|
||||
allPads.push(pads["padIDs"][pad]);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
callback(null, {padIDs: allPads});
|
||||
}
|
||||
|
||||
/******************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue