Skip to content

Commit 00e5899

Browse files
committed
Changed filterJson to filterJSON
1 parent 59bc827 commit 00e5899

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ matched values or the parent object of the matched values. You even have the opt
88

99
Below is a basic usage:
1010
````javascript
11-
$.fn.filterJson({ json object }, {
11+
$.fn.filterJSON({ json object }, {
1212
property: ["prop1", "prop2", ... n],
1313
wrapper: true,
1414
value: "user one",

demos/demo.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>jQuery Filter JSON Plugin</title>
77
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
88
<script type="text/javascript" src="http://ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>
9-
<script type="text/javascript" src="../src/filterJson.plugin.min.js"></script>
9+
<script type="text/javascript" src="../src/filterJSON.plugin.min.js"></script>
1010
<script type="text/javascript" src="assets/sample.json"></script>
1111
<link rel="stylesheet" type="text/css" href="assets/style.css" />
1212
</head>
@@ -73,7 +73,7 @@
7373
</tr>
7474
<tr class="input-row">
7575
<td colspan="2">
76-
<button id="filterJson" name="Apply">Filter JSON</button>
76+
<button id="filterJSON" name="Apply">Filter JSON</button>
7777
</td>
7878
</tr>
7979
<tr class="input-row">
@@ -93,7 +93,7 @@
9393
// selecting the first json sample
9494
$( ":input[name='sample-select']:first" ).click();
9595

96-
$( "#filterJson" ).click(function() {
96+
$( "#filterJSON" ).click(function() {
9797
var startTime = new Date().getTime(),
9898
json = $.parseJSON( $( "#json" ).val() ),
9999
property = $( "#property" ).val(),
@@ -116,7 +116,7 @@
116116
matchCase: matchCase,
117117
avoidDuplicates: avoidDuplicates
118118
},
119-
o = $.fn.filterJson(json, config).toArray();
119+
o = $.fn.filterJSON(json, config).toArray();
120120

121121
$( "#filteredJson" ).val( (o != null && o.length > 0) ? JSON.stringify( o ) : "" );
122122
$( "#info" ).html("Returned " + o.length + " results in " + (new Date().getTime() - startTime) + " milliseconds.");

demos/downloads.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</head>
77
<body>
88
<div class="downlaod-heading">Filter JSON Plugin</div>
9-
<div class="download-link">-&nbsp;<a href="../src/filterJson.plugin.js" target="_blank">Uncompressed Code</a> (5.86KB)</div>
10-
<div class="download-link">-&nbsp;<a href="../src/filterJson.plugin.min.js" target="_blank">Minified Code</a> (2.07KB)</div>
9+
<div class="download-link">-&nbsp;<a href="../src/filterJSON.plugin.js" target="_blank">Uncompressed Code</a> (5.86KB)</div>
10+
<div class="download-link">-&nbsp;<a href="../src/filterJSON.plugin.min.js" target="_blank">Minified Code</a> (2.07KB)</div>
1111
</body>
1212
</html>

demos/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
Below is a basic usage:
2424
<pre class="prettyprint">
25-
$.fn.filterJson({ json object }, {
25+
$.fn.filterJSON({ json object }, {
2626
property: ["prop1", "prop2", ... n],
2727
wrapper: true,
2828
value: "user one",

src/filterJson.plugin.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
(function($) {
1313
$.extend($.fn, {
14-
filterJson: function( json, _config ) {
14+
filterJSON: function( json, _config ) {
1515
var config = {
1616
property: null,
1717
value: "",
@@ -21,10 +21,10 @@
2121
matchCase: false,
2222
avoidDuplicates: false
2323
},
24-
filterJsonLoop = function(json, config) {
24+
filterJSONLoop = function(json, config) {
2525
var errorMsg = null;
2626
if($.isEmptyObject( config.property ) || !config.property[0]) {
27-
errorMsg = "config.property is required to filter the json object.";
27+
errorMsg = "config.property is required to filter the JSON object.";
2828
}
2929
if(!$.isEmptyObject(errorMsg)) {
3030
if(window.console) {
@@ -47,12 +47,12 @@
4747

4848
if(config.avoidDuplicates) {
4949
// avoiding duplicate objects in case of multiple property check.
50-
if($.inArray(_value, ret.filteredJson) == -1) {
51-
ret.filteredJson.push( _value );
50+
if($.inArray(_value, ret.filteredJSON) == -1) {
51+
ret.filteredJSON.push( _value );
5252
}
5353
}
5454
else {
55-
ret.filteredJson.push( _value );
55+
ret.filteredJSON.push( _value );
5656
}
5757
};
5858

@@ -110,7 +110,7 @@
110110
}
111111
else if(type === "[object Object]") {
112112
$.extend(internalConfig, config, {value: valueToCompare});
113-
filterJsonLoop(originalValue, internalConfig);
113+
filterJSONLoop(originalValue, internalConfig);
114114
}
115115
};
116116

@@ -120,14 +120,14 @@
120120
constructReturnObject(json, j);
121121
}
122122
}
123-
filterJsonLoop(j, config);
123+
filterJSONLoop(j, config);
124124
});
125125
}
126126
return ret;
127127
},
128-
ret = {filteredJson: []},
128+
ret = {filteredJSON: []},
129129
returnObject = null,
130-
filteredJson = null,
130+
filteredJSON = null,
131131
prop = null;
132132

133133
// extend the default config with the ones passed in by the user.
@@ -152,13 +152,13 @@
152152
&& _config.avoidDuplicates == undefined) {
153153
config.avoidDuplicates = true;
154154
}
155-
returnObject = filterJsonLoop(json, config);
155+
returnObject = filterJSONLoop(json, config);
156156

157-
if(returnObject && returnObject.filteredJson) {
158-
filteredJson = returnObject.filteredJson.length > 0 ? returnObject.filteredJson : returnObject.filteredJson[0];
157+
if(returnObject && returnObject.filteredJSON) {
158+
filteredJSON = returnObject.filteredJSON.length > 0 ? returnObject.filteredJSON : returnObject.filteredJSON[0];
159159
}
160160

161-
return $(filteredJson);
161+
return $(filteredJSON);
162162
}
163163
});
164164
})(jQuery);

src/filterJson.plugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)