MediaWiki:Common.js:修订间差异

来自赛尔号精灵图鉴
跳转到导航 跳转到搜索
无编辑摘要
标签已被回退
无编辑摘要
 
(未显示同一用户的7个中间版本)
第1行: 第1行:
/* 所有页面通用 JS */
$(function () {
$(function () {
   // 只在条目页面生效
   const btn = $('<a href="/index.php/首页" id="return-home-button">🏠 返回首页</a>').css({
  if (mw.config.get("wgNamespaceNumber") === 0) {
    position: 'fixed',
    $('<a href="/index.php/首页" id="return-home-button">返回首页</a>')
    bottom: '20px',
      .css({
    right: '20px',
        position: 'fixed',
    padding: '10px 14px',
        bottom: '100px',
    background: '#ffffffdd',
        left: '30px',
    color: '#333',
        background: '#ffffffdd',
    fontSize: '14px',
        padding: '6px 12px',
    fontWeight: 'bold',
        borderRadius: '8px',
    border: '1px solid #ccc',
        fontWeight: 'bold',
    borderRadius: '8px',
        zIndex: 9999
    textDecoration: 'none',
      })
    boxShadow: '0 2px 6px rgba(0,0,0,0.2)',
      .appendTo('body');
    zIndex: 9999
  }
  });
  $('body').append(btn);
});
});
// 在线人数计数器
(setInterval() => {
  fetch('/online.php')
    .then(res => res.text())
    .then(n => {
      document.getElementById("online-count").textContent = n;
    });
}, 5000);

2025年5月11日 (日) 13:14的最新版本

$(function () {
  const btn = $('<a href="/index.php/首页" id="return-home-button">🏠 返回首页</a>').css({
    position: 'fixed',
    bottom: '20px',
    right: '20px',
    padding: '10px 14px',
    background: '#ffffffdd',
    color: '#333',
    fontSize: '14px',
    fontWeight: 'bold',
    border: '1px solid #ccc',
    borderRadius: '8px',
    textDecoration: 'none',
    boxShadow: '0 2px 6px rgba(0,0,0,0.2)',
    zIndex: 9999
  });
  $('body').append(btn);
});
👥 当前在线人数:68