MediaWiki:Common.js:修订间差异

来自赛尔号精灵图鉴
跳转到导航 跳转到搜索
无编辑摘要
标签已被回退
无编辑摘要
标签手工回退
第1行: 第1行:
/* 所有页面通用 JS */
/* 所有页面通用 JS */
$function (() {
$(function () {
   // 只在条目页面生效
   // 只在条目页面生效
   if (mw.config.get("wgNamespaceNumber") === 0) {
   if (mw.config.get("wgNamespaceNumber") === 0) {

2025年5月11日 (日) 11:25的版本

/* 所有页面通用 JS */
$(function () {
  // 只在条目页面生效
  if (mw.config.get("wgNamespaceNumber") === 0) {
    $('<a href="/index.php/首页" id="return-home-button">← 返回首页</a>')
      .css({
        position: 'fixed',
        bottom: '100px',
        left: '30px',
        background: '#ffffffdd',
        padding: '6px 12px',
        borderRadius: '8px',
        fontWeight: 'bold',
        zIndex: 9999
      })
      .appendTo('body');
  }
});

// 在线人数计数器
setInterval(() => {
  fetch('/online.php')
    .then(res => res.text())
    .then(n => {
      document.getElementById("online-count").textContent = n;
    });
}, 5000);
👥 当前在线人数:60