Note: After publishing, you may have to bypass your browser's cache to see the changes.
/** * This replaces the image in P4640 statements with an iframe showing the * contents of panoviewer.toolforge.org. * * Based on [[User:Nikki/Panoviewer.js]] * * @license CC0*/(function(){'use strict';varprop='P4640';mw.hook('wikibase.entityPage.entityView.rendered').add(function(){mw.hook('wikibase.entityPage.entityLoaded').add(function(e){if(!e.claims.hasOwnProperty(prop))return;$.each(e.claims[prop],function(i,v){varfile=v.mainsnak.datavalue.value.replace(/ /g,'_'),url='https://panoviewer.toolforge.org/#'+file,parentelement=$(document.getElementById(v.id)).find('.thumb'),imgelement=$(parentelement).find('a img'),width=imgelement.attr('width'),height=imgelement.attr('height');$(parentelement).append($('<a>').attr({'class':'fullscreen','href':url,'target':'_blank',}));$(parentelement).find('.image').replaceWith($('<iframe>').attr({'src':url,'width':width,'height':height,}));});});});})();