[WikiEN-l] Tool for inline section editing

Alek Storm alek.storm at gmail.com
Tue Oct 31 23:44:50 UTC 2006


I hope I'm posting in the right place.  I've written a javascript tool that
modifies the small edit links that appear at the right of each section
header to open the edit form for the section inline (without going to a
separate page).  The "Show preview" and "Show changes" buttons also work
exactly as they would normally.  After clicking "edit", the link changes to
a cancel button.  Clicking "Save page" has the normal result - the entire
page reloads with the changes.  To try it out, add this to your monobook.js:

  inc("User:Supadawg/secedit.js");
  inc("User:Supadawg/util.js");

  function inc(path) {
    var lt = String.fromCharCode(60);
    var gt = String.fromCharCode(62);
    document.writeln(lt+'script type="text/javascript"
src="/w/index.php?title='+path+'&action=raw&ctype=text/javascript&dontcountme=s"'+gt+lt+'/script'+gt);
  }

Leaving out the inc() function if you have it already, of course.  It's
tested and working on Firefox 1.5, and not working on Internet Explorer 6.0,
and only on the English Wikipedia.  If you can read javascript, I've tried
to comment the code enough to make it understandable, but it's still a
little messy.  If anyone could give me some feedback, I'd be very grateful.



More information about the WikiEN-l mailing list