~oh-dev/openhealth/phit-tools

« back to all changes in this revision

Viewing changes to ihris-suite/lib/i2ce/modules/MooTools/modules/Core/tests/test_window.html

  • Committer: litlfred at ibiblio
  • Date: 2009-10-26 13:55:16 UTC
  • Revision ID: litlfred@ibiblio.org-20091026135516-7er0260tad01febt
ihris suite updated to 4.0.1 pre-release...
follows that did not get added on the last attempt did this time... the problem is that bzr does not like to include branches in a sub-directory even if you add them in which 
  is how ihris-suite/lib/* was structed.  so i had to move ihris-suite/lib/*/.bzr to ihris-suite/lib/*/.bzr_dir to trick it
the site will now succesfully install.  have not attempted change the root drive letter yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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">
 
3
<html>
 
4
  <head>
 
5
    <title>Window Test</title>
 
6
    <script src='../../../scripts/mootools-core.js' type='text/javascript'>
 
7
    </script>
 
8
    <script src='../../../scripts/mootools-more.js' type='text/javascript'>
 
9
    </script>
 
10
    <script src='../scripts/I2CE_ClassValues.js' type='text/javascript'>
 
11
    </script>
 
12
    <script src='../scripts/I2CE_Window.js' type='text/javascript'>
 
13
    </script>
 
14
    <script type='text/javascript'>
 
15
      var windows = new Hash();
 
16
 
 
17
      function createAndShowWindow(id,options) {
 
18
        if (windows.has(id)) {
 
19
           alert('already created ' + id);
 
20
        } else {
 
21
          if (!options) {
 
22
            options = {};
 
23
          }
 
24
          var my_window = new I2CE_Window(id,options);
 
25
          if (!my_window) {
 
26
             alert('bad window');
 
27
             return false;
 
28
           }
 
29
           windows.set(id,my_window);
 
30
        }
 
31
        windows.get(id).show();
 
32
        return false;
 
33
 
 
34
      }
 
35
 
 
36
    </script>
 
37
  </head>
 
38
  <body>
 
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.
 
41
    <ul>
 
42
      <li>
 
43
        Class Options:  
 
44
        <br/>The following are the options that  can be set in the window's constuctor
 
45
        <ul>
 
46
          <li>
 
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
 
49
          </li>
 
50
          <li>
 
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
 
53
          </li>
 
54
          <li>
 
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
 
57
          </li>
 
58
          <li>
 
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
 
61
          </li>
 
62
          <li>
 
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
 
64
          </li>
 
65
          <li>
 
66
            windowDragContainer: false,  the container to limit dragging to. Defaults to false meaning there is no containment
 
67
          </li>
 
68
          <li>
 
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
 
71
          </li>
 
72
          <li>
 
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)
 
75
          </li>
 
76
          <li>
 
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
 
78
          </li>
 
79
          <li>
 
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 
 
83
          </li>
 
84
          <li>
 
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 
 
87
          </li>
 
88
          <li>
 
89
            windowZIndex: 50000,  the default z-index set for a floating window
 
90
          </li>
 
91
          <li>
 
92
            windowRepositions: false,  set to true to reposition a floating  window on a scroll/pgup event
 
93
          </li>
 
94
          <li>
 
95
            windowRepositionMorphDuration: 50, 
 
96
          </li>
 
97
          <li>
 
98
            windowLeftPad: 10,
 
99
          </li>
 
100
          <li>
 
101
            windowRightPad: 10,
 
102
          </li>
 
103
          <li>
 
104
            windowTopPad: 10,
 
105
          </li>
 
106
          <li>
 
107
            windowBottomPad: 10,
 
108
          </li>
 
109
          <li>
 
110
            windowHideOnKeys: [],  For example, 27=escape, 18=CTRL-W
 
111
          </li>
 
112
          <li>
 
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
 
115
          </li>
 
116
        </ul>
 
117
      </li>
 
118
      <li>Optional: I2CE_ClassHash.js.  If present, window options can be loaded from the class hash values.
 
119
      </li>
 
120
    </ul>
 
121
    <h2 class='title'>Tests</h2>
 
122
    <ul>
 
123
      <li>
 
124
        <a href='' onclick='return createAndShowWindow("default_window")'>Default Window</a>
 
125
        <div style='display:none;background:gray' id='default_window'>
 
126
          <div>
 
127
            The content of the default window
 
128
            <ul>
 
129
              <li>
 
130
                You should be able to <span class='window_hide' style='background:lime'>close</span> me.
 
131
              </li>
 
132
              <li>
 
133
                You should be able to <span class='window_hide' style='background:red'>also close</span> me.
 
134
              </li>
 
135
              <li>
 
136
                You should be able to <span class='window_hide' style='background:yellow'>close 3</span> me.
 
137
              </li>
 
138
            </ul>
 
139
          </div>
 
140
        </div>
 
141
      </li>
 
142
      <li>
 
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.
 
147
        </span>
 
148
      </li>
 
149
 
 
150
      <li>
 
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
 
154
          <br/>
 
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.
 
157
        </span>
 
158
      </li>
 
159
 
 
160
      <li>
 
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.
 
164
          <br/>
 
165
          The content of the floating draggable window.
 
166
          <br/>
 
167
          This window should reposition on a scroll/resize.
 
168
          <br/>
 
169
          You should be able to <span class='window_hide'  style='background:blue'>close</span> me.
 
170
        </span>
 
171
      </li>
 
172
 
 
173
 
 
174
      <li>
 
175
        <a href='' onclick='return createAndShowWindow("floatdrag_window_norepo")'>Floating Draggable Window by class value.  Does not reposition</a>
 
176
        
 
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.
 
179
          <br/>
 
180
          The content of the floating draggable window 
 
181
          <br/>
 
182
          You should be able to <span class='window_hide'  style='background:blue'>close</span> me.
 
183
          <br/>Hitting escape should also close me
 
184
        </span>
 
185
      </li>
 
186
 
 
187
 
 
188
    </ul>
 
189
  </body>
 
190
</html>