verne 0.3.0 → 0.4.0

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: f156fa00bf36aeafe7340d9a4167f125ae268f70
4
- data.tar.gz: 5003da6c86c9af8646adb1c6cf60372d072c0476
3
+ metadata.gz: 1e7a8baa789ed7867f23a5e75ff7fc431bd0aca9
4
+ data.tar.gz: a83602cbc600d1e7db066bd178a81cd27b544b55
5
5
  SHA512:
6
- metadata.gz: 8da0ea9ce7a28a11cd82d440a240056230b83f95d69eb9176ce262ee991d92c7b4161ac4b315acb6ae6bc246c8051d94747fed4cc848410cfeb0f6f336a86d9a
7
- data.tar.gz: 5db0649ca563862826a2c4cd17e03bf062523fb2eed0d81c367f68e754119335e6152e811c02e775a1997f5adc3dbc3fb62ff460c47aa21a0f356571438d7d69
6
+ metadata.gz: 1f426a0348ab8966371d92fc68697fc431e24d67c58fa20c617537ebc26a3f67d3f79d2fb14cc47c6ceadad135d742684d420f044f90cd943129b104f36f950a
7
+ data.tar.gz: cbc4bd3cc48ac5276e14b1049bdf3902e1efa273d49494f86c0844d4e8700467c5cda634de1dbec009db9d4e380bc84c95c118dd1eb853b2e39512087f631b3a
@@ -1,23 +1,25 @@
1
- $.rails.hideDropdowns = ->
2
- count = $("ul.dropdown-menu.open").length
3
- $("ul.dropdown-menu").fadeOut(150).removeClass("open")
1
+ hideDropdowns = ->
2
+ count = $("[data-type=dropdown][data-state=open]").length
3
+ $("[data-type=dropdown] ul").fadeOut(100)
4
+ $("[data-type=dropdown]").data("state", "")
4
5
  !count
5
6
 
6
7
  $ ->
7
8
  $(document).mouseup (e) ->
8
- container = $("dropdown-menu")
9
+ container = $("[data-type=dropdown]")
9
10
  if (container.has(e.target).length == 0)
10
- $.rails.hideDropdowns()
11
+ hideDropdowns()
11
12
 
12
- $(window).resize -> $.rails.hideDropdowns()
13
+ $(window).resize -> hideDropdowns()
13
14
 
14
15
  $("[data-toggle=dropdown]").click ->
15
- if $(this).siblings("ul.dropdown-menu").hasClass("open")
16
- $.rails.hideDropdowns()
16
+ if $(this).parent().data("state") == "open"
17
+ hideDropdowns()
17
18
  else
18
- $.rails.hideDropdowns()
19
- dropdown = $(this).siblings("ul.dropdown-menu")
20
- dropdown.fadeIn(150).addClass("open")
19
+ hideDropdowns()
20
+ dropdown = $(this).siblings "ul"
21
+ dropdown.fadeIn 100
22
+ $(this).parent().data "state", "open"
21
23
  offset = ($(this).outerWidth(false) - $(dropdown).outerWidth(false)) / 2
22
24
  dropdown.css { 'margin-left' : offset + "px"}
23
25
  false
@@ -1,55 +1,60 @@
1
- $ ->
2
- $(document).on "click", "a[data-toggle=modal]", ->
3
- target = $($(this).attr("data-target"))
4
- $.rails.toggleModal(target)
5
-
6
- $.rails.toggleModal = (target) ->
7
- target.toggleClass("active")
8
- if target.hasClass("active")
9
- overlay = $("<div class=\"overlay\"></div>")
10
- target.appendTo(overlay)
11
- $("body").append(overlay)
12
- else
1
+ toggleModal = (target) ->
2
+ if $(target).data("state") == "open"
3
+ $(target).data "state", ""
13
4
  target.parent().remove()
14
5
  $("body").append(target)
6
+ else
7
+ $(target).data "state", "open"
8
+ overlay = $("<div data-type=\"modal\"></div>")
9
+ target.appendTo(overlay)
10
+ $("body").append(overlay)
11
+
12
+ $ ->
13
+ $(document).on "click", "[data-toggle=modal]", ->
14
+ target = $($(this).attr("data-target"))
15
+ toggleModal(target)
15
16
 
16
- $.rails.allowAction = (link) ->
17
- return true unless link.attr('data-confirm')
18
- $.rails.hideDropdowns()
19
- $.rails.showConfirmDialog(link)
20
- false # Always stops the action since code runs asynchronously
17
+ # $.rails.allowAction = (link) ->
18
+ # return true unless link.attr('data-confirm')
19
+ # $.rails.hideDropdowns()
20
+ # $.rails.showConfirmDialog(link)
21
+ # false # Always stops the action since code runs asynchronously
21
22
 
22
- $.rails.confirmed = (link, should_continue) ->
23
+ # $.rails.confirmed = (link, should_continue) ->
23
24
 
24
- $('.overlay').fadeOut 300, ->
25
- $(this).remove()
25
+ # $('.overlay').fadeOut 300, ->
26
+ # $(this).remove()
26
27
 
27
- if should_continue
28
- link.removeAttr('data-confirm')
29
- link.trigger('click.rails')
28
+ # if should_continue
29
+ # link.removeAttr('data-confirm')
30
+ # link.trigger('click.rails')
30
31
 
31
- $.rails.showConfirmDialog = (link) ->
32
- message = link.attr 'data-confirm'
33
- header = "Notice"
34
- html = """
35
- <div class="overlay">
36
- <div class="modal-wrapper">
37
- <div class="modal">
38
- <h2>#{ header }</h2>
39
- <div class="content">
40
- <p>#{ message }</p>
41
- </div>
42
- <div class="toolbar">
43
- <a href="#" class="button" data-action="cancel">Cancel</a>
44
- <a href="#" class="button" data-action="continue">Continue</a>
45
- </div>
46
- </div>
47
- </div>
48
- </div>
49
- """
50
- $("body").append(html)
32
+ # $.rails.showConfirmDialog = (link) ->
33
+ # message = link.attr 'data-confirm'
34
+ # header = "Notice"
35
+ # html = """
36
+ # <div class="overlay">
37
+ # <div class="modal-wrapper">
38
+ # <div class="modal">
39
+ # <h2>#{ header }</h2>
40
+ # <div class="content">
41
+ # <p>#{ message }</p>
42
+ # </div>
43
+ # <div class="toolbar">
44
+ # <a href="#" class="button" data-action="cancel">Cancel</a>
45
+ # <a href="#" class="button" data-action="continue">Continue</a>
46
+ # </div>
47
+ # </div>
48
+ # </div>
49
+ # </div>
50
+ # """
51
+ # $("body").append(html)
52
+ # $('.overlay a').on 'click', (event) ->
53
+ # event.preventDefault()
54
+ # should_continue = $(this).attr("data-action") == "continue"
55
+ # $.rails.confirmed(link, should_continue)
51
56
 
52
- # $('.overlay a').on 'click', (event) ->
53
- # event.preventDefault()
54
- # should_continue = $(this).attr("data-action") == "continue"
55
- # $.rails.confirmed(link, should_continue)
57
+ # (($) ->
58
+ # $.fn.modal = ->
59
+ # $.rails.toggleModal(this)
60
+ # ) jQuery
@@ -8,7 +8,5 @@
8
8
  @import verne/form
9
9
  @import verne/progress
10
10
  @import verne/list
11
- // @import verne/dropdown
12
- // @import verne/link
13
-
14
- // @import verne/modal
11
+ @import verne/dropdown
12
+ @import verne/modal
@@ -1,6 +1,3 @@
1
- // Settings
2
- $offset: 0
3
-
4
1
  // Mixins
5
2
  @mixin button-is-colored($color)
6
3
  @include box-shadow(0 0 0 1px $color)
@@ -23,7 +20,7 @@ $offset: 0
23
20
  bottom: $rhythm * 2
24
21
  left: $rhythm * 3
25
22
  right: $rhythm * 3
26
- margin: 0 0 $rhythm * 2 0
23
+ margin: 0
27
24
  outline: none
28
25
  display: inline-block
29
26
  border: none
@@ -31,6 +28,7 @@ $offset: 0
31
28
  border-radius: $border-radius
32
29
  cursor: pointer
33
30
  position: relative
31
+ background: transparent
34
32
  -webkit-appearance: none
35
33
  @include button-is-colored($primary-color)
36
34
 
@@ -1,59 +1,61 @@
1
1
  $dropdown-border-color: rgba(0, 0, 0, 0.4)
2
2
 
3
- .dropdown
3
+ %dropdown
4
4
  position: relative
5
5
  display: inline-block
6
-
7
- ul.dropdown-menu
8
- display: none
9
- position: absolute
10
- background: white
11
- list-style: none
12
- margin: $rhythm 0 0 0
13
- padding: 0
14
- border: 1px solid $dropdown-border-color
15
- background: white
16
- left: 0
17
- top: 100%
18
- z-index: 1000
19
- border-radius: 3px
20
- box-shadow: 0px 0px $rhythm rgba(0, 0, 0, 0.2)
21
-
22
- &:after
23
- content: " "
6
+ ul
7
+ display: none
24
8
  position: absolute
25
- width: 0
26
- border: $rhythm solid transparent
27
- border-bottom-color: white
28
- bottom: 100%
29
- left: 50%
30
- margin-left: - $rhythm
9
+ background: white
10
+ margin: $rhythm / 2 0 0 0
11
+ padding: 0
12
+ border: 1px solid $dropdown-border-color
13
+ background: white
14
+ left: 0
15
+ top: 100%
16
+ z-index: 1000
17
+ border-radius: $rhythm / 2
18
+ box-shadow: 0px 0px $rhythm rgba(0, 0, 0, 0.1)
31
19
 
32
- &:before
33
- content: " "
34
- position: absolute
35
- width: 0
36
- border: $rhythm + 0.1 solid transparent
37
- border-bottom-color: $dropdown-border-color
38
- bottom: 100%
39
- left: 50%
40
- margin-left: - $rhythm - 0.1
20
+ &:after
21
+ content: " "
22
+ position: absolute
23
+ width: 0
24
+ border: $rhythm solid transparent
25
+ border-bottom-color: white
26
+ bottom: 100%
27
+ left: 50%
28
+ margin-left: - $rhythm
29
+
30
+ &:before
31
+ content: " "
32
+ position: absolute
33
+ width: 0
34
+ border: $rhythm * 1.25 solid transparent
35
+ border-bottom-color: $dropdown-border-color
36
+ bottom: 100%
37
+ left: 50%
38
+ margin-left: - ($rhythm * 1.25)
41
39
 
42
- li
43
- margin: 0
44
- a
45
- white-space: nowrap
46
- text-align: center
47
- display: block
48
- margin: 0
49
- padding: $rhythm / 2 $rhythm * 2
50
- color: black
51
- transition: 0.1s all linear
52
- width: 100%
53
- border-bottom: none
54
- &:hover
55
- background: rgba(0, 0, 0, 0.08)
56
- li:first-child a
57
- border-radius: 2px 2px 0 0
58
- li:last-child a
59
- border-radius: 0 0 2px 2px
40
+ li
41
+ margin: 0
42
+ padding: 0
43
+ &:before, &:after
44
+ display: none
45
+ a
46
+ cursor: pointer
47
+ white-space: nowrap
48
+ text-align: center
49
+ display: block
50
+ margin: 0
51
+ padding: $rhythm / 2 $rhythm * 2
52
+ color: black
53
+ transition: 0.1s all linear
54
+ width: 100%
55
+ border-bottom: none
56
+ &:hover
57
+ background: rgba(0, 0, 0, 0.08)
58
+ li:first-child a
59
+ border-radius: $rhythm / 2 $rhythm / 2 0 0
60
+ li:last-child a
61
+ border-radius: 0 0 $rhythm / 2 $rhythm / 2
@@ -109,163 +109,3 @@ $border-width: 1px
109
109
  color: rgba(255, 255, 255, 1.0)
110
110
  &::-webkit-input-placeholder
111
111
  color: rgba(255, 255, 255, 0.7)
112
-
113
- .form-old
114
- .input.file
115
- .input-wrapper
116
- width: 100%
117
- // .input.checkbox, .input.boolean
118
- // position: relative
119
- // overflow: hidden
120
- // label
121
- // margin-left: $checkbox-size + $rhythm * 2
122
- // line-height: $checkbox-size
123
- // .input-wrapper
124
- // position: absolute
125
- // top: 0
126
- // left: 0
127
- // margin-left: 0
128
- // width: $checkbox-size
129
- // height: $checkbox-size
130
- // border: $border-radius $highlight-color solid
131
- // border-radius: $border-radius
132
- // margin-bottom: $rhythm
133
- // text-align: center
134
- // &.checked
135
- // border-color: $emrald
136
- // color: $emrald
137
- // &:after
138
- // @include ss-standard
139
- // content: "check"
140
- // position: absolute
141
- // top: -1px
142
- // left: 0
143
- // right: 0
144
- // bottom: 0
145
- // line-height: $checkbox-size
146
- // pointer-events: none
147
- // input
148
- // margin: 0
149
- // padding: 0
150
- // cursor: pointer
151
- // width: 100%
152
- // height: 100%
153
- // opacity: 0
154
-
155
-
156
- // span.required, span.error
157
- // top: - $line-height * 0.1
158
- // position: relative
159
- // font-family: $secondary-font-family
160
- // background: $highlight-color
161
- // border-radius: 2px
162
- // color: white
163
- // display: inline-block
164
- // line-height: $line-height * 0.7
165
- // font-size: $secondary-font-size * 0.7
166
- // font-weight: bold
167
- // text-transform: uppercase
168
- // padding: 0 $line-height * 0.2
169
- // margin: 0
170
- // margin-right: $line-height * 0.2
171
- // .input &
172
- // margin-left: $line-height * 0.2
173
-
174
- // form
175
- // span.hint
176
- // display: block
177
- // font-family: $secondary-font-family
178
- // line-height: $line-height
179
-
180
- // .input
181
- // position: relative
182
- // margin-bottom: $line-height
183
- // overflow: hidden
184
-
185
- // &.hidden
186
- // margin: 0
187
-
188
- // &.date
189
- // margin-right: $line-height
190
- // label
191
- // margin-left: $line-height
192
- // > .input_wrapper > .select_wrapper
193
- // @include span-columns(4)
194
- // select
195
- // width: 100%
196
- // margin: 0
197
-
198
- // > label.control-label
199
- // display: inline-block
200
- // margin-bottom: $line-height * 0.5
201
- // text-align: left
202
-
203
- // > .input_wrapper
204
- // > .select_wrapper
205
- // position: relative
206
- // overflow: hidden
207
- // &:after
208
- // content: "descend"
209
- // position: absolute
210
- // top: 2px
211
- // line-height: $line-height * 2
212
- // font-size: $font-size * 0.7
213
- // bottom: $line-height
214
- // color: rgba(0, 0, 0, 0.3)
215
- // right: $line-height * 0.5
216
- // z-index: 1000
217
- // select
218
- // width: 100%
219
- // display: block
220
- // height: $line-height * 2.0
221
- // padding: $line-height * 0.5
222
- // border: none
223
- // border-bottom: 3px solid rgba(0, 0, 0, 0.4)
224
- // background: rgba(0, 0, 0, 0.07)
225
- // outline: none
226
- // box-sizing: border-box
227
- // -webkit-appearance: none
228
- // border-radius: 0
229
- // position: relative
230
-
231
- // > input, > textarea
232
- // display: block
233
- // height: $line-height * 2.0
234
- // padding: $line-height * 0.5
235
- // width: 100%
236
- // border: none
237
- // border-bottom: 3px solid rgba(0, 0, 0, 0.2)
238
- // background: rgba(0, 0, 0, 0.07)
239
- // outline: none
240
- // resize: none
241
- // box-sizing: border-box
242
-
243
- // > textarea
244
- // height: $line-height * 8.0
245
-
246
-
247
- // &.check_boxes, &.radio_buttons, &.boolean
248
- // > label.control-label
249
- // margin-left: $line-height
250
- // margin-right: $line-height
251
- // user-select: none
252
- // -webkit-user-select: none
253
- // label.checkbox, label.radio
254
- // @include span-columns(6)
255
- // background: rgba(0, 0, 0, 0.05)
256
- // display: block
257
- // line-height: $line-height
258
- // text-align: left
259
- // padding: $line-height * 0.5
260
- // box-sizing: border-box
261
- // border-bottom: 3px solid rgba(0, 0, 0, 0.2)
262
- // margin-bottom: $line-height
263
- // font-weight: 400
264
- // &:hover
265
- // cursor: pointer
266
- // &.selected
267
- // background: $highlight-color
268
- // border-bottom-color: $highlight-color
269
- // font-weight: 700
270
- // input
271
- // display: none
@@ -1,7 +1,4 @@
1
- .modal
2
- display: none
3
-
4
- .overlay
1
+ %modal
5
2
  position: fixed
6
3
  width: auto
7
4
  height: auto
@@ -21,9 +18,9 @@
21
18
  height: 100%
22
19
  vertical-align: middle
23
20
 
24
- .modal
21
+ > div
25
22
  text-align: left
26
- display: inline-block
23
+ display: inline-block !important
27
24
  vertical-align: middle
28
25
  box-shadow: 0 0 $rhythm rgba(0, 0, 0, 0.3)
29
26
  border-radius: $border-radius
@@ -34,12 +31,12 @@
34
31
  overflow: hidden
35
32
  h2
36
33
  margin-bottom: $rhythm * 3
37
- .modal-toolbar
34
+ > div:nth-child(1)
38
35
  text-align: right
39
36
  padding-top: $rhythm * 3
40
37
  .button
41
38
  display: inline-block
42
39
  margin: 0 0 0 $rhythm
43
- .modal-content
40
+ > div:nth-child(2)
44
41
  max-height: $rhythm * 64
45
42
  overflow: scroll
@@ -38,41 +38,37 @@
38
38
  font-size: golden-ratio($rhythm * 3, 0)
39
39
  font-weight: 700
40
40
 
41
- // Modifiers
42
- %copy-is-large
43
- font-size: golden-ratio($rhythm * 3, 1)
41
+ %cite
42
+ line-height: $rhythm * 3
43
+ font-size: $rhythm * 3 / 1.5 // 12px
44
+ text-transform: uppercase
45
+ display: block
46
+ font-style: normal
47
+ font-weight: 600
48
+
49
+ %a
50
+ color: $highlight-color
51
+ text-decoration: none
52
+ border-bottom: 1px solid $highlight-color
44
53
 
45
- // Defaults
46
- // b, strong
47
- // font-weight: 600
54
+ %bold
55
+ font-weight: 600
48
56
 
49
- // a
50
- // color: $highlight-color
51
- // text-decoration: none
52
- // border-bottom: 1px solid $highlight-color
57
+ %block-quote
58
+ @extend %copy
59
+ @extend %copy-is-large
60
+ border-left: $rhythm solid $highlight-color
61
+ font-weight: 300
62
+ display: block
63
+ margin: 0 0 $rhythm * 2 0
64
+ padding:
65
+ top: $rhythm * 2
66
+ bottom: $rhythm * 2
67
+ left: $rhythm * 4
68
+ right: $rhythm * 12
53
69
 
54
- // cite
55
- // line-height: $rhythm * 3
56
- // font-size: $rhythm * 3 / 1.5 // 12px
57
- // text-transform: uppercase
58
- // display: block
59
- // font-style: normal
60
- // font-weight: 600
70
+ // Modifiers
71
+ %copy-is-large
72
+ font-size: golden-ratio($rhythm * 3, 1)
61
73
 
62
- // p, li
63
- // margin-bottom: $rhythm * 2
64
74
 
65
- // blockquote, q
66
- // color: $primary-color
67
- // $offset: $rhythm / 2
68
- // font-size: ($rhythm * 5) * 0.8 // 24px
69
- // border-left: $rhythm solid $highlight-color
70
- // font-style: italic
71
- // font-weight: 300
72
- // display: block
73
- // margin: 0 0 $rhythm * 2 0
74
- // padding:
75
- // top: $rhythm * 2 + $offset
76
- // bottom: $rhythm * 3 - $offset
77
- // left: $rhythm * 4
78
- // right: $rhythm * 12
data/lib/verne/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Verne
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verne
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devon Tivona
@@ -63,8 +63,6 @@ files:
63
63
  - LICENSE
64
64
  - README.md
65
65
  - app/assets/javascripts/verne.dropdown.js.coffee
66
- - app/assets/javascripts/verne.form.js.coffee
67
- - app/assets/javascripts/verne.js.coffee
68
66
  - app/assets/javascripts/verne.modal.js.coffee
69
67
  - app/assets/stylesheets/_verne.sass
70
68
  - app/assets/stylesheets/verne/_alert.sass
@@ -1,18 +0,0 @@
1
- $ ->
2
- $("input[type=checkbox]").each ->
3
- $(this).click (event) ->
4
- $(this).parent().toggleClass("checked")
5
-
6
- $("input[type=file]").each ->
7
- cancel = $("<div>", { class: "input-wrapper", text: "Remove File" })
8
- file = $(this)
9
- cancel.click (event) ->
10
- file.val("")
11
- file.parent().toggleClass("hidden")
12
- cancel.remove()
13
- file.parent().prepend("Upload File")
14
- file.change (event) ->
15
- if file.val() != ""
16
- file.parent().toggleClass("hidden")
17
- cancel.insertAfter(file.parent())
18
-
@@ -1,32 +0,0 @@
1
- configureCheckbox = (checkbox) ->
2
- if checkbox.is(':checked')
3
- checkbox.parent().addClass("selected")
4
- else
5
- checkbox.parent().removeClass("selected")
6
-
7
- $ ->
8
- # Make rows of tables selectable
9
- $("tr[data-target]").click(->
10
- Turbolinks.visit $(this).attr("data-target")
11
- ).find("a").hover (->
12
- $(this).parents("tr").unbind "click"
13
- ), ->
14
- $(this).parents("tr").click ->
15
- Turbolinks.visit $(this).attr("data-target")
16
-
17
- # Add selection states to radio buttons
18
- $("input[type=radio]").each ->
19
- if $(this).is(':checked')
20
- $(this).parent().addClass("selected")
21
- $("input[type=radio]").change ->
22
- selected = $(this)
23
- $('input[type=radio][name="' + selected.attr('name') + '"]').each ->
24
- if $(this).attr('id') != selected.attr('id')
25
- $(this).parent().removeClass("selected")
26
- selected.parent().addClass("selected")
27
-
28
- # Add selection states to check boxes
29
- $('input[type=checkbox]').each ->
30
- configureCheckbox $(this)
31
- $('input[type=checkbox]').change ->
32
- configureCheckbox $(this)