feat: upgrade to version 4.1.6

pull/582/head v4.1.6
Seaton Jiang 2023-03-12 18:10:23 +08:00
parent b0fd30c2d7
commit 0905b89f87
No known key found for this signature in database
GPG Key ID: B79682F6FE8D30E3
4 changed files with 1556 additions and 1517 deletions

View File

@ -2,105 +2,109 @@
* Kratos
* Seaton Jiang <hi@seatonjiang.com>
*/
; (function () {
'use strict'
(function () {
"use strict";
var KRATOS_VERSION = '4.1.5'
var KRATOS_VERSION = "4.1.6";
var navbarConfig = function () {
$('#navbutton').on('click', function () {
$('.navbar-toggler').toggleClass('nav-close')
})
}
$("#navbutton").on("click", function () {
$(".navbar-toggler").toggleClass("nav-close");
});
};
var tooltipConfig = function () {
$('[data-toggle="tooltip"]').tooltip()
}
$('[data-toggle="tooltip"]').tooltip();
};
var gotopConfig = function () {
$(window).on('load', function () {
var $win = $(window)
$(window).on("load", function () {
var $win = $(window);
var setShowOrHide = function () {
if ($win.scrollTop() > 200) {
$('.gotop').addClass('active')
$(".gotop").addClass("active");
} else {
$('.gotop').removeClass('active')
}
}
setShowOrHide()
$win.scroll(setShowOrHide)
})
$('.gotop').on('click', function (event) {
event.preventDefault()
$('html, body').animate({ scrollTop: $('html').offset().top }, 500)
return false
})
$(".gotop").removeClass("active");
}
};
setShowOrHide();
$win.scroll(setShowOrHide);
});
$(".gotop").on("click", function (event) {
event.preventDefault();
$("html, body").animate({ scrollTop: $("html").offset().top }, 500);
return false;
});
};
var searchConfig = function () {
$('.search').on('click', function (e) {
$('.search-form').animate({ width: '200px' }, 200)
$('.search-form input').css('display', 'block')
$(document).one('click', function () {
$('.search-form').animate({ width: '0' }, 100)
$('.search-form input').hide()
})
e.stopPropagation()
})
$('.search-form').on('click', function (e) {
e.stopPropagation()
})
}
$(".search").on("click", function (e) {
$(".search-form").animate({ width: "200px" }, 200);
$(".search-form input").css("display", "block");
$(document).one("click", function () {
$(".search-form").animate({ width: "0" }, 100);
$(".search-form input").hide();
});
e.stopPropagation();
});
$(".search-form").on("click", function (e) {
e.stopPropagation();
});
};
var wechatConfig = function () {
$('.wechat').mouseout(function () {
$('.wechat-pic')[0].style.display = 'none'
})
$('.wechat').mouseover(function () {
$('.wechat-pic')[0].style.display = 'block'
})
}
$(".wechat").mouseout(function () {
$(".wechat-pic")[0].style.display = "none";
});
$(".wechat").mouseover(function () {
$(".wechat-pic")[0].style.display = "block";
});
};
var smiliesConfig = function () {
$('#addsmile').on('click', function (e) {
$('.smile').toggleClass('open')
$(document).one('click', function () {
$('.smile').toggleClass('open')
})
e.stopPropagation()
return false
})
}
$("#addsmile").on("click", function (e) {
$(".smile").toggleClass("open");
$(document).one("click", function () {
$(".smile").toggleClass("open");
});
e.stopPropagation();
return false;
});
};
var postlikeConfig = function () {
$.fn.postLike = function () {
if ($(this).hasClass('done')) {
layer.msg(kratos.repeat, function () {})
return false
if ($(this).hasClass("done")) {
layer.msg(kratos.repeat, function () {});
return false;
} else {
$(this).addClass('done')
layer.msg(kratos.thanks)
var id = $(this).data('id'),
action = $(this).data('action')
$(this).addClass("done");
layer.msg(kratos.thanks);
var id = $(this).data("id"),
action = $(this).data("action");
var ajax_data = {
action: 'love',
action: "love",
um_id: id,
um_action: action
}
$.post(kratos.site + '/wp-admin/admin-ajax.php', ajax_data, function (data) { })
return false
}
}
$(document).on('click', '.btn-thumbs', function () {
$(this).postLike()
})
um_action: action,
};
$.post(
kratos.site + "/wp-admin/admin-ajax.php",
ajax_data,
function (data) {}
);
return false;
}
};
$(document).on("click", ".btn-thumbs", function () {
$(this).postLike();
});
};
var donateConfig = function () {
$('#donate').on('click', function () {
$("#donate").on("click", function () {
layer.open({
type: 1,
area: ['300px', '370px'],
area: ["300px", "370px"],
title: kratos.donate,
resize: false,
scrollbar: false,
@ -115,86 +119,97 @@
kratos.directory +
'/assets/img/payment/alipay.png"></label><input id="wechatpay" type="radio" name="pay-method"><label for="wechatpay" class="pay-button"><img src="' +
kratos.directory +
'/assets/img/payment/wechat.png"></label></div></div>'
})
'/assets/img/payment/wechat.png"></label></div></div>',
});
$('.choose-pay input[type="radio"]').click(function () {
var id = $(this).attr('id')
if (id == 'alipay') {
$('.qr-pay #alipay_qr').removeClass('d-none')
$('.qr-pay #wechat_qr').addClass('d-none')
var id = $(this).attr("id");
if (id == "alipay") {
$(".qr-pay #alipay_qr").removeClass("d-none");
$(".qr-pay #wechat_qr").addClass("d-none");
}
if (id == 'wechatpay') {
$('.qr-pay #alipay_qr').addClass('d-none')
$('.qr-pay #wechat_qr').removeClass('d-none')
}
})
})
if (id == "wechatpay") {
$(".qr-pay #alipay_qr").addClass("d-none");
$(".qr-pay #wechat_qr").removeClass("d-none");
}
});
});
};
var accordionConfig = function () {
$(document).on('click', '.acheader', function (event) {
var $this = $(this)
$this.closest('.accordion').find('.contents').slideToggle(300)
if ($this.closest('.accordion').hasClass('active')) {
$this.closest('.accordion').removeClass('active')
$(document).on("click", ".acheader", function (event) {
var $this = $(this);
$this.closest(".accordion").find(".contents").slideToggle(300);
if ($this.closest(".accordion").hasClass("active")) {
$this.closest(".accordion").removeClass("active");
} else {
$this.closest('.accordion').addClass('active')
}
event.preventDefault()
})
$this.closest(".accordion").addClass("active");
}
event.preventDefault();
});
};
var consoleConfig = function () {
console.log('\n Kratos v' + KRATOS_VERSION + '\n\n https://github.com/seatonjiang/kratos \n\n')
}
console.log(
"\n Kratos v" +
KRATOS_VERSION +
"\n\n https://github.com/seatonjiang/kratos \n\n"
);
};
var lightGalleryConfig = function () {
if (kratos.lightgallery === '1' && window.lightGallery !== undefined) {
lightGallery(document.getElementById('lightgallery'), {
selector: 'a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"], a[href$=".gif"], a[href$=".bmp"], a[href$=".webp"]'
})
}
}
document.addEventListener('DOMContentLoaded', function () {
accordionConfig()
navbarConfig()
tooltipConfig()
gotopConfig()
searchConfig()
wechatConfig()
smiliesConfig()
postlikeConfig()
donateConfig()
consoleConfig()
lightGalleryConfig()
if (kratos.lightgallery === "1" && window.lightGallery !== undefined) {
lightGallery(document.getElementById("lightgallery"), {
selector:
'a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"], a[href$=".gif"], a[href$=".bmp"], a[href$=".webp"]',
});
})()
}
};
document.addEventListener("DOMContentLoaded", function () {
accordionConfig();
navbarConfig();
tooltipConfig();
gotopConfig();
searchConfig();
wechatConfig();
smiliesConfig();
postlikeConfig();
donateConfig();
consoleConfig();
lightGalleryConfig();
});
})();
function grin(tag) {
var myField
tag = ' ' + tag + ' '
if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') {
myField = document.getElementById('comment')
var myField;
tag = " " + tag + " ";
if (
document.getElementById("comment") &&
document.getElementById("comment").type == "textarea"
) {
myField = document.getElementById("comment");
} else {
return false
return false;
}
if (document.selection) {
myField.focus()
sel = document.selection.createRange()
sel.text = tag
myField.focus()
} else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart
var endPos = myField.selectionEnd
var cursorPos = endPos
myField.value = myField.value.substring(0, startPos) + tag + myField.value.substring(endPos, myField.value.length)
cursorPos += tag.length
myField.focus()
myField.selectionStart = cursorPos
myField.selectionEnd = cursorPos
myField.focus();
sel = document.selection.createRange();
sel.text = tag;
myField.focus();
} else if (myField.selectionStart || myField.selectionStart == "0") {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
var cursorPos = endPos;
myField.value =
myField.value.substring(0, startPos) +
tag +
myField.value.substring(endPos, myField.value.length);
cursorPos += tag.length;
myField.focus();
myField.selectionStart = cursorPos;
myField.selectionEnd = cursorPos;
} else {
myField.value += tag
myField.focus()
myField.value += tag;
myField.focus();
}
}

View File

@ -10,7 +10,7 @@ if (defined('WP_USE_THEMES') && WP_USE_THEMES === false) {
* @version 2022.11.27
*/
define('THEME_VERSION', '4.1.5');
define('THEME_VERSION', '4.1.6');
// 主题配置
require get_template_directory() . '/inc/codestar-framework/autoload.php';

View File

@ -1,5 +1,5 @@
{
"version": "4.1.5",
"details_url": "https://github.com/seatonjiang/kratos/releases/tag/v4.1.5",
"download_url": "https://cdn.seatonjiang.com/kratos/v4.1.5.zip"
"version": "4.1.6",
"details_url": "https://github.com/seatonjiang/kratos/releases/tag/v4.1.6",
"download_url": "https://cdn.seatonjiang.com/kratos/v4.1.6.zip"
}

View File

@ -2,7 +2,7 @@
/*
Theme Name: Kratos
Text Domain: kratos
Version: 4.1.5
Version: 4.1.6
Requires PHP: 7.4
Description:
Tags: , , , , , , , , , , , , ,
@ -42,7 +42,8 @@ body {
background: #f5f5f5;
font-weight: 350;
font-size: 16px;
font-family: -apple-system, BlinkMacSystemFont, opensans, Optima, 'Microsoft Yahei', sans-serif;
font-family: -apple-system, BlinkMacSystemFont, opensans, Optima,
"Microsoft Yahei", sans-serif;
line-height: 1.8;
}
@ -322,7 +323,7 @@ button:focus {
border-right: 0;
border-bottom: 0;
border-left: 0;
content: '\e62e';
content: "\e62e";
vertical-align: unset;
font-size: 16px;
font-family: kicon;
@ -402,7 +403,6 @@ button:focus {
}
@media screen and (max-width: 992px) {
.navbar-light .navbar-nav .dropdown-menu,
.navbar-light .navbar-nav .dropdown-item.active,
.navbar-light .navbar-nav .dropdown-item:active,
@ -717,7 +717,7 @@ ol {
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-left: 4px solid #00a2ff;
content: '';
content: "";
vertical-align: top;
}
@ -939,7 +939,7 @@ ol {
margin-right: 5px;
margin-left: 5px;
color: #71777c;
content: '\B7';
content: "\B7";
}
.k-main .details .article .content {
@ -957,7 +957,7 @@ ol {
.k-main .details .article .content p::after {
clear: both;
display: block;
content: '';
content: "";
}
.k-main .details .article .content h2,
@ -1127,7 +1127,7 @@ ol {
.k-main .details .article .content .alignright::after {
clear: both;
display: block;
content: '';
content: "";
}
.k-main .details .article .content .alignleft {
@ -1728,7 +1728,15 @@ ol {
padding-top: 4.8px;
}
.k-main .details .comments .comment-respond .comment-textarea .text-bar .tool a img {
.k-main
.details
.comments
.comment-respond
.comment-textarea
.text-bar
.tool
a
img {
width: 100%;
}
@ -1749,7 +1757,12 @@ ol {
color: #333333;
}
.k-main .details .comments .comment-respond .comment-textarea #cancel-comment-reply-link {
.k-main
.details
.comments
.comment-respond
.comment-textarea
#cancel-comment-reply-link {
display: inline-block;
padding: 6px 12px;
border: none;
@ -1778,7 +1791,14 @@ ol {
transform-origin: 50% 0;
}
.k-main .details .comments .comment-respond .comment-textarea .text-bar .smile a {
.k-main
.details
.comments
.comment-respond
.comment-textarea
.text-bar
.smile
a {
float: left;
display: block;
padding: 4px;
@ -1959,7 +1979,7 @@ ol {
width: 72px;
height: 2px;
background-color: #00a2ff;
content: '';
content: "";
}
.k-main .sidebar .w-tags .item a {
@ -2207,7 +2227,7 @@ ol {
border: 2px solid #00a2ff;
border-radius: 15px;
background-color: #fff;
content: '';
content: "";
}
.k-main .sidebar .w-toc .item .ul-toc::before {
@ -2247,7 +2267,7 @@ ol {
border: 3px solid #fff;
border-radius: 15px;
background: #a7a7a7;
content: '';
content: "";
}
.k-main .sidebar .w-toc .item .li-1::before {
@ -2327,7 +2347,7 @@ ol {
width: 20px;
height: 100%;
background: #ffffff;
content: '';
content: "";
}
.k-main .page404 .overlay:before {
@ -2388,7 +2408,11 @@ ol {
}
.k-main .page404 .content .action .back-index:hover,
.k-main .page404 .content .action .back-index:not(:disabled):not(.disabled):active {
.k-main
.page404
.content
.action
.back-index:not(:disabled):not(.disabled):active {
border-color: #d8dcdf;
background-color: #f6f4f4;
color: #666;