JSPopupPlugin allows you to show dynamic content in a virtual popup dialog.
Good for status messages, or to show detailed information without causing the
web browser's context to switch from the page that they requested.
Uses Foswiki:Extensions.YahooUserInterfaceContrib
It uses javascript to create a popup window containing either a hidden pre-rendered
part of a topic, or a Foswiki request that is dynamically requested and served.
Popups are activated either on a mouse click, when the mouse passes over the anchor, or when the page is loaded.
To make it easy for System.Skins developers, any html link with the css foswikiPopupLink class will get a popup dialog.
If the Javascript fails, or this plugin is disabled, the link will gracefully fall back to going to the link in the main browser window.
use the foswikiPopupLink class to get popup dialog elements on urls that can degrade gracefully for users without javascript.
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
css foswikiPopupLink class
Any element with the foswikiPopupLink will get an onClick handler that will popup a YUI dialog. This dialog will be filled with content from the server (using the href attribute), requested dynamically.
%POPUP{}%
parameters are
anchor="" - the text that is the click target that causes the POPUP to come up
(if this is not set, or an empty string, then the popup is shown on page load REMEMBER, only one popup open at a time)
anchortype="" - type of anchor trigger - [onclick,onmouseover,popuplink] ('onclick' is default)
onclick - surrounds anchor with a html span, with an onclick action
onmouseover - surrounds anchor with a html span, with an onmouseover action
popuplink - makes an ajax popup with non-javascript fallback eg: <a href="fallbackurl" onclick="return foswiki.jspopupOpen("popuptext")" > anchor < /a >
fallbackurl="" - the href url to use for non-javascript browsers (defaults to popuptext
popuptitle="" - what will be displayed in the popup title (not shown if border="off")
popuptext="" - what will be displayed in the popup
popuptexttype ="" - tml, rest
popuplocation="" - general location relative to the anchor (center, below) - center is default
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
delay=200 - used as the delay in mS if the anchortype='mouseover'
%POPUPLINK%
POPUPLINK is useful for creating popup alternatives (with fallback) to enquiry or action pages, such as Raw topic view. Instead of leaving the foswiki topic to see what the markup is
the user is able to quickly see the WikiMarkup, and then cancel back to the normal topic view.
%POPUPLINK{"Attach" url="" }%
DEFAULT - the text the user sees on the page as a link
url - the url the link goes to.
if the browser has javascript, and the YahooUserInterface components work, this will a popup dialog will contain the output of that url (using foswiki's ?cover=popup)
if the popup does not work, the clicking the link will goto that page in the browser
Plugin Settings
Plugin settings are stored as preferences variables. To reference
a plugin setting write %<plugin>_<setting>%, i.e. %JSPOPUPPLUGIN_SHORTDESCRIPTION%
Set SHORTDESCRIPTION = Creates a dynamic popup windows using Javascript
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 Foswiki is running.
Download the ZIP file from the Plugin web (see below)
Unzip JSPopupPlugin.zip in your foswiki installation directory. Content: