User talk:Writ Keeper/Scripts/googleTitle.js

Latest comment: 6 years ago by Sam Sailor in topic Apostrophe

Legacy JavaScript edit

Hello! This script has been detected as using deprecated parameters that need to be replaced with the updated version. Examples include addOnloadHook( ... ) needs to be replaced with $( ... ) or $( function() { ... } ) (depending on use); all wgGlobalVariables need to be properly gotten with mw.config.get( 'wgGlobalVariable' ); and addPortletLink needs to be called with mw.util.addPortletLink. Please see MW:ResourceLoader/Legacy JavaScript for details. Thank you. — {{U|Technical 13}} (etc) 22:32, 19 January 2015 (UTC)Reply

search edit

I find it weird that it searched title page + Wikipedia.org.
Just change

searchNode.href = "http://www.google.com/search?q=" + encodeURIComponent(subjectName.replace(/_/g, " ")) + "+-wikipedia.org";

to

searchNode.href = "http://www.google.com/search?q=" + encodeURIComponent(subjectName.replace(/_/g, " "));

for it just to search the title page.NikolaiHo 01:44, 8 September 2016 (UTC)Reply

suggestion: add space(s) before "Google Search" edit

Hi Writ Keeper! I just "installed" your script for the first time. Definitely neat and I can imagine it saving time in the future.

I just had one suggestion: can you add some whitespace before "Google Search"? Currently, it gets scrunched up right next to the title. If you prefer to leave it as-is, do you mind if I fork the script? Thanks, = paul2520 (talk) 02:57, 29 November 2017 (UTC)Reply

Thanks for the quick response! Looks great. = paul2520 (talk) 12:50, 29 November 2017 (UTC)Reply
No problem! Happy to help. Writ Keeper  14:30, 29 November 2017 (UTC)Reply

Apostrophe edit

Hi Writ Keeper. Thank you for the many useful scripts you have made for the community! If an article title contains an apostrophe ' as in e.g. Babette's Feast, the string will be stripped for anything after the apostrophe and the search will be for Babette only. Could you fix that, please? Sam Sailor 10:05, 9 January 2018 (UTC)Reply

@Sam Sailor: Nice catch, thanks! Should be fixed now. Writ Keeper  14:29, 9 January 2018 (UTC)Reply
And it works! Thank you so much for the quick fix. Sam Sailor 19:03, 9 January 2018 (UTC)Reply