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.
// Google images and TinEye search gadget for mobile code starts$.when(mw.loader.using(['oojs-ui-core','oojs-ui.styles.icons-interactions'])).then(function(){//Only load in file pages in view action that have a file (not file redirects)if(mw.config.get('wgNamespaceNumber')==6&&mw.config.get('wgAction')==="view"&&document.getElementById('file')&&mw.config.get('skin')==='minerva'){//Some return conditionsvarimg=document.getElementById('file').getElementsByTagName('img');if(!img||!img.length)return;// No preview image, e.g. for large PNGsimg=img[0];varimgURL=img.parentNode.href;if(!imgURL)return;// This occurs with thumbs of videos/sounds for instanceif(img.width<=300)imgURL=img.src;// Image smaller than 300px widthelse{// Get thumb urlvarn=imgURL.indexOf("/commons/")+9;imgURL=imgURL.substr(0,n)+"thumb/"+imgURL.substr(n);n=imgURL.lastIndexOf('/')+1;imgURL+="/300px-"+imgURL.substring(n);if(!imgURL.slice(-3).indexOf("svg"))imgURL+=".png";}//Button construction startvargimage='https://www.google.com/searchbyimage?image_url='+encodeURIComponent(imgURL),tineye='https://tineye.com/search?sort=size&order=desc&url='+encodeURIComponent(imgURL),gimageBtn=newOO.ui.ButtonWidget({label:'Google images',href:gimage,icon:'search',target:'_blank',title:'Find copies and similar images using Google images search'}),tineyeBtn=newOO.ui.ButtonWidget({label:'TinEye',href:tineye,icon:'search',target:'_blank',title:'Find copies and similar images using TinEye search'});//Append the button to siteNotice div id. Change link order here.$("#siteNotice").append(gimageBtn.$element,tineyeBtn.$element);}});