Edit Assist Extension

⚙ This extension is a Module.


This extension creates buttons above the edit text box to quickly insert creole markup (easily adapted to other markup).

Picture of extension in action.

Edit Assist picture


The code for editassist.pl follows below. This needs to be put into a new file inside your oddmuse modules directory.

You will also need to put pictures of the buttons into a directory accessible by http://Your-domain-name/images/. The images are “borrowed” from wikipedia as is the code.

Tree:stuff/edit-buttons/ (it is easier to clone the repo or download the whole repo as an archieve, rather than downloading the images one by one)


For customizing, see the “addButton” list at the bottom. This function call is fairly obvious, and can be easily changed for different markup, different image path, or to add more buttons.

Alternative Installation

The Javascript above can be put statically on the web site - along with the images. This means that the JS is cached on the browser for each edit. It also means the module is faster to run and easier to maintain.

My (Scott Penrose) change is below.

Perl Module (note that it ADDS to the HtmlHeaders - allowing config and other entries to also add to them).

push (@MyInitVariables,
      sub {
	if ($q->param('action') eq 'edit')  {
	  $HtmlHeaders .=  qq{
             <script type="text/javascript" src="/editassist.js"></script>

The Javascript - rather than putting it in here - just copy it above below (not including) the first “script” tag down to the close script, and call it something like “editassist.js” and save it somewhere sensible on your server.

EVEN EASIER - just load the .js all the time by adding it to your config file - the down side is that this JS loads each time, but it has no real effect.