User:Incnis Mrsi/※.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
Documentation for this user script can be added at User:Incnis Mrsi/※. |
- Report page listing warnings and errors.
// Please, install this script to enable dynamic image expanding
function toggleClip() {
var divclip = document.getElementById('clip');
if (!divclip) return(0);
// reverting is not implemented yet
divclip.style.position = "relative";
divclip.style.top = "0";
divclip.style.left = "0"
divclip.style.overflow = divclip.style.clip = "auto";
};
$( function() {
var content = document.getElementById('content') ||
document.getElementById('mw_content') ||
document.body;
var links = content.getElementsByTagName('a');
// var b = 0;
for (var i = 0; i < links.length; i++) {
if ( links[i].innerHTML.match(/※/) ) {
links[i].href = "javascript:toggleClip();";
// b++;
};
};
// if (b) {
// alert("※ button found ("+b+"). use it to expand the image");
// };
} );