Bruce responsive enhancement

This commit is contained in:
Liang Ding 2015-02-25 10:45:04 +08:00
parent 4f9c481851
commit 02ea3734ce
2 changed files with 30 additions and 27 deletions

View File

@ -1,36 +1,38 @@
<#macro comments commentList article> <#macro comments commentList article>
<div class="row" id="comments"> <div class="row" id="comments">
<#list commentList as comment> <div class="col-sm-12">
<div class="row comment" id="${comment.oId}"> <#list commentList as comment>
<img class="col-sm-1" title="${comment.commentName}" <div class="row comment" id="${comment.oId}">
alt="${comment.commentName}" src="${comment.commentThumbnailURL}"/> <img class="col-sm-1" title="${comment.commentName}"
<div class="col-sm-11"> alt="${comment.commentName}" src="${comment.commentThumbnailURL}"/>
<div class="row"> <div class="col-sm-11">
<#if "http://" == comment.commentURL> <div class="row">
<a>${comment.commentName}</a> <#if "http://" == comment.commentURL>
<#else> <a>${comment.commentName}</a>
<a href="${comment.commentURL}" target="_blank">${comment.commentName}</a> <#else>
</#if> <a href="${comment.commentURL}" target="_blank">${comment.commentName}</a>
<#if comment.isReply>@ </#if>
<a href="${servePath}${article.permalink}#${comment.commentOriginalCommentId}" <#if comment.isReply>@
onmouseover="page.showComment(this, '${comment.commentOriginalCommentId}', 20);" <a href="${servePath}${article.permalink}#${comment.commentOriginalCommentId}"
onmouseout="page.hideComment('${comment.commentOriginalCommentId}')">${comment.commentOriginalCommentName}</a> onmouseover="page.showComment(this, '${comment.commentOriginalCommentId}', 20);"
</#if> onmouseout="page.hideComment('${comment.commentOriginalCommentId}')">${comment.commentOriginalCommentName}</a>
</#if>
<span class="gray">• ${comment.commentDate?string("yy-MM-dd HH:mm")} • <#if article.commentable> <span class="gray">• ${comment.commentDate?string("yy-MM-dd HH:mm")} • <#if article.commentable>
<a rel="nofollow" href="javascript:replyTo('${comment.oId}');">Reply</a> <a rel="nofollow" href="javascript:replyTo('${comment.oId}');">Reply</a>
</#if></span> </#if></span>
</div>
<div class="row code-highlight">${comment.commentContent}</div>
</div> </div>
<div class="row code-highlight">${comment.commentContent}</div>
</div> </div>
</#list>
</div> </div>
</#list>
</div> </div>
<#if article.commentable> <#if article.commentable>
<div class="row cmtForm"> <div class="row cmtForm">
<table id="commentForm"> <table id="commentForm" class="col-sm-12">
<tbody> <tbody>
<#if !isLoggedIn> <#if !isLoggedIn>
<tr> <tr>
@ -70,7 +72,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<textarea rows="10" cols="72" id="comment"></textarea> <textarea rows="10" style="width: 100%;" id="comment"></textarea>
</td> </td>
</tr> </tr>
<#if !isLoggedIn> <#if !isLoggedIn>
@ -117,7 +119,7 @@
"externalRelevantArticles1Label": "${externalRelevantArticlesLabel}" "externalRelevantArticles1Label": "${externalRelevantArticlesLabel}"
}); });
var addComment = function(result, state) { var addComment = function (result, state) {
var commentHTML = '<div class="row comment" id="' + result.oId + '"><img class="col-sm-1" \ var commentHTML = '<div class="row comment" id="' + result.oId + '"><img class="col-sm-1" \
title="' + result.userName + '" alt="' + result.userName + title="' + result.userName + '" alt="' + result.userName +
'" src="' + result.commentThumbnailURL '" src="' + result.commentThumbnailURL
@ -144,16 +146,16 @@
return commentHTML; return commentHTML;
}; };
var replyTo = function(id) { var replyTo = function (id) {
var commentFormHTML = "<table class='cmtReplyForm' id='replyForm'>"; var commentFormHTML = "<table class='cmtReplyForm' id='replyForm'>";
page.addReplyForm(id, commentFormHTML); page.addReplyForm(id, commentFormHTML);
$("#replyForm label").each(function() { $("#replyForm label").each(function () {
$this = $(this); $this = $(this);
$this.attr("for", $this.attr("for") + "Reply"); $this.attr("for", $this.attr("for") + "Reply");
}); });
}; };
$(document).ready(function() { $(document).ready(function () {
page.load(); page.load();
// emotions // emotions
page.replaceCommentsEm("#comments"); page.replaceCommentsEm("#comments");

View File

@ -7,6 +7,7 @@
<meta name="copyright" content="B3log" /> <meta name="copyright" content="B3log" />
<meta name="owner" content="B3log Team" /> <meta name="owner" content="B3log Team" />
<meta name="revised" content="${blogTitle?html}, ${year}" /> <meta name="revised" content="${blogTitle?html}, ${year}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" />
<meta http-equiv="Window-target" content="_top" /> <meta http-equiv="Window-target" content="_top" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/skins/${skinDirName}/css/bootstrap${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" /> <link type="text/css" rel="stylesheet" href="${staticServePath}/skins/${skinDirName}/css/bootstrap${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/skins/${skinDirName}/css/${skinDirName}${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" /> <link type="text/css" rel="stylesheet" href="${staticServePath}/skins/${skinDirName}/css/${skinDirName}${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" />