User:Aliser/common.js: Difference between revisions
From Space Station 14 Wiki
|
|
(One intermediate revision by the same user not shown) |
Line 1: |
Line 1: |
| // ********************************
| |
| // ******* Start DRUID js *********
| |
| // ********************************
| |
|
| |
|
| // DRUID Infobox.
| |
| // source: https://support.wiki.gg/wiki/MediaWiki:Gadget-druidInfoboxes.js
| |
| // license: CC BY-SA 4.0
| |
|
| |
| $(function () {
| |
| $(".druid-title-tab").off("click")
| |
| .on('click', function () {
| |
| var $parent = $(this).closest(".druid-container");
| |
| $parent.find(".druid-toggleable").removeClass("focused");
| |
| var i = $(this).attr("data-druid");
| |
| $parent.find(".druid-toggleable[data-druid=" + i + "]").addClass("focused");
| |
| });
| |
|
| |
| $(".druid-section-tab").off("click")
| |
| .on('click', function () {
| |
| var $parent = $(this).closest(".druid-section-container");
| |
| $parent.find(".druid-toggleable").removeClass("focused");
| |
| var i = $(this).attr("data-druid");
| |
| $parent.find(".druid-toggleable[data-druid=" + i + "]").addClass("focused");
| |
| });
| |
|
| |
| $(".druid-collapsible").off("click")
| |
| .on('click', function () {
| |
| var kind = $(this).attr("data-druid-section");
| |
| $(this).toggleClass("druid-collapsible-collapsed");
| |
| $(this)
| |
| .closest(".druid-container")
| |
| .find("[data-druid-section-row=" + kind + "]")
| |
| .toggleClass("druid-collapsed");
| |
| });
| |
| });
| |
|
| |
| // ********************************
| |
| // ******* End DRUID js *********
| |
| // ********************************
| |
Latest revision as of 05:02, 30 May 2025