| @@ -41,13 +41,13 @@ socket.onmessage = function (e) { | |||
| html += " <img class=\"ui avatar image\" src=\"/user/avatar/" + record.ActUser.LowerName + "/-1\" alt=\"\">" | |||
| html += " <div class=\"middle aligned content\">" | |||
| html += " <a href=\"/" + record.ActUser.Name + "\" title=\"\">" + record.ActUser.Name + "</a>" | |||
| var actionName = getAction(record.OpType,isZh); | |||
| html += actionName; | |||
| if(record.OpType == "6" || record.OpType == "10" || record.OpType == "12" || record.OpType == "13"){ | |||
| html += " <a href=\"/" + getIssueLink(record) + "\" rel=\"nofollow\">" + getIssueText(record,actionName) + "</a>" | |||
| html += " <a href=\"" + getIssueLink(record) + "\" rel=\"nofollow\">" + getIssueText(record) + "</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>" | |||
| html += " <a href=\"" + getPRLink(record) + "\" rel=\"nofollow\">" + getPRText(record) + "</a>" | |||
| } | |||
| if(record.Repo != null){ | |||
| @@ -74,18 +74,18 @@ function getTime(UpdatedUnix){ | |||
| return "10分钟前"; | |||
| } | |||
| function getPRLink(data){ | |||
| return "/" + data.Repo.OwnerName + "/" + data.Repo.Name + "/pulls/" + data.ID | |||
| function getPRLink(record){ | |||
| return "/" + record.Repo.OwnerName + "/" + record.Repo.Name + "/pulls/" + record.ID | |||
| } | |||
| function getPRText(data,actionName){ | |||
| return actionName + " " + data.Repo.OwnerName + "/" + data.Repo.Name + "#" + data.ID | |||
| function getPRText(record){ | |||
| return record.Repo.OwnerName + "/" + record.Repo.Name + "#" + record.ID | |||
| } | |||
| function getIssueLink(data){ | |||
| return "/" + data.Repo.OwnerName + "/" + data.Repo.Name + "/issues/" + data.ID | |||
| function getIssueLink(record){ | |||
| return "/" + record.Repo.OwnerName + "/" + record.Repo.Name + "/issues/" + record.ID | |||
| } | |||
| function getIssueText(data,actionName){ | |||
| return actionName + " " + data.Repo.OwnerName + "/" + data.Repo.Name + "#" + data.ID | |||
| function getIssueText(record){ | |||
| return record.Repo.OwnerName + "/" + record.Repo.Name + "#" + record.ID | |||
| } | |||
| /* | |||
| @@ -128,7 +128,7 @@ var actionNameZH={ | |||
| "15":"重新开启了合并请求", | |||
| "17":"从 {repoName} 删除分支 {deleteBranchName}", | |||
| "22":"拒绝了合并请求" | |||
| } | |||
| }; | |||
| var actionNameEN={ | |||
| "1":"created repository", | |||
| @@ -144,7 +144,7 @@ var actionNameEN={ | |||
| "15":"reopened pull request", | |||
| "17":"deleted branch {deleteBranchName} from {repoName}", | |||
| "22":"rejected pull request" | |||
| } | |||
| }; | |||
| function getAction(opType,isZh){ | |||
| if(isZh){ | |||