Jump to content

MediaWiki talk:Gadget-addsection-plus.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mattflaschen (talk | contribs) at 12:13, 20 April 2008 (provide code). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

{{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)[reply]

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 wiktionary:Talk:Main Page. However, I'm not sure what the cause of this is. Superm401 - Talk 10:22, 20 April 2008 (UTC)[reply]

I found it. The padding on the "+"/"new section" tab was increased in MediaWiki:monobook.js. Superm401 - Talk 11:42, 20 April 2008 (UTC)[reply]
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. Superm401 - Talk 12:13, 20 April 2008 (UTC)[reply]