atlas_assets 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile +3 -3
- data/Gemfile.lock +61 -38
- data/docs/_posts/2013-10-28-dropdown.md +94 -39
- data/lib/assets/javascripts/models/dropdown.coffee +3 -1
- data/lib/assets/javascripts/templates/dropdown.hbs +1 -1
- data/lib/assets/javascripts/views/dropdown_view.coffee +5 -3
- data/lib/assets/stylesheets/atlas_assets/_chosen.scss +1 -1
- data/lib/atlas_assets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGFjOTQ1ZTMwMDZmZDI3NjE2N2U0OWQ1MzY4ZjU3OGFhMWI1YmY4Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjU4NDhmMDMyOTBlZmQ2ZTZmNTk3OGRmMGNlYmI0ZTllMGE4ZjhiYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjFjNzc0ZGViZmE1OWMzNDJhYjcwMDVhMzc1MmEwNzRhZTgwMzVkZjIyMDc1
|
10
|
+
MTQ1Y2VmM2VhNzIyY2I1ZDFhYzhkMjE3ZGMyNzAwYTYyM2YwYTM0ZTViMGVk
|
11
|
+
Y2NmNWQ2ZTJjMWNmNjVkMzk0YjQxMjVhNjgyMTlkOTkxODU5YmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTI1NGI3OGEzM2VkMDlhYTlhNTg3OGU0MDZjM2U3MzE2MWI4MmQ0NzcyMjU0
|
14
|
+
MzcyNTg2MDIwMTQ2YjRhNWZlZWFlNjlhYjk5OGU4OGRmNjI4YTgyODY3NDI2
|
15
|
+
NjdiMTk1NjkwMmM4MzI5YzMwNDFkYmNiNjZjNzQyMWE0MmZjMTc=
|
data/Gemfile
CHANGED
@@ -5,14 +5,14 @@ ruby '1.9.3'
|
|
5
5
|
gemspec
|
6
6
|
|
7
7
|
gem "rake", "~> 10.0.4"
|
8
|
-
gem "jekyll", "~>
|
8
|
+
gem "jekyll", "~> 2.0"
|
9
9
|
gem "sass", "~> 3.2.9"
|
10
|
-
gem 'jekyll-assets'
|
10
|
+
gem 'jekyll-assets'
|
11
11
|
gem 'coffee-script'
|
12
12
|
gem 'rack-contrib', "~> 1.1.0"
|
13
13
|
gem "rack-rewrite", "~> 1.3.3"
|
14
14
|
gem "pygmentize", "~> 0.0.3"
|
15
|
-
gem "kramdown", "~> 1.
|
15
|
+
gem "kramdown", "~> 1.3"
|
16
16
|
gem "coderay", "~> 1.0.9"
|
17
17
|
gem "puma", "~> 2.0.1"
|
18
18
|
gem "eco"
|
data/Gemfile.lock
CHANGED
@@ -1,34 +1,23 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/ixti/jekyll-assets.git
|
3
|
-
revision: 62d828f2648d632970e7e8a5d6884861204d63e5
|
4
|
-
specs:
|
5
|
-
jekyll-assets (0.9.2)
|
6
|
-
jekyll (>= 1.0.0, < 3.0.0)
|
7
|
-
sass (~> 3.2)
|
8
|
-
sprockets (~> 2.10)
|
9
|
-
sprockets-helpers
|
10
|
-
sprockets-sass
|
11
|
-
|
12
1
|
PATH
|
13
2
|
remote: .
|
14
3
|
specs:
|
15
|
-
atlas_assets (0.8.
|
4
|
+
atlas_assets (0.8.7)
|
16
5
|
handlebars_assets (~> 0.15)
|
17
6
|
|
18
7
|
GEM
|
19
8
|
remote: https://rubygems.org/
|
20
9
|
specs:
|
21
|
-
|
22
|
-
|
10
|
+
blankslate (2.1.2.4)
|
11
|
+
celluloid (0.16.0)
|
12
|
+
timers (~> 4.0.0)
|
13
|
+
classifier-reborn (2.0.1)
|
14
|
+
fast-stemmer (~> 1.0)
|
23
15
|
coderay (1.0.9)
|
24
16
|
coffee-script (2.3.0)
|
25
17
|
coffee-script-source
|
26
18
|
execjs
|
27
|
-
coffee-script-source (1.
|
19
|
+
coffee-script-source (1.8.0)
|
28
20
|
colorator (0.1)
|
29
|
-
commander (4.1.6)
|
30
|
-
highline (~> 1.6.11)
|
31
|
-
directory_watcher (1.4.1)
|
32
21
|
eco (1.0.0)
|
33
22
|
coffee-script
|
34
23
|
eco-source
|
@@ -36,32 +25,58 @@ GEM
|
|
36
25
|
eco-source (1.1.0.rc.1)
|
37
26
|
execjs (2.2.1)
|
38
27
|
fast-stemmer (1.0.2)
|
39
|
-
|
28
|
+
ffi (1.9.5)
|
29
|
+
handlebars_assets (0.18)
|
40
30
|
execjs (>= 1.2.9)
|
41
31
|
multi_json
|
42
32
|
sprockets (>= 2.0.3)
|
43
33
|
tilt
|
44
|
-
highline (1.6.21)
|
45
34
|
hike (1.2.3)
|
46
|
-
|
47
|
-
|
35
|
+
hitimes (1.2.2)
|
36
|
+
jekyll (2.4.0)
|
37
|
+
classifier-reborn (~> 2.0)
|
48
38
|
colorator (~> 0.1)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
39
|
+
jekyll-coffeescript (~> 1.0)
|
40
|
+
jekyll-gist (~> 1.0)
|
41
|
+
jekyll-paginate (~> 1.0)
|
42
|
+
jekyll-sass-converter (~> 1.0)
|
43
|
+
jekyll-watch (~> 1.1)
|
44
|
+
kramdown (~> 1.3)
|
45
|
+
liquid (~> 2.6.1)
|
46
|
+
mercenary (~> 0.3.3)
|
47
|
+
pygments.rb (~> 0.6.0)
|
48
|
+
redcarpet (~> 3.1)
|
49
|
+
safe_yaml (~> 1.0)
|
50
|
+
toml (~> 0.1.0)
|
51
|
+
jekyll-assets (0.10.0)
|
52
|
+
jekyll (~> 2.0)
|
53
|
+
sass (~> 3.2)
|
54
|
+
sprockets (~> 2.10)
|
55
|
+
sprockets-helpers
|
56
|
+
sprockets-sass
|
57
|
+
jekyll-coffeescript (1.0.1)
|
58
|
+
coffee-script (~> 2.2)
|
59
|
+
jekyll-gist (1.1.0)
|
60
|
+
jekyll-paginate (1.0.0)
|
61
|
+
jekyll-sass-converter (1.2.1)
|
62
|
+
sass (~> 3.2)
|
63
|
+
jekyll-watch (1.1.1)
|
64
|
+
listen (~> 2.7)
|
65
|
+
kramdown (1.4.2)
|
66
|
+
liquid (2.6.1)
|
67
|
+
listen (2.7.11)
|
68
|
+
celluloid (>= 0.15.2)
|
69
|
+
rb-fsevent (>= 0.9.3)
|
70
|
+
rb-inotify (>= 0.9)
|
71
|
+
mercenary (0.3.4)
|
59
72
|
multi_json (1.10.1)
|
73
|
+
parslet (1.5.0)
|
74
|
+
blankslate (~> 2.0)
|
60
75
|
posix-spawn (0.3.9)
|
61
76
|
puma (2.0.1)
|
62
77
|
rack (>= 1.1, < 2.0)
|
63
78
|
pygmentize (0.0.3)
|
64
|
-
pygments.rb (0.
|
79
|
+
pygments.rb (0.6.0)
|
65
80
|
posix-spawn (~> 0.3.6)
|
66
81
|
yajl-ruby (~> 1.1.0)
|
67
82
|
rack (1.5.2)
|
@@ -69,9 +84,13 @@ GEM
|
|
69
84
|
rack (>= 0.9.1)
|
70
85
|
rack-rewrite (1.3.3)
|
71
86
|
rake (10.0.4)
|
72
|
-
|
87
|
+
rb-fsevent (0.9.4)
|
88
|
+
rb-inotify (0.9.5)
|
89
|
+
ffi (>= 0.5.0)
|
90
|
+
redcarpet (3.1.2)
|
91
|
+
safe_yaml (1.0.4)
|
73
92
|
sass (3.2.19)
|
74
|
-
sprockets (2.12.
|
93
|
+
sprockets (2.12.2)
|
75
94
|
hike (~> 1.2)
|
76
95
|
multi_json (~> 1.0)
|
77
96
|
rack (~> 1.0)
|
@@ -82,6 +101,10 @@ GEM
|
|
82
101
|
sprockets (~> 2.0)
|
83
102
|
tilt (~> 1.1)
|
84
103
|
tilt (1.4.1)
|
104
|
+
timers (4.0.1)
|
105
|
+
hitimes
|
106
|
+
toml (0.1.1)
|
107
|
+
parslet (~> 1.5.0)
|
85
108
|
yajl-ruby (1.1.0)
|
86
109
|
|
87
110
|
PLATFORMS
|
@@ -92,9 +115,9 @@ DEPENDENCIES
|
|
92
115
|
coderay (~> 1.0.9)
|
93
116
|
coffee-script
|
94
117
|
eco
|
95
|
-
jekyll (~>
|
96
|
-
jekyll-assets
|
97
|
-
kramdown (~> 1.
|
118
|
+
jekyll (~> 2.0)
|
119
|
+
jekyll-assets
|
120
|
+
kramdown (~> 1.3)
|
98
121
|
puma (~> 2.0.1)
|
99
122
|
pygmentize (~> 0.0.3)
|
100
123
|
rack-contrib (~> 1.1.0)
|
@@ -11,7 +11,7 @@ The Dropdown is a site wide BackboneView helper using the [Chosen](http://harves
|
|
11
11
|
|
12
12
|
## Basic Example
|
13
13
|
|
14
|
-
<div class="pull-left" id="dropdown-example-1"></div><div class="pull-left"
|
14
|
+
<div class="pull-left" id="dropdown-example-1"></div><div class="pull-left"></div><div style="clear:both"> </div>
|
15
15
|
|
16
16
|
~~~javascript
|
17
17
|
var dropdown = new classes.DropdownView();
|
@@ -23,51 +23,82 @@ dropdown.add({model: new classes.Dropdown({'label':'third'})})
|
|
23
23
|
$('#dropdown-example-1').append(dropdown.render().el)
|
24
24
|
~~~
|
25
25
|
|
26
|
-
## Setting `label`
|
26
|
+
## Setting `label` and `value`
|
27
27
|
|
28
28
|
<div id="dropdown-example-2"></div>
|
29
29
|
~~~javascript
|
30
30
|
// Set the label from a different atribute, and choose a default value
|
31
|
-
var dropdown2 = new classes.DropdownView(
|
31
|
+
var dropdown2 = new classes.DropdownView();
|
32
32
|
|
33
|
-
dropdown2.add({model: new classes.Dropdown({'
|
34
|
-
dropdown2.add({model: new classes.Dropdown({'
|
35
|
-
dropdown2.add({model: new classes.Dropdown({'
|
33
|
+
dropdown2.add({model: new classes.Dropdown({'value':'1', 'label':'first'})})
|
34
|
+
dropdown2.add({model: new classes.Dropdown({'value':'2', 'label':'second'})})
|
35
|
+
dropdown2.add({model: new classes.Dropdown({'value':'3', 'label':'third'})})
|
36
36
|
|
37
37
|
$('#dropdown-example-2').append(dropdown2.render().el)
|
38
38
|
~~~
|
39
39
|
|
40
|
-
##
|
40
|
+
## Setting custom `label` Attribute
|
41
|
+
|
41
42
|
<div id="dropdown-example-3"></div>
|
43
|
+
~~~javascript
|
44
|
+
// Set the label from a different atribute, and choose a default value
|
45
|
+
var dropdown3 = new classes.DropdownView({'label':'title', 'default_to':'third'});
|
46
|
+
|
47
|
+
dropdown3.add({model: new classes.Dropdown({'title':'first'})})
|
48
|
+
dropdown3.add({model: new classes.Dropdown({'title':'second'})})
|
49
|
+
dropdown3.add({model: new classes.Dropdown({'title':'third'})})
|
50
|
+
|
51
|
+
$('#dropdown-example-3').append(dropdown3.render().el)
|
52
|
+
~~~
|
53
|
+
|
54
|
+
## Helper Text and Setting the Width of the Dropdown
|
55
|
+
<div id="dropdown-example-4"></div>
|
42
56
|
|
43
57
|
~~~javascript
|
44
58
|
// Add helper texts
|
45
59
|
// And set the width
|
46
|
-
|
60
|
+
dropdown4 = new classes.DropdownView({'helper': 'option1', 'width':'300px'})
|
47
61
|
|
48
|
-
|
49
|
-
|
62
|
+
dropdown4.add({model: new classes.Dropdown({'label': 'this'})})
|
63
|
+
dropdown4.add({model: new classes.Dropdown({'label': 'that'})})
|
50
64
|
|
51
|
-
$('#dropdown-example-
|
65
|
+
$('#dropdown-example-4').append(dropdown4.render().el)
|
52
66
|
~~~
|
53
67
|
|
54
68
|
## Multiple Selections
|
55
69
|
|
56
|
-
<div id="dropdown-example-
|
70
|
+
<div id="dropdown-example-5"></div>
|
57
71
|
|
58
72
|
~~~javascript
|
59
73
|
// Helper Text and Multiple Selection
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
$('#dropdown-example-
|
74
|
+
dropdown5 = new classes.DropdownView({'multiple':true, 'width':'300px'})
|
75
|
+
dropdown5.add({model: new classes.Dropdown({'label': 'the other'})})
|
76
|
+
dropdown5.add({model: new classes.Dropdown({'label': 'that other'})})
|
77
|
+
dropdown5.add({model: new classes.Dropdown({'label': '1'})})
|
78
|
+
dropdown5.add({model: new classes.Dropdown({'label': '2'})})
|
79
|
+
dropdown5.add({model: new classes.Dropdown({'label': '3'})})
|
80
|
+
dropdown5.add({model: new classes.Dropdown({'label': '4'})})
|
81
|
+
dropdown5.add({model: new classes.Dropdown({'label': '5'})})
|
82
|
+
$('#dropdown-example-5').append(dropdown5.render().el)
|
83
|
+
~~~
|
84
|
+
|
85
|
+
|
86
|
+
## Custom values different from labels, defaulting to a value or label
|
87
|
+
|
88
|
+
<div id="dropdown-example-6"></div>
|
89
|
+
|
90
|
+
~~~javascript
|
91
|
+
// Helper Text and Multiple Selection
|
92
|
+
dropdown6 = new classes.DropdownView({ 'default_to': 2 })
|
93
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'One', 'value':'1'})})
|
94
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'Two', 'value':'2'})})
|
95
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'Three', 'value':'3'})})
|
96
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'Four', 'value':'4'})})
|
97
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'Five', 'value':'5'})})
|
98
|
+
$('#dropdown-example-6').append(dropdown6.render().el)
|
69
99
|
~~~
|
70
100
|
|
101
|
+
|
71
102
|
### Available Options
|
72
103
|
|
73
104
|
- `allow_single_deselect`
|
@@ -92,33 +123,57 @@ $(function () {
|
|
92
123
|
|
93
124
|
$('#dropdown-example-1').append(dropdown.render().el)
|
94
125
|
|
95
|
-
//
|
96
|
-
window.dropdown2 = new classes.DropdownView({'label':'title', 'default_to':'third'});
|
126
|
+
// Setting `label` and `value`
|
97
127
|
|
98
|
-
dropdown2
|
99
|
-
|
100
|
-
dropdown2.add({model: new classes.Dropdown({'
|
128
|
+
var dropdown2 = new classes.DropdownView();
|
129
|
+
|
130
|
+
dropdown2.add({model: new classes.Dropdown({'value':'1', 'label':'first'})})
|
131
|
+
dropdown2.add({model: new classes.Dropdown({'value':'2', 'label':'second'})})
|
132
|
+
dropdown2.add({model: new classes.Dropdown({'value':'3', 'label':'third'})})
|
101
133
|
|
102
134
|
$('#dropdown-example-2').append(dropdown2.render().el)
|
103
135
|
|
136
|
+
|
137
|
+
// Set the label from a different atribute, and choose a default value
|
138
|
+
window.dropdown3 = new classes.DropdownView({'label':'title', 'default_to':'third'});
|
139
|
+
|
140
|
+
dropdown3.add({model: new classes.Dropdown({'title':'first'})})
|
141
|
+
dropdown3.add({model: new classes.Dropdown({'title':'second'})})
|
142
|
+
dropdown3.add({model: new classes.Dropdown({'title':'third'})})
|
143
|
+
|
144
|
+
$('#dropdown-example-3').append(dropdown3.render().el)
|
145
|
+
|
104
146
|
// Add helper texts
|
105
147
|
// And set the width
|
106
|
-
|
148
|
+
dropdown4 = new classes.DropdownView({'helper': 'option1', 'width':'400px'})
|
107
149
|
|
108
|
-
|
109
|
-
|
150
|
+
dropdown4.add({model: new classes.Dropdown({'label': 'this'})})
|
151
|
+
dropdown4.add({model: new classes.Dropdown({'label': 'that'})})
|
110
152
|
|
111
|
-
$('#dropdown-example-
|
153
|
+
$('#dropdown-example-4').append(dropdown4.render().el)
|
112
154
|
|
113
155
|
// Helper Text and Multiple Selection
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
$('#dropdown-example-
|
156
|
+
dropdown5 = new classes.DropdownView({'multiple':true, 'width':'300px'})
|
157
|
+
dropdown5.add({model: new classes.Dropdown({'label': 'the other'})})
|
158
|
+
dropdown5.add({model: new classes.Dropdown({'label': 'that other'})})
|
159
|
+
dropdown5.add({model: new classes.Dropdown({'label': '1'})})
|
160
|
+
dropdown5.add({model: new classes.Dropdown({'label': '2'})})
|
161
|
+
dropdown5.add({model: new classes.Dropdown({'label': '3'})})
|
162
|
+
dropdown5.add({model: new classes.Dropdown({'label': '4'})})
|
163
|
+
dropdown5.add({model: new classes.Dropdown({'label': '5'})})
|
164
|
+
$('#dropdown-example-5').append(dropdown5.render().el)
|
165
|
+
|
166
|
+
// Custom values different from labels, defaulting to a value or label
|
167
|
+
dropdown6 = new classes.DropdownView({ 'default_to': 2 })
|
168
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'One', 'value':'1'})})
|
169
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'Two', 'value':'2'})})
|
170
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'Three', 'value':'3'})})
|
171
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'Four', 'value':'4'})})
|
172
|
+
dropdown6.add({model: new classes.Dropdown({'label': 'Five', 'value':'5'})})
|
173
|
+
$('#dropdown-example-6').append(dropdown6.render().el)
|
174
|
+
|
123
175
|
})
|
176
|
+
|
177
|
+
|
178
|
+
|
124
179
|
</script>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
{{/if}}
|
5
5
|
<select class="dropdown-list" {{#if multiple}}multiple{{/if}} {{#if placeholder}}data-placeholder='{{placeholder}}'{{/if}}>
|
6
6
|
{{#each models}}
|
7
|
-
<option {{#if selected}}selected{{/if}} {{#if disabled}}disabled{{/if}}>{{label}}</option>
|
7
|
+
<option {{#if value}}value="{{value}}"{{/if}} {{#if selected}}selected{{/if}} {{#if disabled}}disabled{{/if}}>{{label}}</option>
|
8
8
|
{{/each}}
|
9
9
|
</select>
|
10
10
|
{{#if helper}}
|
@@ -13,10 +13,12 @@ classes.DropdownView = Backbone.View.extend
|
|
13
13
|
@set_default(model)
|
14
14
|
|
15
15
|
set_default: (model) ->
|
16
|
-
model.
|
16
|
+
if model.get('value') is "#{@opts.default_to}" or model.get('label') is "#{@opts.default_to}"
|
17
|
+
model.set('selected', 'selected')
|
17
18
|
|
18
19
|
add: (params) ->
|
19
20
|
model = params.model
|
21
|
+
model.set 'value', model.get(@opts.value || 'value') || model.get(@opts.label || 'label')
|
20
22
|
model.set 'label', model.get(@opts.label || 'label')
|
21
23
|
@collection.add(model)
|
22
24
|
@set_default(model)
|
@@ -29,7 +31,7 @@ classes.DropdownView = Backbone.View.extend
|
|
29
31
|
this.delegateEvents();
|
30
32
|
@$('.dropdown-list').chosen({width: @opts.width, disable_search_threshold: @opts.disable_search_threshold}).change((e,selected) =>
|
31
33
|
model = @collection.find (m) ->
|
32
|
-
selected.selected is m.get('
|
34
|
+
selected.selected is m.get('value')
|
33
35
|
this.trigger(app.events.SELECT, model)
|
34
36
|
)
|
35
37
|
@
|
@@ -43,4 +45,4 @@ classes.DropdownView = Backbone.View.extend
|
|
43
45
|
@render().el
|
44
46
|
|
45
47
|
get_selected: () ->
|
46
|
-
@collection.find (model) => @$('select').val() is model.get('
|
48
|
+
@collection.find (model) => @$('select').val() is model.get('value')
|
data/lib/atlas_assets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atlas_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rune Skjoldborg Madsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: handlebars_assets
|