MediaWiki:Mobile.js:修订间差异

来自PlantsVsZombies Mixed
跳转到导航 跳转到搜索
(创建页面,内容为“→‎这里的任何JavaScript将为使用移动版网站的用户加载:​ // Wait for the DOM to be ready document.addEventListener("DOMContentLoaded", function() { // Check if we are in mobile view if (mw.config.get('skin') === 'minerva') { // Create a new link var newLink = document.createElement('a'); newLink.href = '/wiki/Special:MyPage'; newLink.textContent = 'My Page'; // Create a new list item var newListItem = document.creat…”
标签移动版编辑 移动版网页编辑
(没有差异)

2024年2月17日 (六) 17:43的版本

/* 这里的任何JavaScript将为使用移动版网站的用户加载 */
// Wait for the DOM to be ready
document.addEventListener("DOMContentLoaded", function() {
  // Check if we are in mobile view
  if (mw.config.get('skin') === 'minerva') {
    // Create a new link
    var newLink = document.createElement('a');
    newLink.href = '/wiki/Special:MyPage';
    newLink.textContent = 'My Page';

    // Create a new list item
    var newListItem = document.createElement('li');
    newListItem.appendChild(newLink);

    // Add the list item to the menu
    var menu = document.getElementById('p-navigation').getElementsByTagName('ul')[0];
    menu.appendChild(newListItem);
  }
});