Commit 0bf0c7c0 authored by Vanessa's avatar Vanessa

update time

parent a00f0951
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
// 获取广播 // 获取广播
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://symphony.b3log.org/apis/broadcasts", url: "http://symphony.b3log.org:8084/apis/broadcasts",
dataType: "jsonp", dataType: "jsonp",
jsonp: "callback", jsonp: "callback",
beforeSend: function() { beforeSend: function() {
...@@ -116,8 +116,8 @@ ...@@ -116,8 +116,8 @@
var articleLiHtml = "<li>" var articleLiHtml = "<li>"
+ "<a target='_blank' href='" + article.articlePermalink + "'>" + "<a target='_blank' href='" + article.articlePermalink + "'>"
+ article.articleTitle + "</a>&nbsp; <span class='date'>" + $.bowknot.getDate(article.articleCreateTime, 1); + article.articleTitle + "</a>&nbsp; <span class='date'>" + $.bowknot.getDate(article.articleCreateTime, 1);
+"</span></li>" +"</span></li>";
listHTML += articleLiHtml listHTML += articleLiHtml;
} }
listHTML += "</ul>"; listHTML += "</ul>";
...@@ -136,7 +136,19 @@ ...@@ -136,7 +136,19 @@
url: latkeConfig.servePath + "/console/plugins/b3log-broadcast/chance", url: latkeConfig.servePath + "/console/plugins/b3log-broadcast/chance",
success: function(result) { success: function(result) {
if (result.sc) { if (result.sc) {
$("#b3logBroadcast .module-header > button").text(result.broadcastChanceExpirationTime + "${chanceBroadcastLabel}").show(); var ShowCountDown = function() {
var now = new Date();
var leftTime = result.broadcastChanceExpirationTime - now.getTime();
var leftsecond = parseInt(leftTime / 1000);
var minute = Math.floor(leftsecond / 60),
second = Math.floor(leftsecond - minute * 60);
$("#b3logBroadcast .module-header > button").text("${chanceBroadcastLabel}:" + minute + ":" + second).show();
};
window.setInterval(function() {
ShowCountDown();
}, 1000);
} else { } else {
$("#b3logBroadcast .module-header > button").hide(); $("#b3logBroadcast .module-header > button").hide();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment