Skip to content
Snippets Groups Projects
  1. Jan 27, 2022
  2. Jan 10, 2022
  3. Aug 11, 2021
  4. Jan 27, 2021
  5. Jul 20, 2020
  6. Jun 01, 2020
  7. Mar 18, 2020
  8. Oct 29, 2019
  9. Jan 16, 2019
  10. Jan 02, 2019
  11. Aug 31, 2018
  12. Aug 16, 2018
  13. Aug 09, 2018
  14. Oct 17, 2017
  15. Apr 04, 2017
  16. Mar 31, 2017
    • Tyler R Lemburg's avatar
      Updated Google Search API to version 2 · e6fe3a1c
      Tyler R Lemburg authored
      Google is deprecating version 1 of their custom search element API
      sometime in April. While we don't generate actual elements using their
      code, we use their javascript libraries to call the search. This
      change updates the code for version 2, removing the deprecation warning
      and keeping things in compliance.
      
      Before working with this, read
      https://developers.google.com/custom-search/docs/element
      very carefully. The flow of the Google Search as it relates to UNL_Search
      is:
      
      1) end-scripts.tpl.php is rendered with variables that include the custom
      search engine ID
      
      2) This script, using search.js (or search.min.js), adds the google search
      javascript to the end of the page asynchronously. It also gives the callback
      for its loading as window.searchInit, which loads the UNLSearch.initialize
      function.
      
      3) This sets up the various search capabilities, binds callbacks onto those
      actions, and has all the JS functions that we operate on in the search.
      
      I didn't need to use the <gsce> element as described in the docs,
      as we already have a text box to search, and I bind the results to
      the unl_results div (local_results if a site-search is executed).
      
      Lastly, this new code does not use the "Linked Search Engine" specification.
      Instead, the as_sitesearch parameter is passed into the Google API,
      or, if a specific Custom Search Engine is specified (cx parameter),
      that is used vs. our regular UNL one.
      e6fe3a1c
  17. Dec 15, 2016
  18. Jun 02, 2016
  19. Feb 01, 2016
  20. Jan 13, 2016
  21. Jan 11, 2016
  22. Dec 17, 2015
  23. Dec 16, 2015
  24. Jul 29, 2014
  25. Apr 24, 2014
  26. Apr 23, 2014
  27. Apr 21, 2014
  28. Apr 17, 2014
  29. Sep 07, 2012
  30. Mar 27, 2012
  31. Mar 26, 2012
Loading