Site Notice
hello, world
Difference between revisions of "MediaWiki:Js-blog.js"
From Project-EPB Commons
Line 52: | Line 52: | ||
}); | }); | ||
} | } | ||
+ | }); | ||
+ | /** 评论区提示 **/ | ||
+ | $(function(){ | ||
+ | $('body:not(.wp-admin) .comments-area .comment-notes').html('<span id="email-notes">您提交的电子邮件地址不会被公开显示,它仅会被用来查询Gravatar头像数据。</span><span id="custom-notes">除评论内容外其他均不是必填项目。</span>'); | ||
+ | $('body:not(.wp-admin) .comments-area input[name="author"]').attr('placeholder','昵称'); | ||
}); | }); |
Revision as of 17:49, 7 September 2019
/**
*『Wjghj Project Static』
* This _JavaScript_ code is from https://common.wjghj.cn
* CC BY-NC-SA
* For Wjghj Wordpress https://blog.wjghj.cn
**/
$(function(){
$('[data-slug="hello-dolly"]').html(function(){
var $this = $(this);
$this.find('.plugin-title strong').text('Wjghj Blog');
$this.find('.plugin-description').html('Wjghj Project为其博客项目魔改的插件,启用此插件可以超越Wordpress的限制调用外部的css以及js资源等');
$this.find('.plugin-version-author-uri').html('版本代号: Noah | <a href="https://wjghj.cn/wiki/Project:关于">Wjghj Project</a> | <a href="https://blog.wjghj.cn/wp-content/plugins/wjghjblog.php">查看详情</a>');
});
});
/** 复制时版权声明 **/
$(window).on('copy',function(){
if ($('#wpadminbar').length == 0) {
toastr['warning']($('#sq-middle-footer .license-description').html(),'您刚刚复制了'+$('.sq-site-title a').text()+'上的内容!');
}
});
/** 自动神隐顶部条 **/
$(function(){
var lastScrollY = 0;
$(window).scroll(function() {
//变化量可自行修改,使其在指定高度内滚动时不隐藏
if (window.scrollY - lastScrollY > 0 && window.scrollY > 500) {
//往下滚动,隐藏导航栏
$('.sq-site-header').addClass('header-hide');
$('#toast-container').addClass('notify-hide');
} else if (window.scrollY - lastScrollY < 0) {
//往上滚动,显示导航栏(Safari会有BUG,尴尬)
$('.sq-site-header').removeClass('header-hide');
$('#toast-container').removeClass('notify-hide');
}
lastScrollY = window.scrollY;
});
$('.sq-site-header').attr({'style':'position:fixed !important'}).mouseover(function(){
$('.sq-site-header, #toast-container').addClass('header-is-hover');
}).mouseout(function(){
$('.sq-site-header, #toast-container').removeClass('header-is-hover');
});
});
/** 变更管理工具条的位置 **/
$(function(){
if ($('body.wp-admin').length == 0) {
$('#wpadminbar').prependTo('body:not(.post-php) [role="main"]').css({
'position':'inherit',
'top':'0px',
'margin':'8px 0'
});
}
});
/** 评论区提示 **/
$(function(){
$('body:not(.wp-admin) .comments-area .comment-notes').html('<span id="email-notes">您提交的电子邮件地址不会被公开显示,它仅会被用来查询Gravatar头像数据。</span><span id="custom-notes">除评论内容外其他均不是必填项目。</span>');
$('body:not(.wp-admin) .comments-area input[name="author"]').attr('placeholder','昵称');
});