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