carte-server 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1588bcae30f07e9328f0544d3b0276ac7452fb40
4
- data.tar.gz: 28ce06311f7becefb4f080e08d7abba02cd85e57
3
+ metadata.gz: 62dd6b63cb3dc76b0ec49dc9eb0e1218947c3d9d
4
+ data.tar.gz: cfc482d9f3834d61ad601a2b341b1ae5f58c19f0
5
5
  SHA512:
6
- metadata.gz: b249cbf0dfd97b5e12c4ed0530377b842ab49d0ea18c0f25f7c4bd7e9d9f6272e96f73402c1ff141a9a0422f063c09f866609b59d4388df62ac7220b3be4abf4
7
- data.tar.gz: d426ff1c3ce87509cbccdf60810243f65b854172166a60963772cbab89154ad4793ef229600fd9d65e600acb647b3be91f25394d086b24da105c92e61485b3c3
6
+ metadata.gz: a35116bcb9945a1fe83a566db288c5189eb85f9ce71047ef70ad73aa3f1622d21d596bc2b609e24e4dbcb59a5fc7792c6d14928d8f7f4a75f613af00826cf57d
7
+ data.tar.gz: e38cc8e0f86b9f68d88f44b0b2bbea58e6cb7334538c8df289e3397df6a3a7cbb54aa9cccb714292b2ad02ce61d133ccee7c89f4f4762f3e7ff6be703b7710c3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carte-server (0.0.23)
4
+ carte-server (0.0.26)
5
5
  activesupport
6
6
  haml
7
7
  mongoid
data/lib/carte.coffee CHANGED
@@ -74,5 +74,5 @@ module.exports = class Carte
74
74
  browserify
75
75
  .bundle()
76
76
  .pipe sourceStream file
77
- .pipe gulpIf(!@watching, streamify(uglify()))
77
+ .pipe gulpIf(!@watching, streamify(uglify(compress: {drop_console: !@watching})))
78
78
  .pipe gulp.dest dir
@@ -10,11 +10,8 @@ module.exports = class Card extends Backbone.Model
10
10
 
11
11
  url: ()->
12
12
  if @isNew()
13
- console.log @
14
- console.log 'url is new'
15
13
  url = '/cards.json'
16
14
  else
17
- console.log 'url is not new'
18
15
  url = '/cards/' + encodeURIComponent(@get('title')) + '.json'
19
16
  config.root_path + config.api_path + url
20
17
 
@@ -10,7 +10,5 @@ module.exports = class Cards extends Backbone.Collection
10
10
  url = '/cards.json?' + $.param(@query)
11
11
  config.root_path + config.api_path + url
12
12
  parse: (response)->
13
- console.log response
14
13
  @pagination = response.pagination
15
- console.log @page
16
14
  response.cards
@@ -7,13 +7,12 @@ module.exports = class Router extends Backbone.Router
7
7
  '' : 'list'
8
8
 
9
9
  list: (string)->
10
+ console.log '[router] list', string
10
11
  location.hash = '/' if location.hash == ''
11
- console.log 'list'
12
12
  @current = 'list'
13
13
  @query = querystring.parse(string)
14
- console.log @query
15
14
 
16
15
  show: (title)->
17
- console.log 'show', title
16
+ console.log '[router] show', title
18
17
  @current = 'show'
19
18
  @title = title
@@ -10,8 +10,6 @@ module.exports = React.createClass
10
10
 
11
11
  componentDidMount: ->
12
12
  @props.card.on 'change', @forceUpdate.bind(@, null)
13
- @props.card.on 'change', (model)->
14
- console.log 'change', model
15
13
 
16
14
  getInitialState: ()->
17
15
  showTools: false
@@ -27,7 +25,6 @@ module.exports = React.createClass
27
25
  @setState showTools: false
28
26
 
29
27
  render: ->
30
- console.log 'Card: render'
31
28
  <div className='col-sm-4 col-xs-12 list-group' style={marginBottom:'0px',padding:"5px"} onMouseOver={@onMouseOver} onMouseLeave={@onMouseLeave}>
32
29
  <div className='list-group-item' style={height:'200px'}>
33
30
  <div style={marginBottom:'10px'}>
@@ -10,7 +10,7 @@ module.exports = React.createClass
10
10
  error: false
11
11
 
12
12
  componentDidMount: ()->
13
- console.log 'component did mount'
13
+ console.log '[views/cards] component did mount'
14
14
  @props.cards.on 'sync', @forceUpdate.bind(@, null)
15
15
  if @props.card
16
16
  @props.card.on 'error', (model, response)=>
@@ -18,7 +18,7 @@ module.exports = React.createClass
18
18
  @forceUpdate.bind(@, null)
19
19
 
20
20
  componentWillReceiveProps: (nextProps)->
21
- console.log 'component did mount'
21
+ console.log '[views/cards] component will receive props'
22
22
  nextProps.cards.on 'sync', @forceUpdate.bind(@, null)
23
23
  if nextProps.card
24
24
  nextProps.card.on 'error', (model, response)=>
@@ -26,9 +26,7 @@ module.exports = React.createClass
26
26
  @forceUpdate.bind(@, null)
27
27
 
28
28
  render: ->
29
- console.log 'render cards', @props.cards, @state
30
29
  if @props.cards.fetching
31
- console.log 'cards loading'
32
30
  <Message>
33
31
  <i className='glyphicon glyphicon-refresh glyphicon-refresh-animate' /> Loading ...
34
32
  </Message>
@@ -37,6 +35,5 @@ module.exports = React.createClass
37
35
  <i className='glyphicon glyphicon-alert' /> {@state.error.status} {@state.error.statusText}
38
36
  </Message>
39
37
  else
40
- console.log 'cards loaded'
41
38
  cards = @props.cards.map (card)-> <Card key={card.get("title")} card={card} />
42
39
  <div className='row'>{cards}</div>
@@ -11,19 +11,17 @@ module.exports = React.createClass
11
11
  displayName: 'Content'
12
12
 
13
13
  componentWillMount: ->
14
- console.log 'componentWillMount'
14
+ console.log '[views/content] component will mount'
15
15
  @callback = ()=> @forceUpdate()
16
16
  @props.router.on "route", @callback
17
17
 
18
18
  componentWillUnmount: ->
19
- console.log 'componentWillMount un'
19
+ console.log '[views/content] component will unmount'
20
20
  @props.router.off "route", @callback
21
21
 
22
22
  render: ->
23
- console.log 'render component'
24
23
  switch @props.router.current
25
24
  when "list"
26
- console.log 'list', @props.router.query
27
25
  cards = new CardCollection()
28
26
  cards.query = $.extend {}, config.default_query, @props.router.query
29
27
  cards.fetching = true
@@ -37,31 +35,25 @@ module.exports = React.createClass
37
35
  document.title = config.title
38
36
  <List key='list' router={@props.router} cards={cards} />
39
37
  when "show"
40
- console.log 'show'
41
38
  cards = new CardCollection()
42
39
  cards.fetching = true
43
40
  card = new CardModel(title: @props.router.title)
44
41
  card.fetch
45
42
  success: (card)->
46
- console.log card
47
43
  for left in card.get("lefts")
48
44
  cardModel = new CardModel(left)
49
45
  cardModel.set 'focused', false
50
- console.log 'adding left', cardModel
51
46
  cards.add cardModel
52
47
  card.set 'focused', true
53
48
  cards.add card
54
49
  for right in card.get("rights")
55
50
  cardModel = new CardModel(right)
56
51
  cardModel.set 'focused', false
57
- console.log 'adding right', cardModel
58
52
  cards.add cardModel
59
53
  cards.fetching = false
60
54
  error: (card, response)=>
61
- console.log 'error!!!!!!!!!!!!!!!!!!!!!!!!', response
62
55
  cards.fetching = false
63
56
  document.title = config.title + '、' + card.get('title')
64
57
  <List key='show' cards={cards} card={card} />
65
58
  else
66
- console.log 'else'
67
59
  <div>Loading ...</div>
@@ -54,7 +54,6 @@ module.exports = React.createClass
54
54
  @props.card.set 'title', @state.title
55
55
  location.hash = '/' + @state.title
56
56
  error: (model, response, options)=>
57
- console.log response.responseJSON
58
57
  @setState errors: response.responseJSON.card.errors
59
58
  @setState updating: false
60
59
  @setState shaking: true
@@ -15,9 +15,9 @@ module.exports = React.createClass
15
15
  isCheckedIncludeContent: false
16
16
 
17
17
  componentWillMount: ()->
18
- console.log 'header mounted'
18
+ console.log '[views/header] component will mount'
19
19
  @onSync = ()=>
20
- console.log 'model new calback'
20
+ console.log '[views/header] onSync callback'
21
21
  @card = new CardModel()
22
22
  @card._isNew = true
23
23
  @card.on 'sync', @onSync
@@ -39,7 +39,7 @@ module.exports = React.createClass
39
39
  @props.router.on "route", @callback
40
40
 
41
41
  componentWillUnmount: ->
42
- console.log 'componentWillMount un'
42
+ console.log '[views/header] component will unmount'
43
43
  @props.router.off "route", @callback
44
44
 
45
45
  onChangeIncludeContent: (event)->
@@ -50,14 +50,12 @@ module.exports = React.createClass
50
50
  @setState searchText: event.target.value
51
51
 
52
52
  onKeyDownSearchText: (event)->
53
- console.log 'press', event
53
+ console.log '[views/header] onKeyDownSearchText', event
54
54
  if event.keyCode == 13 # ENTER
55
- console.log '13 enter'
56
55
  event.preventDefault()
57
56
  @search()
58
57
 
59
58
  search: ->
60
- console.log @state
61
59
  tags = []
62
60
  titles = []
63
61
  for searchText in @state.searchText.split(' ')
@@ -12,10 +12,11 @@ module.exports = React.createClass
12
12
  displayName: 'List'
13
13
 
14
14
  componentDidMount: ->
15
+ console.log '[views/list] component did mount'
15
16
  @props.cards.on 'sync', @forceUpdate.bind(@, null)
16
17
 
17
18
  componentWillReceiveProps: (nextProps)->
18
- console.log 'List: component will receive props'
19
+ console.log '[views/list] component will receive props'
19
20
  nextProps.cards.on 'sync', @forceUpdate.bind(@, null)
20
21
 
21
22
  atozParam: ()->
@@ -37,7 +38,6 @@ module.exports = React.createClass
37
38
  $.param(query)
38
39
 
39
40
  render: ->
40
- console.log 'render', @props.cards.query
41
41
  <div className="container" style={{paddingLeft:"5px",paddingRight:"5px"}}>
42
42
  {if !@props.card
43
43
  <div className="row">
@@ -58,7 +58,7 @@ module.exports = React.createClass
58
58
  </div>
59
59
  <div className="col-sm-4" style={{padding:"0px"}}>
60
60
  <a href="javascript:void(0)" className="center-block text-center" style={padding:'6px 12px'}>
61
- <span className="badge text-center" style={backgroundColor:'#333'}>
61
+ <span className="badge text-center" style={color:'#333',backgroundColor:'#eee'}>
62
62
  {
63
63
  if @props.cards.pagination
64
64
  @props.cards.pagination.total_entries
data/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "carte-client",
3
3
  "description": "something like dictionary, wiki, or information card",
4
- "version": "0.0.25",
4
+ "version": "0.0.26",
5
5
  "main": "lib/carte.coffee",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carte-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - tily