«ميدياويكي:Common.js»: الفرق بين المراجعتين
من Sudan Memory
| سطر ٤: | سطر ٤: | ||
$(function () { | $(function () { | ||
| + | document.querySelectorAll('.abyat').forEach(function(poem) { // Iterate through containers declared as أبيات | ||
| + | poem.innerHTML = poemFormat(poem); // Process to format | ||
| + | }); | ||
| + | |||
var toggler = document.getElementsByClassName("treeBranch"); | var toggler = document.getElementsByClassName("treeBranch"); | ||
var i; | var i; | ||
مراجعة ١٥:٢٩، ١٢ مارس ٢٠٢٤
/* الجافاسكريبت الموضوع هنا سيتم تحميله لكل المستخدمين مع كل تحميل للصفحة. */ importScript('ميدياويكي:Poems.js'); $(function () { document.querySelectorAll('.abyat').forEach(function(poem) { // Iterate through containers declared as أبيات poem.innerHTML = poemFormat(poem); // Process to format }); var toggler = document.getElementsByClassName("treeBranch"); var i; for (i = 0; i < toggler.length; i++) { toggler[i].addEventListener("click", function() { this.parentElement.querySelector(".treeBranch-nested").classList.toggle("treeBranch-active"); this.classList.toggle("treeBranch-down"); }); } }());