|
From: Raymond I. <xw...@us...> - 2003-03-30 17:13:55
|
Update of /cvsroot/dynapi/dynapi3x/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv11568/examples
Modified Files:
dynapi.api.dynlayer-anchor-stretching.html
dynapi.api.ext.keyevents.html
dynapi.util.ioelement-postresponse.asp
dynapi.util.ioelement-postresponse.php
dynapi.util.ioelement-testfile.html
speedtest.dynlayer-basic.html
Added Files:
dynapi.api.dynlayer-blackboard.html
Log Message:
uploaded by raymond - includes kevin's patches
--- NEW FILE ---
<html>
<head>
<title>DynAPI Examples - Blackboard</title>
<script language="JavaScript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/');
dynapi.library.include('DynLayer');
</script>
<script language="Javascript">
var cnt=0;
var lyr=new DynLayer(null,100,100,100,100,'yellow');
lyr.addChild(new DynLayer({x:10,y:10,html:'child layer',color:'lime'}));
lyr.enableBlackboard();
dynapi.document.addChild(lyr);
change();
function change(){
cnt++;
var h='<table width="100" height="100" border="1"><tr><td bgcolor="#e0e0e0" align="center">Counter:'+cnt
+'<br><a href="javascript:;" onclick="change();return false;">Click Here</a>'
+'</td></tr></table>';
lyr.setHTML(h);
}
</script>
</head>
<body>
<script>
dynapi.document.insertAllChildren();
</script>
</body>
</html>
Index: dynapi.api.dynlayer-anchor-stretching.html
===================================================================
RCS file: /cvsroot/dynapi/dynapi3x/examples/dynapi.api.dynlayer-anchor-stretching.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** dynapi.api.dynlayer-anchor-stretching.html 10 Feb 2003 22:35:40 -0000 1.1.1.1
--- dynapi.api.dynlayer-anchor-stretching.html 30 Mar 2003 17:13:16 -0000 1.2
***************
*** 1,4 ****
<html>
-
<head>
<title>DynAPI Examples - DynLayer Anchor - Stretching</title>
--- 1,3 ----
Index: dynapi.api.ext.keyevents.html
===================================================================
RCS file: /cvsroot/dynapi/dynapi3x/examples/dynapi.api.ext.keyevents.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** dynapi.api.ext.keyevents.html 10 Feb 2003 22:35:41 -0000 1.1.1.1
--- dynapi.api.ext.keyevents.html 30 Mar 2003 17:13:17 -0000 1.2
***************
*** 10,15 ****
<script language="Javascript">
<!--
!
! var x=0,y=0;
myLayer = new DynLayer()
--- 10,15 ----
<script language="Javascript">
<!--
! /*
! var x=10,y=80;
myLayer = new DynLayer()
***************
*** 30,47 ****
onkeydown : function(e) {
if (e.which==39) { x+=20;myLayer.setLocation(x,y);return true }
! if (e.which==37) { x-=20;myLayer.setLocation(-20,0);return true }
if (e.which==40) { y+=20;myLayer.setLocation(x,y);return true }
if (e.which==38) { y-=20;myLayer.setLocation(x,y);return true }
! if (e.ctrlKey) { myLayer.moveBy(20,20);return true }
! if (e.shiftKey) alert('SHIFT!')
! status=e.which +" "+ String.fromCharCode(e.which)
}
}
! dynapi.document.addEventListener(myListener);
dynapi.document.addChild(myLayer);
! -->
</script>
</head>
--- 30,90 ----
onkeydown : function(e) {
if (e.which==39) { x+=20;myLayer.setLocation(x,y);return true }
! if (e.which==37) { x-=20;myLayer.setLocation(x,y);return true }
if (e.which==40) { y+=20;myLayer.setLocation(x,y);return true }
if (e.which==38) { y-=20;myLayer.setLocation(x,y);return true }
! if (e.ctrlKey) { x+=20;y+=20;myLayer.setLocation(x,y);return true }
! if (e.shiftKey) alert('SHIFT!');
}
}
+ */
! html='Click in the main window or in the text field below. Then press any alphabetic or \'SHIFT\' keys to show the key. In the text field below press a \'CTRL\' key to slide me or an arrow key to move me. Try and find the secret key ;)<form><input type="text" size="5"></form>';
! myLayer=new DynLayer(html,10,80,400,120,'#c0c0c0')
! function info(e) {
! var type=e.type;
! var src=e.src;
! var origin=e.origin;
! var propagate=e.propagate;
! var bubble=e.bubble;
! var bubbleChild=e.bubbleChild;
! var defaultValue=e.defaultValue;
! var srcName=src._name;
! var originName=origin._name;
! var ctrlKey=e.ctrlKey;
! var bubbleChildName=(bubbleChild)?bubbleChild._name:'None';
! var str='[ '+srcName+' '+type+' ] ';
! //var str='[ '+srcName+' '+type+' ] origin='+originName+' propagate='+propagate+' bubble='+bubble+' bubbleChild='+bubbleChildName+' defaultValue='+defaultValue+' ctrlKey='+ctrlKey+'. ';
! return str;
! };
! myListener = {
! onkeyup : function(e) {
! if (e.charKey=='s') alert(info(e)+'You found the secret key.');
! },
! onkeydown : function(e) {
! var o=e.src;
! var key=e.getKey();
! var doc=(o._name=='Document');
! if (e.shiftKey) alert(info(e)+'You pressed a SHIFT key.')
! else if (e.ctrlKey&&!doc) { o.slideTo(o.getX()+20,o.getY()+20); }
! else if (e.which==39&&!doc) { o.setLocation(o.getX()+20,null); }
! else if (e.which==37&&!doc) { o.setLocation(o.getX()-20,null); }
! else if (e.which==40&&!doc) { o.setLocation(null,o.getY()+20); }
! else if (e.which==38&&!doc) { o.setLocation(null,o.getY()-20); }
! else if ((key>='a')&&(key<='z')) alert(info(e)+'You pressed the "'+key+'" key.')
! status=e.which +" "+ String.fromCharCode(e.which)
! }
! }
!
! // dynapi.document.addEventListener(myListener);
! // dynapi.document.addChild(myLayer);
!
! myLayer._name='Layer'
! myLayer.addEventListener(myListener);
! dynapi.document._name='Document';
dynapi.document.addChild(myLayer);
+ dynapi.document.addEventListener(myListener);
! //-->
</script>
</head>
Index: dynapi.util.ioelement-postresponse.asp
===================================================================
RCS file: /cvsroot/dynapi/dynapi3x/examples/dynapi.util.ioelement-postresponse.asp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** dynapi.util.ioelement-postresponse.asp 10 Feb 2003 22:35:44 -0000 1.1.1.1
--- dynapi.util.ioelement-postresponse.asp 30 Mar 2003 17:13:17 -0000 1.2
***************
*** 8,12 ****
// find the filename to output to the debugger
! var url = (dynapi.ua.ns4)? this.src : this.document.location.href;
url = url.substring(url.lastIndexOf('/')+1,url.indexOf('?'));
}
--- 8,12 ----
// find the filename to output to the debugger
! var url = this.src || this.location.href || this.document.location.href;
url = url.substring(url.lastIndexOf('/')+1,url.indexOf('?'));
}
***************
*** 23,27 ****
%>
! -->
</script>
<body></body>
--- 23,27 ----
%>
! //-->
</script>
<body></body>
Index: dynapi.util.ioelement-postresponse.php
===================================================================
RCS file: /cvsroot/dynapi/dynapi3x/examples/dynapi.util.ioelement-postresponse.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** dynapi.util.ioelement-postresponse.php 10 Feb 2003 22:35:44 -0000 1.1.1.1
--- dynapi.util.ioelement-postresponse.php 30 Mar 2003 17:13:17 -0000 1.2
***************
*** 9,13 ****
// find the filename to output to the debugger
! var url = (dynapi.ua.ns4)? this.src : this.document.location.href;
url = url.substring(url.lastIndexOf('/')+1,url.indexOf('?'));
}
--- 9,13 ----
// find the filename to output to the debugger
! var url = this.src || this.location.href || this.document.location.href;
url = url.substring(url.lastIndexOf('/')+1,url.indexOf('?'));
}
Index: dynapi.util.ioelement-testfile.html
===================================================================
RCS file: /cvsroot/dynapi/dynapi3x/examples/dynapi.util.ioelement-testfile.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** dynapi.util.ioelement-testfile.html 10 Feb 2003 22:35:45 -0000 1.1.1.1
--- dynapi.util.ioelement-testfile.html 30 Mar 2003 17:13:17 -0000 1.2
***************
*** 8,12 ****
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
--- 8,12 ----
ioelement = parent.IOElement.notify(this, init); // run init() when this file loads
}
! else alert('Error: Missing or invalid DynAPI library');
// you can server-generate js variables and retrieve them in the load handler
***************
*** 18,26 ****
var args = dynapi.functions.getURLArguments(this);
var myValue = args['myvalue'];
}
- // find the filename to output to the debugger
- var url = (dynapi.ua.ns4)? this.src : this.document.location.href;
- url = url.substring(url.lastIndexOf('/')+1,url.indexOf('?'));
function init() {
dynapi.debug.print('loaded '+url);
--- 18,27 ----
var args = dynapi.functions.getURLArguments(this);
var myValue = args['myvalue'];
+
+ // find the filename to output to the debugger
+ var url = this.src || this.location.href || this.document.location.href;
+ url = url.substring(url.lastIndexOf('/')+1,url.indexOf('?'));
}
function init() {
dynapi.debug.print('loaded '+url);
Index: speedtest.dynlayer-basic.html
===================================================================
RCS file: /cvsroot/dynapi/dynapi3x/examples/speedtest.dynlayer-basic.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** speedtest.dynlayer-basic.html 26 Mar 2003 02:22:30 -0000 1.3
--- speedtest.dynlayer-basic.html 30 Mar 2003 17:13:17 -0000 1.4
***************
*** 18,22 ****
x=c*31;
c+=1;
! lyr=new DynLayer(null,x,y,20,20,'yellow')
dynapi.document.addChild(lyr);
}
--- 18,22 ----
x=c*31;
c+=1;
! lyr=new DynLayer(null,x,y,20,20,'yellow');
dynapi.document.addChild(lyr);
}
|