MediaWiki:Gadget-VisitorTips.js
跳到导航
跳到搜索
注意:这类代码页面在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- 按住
CTRL+SHIFT+DEL 或 ⌘-Shift-R
来清除缓存! - 或尝试在地址栏的地址最后添加代码
?_=1
来访问最新页面。 - 你还可以在设置中勾选小工具在页面右上角添加清除缓存按钮!
if (mw.config.get('wgUserName')===null) {
$(window).scroll(function(){
if (mw.config.get("wgAction") === "view"&& !document.querySelector("#NewuserTips")&& $(this).scrollTop() > 1700 && !window.localStorage.getItem('NewuserTips')) {
var url = new mw.Uri();
var wgUserVariant = mw.config.get("wgUserVariant");
$("body").append('<div id="NewuserTips" style="background: #a7a93cf0; color: white; text-align: center; padding: .17rem; position: fixed; top: 0; left: 0; right: 0; box-shadow: 0 0 2.5px #000; z-index: 9999;"><p>我们鼓励您编辑条目,创建账号成为本站的一员><,登录后您可以建立自己的用户页并署名贡献(<a style=" color: #f4ff7f;" href="https://www.hmoegirl.info/%E7%89%B9%E6%AE%8A:%E5%88%9B%E5%BB%BA%E8%B4%A6%E6%88%B7"> 注册 </a>|<a style="color: #f4ff7f;" href="https://www.hmoegirl.info/%E7%89%B9%E6%AE%8A:%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95"> 登录 </a>|<a a style="color: #f4ff7f;" href="https://www.hmoegirl.info/H%E8%90%8C%E5%A8%98:%E5%AE%98%E6%96%B9%E7%BE%A4%E7%BB%84"> 加入社群 </a>) <span id="NewuserTips-disable" a style="color: #f4ff7f;" class="mw-ui-destructive"> [ 不再提示 ] </span></div>');
}
$(".mw-ui-destructive").on("click", function(e) {
$("#NewuserTips").remove();
window.localStorage.setItem('NewuserTips', true);
});
});
}