From fefeee7ccf1b6fb6a133c8b9c5eb07b1760c2d94 Mon Sep 17 00:00:00 2001 From: rstular Date: Mon, 17 Feb 2020 15:15:55 +0100 Subject: Reformatting --- js/messaging.js | 462 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 258 insertions(+), 204 deletions(-) (limited to 'js/messaging.js') diff --git a/js/messaging.js b/js/messaging.js index 42bbd0b..4004147 100644 --- a/js/messaging.js +++ b/js/messaging.js @@ -1,3 +1,10 @@ +const API_ENDPOINT = "https://gimb.tk/test.php"; +const DIRECTORY_URL = "/directory.json"; +// const API_ENDPOINT = "http://localhost:5000/test.php"; + +// "Global" object for name directory +var directory = null; + async function checkLogin() { localforage.getItem("logged_in").then(function (value) { // This code runs once the value has been loaded @@ -11,31 +18,72 @@ async function checkLogin() { }); } -function htmlEncode(value){ - // Create a in-memory element, set its inner text (which is automatically encoded) - // Then grab the encoded contents back out. The element never exists on the DOM. - return $('