1
<?xml version="1.0" encoding="utf-8"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
<title>Window Test</title>
6
<script src='../../../scripts/mootools-core.js' type='text/javascript'>
8
<script src='../../../scripts/mootools-more.js' type='text/javascript'>
10
<script src='../scripts/I2CE_ClassValues.js' type='text/javascript'>
12
<script src='../scripts/I2CE_Window.js' type='text/javascript'>
14
<script type='text/javascript'>
15
var windows = new Hash();
17
function createAndShowWindow(id,options) {
18
if (windows.has(id)) {
19
alert('already created ' + id);
24
var my_window = new I2CE_Window(id,options);
29
windows.set(id,my_window);
31
windows.get(id).show();
39
<h2 class='title'>I2CE Window</h2>
40
Given a node, or node id, create a window object that can be opened, closed, and dragged.
44
<br/>The following are the options that can be set in the window's constuctor
47
windowShow: false, a function to call on the window when you want to show it. if false, it will set the display style to block.
48
the function should take one argument, the window element
51
windowHide: false, a function to call on the window when you want to show it. if false, it will set the display style to none
52
the function should take one argument, the window element
55
windowCheck: false, a function to call on The window when see if it is 'hidden' or 'shown' if false, it will checkthe display style state
56
to work with the default (false) windowHide and windowShow
59
the function should take one argument, the window wlement. It should also return true (if 'visible') or false (if not 'visible')
60
windowDraggable: true, make the window draggable. only applies if windowHide/Show/Check are false
63
windowDragButtonClass: 'window_drag', the class of an element to idenfity a dragging handle for a floating draggable window. Defaults to 'window_drag_handle'. only matches elements contained within the window
66
windowDragContainer: false, the container to limit dragging to. Defaults to false meaning there is no containment
69
windowFloats: false, make the window a floater (if no function is specifed) otherwise affects the style.visible propert.
70
if false, then the window is not draggable. You can also make a window not floatable by setting the class not_floats
73
windowShowClass: false, defaults to false. if set to a string, it is the class we set a window to if the window is not a floater nor a function
74
when we show the class. To set the class, both windowShowClass and windowHideClass need to be strings (possibly empty)
77
windowHideClass: false, defaults to false. if set to a string, it is the class we set window to if the window is not a floater nor a function
80
windowPositionVert: 'upper_viewable', where to place the windowmake the window vertically. only applies if windowShow is false
81
valid options 'upper_viewable' (defaul) , 'lower_viewable', 'center_viewable', 'upper', 'lower' 'center' 'mouse_above' 'mouse_below'
82
or none of these which means we dont do anything
85
windowPositionHoriz: 'center_viewable', where to place the windowmake the window vertically. only applies if windowShow is false
86
valid options 'center_viewable' (default), 'left_viewable', 'right_viewable' , 'left', 'right' 'center' or none of these which means we dont do anything
89
windowZIndex: 50000, the default z-index set for a floating window
92
windowRepositions: false, set to true to reposition a floating window on a scroll/pgup event
95
windowRepositionMorphDuration: 50,
110
windowHideOnKeys: [], For example, 27=escape, 18=CTRL-W
113
windowHideButtonClass: 'window_hide' applies to floating windows and defaults to 'window_hide'.
114
If set, it is a class we check within the window element to attach a hide on click event
118
<li>Optional: I2CE_ClassHash.js. If present, window options can be loaded from the class hash values.
121
<h2 class='title'>Tests</h2>
124
<a href='' onclick='return createAndShowWindow("default_window")'>Default Window</a>
125
<div style='display:none;background:gray' id='default_window'>
127
The content of the default window
130
You should be able to <span class='window_hide' style='background:lime'>close</span> me.
133
You should be able to <span class='window_hide' style='background:red'>also close</span> me.
136
You should be able to <span class='window_hide' style='background:yellow'>close 3</span> me.
143
<a href='' onclick='return createAndShowWindow("float_window1",{windowFloats:true})'>Floating Window by option</a>
144
<span style='display:none;background:gray' id='float_window1'>
145
The content of the floating window -- 1
146
You should be able to <input type='submit' class='window_hide' value='Close'/> me.
151
<a href='' onclick='return createAndShowWindow("float_window2")'>Floating Window by class value</a>
152
<span style='display:none;background:gray' id='float_window2' class='windowFloats=true'>
153
The content of the floating window -- 2
155
You should be able to <span class='window_hide' style='background:blue'>close</span> me.
156
You should NOT be able to <span style='background:yellow' class='window_drag'>drag</span> me.
161
<a href='' onclick='return createAndShowWindow("floatdrag_window")'>Floating Draggable Window by class value</a>
162
<span style='display:none;background:gray' id='floatdrag_window' class='windowFloats=true windowDraggable=true windowRepositions=true'>
163
You should be able to <span style='background:yellow' class='window_drag'>drag</span> me.
165
The content of the floating draggable window.
167
This window should reposition on a scroll/resize.
169
You should be able to <span class='window_hide' style='background:blue'>close</span> me.
175
<a href='' onclick='return createAndShowWindow("floatdrag_window_norepo")'>Floating Draggable Window by class value. Does not reposition</a>
177
<span style='display:none;background:gray' id='floatdrag_window_norepo' class='windowFloats=true windowDraggable=true windowHideOnKeys=[18,27]'>
178
You should be able to <span style='background:yellow' class='window_drag'>drag</span> me.
180
The content of the floating draggable window
182
You should be able to <span class='window_hide' style='background:blue'>close</span> me.
183
<br/>Hitting escape should also close me