Commit graph

6 commits

Author SHA1 Message Date
Brian Huisman 47562e0a71 Add 'online' value for Mustache template
Provide an 'online' value to the Search Result Mustache template. This will, for example, allow you to put things in your Search Result template that will show up when your site is displayed live (PHP), but will not be output when your site is displayed using the offline Javascript, and vice versa.

eg.
{{#online}}
  This will only display in your template if it's online.
{{/online}}
{{^online}}
  This will only display in your template it it's offline.
{{/online}}
2023-06-22 09:57:33 -04:00
Brian Huisman eda57224d9 Remove need for 'jw_depth' value
By using the location of the search.js script file, we can determine the root URL of an offline installation as long as the online script has been installed at https://example.com/orcinus/js/search.js
2023-06-21 15:07:57 -04:00
Brian Huisman b17a68c175 Update template.offline.js
Quote jw_depth string.
2023-06-21 12:09:28 -04:00
Brian Huisman e440babc38 Directly reference jw_depth
Don't depend on the id="os_results" element existing in the user template, just use os_odata.jw_depth directly.
2023-06-15 09:48:28 -04:00
Brian Huisman a489fb1b8e sp_smart => sp_punct
Change sp_smart to sp_punct also in the offline javascript template.
2023-06-14 15:39:30 -04:00
Brian Huisman 1ce34d9e41 Offline javascript output
Make the javascript output text into a Mustache template.
Add the jw_depth variable.
2023-06-14 14:43:55 -04:00