"മീഡിയവിക്കി:Common.js" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം
No edit summary |
No edit summary |
||
| (2 ഉപയോക്താക്കൾ ചെയ്ത ഇടയ്ക്കുള്ള 9 നാൾപ്പതിപ്പുകൾ പ്രദർശിപ്പിക്കുന്നില്ല) | |||
| വരി 1: | വരി 1: | ||
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); | |||
/* ============================================================ | /* ============================================================ | ||
OpenStreetMap marker URL fix | OpenStreetMap marker URL fix | ||
============================================================ */ | ============================================================ */ | ||
window.onload = function () { | |||
var images = document.querySelectorAll('img'); | var images = document.querySelectorAll('img'); | ||
for (var i = 0; i < images.length; i++) { | for (var i = 0; i < images.length; i++) { | ||
| വരി 8: | വരി 10: | ||
if ( | if ( | ||
img.src && | img.src && | ||
img.src. | img.src.startsWith("https://tile.openstreetmap.org/v4/marker/") | ||
) { | ) { | ||
img.src = img.src.replace( | img.src = img.src.replace( | ||
| വരി 15: | വരി 17: | ||
); | ); | ||
} | } | ||
}; | |||
} | }; | ||
/* ============================================================ | /* ============================================================ | ||
| വരി 74: | വരി 76: | ||
var license = ''; | var license = ''; | ||
var licenseUrl = ''; | var licenseUrl = ''; | ||
var commonsUrl = info.descriptionurl || ''; | |||
if (info.extmetadata) { | if (info.extmetadata) { | ||
| വരി 96: | വരി 99: | ||
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: | വരി 115: | ||
(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: | വരി 143: | ||
}); | }); | ||
/* Hide | /* Hide source placeholders */ | ||
sources.forEach(function (el) { | sources.forEach(function (el) { | ||
el.style.display = 'none'; | el.style.display = 'none'; | ||
| വരി 243: | വരി 248: | ||
})(); | })(); | ||
/* ============================================================ | /* ============================================================ | ||
| വരി 365: | വരി 261: | ||
); | ); | ||
} | } | ||
/* ============================================================ | /* ============================================================ | ||
| വരി 418: | വരി 313: | ||
$(addCharSubsetMenu); | $(addCharSubsetMenu); | ||
/* ============================================================ | /* ============================================================ | ||
| വരി 463: | വരി 357: | ||
}); | }); | ||
}); | }); | ||
/* ============================================================ | /* ============================================================ | ||
| വരി 469: | വരി 362: | ||
============================================================ */ | ============================================================ */ | ||
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: | വരി 374: | ||
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; | ||