Skip to content

Commit b5c43e2

Browse files
committed
add documentation
1 parent 69fea4c commit b5c43e2

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

assets/js/admin.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,27 @@ const $ = {
4545
return elements.length === 1 ? elements[0] : elements;
4646
},
4747

48-
// wrapper around JQuery Ajax methods for GET request
48+
/**
49+
* Wrapper around JQuery Ajax methods for GET request
50+
*
51+
* @author Sheikh Saad Abdullah (A00447871)
52+
* @param {String} endpoint target to request data from
53+
* @param {Function} callback function to process data received
54+
*/
4955
get(endpoint, callback) {
5056
jQuery
5157
.get(SERVER_URL + endpoint, callback)
5258
.fail((err) => console.log(err));
5359
},
5460

55-
// wrapper around JQuery Ajax methods for POST request
61+
//
62+
/**
63+
* Wrapper around JQuery Ajax methods for POST request
64+
*
65+
* @author Sheikh Saad Abdullah (A00447871)
66+
* @param {String} endpoint target to send request to
67+
* @param {Object} payload data to send
68+
*/
5669
post(endpoint, payload) {
5770
jQuery
5871
.post(SERVER_URL + endpoint, payload, (res) => console.log(res))
@@ -107,6 +120,7 @@ const staticData = {
107120
* Enable or disable the editing of a blog post
108121
*
109122
* @author Mohak Shrivastava (A00445470)
123+
* @author Sheikh Saad Abdullah (A00447871)
110124
* @param {Object} elem DOM object of the switched edit toggle
111125
* @param {Number} index index of the toggle switch
112126
*/
@@ -211,6 +225,7 @@ const staticData = {
211225
* Save a word to the word bank
212226
*
213227
* @author Mohak Shrivastava (A00445470)
228+
* @author Sheikh Saad Abdullah (A00447871)
214229
*/
215230
saveWord() {
216231
let wb = $.el("#wb");
@@ -236,6 +251,7 @@ const staticData = {
236251
* else append the word to the text being edited
237252
*
238253
* @author Mohak Shrivastava (A00445470)
254+
* @author Sheikh Saad Abdullah (A00447871)
239255
* @param {String} word text from the word bank
240256
*/
241257
putWord(word) {
@@ -285,6 +301,7 @@ const staticData = {
285301
* Variables and functions to control behaviour of the Keyboard
286302
*
287303
* @author Naziya Tasnim (A00447506)
304+
* @author Sheikh Saad Abdullah (A00447871)
288305
* -------------------------------------------------------------------- */
289306

290307
kbdFocus: null, // text field to focus
@@ -295,6 +312,7 @@ const staticData = {
295312
* Character of the key pressed
296313
*
297314
* @author Naziya Tasnim (A00447506)
315+
* @author Sheikh Saad Abdullah (A00447871)
298316
* @param {String} char character or string to convert
299317
* @returns uppercase of char if keyboard is in caps/shift mode
300318
*/
@@ -315,6 +333,7 @@ const staticData = {
315333
* Adds a character to the text area
316334
*
317335
* @author Naziya Tasnim (A00447506)
336+
* @author Sheikh Saad Abdullah (A00447871)
318337
* @param {String} selection character to add to text area
319338
*/
320339
addText(selection) {

assets/js/viewer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ const PORT = 49149, // port to connect to server on
1818
const staticData = {
1919
content: "Disconnected from server.",
2020

21+
/**
22+
* Load blog from database server
23+
*
24+
* @author Sheikh Saad Abdullah (A00447871)
25+
* @param {Number} blogNum index of blog to load
26+
*/
2127
load(blogNum) {
2228
$.get(SERVER_URL + "/blog/" + blogNum, (res) => {
2329
this.content = res.data;

0 commit comments

Comments
 (0)