sinatra-hexacta 0.5.0 → 0.5.1
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/lib/sinatra/public/js/finder.js +16 -4
- data/lib/sinatra/views/inputs/paginator.slim +15 -0
- data/lib/sinatra/views/inputs/range.slim +20 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4ff487c00d34b9c9ad97a89dd18f507133521b8f2962f69cd94d05628c8dba1
|
4
|
+
data.tar.gz: d73220612fb3615a96f064e7e4fac2dacd97bb0b364fcd6800682d981f23434a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e52145d0d19a443acf4ea02a96626f670831670c779d832f10f287ae60319c1f3cf70f0c84bc9f41d15e74c17203f34edbc3cead109e63ff873234725a3061e
|
7
|
+
data.tar.gz: d3335785a3304a2acc2a22a3a55bd4b3d5a29b0883d459de89106f39ad67e9382b42af91ae61e5d46734c2eb208ebdc61abcf0f33155107c81d0ba1016cea679
|
@@ -1,3 +1,5 @@
|
|
1
|
+
var hide_results_timeout = false;
|
2
|
+
|
1
3
|
class Finder {
|
2
4
|
|
3
5
|
static find(query){
|
@@ -7,6 +9,11 @@ class Finder {
|
|
7
9
|
data: { query: query }
|
8
10
|
}).done(function(result) {
|
9
11
|
$("#header .results").html(result);
|
12
|
+
|
13
|
+
$('#header .results *').click(function() {
|
14
|
+
clearTimeout(hide_results_timeout);
|
15
|
+
$("#header input").focus();
|
16
|
+
});
|
10
17
|
});
|
11
18
|
}
|
12
19
|
|
@@ -54,12 +61,18 @@ $(document).ready(function(){
|
|
54
61
|
$("#header input").focusin(function() {
|
55
62
|
$("#header .results").addClass("toggled");
|
56
63
|
})
|
64
|
+
|
57
65
|
$("#header input").focusout(function() {
|
58
|
-
|
59
|
-
|
60
|
-
|
66
|
+
hide_results_timeout = setTimeout(function() {
|
67
|
+
$("#header .results").removeClass("toggled");
|
68
|
+
},200);
|
69
|
+
});
|
70
|
+
|
71
|
+
$('#header .results *').click(function() {
|
72
|
+
clearTimeout(hide_results_timeout);
|
61
73
|
$("#header input").focus();
|
62
74
|
});
|
75
|
+
|
63
76
|
$('#header input').keyup(function() {
|
64
77
|
clearTimeout(header_input_timeout);
|
65
78
|
|
@@ -68,7 +81,6 @@ $(document).ready(function(){
|
|
68
81
|
$.xhrPool.abortAll();
|
69
82
|
if (last_query != $.trim($('#header input').val())) {
|
70
83
|
last_query = $.trim($('#header input').val());
|
71
|
-
console.log(last_query);
|
72
84
|
if (last_query.length > 2) {
|
73
85
|
Finder.find(last_query);
|
74
86
|
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
-if pages > 1
|
2
|
+
.row.text-center
|
3
|
+
ul.pagination.no-margin style="vertical-align:middle"
|
4
|
+
li.page-first
|
5
|
+
a href="#" onclick="advance_search(#{url},0,#{format});" «
|
6
|
+
-if offset > 0
|
7
|
+
li.page-pre
|
8
|
+
a href="#" onclick="advance_search(#{url},#{offset - 1},#{format});" ‹
|
9
|
+
input.form-control.text-center name="offset" type="number" max="#{pages}" min="1" value="#{offset+1}" style="vertical-align:middle;display:inline-block;width:100px"
|
10
|
+
ul.pagination.no-margin style="vertical-align:middle"
|
11
|
+
-if offset < pages -1
|
12
|
+
li.page-next
|
13
|
+
a href="#" onclick="advance_search(#{url},#{offset + 1},#{format});" ›
|
14
|
+
li.page-last
|
15
|
+
a onclick="advance_search(#{url},#{pages-1},#{format});" »
|
@@ -0,0 +1,20 @@
|
|
1
|
+
-if from.nil? || to.nil?
|
2
|
+
-date_range = ""
|
3
|
+
-else
|
4
|
+
-date_range = "#{from.strftime('%d %Bb, %y')} - #{to.strftime('%d %Bb, %y')}"
|
5
|
+
|
6
|
+
.form-group.fg-float
|
7
|
+
label #{title}
|
8
|
+
.fg-line
|
9
|
+
-if required
|
10
|
+
input.form-control.date-range.fg-input id="#{id}" type="text" name="#{name}" required="" value="#{date_range}"
|
11
|
+
-else
|
12
|
+
input.form-control.date-range.fg-input id="#{id}" type="text" name="#{name}" value="#{date_range}"
|
13
|
+
input.hidden name="from" value="#{from}"
|
14
|
+
input.hidden name="to" value="#{to}"
|
15
|
+
|
16
|
+
javascript:
|
17
|
+
$('##{id}').on('apply.daterangepicker', function(ev, picker) {
|
18
|
+
$('##{id}').parent().find("input[name='from']").val(picker.startDate.format('DD/MM/YYYY'))
|
19
|
+
$('##{id}').parent().find("input[name='to']").val(picker.endDate.format('DD/MM/YYYY'))
|
20
|
+
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-hexacta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Zanger
|
@@ -178,7 +178,9 @@ files:
|
|
178
178
|
- lib/sinatra/views/inputs/input.slim
|
179
179
|
- lib/sinatra/views/inputs/month.slim
|
180
180
|
- lib/sinatra/views/inputs/multiple_select.slim
|
181
|
+
- lib/sinatra/views/inputs/paginator.slim
|
181
182
|
- lib/sinatra/views/inputs/radio.slim
|
183
|
+
- lib/sinatra/views/inputs/range.slim
|
182
184
|
- lib/sinatra/views/inputs/select.slim
|
183
185
|
- lib/sinatra/views/inputs/textarea.slim
|
184
186
|
- lib/sinatra/views/inputs/tick.slim
|