|
Dialog Widget
Dialog WidgetThis JavaScript adds a window in a HTML page. It is based on Prototype and script.aculo.us libraries. By including effects.js script, you can use script.aculo.us effects to show and hide windows. The widget has been tested on Safari, Camino, Firefox and IE6, Opera looks fine. Features
How to useTo use the Dialog Widget, add this code to the head section of the page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <style type="text/css" title="currentStyle" media="screen"> @import '<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "theme","app","css.jsp?externalApp=true")%>'; </style> <script type="text/JavaScript" src="<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "common",null,"JSlibrary.jsp")%>"> </script> <script type="text/JavaScript" src="<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "widget","dialog","dialog.js")%>"> </script> JavaScript codeInclude this code in the page:
function openDialog(){
var idailogContent='Adding the content here <b>This can even take the html code</b>';
var idialog = new dekohDialog('dialog_ID',{title:"My Dialog",height:200,width:400, content: idailogContent,topMessage:'This is sample dialog'});
}
HTML CodeInclude this code where you want to invoke the dialog: <input type='button' value='Open Dialog' onclick='JavaScript:openDialog();'/> Customizing Dialog WidgetA good guide to creating a new look and feel can be found here Create a CSS file for the dialog's look and feel and reference the new className (the default className used by the widget is 'Dekoh') as an optional parameter (see below). How to useTo customizing the Dialog Widget, add this code to the head section of the page:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <script type="text/JavaScript" src="<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "common",null,"JSlibrary.jsp")%>"> </script> <script type="text/JavaScript" src="<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "widget","dialog","dialog.js")%>"> </script> JavaScript code
<script type="text/javascript" xml:space="preserve">
function openDialog(){
var idailogContent='Adding the content here <b>This can even take the html code</b>';
var idialog = new dekohDialog('dialog_ID',{className:'YOUR_CLASS',title:"My Dialog",height:200,width:400, content: idailogContent,topMessage:'This is sample dialog'});}
</script>
HTML CodeInclude this code where you want to invoke the dialog:<input type='button' value='Open Dialog' onclick='JavaScript:openDialog();'/> Parameters used by the widgetRequired parameters
Optional parameters
Functions
AvailabilityDekoh Portal Ver 0.4.2 or later.AcknowledgementsDekoh Dialog widget is based on the prototype window (http://prototype-window.xilinus.com/) class.Attachments
|