MediaWiki:Mobile.js:修订间差异

来自京津冀学生网
跳转到导航 跳转到搜索
Admin留言 | 贡献
无编辑摘要
Admin留言 | 贡献
无编辑摘要
标签移动版编辑 移动版网页编辑
第4行: 第4行:
   Just replace span text and href to add links */
   Just replace span text and href to add links */
mw.loader.load('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', "text/css");
mw.loader.load('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', "text/css");
mw.loader.load('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20,400,1,0', "text/css");


mw.loader.using('mobile.site.styles');
mw.loader.using('mobile.site.styles');


mw.loader.load('https://doc.wikimedia.org/oojs-ui/master/demos/node_modules/oojs/dist/oojs.js');
if ($('.menu ul:first').length) {
if ($('.menu ul:first').length) {
           console.log("mobile menu exists");
           console.log("mobile menu exists");

2025年9月12日 (五) 07:33的版本

/* 这里的任何JavaScript将为使用移动版网站的用户加载 */
  /* Add to MediaWiki:Mobile.js for custom Mobile Menu links 
  for MW-1.34.2 with MobileFrontend and MinervaNeue 
  Just replace span text and href to add links */
mw.loader.load('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', "text/css");

mw.loader.using('mobile.site.styles');

if ($('.menu ul:first').length) {
           console.log("mobile menu exists");
           $('.menu ul:first').after(
                 '<ul id="p-otherlink" class="toggle-list__list"> \
                      <li class="toggle-list-item"> \
                      <a class="toggle-list-item__anchor menu__item--link1" href="https://discuss.jjjstudent.com" data-mw="interface"> \
<i class="fa fa-users" style="width: 20px; height: 20px; color: var(--color-subtle,#54595d); margin-right: 8px; line-height: inherit; text-align: center;"></i> \
                              <span class="toggle-list-item__label">论坛</span> \
                      </a> \
                      </li> \
<li class="toggle-list-item"> \
                      <a class="toggle-list-item__anchor menu__item--link2" href="https://old.jjjstudent.com" data-mw="interface"> \
<i class="fa fa-archive" style="width: 20px; height: 20px; color: var(--color-subtle,#54595d); margin-right: 8px; line-height: inherit; text-align: center;"></i>  \
                              <span class="toggle-list-item__label">文档存档</span> \
                      </a> \
                      </li> \
                 </ul>'
            );
};

if ($('.mw-collapsible')[0]) mw.loader.using('jquery.makeCollapsible').then(function () {
    //console.debug('jquery.makeCollapsible is loaded.');
    $('.mw-collapsible').makeCollapsible();
});