Permalink
Browse files

Add info to all files

  • Loading branch information...
1 parent 5f04fac commit 059526ac3d49135ec6dfe7c9a867017588418680 @vpetrov committed Nov 14, 2012
Showing with 79 additions and 10 deletions.
  1. +24 −0 LICENSE
  2. +5 −0 README.md
  3. +8 −0 config.js
  4. +18 −10 db.js
  5. +8 −0 index.js
  6. +8 −0 lib/arrays.js
  7. +8 −0 lib/obj.js
View
24 LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2012, The Neuroinformatics Research Group at Harvard University
+Copyright (c) 2012, The President and Fellows of Harvard College
+All rights reserved.
+
+The New BSD License:
+--------------------
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
+following conditions are met:
+
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following
+ disclaimer.
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the distribution.
+ - Neither the name of the Neuroinformatics Research Group at Harvard University nor the names of its contributors may
+ be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE NEUROINFORMATICS RESEARCH GROUP AT HARVARD UNIVERSITY BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
@@ -4,3 +4,8 @@ survana
An HTML5 application for administering questionnaires on tablets and mobile devices. Developed by the Neuroinformatics Research Group at Harvard University.
[![Build Status](https://travis-ci.org/vpetrov/survana.png)](https://travis-ci.org/vpetrov/survana)
+
+Author: Victor Petrov <victor.petrov@gmail.com>
+
+License: New BSD License (see LICENSE file for details).
+
View
@@ -1,3 +1,11 @@
+/** config.js
+ *
+ * @author Victor Petrov <victor.petrov@gmail.com>
+ * @copyright (c) 2012, The Neuroinformatics Research Group at Harvard University.
+ * @copyright (c) 2012, The President and Fellows of Harvard College.
+ * @license New BSD License (see LICENSE file for details).
+ */
+
var path=require('path');
exports.brand="Survana";
View
28 db.js
@@ -1,20 +1,28 @@
+/** db.js
+ *
+ * @author Victor Petrov <victor.petrov@gmail.com>
+ * @copyright (c) 2012, The Neuroinformatics Research Group at Harvard University.
+ * @copyright (c) 2012, The President and Fellows of Harvard College.
+ * @license New BSD License (see LICENSE file for details).
+ */
+
var mongodb=require('mongodb');
var util=require('./util');
function connect(fnSuccess,fnError)
-{
+{
if (module.client)
fnSuccess(module.client);
-
+
module.db.open(function(error,client){
if (error && fnError)
return fnError(error);
-
+
module.client=client;
-
+
//setup shortcuts
client.uniqueId=uniqueId;
-
+
if (fnSuccess)
return fnSuccess(client);
});
@@ -33,10 +41,10 @@ function collection(name,fnSuccess,fnError)
{
if (fnError)
return fnError(error,client);
-
+
throw error;
}
-
+
//call the success callback
return fnSuccess(col,client);
});
@@ -45,7 +53,7 @@ function collection(name,fnSuccess,fnError)
function find(options)
{
-
+
}
function uniqueId(dbcollection,field,callback)
@@ -57,7 +65,7 @@ function uniqueId(dbcollection,field,callback)
fields[field]=1;
//run a query
- dbcollection.findOne(query,fields,function(err,item){
+ dbcollection.findOne(query,fields,function(err,item){
//loop until item is not found
if (item)
uniqueId(dbcollection,field,callback);
@@ -70,7 +78,7 @@ module.exports=function(config){
module.db=new mongodb.Db(config.name,
new mongodb.Server(config.host,config.port,config.server_options),
config.db_options);
-
+
return {
db:module.db,
connect:connect,
View
@@ -1,3 +1,11 @@
+/** index.js
+ *
+ * @author Victor Petrov <victor.petrov@gmail.com>
+ * @copyright (c) 2012, The Neuroinformatics Research Group at Harvard University.
+ * @copyright (c) 2012, The President and Fellows of Harvard College.
+ * @license New BSD License (see LICENSE file for details).
+ */
+
var express=require('express');
var DB=require('./db');
var sconfig=require("./config");
View
@@ -1,3 +1,11 @@
+/** lib/arrays.js
+ *
+ * @author Victor Petrov <victor.petrov@gmail.com>
+ * @copyright (c) 2012, The Neuroinformatics Research Group at Harvard University.
+ * @copyright (c) 2012, The President and Fellows of Harvard College.
+ * @license New BSD License (see LICENSE file for details).
+ */
+
var util = require('util');
var obj = require('./obj');
View
@@ -1,3 +1,11 @@
+/** lib/obj.js
+ *
+ * @author Victor Petrov <victor.petrov@gmail.com>
+ * @copyright (c) 2012, The Neuroinformatics Research Group at Harvard University.
+ * @copyright (c) 2012, The President and Fellows of Harvard College.
+ * @license New BSD License (see LICENSE file for details).
+ */
+
var util=require('util');
exports.keys=function(o)

0 comments on commit 059526a

Please sign in to comment.