Commit 9cdd3380 authored by Pietro Albini's avatar Pietro Albini

Use the new Google Custom Search API

The old one was deprecated, and will be removed soon.
parent dc2a178b
......@@ -103,30 +103,21 @@
Non avete trovato quello che cercate? <a href="http://www.ubuntu-it.org/contatti">Contattateci</a>!
</div>
<div id="cse" style="width: 100%;">Caricamento...</div>
<script src="https://www.google.it/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'it', style : google.loader.themes.V2_DEFAULT});
google.setOnLoadCallback(function() {
var customSearchOptions = {}; var customSearchControl = new google.search.CustomSearchControl(
'008742922050479854700:9nnmuh99is4', customSearchOptions);
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
customSearchControl.draw('cse');
HASH_LABEL = "#";
// Start search handling url hash
customSearchControl.execute(window.location.hash.substring(HASH_LABEL.length));
// Update hash after search
customSearchControl.setSearchCompleteCallback(
customSearchControl,
function () {
window.location.hash = HASH_LABEL + this.getInputQuery();
}
)
}, true);
<gcse:search></gcse:search>
<script>
(function() {
var cx = '008742922050479854700:9nnmuh99is4';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
......
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