MediaWiki:Mobile.js
Hopp til navigering
Hopp til søk
Merk: Etter publisering vil det kanskje være nødvendig å slette mellomlageret i nettleseren din for å se endringene.
- Firefox / Safari: Hold Shift mens du klikker på Oppdater, eller trykk enten Ctrl+F5 eller Ctrl+R (⌘+R på Mac)
- Google Chrome: Trykk Ctrl+Shift+R (⌘+Shift+R på Mac)
- Internet Explorer / Edge: Hold Ctrl mens du trykker på Oppdater eller trykk Ctrl+F5
- Opera: Ttrykk Ctrl+F5.
/* JavaScript her vil lastes for alle brukere av mobilsiden */
/* Add to MediaWiki:Mobile.js for custom Mobile Menu links
for MW-1.34.2 with MobileFrontend and MinervaNeue
Just replace span text and href to add links */
var timer = setInterval(function() {
if ($('.menu ul:first').length) {
console.log("mobile menu exists");
clearInterval(timer);
$('.menu ul:first').after(
'<ul> \
<li> \
<a href="/wiki/Kategori:Vrak" \
class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"> \
<span>Kart over vrak</span> \
</a> \
</li> \
</ul>'
);
}
}, 100); // check every 100ms
.map {
float: right;
border: 1px solid #c8ccd1; /* Same as picture thumbnails*/
padding: 3px;
background-color: #f8f9fa;
min-width: 300px; /* With this, you can set the inline width property of the map to 100% */
margin-bottom: 20px;
clear: both; /* To avoid two elements next to each other - force them below another instead*/
width: min-content; /* To force the caption to break lines if it is longer than the map*/
}
.map > p {
font-size: 94%; /* Smaller caption, same as picture captions */
padding: 3px 0 0 3px;
}
/* Make map mobile-friendly by forcing it to stretch 100% width */
@media only screen and (max-width: 750px) {
.map {
float: left;
width: 100%;
}
.leaflet-container {
width: 100% !important; /* Override the (inline) width property set when writing e. g. {{#display_map: ... |width=400px}}, because this could be too large for mobile screens */
}
}