Sha256: daa43876be92deb4b2aafa7a0c0f5f7c3fb63db2d280348505f55acf03a0a42f

Contents?: true

Size: 1016 Bytes

Versions: 7

Compression:

Stored size: 1016 Bytes

Contents

%h2
  Search results

#cse
  Loading

:javascript
  function parseQueryFromUrl () {
    var queryParamName = "q";
    var search = window.location.search.substr(1);
    var parts = search.split('&');
    for (var i = 0; i < parts.length; i++) {
      var keyvaluepair = parts[i].split('=');
      if (decodeURIComponent(keyvaluepair[0]) == queryParamName) {
        return decodeURIComponent(keyvaluepair[1].replace(/\+/g, ' '));
      }
    }
    return '';
  }
  google.load('search', '1', {language : 'en'});
  google.setOnLoadCallback(function() {
    var customSearchControl = new google.search.CustomSearchControl('012526638842992167133:g7thmrlp2uw');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    var options = new google.search.DrawOptions();
    options.enableSearchResultsOnly(); 
    customSearchControl.draw('cse',options);
    var queryFromUrl = parseQueryFromUrl();
    if (queryFromUrl) {
      customSearchControl.execute(queryFromUrl);
    }
  }, true);

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
inqlude-0.7.3 view/search.html.haml
inqlude-0.7.2 view/search.html.haml
inqlude-0.7.1 view/search.html.haml
inqlude-0.7.0 view/search.html.haml
inqlude-0.0.8 view/search.html.haml
inqlude-0.0.7 view/search.html.haml
inqlude-0.0.6 view/search.html.haml