Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/1283/head
zouap 3 years ago
parent
commit
07af0d24f0
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      public/home/home.js

+ 5
- 5
public/home/home.js View File

@@ -32,7 +32,6 @@ var swiperRepo = new Swiper(".homepro-list", {
},
});


var output = document.getElementById("newmessage");
var socket = new WebSocket("ws://" + document.location.host + "/action/notification");

@@ -45,10 +44,12 @@ var maxSize = 20;
var html =document.documentElement;
var lang = html.attributes["lang"]
var isZh = true;
if(lang != null && lang =="en-US" ){
if(lang != null && lang.nodeValue =="en-US" ){
console.log("the language is " + lang.nodeValue);
isZh=false;
}else{
console.log("default lang=zh");
}
console.log("the language is " + lang);

socket.onmessage = function (e) {
var data =JSON.parse(e.data)
@@ -364,8 +365,7 @@ function displayRepo(json){
if(record["Topics"] != null){
for(var j = 0; j < record["Topics"].length; j++){
topic = record["Topics"][j];
url = "/explore/repos?q=" + topic + "&amp;topic="
url = escape(url);
url = "/explore/repos?q=" + escape(topic) + "&amp;topic="
html += "<a class=\"ui small label topic\" href=\"" + url + "\">" + topic + "</a>";
}
}


Loading…
Cancel
Save