corn_starch 1.6.0 → 1.7.0
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 +4 -4
- data/app/assets/javascripts/corn_starch/infiniscroll.js.coffee +2 -2
- data/app/assets/javascripts/corn_starch/modal.js.coffee +17 -0
- data/app/helpers/corn_starch/modal_helper.rb +25 -0
- data/app/views/corn_starch/layouts/_modal.html.erb +14 -0
- data/lib/corn_starch/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af02d5a73ddbb4898af79492f2df01e7454bb225
|
4
|
+
data.tar.gz: f11cb145b4a6a671b9f63e7754f732957af4075c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc89c7ba08a43fb732c6e48840c18c1f3f0ae283c7b8c5f27be3e755a94d7da807da97a70b157a5d3bd0182e0537b6844bd455dfd62e35a96be3b524576586fe
|
7
|
+
data.tar.gz: 7004cf965425d663232fee519c61ca0474bb5833099d841a5ace2f57ef4fb049a7ee99f9dfc7661e24dc4e3b482ee9c9cbf2f9e91bb06bb0a5b89a4a794b63d6
|
@@ -48,7 +48,7 @@ window.infiniscroll = (container) ->
|
|
48
48
|
$(window).scroll infiniscroll_handler
|
49
49
|
|
50
50
|
# Scroll Handler
|
51
|
-
window.infiniscroll_handler =
|
51
|
+
window.infiniscroll_handler = ->
|
52
52
|
|
53
53
|
# Acquire Container
|
54
54
|
infiniscroll_container = $('.infiniscroll-container')[0]
|
@@ -63,7 +63,7 @@ window.infiniscroll_handler = () ->
|
|
63
63
|
infiniscroll infiniscroll_container.id
|
64
64
|
|
65
65
|
# InfiniScroll Init
|
66
|
-
window.infiniscroll_init =
|
66
|
+
window.infiniscroll_init = ->
|
67
67
|
|
68
68
|
# Acquire Container
|
69
69
|
infiniscroll_container = $('.infiniscroll-container')
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# CornStarch
|
2
|
+
# by Eresse <eresse@eresse.net>
|
3
|
+
|
4
|
+
# Modal JS
|
5
|
+
|
6
|
+
# Init Modal
|
7
|
+
window.modal_init = (modal) ->
|
8
|
+
|
9
|
+
# Wire up Show Button
|
10
|
+
if $("#modal-#{modal}-btn-show").length
|
11
|
+
$("#modal-#{modal}-btn-show").click ->
|
12
|
+
$("#modal-#{modal}").show 'fast'
|
13
|
+
|
14
|
+
# Wire up Hide Button
|
15
|
+
if $("#modal-#{modal}-btn-hide").length
|
16
|
+
$("#modal-#{modal}-btn-hide").click ->
|
17
|
+
$("#modal-#{modal}").hide 'fast'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# CornStarch
|
2
|
+
# by Eresse <eresse@eresse.net>
|
3
|
+
|
4
|
+
# CornStarch Module
|
5
|
+
module CornStarch
|
6
|
+
|
7
|
+
# Modal Helper
|
8
|
+
module ModalHelper
|
9
|
+
|
10
|
+
# Modal Tag
|
11
|
+
def modal_tag params, &block
|
12
|
+
render partial: 'modal', locals: { modal: params }, &block
|
13
|
+
end
|
14
|
+
|
15
|
+
# Hide Button Tag
|
16
|
+
def modal_hide_btn_tag modal
|
17
|
+
div_tag class: 'modal-close-btn', id: "modal-#{modal[:name]}-btn-hide"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Modal Block Tag
|
21
|
+
def modal_block_tag &block
|
22
|
+
div_tag class: 'modal-block', &block
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%# Modal %>
|
2
|
+
<div class='modal' id='modal-<%= modal[:name] %>'>
|
3
|
+
<div class='modal-content'>
|
4
|
+
<%= yield %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<%# Modal JS %>
|
9
|
+
<script>
|
10
|
+
|
11
|
+
<%# Init Modal %>
|
12
|
+
$(document).ready(function() { modal_init(<%= modal[:name] %>); });
|
13
|
+
$(document).on('page:load', function() { modal_init(<%= modal[:name] %>); });
|
14
|
+
</script>
|
data/lib/corn_starch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corn_starch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eresse
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,12 +52,15 @@ files:
|
|
52
52
|
- Rakefile
|
53
53
|
- app/assets/javascripts/corn_starch/application.js
|
54
54
|
- app/assets/javascripts/corn_starch/infiniscroll.js.coffee
|
55
|
+
- app/assets/javascripts/corn_starch/modal.js.coffee
|
55
56
|
- app/assets/javascripts/corn_starch/notifications.js.coffee
|
56
57
|
- app/controllers/corn_starch/corn_starch_controller.rb
|
57
58
|
- app/controllers/corn_starch/sessions_controller.rb
|
58
59
|
- app/helpers/corn_starch/corn_starch_helper.rb
|
59
60
|
- app/helpers/corn_starch/gravatar_helper.rb
|
60
61
|
- app/helpers/corn_starch/infiniscroll_helper.rb
|
62
|
+
- app/helpers/corn_starch/modal_helper.rb
|
63
|
+
- app/views/corn_starch/layouts/_modal.html.erb
|
61
64
|
- app/views/corn_starch/layouts/_notifications.html.erb
|
62
65
|
- app/views/corn_starch/layouts/_pagination.html.erb
|
63
66
|
- bin/console
|