Skip to content

Commit 2570b50

Browse files
committed
typo enhancement
1 parent cca03ae commit 2570b50

File tree

11 files changed

+40
-39
lines changed

11 files changed

+40
-39
lines changed

source/_posts/2016-10-24-decorator.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ wechat:
1717
share_desc: 麻麻说:写代码一定要优雅
1818
---
1919

20-
<!-- more -->
21-
22-
# Javascript 中的装饰器
23-
2420
## 前言
2521

2622
在 ES6 中增加了对类对象的相关定义和操作(比如 `class``extends` ),这就使得我们在多个不同类之间共享或者扩展一些方法或者行为的时候,变得并不是那么优雅。这个时候,我们就需要一种更优雅的方法来帮助我们完成这些事情。
2723

24+
<!-- more -->
25+
2826
## Python 中的装饰器
2927

3028
decorators 即 装饰器,这一特性的提出来源于 python 之类的语言,如果你熟悉 python 的话,对它一定不会陌生。那么我们先来看一下 python 里的装饰器是什么样子的吧:

themes/lattice/layout/_partial/common/header.swig

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{{ header_menu('main-nav') }}
1414
</ul>
1515
</nav>
16-
<div class="mod-search">
16+
<div class="mod-search" id="J_search">
1717
<a class="fa fa-search mod-search-ico" id="J_searchTrigger" title="{{ __('menu.search') }}"></a>
1818
<form id="J_searchForm" method="get" class="mod-search-form" action="/search/">
1919
<input type="text" name="query" class="mod-search-ipt" id="J_searchInput" placeholder="{{ __('menu.search') }}" />

themes/lattice/layout/_partial/post/main.swig

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<!-- Post -->
22
<article class="post">
3+
<div class="post-cover"><img src="{{ post_img( post.cover|default(theme.post.cover) ) }}" alt="{{ post.title }}" /></div>
34
<header class="post-hd">
45
{{seachData()}}
5-
<h2 class="post-tit">{{ post.title }}</h2>
6+
<h1 class="post-tit">{{ post.title }}</h1>
67
<div class="post-meta">
78
by <a target="_blank" href="https://github.com/{{ author.github_name }}" class="post-author">{{ author.nick|default(author.github_name) }}</a> on <span>{{ date(post.date) }}</span>
89
</div>
@@ -11,9 +12,6 @@
1112
{% endif %}
1213
<span style="display:none;" id="busuanzi_value_page_pv"></span>
1314
</header>
14-
15-
<div class="post-cover"><img src="{{ post_img( post.cover|default(theme.post.cover) ) }}" alt="{{ post.title }}" /></div>
16-
1715
<div class="post-content">
1816
{{ page_anchor(post.content) }}
1917

themes/lattice/source/css/_base/_mixins.styl

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ the-transition() {
55
}
66

77
mobile() {
8-
@media (max-width: 989px) {
8+
@media (max-width: 1023px) {
99
{block}
1010
}
1111
}
@@ -17,7 +17,7 @@ mobile() {
1717
// }
1818

1919
desktop() {
20-
@media (min-width: 990px) and (max-width: 1189px) {
20+
@media (min-width: 1014px) and (max-width: 1279px) {
2121
{block}
2222
}
2323
}

themes/lattice/source/css/_base/_vars.styl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
color-default = #646464
33
color-accent = #1abc9c
44
color-grey = #999
5+
color-grey-lite = #eee
56
color-border = #ddd
67
color-link = #333
78
color-dark = #000
@@ -16,7 +17,6 @@ color-facebook = #3b5998
1617
color-pinterest = #cb2027
1718
color-google = #dd4b39
1819
$color-theme = #6190e8
19-
$gainsboro = #eee
2020
color-primary = $color-theme
2121

2222
bg-primary = $color-theme

themes/lattice/source/css/_base/header.styl

+6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
width: 30px
6767
line-height: 30px
6868
text-align: center
69+
color: color-default
70+
&.active
71+
.mod-search-ico
72+
background: color-grey-lite
6973
&-form
7074
overflow:hidden
7175
opacity: 0
@@ -82,11 +86,13 @@
8286
box-sizing: border-box
8387
border: 1px solid #eee
8488
background-color: #fcfcfc
89+
outline: none
8590
&::-webkit-input-placeholder
8691
font-size: 14px
8792

8893
+mobile() {
8994
padding: 0 15px
95+
box-shadow: 0 1px 2px rgba(0,0,0,.1)
9096
&-main {
9197
position: absolute
9298
top: 60px

themes/lattice/source/css/_base/layout.styl

+2-12
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,22 @@
1717
padding-top: 20px
1818
+mobile() {
1919
// background: #eaeaea
20+
padding-top: 1px
2021
}
2122

2223
.mod-main
2324
float:left
2425
width: 930px
2526
margin-right: 20px
26-
+mobile() {
27-
float: none
28-
margin-right: 0
29-
width: 100%
30-
}
3127
+desktop-large() {
3228
width: 1230px
3329
}
3430
+desktop() {
3531
width: 730px
3632
}
37-
38-
.mod-side
39-
float: left
40-
width: 240px
41-
box-sizing: border-box
42-
padding: 20px 15px
4333
+mobile() {
44-
border-top: 1px solid #eee
4534
float: none
35+
margin-right: 0
4636
width: 100%
4737
}
4838

themes/lattice/source/css/_base/sidebar.styl

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
.mod-side
22
background: #fff
3+
float: left
4+
width: 240px
5+
box-sizing: border-box
6+
padding: 20px 0 20px 15px
37
&-sec
48
margin-bottom: 30px
59
&:last-child
@@ -22,6 +26,8 @@
2226
&-bd
2327
padding: 10px 15px
2428
+mobile() {
29+
float: none
30+
width: 100%
2531
margin-top: 20px
2632
border-top: 1px solid #ddd
2733
}
@@ -52,8 +58,4 @@
5258
max-width: 224px
5359
margin: 0 auto 10px
5460
&-slogan
55-
text-align: center
56-
57-
58-
59-
61+
text-align: center

themes/lattice/source/css/_index/cates.styl

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
a
5252
color: $color-theme
5353
font-size: 14px
54-
box-shadow: 0 1px 2px rgba(0,0,0,0.2)
54+
box-shadow: 0 1px 2px rgba(0,0,0,0.1)
5555

5656

themes/lattice/source/css/_post/post.styl

+11-7
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
word-wrap: break-word
77
&-hd
88
padding: 20px 0
9-
h2
10-
margin-bottom: 5px
11-
color: #333
12-
font-size: 28px
13-
font-weight: 300
9+
&-tit
10+
margin-bottom: 5px
11+
color: #333
12+
//font-size: 28px
13+
font-weight: 300
1414
&-meta
1515
font-size: 12px
1616
overflow: hidden
@@ -40,9 +40,13 @@
4040
top: 0
4141

4242
&-cover
43-
margin: 0 0 20px
43+
padding-top: 20px
4444
img
4545
display: block
46+
+mobile()
47+
width: 100%
48+
+mobile()
49+
padding-top: 0
4650

4751
&-revision
4852
font-size: 12px
@@ -71,7 +75,7 @@
7175
border-bottom: none
7276

7377
&-content
74-
padding: 20px 0
78+
padding: 0 0 20px 0
7579
& a
7680
vertical-align: top
7781
& img

themes/lattice/source/js/mods/common.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
var search = {
2929
init: function (){
30+
this.$el = $('#J_search');
3031
this.$form = $('#J_searchForm');
3132
this.$input = $('#J_searchInput');
3233
this.$trigger = $('#J_searchTrigger');
@@ -41,12 +42,14 @@
4142
});
4243

4344
this.$trigger.on('click', function(e){
44-
var isShowed = $(this).data('show');
45+
var $this = $(this),
46+
isShowed = $(this).data('show');
4547
if (!isShowed) {
4648
self.$input.focus();
4749
}
4850
self.$form.toggleClass('show');
49-
$(this).data('show', !isShowed);
51+
self.$el.toggleClass('active');
52+
$this.data('show', !isShowed);
5053
});
5154
}
5255
};

0 commit comments

Comments
 (0)