MediaWiki:Common.js
From LSJ
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
$(document).ready(function() { if(mw.config.get("wgCanonicalNamespace") == "") { var subjectName; var pageName = mw.config.get("wgPageName"); if(pageName.charAt(pageName.length - 1) == ")") { subjectName = pageName.substring(0, pageName.lastIndexOf("(") - 1); } else { subjectName = pageName; } var newNode = " <a href='https://www.google.com/search?q=%22" + encodeURIComponent(subjectName.replace(/_/g, " ")).replace(/'/g,"%27") + "%22 +-lsj.gr' target='_blank' rel='noopener, noreferrer, nofollow'><span style='font-size:x-small;'>Search Google</span></a>" $("#firstHeading").append(newNode); } });