I'm having trouble getting a simple one-line User JS working on Wiktionary.
$('#p-navigation').removeClass('first persistent').addClass('collapsed');
It works fine from Google Chrome's dev console. It makes the navigation portal collapsible like the other portals in the sidebar.
But when I add it to my User:XXX/vector.js the result is not the same. The class I add is there but the ones I remove are also still there and the result is the standard navigation portal.
I suspect there is some other js executed after the user's vector.js but I'm not sure how to check that.
I have tried setting a breakpoint on the node in Google Chrome's dev tools and reloading the page, but it is never triggered.
Apologies if this is not the right mailing list. None of the lists seemed fit according to http://www.mediawiki.org/wiki/Mailing_lists
Andrew Dunbar (hippietrail)
Andrew Dunbar schrieb:
I'm having trouble getting a simple one-line User JS working on Wiktionary.
Apologies if this is not the right mailing list. None of the lists seemed fit according to http://www.mediawiki.org/wiki/Mailing_lists
I think the http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts would be a better place to discuss. Even though it's not Wiktionary, you should find the (user-)JS gurus there :-)
Apart from that, I guess your code interferes with the ext.vector.collapsibleNav.js module. Waiting for it (with mw.loader.using) before executing your snippet should work.
regards, Bergi
On 6 June 2012 13:57, Bergi a.d.bergi@web.de wrote:
Andrew Dunbar schrieb:
I'm having trouble getting a simple one-line User JS working on Wiktionary.
Apologies if this is not the right mailing list. None of the lists seemed fit according to http://www.mediawiki.org/wiki/Mailing_lists
I think the http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts would be a better place to discuss. Even though it's not Wiktionary, you should find the (user-)JS gurus there :-)
Apart from that, I guess your code interferes with the ext.vector.collapsibleNav.js module. Waiting for it (with mw.loader.using) before executing your snippet should work.
Thanks for both parts of your answer. Your tip worked perfectly and I know where to ask next time.
Andrew Dunbar (hippietrail)
regards, Bergi
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org