Skip to content

Commit

Permalink
Remove auto-load search results and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsamuelwrites committed Aug 21, 2018
1 parent 3f5af0e commit c9e926e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion search.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div class="section">
<h2>Search properties</h2>
<form action="./search.html" onsubmit="findProperty(event, this)">
<input id="search" name="search" type="text" value="instance of"></input>
<input id="search" name="search" type="text" placeholder="Software" ></input>
<input type="submit">
</form>
</div>
Expand Down
8 changes: 6 additions & 2 deletions wdprop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1385,14 +1385,19 @@ function findPropertyOnLoad() {
language = decodeURIComponent(value[1]);
}
}
var search = 'instance of';
var search = '';
if(window.location.search.length > 0) {
var reg = new RegExp("search=([^&#=]*)");
var value = reg.exec(window.location.search);
if (value != null) {
search = decodeURIComponent(value[1]);
}
}

if (search == "") {
return;
}

sparqlQuery = getSearchQuery(language, '"'+search+'"');
document.getElementById("search").value = search;
queryWikidata(sparqlQuery, createDivSearchProperties, "searchResults");
Expand Down Expand Up @@ -1455,7 +1460,6 @@ function createDivTranslationPath(divId, json, optimized) {
var comment = "";
var time = "";
if (optimized) {
console.log(count);
if ('comment'+count in result) {
comment = result['comment'+count].value;
time = result['time'+count].value;
Expand Down

0 comments on commit c9e926e

Please sign in to comment.