Added documentation to group modules together.
This commit is contained in:
parent
a340d8f4bf
commit
c2c9d215f7
5
api.js
5
api.js
|
@ -1,4 +1,9 @@
|
|||
//api.js
|
||||
/**
|
||||
* Module for handling API requests.
|
||||
* API is able to be called through /api/:apirequest?=arguments
|
||||
* @module api
|
||||
*/
|
||||
|
||||
//Importing self-written modules.
|
||||
var lookup = require('./lookup');
|
||||
|
|
4
auth.js
4
auth.js
|
@ -1,4 +1,8 @@
|
|||
//auth.js
|
||||
/**
|
||||
* Module for handling the Authentication in the web application.
|
||||
* @module auth
|
||||
*/
|
||||
|
||||
//Importing first and third-party modules.
|
||||
var qs = require('querystring');
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
//configuration.js
|
||||
/**
|
||||
* Module for the return/creating of a settings file/object.
|
||||
* @module configuration
|
||||
*/
|
||||
|
||||
//Import first-party modules.
|
||||
var fs = require('fs');
|
||||
|
||||
/**
|
||||
* Module for the return/creating of a settings file/object.
|
||||
* Function for the return/creating of a settings file/object.
|
||||
* @return {Object} settings - Object of all the settings.
|
||||
*/
|
||||
module.exports = function () {
|
||||
|
|
5
crypt.js
5
crypt.js
|
@ -1,4 +1,8 @@
|
|||
//crypt.js
|
||||
/**
|
||||
* Module for encrypting and decrypting strings.
|
||||
* @module crypt
|
||||
*/
|
||||
|
||||
//Import first-party modules.
|
||||
var crypto = require('crypto');
|
||||
|
@ -30,6 +34,7 @@ function encrypt(str) {
|
|||
/**
|
||||
* Function to decrypt a string.
|
||||
* @param {String} str - String you want to decrypt
|
||||
* @return {String} The decrypted string.
|
||||
*/
|
||||
function decrypt(str) {
|
||||
var decryptArray = [];
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
//database.js
|
||||
/**
|
||||
* Module for using a database interface
|
||||
* Either local (NeDB) or remote (MongoDB) based on configuration values.
|
||||
* @module database
|
||||
*/
|
||||
|
||||
//Import first-party modules.
|
||||
var fs = require('fs');
|
||||
|
@ -7,7 +12,7 @@ var fs = require('fs');
|
|||
var config = require('./configuration');
|
||||
|
||||
/**
|
||||
* Module for using a database interface.
|
||||
* Function for using a database interface.
|
||||
* Either local (NeDB) or remote (MongoDB).
|
||||
* @return {Object} database - Entire database engine (NeDB/MongoDB).
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
//lookup.js
|
||||
/**
|
||||
* Module for handling lookup requests by the user supplied search query.
|
||||
* @module lookup
|
||||
*/
|
||||
|
||||
//Importing first-party modules.
|
||||
var fs = require('fs');
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
//redirecter.js
|
||||
/**
|
||||
* Module for redirecting the user based on what they typed into search.
|
||||
* @module redirecter
|
||||
*/
|
||||
|
||||
|
||||
//Import first-party modules.
|
||||
var qs = require('querystring');
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
//schedule.js
|
||||
/**
|
||||
* Module for parsing downloaded schedule pages into useable/readable JSON objects.
|
||||
* Usually used after a lookup with the supplied information from it.
|
||||
* @module schedule
|
||||
*/
|
||||
|
||||
//Import first-party modules.
|
||||
var url = require('url');
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
//spider.js
|
||||
/**
|
||||
* Module/script for getting students, teachers, chambers and groups from the schedule website.
|
||||
* This script needs to be run before using the application, as the website will have no information to run on.
|
||||
* @module spider
|
||||
*/
|
||||
|
||||
//Import first-party modules.
|
||||
var url = require('url');
|
||||
|
|
8
time.js
8
time.js
|
@ -1,4 +1,10 @@
|
|||
//time.js
|
||||
/**
|
||||
* Module handling time related tasks.
|
||||
* Used for adding frontend features like showing what hour it currently is or
|
||||
* changing color because the school day is over.
|
||||
* @module time
|
||||
*/
|
||||
|
||||
//Importing self-written modules.
|
||||
var config = require('./configuration');
|
||||
|
@ -31,7 +37,7 @@ function parse(timestr) {
|
|||
/**
|
||||
* Function for parsing and checking if the currrent time is within the parsed string.
|
||||
* @param {String} timespan - A string containing a time from and to (e.g "9:15 - 10:00")
|
||||
* @return {Boolean} - Returns true if the current time is within the timespan or false when it's not.
|
||||
* @return {Boolean} Returns true if the current time is within the timespan or false when it's not.
|
||||
*/
|
||||
function withinTimespan(timespan) {
|
||||
if (get() > parse(timespan)[0] && get() < parse(timespan)[1]) return true;
|
||||
|
|
Loading…
Reference in a new issue