feat: upgrade to version 3.2.1

pull/331/head v3.2.1
Seaton Jiang 2020-10-26 13:49:44 +08:00
parent c011ffe5fe
commit a1708f792a
No known key found for this signature in database
GPG Key ID: C1086BAE716FF138
5 changed files with 213 additions and 177 deletions

View File

@ -1,5 +1,5 @@
<p align="center">
<img src="https://cdn.jsdelivr.net/gh/vtrois/kratos@3.2.0/assets/img/options/about.png">
<img src="https://cdn.jsdelivr.net/gh/vtrois/kratos@3.2.1/assets/img/options/about.png">
</p>
<p align="center">
@ -131,7 +131,7 @@ Detailed changes for each release are documented in the [release notes](https://
If you find Kratos useful, you can buy us a cup of coffee
<p align="center">
<img width="700" src="https://cdn.jsdelivr.net/gh/vtrois/kratos@3.2.0/assets/img/options/donate.png">
<img width="700" src="https://cdn.jsdelivr.net/gh/vtrois/kratos@3.2.1/assets/img/options/donate.png">
</p>
## License

View File

@ -2,186 +2,222 @@
* Kratos
* Seaton Jiang <seaton@vtrois.com>
*/
; (function () {
'use strict'
(function () {
"use strict";
var KRATOS_VERSION = '3.2.0'
var KRATOS_VERSION = "3.2.1";
var navbarConfig = function () {
$('#navbutton').on('click', function () {
$('.navbar-toggler').toggleClass('nav-close')
})
}
var navbarConfig = function () {
$("#navbutton").on("click", function () {
$(".navbar-toggler").toggleClass("nav-close");
});
};
var tooltipConfig = function () {
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
}
var tooltipConfig = function () {
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});
};
var gotopConfig = function () {
$(window).on('load', function () {
var $win = $(window)
if ($win.scrollTop() > 200) {
$('.gotop').addClass('active')
} else {
$('.gotop').removeClass('active')
}
$win.scroll(function () {
if ($win.scrollTop() > 200) {
$('.gotop').addClass('active')
} else {
$('.gotop').removeClass('active')
}
})
})
$('.gotop').on('click', function (event) {
event.preventDefault()
$('html, body').animate({
scrollTop: $('html').offset().top
}, 500)
return false
})
}
var gotopConfig = function () {
$(window).on("load", function () {
var $win = $(window);
if ($win.scrollTop() > 200) {
$(".gotop").addClass("active");
} else {
$(".gotop").removeClass("active");
}
$win.scroll(function () {
if ($win.scrollTop() > 200) {
$(".gotop").addClass("active");
} else {
$(".gotop").removeClass("active");
}
});
});
$(".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()
})
}
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();
});
};
var wechatConfig = function () {
$('.wechat').mouseout(function () {
$('.wechat-pic')[0].style.display = 'none'
})
$('.wechat').mouseover(function () {
$('.wechat-pic')[0].style.display = 'block'
})
}
var wechatConfig = function () {
$(".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
})
}
var smiliesConfig = function () {
$("#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
} else {
$(this).addClass('done')
layer.msg(kratos.thanks)
var id = $(this).data("id"),
action = $(this).data('action')
var ajax_data = {
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()
})
}
var postlikeConfig = function () {
$.fn.postLike = function () {
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");
var ajax_data = {
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();
});
};
var donateConfig = function () {
$("#donate").on('click', function () {
layer.open({
type: 1,
area: ['300px', '370px'],
title: kratos.donate,
resize: false,
scrollbar: false,
content: '<div class="donate-box"><div class="meta-pay text-center my-2"><strong>' + kratos.scan + '</strong></div><div class="qr-pay text-center"><img class="pay-img" id="alipay_qr" src="' + kratos.alipay + '"><img class="pay-img d-none" id="wechat_qr" src="' + kratos.wechat + '"></div><div class="choose-pay text-center mt-2"><input id="alipay" type="radio" name="pay-method" checked><label for="alipay" class="pay-button"><img src="' + 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>'
})
$(".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') };
if (id == 'wechatpay') { $(".qr-pay #alipay_qr").addClass('d-none'); $(".qr-pay #wechat_qr").removeClass('d-none') };
})
})
}
var donateConfig = function () {
$("#donate").on("click", function () {
layer.open({
type: 1,
area: ["300px", "370px"],
title: kratos.donate,
resize: false,
scrollbar: false,
content:
'<div class="donate-box"><div class="meta-pay text-center my-2"><strong>' +
kratos.scan +
'</strong></div><div class="qr-pay text-center"><img class="pay-img" id="alipay_qr" src="' +
kratos.alipay +
'"><img class="pay-img d-none" id="wechat_qr" src="' +
kratos.wechat +
'"></div><div class="choose-pay text-center mt-2"><input id="alipay" type="radio" name="pay-method" checked><label for="alipay" class="pay-button"><img src="' +
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>',
});
$(".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");
}
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')
} else {
$this.closest('.accordion').addClass('active')
}
event.preventDefault()
})
}
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");
} else {
$this.closest(".accordion").addClass("active");
}
event.preventDefault();
});
};
var consoleConfig = function () {
console.log('\n Kratos v' + KRATOS_VERSION + '\n\n https://github.com/vtrois/kratos \n\n')
}
var consoleConfig = function () {
console.log(
"\n Kratos v" +
KRATOS_VERSION +
"\n\n https://github.com/vtrois/kratos \n\n"
);
};
$(function () {
accordionConfig()
navbarConfig()
tooltipConfig()
gotopConfig()
searchConfig()
wechatConfig()
smiliesConfig()
postlikeConfig()
donateConfig()
consoleConfig()
})
}())
$(function () {
accordionConfig();
navbarConfig();
tooltipConfig();
gotopConfig();
searchConfig();
wechatConfig();
smiliesConfig();
postlikeConfig();
donateConfig();
consoleConfig();
});
})();
function grin (tag) {
var myField
tag = ' ' + tag + ' '
if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') {
myField = document.getElementById('comment')
} else {
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
}
else {
myField.value += tag
myField.focus()
}
}
function grin(tag) {
var myField;
tag = " " + tag + " ";
if (
document.getElementById("comment") &&
document.getElementById("comment").type == "textarea"
) {
myField = document.getElementById("comment");
} else {
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;
} else {
myField.value += tag;
myField.focus();
}
}

View File

@ -1 +1 @@
function grin (t) { var o; if (t = " " + t + " ", !document.getElementById("comment") || "textarea" != document.getElementById("comment").type) return !1; if (o = document.getElementById("comment"), document.selection) o.focus(), sel = document.selection.createRange(), sel.text = t, o.focus(); else if (o.selectionStart || "0" == o.selectionStart) { var e = o.selectionStart, a = o.selectionEnd, n = a; o.value = o.value.substring(0, e) + t + o.value.substring(a, o.value.length), n += t.length, o.focus(), o.selectionStart = n, o.selectionEnd = n } else o.value += t, o.focus() } (function () { "use strict"; var t = "3.2.0", o = function () { $("#navbutton").on("click", function () { $(".navbar-toggler").toggleClass("nav-close") }) }, e = function () { $(function () { $('[data-toggle="tooltip"]').tooltip() }) }, a = function () { $(window).on("load", function () { var t = $(window); t.scrollTop() > 200 ? $(".gotop").addClass("active") : $(".gotop").removeClass("active"), t.scroll(function () { t.scrollTop() > 200 ? $(".gotop").addClass("active") : $(".gotop").removeClass("active") }) }), $(".gotop").on("click", function (t) { return t.preventDefault(), $("html, body").animate({ scrollTop: $("html").offset().top }, 500), !1 }) }, n = function () { $(".search").on("click", function (t) { $(".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() }), t.stopPropagation() }), $(".search-form").on("click", function (t) { t.stopPropagation() }) }, c = function () { $(".wechat").mouseout(function () { $(".wechat-pic")[0].style.display = "none" }), $(".wechat").mouseover(function () { $(".wechat-pic")[0].style.display = "block" }) }, s = function () { $("#addsmile").on("click", function (t) { return $(".smile").toggleClass("open"), $(document).one("click", function () { $(".smile").toggleClass("open") }), t.stopPropagation(), !1 }) }, i = function () { $.fn.postLike = function () { if ($(this).hasClass("done")) return layer.msg(kratos.repeat, function () { }), !1; $(this).addClass("done"), layer.msg(kratos.thanks); var t = $(this).data("id"), o = $(this).data("action"), e = { action: "love", um_id: t, um_action: o }; return $.post(kratos.site + "/wp-admin/admin-ajax.php", e, function (t) { }), !1 }, $(document).on("click", ".btn-thumbs", function () { $(this).postLike() }) }, l = function () { $("#donate").on("click", function () { layer.open({ type: 1, area: ["300px", "370px"], title: kratos.donate, resize: !1, scrollbar: !1, content: '<div class="donate-box"><div class="meta-pay text-center my-2"><strong>' + kratos.scan + '</strong></div><div class="qr-pay text-center"><img class="pay-img" id="alipay_qr" src="' + kratos.alipay + '"><img class="pay-img d-none" id="wechat_qr" src="' + kratos.wechat + '"></div><div class="choose-pay text-center mt-2"><input id="alipay" type="radio" name="pay-method" checked><label for="alipay" class="pay-button"><img src="' + 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>' }), $(".choose-pay input[type='radio']").click(function () { var t = $(this).attr("id"); "alipay" == t && ($(".qr-pay #alipay_qr").removeClass("d-none"), $(".qr-pay #wechat_qr").addClass("d-none")), "wechatpay" == t && ($(".qr-pay #alipay_qr").addClass("d-none"), $(".qr-pay #wechat_qr").removeClass("d-none")) }) }) }, r = function () { $(document).on("click", ".acheader", function (t) { var o = $(this); o.closest(".accordion").find(".contents").slideToggle(300), o.closest(".accordion").hasClass("active") ? o.closest(".accordion").removeClass("active") : o.closest(".accordion").addClass("active"), t.preventDefault() }) }, d = function () { console.log("\n Kratos v" + t + "\n\n https://github.com/vtrois/kratos \n\n") }; $(function () { r(), o(), e(), a(), n(), c(), s(), i(), l(), d() }) })()
function grin (t) { var o; if (t = " " + t + " ", !document.getElementById("comment") || "textarea" != document.getElementById("comment").type) return !1; if (o = document.getElementById("comment"), document.selection) o.focus(), sel = document.selection.createRange(), sel.text = t, o.focus(); else if (o.selectionStart || "0" == o.selectionStart) { var e = o.selectionStart, a = o.selectionEnd, n = a; o.value = o.value.substring(0, e) + t + o.value.substring(a, o.value.length), n += t.length, o.focus(), o.selectionStart = n, o.selectionEnd = n } else o.value += t, o.focus() } (function () { "use strict"; var t = "3.2.1", o = function () { $("#navbutton").on("click", function () { $(".navbar-toggler").toggleClass("nav-close") }) }, e = function () { $(function () { $('[data-toggle="tooltip"]').tooltip() }) }, a = function () { $(window).on("load", function () { var t = $(window); t.scrollTop() > 200 ? $(".gotop").addClass("active") : $(".gotop").removeClass("active"), t.scroll(function () { t.scrollTop() > 200 ? $(".gotop").addClass("active") : $(".gotop").removeClass("active") }) }), $(".gotop").on("click", function (t) { return t.preventDefault(), $("html, body").animate({ scrollTop: $("html").offset().top }, 500), !1 }) }, n = function () { $(".search").on("click", function (t) { $(".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() }), t.stopPropagation() }), $(".search-form").on("click", function (t) { t.stopPropagation() }) }, c = function () { $(".wechat").mouseout(function () { $(".wechat-pic")[0].style.display = "none" }), $(".wechat").mouseover(function () { $(".wechat-pic")[0].style.display = "block" }) }, s = function () { $("#addsmile").on("click", function (t) { return $(".smile").toggleClass("open"), $(document).one("click", function () { $(".smile").toggleClass("open") }), t.stopPropagation(), !1 }) }, i = function () { $.fn.postLike = function () { if ($(this).hasClass("done")) return layer.msg(kratos.repeat, function () { }), !1; $(this).addClass("done"), layer.msg(kratos.thanks); var t = $(this).data("id"), o = $(this).data("action"), e = { action: "love", um_id: t, um_action: o }; return $.post(kratos.site + "/wp-admin/admin-ajax.php", e, function (t) { }), !1 }, $(document).on("click", ".btn-thumbs", function () { $(this).postLike() }) }, l = function () { $("#donate").on("click", function () { layer.open({ type: 1, area: ["300px", "370px"], title: kratos.donate, resize: !1, scrollbar: !1, content: '<div class="donate-box"><div class="meta-pay text-center my-2"><strong>' + kratos.scan + '</strong></div><div class="qr-pay text-center"><img class="pay-img" id="alipay_qr" src="' + kratos.alipay + '"><img class="pay-img d-none" id="wechat_qr" src="' + kratos.wechat + '"></div><div class="choose-pay text-center mt-2"><input id="alipay" type="radio" name="pay-method" checked><label for="alipay" class="pay-button"><img src="' + 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>' }), $(".choose-pay input[type='radio']").click(function () { var t = $(this).attr("id"); "alipay" == t && ($(".qr-pay #alipay_qr").removeClass("d-none"), $(".qr-pay #wechat_qr").addClass("d-none")), "wechatpay" == t && ($(".qr-pay #alipay_qr").addClass("d-none"), $(".qr-pay #wechat_qr").removeClass("d-none")) }) }) }, r = function () { $(document).on("click", ".acheader", function (t) { var o = $(this); o.closest(".accordion").find(".contents").slideToggle(300), o.closest(".accordion").hasClass("active") ? o.closest(".accordion").removeClass("active") : o.closest(".accordion").addClass("active"), t.preventDefault() }) }, d = function () { console.log("\n Kratos v" + t + "\n\n https://github.com/vtrois/kratos \n\n") }; $(function () { r(), o(), e(), a(), n(), c(), s(), i(), l(), d() }) })()

View File

@ -1,5 +1,5 @@
{
"version": "3.2.0",
"details_url": "https://github.com/vtrois/kratos/releases/tag/v3.2.0",
"download_url": "https://mirrors.vtrois.com/kratos/v3.2.0.zip"
"version": "3.2.1",
"details_url": "https://github.com/vtrois/kratos/releases/tag/v3.2.1",
"download_url": "https://mirrors.vtrois.com/kratos/v3.2.1.zip"
}

View File

@ -1,7 +1,7 @@
/*
Theme Name: Kratos
Text Domain: kratos
Version: 3.2.0
Version: 3.2.1
Requires PHP: 7.0
Description:
Tags: , , , , , , , , , , , , ,