Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

Commit

Permalink
Update stylesheets.
Browse files Browse the repository at this point in the history
  • Loading branch information
wzpan committed Jul 4, 2017
1 parent d9afbc6 commit be79dd7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<link rel="stylesheet" href="http://onmw7y6f4.bkt.clouddn.com/comment-v1.0.3.1.css">
<link rel="stylesheet" href="http://onmw7y6f4.bkt.clouddn.com/comment-v1.0.4.1.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown.js/0.5.0/markdown.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/timeago.js/3.0.2/timeago.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js"></script>
<script src="http://onmw7y6f4.bkt.clouddn.com/comment-v1.0.4.1.js"></script>
<script src="http://onmw7y6f4.bkt.clouddn.com/comment-v1.0.4.2.js"></script>

<style>
.btn {
Expand Down
10 changes: 7 additions & 3 deletions comment.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
width: 100%;
/*background-color: #fff;*/
border-bottom: 2px solid #e6ebf1;
margin-bottom: 14px;
}

.discussion-timeline::before {
Expand Down Expand Up @@ -126,18 +127,19 @@
.timeline-comment-header {
padding-right: 15px;
padding-left: 15px;
color: #586069;
color: #586069;
background-color: #f6f8fa;
border-bottom: 1px solid #d1d5da;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
line-height: 1em;
line-height: 1em!important;
}

.timeline-comment-header h3 {
margin-top: 0;
margin-bottom: 0;
color: #586069;
line-height: 40px;
}

.timeline-comment-header a {
Expand Down Expand Up @@ -191,7 +193,8 @@
}

.d-block {
display: block !important;
display: block !important;
border-bottom: 0px;
}

.markdown-body>*:last-child {
Expand Down Expand Up @@ -328,6 +331,7 @@
}

#recent-comments .comment-widget-avatar .avatar {
margin-bottom: 5px;
display: block;
}

Expand Down
27 changes: 17 additions & 10 deletions comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _getComment = function(params, callback) {
success: function (page_comments) {
if (!page_comments || page_comments.length <= 0) {
(callback && typeof(callback) === "function") && callback(comments);
callback = null;
return;
}
page_comments.forEach(function(comment){
Expand All @@ -67,7 +68,7 @@ var _getComment = function(params, callback) {
},
error: function(err) {
(callback && typeof(callback) === "function") && callback(comments);
return;
callback = null;
}
});
}
Expand All @@ -86,14 +87,15 @@ var _getCommentsUrl = function(params, callback) {
success: function (issues) {
if (!issues || issues.length <= 0) {
(callback && typeof(callback) === "function") && callback("", "");
callback = null;
return;
}
issues.forEach(function(issue){
// match title
if (issue.title && issue.title == issue_title) {
(callback && typeof(callback) === "function") && callback(issue.comments_url, issue);
found = true;
return;
callback = null;
}
});
if (!found) {
Expand All @@ -105,7 +107,7 @@ var _getCommentsUrl = function(params, callback) {
},
error: function() {
(callback && typeof(callback) === "function") && callback("", "");
return;
callback = null;
}
});
}
Expand All @@ -115,6 +117,7 @@ var _getIssue = function(issue_id, callback) {
let issue_url = api_addr + username + '/' + repo + '/issues/' + issue_id;
_getIssueByUrl(issue_url, (issue)=>{
(callback && typeof(callback) === "function") && callback(issue);
callback = null;
});
}

Expand All @@ -128,15 +131,16 @@ var _getIssueByUrl = function(issue_url, callback) {
success: function (issues) {
if (!issues || issues.length <= 0) {
(callback && typeof(callback) === "function") && callback();
callback = null;
return;
}
let issue = issues;
(callback && typeof(callback) === "function") && callback(issue);
return;
callback = null;
},
error: function() {
(callback && typeof(callback) === "function") && callback();
return;
callback = null;
}
});
}
Expand Down Expand Up @@ -214,11 +218,13 @@ var _renderRecentComment = function(user, title, content, time, url, callback) {
</div>
`;
(callback && typeof(callback) === "function") && callback(res);
callback = null;
}

var _getRecentCommentList = function(comment_list, i, render_count, total_count, comments, callback) {
if (render_count>=total_count || i>=comments.length) {
(callback && typeof(callback) === "function") && callback(comment_list);
callback = null;
return;
}
let comment = comments[i];
Expand All @@ -231,6 +237,7 @@ var _getRecentCommentList = function(comment_list, i, render_count, total_count,
if (!content || content == '') {
i++;
_getRecentCommentList(comment_list, i, render_count, total_count, comments, callback);
return;
}
if (!title) {
// Get title of issue
Expand All @@ -243,7 +250,7 @@ var _getRecentCommentList = function(comment_list, i, render_count, total_count,
});
});
} else {
_renderRecentComment(user, issue.title, content, time, url, (item) => {
_renderRecentComment(user, title, content, time, url, (item) => {
comment_list += item;
i++;
render_count++;
Expand Down Expand Up @@ -316,11 +323,11 @@ var _getRecentIssues = function(params, callback) {
issues = issues.sort('created_at').reverse().slice(0, 5);
}
(callback && typeof(callback) === "function") && callback(issues);
return;
callback = null;
},
error: function (err) {
(callback && typeof(callback) === "function") && callback();
return;
callback = null;
}
});
}
Expand All @@ -341,11 +348,11 @@ var _getRecentComments = function(params, callback) {
}

(callback && typeof(callback) === "function") && callback(comments);
return;
callback = null;
},
error: function (err) {
(callback && typeof(callback) === "function") && callback();
return;
callback = null;
}
});
}
Expand Down
Loading

0 comments on commit be79dd7

Please sign in to comment.