Skip to content

Commit

Permalink
add markdown help tips
Browse files Browse the repository at this point in the history
  • Loading branch information
IceskYsl committed Aug 25, 2012
1 parent 1a45dd7 commit b86c571
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 22 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ window.App =


$(document).ready ->
$("abbr.timeago").timeago()
$(".alert").alert()
$('.dropdown-toggle').dropdown()
$("abbr.timeago").timeago()
$(".alert").alert()
$('.dropdown-toggle').dropdown()



Expand Down
4 changes: 3 additions & 1 deletion app/assets/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,6 @@ h1, h2, h3, h4 { font-family: Arial, Helvetica, sans-serif; }
.p-con ul li { padding: 2px 0px 2px 6px; list-style-type: disc; background: url("images/p-con-li.png") no-repeat left 1px; color:#666; }
.p-con blockquote { font: italic 14px/19px Georgia, "Times New Roman", Times, serif; padding: 10px 20px; margin: 10px 0px; background: #ecf6f8; }
.p-con blockquote p { font: italic 14px/19px Georgia, "Times New Roman", Times, serif; }
.p-con blockquote li { padding: 2px 0px 2px 13px; list-style-type: none; font-size: 12px; line-height: 17px;}
.p-con blockquote li { padding: 2px 0px 2px 13px; list-style-type: none; font-size: 12px; line-height: 17px;}

.comments{margin-top: 10px; border-top: solid 1px #c5ded7; padding:10px 0px;}
28 changes: 27 additions & 1 deletion app/views/cpanel/posts/_editor_toolbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,31 @@
<ul class="pills" style="clear:none;">
<li class="edit active"><%= link_to(t("common.editor_toolbar_edit"), "#") %></li>
<li class="preview"><%= link_to(t("common.editor_toolbar_preview"), "#") %></li>
<li> <a href="#markdown_help_tip_modal" data-toggle="modal" data-keyboard="true" data-backdrop="true"><%=t("common.editor_toolbar_help")%></a></li>
</ul>
</div>
</div>


<div id="markdown_help_tip_modal" class="modal hide fade">
<div class="modal-header">
<a href="#" class="close" data-dismiss="modal">&times;</a>
<h4>格式说明</h4>
</div>
<div class="modal-body">
<ul>
<li>支持 Markdown 格式</li>
<li><strong>**粗体**</strong>、~~删除线~~、<code>`单行代码`</code></li>
<li>http://example.org 自动加链接</li>
<li>@name 会链接到用户页面,并会通知他</li>
<li>![Alt text here](http://foo.com/bar.jpg) 显示图片</li>
<li>多行代码格式,使用3个`包起来,注意要换行,第一个```后面接语言名称(ruby,bash,html,css,python,erb,java... <a href="http://pygments.org/docs/lexers/" target="_blank">更多</a>)<br />
比如这样:
<pre style="border:0;background:#FFF;margin:0;">```ruby
class Hello
end
```</pre>
</li>
</ul>
</div>
</div>

2 changes: 2 additions & 0 deletions app/views/cpanel/posts/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
<div class="clearfix">
<%= f.label :body %>
<div class="input">

<%= f.text_area :body, :class => "post_editor closewarning ", :style => "height:400px;width:99%" %>
</div>

</div>

<div class="clearfix">
Expand Down
18 changes: 17 additions & 1 deletion app/views/pages/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,26 @@
<div class="SL">
<div class="post" >
<div class="p-head">
<h1> <%=@page.title %></h1>
<h1> <%=@page.title %></h1>
</div>
<div class="p-con">
<%= raw @page.body %>
</div>
</div>

<div class="comments" >
<!-- Duoshuo Comment BEGIN -->
<div class="ds-thread"></div>
<script type="text/javascript">
var duoshuoQuery = {short_name:"<%=raw Setting.duoshuo_shortname%>"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = 'http://static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- Duoshuo Comment END -->
</div>
</div>
34 changes: 18 additions & 16 deletions app/views/posts/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,9 @@

<div class="p-con-author">
作者: <%= raw SiteConfig.site_author %> <br />
地址<%=link_to @post.title,post_path(@post)%>
原文地址<%=link_to @post.title,post_path(@post)%>
</div>

<!-- Duoshuo Comment BEGIN -->
<div class="ds-thread"></div>
<script type="text/javascript">
var duoshuoQuery = {short_name:"<%=raw Setting.duoshuo_shortname%>"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = 'http://static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- Duoshuo Comment END -->


<!-- <div id="disqus_thread"></div>
<script type="text/javascript">
Expand All @@ -51,4 +37,20 @@
-->
</div>
<div class="comments" >
<!-- Duoshuo Comment BEGIN -->
<div class="ds-thread"></div>
<script type="text/javascript">
var duoshuoQuery = {short_name:"<%=raw Setting.duoshuo_shortname%>"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = 'http://static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- Duoshuo Comment END -->
</div>

</div>
1 change: 1 addition & 0 deletions config/locales/menu.zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
access_denied: "访问被拒绝,你可能没有权限或未登录。"
editor_toolbar_edit: "编辑"
editor_toolbar_preview: "预览"
editor_toolbar_help: "帮助(按“M”键)"
by: ""
at: ""
hot_topics: "热门讨论"
Expand Down

0 comments on commit b86c571

Please sign in to comment.