mirror of
				https://github.com/Mabbs/mabbs.github.io
				synced 2025-10-31 20:36:38 +00:00 
			
		
		
		
	Update 2 files
- /_layouts/default.html - /search.html
This commit is contained in:
		| @@ -27,6 +27,18 @@ | |||||||
|  |  | ||||||
|   gtag('config', '{{ site.google_analytics }}'); |   gtag('config', '{{ site.google_analytics }}'); | ||||||
|   var lastUpdated = new Date("{{ site.time | date: "%FT%T%z" }}"); |   var lastUpdated = new Date("{{ site.time | date: "%FT%T%z" }}"); | ||||||
|  |   function getSearchJSON(callback) { | ||||||
|  |     var searchData = JSON.parse(localStorage.getItem(lastUpdated)); | ||||||
|  |     if (!searchData) { | ||||||
|  |       localStorage.clear(); | ||||||
|  |       $.getJSON("search.json", function (data) { | ||||||
|  |           localStorage.setItem(lastUpdated, JSON.stringify(data)); | ||||||
|  |           callback(data); | ||||||
|  |       }); | ||||||
|  |     } else { | ||||||
|  |       callback(searchData); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|   </script> |   </script> | ||||||
|   {% endif %} |   {% endif %} | ||||||
|   <style> |   <style> | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ var status = false; | |||||||
| if(mykeyword != null && mykeyword.toString().length>1){ | if(mykeyword != null && mykeyword.toString().length>1){ | ||||||
|      sbox.value = mykeyword; |      sbox.value = mykeyword; | ||||||
| } | } | ||||||
| $.getJSON("search.json", function(json){ | getSearchJSON(function(json){ | ||||||
|   var sjs = SimpleJekyllSearch({ |   var sjs = SimpleJekyllSearch({ | ||||||
|      searchInput: sbox, |      searchInput: sbox, | ||||||
|      resultsContainer: document.getElementById('results-container'), |      resultsContainer: document.getElementById('results-container'), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 mayx
					mayx