combo_auto_box 0.0.49 → 0.0.50

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 450b0baa2ff62c8da0071dd9f79823cc0395ed95
4
- data.tar.gz: b801e1f5c9d05df1d33f03fef12125335abf8aec
3
+ metadata.gz: 8f9debb2b2c340530de953873e3d271f632eaaa1
4
+ data.tar.gz: 3d9312a88383e3d1c73cdf44e5eb476da784cc0f
5
5
  SHA512:
6
- metadata.gz: 64d9ede45079dc427ea67402d0ff050024faa151f60d6cc71f5be8e9d6f3d4ac2489a7b1f333d445a84065b15f399b61891e77132f0f2852d34c99a238fe0d5e
7
- data.tar.gz: 21155fe070b5a61bf5ca699e23006a2b186ff13771b841f5c3fc612603e6839b4e5afadda8965ae2ccc7975dc02e1d672a213c476104d821b472845e99480284
6
+ metadata.gz: 70281602dc926d1b835452ed29919a6587c4c5a1355ab4d7c6fcf17b50d8550115f5be301178afa09f21e011f625eab03d84fd50f0f29459925da9ec570927cd
7
+ data.tar.gz: 36d8741a23cd3800425aa23a270fe07da567522ca6b60c38bf116e34f9377c858d727d0b3094f175724cf39d267a931eee1c50d6eea357423eecb017fcd21d0b
@@ -1,3 +1,3 @@
1
1
  module ComboAutoBox
2
- VERSION = '0.0.49'
2
+ VERSION = '0.0.50'
3
3
  end
@@ -11,23 +11,6 @@ var ComboAutoBox = {
11
11
  return prefix + "-" + now;
12
12
  };
13
13
 
14
- var htmlSafe = function(html) {
15
- html = html.toString();
16
- html = html.replace(/\&/g, '&');
17
- html = html.replace(/\</g, '&lt;');
18
- html = html.replace(/\>/g, '&gt;');
19
- html = html.replace(/\"/g, '&quot;');
20
- html = html.replace(/\'/g, '&#x27;');
21
- html = html.replace(/\//g, '&#x2F;');
22
-
23
- return html;
24
- }
25
-
26
- $.each(options.source, function( index, value ){
27
- options.source[index]['id'] = htmlSafe(options.source[index]['id']);
28
- options.source[index]['label'] = htmlSafe(options.source[index]['label']);
29
- });
30
-
31
14
  // generatea an ID based on current time
32
15
  var generateAnId = function(prefix) {
33
16
  var now = new Date().getTime();
@@ -694,7 +677,7 @@ var ComboAutoBox = {
694
677
  var items = [];
695
678
 
696
679
  $.each(data, function(index){
697
- items.push('<li><span class="combo-auto-box-item-id">' + data[index].id +'</span><span class="combo-auto-box-item-label">'+ data[index].label + '</span></li>');
680
+ items.push('<li><span class="combo-auto-box-item-id">' + htmlSafe(data[index].id) +'</span><span class="combo-auto-box-item-label">'+ htmlSafe(data[index].label) + '</span></li>');
698
681
  });
699
682
 
700
683
  $('#' + modalDialogId + ' > div.list').css('height', ($('#' + modalDialogId).dialog("option", "height") - 90) + 'px');
@@ -725,7 +708,7 @@ var ComboAutoBox = {
725
708
  var items = [];
726
709
 
727
710
  $.each(data, function(index){
728
- items.push('<a href="javascript:void(0);" class="list-group-item"><span class="combo-auto-box-item-id" style="display:none;">' + data[index].id +'</span><span class="combo-auto-box-item-label">'+ data[index].label + '</span></a>');
711
+ items.push('<a href="javascript:void(0);" class="list-group-item"><span class="combo-auto-box-item-id" style="display:none;">' + htmlSafe(data[index].id) +'</span><span class="combo-auto-box-item-label">'+ htmlSafe(data[index].label) + '</span></a>');
729
712
  });
730
713
 
731
714
  $('#' + modalDialogId + ' > div.modal-dialog > div.modal-content > div.modal-body > div.list-group').html(items.join(''));
@@ -884,6 +867,7 @@ var ComboAutoBox = {
884
867
  }
885
868
 
886
869
  var htmlSafe = function(html) {
870
+ html = html.toString();
887
871
  html = html.replace(/\&/g, '&amp;');
888
872
  html = html.replace(/\</g, '&lt;');
889
873
  html = html.replace(/\>/g, '&gt;');
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: combo_auto_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.49
4
+ version: 0.0.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adilson Chacon