01_init.js 811 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @license
  3. * (C) Copyright Contributors to the SearXNG project.
  4. * (C) Copyright Contributors to the searx project (2014 - 2021).
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. window.searxng = (function(d) {
  8. 'use strict';
  9. //
  10. d.getElementsByTagName("html")[0].className = "js";
  11. // add data- properties
  12. var script = d.currentScript || (function() {
  13. var scripts = d.getElementsByTagName('script');
  14. return scripts[scripts.length - 1];
  15. })();
  16. return {
  17. autocompleter: script.getAttribute('data-autocompleter') === 'true',
  18. infinite_scroll: script.getAttribute('data-infinite-scroll') === 'true',
  19. method: script.getAttribute('data-method'),
  20. translations: JSON.parse(script.getAttribute('data-translations'))
  21. };
  22. })(document);