MediaWiki talk:Gadget-addsection-plus.js
{{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, GracenotesT § 19:42, 19 April 2008 (UTC)
Extra spacing edit
Even with this running, the tab still takes up more space than I think it used to. Compare to wiktionary:Talk:Main Page. However, I'm not sure what the cause of this is. Superm401 - Talk 10:22, 20 April 2008 (UTC)
- I found it. The padding on the "+"/"new section" tab was increased in MediaWiki:monobook.js. Superm401 - Talk 11:42, 20 April 2008 (UTC)
- Code to fix this is:
var plusLink = document.getElementById("ca-addsection").firstChild; plusLink.style.paddingLeft = ".4em"; plusLink.style.paddingRight = ".4em";
- 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)
- 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. Superm401 - Talk 16:56, 20 April 2008 (UTC)
- Okay, it should be fixed now. Superm401 - Talk 17:04, 20 April 2008 (UTC)
- Actually, I don't think MediaWiki:Gadget-addsection-plus.js was ever broken. It already had the check for tab and tablink, and returned if they were null. Only the version in my user space was broken. :) I removed the gratuitous check, and then integrated the two blocks. Sorry for the confusion. Superm401 - Talk 17:08, 20 April 2008 (UTC)
- Okay, it should be fixed now. Superm401 - Talk 17:04, 20 April 2008 (UTC)
- 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. Superm401 - Talk 16:56, 20 April 2008 (UTC)
- 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)
Can we make this happen faster? edit
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 :-) ?