Skip to content

Commit 8cad573

Browse files
authored
Merge pull request #8 from henilp105/henilp105-issue#217-search-1
Resolves Issue fortran-lang#217
2 parents a325937 + 5accd21 commit 8cad573

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

assets/js/package_search.js

+9-15
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,23 @@
77

88
}
99

10-
function query_params(query) {
11-
query = query.split('+').join(' ');
1210

13-
var params = {},
14-
tokens,
15-
re = /[?&]?([^=]+)=([^&]*)/g;
16-
17-
while (tokens = re.exec(query)) {
18-
params['1'] = decodeURIComponent(tokens[2]);
19-
}
20-
21-
22-
return params['1'];
23-
}
2411

2512
function search(data){
2613
// Called after json data is loaded
27-
//
2814

2915
projects = data.projects;
3016

3117
// Get search string
32-
var queryString = query_params(fortranLang.findGetParameter('query'));
18+
var query = fortranLang.findGetParameter('query').split('+').join(' ');
19+
20+
var tokens,
21+
re = /[?&]?([^=]+)=([^&]*)/g;
22+
tokens = re.exec(query);
23+
24+
25+
var queryString = decodeURIComponent(tokens[2]);
26+
3327
document.getElementById('search-query').value = queryString;
3428

3529
results = searchProjects(queryString,projects);

0 commit comments

Comments
 (0)