tags:

views:

74

answers:

1

Hi im trying to build a mediawiki extension which requires AJAX calls during editing a page. All I need is to add a new edit button on the edit page which displays a javascript popup editor which in turn makes the appropriate calls.

I need to know if it is feasible in Mediawiki, to inject javascrpt code into edit buttons.

Any kind of information or leads are welcome!

+2  A: 

Ok clearly the question is very specific, tht no one cared to answer. so if some one else wants to know how to add custom edit buttons in Mediawiki, this is how I did it

I found a Mediawiki help page which asks the user to edit a particular javascript page located at http://(wiki-site-url)/Mediawiki:Comomn.js . On closer inspection this is not an actual js page but a normal wikipage(stored in the database as wikitext) which is loaded by mediawiki during runtime. The site admin can edit this page by adding

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
 "imageFile": "<path-to-image-on-the-server>",
 "speedTip": "Comment visible only for editors",
 "tagOpen": "open tag",
 "tagClose": "closing tag",
 "sampleText": "Insert comment here"}
}

This can also be achieved for a single user by applying the same edit on the users own copy of the js file available at http://(wiki-site-url/User:(Your_username)/(skinname).js

Both the js pages could be created if they dont already exist.

pradeep122
This method works fine for adding simple buttons. But if you want to add more complex buttons with popups please refer to the page on XEB(Extra Edit Buttons)(http://en.wikipedia.org/wiki/User:MarkS/Extra_edit_buttons) and the actual JS soruce (http://en.wikipedia.org/wiki/User:MarkS/extraeditbuttons.js)
pradeep122
Thanks for coming back and sharing your knowledge here, pradeep!
Mark Robinson