|
|
@@ -25,8 +25,8 @@ if(lang != null && lang =="en-US" ){ |
|
|
|
console.log("the language is " + lang); |
|
|
|
|
|
|
|
socket.onmessage = function (e) { |
|
|
|
console.log("data=" + e.data) |
|
|
|
var data =JSON.parse(e.data) |
|
|
|
console.log("data=" + data) |
|
|
|
var html = ""; |
|
|
|
if (data != null){ |
|
|
|
if(messageQueue.length > maxSize){ |
|
|
@@ -35,21 +35,22 @@ socket.onmessage = function (e) { |
|
|
|
messageQueue.push(data); |
|
|
|
} |
|
|
|
for(var i = 0; i < messageQueue.length;i++){ |
|
|
|
var record = messageQueue[i]; |
|
|
|
html += "<div class=\"swiper-slide item\">"; |
|
|
|
html += " <img class=\"ui avatar image\" src=\"/user/avatar/" + data.ActUser.LowerName + "/-1\" alt=\"\">" |
|
|
|
html += " <img class=\"ui avatar image\" src=\"/user/avatar/" + record.ActUser.LowerName + "/-1\" alt=\"\">" |
|
|
|
html += " <div class=\"middle aligned content\">" |
|
|
|
html += " <a href=\"/" + data.ActUser.Name + "\" title=\"\">" + data.ActUser.Name + "</a>" |
|
|
|
html += " <a href=\"/" + record.ActUser.Name + "\" title=\"\">" + record.ActUser.Name + "</a>" |
|
|
|
|
|
|
|
var actionName = getAction(data.OpType,isZh); |
|
|
|
if(data.OpType == "6" || data.OpType == "10" || data.OpType == "12" || data.OpType == "13"){ |
|
|
|
html += " <a href=\"/" + getIssueLink(data) + "\" rel=\"nofollow\">" + getIssueText(data,actionName) + "</a>" |
|
|
|
var actionName = getAction(record.OpType,isZh); |
|
|
|
if(record.OpType == "6" || record.OpType == "10" || record.OpType == "12" || record.OpType == "13"){ |
|
|
|
html += " <a href=\"/" + getIssueLink(record) + "\" rel=\"nofollow\">" + getIssueText(record,actionName) + "</a>" |
|
|
|
} |
|
|
|
if(data.OpType == "7" || data.OpType == "11" || data.OpType == "14" || data.OpType == "15"){ |
|
|
|
html += " <a href=\"/" + getPRLink(data) + "\" rel=\"nofollow\">" + getPRText(data,actionName) + "</a>" |
|
|
|
if(record.OpType == "7" || record.OpType == "11" || record.OpType == "14" || record.OpType == "15"){ |
|
|
|
html += " <a href=\"/" + getPRLink(record) + "\" rel=\"nofollow\">" + getPRText(record,actionName) + "</a>" |
|
|
|
} |
|
|
|
|
|
|
|
if(data.Repo != null){ |
|
|
|
var time = getTime(data.Repo.UpdatedUnix); |
|
|
|
if(record.Repo != null){ |
|
|
|
var time = getTime(record.Repo.UpdatedUnix); |
|
|
|
html += time; |
|
|
|
} |
|
|
|
html += "</div>"; |
|
|
|