sinatra-hexacta 0.5.0 → 0.5.1

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
  SHA256:
3
- metadata.gz: 40539215cd6fdc0125ffc66f4ff4676f0fd1e9406363ab1c77610210f7b2f089
4
- data.tar.gz: 0e98f2f83219644a2b656f3c2dc004feb32057d8f496a080020d46ef3f3e56b8
3
+ metadata.gz: a4ff487c00d34b9c9ad97a89dd18f507133521b8f2962f69cd94d05628c8dba1
4
+ data.tar.gz: d73220612fb3615a96f064e7e4fac2dacd97bb0b364fcd6800682d981f23434a
5
5
  SHA512:
6
- metadata.gz: efbe90d384fe23a27f1aadd100bda5f915453650197588c86e64a8f62af65cd1b4751773e9090051d29291abbc388a61a33e4fcc30f8189ff5250ad42c59b93a
7
- data.tar.gz: c01a593e12a8ecdf8c1b161d9a5259b5cd22b55512af32871bc8c7b61f9c1b33d5121d5ec383af6c11abe9976d81daee520b2681f370f6d70a7b3dd5a479f9d8
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
- $("#header .results").removeClass("toggled");
59
- })
60
- $('#header .results').click(function() {
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.0
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