//
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)];
}
// 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 ;
+ });
}
request = null;
}
+
// Continuation of ctdl_startup() after serv_info is retrieved
//
function ctdl_startup_2(data) {
display_room_list();
}
+
// Display a room list in the main div.
//
function display_room_list() {
request = null;
}
+
// Renderer for display_room_list()
//
function display_room_list_renderer(data) {
document.getElementById("roomlist").innerHTML = new_roomlist_text ;
}
+
// Update the "banner" div with all relevant info.
//
function update_banner() {