combo_auto_box 0.0.49 → 0.0.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/combo_auto_box/version.rb +1 -1
- data/vendor/assets/javascripts/combo-auto-box.js +3 -19
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f9debb2b2c340530de953873e3d271f632eaaa1
|
4
|
+
data.tar.gz: 3d9312a88383e3d1c73cdf44e5eb476da784cc0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70281602dc926d1b835452ed29919a6587c4c5a1355ab4d7c6fcf17b50d8550115f5be301178afa09f21e011f625eab03d84fd50f0f29459925da9ec570927cd
|
7
|
+
data.tar.gz: 36d8741a23cd3800425aa23a270fe07da567522ca6b60c38bf116e34f9377c858d727d0b3094f175724cf39d267a931eee1c50d6eea357423eecb017fcd21d0b
|
@@ -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, '<');
|
18
|
-
html = html.replace(/\>/g, '>');
|
19
|
-
html = html.replace(/\"/g, '"');
|
20
|
-
html = html.replace(/\'/g, ''');
|
21
|
-
html = html.replace(/\//g, '/');
|
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, '&');
|
888
872
|
html = html.replace(/\</g, '<');
|
889
873
|
html = html.replace(/\>/g, '>');
|