Pop Up Calculator Add-On
<--
Contributions to this TWiki add-on are appreciated. Please update the add-on page at
http://twiki.org/cgi-bin/view/Plugins/PopUpCalculatorAddOn or provide feedback at
http://twiki.org/cgi-bin/view/Plugins/PopUpCalculatorAddOnDev .
If you are a TWiki contributor please update the add-on in the SVN repository.
-->
Add a popup calculator to a TWiki skin
Introduction
Addressing a community of Engineers on an intranet, it is valuable to offer a popup calculator. This particular one is nice-looking and works in any modern browser (IE, Firefox) and operating system (Windows, Linux).
We got permission from the author to redistribute it:
<--/twistyPlugin twikiMakeVisibleInline--> <--/twistyPlugin-->
Usage
1. Add a calc link in any TWiki page using this code:
%INCLUDE{ "%SYSTEMWEB%.PopUpCalculatorAddOn" section="javascript" }%
%INCLUDE{ "%SYSTEMWEB%.PopUpCalculatorAddOn" section="link" }%
This will produce a link like this:
<--
calc
-->
calc
Notes:
- The
"javascript" section should be included only once; omit this include in case the calendar has been added to the skin.
- The
"link" section can be included as many times as needed. In case of the "link" section include you can build your own link text or link button, make sure the link target (e.g. anchor href parameter) points to: javascript:openPopupWin('%PUBURL%/%SYSTEMWEB%/PopUpCalculatorAddOn/popup.html')
2. Add a calc link to the skin's header so that it is available on all TWiki pages:
Follow the add-on instructions below, or add a calc link in your WebTopBar as described in TWiki:Support.ReplaceJumpWithSearch .
Add-On Installation Instructions
Note: You do not need to install anything on the browser to use this add-on. The following instructions are for the administrator who installs the add-on on the server where TWiki is running.
- Download the ZIP file from the Add-on Home (see below)
- Unzip
PopUpCalculatorAddOn.zip in your twiki directory
- Edit your templates/twiki.pattern.tmpl, look where it defines SCRIPT, and add:
%TMPL:DEF{"script"}%
<script type="text/javascript">
<!-- <pre> HIDE
var popupWin;
function openPopupWin(addr)
{
if(popupWin)
popupWin.close();
var chasm = screen.availWidth;
var mount = screen.availHeight;
var w = 240;
var h = 410;
popupWin=window.open(addr,'popupWin','status=no, width=' + w + ',height=' + h + ',left='
+ ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5));
}
// </pre> HIDE -->
</script>
- Edit your TWiki.WebTopBar and somewhere add the following code:
<a href="javascript:openPopupWin('%PUBURL%/%SYSTEMWEB%/PopUpCalculatorAddOn/popup.html')">calc</a>
- Et voila, you now have a popup calculator on all your pages. Enjoy.
Add-On Info
- Set SHORTDESCRIPTION = Add a popup calculator to a TWiki skin
Related Topic: TWikiAddOns
META FILEATTACHMENT |
attr="h" comment="Screenshot" date="1100676273" name="Calculator.gif" path="Calculator.gif" size="15706" user="TWikiContributor" version="1" |
|