Skip to content

Commit 61a4330

Browse files
committed
some code formatting
1 parent 5921e4a commit 61a4330

File tree

6 files changed

+43
-39
lines changed

6 files changed

+43
-39
lines changed

src/ajax/index.coffee

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
'use strict'
1+
22
user = require('./user')
33
reply = require('./reply')
44
topic = require('./topic')
55
message = require('./message')
6+
67
exports.topicGet = topic.get
78
exports.topicCreate = topic.create
89
exports.topicGetList = topic.getList

src/ajax/reply.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
'use strict'
1+
22
reqwest = require('reqwest')
33
configs = require('../configs')
44

55
exports.create = (data, token, cb) ->
66
reqwest
7-
url: configs.domain + '/api/v1/topic/' + data.topic_id + '/replies'
7+
url: "#{configs.domain}/api/v1/topic/#{data.topic_id}/replies"
88
data: JSON.stringify(
99
accesstoken: token
1010
content: data.content

src/ajax/topic.coffee

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ configs = require('../configs')
44

55
exports.getList = (page, cb) ->
66
reqwest
7-
url: configs.domain + '/api/v1/topics'
7+
url: "#{configs.domain}/api/v1/topics"
88
type: 'json'
99
data:
1010
page: page
@@ -18,7 +18,7 @@ exports.getList = (page, cb) ->
1818

1919
exports.get = (id, cb) ->
2020
reqwest
21-
url: configs.domain + '/api/v1/topic/' + id
21+
url: "#{configs.domain}/api/v1/topic/#{id}"
2222
data: [ {
2323
name: 'mdrender'
2424
value: false
@@ -33,7 +33,7 @@ exports.get = (id, cb) ->
3333

3434
exports.create = (data, token, cb) ->
3535
reqwest
36-
url: configs.domain + '/api/v1/topics'
36+
url: "#{configs.domain}/api/v1/topics"
3737
data: JSON.stringify(
3838
title: data.title
3939
content: data.content

src/ajax/user.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ configs = require('../configs')
44

55
exports.get = (loginname, token, cb) ->
66
reqwest
7-
url: configs.domain + '/api/v1/user/' + loginname
7+
url: "#{configs.domain}/api/v1/user/#{loginname}"
88
type: 'json'
99
data: accesstoken: token
1010
method: 'get'
@@ -16,7 +16,7 @@ exports.get = (loginname, token, cb) ->
1616

1717
exports.accesstoken = (token, cb) ->
1818
reqwest
19-
url: configs.domain + '/api/v1/accesstoken'
19+
url: "#{configs.domain}/api/v1/accesstoken"
2020
data: JSON.stringify(accesstoken: token)
2121
type: 'json'
2222
method: 'post'

src/app/app-wireframe.coffee

+22-19
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1-
'use strict'
1+
22
hsl = require('hsl')
33
React = require('react')
44
reset = require('../util/reset')
55
Spinner = React.createFactory(require('./spinner'))
66
_React$DOM = React.DOM
77
div = _React$DOM.div
88
span = _React$DOM.span
9-
module.exports = React.createClass(
9+
10+
module.exports = React.createClass
1011
displayName: 'app-wireframe'
12+
1113
render: ->
12-
div { style: @styleRoot() }, div({ style: @styleBox() }, Spinner(), span({ style: @styleText() }, 'Loading app...'))
14+
div style: @styleRoot(),
15+
div style: @styleBox(),
16+
Spinner()
17+
span style: @styleText(), 'Loading app...'
18+
1319
styleRoot: ->
14-
{
15-
position: 'absolute'
16-
width: '100%'
17-
height: '100%'
18-
display: 'flex'
19-
justifyContent: 'center'
20-
alignItems: 'center'
21-
}
20+
position: 'absolute'
21+
width: '100%'
22+
height: '100%'
23+
display: 'flex'
24+
justifyContent: 'center'
25+
alignItems: 'center'
26+
2227
styleBox: ->
28+
2329
styleText: ->
24-
{
25-
fontFamily: reset.fashionFonts
26-
marginTop: '20px'
27-
display: 'inline-block'
28-
color: hsl(0, 10, 70)
29-
fontSize: '13px'
30-
}
31-
)
30+
fontFamily: reset.fashionFonts
31+
marginTop: '20px'
32+
display: 'inline-block'
33+
color: hsl(0, 10, 70)
34+
fontSize: '13px'

src/app/hint.coffee

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
'use strict'
1+
22
hsl = require('hsl')
33
React = require('react')
44
reset = require('../util/reset')
55
div = React.DOM.div
6-
module.exports = React.createClass(
6+
7+
module.exports = React.createClass
78
displayName: 'app-hint'
89
propTypes: text: React.PropTypes.string.isRequired
10+
911
render: ->
10-
div { style: @styleRoot() }, @props.text
12+
div style: @styleRoot(), @props.text
13+
1114
styleRoot: ->
12-
{
13-
lineHeight: '20px'
14-
height: '20px'
15-
color: hsl(0, 0, 79)
16-
fontFamily: reset.codeFonts
17-
padding: '0 2px'
18-
fontSize: '12px'
19-
}
20-
)
15+
lineHeight: '20px'
16+
height: '20px'
17+
color: hsl(0, 0, 79)
18+
fontFamily: reset.codeFonts
19+
padding: '0 2px'
20+
fontSize: '12px'

0 commit comments

Comments
 (0)