From 46b0bd54f31f70ccf197067193c233e5f77af129 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 28 Apr 2019 18:06:10 -0400 Subject: [PATCH] Indents are 8 positions, NEVER 4, and are comprised of tabs, not spaces. Anyone who believes otherwise is a racist. --- webcit-ng/static/js/main.js | 43 ++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/webcit-ng/static/js/main.js b/webcit-ng/static/js/main.js index 3c89914ac..f0b0e90a4 100644 --- a/webcit-ng/static/js/main.js +++ b/webcit-ng/static/js/main.js @@ -34,12 +34,11 @@ function _(x) { // function randomString(length) { var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghiklmnopqrstuvwxyz'.split(''); + var str = ''; - if (! length) { + if (!length) { length = Math.floor(Math.random() * chars.length); } - - var str = ''; for (var i = 0; i < length; i++) { str += chars[Math.floor(Math.random() * chars.length)]; } @@ -50,35 +49,35 @@ function randomString(length) { // string escape for html display // function escapeHTML(text) { - 'use strict'; - return text.replace(/[\"&<>]/g, function (a) { - return { - '"': '"', - '&': '&', - '<': '<', - '>': '>' - }[a]; - }); + 'use strict'; + return text.replace(/[\"&<>]/g, function (a) { + return { + '"': '"', + '&': '&', + '<': '<', + '>': '>' + }[a]; + }); } // string escape for html display // function escapeHTMLURI(text) { - 'use strict'; - return text.replace(/./g, function (a) { - return '%' + a.charCodeAt(0).toString(16); - }); + 'use strict'; + return text.replace(/./g, function (a) { + return '%' + a.charCodeAt(0).toString(16); + }); } // string escape for JavaScript string // function escapeJS(text) { - 'use strict'; - return text.replace(/[\"\']/g, function (a) { - return '\\' + a ; - }); + 'use strict'; + return text.replace(/[\"\']/g, function (a) { + return '\\' + a ; + }); } @@ -96,6 +95,7 @@ function ctdl_startup() { request = null; } + // Continuation of ctdl_startup() after serv_info is retrieved // function ctdl_startup_2(data) { @@ -112,6 +112,7 @@ function ctdl_startup_2(data) { display_room_list(); } + // Display a room list in the main div. // function display_room_list() { @@ -128,6 +129,7 @@ function display_room_list() { request = null; } + // Renderer for display_room_list() // function display_room_list_renderer(data) { @@ -162,6 +164,7 @@ function display_room_list_renderer(data) { document.getElementById("roomlist").innerHTML = new_roomlist_text ; } + // Update the "banner" div with all relevant info. // function update_banner() { -- 2.30.2