Explorar o código

Add files via upload

Daniele Bonini (皮夕): WebDev, DevOps and homomm.org by lots of Simplicity bits %!s(int64=3) %!d(string=hai) anos
pai
achega
14acf0ee34
Modificáronse 2 ficheiros con 13 adicións e 18 borrados
  1. 10 4
      Public/static/js/common.js
  2. 3 14
      Public/static/js/home.js

+ 10 - 4
Public/static/js/common.js

@@ -1,20 +1,20 @@
 /**
  * Copyright 2021, 2024 5 Mode
  *
- * This file is part of Http Console.
+ * This file is part of Homomm.
  *
- * Http Console is free software: you can redistribute it and/or modify
+ * Homomm is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
- * Http Console is distributed in the hope that it will be useful,
+ * Homomm is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.  
  * 
  * You should have received a copy of the GNU General Public License
- * along with Http Console. If not, see <https://www.gnu.org/licenses/>.
+ * along with Homomm. If not, see <https://www.gnu.org/licenses/>.
  *
  * commons.js
  * 
@@ -36,3 +36,9 @@ function encryptSha2(string) {
   jsSHAo.update(string);
   return jsSHAo.getHash("HEX");
 }
+
+function rnd(min, max) {
+  min = Math.ceil(min);
+  max = Math.floor(max);
+  return Math.floor(Math.random() * (max - min +1)) + min;
+}

+ 3 - 14
Public/static/js/home.js

@@ -117,18 +117,6 @@ function closeSplash() {
   $("#splash").hide();	
 }
 
-/**
- * Encrypt the given string
- * 
- * @param {string} string - The string to encrypt
- * @returns {string} the encrypted string
- */
-function encryptSha2(string) {
-  var jsSHAo = new jsSHA("SHA-256", "TEXT", 1);
-  jsSHAo.update(string);
-  return jsSHAo.getHash("HEX");
-}
-
 function refresh() {
  $("#CommandLine").val("refreshbrd");
  frmHC.submit();
@@ -158,7 +146,7 @@ function deleteMsg(msg) {
 }  
 
 function openPic(pic) {
-  $("#CommandLine").val("openpic " + pic)
+  $("#CommandLine").val("openpic " + pic);
   frmHC.submit();
 }
 
@@ -180,7 +168,8 @@ function checkServer() {
       if (data.length === 2 && data[0] === 200) {
       
         if ($("input#last_message").val() !== data[1]) {
-          refresh();
+          $("#myPlayButton").click();
+          setTimeout("refresh()", 12000);
         }
 
       }