key Log In or Register to edit

JS Popup Plugin TWiki Plugin

Uses javascript to create a popup window containing either a hiden pre-rendered part of a topic, or a TWiki request that is dynamically requested and served.

This will allow you to create a popup Comment Edit box:

%POPUP{anchor="<span class='twikiButton'>add comment</span>" popuptext="%COMMENT%" popuptexttype="tml"}%

or a popup menu of webs

%POPUP{
anchor=" *listofwebs* " 
anchortype="onmouseover" 
popuptext="%WEBLIST{"| [[$name.WebHome][$name]] |"}%" 
popuptexttype="tml" 
popuplocation="below"
border="off"}%

there is only one popup window at a time, so if the clicks on an anchor while another popup is up, it will be replaced by the new one.

Syntax Rules

%POPUP{}%

parameters are

  • anchor="" - the text that is the click target that causes the POPUP to come up
  • anchortype="" - action done to trigger the popup - onclick,onmouseover ('onclick' is default)
  • popuptext="" - what will be displayed in the popup
  • popuptexttype ="" - tml, rest the rest Option requires the Dojo Toolkit Contrib to be installed, delayedtml TODO, javascript TODO
  • popuplocation="" - general location relative to the anchor (center, above, below, left, right) - center is default TODO: only center and below are implemented
    • TODO: its currently relative to the mouse event, not the anchor
    • TODO: add location on screen, not- relative to mouse.. (popup in top right)
  • buttons="" - what buttons to show (ok, cancel, save...) TODO
  • border="" - show the border & close button (defaults to 'on') - if you select not to show the border and close button then there is an onmouseleave that closes the window

TODO: should cache the answers, cos its not worth re-requesting attach twice withing a few seconds

TODO: look at JSAN-ing it all

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %JSPOPUPPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the Text Formatting Rules topic:
    • Set SHORTDESCRIPTION = Creates a dynamic popup window

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip JSPopupPlugin.zip in your twiki installation directory. Content: File:Description:data/TWiki/JSPopupPlugin.txt Plugin topic data/TWiki/JSPopupPlugin.txt,v Plugin topic repository lib/TWiki/Plugins/JSPopupPlugin.pm Plugin Perl module
  • use the configure script to enable the Wysiwyg Plugin and Inline Edit Plugin
  • Test if the installation was successful:
    • double click in a topic you have permission to edit.

Plugin Info

Plugin Author: TWiki:Main.SvenDowideit - SvenDowideit@wikiring.com - WikiRing.com
uses Ajax Toolbox? © & Author: Matt Kruse <matt@ajaxtoolbox.com> http://www.AjaxToolbox.com/
Copyright: © 2001-2006, SvenDowideit@wikiring.com
License: GPL (GNU General Public License)
Plugin Version: 01 May 2006
Change History:  
01 May 2006: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/JSPopupPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/JSPopupPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/JSPopupPluginAppraisal

Related Topics: T Wiki Plugins, Developer Documentation Category, Admin Documentation Category, T Wiki Preferences

-- SvenDowideit@wikiring.com - WikiRing.com

toggleopenShow attachmentstogglecloseHide attachments
Topic attachments
I Attachment Action Size Date Who Comment
jsjs JSPopupPlugin.js manage 7.4 K 05 Jul 2006 - 03:41 Unknown User  
jsjs json.js manage 3.9 K 05 Jul 2006 - 03:41 Unknown User  
jsjs AjaxRequest.js manage 16.7 K 05 Jul 2006 - 03:41 Unknown User  
 
Ad Sponsor
Back to Redbourn
Copyright © We make no guarantee of the correctness of the content of this site. All material on this collaboration platform is the property of Martin Cleaver and the contributing authors.