From 046dad97a60ee468f5f8b85f1603c2367255c8d5 Mon Sep 17 00:00:00 2001 From: disy-mk Date: Sun, 24 Mar 2013 02:58:14 +0100 Subject: [PATCH] adds missing semicolons in src/node/db --- src/node/db/API.js | 44 +++++++++++++++++----------------- src/node/db/AuthorManager.js | 26 ++++++++++---------- src/node/db/DB.js | 2 +- src/node/db/GroupManager.js | 16 ++++++------- src/node/db/Pad.js | 6 ++--- src/node/db/PadManager.js | 14 +++++------ src/node/db/ReadOnlyManager.js | 10 ++++---- src/node/db/SessionManager.js | 22 ++++++++--------- 8 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/node/db/API.js b/src/node/db/API.js index 3955d4958..83e054d64 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -143,7 +143,7 @@ exports.getText = function(padID, rev, callback) data = {text: atext.text}; callback(null, data); - }) + }); } //the client wants the latest text, lets return it to him else @@ -151,7 +151,7 @@ exports.getText = function(padID, rev, callback) callback(null, {"text": pad.text()}); } }); -} +}; /** setText(padID, text) sets the text of a pad @@ -182,7 +182,7 @@ exports.setText = function(padID, text, callback) //update the clients on the pad padMessageHandler.updatePadClients(pad, callback); }); -} +}; /** getHTML(padID, [rev]) returns the html of a pad @@ -258,7 +258,7 @@ exports.getHTML = function(padID, rev, callback) }); } }); -} +}; exports.setHTML = function(padID, html, callback) { @@ -274,7 +274,7 @@ exports.setHTML = function(padID, html, callback) padMessageHandler.updatePadClients(pad, callback); }); -} +}; /******************/ /**CHAT FUNCTIONS */ @@ -345,7 +345,7 @@ exports.getChatHistory = function(padID, start, end, callback) callback(null, {messages: msgs}); }); }); -} +}; /*****************/ /**PAD FUNCTIONS */ @@ -368,7 +368,7 @@ exports.getRevisionsCount = function(padID, callback) callback(null, {revisions: pad.getHeadRevisionNumber()}); }); -} +}; /** getLastEdited(padID) returns the timestamp of the last revision of the pad @@ -389,7 +389,7 @@ exports.getLastEdited = function(padID, callback) callback(null, {lastEdited: value}); }); }); -} +}; /** createPad(padName [, text]) creates a new pad in this group @@ -414,7 +414,7 @@ exports.createPad = function(padID, text, callback) if(ERR(err, callback)) return; callback(); }); -} +}; /** deletePad(padID) deletes a pad @@ -432,7 +432,7 @@ exports.deletePad = function(padID, callback) pad.remove(callback); }); -} +}; /** getReadOnlyLink(padID) returns the read only link of a pad @@ -456,7 +456,7 @@ exports.getReadOnlyID = function(padID, callback) callback(null, {readOnlyID: readOnlyId}); }); }); -} +}; /** setPublicStatus(padID, publicStatus) sets a boolean for the public status of a pad @@ -489,7 +489,7 @@ exports.setPublicStatus = function(padID, publicStatus, callback) callback(); }); -} +}; /** getPublicStatus(padID) return true of false @@ -515,7 +515,7 @@ exports.getPublicStatus = function(padID, callback) callback(null, {publicStatus: pad.getPublicStatus()}); }); -} +}; /** setPassword(padID, password) returns ok or a error message @@ -544,7 +544,7 @@ exports.setPassword = function(padID, password, callback) callback(); }); -} +}; /** isPasswordProtected(padID) returns true or false @@ -570,7 +570,7 @@ exports.isPasswordProtected = function(padID, callback) callback(null, {isPasswordProtected: pad.isPasswordProtected()}); }); -} +}; /** listAuthorsOfPad(padID) returns an array of authors who contributed to this pad @@ -589,7 +589,7 @@ exports.listAuthorsOfPad = function(padID, callback) callback(null, {authorIDs: pad.getAllAuthors()}); }); -} +}; /** sendClientsMessage(padID, msg) sends a message to all clients connected to the @@ -622,7 +622,7 @@ exports.sendClientsMessage = function (padID, msg, callback) { padMessageHandler.handleCustomMessage(padID, msg, callback); } } ); -} +}; /** checkToken() returns ok when the current api token is valid @@ -635,7 +635,7 @@ Example returns: exports.checkToken = function(callback) { callback(); -} +}; /** getChatHead(padID) returns the chatHead (last number of the last chat-message) of the pad @@ -653,7 +653,7 @@ exports.getChatHead = function(padID, callback) if(ERR(err, callback)) return; callback(null, {chatHead: pad.chatHead}); }); -} +}; /** createDiffHTML(padID, startRev, endRev) returns an object of diffs from 2 points in a pad @@ -730,10 +730,10 @@ exports.createDiffHTML = function(padID, startRev, endRev, callback){ }); } ], function(err){ - callback(err, {html: html, authors: authors}) + callback(err, {html: html, authors: authors}); }); }); -} +}; /******************************/ /** INTERNAL HELPER FUNCTIONS */ @@ -742,7 +742,7 @@ exports.createDiffHTML = function(padID, startRev, endRev, callback){ //checks if a number is an int function is_int(value) { - return (parseFloat(value) == parseInt(value)) && !isNaN(value) + return (parseFloat(value) == parseInt(value)) && !isNaN(value); } //gets a pad safe diff --git a/src/node/db/AuthorManager.js b/src/node/db/AuthorManager.js index 667e0605d..bc7a4808b 100644 --- a/src/node/db/AuthorManager.js +++ b/src/node/db/AuthorManager.js @@ -39,7 +39,7 @@ exports.doesAuthorExists = function (authorID, callback) if(ERR(err, callback)) return; callback(null, author != null); }); -} +}; /** * Returns the AuthorID for a token. @@ -54,7 +54,7 @@ exports.getAuthor4Token = function (token, callback) //return only the sub value authorID callback(null, author ? author.authorID : author); }); -} +}; /** * Returns the AuthorID for a mapper. @@ -75,7 +75,7 @@ exports.createAuthorIfNotExistsFor = function (authorMapper, name, callback) //return the authorID callback(null, author); }); -} +}; /** * Returns the AuthorID for a mapper. We can map using a mapperkey, @@ -133,7 +133,7 @@ exports.createAuthor = function(name, callback) db.set("globalAuthor:" + author, authorObj); callback(null, {authorID: author}); -} +}; /** * Returns the Author Obj of the author @@ -143,7 +143,7 @@ exports.createAuthor = function(name, callback) exports.getAuthor = function (author, callback) { db.get("globalAuthor:" + author, callback); -} +}; @@ -155,7 +155,7 @@ exports.getAuthor = function (author, callback) exports.getAuthorColorId = function (author, callback) { db.getSub("globalAuthor:" + author, ["colorId"], callback); -} +}; /** * Sets the color Id of the author @@ -166,7 +166,7 @@ exports.getAuthorColorId = function (author, callback) exports.setAuthorColorId = function (author, colorId, callback) { db.setSub("globalAuthor:" + author, ["colorId"], colorId, callback); -} +}; /** * Returns the name of the author @@ -176,7 +176,7 @@ exports.setAuthorColorId = function (author, colorId, callback) exports.getAuthorName = function (author, callback) { db.getSub("globalAuthor:" + author, ["name"], callback); -} +}; /** * Sets the name of the author @@ -187,7 +187,7 @@ exports.getAuthorName = function (author, callback) exports.setAuthorName = function (author, name, callback) { db.setSub("globalAuthor:" + author, ["name"], name, callback); -} +}; /** * Returns an array of all pads this author contributed to @@ -208,7 +208,7 @@ exports.listPadsOfAuthor = function (authorID, callback) //author does not exists if(author == null) { - callback(new customError("authorID does not exist","apierror")) + callback(new customError("authorID does not exist","apierror")); } //everything is fine, return the pad IDs else @@ -224,7 +224,7 @@ exports.listPadsOfAuthor = function (authorID, callback) callback(null, {padIDs: pads}); } }); -} +}; /** * Adds a new pad to the list of contributions @@ -251,7 +251,7 @@ exports.addPad = function (authorID, padID) //save the new element back db.set("globalAuthor:" + authorID, author); }); -} +}; /** * Removes a pad from the list of contributions @@ -272,4 +272,4 @@ exports.removePad = function (authorID, padID) db.set("globalAuthor:" + authorID, author); } }); -} \ No newline at end of file +}; diff --git a/src/node/db/DB.js b/src/node/db/DB.js index 7273c83e3..affa9c58e 100644 --- a/src/node/db/DB.js +++ b/src/node/db/DB.js @@ -54,4 +54,4 @@ exports.init = function(callback) callback(null); } }); -} +}; diff --git a/src/node/db/GroupManager.js b/src/node/db/GroupManager.js index 81b0cb9ef..26527eff6 100644 --- a/src/node/db/GroupManager.js +++ b/src/node/db/GroupManager.js @@ -43,7 +43,7 @@ exports.listAllGroups = function(callback) { } callback(null, {groupIDs: groupIDs}); }); -} +}; exports.deleteGroup = function(groupID, callback) { @@ -101,7 +101,7 @@ exports.deleteGroup = function(groupID, callback) if(ERR(err, callback)) return; //skip if there is no group2sessions entry - if(group2sessions == null) {callback(); return} + if(group2sessions == null) {callback(); return;} //collect all sessions in an array, that allows us to use async.forEach var sessions = []; @@ -162,7 +162,7 @@ exports.deleteGroup = function(groupID, callback) if(ERR(err, callback)) return; callback(); }); -} +}; exports.doesGroupExist = function(groupID, callback) { @@ -172,7 +172,7 @@ exports.doesGroupExist = function(groupID, callback) if(ERR(err, callback)) return; callback(null, group != null); }); -} +}; exports.createGroup = function(callback) { @@ -199,7 +199,7 @@ exports.createGroup = function(callback) callback(null, {groupID: groupID}); }); }); -} +}; exports.createGroupIfNotExistsFor = function(groupMapper, callback) { @@ -235,7 +235,7 @@ exports.createGroupIfNotExistsFor = function(groupMapper, callback) callback(null, {groupID: groupID}); } }); -} +}; exports.createGroupPad = function(groupID, padName, text, callback) { @@ -301,7 +301,7 @@ exports.createGroupPad = function(groupID, padName, text, callback) if(ERR(err, callback)) return; callback(null, {padID: padID}); }); -} +}; exports.listPads = function(groupID, callback) { @@ -328,4 +328,4 @@ exports.listPads = function(groupID, callback) }); } }); -} +}; diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js index 4701e82a3..24d5e047e 100644 --- a/src/node/db/Pad.js +++ b/src/node/db/Pad.js @@ -111,13 +111,13 @@ Pad.prototype.saveToDatabase = function saveToDatabase(){ } db.set("pad:"+this.id, dbObject); -} +}; // get time of last edit (changeset application) Pad.prototype.getLastEdit = function getLastEdit(callback){ var revNum = this.getHeadRevisionNumber(); db.getSub("pad:"+this.id+":revs:"+revNum, ["meta", "timestamp"], callback); -} +}; Pad.prototype.getRevisionChangeset = function getRevisionChangeset(revNum, callback) { db.getSub("pad:"+this.id+":revs:"+revNum, ["changeset"], callback); @@ -250,7 +250,7 @@ Pad.prototype.getValidRevisionRange = function getValidRevisionRange(startRev, e endRev = head; } if(startRev !== null && endRev !== null) { - return { startRev: startRev , endRev: endRev } + return { startRev: startRev , endRev: endRev }; } return null; }; diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index 7d546fc71..30d799d72 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -155,7 +155,7 @@ exports.getPad = function(id, text, callback) callback(null, pad); }); } -} +}; exports.listAllPads = function(callback) { @@ -164,7 +164,7 @@ exports.listAllPads = function(callback) }else{ return {padIDs: padList.getPads()}; } -} +}; //checks if a pad exists exports.doesPadExists = function(padId, callback) @@ -180,7 +180,7 @@ exports.doesPadExists = function(padId, callback) callback(null, false); } }); -} +}; //returns a sanitized padId, respecting legacy pad id formats exports.sanitizePadId = function(padId, callback) { @@ -213,12 +213,12 @@ exports.sanitizePadId = function(padId, callback) { } }); } -} +}; exports.isValidPadId = function(padId) { return /^(g.[a-zA-Z0-9]{16}\$)?[^$]{1,50}$/.test(padId); -} +}; /** * Removes the pad from database and unloads it. @@ -227,11 +227,11 @@ exports.removePad = function(padId){ db.remove("pad:"+padId); exports.unloadPad(padId); padList.removePad(padId); -} +}; //removes a pad from the array exports.unloadPad = function(padId) { if(globalPads.get(padId)) globalPads.remove(padId); -} +}; diff --git a/src/node/db/ReadOnlyManager.js b/src/node/db/ReadOnlyManager.js index b135e6139..b2f37afb7 100644 --- a/src/node/db/ReadOnlyManager.js +++ b/src/node/db/ReadOnlyManager.js @@ -61,8 +61,8 @@ exports.getReadOnlyId = function (padId, callback) if(ERR(err, callback)) return; //return the results callback(null, readOnlyId); - }) -} + }); +}; /** * returns a the padId for a read only id @@ -71,7 +71,7 @@ exports.getReadOnlyId = function (padId, callback) exports.getPadId = function(readOnlyId, callback) { db.get("readonly2pad:" + readOnlyId, callback); -} +}; /** * returns a the padId and readonlyPadId in an object for any id @@ -86,7 +86,7 @@ exports.getIds = function(padIdOrReadonlyPadId, callback) { readonly: false }); }); - } + }; if (padIdOrReadonlyPadId.indexOf("r.") != 0) return handleRealPadId(); @@ -101,4 +101,4 @@ exports.getIds = function(padIdOrReadonlyPadId, callback) { readonly: true }); }); -} +}; diff --git a/src/node/db/SessionManager.js b/src/node/db/SessionManager.js index 60e0a7ac9..f1c1b44e8 100644 --- a/src/node/db/SessionManager.js +++ b/src/node/db/SessionManager.js @@ -35,7 +35,7 @@ exports.doesSessionExist = function(sessionID, callback) if(ERR(err, callback)) return; callback(null, session != null); }); -} +}; /** * Creates a new session between an author and a group @@ -182,8 +182,8 @@ exports.createSession = function(groupID, authorID, validUntil, callback) //return error and sessionID callback(null, {sessionID: sessionID}); - }) -} + }); +}; exports.getSessionInfo = function(sessionID, callback) { @@ -195,7 +195,7 @@ exports.getSessionInfo = function(sessionID, callback) //session does not exists if(session == null) { - callback(new customError("sessionID does not exist","apierror")) + callback(new customError("sessionID does not exist","apierror")); } //everything is fine, return the sessioninfos else @@ -203,7 +203,7 @@ exports.getSessionInfo = function(sessionID, callback) callback(null, session); } }); -} +}; /** * Deletes a session @@ -224,7 +224,7 @@ exports.deleteSession = function(sessionID, callback) //session does not exists if(session == null) { - callback(new customError("sessionID does not exist","apierror")) + callback(new customError("sessionID does not exist","apierror")); } //everything is fine, return the sessioninfos else @@ -276,8 +276,8 @@ exports.deleteSession = function(sessionID, callback) { if(ERR(err, callback)) return; callback(); - }) -} + }); +}; exports.listSessionsOfGroup = function(groupID, callback) { @@ -296,7 +296,7 @@ exports.listSessionsOfGroup = function(groupID, callback) listSessionsWithDBKey("group2sessions:" + groupID, callback); } }); -} +}; exports.listSessionsOfAuthor = function(authorID, callback) { @@ -315,7 +315,7 @@ exports.listSessionsOfAuthor = function(authorID, callback) listSessionsWithDBKey("author2sessions:" + authorID, callback); } }); -} +}; //this function is basicly the code listSessionsOfAuthor and listSessionsOfGroup has in common function listSessionsWithDBKey (dbkey, callback) @@ -363,5 +363,5 @@ function listSessionsWithDBKey (dbkey, callback) //checks if a number is an int function is_int(value) { - return (parseFloat(value) == parseInt(value)) && !isNaN(value) + return (parseFloat(value) == parseInt(value)) && !isNaN(value); }