MediaWiki talk:Gadget-addsection-plus.js

Page contents not supported in other languages.
Source: Wikipedia, the free encyclopedia.

{{

editprotected
}}

Please replace:

if(tablink.textContent) tablink.textContent = '+';
else if(tablink.innerHTML) tablink.innerHTML = '+';

with:

tablink.firstChild.nodeValue = '+';

as it's cross-browser, less complicated, and part of the W3 core DOM-1 spec. innerHTML with XHTML can be messy. Thanks,

]

Y Done - Nihiltres{t.l} 20:46, 19 April 2008 (UTC)[reply]

Extra spacing

Even with this running, the tab still takes up more space than I think it used to. Compare to

]

I found it. The padding on the "+"/"new section" tab was increased in MediaWiki:monobook.js. ]
Code to fix this is:
var plusLink = document.getElementById("ca-addsection").firstChild;
plusLink.style.paddingLeft = ".4em";
plusLink.style.paddingRight = ".4em";
This can just be added at the end of the current function. ]
Y Done – now I have to add this to my monobook.js given the custom function I use. :) Nihiltres{t.l} 13:39, 20 April 2008 (UTC)[reply]
Sorry. I tested this on discussion pages, but neglected to notice that the code is invalid if there is no "add section" tab (e.g. on regular articles). Basically, this stops any JavaScript later on the page from working. I've commented out the code temporarily, and will put it back after I've confirmed a fix. ]
Okay, it should be fixed now. ]
Actually, I don't think ]

Can we make this happen faster?

I've turned this gadget off because I find myself intending to click on 'history' and actually clicking on 'move' because the 'new section' is changed to '+' well after it is visible.

Can we either have this gadget perform its stuff before the tabs are actually displayed, or actually change 'new section' to '+' like we did with 'discussion' to 'talk', invert people's selection of this gadget and make it do the opposite to what it does now :-) ?

Mark Hurd (talk) 04:31, 23 March 2012 (UTC)[reply]

I don't know a way to make it happen earlier. It's currently being done on ready, which is about the earliest where we can still ensure the element exists. The inversion idea is clever, but it might be tricky getting consensus. ]