"മീഡിയവിക്കി:Common.js" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം
No edit summary |
No edit summary |
||
| വരി 74: | വരി 74: | ||
var license = ''; | var license = ''; | ||
var licenseUrl = ''; | var licenseUrl = ''; | ||
var commonsUrl = info.descriptionurl || ''; | |||
if (info.extmetadata) { | if (info.extmetadata) { | ||
| വരി 96: | വരി 97: | ||
img.style.width = '100%'; | img.style.width = '100%'; | ||
/* Lightbox | /* Lightbox source: responsive, not original */ | ||
var lightboxSrc = info.url; | var lightboxSrc = info.url; | ||
if (info.responsiveUrls) { | if (info.responsiveUrls) { | ||
| വരി 112: | വരി 113: | ||
(licenseUrl | (licenseUrl | ||
? ' – <a href="' + licenseUrl + | ? ' – <a href="' + licenseUrl + | ||
'" target="_blank">' + license + '</a>' | '" target="_blank" rel="noopener noreferrer">' + | ||
: '')+ | license + '</a>' | ||
: '') + | |||
(commonsUrl | |||
? '<br><a href="' + commonsUrl + | |||
'" target="_blank" rel="noopener noreferrer">' + | |||
'View on Wikimedia Commons</a>' | |||
: ''); | |||
figure.appendChild(img); | figure.appendChild(img); | ||
| വരി 138: | വരി 141: | ||
}); | }); | ||
/* Hide | /* Hide source placeholders */ | ||
sources.forEach(function (el) { | sources.forEach(function (el) { | ||
el.style.display = 'none'; | el.style.display = 'none'; | ||
| വരി 243: | വരി 246: | ||
})(); | })(); | ||
/* ============================================================ | /* ============================================================ | ||
| വരി 365: | വരി 259: | ||
); | ); | ||
} | } | ||
/* ============================================================ | /* ============================================================ | ||
| വരി 418: | വരി 311: | ||
$(addCharSubsetMenu); | $(addCharSubsetMenu); | ||
/* ============================================================ | /* ============================================================ | ||
| വരി 463: | വരി 355: | ||
}); | }); | ||
}); | }); | ||
/* ============================================================ | /* ============================================================ | ||
| വരി 469: | വരി 360: | ||
============================================================ */ | ============================================================ */ | ||
var autoCollapse = 2; | var autoCollapse = 2; | ||
var collapseCaption = | var collapseCaption = 'മറയ്ക്കുക'; | ||
var expandCaption = | var expandCaption = 'പ്രദർശിപ്പിക്കുക'; | ||
function collapseTable(tableIndex) { | function collapseTable(tableIndex) { | ||
var Button = document.getElementById( | var Button = document.getElementById('collapseButton' + tableIndex); | ||
var Table = document.getElementById( | var Table = document.getElementById('collapsibleTable' + tableIndex); | ||
if (!Table || !Button) return; | if (!Table || !Button) return; | ||
| വരി 481: | വരി 372: | ||
for (var i = 1; i < Rows.length; i++) { | for (var i = 1; i < Rows.length; i++) { | ||
Rows[i].style.display = hide ? | Rows[i].style.display = hide ? 'none' : ''; | ||
} | } | ||
Button.firstChild.data = hide ? expandCaption : collapseCaption; | Button.firstChild.data = hide ? expandCaption : collapseCaption; | ||