| @@ -32,7 +32,6 @@ var swiperRepo = new Swiper(".homepro-list", { | |||||
| }, | }, | ||||
| }); | }); | ||||
| var output = document.getElementById("newmessage"); | var output = document.getElementById("newmessage"); | ||||
| var socket = new WebSocket("ws://" + document.location.host + "/action/notification"); | var socket = new WebSocket("ws://" + document.location.host + "/action/notification"); | ||||
| @@ -45,10 +44,12 @@ var maxSize = 20; | |||||
| var html =document.documentElement; | var html =document.documentElement; | ||||
| var lang = html.attributes["lang"] | var lang = html.attributes["lang"] | ||||
| var isZh = true; | 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; | isZh=false; | ||||
| }else{ | |||||
| console.log("default lang=zh"); | |||||
| } | } | ||||
| console.log("the language is " + lang); | |||||
| socket.onmessage = function (e) { | socket.onmessage = function (e) { | ||||
| var data =JSON.parse(e.data) | var data =JSON.parse(e.data) | ||||
| @@ -364,8 +365,7 @@ function displayRepo(json){ | |||||
| if(record["Topics"] != null){ | if(record["Topics"] != null){ | ||||
| for(var j = 0; j < record["Topics"].length; j++){ | for(var j = 0; j < record["Topics"].length; j++){ | ||||
| topic = record["Topics"][j]; | topic = record["Topics"][j]; | ||||
| url = "/explore/repos?q=" + topic + "&topic=" | |||||
| url = escape(url); | |||||
| url = "/explore/repos?q=" + escape(topic) + "&topic=" | |||||
| html += "<a class=\"ui small label topic\" href=\"" + url + "\">" + topic + "</a>"; | html += "<a class=\"ui small label topic\" href=\"" + url + "\">" + topic + "</a>"; | ||||
| } | } | ||||
| } | } | ||||