You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(17) |
Nov
(47) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(44) |
Feb
(8) |
Mar
|
Apr
(26) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2003 |
Jan
|
Feb
(1) |
Mar
(44) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
|
From: Jordi M. <do...@us...> - 2002-01-15 12:30:59
|
Update of /cvsroot/dynapi/dynapi/examples
In directory usw-pr-cvs1:/tmp/cvs-serv1391/examples
Modified Files:
dynapi.ext.inline.htm dynapi.gui.pushpanel.html
Log Message:
release
Index: dynapi.ext.inline.htm
===================================================================
RCS file: /cvsroot/dynapi/dynapi/examples/dynapi.ext.inline.htm,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** dynapi.ext.inline.htm 2002/01/04 14:25:18 1.8
--- dynapi.ext.inline.htm 2002/01/15 12:30:37 1.9
***************
*** 43,51 ****
<body>
- <br><br>
- sasa
- <br>
- <br>
- a
<div id="layer1" style="position:relative; visibility:hidden">
<div id="clayer1" style="position:absolute; visibility:hidden; left:0px; top:0px; width:200px; height:20px;">Child Layer 1 (Click Me)</div><br>
--- 43,46 ----
Index: dynapi.gui.pushpanel.html
===================================================================
RCS file: /cvsroot/dynapi/dynapi/examples/dynapi.gui.pushpanel.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** dynapi.gui.pushpanel.html 2001/03/28 10:21:00 1.8
--- dynapi.gui.pushpanel.html 2002/01/15 12:30:37 1.9
***************
*** 42,46 ****
label4 = new Label('<table width=600 border=1><tr><td width=600>label 4 aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk</td></tr></table>')
label4.setPadding(5)
! label4.setBgColor('00eeb0')
label4.pack()
--- 42,46 ----
label4 = new Label('<table width=600 border=1><tr><td width=600>label 4 aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk asdkfjd kfdjf dk dk fjd kfjds lkdjf ksdjf lskdf jsdlk aslk</td></tr></table>')
label4.setPadding(5)
! label4.setBgColor('#00eeb0')
label4.pack()
|
|
From: Jordi M. <do...@us...> - 2002-01-15 12:30:59
|
Update of /cvsroot/dynapi/dynapi/src/lib/dynapi/gui
In directory usw-pr-cvs1:/tmp/cvs-serv1391/src/lib/dynapi/gui
Modified Files:
dynimage.js
Log Message:
release
Index: dynimage.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi/src/lib/dynapi/gui/dynimage.js,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** dynimage.js 2001/05/04 02:47:17 1.23
--- dynimage.js 2002/01/15 12:30:37 1.24
***************
*** 8,12 ****
dynapi.api [dynlayer, dyndocument, browser, events]
*/
-
function DynImage() {
this.DynLayer = DynLayer;
--- 8,11 ----
***************
*** 134,136 ****
}
};
! DynAPI.addLoadFunction("DynImage.loaderStart()")
\ No newline at end of file
--- 133,135 ----
}
};
! DynAPI.addLoadFunction("DynImage.loaderStart()")
|
|
From: Jordi M. <do...@us...> - 2002-01-15 12:30:59
|
Update of /cvsroot/dynapi/dynapi/src/lib/dynapi/event
In directory usw-pr-cvs1:/tmp/cvs-serv1391/src/lib/dynapi/event
Modified Files:
mouse.js
Log Message:
release
Index: mouse.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi/src/lib/dynapi/event/mouse.js,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** mouse.js 2002/01/04 14:25:18 1.24
--- mouse.js 2002/01/15 12:30:37 1.25
***************
*** 38,43 ****
// This is THE event.
DynMouseEvent._e=new DynMouseEvent()
! // If this is true, then mouseups always happen where the mousedown happened
! DynMouseEvent.forceMouseUp = false
DynMouseEvent.EventMethod=function(e) {
--- 38,43 ----
// This is THE event.
DynMouseEvent._e=new DynMouseEvent()
! // If this is true, then mouseups always happen where the mousedown happened ( true is recommended )
! DynMouseEvent.forceMouseUp = true
DynMouseEvent.EventMethod=function(e) {
|
|
From: Jordi M. <do...@us...> - 2002-01-15 12:30:59
|
Update of /cvsroot/dynapi/dynapi In directory usw-pr-cvs1:/tmp/cvs-serv1391 Modified Files: REVISION Log Message: release Index: REVISION =================================================================== RCS file: /cvsroot/dynapi/dynapi/REVISION,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** REVISION 2001/11/06 17:58:53 1.13 --- REVISION 2002/01/15 12:30:37 1.14 *************** *** 15,18 **** --- 15,50 ---- [ - Bug Fix ] + + Version 2.5.7 + ------------- + This branch ( 2.5.x ) and the newly created 2.9.x ( where new ideas / objects are tested ) are different + things and should not be confused. + + While they have undergone some bugfixing, it is obvious that the default group of GUI widgets supplied + with this distro is too buggy / old / obsolete and need to be rewritten. I plan to rewrite them all + for the next release, and probably make them a separate release from the core. This said it is + easy to understand that little to no effort has been dedicated to improve the existing widgets for this + release, so expect more or less the same flaws ( and even some new ones :) ). + + [-] Fixed 2.5.6 drag bug + [-] Fixed scrollbar not reaching bottom of the scrolling space when scrolling via 'up' and 'down' buttons + [-] Fixed "removeFromParent is destroying the layer" bug. + [+] Added disabling contextual menus for each dynlayer ( off by default, example page is provided ) + [*] By default mouseUps always will happen in the layer were the mousedown happened, even if the mouse + was dragged outside the layer ( No more stuck scroll buttons ). This behaviour can be disabled from + within mouse.js ( instructions provided inside the file ). + [*] Only one event is captured per page. I realized I we were using the event's target properties to determine + the dynlayer where it occured, hence with one single event being captured in the document everything works + in the same way. Moreover, remember that capturing a layer event was layer.doc.capture.... since all + layers share the document ( except NS4 ) we were capturing the same events once and again. + Try the strech tests and see how intializacions are a lot faster now. About 4ks of code are gone, as well [:)] + [+] You can add layers on load time. Yeap no more waiting for the onload event. + [+] Since layers can be added onpage load, they can be made relative. + Yep, place them within a table which defines your layout and it will work. + Still some flaws ( see example in tests/ directory where a scrollbar is working inside a relative positioned table ) + but pretty promising. + Please consider this inflow stuff as alpha work and do not consider using it in real projects. It won't work + + Version 2.5.6 ------------- |
|
From: martin str?m <ma...@us...> - 2002-01-14 16:41:31
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi
In directory usw-pr-cvs1:/tmp/cvs-serv29386
Modified Files:
debug.js
Log Message:
Changed window- and form-element size for ie/mac.
Index: debug.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi2x/src/dynapi/debug.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** debug.js 2002/01/11 20:51:55 1.1
--- debug.js 2002/01/14 16:41:28 1.2
***************
*** 63,68 ****
if (!this.isLoaded() && p) {
var url = dynapi.documentPath+p+'debug.html#';
! var w = dynapi.ua.mac? (dynapi.ua.ie?330:300) : 360;
! var h = dynapi.ua.mac? (dynapi.ua.ie?405:365) : dynapi.ua.ie? 420:465;
this.win = window.open(url,'debugwin','width='+w+',height='+h+',scrollbars=no,status=no,toolbar=no,resizable=no');
/*if (dynapi.ua.ns4) { // move the debug window to the right edge?
--- 63,68 ----
if (!this.isLoaded() && p) {
var url = dynapi.documentPath+p+'debug.html#';
! var w = dynapi.ua.mac? (dynapi.ua.ie?300 : 300) : 360;
! var h = dynapi.ua.mac? (dynapi.ua.ie?367 : 365) : dynapi.ua.ie? 420:465;
this.win = window.open(url,'debugwin','width='+w+',height='+h+',scrollbars=no,status=no,toolbar=no,resizable=no');
/*if (dynapi.ua.ns4) { // move the debug window to the right edge?
|
|
From: martin str?m <ma...@us...> - 2002-01-14 16:40:56
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi In directory usw-pr-cvs1:/tmp/cvs-serv29173 Modified Files: debug.html Log Message: Changed window- and form-element size for ie/mac. Index: debug.html =================================================================== RCS file: /cvsroot/dynapi/dynapi2x/src/dynapi/debug.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** debug.html 2002/01/14 12:40:20 1.2 --- debug.html 2002/01/14 16:40:53 1.3 *************** *** 25,31 **** var str='<form name=debugform><font face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" size="1">'+ '<table cellspacing=0 cellpadding=0 border=0><tr><td colspan=2>'+ ! '<textarea name="print" cols="'+(dynapi.ua.mac? (dynapi.ua.ie?42:42) :40)+'" rows="'+(dynapi.ua.ie?12:13)+'" wrap="off"></textarea><br>'+ ! '<input type=text name="stat" size="'+(dynapi.ua.mac? (dynapi.ua.ie?44:46) :42)+'" '+(dynapi.ua.ie?'style="font-family:Monaco;"':'')+' value="DynAPI '+dynapi.version+'"/><br>'+ ! '<textarea name="eval" cols="'+(dynapi.ua.mac? (dynapi.ua.ie?42:42) :40)+'" rows="'+(dynapi.ua.ie?7:8)+'" wrap="off"></textarea><br>'+ '</td></tr><tr>'+ '<td><input type=button value="Evaluate" onclick="window.opener.DynAPI.debug.evaluate(this.form.eval.value)"></td>'+ --- 25,31 ---- var str='<form name=debugform><font face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" size="1">'+ '<table cellspacing=0 cellpadding=0 border=0><tr><td colspan=2>'+ ! '<textarea name="print" cols="'+(dynapi.ua.mac? (dynapi.ua.ie?52:42) :40)+'" rows="'+(dynapi.ua.ie?12:13)+'" wrap="off"></textarea><br>'+ ! '<input type=text name="stat" size="'+(dynapi.ua.mac? (dynapi.ua.ie?40:46) :42)+'" '+(dynapi.ua.ie?'style="font-family:Monaco;"':'')+' value="DynAPI '+dynapi.version+'"/><br>'+ ! '<textarea name="eval" cols="'+(dynapi.ua.mac? (dynapi.ua.ie?52:42) :40)+'" rows="'+(dynapi.ua.ie?7:8)+'" wrap="off"></textarea><br>'+ '</td></tr><tr>'+ '<td><input type=button value="Evaluate" onclick="window.opener.DynAPI.debug.evaluate(this.form.eval.value)"></td>'+ |
|
From: martin str?m <ma...@us...> - 2002-01-14 13:20:15
|
Update of /cvsroot/dynapi/dynapi2x/src In directory usw-pr-cvs1:/tmp/cvs-serv30078 Modified Files: dynapi-2.5mode.js Log Message: Added the 'is'-object and is.platform property Index: dynapi-2.5mode.js =================================================================== RCS file: /cvsroot/dynapi/dynapi2x/src/dynapi-2.5mode.js,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dynapi-2.5mode.js 2002/01/11 20:51:55 1.1 --- dynapi-2.5mode.js 2002/01/14 13:20:11 1.2 *************** *** 27,30 **** --- 27,32 ---- DynMouseEvent = MouseEvent; dynapi.librarypath = dynapi.libraryPath = dynapi.library.path; + dynapi.ua.platform = dynapi.ua.win32? "win32" : dynapi.ua.mac? "mac" : "other"; + is = dynapi.ua; // v2.5x package/include system; |
|
From: martin str?m <ma...@us...> - 2002-01-14 12:40:24
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi In directory usw-pr-cvs1:/tmp/cvs-serv20748 Modified Files: debug.html Log Message: small typo Index: debug.html =================================================================== RCS file: /cvsroot/dynapi/dynapi2x/src/dynapi/debug.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** debug.html 2002/01/11 20:51:55 1.1 --- debug.html 2002/01/14 12:40:20 1.2 *************** *** 20,24 **** <style type="text/css"> </style> ! <body bgcolor="#D4D0C8" leftmargin=10 topmargin=10"> <script> --- 20,24 ---- <style type="text/css"> </style> ! <body bgcolor="#D4D0C8" leftmargin=10 topmargin=10> <script> |
|
From: Robert R. <rai...@us...> - 2002-01-14 02:34:13
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/api
In directory usw-pr-cvs1:/tmp/cvs-serv24807/src/dynapi/api
Modified Files:
dyndocument.js mouse.js
Log Message:
Events fix for frames in IE
Index: dyndocument.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi2x/src/dynapi/api/dyndocument.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** dyndocument.js 2002/01/11 20:51:55 1.1
--- dyndocument.js 2002/01/14 02:34:10 1.2
***************
*** 82,85 ****
--- 82,86 ----
p._create = function() {
this._created = true;
+ this.frame.lyrobj = this;
if (dynapi.ua.ns4) {
this.css = this.doc;
***************
*** 95,98 ****
--- 96,100 ----
}
this.elm.lyrobj = this;
+ this.doc.lyrobj = this;
this.findDimensions();
for (var i=0;i<this.children.length;i++) {
Index: mouse.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi2x/src/dynapi/api/mouse.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** mouse.js 2002/01/11 20:51:55 1.1
--- mouse.js 2002/01/14 02:34:10 1.2
***************
*** 46,52 ****
};
MouseEvent.eventHandler = function(e) {
! var dynobject = this.lyrobj;
if (DynAPI.ua.def) {
! if (DynAPI.ua.ie) var e = window.event;
e.cancelBubble=true;
}
--- 46,52 ----
};
MouseEvent.eventHandler = function(e) {
! var dynobject = this.lyrobj._dyndoc;
if (DynAPI.ua.def) {
! if (DynAPI.ua.ie) var e = dynobject.frame.event;
e.cancelBubble=true;
}
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:59
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/images
In directory usw-pr-cvs1:/tmp/cvs-serv15575/src/dynapi/images
Added Files:
arrowdown.gif arrowleft.gif arrowright.gif arrowup.gif
blank.gif button.gif button_mo.gif
Log Message:
Initial Import == 2.9
--- NEW FILE ---
GIF89a
!!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~
¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦§§§¨¨¨©©©ªªª«««¬¬¬®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿ÀÀÀÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿ!þMade with GIMP
--- NEW FILE ---
GIF89a
!!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~
¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦§§§¨¨¨©©©ªªª«««¬¬¬®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿ÀÀÀÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿ!þMade with GIMP
--- NEW FILE ---
GIF89a
--- NEW FILE ---
GIF89a
!!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~
¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦§§§¨¨¨©©©ªªª«««¬¬¬®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿ÀÀÀÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿ!þMade with GIMP
--- NEW FILE ---
GIF89a
--- NEW FILE ---
GIF89aY
--- NEW FILE ---
GIF89aY
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:59
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/gui
In directory usw-pr-cvs1:/tmp/cvs-serv15575/src/dynapi/gui
Added Files:
dynimage.js graphics.js loadpanel.js
Log Message:
Initial Import == 2.9
--- NEW FILE ---
/*
DynAPI Distribution
DynImage Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/
DynImage = {};
DynImage.image = [];
DynImage.getImage = function(src,w,h) {
for (var i=0;i<DynImage.image.length;i++) {
if (DynImage.image[i].img.src==src) return DynImage.image[i].img;
}
var index = DynImage.image.length;
DynImage.image[index] = {};
if (w&&h) {
DynImage.image[index].img = new Image(w,h);
DynImage.image[index].img.w = w;
DynImage.image[index].img.h = h;
}
else DynImage.image[index].img = new Image();
DynImage.image[index].img.src = src;
if (!DynImage.timerId) DynImage.timerId=setTimeout('DynImage.loadercheck()',50);
return DynImage.image[index].img;
}
DynImage.loadercheck=function() {
DynImage.ItemsDone=0;
var max=DynImage.image.length;
for (var i=0; i<max; i++) if (DynImage.image[i].img.complete) DynImage.ItemsDone+=1;
if (DynImage.ItemsDone<max) DynImage.timerId=setTimeout('DynImage.loadercheck()',25);
else {
if (DynAPI.ua.def&&(!DynAPI.ua.ie||(DynAPI.ua.ie&&DynAPI.ua.platform=="mac"))) {
DynImage.image[i].img.width = DynImage.image[i].img.w;
DynImage.image[i].img.height = DynImage.image[i].img.h;
}
DynImage.timerId=null;
}
};
dynapi.onLoad(DynImage.loadercheck);
--- NEW FILE ---
// 2D Graphics Package
// Drawing routines for DynLayer
// Copyright (C) 2000-2001 Dan Steinman, Guoyi Chao, Rob Breeds
// Guoyi Chao: drawing routines for line, circle, ellipse
// Dan Steinman: DynAPI2 support, object wrappers, VML support, improved routines for line, rect, and fills()
// Rob Breeds: improve performance on ellipse and circle algorithms, and added line thicknesses support
// Distributed under the terms of the GNU Library General Public License
function Graphics(dlyr) {
this._dlyr = dlyr;
this._s = "yellow";
this._w = 1;
this._f = "white";
}
Graphics.prototype.setStrokeColor = function(v) {this._s = v};
Graphics.prototype.setStrokeWeight = function(v) {this._w = v};
Graphics.prototype.setFillColor = function(v) {this._f = v};
Graphics.prototype.drawPixel = function(x,y) {
drawPixel(x,y,this._s,this._w,this);
};
Graphics.prototype.drawLine = function(x1,y1,x2,y2) {
var shape;
if (Graphics.useVML) {
shape = new VML_Line(x1,y1,x2,y2,this._w,this._s);
this._dlyr.elm.appendChild(shape.elm);
}
else {
shape = new Line(x1,y1,x2,y2,this._w,this._s);
this._dlyr.addChild(shape);
}
return shape;
};
Graphics.prototype.drawCircle = function(x,y,radius) {
var shape;
if (Graphics.useVML) {
// bug in IE, always fills anyway
shape = new VML_Oval(x,y,2*radius,2*radius,this._w,this._s, dynapi.ua.ie5?this._dlyr.bgColor:false);
this._dlyr.elm.appendChild(shape.elm);
}
else {
shape = new Circle(x,y,radius,this._w,this._s);
this._dlyr.addChild(shape);
}
return shape;
};
Graphics.prototype.fillCircle = function(x,y,r) {
fillCircle(x+r,y+r,r,this.color,this._dlyr);
};
Graphics.prototype.drawOval = function(x,y,w,h) {
drawEllipse(x+w/2,y+h/2,w,h,this.color,false,this.thickness,this._dlyr);
};
Graphics.prototype.fillEllipse = function(x,y,w,h) {
drawEllipse(x+w/2,y+h/2,w,h,this.color,true,this.thickness,this._dlyr);
};
Graphics.prototype.drawRect = function(x,y,w,h) {
drawRect(x,y,w,h,this.color,this.thickness,this._dlyr);
};
Graphics.prototype.fillRect = function(x,y,w,h) {
fillRect(x,y,w,h,this.color,this._dlyr);
};
Graphics.prototype.clear = function() {
this.deleteAllChildren();
this.setHTML('');
};
Graphics.useVML = false;
if (dynapi.ua.ie && dynapi.ua.v>=5) { // include active-x component for IE5+
Graphics.useVML = true;
var str = '<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>'+
'<object id="VMLRender" codebase="vgx.dll" classid="CLSID:10072CEC-8CC1-11D1-986E-00A0C955B42E"></object>'+
'<style>'+
'<!--'+
'v\\:* { behavior: url(#VMLRender); }'+
'-->'+
'</style>';
if (dynapi.loaded) {
dynapi.frame.document.body.appendChild('beforeEnd',str);
}
else {
document.write(str);
}
}
// Drawing Routines
function Pixel(x,y,color,t) { // not really needed
this.DynLayer = DynLayer;
this.DynLayer();
this.setLocation(x,y);
this.setSize(t||1,t||1);
this.setBgColor(color||"black");
}
Pixel.prototype = new DynLayer();
function drawPixel(x,y,color,t,lyr) {
lyr.addChild( new DynLayer('',Math.round(x),Math.round(y),t,t,color) )
}
function Shape() {
this.DynLayer = DynLayer;
this.DynLayer();
this.setStrokeColor("black");
this.setStrokeWeight(1);
}
Shape.prototype = new DynLayer();
Shape.prototype.setStrokeColor = function(v) {this._s = v};
Shape.prototype.setStrokeWeight = function(v) {this._w = v};
function Line(x1,y1,x2,y2,w,s) {
this.Shape = Shape;
this.Shape();
this.setStrokeWeight(w);
this.setStrokeColor(s);
var dx = Math.min(x1,x2);
var dy = Math.min(y1,y2);
var width = Math.abs(x2-x1);
var height = Math.abs(y2-y1);
this.setLocation(dx, dy);
if(x1==x2||y1==y2) { // straight line
this.setBgColor(s);
if(x1==x2) this.setSize(w,height); // vertical
else this.setSize(width,w); //horizontal
}
else { // diagonal
this.setSize(width,height);
var nx1 = x1-dx;
var ny1 = y1-dy;
var nx2 = x2-dx;
var ny2 = y2-dy;
drawLine(nx1,ny1,nx2,ny2,s,w,this);
}
}
Line.prototype = new Shape();
function VMLElement() {
this.elm = null
};
VMLElement.prototype.createShape = function(type) {
this.elm = document.createElement('v:'+type);
}
VMLElement.prototype.setLocation = function() {};
function VML_Line(x1,y1,x2,y2,w,s) {
this.VMLElement = VMLElement;
this.VMLElement();
this.createShape("line");
this.elm.from = x1+'px ,'+y1+'px';
this.elm.to = x2+'px ,'+y2+'px';
this.elm.strokeColor = s;
this.elm.innerHTML = '<v:stroke weight="'+w+'px">';
//this.elm.innerHTML = '<v:stroke weight="'+this.thickness+'px" color="'+this.color+'">';
//"<v:line id='line" + nnode + "' from=" + x1 + "," + y1 +"' to='" + x2 + "," + y2 +"'><v:stroke weight='2px' color='black'/></v:line>";
};
VML_Line.prototype = new VMLElement();
function VML_Oval(x,y,width,height,w,s,fc) {
this.VMLElement = VMLElement;
this.VMLElement();
this.elm = document.createElement('v:oval');
this.elm.style.position = "absolute";
this.elm.style.left = x+"px";
this.elm.style.top = y+"px";
this.elm.style.width = width+"px";
this.elm.style.height = height+"px";
this.elm.strokeColor = s;
if (fc) {
this.elm.fillColor = fc;
this.elm.fill = true;
}
else this.elm.fill = false;
this.elm.innerHTML = '<v:stroke weight="'+w+'px">';
};
VML_Oval.prototype = new VMLElement();
function drawLine(x1,y1,x2,y2,color,t,lyr) {
var flag = (Math.abs(y2-y1) > Math.abs(x2-x1))
var dx,dy,x,y,e,xstep,ystep
if (flag) dx=Math.abs(y2-y1),dy=Math.abs(x2-x1),x=y1,y=x1
else dx=Math.abs(x2-x1),dy=Math.abs(y2-y1),x=x1,y=y1
xstep=x1>x2?-1:1
ystep=y1>y2?-1:1
if(x1==x2||y1==y2) {
if(x1==x2) {
var ny1 = Math.min(y1,y2)
var ny2 = Math.max(y1,y2)
lyr.addChild( new DynLayer('',x1,ny1,t,(ny2-ny1)*t,color) )
return
}
else {
var nx1 = Math.min(x1,x2)
var nx2 = Math.max(x1,x2)
lyr.addChild( new DynLayer('',nx1,y1,(nx2-nx1)*t,t,color) )
return
}
}
// Bresenham Method Begin
var e=-dx
for(var count=0;count<=dx;count++) {
if (flag) drawPixel(y,x,color,t,lyr)
else drawPixel(x,y,color,t,lyr)
if (flag) x+=ystep
else x+=xstep
e+=dy<<1
if(e>=0) {
if(flag) y+=xstep
else y+=ystep
e-=dx<<1
}
}
return
}
function Circle(x,y,radius,w,s) {
this.Shape = Shape;
this.Shape();
this.setStrokeWeight(w);
this.setStrokeColor(s);
this.setLocation(x,y);
this.setSize(2*radius, 2*radius);
drawCircle(0+radius,0+radius,radius-1,this._s,this._w,this);
}
Circle.prototype = new Shape();
function drawCircle(centerX,centerY,radius,color,t,lyr) {
var x = centerX;
var y = centerY;
var cx = 0
var cy = radius
var df = 1 - radius
var d_e = 3
var d_se = -(radius<<1) + 5
do {
drawPixel(x+cx, y+cy, color,t,lyr)
if (cx) drawPixel(x-cx, y+cy, color,t,lyr)
if (cy) drawPixel(x+cx, y-cy, color,t,lyr)
if ((cx) && (cy)) drawPixel(x-cx, y-cy, color,t,lyr)
if (cx != cy) {
drawPixel(x+cy, y+cx, color,t,lyr)
if (cx) drawPixel(x+cy, y-cx, color,t,lyr)
if (cy) drawPixel(x-cy, y+cx, color,t,lyr)
if (cx && cy) drawPixel(x-cy, y-cx, color,t,lyr)
}
if (df < 0) {
df += d_e
d_e += 2
d_se += 2
}
else {
df += d_se
d_e += 2
d_se += 4
cy--
}
cx++
} while (cx <= cy)
}
function fillCircle(x,y,radius,color,lyr) {
var cx = 0
var cy = radius
var df = 1 - radius
var d_e = 3
var d_se = -(radius<<1) + 5
do {
fillRect(x-cy, y-cx, cy<<1, cx<<1, color,lyr)
if (df < 0) {
df += d_e
d_e += 2
d_se += 2
}
else {
if (cx != cy) fillRect(x-cx, y-cy, cx<<1, cy<<1, color,lyr)
df += d_se
d_e += 2
d_se += 4
cy--
}
cx++
} while (cx <= cy)
}
function drawEllipse(cx,cy,rx,ry,color,filled,t,lyr) {
var x,y,a2,b2, S, T
a2 = rx*rx
b2 = ry*ry
x = 0
y = ry
S = a2*(1-2*ry) + 2*b2
T = b2 - 2*a2*(2*ry-1)
symmPaint(cx,cy,x,y,color,filled,t,lyr)
do {
if (S<0) {
S += 2*b2*(2*x+3)
T += 4*b2*(x+1)
x++
} else if (T<0) {
S += 2*b2*(2*x+3) - 4*a2*(y-1)
T += 4*b2*(x+1) - 2*a2*(2*y-3)
x++
y--
} else {
S -= 4*a2*(y-1)
T -= 2*a2*(2*y-3)
y--
}
symmPaint(cx,cy,x,y,color,filled,t,lyr)
} while (y>0)
}
//Bresenham's algorithm for ellipses
function symmPaint(cx,cy, x, y, color, filled, t, lyr){
if (filled) {
fillRect ( cx-x, cy-y, x<<1, y<<1, color, lyr )
} else {
drawPixel ( cx-x, cy-y, color, t,lyr )
drawPixel ( cx+x, cy-y, color, t,lyr )
drawPixel ( cx-x, cy+y, color, t,lyr )
drawPixel ( cx+x, cy+y, color, t,lyr )
}
}
function drawRect(x,y,w,h,color,t,lyr) {
lyr.addChild( new DynLayer('',x,y,w,t,color) )
lyr.addChild( new DynLayer('',x,y,t,h,color) )
lyr.addChild( new DynLayer('',x+w-t,y,t,h,color) )
lyr.addChild( new DynLayer('',x,y+h-t,w,t,color) )
}
function fillRect(x,y,w,h,color,lyr) {
lyr.addChild( new DynLayer('',x,y,w,h,color) )
}
--- NEW FILE ---
/*
DynAPI Distribution
LoadPanel Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
Requirements:
dynapi.api [dynlayer, dyndocument, browser, events]
*/
function LoadPanel(url) {
this.DynLayer = DynLayer;
this.DynLayer();
this.autoH=true;
this.autoW=false;
this.isILayer=false;
this.isIFrame=!(dynapi.ua.ie5 && is.platform=='win32');
this._isReloading = false;
this.addEventListener(LoadPanel.events);
this.url = url;
};
LoadPanel.events = {
oncreate : function(e) {
var o = e.getSource();
if (!o._isReloading) {
o.setURL(o.url);
}
}
};
LoadPanel.prototype = new DynLayer();
LoadPanel.prototype._DynLayer_setSize = DynLayer.prototype.setSize;
LoadPanel.prototype.setSize = function(w,h) {
var r = this._DynLayer_setSize(w,h);
if (r && this._created && !this._isReloading && this.autoH && this.url) this.reload();
};
LoadPanel.prototype.setAutoResizeWidth=function(b) {this.autoW=b};
LoadPanel.prototype.setAutoResizeHeight=function(b) {this.autoH=b};
LoadPanel.prototype.useILayer=function(b) {
if (dynapi.ua.ns4) {
this.isILayer=b;
if (this.created) this.reload();
}
};
LoadPanel.prototype.useIFrame=function(b) {
if (is.def) {
this.isIFrame=b;
if (this.created) this.reload();
}
};
LoadPanel.prototype.insertInlineElements=function() {
if (dynapi.ua.ie) {
if (this.isIFrame) this.setHTML('<IFRAME ID="'+this.id+'loadElement" STYLE="visibility: hidden; display: none;"></IFRAME>',false);
else this.setHTML('<DIV ID="'+this.id+'loadElement" STYLE="behavior:url(#default#download)" style="display: none;"></DIV>',false);
}
else if (dynapi.ua.ns4 && this.isILayer) this.setHTML('<ilayer></ilayer>',false);
else if (dynapi.ua.ns6) this.setHTML('<IFRAME ID="'+this.id+'loadElement" STYLE="visibility: hidden;"></IFRAME>',false);
};
LoadPanel.prototype.findInlineElements=function() {
if (dynapi.ua.ie) {
if (this.isIFrame) this.loadElement=document.frames(this.id+'loadElement');
else this.loadElement=document.all(this.id+'loadElement');
alert(this.loadElement);
}
else if (dynapi.ua.ns4) {
if (this.isILayer) this.loadElement=this.doc.layers[0];
else this.loadElement=this.elm;
}
else if (dynapi.ua.ns6) this.loadElement=document.getElementById(this.id+'loadElement');
};
LoadPanel.prototype.getFileScope=function() {
if (!this.loadElement) return null;
return this.loadElement;
};
LoadPanel.prototype.clearFile=function() {
this.url=null;
if (this.isILayer) {
this.loadElement.document.write('');
this.loadElement.document.close();
}
else this.reload();
};
LoadPanel.prototype.getURL=function() {
return this.url;
};
LoadPanel.prototype.setURL = function(url) {
alert('yo')
if (!url) return;
else if (!this._created) this.url = url;
else LoadPanel.queue.add(url,this);
};
LoadPanel.prototype.reload=function() {
this._isReloading=true;
this.setHTML('');
this.setURL(this.url);
this._isReloading=false;
};
LoadPanel.prototype.loadHandler=function(url) {
this.url=url;
if (dynapi.ua.ie5 && !this.isIFrame && this.elm && this.elm.all) {
var imgs = this.elm.all.tags("img");
for (var i=0;i<imgs.length;i++) {
if (imgs[i].readyState == 'uninitialized') imgs[i].src = imgs[i].src;
}
}
if (dynapi.ua.ns4 && this.isILayer) {
var w = this.loadElement.document.width;
var h = this.loadElement.document.height;
}
else {
var w = this.getContentWidth()||this.w;
var h = this.getContentHeight()||this.h;
}
this._DynLayer_setSize(this.autoW?w:null,this.autoH?h:null);
this._isReloading=false;
this.invokeEvent('load');
};
function LoadQueue() {
this.queue=new Array();
this.index=0;
};
LoadQueue.prototype.toString=function() {
return "LoadPanel.queue";
};
LoadQueue.prototype.add=function(url,loadpanel) {
var q=this.queue.length;
this.queue[q]=[url,loadpanel];
this.loadNext();
};
LoadQueue.prototype.loadNext=function() {
dprint('loadnext')
if (!this.busy && this.queue[this.index]) {
this.busy=true;
var lpanel=this.currentLoadPanel=this.queue[this.index][1];
var url=this.currentURL=this.queue[this.index][0];
if (dynapi.ua.ns4) {
if (!lpanel.loadElement) {
lpanel.insertInlineElements();
lpanel.findInlineElements();
}
DynAPI.document.releaseMouseEvents();
var lyr=lpanel.elm;
while(lyr.parentLayer) lyr=lyr.parentLayer;
lyr.onload=LoadQueue.loadHandler;
lpanel.loadElement.onload=LoadQueue.loadHandler;
lpanel.loadElement.src=url;
} else {
if (!lpanel.loadElement) {
alert('no')
lpanel.insertInlineElements();
lpanel.findInlineElements();
}
if (dynapi.ua.ie) {
if (lpanel.isIFrame) {
lpanel.loadElement.document.isLoading=true;
lpanel.loadElement.location=url;
lpanel.timerID=setInterval(this.toString() + '.loadTimer()',250);
}
else lpanel.loadElement.startDownload(url,LoadQueue.loadHandler);
}
else if (dynapi.ua.ns6) {
lpanel.timerID=setInterval(this.toString() + '.loadTimer()',250);
lpanel.loadElement.src=url;
}
}
Methods.removeFromArray(this.queue,this.index);
}
};
if (dynapi.ua.ns6) {
LoadQueue.prototype.loadTimer=function() {
var lpanel=this.currentLoadPanel;
if (!document.getElementById(lpanel.id+'loadElement')) {
clearInterval(lpanel.timerID);
LoadQueue.continueLoad();
}
else if (lpanel.loadElement.contentDocument && lpanel.loadElement.contentDocument.body.innerHTML != document.body.innerHTML) {
clearInterval(lpanel.timerID);
LoadQueue.loadHandler(lpanel.loadElement.contentDocument);
}
}
} else if (dynapi.ua.ie) {
LoadQueue.prototype.loadTimer=function() {
var lpanel=this.currentLoadPanel;
if (!document.frames(lpanel.id+'loadElement')) {
clearInterval(lpanel.timerID);
LoadQueue.continueLoad();
}
else if (!lpanel.loadElement.document.isLoading && (lpanel.loadElement.document.readyState=='interactive' || lpanel.loadElement.document.readyState=='complete')) {
clearInterval(lpanel.timerID);
LoadQueue.loadHandler(lpanel.loadElement.document.body.innerHTML);
}
}
}
LoadQueue.loadHandler=function(e) {
var q=LoadPanel.queue;
var lp=q.currentLoadPanel;
if (q.currentLoadPanel) {
if (dynapi.ua.ie) {
lp.elm.innerHTML=e;
if (lp.isIFrame) lp.loadElement=null;
}
else if (dynapi.ua.ns4) {
var lyr = lp.elm;
while(lyr.parentLayer != window) lyr = lyr.parentLayer;
lyr.onload = function(){};
lp.loadElement.onload = function(){};
}
else if (dynapi.ua.ns6) {
var html=e.body.innerHTML;
lp.elm.innerHTML=html;
lp.loadElement=null;
}
setTimeout('LoadQueue.continueLoad()',200);
}
};
LoadQueue.continueLoad=function() {
var q=LoadPanel.queue;
q.currentLoadPanel.loadHandler(q.currentURL);
q.busy=false;
if (q.queue[q.index]) q.loadNext();
else if (dynapi.ua.ns4) DynAPI.document.captureMouseEvents();
};
LoadPanel.queue=new LoadQueue();
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:59
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/util
In directory usw-pr-cvs1:/tmp/cvs-serv15575/src/dynapi/util
Added Files:
cookie.js ioelement.js
Log Message:
Initial Import == 2.9
--- NEW FILE ---
/*
DynAPI Distribution
Cookie functions
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/
/* to-do: make a Cookie object that saves multiple values into one cookie that can be parsed out later
example:
var c = new Cookie('mycookieset');
c.set('name','MyName');
c.set('array',[1,2,3]);
var c = dynapi.functions.getCookie('mycookieset');
var name = c.get('name');
var array = c.get('array');
array[array.length] = 4;
c.set('name',name+' MyLastName');
c.set('array',array);
*/
function Cookie() {
this.inherit('DynObject');
}
dynapi.setPrototype('Cookie','DynObject');
dynapi.functions.setCookie = function(name,value,days) {
if (days) {
var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires="; expires="+date.toGMTString();
}
else expires = "";
dynapi.frame.document.cookie = name+"="+value+expires+"; path=/";
};
dynapi.functions.getCookie = function(name) {
var nameEQ = name+"=";
var ca = dynapi.frame.document.cookie.split(';');
for(var i=0;i<ca.length;i++) {
var c=ca[i];
while (c.charAt(0)==' ') c=c.substring(1,c.length);
if (c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length);
}
return null;
};
dynapi.functions.deleteCookie = function(name) {
dynapi.functions.setCookie(name,"",-1);
};
--- NEW FILE ---
/*
DynAPI Distribution
IOElement Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: dynapi.api.DynLayer
*/
// DS: this code is now overly complicated for it's purpose, it will be simplified in a later version
// I was originally using this code for script loading, but delegated all necessary code to dynapi.library.js
function IOElement(hidden) {
this.inherit('DynLayer');
this.list = {};
this.loadList = [];
this.loadIndex = -1;
this.busy = true;
this.failTime = 15000;
this._hidden = (hidden!=null && hidden!=false);
if (this._hidden) {
this.setVisible(false);
var o = this;
if (!dynapi.loaded) {
dynapi.onLoad(function() {
dynapi.document.addChild(o);
});
}
else dynapi.document.addChild(o);
}
var r = Math.floor(Math.random()*10000000);
this.randID = 'IOElement'+r+'elm';
this.setID('IOElement'+r);
this.addEventListener(IOElement.events);
};
dynapi.setPrototype('IOElement','DynLayer');
IOElement.events = {
onprecreate : function(e) {
var o = e.getSource();
if (o._hidden) {
if (dynapi.ua.ns4) o.html = '<ilayer name="'+o.randID+'" visibility="hide" width=0 height=0></ilayer>';
else if (dynapi.ua.ie) o.html = '<iframe name="'+o.randID+'" style="width:0px; height:0px; visibility:hidden"></iframe>'; //style="display:none"
else o.html = '<iframe name="'+o.randID+'" style="width:0px; height:0px; visibility:hidden"></iframe>';
}
else {
if (dynapi.ua.ns4) o.html = '<layer width='+o.w+' height='+o.h+' name="'+o.randID+'" visibility="inherit"></ilayer>';
else o.html = '<iframe name="'+o.randID+'" width='+o.w+' height='+o.h+' scrolling="no" frameborder="no" marginwidth=0 marginheight=0 style="overflow:hidden;"></iframe>';
}
},
oncreate : function(e) {
var o = e.getSource();
o.busy = false;
//if (!o._hidden && dynapi.ua.ie) {
// setTimeout(o+'.getScope().document.body.style.backgroundColor = "'+o.bgColor+'"',1);
//}
//if (o.loadlist.length>0) o._loadNext();
}
};
IOElement.prototype.getScope = function() {
var scope;
if (dynapi.ua.ns4) scope = this.doc.layers[this.randID];
else scope = parent.frames[this.randID];
return scope;
};
IOElement.prototype.fail = function(id) {
//if (this.fn[id]) this.fn[id](false);
alert('failed')
this.busy = false;
};
IOElement.prototype.load = function(url, fn) {
if (typeof(url)=="string") this.loadList[this.loadList.length] = [url,fn];
else {
for (var i=0;i<url.length;i++) {
var src = url[i];
if (i==url.length-1) this.loadList[this.loadList.length] = [src,fn];
else this.loadList[this.loadList.length] = [src];
}
}
this._loadNext();
};
IOElement.prototype._loadNext = function() {
if (this.busy) return; // dprint('IOElement Warning: busy');
else {
if (this.loadIndex<this.loadList.length-1) {
this.loadIndex++;
var l = this.loadList[this.loadIndex];
//alert('loadnext '+this.loadIndex+' '+l[0]);
this._load(l[0],l[1]);
}
}
};
IOElement.prototype._load = function(url, fn) {
if (url.indexOf('http')!=0) {
if (url.substr(0,1)=='/') url = 'http://'+document.domain+url;
else url = dynapi.documentPath+url;
}
var id = 'd'+Math.floor(Math.random()*1000000);
this.list[id] = fn;
this.busy = true;
//this.timer = setTimeout(this+'.fail('+id+')',this.failTime);
url += (url.indexOf('?')==-1)? '?' : '&';
url += 'ioLoadID='+id+'&ioElmID='+this.id;
var elm = this.getScope();
if (elm) {
if (dynapi.ua.ns4) elm.src = url;
else elm.document.location.href = url;
}
};
IOElement.prototype._notify = function(id,url) {
if (!this.busy) {
dprint('IOElement Error: '+id+' '+this.randID+' '+url);
return;
}
this.busy = false;
clearTimeout(this.timer);
var fn = this.list[id];
if (fn) {
if (typeof(fn)=="function") {
var e = new DynEvent("load",this);
e.success = true;
fn(e);
}
else if (typeof(fn)=="string") eval(fn);
}
this._loadNext();
};
IOElement.notify = function(elm, fn) {
if (elm) {
var url, id;
if (dynapi.ua.ns4) url = elm.src;
else url = elm.document.location.href;
if (url) {
elm.args = dynapi.functions.getURLArguments(url);
var id = elm.args["ioLoadID"];
var obj = parent.DynObject.all[elm.args["ioElmID"]];
if (obj!=null && id!=null) {
elm.onload = function() {
if (fn) fn();
obj._notify(id,url);
};
return obj;
}
else {
return false;
}
}
}
return null;
};
/* //pages loaded must include this code
<script>
if (parent.DynAPI) parent.IOElement.notify(this);
</script>
*/
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:59
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/fx
In directory usw-pr-cvs1:/tmp/cvs-serv15575/src/dynapi/fx
Added Files:
circleanim.js hoveranim.js imganim.js pathanim.js
pathanim_glide.js pathanim_slide.js thread.js
Log Message:
Initial Import == 2.9
--- NEW FILE ---
/*
DynAPI Distribution
CircleAnimation Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: PathAnimation
*/
// You must add this to the DynAPI library if you want to include it via dynapi.library.include('CircleAnimation');
// dynapi.library.add('dynapi.fx.CircleAnimation','circleanim.js',['Thread','dynapi.functions']);
function CircleAnimation(dlyr) {
this.inherit('Thread',dlyr);
this.offsetX = 0;
this.offsetY = 0;
this.playing = false;
this.radius = 100;
this.angle = 0;
this.setAngleIncrement(10);
}
dynapi.setPrototype('CircleAnimation','Thread');
CircleAnimation.prototype.setRadius = function (r) {
this.hradius = this.vradius = r;
};
CircleAnimation.prototype.setHRadius = function (r) {
this.hradius = r;
};
CircleAnimation.prototype.setVRadius = function (r) {
this.vradius = r;
};
CircleAnimation.prototype.setAngle = function (a) {
this.angle = dynapi.functions.degreeToRadian(a);
};
CircleAnimation.prototype.setAngleIncrement = function (inc) {
this.angleinc = dynapi.functions.degreeToRadian(inc);
};
CircleAnimation.prototype.playAnimation = function () {
this.playing = true;
if (this.dlyr!=null) {
this.offsetX = this.hradius*Math.cos(this.angle);
this.offsetY = -this.vradius*Math.sin(this.angle);
this.baseX = this.dlyr.x-this.offsetX;
this.baseY = this.dlyr.y+this.offsetY;
this.dlyr.invokeEvent("circlestart");
}
this.start();
};
CircleAnimation.prototype.stopAnimation = function () {
this.playing = false;
this.stop();
if (this.dlyr!=null) this.dlyr.invokeEvent("circlestop");
};
CircleAnimation.prototype.run = function () {
if (!this.playing || this.dlyr==null) return;
this.angle += this.angleinc;
this.offsetX = this.hradius*Math.cos(this.angle);
this.offsetY = -this.vradius*Math.sin(this.angle);
if (this.dlyr!=null) {
this.dlyr.invokeEvent("circlerun");
this.dlyr.moveTo(this.baseX+this.offsetX,this.baseY+this.offsetY);
}
};
CircleAnimation.prototype.reset = function () {
this.angle = this.offsetX = this.offsetY = 0;
};
CircleAnimation.prototype.generatePath = function(centerX,centerY) {
if (centerX==null) centerX = this.dlyr!=null? this.dlyr.x : 0;
if (centerY==null) centerY = this.dlyr!=null? this.dlyr.y : 0;
var path = [];
var i = 0;
/* for (var a=this.angle;a<=this.angle+Math.PI*2;a+=this.angleinc) {
path[i] = Math.round(centerX + this.hradius*Math.cos(a));
path[i+1] = Math.round(centerY - this.vradius*Math.sin(a));
i+=2;
}*/
if (this.angleinc>0)
for (var a=this.angle;a<=this.angle+Math.PI*2;a+=this.angleinc) {
path[i] = Math.round(centerX + this.hradius*Math.cos(a));
path[i+1] = Math.round(centerY - this.vradius*Math.sin(a));
i+=2;
}
else
for (var a=this.angle;a>=this.angle-Math.PI*2;a+=this.angleinc) {
path[i] = Math.round(centerX + this.hradius*Math.cos(a));
path[i+1] = Math.round(centerY - this.vradius*Math.sin(a));
i+=2;
}
return path;
};
--- NEW FILE ---
/*
DynAPI Distribution
HoverAnimation Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: PathAnimation
*/
// You must add this to the DynAPI library if you want to include it via dynapi.library.include('HoverAnimation');
// dynapi.library.add('HoverAnimation','hoveranim.js','Thread','dynapi.fx');
function HoverAnimation(dlyr) {
this.Thread = Thread;
this.Thread(dlyr);
this.offsetX = 0;
this.offsetY = 0;
this.playing = false;
this.amplitude = 100;
this.angle = 0;
this.setAngleIncrement(10);
}
HoverAnimation.prototype = new Thread;
HoverAnimation.prototype.setAmplitude = function (amp) {
this.amplitude = amp;
};
HoverAnimation.prototype.setAngle = function (a) {
this.angle = PathAnimation.degreeToRadian(a);
};
HoverAnimation.prototype.setAngleIncrement = function (inc) {
this.angleinc = PathAnimation.degreeToRadian(inc);
};
HoverAnimation.prototype.playAnimation = function () {
this.playing = true;
if (this.dlyr!=null) {
this.offsetX = 0;
this.offsetY = this.amplitude*Math.sin(this.angle);
this.baseX = this.dlyr.x;
this.baseY = this.dlyr.y+this.offsetY;
this.dlyr.invokeEvent("hoverstart");
}
this.start();
};
HoverAnimation.prototype.stopAnimation = function () {
this.playing = false;
this.stop();
if (this.dlyr!=null) this.dlyr.invokeEvent("hoverstop");
};
HoverAnimation.prototype.run = function () {
if (!this.playing || this.dlyr==null) return;
this.angle += this.angleinc;
this.offsetX = 0;
this.offsetY = this.amplitude*Math.sin(this.angle);
if (this.dlyr!=null) {
this.dlyr.invokeEvent("hoverrun");
this.dlyr.moveTo(this.baseX+this.offsetX,this.baseY+this.offsetY);
}
};
HoverAnimation.prototype.reset = function () {
this.angle = this.offsetX = this.offsetY = 0;
};
HoverAnimation.prototype.generatePath = function(centerX,centerY) {
// to do
};
--- NEW FILE ---
/*
DynAPI Distribution
ImageAnimation Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: Thread
*/
function ImageAnimation(dynimage) {
this.Thread = Thread;
this.Thread(dynimage);
this.imgAnim = new Array();
this.imgAnim.playing = null;
}
ImageAnimation.prototype = new Thread;
ImageAnimation.prototype.addAnimation = function (imgArray) {
var animNum = this.imgAnim.length;
this.imgAnim[animNum] = imgArray;
this.imgAnim[animNum].loops = false;
this.imgAnim[animNum].resets = false;
this.imgAnim[animNum].frame = 0;
this.imgAnim[animNum].playing = true;
this.imgAnim[animNum].direction = 0;
this.imgAnim[animNum].alternates = false;
return animNum;
};
ImageAnimation.prototype.getFrame = function (animNum,frameNum) {
return this.imgAnim[animNum][frameNum];
};
ImageAnimation.prototype.setLoops = function (animNum,loop) {
this.imgAnim[animNum].loops = loop;
};
ImageAnimation.prototype.setResets = function (animNum) {
this.imgAnim[animNum].resets = true;
};
ImageAnimation.prototype.setAlternates = function (animNum,alt) {
this.imgAnim[animNum].loops = true;
this.imgAnim[animNum].alternates = alt;
};
ImageAnimation.prototype.playAnimation = function (animNum) {
if (animNum!=null && this.imgAnim.playing!=animNum) {
this.playing = true;
this.imgAnim.playing = animNum;
if (this.dlyr!=null) this.dlyr.invokeEvent("imgstart");
this.start();
}
};
ImageAnimation.prototype.stopAnimation = function () {
this.imgAnim.playing = null;
this.playing = false;
this.stop();
if (this.dlyr!=null) this.dlyr.invokeEvent("imgrun");
};
ImageAnimation.prototype.run = function () {
if (!this.playing || this.imgAnim.playing==null || this.dlyr==null) return;
var anim = this.imgAnim[this.imgAnim.playing];
if (anim.frame==0 && this.img==anim[anim.frame]) {
anim.frame++; // skip 1st frame if same
}
if (this.dlyr!=null) this.dlyr.invokeEvent("imgrun");
this.dlyr.setImage(anim[anim.frame]);
if (anim.frame>=anim.length-1) {
if (anim.loops) {
if (anim.alternates && anim.direction==0 && anim.frame==anim.length-1) {
anim.direction = 1;
anim.frame = anim.length-2;
}
else anim.frame = 0;
}
else if (anim.resets) {
anim.frame = 0;
this.stop()
}
else {
this.stop()
}
}
else {
if (anim.alternates) {
if (anim.frame==0 && anim.direction==1) {
anim.direction = 0;
anim.frame = 1;
}
else if (anim.direction==0) {
anim.frame++;
}
else if (anim.direction==1) {
anim.frame--;
}
}
else {
anim.frame++;
}
}
};
--- NEW FILE ---
/*
DynAPI Distribution
PathAnimation Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: dynapi.fx.Thread
*/
function PathAnimation(dlyr) {
this.inherit('Thread',dlyr);
this.paths = new Array();
this.pathPlaying = null;
}
var p = dynapi.setPrototype('PathAnimation','Thread');
p.add = function (path, loops, resets) {
var n = this.paths.length;
this.paths[n] = path;
this.setLoops(n,loops);
this.setResets(n,resets);
this.setFrame(n,0);
return n;
};
p.setLoops = function (n, loops) {
this.paths[n].loops = (loops);
};
p.setResets = function (n, resets) {
this.paths[n].resets = (resets);
};
p.setFrame = function (n, frame) {
this.paths[n].frame = frame;
};
p.play = function (noevt) {
if (!this.playing) {
this.pathPlaying = null;
if (arguments[0]==null) arguments[0] = 0;
if (typeof(arguments[0]) == "number") {
this.pathPlaying = this.paths[arguments[0]];
}
else if (typeof(arguments[0]) == "object") {
this.pathPlaying = arguments[0];
this.pathPlaying.loops = arguments[1]||false;
this.pathPlaying.resets = arguments[2]||false;
this.pathPlaying.frame = 0;
}
this.playing = true;
if (this.dlyr!=null && noevt!=false) this.dlyr.invokeEvent("pathstart");
this.start();
}
};
p._Thread_stop = Thread.prototype.stop;
p.stop = function (noevt) {
if (this.pathPlaying && this.pathPlaying.resets && !this.cancelThread && this.dlyr!=null) this.dlyr.setLocation(this.pathPlaying[0],this.pathPlaying[1]);
this._Thread_stop();
this.pathPlaying = null;
this.playing = false;
if (this.dlyr!=null && noevt!=false) this.dlyr.invokeEvent("pathcancel");
};
p.run = function () {
if (!this.playing || this.pathPlaying==null) return;
var anim = this.pathPlaying;
if (anim.frame>=anim.length/2) {
if (anim.loops) {
anim.frame = 0;
}
else if (anim.resets) {
anim.frame = 0;
if (this.dlyr!=null) this.dlyr.setLocation(anim[0],anim[1]);
this.stop();
this.dlyr.invokeEvent("pathfinish");
return;
}
else {
anim.frame = 0;
this.stop();
this.dlyr.invokeEvent("pathfinish");
return;
}
}
if (anim.frame==0 && (this.dlyr!=null && this.dlyr.x==anim[0] && this.dlyr.y==anim[1])) {
anim.frame += 1;
}
this.newX = anim[anim.frame*2];
this.newY = anim[anim.frame*2+1];
if (this.dlyr!=null) {
this.dlyr.invokeEvent("pathrun");
this.dlyr.setLocation(this.newX,this.newY);
}
anim.frame++;
};
// Path Functions
// Combines separate [x1,x2],[y1,y2] arrays into a path array [x1,y1,x2,y2]
PathAnimation.interlace = function(x,y) {
var l = Math.max(x.length,y.length);
var a = new Array(l*2);
for (var i=0; i<l; i++) {
a[i*2] = x[i];
a[i*2+1] = y[i];
}
return a;
};
// Returns correct angle in radians between 2 points
PathAnimation.getNormalizedAngle = function(x1,y1,x2,y2) {
var distx = Math.abs(x1-x2);
var disty = Math.abs(y1-y2);
if (distx==0 && disty==0) angle = 0;
else if (distx==0) angle = Math.PI/2;
else angle = Math.atan(disty/distx);
if (x1<x2) {
if (y1<y2) angle = Math.PI*2-angle;
}
else {
if (y1<y2) angle = Math.PI+angle;
else angle = Math.PI-angle;
}
return angle;
};
--- NEW FILE ---
/*
DynAPI Distribution
Glide Animation Extension
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: PathAnimation
*/
// To use on a DynLayer:
// dlyr.addMethod("glideTo",PathAnimation.glideTo);
// dlyr.addMethod("glideStop",PathAnimation.glideStop);
// dlyr.glideTo(x,y,"slow","slow",5,10);
// dlyr.glideStop();
// Or attach to all DynLayers or another class like this:
// DynLayer.prototype.glideTo = PathAnimation.glideTo;
// DynLayer.prototype.glideStop = PathAnimation.glideStop;
// These will invoke "pathstart", "pathrun", "pathfinish" and "pathcancel" events on the dynlayer
PathAnimation.glideTo = function(x2,y2,angleinc,ms,startSpeed,endSpeed) {
if (!this._pathanim) this._pathanim = new PathAnimation(this);
if (!ms) ms = 20;
if (x2==null) x2 = this.x;
if (y2==null) y2 = this.y;
if (this.x==x2 && this.y==y2) return;
this._pathanim.sleep(ms);
this._pathanim.play( GlideAnimation(this.x,this.y,x2,y2,angleinc,startSpeed,endSpeed) );
};
PathAnimation.glideStop = function () {
if (this._pathanim) this._pathanim.stop();
};
function GlideAnimation(x1,y1,x2,y2,angleinc,startSpeed,endSpeed) {
var normAngle = PathAnimation.getNormalizedAngle(x1,y1,x2,y2);
var distx = x2-x1;
var disty = y2-y1;
var distance = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2));
angleinc = (angleinc==null)? 7 : Math.abs(angleinc);
// a terrible mess but it works
var r = 1;
if (startSpeed == "fast") {
var centerX = x1;
var centerY = y1;
var centerX2 = x2;
var centerY2 = y2;
startAngle = 0;
endAngle = 90;
if (endSpeed=="fast") distance = distance/2;
}
else {
startAngle = -90;
endAngle = 0;
if (endSpeed == "fast") {
var centerX = x1+distx;
var centerY = y1+disty;
}
else { // default slow,slow
var centerX2 = x2-distx/2;
var centerY2 = y2-disty/2;
distance = distance/2;
var centerX = x1+distx/2;
var centerY = y1+disty/2;
r = -1;
}
}
var i,d,x,y,dx,dy,path=[];
for (var a=startAngle; a<endAngle; a+=angleinc) {
i = path.length;
d = distance*Math.sin(a*Math.PI/180);
path[i] = Math.round(centerX + d*Math.cos(normAngle));
path[i+1] = Math.round(centerY - d*Math.sin(normAngle));
}
if (startSpeed==endSpeed) {
for (var a=endAngle; a<endAngle+90; a+=angleinc) {
i = path.length;
d = distance*Math.sin(a*Math.PI/180);
path[i] = Math.round(centerX2 - r*d*Math.cos(normAngle));
path[i+1] = Math.round(centerY2 + r*d*Math.sin(normAngle));
}
}
var l = path.length;
if (path[l-2] != x2 && path[l-1]!=y2) {
path[l] = x2;
path[l+1] = y2;
}
return path;
};
PathAnimation.glide = GlideAnimation;
--- NEW FILE ---
/*
DynAPI Distribution
Slide Animation Extension
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: PathAnimation
*/
// To use on a DynLayer:
// dlyr.setMethod("slideTo",PathAnimation.slideTo); // will overwrite the built in DynLayer.slideTo()
// dlyr.setMethod("slideStop",PathAnimation.slideStop);
// dlyr.slideTo(x,y,5,10);
// dlyr.slideStop();
// Or attach to all DynLayers or another class like this:
// DynLayer.prototype.glideTo = PathAnimation.glideTo;
// DynLayer.prototype.glideStop = PathAnimation.glideStop;
// These will invoke "pathstart", "pathrun", "pathfinish" and "pathcancel" events on the dynlayer
PathAnimation.slideTo = function(x,y,inc,ms) {
if (!this._pathanim) this._pathanim = new PathAnimation(this);
if (!ms) ms = 20;
if (!inc) inc = 10;
if (x==null) x = this.x;
if (y==null) y = this.y;
this._pathanim.sleep(ms);
this._pathanim.play( SlideAnimation(this.x,this.y, x,y, inc) );
};
PathAnimation.slideStop = function () {
if (this._pathanim) this._pathanim.stop();
};
// Generates a path between 2 points, stepping inc pixels at a time
function SlideAnimation(x1,y1,x2,y2,inc) {
if (x2==null) x2 = x1;
if (y2==null) y2 = y1;
var distx = x2-x1;
var disty = y2-y1;
if (x1==x2 && y1==y2) return;
var num = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2))/(inc||10)-1;
var dx = distx/num;
var dy = disty/num;
var path = [];
var x = x1;
var y = y1;
for (var i=0;i<=num;i++) {
x += dx;
y += dy;
path[i*2] = Math.round(x);
path[i*2+1] = Math.round(y);
}
if (path[i*2-2] != x2 || path[i*2-1] != y2) {
path[i*2] = x2;
path[i*2+1] = y2;
}
return path;
};
PathAnimation.line = SlideAnimation;
// a useful functions in some cases but not needed for slide
// Generates a path between 2 points in N steps
/*PathAnimation.lineN = function(x1,y1,x2,y2,N) {
if (N==0) return [];
var dx = (x2 == x1)? 0 : (x2 - x1)/N;
var dy = (y2 == y1)? 0 : (y2 - y1)/N;
var path = new Array();
for (var i=0;i<=N;i++) {
path[i*2] = Math.round(x1 + i*dx);
path[i*2+1] = Math.round(y1 + i*dy);
}
return path;
};*/
--- NEW FILE ---
/*
DynAPI Distribution
Thread class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: dynapi.api.DynLayer
*/
function Thread(dlyr) {
// Inherit from object. Provides unique ID
this.inherit('DynObject');
this.setDynLayer(dlyr);
}
var p = dynapi.setPrototype('Thread','DynObject');
p.active = false;
p.interval = 50;
p.cancelThread = false;
p.sleep = function (ms) {
this.interval = Math.abs(parseInt(ms));
if (this.active) {
this.stop();
setTimeout(this+'.start()',this.interval+1);
}
};
p.setFPS = function (fps) {
this.sleep(Math.floor(1000/fps));
};
p.cancel = function () {
this.cancelThread = true;
this.stop();
};
p.start = function () {
if (!this.active) {
this.active = true;
if (!this.cancelThread) this.timer = setInterval(this+'.run()',this.interval);
}
};
p.run = dynapi.functions.Null; // overwrite run
p.stop = function () {
this.active = false;
if (!this.cancelThread && this.timer) {
clearInterval(this.timer);
delete this.timer;
}
};
p.setDynLayer = function (dlyr) {
this.dlyr = dlyr;
};
p.getDynLayer = function () {
return this.dlyr;
};
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:59
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/api
In directory usw-pr-cvs1:/tmp/cvs-serv15575/src/dynapi/api
Added Files:
dyndocument.js dynlayer.js event.js mouse.js
Log Message:
Initial Import == 2.9
--- NEW FILE ---
/*
DynAPI Distribution
DynDocument Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: dynapi.api.DynElement
*/
function DynDocument(frame) {
this.inherit('DynElement');
this.frame = frame;
this.doc = this.frame.document;
if (this.frame==dynapi.frame) this.all = DynObject.all; // need it?
this._dyndoc = this; // need it?
this.x = 0;
this.y = 0;
this.w = 0;
this.h = 0;
this._topZIndex = 10000;
var o = this;
this.frame.onresize = function() {o._handleResize()};
this.onResizeNS4 = "reload" // or "redraw"
this.fgColor = this.doc.fgColor||'';
this.bgColor = this.doc.bgColor||'';
this._created = false;
};
var p = dynapi.setPrototype('DynDocument','DynElement');
p.getBgColor = function() {
return this.bgColor;
};
p._remove = function() {
this.elm=null;
this.doc=null;
this.frame=null;
};
p.getX = p.getY = p.getPageX = p.getPageY = function() {return 0};
p.getWidth = function() {
if (!this.w) this.findDimensions();
return this.w;
};
p.getHeight = function() {
if (!this.h) this.findDimensions();
return this.h;
};
p.findDimensions = function() {
this.w=(dynapi.ua.ns||dynapi.ua.opera)? this.frame.innerWidth : this.elm.clientWidth;
this.h=(dynapi.ua.ns||dynapi.ua.opera)? this.frame.innerHeight : this.elm.clientHeight;
};
p.setBgColor = function(color) {
if (color == null) color='';
if (dynapi.ua.ns4 && color == '') color = '#ffffff';
this.bgColor = color;
this.doc.bgColor = color;
};
p.setFgColor = function(color) {
if (color == null) color='';
if (dynapi.ua.ns4 && color == '') color='#ffffff';
this.fgColor = color;
this.doc.fgColor = color;
};
p.insertChild = function(c) {
if (c.parent == this) {
DynElement._flagEvent(c,'precreate');
this.doc.write(c.getOuterHTML());
c._inserted = true;
}
};
p.insertAllChildren = function() {
var str = '';
var c;
for (var i=0;i<this.children.length;i++) {
c = this.children[i];
DynElement._flagEvent(c,'precreate');
str += c.getOuterHTML();
c._inserted = true;
}
this.doc.write(str);
this.doc.close();
};
p._create = function() {
this._created = true;
if (dynapi.ua.ns4) {
this.css = this.doc;
this.elm = this.doc;
}
else {
this.elm = this.frame.document.body;
this.css = this.frame.document.body.style;
if (dynapi.ua.ie) {
this._overflow = this.css.overflow || '';
if (this._cursor) this.css.cursor = this._cursor;
}
}
this.elm.lyrobj = this;
this.findDimensions();
for (var i=0;i<this.children.length;i++) {
if (this.children[i]._inserted) {
DynLayer._assignElement(this.children[i]);
DynElement._flagEvent(this.children[i],'create');
}
else this.children[i]._create();
}
this._updateAnchors();
if (this.assignMouseEvents) this.assignMouseEvents();
this.invokeEvent('load');
};
p._destroy = function() {
for (var i=0;i<this.children.length;i++) {
this.children[i]._destroy();
delete this.children[i];
}
delete DynObject.all;
this.elm = null;
this.css = null;
this.frame = null;
};
p._handleResize = function() {
var w = this.w;
var h = this.h;
this.findDimensions();
if (this.w!=w || this.h!=h) {
if (dynapi.ua.ns4) {
if (this.onResizeNS4=="redraw") {
for (var i=0;i<this.children.length;i++) {
this.children[i].elm = null;
if (this.children[i]._created) {
this.children[i]._created = false;
this.children[i]._create();
}
}
this.invokeEvent('resize');
}
else if (this.onResizeNS4=="reload") {
this.doc.location.href = this.doc.location.href;
}
}
else this.invokeEvent('resize');
}
};
p.setCursor = function(c) {
if (!c) c = 'default';
if (dynapi.ua.ie && this._cursor!=c) {
this._cursor = c;
if (this.css) this.css.cursor = c;
}
};
function main() {
if (dynapi.document==null) {
dynapi.document = new DynDocument(dynapi.frame);
if (dynapi.loaded) dynapi.document._create();
else dynapi.onLoad(function() {
dynapi.document._create();
});
}
};
if (!dynapi.loaded) main();
--- NEW FILE ---
/*
DynAPI Distribution
DynLayer Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: dynapi.api.DynDocument
*/
// to-do: split this file into ns4/ie4 versions, correct dynapi.library definitions to reflect
function DynLayer() {
this.inherit('DynElement');
var a = arguments;
if (a[0]) this.setHTML(a[0]);
else this.html = null;
this.x = a[1];
this.y = a[2];
this.w = a[3];
this.h = a[4];
this.bgColor = a[5];
this.visible = true;
this.z = 1;
this.elm = null;
this.doc = null;
this.css = null;
this._saveAnchor = false;
this._layout = null;
};
var p = dynapi.setPrototype('DynLayer','DynElement');
p._destroy = function() {
for (var i=0;i<this.children.length;i++) {
this.children[i]._destroy();
}
this.children = null;
this.frame = null;
this.bgImage = null;
this.bgColor = null;
this.html = null;
this.x = null;
this.y = null;
this.w = null;
this.h = null;
this.z = null;
if (this.elm) {
this.elm.lyrobj = null;
this.elm = null;
}
this.doc = null;
this.css = null;
this.parent = null;
};
p._remove = function() {
if (dynapi.ua.def && this.elm) {
this.elm.style.visibility = "hidden";
this.elm.innerHTML = "";
this.elm.outerHTML = "";
}
else if (dynapi.ua.ns4 && this.elm) {
if (!this.parent.doc.recycled) this.parent.doc.recycled=[];
this.parent.doc.recycled[this.parent.doc.recycled.length]=this.elm;
this.elm.visibility="hide";
}
this.frame = null;
this.bgImage = null;
this.bgColor = null;
this.html = null;
this.z = null;
this.w = null;
this.h = null;
this.elm = null;
this.doc = null;
this.css = null;
};
if (dynapi.ua.ns4) {
p._create = function() {
if (this.parent && !this.elm) {
DynElement._flagEvent(this,'precreate');
var parentElement = this.parent.isClass('DynLayer')? this.parent.elm : this.parent.frame;
var elm = new Layer(this.w||0, parentElement);
if (this.w) elm.clip.width = this.w;
if (this.h) elm.clip.height = this.h;
if (this.x && this.y) elm.moveTo(this.x,this.y);
else if (this.x) elm.left = this.x;
else if (this.y) elm.top = this.y;
if (this.children.length || (this.html!=null && this.html!='')) {
elm.document.write(this.getInnerHTML());
elm.document.close();
}
if (this.bgColor!=null) elm.document.bgColor = this.bgColor;
if (this.clip) {
var c = elm.clip, cl = this.clip;
c.top=cl[0], c.right=cl[1], c.bottom=cl[2], c.left=cl[3];
}
if (this.z) elm.zIndex = this.z;
elm.visibility = this.visible? "inherit" : "hide";
DynLayer._assignElement(this,elm);
DynElement._flagEvent(this,'create');
}
};
DynLayer._assignElement = function(dlyr,elm) {
if (!elm) elm = dlyr.parent.doc.layers[dlyr.id];
dlyr.elm = elm;
dlyr.css = elm;
dlyr.doc = elm.document;
dlyr.doc.lyrobj = dlyr;
dlyr.elm.lyrobj = dlyr;
dlyr._dyndoc = dlyr.parent._dyndoc;
for (var i=0;i<dlyr.doc.images.length;i++) dlyr.doc.images[i].lyrobj=dlyr;
if (dlyr.html!=null && dlyr.html!='' && (dlyr.w==null || dlyr.h==null)) {
var cw = (dlyr.w==null)? dlyr.getContentWidth() : null;
var ch = (dlyr.h==null)? dlyr.getContentHeight() : null;
dlyr.setSize(cw,ch);
}
if (dlyr.bgImage!=null) dlyr.setBgImage(dlyr.bgImage);
if (dlyr.assignMouseEvents) dlyr.assignMouseEvents();
for (var i=0; i<dlyr.children.length; i++) {
DynLayer._assignElement(dlyr.children[i]);
}
};
p.getOuterHTML=function() {
var s='\n<layer id="'+this.id+'"';
if (this.visible==false) s+=' visibility="hide"';
s+=' left='+(this.x!=null? this.x : 0);
s+=' top='+(this.y!=null? this.y : 0);
if (this.w!=null) s+=' width='+this.w;
if (this.h!=null) s+=' height='+this.h;
if (this.clip) s+=' clip="'+this.clip[3]+','+this.clip[0]+','+this.clip[1]+','+this.clip[2]+'"';
else s+=' clip="0,0,'+((this.w>=0)?this.w:0)+','+((this.h>=0)?this.h:0)+'"';
if (this.z) s+=' z-index='+this.z;
if (this.bgColor!=null) s+=' bgcolor="'+this.bgColor+'"';
s+='>';
s += this.getInnerHTML();
s+='</layer>';
return s;
};
p.setLocation = function(x,y) {
var cx = (x!=null && x!=this.x);
var cy = (y!=null && y!=this.y);
if (cx) this.x = x||0;
if (cy) this.y = y||0;
if (this.css!=null) {
if (cx && cy) this.elm.moveTo(this.x, this.y);
else if (cx) this.css.left = this.x;
else if (cy) this.css.top = this.y;
}
return (cx||cy);
};
p.setPageLocation = function(x,y) {
if (this.css) {
if (x!=null) {
this.css.pageX = x;
this.x = this.css.left;
}
if (y!=null) {
this.css.pageY = y;
this.y = this.css.top;
}
return true;
}
else {
if (this.isChild) {
if (x!=null) x = x - this.parent.getPageX();
if (y!=null) y = y - this.parent.getPageY();
}
return this.setLocation(x,y);
}
};
p.getPageX = function() {return this.css? this.css.pageX : null};
p.getPageY = function() {return this.css? this.css.pageY : null};
p.setVisible = function(b) {
if (b!=this.visible) {
this.visible = b;
if (this.css) this.css.visibility = b? "inherit" : "hide";
}
};
p.setSize = function(w,h) {
var cw = (w!=null && w!=this.w);
var ch = (h!=null && h!=this.h);
if (cw) this.w = w<0? 0 : w;
if (ch) this.h = h<0? 0 : h;
if (cw||ch) {
if (this._childAnchors) this._updateAnchors();
if (this._layout) this._layout._fixLayout();
if (this.css) {
if (cw) this.css.clip.width = this.w;
if (ch) this.css.clip.height = this.h;
}
}
return (cw||ch);
};
p.setHTML=function(html) {
var ch = (html!=null && html!=this.html);
if (ch) {
this.html = html;
if (this.css) {
if (dynapi.ua.platform=="mac") this.html+='\n';
var sTmp=(this.w==null)?'<NOBR>'+this.html+'</NOBR>':this.html;
this.doc.open();
this.doc.write(sTmp);
this.doc.close();
for (var i=0;i<this.doc.images.length;i++) this.doc.images[i].lyrobj=this;
for (i=0;i<this.doc.links.length;i++) this.doc.links[i].lyrobj=this;
}
}
};
}
else {
p._create = function() {
if (this.parent && !this.elm) {
DynElement._flagEvent(this,'precreate');
var elm, parentElement;
if (dynapi.ua.ns6) {
parentElement = this.parent.elm;
var r = parentElement.ownerDocument.createRange();
r.setStartBefore(parentElement);
var ptxt = r.createContextualFragment(this.getOuterHTML());
parentElement.appendChild(ptxt);
elm = parentElement.lastChild;
} else if (dynapi.ua.ie) {
parentElement = this.parent.elm;
parentElement.insertAdjacentHTML("beforeEnd",this.getOuterHTML());
elm = parentElement.children[parentElement.children.length-1];
}
DynLayer._assignElement(this,elm);
DynElement._flagEvent(this,'create');
}
};
DynLayer._assignElement = function(dlyr,elm) {
if (!elm) elm = dynapi.ua.ns6? dlyr.parent.doc.getElementById(dlyr.id) : dlyr.parent.elm.all[dlyr.id];
dlyr.elm = elm;
dlyr.css = elm.style;
dlyr.doc = dlyr.parent.doc;
dlyr.elm.lyrobj = dlyr;
dlyr._dyndoc = dlyr.parent._dyndoc;
if (dynapi.ua.ie && elm.all.tags("img").length) elm.ondragstart = dynapi.functions.False;
if (dlyr.z && dynapi.ua.ns6) dlyr.css.zIndex = dlyr.z;
if (dlyr.assignMouseEvents) dlyr.assignMouseEvents();
for (var i=0; i<dlyr.children.length; i++) {
DynLayer._assignElement(dlyr.children[i]);
}
if (dlyr.html!=null && dlyr.html!='' && (dlyr.w==null || dlyr.h==null)) {
var cw = (dlyr.w==null)? dlyr.getContentWidth() : null;
var ch = (dlyr.h==null)? dlyr.getContentHeight() : null;
dlyr.setSize(cw,ch);
}
};
p.getOuterHTML=function() {
var s='<div id="'+this.id+'" style="';
if (this.visible==false) s+=' visibility:hidden;';
s+=' left:'+(this.x!=null? this.x : 0)+'px;';
s+=' top:'+(this.y!=null? this.y : 0)+'px;';
if (this.w!=null) s+=' width:'+this.w+'px;';
if (this.h!=null) s+=' height:'+this.h+'px;';
if (this.clip) s+=' clip:rect('+this.clip[0]+'px '+this.clip[1]+'px '+this.clip[2]+'px '+this.clip[3]+'px);';
else if (this.w!=null && this.h!=null) s+=' clip:rect(0px '+this.w+'px '+this.h+'px 0px);';
if (this.z) s+=' z-index='+this.z+';';
if (this.bgImage!=null) s+=' background-image:url('+this.bgImage+');';
if (this.bgColor!=null) s+=' background-color:'+this.bgColor+';';
if (dynapi.ua.ie55 && this.bgImage==null && this.html==null) s+=' background-image:url(javascript:null);';
if (this._cursor!=null) s+=' cursor:'+this._cursor+';';
s+=' position:absolute;">';
s += this.getInnerHTML();
s+='</div>';
return s;
};
p.setLocation=function(x,y) {
var cx = (x!=null && x!=this.x);
var cy = (y!=null && y!=this.y);
if (cx) this.x = x||0;
if (cy) this.y = y||0;
if (this.css!=null) {
if (dynapi.ua.ie && dynapi.ua.v>=5) {
if (cx) this.css.pixelLeft = this.x;
if (cy) this.css.pixelTop = this.y;
}
else {
if (cx) this.css.left = this.x+"px";
if (cy) this.css.top = this.y+"px";
}
}
return (cx||cy);
};
p.setPageLocation = function(x,y) {
if (this.isChild) {
if (x!=null) x = x - this.parent.getPageX();
if (y!=null) y = y - this.parent.getPageY();
}
return this.setLocation(x,y);
};
p.getPageX=function() {return (this.isChild)? this.parent.getPageX()+(this.x||0) : this.x||0};
p.getPageY=function() {return (this.isChild)? this.parent.getPageY()+(this.y||0) : this.y||0};
p.setVisible=function(b) {
if (b!=this.visible) {
this.visible = b;
if (this.css) this.css.visibility = b? "inherit" : "hidden";
}
};
p.setSize = function(w,h) {
var cw = (w!=null && w!=this.w);
var ch = (h!=null && h!=this.h);
if (cw) this.w = w<0? 0 : w;
if (ch) this.h = h<0? 0 : h;
if (cw||ch) {
if (this._childAnchors) this._updateAnchors();
if (this._layout) this._layout._fixLayout();
if (this.css) {
if (cw) this.css.width = this.w||0;
if (ch) this.css.height = this.h||0;
if (cw || ch) this.css.clip = 'rect(0px '+(this.w||0)+'px '+(this.h||0)+'px 0px)';
}
}
return (cw||ch);
};
if (dynapi.ua.ie) {
p.setHTML = function(html) {
var ch = (html!=null && html!='' && html!=this.html);
if (ch) {
this.html = html;
if (this.css) {
this.elm.innerHTML = html;
}
}
};
} else {
p.setHTML=function(html) {
var ch = (html!=null && html!=this.html);
if (ch) {
this.html = html;
if (this.css) {
var sTmp=(this.w==null)?'<NOBR>'+this.html+'</NOBR>':this.html;
while (this.elm.hasChildNodes()) this.elm.removeChild(this.elm.firstChild);
var r=this.elm.ownerDocument.createRange();
r.selectNodeContents(this.elm);
r.collapse(true);
var df=r.createContextualFragment(sTmp);
this.elm.appendChild(df);
}
}
};
}
}
p.setAnchor = function(anchor) {
if (anchor == null) {
delete this._saveAnchor;
if (this.parent && this.parent._childAnchors && this.parent._childAnchors[this.is]) delete this.parent._childAnchors[this.is];
}
else if (this.parent) {
if (!this.parent._childAnchors) this.parent._childAnchors = {};
var a = this.parent._childAnchors;
a[this.id] = anchor;
this.parent._updateAnchor(this.id);
}
else this._saveAnchor = anchor;
};
p.setX=function(x) {this.setLocation(x,null)};
p.setY=function(y) {this.setLocation(null,y)};
p.getX=function() {return this.x||0};
p.getY=function() {return this.y||0};
p.setPageX = function(x) {this.setPageLocation(x,null)};
p.setPageY = function(y) {this.setPageLocation(null,y)};
p.getVisible=function() {return this.visible};
p.setZIndex=function(z) {
if (typeof(z)=="object") {
if (z.above) this.z = z.above.z + 1;
else if (z.below) this.z = z.below.z - 1;
else if (z.topmost && this.parent) {
if (this.parent._topZ==null) this.parent._topZ = 10000;
this.z = this.parent._topZ++;
}
}
else this.z = z;
if (this.css) this.css.zIndex = this.z;
};
p.getZIndex=function() {return this.z};
p.getInnerHTML=function() {
var s="";
if (this.html!=null) s+=this.html;
for (var i=0;i<this.children.length;i++) s+=this.children[i].getOuterHTML();
return s;
};
p.getHTML = function() {return this.html};
p.setWidth=function(w) {this.setSize(w,null)};
p.setHeight=function(h) {this.setSize(null,h)};
p.getWidth=function() {return this.w||0};
p.getHeight=function() {return this.h||0};
p.getBgImage=function() {return this.bgImage};
p.getBgColor=function() {return this.bgColor};
p.setCursor = function(c) {
if (!c) c = 'default';
if (dynapi.ua.ie && this._cursor!=c) {
this._cursor = c;
if (this.css) this.css.cursor = c;
}
};
p.getCursor = function() {return this._cursor};
p.setBgColor=function(c) {
if (c==null && !dynapi.ua.ns4) c = 'transparent';
this.bgColor = c;
if (this.css) {
if (dynapi.ua.ns4) this.doc.bgColor = c;
else this.css.backgroundColor = c;
}
};
p.setBgImage=function(path) {
this.bgImage=path;
if (this.css) {
if (dynapi.ua.ns4) {
if (!path) this.setBgColor(this.getBgColor());
else setTimeout(this+'.elm.background.src="'+path+'"',1);
}
else this.css.backgroundImage='url('+path+')';
}
};
p.getContentWidth=function() {
if (this.elm==null) return 0;
else {
if (dynapi.ua.ns4) return this.doc.width;
else if (dynapi.ua.ie) {
if (dynapi.ua.platform=="mac") return this.elm.offsetWidth;
return parseInt(this.elm.scrollWidth);
}
else {
var tw = this.elm.style.width;
this.elm.style.width = "auto";
var w = this.elm.offsetWidth;
this.elm.style.width = tw;
return w;
}
};
};
p.getContentHeight=function() {
if (this.elm==null) return 0;
else {
if (dynapi.ua.ns4) return this.doc.height;
else if (dynapi.ua.ie) {
if (dynapi.ua.platform=="mac") return this.elm.offsetHeight;
return parseInt(this.elm.scrollHeight);
}
else {
var th = this.elm.style.height;
this.elm.style.height = "auto";
var h = this.elm.offsetHeight;
this.elm.style.height = th;
return h;
}
}
};
p.setClip=function(clip) {
var cc=this.getClip();
for (var i=0;i<clip.length;i++) if (clip[i]==null) clip[i]=cc[i];
this.clip=clip;
if (this.css==null) return;
var c=this.css.clip;
if (dynapi.ua.ns4) c.top=clip[0], c.right=clip[1], c.bottom=clip[2], c.left=clip[3];
else this.css.clip="rect("+clip[0]+"px "+clip[1]+"px "+clip[2]+"px "+clip[3]+"px)";
};
p.getClip=function() {
if (this.css==null || !this.css.clip) return [0,0,0,0];
var c = this.css.clip;
if (c) {
if (dynapi.ua.ns4) return [c.top,c.right,c.bottom,c.left];
if (c.indexOf("rect(")>-1) {
c=c.split("rect(")[1].split(")")[0].split("px");
for (var i=0;i<c.length;i++) c[i]=parseInt(c[i]);
return [c[0],c[1],c[2],c[3]];
}
else return [0,this.w,this.h,0];
}
};
p.slideTo = function(endx,endy,inc,speed) {
if (!this._slideActive) {
var x = this.x||0;
var y = this.y||0;
if (endx==null) endx = x;
if (endy==null) endy = y;
var distx = endx-x;
var disty = endy-y;
if (x==endx && y==endy) return;
var num = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2))/(inc||10)-1;
var dx = distx/num;
var dy = disty/num;
this._slideActive = true;
this._slide(dx,dy,endx,endy,num,this.x,this.y,1,(speed||20));
}
};
p.slideStop = function() {
this._slideActive = false;
this.invokeEvent('pathcancel');
};
p._slide = function(dx,dy,endx,endy,num,x,y,i,speed) {
if (!this._slideActive) this.slideStop();
else if (i++ < num) {
this.invokeEvent('pathrun');
if (this._slideActive) {
x += dx;
y += dy;
this.setLocation(Math.round(x),Math.round(y));
setTimeout(this+'._slide('+dx+','+dy+','+endx+','+endy+','+num+','+x+','+y+','+i+','+speed+')',speed);
}
else this.slideStop();
}
else {
this._slideActive = false;
this.invokeEvent('pathrun');
this.setLocation(endx,endy);
this.invokeEvent('pathfinish');
}
};
--- NEW FILE ---
/*
DynAPI Distribution
DynEvent, EventObject, DynElement Classes
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/
function DynEvent(type,src) {
this.inherit('DynObject');
this.type = type;
this.src = src;
this.origin = src;
this.propagate = true;
this.bubble = false;
this.bubbleChild = null;
this.defaultValue = true;
};
var p = dynapi.setPrototype('DynEvent','DynObject');
p.getType = function() {return this.type};
p.getSource = function() {return this.src};
p.getOrigin=function() {return this.origin};
p.stopPropagation = function() {this.propagate = false};
p.preventBubble = function() {this.bubble = false};
p.preventDefault = function() {this.defaultValue = false};
p.getBubbleChild = function() {return this.bubbleChild};
function EventObject() {
this.inherit('DynObject');
this._listeners = [];
}
p = dynapi.setPrototype('EventObject','DynObject');
p._addEventListener = DynAPI.functions.Null;
p.addEventListener = function(el) {
if (el) {
for (var i=0;i<this._listeners.length;i++) if (this._listeners[i]==el) return;
this._listeners[this._listeners.length] = el;
if (this._listeners.length && this.captureMouseEvents) this.captureMouseEvents();
}
};
p._removeEventListener = DynAPI.functions.Null;
p.removeEventListener = function(el) {
if (el) {
DynAPI.functions.removeFromArray(this._listeners, el, false);
if (!this._listeners.length && this.releaseMouseEvents) this.releaseMouseEvents();
}
};
p.removeAllEventListeners = function() {
this._listeners = [];
};
p.invokeEvent = function(type,e,args) {
if (!e) e = new DynEvent(type,this);
if (this._listeners.length) for (var i=0;i<this._listeners.length;i++) {
if (this._listeners[i]["on"+type]) this._listeners[i]["on"+type](e,args);
if (!e.propagate) break;
}
if (this["on"+type]) this["on"+type](e,args);
if(e.bubble && this.parent) {
e.x += e.src.x;
e.y += e.src.y;
e.src = this.parent;
e.bubbleChild = this;
this.parent.invokeEvent(type,e,args);
}
};
function DynElement() {
this.inherit('EventObject');
this.isChild = false;
this._created = false;
this.parent = null;
this._dyndoc = null;
this.children = [];
this._childAnchors = [];
};
p = dynapi.setPrototype('DynElement','EventObject');
p.addChild = function(c) {
if (!c) return DynAPI.debug.print("Error: no object sent to [DynLayer].addChild()");
if (c.isChild) c.removeFromParent();
c.isChild = true;
c.parent = this;
if (c._saveAnchor) {
c.setAnchor(c._saveAnchor);
delete c._saveAnchor;
}
if (this._created) c._create();
this.children[this.children.length] = c;
return c;
};
p.removeChild = function(c) {
var l = this.children.length;
for (var i=0;i<l && this.children[i]!=c;i++);
if (i!=l) {
c._remove();
c._created = false;
c.isChild = false;
c.parent = null;
c.dyndoc = null;
this.children[i] = this.children[l-1];
this.children[l-1] = null;
this.children.length--;
}
};
p.deleteChild = function(c) {
c.removeFromParent();
c._delete();
};
p.deleteAllChildren = function() {
var l = this.children.length;
for(var i=0;i<l;i++) {
this.children[i].del();
delete this.children[i];
}
this.children = [];
};
p.deleteFromParent = function () {
if (this.parent) this.parent.deleteChild(this);
};
p.removeFromParent = function () {
if (this.parent) this.parent.removeChild(this);
};
p._create = p._remove = p._delete = p._destroy = DynAPI.functions.Null;
p.getAll = function() {
var ret = [];
var temp;
var l = this.children.length;
for(var i=0;i<l;i++) {
ret[this.children[i].id] = this.children[i];
temp = this.children[i].getAll();
for(var j in temp) ret[j] = temp[j];
}
return ret
};
p.isParentOf = function(obj,equality) {
if (!obj) return false;
return (equality && this==obj) || this.getAll()[obj.id]==obj;
};
p.isChildOf = function(obj,equality) {
if(!obj) return false;
return (equality && this==obj) || obj.getAll()[this.id]==this;
};
DynElement._flagEvent = function(obj,type) {
if (type=="create") obj._created = true;
obj.invokeEvent(type);
var l=obj.children.length;
for (var i=0; i<l; i++) {
DynElement._flagEvent(obj.children[i],type);
}
};
p.updateAnchor = function() {
this.parent._updateAnchor(this.id);
};
p._updateAnchor = function(id) {
var dlyr = DynAPI.document.all[id];
var a = this._childAnchors[id];
var tw = this.w;
var th = this.h;
if (tw==null && th==null) return;
var x = a.left;
var y = a.top;
var w = null;
var h = null;
if (a.centerH!=null) {
x = Math.ceil(tw/2 - dlyr.getWidth()/2 + a.centerH);
}
else if (a.right!=null) {
if (a.left!=null) w = tw - a.right - a.left;
else x = tw - dlyr.getWidth() - a.right;
}
if (a.centerV!=null) {
y = Math.ceil(th/2 - dlyr.getHeight()/2 + a.centerV);
}
else if (a.bottom!=null) {
if (a.top!=null) h = th - a.bottom - a.top;
else y = th - dlyr.getHeight() - a.bottom;
}
dlyr.setLocation(x,y);
dlyr.setSize(w,h);
};
p._updateAnchors = function() {
var tw = this.w;
var th = this.h;
if (tw==null && th==null) return;
for (id in this._childAnchors) this._updateAnchor(id);
};
--- NEW FILE ---
/*
DynAPI Distribution
MouseEvent Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: dynapi.api.DynDocument
*/
function MouseEvent(type, src) {
this.inherit('DynEvent',type,src);
this.bubble = true;
this._trap = false;
this._trapSrc = null;
this._button = 1;
this._mouseEvent = null;
};
var p = dynapi.setPrototype('MouseEvent','DynEvent');
p.getX = function() {return this.x};
p.getY = function() {return this.y};
p.getPageX = function() {return this.pageX};
p.getPageY = function() {return this.pageY};
p.trapMouseUp = function() {return this._trap = true};
p.getButton = function() {
if (!this._mouseEvent) return "left";
var b = DynAPI.ua.ie? this._mouseEvent.button : this._mouseEvent.which;
if (DynAPI.ua.ie){
if (b==2) b=3;
else if (b==4) b=2;
};
if (b==2) return "middle";
if (b==3) return "right";
else return "left";
};
MouseEvent._e = new MouseEvent();
MouseEvent.docEventHandler = function(e) {
if (!e.target.lyrobj) {
routeEvent(e);
return true;
}
else {
routeEvent(e);
return MouseEvent._e.defaultValue;
}
};
MouseEvent.eventHandler = function(e) {
var dynobject = this.lyrobj;
if (DynAPI.ua.def) {
if (DynAPI.ua.ie) var e = window.event;
e.cancelBubble=true;
}
if (DynAPI.ua.def) var realsrc = dynapi.functions.getContainerLayerOf(DynAPI.ua.ie?e.srcElement:e.target) || dynobject;
else if (DynAPI.ua.ns4) var realsrc = e.target.lyrobj || dynobject;
if (DynAPI.ua.ns4) {
if (!e.target.lyrobj && (e.type=="mousedown" || e.type=="mouseup" || e.type=="click")) {
return routeEvent(e);
}
}
if (!realsrc) return true
if (DynAPI.ua.def) {
if (e.type=="mouseout" && realsrc.isParentOf(dynapi.functions.getContainerLayerOf(DynAPI.ua.ie?e.toElement:e.relatedTarget),true)) return true;
if (e.type=="mouseover" && realsrc.isParentOf(dynapi.functions.getContainerLayerOf(DynAPI.ua.ie?e.fromElement:e.relatedTarget),true)) return true;
}
var evt = MouseEvent._e;
var type = e.type;
evt.type = type;
evt.src = realsrc;
evt.bubbleChild = null;
evt.defaultValue = true;
evt.bubble = true;
evt.pageX = DynAPI.ua.ie? e.x+document.body.scrollLeft : e.pageX-window.pageXOffset;
evt.pageY = DynAPI.ua.ie? e.y+document.body.scrollTop : e.pageY-window.pageYOffset;
evt.x = DynAPI.ua.ie? evt.pageX-evt.src.getPageX() : e.layerX;
evt.y = DynAPI.ua.ie? evt.pageY-evt.src.getPageY() : e.layerY;
evt._mouseEvent = e;
if (DynAPI.ua.def) {
if (evt.type=='mouseover') {
var fromL = dynapi.functions.getContainerLayerOf(DynAPI.ua.ie?e.fromElement:e.relatedTarget);
if(fromL && fromL.isChildOf(realsrc.parent,true)) evt.preventBubble();
}
if (evt.type=='mouseout') {
var toL = dynapi.functions.getContainerLayerOf(DynAPI.ua.ie?e.toElement:e.relatedTarget);
if(toL && toL.isChildOf(realsrc.parent,true)) evt.preventBubble();
}
}
else if (DynAPI.ua.ns4 && (e.type=="mouseover" || e.type=="mouseout")) evt.preventBubble();
if (DynAPI.ua.def) {
if (e.type=='mousedown') evt._trap = false;
if (e.type=='mouseup' && evt._trap) evt.src = realsrc = evt._trapSrc;
}
evt.origin = realsrc;
realsrc.invokeEvent(type,evt);
if (DynAPI.ua.def) {
if (e.type=='mousedown') {
if (evt._trap) evt._trapSrc = realsrc;
}
}
return evt.defaultValue;
};
DynDocument.prototype.captureMouseEvents = function() {
if(DynAPI.ua.def&&!DynAPI.ua.ie) {
this.doc.addEventListener("mousemove",MouseEvent.eventHandler,false);
this.doc.addEventListener("mousedown",MouseEvent.eventHandler,false);
this.doc.addEventListener("mouseup",MouseEvent.eventHandler,false);
this.doc.addEventListener("mouseover",MouseEvent.eventHandler,false);
this.doc.addEventListener("mouseout",MouseEvent.eventHandler,false);
this.doc.addEventListener("click",MouseEvent.eventHandler,false);
this.doc.addEventListener("dblclick",MouseEvent.eventHandler,false);
}
else {
if (DynAPI.ua.ns4) this.doc.captureEvents(Event.MOUSEMOVE | Event.MOUSEDOWN | Event.MOUSEUP | Event.CLICK | Event.DBLCLICK);
this.doc.onmousemove=this.doc.onmousedown=this.doc.onmouseup=this.doc.onclick=this.doc.onclick=this.doc.ondblclick=MouseEvent.eventHandler;
}
};
DynDocument.prototype.releaseMouseEvents=function() {
if(DynAPI.ua.def&&!DynAPI.ua.ie) {
this.doc.removeEventListener("mousemove",MouseEvent.eventHandler,false);
this.doc.removeEventListener("mousedown",MouseEvent.eventHandler,false);
this.doc.removeEventListener("mouseup",MouseEvent.eventHandler,false);
this.doc.removeEventListener("mouseover",MouseEvent.eventHandler,false);
this.doc.removeEventListener("mouseout",MouseEvent.eventHandler,false);
this.doc.removeEventListener("click",MouseEvent.eventHandler,false);
this.doc.removeEventListener("dblclick",MouseEvent.eventHandler,false);
}
else {
if (DynAPI.ua.ns4) this.doc.releaseEvents(Event.MOUSEMOVE | Event.MOUSEDOWN | Event.MOUSEUP | Event.CLICK | Event.DBLCLICK);
this.doc.onmousemove=this.doc.onmousedown=this.doc.onmouseup=this.doc.onclick=this.doc.ondblclick=null;
}
};
DynLayer.prototype.captureMouseEvents = function() {
var elm=this.elm;
if(!elm) return;
if(DynAPI.ua.def&&!DynAPI.ua.ie) {
elm.addEventListener("mousemove",MouseEvent.eventHandler,false);
elm.addEventListener("mousedown",MouseEvent.eventHandler,false);
elm.addEventListener("mouseup",MouseEvent.eventHandler,false);
elm.addEventListener("mouseover",MouseEvent.eventHandler,false);
elm.addEventListener("mouseout",MouseEvent.eventHandler,false);
elm.addEventListener("click",MouseEvent.eventHandler,false);
elm.addEventListener("dblclick",MouseEvent.eventHandler,false);
elm.ondragstart = dynapi.functions.False;
elm.onselectstart = dynapi.functions.False;
}
else {
if (DynAPI.ua.ns4) elm.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.CLICK | Event.DBLCLICK | Event.MOUSEMOVE);
elm.onmousemove=elm.onmousedown=elm.onmouseup=elm.onmouseover=elm.onmouseout=elm.onclick=elm.ondblclick = MouseEvent.eventHandler;
}
};
DynLayer.prototype.releaseMouseEvents=function() {
var elm=this.elm;
if(!elm) return;
if(DynAPI.ua.def&&!DynAPI.ua.ie) {
elm.removeEventListener("mousemove",MouseEvent.eventHandler,false);
elm.removeEventListener("mousedown",MouseEvent.eventHandler,false);
elm.removeEventListener("mouseup",MouseEvent.eventHandler,false);
elm.removeEventListener("mouseover",MouseEvent.eventHandler,false);
elm.removeEventListener("mouseout",MouseEvent.eventHandler,false);
elm.removeEventListener("click",MouseEvent.eventHandler,false);
elm.removeEventListener("dblclick",MouseEvent.eventHandler,false);
}
else {
if (DynAPI.ua.ns4) elm.releaseEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.CLICK | Event.DBLCLICK | Event.MOUSEMOVE);
elm.onmousemove=elm.onmousedown=elm.onmouseup=elm.onclick=elm.ondblclick=null;
}
};
DynElement.prototype.assignMouseEvents = function() {
if (this._listeners.length) this.captureMouseEvents();
};
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:59
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi
In directory usw-pr-cvs1:/tmp/cvs-serv15575/src/dynapi
Added Files:
debug.html debug.js functions.js library.html library.js
Log Message:
Initial Import == 2.9
--- NEW FILE ---
<title>DynAPI Debugger</title>
<script>
var dynapi = window.opener.dynapi;
function handleError(msg, url, lno) {
dynapi.debug.error(msg, "Debugger", lno);
};
this.onload = function() {
if (dynapi._debugBuffer) {
dynapi.debug.print(dynapi._debugBuffer);
dynapi._debugBuffer = '';
}
}
if (!dynapi.ua.ns6) self.onerror = handleError;
</script>
<style type="text/css">
</style>
<body bgcolor="#D4D0C8" leftmargin=10 topmargin=10">
<script>
var str='<form name=debugform><font face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" size="1">'+
'<table cellspacing=0 cellpadding=0 border=0><tr><td colspan=2>'+
'<textarea name="print" cols="'+(dynapi.ua.mac? (dynapi.ua.ie?42:42) :40)+'" rows="'+(dynapi.ua.ie?12:13)+'" wrap="off"></textarea><br>'+
'<input type=text name="stat" size="'+(dynapi.ua.mac? (dynapi.ua.ie?44:46) :42)+'" '+(dynapi.ua.ie?'style="font-family:Monaco;"':'')+' value="DynAPI '+dynapi.version+'"/><br>'+
'<textarea name="eval" cols="'+(dynapi.ua.mac? (dynapi.ua.ie?42:42) :40)+'" rows="'+(dynapi.ua.ie?7:8)+'" wrap="off"></textarea><br>'+
'</td></tr><tr>'+
'<td><input type=button value="Evaluate" onclick="window.opener.DynAPI.debug.evaluate(this.form.eval.value)"></td>'+
'<td align=right><input type="button" value="Clear" onclick="{this.form.print.value=\'\'; this.form.stat.value=\'\'; this.form.eval.value=\'\';}"></td></tr></table>'+
'</font></form>';
document.open();
document.write(str);
document.close();
</script>
</body>
--- NEW FILE ---
/*
DynAPI Distribution
Debugger
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/
function Debugger() {
this.inherit('DynObject');
this.win = null;
}
dynapi.setPrototype('Debugger','DynObject');
Debugger.prototype.isLoaded = function() {return (this.win && this.win.document.debugform)};
Debugger.prototype.status = function(str) {
if (this.isLoaded()) {
for (var i=1;i<arguments.length;i++) {
str += ', '+arguments[i];
}
this.win.document.debugform.stat.value = str;
};
};
Debugger.prototype.inspect = function(obj,showFunctions) {
this.print('Inspecting:');
var v;
for (var i in obj) {
if (obj[i]==null) v = "null";
else if (typeof(obj[i])=='function') {
if (showFunctions==false) continue;
else v = '[Function]';
}
else if (typeof(obj[i])=='object' && obj[i].length) v = 'Array ['+obj[i]+']';
else if (typeof(obj[i])=='object') v = '[Object]';
else v = obj[i];
this.print(' '+i+' = '+v);
}
};
Debugger.prototype.print = function(s) {
if (this.isLoaded()) {
for (var i=1;i<arguments.length;i++) { // accommodate print(v1,v2,v3)
s += ', '+arguments[i];
}
this.win.document.debugform.print.value += s +'\n';
}
else {
if (!dynapi._debugBuffer) dynapi._debugBuffer = s;
else dynapi._debugBuffer += '\n'+s;
}
};
Debugger.prototype.error = function(msg, url, lno) {
if (url && url.indexOf(dynapi.documentPath)==0) {
url = url.substring(dynapi.documentPath.length);
}
this.print('Error:'+ (lno? ' Line '+lno : '') +' ['+url+']\n '+msg);
};
Debugger.prototype.evaluate = function(str) {
window.eval(str);
};
Debugger.prototype.setEvaluate = function(str) {
if (this.isLoaded()) this.win.document.debugform.eval.value = str
};
Debugger.prototype.open = function() {
var p = dynapi.library.path;
if (!this.isLoaded() && p) {
var url = dynapi.documentPath+p+'debug.html#';
var w = dynapi.ua.mac? (dynapi.ua.ie?330:300) : 360;
var h = dynapi.ua.mac? (dynapi.ua.ie?405:365) : dynapi.ua.ie? 420:465;
this.win = window.open(url,'debugwin','width='+w+',height='+h+',scrollbars=no,status=no,toolbar=no,resizable=no');
/*if (dynapi.ua.ns4) { // move the debug window to the right edge?
var f = dynapi.frame;
var ns4 = dynapi.ua.ns4;
var sX = ns4? f.screenX : f.screenLeft;
var sY = ns4? f.screenY : f.screenTop;
var sW = ns4? f.outerWidth : 100;
if (sX!=null && sY!=null && sW!=null) this.win.moveTo(sX+sW,sY);
}*/
this.win.focus();
if (dynapi._debugBuffer) {
dynapi.debug.print(dynapi._debugBuffer);
dynapi._debugBuffer = '';
}
dynapi.frame.onerror = function(msg, url, lno) {
dynapi.debug.error(msg, url, lno);
};
}
};
Debugger.prototype.close = function() {
if (this.isLoaded()) {
this.win.close();
this.win = null;
}
};
dynapi.debug = new Debugger();
dynapi.debug.open();
/*dynapi.onUnload(function() {
dynapi.debug.close(); // close the debug window on unload
});*/
--- NEW FILE ---
/*
DynAPI Distribution
dynapi.functions extension
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/
dynapi.functions.DecToHex = function(val){
lo=val%16;
val-=lo;
lo+=48;
if (lo>57) lo+=7;
hi=val/16;
hi+=48;
if (hi>57) hi+=7;
return String.fromCharCode(hi,lo);
};
dynapi.functions.getColor = function(r,g,b) {
return '#'+dynapi.functions.DecToHex(r)+dynapi.functions.DecToHex(g)+dynapi.functions.DecToHex(b);
};
dynapi.functions.createRedPal = function(pal) {
var r=g=b=0;
for (var i=0; i<256; i++){
pal[i]=dynapi.functions.getColor(r,g,b);
r+=8;
if (r>255) { r=255; g+=6; b+=2; }
if (g>255) { g=255; b+=2; }
if (b>255) { b=255; }
}
};
dynapi.functions.createGrayPal = function(pal) {
var r=0;
for (var i=0; i<256; i++){
pal[i]=dynapi.functions.getColor(r,r,r);
r+=4;
if (r>255) { r=255; }
}
};
dynapi.functions.createBluePal = function(pal){
var r=g=b=0;
for (var i=0; i<256; i++){
pal[i]=dynapi.functions.getColor(r,g,b);
b+=6;
if (b>255) { b=255; g+=2; }
if (g>255) { g=255; r+=2; }
}
};
dynapi.functions.createGreenPal = function(pal) {
var r=g=b=0;
for (var i=0; i<256; i++){
pal[i]=dynapi.functions.getColor(r,g,b);
g+=6;
if (g>255) { g=255; b+=2; }
if (b>255) { b=255; r+=2; }
}
};
dynapi.functions.radianToDegree = function(radian) {
return radian*180/Math.PI
};
dynapi.functions.degreeToRadian = function(degree) {
return degree*Math.PI/180
};
dynapi.functions.sintable = function(lsin) {
for (var i=0; i<361; i+=1) lsin[i]=Math.sin((i/180)*Math.PI);
};
dynapi.functions.costable = function(lcos) {
for (var i=0; i<361; i+=1) lcos[i]=Math.cos((i/180)*Math.PI);
};
--- NEW FILE ---
<script>
dynapi.library._handleLoad(this);
</script>
--- NEW FILE ---
/*
DynAPI Distribution
Dynamic Loading extension to dynapi.library
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/
DynAPILibrary.prototype.a = function() {alert('hi')};
// begin loading the object
DynAPILibrary.prototype.load = function(n,fn) {
var list = this._queue(n,null,arguments[2]);
//return dynapi.debug.print('going to load: '+list);
if (list.length) {
var s,src;
for (var i=0;i<list.length;i++) {
src = list[i];
s = this.scripts[list[i]];
if (i==list.length-1 && fn!=null) s.fn = fn;
this.loadList[this.loadList.length] = src;
}
this._load();
}
else if (fn) fn();
};
// reload the object
DynAPILibrary.prototype.reload = function(n,fn,force) {
var s = this.objects[n];
if (s) {
s.loaded = false;
this.load(n,fn,force);
}
};
// load a script that is not added to the library
DynAPILibrary.prototype.loadScript = function(src,fn) {
if (!this.scripts[src]) {
var n = 'unnamed'+this._c++;
s = this.add(n,src); // generate a name for the script
s.unnamed = true;
s.fn = null;
s.dep = [];
this.load(n,fn);
}
};
// inserts the script element into the page
DynAPILibrary.prototype._load = function() {
if (this.busy) return; // dynapi.debug.print('Library Warning: busy');
else {
if (this.loadIndex<this.loadList.length-1) {
this.busy = true;
this.loadIndex++;
var src = this.loadList[this.loadIndex];
//if (!confirm('load: '+src+' ?')) return;
var rsrc = src + '?'+Math.random(); // random ensures cached files are not loaded
var s = this.scripts[src];
if (dynapi.ua.ns4) {
// delete the constructors
for (var j=0;j<s.objects.length;j++) {
var n = s.objects[j];
if (dynapi.frame[n]) {
dynapi.frame[n] = null;
if (s.pkg) dynapi.frame[s.pkg+'.'+n] = null;
}
}
this.elm.src = dynapi._path+'library.html?js='+src;
}
else if (dynapi.ua.ie && (dynapi.v==4 || dynapi.ua.mac)) {
dynapi.frame.document.body.insertAdjacentHTML('beforeEnd','<script language="javascript" src="'+rsrc+'" defer><\/script>');
this._export(src);
}
else {
var elm = s.elm = dynapi.frame.document.createElement('script');
elm.src = rsrc;
elm.type = 'text/javascript';
elm.defer = true;
if (dynapi.ua.ie) {
elm.C = 0;
var o = this;
elm.onreadystatechange = function() {
elm.C++;
if (elm.C==2) { // use 2nd statechange for onload
o._export(src);
}
}
}
dynapi.frame.document.getElementsByTagName('head')[0].appendChild(elm);
// I could not find way to know when the script is complete in Moz v0.9.3
if (dynapi.ua.ns6) setTimeout(this+'._export("'+src+'")',100);
}
}
}
};
// executed after a script is finished loading, run main() functions
DynAPILibrary.prototype._export = function(src) {
var src = this.loadList[this.loadIndex];
var s = this.scripts[src];
if (s) {
this._register(s);
// run main() if available
if (!dynapi.ua.ns4 && typeof(main)=="function") {
main();
main = null;
}
if (dynapi.ua.ns4) {
if (typeof(this.elm.main)=="function") {
this.elm.main();
this.elm.main = null;
}
// check global main after elm.main
else if (typeof(main)=="function") {
main();
main = null;
}
// clear out all functions in the layer's scope
for (var i in this.elm[name]) {
if (typeof(this.elm[i])=="function") {
delete this.elm[i];
}
}
}
this.busy = false;
// load next file
this._load();
}
else return alert('Library Error: unknown script '+src);
};
// registers the script as loaded, exports the objects
DynAPILibrary.prototype._register = function(s) {
//dynapi.debug.print('loaded "'+s.src+'"');
s.loaded = true;
s.queued = false;
if (!s.unnamed) {
var n,found;
// loop through each object that the script contains
for (var i=0;i<s.objects.length;i++) {
found = false;
n = s.objects[i];
// scope local objects in the layer to the DynAPI frame
if (dynapi.ua.ns4 && this.elm && typeof(this.elm[n])=="function") {
dynapi.frame[n] = this.elm[n];
found = true;
}
else if (typeof(dynapi.frame[n])=="function" || typeof(dynapi.frame[n])=="object") found = true;
else if (n.indexOf('.')>0) {
var ns = n.split('.'), o = dynapi.frame, b = false;
for (var j=0;j<ns.length;j++) {
o = o[ns[j]];
}
if (typeof(o)=="function" || typeof(o)=="object") found = true;
}
else if (typeof(dynapi[n])=="object") found = true;
if (found) {
if (s.pkg) {
// make package link eg dynapi.api.DynLayer
if (s.pkg!="dynapi") this.packages[s.pkg][n] = dynapi.frame[n];
n = s.pkg+'.'+n;
}
dynapi.debug.print('loaded ['+n+']');
}
else {
dynapi.debug.print('Library Error: could not find ['+n+']');
}
}
}
// run handler if available
if (s.fn) {
s.fn();
delete s.fn;
}
};
// called from /lib/dynapi/library.html to write the <script>, NS4 only
DynAPILibrary.prototype._handleLoad = function(elm) {
var args = dynapi.functions.getURLArguments(elm.src);
var js = args["js"];
if (js) {
if (js.indexOf('http')!=0) {
var l = dynapi.frame.document.location;
if (js.substr(0,1)=='/') js = l.port+'//'+host+src;
else js = dynapi.documentPath+js;
}
//if (!confirm('write '+js+' ?')) return dynapi.library._export(js);
elm.document.write('<script language="JavaScript" src="'+js+'?r'+Math.random()+'"><\/script>');
elm.document.close();
elm.onload = function() {
dynapi.library._export(js);
}
}
};
// inserts the layer for NS4, register included scripts
DynAPILibrary.prototype._create = function() {
// ensure a previous main function is wiped out
if (typeof(main)=="function") main = null;
// register objects from scripts included by dynapi.library.include() or manually
var s;
for (var i in this.scripts) {
s = this.scripts[i];
if (s.loaded || (s.objects[0] && dynapi.frame[s.objects[0]])) this._register(s);
}
// create NS4 layer to load scripts into
if (dynapi.ua.ns4) this.elm = new Layer(0, dynapi.frame);
this.busy = false;
if (this.loadList.length) {
var s = this.scripts[this.loadList[this.loadList.length-1]];
s.fn = function() {
setTimeout('dynapi._onLoad()',1);
}
this._load();
}
else setTimeout('dynapi._onLoad()',1);
};
|
Update of /cvsroot/dynapi/dynapi2x/examples
In directory usw-pr-cvs1:/tmp/cvs-serv15575/examples
Added Files:
dynapi.api.dynlayer-anchor.html
dynapi.api.dynlayer-create.html dynapi.api.dynlayer-slide.html
dynapi.api.ext.dragevent.html dynapi.api.mouseevent.html
dynapi.fx.pathanim-glide.html dynapi.fx.pathanim-slide.html
dynapi.fx.pathanim.html dynapi.gui.graphics.html
dynapi.library-file1.js dynapi.library-file2.js
dynapi.library-load.html dynapi.util.ioelement-testfile.html
dynapi.util.ioelement.html
Log Message:
Initial Import == 2.9
--- NEW FILE ---
<html>
<head>
<title>DynAPI Examples - DynLayer Anchor</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.debug');
dynapi.library.include('dynapi.library');
dynapi.library.include('dynapi.api');
</script>
<script language="Javascript">
var bb = new DynLayer();
bb.setBgColor('black');
bb.setAnchor({left:8,right:8,top:8,bottom:8});
main = new DynLayer();
main.setBgColor('#999999');
main.setAnchor({left:1,right:1,top:1,bottom:1});
bb.addChild(main);
var anchorlayer = new DynLayer();
anchorlayer.setBgColor('black');
anchorlayer.setSize(200,100);
anchorlayer.setLocation(100,100);
var nw = anchorlayer.addChild( new DynLayer() );
nw.setBgColor('yellow');
nw.setSize(15,15);
nw.setAnchor({left:0,top:0});
var ne = anchorlayer.addChild( new DynLayer() );
ne.setBgColor('yellow');
ne.setSize(15,15);
ne.setAnchor({right:0,top:0});
var sw = anchorlayer.addChild( new DynLayer() );
sw.setBgColor('yellow');
sw.setSize(15,15);
sw.setAnchor({left:0,bottom:0});
var se = anchorlayer.addChild( new DynLayer() );
se.setBgColor('yellow');
se.setSize(15,15);
se.setAnchor({right:0,bottom:0});
var n = anchorlayer.addChild( new DynLayer() );
n.setHeight(5);
n.setBgColor('green');
n.setAnchor({left:20,top:5,right:20});
var s = anchorlayer.addChild( new DynLayer() );
s.setHeight(5);
s.setBgColor('green');
s.setAnchor({left:20,bottom:5,right:20});
var e = anchorlayer.addChild( new DynLayer() );
e.setWidth(5);
e.setBgColor('green');
e.setAnchor({right:5,top:20,bottom:20});
var w = anchorlayer.addChild( new DynLayer() );
w.setWidth(5);
w.setBgColor('green');
w.setAnchor({left:5,top:20,bottom:20});
var cn = anchorlayer.addChild( new DynLayer() );
cn.setSize(20,10);
cn.setBgColor('red');
cn.setAnchor({top:15,centerH:0});
var cn = anchorlayer.addChild( new DynLayer() );
cn.setSize(20,10);
cn.setBgColor('red');
cn.setAnchor({top:15,centerH:0});
var cs = anchorlayer.addChild( new DynLayer() );
cs.setSize(20,10);
cs.setBgColor('red');
cs.setAnchor({bottom:15,centerH:0});
var ce = anchorlayer.addChild( new DynLayer() );
ce.setSize(10,20);
ce.setBgColor('red');
ce.setAnchor({right:15,centerV:0});
var cw = anchorlayer.addChild( new DynLayer() );
cw.setSize(10,20);
cw.setBgColor('red');
cw.setAnchor({left:15,centerV:0});
var chv = anchorlayer.addChild( new DynLayer() );
chv.setSize(20,20);
chv.setBgColor('blue');
chv.setAnchor({centerH:0,centerV:0});
var box = new DynLayer();
box.setBgColor('white');
box.setSize(100,100);
box.setAnchor({right:10,bottom:10});
bluesquare = new DynLayer();
bluesquare.setBgColor('blue');
bluesquare.setSize(10,10);
bluesquare.setAnchor({left:0,top:0});
box.addChild(bluesquare);
main.addChild(box);
main.addChild(anchorlayer)
dynapi.document.addChild(bb);
dynapi.onLoad(init);
function init() {
str = '// Try these tests:\n\n'+
'anchorlayer.setLocation(50,50);\n'+
'anchorlayer.setSize(300,200);\n'+
'//anchorlayer.setAnchor({left:0,right:0,top:0,bottom:0});\n\n'+
'bluesquare.setSize(10,10); // must reset size if it is no longer 10x10\n\n'+
'// Align:\n'+
'bluesquare.setAnchor({right:0,bottom:0});\n'+
'//bluesquare.setAnchor({right:0,top:0});\n'+
'//bluesquare.setAnchor({left:0,top:0});\n'+
'//bluesquare.setAnchor({left:0,bottom:0});\n'+
'// Strech:\n'+
'//bluesquare.setAnchor({left:0,right:0,bottom:0});\n'+
'//bluesquare.setAnchor({left:0,right:0,top:0});\n'+
'//bluesquare.setAnchor({left:0,top:0,bottom:0});\n'+
'//bluesquare.setAnchor({right:0,top:0,bottom:0});\n'+
'// Center:\n'+
'//bluesquare.setAnchor({centerV:0,centerH:0});\n';
dynapi.debug.setEvaluate(str);
}
</script>
</head>
<body bgcolor="white">
<script>
dynapi.document.insertAllChildren();
</script>
</body>
</html>
--- NEW FILE ---
<html>
<head>
<title>DynAPI - DynLayer Create/Remove/Delete</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.api');
</script>
<script language="Javascript">
w = new DynLayer();
w.setBgColor('white');
w.setSize(130,130);
w.setLocation(250,50);
b = new DynLayer();
b.setBgColor('black');
b.setSize(100,100);
b.setLocation(400,50);
r = new DynLayer();
r.setBgColor('red');
r.setSize(50,50);
DynAPI.document.addChild(w);
DynAPI.document.addChild(b);
</script>
</head>
<body bgcolor="#999999">
<p>This is not working, and will be fixed in a next release:
<p>R: add to <a href="javascript://" onClick="w.addChild(r)">W</a>, <a href="javascript://" onClick="b.addChild(r)">B</a><br>
R: remove from <a href="javascript://" onClick="r.removeFromParent()">[parent]</a>, <a href="javascript://" onClick="w.removeChild(r)">W</a>, <a href="javascript://" onClick="b.removeChild(r)">B</a>
<script>
DynAPI.document.insertAllChildren();
</script>
</body>
</html>
--- NEW FILE ---
<html>
<head>
<title>DynAPI Examples - DynLayer [Slide]</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.api');
</script>
<script language="Javascript">
DynAPI.onLoad(function() {
block = new DynLayer();
block.setSize(20,20);
block.setLocation(100,100);
block.setBgColor("red");
var listener = {};
listener.onpathstart = function(e) {
status = "start";
}
listener.onpathrun = function(e) {
var o = e.getSource();
status = "play "+o.x+" "+o.y;
}
listener.onpathstop = function(e) {
var o = e.getSource();
status = "stop "+o.x+" "+o.y;;
}
block.addEventListener(listener);
DynAPI.document.addChild(block);
});
//-->
</script>
</head>
<body bgcolor="#ffffff">
<p>SlideTo:
<br>(<a href="javascript:block.slideTo(100,100)">100,100</a>)
<br>(<a href="javascript:block.slideTo(200,100)">200,100</a>)
<br>(<a href="javascript:block.slideTo(200,200)">200,200</a>)
<br>(<a href="javascript:block.slideTo(100,200)">100,200</a>)
<br>(<a href="javascript:block.slideTo(400,50)">400,50</a>)
<br>(<a href="javascript:block.slideTo(50,400)">50,400</a>)
</body>
</html>
--- NEW FILE ---
<html>
<head>
<title>DynAPI Examples - Drag Event</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.api');
dynapi.library.include('dynapi.library');
dynapi.library.include('dynapi.debug');
dynapi.library.include('DragEvent');
</script>
<script language="Javascript">
var p = dynapi.document.addChild(new DynLayer(null,20,20,200,200,'silver'))
var a=p.addChild(new DynLayer(null,10,10,20,20,'red'))
DragEvent.enableDragEvents(a);
DragEvent.setDragBoundary(a, {left:5, right:5, top:5, bottom:5});
dynapi.onLoad(function() {
str = '// Try these tests:\n\n'+
'p.setSize(150,350);\n'+
'//p.setSize(200,200);\n';
dynapi.debug.setEvaluate(str);
});
</script>
</head>
<body bgcolor="#ffffff">
<script>
dynapi.document.insertAllChildren();
</script>
</body>
</html>
--- NEW FILE ---
<html>
<head>
<title>DynAPI - Mouse Events</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.api','dynapi.debug');
</script>
<script language="Javascript">
var o = new DynObject();
eo = new EventObject();
eo.onhi = function() {
alert('hi!');
}
var el = {};
el.onhi = function(e) {
alert('HI 1!');
e.setPropagate(false);
}
eo.addEventListener(el);
var el2 = {};
el2.onhi = function(e) {
alert('HI 2!');
}
eo.addEventListener(el2);
var str = '<img src="../src/dynapi/images/arrowdown.gif" width=18 height=10 alt="" border="0">'+
'<a href="javascript:alert(\'IMG\')"><img src="../src/dynapi/images/arrowup.gif" width=18 height=10 alt="" border="0"></a><br>'+
'text text '+
'<a href="javascript:alert(\'TEXT\')">link link</a>'+
'<form><input type=button value="Button" onclick="alert(\'BUTTON\')"></form>';
red = new DynLayer(str,50,50,300,300,'red');
blue = red.addChild(new DynLayer(str,0,100,200,200,'blue'));
yellow = blue.addChild(new DynLayer(str,100,100,100,100,'yellow'));
DynAPI.document.addChild(red);
DynAPI.onLoad(init);
function init() {
var el = {};
el.onmouseout = el.onmouseover = el.onmouseup = el.onmousedown = function(e) {
var o = e.getSource();
DynAPI.debug.print(e.type+' '+o.getBgColor()+' xy='+e.x+','+e.y+' pXY='+e.pageX+','+e.pageY);
}
var move = {};
move.onmousemove = function(e) {
var o = e.getSource();
DynAPI.debug.status(e.type+' '+o.getBgColor()+' xy='+e.x+','+e.y+' pXY='+e.pageX+','+e.pageY);
}
red.addEventListener(el);
blue.addEventListener(el);
yellow.addEventListener(el);
yellow.addEventListener(move);
}
</script>
</head>
<body bgcolor="#999999" link="green">
<script language="Javascript">
DynAPI.document.insertAllChildren();
</script>
</body>
</html>
--- NEW FILE ---
<html>
<head>
<title>DynAPI Examples - Glide Animation (Path Animation)</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.api');
dynapi.library.include('PathAnimation');
dynapi.library.include('GlideAnimation');
</script>
<script language="Javascript">
DynAPI.onLoad(init);
function init() {
block = new DynLayer();
block.setSize(20,20);
block.setLocation(200,100);
block.setBgColor("red");
block.addMethod('glideTo',PathAnimation.glideTo);
block.addMethod('glideStop',PathAnimation.glideStop);
squarePath = new PathAnimation(block);
squarePath.sleep(20);
var p = PathAnimation.glide(200,100,400,100,7,'slow','slow');
p = p.concat( PathAnimation.glide(400,100,400,200,7,'slow','slow') );
p = p.concat( PathAnimation.glide(400,200,200,200,7,'slow','slow') );
p = p.concat( PathAnimation.glide(200,200,200,100,7,'slow','slow') );
squarePath.add(p,true);
var listener = {}
listener.onpathstart = function(e) {
DynAPI.debug.print("start");
}
listener.onpathrun = function(e) {
var o = e.getSource();
DynAPI.debug.print("play "+o.x+" "+o.y);
}
listener.onpathfinish = function(e) {
var o = e.getSource();
DynAPI.debug.print("stop "+o.x+" "+o.y);
}
block.addEventListener(listener);
DynAPI.document.addChild(block);
}
//-->
</script>
</head>
<body bgcolor="#ffffff">
<p>Square Slide:
<br><a href="javascript://" onclick="squarePath.play(); return false;">start</a>
<br><a href="javascript://" onclick="squarePath.stop(); return false;">pause</a>
<p>SlideTo:
<br>(<a href="javascript://" onclick="block.glideTo(200,100); return false;">200,100</a>) slow,slow
<br>(<a href="javascript://" onclick="block.glideTo(400,100); return false;">400,100</a>) slow,slow
<br>(<a href="javascript://" onclick="block.glideTo(400,200); return false;">400,200</a>) slow,slow
<br>(<a href="javascript://" onclick="block.glideTo(200,200); return false;">200,200</a>) slow,slow
<p>(<a href="javascript://" onclick="block.glideTo(100,100,5,20,'fast','slow'); return false;">100,100</a>) fast,slow
<br>(<a href="javascript://" onclick="block.glideTo(50,400,5,20,'slow','fast'); return false;">50,400</a>) slow,fast
<br>(<a href="javascript://" onclick="block.glideTo(0,0,5,20,'fast','fast'); return false;">0,0</a>) fast fast
</body>
</html>
--- NEW FILE ---
<html>
<head>
<title>DynAPI Examples - Path Animation [Slide]</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.api');
dynapi.library.include('dynapi.library');
dynapi.library.include('dynapi.debug');
dynapi.library.include('PathAnimation');
dynapi.library.include('SlideAnimation');
</script>
<script language="Javascript">
DynAPI.onLoad(function() {
block = new DynLayer();
block.setSize(20,20);
block.setLocation(100,100);
block.setBgColor("red");
var listener = {};
listener.onpathstart = function(e) {
status = "start";
}
listener.onpathrun = function(e) {
var o = e.getSource();
status = "play "+o.x+" "+o.y;
}
listener.onpathfinish = function(e) {
var o = e.getSource();
status = "stop "+o.x+" "+o.y;;
}
block.addEventListener(listener);
DynAPI.document.addChild(block);
});
//-->
</script>
</head>
<body bgcolor="#ffffff">
<p>SlideTo:
<br>(<a href="javascript:block.slideTo(100,100)">100,100</a>)
<br>(<a href="javascript:block.slideTo(200,100)">200,100</a>)
<br>(<a href="javascript:block.slideTo(200,200)">200,200</a>)
<br>(<a href="javascript:block.slideTo(100,200)">100,200</a>)
<br>(<a href="javascript:block.slideTo(400,50)">400,50</a>)
<br>(<a href="javascript:block.slideTo(50,400)">50,400</a>)
</body>
</html>
--- NEW FILE ---
<html>
<head>
<title>DynAPI Examples - Path Animation</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.api');
dynapi.library.include('dynapi.library');
dynapi.library.include('dynapi.debug');
dynapi.library.include('PathAnimation');
dynapi.library.include('SlideAnimation');
dynapi.library.include('GlideAnimation');
dynapi.library.add('dynapi.fx.CircleAnimation','circleanim.js',['Thread','dynapi.functions']);
dynapi.library.include('CircleAnimation');
</script>
<script language="Javascript">
dynapi.onLoad(init);
function init() {
block = new DynLayer();
block.setSize(20,20);
block.setLocation(214,174);
block.setBgColor("red");
// path 0 straight line manually created
path = new PathAnimation(block);
linemanual = [100,100,110,110,120,120,130,130,140,140,150,150,160,160,170,170,180,180,190,190,200,200];
path.add( linemanual );
// path 1 straight line generated
linegenerated = PathAnimation.line(100,100, 33,3, 20); // x1,y1,x2,y2,inc
path.add( linegenerated );
// path 2 squiggly line
var x = [90,92,94,97,100,103,107,111,116,120,125,130,135,140,146,151,156,161,167,172,177,183,189,196,203,210,218,227,235,244,252,260,267,273,279,284,288,291,293,294,295,294,293,291,288,285,282,278,274,270,266,263,260,257,254,252,251,251,251,253,255,257,261,266,271,277,284,292,300,310,320,332,344,357,371,385,398,412,424,435];
var y = [73,73,72,72,73,73,74,75,77,79,82,85,89,94,101,108,116,125,136,147,158,169,180,191,200,208,215,221,226,229,231,231,230,228,225,220,215,209,202,194,187,179,171,163,155,147,139,132,126,119,114,109,104,100,96,92,88,84,81,77,74,71,68,66,64,63,63,64,65,68,73,79,86,96,107,119,131,143,155,165];
linesquiggle = PathAnimation.interlace(x,y)
path.add( linesquiggle );
// path 3 generated circle path starting at 180degrees about point (250,250)
// note: circleanim is not required in order to use pathanim
circle = new CircleAnimation();
circle.setRadius(50);
circle.setAngle(180);
circle.setAngleIncrement(10);
circlepath = circle.generatePath(250,250);
path.add(circlepath);
// default interval
path.sleep(50);
var listener = {};
listener.onpathstart = function(e) {
status = "start";
}
listener.onpathrun = function(e) {
var o = e.getSource();
status = "play "+o.x+" "+o.y;
}
listener.onpathstop = function(e) {
var o = e.getSource();
status = "stop "+o.x+" "+o.y;;
}
block.addEventListener(listener);
DynAPI.document.addChild(block);
}
</script>
</head>
<body bgcolor="#ffffff">
<p><b>Controls</b>:
<br>sleep : <a href="javascript:path.sleep(20)">20</a> | <a href="javascript:path.sleep(50)">50</a> | <a href="javascript:path.sleep(100)">100</a>
<br>show coordinates : <a href="javascript:alert(path.paths[0])">path 0</a> | <a href="javascript:alert(path.paths[1])">path 1</a> | <a href="javascript:alert(path.paths[2])">path 2</a> | <a href="javascript:alert(path.paths[3])">path 3</a>
<br><a href="javascript:path.stop()">stopAnimation</a>
<p><b>Unstored Animations</b>
<br><font size=-1>This type is meant for quick playing, the information is deleted when
<br>the animation is finished playing (this is used in slide animations)</font>
<p><a href="javascript:path.play(linemanual)">quickplay path 0</a>
<br><a href="javascript:path.play(linegenerated)">quickplay path 1</a>
<br><a href="javascript:path.play(linesquiggle)">quickplay path 2</a>
<br><a href="javascript:path.play(circlepath,true)">quickplay path 3</a> (loops)
<p><b>Stored Animations</b>
<br><font size=-1>These play paths that have been saved in the PathAnimation object</font>
<table border=1>
<tr><td><td>
<td>loop</td>
<td>auto-reset</td>
<td>play</tr>
<tr><td>Path 0
<br>straight line<td>
<td><a href="javascript:path.setLoops(0,true)">on</a> | <a href="javascript:path.setLoops(0,false)">off</a></td>
<td><a href="javascript:path.setResets(0,true)">on</a> | <a href="javascript:path.setResets(0,false)">off</a></td>
<td><a href="javascript:path.play(0)">play</a></td></tr>
<tr><td>Path 1
<br>generated line<td>
<td><a href="javascript:path.setLoops(1,true)">on</a> | <a href="javascript:path.setLoops(1,false)">off</a></td>
<td><a href="javascript:path.setResets(1,true)">on</a> | <a href="javascript:path.setResets(1,false)">off</a></td>
<td><a href="javascript:path.play(1)">play</a></td></tr>
<tr><td>Path 2
<br>squiggly line<td>
<td><a href="javascript:path.setLoops(2,true)">on</a> | <a href="javascript:path.setLoops(2,false)">off</a></td>
<td><a href="javascript:path.setResets(2,true)">on</a> | <a href="javascript:path.setResets(2,false)">off</a></td>
<td><a href="javascript:path.play(2)">play</a></td></tr>
<tr><td>Path 2
<br>circle<td>
<td><a href="javascript:path.setLoops(3,true)">on</a> | <a href="javascript:path.setLoops(3,false)">off</a></td>
<td><a href="javascript:path.setResets(3,true)">on</a> | <a href="javascript:path.setResets(3,false)">off</a></td>
<td><a href="javascript:path.play(3)">play</a></td></tr>
</table>
</body>
</html>
--- NEW FILE ---
<html>
<head>
<title>DynAPI Examples - Graphics</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.library');
dynapi.library.include('dynapi.api');
dynapi.library.include('dynapi.gui.Graphics');
</script>
<script language="JavaScript">
<!--
DynAPI.onLoad(function() {
lyr = new DynLayer()
lyr.setLocation(20,50)
lyr.setSize(400,400)
lyr.setBgColor('#C0C0C0');
DynAPI.document.addChild(lyr)
graphics = new Graphics(lyr);
graphics.useVML = true
graphics.setStrokeColor('red');
graphics.setStrokeWeight(2);
graphics.setFillColor(lyr.bgcolor);
});
function getRandomInt(min,max) {
return Math.floor(min+Math.random()*(max-min+1))
}
function randline() {
graphics.drawLine(getRandomInt(0,400),getRandomInt(0,400),getRandomInt(0,400),getRandomInt(0,400));
}
function randcircle() {
graphics.drawCircle(getRandomInt(0,300),getRandomInt(0,200),getRandomInt(20,100));
}
//-->
</script>
</head>
<body bgcolor="#ffffff">
<form>
<INPUT TYPE="BUTTON" value="draw line" onclick="randline();">
<INPUT TYPE="BUTTON" value="draw circle" onclick="randcircle();">
<INPUT TYPE="BUTTON" value="draw rect" onclick="">
<INPUT TYPE="BUTTON" value="delete last" onclick="">
<INPUT TYPE="BUTTON" value="delete all" onclick="">
</form>
</body>
</html>
--- NEW FILE ---
// make global variable
file1Data = [1,1,1,1,1];
alert('you ran file1');
--- NEW FILE ---
// make global variable
file2Data = [2,2,2,2,2];
alert('you ran file2');
--- NEW FILE ---
<html>
<head>
<title>DynAPI - Library [Load]</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
<!--
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.debug'); // can load on the fly
dynapi.library.include('dynapi.library'); // include library load extension
dynapi.library.addPackage('mypackage','mypackage/');
dynapi.library.add(['mypackage.MyObject0','mypackage.MyObject1'],'myobject1.js','dynapi.api');
dynapi.library.add('mypackage.MyObject2','myobject2.js','MyObject1');
dynapi.library.add('mypackage.MyObject3','myobject3.js',['MyObject2']);
// include the <script> elements for the files:
//dynapi.library.include('dynapi.api');
//dynapi.library.include('DynEvent');
//dynapi.library.include('DynDocument');
//dynapi.library.include('MouseEvent');
//dynapi.library.include('MyObject3');
// any load()'s performed before dynapi is loaded will be queued
// and loaded before dynapi.onLoad handlers are called
//dynapi.library.load('dynapi.api');
function loadPackage() {
var p = document.libloader.packagename.options[document.libloader.packagename.selectedIndex].value;
if (p) dynapi.library.load(p, function() {
alert(eval(p));
});
}
function getPackagePath() {
var p = document.libloader.packagename.options[document.libloader.packagename.selectedIndex].value;
if (p) alert(dynapi.library.getPath(p));
}
function loadObject() {
var n = document.libloader.objectname.options[document.libloader.objectname.selectedIndex].value;
if (n) dynapi.library.load(n, function() {
alert(dynapi.frame[n]);
});
}
function reloadObject() {
var n = document.libloader.objectname.options[document.libloader.objectname.selectedIndex].value;
if (n) dynapi.library.reload(n, function() {
alert(dynapi.frame[n]);
}, true);
}
function reloadAll() {
var n = document.libloader.objectname.options[document.libloader.objectname.selectedIndex].value;
if (n) dynapi.library.reload(n, function() {
alert(dynapi.frame[n]);
}, true);
}
//-->
</script>
<script language="Javascript">
dynapi.onLoad(init);
function init() {
var evalstr = 'dynapi.debug.print(MyObject0)\n'+
'dynapi.debug.print(MyObject1)\n'+
'dynapi.debug.print(MyObject2)\n'+
'dynapi.debug.print(MyObject3)\n\n'+
'var m3 = new MyObject3();\n'+
'alert(m3.value0+" "+m3.value1+" "+m3.value2+" "+m3.value3);\n';
dynapi.debug.setEvaluate(evalstr)
// run test on startup:
//createTest();
}
//dynapi.onLoad(createTest);
count = 1;
function createTest() {
dynapi.library.load('dynapi.api', function(){
dynapi.document.addChild(new DynLayer('success '+count++,260,70,80,80,'yellow'));
});
}
</script>
</head>
<body bgcolor="#999999">
<!-- load debugger on the fly
<a href="javascript:dynapi.library.load('dynapi.debug', function(){dynapi.debug.open()})">open Debugger</a><br>
<a href="javascript:dynapi.debug.close()">close Debugger</a>
-->
<form name="libloader">
<p>After clicking the links try testing for the objects with the given commands in the debugger.<br>
<ul>
<p><li>Load a package:<br>
<font face="Courier" size=-1><select name=packagename size=5>
<script language="Javascript">
var str = '';
var s,pkg;
for (var p in dynapi.library.packages) {
str += '<option value="'+p+'">'+p+'</option>';
}
document.write(str);
</script>
</select></font><br>
<input type=button onclick="loadPackage()" value="Load"><input type=button onclick="getPackagePath()" value="Get Path">
<p><li>Load an object:<br>
<font face="Courier" size=-1><select name=objectname size=10>
<script language="Javascript">
var str = '';
var s,pkg;
for (var n in dynapi.library.objects) {
s = dynapi.library.objects[n];
str += '<option value="'+n+'">'+ s.pkg +'.'+ n +'</option>';
}
document.write(str);
</script>
</select></font>
<br><input type=button onclick="loadObject()" value="Load"><input type=button onclick="reloadObject" value="Reload"><input type=button onclick="reloadAll()" value="Reload all Dependencies">
</form>
<p><li>Tests:<br>
<a href="javascript:createTest()">load dynapi.api, then draw a layer</a><br>
<p><li>Manually load a JS file:<br>
Note: dynapi.library.loadScript() is meant for non-objects (commands that manipulate the page or load data)<br>
<a href="javascript:dynapi.library.loadScript('dynapi.library-file1.js', function(){alert(file1Data); dynapi.debug.print('loaded dynapi.library-file1.js')})">libraryloader_file1.js</a><br>
<a href="javascript:dynapi.library.loadScript('dynapi.library-file2.js', function(){alert(file2Data); dynapi.debug.print('loaded dynapi.library-file2.js')})">libraryloader_file2.js</a>
</ul>
</body>
</html>
--- NEW FILE ---
<html>
<script>
<!--
var dynapi = parent.dynapi;
var ioelement;
if (dynapi) {
ioelement = parent.IOElement.notify(this, init); // run init() when this file loads
}
else alert('Error: no dynapi');
// you can server-generate js variables and retrieve them in the load handler
var boolValue = true;
var randValue = Math.random();
// obtain arguments passed in the url
if (dynapi) {
var args = dynapi.functions.getURLArguments(this);
var myValue = args['myvalue'];
}
function init() {
dynapi.debug.print('loaded ioelement-testfile.html');
}
//-->
</script>
<body>
<script>
<!--
if (ioelement) {
// fix iframe bgcolor to parent IOElement's bgcolor, IE/Moz only
if (!dynapi.ua.ns4) this.document.body.style.backgroundColor = ioelement.getBgColor();
document.write('<b>server-generated values:</b><br>');
document.write('boolValue = '+boolValue+'<br>');
document.write('randValue = '+randValue+'<br>');
document.write('<b>value passed in the URL:</b><br>');
document.write('myvalue = '+args['myvalue']+'<br>');
document.write('<b>values used by IOElement:</b><br>');
document.write('ioLoadID = '+args['ioLoadID']+'<br>');
document.write('ioElmID = '+args['ioElmID']+'<br>');
}
//-->
</script>
<p>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>
</body>
</html>
--- NEW FILE ---
<html>
<head>
<title>DynAPI - I/O Element</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/dynapi/');
dynapi.library.include('dynapi.debug');
dynapi.library.include('dynapi.api');
dynapi.library.include('IOElement');
</script>
<script language="Javascript">
var d = dynapi.document.addChild(new DynLayer('',150,90,400,300,'white'));
// create a hidden IOElement
// you do not have to add the IOElement to dynapi.document manually
// it is done automatically when "true" is passed to the constructor
hidden_io = new IOElement(true);
// create a visible IOElement
// shows a layer/iframe element inside the dynlayer
yellow_io = new IOElement();
yellow_io.setLocation(50,50);
yellow_io.setSize(300,200);
yellow_io.setBgColor('yellow');
dynapi.onLoad(init);
function init() {
// works better in IE if created on the fly
// a later version may only be created this way
d.addChild(yellow_io);
}
function loadtest(ioelement) {
var fn = function(e) {
var o = e.getSource();
alert('IOElement load handler found these values:\nboolValue = ' + o.getScope().boolValue+'\nrandValue = ' + o.getScope().randValue+'\nmyValue = ' + o.getScope().myValue);
}
ioelement.load("dynapi.util.ioelement-testfile.html?myvalue=12345",fn);
}
</script>
</head>
<body bgcolor="#999999">
Load "dynapi.util.ioelement-testfile.html" into:<br>
<a href="javascript:loadtest(hidden_io)">hidden IOElement</a><br>
<a href="javascript:loadtest(yellow_io)">visible IOElement (yellow)</a>
<script>
dynapi.document.insertAllChildren();
</script>
</body>
</html>
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:58
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/api/ext
In directory usw-pr-cvs1:/tmp/cvs-serv15575/src/dynapi/api/ext
Added Files:
dragevent.js dynkeyevent.js dynlayer_inline.js
Log Message:
Initial Import == 2.9
--- NEW FILE ---
/*
DynAPI Distribution
DragEvent Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/
// DragEvent object
function DragEvent(type,src) {
this.inherit('DynEvent');
this.DynEvent()
this.isDragging = false;
}
dynapi.setPrototype('DragEvent','DynEvent');
DragEvent.prototype.getX=function() {return this.x;};
DragEvent.prototype.getY=function() {return this.y;};
DragEvent.prototype.getPageX=function() {return this.pageX;};
DragEvent.prototype.getPageY=function() {return this.pageY;};
DragEvent.prototype.cancelDrag=function() {this.isDragging=false;};
DragEvent.dragPlay=0;
DragEvent.dragevent=new DragEvent();
DragEvent.lyrListener = {
onmousedown : function(e) {
e.preventDefault();
DragEvent.startDrag(e);
}
};
DragEvent.startDrag = function(e) {
var lyr = e.getSource();
if (DynAPI.ua.dom) {
lyr.elm.ondragstart = function() { return false; }
lyr.elm.onselectstart = function() { return false; }
}
// Initialize dragEvent object
var de=DragEvent.dragevent;
de.type="dragstart";
de.src=lyr;
de.origin=e.origin;
// Set properties
de.isDragging=false;
de.x=e.getPageX()-e.getSource().getPageX();
de.y=e.getPageY()-e.getSource().getPageY();
de.pageX=e.getPageX();
de.pageY=e.getPageY();
de.parentPageX=lyr.parent.getPageX();
de.parentPageY=lyr.parent.getPageY();
de.isDragging=true;
lyr.invokeEvent("dragstart",de);
}
DragEvent.docListener = {
onmousemove : function(e) {
// Get, if any, the currently drag in process and the layer. If none, return
var de = DragEvent.dragevent;
if (!de || !de.isDragging) return;
var lyr = de.src;
if (!lyr) return;
// DS: what is this?
// Detect if we should start the drag
/*if(DragEvent.dragPlay==0 || (Math.abs(de.pageX-e.getPageX())-DragEvent.dragPlay>0) || (Math.abs(de.pageY-e.getPageY())-DragEvent.dragPlay>0)) {
de.isDragging=true;
de.src.invokeEvent("dragstart",de);
e.setBubble(de.bubble);
}
*/
/*else if (!de.dragEnabled) {
// This allows 'cancelDrag' method to fire the mouseUp as if had been released by the user
lyr.invokeEvent("mouseup");
return;
}*/
// Properties
de.type="dragmove";
de.pageX=e.getPageX();
de.pageY=e.getPageY();
if (DragEvent.stopAtDocumentEdge) {
if (de.pageX<0) de.pageX = 0;
if (de.pageY<0) de.pageY = 0;
if (de.pageX>DynAPI.document.w) de.pageX = DynAPI.document.w;
if (de.pageY>DynAPI.document.h) de.pageY = DynAPI.document.h;
}
var x=de.pageX-de.parentPageX-de.x;
var y=de.pageY-de.parentPageY-de.y;
// Respect boundary, if any
if (lyr._dragBoundary) {
var dB = lyr._dragBoundary;
var t = dB.top;
var r = dB.right;
var b = dB.bottom;
var l = dB.left
if (x<l) x = l;
else if (x>lyr.parent.w-lyr.w-r) x = lyr.parent.w-lyr.w-r;
if (y<t) y = t;
else if (y>lyr.parent.h-lyr.h-b) y = lyr.parent.h-lyr.h-b;
}
else if (lyr._dragBoundaryA) {
var dB = lyr._dragBoundaryA;
var b=dB[2];
var r=dB[1];
var l=dB[3];
var t=dB[0];
var w=lyr.w;
var h=lyr.h;
if (x<l) x=l;
else if (x+w>r) x=r-w;
if (y<t) y=t;
else if (y+h>b) y=b-h;
}
// Move dragged layer
lyr.setLocation(x,y);
lyr.invokeEvent("dragmove",de);
e.preventDefault();
e.preventBubble();
},
onmouseup : function(e) {
// Get, if any, the currently drag in process and the layer. If none, return
var de=DragEvent.dragevent;
if (!de) return;
var lyr=de.src;
if (!lyr) return;
if (!de.isDragging) {
de.type="dragend";
de.src=null;
//e.setBubble(true);
return;
}
if (DynAPI.ua.ie) lyr.doc.body.onselectstart = null;
// Avoid click for the dragged layer ( with MouseEvent addition )
if (DynAPI.ua.def) DynAPI.wasDragging=true;
if (lyr.parent.DragDrop) lyr.parent.DragDrop(lyr);
// Properties for the event
de.type="dragend";
de.isDragging=false;
lyr.invokeEvent("dragend",de);
// Clean drag stuff
de.src=null;
//e.preventDefault();
e.preventBubble();
}
};
DragEvent.stopAtDocumentEdge = true;
DragEvent.setDragBoundary=function(lyr,t,r,b,l) {
if (!lyr) {DynAPI.debug.print("Error: no object passed to DragEvent.setDragBoundary()"); return;}
var a=arguments;
if (a.length==0) return;
if (a.length==1) {
lyr._dragBoundary = {left:0,right:0,top:0,bottom:0};
}
if (a.length==2) {
lyr._dragBoundary = arguments[1];
}
else if (a.length==5) lyr._dragBoundaryA = [t,r,b,l];
};
DragEvent.enableDragEvents=function(f) {
for (var i=0;i<arguments.length;i++) {
var lyr=arguments[i];
if (!lyr) {DynAPI.debug.print("Error: no object passed to DragEvent.enableDragEvents()"); return;}
if (lyr.isClass('DynLayer')) lyr.addEventListener(DragEvent.lyrListener);
}
DynAPI.document.addEventListener(DragEvent.docListener);
};
DragEvent.disableDragEvents=function() {
for (var i=0;i<arguments.length;i++) {
var lyr=arguments[i];
lyr.removeEventListener(DragEvent.lyrListener);
}
};
/*
DynObject.prototype.DragDrop=function(s){
if (!this.children.length>0) return false;
var ch,chX,sX,sY;
for (var i in this.children) {
ch=this.children[i];
chX=ch.getPageX();
chY=ch.getPageY();
sX=s.getPageX();
sY=s.getPageY();
if (chX<sX && chX+ch.w>sX+s.w && chY<sY && chY+ch.h>sY+s.h) {
if (ch.DragDrop(s)) return true;
ch.invokeEvent("drop");
return true;
}
}
return false;
};
*/
--- NEW FILE ---
/*
DynAPI Distribution
Key Event Extensions by Henrik Våglin (hv...@ya...)
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
Requirements:
dynapi.api [dynlayer, dyndocument, browser]
dynapi.event [listeners]
*/
function DynKeyEvent() {
this.inherit('DynEvent');
};
var p = dynapi.setPrototype('DynKeyEvent','DynEvent');
DynKeyEvent.prototype.getKey=function() {
return this.charKey
};
DynKeyEvent.prototype.bubbleEvent=function() {
if (!this.bubble||this.src.isDynDocument||this.src.parent==null) return;
this.src=this.src.parent;
this.src.invokeEvent(this.type,this);
this.bubbleEvent();
return;
};
DynKeyEvent.EventMethod = function(e) {
var dynobject=this.lyrobj;
if(is.def) {
if (is.ie) var e=dynobject.frame.event;
else if (e.eventPhase!=3) return false;
e.cancelBubble=true;
}
if(is.def) var realsrc = Methods.getContainerLayerOf(is.ie?e.srcElement:e.target)||dynobject;
else if(is.ns4) var realsrc=e.target.lyrobj;
if (!realsrc) return false;
var evt=DynKeyEvent._e
evt.type=e.type
evt.src=realsrc;
evt.browserReturn=true;
evt.bubble=true;
evt.which=(is.ns4)?e.which:e.keyCode;
var curKey = String.fromCharCode(evt.which).toLowerCase();
if (((curKey>='a')&&(curKey<='z'))||((curKey>='0')&&(curKey<='9'))) evt.charKey=curKey;
else evt.charKey=null;
evt.ctrlKey=(is.ns4)?(e.modifiers & Event.CONTROL_MASK):(e.ctrlKey||e.ctrlLeft||e.keyCode==17);
evt.shiftKey=(is.ns4)?(e.modifiers & Event.SHIFT_MASK):(e.shiftKey||e.shiftLeft||e.keyCode==16);
evt.orig=e;
realsrc.invokeEvent(evt.type,evt);
evt.bubbleEvent();
return evt.browserReturn;
};
DynKeyEvent._e=new DynKeyEvent();
DynDocument.prototype.captureKeyEvents=function() {
if(is.def&&!is.ie) {
this.doc.addEventListener("keydown",DynKeyEvent.EventMethod,false)
this.doc.addEventListener("keyup",DynKeyEvent.EventMethod,false)
this.doc.addEventListener("keypress",DynKeyEvent.EventMethod,false)
}
else {
if (is.ns4) this.doc.captureEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP);
this.doc.onkeypress=this.doc.onkeydown=this.doc.onkeyup=DynKeyEvent.EventMethod
}
}
DynDocument.prototype.releaseKeyEvents=function() {
if(is.def&&!is.ie) {
this.doc.removeEventListener("keydown",DynKeyEvent.EventMethod,false)
this.doc.removeEventListener("keyup",DynKeyEvent.EventMethod,false)
this.doc.removeEventListener("keypress",DynKeyEvent.EventMethod,false)
}
else {
if (is.ns4) this.doc.releaseEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP);
this.doc.onkeypress=this.doc.onkeydown=this.doc.onkeyup=null
}
}
DynLayer.prototype.captureKeyEvents=function() {
if(!this.elm) return
if(is.def&&!is.ie) {
this.elm.addEventListener("keydown",DynKeyEvent.EventMethod,false)
this.elm.addEventListener("keyup",DynKeyEvent.EventMethod,false)
this.elm.addEventListener("keypress",DynKeyEvent.EventMethod,false)
}
else {
if (is.ns4) this.elm.captureEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP);
this.elm.onkeypress=this.elm.onkeydown=this.elm.onkeyup=DynKeyEvent.EventMethod
}
}
DynLayer.prototype.releaseKeyEvents=function() {
if(!this.elm) return
if(is.def&&!is.ie) {
this.elm.removeEventListener("keydown",DynKeyEvent.EventMethod,false)
this.elm.removeEventListener("keyup",DynKeyEvent.EventMethod,false)
this.elm.removeEventListener("keypress",DynKeyEvent.EventMethod,false)
}
else {
if (is.ns4) this.elm.releaseEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP);
this.elm.onkeypress=this.elm.onkeydown=this.elm.onkeyup=null
}
}
/* Overwrite methods to support key events. */
DynObject.prototype.assignKeyEvents = function() {
if (this.hasEventListeners) this.captureKeyEvents()
var l=this.children.length;
for (var i=0; i<l; i++) this.children[i].assignKeyEvents()
}
DynObject.prototype._OldK_addEventListener = DynObject.prototype.addEventListener
DynObject.prototype.addEventListener = function(l) {
var r = this._OldK_addEventListener(l)
if(this.hasEventListeners && this.created) this.captureKeyEvents()
return r
}
DynObject.prototype._OldK_removeEventListener = DynObject.prototype.removeEventListener
DynObject.prototype.removeEventListener = function(l) {
var r = this._OldK_removeEventListener(l)
if(!this.hasEventListeners) this.releaseKeyEvents()
return r
}
DynObject.prototype._OldK_removeAllEventListeners = DynObject.prototype.removeAllEventListeners
DynObject.prototype.removeAllEventListeners = function() {
var r = this._OldK_removeAllEventListeners()
this.releaseKeyEvents()
return r
}
// DynLayer Specific
DynLayer.prototype._OldK_specificCreate = DynLayer.prototype.specificCreate
DynLayer.prototype.specificCreate = function() {
this._OldK_specificCreate()
this.assignKeyEvents()
}
// DynDocument specific
DynDocument.prototype._OldK_specificCreate = DynDocument.prototype.specificCreate
DynDocument.prototype.specificCreate = function() {
this._OldK_specificCreate()
this.assignKeyEvents()
}
--- NEW FILE ---
// DS: this code needs to be updated
/*
DynObject.prototype.findLayers=function() {
var divs=[];
if (is.def&&!is.ie) divs=this.doc.getElementsByTagName("DIV");
else if (is.ie) divs=this.doc.all.tags("DIV");
else if (is.ns4) divs=this.doc.layers;
else return;
for (var i=0; i<divs.length; i++) {
if(Methods.isDirectChildOf(divs[i],this.elm)) {
var id=is.ns4? divs[i].name : divs[i].id;
var dlyr=new DynLayer(id);
dlyr.parent=this;
dlyr.created=true;
dlyr.isChild=true;
dlyr.elm=divs[i];
if (is.def) {
dlyr.css=dlyr.elm.style;
dlyr.doc=this.doc
}
else if (is.ns4) {
dlyr.css=dlyr.elm;
dlyr.doc=dlyr.elm.document;
}
dlyr.frame=this.frame;
//Event stuff
dlyr.elm.lyrobj=dlyr.doc.lyrobj=dlyr;
if(is.ns4) {
for (var j in dlyr.doc.images) dlyr.doc.images[j].lyrobj=dlyr;
for (j=0;j<dlyr.doc.links.length;j++) dlyr.doc.links[j].lyrobj=dlyr;
}
// DynObject.all[dlyr.id]=dlyr;
// JM: Constructors take care of this
this.children[this.children.length]=dlyr;
dlyr.updateValues();
dlyr.findLayers();
}
}
};
DynLayer.prototype.updateValues=function() {
if (is.def) {
this.x=this.elm.offsetLeft;
this.y=this.elm.offsetTop;
this.w=is.ie4? this.css.pixelWidth||this.getContentWidth() : this.elm.offsetWidth;
this.h=is.ie4? this.css.pixelHeight||this.getContentHeight() : this.elm.offsetHeight;
this.bgImage = this.css.backgroundImage;
this.bgColor = this.css.backgroundColor;
this.html = this.innerHTML = this.elm.innerHTML;
}
else if (is.ns4) {
this.x=parseInt(this.css.left);
this.y=parseInt(this.css.top);
this.w=this.css.clip.width;
this.h=this.css.clip.height;
this.clip=[this.css.clip.top,this.css.clip.right,this.css.clip.bottom,this.css.clip.left];
this.bgColor=this.doc.bgColor!="this.doc.bgColor"?this.doc.bgColor:null;
this.bgImage=this.elm.background.src!=""?this.elm.background.src:null;
this.html=this.innerHTML = this.elm.innerHTML = "";
}
this.z=this.css.zIndex;
var b=this.css.visibility;
this.visible=(b=="inherit"||b=="show"||b=="visible"||b=="");
};
Methods.isDirectChildOf = function(l, parent) {
if(is.def&&!is.ie) {
for(var p=l.parentNode;p;p=p.parentNode) if(p.nodeName.toLowerCase()=='div') return p==parent;
return !parent.nodeName;
}
else if (is.ie) {
for(var p=l.parentElement;p;p=p.parentElement) if(p.tagName.toLowerCase()=='div') return p==parent;
return !parent.tagName;
}
else if(is.ns4) return (l.parentLayer == parent);
};
DynDocument.prototype._OldI_specificCreate = DynDocument.prototype.specificCreate
DynDocument.prototype.specificCreate = function() {
this._OldI_specificCreate()
this.findLayers()
}
*/
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:58
|
Update of /cvsroot/dynapi/dynapi2x/src
In directory usw-pr-cvs1:/tmp/cvs-serv15575/src
Added Files:
dynapi-2.5mode.js dynapi.js
Log Message:
Initial Import == 2.9
--- NEW FILE ---
/*
DynAPI 2.5x Compatibility Mode
-------------------------------------
These commands make v2.9 largely backward compatible with 2.5. However, some changes
make it impossible to be fully compatible. All syntax that has been changed can be
considered deprecated. This compatibility mode is merely a starting point and it is
recommended that you read "docs/changelog.html" for a complete description of the
new features and to move your code over to 2.9 syntax.
A short list of non-compatibility:
- DynAPI.onload = function(){} can no longer be used, replace with dynapi.onLoad(function() {});
- EventListener is no longer available, it is now an empty object, and thus the e.getTarget() is
now removed. Instead of retreiving an object from DynEvent using e.getTarget(), you must change to
e.getSource(), and retrieve the widget object in another fashion.
Include this file *AFTER* event.js,dyndocument.js,dynlayer.js,mouseevent.js
*/
// these have not been tested, nor is a complete list
// syntax changes
DynAPI = dynapi;
Methods = dynapi.functions;
EventListener = dynapi.functions.Null;
DynMouseEvent = MouseEvent;
dynapi.librarypath = dynapi.libraryPath = dynapi.library.path;
// v2.5x package/include system;
DynAPIObject.prototype.getLibraryPath = function() {return dynapi.library.path};
DynAPIObject.prototype.setLibraryPath = function(path) {
dynapi.library.setPath(path);
};
DynAPIObject.prototype.addPackage = function(pckg) {
if (!this.packages) this.packages = [];
if (this.packages[pckg]) return;
this.packages[pckg] = { libs: [] };
};
DynAPIObject.prototype.addLibrary = function(path,files) {
var pckg = path.substring(0,path.indexOf('.'));
if (!pckg) {
alert("DynAPI Error: Incorrect DynAPI.addLibrary usage");
return;
}
var name = path.substring(path.indexOf('.')+1);
if (!this.packages[pckg]) this.addPackage(pckg);
if (this.packages[pckg].libs[name]) {
alert("DynAPI Error: Library "+name+" already exists");
return;
}
this.packages[pckg].libs[name] = files;
};
DynAPIObject.prototype.include = function(src,pth) {
src=src.split('.');
if (src[src.length-1] == 'js') src.length -= 1;
var path=pth||this.libraryPath||'';
if (path.substr(path.length-1) != "/") path += "/";
var pckg=src[0];
var grp=src[1];
var file=src[2];
if (file=='*') {
if (this.packages[pckg]) group=this.packages[pckg].libs[grp];
if (group) for (var i=0;i<group.length;i++) document.write('<script language="Javascript1.2" src="'+path+pckg+'/'+grp+'/'+group[i]+'.js"><\/script>');
else alert('include()\n\nThe following package could not be loaded:\n'+src+'\n\nmake sure you specified the correct path.');
} else document.write('<script language="Javascript1.2" src="'+path+src.join('/')+'.js"><\/script>');
};
DynAPIObject.prototype.addLoadFunction = function(f) {
this.onLoad(f);
};
DynAPIObject.prototype.addUnLoadFunction = function(f) {
this.onUnload(f);
};
DynAPIObject.prototype.addResizeFunction = function(f) {
l = {onresize : f};
dynapi.document.addEventListener(l);
};
DynAPI.addPackage('dynapi');
DynAPI.addLibrary('dynapi.api' ,["browser","dynlayer","dyndocument"]);
DynAPI.addLibrary('dynapi.event',["listeners","mouse","dragevent","keyboard"]);
DynAPI.addLibrary('dynapi.ext' ,["inline","layer","dragdrop","functions"]);
DynAPI.addLibrary('dynapi.gui' ,["viewport","dynimage","button","buttonimage","label","list","loadpanel","pushpanel","scrollbar","scrollpane","sprite"]);
DynAPI.addLibrary('dynapi.util' ,["circleanim","cookies","debug","thread","hoveranim","imganim","pathanim","console"]);
// DynLayer
DynLayer.prototype.moveTo = DynLayer.prototype.setLocation;
DynLayer.prototype.moveBy = function(x,y) {
this.setLocation(this.x+x,this.y+y);
}
DynLayer.prototype.isDynLayer = true;
DynDocument.prototype.isDynDocument = true;
// resize events
if (dynapi.ua.ns4) {
DynLayer.prototype.setSize = function(w,h,noevt) {
var cw = (w!=null && w!=this.w);
var ch = (h!=null && h!=this.h);
if (cw) this.w = w<0? 0 : w;
if (ch) this.h = h<0? 0 : h;
if (cw||ch) {
if (this._childAnchors) this._updateAnchors();
if (this._layout) this._layout._fixLayout();
if (this.css) {
if (cw) this.css.clip.width = this.w;
if (ch) this.css.clip.height = this.h;
}
if (noevt!=false) this.invokeEvent('resize');
}
return (cw||ch);
};
}
else {
DynLayer.prototype.setSize = function(w,h,noevt) {
var cw = (w!=null && w!=this.w);
var ch = (h!=null && h!=this.h);
if (cw) this.w = w<0? 0 : w;
if (ch) this.h = h<0? 0 : h;
if (cw||ch) {
if (this._childAnchors) this._updateAnchors();
if (this._layout) this._layout._fixLayout();
if (this.css) {
if (cw) this.css.width = this.w||0;
if (ch) this.css.height = this.h||0;
if (cw || ch) this.css.clip = 'rect(0px '+(this.w||0)+'px '+(this.h||0)+'px 0px)';
}
if (noevt!=false) this.invokeEvent('resize');
}
return (cw||ch);
};
}
DynLayer.prototype.setWidth=function(w,noevt) {this.setSize(w,null,noevt)};
DynLayer.prototype.setHeight=function(h,noevt) {this.setSize(null,h,noevt)};
DynElement._flagEvent = function(obj,type) {
if (type=="create") {
obj._created = true;
obj.created = true; // added
}
var l=obj.children.length;
for (var i=0; i<l; i++) {
DynElement._flagEvent(obj.children[i],type);
}
obj.invokeEvent(type); // called after children
};
--- NEW FILE ---
/*
DynAPI Distribution
DynObject, DynAPI Object, UserAgent, Library, Functions
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/
function DynObject() {
this.setID("DynObject"+DynObject._c++);
};
var p = DynObject.prototype;
p.inherit = function(n) {
var b = 0;
if (n) {
var a = arguments;
var p = dynapi.frame[n];
if (!p && dynapi.ua.ns4 && dynapi.library) p = dynapi.library.elm[n];
if (p) {
this[n] = p;
this[n](a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]);
b = 1;
}
}
if (!b) alert('Inherit Error: '+n);
};
p.getClassName = function() {return this._className};
p.getClass = function() {return dynapi.frame[this._className]};
p.isClass = function(n) {return DynObject.isClass(this._className,n)};
p.addMethod = function(n,fn) {this[n] = fn};
p.removeMethod = function(n) {this[n] = null};
p.setID = function(id) {
if (this.id) delete DynObject.all[this.id];
this.id = id;
DynObject.all[this.id] = this;
};
p.toString = function() {return "DynObject.all."+this.id};
DynObject.all = [];
DynObject._c = -1;
DynObject.isClass = function(cn,n) {
if (cn == n) return true;
else {
var c = dynapi.frame[cn];
var p = c.prototype._pClassName;
if (p) return DynObject.isClass(p,n)
else return false;
}
};
function _UserAgent() {
var b = navigator.appName;
var v = this.version = navigator.appVersion;
this.v = parseInt(v);
this.ns = (b=="Netscape");
this.ie = (b=="Microsoft Internet Explorer");
this.opera = navigator.userAgent.indexOf("Opera")>0;
this.supported = true;
if (this.ns) {
this.v = parseInt(v);
this.ns4 = (this.v==4);
this.ns6 = (this.v>=5);
}
else if (this.ie) {
this.ie4 = this.ie5 = this.ie55 = this.ie6 = false;
if (v.indexOf('MSIE 4')>0) {this.ie4 = true; this.v = 4;}
else if (v.indexOf('MSIE 5')>0) {this.ie5 = true; this.v = 5;}
else if (v.indexOf('MSIE 5.5')>0) {this.ie55 = true; this.v = 5.5;}
else if (v.indexOf('MSIE 6')>0) {this.ie6 = true; this.v = 6;}
}
else if (this.opera) {
this.v = parseInt(v);
}
else {
this.supported = false;
return;
}
this.dom = (document.createElement && document.appendChild && document.getElementsByTagName)? true : false;
this.def = (this.ie||this.dom);
var ua = navigator.userAgent.toLowerCase();
this.win32 = ua.indexOf("win")>-1;
this.mac = ua.indexOf("mac")>-1;
this.other = (!this.win32 && !this.mac);
}
function DynAPIObject() {
this.DynObject = DynObject;
this.DynObject();
this.version = 2.9;
this.loaded = false;
this.ua = new _UserAgent();
this._loadfn = [];
this._unloadfn = [];
var f = this.frame = self;
var url = f.document.location.href;
url = url.substring(0,url.lastIndexOf('/')+1);
this.documentPath = url;
var o = this;
this.library = {};
this.library.setPath = function(p) {o.library.path = p};
f.onload = function() {
o.loaded = true;
if (o.library._create) o.library._create(); // calls dynapi._onLoad() after loading necessary files
else setTimeout(o+'._onLoad()',1);
};
f.onunload = function() {
for (var i=0;i<o._unloadfn.length;i++) {
var f = o._unloadfn[i];
if (typeof(f)=="string") eval(f);
if (typeof(f)=="function") f();
}
if (o.document) {
o.document._destroy();
o.document = null;
}
};
};
p = DynAPIObject.prototype = new DynObject;
p.onLoad = function(f) {
if (f!=null) this._loadfn[this._loadfn.length] = f;
};
p._onLoad = function(f) {
for (var i=0;i<this._loadfn.length;i++) {
var f = this._loadfn[i];
if (typeof(f)=="string") eval(f);
if (typeof(f)=="function") f();
}
}
p.onUnload = function(f) {
if (f!=null) this._unloadfn[this._unloadfn.length] = f;
};
p.setPrototype = function(sC,sP) {
var c = this.frame[sC];
var p = this.frame[sP];
if ((!c || !p) && this.ua.ns4 && this.library && this.library.elm) {
if (!c) c = this.library.elm[sC];
if (!p) p = this.library.elm[sP];
}
if (!c || !p) return alert('Prototype Error');
c.prototype = new p();
c.prototype._className = sC;
c.prototype._pClassName = sP;
c.toString = function() {return '['+sC+']'};
return c.prototype;
};
var dynapi = new DynAPIObject();
dynapi.functions = {
removeFromArray : function(array, index, id) { // need it?
var which=(typeof(index)=="object")?index:array[index];
if (id) delete array[which.id];
else for (var i=0; i<array.length; i++)
if (array[i] == which) {
if(array.splice) array.splice(i,1);
else { for(var x=i; x<array.length-1; x++) array[x]=array[x+1];
array.length -= 1; }
break;
}
return array;
},
getContainerLayerOf : function(element) { // need it?
if(!element) return null;
if(dynapi.ua.def&&!dynapi.ua.ie) while (!element.lyrobj && element.parentNode && element.parentNode!=element) element=element.parentNode;
else if(dynapi.ua.ie) while (!element.lyrobj && element.parentElement && element.parentElement!=element) element=element.parentElement;
return element.lyrobj
},
True : function() {return true},
False : function() {return false},
Null : function() {},
getImage : function(src,w,h) {
var img = (w!=null&&h!=null)? new Image(w,h) : new Image();
img.src = src;
return img;
},
getURLArguments : function(o) { // pass a string or frame/layer object
var url;
if (typeof(o)=="string") url = o;
else if (dynapi.ua.ns4 && o.src) url = o.src;
else if (o.document) url = o.document.location.href;
else return {};
var list = {};
var s = url.substring(url.indexOf('?')+1);
var a = s.split('&');
var b;
for (var i=0;i<a.length;i++) {
var b = a[i].split('=');
list[b[0]] = b[1];
}
return list;
}
};
dynapi.documentArgs = dynapi.functions.getURLArguments(dynapi.frame);
dynapi.debug = {};
dynapi.debug.print = function(s) {
if (!dynapi._debugBuffer) dynapi._debugBuffer = s;
else dynapi._debugBuffer += '\n'+s;
};
// The DynAPI library system is optional, this can be removed if you want to include other scripts manually
function DynAPILibrary() {
this.inherit('DynObject');
// list of js files: this.scripts['../src/lib/dynapi/api/dynlayer.js'] = {dep, objects, pkg, fn};
this.scripts = {};
// list of package names: this.packages['dynapi.api'] = dynapi.api = {_objects,_path}
this.packages = {};
// list of object names: this.objects['DynLayer'] = this.scripts['../src/lib/dynapi/api/dynlayer.js']
this.objects = {};
this._c = 0;
this.loadList = [];
this.loadIndex = -1;
this.path = null;
this.busy = true;
}
p = dynapi.setPrototype('DynAPILibrary','DynObject');
// can return a path specific to a package, eg. dynapi.library.getPath('dynapi.api') returns '/src/lib/dynapi/api/'
p.getPath = function(pkg) {
if (!pkg) pkg = 'dynapi';
if (this.packages[pkg]) return this.packages[pkg]._path;
return null;
};
// set dynapi path
p.setPath = function(p) {
this.path = p;
// to-do: rearrange so add()'s can be done before setPath
// full paths will then be determined when queued
// need an extra argument on addPackage to specify whether the path is relative to this.path or not
// OR: add functionality so that these package definitions can be loaded/included on the fly
this.addPackage('dynapi',p);
this.add('dynapi.debug','debug.js');
this.add('dynapi.library','library.js');
this.add('dynapi.functions','functions.js');
this.addPackage('dynapi.api',p+'api/');
this.add(['dynapi.api.DynEvent','dynapi.api.EventObject','dynapi.api.DynElement'],'event.js');
this.add('dynapi.api.DynDocument','dyndocument.js','DynEvent');
this.add('dynapi.api.DynLayer','dynlayer.js','DynDocument');
this.add('dynapi.api.MouseEvent','mouse.js','DynLayer');
this.addPackage('dynapi.api.ext',p+'api/ext/');
this.add('dynapi.api.ext.DragEvent','dragevent.js','DynDocument');
this.add('dynapi.api.ext.DynKeyEvent','dynkeyevent.js','DynLayer');
this.addPackage('dynapi.fx',p+'fx/');
this.add('dynapi.fx.Thread','thread.js','DynLayer');
this.add('dynapi.fx.PathAnimation','pathanim.js','Thread');
this.add('dynapi.fx.GlideAnimation','pathanim_glide.js','PathAnimation');
this.add('dynapi.fx.SlideAnimation','pathanim_slide.js','PathAnimation');
this.add('dynapi.fx.ImageAnimation','imganim.js','Thread');
this.addPackage('dynapi.gui',p+'gui/');
this.add('dynapi.gui.DynImage','dynimage.js','DynLayer');
this.add('dynapi.gui.Graphics','graphics.js','DynLayer');
this.add('dynapi.gui.LoadPanel','loadpanel.js','DynLayer');
this.addPackage('dynapi.util',p+'util/');
this.add('dynapi.util.Cookie','cookie.js');
this.add('dynapi.util.IOElement','ioelement.js','DynLayer');
};
// adds package(s) to the library
p.addPackage = function(pkg, path) {
var ps;
if (pkg.indexOf('.')) ps = pkg.split('.');
else ps = [pkg];
var p = dynapi.frame;
for (var i=0;i<ps.length;i++) { // returns the package object (eg. dynapi.api), or creates it if non-existant
if (!p[ps[i]]) p[ps[i]] = {};
p = p[ps[i]];
}
this.packages[pkg] = p;
p._objects = [];
p._path = path;
return p;
};
// add object(s) to the library
p.add = function(name, src, dep, relSource) {
var objects = typeof(name)=="string"? [name] : name;
var dep = !dep? [] : typeof(dep)=="string"? [dep] : dep;
var s,p,pkg;
if (objects[0].indexOf('.')) {
pkg = objects[0].substring(0,objects[0].lastIndexOf('.'));
if (pkg && this.packages[pkg]) {
p = this.packages[pkg];
if (relSource!=false) src = p._path + src;
}
}
if (!this.scripts[src]) s = this.scripts[src] = {};
else s = this.scripts[src];
s.objects = [];
s.dep = dep;
s.src = src;
s.pkg = pkg;
s.loaded = false;
s.fn = null;
var n;
for (var i=0;i<objects.length;i++) {
n = objects[i];
if (pkg) n = n.substring(n.lastIndexOf('.')+1);
this.objects[n] = s;
s.objects[s.objects.length] = n;
if (p) p._objects[p._objects.length] = n;
}
return s;
};
// returns a list of js source filenames to load
p._queue = function(n, list, force) {
var na=[], names=[],o;
if (list==null) list = [];
if (typeof(n)=="string") na = [n];
else na = n;
for (var i=0;i<na.length;i++) {
o = na[i];
if (typeof(o)=="string") {
if (this.packages[o])
for (var j in this.packages[o]._objects)
names[names.length] = this.packages[o]._objects[j];
else names[names.length] = o;
}
else if (typeof(o)=="object" && o.length) {
list = this._queue(o, list, force);
}
}
var s;
for (var j=0;j<names.length;j++) {
s = this._queueObject(names[j], force);
if (s) {
if (s.dep)
for (var i=0;i<s.dep.length;i++)
list = this._queue(s.dep[i], list, force);
list[list.length] = s.src;
}
}
return list;
};
// determines whether to add the script this object is in to the queue
p._queueObject = function(n, f) {
if (n.indexOf('.')) {
var pkg = n.substring(0,n.lastIndexOf('.'));
if (this.packages[pkg]) n = n.substring(n.lastIndexOf('.')+1);
}
var s = this.objects[n];
if (s) {
if (!s.queued) {
if (f!=true && s.loaded) dynapi.debug.print('Library Warning: '+n+' is already loaded');
else {
s.queued = true;
s.loaded = false;
return s;
}
}
}
else dynapi.debug.print('Library Error: no library map for '+n);
return false;
};
// writes the <script> tag for the object
p.include = function(n) {
var a = arguments;
if (dynapi.loaded) this.load(a);
else {
var list = this._queue(a);
var src;
for (var i=0;i<list.length;i++) {
src = list[i];
this.scripts[src].loaded = true;
dynapi.frame.document.write('<script language="JavaScript" src="'+src+'"><\/script>');
}
}
};
p.load = p.reload = p.loadScript = function(n) {
dynapi.debug.print('Warning: dynapi.library load extensions not included');
};
dynapi.library = new DynAPILibrary();
// deprecated
var DynAPI = dynapi;
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:58
|
Update of /cvsroot/dynapi/dynapi2x
In directory usw-pr-cvs1:/tmp/cvs-serv15575
Added Files:
LICENSE README REVISION
Log Message:
Initial Import == 2.9
--- NEW FILE ---
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
--- NEW FILE ---
--------------------------
DynAPI Distribution Readme
--------------------------
Information
------------
DynAPI 2 is an open-sourced project initiated by Dan Steinman. The
DynAPI has been created to make cross-browser dynamic html a reality.
The DynAPI Distribution is distributed under the terms of the GNU LGPL
license. Please see below or view the LICENSE file for more details.
Release Notes
-------------
The revision history can be found in the REVISION file included with
this distribution. Please report any bugs to the dynapi mailing
list, dyn...@li....
Documentation
-------------
Currently, DynAPI project documentation is being created. For more
documentation, visit the documentation section at http://dynapi.sourceforge.net.
Naming Conventions
------------------
The following class structure is used:
dynapi.api.* - Main API classes
dynapi.ext.* - API Extensions
dynapi.event.* - Event classes
dynapi.gui.* - GUI Widgets
dynapi.images.* - Default Images
dynapi.util.* - Utility functions
Browser support
---------------
The DynAPI distribution supports the following browsers:
Netscape 4.x
Internet Explorer 4
Internet Explorer 5
Mozilla
Netscape 6
More information
----------------
For more information about the DynAPI Distribution, extensions, widgets,
examples or new releases please visit http://dynapi.sourceforge.net.
More information about the original auther of the DynAPI 1 and 2, Dan
Steinman, can be found at http://www.dansteinman.com.
DynAPI Credits
--------------
Bill Tammen
Brandon Myers
Cameron Hart
Chris Bodar
Clack Pacheco
Dan Steinman
Guangyi Wu
IlMaestro
Jason Pelzer
Jared Nuzzolillo
Micah Goulart
Michael Lilli
Michael Pemberton
Pascal Bestebroer
Robert Rainwater
Ryan Grenz
Scott Andrew
And Many Others ...
Copyright Information
---------------------
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--- NEW FILE ---
------------------------------------
DynAPI Distribution Revision History
------------------------------------
Please report any bugs to the DynAPI Development Mailing List at
dyn...@li....
TODO
----
- Improve NS 6 support.
[ Legend: ]
[ + Added Feature ]
[ * Improved/Changed Feature ]
[ - Bug Fix ]
Version 2.9
------------
[*] File structure reorganized
[+] Debugger
[+] Library Loader
[+] DynLayer anchoring
[+] GlideAnimation
[*] DynLayer resize handling
[*] DynLayer has slideTo built-in
[*] Event handing changed, EventListener removed
[*] more... read docs/changelog.html for complete list of new features and syntax
Version 2.54
------------
[+] Added Netscape 4 resize fix (layers are recreated on resize)
[*] Recycled layers in Netscape 4 should now lose previous properties
[-] Event fixes in Netscape 4
[-] Double-click events fix for non windows Netscape 4
[*] setID now removes old references when reassigning ids
[-] ScrollPane fix for setting bar width/height
[-] innerHTML is now only set for IE (not Mozilla/NS6)
[-] setSize will not set the size only if there is no change
[*] Changed setBgColor/setFgColor logic for Netscape 4
[*] DynAPIObject now uses "c=null" instead of "delete c"
[*] LoadPanel should display correctly now on resize in IE
[*] recycled layers are now retrieved from the last array element first
Version 2.53
------------
[*] Improved memory management
[-] Improvements for the Mac
[-] DynImage fixes for Mac
[*] Merged IE4 and IE5 code in LoadPanel
[-] Fixed typo in dynlayer.js (is.win32 --> is.platform=="win32")
[*] Converted for (var i in x) loops (should fix some problems)
[*] toString now uses the format DynObject.all.dynobject1
Version 2.52
------------
[-] Fixed bug causing errors in input boxes using keyevents
[-] Fixed some EventMethod bugs in NS 4
Version 2.51
-----------
[-] cancelBrowserEvent changes for NS 4
Version 2.5
-----------
The internal structure has been completely rewritten in the 2.5
release. External changes were kept to a minimum. Events
are now in dynapi.event.*. Please look at the examples
to see how they are included. Also, keyevents has been moved
and renamed to dynapi.event.keyboard.js. Many other internal
bug fixes have also been made.
[*] Precreation changes in NS 6 (the div and all its children
are created at once)
[-] Keyevents should now bubble
[*] Simple events (dynlayer.onresize = function(){}) can be used
by including simple.js instead of mouse.js.
[*] Mozilla (DOM) support has been improved
[*] DragDrop changes for children layers
[-] Inline layers (inline.js) should now work in NS 6
[-] Image animation fixes
[-] Many other bug fixes
Version 2001.01.25
------------------
This release features many changes to the DynAPI. Most
noticable is a new layer creation system, as well as
requiring the script tags after the DynAPI.include()
statements must be closed before using any DynAPI
related functions. Also, the widgets are finally back.
There is a new loadPanel widget for loading external
files as well as list, path animation (slide), button,
scrollpanel, and label widgets. This release also
features the first API documentation for the
distribution. Please post and bugs to the mailing
list. There are too many changes to list, but
here are a few:
[-] Many fixes to events
[*] createElement, deleteElement, assignElement, and
assignChildren arenow static methods of the DynLayer object.
[-] DynAPI.include() should now work correctly
[+] Libraries are now added dynamically (not hard-coded into DynAPI)
[-] Re-fix for setBgImage in Netscape
[-] Returned setPageX/Y to previous versions
[*] getClip fix
[*] Check for child is created in deleteChildElements
[*] Modified moveTo
[-] InvokeEvent how works properly for double click in NS
[*] Removed .unassigned and .all arrays.
[*] Renamed .unassignedID and .allID to .unassigned and .all
[-] Fixed DynAPI.removeFromArray with removal of id's
[-] Fixed bug in removal from unassigned array in findLayers
[-] Fixed bug in adding to the all array in findLayers
[+] Added dynapi.ext.loadPanel for loading external files
Version 2000.11.07
------------------
[*] Modified setSize/Height,Width
[*] Removed .onCreate call. Must use EventListener to capture.
[-] Fixed problem with .allID deletion
Version 2000.11.06
------------------
[-] Fixed conflict with variable name package
Version 2000.11.05
------------------
[*] Removed right and middle mouse event modifications to setEvent
[-] EventMethod modifications (there is only one eventMethod now)
[-] RecreateAll fix
[-] Inline layers fix for IE 4
[-] Many changes to DynLayer
[*] DynLayer onCreate is no longer used. EventListeners must be used instead.
[*] Files have been renamed. They no longer include the package name.
[*] Directory lib2.0 is now lib
[*] DynDocument's include method was updated for file name changes.
[+] Added method release releaseMouseEvents to DynDocument
[*] DynDocument and DynLayer EventMethod are now the same method
[+] Added function DynAPI.addPackage(name) to add packages to the lib directory
[*] DynAPI.addLibrary requires the 1st parameter be a complete package name
Version 2000.10.31b
-------------------
[-] Unbroke deleteElement()
[-] Fixed typo in removeChild() (unAssigned->unassigned)
[*] Returned this.children to original state (it is now always an array)
[*] Updated core.ext.inline.js to work with new arrays
[*] Removed old rtmouseup code in EventMethod
[*] Updated handleEvent() to work with rtmouse[up/down] and mdmouse[up/down]
[*] Removed hasChildren() method (no longer needed since .children is always an array)
[*] Updated mouseevents example to demo middle mouse button events
Version 2000.10.30
------------------
[*] Removed DynAPI.Version() (was not ever accurate)
[+] Added modification date to all files
[+] Added DynAPI.addLibrary() to add a new library of files to DynAPI2
[*] MouseEvents now trap and expose the button pressed and any modifier keys (.button, .altKey, .ctrlKey, .shiftKey)
[*] Renamed DynLayer's .IamADynLayer boolean with .isDynLayer
[+] Added DynDocument boolean, isDynDocument, which distinguishes DynDocs from DynLayers during addChild operations
[*] DynAPI.document is assigned at the beginning of DynAPI.loadHandler now
[-] DynAPI.getDocument has been reworked to return the proper DynDocument object
[-] DynDocuments toString method returns a string reference to DynAPI.getDocument()
[-] DynLayers toString method returns a string reference to the array currently holding it (no more this.object references)
[-] DynDocument is no longer attached to top-level window, but the frame it's meant to be assigned for
[*] The resize handler now handles multiple DynDocs, not just DynAPI.document
[*] DynAPI.document is assigned at the beginning of DynAPI.loadHandler now
[+] There are now 2 arrays to hold references to DynLayers, all[] and allID[]. all[] holds only ordinal references, and allID[] holds id references ( allID[dynlayer.id] )
[+] Each DynDocument maintains it's own all and allID arrays
[-] DynLayers are no longer automatically assigned to any all or allID collection when created
[*] core.ext.import.js renamed to core.ext.debug.js (seems more accurate)
[*] core.gui.popup.js renamed to core.ext.menulist.js for old-times sake
[-] Fixed bug in core.ext.debug.js with bgcolor not being returned correctly
[-] Fixed problem in core.ext.inline.js with images and multiple divs
[*] Removed core.ext.addon.js (duplicate file), core.ext.fader.js, core.api.rightevents.js, and core.ext.loadhtml
[*] Removed this.object references from slide method
[*] Removed dragdrop.js from api (its already located in ext dir)
[*] Updated some examples
[*] Children array is now set to null and only assigned when a child is added
[*] Added check for existence of children array in removeChild, removeAllChildren, etc
[+] Added hasChildren method (should be used instead of checking children.length)
[*] DragDrop now checks if children exist first
[*] The EventMethod's are now prototypes
[-] Fixed type in DynLayer (DynAPI->DynLayer in removeChild)
[-] Elements removed from unassigned arrays after adding to dyndoc in createElement
Version 2000.10.24
------------------
[-] Removed function parameter in slideBy()
[-] Fixed corestyle to verify style argument
[*] Inline div layers now get the HTML property set (sadly only ie.. any work arounds for ns?)
[*] Minor speed optimizations to the dynlayer creation
[-] Included deleteElement fix (the outterhtml -> outerhtml spelling :)
[*] Changed getHTML() to always return the layer.html property.
[-] Fixed DynDocument.load()
[+] Included object properties to DynLayer and DynDocument.
[-] Modified DynLayer.toString() should now return correct layer name (with correct parent)
[-] Fixed some mouseevents problems
[-] Included new findLayers() code. Should make child divs be "parsed" correctly in both NS AND IE.
[-] Fixed bug with events not being triggered on images in inline layers.
[-] Included dragging fix (making layers stick to the correct mouse location)
[-] Fixed some broken examples
[-] Included deleteChildElements() and deleteElement() and recreateAll() fix.
[*] Renamed DynAPI.unload to DynAPI.unloadHandler
Version 2000.09.30
------------------
[*] Restored the old getImage() speed up, it now checks to make sure every image is only preloaded once
[-] Fixed setHTML (thanks to marstr)
[-] Fixed mouseevents for inline layers
[*] Removed setParentComponent() and getParentComponent()
[-] Fixed dragging problems
[*] Included "target dragging" enhancement
Version 2000.08.29
------------------
[-] Added a small Mac hack in getClip()
[-] Fixed "resize" event in setSize()
[-] setLibraryPath() will add a slash if needed
[-] Fixed problem with slide extension (slideend was called before cleartimeout)
[*] Included new setWidth() and setHeight() methods (can now handle events)
[*] Renamed core.ext.addon to core.ext.inline
[*] Moved DynLayer.updateValues() method to core.ext.inline
[-] Included nested layers code into findLayers()
[-] Minor bug fix in findLayers() (with all[] array)
Version 2000.08.18
------------------
[*] Removed fx and gui widgets from the package, updated text files.
Version 2000.08.17
------------------
[*] Split the core.ext.addon into two files: core.ext.addon.js andcore.ext.images.js
[-] Fixed problem in deleteElement() under Mozilla
[+] Included fx widgets (old Widgetx effects) - note VERY slow on Mozilla)
[+] Included core.ext.functions containing some miscellaneous functions
[+] Added new Lite classes.
Version 2000.08.15
------------------
[+] Included plugin system, makes it possible for 3rd party code to do advanced handling of events - use mountplugin() to add a new plugin
[+] Reintroduced DynAPI.getDocument()
[+] Added "onrtmouseup" and "onrtmousedown" for layers and documents, and made it working under Mozilla.
[-] Fixed findLayers() for framesets (dyndocuments)
[+] Included DynAPI2 beginners tutorials.
[-] Style fix for gui widgets.
[+] Added getModel() method to core.ext.addon. It can be used to display Object Model of the DynAPI.
Version 2000.07.30
------------------
[-] Included IE5.5 fix.
Version 2000.07.17
------------------
[-] Fixed other bug in core.api.dragevent, now you if you specify no drag boundaries the layer will be dragable anywhere. (or set dragBoundary property of layer to null)
Version 2000.07.16
------------------
[-] Fixed a bug in setDragBoundaries() and the dragging of layers within a specified area.
Version 2000.07.14
------------------
[+] Added ie55 property to Browser class
[-] Added slideTo() object fix, so sliding works with widgets
[*] Code optimizing and removing of unneeded characters
[*] Moved all dynlayer event code to core.api.events
[*] Moved dragdrop code to core.ext.dragdrop
[-] Included fix for setSize()
[-] Fixed problem with imageloader
Version 2000.07.11
------------------
[+] Added core.ext.addon, now contains the findLayers(), getImage() and the imageloader methods
[*] Removed the methods mentioned above from the core DynAPI object
[+] Added core.ext.layer, contains setMaxSize(), setPadding() and getPadding()
[*] Removed the methods mentioned above from the DynLayer object
Version 2000.07.05
------------------
[+] Added initial draganddrop support (use ondrop eventlistener)
[+] Added dragobject property to dyndocument
[*] Removed deleteAllChildren() call on dyndocument.unload
[+] Added onUnload() event to DynAPI constructor
Version 2000.07.03
------------------
[+] Added findDimensions() call in loadhandler
[+] Added deleteAllChildren() method to the DynDocument
[+] Added unload handler, automaticlly calls deleteAllChildren() of the default dyndocument
[*] Changed filestructure, and updated loadhandler()
Version 2000.07.01
------------------
[-] Fixed mousevents recursion for Mozilla
[-] Fixed setBgColor(null) for Mozilla
[*] Added DOM browsercheck
[+] Added new array properties: api[] gui[] and ext[] for use with new include()
[+] Added librarypath property, and setLibraryPath() method
[*] Changed include() method can now handle wildcards, use following:
DynAPI.include('core.api.*') - will link in all known API classes
DynAPI.include('core.gui.*') - will link in all known GUI classes
[*] The include() method now also contains a path parameter to specify the file path, if no path is selected the librarypath property will be used.
Version 2000.06.26
------------------
[*] Changed: made Mozilla/NS6 support working. (tested with milestone16)
[*] File including should now be done from within own code
Version 2000.06.25
------------------
[*] Splited every class in multiple files.
[+] Added include property to DynAPI class, to load extra files
[+] Added root property to specify root of DynAPI library
[*] Small code-cleaning (removing unneeded comments and extra characters)
[+] Incorporated getImage and imageloader functions into DynAPI constructor
[*] Made the EventListener class an extension (only link it if needed)
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:51:58
|
Update of /cvsroot/dynapi/dynapi2x/examples/mypackage
In directory usw-pr-cvs1:/tmp/cvs-serv15575/examples/mypackage
Added Files:
myobject1.js myobject2.js myobject3.js
Log Message:
Initial Import == 2.9
--- NEW FILE ---
function MyObject0() {
this.inherit('DynObject');
this.value0 = 0;
}
dynapi.setPrototype('MyObject0','DynObject');
function MyObject1() {
this.inherit('MyObject0');
this.value1 = 1;
}
dynapi.setPrototype('MyObject1','MyObject0');
function main() {
dynapi.debug.print('dynapi.library-myobject1.js main!');
}
if (!dynapi.loaded) main();
--- NEW FILE ---
function MyObject2() {
this.inherit('MyObject1');
this.value2 = 2;
}
dynapi.setPrototype('MyObject2','MyObject1');
--- NEW FILE ---
function MyObject3() {
this.inherit('MyObject2');
this.value3 = 3;
}
dynapi.setPrototype('MyObject3','MyObject2');
|
|
From: Robert R. <rai...@us...> - 2002-01-11 20:49:26
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/api/ext In directory usw-pr-cvs1:/tmp/cvs-serv14953/ext Log Message: Directory /cvsroot/dynapi/dynapi2x/src/dynapi/api/ext added to the repository |
|
From: Robert R. <rai...@us...> - 2002-01-11 20:49:18
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/images In directory usw-pr-cvs1:/tmp/cvs-serv14881/images Log Message: Directory /cvsroot/dynapi/dynapi2x/src/dynapi/images added to the repository |
|
From: Robert R. <rai...@us...> - 2002-01-11 20:49:18
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/util In directory usw-pr-cvs1:/tmp/cvs-serv14881/util Log Message: Directory /cvsroot/dynapi/dynapi2x/src/dynapi/util added to the repository |
|
From: Robert R. <rai...@us...> - 2002-01-11 20:49:18
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/api In directory usw-pr-cvs1:/tmp/cvs-serv14881/api Log Message: Directory /cvsroot/dynapi/dynapi2x/src/dynapi/api added to the repository |
|
From: Robert R. <rai...@us...> - 2002-01-11 20:49:18
|
Update of /cvsroot/dynapi/dynapi2x/src/dynapi/gui In directory usw-pr-cvs1:/tmp/cvs-serv14881/gui Log Message: Directory /cvsroot/dynapi/dynapi2x/src/dynapi/gui added to the repository |