blacklight_dates2svg 0.0.1.beta4 → 0.0.1.beta5

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: f9ffe7bf81a438203c77f694049796c795f18713
4
- data.tar.gz: 263560282e92f4554657d15eb68225ce980408f6
3
+ metadata.gz: 9b6e3c9c7b6ee1bfe77f5a6bdc6f5cd39c06e3eb
4
+ data.tar.gz: 871f188517d01f69ed47296198ec2bc382da3c4f
5
5
  SHA512:
6
- metadata.gz: 4ac75f9127829e3f312544c31f7de00b510930e58ae42558b9165c01f3295dbce1622c1aadc6bcae98ea8ae556cdb2f66d2a22cfbe930fa64a3fdc3e1f1139df
7
- data.tar.gz: 2aefd518b0819738f0c457e164e00fcaf912b103c66f1211deeef1974c03a67def4e2cf9b318f3030fae633246e32a3dc72293bda37294990c471c5bf1e463a9
6
+ metadata.gz: 6fce8e94aecacd1d6eee09fef8131a2ed9bf435611f89de864ff75aee446b55a3032c0caeccc4b01b88fca278d31c6a537e0b3a0835b92f28777dcee1f6b9674
7
+ data.tar.gz: 3850a7d08e0f038abe6bf4a4e9d5dbe519412217434869aeb5ebcf149a996a10295a757a002fa7f1e8284677f161a6300de8d39aa0883e02f666a58b48272513
@@ -21,10 +21,10 @@
21
21
  var begin_input = $("form input" + settings.begin_input, selector);
22
22
  var end_input = $("form input" + settings.end_input, selector);
23
23
  var hits_element = $(settings.hits, selector);
24
-
24
+
25
25
  updateRangesFromInputs();
26
26
  updateRangeOnFormChange();
27
-
27
+
28
28
  $("rect", svg).each(function(){
29
29
  $(this).click(function(){
30
30
  // clear selected months
@@ -41,7 +41,11 @@
41
41
  updateDateSelectorFormControls();
42
42
  });
43
43
  });
44
-
44
+
45
+ function inputHasValue(input) {
46
+ return (input != "" && input !== undefined);
47
+ }
48
+
45
49
  function selectRange(){
46
50
  if($("rect[data-selected='true']", svg).length > 1){
47
51
  var in_range = false;
@@ -99,7 +103,7 @@
99
103
  function updateRangeOnFormChange(){
100
104
  $.each([begin_input, end_input], function(){
101
105
  $(this).change(function(){
102
- if($(this).attr("value") != "" &&
106
+ if(inputHasValue($(this).attr("value")) &&
103
107
  begin_input.attr("value").match(/^\d{4}-\d{2}/) &&
104
108
  end_input.attr("value").match(/^\d{4}-\d{2}/)){
105
109
  $("rect", svg).each(function(){
@@ -113,14 +117,14 @@
113
117
 
114
118
  function updateRangesFromInputs(){
115
119
  var begin_grid_element, end_grid_element;
116
- if(begin_input.length > 0 && begin_input.attr("value") != "") {
120
+ if(begin_input.length > 0 && inputHasValue(begin_input.attr("value"))) {
117
121
  var match = begin_input.attr("value").match(/^(\d{4})-(\d{2})/)
118
122
  var year = match[1]
119
123
  var month = match[2]
120
124
  begin_grid_element = $("rect[data-year='" + year + "'][data-month='" + month +"']", svg);
121
125
  begin_grid_element.attr("data-selected", "true");
122
126
  }
123
- if(end_input.length > 0 && end_input.attr("value") != "") {
127
+ if(end_input.length > 0 && inputHasValue(end_input.attr("value"))) {
124
128
  var match = end_input.attr("value").match(/^(\d{4})-(\d{2})/)
125
129
  var year = match[1]
126
130
  var month = match[2]
@@ -130,6 +134,6 @@
130
134
  selectRange();
131
135
  updateDateSelectorFormControls();
132
136
  }
133
-
137
+
134
138
  }
135
- })( jQuery );
139
+ })( jQuery );
@@ -1,3 +1,3 @@
1
1
  module BlacklightDates2SVG
2
- VERSION = "0.0.1.beta4"
2
+ VERSION = "0.0.1.beta5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight_dates2svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta4
4
+ version: 0.0.1.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jessie Keck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails