Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加二维码,微信分享 #590

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 43 additions & 43 deletions views/sign/reset.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
<%- partial('../sign/sidebar') %>
<div id='content'>
<div class='panel'>
<div class='header'>
<ul class='breadcrumb'>
<li><a href='/'>主页</a><span class='divider'>/</span></li>
<li class='active'>重置密码</li>
</ul>
</div>
<div class='inner'>
<% if(typeof(error) !== 'undefined' && error){ %>
<div class="alert alert-error">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<strong><%= error %></strong>
</div>
<% } %>
<form id='signin_form' class='form-horizontal' action='/reset_pass' method='post'>
<div class='control-group'>
<label class='control-label' for='psw'>新密码</label>
<div class='controls'>
<input class='input-xlarge' id='psw' name='psw' size='30' type='password'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='repsw'>确认密码</label>
<div class='controls'>
<input class='input-xlarge' id='repsw' name='repsw' size='30' type='password'/>
</div>
</div>
<input type='hidden' name='_csrf' value='<%= csrf %>'/>
<input type='hidden' name='name' id='name' value='<%= name%>'>
<input type='hidden' name='key' id='key' value='<%= key%>'>
<div class='form-actions'>
<input type='submit' class='span-primary' value='确定'/>
</div>
</form>
</div>
</div>
</div>
<%- partial('../sign/sidebar') %>

<div id='content'>
<div class='panel'>
<div class='header'>
<ul class='breadcrumb'>
<li><a href='/'>主页</a><span class='divider'>/</span></li>
<li class='active'>重置密码</li>
</ul>
</div>
<div class='inner'>
<% if(typeof(error) !== 'undefined' && error){ %>
<div class="alert alert-error">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<strong><%= error %></strong>
</div>
<% } %>
<form id='signin_form' class='form-horizontal' action='/reset_pass' method='post'>
<div class='control-group'>
<label class='control-label' for='psw'>新密码</label>

<div class='controls'>
<input class='input-xlarge' id='psw' name='psw' size='30' type='password'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='repsw'>确认密码</label>

<div class='controls'>
<input class='input-xlarge' id='repsw' name='repsw' size='30' type='password'/>
</div>
</div>
<input type='hidden' name='_csrf' value='<%= csrf %>'/>
<input type='hidden' name='name' id='name' value='<%= name%>'>
<input type='hidden' name='key' id='key' value='<%= key%>'>

<div class='form-actions'>
<input type='submit' class='span-primary' value='确定'/>
</div>
</form>
</div>
</div>
</div>
37 changes: 37 additions & 0 deletions views/topic/_share.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

<a href="javascript:void(0)" id="wexin"><i class="fa fa-share"></i>微信
<div id="qc-popup">
<div id="QRCode"></div>
</div>
</a>
<style type="text/css">
#wexin {
display: inline-block;
}
#qc-popup {
display: none;
background: #FFF;
position: absolute;
margin-top: -4.5em;
margin-left: 3.4em;
padding: 10px;
border: 1px solid #e5e5e5;
}
</style>
<script type="text/javascript">
//popup the QRCode
$("#wexin").hover(function () {
$("#qc-popup").show();
}, function (){
$("#qc-popup").hide();
});
// qrcode generate
var host = "https://cnodejs.org"
var url = host + "/topic/<%= topic._id %>";
new QRCode(document.getElementById("QRCode"), {
text: url,
width: 150,
height: 150,
});
// END qrcode generate
</script>
2 changes: 2 additions & 0 deletions views/topic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
<% if (topic.tab) { %>
<span> 来自 <%= topic.tabName %></span>
<%}%>
<!-- <span>微信分享</span> -->
<%- partial('../topic/_share') %>
</div>
<% if (current_user) { %>
<div id="manage_topic">
Expand Down