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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzE4ZDZmMjUxYmI5YWExYjU4YWM3ODQ5ZjAwODFkY2RmNTk0MmVkMw==
4
+ OGFjOTQ1ZTMwMDZmZDI3NjE2N2U0OWQ1MzY4ZjU3OGFhMWI1YmY4Mg==
5
5
  data.tar.gz: !binary |-
6
- ZDEzMTE1MDgxYTNlNmQ2MzYyOWIxZjA0ZmVhN2M0OTRmZDU4ODg5Yg==
6
+ NjU4NDhmMDMyOTBlZmQ2ZTZmNTk3OGRmMGNlYmI0ZTllMGE4ZjhiYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGRhZWZiMzlkOWExOTdkOTI0ZDUyNjVhMzg3Yzk1Zjc1MDMzY2E4YTczYzhk
10
- YTdmYjIwNzk0ZTcyZGNiNGJkZDA4MWU3NjE4MjIyZTZkOTE2ZGE5NDNmNTMz
11
- M2M4OWE0M2Q3NjE2ZGQ4ZGFmN2NlMmY2OTYzMzYxNzdlOTFkMGM=
9
+ MjFjNzc0ZGViZmE1OWMzNDJhYjcwMDVhMzc1MmEwNzRhZTgwMzVkZjIyMDc1
10
+ MTQ1Y2VmM2VhNzIyY2I1ZDFhYzhkMjE3ZGMyNzAwYTYyM2YwYTM0ZTViMGVk
11
+ Y2NmNWQ2ZTJjMWNmNjVkMzk0YjQxMjVhNjgyMTlkOTkxODU5YmM=
12
12
  data.tar.gz: !binary |-
13
- ZDY3ZTc0YTRjN2I3NmRiOGMzNzMyMzI2YWI2NmNmOWE5MmVmYTQwYmMxMTg5
14
- OTFhMTZhZTk1YTY1ZTZkZDBlNTU2ZDU4Y2E4OTMxOTQ1NTZmOGI1ZjQ3NjAw
15
- YjJmYjRjZmViYjE1OWEzMmM2OWJhY2FhMGYxYmI5N2EwY2RmNWQ=
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", "~> 1.0.2"
8
+ gem "jekyll", "~> 2.0"
9
9
  gem "sass", "~> 3.2.9"
10
- gem 'jekyll-assets', :git => "git://github.com/ixti/jekyll-assets.git"
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.0.2"
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.5)
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
- classifier (1.3.4)
22
- fast-stemmer (>= 1.0.0)
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.7.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
- handlebars_assets (0.17.1)
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
- jekyll (1.0.4)
47
- classifier (~> 1.3)
35
+ hitimes (1.2.2)
36
+ jekyll (2.4.0)
37
+ classifier-reborn (~> 2.0)
48
38
  colorator (~> 0.1)
49
- commander (~> 4.1.3)
50
- directory_watcher (~> 1.4.1)
51
- kramdown (~> 1.0.2)
52
- liquid (~> 2.5.1)
53
- maruku (~> 0.5)
54
- pygments.rb (~> 0.5.0)
55
- safe_yaml (~> 0.7.0)
56
- kramdown (1.0.2)
57
- liquid (2.5.5)
58
- maruku (0.7.2)
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.5.4)
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
- safe_yaml (0.7.1)
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.1)
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 (~> 1.0.2)
96
- jekyll-assets!
97
- kramdown (~> 1.0.2)
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"><a class='btn'>Build Settings</a></div><div style="clear:both">&nbsp;</div>
14
+ <div class="pull-left" id="dropdown-example-1"></div><div class="pull-left"></div><div style="clear:both">&nbsp;</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` Attribute
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({'label':'title', 'default_to':'third'});
31
+ var dropdown2 = new classes.DropdownView();
32
32
 
33
- dropdown2.add({model: new classes.Dropdown({'title':'first'})})
34
- dropdown2.add({model: new classes.Dropdown({'title':'second'})})
35
- dropdown2.add({model: new classes.Dropdown({'title':'third'})})
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
- ## Helper Text and Setting the Width of the Dropdown
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
- dropdown3 = new classes.DropdownView({'helper': 'option1', 'width':'300px'})
60
+ dropdown4 = new classes.DropdownView({'helper': 'option1', 'width':'300px'})
47
61
 
48
- dropdown3.add({model: new classes.Dropdown({'label': 'this'})})
49
- dropdown3.add({model: new classes.Dropdown({'label': 'that'})})
62
+ dropdown4.add({model: new classes.Dropdown({'label': 'this'})})
63
+ dropdown4.add({model: new classes.Dropdown({'label': 'that'})})
50
64
 
51
- $('#dropdown-example-3').append(dropdown3.render().el)
65
+ $('#dropdown-example-4').append(dropdown4.render().el)
52
66
  ~~~
53
67
 
54
68
  ## Multiple Selections
55
69
 
56
- <div id="dropdown-example-4"></div>
70
+ <div id="dropdown-example-5"></div>
57
71
 
58
72
  ~~~javascript
59
73
  // Helper Text and Multiple Selection
60
- dropdown4 = new classes.DropdownView({'multiple':true, 'width':'300px'})
61
- dropdown4.add({model: new classes.Dropdown({'label': 'the other'})})
62
- dropdown4.add({model: new classes.Dropdown({'label': 'that other'})})
63
- dropdown4.add({model: new classes.Dropdown({'label': '1'})})
64
- dropdown4.add({model: new classes.Dropdown({'label': '2'})})
65
- dropdown4.add({model: new classes.Dropdown({'label': '3'})})
66
- dropdown4.add({model: new classes.Dropdown({'label': '4'})})
67
- dropdown4.add({model: new classes.Dropdown({'label': '5'})})
68
- $('#dropdown-example-4').append(dropdown4.render().el)
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
- // Set the label from a different atribute, and choose a default value
96
- window.dropdown2 = new classes.DropdownView({'label':'title', 'default_to':'third'});
126
+ // Setting `label` and `value`
97
127
 
98
- dropdown2.add({model: new classes.Dropdown({'title':'first'})})
99
- dropdown2.add({model: new classes.Dropdown({'title':'second'})})
100
- dropdown2.add({model: new classes.Dropdown({'title':'third'})})
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
- dropdown3 = new classes.DropdownView({'helper': 'option1', 'width':'300px'})
148
+ dropdown4 = new classes.DropdownView({'helper': 'option1', 'width':'400px'})
107
149
 
108
- dropdown3.add({model: new classes.Dropdown({'label': 'this'})})
109
- dropdown3.add({model: new classes.Dropdown({'label': 'that'})})
150
+ dropdown4.add({model: new classes.Dropdown({'label': 'this'})})
151
+ dropdown4.add({model: new classes.Dropdown({'label': 'that'})})
110
152
 
111
- $('#dropdown-example-3').append(dropdown3.render().el)
153
+ $('#dropdown-example-4').append(dropdown4.render().el)
112
154
 
113
155
  // Helper Text and Multiple Selection
114
- dropdown4 = new classes.DropdownView({'multiple':true, 'width':'300px'})
115
- dropdown4.add({model: new classes.Dropdown({'label': 'the other'})})
116
- dropdown4.add({model: new classes.Dropdown({'label': 'that other'})})
117
- dropdown4.add({model: new classes.Dropdown({'label': '1'})})
118
- dropdown4.add({model: new classes.Dropdown({'label': '2'})})
119
- dropdown4.add({model: new classes.Dropdown({'label': '3'})})
120
- dropdown4.add({model: new classes.Dropdown({'label': '4'})})
121
- dropdown4.add({model: new classes.Dropdown({'label': '5'})})
122
- $('#dropdown-example-4').append(dropdown4.render().el)
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>
@@ -3,4 +3,6 @@ classes.Dropdown = Backbone.Model.extend
3
3
  @
4
4
 
5
5
  setLabel: (label) ->
6
- @set('label',@get(label))
6
+ @set('label', @get(label))
7
+ setValue: (value) ->
8
+ @set('value', @get(value))
@@ -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.set('selected', 'selected') if model.get('label') is @opts.default_to
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('label')
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('label')
48
+ @collection.find (model) => @$('select').val() is model.get('value')
@@ -135,7 +135,7 @@
135
135
  overflow-y: auto;
136
136
  margin: 0 4px 4px 0;
137
137
  padding: 0 0 0 4px;
138
- max-height: 240px;
138
+ max-height: 394px;
139
139
  -webkit-overflow-scrolling: touch;
140
140
  }
141
141
  .chosen-container .chosen-results li {
@@ -1,5 +1,5 @@
1
1
  module Atlas
2
2
  module Assets
3
- VERSION = "0.8.6"
3
+ VERSION = "0.8.7"
4
4
  end
5
5
  end
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.6
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-09-18 00:00:00.000000000 Z
11
+ date: 2014-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: handlebars_assets