Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
parent.document.title="TinyMCE_Layer.class.js Overview";
}
</script>
</head>
<body bgcolor="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
<tr align="center" valign="top">
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a> </td>
<td bgcolor="#FFFFFF" class="NavBarCell1Rev"> <font class="NavBarFont1Rev"><b>File</b></font> </td>
<td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a> </td>
</tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>
<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
PREV
NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
<a href="index.html" target="_top"><b>FRAMES</b></a>
<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
<script>
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->
<hr>
<center>
<h2>TinyMCE_Layer.class.js</h2>
</center>
<h4>Summary</h4>
<p>
No overview generated for 'TinyMCE_Layer.class.js'<BR/><BR/>
</p>
<hr>
<table border="1" cellpadding="3" cellspacing="0" width="100%">
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan=2><font size="+2">
<b>Class Summary</b>
</font></td>
</tr>
<tr bgcolor="white" class="TableRowColor">
<td width="15%"><b><a href="TinyMCE_Layer.html">TinyMCE_Layer</a></b></td>
<td> </td>
</tr>
</table>
<hr/>
<!-- ========== METHOD SUMMARY =========== -->
<!-- ========== END METHOD SUMMARY =========== -->
<pre class="sourceview"><span class="comment">/**
* $RCSfile: overview-summary-TinyMCE_Layer.class.js.html,v $
* $Revision: 1.19 $
* $Date: 2006/04/14 20:00:30 $
*
* <span class="attrib">@author</span> Moxiecode
* <span class="attrib">@copyright</span> Copyright 2004-2006, Moxiecode Systems AB, All rights reserved.
*/</span>
<span class="comment">/**
* Constructor for the TinyMCE Layer. This class enables you to construct
* floating layers that is visible on top of select input fields, flashes and iframes.
*
* <span class="attrib">@param</span> {string} id Unique ID name for the layer.
* <span class="attrib">@param</span> {boolean} bm Block mode, defaults to true.
*/</span>
<span class="reserved">function</span> TinyMCE_Layer(id, bm) {
<span class="reserved">this</span>.id = id;
<span class="reserved">this</span>.blockerElement = null;
<span class="reserved">this</span>.events = false;
<span class="reserved">this</span>.element = null;
<span class="reserved">this</span>.blockMode = typeof(bm) != <span class="literal">'undefined'</span> ? bm : true;
<span class="reserved">this</span>.doc = document;
};
TinyMCE_Layer.<span class="reserved">prototype</span> = {
<span class="comment">/**
* Moves the layer relative to the specified HTML element.
*
* <span class="attrib">@param</span> {HTMLElement} re Element to move the layer relative to.
* <span class="attrib">@param</span> {string} p Position of the layer tl = top left, tr = top right, bl = bottom left, br = bottom right.
*/</span>
moveRelativeTo : <span class="reserved">function</span>(re, p) {
var rep = <span class="reserved">this</span>.getAbsPosition(re);
var w = parseInt(re.offsetWidth);
var h = parseInt(re.offsetHeight);
var e = <span class="reserved">this</span>.getElement();
var ew = parseInt(e.offsetWidth);
var eh = parseInt(e.offsetHeight);
var x, y;
switch (p) {
case <span class="literal">"tl"</span>:
x = rep.absLeft;
y = rep.absTop;
break;
case <span class="literal">"tr"</span>:
x = rep.absLeft + w;
y = rep.absTop;
break;
case <span class="literal">"bl"</span>:
x = rep.absLeft;
y = rep.absTop + h;
break;
case <span class="literal">"br"</span>:
x = rep.absLeft + w;
y = rep.absTop + h;
break;
case <span class="literal">"cc"</span>:
x = rep.absLeft + (w / 2) - (ew / 2);
y = rep.absTop + (h / 2) - (eh / 2);
break;
}
<span class="reserved">this</span>.moveTo(x, y);
},
<span class="comment">/**
* Moves the layer relative in pixels.
*
* <span class="attrib">@param</span> {int} x Horizontal relative position in pixels.
* <span class="attrib">@param</span> {int} y Vertical relative position in pixels.
*/</span>
moveBy : <span class="reserved">function</span>(x, y) {
var e = <span class="reserved">this</span>.getElement();
<span class="reserved">this</span>.moveTo(parseInt(e.style.left) + x, parseInt(e.style.top) + y);
},
<span class="comment">/**
* Moves the layer absolute in pixels.
*
* <span class="attrib">@param</span> {int} x Horizontal absolute position in pixels.
* <span class="attrib">@param</span> {int} y Vertical absolute position in pixels.
*/</span>
moveTo : <span class="reserved">function</span>(x, y) {
var e = <span class="reserved">this</span>.getElement();
e.style.left = x + <span class="literal">"px"</span>;
e.style.top = y + <span class="literal">"px"</span>;
<span class="reserved">this</span>.updateBlocker();
},
<span class="comment">/**
* Resizes the layer by the specified relative width and height.
*
* <span class="attrib">@param</span> {int} w Relative width value.
* <span class="attrib">@param</span> {int} h Relative height value.
*/</span>
resizeBy : <span class="reserved">function</span>(w, h) {
var e = <span class="reserved">this</span>.getElement();
<span class="reserved">this</span>.resizeTo(parseInt(e.style.width) + w, parseInt(e.style.height) + h);
},
<span class="comment">/**
* Resizes the layer to the specified width and height.
*
* <span class="attrib">@param</span> {int} w Width value.
* <span class="attrib">@param</span> {int} h Height value.
*/</span>
resizeTo : <span class="reserved">function</span>(w, h) {
var e = <span class="reserved">this</span>.getElement();
<span class="reserved">if</span> (w != null)
e.style.width = w + <span class="literal">"px"</span>;
<span class="reserved">if</span> (h != null)
e.style.height = h + <span class="literal">"px"</span>;
<span class="reserved">this</span>.updateBlocker();
},
<span class="comment">/**
* Shows the layer.
*/</span>
show : <span class="reserved">function</span>() {
<span class="reserved">this</span>.getElement().style.display = <span class="literal">'block'</span>;
<span class="reserved">this</span>.updateBlocker();
},
<span class="comment">/**
* Hides the layer.
*/</span>
hide : <span class="reserved">function</span>() {
<span class="reserved">this</span>.getElement().style.display = <span class="literal">'none'</span>;
<span class="reserved">this</span>.updateBlocker();
},
<span class="comment">/**
* Returns true/false if the layer is visible or not.
*
* <span class="attrib">@return</span> true/false if it's visible or not.
* <span class="attrib">@type</span> boolean
*/</span>
isVisible : <span class="reserved">function</span>() {
<span class="reserved">return</span> <span class="reserved">this</span>.getElement().style.display == <span class="literal">'block'</span>;
},
<span class="comment">/**
* Returns the DOM element that the layer is binded to.
*
* <span class="attrib">@return</span> DOM HTML element.
* <span class="attrib">@type</span> HTMLElement
*/</span>
getElement : <span class="reserved">function</span>() {
<span class="reserved">if</span> (!<span class="reserved">this</span>.element)
<span class="reserved">this</span>.element = <span class="reserved">this</span>.doc.getElementById(<span class="reserved">this</span>.id);
<span class="reserved">return</span> <span class="reserved">this</span>.element;
},
<span class="comment">/**
* Sets the block mode. If you set this property to true a control box blocker iframe
* will be added to the document since MSIE has a issue where select boxes are visible
* through layers.
*
* <span class="attrib">@param</span> {boolean} s Block mode state, true is the default value.
*/</span>
setBlockMode : <span class="reserved">function</span>(s) {
<span class="reserved">this</span>.blockMode = s;
},
<span class="comment">/**
* Updates the select/iframe/flash blocker this will also block the caret in Firefox.
*/</span>
updateBlocker : <span class="reserved">function</span>() {
var e, b, x, y, w, h;
b = <span class="reserved">this</span>.getBlocker();
<span class="reserved">if</span> (b) {
<span class="reserved">if</span> (<span class="reserved">this</span>.blockMode) {
e = <span class="reserved">this</span>.getElement();
x = <span class="reserved">this</span>.parseInt(e.style.left);
y = <span class="reserved">this</span>.parseInt(e.style.top);
w = <span class="reserved">this</span>.parseInt(e.offsetWidth);
h = <span class="reserved">this</span>.parseInt(e.offsetHeight);
b.style.left = x + <span class="literal">'px'</span>;
b.style.top = y + <span class="literal">'px'</span>;
b.style.width = w + <span class="literal">'px'</span>;
b.style.height = h + <span class="literal">'px'</span>;
b.style.display = e.style.display;
} <span class="reserved">else</span>
b.style.display = <span class="literal">'none'</span>;
}
},
<span class="comment">/**
* Returns the blocker DOM element, this is a invisible iframe.
*
* <span class="attrib">@return</span> DOM HTML element.
* <span class="attrib">@type</span> HTMLElement
*/</span>
getBlocker : <span class="reserved">function</span>() {
var d, b;
<span class="reserved">if</span> (!<span class="reserved">this</span>.blockerElement && <span class="reserved">this</span>.blockMode) {
d = <span class="reserved">this</span>.doc;
b = d.createElement(<span class="literal">"iframe"</span>);
b.style.cssText = <span class="literal">'display: none; position: absolute; left: 0; top: 0'</span>;
b.src = <span class="literal">'javascript:false;'</span>;
b.frameBorder = <span class="literal">'0'</span>;
b.scrolling = <span class="literal">'no'</span>;
d.body.appendChild(b);
<span class="reserved">this</span>.blockerElement = b;
}
<span class="reserved">return</span> <span class="reserved">this</span>.blockerElement;
},
<span class="comment">/**
* Returns the absolute x, y cordinate of the specified node.
*
* <span class="attrib">@param</span> {DOMElement} n DOM node to retrive x, y of.
* <span class="attrib">@return</span> Object containing absLeft and absTop properties.
* <span class="attrib">@type</span> Object
*/</span>
getAbsPosition : <span class="reserved">function</span>(n) {
var p = {absLeft : 0, absTop : 0};
<span class="reserved">while</span> (n) {
p.absLeft += n.offsetLeft;
p.absTop += n.offsetTop;
n = n.offsetParent;
}
<span class="reserved">return</span> p;
},
<span class="comment">/**
* Creates a element for the layer based on the id and specified name.
*
* <span class="attrib">@param</span> {string} n Element tag name, like div.
* <span class="attrib">@param</span> {string} c Optional class name to set as class attribute value.
* <span class="attrib">@param</span> {HTMLElement} p Optional parent element reference, defaults to body.
* <span class="attrib">@return</span> HTML DOM element that got created.
* <span class="attrib">@type</span> HTMLElement
*/</span>
create : <span class="reserved">function</span>(n, c, p) {
var d = <span class="reserved">this</span>.doc, e = d.createElement(n);
e.setAttribute(<span class="literal">'id'</span>, <span class="reserved">this</span>.id);
<span class="reserved">if</span> (c)
e.className = c;
<span class="reserved">if</span> (!p)
p = d.body;
p.appendChild(e);
<span class="reserved">return</span> <span class="reserved">this</span>.element = e;
},
<span class="comment">/**
* Parses a int value this method will return 0 if the string is empty.
*
* <span class="attrib">@param</span> {string} s String to parse value of.
* <span class="attrib">@return</span> Parsed number.
* <span class="attrib">@type</span> int
*/</span>
parseInt : <span class="reserved">function</span>(s) {
<span class="reserved">if</span> (s == null || s == <span class="literal">''</span>)
<span class="reserved">return</span> 0;
<span class="reserved">return</span> parseInt(s);
}
};
</pre>
<hr>
<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
<tr align="center" valign="top">
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a> </td>
<td bgcolor="#FFFFFF" class="NavBarCell1Rev"> <font class="NavBarFont1Rev"><b>File</b></font> </td>
<td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a> </td>
</tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>
<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
PREV
NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
<a href="index.html" target="_top"><b>FRAMES</b></a>
<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
<script>
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->
<hr>
<font size="-1">
</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Fri Apr 14 21:59:23 2006</div>
</body>
</html>