МедияУики:Gadget-Big dynamap.js
Забележка: За да се видят промените, необходимо е след съхраняване на страницата, кешът на браузъра да бъде изтрит.
- Firefox / Safari: Задържа се клавиш Shift и се щраква върху Презареждане (Reload) или чрез клавишната комбинация Ctrl-Shift-R (⌘-Shift-R за Mac);
- Google Chrome: клавишна комбинация Ctrl-Shift-R (⌘-Shift-R за Mac)
- Internet Explorer: Задържа се клавиш Ctrl и се щраква върху Refresh или чрез клавишната комбинация CTRL-F5;
- Opera: кешът се изчиства през менюто Tools → Preferences.
if ( window.importScript && ! window.jQuery ) {
importScript("МедияУики:Gadget-jQuery.js");
}
/**
Create a bigger map for each [[Шаблон:ПК|dynamic map]].
The new map should be shown on a mouse click.
The old image links are disabled.
@uses jQuery
*/
$(function() {
jQuery("div.dynamap").each(function(){
var newMap = jQuery(this).clone();
var newImg = jQuery("img", newMap).eq(0); // the map image
var oldWidth = newImg[0].width;
var newWidth = 600;
newImg[0].src = newImg[0].src.replace(/\d+(px)/, newWidth + "$1");
newImg[0].width = newWidth;
newImg[0].height *= newWidth / oldWidth;
var mapOffset = jQuery(this).offset();
newMap.css({
"z-index" : 10,
position : "absolute",
top : mapOffset.top,
left : mapOffset.left - ( newWidth - oldWidth ) + 5,
width : newWidth + "px"
}).click(function(){
jQuery(this).hide();
return false;
}).hide().appendTo(document.body);
jQuery("a", this).click(function(){
newMap.show();
return false; // tell the browser to not follow the image link
});
});
});