Fix search results opening in new tab

fixes #17
parent 2396a483
......@@ -31,18 +31,25 @@
};
};
var csc;
var myCallback = function() {
var doRender = function() {
var csc = new google.search.CustomSearchControl;
.setLinkTarget (google.search.Search.LINK_TARGET_SELF);
google.search.cse.element.render({
div: "searchresults",
tag: 'searchresults-only',
gname: 'searchresults'
});
var options = {};
options[google.search.Search.RESTRICT_EXTENDED_ARGS] = {
'as_sitesearch': 'nove.ok1kvk.cz'
};
csc = new google.search.CustomSearchControl('003089460452505374651:q5prtsadbio', options);
csc.setLinkTarget (google.search.Search.LINK_TARGET_SELF);
var drawOptions = new google.search.DrawOptions();
drawOptions.enableSearchResultsOnly();
csc.draw("searchresults", drawOptions);
var s = $("#searchbox input").val()
if(s != "")
google.search.cse.element.getElement('searchresults').execute(s);
csc.execute(s);
}
if (document.readyState == 'complete') {
doRender();
......@@ -74,7 +81,7 @@
$("#searchresults").html("");
myCallback();
} else
google.search.cse.element.getElement('searchresults').execute(s);
csc.execute(s);
},250));
(function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment