Skip to content

Commit 1fa2186

Browse files
committed
upgrades to rails4
1 parent 77cf6dd commit 1fa2186

File tree

249 files changed

+17410
-17785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+17410
-17785
lines changed

.nojekyll

Whitespace-only changes.

Gemfile

-4
This file was deleted.

Gemfile.lock

-32
This file was deleted.

README.md

+1-1

_config.yml

-5
This file was deleted.

_includes/_footer.html

-6
This file was deleted.

_includes/_header.html

-17
This file was deleted.

_layouts/chapter.html

-12
This file was deleted.

_layouts/default.html

-7
This file was deleted.

assets/images/alipay.gif

-1.57 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-89.1 KB
Binary file not shown.
Binary file not shown.
-87.5 KB
Binary file not shown.
Binary file not shown.
-85.8 KB
Binary file not shown.
-45.9 KB
Binary file not shown.

assets/images/figures/hello_world.png

-19 KB
Binary file not shown.
-78.3 KB
Binary file not shown.

assets/images/figures/heroku_info.png

-115 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

assets/images/figures/new_readme.png

-14.7 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-141 KB
Binary file not shown.
-103 KB
Binary file not shown.
-123 KB
Binary file not shown.
-80.5 KB
Binary file not shown.
Binary file not shown.
-56.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-58.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

assets/js/global.js

+13-48
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,22 @@
11
var tutorialScript = {
22
init: function() {
3-
var fnrefback = 'fnref-';
4-
5-
this.generateTOC();
6-
this.enhanceFootnoteItem();
7-
this.addIdToSup();
8-
this.addCaptionClassToImage();
9-
this.addCaptionClassToTable();
10-
},
11-
12-
generateTOC: function() {
13-
$('.toc').tableOfContents('.main', {
14-
'startLevel': 2,
15-
'depth': 2
16-
});
3+
this.relocateNavigation();
174
},
185

19-
enhanceFootnoteItem: function() {
20-
var t = this;
21-
if($('.navigation + ol').length > 0) {
22-
$('.navigation + ol').addClass('footnotes');
23-
24-
$('.navigation + ol > li').each(function(index, ele) {
25-
var order = index+1;
26-
$(ele).attr('id', 'fn-'+order);
27-
28-
$(ele).append('&nbsp;&nbsp;<a href="#fnref-'+order+'">&#8617;</a>');
29-
});
6+
relocateNavigation: function() {
7+
navi = $('.navigation');
8+
navi_content = $('.navigation').clone();
9+
if(navi.length > 0) {
10+
navi.remove();
11+
12+
if($('.footnotes').length > 0) {
13+
navi_content.insertBefore('.footnotes');
14+
} else {
15+
navi_content.appendTo('.main');
16+
}
3017
}
31-
},
32-
33-
// add an id to the footnote element in the content
34-
addIdToSup: function() {
35-
var $sup = $('sup', '.main'),
36-
id = 'fnref-'+$sup.text();
37-
$sup.each(function(index){
38-
$(this).attr('id', 'fnref-'+(index+1));
39-
});
40-
},
41-
42-
addCaptionClassToImage: function() {
43-
$('img').each(function(index, ele){
44-
var $caption = $(this).parent().next('p');
45-
$caption.addClass('caption');
46-
});
47-
},
48-
49-
addCaptionClassToTable: function() {
50-
$('table').each(function(index, ele){
51-
var $caption = $(this).next('p');
52-
$caption.addClass('caption');
53-
})
5418
}
19+
5520
};
5621

5722
$(document).ready(function(){

assets/js/jquery.tableofcontents.min.js

-12
This file was deleted.

assets/sample.pdf

-1.46 MB
Binary file not shown.

assets/css/style.css assets/styles/style.css

+23-10
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,10 @@ a.btn:hover, a.btn:active {
685685
padding: 0;
686686
}
687687

688-
.toc ol li {
689-
padding-left: 20px;
690-
}
688+
.toc li.level-1 { padding-left: 0px; }
689+
.toc li.level-3 { padding-left: 20px; }
690+
.toc li.level-4 { padding-left: 40px; }
691+
.toc li.level-5 { padding-left: 60px; }
691692

692693
/* Main */
693694

@@ -735,7 +736,11 @@ a.btn:hover, a.btn:active {
735736
text-align: right;
736737
}
737738

738-
.main .caption {
739+
.main .figure {
740+
margin: 1em 0;
741+
}
742+
743+
.main .figure .caption {
739744
color: #999;
740745
text-align: center;
741746
}
@@ -823,7 +828,15 @@ a.btn:hover, a.btn:active {
823828
font-weight: bold;
824829
}
825830

826-
/* Highlight */
831+
/* Code Block */
832+
833+
.main .codeblock {
834+
margin: 1em 0;
835+
}
836+
837+
.main .codeblock .caption {
838+
margin: 0 0 -1em 0;
839+
}
827840

828841
.main .highlight {
829842
border: 1px solid #999;
@@ -853,29 +866,29 @@ a.btn:hover, a.btn:active {
853866

854867
/* navigation */
855868

856-
.main .navigation {
869+
.navigation {
857870
font-size: 12px;
858871
margin: 20px 0 40px;
859872
padding-bottom: 20px;
860873
}
861874

862-
.main .navigation .prev_page {
875+
.navigation .prev_page {
863876
float: left;
864877
}
865878

866-
.main .navigation .next_page {
879+
.navigation .next_page {
867880
float: right;
868881
}
869882

870883
/* Footnotes */
871884

872885
.footnotes {
873886
border-top: 3px double #999;
874-
margin: 0!important;
875-
padding-top: 40px;
876887
padding-bottom: 20px;
877888
}
878889

890+
.footnotes li p { margin: 0; }
891+
879892
/* Footer */
880893

881894
.footer {

author.html

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!doctype html>
2+
<html lang="zh_CN">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>作者译者</title>
6+
<meta name="author" content="Andor Chen" />
7+
<link rel="stylesheet" href="/assets/styles/style.css" />
8+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
9+
<script type="text/javascript" src="/assets/js/global.js"></script>
10+
</head>
11+
12+
<body>
13+
<div class="wrapper">
14+
<div class="header">
15+
<h1 class="logo"><a class="ir" href="">Ruby on Rails 教程</a></h1>
16+
<p class="subtitle">Ruby on Rails Tutorial 原书第 2 版</p>
17+
</div>
18+
<div class="content">
19+
20+
<div class="item author">
21+
<h1 id="author"><span></span> 作者译者</h1>
22+
<ol class="toc"></ol>
23+
<div class="main">
24+
<p>本书的英文版原作者是 <a href="http://michaelhartl.com/">Michael Hartl</a>,把 Ruby on Rails Web 开发介绍给世人的先行者。他之前曾经写作并开发了 RailsSoace,一本很过时的 Rails 教程;也曾使用 Ruby on Rails 开发过一个名为 Insoshi 的社交网络平台,这个平台曾经很流行,现在已经过气了。因为他对 Ruby 社区的贡献,于 2011 年被授予了 <a href="http://rubyheroes.com/heroes">Ruby Hero 奖</a>。他毕业于<a href="http://college.harvard.edu/">哈佛学院</a>,并获得了<a href="http://www.caltech.edu/">加州理工学院</a>的物理学博士学位。他还是 <a href="http://ycombinator.com/">Y Combinator</a> 创业者项目的毕业生。</p>
25+
26+
<p>本书的中文版译者是 <a href="http://about.ac">Andor Chen</a>。他毕业于<a href="http://www.csu.edu.cn">中南大学</a>,现在一家国内领先的锂离子电池制造企业任职机械工程师。用过 WordPress 的读者或许会熟悉这个名字。现在他是个 Ruby 初学者,并在学习使用 Rails 做 Web 开发。本书就是他在学习 Rails 的过程中翻译的。</p>
27+
</div>
28+
</div>
29+
30+
31+
32+
<div class="navigation">
33+
34+
35+
<a class="next_page" href="/preface.html">致中国读者 &raquo;</a>
36+
37+
</div>
38+
39+
40+
</div>
41+
<div class="footer">
42+
<p>Andor Chen 保留部分权力。基于<a href="http://creativecommons.org/licenses/by-sa/3.0/" title="Creative Commons Attribution-ShareAlike 3.0 Unported License" target="_blank">“CC 3.0 BY-SA 协议”</a>发布</p>
43+
</div>
44+
</div>
45+
</body>
46+
</html>

author.md

-12
This file was deleted.

0 commit comments

Comments
 (0)