MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / Threadfin

Function Threadfin

html/js/data.js:215–294  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

213}
214
215function Threadfin(data) {
216 if (webSockets == false) {
217 alert("Your browser does not support WebSockets");
218 return;
219 } else {
220 if (data["cmd"] != "getLog") {
221 showLoadingScreen(true)
222 }
223 }
224 delete undo["epgMapping"];
225
226 var protocolWS
227 switch (window.location.protocol) {
228 case "http:": protocolWS = "ws://"; break;
229 case "https:": protocolWS = "wss://"; break;
230 }
231
232
233 var ws = new WebSocket(protocolWS + window.location.hostname + ":" + window.location.port + "/data/" + "?Token=" + getCookie("Token"));
234 ws.onopen = function () {
235 console.log(data)
236 ws.send(JSON.stringify(data));
237 }
238
239 ws.onmessage = function (e) {
240 var response = JSON.parse(e.data);
241 console.log(response);
242
243 if (response.hasOwnProperty("clientInfo")) {
244 createClintInfo(response["clientInfo"]);
245 }
246
247 if (response.hasOwnProperty("log")) {
248 createClintInfo(response["log"]);
249 }
250
251 if (response.hasOwnProperty("status")) {
252 if (response["status"] == false) {
253 alert(response["err"])
254 if (response.hasOwnProperty("reload")) {
255 location.reload();
256 }
257 //checkErr(response)
258 console.log(response);
259 updateThreadfinStatus(response);
260 setTimeout(function () { showLoadingScreen(false); }, 300);
261
262 return
263 }
264
265 updateThreadfinStatus(response)
266
267 //console.log(data["cmd"]);
268 switch (data["cmd"]) {
269 case "saveUserData": createMenu(); break;
270 case "saveNewUser": createMenu(); break;
271 case "saveFilesXMLTV": //createMenu(); break;
272 case "saveFilesM3U": //createMenu(); return; break;

Callers 11

updateLogFunction · 0.70
emptyLogFunction · 0.70
saveData2Function · 0.70
saveDataFunction · 0.70
saveXEPGFunction · 0.70
saveUserDetailFunction · 0.70
pageReadyFunction · 0.70
ThreadfinBackupFunction · 0.70
ThreadfinRestoreFunction · 0.70
saveFileDetailFunction · 0.70
updateFileFunction · 0.70

Calls 6

showLoadingScreenFunction · 0.85
createClintInfoFunction · 0.85
updateThreadfinStatusFunction · 0.85
createMenuFunction · 0.85
writeLogInDivFunction · 0.85
getCookieFunction · 0.70

Tested by

no test coverage detected