Difference between revisions of "Add Button Extension"

From assela Pathirana
Jump to navigationJump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
==This page is outdated==
Keeping it only for historical purposes. Don't use the tools listed here any more.
{{Wbox|There has been a bug in the extension. Thanks for all users who pointed this out to me. The mod is simple. Just change the line 60 of
<tt>AddButtonExtension.php</tt> file from
<nowiki>
</nowiki>
<pre><nowiki>
$text=$vars.submit
</nowiki></pre>
to
<nowiki>
</nowiki>
<pre><nowiki>
$text=$vars."
</nowiki></pre>
Thanks to those who pointed this out to me.
}}
==Context and Purpose==
==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  [[A_Productive_Desktop_Environment_for_Scientists_and_Engineers_-_Part_III#My_experience_with_Vim|vim]] can be enahanced with all sorts of macros and programs to aid fast editing.  
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  [[A_Productive_Desktop_Environment_for_Scientists_and_Engineers_-_Part_III#My_experience_with_Vim|vim]] can be enahanced with all sorts of macros and programs to aid fast editing.  
Line 19: Line 38:
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 <tt>addButtonsHere.js</tt> of the package and providing new button graphics as needed. For example: <tt>commentbutton.jpg</tt> contains the image necessary to make the fouth button (HTML comment).  
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 <tt>addButtonsHere.js</tt> of the package and providing new button graphics as needed. For example: <tt>commentbutton.jpg</tt> contains the image necessary to make the fouth button (HTML comment).  
The part of code that activates this button is  
The part of code that activates this button is  
<pre>  
<pre>  
buttonpara[2]=new Array(function insertTag()
buttonpara[2]=new Array(function insertTag()
Line 26: Line 46:


So, if one wants to add a button that creats a link to perform a google search on the selected word/phrase:  
So, if one wants to add a button that creats a link to perform a google search on the selected word/phrase:  
<pre>  
<pre>  
buttonpara[2]=new Array(function insertTag()
buttonpara[2]=new Array(function insertTag()
Line 35: Line 56:


==Installation==
==Installation==
# Download the program: [[:Media:AddButtonExtension.0.2.tar.gz|AddButtonExtension.0.2.tar.gz]] (Deprecated versions: [[:Media:AddButtonExtension.0.1.tar.gz|AddButtonExtension.0.1.tar.gz]])
# Download the program: [[:Media:AddButtonExtension.0.3.tar.gz|AddButtonExtension.0.3.tar.gz]] (Deprecated versions: [[:Media:AddButtonExtension.0.1.tar.gz|AddButtonExtension.0.1.tar.gz]])
# Expand it in the <tt>extensions</tt> folder.
# Expand it in the <tt>extensions</tt> folder.
# Add the lines to call the extension to <tt>LocalSettings.php</tt>
# Add the lines to call the extension to <tt>LocalSettings.php</tt>
<pre>
<pre>
#settings for AddButtonExtension
#settings for AddButtonExtension
Line 57: Line 79:
{{my_contact}}
{{my_contact}}


[[Category:Computing]][[Category:Mediawiki]]
[[Category:Mediawiki Extensions]]

Latest revision as of 05:48, 11 May 2020

This page is outdated

Keeping it only for historical purposes. Don't use the tools listed here any more.


Red warning.gif

There has been a bug in the extension. Thanks for all users who pointed this out to me. The mod is simple. Just change the line 60 of AddButtonExtension.php file from

$text=$vars.submit

to

$text=$vars."

Thanks to those who pointed this out to me.

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

Add Button Extension at work.

In addition to the standard Mediawiki editor buttons (Bold, Italic, ...,Sign,Line) this extensino adds five additional buttons.

  1. Terminal Type Text.
  2. Pre-formatted text.
  3. Stike-out text.
  4. HTML comments (hiding text.)
  5. 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

  1. Download the program: AddButtonExtension.0.3.tar.gz (Deprecated versions: AddButtonExtension.0.1.tar.gz)
  2. Expand it in the extensions folder.
  3. 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!

Please Contribute

If you have any ideas for useful button to be added:

  1. Create the graphic
  2. Suggest the line to be added to addButtonsHere.js> file.
  3. Send them to me.

I will add suitable ones to the standard package (Of course you will be acknowleged.)

Please use this e-mail address 3tv-assela@pathirana.net to contact me, if needed.

(Confused about the strange letters in the e-mail address? Wondering whether to put this address to your contact list? Please read Site FAQ)