mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 13:09:40 +08:00
优化 任务列表显示样式
This commit is contained in:
parent
3f035bef6f
commit
c5532666be
@ -274,7 +274,7 @@ ul[data-type=taskList] {
|
||||
|
||||
& > label {
|
||||
flex: 0 0 auto;
|
||||
margin-right: 0.5rem;
|
||||
margin-right: 0.4rem;
|
||||
user-select: none;
|
||||
|
||||
& > input[type="checkbox"],
|
||||
|
@ -143,6 +143,12 @@ const commonContext = {
|
||||
}
|
||||
})
|
||||
},
|
||||
/*初始化任务列表,禁止点击*/
|
||||
iniTaskItemDisabled() {
|
||||
$('li[data-type="taskItem"]').each(function () {
|
||||
$(this).find('label > input[type="checkbox"]').prop('disabled', true)
|
||||
})
|
||||
},
|
||||
/* 激活登录窗口下拉框功能 */
|
||||
initLogonMenu() {
|
||||
$('.navbar-logon').each(function (index, item) {
|
||||
@ -365,7 +371,7 @@ const commonContext = {
|
||||
}
|
||||
const grt = new Date(loveTime)
|
||||
setInterval(function () {
|
||||
let now= Date.now()
|
||||
let now = Date.now()
|
||||
let difference = parseInt((now - grt) / 1000)
|
||||
let seconds = difference % 60
|
||||
difference = parseInt(difference / 60)
|
||||
@ -612,7 +618,7 @@ let timeLifeHour = -1
|
||||
|
||||
!(function () {
|
||||
const loads = ['initCarousel', 'sparkInput', 'websiteTime']
|
||||
const omits = ['initEffects', 'showThemeVersion']
|
||||
const omits = ['initEffects', 'showThemeVersion', 'iniTaskItemDisabled']
|
||||
|
||||
Object.keys(commonContext).forEach(
|
||||
(c) => !loads.includes(c) && !omits.includes(c) && commonContext[c]()
|
||||
|
@ -175,6 +175,8 @@ $(document).on('pjax:success', async function (event, data, status, xhr, options
|
||||
window.postPjax && window.postPjax(serialNumber)
|
||||
/* 刷新人生倒计时 */
|
||||
commonContext.initTimeCount()
|
||||
/* 初始化任务列表,禁止点击 */
|
||||
commonContext.iniTaskItemDisabled()
|
||||
/* 初始化轮播 */
|
||||
commonContext.initCarousel()
|
||||
window.DProgress && DProgress.done()
|
||||
@ -209,6 +211,8 @@ $(document).on('pjax:end', function (event, xhr, options) {
|
||||
commonContext.initCarousel()
|
||||
/* 刷新人生倒计时 */
|
||||
commonContext.initTimeCount()
|
||||
/* 初始化任务列表,禁止点击 */
|
||||
commonContext.iniTaskItemDisabled()
|
||||
window.DProgress && DProgress.done()
|
||||
// 应该是由于浏览器缓存失效,有时候浏览器前后退还是会执行pjax:beforeSend
|
||||
$('html').removeClass('pjax-loading')
|
||||
|
2
templates/assets/css/style.min.css
vendored
2
templates/assets/css/style.min.css
vendored
File diff suppressed because one or more lines are too long
4
templates/assets/js/common.min.js
vendored
4
templates/assets/js/common.min.js
vendored
File diff suppressed because one or more lines are too long
2
templates/assets/js/pjax.min.js
vendored
2
templates/assets/js/pjax.min.js
vendored
@ -1 +1 @@
|
||||
(()=>{const i=new Set($('link[href*=".css"]').map((o,e)=>$(e).attr("href")).get()),l=new Set($('script[src*=".js"]').map((o,e)=>$(e).attr("src")).get()),e=()=>{var o=(new Date).getTime();return window.pjaxSerialNumber=o,console.log("sn = "+o),o},n=o=>"/"!==o.pathname&&0!==$(".banner").length?(window.initTop=99999999,window.innerHeight/4):0,c=(e,n,t)=>{if(n>=e.length)t&&t();else{let o=$(e[n]).attr("src");l.has(o)?c(e,n+1,t):(console.log((t?"同步":"异步")+"顺序加载js "+o),Utils.cachedScript(o).done(function(){console.log((t?"同步":"异步")+"顺序加载js完成 "+o),l.add(o),window.DProgress&&DProgress.inc(),c(e,n+1,t)}).fail(function(){console.log((t?"同步":"异步")+"顺序加载js失败 "+o),c(e,n+1,t)}))}};$(document).on("click","a[target!=_blank][href]:not([data-not-pjax])",o=>{$.pjax.click(o,".column-main",{scrollTo:n(o.currentTarget),fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:n(o.currentTarget),fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("pjax:click",function(o,e){console.log("------------------------"),console.log("pjax:click sn = "+e.serialNumber)}),$(document).on("pjax:beforeSend",function(o,e,n){console.log("pjax:beforeSend sn = "+n.serialNumber),$("html").addClass("pjax-loading")}),$(document).on("pjax:start",function(o,e,n){console.log("pjax:start sn = "+n.serialNumber),window.DProgress&&DProgress.start(),$(".pjax-close").remove()}),$(document).on("pjax:send",function(o,e,n){console.log("pjax:send sn = "+n.serialNumber)}),$(document).on("pjax:clicked",function(o,e){console.log("pjax:clicked sn = "+e.serialNumber)}),$(document).on("pjax:beforeReplace",function(o,e,n){console.log("pjax:beforeReplace sn = "+n.serialNumber),$(".navbar-nav .current,.panel-side-menu .current").removeClass("current"),commonContext.initNavbar(),0<$("html.disable-scroll").length&&$(".navbar-mask").trigger("click")}),$(document).on("pjax:success",async function(o,e,n,t,a){a=a.serialNumber;if(console.log("pjax:success sn = "+a),window.pjaxSerialNumber===a){commonContext.initGallery(),commonContext.initTocAndNotice(),$("html").removeClass("pjax-loading");const r=$($.parseHTML(e,document,!0)),s=$("head");s.find("meta").remove(),s.find('link[rel="canonical"]').remove(),s.append(r.filter("meta")),s.append(r.filter('link[rel="canonical"]')),r.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");i.has(o)||(s.append($(this)),console.log("加载css "+$(this).attr("href")),this.onload=function(){i.add(o),window.DProgress&&DProgress.inc(),console.log("加载css完成 "+$(this).attr("href"))})});let o=r.filter("script[data-pjax]");if(0<o.length){o.filter("[async]").each(function(){let o=$(this).attr("src");l.has(o)||(console.log("异步无序加载js "+o),Utils.cachedScript(o).done(function(){console.log("异步无序js完成 "+o),window.DProgress&&DProgress.inc(),l.add(o)}).fail(function(){console.log("异步无序js失败 "+o)}))}),new Promise(()=>{c(o.filter("[defer]"),0)});let e=o.filter(":not([async]):not([defer])");0<e.length&&await new Promise(o=>{c(e,0,o)})}console.log("全部处理完成"),window.pjaxSerialNumber===a&&(window.journalPjax&&window.journalPjax(a),window.postPjax&&window.postPjax(a),commonContext.initTimeCount(),commonContext.initCarousel(),window.DProgress)&&DProgress.done()}}),$(document).on("pjax:timeout",function(o,e,n){console.log("pjax:timeout sn = "+n.serialNumber)}),$(document).on("pjax:error",function(o,e,n,t,a){console.log(`pjax:error sn = ${a.serialNumber} error `+t)}),$(document).on("pjax:complete",function(o,e,n,t){console.log("pjax:complete sn = "+t.serialNumber)}),$(document).on("pjax:end",function(o,e,n){console.log("pjax:end sn = "+n.serialNumber),null==e&&(commonContext.initTocAndNotice(),commonContext.initCarousel(),commonContext.initTimeCount(),window.DProgress&&DProgress.done(),$("html").removeClass("pjax-loading"))}),$(document).on("pjax:popstate",function(o){console.log("pjax:popstate")})})();
|
||||
(()=>{const i=new Set($('link[href*=".css"]').map((o,e)=>$(e).attr("href")).get()),l=new Set($('script[src*=".js"]').map((o,e)=>$(e).attr("src")).get()),e=()=>{var o=(new Date).getTime();return window.pjaxSerialNumber=o,console.log("sn = "+o),o},n=o=>"/"!==o.pathname&&0!==$(".banner").length?(window.initTop=99999999,window.innerHeight/4):0,c=(e,n,t)=>{if(n>=e.length)t&&t();else{let o=$(e[n]).attr("src");l.has(o)?c(e,n+1,t):(console.log((t?"同步":"异步")+"顺序加载js "+o),Utils.cachedScript(o).done(function(){console.log((t?"同步":"异步")+"顺序加载js完成 "+o),l.add(o),window.DProgress&&DProgress.inc(),c(e,n+1,t)}).fail(function(){console.log((t?"同步":"异步")+"顺序加载js失败 "+o),c(e,n+1,t)}))}};$(document).on("click","a[target!=_blank][href]:not([data-not-pjax])",o=>{$.pjax.click(o,".column-main",{scrollTo:n(o.currentTarget),fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:n(o.currentTarget),fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("pjax:click",function(o,e){console.log("------------------------"),console.log("pjax:click sn = "+e.serialNumber)}),$(document).on("pjax:beforeSend",function(o,e,n){console.log("pjax:beforeSend sn = "+n.serialNumber),$("html").addClass("pjax-loading")}),$(document).on("pjax:start",function(o,e,n){console.log("pjax:start sn = "+n.serialNumber),window.DProgress&&DProgress.start(),$(".pjax-close").remove()}),$(document).on("pjax:send",function(o,e,n){console.log("pjax:send sn = "+n.serialNumber)}),$(document).on("pjax:clicked",function(o,e){console.log("pjax:clicked sn = "+e.serialNumber)}),$(document).on("pjax:beforeReplace",function(o,e,n){console.log("pjax:beforeReplace sn = "+n.serialNumber),$(".navbar-nav .current,.panel-side-menu .current").removeClass("current"),commonContext.initNavbar(),0<$("html.disable-scroll").length&&$(".navbar-mask").trigger("click")}),$(document).on("pjax:success",async function(o,e,n,t,a){a=a.serialNumber;if(console.log("pjax:success sn = "+a),window.pjaxSerialNumber===a){commonContext.initGallery(),commonContext.initTocAndNotice(),$("html").removeClass("pjax-loading");const s=$($.parseHTML(e,document,!0)),r=$("head");r.find("meta").remove(),r.find('link[rel="canonical"]').remove(),r.append(s.filter("meta")),r.append(s.filter('link[rel="canonical"]')),s.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");i.has(o)||(r.append($(this)),console.log("加载css "+$(this).attr("href")),this.onload=function(){i.add(o),window.DProgress&&DProgress.inc(),console.log("加载css完成 "+$(this).attr("href"))})});let o=s.filter("script[data-pjax]");if(0<o.length){o.filter("[async]").each(function(){let o=$(this).attr("src");l.has(o)||(console.log("异步无序加载js "+o),Utils.cachedScript(o).done(function(){console.log("异步无序js完成 "+o),window.DProgress&&DProgress.inc(),l.add(o)}).fail(function(){console.log("异步无序js失败 "+o)}))}),new Promise(()=>{c(o.filter("[defer]"),0)});let e=o.filter(":not([async]):not([defer])");0<e.length&&await new Promise(o=>{c(e,0,o)})}console.log("全部处理完成"),window.pjaxSerialNumber===a&&(window.journalPjax&&window.journalPjax(a),window.postPjax&&window.postPjax(a),commonContext.initTimeCount(),commonContext.iniTaskItemDisabled(),commonContext.initCarousel(),window.DProgress)&&DProgress.done()}}),$(document).on("pjax:timeout",function(o,e,n){console.log("pjax:timeout sn = "+n.serialNumber)}),$(document).on("pjax:error",function(o,e,n,t,a){console.log(`pjax:error sn = ${a.serialNumber} error `+t)}),$(document).on("pjax:complete",function(o,e,n,t){console.log("pjax:complete sn = "+t.serialNumber)}),$(document).on("pjax:end",function(o,e,n){console.log("pjax:end sn = "+n.serialNumber),null==e&&(commonContext.initTocAndNotice(),commonContext.initCarousel(),commonContext.initTimeCount(),commonContext.iniTaskItemDisabled(),window.DProgress&&DProgress.done(),$("html").removeClass("pjax-loading"))}),$(document).on("pjax:popstate",function(o){console.log("pjax:popstate")})})();
|
@ -30,7 +30,7 @@ spec:
|
||||
settingName: theme-dream2-plus-setting
|
||||
configMapName: theme-dream2-plus-configMap
|
||||
# 版本号
|
||||
version: 1.3.3.beta2
|
||||
version: 1.3.3.beta3
|
||||
# 最低支持的 Halo 版本
|
||||
require: ">=2.20.0"
|
||||
# 许可
|
||||
|
Loading…
x
Reference in New Issue
Block a user