Khác biệt giữa bản sửa đổi của “MediaWiki:Minerva.js”

Từ Từ điển tri thức Hội Thánh của Đức Chúa Trời
Bước tới điều hướng Bước tới tìm kiếm
Không có tóm lược sửa đổi
Thẻ: Lùi lại thủ công
Không có tóm lược sửa đổi
Dòng 1: Dòng 1:
/* All JavaScript here will be loaded for users of the MinervaNeue skin */
/* All JavaScript here will be loaded for users of the MinervaNeue skin */
/* All JavaScript here will be loaded for users of the MinervaNeue skin */
// 모바일 메뉴에서 '둘러보기' 문서 보여주기
// 모바일 메뉴에서 '둘러보기' 문서 보여주기
document
document
  .querySelector("#mw-mf-page-left #p-navigation")
    .querySelector('#mw-mf-page-left #p-navigation')
  .insertAdjacentHTML(
    .insertAdjacentHTML(
    "afterend",
        'afterend',
    '<ul id="p-main-categories" class="recommended-open"><li class="title-recommended open"><a><span>Bài viết đề xuất</span></a><span class="ico-arrow"></span></li><li class="recommended"><a href="/WHội Thánh của Đức Chúa Trời Hiệp Hội Truyền Giáo Tin Lành Thế Giới><span>Cội Thánh của Đức Chúa Trời (Tài liệu)</span></a></li><li class="recommended"><a href="/Ahnsahnghong"><span>Christ Ahnsahnghong</span></a></li><li class="recommended"><a href="/God_the_Mother"><span>God the Mother</span></a></li><li class="recommended"><a href="/Sabbath"><span>Sabbath</span></a></li><li class="recommended"><a href="/Passover"><span>Passover</span></a></li><li class="recommended"><a href="/Gospel_and_the_New_Covenant"><span>Gospel and New Covenant</span></a></li><li class="title-category"><a><span>Browse by Category</span></a><span class="ico-arrow"></span></li><li class="category"><a href="/Category:Church_of_God"><span>Church of God</span></a></li><li class="category"><a href="/Category:God_the_Father"><span>God the Father</span></a></li><li class="category"><a href="/Category:God_the_Mother"><span>God the Mother</span></a></li><li class="category"><a href="/Category:Gospel_of_the_New_Covenant"><span>Gospel of the New Covenant</span></a></li><li class="category"><a href="/Category:Bible_Knowledge"><span>Bible Knowledge</span></a></li><li class="category"><a href="/Category:Biblical_Issues"><span>Biblical Issues</span></a></li><li class="category"><a href="/Category:Community_Service"><span>Community Service</span></a></li><li class="category"><a href="/Category:Global_Cooperation"><span>Global Cooperation</span></a></li></ul>'
        '<ul id="p-main-categories" class="recommended-open"><li class="title-recommended open"><a><span>Recommended Documents</span></a><span class="ico-arrow"></span></li><li class="recommended"><a href="/World_Mission_Society_Church_of_God"><span>Church of God(Document)</span></a></li><li class="recommended"><a href="/Ahnsahnghong"><span>Christ Ahnsahnghong</span></a></li><li class="recommended"><a href="/God_the_Mother"><span>God the Mother</span></a></li><li class="recommended"><a href="/Sabbath"><span>Sabbath</span></a></li><li class="recommended"><a href="/Passover"><span>Passover</span></a></li><li class="recommended"><a href="/Gospel_and_the_New_Covenant"><span>Gospel and New Covenant</span></a></li><li class="title-category"><a><span>Browse by Category</span></a><span class="ico-arrow"></span></li><li class="category"><a href="/Category:Church_of_God"><span>Church of God</span></a></li><li class="category"><a href="/Category:God_the_Father"><span>God the Father</span></a></li><li class="category"><a href="/Category:God_the_Mother"><span>God the Mother</span></a></li><li class="category"><a href="/Category:Gospel_of_the_New_Covenant"><span>Gospel of the New Covenant</span></a></li><li class="category"><a href="/Category:Bible_Knowledge"><span>Bible Knowledge</span></a></li><li class="category"><a href="/Category:Biblical_Issues"><span>Biblical Issues</span></a></li><li class="category"><a href="/Category:Community_Service"><span>Community Service</span></a></li><li class="category"><a href="/Category:Global_Cooperation"><span>Global Cooperation</span></a></li></ul>'
  );
    );


document
document.querySelector('#p-main-categories .title-recommended').addEventListener('click', function () {
  .querySelector("#p-main-categories .title-recommended")
     openList(this, 'recommended-open');
  .addEventListener("click", function () {
});
     openList(this, "recommended-open");
document.querySelector('#p-main-categories .title-category').addEventListener('click', function () {
  });
     openList(this, 'category-open');
document
});
  .querySelector("#p-main-categories .title-category")
  .addEventListener("click", function () {
     openList(this, "category-open");
  });


function openList(titleLi, listClass) {
function openList(titleLi, listClass) {
  var list = document.querySelector("#p-main-categories");
    var list = document.querySelector('#p-main-categories');
  if (list.classList.contains(listClass)) {
    if (list.classList.contains(listClass)) {
    list.classList.remove(listClass);
        list.classList.remove(listClass);
  } else {
    } else {
    list.classList.add(listClass);
        list.classList.add(listClass);
  }
    }


  if (titleLi.classList.contains("open")) {
    if (titleLi.classList.contains('open')) {
    titleLi.classList.remove("open");
        titleLi.classList.remove('open');
  } else {
    } else {
    titleLi.classList.add("open");
        titleLi.classList.add('open');
  }
    }
}
}


// 유튜브 썸네일
// 유튜브 썸네일
document.querySelectorAll("iframe").forEach(function (iframe) {
document.querySelectorAll('iframe').forEach(function(iframe){
  iframe.parentElement.classList.add("video-wrap");
    iframe.parentElement.classList.add('video-wrap');
});
});

Phiên bản lúc 07:44, ngày 7 tháng 7 năm 2023

/* All JavaScript here will be loaded for users of the MinervaNeue skin */
// 모바일 메뉴에서 '둘러보기' 문서 보여주기
document
    .querySelector('#mw-mf-page-left #p-navigation')
    .insertAdjacentHTML(
        'afterend',
        '<ul id="p-main-categories" class="recommended-open"><li class="title-recommended open"><a><span>Recommended Documents</span></a><span class="ico-arrow"></span></li><li class="recommended"><a href="/World_Mission_Society_Church_of_God"><span>Church of God(Document)</span></a></li><li class="recommended"><a href="/Ahnsahnghong"><span>Christ Ahnsahnghong</span></a></li><li class="recommended"><a href="/God_the_Mother"><span>God the Mother</span></a></li><li class="recommended"><a href="/Sabbath"><span>Sabbath</span></a></li><li class="recommended"><a href="/Passover"><span>Passover</span></a></li><li class="recommended"><a href="/Gospel_and_the_New_Covenant"><span>Gospel and New Covenant</span></a></li><li class="title-category"><a><span>Browse by Category</span></a><span class="ico-arrow"></span></li><li class="category"><a href="/Category:Church_of_God"><span>Church of God</span></a></li><li class="category"><a href="/Category:God_the_Father"><span>God the Father</span></a></li><li class="category"><a href="/Category:God_the_Mother"><span>God the Mother</span></a></li><li class="category"><a href="/Category:Gospel_of_the_New_Covenant"><span>Gospel of the New Covenant</span></a></li><li class="category"><a href="/Category:Bible_Knowledge"><span>Bible Knowledge</span></a></li><li class="category"><a href="/Category:Biblical_Issues"><span>Biblical Issues</span></a></li><li class="category"><a href="/Category:Community_Service"><span>Community Service</span></a></li><li class="category"><a href="/Category:Global_Cooperation"><span>Global Cooperation</span></a></li></ul>'
    );

document.querySelector('#p-main-categories .title-recommended').addEventListener('click', function () {
    openList(this, 'recommended-open');
});
document.querySelector('#p-main-categories .title-category').addEventListener('click', function () {
    openList(this, 'category-open');
});

function openList(titleLi, listClass) {
    var list = document.querySelector('#p-main-categories');
    if (list.classList.contains(listClass)) {
        list.classList.remove(listClass);
    } else {
        list.classList.add(listClass);
    }

    if (titleLi.classList.contains('open')) {
        titleLi.classList.remove('open');
    } else {
        titleLi.classList.add('open');
    }
}

// 유튜브 썸네일
document.querySelectorAll('iframe').forEach(function(iframe){
    iframe.parentElement.classList.add('video-wrap');
});