luv-assets 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/search-text.min.js +1 -0
- package/package.json +1 -1
- package/readme.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function renderSearchHistory(){let searchHistory=getCompatibleSearchHistoryFromLocalStorage();if(searchHistory.data.length===0){return}const $searchHistoryList=$("#search-history-items-js");searchHistory.data.forEach(function(keyword){const $listItem=$("<li>",{class:"q-js py-2 px-2",text:keyword});$searchHistoryList.append($listItem)});$("#search-history-js").removeClass("d-none")}$(document).ready(function(){pullSearchHistory(pullSearchHistoryUrl);renderSearchHistory();$("#removeDialog .btn-primary").click(function(){removeSearchFromLocalStorage();removeHistory(removeHistoryUrl);location.reload()});const $input=$("#q");const $btnClearContainer=$("#btn-clear-container-js");const $btnContainer=$("#btn-container-js");$input.on("input focus",function(){const q=$(this).val().trim();if(q.length>0){$btnClearContainer.removeClass("d-none");$btnContainer.addClass("d-none")}else{$btnClearContainer.addClass("d-none");$btnContainer.removeClass("d-none")}});$btnClearContainer.on("click",function(){$input.val("").focus();$(this).addClass("d-none");$btnContainer.removeClass("d-none")});$("#searchForm").on("submit",function(e){if(!$input.val().trim()){e.preventDefault();$input.focus();return false}});$(".q-js").click(function(){const search_text=$(this).text();$("#q").val(search_text);$("#searchForm").submit()})});
|
package/package.json
CHANGED
package/readme.txt
CHANGED
|
@@ -12,6 +12,7 @@ terser 负责压缩js
|
|
|
12
12
|
terser src/js/product.js -o dist/js/product.min.js
|
|
13
13
|
terser src/js/category.js -o dist/js/category.min.js
|
|
14
14
|
terser src/js/search.js -o dist/js/search.min.js
|
|
15
|
+
terser src/js/search-text.js -o dist/js/search-text.min.js
|
|
15
16
|
-----------
|
|
16
17
|
// load any GitHub release, commit, or branch
|
|
17
18
|
// note: we recommend using npm for projects that support it
|