diff --git a/src/js/search.js b/src/js/search.js index ba96452..bb16eed 100644 --- a/src/js/search.js +++ b/src/js/search.js @@ -88,4 +88,4 @@ $(function () { var event = new Event('input', {bubbles: true}) searchInput.dispatchEvent(event) } -})() \ No newline at end of file +}) \ No newline at end of file diff --git a/templates/assets/js/search.min.js b/templates/assets/js/search.min.js index 908406e..dbf8a35 100644 --- a/templates/assets/js/search.min.js +++ b/templates/assets/js/search.min.js @@ -1 +1 @@ -$(function(){var e,t=document.getElementById("dream-search-form"),a=DreamConfig.search_target,n=document.getElementById("halo-search-form-text-input"),i=$("#dream-search-result"),r=$("#dream-search-result-empty");function s(e){return e.replace(/<(?!(?:mark\b[^<>]*)<\/mark>|mark\b)[^<>]*>/gi,"")}function c(e){if(!e)return i.empty(),r.show();Utils.request({url:"/apis/api.halo.run/v1alpha1/indices/post",contentType:"application/json;charset=UTF-8",returnRaw:!0,data:{keyword:e,limit:$("#halo-search-form-limit").val(),highlightPreTag:"",highlightPostTag:""}}).then(e=>{if(console.log(e),0\n
\n\n

'+s(n.title)+'

\n
\n
\n'+s(n.description)+'\n
\n
\n
\n
\n\n
\n
\n')}}else r.show(),i.empty()}).catch(e=>{})}t.addEventListener("submit",function(e){e.preventDefault(),c(n.value)}),document.addEventListener("keydown",function(e){"Enter"===e.key&&t.contains(document.activeElement)&&(e.preventDefault(),c(n.value))}),n.addEventListener("input",function(e){c(e.target.value)}),function(e,t=window.location.href){e="keyword".replace(/[\[\]]/g,"\\$&");e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return e&&e[2]&&decodeURIComponent(e[2].replace(/\+/g," "))}()&&(e=new Event("input",{bubbles:!0}),n.dispatchEvent(e))})(); \ No newline at end of file +$(function(){var e,t=document.getElementById("dream-search-form"),a=DreamConfig.search_target,n=document.getElementById("halo-search-form-text-input"),i=$("#dream-search-result"),r=$("#dream-search-result-empty");function s(e){return e.replace(/<(?!(?:mark\b[^<>]*)<\/mark>|mark\b)[^<>]*>/gi,"")}function c(e){if(!e)return i.empty(),r.show();Utils.request({url:"/apis/api.halo.run/v1alpha1/indices/post",contentType:"application/json;charset=UTF-8",returnRaw:!0,data:{keyword:e,limit:$("#halo-search-form-limit").val(),highlightPreTag:"",highlightPostTag:""}}).then(e=>{if(console.log(e),0\n
\n\n

'+s(n.title)+'

\n
\n
\n'+s(n.description)+'\n
\n
\n
\n
\n\n
\n
\n')}}else r.show(),i.empty()}).catch(e=>{})}t.addEventListener("submit",function(e){e.preventDefault(),c(n.value)}),document.addEventListener("keydown",function(e){"Enter"===e.key&&t.contains(document.activeElement)&&(e.preventDefault(),c(n.value))}),n.addEventListener("input",function(e){c(e.target.value)}),function(e,t=window.location.href){e="keyword".replace(/[\[\]]/g,"\\$&");e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return e&&e[2]&&decodeURIComponent(e[2].replace(/\+/g," "))}()&&(e=new Event("input",{bubbles:!0}),n.dispatchEvent(e))}); \ No newline at end of file diff --git a/theme.yaml b/theme.yaml index f07cc69..70c174a 100644 --- a/theme.yaml +++ b/theme.yaml @@ -30,7 +30,7 @@ spec: settingName: theme-dream2-plus-setting configMapName: theme-dream2-plus-configMap # 版本号 - version: 1.2.7.beta3 + version: 1.2.7.beta4 # 最低支持的 Halo 版本 require: ">=2.15.0" # 许可