carte-server 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea8ba3e099c22995406bea46da747e0a946a76de
4
- data.tar.gz: b09af6170a04272a31e259bb16f4497b0b5b05ab
3
+ metadata.gz: 40e29e4e73482abcd5e6155e32ea8a5765f38247
4
+ data.tar.gz: a4495c673b963ba553581bf4d9c47c0accb88e30
5
5
  SHA512:
6
- metadata.gz: b7949667b7863001901f96089f09e9a3285ebabc12c3601a8a81d1511ee3d6f2d32c28b227861017e02914edd8298fb83c1caea4ffb4a6dee7a23c4340ff9751
7
- data.tar.gz: bb17ea69b992365e73d5d5dc7b1f1fab7ca6785ffe11ff7e6b80c9ca3dac6149c890272e827568dae3cf0bff80d171934fe6a0ff32ef2d77d0dba164349b218b
6
+ metadata.gz: b77a2714e6a6188549a7c9ea9b6a4da6df1684c54c71a76e9322a2a751a1fc4eecd58593e2108eefbf51c1e7482487a300794e347bc1e4561bad8d7b34412731
7
+ data.tar.gz: e241efb22b9a7db1f53832c63e6900e47252556ef73aadbebe91c9ecaf48439692f3b39d904dc796e5a787bc597254bc27203e3b74e64e7e043b98546e6ccaf5
data/README.md CHANGED
@@ -1,31 +1,38 @@
1
1
  # Carte
2
2
 
3
- TODO: Write a gem description
3
+ [![npm version](https://badge.fury.io/js/carte-client.svg)](http://badge.fury.io/js/carte-client)
4
+ [![gem Version](https://badge.fury.io/rb/carte-server.svg)](http://badge.fury.io/rb/carte-server)
4
5
 
5
- ## Installation
6
+ Something like dictionary, wiki, or information card.
6
7
 
7
- Add this line to your application's Gemfile:
8
+ ## Screenshot
8
9
 
9
- ```ruby
10
- gem 'carte'
11
- ```
10
+ ![](screenshot.png)
11
+
12
+ ## Features
12
13
 
13
- And then execute:
14
+ * Manage your data fragments with cards
15
+ * Create, edit and search cards quickly
16
+ * View your card with the cards around it (like paper dictionary)
17
+ * No user concept, super simple system like wiki
14
18
 
15
- $ bundle
19
+ You can try carte on [sandbox](http://carte-sandbox.herokuapp.com/#/).
20
+ Japanese introduction is [here](http://tily.tumblr.com/post/117678137942/carte).
16
21
 
17
- Or install it yourself as:
22
+ ## Components
18
23
 
19
- $ gem install carte
24
+ * [carte-server](https://rubygems.org/gems/carte-server)
25
+ * [carte-client](https://www.npmjs.com/package/carte-client)
20
26
 
21
- ## Usage
27
+ ## Deploy
22
28
 
23
- TODO: Write usage instructions here
29
+ [![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/tily/carte-sandbox)
24
30
 
25
- ## Contributing
31
+ Deploy your carte with the button above. After deployment, you may want to customize your carte.
26
32
 
27
- 1. Fork it ( https://github.com/[my-github-username]/carte/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
33
+ ```
34
+ ## change title and description
35
+ $ vi config.json
36
+ ## replace brand icon
37
+ $ cp ~/Desktop/icon.png public/images/icon.png
38
+ ```
@@ -2,6 +2,7 @@
2
2
  React = require('react')
3
3
  Edit = require('./edit')
4
4
  ModalTrigger = require('react-bootstrap/lib/ModalTrigger')
5
+ markdownIt = require('markdown-it')(linkify: true)
5
6
 
6
7
  module.exports = React.createClass
7
8
  displayName: 'Card'
@@ -33,7 +34,7 @@ module.exports = React.createClass
33
34
  <div className='col-sm-4' style={padding:'5px'} onMouseOver={@onMouseOver} onMouseLeave={@onMouseLeave}>
34
35
  <div className='list-group' style={margin:'0px',padding:'0px'}>
35
36
  <div className='list-group-item' style={style}>
36
- <p>
37
+ <div>
37
38
  {
38
39
  if @props.card.get('focused')
39
40
  <i className='glyphicon glyphicon-star' style={marginRight:'5px'} />
@@ -53,10 +54,12 @@ module.exports = React.createClass
53
54
  <i className='glyphicon glyphicon-link' />
54
55
  </a>
55
56
  </span>
56
- </p>
57
- <p style={overflow:'scroll',width:'100%',height:'80%',wordWrap:'break-word'}>
58
- {@props.card.get('content')}
59
- </p>
57
+ </div>
58
+ <div style={overflow:'scroll',width:'100%',height:'80%',wordWrap:'break-word'}>
59
+ <p>
60
+ <div dangerouslySetInnerHTML={__html: markdownIt.render @props.card.get('content')} />
61
+ </p>
62
+ </div>
60
63
  </div>
61
64
  </div>
62
65
  </div>
@@ -3,6 +3,7 @@ React = require('react')
3
3
  List = require('./list')
4
4
  CardCollection = require('../models/cards')
5
5
  CardModel = require('../models/card')
6
+ config = require('../../shared/config.json')
6
7
 
7
8
  module.exports = React.createClass
8
9
  displayName: 'Content'
@@ -33,7 +34,7 @@ module.exports = React.createClass
33
34
  title.push(k + ': ' + v)
34
35
  title = title.join(', ')
35
36
  title = 'search: ' + cards.query.title + ' (' + title + ')' if cards.query.title
36
- title += ' - carte'
37
+ title += ' - ' + config.title
37
38
  document.title = title
38
39
  <List key='list' cards={cards} showNav=true />
39
40
  when "show"
@@ -59,7 +60,7 @@ module.exports = React.createClass
59
60
  cards.fetching = false
60
61
  error: (card, response)=>
61
62
  console.log response
62
- document.title = card.get('title') + ' - carte'
63
+ document.title = card.get('title') + ' - ' + config.title
63
64
  <List key='show' cards={cards} showNav=false />
64
65
  else
65
66
  console.log 'else'
@@ -39,7 +39,7 @@ module.exports = React.createClass
39
39
  @setState updating: false
40
40
 
41
41
  render: ->
42
- <Modal {...@props} bsStyle='default' title={if @props.card.isNew() then 'New' else 'Edit'} animation={false}>
42
+ <Modal {...@props} bsStyle='default' title={if @props.card.isNew() then <i className="glyphicon glyphicon-plus" /> else <i className="glyphicon glyphicon-edit" />} animation={false}>
43
43
  <div className='modal-body'>
44
44
  {
45
45
  if @state.errors
@@ -76,36 +76,61 @@ module.exports = React.createClass
76
76
  if @props.cards.query.order == 'random'
77
77
  <ul className="nav nav-pills pull-right">
78
78
  <li>
79
- <a href={"/#/?" + @randomParam()} style={{padding:'6px 12px'}}>
80
- <i className="glyphicon glyphicon-refresh" />
81
- </a>
79
+ {
80
+ if @props.cards.page
81
+ <a href={"/#/?" + @randomParam()} style={{padding:'6px 12px'}}>
82
+ <i className="glyphicon glyphicon-refresh" />
83
+ </a>
84
+ else
85
+ <a href="javascript:void(0)" style={{padding:'6px 12px'}}>
86
+ <i className="glyphicon glyphicon-refresh glyphicon-refresh-animate" />
87
+ </a>
88
+ }
82
89
  </li>
83
90
  </ul>
84
91
  else
85
- if @props.cards.page
86
- <ul className="nav nav-pills pull-right">
92
+ <ul className="nav nav-pills pull-right">
93
+ <li>
87
94
  {
88
- if @props.cards.page.current > 1
89
- <li>
90
- <a href={"/#/?" + @pageParam(@props.cards.page.current - 1)} aria-label="Previous" style={{padding:'6px 12px'}}>
91
- <span aria-hidden="true">&laquo;</span>
92
- </a>
93
- </li>
94
- }
95
- <li>
96
- <a href={"/#/?" + @pageParam(@props.cards.page.current)} style={{padding:'6px 12px'}}>
97
- {@props.cards.page.current} / {@props.cards.page.total}
95
+ if @props.cards.page
96
+ if @props.cards.page.current > 1
97
+ href = "/#/?" + @pageParam(@props.cards.page.current - 1)
98
+ else
99
+ href = "/#/?" + @pageParam(@props.cards.page.total)
100
+ else
101
+ href = "javascript:void(0)"
102
+ <a href={href} aria-label="Previous" style={{padding:'6px 12px'}}>
103
+ <span aria-hidden="true">&laquo;</span>
98
104
  </a>
99
- </li>
105
+ }
106
+ </li>
107
+ <li style={width:'4.0em',textAlign:'center'}>
100
108
  {
101
- if @props.cards.page.current < @props.cards.page.total
102
- <li>
103
- <a href={"/#/?" + @pageParam(@props.cards.page.current + 1)} aria-label="Next" style={{padding:'6px 12px'}}>
104
- <span aria-hidden="true">&raquo;</span>
105
- </a>
106
- </li>
109
+ if @props.cards.page
110
+ <a href={"/#/?" + @pageParam(@props.cards.page.current)} style={{padding:'6px 12px'}}>
111
+ {@props.cards.page.current} / {@props.cards.page.total}
112
+ </a>
113
+ else
114
+ <a href="javascript:void(0)" style={{padding:'6px 12px'}}>
115
+ <i className="glyphicon glyphicon-refresh glyphicon-refresh-animate" />
116
+ </a>
107
117
  }
108
- </ul>
118
+ </li>
119
+ <li>
120
+ {
121
+ if @props.cards.page
122
+ if @props.cards.page.current < @props.cards.page.total
123
+ href = "/#/?" + @pageParam(@props.cards.page.current + 1)
124
+ else
125
+ href = "/#/?" + @pageParam(1)
126
+ else
127
+ href = "javascript:void(0)"
128
+ <a href={href} aria-label="Next" style={{padding:'6px 12px'}}>
129
+ <span aria-hidden="true">&raquo;</span>
130
+ </a>
131
+ }
132
+ </li>
133
+ </ul>
109
134
  }
110
135
  </div>
111
136
  </div>
@@ -45,7 +45,7 @@ module Carte
45
45
  end
46
46
 
47
47
  get '/app.js' do
48
- File.read(settings.script_path)
48
+ send_file settings.script_path
49
49
  end
50
50
 
51
51
  namespace '/api' do
@@ -34,7 +34,7 @@ module Carte
34
34
  end
35
35
 
36
36
  def self.sample(size=1)
37
- self.in(id: (1...self.count).to_a.sample(size))
37
+ self.in(id: (1..self.count).to_a.sample(size))
38
38
  end
39
39
 
40
40
  def lefts(size=1)
@@ -2,6 +2,6 @@ require 'sinatra/base'
2
2
 
3
3
  module Carte
4
4
  class Server < Sinatra::Base
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
6
6
  end
7
7
  end
@@ -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.3",
4
+ "version": "0.0.4",
5
5
  "main": "lib/carte.coffee",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -31,6 +31,7 @@
31
31
  "gulp-uglify": "^1.2.0",
32
32
  "gulp-util": "^3.0.4",
33
33
  "jquery": "^2.1.3",
34
+ "markdown-it": "^4.2.0",
34
35
  "react": "^0.13.2",
35
36
  "react-bootstrap": "^0.21.0",
36
37
  "vinyl-source-stream": "^1.1.0",
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carte-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - tily
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2015-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -219,6 +219,7 @@ files:
219
219
  - mongoid.yml
220
220
  - package.json
221
221
  - public/images/icon.png
222
+ - screenshot.png
222
223
  - spec/server_spec.rb
223
224
  homepage: ''
224
225
  licenses: