User talk:Danski454/unwatch.js
Appearance
AJAX?
[edit]@Danski454: Would it be possible to click to unwatch without leaving the current page? Perhaps with an AJAX method? ~★ nmaia d 10:54, 6 May 2019 (UTC)
- @NMaia: Done: just add
var unwatchAJAX = true;
to your common.js (I left the old code in for those who still want it). --Danski454 (talk) 12:16, 6 May 2019 (UTC)- Awesome, thanks! :) ~★ nmaia d 12:21, 6 May 2019 (UTC)
- @Danski454: Did I... do this right? It didn't work for me. ~★ nmaia d 12:25, 6 May 2019 (UTC)
- @NMaia: That should work, what is happening instead? Danski454 (talk) 12:31, 6 May 2019 (UTC)
- @Danski454: I'm still being directed to another page when I click [unwatch], same as before your modifications. No errors on my browser (Firefox) console. ~★ nmaia d 12:35, 6 May 2019 (UTC)
- @NMaia: That should not happen, have you tried clearing your cache? --Danski454 (talk) 12:40, 6 May 2019 (UTC)
- you should actually clear it. Danski454 (talk) 12:41, 6 May 2019 (UTC)
- @Danski454: I tried Ctrl+F5, to no avail, and then cleared cache and cookies from en.wikipedia.org, also to no avail. ~★ nmaia d 12:44, 6 May 2019 (UTC)
- @NMaia: this probably won't work, but try moving the
var unwatchAJAX = true;
before the mw.loader.load statement. Danski454 (talk) 12:49, 6 May 2019 (UTC)- @Danski454: Still didn't work. I tried using Ctrl+F5 and all. ~★ nmaia d 13:28, 6 May 2019 (UTC)
- @NMaia: this probably won't work, but try moving the
- @Danski454: I tried Ctrl+F5, to no avail, and then cleared cache and cookies from en.wikipedia.org, also to no avail. ~★ nmaia d 12:44, 6 May 2019 (UTC)
- you should actually clear it. Danski454 (talk) 12:41, 6 May 2019 (UTC)
- @NMaia: That should not happen, have you tried clearing your cache? --Danski454 (talk) 12:40, 6 May 2019 (UTC)
- @Danski454: I'm still being directed to another page when I click [unwatch], same as before your modifications. No errors on my browser (Firefox) console. ~★ nmaia d 12:35, 6 May 2019 (UTC)
- @NMaia: That should work, what is happening instead? Danski454 (talk) 12:31, 6 May 2019 (UTC)
- @Danski454: Did I... do this right? It didn't work for me. ~★ nmaia d 12:25, 6 May 2019 (UTC)
- Awesome, thanks! :) ~★ nmaia d 12:21, 6 May 2019 (UTC)
@NMaia: what happens if you run the code typeof unwatchAJAX !== "undefined" && unwatchAJAX
in the console? I'll probably need to ask WP:VPT anyway. Danski454 (talk) 13:37, 6 May 2019 (UTC)
- @Danski454: Running that returns
false
. FWIW, on meta I get the same issue. ~★ nmaia d 14:14, 6 May 2019 (UTC)- @NMaia: I think I've found it. Replace
var unwatchAJAX = true;
withwindow.unwatchAJAX = true;
. It seems that code in global.js is run in a different scope. Danski454 (talk) 14:21, 6 May 2019 (UTC)- @Danski454: It works! You rock! Thank you. You might want to document these two variables as a comment on the code for future users :) ~★ nmaia d 14:25, 6 May 2019 (UTC)
- @NMaia: I think I've found it. Replace