User talk:Alex Smotrov/edittop.js

From Wikipedia, the free encyclopedia

[edit] EditTop Documentation

Script puts [edit] link above page heading. It allows you to edit the top section of the page.

It should look like the link in the top right corner of this page (absolutely positioned with CSS as an example).


Unlike other similar scripts this one doesn't check what kind of page you're own but simply looks for another [edit] link inside level 2 header below, then duplicates it. The idea is taken from the script discussed here.

Note: on pages with only level 3 headers the script will not work, but these pages should be short enough anyway.


Installation: copy to your monobook.js

  • either importScript('User:Alex_Smotrov/edittop.js');
  • or raw code from the script page


Tested in FireFox 1.5, Opera 9.10, Internet Explorer 6


If you prefer [edit] link below page heading then simply remove

if (document.getElementById('featured-star')) zero.style.marginRight = '25px'

and replace

var parent = document.getElementsByTagName('H1')[0];

with

var parent = document.getElementById('bodyContent');

Alex Smotrov 18:50, 23 March 2007 (UTC)