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

跳到导航 跳到搜索
添加1,386字节 、​ 2021年7月8日 (星期四)
无编辑摘要
imported>=海豚=
(以“mw.loader.load('https://www.hmoegirl.com/index.php?title=User:AT/js/UserStatus.js&action=raw&ctype=text/javascript'); document.querySelector("#footer-poweredbyico > a > img")…”替换内容)
imported>=海豚=
无编辑摘要
第2行: 第2行:
document.querySelector("#footer-poweredbyico > a > img").srcset='';
document.querySelector("#footer-poweredbyico > a > img").srcset='';
document.querySelector("#footer-poweredbyico > a > img").src='https://hmoegirl.com/resources/assets/poweredby_mediawiki_132x47.png';
document.querySelector("#footer-poweredbyico > a > img").src='https://hmoegirl.com/resources/assets/poweredby_mediawiki_132x47.png';
"use strict";
$(function() {
   if (mw.config.get('wgNamespaceNumber') % 2 == 1) return; // 排除所有非讨论页。
  
   let vote = $(".votebox");
   if (vote.length > 1) { alert("同一个页面中有多个投票模板。"); return; } // 同一个页面中有多个投票模板。
  
   let voteInfo = vote.find(".UTCStartTime")
   const utcStartTime = voteInfo.dataset.utcStartTime;
   const duration = voteInfo.dataset.duration;
   const promoter = voteInfo.dataset.promoter;
   const utcEndTime = utcStartTime + duration;
   alert("发起人"+promoter+"。");
   if (utcEndTime > Date.getTime()) alert("投票尚未结束。"); // The vote isn't end yet.
  
   if (vote) alert("找到由 " + promoter + " 发起的投票。");
   else alert("页面内未找到投票。")
  
   let discussSection = $("h2").filter(".mw-headline",
     () => $(this).innerHTML == "讨论区" || $(this).innerHTML == "討論區" || $(this).innerHTML == "讨论" || $(this).innerHTML == "討論"
   ).nextUntil("h2");
   let voteSection = $("h2").filter(".mw-headline",
     () => $(this).innerHTML == "投票区" || $(this).innerHTML == "投票區" || $(this).innerHTML == "投票"
   ).nextUntil("h2");
  
   discussSection.each(() => $(this).css("background-color","yellow"));
   discussSection.each(() => $(this).css("background-color","blue"));
})
//</pre>
匿名用户

导航菜单