MediaWiki talk:InterProject.js
Loaded via MediaWiki:Common.js. |
Vector.js
Here's the respective part from vector.js:
function toggle($element) { $j.cookie('vector-nav-' + $element.parent().attr('id'), $element.parent().is('.collapsed'), { 'expires': 30, 'path': '/' }); $element.parent().toggleClass('expanded').toggleClass('collapsed').find('div.body').slideToggle('fast'); } $headings.keydown(function(event) { if (event.which == 13 || event.which == 32) { toggle($j(this)); } }).mousedown(function() { toggle($j(this)); $j(this).blur(); return false; });
--DieBuche (talk) 13:46, 24 October 2010 (UTC)
- And here's the original, including the code for setting the initial state. I'd rather like to keep reusing it instead of duplicating it if I possibly can, though. —Ilmari Karonen (talk) 01:03, 25 October 2010 (UTC)
- An here's the patched bug, which enables us to add the new submenu at any time: https://bugzilla.wikimedia.org/show_bug.cgi?id=25726 --DieBuche (talk) 23:00, 1 November 2010 (UTC)
- Wow, cool! I didn't even know jQuery could do that. Although I think that still leaves the issue of setting the initial state (based on cookies) unsolved. :( Would you happen to know some neat jQuery trick for that too? —Ilmari Karonen (talk) 01:53, 2 November 2010 (UTC)
- I don't think that's possible without further changing collapsibleNav.js. Something like this should work though:
- Wow, cool! I didn't even know jQuery could do that. Although I think that still leaves the issue of setting the initial state (based on cookies) unsolved. :( Would you happen to know some neat jQuery trick for that too? —Ilmari Karonen (talk) 01:53, 2 November 2010 (UTC)
- An here's the patched bug, which enables us to add the new submenu at any time: https://bugzilla.wikimedia.org/show_bug.cgi?id=25726 --DieBuche (talk) 23:00, 1 November 2010 (UTC)
if ($.cookie('vector-nav-p-interproject')=='true') $('#p-interproject').mousedown();
Sister projects
At Special:Recentchanges, link to "Sister projects" doesn't work. I can't find why. Similar thing happens on Meta. Any ideas? -Aleator (talk) 02:09, 29 November 2012 (UTC)
- This seems to be caused by gerrit:30361 / gerrit:34702, which replaced the h5 elements by h3. I just fixed our version of the hack at ptwiki. Helder 19:48, 20 December 2012 (UTC)
Wikibase Client
@Krinkle and Ilmari Karonen: does this script work with mw:Extension:Wikibase Client#Other projects sidebar? AFAIU that feature is going to be deployed on more and more sites, to gradually replace the old system. Hint: s:fr:Special:Diff/4387651/4517757. --Ricordisamoa 11:40, 11 August 2014 (UTC)
Cookie
@Krinkle, Ilmari Karonen, and DieBuche: , since the collapsable menu are not wokring anymore, does the following code still needed?
var state = $.cookie('vector-nav-' + interProject.id);
if (state === 'true') {
$(interProject).addClass('expanded').find('.body, .pBody').show();
} else {
$(interProject).addClass('collapsed');
}
--Andyrom75 (talk) 20:30, 3 December 2014 (UTC)
- Yes, that could be safely removed. How are things going here? --DieBuche (talk) 11:16, 6 December 2014 (UTC)