Difference between revisions of "Add Button Extension"
Line 31: | Line 31: | ||
"google.jpg","Google"); | "google.jpg","Google"); | ||
</pre> | </pre> | ||
Of course we need a suitable button graphic in the file google.jpg. | |||
==Installation== | |||
# Download the program: [[Image:AddButtonExtension.0.1.tar.gz]] | |||
# Expand it in the <tt>extensions</tt> folder. | |||
# Add the lines to call the extension to <tt>LocalSettings.php</tt> | |||
<pre> | |||
#settings for AddButtonExtension | |||
$wgAddButtonExtensionPath = "extensions/AddButtonExtension"; | |||
include_once("$IP/$wgAddButtonExtensionPath/AddButtonExtension.php"); | |||
#end settings for AddButtonExtension | |||
</pre> | |||
That's it! | |||
[[Category:Computing]][[Category:Mediawiki]] |
Revision as of 14:22, 8 September 2006
Context and Purpose
Efficient editing aids can go a long way in making the expanding and improving a wiki easy. There are several html/wiki tags that I use very often on a page. Stopping to add these tags to my text is sometimes distracting. One of the good solutions will be to use an external editor to edit your wikis. For example an advanced editor like vim can be enahanced with all sorts of macros and programs to aid fast editing.
But, another is to add button's whose task is to add those frequently used commands. This is what Add Button Extension does.
What it does
In addition to the standard Mediawiki editor buttons (Bold, Italic, ...,Sign,Line) this extensino adds five additional buttons.
- Terminal Type Text.
- Pre-formatted text.
- Stike-out text.
- HTML comments (hiding text.)
- Linking a keyword to wikipedia.(see Note:).
Note: Of course your interwiki table should have an entry called wikipedia: for this to work.
What it can do
The beauty of this scheme is that it is possible to add (even remove) any number of editor buttons, that are linked to different actions. This is done by changing the file addButtonsHere.js of the package and providing new button graphics as needed. For example: commentbutton.jpg contains the image necessary to make the fouth button (HTML comment). The part of code that activates this button is
buttonpara[2]=new Array(function insertTag() { insertTags("{{strike|","}}","striked out"); }, "strikebutton.jpg","Strike Out");
So, if one wants to add a button that creats a link to perform a google search on the selected word/phrase:
buttonpara[2]=new Array(function insertTag() { insertTags("[http://www.google.com/search?as_q=","]","striked out"); }, "google.jpg","Google");
Of course we need a suitable button graphic in the file google.jpg.
Installation
- Download the program: File:AddButtonExtension.0.1.tar.gz
- Expand it in the extensions folder.
- Add the lines to call the extension to LocalSettings.php
#settings for AddButtonExtension $wgAddButtonExtensionPath = "extensions/AddButtonExtension"; include_once("$IP/$wgAddButtonExtensionPath/AddButtonExtension.php"); #end settings for AddButtonExtension
That's it!