User talk:Alex Smotrov/edittop.js
- either select "Add an  link for the lead section of a page" gadget in your preferences;
- or use
importScript('MediaWiki:Gadget-edittop.js')in your personal js file.
For discussion please use MediaWiki_talk:Gadget-edittop.js.
EditTop is a script that adds an  link above page heading, allowing you to edit the top section of the page.
Unlike other similar scripts that check the page you're on and then construct an  link, this script simply looks for another  link inside level 2 header below, then duplicates it. As a result:
- good: link url, name and tooltip are always correct, whatever project or user interface language is;
- good: script obeys "no-section-editing" (either in your preferences or
__NOEDITSECTION__on the page);
- bad: there's no link if the page doesn't have level 2 headers (but such pages are supposedly short enough anyway).
Script should work in all major browsers. Source code is here.
(Intro) edit summary can be added with the following code in your monobook.js:
if (wgAction=='edit' && document.URL.indexOf('§ion=0') != -1)
document.getElementById('wpSummary').value = '(Intro) '
Please do not use
/* Intro */<code> as this creates misleading non-existent section link.</small>
This works for secure.wikimedia.org, but it's a step down for me since it doesn't add a /* Intro */ or similar thing to the edit summary. Any chance of that being added? --Gwern (contribs) 21:32 19 June 2007 (GMT)
- I added it as an extra option: see above. Good luck ∴ Alex Smotrov 22:51, 19 June 2007 (UTC)