User:Irukaza/common.js:修订间差异

imported>=海豚=
无编辑摘要
imported>Irukaza
(清空页面)
 
(未显示2个用户的340个中间版本)
第1行: 第1行:
if (mw.config.get("wgAction") === "view"&& !document.querySelector("#noteTA-lang")) {
 
       var url = new mw.Uri();
       var wgUserVariant = mw.config.get("wgUserVariant");
   $(window).scroll(function(){
     if ($(this).scrollTop() > 700) {
       $("body").append('<div id="noteTA-lang" style="background: #a7a93cf0; color: white; text-align: center; padding: .17rem; position: fixed; top: 0; left: 0; right: 0; z-index: 9999;"><p>我们鼓励您编辑条目,创建账号成为本站的一员,登录后您可以建立自己的用户页并署名贡献(<a class="p4js-conversion-link mw-ui-destructive" href="www.baidu.com"> 注册 </a>|<a class="p4js-conversion-link mw-ui-destructive" href="www.baidu.com"> 登录 </a>)(<span id="noteTA-lang-disable" class="p4js-conversion-link mw-ui-destructive"> 不再提示 </span>)</div>');
     }
   });
     }
$(".noteTA-lang-changer").on("click", function(e) {
           var uri = new mw.Uri();
           var path = uri.path;
           Object.keys(map).forEach(function(s) {
             path = path.replace(new RegExp("^/" + s + "/"), "/");
           });
           uri.path = "/" + e.target.dataset.lang + "/" + path.replace(/^\//, "");
           location.replace(uri);
           $("#noteTA-lang").remove();
         }).filter('[data-lang="' + wgUserVariant + '"]').addClass("mw-ui-progressive");
         $("#noteTA-lang-explainer").on("click", function() {
           //open(mw.config.get("wgServer") + mw.config.get("wgScriptPath") +,"_blank");
         }).hide();
         $("#noteTA-lang-disable").on("click", function() {
           $("#noteTA-lang").remove();
           localStorage.setItem("AnnTools-noteTA-alert", "true");
         });

2022年3月17日 (四) 18:22的最新版本