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: L W <war...@us...> - 2005-09-28 19:33:18
|
Update of /cvsroot/dynapi/dynapi3x/src/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2876/src/gui Modified Files: explorer.style.js Log Message: [-] Fix missing nowrap in Explorer Style Index: explorer.style.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/gui/explorer.style.js,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** explorer.style.js 9 Sep 2003 15:34:56 -0000 1.1 --- explorer.style.js 28 Sep 2005 19:33:11 -0000 1.2 *************** *** 4,8 **** The DynAPI Distribution is distributed under the terms of the GNU LGPL license. ! Requires: StyleManager, Explorer */ --- 4,8 ---- The DynAPI Distribution is distributed under the terms of the GNU LGPL license. ! Requires: StyleManager, Explorer */ *************** *** 13,17 **** style.cssLeave = 'ExplorerLeave'; style.cssRootLeave = 'ExplorerRootLeave'; ! style.cssCurrentLeave = 'ExplorerCurrentLeave'; style.loadImages = function(){ // load default images --- 13,17 ---- style.cssLeave = 'ExplorerLeave'; style.cssRootLeave = 'ExplorerRootLeave'; ! style.cssCurrentLeave = 'ExplorerCurrentLeave'; style.loadImages = function(){ // load default images *************** *** 42,49 **** style._buildHTML = function(leave,level,last,lD) { var niv = level||0; ! var listaD = lD || new Array(); ! //if(leave['_html'+leave.open] && !leave.tree._hTree[leave.id]) return leave['_html'+leave.open]; ! var tree = leave.tree; var iFL = tree.getStyleAttribute('imageFile'); --- 42,49 ---- style._buildHTML = function(leave,level,last,lD) { var niv = level||0; ! var listaD = lD || new Array(); ! //if(leave['_html'+leave.open] && !leave.tree._hTree[leave.id]) return leave['_html'+leave.open]; ! var tree = leave.tree; var iFL = tree.getStyleAttribute('imageFile'); *************** *** 58,67 **** var iNC = tree.getStyleAttribute('imageNoChildren'); var iNCL = tree.getStyleAttribute('imageNoChildrenlast'); ! var csRLV = tree.getStyleAttribute('cssRootLeave')||''; var csCLV = tree.getStyleAttribute('cssCurrentLeave')||''; var csLV = tree.getStyleAttribute('cssLeave')||''; ! ! var ret = '<tr><td><img src="'+iWht.src+'" height="1" width="5"></td><td valign="top">'; for(var i=0;i<(niv-1);i++) ret += '<img src="'+(listaD[i]? iWht.src:iLn.src)+'" width="15" height="18" align=top>'; if(niv == 0) ret += ''; --- 58,67 ---- var iNC = tree.getStyleAttribute('imageNoChildren'); var iNCL = tree.getStyleAttribute('imageNoChildrenlast'); ! var csRLV = tree.getStyleAttribute('cssRootLeave')||''; var csCLV = tree.getStyleAttribute('cssCurrentLeave')||''; var csLV = tree.getStyleAttribute('cssLeave')||''; ! ! var ret = '<tr><td><img src="'+iWht.src+'" height="1" width="5"></td><td valign="top" nowrap>'; for(var i=0;i<(niv-1);i++) ret += '<img src="'+(listaD[i]? iWht.src:iLn.src)+'" width="15" height="18" align=top>'; if(niv == 0) ret += ''; *************** *** 77,81 **** if (leave.open||leave.id == leave.tree.currentPos) ret += '<img src="'+(icon_sel.src)+'" width="16" height="16" align="top">'; else ret += '<img src="'+(icon.src)+'" width="16" height="16" align="top">'; ! } ret += '<a class="'+(niv==0 ? csRLV: (leave.id == tree.currentPos ? (leave.cssSel||csCLV) : (leave.css||csLV))) + '" href="javascript:;" onclick="return '+leave.tree+'.setCurrent(\''+ leave.id +'\')">'; --- 77,81 ---- if (leave.open||leave.id == leave.tree.currentPos) ret += '<img src="'+(icon_sel.src)+'" width="16" height="16" align="top">'; else ret += '<img src="'+(icon.src)+'" width="16" height="16" align="top">'; ! } ret += '<a class="'+(niv==0 ? csRLV: (leave.id == tree.currentPos ? (leave.cssSel||csCLV) : (leave.css||csLV))) + '" href="javascript:;" onclick="return '+leave.tree+'.setCurrent(\''+ leave.id +'\')">'; *************** *** 89,93 **** listaD[niv-1] = last; if((leave.open || niv==0) && leave.children.length!=0) { ! for(var i in leave.children) { q++; ret += this._buildHTML(leave.children[i],niv+1,q==leave.count,listaD); --- 89,93 ---- listaD[niv-1] = last; if((leave.open || niv==0) && leave.children.length!=0) { ! for(var i in leave.children) { q++; ret += this._buildHTML(leave.children[i],niv+1,q==leave.count,listaD); *************** *** 103,108 **** this._adjustSize = this.style._adjustSize; this.setAutoSize(this.w||true,this.h||true); ! if(this._created) this.renderStyle(); ! }; // renderStyle will act as a function of the DynLayer object style.renderStyle = function(act){ --- 103,108 ---- this._adjustSize = this.style._adjustSize; this.setAutoSize(this.w||true,this.h||true); ! if(this._created) this.renderStyle(); ! }; // renderStyle will act as a function of the DynLayer object style.renderStyle = function(act){ *************** *** 117,121 **** this._OldAdjustSize = null; }; ! return style; }; --- 117,121 ---- this._OldAdjustSize = null; }; ! return style; }; *************** *** 131,133 **** // Creates the style once it has been loaded ! Styles.addStyle('Explorer',ExplorerStyle); \ No newline at end of file --- 131,133 ---- // Creates the style once it has been loaded ! Styles.addStyle('Explorer',ExplorerStyle); |
From: L W <war...@us...> - 2005-09-28 19:33:18
|
Update of /cvsroot/dynapi/dynapi3x/docs/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2876/docs/docs Modified Files: revision.html Log Message: [-] Fix missing nowrap in Explorer Style Index: revision.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/docs/docs/revision.html,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** revision.html 2 Aug 2005 10:39:08 -0000 1.39 --- revision.html 28 Sep 2005 19:33:10 -0000 1.40 *************** *** 37,40 **** --- 37,45 ---- [ - Bug Fix ] + + Version CVS-HEAD + ------------------ + [-] Fix missing nowrap in Explorer Style + Version 3.0.0-beta2 (2005-08-02) ---------------------------------- |
From: Andrew G. <agi...@us...> - 2005-08-23 23:00:30
|
Update of /cvsroot/dynapi/dynapi3x/test/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22767 Modified Files: editTest.php saveTest.php Log Message: Increased max length for test code Index: editTest.php =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/test/scripts/editTest.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** editTest.php 15 Aug 2005 23:18:16 -0000 1.1 --- editTest.php 23 Aug 2005 23:00:18 -0000 1.2 *************** *** 25,29 **** <br/> ! <b>Test code:</b> max length <code>10KB</code> <br/> <textarea name="test_code" cols="64" rows="15"><?=htmlspecialchars($test_code)?></textarea> --- 25,29 ---- <br/> ! <b>Test code:</b> max length <code>16KB</code> <br/> <textarea name="test_code" cols="64" rows="15"><?=htmlspecialchars($test_code)?></textarea> Index: saveTest.php =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/test/scripts/saveTest.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** saveTest.php 15 Aug 2005 23:18:16 -0000 1.1 --- saveTest.php 23 Aug 2005 23:00:18 -0000 1.2 *************** *** 15,20 **** $name = $_REQUEST["name"]; ! $expected_result = $_REQUEST["expected_result"]; ! $test_code = $_REQUEST["test_code"]; if ($name == "") { --- 15,20 ---- $name = $_REQUEST["name"]; ! $expected_result = stripslashes($_REQUEST["expected_result"]); ! $test_code = stripslashes($_REQUEST["test_code"]); if ($name == "") { *************** *** 31,36 **** die("<p>Test code is required (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } ! if (strlen($test_code) > (1024 * 10)) { ! die("<p>Test code too long, max length = 10KB (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } --- 31,36 ---- die("<p>Test code is required (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } ! if (strlen($test_code) > (1024 * 16)) { ! die("<p>Test code too long, max length = 16KB (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } *************** *** 42,45 **** --- 42,46 ---- } + $code_filename = "../" . $name . ".html"; $result_filename = "../" . $name . ".txt"; |
From: Andrew G. <agi...@us...> - 2005-08-23 22:59:10
|
Update of /cvsroot/dynapi/dynapi3x/test/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22337 Modified Files: storeResult.php Log Message: Fixed bad SQL and strip slashes from request parameters Index: storeResult.php =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/test/scripts/storeResult.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** storeResult.php 15 Aug 2005 23:18:16 -0000 1.1 --- storeResult.php 23 Aug 2005 22:58:57 -0000 1.2 *************** *** 16,22 **** $name = $_REQUEST['name']; $passfail = $_REQUEST['passfail']; ! $comments = $_REQUEST['comments']; ! $tester = $_REQUEST['tester']; ! $agent = $_SERVER['HTTP_USER_AGENT']; $dynapiVersion = getDynAPIVersion(); $now = date("YmdHis"); --- 16,22 ---- $name = $_REQUEST['name']; $passfail = $_REQUEST['passfail']; ! $comments = stripslashes($_REQUEST['comments']); ! $tester = stripslashes($_REQUEST['tester']); ! $agent = stripslashes($_SERVER['HTTP_USER_AGENT']); $dynapiVersion = getDynAPIVersion(); $now = date("YmdHis"); *************** *** 44,48 **** or die("Could not select database $test_database_name"); ! $query = "INSERT INTO testresult (testcase_name, dynapi_version, testcase_date, passed, comments, user_agent, test_date, tester) VALUES ('$name', 'dynapi$version', '$fileMod', $passfail, '$comments', '$agent', '$now', '$tester')"; mysql_query($query) or die('Query failed: ' . mysql_error()); --- 44,48 ---- or die("Could not select database $test_database_name"); ! $query = "INSERT INTO testresult (testcase_name, dynapi_version, testcase_date, passed, comments, user_agent, test_date, tester) VALUES ('$name', '$dynapiVersion', '$fileMod', $passfail, '$comments', '$agent', '$now', '$tester')"; mysql_query($query) or die('Query failed: ' . mysql_error()); |
From: Andrew G. <agi...@us...> - 2005-08-23 22:55:06
|
Update of /cvsroot/dynapi/dynapi3x/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21705 Modified Files: 003.DynLayerDestroy.html Log Message: Automatically destroy layers at end of run Index: 003.DynLayerDestroy.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/test/003.DynLayerDestroy.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** 003.DynLayerDestroy.html 15 Aug 2005 23:18:16 -0000 1.1 --- 003.DynLayerDestroy.html 23 Aug 2005 22:54:59 -0000 1.2 *************** *** 28,33 **** document.countform.counttext.value = counter; } ! if (counter >= 1000) stop(); } --- 28,35 ---- document.countform.counttext.value = counter; } ! if (counter >= 1000) { stop(); + destroyAll(); + } } *************** *** 35,38 **** --- 37,42 ---- function start() { if (counter==0){ + document.countform.counttext.value = 0; + document.countform.timer.value = ''; var d=new Date(); startTime=d.getTime(); *************** *** 48,54 **** function destroyAll() { dynapi.document.destroyAllChildren(); ! document.countform.counttext.value = 0; ! document.countform.timer.value = ''; ! counter=0; } --- 52,56 ---- function destroyAll() { dynapi.document.destroyAllChildren(); ! counter = 0; } *************** *** 57,62 **** <body bgcolor="#999999"> ! <p><a href="javascript:start()">Start generation</a><br> ! <a href="javascript:destroyAll()">Destroy all</a><br> <form name="countform"> --- 59,63 ---- <body bgcolor="#999999"> ! <p><a href="javascript:start()">Start generation</a></p> <form name="countform"> |
From: Andrew G. <agi...@us...> - 2005-08-23 22:53:47
|
Update of /cvsroot/dynapi/dynapi3x/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21537 Modified Files: 001.DynLayers.html Log Message: Fixed bad quoting Index: 001.DynLayers.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/test/001.DynLayers.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** 001.DynLayers.html 15 Aug 2005 23:18:16 -0000 1.1 --- 001.DynLayers.html 23 Aug 2005 22:53:39 -0000 1.2 *************** *** 1,21 **** ! <html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <title>DynAPI - Test Suite</title> ! <script type=\"text/javascript\" language=\"JavaScript\" src=\"../src/dynapi.js\"></script> ! <script type=\"text/javascript\" language=\"JavaScript\"> ! dynapi.library.setPath(\'../src/\'); </script> ! <script type=\"text/javascript\" language=\"JavaScript\"> ! dynapi.library.include(\'dynapi.api\'); </script> ! <script type=\"text/javascript\" language=\"JavaScript\"> w = new DynLayer(); ! w.setBgColor(\'white\'); w.setSize(130,130); w.setLocation(50,50); b = new DynLayer(); ! b.setBgColor(\'black\'); b.setSize(100,100); b.setLocation(200,50); --- 1,21 ---- ! <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DynAPI - Test Suite</title> ! <script type="text/javascript" language="JavaScript" src="../src/dynapi.js"></script> ! <script type="text/javascript" language="JavaScript"> ! dynapi.library.setPath('../src/'); </script> ! <script type="text/javascript" language="JavaScript"> ! dynapi.library.include('dynapi.api'); </script> ! <script type="text/javascript" language="JavaScript"> w = new DynLayer(); ! w.setBgColor('white'); w.setSize(130,130); w.setLocation(50,50); b = new DynLayer(); ! b.setBgColor('black'); b.setSize(100,100); b.setLocation(200,50); *************** *** 26,32 **** </script> </head> ! <body bgcolor=\"#999999\"> ! <script type=\"text/javascript\" language=\"JavaScript\"> dynapi.document.insertAllChildren(); </script> --- 26,32 ---- </script> </head> ! <body bgcolor="#999999"> ! <script type="text/javascript" language="JavaScript"> dynapi.document.insertAllChildren(); </script> |
From: Andrew G. <agi...@us...> - 2005-08-16 23:19:33
|
Update of /cvsroot/dynapi/dynapi3x/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31877 Modified Files: 002.Location.txt Log Message: Better description Index: 002.Location.txt =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/test/002.Location.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** 002.Location.txt 15 Aug 2005 23:18:16 -0000 1.1 --- 002.Location.txt 16 Aug 2005 23:19:15 -0000 1.2 *************** *** 1 **** ! Square should move around --- 1,4 ---- ! Clicking on the links should cause the black square should move over ! the ping and yellow squares. This test covers the setLocation function ! (moving relative to the parent DynLayer) and setPageLocation (moving ! relative to the page). |
From: Andrew G. <agi...@us...> - 2005-08-16 22:39:53
|
Update of /cvsroot/dynapi/dynapi3x/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22981 Added Files: 005.ViewPane.html 005.ViewPane.txt Log Message: ViewPane test adapted from w9.9's example --- NEW FILE --- <html> <head> <title>DynAPI Examples - ViewPane</title> <script language="JavaScript" src="../src/dynapi.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> dynapi.library.setPath('../src/'); dynapi.library.include('dynapi.api'); dynapi.library.include('ViewPane'); </script> <script language="JavaScript" type="text/javascript"> var html_content = new Array(); html_content[0] = '<div style="width:400; height:400; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #1</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>\n'; html_content[1] = '<div style="width:100; height:100; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #2</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>'; html_content[2] = '<div style="width:1000; height:100; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #3</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>'; html_content[3] = '<div style="width:100; height:300; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #4</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>'; html_content[4] = '<div style="width:200; height:160; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #5</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>'; var vp = new Array(); vp[0] = new ViewPane(null,25,25,200,160); vp[1] = new ViewPane(null,275,25,200,160); vp[2] = new ViewPane(null,25,225,200,160); vp[3] = new ViewPane(null,275,225,200,160); vp[4] = new ViewPane(null,25,425,200,160); vp[0].setContent(new DynLayer('Test Layer1',10,10,250,250,'yellow')); vp[1].setContent(new DynLayer('Test Layer2',10,10,250,250,'yellow')); vp[2].setContent(new DynLayer('Test Layer3',10,10,250,250,'yellow')); vp[3].setContent(new DynLayer('Test Layer4',10,10,250,250,'yellow')); vp[4].setContent(new DynLayer('Test Layer5',10,10,250,250,'yellow')); changeContent(0,0); changeContent(1,1); changeContent(2,2); changeContent(3,3); changeContent(4,4); dynapi.document.addChild(vp[0]); dynapi.document.addChild(vp[1]); dynapi.document.addChild(vp[2]); dynapi.document.addChild(vp[3]); dynapi.document.addChild(vp[4]); function changeContent (vp_inx,html_inx) { vp[vp_inx||0].setContent( html_content[html_inx||0] ); }; </script> </head> <body> <script language="JavaScript" type="text/javascript"> dynapi.document.insertAllChildren(); </script> </body> </html> --- NEW FILE --- There are 5 ViewPanes. Each ViewPane contains a yellow fixed-size DIV element with some text. The DIVs are set at various sizes w.r.t. the ViewPane. ViewPane size is 200x160. <p> <i>Content #1:</i> The DIV (400x400) is wider and taller than the ViewPane. Horizontal and vertical scroolbars should be present. <p> <i>Content #2:</i> 100x100. No scrollbars. You may be able to scroll the content of the DIV by dragging the mouse around inside it - this is a browser feature. <p> <i>Content #3:</i> 300x100. Horizontal scrollbar only. <p> <i>Content #4:</i> 100x300. Vertical scrollbar only. <p> <i>Content #5:</i> 200x160. No scrollbars. |
From: Andrew G. <agi...@us...> - 2005-08-15 23:18:25
|
Update of /cvsroot/dynapi/dynapi3x/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10083 Added Files: 001.DynLayers.html 001.DynLayers.txt 002.Location.html 002.Location.txt 003.DynLayerDestroy.html 003.DynLayerDestroy.txt 004.BorderManager.html 004.BorderManager.txt index.php Log Message: Initial version --- NEW FILE --- <html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <title>DynAPI - Test Suite</title> <script type=\"text/javascript\" language=\"JavaScript\" src=\"../src/dynapi.js\"></script> <script type=\"text/javascript\" language=\"JavaScript\"> dynapi.library.setPath(\'../src/\'); </script> <script type=\"text/javascript\" language=\"JavaScript\"> dynapi.library.include(\'dynapi.api\'); </script> <script type=\"text/javascript\" language=\"JavaScript\"> w = new DynLayer(); w.setBgColor(\'white\'); w.setSize(130,130); w.setLocation(50,50); b = new DynLayer(); b.setBgColor(\'black\'); b.setSize(100,100); b.setLocation(200,50); dynapi.document.addChild(w); dynapi.document.addChild(b); </script> </head> <body bgcolor=\"#999999\"> <script type=\"text/javascript\" language=\"JavaScript\"> dynapi.document.insertAllChildren(); </script> </body> </html> --- NEW FILE --- You should see a grey background, a white square and a smaller black square to the right. --- NEW FILE --- <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DynAPI - Test Suite</title> <script type="text/javascript" language="JavaScript" src="../src/dynapi.js"></script> <script type="text/javascript" language="JavaScript"> dynapi.library.setPath('../src/'); </script> <script type="text/javascript" language="JavaScript"> dynapi.library.include('dynapi.api'); </script> <script type="text/javascript" language="JavaScript"> // Parent Layer p = new DynLayer(); p.setBgColor('white'); p.setSize(200,200); p.setLocation(225,25); // Markers m1 = new DynLayer('25,25'); m1.setBgColor('yellow'); m1.setSize(50,50); m1.setLocation(25,25); m2 = new DynLayer('25,125'); m2.setBgColor('yellow'); m2.setSize(50,50); m2.setLocation(25,125); m3 = new DynLayer('350,50'); m3.setBgColor('pink'); m3.setSize(50,50); m3.setLocation(125,25); m4 = new DynLayer('350,150'); m4.setBgColor('pink'); m4.setSize(50,50); m4.setLocation(125,125); c = new DynLayer(); c.setBgColor('black'); c.setSize(50,50); c.setLocation(75,75); dynapi.document.addChild(p); p.addChild(m1); p.addChild(m2); p.addChild(m3); p.addChild(m4); p.addChild(c); </script> </head> <body bgcolor="#999999"> <script type="text/javascript" language="JavaScript"> dynapi.document.insertAllChildren(); </script> <p> <a href="javascript:;" onclick="c.setLocation(25,25)">Set Location 25,25</a><br> <a href="javascript:;" onclick="c.setLocation(25,125)">Set Location 25,125</a><br> <a href="javascript:;" onclick="c.setPageLocation(350,50)">Set Page Location 350,50</a><br> <a href="javascript:;" onclick="c.setPageLocation(350,150)">Set Page Location 350,150</a><br> </p> <p> <a href="javascript:;" onclick="c.setLocation(75,75)">Center</a> </p> </body> </html> --- NEW FILE --- Square should move around --- NEW FILE --- <html> <head> <title>DynAPI - DynLayer Destroy</title> <script language="JavaScript" src="../src/dynapi.js"></script> <script language="Javascript"> dynapi.library.setPath('../src/'); dynapi.library.include('dynapi.api'); dynapi.library.include('dynapi.functions'); </script> <script language="Javascript"> dynapi.onLoad(init); function init() { document.countform.counttext.value = 0; }; var counter = 0; var startTime=0; function generate(n) { for (var i=0;i<n;i++) { var d = new DynLayer(); d.setBgColor(dynapi.functions.getRandomColor()); d.setSize(10+80*Math.random(),10+80*Math.random()); d.setLocation(130+500*Math.random(),500*Math.random()); dynapi.document.addChild(d); counter++; document.countform.counttext.value = counter; } if (counter >= 1000) stop(); } var timer; function start() { if (counter==0){ var d=new Date(); startTime=d.getTime(); timer = setInterval('generate(10)',1); } } function stop() { clearInterval(timer); var d=new Date(); document.countform.timer.value = (d.getTime()-startTime)/1000; } function destroyAll() { dynapi.document.destroyAllChildren(); document.countform.counttext.value = 0; document.countform.timer.value = ''; counter=0; } </script> </head> <body bgcolor="#999999"> <p><a href="javascript:start()">Start generation</a><br> <a href="javascript:destroyAll()">Destroy all</a><br> <form name="countform"> <input type=text name="counttext" size=5/> <br/> <input type=text name="timer" size=5> </form> </body> </html> --- NEW FILE --- When running this test it is useful to watch the memory usage of the browser. Let the test run to create 1000 or so dynlayers. Stop it, destroy the layers, and run it again. If the second run continues to increase the amount of memory used by the browser, then memory is not being released and you should mark the test as failed. <br> This test is based on the dynapi.api.dynlayer-destroy.html example. --- NEW FILE --- <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DynAPI - Test Suite - BorderManager</title> <script type="text/javascript" language="JavaScript" src="../src/dynapi.js"></script> <script type="text/javascript" language="JavaScript"> dynapi.library.setPath('../src/'); </script> <script type="text/javascript" language="JavaScript"> dynapi.library.include('dynapi.api'); dynapi.library.include('BorderManager'); </script> <script type="text/javascript" language="JavaScript"> var oldL = dynapi.document; var i,newL; for (i = 0; i < 125; i++) { newL = new DynLayer(); newL.setBgColor('#e0e0e0'); newL.setSize(500 - i*4, 500 - i*4); newL.setLocation(2, 2); newL.setInnerBorder(1,"black"); oldL.addChild(newL); oldL = newL; } </script> </head> <body bgcolor="#999999"> <script type="text/javascript" language="JavaScript"> dynapi.document.insertAllChildren(); </script> </body> </html> --- NEW FILE --- This test shows 125 white layers, each with a 1-pixel wide black border. The layers are stacked one above the other in decreasing size so that all the borders are visible. --- NEW FILE --- <html> <head> <title>DynAPI - Test Suite</title> </head> <body> <?php require("scripts/config.php"); // Read test files // Keep this ... just write the files!!!! (security?) echo "<p><a href=\"scripts/editTest.php\">Create new test case</a></p>\n"; echo "<p>Available test cases:</p>\n"; echo "<table border=\"1\" cellspacing=\"0\">\n"; echo "<table border=\"1\" cellspacing=\"0\">\n"; echo "<tr>\n"; echo " <th>Name</th>\n"; echo " <th colspan=\"3\">Commands</th>\n"; echo "</tr>\n"; foreach (glob("*.html") as $filename) { $basename = basename($filename, ".html"); if (!file_exists($basename . ".txt")) continue; echo "<tr>"; echo "<td>" . $basename . "</td>"; echo " <td><a href=\"scripts/displayTest.php?name=" . urlencode($basename) . "\">Run</a></td>\n"; echo " <td><a href=\"scripts/editTest.php?name=" . urlencode($basename) . "\">Edit</a></td>\n"; echo " <td><a href=\"scripts/showResults.php?name=" . urlencode($basename) . "\">Previous results</a></td>\n"; echo "</tr>\n"; } echo "</table>\n"; ?> </body> </html> |
Update of /cvsroot/dynapi/dynapi3x/test/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10083/scripts Added Files: config.php create_tables.sql displayTest.php editTest.php saveTest.php showResults.php storeResult.php testForm.php Log Message: Initial version --- NEW FILE --- <?php $test_database_server="mysql-d.sourceforge.net"; $test_database_name="dynapi"; $test_database_user="dynapi"; $test_database_password="a58SiNIi"; ?> --- NEW FILE --- -- -- Table structure for table `testresult` -- CREATE TABLE `testresult` ( `id` int(11) NOT NULL auto_increment, `testcase_name` varchar(64) NOT NULL, `testcase_date` timestamp NULL default NULL, `dynapi_version` varchar(128) default NULL, `passed` tinyint(4) default NULL, `comments` text, `user_agent` varchar(128) default NULL, `test_date` timestamp NOT NULL, `tester` varchar(64) default NULL, PRIMARY KEY (`id`) ); --- NEW FILE --- <head> <title>DynAPI - Test Suite</title> </head> <frameset cols="30%, 70%"> <?php $name = $_REQUEST['name']; echo "<frame src=\"testForm.php?"; echo "name=", urlencode($name); echo "\"/>\n"; echo "<frame src=\"../" . $name . ".html\"/>\n"; ?> </frameset> --- NEW FILE --- <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DynAPI - Test Suite</title> </head> <?php $name = $_REQUEST['name']; if ($name) { $code_filename = "../" . $name . ".html"; if (file_exists($code_filename)) $test_code = file_get_contents($code_filename); $result_filename = "../" . $name . ".txt"; if (file_exists($result_filename)) $expected_result = file_get_contents($result_filename); } ?> <body> <p> <a href="../index.php">Top</a> </p> <form action="saveTest.php" method="post"> <b>Test name:</b> max length <code>64 bytes</code>, allowed chars <code>a-zA-Z0-9._-</code> <br/> <input type="text" name="name" size="64" maxlength="64" value="<?=$name?>"/> <br/> <br/> <b>Test code:</b> max length <code>10KB</code> <br/> <textarea name="test_code" cols="64" rows="15"><?=htmlspecialchars($test_code)?></textarea> <br/> <br/> <b>Expected results:</b> max length <code>2KB</code> <br/> <textarea name="expected_result" cols="64" rows="10"><?=$expected_result?></textarea> <br/> <br/> <br/> <input type="submit" value="Save"/> </form> </body> </html> --- NEW FILE --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DynAPI - Test Suite</title> </head> <body> <?php echo "<p><a href=\"../index.php\">Top</a></p>\n"; $name = $_REQUEST["name"]; $expected_result = $_REQUEST["expected_result"]; $test_code = $_REQUEST["test_code"]; if ($name == "") { die("<p>Name is required (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } if (strlen($name) > 64) { die("<p>Name too long, max length = 64 bytes (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } if (!preg_match('/^[a-zA-Z0-9\._-]+$/i', $name)) { die('<p>Bad name: $name (<a href=\"javascript:history.back()\">back</a>).</p>\n"</p>\n'); } if ($test_code == "") { die("<p>Test code is required (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } if (strlen($test_code) > (1024 * 10)) { die("<p>Test code too long, max length = 10KB (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } if ($expected_result == "") { die("<p>Expected result is required (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } if (strlen($expected_result) > (1024 * 2)) { die("<p>Expected result too long, max length = 2KB (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } $code_filename = "../" . $name . ".html"; $result_filename = "../" . $name . ".txt"; $handle = fopen($code_filename, "w+"); $rv1 = fwrite($handle, $test_code); fclose($handle); $handle = fopen($result_filename, "w+"); $rv2 = fwrite($handle, $expected_result); fclose($handle); printf("<p>Code: %d bytes, result: %d bytes</p>\n", $rv1, $rv2); ?> </body> </html> --- NEW FILE --- <html> <head> <title>DynAPI - Test Suite</title> </head> <body> <?php require("config.php"); $name = $_REQUEST['name']; $test_database_connection = mysql_connect("$test_database_server", "$test_database_user", "$test_database_password") or die("Could not connect to database: " . mysql_error()); mysql_select_db("$test_database_name") or die("Could not select database $test_database_name"); // Performing SQL query $query = "SELECT dynapi_version, testcase_date, passed, comments, user_agent, test_date, tester FROM testresult WHERE testcase_name = '" . $name . "' ORDER BY id"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); $num_rows = mysql_num_rows($result); echo "<p><a href=\"../index.php\">Top</a></p>\n"; echo "<p>Previous test results for <b>$name</b></p>\n"; // List test cases in a table echo "<table border=\"1\" cellspacing=\"0\">\n"; echo "<tr>\n"; echo " <th>DynAPI Version</th>\n"; echo " <th>Testcase created</th>\n"; echo " <th>Passed</th>\n"; echo " <th>Comments</th>\n"; echo " <th>User agent</th>\n"; echo " <th>Test Date</th>\n"; echo " <th>Tester</th>\n"; echo "</tr>\n"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { if ($line["passed"]) $style = ""; else $style = "style=\"background-color:pink;\""; echo "<tr $style>\n"; echo " <td>" . $line["dynapi_version"] . "</td>\n"; echo " <td>" . $line["testcase_date"] . "</td>\n"; echo " <td>" . ($line["passed"] ? "<font color=\"green\">Yes</font>" : "<font color=\"red\">No</font>") . "</td>\n"; echo " <td>" . $line["comments"] . "</td>\n"; echo " <td>" . $line["user_agent"] . "</td>\n"; echo " <td>" . $line["test_date"] . "</td>\n"; echo " <td>" . $line["tester"] . "</td>\n"; echo "</tr>\n"; } echo "</table>\n"; // Free resultset mysql_free_result($result); // Closing connection mysql_close($test_database_connection); ?> </body> </html> --- NEW FILE --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DynAPI - Test Suite</title> </head> <body> <?php echo "<a href=\"../index.php\">Top</a>\n"; $name = $_REQUEST['name']; $passfail = $_REQUEST['passfail']; $comments = $_REQUEST['comments']; $tester = $_REQUEST['tester']; $agent = $_SERVER['HTTP_USER_AGENT']; $dynapiVersion = getDynAPIVersion(); $now = date("YmdHis"); $fileMod = stat("../" . $name . ".html"); $fileMod = strftime("%Y-%m-%d %H:%M:%S", $fileMod[9]); if ($passfail!='P' and $passfail!='F'){ die("<p>You must select either pass or fail (<a href=\"javascript:history.back()\">back</a>).</p>\n"); } if ($passfail=='P'){ $passfail=1; } else{ $passfail=0; } require("config.php"); $test_database_connection = mysql_connect("$test_database_server", "$test_database_user", "$test_database_password") or die("Could not connect to database: " . mysql_error()); mysql_select_db("$test_database_name") or die("Could not select database $test_database_name"); $query = "INSERT INTO testresult (testcase_name, dynapi_version, testcase_date, passed, comments, user_agent, test_date, tester) VALUES ('$name', 'dynapi$version', '$fileMod', $passfail, '$comments', '$agent', '$now', '$tester')"; mysql_query($query) or die('Query failed: ' . mysql_error()); printf("<p>Records stored: %d</p>\n", mysql_affected_rows()); mysql_close($test_database_connection); function getDynAPIVersion() { $major = 0; $minor = 0; $revision = 0; $handle = fopen("../../src/version.xml", "r"); while (!feof($handle)) { $line = fgets($handle, 4096); preg_match("/<major>([^<]+)/", $line, $matches); if (count($matches) > 1) $major = $matches[1]; preg_match("/<minor>([^<]+)/", $line, $matches); if (count($matches) > 1) $minor = $matches[1]; preg_match("/<revision>([^<]+)/", $line, $matches); if (count($matches) > 1) $revision = $matches[1]; } fclose($handle); return $major . "." . $minor . "." . $revision; } ?> </body> </html> --- NEW FILE --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DynAPI - Test Suite</title> </head> <body> <form action="storeResult.php" target="_top"> <?php $name = $_REQUEST['name']; require("config.php"); $fileMod = stat("../" . $name . ".html"); $fileMod = strftime("%Y-%m-%d %H:%M:%S", $fileMod[9]); echo "<a href=\"../index.php\" target=\"_TOP\">Top</a>\n"; echo "<table>\n"; echo " <tr>\n"; echo " <td align=\"right\">Test Name:</td>\n"; echo " <td>" . $name . "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"right\">Last modified:</td>\n"; echo " <td>" . $fileMod . "</td>\n"; echo " </tr>\n"; echo "</table>\n"; echo "<h4>Expected result:</h4>\n"; echo file_get_contents("../" . $name . ".txt"); echo "</p>\n"; echo "<h4>Observed result:</h4>\n"; echo "<input type=\"radio\" name=\"passfail\" value=\"P\"\">Pass</input>"; echo "<input type=\"radio\" name=\"passfail\" value=\"F\"\">Fail</input>"; echo "<br/>\n"; echo "Testers name: "; echo "<input type=\"text\" name=\"tester\"/>\n"; echo "<br/>\n"; echo "Comments / observations:"; echo "<br/>\n"; echo "<textarea name=\"comments\" rows=\"10\" cols=\"32\"></textarea>\n"; echo "<br/>\n"; echo "<input type=\"submit\" value=\"Save test result\"/>\n"; echo "<input type=\"hidden\" name=\"name\" value=\"" . $name . "\"/>\n"; ?> </form> </body> </html> |
From: Andrew G. <agi...@us...> - 2005-08-15 23:10:51
|
Update of /cvsroot/dynapi/dynapi3x/test/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6160/scripts Log Message: Directory /cvsroot/dynapi/dynapi3x/test/scripts added to the repository |
From: Andrew G. <agi...@us...> - 2005-08-11 02:56:20
|
Update of /cvsroot/dynapi/dynapi3x/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21469/test Log Message: Directory /cvsroot/dynapi/dynapi3x/test added to the repository |
From: L W <war...@us...> - 2005-08-02 10:39:18
|
Update of /cvsroot/dynapi/dynapi3x/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv942/src Modified Files: dynapi.js Log Message: Update revisions prior to tag and release. Index: dynapi.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/dynapi.js,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** dynapi.js 17 Jul 2003 04:34:06 -0000 1.15 --- dynapi.js 2 Aug 2005 10:39:08 -0000 1.16 *************** *** 1,12 **** /* ! DynAPI Distribution ! DynObject, DynAPI Object, UserAgent, Library, Functions ! The DynAPI Distribution is distributed under the terms of the GNU LGPL license. */ function DynObject() { ! this.id = "DynObject"+DynObject._c++; ! DynObject.all[this.id] = this; }; var p = DynObject.prototype; --- 1,12 ---- /* ! DynAPI Distribution ! DynObject, DynAPI Object, UserAgent, Library, Functions ! The DynAPI Distribution is distributed under the terms of the GNU LGPL license. */ function DynObject() { ! this.id = "DynObject"+DynObject._c++; ! DynObject.all[this.id] = this; }; var p = DynObject.prototype; *************** *** 17,25 **** p.removeMethod = function(n) {this[n] = null}; p.setID = function(id,isInline,noImports) { ! if (this.id) delete DynObject.all[this.id]; ! this.id = id; ! this.isInline=isInline; ! this._noInlineValues=noImports; ! DynObject.all[this.id] = this; }; p.toString = function() {return "DynObject.all."+this.id}; --- 17,25 ---- p.removeMethod = function(n) {this[n] = null}; p.setID = function(id,isInline,noImports) { ! if (this.id) delete DynObject.all[this.id]; ! this.id = id; ! this.isInline=isInline; ! this._noInlineValues=noImports; ! DynObject.all[this.id] = this; }; p.toString = function() {return "DynObject.all."+this.id}; *************** *** 27,142 **** DynObject._c = 0; 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; ! var ua = navigator.userAgent.toLowerCase(); ! this.v = parseInt(v); ! this.safari = ua.indexOf("safari")>-1; // always check for safari & opera ! this.opera = ua.indexOf("opera")>-1; // before ns or ie ! this.ns = !this.opera && !this.safari && (b=="Netscape"); ! this.ie = !this.opera && (b=="Microsoft Internet Explorer"); ! this.gecko = ua.indexOf('gecko')>-1; // check for gecko engine ! if (this.ns) { ! this.ns4 = (this.v==4); ! this.ns6 = (this.v>=5); ! this.b = "Netscape"; ! }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;} ! this.b = "MSIE"; ! }else if (this.opera) { ! this.v=parseInt(ua.substr(ua.indexOf("opera")+6,1)); // set opera version ! this.opera6=(this.v>=6); ! this.opera7=(this.v>=7); ! this.b = "Opera"; ! }else if (this.safari) { ! this.ns6 = (this.v>=5); // ns6 compatible correct? ! this.b = "Safari"; ! } ! this.dom = (document.createElement && document.appendChild && document.getElementsByTagName)? true : false; ! this.def = (this.ie||this.dom); ! this.win32 = ua.indexOf("win")>-1; ! this.mac = ua.indexOf("mac")>-1; ! this.other = (!this.win32 && !this.mac); ! this.supported = (this.def||this.ns4||this.ns6||this.opera)? true:false; ! this.broadband=false; ! this._bws=new Date; // bandwidth timer start }; function DynAPIObject() { ! this.DynObject = DynObject; ! this.DynObject(); ! this.version = '3.0.0 Beta 1'; ! this.loaded = false; ! this.ua = new _UserAgent(); ! this._loadfn = []; ! this._unloadfn = []; ! var f = this.frame = window; ! ! 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.ua.supported) return alert('Unsupported Browser. Exiting.'); ! 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++) o._unloadfn[i](); ! if (o.document) { ! o.document._destroy(); ! o.document = null; ! } ! }; }; p = DynAPIObject.prototype = new DynObject; p.onLoad = function(f) { ! if (typeof(f)=="function") { ! if (!this.loaded) this._loadfn[this._loadfn.length] = f; ! else f(); ! } }; p._onLoad = function(f) { ! for (var i=0;i<this._loadfn.length;i++) this._loadfn[i](); }; p.onUnload = function(f) { ! if (typeof(f)=="function") 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; }; --- 27,142 ---- DynObject._c = 0; 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; ! var ua = navigator.userAgent.toLowerCase(); ! this.v = parseInt(v); ! this.safari = ua.indexOf("safari")>-1; // always check for safari & opera ! this.opera = ua.indexOf("opera")>-1; // before ns or ie ! this.ns = !this.opera && !this.safari && (b=="Netscape"); ! this.ie = !this.opera && (b=="Microsoft Internet Explorer"); ! this.gecko = ua.indexOf('gecko')>-1; // check for gecko engine ! if (this.ns) { ! this.ns4 = (this.v==4); ! this.ns6 = (this.v>=5); ! this.b = "Netscape"; ! }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;} ! this.b = "MSIE"; ! }else if (this.opera) { ! this.v=parseInt(ua.substr(ua.indexOf("opera")+6,1)); // set opera version ! this.opera6=(this.v>=6); ! this.opera7=(this.v>=7); ! this.b = "Opera"; ! }else if (this.safari) { ! this.ns6 = (this.v>=5); // ns6 compatible correct? ! this.b = "Safari"; ! } ! this.dom = (document.createElement && document.appendChild && document.getElementsByTagName)? true : false; ! this.def = (this.ie||this.dom); ! this.win32 = ua.indexOf("win")>-1; ! this.mac = ua.indexOf("mac")>-1; ! this.other = (!this.win32 && !this.mac); ! this.supported = (this.def||this.ns4||this.ns6||this.opera)? true:false; ! this.broadband=false; ! this._bws=new Date; // bandwidth timer start }; function DynAPIObject() { ! this.DynObject = DynObject; ! this.DynObject(); ! this.version = '3.0.0-beta2'; ! this.loaded = false; ! this.ua = new _UserAgent(); ! this._loadfn = []; ! this._unloadfn = []; ! var f = this.frame = window; ! ! 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.ua.supported) return alert('Unsupported Browser. Exiting.'); ! 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++) o._unloadfn[i](); ! if (o.document) { ! o.document._destroy(); ! o.document = null; ! } ! }; }; p = DynAPIObject.prototype = new DynObject; p.onLoad = function(f) { ! if (typeof(f)=="function") { ! if (!this.loaded) this._loadfn[this._loadfn.length] = f; ! else f(); ! } }; p._onLoad = function(f) { ! for (var i=0;i<this._loadfn.length;i++) this._loadfn[i](); }; p.onUnload = function(f) { ! if (typeof(f)=="function") 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; }; *************** *** 145,232 **** dynapi.ximages={'__xCnTer__':0}; // eXtensible Images p._imageGetHTML=function(){ ! t= '<img src="'+this.src+'"' ! +((this.width)? ' width="'+this.width+'"':'') ! +((this.height)? ' height="'+this.height+'"':'') ! +' border="0">'; ! return t; }; dynapi.functions = { ! removeFromArray : function(array, index, id) { ! 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; ! }, ! removeFromObject : function(object, id) { ! if(!dynapi.ua.opera) delete object[id]; ! else { ! var o={}; ! for (var i in object) if(id!=i) o[i]=object[i]; ! object=o; ! } ! return object; ! }, ! True : function() {return true}, ! False : function() {return false}, ! Null : function() {}, ! Zero : function() {return 0;}, ! Allow : function() { ! event.cancelBubble = true; ! return true; ! }, ! Deny : function() { ! event.cancelBubble = false; ! return false; ! }, ! getImage : function(src,w,h) { ! img=(w!=null&&h!=null)? new Image(w,h) : new Image(); ! img.src=src; ! img.getHTML=dynapi._imageGetHTML; ! return img; ! }, ! getURLArguments : function(o) { // pass a string or frame/layer object ! var url,l={}; ! 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 l; ! var s = url.substring(url.indexOf('?')+1); ! var a = s.split('&'); ! for (var i=0;i<a.length;i++) { ! var b = a[i].split('='); ! l[b[0]] = unescape(b[1]); ! } ! return l; ! }, ! getAnchorLocation : function(a,lyr){ ! var o,x=0,y=0; ! if(lyr && !lyr.doc) lyr=null; ! lyr=(lyr)? lyr:{doc:document,elm:document}; ! if(typeof(a)=='string') { ! if(lyr.doc.all) a=lyr.doc.all[a]; ! else if(lyr.doc.getElementById) a=lyr.doc.getElementById(a); ! else if(lyr.doc.layers) a=lyr.doc.anchors[a]; ! } ! if(a) o=a; ! else return; ! if(lyr.doc.layers) { y+=o.y; x+=o.x;} ! else if(lyr.doc.getElementById || lyr.doc.all){ ! while (o.offsetParent && lyr.elm!=o){ ! x+= o.offsetLeft;y+= o.offsetTop; ! o = o.offsetParent; ! } ! } ! return {x:x,y:y,anchor:a}; ! } }; --- 145,232 ---- dynapi.ximages={'__xCnTer__':0}; // eXtensible Images p._imageGetHTML=function(){ ! t= '<img src="'+this.src+'"' ! +((this.width)? ' width="'+this.width+'"':'') ! +((this.height)? ' height="'+this.height+'"':'') ! +' border="0">'; ! return t; }; dynapi.functions = { ! removeFromArray : function(array, index, id) { ! 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; ! }, ! removeFromObject : function(object, id) { ! if(!dynapi.ua.opera) delete object[id]; ! else { ! var o={}; ! for (var i in object) if(id!=i) o[i]=object[i]; ! object=o; ! } ! return object; ! }, ! True : function() {return true}, ! False : function() {return false}, ! Null : function() {}, ! Zero : function() {return 0;}, ! Allow : function() { ! event.cancelBubble = true; ! return true; ! }, ! Deny : function() { ! event.cancelBubble = false; ! return false; ! }, ! getImage : function(src,w,h) { ! img=(w!=null&&h!=null)? new Image(w,h) : new Image(); ! img.src=src; ! img.getHTML=dynapi._imageGetHTML; ! return img; ! }, ! getURLArguments : function(o) { // pass a string or frame/layer object ! var url,l={}; ! 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 l; ! var s = url.substring(url.indexOf('?')+1); ! var a = s.split('&'); ! for (var i=0;i<a.length;i++) { ! var b = a[i].split('='); ! l[b[0]] = unescape(b[1]); ! } ! return l; ! }, ! getAnchorLocation : function(a,lyr){ ! var o,x=0,y=0; ! if(lyr && !lyr.doc) lyr=null; ! lyr=(lyr)? lyr:{doc:document,elm:document}; ! if(typeof(a)=='string') { ! if(lyr.doc.all) a=lyr.doc.all[a]; ! else if(lyr.doc.getElementById) a=lyr.doc.getElementById(a); ! else if(lyr.doc.layers) a=lyr.doc.anchors[a]; ! } ! if(a) o=a; ! else return; ! if(lyr.doc.layers) { y+=o.y; x+=o.x;} ! else if(lyr.doc.getElementById || lyr.doc.all){ ! while (o.offsetParent && lyr.elm!=o){ ! x+= o.offsetLeft;y+= o.offsetTop; ! o = o.offsetParent; ! } ! } ! return {x:x,y:y,anchor:a}; ! } }; *************** *** 237,265 **** dPrint=function(s){var d=dynapi.debug; d.print(s)}; dynapi.debug.print = function(s) { ! //@IF:DEBUG[ ! if(s==null) s=''; ! dynapi._debugBuffer += s + '\n'; ! //]:DEBUG }; // The DynAPI library system is optional, this can be removed if you want to include other scripts manually function DynAPILibrary() { ! this.DynObject = DynObject; ! this.DynObject(); ! // list of js files: this.scripts['../src/api/dynlayer_ie.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/api/dynlayer_ie.js'] ! this.objects = {}; ! ! this._c = 0; ! this.loadList = []; ! this.loadIndex = -1; ! this.path = null; ! this.busy = true; }; p = dynapi.setPrototype('DynAPILibrary','DynObject'); --- 237,265 ---- dPrint=function(s){var d=dynapi.debug; d.print(s)}; dynapi.debug.print = function(s) { ! //@IF:DEBUG[ ! if(s==null) s=''; ! dynapi._debugBuffer += s + '\n'; ! //]:DEBUG }; // The DynAPI library system is optional, this can be removed if you want to include other scripts manually function DynAPILibrary() { ! this.DynObject = DynObject; ! this.DynObject(); ! // list of js files: this.scripts['../src/api/dynlayer_ie.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/api/dynlayer_ie.js'] ! this.objects = {}; ! ! this._c = 0; ! this.loadList = []; ! this.loadIndex = -1; ! this.path = null; ! this.busy = true; }; p = dynapi.setPrototype('DynAPILibrary','DynObject'); *************** *** 267,431 **** // can return a path specific to a package, eg. dynapi.library.getPath('dynapi.api') returns '/src/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,pkgFile) { ! 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 ! ! // load pkgFile or 'ext/packages.js' file ! var s='<script type="text/javascript" language="JavaScript" src="' ! +((pkgFile)? pkgFile:p+'ext/packages.js')+'"><\/script>'; ! document.write(s); }; // 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; ! 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.rdep = []; ! 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; }; // adds a dependency, whenever object "n" is loaded it will load object "d" beforehand p.addBefore = function(n, d) { ! var s = this.objects[n]; ! if (s && this.objects[d]) s.dep[s.dep.length] = d; }; // adds a reverse dependency, whenever object "n" is loaded it will load object "r" afterword p.addAfter = function(n, r) { ! var s = this.objects[n]; ! if (s && this.objects[r]) s.rdep[s.rdep.length] = r; }; // 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; ! // also include reverse deps ! if (s.rdep.length) list = this._queue(s.rdep, list, force); ! } ! } ! return list; }; // determines whether to queue the script this object is in 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() { ! var a = arguments; ! if (a[0]==true) a=a[1]; // arguments used ONLY by packages.js ! // buffer includes until packages(.js) are loaded ! if (!this._pakLoaded) { ! if(!this._buffer) this._buffer=[]; ! this._buffer[this._buffer.length]=a; ! return; ! } ! 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 type="text/javascript" language="JavaScript" src="'+src+'"><\/script>'); ! } ! } }; p.load = p.reload = p.loadScript = p.reloadScript = function(n) { ! dynapi.debug.print('Warning: dynapi.library load extensions not included'); }; dynapi.library = new DynAPILibrary(); --- 267,431 ---- // can return a path specific to a package, eg. dynapi.library.getPath('dynapi.api') returns '/src/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,pkgFile) { ! 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 ! ! // load pkgFile or 'ext/packages.js' file ! var s='<script type="text/javascript" language="JavaScript" src="' ! +((pkgFile)? pkgFile:p+'ext/packages.js')+'"><\/script>'; ! document.write(s); }; // 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; ! 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.rdep = []; ! 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; }; // adds a dependency, whenever object "n" is loaded it will load object "d" beforehand p.addBefore = function(n, d) { ! var s = this.objects[n]; ! if (s && this.objects[d]) s.dep[s.dep.length] = d; }; // adds a reverse dependency, whenever object "n" is loaded it will load object "r" afterword p.addAfter = function(n, r) { ! var s = this.objects[n]; ! if (s && this.objects[r]) s.rdep[s.rdep.length] = r; }; // 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; ! // also include reverse deps ! if (s.rdep.length) list = this._queue(s.rdep, list, force); ! } ! } ! return list; }; // determines whether to queue the script this object is in 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() { ! var a = arguments; ! if (a[0]==true) a=a[1]; // arguments used ONLY by packages.js ! // buffer includes until packages(.js) are loaded ! if (!this._pakLoaded) { ! if(!this._buffer) this._buffer=[]; ! this._buffer[this._buffer.length]=a; ! return; ! } ! 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 type="text/javascript" language="JavaScript" src="'+src+'"><\/script>'); ! } ! } }; p.load = p.reload = p.loadScript = p.reloadScript = function(n) { ! dynapi.debug.print('Warning: dynapi.library load extensions not included'); }; dynapi.library = new DynAPILibrary(); |
From: L W <war...@us...> - 2005-08-02 10:39:17
|
Update of /cvsroot/dynapi/dynapi3x/docs/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv942/docs/docs Modified Files: revision.html Log Message: Update revisions prior to tag and release. Index: revision.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/docs/docs/revision.html,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** revision.html 12 Oct 2003 19:58:13 -0000 1.38 --- revision.html 2 Aug 2005 10:39:08 -0000 1.39 *************** *** 37,43 **** [ - Bug Fix ] ! ! Version in CVS ! --------------------------- [*] Updated Documentation & Examples [*] Update quickrefs (See docs/docs/quickref.html) --- 37,42 ---- [ - Bug Fix ] ! Version 3.0.0-beta2 (2005-08-02) ! ---------------------------------- [*] Updated Documentation & Examples [*] Update quickrefs (See docs/docs/quickref.html) |
From: L W <war...@us...> - 2005-08-02 10:39:17
|
Update of /cvsroot/dynapi/dynapi3x/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv942/docs Modified Files: index.html Log Message: Update revisions prior to tag and release. Index: index.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/docs/index.html,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** index.html 12 Oct 2003 19:58:13 -0000 1.19 --- index.html 2 Aug 2005 10:39:08 -0000 1.20 *************** *** 35,39 **** <hr size="1" color="#C0C0C0"> ! <h3>Revised <i>2003.10.12</i></h3> <dl> --- 35,39 ---- <hr size="1" color="#C0C0C0"> ! <h3>Revised <i>2005-08-02</i></h3> <dl> *************** *** 45,57 **** <dl> ! <dt>Latest version: 3.0.0 (Beta 1)</dt> ! <dd>Please read <a href="changelog.html">3.0.0 ChangeLog</a> ! <dd><a href="http://dynapi.sourceforge.net/">dynapi.sourceforge.net</a></dd> </dl> </td> <td width="50%" valign="top"> <dl> ! <dt>Editors:</dt> ! <dd>Robert Rainwater<br> Dan Steinman<br> Raymond Irving<br> --- 45,57 ---- <dl> ! <dt>Latest version: 3.0.0 (Beta 2)</dt> ! <dd>Please read <a href="changelog.html">3.0.0 ChangeLog</a> ! <dd><a href="http://dynapi.sourceforge.net/">dynapi.sourceforge.net</a></dd> </dl> </td> <td width="50%" valign="top"> <dl> ! <dt>Editors:</dt> ! <dd>Robert Rainwater<br> Dan Steinman<br> Raymond Irving<br> *************** *** 82,100 **** Contents</h2> <ul class="toc"> ! <li class="tocline2"><a href="docs/whatsnew.html">What's New</a> / (<a href="changelog.html">ChangeLog</a>)</li> ! <li class="tocline2"><a href="docs/keyfeatures.html">Key Features</a></li> ! <li class="tocline2"><a href="docs/requirements.html">System Requirements</a></li> ! <li class="tocline2"><a href="docs/faq.html">Frequently Asked Questions</a></li> ! <li class="tocline2"><a href="docs/examples.html">Examples</a></li> ! <li class="tocline2"><a href="docs/quickref.html">Quick Reference</a></li> ! <li class="tocline2"><a href="docs/tipsticks.html">Tutorials, Tips & Tricks & Tools</a></li> ! <li class="tocline2"><a href="docs/troubleshoot.html">Testing & Troubleshooting</a></li> ! <li class="tocline2"><a href="docs/roadmap.html">Road Map</a></li> ! <li class="tocline2"><a href="docs/license.html">License Information</a></li> ! <li class="tocline2"><a href="docs/revision.html">Appendix A: Revision History</a></li> ! <li class="tocline2"><a href="docs/contributors.html">Appendix B: Acknowledgements</a></li> ! <li class="tocline2"> </li> </ul> --- 82,100 ---- Contents</h2> <ul class="toc"> ! <li class="tocline2"><a href="docs/whatsnew.html">What's New</a> / (<a href="changelog.html">ChangeLog</a>)</li> ! <li class="tocline2"><a href="docs/keyfeatures.html">Key Features</a></li> ! <li class="tocline2"><a href="docs/requirements.html">System Requirements</a></li> ! <li class="tocline2"><a href="docs/faq.html">Frequently Asked Questions</a></li> ! <li class="tocline2"><a href="docs/examples.html">Examples</a></li> ! <li class="tocline2"><a href="docs/quickref.html">Quick Reference</a></li> ! <li class="tocline2"><a href="docs/tipsticks.html">Tutorials, Tips & Tricks & Tools</a></li> ! <li class="tocline2"><a href="docs/troubleshoot.html">Testing & Troubleshooting</a></li> ! <li class="tocline2"><a href="docs/roadmap.html">Road Map</a></li> ! <li class="tocline2"><a href="docs/license.html">License Information</a></li> ! <li class="tocline2"><a href="docs/revision.html">Appendix A: Revision History</a></li> ! <li class="tocline2"><a href="docs/contributors.html">Appendix B: Acknowledgements</a></li> ! <li class="tocline2"> </li> </ul> |
From: Raymond I. <xw...@us...> - 2003-03-30 17:14:02
|
Update of /cvsroot/dynapi/dynapi3x/docs/docs In directory sc8-pr-cvs1:/tmp/cvs-serv11568/docs/docs Modified Files: examples.html quickref.dynlayer.html revision.html Log Message: uploaded by raymond - includes kevin's patches Index: examples.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/docs/docs/examples.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** examples.html 26 Mar 2003 02:22:30 -0000 1.8 --- examples.html 30 Mar 2003 17:13:21 -0000 1.9 *************** *** 38,41 **** --- 38,42 ---- <li><a href="../../examples/dynapi.api.dynlayer-destroy.html">Delete Layer</a> <li><a href="../../examples/dynapi.api.dynlayer-slide.html">Slide Layer</a> + <li><a href="../../examples/dynapi.api.dynlayer-blackboard.html">Blackboard</a> <li><a href="../../examples/dynapi.api.dynlayer-anchor.html">Anchor</a> <li><a href="../../examples/dynapi.api.dynlayer-anchor-anchoring.html">Anchor Index: quickref.dynlayer.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/docs/docs/quickref.dynlayer.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** quickref.dynlayer.html 26 Mar 2003 02:22:30 -0000 1.3 --- quickref.dynlayer.html 30 Mar 2003 17:13:22 -0000 1.4 *************** *** 25,28 **** --- 25,30 ---- <h2>Public Methods</h2> <dl> + <dt>enableBlackboard()</dt> + <dd>...</dd> <dt>getOuterHTML()</dt> <dd>...</dd> Index: revision.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/docs/docs/revision.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** revision.html 26 Mar 2003 03:04:04 -0000 1.10 --- revision.html 30 Mar 2003 17:13:22 -0000 1.11 *************** *** 41,44 **** --- 41,54 ---- --------------- [*] Update Examples + [*] DynKeyEvents now supports bubbling + [-] Fix IOElement & DataSource typos/bugs + [*] IOElementSoda now loads functions.Math libary + [+] Add getGUID() to functions.Math + [+] Add getRandomNumber(n) to functions.Math + [-] Fix setAnchor() resize bug + [*] Modify compiler - add "check semi-colon" button to the main screen + [+] Add enableBlackboard() function + > enableBlackboard() must be called before the layer is created or + > before the setHTML function if the layer has already been created [+] Add FocusManager [+] Add setDragMode(b,boundry) *************** *** 47,51 **** [+] Add onresize and onlocationchange events [+] Add Preserve Data Type (pDType) to Cookie constructure - Cookie(name,pDType) ! [+] Add Cookie.encode & Cookie.decode functions - useful for storing simple and complex objects and datatype. [+] Add removeAll() function to cookie object [*] Modify insertAllChildren() and insertChild() to support blueprints. --- 57,61 ---- [+] Add onresize and onlocationchange events [+] Add Preserve Data Type (pDType) to Cookie constructure - Cookie(name,pDType) ! [+] Add Cookie.encode & Cookie.decode functions - useful for storing simple and complex objects and datatype. [+] Add removeAll() function to cookie object [*] Modify insertAllChildren() and insertChild() to support blueprints. *************** *** 53,66 **** [*] Modify DynLayer files to use a common/base file [+] Add swiper animation class ! [*] Modify DynEvent Object - DynEvent should not be a DynObject. [+] Rename IOElementSODA, IOElementSYNC to IOElementSoda, IOElementSync respectively. [+] Add ImageClip to dynapi.gui - See ImageClip & Slide Show examples [+] Add fadeColor to dynapi.functions.Color - see Color Fade exmaple [+] Remove oncreate and onprecreate events, please use onCreate and onPrecreate instead ! [+] Add dictionary support to dynapi constructor [+] Add Fader Class - needs more testing in gecko browsers [-] Fix NS4/NS6 Drag event bug [*] Enhance inline layer support - inline layers/widgets can be created/automated before page loads ! [-] Fix DynLayerInline [*] Modify addChild() to addChild(c,alias,inlineID) [*] Modify setID() to setID(id,isInline,noImports) --- 63,76 ---- [*] Modify DynLayer files to use a common/base file [+] Add swiper animation class ! [*] Modify DynEvent Object - DynEvent should not be a DynObject. [+] Rename IOElementSODA, IOElementSYNC to IOElementSoda, IOElementSync respectively. [+] Add ImageClip to dynapi.gui - See ImageClip & Slide Show examples [+] Add fadeColor to dynapi.functions.Color - see Color Fade exmaple [+] Remove oncreate and onprecreate events, please use onCreate and onPrecreate instead ! [+] Add dictionary support to dynapi constructor [+] Add Fader Class - needs more testing in gecko browsers [-] Fix NS4/NS6 Drag event bug [*] Enhance inline layer support - inline layers/widgets can be created/automated before page loads ! [-] Fix DynLayerInline [*] Modify addChild() to addChild(c,alias,inlineID) [*] Modify setID() to setID(id,isInline,noImports) *************** *** 91,95 **** > This will cause only the slide functions to load when needed since DynLayer already offers a slideTo feature ! [+] Add generateLinePath() to functions.Math [*] Move dynapi.functions.getNormalizedAngle to dynapi.functions.Math [-] Fix HoverAnimation --- 101,105 ---- > This will cause only the slide functions to load when needed since DynLayer already offers a slideTo feature ! [+] Add generateLinePath() to functions.Math [*] Move dynapi.functions.getNormalizedAngle to dynapi.functions.Math [-] Fix HoverAnimation *************** *** 106,112 **** Version 3.0 Alpha (2.9.2) --------------------------- ! This version is a code fork from DynAPI 2.54, so some features and ! bug fixes in later versions may not be included in this version. ! This is definately not a drop in replacement for DynAPI 2.5x, a large amount of syntax has changed. See the <a href="../changelog.html">ChangeLog</a> for more information --- 116,122 ---- Version 3.0 Alpha (2.9.2) --------------------------- ! This version is a code fork from DynAPI 2.54, so some features and ! bug fixes in later versions may not be included in this version. ! This is definately not a drop in replacement for DynAPI 2.5x, a large amount of syntax has changed. See the <a href="../changelog.html">ChangeLog</a> for more information *************** *** 158,167 **** 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 --- 168,177 ---- 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 *************** *** 179,183 **** 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 --- 189,193 ---- 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 *************** *** 188,192 **** as little testing has been made as of yet. See the "INSTALL" file for more information. 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: --- 198,202 ---- as little testing has been made as of yet. See the "INSTALL" file for more information. 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: |
From: Raymond I. <xw...@us...> - 2003-03-30 17:14:02
|
Update of /cvsroot/dynapi/dynapi3x/src/ext In directory sc8-pr-cvs1:/tmp/cvs-serv11568/src/ext Modified Files: functions.math.js Log Message: uploaded by raymond - includes kevin's patches Index: functions.math.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/ext/functions.math.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** functions.math.js 21 Feb 2003 12:23:43 -0000 1.2 --- functions.math.js 30 Mar 2003 17:13:24 -0000 1.3 *************** *** 22,25 **** --- 22,43 ---- for (var i=0; i<361; i+=1) lcos[i]=Math.cos((i/180)*Math.PI); }; + f.getRandomNumber = function(n) { + var t=new Date(); + n=(n)? n: parseInt(Math.random()*10000); + return Math.round((Math.abs(Math.sin(t.getTime()))*(Math.random()*1000)))%n+1; + }; + f.getGUID = function() { // Globally Unique ID + var n1,n2,n3,n4; + var l,r,m,c=Math.random()+'' + c=c.substr(c.indexOf('.')+1); + m=(c.length-1)/2; + l=c.substr(0,m); r=c.substr(m); + n1=this.getRandomNumber(1000); + n2=this.getRandomNumber(255);n3=this.getRandomNumber(255);n4=this.getRandomNumber(255); + n2 = (n2 < 16 ? '0' : '') + n2.toString(16); + n3 = (n3 < 16 ? '0' : '') + n3.toString(16); + n4 = (n4 < 16 ? '0' : '') + n4.toString(16); + return (n1+n2+'-'+l+'-'+n3+n4+'-'+r).toUpperCase(); + }; // Path Functions ------------------------ |
From: Raymond I. <xw...@us...> - 2003-03-30 17:13:58
|
Update of /cvsroot/dynapi/dynapi3x/src/api/ext In directory sc8-pr-cvs1:/tmp/cvs-serv11568/src/api/ext Modified Files: dynkeyevent.js Log Message: uploaded by raymond - includes kevin's patches Index: dynkeyevent.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/ext/dynkeyevent.js,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** dynkeyevent.js 10 Feb 2003 22:35:54 -0000 1.1.1.1 --- dynkeyevent.js 30 Mar 2003 17:13:21 -0000 1.2 *************** *** 1 **** ! /* 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.DynEvent = DynEvent; this.DynEvent(); }; var p = dynapi.setPrototype('DynKeyEvent','DynEvent'); p.getKey=function() { return this.charKey; }; p.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._dynobj; if (!dynobject) return true; dynobject = dynobject._dyndoc; if (!dynobject) return true; if(dynapi.ua.def) { if (dynapi.ua.ie) var e=dynobject.frame.event; else if (e.eventPhase!=3) return false; e.cancelBubble=true; } if(dynapi.ua.def) var realsrc = MouseEvent._getContainerLayerOf(dynapi.ua.ie?e.srcElement:e.target)||dynobject; else if(dynapi.ua.ns4) var realsrc=e.target._dynobj; if (!realsrc) return false; var evt=DynKeyEvent._e evt.type=e.type evt.src=realsrc; evt.browserReturn=true; evt.bubble=true; evt.which=(dynapi.ua.ns4)?e.which:e.keyCode; var curKey = String.fromCharCode(evt.which).toLowerCase(); if (((curKey>='a')&&(curKey<='z'))||((curKey>='0')&&(curKey<='9'))) evt.charKey=curKey; evt.altKey=(dynapi.ua.ns4)? false:(e.altKey||e.altLeft||e.keyCode==18||e.keyCode==57388); evt.ctrlKey=(dynapi.ua.ns4)?(e.modifiers & Event.CONTROL_MASK):(e.ctrlKey||e.ctrlLeft||e.keyCode==17||e.keyCode==57391); evt.shiftKey=(dynapi.ua.ns4)?(e.modifiers & Event.SHIFT_MASK):(e.shiftKey||e.shiftLeft||e.keyCode==16||e.keyCode==57390); evt.orig=e; realsrc.invokeEvent(evt.type,evt); evt.bubbleEvent(); return evt.browserReturn; }; DynKeyEvent._e=new DynKeyEvent(); DynDocument.prototype.captureKeyEvents=function() { if(dynapi.ua.def && !dynapi.ua.ie) { this.doc.addEventListener("keydown",DynKeyEvent.EventMethod,false); this.doc.addEventListener("keyup",DynKeyEvent.EventMethod,false); this.doc.addEventListener("keypress",DynKeyEvent.EventMethod,false); } else { if (dynapi.ua.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(dynapi.ua.def&&!dynapi.ua.ie) { this.doc.removeEventListener("keydown",DynKeyEvent.EventMethod,false); this.doc.removeEventListener("keyup",DynKeyEvent.EventMethod,false); this.doc.removeEventListener("keypress",DynKeyEvent.EventMethod,false); } else { if (dynapi.ua.ns4) this.doc.releaseEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP); this.doc.onkeypress=this.doc.onkeydown=this.doc.onkeyup=null; } }; DynDocument.prototype.captureHotKey = function(key,fn){ var klst=((key+'').toLowerCase()).split('+'); klst.sort(); key=klst.join('+'); if(!this._hotKeys){ this._hotKeys={}; this._keyDn={}; this._keyLst=''; this.captureKeyEvents(); this.addEventListener({ onkeydown:function(e){ var k = e.which; var o = e.getSource(); // to-do: add opera v7 key code (57xxx), e.g 57388 if (k==13) k="enter"; else if(k==27) k="esc"; else if(k==45) k="inert"; else if(k==46) k="delete"; else if(k==36) k="home"; else if(k==35) k="end"; else if(k==33) k="pgup"; else if(k==34) k="pgdn"; else if(k==38) k="up"; else if(k==40) k="down"; else if(k==37) k="left"; else if(k==39) k="right"; else if(e.altKey && !o._keyDn['alt']) k="alt"; else if(e.ctrlKey && !o._keyDn['ctrl']) k="ctrl"; else if(e.shiftKey && !o._keyDn['shift']) k="shift"; else k=(String.fromCharCode(k)).toLowerCase(); if(!o._keyDn[k]) { // store new key in keyDn array o._keyLst+=(((o._keyLst)? '+':'')+k); // build key list var ar=o._keyLst.split('+'); ar.sort(); o._keyLst=ar.join('+'); o._keyDn[k]=true; } k=o._hotKeys[o._keyLst]; if(k){ o._keyLst='';o._keyDn={}; if(typeof(k)=='string') return eval(k); else return k(); } }, onkeyup:function(e){ var o=e.getSource(); o._keyLst='';o._keyDn={}; } }); } this._hotKeys[key]=fn; }; DynDocument.prototype.releaseHotKey = function(key){ if(this._hotKeys) delete(this._hotKeys[key]); }; DynLayer.prototype.captureKeyEvents=function() { if(!this.elm) return; if(dynapi.ua.def&&!dynapi.ua.ie) { this.elm.addEventListener("keydown",DynKeyEvent.EventMethod,false); this.elm.addEventListener("keyup",DynKeyEvent.EventMethod,false); this.elm.addEventListener("keypress",DynKeyEvent.EventMethod,false); } else { if (dynapi.ua.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(dynapi.ua.def&&!dynapi.ua.ie) { this.elm.removeEventListener("keydown",DynKeyEvent.EventMethod,false); this.elm.removeEventListener("keyup",DynKeyEvent.EventMethod,false); this.elm.removeEventListener("keypress",DynKeyEvent.EventMethod,false); } else { if (dynapi.ua.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._hasMouseEvents) 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._hasMouseEvents && 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._hasMouseEvents) this.releaseKeyEvents(); return r; }; DynObject.prototype._OldK_removeAllEventListeners = DynObject.prototype.removeAllEventListeners; DynObject.prototype.removeAllEventListeners = function() { var r = this._OldK_removeAllEventListeners(); this.releaseKeyEvents(); return r; }; \ No newline at end of file --- 1 ---- ! /* DynAPI Distribution Key Event Extensions by Henrik Våglin (hv...@ya...) The DynAPI Distribution is distributed under the terms of the GNU LGPL license. requires: Dynlayer */ function DynKeyEvent(type,src) { this.DynEvent = DynEvent; this.DynEvent(type,src); this.charKey=null; this.bubble=true; }; var p = dynapi.setPrototype('DynKeyEvent','DynEvent'); p.getKey=function() { return this.charKey; }; //p.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._getContainerLayerOf = function(element) { if (!element) return null; while (!element._dynobj && element.parentNode && element.parentNode!=element) element = element.parentNode; return element._dynobj; }; //DynKeyEvent.EventMethod = function(e) { DynKeyEvent._eventListener = function(e) { var dynobject=this._dynobj; if (!dynobject) return true; // dynobject = dynobject._dyndoc; // if (!dynobject) return true; var dyndoc = dynobject.doc._dynobj; if (!dyndoc) return true; if(dynapi.ua.def) { // if (dynapi.ua.ie) var e=dynobject.frame.event; if (dynapi.ua.ie) var e=dyndoc.frame.event; else if (e.eventPhase!=3) return false; e.cancelBubble=true; } // if(dynapi.ua.def) var realsrc = MouseEvent._getContainerLayerOf(dynapi.ua.ie?e.srcElement:e.target)||dynobject; if(dynapi.ua.def) var realsrc = DynKeyEvent._getContainerLayerOf(dynapi.ua.ie?e.srcElement:e.target)||dynobject; else if(dynapi.ua.ns4) var realsrc=e.target._dynobj; if (!realsrc) return false; // var evt=DynKeyEvent._e // evt.type=e.type // evt.src=realsrc; // evt.browserReturn=true; // evt.bubble=true; var evt=new DynKeyEvent(e.type,realsrc); evt.which=(dynapi.ua.ns4)?e.which:e.keyCode; var curKey = String.fromCharCode(evt.which).toLowerCase(); if (((curKey>='a')&&(curKey<='z'))||((curKey>='0')&&(curKey<='9'))) evt.charKey=curKey; evt.altKey=(dynapi.ua.ns4)? false:(e.altKey||e.altLeft||e.keyCode==18||e.keyCode==57388); evt.ctrlKey=(dynapi.ua.ns4)?(e.modifiers & Event.CONTROL_MASK):(e.ctrlKey||e.ctrlLeft||e.keyCode==17||e.keyCode==57391); evt.shiftKey=(dynapi.ua.ns4)?(e.modifiers & Event.SHIFT_MASK):(e.shiftKey||e.shiftLeft||e.keyCode==16||e.keyCode==57390); // evt.orig=e; realsrc.invokeEvent(evt.type,evt); // evt.bubbleEvent(); // return evt.browserReturn; return evt.defaultValue; }; //DynKeyEvent._e=new DynKeyEvent(); //DynDocument.prototype.captureKeyEvents=function() { DynElement.prototype.captureKeyEvents=function() { var elm=(this.getClassName()=='DynLayer')?this.elm:this.doc; if(!elm) return; this._hasKeyEvents=true; if(dynapi.ua.def && !dynapi.ua.ie) { // this.doc.addEventListener("keydown",DynKeyEvent.EventMethod,false); // this.doc.addEventListener("keyup",DynKeyEvent.EventMethod,false); // this.doc.addEventListener("keypress",DynKeyEvent.EventMethod,false); elm.addEventListener("keydown",DynKeyEvent._eventListener,false); elm.addEventListener("keyup",DynKeyEvent._eventListener,false); elm.addEventListener("keypress",DynKeyEvent._eventListener,false); } else { // if (dynapi.ua.ns4) this.doc.captureEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP); // this.doc.onkeypress=this.doc.onkeydown=this.doc.onkeyup=DynKeyEvent.EventMethod; if (dynapi.ua.ns4) elm.captureEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP); elm.onkeypress=elm.onkeydown=elm.onkeyup=DynKeyEvent._eventListener; } }; //DynDocument.prototype.releaseKeyEvents=function() { DynElement.prototype.releaseKeyEvents=function() { var elm=(this.getClassName()=='DynLayer')?this.elm:this.doc; if(!elm) return; this._hasKeyEvents=false; if(dynapi.ua.def&&!dynapi.ua.ie) { // this.doc.removeEventListener("keydown",DynKeyEvent.EventMethod,false); // this.doc.removeEventListener("keyup",DynKeyEvent.EventMethod,false); // this.doc.removeEventListener("keypress",DynKeyEvent.EventMethod,false); elm.removeEventListener("keydown",DynKeyEvent._eventListener,false); elm.removeEventListener("keyup",DynKeyEvent._eventListener,false); elm.removeEventListener("keypress",DynKeyEvent._eventListener,false); } else { // if (dynapi.ua.ns4) this.doc.releaseEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP); // this.doc.onkeypress=this.doc.onkeydown=this.doc.onkeyup=null; if (dynapi.ua.ns4) elm.releaseEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP); elm.onkeypress=elm.onkeydown=elm.onkeyup=null; } }; DynDocument.prototype.captureHotKey = function(key,fn){ var klst=((key+'').toLowerCase()).split('+'); klst.sort(); key=klst.join('+'); if(!this._hotKeys){ this._hotKeys={}; this._keyDn={}; this._keyLst=''; this.captureKeyEvents(); this.addEventListener({ onkeydown:function(e){ var k = e.which; var o = e.getSource(); // to-do: add opera v7 key code (57xxx), e.g 57388 if (k==13) k="enter"; else if(k==27) k="esc"; else if(k==45) k="insert"; else if(k==46) k="delete"; else if(k==36) k="home"; else if(k==35) k="end"; else if(k==33) k="pgup"; else if(k==34) k="pgdn"; else if(k==38) k="up"; else if(k==40) k="down"; else if(k==37) k="left"; else if(k==39) k="right"; else if(e.altKey && !o._keyDn['alt']) k="alt"; else if(e.ctrlKey && !o._keyDn['ctrl']) k="ctrl"; else if(e.shiftKey && !o._keyDn['shift']) k="shift"; else k=(String.fromCharCode(k)).toLowerCase(); if(!o._keyDn[k]) { // store new key in keyDn array o._keyLst+=(((o._keyLst)? '+':'')+k); // build key list var ar=o._keyLst.split('+'); ar.sort(); o._keyLst=ar.join('+'); o._keyDn[k]=true; } k=o._hotKeys[o._keyLst]; if(k){ o._keyLst='';o._keyDn={}; if(typeof(k)=='string') return eval(k); else return k(); } }, onkeyup:function(e){ var o=e.getSource(); o._keyLst='';o._keyDn={}; } }); } this._hotKeys[key]=fn; }; DynDocument.prototype.releaseHotKey = function(key){ if(this._hotKeys) delete this._hotKeys[key]; }; //DynLayer.prototype.captureKeyEvents=function() { // if(!this.elm) return; // if(dynapi.ua.def&&!dynapi.ua.ie) { // this.elm.addEventListener("keydown",DynKeyEvent.EventMethod,false); // this.elm.addEventListener("keyup",DynKeyEvent.EventMethod,false); // this.elm.addEventListener("keypress",DynKeyEvent.EventMethod,false); // } // else { // if (dynapi.ua.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(dynapi.ua.def&&!dynapi.ua.ie) { // this.elm.removeEventListener("keydown",DynKeyEvent.EventMethod,false); // this.elm.removeEventListener("keyup",DynKeyEvent.EventMethod,false); // this.elm.removeEventListener("keypress",DynKeyEvent.EventMethod,false); // } // else { // if (dynapi.ua.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._hasMouseEvents) 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._hasMouseEvents && 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._hasMouseEvents) this.releaseKeyEvents(); // return r; //}; //DynObject.prototype._OldK_removeAllEventListeners = DynObject.prototype.removeAllEventListeners; //DynObject.prototype.removeAllEventListeners = function() { // var r = this._OldK_removeAllEventListeners(); // this.releaseKeyEvents(); // return r; //}; \ No newline at end of file |
From: Raymond I. <xw...@us...> - 2003-03-30 17:13:58
|
Update of /cvsroot/dynapi/dynapi3x/src/api In directory sc8-pr-cvs1:/tmp/cvs-serv11568/src/api Modified Files: dyndocument.js dynlayer_base.js dynlayer_dom.js dynlayer_ie.js dynlayer_ns4.js dynlayer_opera.js event.js mouse_dom.js mouse_ie.js mouse_ns4.js Log Message: uploaded by raymond - includes kevin's patches Index: dyndocument.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/dyndocument.js,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** dyndocument.js 26 Mar 2003 02:22:31 -0000 1.6 --- dyndocument.js 30 Mar 2003 17:13:18 -0000 1.7 *************** *** 21,25 **** var o = this; this.frame.onresize = function() {o._handleResize()}; ! this.onResizeNS4 = "reload" // or "redraw" this.fgColor = this.doc.fgColor||''; this.bgColor = this.doc.bgColor||''; --- 21,25 ---- var o = this; this.frame.onresize = function() {o._handleResize()}; ! this.onResizeNS4 = "reload"; // or "redraw" this.fgColor = this.doc.fgColor||''; this.bgColor = this.doc.bgColor||''; *************** *** 27,33 **** }; var p = dynapi.setPrototype('DynDocument','DynElement'); - p.getBgColor = function() { - return this.bgColor; - }; p._remove = function() { this.elm=null; --- 27,30 ---- *************** *** 35,38 **** --- 32,38 ---- this.frame=null; }; + p.getBgColor = function() { + return this.bgColor; + }; p.getX = p.getY = p.getPageX = p.getPageY = dynapi.functions.Zero; p.getWidth = function() { *************** *** 116,120 **** // create divs object - speeds up DOM browsers on Win32. Linux & Mac? if (ua.ie||ua.dom) { ! divs={} var dv,all=(ua.ie||ua.opera)? document.all.tags('div') : document.getElementsByTagName('div'); var i=0,l=all.length; // very important! --- 116,120 ---- // create divs object - speeds up DOM browsers on Win32. Linux & Mac? if (ua.ie||ua.dom) { ! divs={}; var dv,all=(ua.ie||ua.opera)? document.all.tags('div') : document.getElementsByTagName('div'); var i=0,l=all.length; // very important! Index: dynlayer_base.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/dynlayer_base.js,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dynlayer_base.js 26 Mar 2003 02:22:31 -0000 1.1 --- dynlayer_base.js 30 Mar 2003 17:13:19 -0000 1.2 *************** *** 121,124 **** --- 121,125 ---- var i,ch=this.children; if (this.html!=null) s+=this.html; + if (this._blkBoardElm) s=('<div id="'+this.id+'_blkboard">'+s+'</div>'); for (i=0;i<ch.length;i++) s+=ch[i].getOuterHTML(); return s; *************** *** 156,160 **** if (ch) this.h = h<0? 0 : h; if (cw||ch) { ! if (this._updateAnchors) this._updateAnchors(); if (this.css) { if (cw) this.css.width = this.w||0; --- 157,162 ---- if (ch) this.h = h<0? 0 : h; if (cw||ch) { ! if (this._hasAnchor) this.updateAnchor(); // update this anchor ! if (this._hasChildAnchors) this._updateAnchors(); // update child anchors if (this.css) { if (cw) this.css.width = this.w||0; *************** *** 197,201 **** 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) { --- 199,204 ---- if (anchor == null) { delete this._saveAnchor; ! if (this.parent && this.parent._childAnchors && this.parent._childAnchors[this.id]) delete this.parent._childAnchors[this.id]; ! this._hasAnchor = false; } else if (this.parent) { *************** *** 204,207 **** --- 207,211 ---- a[this.id] = anchor; this.parent._updateAnchor(this.id); + this._hasAnchor = this.parent._hasChildAnchors = true; } else this._saveAnchor = anchor; Index: dynlayer_dom.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/dynlayer_dom.js,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dynlayer_dom.js 26 Mar 2003 02:22:31 -0000 1.5 --- dynlayer_dom.js 30 Mar 2003 17:13:19 -0000 1.6 *************** *** 36,39 **** --- 36,40 ---- dlyr.elm._dynobj = dlyr; dlyr._dyndoc = dlyr.parent._dyndoc; + if(dlyr._blkBoardElm) dlyr._blkBoardElm = (divs)? divs[dlyr.id+'_blkboard'] : dlyr.parent.doc.getElementById(dlyr.id+'_blkboard'); if (dlyr.z) dlyr.css.zIndex = dlyr.z; *************** *** 53,56 **** --- 54,70 ---- }; + p.enableBlackboard = function(){ + if (!this._created) this._blkBoardElm=true; + else if(!this._blkBoardElm){ + var r,ptxt; + var h='',elm = this.elm; + if(this.html!=null) h=this.html; + r = elm.ownerDocument.createRange(); + r.setStartBefore(elm); + ptxt = r.createContextualFragment('<div id="'+this.id+'_blkboard">'+h+'</div>'); + elm.appendChild(ptxt); + this._blkBoardElm = elm.lastChild; + } + }; p.setLocation=function(x,y) { var cx = (x!=null && x!=this.x); *************** *** 62,65 **** --- 76,80 ---- if (cy) this.css.top = this.y+"px"; } + if(this._hasLocationEvents) this.invokeEvent('locationchange'); return (cx||cy); }; *************** *** 75,85 **** 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); } } --- 90,102 ---- this.html = html; if (this.css) { + var elm = (this._blkBoardElm)? this._blkBoardElm:this.elm; + elm.innerHTML = html; var sTmp=(this.w==null)?'<NOBR>'+this.html+'</NOBR>':this.html; ! while (elm.hasChildNodes()) elm.removeChild(elm.firstChild); ! var r=elm.ownerDocument.createRange(); ! r.selectNodeContents(elm); r.collapse(true); var df=r.createContextualFragment(sTmp); ! elm.appendChild(df); } } *************** *** 87,91 **** }; p.setTextSelectable=function(b) { ! this._textSelectable = b if(!this._hasMouseEvents) this.captureMouseEvents(); if (!b) this.setCursor('default'); --- 104,108 ---- }; p.setTextSelectable=function(b) { ! this._textSelectable = b; if(!this._hasMouseEvents) this.captureMouseEvents(); if (!b) this.setCursor('default'); Index: dynlayer_ie.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/dynlayer_ie.js,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** dynlayer_ie.js 26 Mar 2003 02:22:31 -0000 1.6 --- dynlayer_ie.js 30 Mar 2003 17:13:19 -0000 1.7 *************** *** 29,33 **** elm.style.backgroundColor=(this.bgColor||'transparent'); elm.style.zIndex=(this.z||1); ! elm.style.cursor=(this._cursor||'auto') elm.style.overflow=(this._overflow!=null)? 'hidden':''; if(this.bgImage!=null) elm.style.backgroundImage='url('+this.bgImage+')'; --- 29,33 ---- elm.style.backgroundColor=(this.bgColor||'transparent'); elm.style.zIndex=(this.z||1); ! elm.style.cursor=(this._cursor||'auto'); elm.style.overflow=(this._overflow!=null)? 'hidden':''; if(this.bgImage!=null) elm.style.backgroundImage='url('+this.bgImage+')'; *************** *** 53,56 **** --- 53,57 ---- dlyr.elm._dynobj = dlyr; dlyr._dyndoc = dlyr.parent._dyndoc; + if(dlyr._blkBoardElm) dlyr._blkBoardElm = (divs)? divs[dlyr.id+'_blkboard'] : dlyr.parent.elm.all[dlyr.id+'_blkboard']; if (dlyr.html!=null && dlyr.html!='' && (dlyr.w==null || dlyr.h==null)) { *************** *** 73,76 **** --- 74,86 ---- }; + p.enableBlackboard = function(){ + if (!this._created) this._blkBoardElm=true; + else if(!this._blkBoardElm){ + var h='',elm = this.elm; + if(this.html!=null) h=this.html; + elm.insertAdjacentHTML("beforeEnd",'<div id="'+this.id+'_blkboard">'+h+'</div>'); + this._blkBoardElm = elm.children[elm.children.length-1]; + } + }; p.setLocation=function(x,y) { var cx = (x!=null && x!=this.x); *************** *** 98,121 **** return this.setLocation(x,y); }; - 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._updateAnchors) this._updateAnchors(); - 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 (this.updateLayout) this.updateLayout(); - } - } - return (cw||ch); - }; p.setHTML = function(html) { if (html!=this.html) { this.html = html; ! if (this.css) this.elm.innerHTML = html; } if(this._hasContentEvents) this.invokeEvent('contentchange'); --- 108,118 ---- return this.setLocation(x,y); }; p.setHTML = function(html) { if (html!=this.html) { this.html = html; ! if (this.css) { ! var elm = (this._blkBoardElm)? this._blkBoardElm:this.elm; ! elm.innerHTML = html; ! } } if(this._hasContentEvents) this.invokeEvent('contentchange'); Index: dynlayer_ns4.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/dynlayer_ns4.js,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dynlayer_ns4.js 26 Mar 2003 02:22:31 -0000 1.5 --- dynlayer_ns4.js 30 Mar 2003 17:13:19 -0000 1.6 *************** *** 65,68 **** --- 65,72 ---- dlyr.elm._dynobj = dlyr; // ??? dlyr._dyndoc = dlyr.parent._dyndoc; + if(dlyr._blkBoardElm) { + dlyr._blkBoardElm = elm.document.layers[dlyr.id+'_blkboard']; + dlyr.doc = dlyr._blkBoardElm; // useful for <forms> + } if (dlyr.html!=null && dlyr.html!='' && (dlyr.w==null || dlyr.h==null)) { *************** *** 103,109 **** --- 107,130 ---- else s+=this.html; } + if (this._blkBoardElm) s=('<layer id="'+this.id+'_blkboard">'+s+'</layer>'); for (i=0;i<this.children.length;i++) s+=this.children[i].getOuterHTML(); return s; }; + p.enableBlackboard = function(){ + if (!this._created) this._blkBoardElm=true; + else if(!this._blkBoardElm){ + var c,i,h='',elm = this.elm; + if(this.html!=null) h=this.html; + var parentElement = this.parent.isClass('DynLayer')? this.parent.elm : this.parent.frame; + var elm = this._blkBoardElm = new Layer(0, elm); + elm.document.write(h); + elm.document.close(); + elm.visibility = 'inherit'; + for (i=0;i<this.children.length;i++){ + c=this.children[i]; + c.css.zIndex=c.css.zIndex; // reset zindex + } + } + }; p.setLocation = function(x,y) { var cx = (x!=null && x!=this.x); *************** *** 187,191 **** if (ch) this.h = h<0? 0 : h; if (cw||ch) { ! if (this._updateAnchors) this._updateAnchors(); if (this.css) { if (cw) this.css.clip.width = this.w || 0; --- 208,213 ---- if (ch) this.h = h<0? 0 : h; if (cw||ch) { ! if (this._hasAnchor) this.updateAnchor(); // update this anchor ! if (this._hasChildAnchors) this._updateAnchors(); // update child anchors if (this.css) { if (cw) this.css.clip.width = this.w || 0; *************** *** 202,211 **** this.html = html; if (this.css) { ! this.doc.open(); ! this.doc.write(this.html); ! this.doc.close(); var i; ! for (i=0;i<this.doc.images.length;i++) this.doc.images[i]._dynobj = this; ! for (i=0;i<this.doc.links.length;i++) this.doc.links[i]._dynobj = this; } } --- 224,234 ---- this.html = html; if (this.css) { ! var doc = (this._blkBoardElm)? this._blkBoardElm.document:this.doc; ! doc.open(); ! doc.write(this.html); ! doc.close(); var i; ! for (i=0;i<doc.images.length;i++) doc.images[i]._dynobj = this; ! for (i=0;i<doc.links.length;i++) doc.links[i]._dynobj = this; } } *************** *** 213,217 **** }; p.setTextSelectable=function(b) { ! this._textSelectable = b this.addEventListener({ onmousemove : function(e) { --- 236,240 ---- }; p.setTextSelectable=function(b) { ! this._textSelectable = b; this.addEventListener({ onmousemove : function(e) { Index: dynlayer_opera.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/dynlayer_opera.js,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dynlayer_opera.js 26 Mar 2003 02:22:31 -0000 1.5 --- dynlayer_opera.js 30 Mar 2003 17:13:19 -0000 1.6 *************** *** 41,44 **** --- 41,45 ---- dlyr.elm._dynobj = dlyr; dlyr._dyndoc = dlyr.parent._dyndoc; + if(dlyr._blkBoardElm) dlyr._blkBoardElm = (divs)? divs[dlyr.id+'_blkboard'] : dlyr.parent.doc.getElementById(dlyr.id+'_blkboard'); if (dlyr.html!=null && dlyr.html!='' && (dlyr.w==null || dlyr.h==null)) { *************** *** 57,60 **** --- 58,70 ---- if (dlyr._hasKeyEvents) dlyr.captureKeyEvents(); }; + p.enableBlackboard = function(){ + if (!this._created) this._blkBoardElm=true; + else if(!this._blkBoardElm){ + var h='',elm = this.elm; + if(this.html!=null) h=this.html; + elm.insertAdjacentHTML("beforeEnd",'<div id="'+this.id+'_blkboard">'+h+'</div>'); + this._blkBoardElm = elm.children[elm.children.length-1]; + } + }; p.setLocation=function(x,y) { var cx = (x!=null && x!=this.x); *************** *** 85,94 **** if (html!=this.html) { this.html = html; ! if (this.css) this.elm.innerHTML = html; } if(this._hasContentEvents) this.invokeEvent('contentchange'); }; p.setTextSelectable=function(b) { ! this._textSelectable = b if (this.elm) this.elm.onselectstart = b? dynapi.functions.Allow : dynapi.functions.Deny; if (!b) this.setCursor('default'); --- 95,107 ---- if (html!=this.html) { this.html = html; ! if (this.css) { ! var elm = (this._blkBoardElm)? this._blkBoardElm:this.elm; ! elm.innerHTML = html; ! } } if(this._hasContentEvents) this.invokeEvent('contentchange'); }; p.setTextSelectable=function(b) { ! this._textSelectable = b; if (this.elm) this.elm.onselectstart = b? dynapi.functions.Allow : dynapi.functions.Deny; if (!b) this.setCursor('default'); Index: event.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/event.js,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** event.js 26 Mar 2003 02:22:31 -0000 1.5 --- event.js 30 Mar 2003 17:13:20 -0000 1.6 *************** *** 27,31 **** this.DynObject(); this._listeners = []; ! } EventObject._SubClass={}; --- 27,31 ---- this.DynObject(); this._listeners = []; ! }; EventObject._SubClass={}; *************** *** 49,58 **** else this._hasMouseEvents = true; } ! if (this.captureKeyEvents) { ! if (this._created && !this._hasKeyEvents && (el.onkeydown || el.onkeyup || el.keypress)) { ! this.captureKeyEvents(); ! } ! else this._hasKeyEvents = true; ! } } }; --- 49,54 ---- else this._hasMouseEvents = true; } ! if (this.captureKeyEvents) ! if (this._created && !this._hasKeyEvents && (el.onkeydown || el.onkeyup || el.onkeypress)) this.captureKeyEvents(); } }; *************** *** 97,101 **** var cls=EventObject._SubClass; if(typeof(fn)=='function') cls[ek]=fn; ! else if(!fn && cls[ek]) delete(cls[ek]) }; --- 93,97 ---- var cls=EventObject._SubClass; if(typeof(fn)=='function') cls[ek]=fn; ! else if(!fn && cls[ek]) delete cls[ek]; }; *************** *** 134,137 **** --- 130,134 ---- if (c._saveAnchor) { c.setAnchor(c._saveAnchor); + c._saveAnchor = null; delete c._saveAnchor; } *************** *** 179,183 **** p._create = p._createInLine = p._createInserted = p._remove = p._delete = p._destroy = dynapi.functions.Null; ! p.getChildren = function() {return this.children} p.getAllChildren = function() { var ret = []; --- 176,180 ---- p._create = p._createInLine = p._createInserted = p._remove = p._delete = p._destroy = dynapi.functions.Null; ! p.getChildren = function() {return this.children}; p.getAllChildren = function() { var ret = []; *************** *** 189,193 **** for(var j in temp) ret[j] = temp[j]; } ! return ret }; p.getParents = function(l) { --- 186,190 ---- for(var j in temp) ret[j] = temp[j]; } ! return ret; }; p.getParents = function(l) { *************** *** 306,311 **** --- 303,312 ---- if(padX) {x=(x)? x:0;x+=padX} if(padY) {y=(y)? y:0;y+=padY} + + var tmp=dlyr._hasAnchor; + dlyr._hasAnchor=false; // ignore anchor updates of this layer if(x!=null||y!=null) dlyr.setLocation(x,y); if(w!=null||h!=null) dlyr.setSize(w,h); + dlyr._hasAnchor = tmp; // useful for preventing stack overflow }; p._updateAnchors = function() { Index: mouse_dom.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/mouse_dom.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** mouse_dom.js 25 Feb 2003 21:38:20 -0000 1.2 --- mouse_dom.js 30 Mar 2003 17:13:20 -0000 1.3 *************** *** 125,128 **** }; ! function main() { dynapi.document._mouseEvent = new MouseEvent(dynapi.document);} if (!dynapi.loaded) main(); --- 125,130 ---- }; ! function main() { ! dynapi.document._mouseEvent = new MouseEvent(dynapi.document); ! }; if (!dynapi.loaded) main(); Index: mouse_ie.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/mouse_ie.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** mouse_ie.js 25 Feb 2003 21:38:20 -0000 1.2 --- mouse_ie.js 30 Mar 2003 17:13:20 -0000 1.3 *************** *** 116,119 **** }; ! function main() { dynapi.document._mouseEvent = new MouseEvent(dynapi.document); } if (!dynapi.loaded) main(); --- 116,121 ---- }; ! function main() { ! dynapi.document._mouseEvent = new MouseEvent(dynapi.document); ! }; if (!dynapi.loaded) main(); Index: mouse_ns4.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/api/mouse_ns4.js,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mouse_ns4.js 25 Feb 2003 21:45:17 -0000 1.3 --- mouse_ns4.js 30 Mar 2003 17:13:20 -0000 1.4 *************** *** 1 **** ! /* DynAPI Distribution MouseEvent Class The DynAPI Distribution is distributed under the terms of the GNU LGPL license. requires: dynapi.api.DynDocument */ function MouseEvent(dyndoc) { this.DynEvent = DynEvent; this.DynEvent(); this.bubble = true; this._browserEvent = null; this._relative = null; this._dyndoc = dyndoc; }; 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 = dynapi.functions.Null; p.getRelative = function() {return this._relative}; p.getButton = function() { if (!this._browserEvent) return "left"; var b = this._browserEvent.which; if (b==2) return "middle"; if (b==3) return "right"; else return "left"; }; p._init = function(type,e,src) { this.type = type; this._browserEvent = e; this.origin = src; this.bubbleChild = null; this.pageX = e.pageX-this._dyndoc.frame.pageXOffset; this.pageY = e.pageY-this._dyndoc.frame.pageYOffset; if (e.target._dynobj == src) { this.x = e.layerX; this.y = e.layerY; } else { this.x = e.pageX - (src.pageX||0); this.y = e.pageY - (src.pageY||0); } this.defaultValue = true; this.bubble = true; }; p._invoke = function() { var o = this.origin; //if (this.type=='mousedown' && o._textSelectable==false) this.defaultValue = false; o.invokeEvent(this.type,this); // synthetic click event if (this.type=='mouseup') { this._init('click',this._browserEvent,o); this._invoke(); // synthetic dblclick event if (dynapi.ua.other); } }; function main() { dynapi.document._mouseEvent = new MouseEvent(dynapi.document); } if (!dynapi.loaded) main(); MouseEvent._docMoveHandler = function(e) { var dyndoc = this._dynobj; var src = e.target; var dynobj = src._dynobj || src._dynobji; if (!dynobj) { dyndoc._moveOver = null; return true; } var me = dyndoc._mouseEvent; //dynapi.debug.status('move '+dynobj.name+' '+e.layerX+' '+e.layerY); me._init('mousemove',e,dynobj); me._invoke(); var defaultVal = me.defaultValue; // synthetic mouseover/out events if (dyndoc._moveOver!=dynobj) { var rel = dyndoc._moveOver; var bubble = true; // mouse out if (rel) { // && !rel.isChildOf(dynobj) // during mouseout e.getRelated() is which elm it is moving to //bubble = !dynobj.isChildOf(rel); me._init('mouseout',e,rel); me._relative = dynobj; me._invoke(); //MouseEvent._generateEvent('mouseout',e,me,rel,dynobj,bubble); // out occurs before over } // mouse over dyndoc._moveOver = dynobj; //if (rel) var bubble = !rel.isChildOf(dynobj); //var bubble = !dynobj.isChildOf(rel); // during mouseover e.getRelated() is which elm it is moving to me._init('mouseover',e,dynobj); me._relative = rel; me._invoke(); //MouseEvent._generateEvent('mouseover',e,me,dynobj,rel); } return defaultVal; } MouseEvent._eventHandler = function(e) { var src = e.target; var dynobj = this._dynobj; if (!dynobj) return true; var dyndoc = dynobj._dyndoc; var me = dyndoc._mouseEvent; me._wasHandled = false; var r = routeEvent(e); if (!me._wasHandled) { //if (src._dynobji) { // src._dynobji == dynlayer.doc.images[x]._dynobji // me._init(e.type,e,src._dynobji); // if (e.type=='mousedown') me.defaultValue = false; // me._invoke(); //} // else if (src._dynobj) { // src._dynobj == dynlayer.doc._dynobj,dynlayer.doc.images[x]._dynobj,dynlayer.doc.links[x]._dynobj me._init(e.type,e,src._dynobj); me._invoke(); } else { // dynobj == dynlayer.elm._dynobj me._init(e.type,e,dynobj); me._invoke(); } me._wasHandled = true; } dynobj = (src._dynobj)? src._dynobj:dynobj; // prevent image dragging if (e.type=='mousedown' && (e.target+'')=='[object Image]') { me.defaultValue=false; } // disable text select if (e.type=='mousedown' && dynobj._textSelectable==false) { // ns4 will disable hyperlinks. this is my workaround me.defaultValue =(e.target.href)? null:false; } return me.defaultValue; }; DynElement.prototype.captureMouseEvents = function() { this._hasMouseEvents = true; var elm = this.elm; if (elm) { elm.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.DBLCLICK); elm.onmousedown = elm.onmouseup = elm.ondblclick = MouseEvent._eventHandler; if (this.getClassName()=='DynDocument') { // move/over/out events are generated from the document this.doc.captureEvents(Event.MOUSEMOVE); elm.onmousemove = MouseEvent._docMoveHandler; } elm._dynobj = this; this.doc._dynobj = this; for (var i=0;i<this.doc.images.length;i++) this.doc.images[i]._dynobj=this; // was _dynobji for (var i=0;i<this.doc.links.length;i++) this.doc.links[i]._dynobj=this; } }; DynElement.prototype.releaseMouseEvents = function() { this._hasMouseEvents = false; var elm = this.elm; if (elm) { elm.releaseEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.DBLCLICK); elm.onmousedown = elm.onmouseup = elm.ondblclick = null; if (this.getClassName()=='DynDocument') { elm.releaseEvents(Event.MOUSEMOVE); elm.onmousemove = null; } elm._dynobj = null; this.doc._dynobj = null; for (var i=0;i<this.doc.images.length;i++) this.doc.images[i]._dynobji=null; for (var i=0;i<this.doc.links.length;i++) this.doc.links[i]._dynobj=null; } }; \ No newline at end of file --- 1 ---- ! /* DynAPI Distribution MouseEvent Class The DynAPI Distribution is distributed under the terms of the GNU LGPL license. requires: dynapi.api.DynDocument */ function MouseEvent(dyndoc) { this.DynEvent = DynEvent; this.DynEvent(); this.bubble = true; this._browserEvent = null; this._relative = null; this._dyndoc = dyndoc; }; 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 = dynapi.functions.Null; p.getRelative = function() {return this._relative}; p.getButton = function() { if (!this._browserEvent) return "left"; var b = this._browserEvent.which; if (b==2) return "middle"; if (b==3) return "right"; else return "left"; }; p._init = function(type,e,src) { this.type = type; this._browserEvent = e; this.origin = src; this.bubbleChild = null; this.pageX = e.pageX-this._dyndoc.frame.pageXOffset; this.pageY = e.pageY-this._dyndoc.frame.pageYOffset; if (e.target._dynobj == src) { this.x = e.layerX; this.y = e.layerY; } else { this.x = e.pageX - (src.pageX||0); this.y = e.pageY - (src.pageY||0); } this.defaultValue = true; this.bubble = true; }; p._invoke = function() { var o = this.origin; //if (this.type=='mousedown' && o._textSelectable==false) this.defaultValue = false; o.invokeEvent(this.type,this); // synthetic click event if (this.type=='mouseup') { this._init('click',this._browserEvent,o); this._invoke(); // synthetic dblclick event if (dynapi.ua.other); } }; function main() { dynapi.document._mouseEvent = new MouseEvent(dynapi.document); }; if (!dynapi.loaded) main(); MouseEvent._docMoveHandler = function(e) { var dyndoc = this._dynobj; var src = e.target; var dynobj = src._dynobj || src._dynobji; if (!dynobj) { dyndoc._moveOver = null; return true; } var me = dyndoc._mouseEvent; //dynapi.debug.status('move '+dynobj.name+' '+e.layerX+' '+e.layerY); me._init('mousemove',e,dynobj); me._invoke(); var defaultVal = me.defaultValue; // synthetic mouseover/out events if (dyndoc._moveOver!=dynobj) { var rel = dyndoc._moveOver; var bubble = true; // mouse out if (rel) { // && !rel.isChildOf(dynobj) // during mouseout e.getRelated() is which elm it is moving to //bubble = !dynobj.isChildOf(rel); me._init('mouseout',e,rel); me._relative = dynobj; me._invoke(); //MouseEvent._generateEvent('mouseout',e,me,rel,dynobj,bubble); // out occurs before over } // mouse over dyndoc._moveOver = dynobj; //if (rel) var bubble = !rel.isChildOf(dynobj); //var bubble = !dynobj.isChildOf(rel); // during mouseover e.getRelated() is which elm it is moving to me._init('mouseover',e,dynobj); me._relative = rel; me._invoke(); //MouseEvent._generateEvent('mouseover',e,me,dynobj,rel); } return defaultVal; }; MouseEvent._eventHandler = function(e) { var src = e.target; var dynobj = this._dynobj; if (!dynobj) return true; var dyndoc = dynobj._dyndoc; var me = dyndoc._mouseEvent; me._wasHandled = false; var r = routeEvent(e); if (!me._wasHandled) { //if (src._dynobji) { // src._dynobji == dynlayer.doc.images[x]._dynobji // me._init(e.type,e,src._dynobji); // if (e.type=='mousedown') me.defaultValue = false; // me._invoke(); //} // else if (src._dynobj) { // src._dynobj == dynlayer.doc._dynobj,dynlayer.doc.images[x]._dynobj,dynlayer.doc.links[x]._dynobj me._init(e.type,e,src._dynobj); me._invoke(); } else { // dynobj == dynlayer.elm._dynobj me._init(e.type,e,dynobj); me._invoke(); } me._wasHandled = true; } dynobj = (src._dynobj)? src._dynobj:dynobj; // prevent image dragging if (e.type=='mousedown' && (e.target+'')=='[object Image]') { me.defaultValue=false; } // disable text select if (e.type=='mousedown' && dynobj._textSelectable==false) { // ns4 will disable hyperlinks. this is my workaround me.defaultValue =(e.target.href)? null:false; } return me.defaultValue; }; DynElement.prototype.captureMouseEvents = function() { this._hasMouseEvents = true; var elm = this.elm; if (elm) { elm.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.DBLCLICK); elm.onmousedown = elm.onmouseup = elm.ondblclick = MouseEvent._eventHandler; if (this.getClassName()=='DynDocument') { // move/over/out events are generated from the document this.doc.captureEvents(Event.MOUSEMOVE); elm.onmousemove = MouseEvent._docMoveHandler; } elm._dynobj = this; this.doc._dynobj = this; for (var i=0;i<this.doc.images.length;i++) this.doc.images[i]._dynobj=this; // was _dynobji for (var i=0;i<this.doc.links.length;i++) this.doc.links[i]._dynobj=this; } }; DynElement.prototype.releaseMouseEvents = function() { this._hasMouseEvents = false; var elm = this.elm; if (elm) { elm.releaseEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.DBLCLICK); elm.onmousedown = elm.onmouseup = elm.ondblclick = null; if (this.getClassName()=='DynDocument') { elm.releaseEvents(Event.MOUSEMOVE); elm.onmousemove = null; } elm._dynobj = null; this.doc._dynobj = null; for (var i=0;i<this.doc.images.length;i++) this.doc.images[i]._dynobji=null; for (var i=0;i<this.doc.links.length;i++) this.doc.links[i]._dynobj=null; } }; \ No newline at end of file |
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); } |
From: Raymond I. <xw...@us...> - 2003-03-30 17:13:55
|
Update of /cvsroot/dynapi/dynapi3x/src In directory sc8-pr-cvs1:/tmp/cvs-serv11568/src Modified Files: dynapi.js Log Message: uploaded by raymond - includes kevin's patches Index: dynapi.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/dynapi.js,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** dynapi.js 26 Mar 2003 02:22:30 -0000 1.9 --- dynapi.js 30 Mar 2003 17:13:17 -0000 1.10 *************** *** 264,268 **** this.path = null; this.busy = true; ! } p = dynapi.setPrototype('DynAPILibrary','DynObject'); --- 264,268 ---- this.path = null; this.busy = true; ! }; p = dynapi.setPrototype('DynAPILibrary','DynObject'); *************** *** 302,306 **** // DynLayer ! this.add('dynapi.api.DynLayerBase','dynlayer_base.js','DynDocument') if (dynapi.ua.ns4) this.add('dynapi.api.DynLayer','dynlayer_ns4.js','DynLayerBase'); else if (dynapi.ua.ie) this.add('dynapi.api.DynLayer','dynlayer_ie.js','DynLayerBase'); --- 302,306 ---- // DynLayer ! this.add('dynapi.api.DynLayerBase','dynlayer_base.js','DynDocument'); if (dynapi.ua.ns4) this.add('dynapi.api.DynLayer','dynlayer_ns4.js','DynLayerBase'); else if (dynapi.ua.ie) this.add('dynapi.api.DynLayer','dynlayer_ie.js','DynLayerBase'); *************** *** 343,347 **** this.add('dynapi.util.Cookie','cookie.js'); this.add('dynapi.util.IOElement','ioelement.js','DynLayer'); ! this.add('dynapi.util.IOElementSoda','ioelement.soda.js','IOElement'); this.add('dynapi.util.IOElementSync','ioelement.sync.js','IOElement'); this.add('dynapi.util.DataSource','datasource.js','IOElement'); --- 343,347 ---- this.add('dynapi.util.Cookie','cookie.js'); this.add('dynapi.util.IOElement','ioelement.js','DynLayer'); ! this.add('dynapi.util.IOElementSoda','ioelement.soda.js',['Math','IOElement']); this.add('dynapi.util.IOElementSync','ioelement.sync.js','IOElement'); this.add('dynapi.util.DataSource','datasource.js','IOElement'); |
From: Raymond I. <xw...@us...> - 2003-03-30 17:13:51
|
Update of /cvsroot/dynapi/dynapi3x/bin In directory sc8-pr-cvs1:/tmp/cvs-serv11568/bin Modified Files: compiler.js dcompiler.html Log Message: uploaded by raymond - includes kevin's patches Index: compiler.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/bin/compiler.js,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** compiler.js 10 Feb 2003 22:35:26 -0000 1.1.1.1 --- compiler.js 30 Mar 2003 17:13:15 -0000 1.2 *************** *** 19,24 **** var jsCLastCompressedSize = 0; ! //Compiles or Compresses the select dynapi source folder ! function compile() { var f=document.frmcompiler; --- 19,25 ---- var jsCLastCompressedSize = 0; ! // Compiles or Compresses the select dynapi source folder ! // When check==true compiler will check dynapi files in source folder for missing semi-colons ! function compile(check) { var f=document.frmcompiler; *************** *** 27,31 **** jsFileIndex = -1; ! jsCLevel = f.cbolevel.value; jsCDebug = f.chkdebug.checked; jsCNS4 = f.chkns4.checked; --- 28,33 ---- jsFileIndex = -1; ! jsCCheck = check; ! jsCLevel = (jsCCheck)? 'low':f.cbolevel.value; jsCDebug = f.chkdebug.checked; jsCNS4 = f.chkns4.checked; *************** *** 61,67 **** document.images['bar'].style.width="1%"; CompressNextFile(); }; - // CompressNextFile: Compresses one file at a time using the crunch() function (compressor.js) function CompressNextFile(state,strText){ --- 63,69 ---- document.images['bar'].style.width="1%"; CompressNextFile(); + showScreen(jsCCheck); }; // CompressNextFile: Compresses one file at a time using the crunch() function (compressor.js) function CompressNextFile(state,strText){ *************** *** 76,82 **** f.txtstatus.value='Compiling ['+jsCLastFileName+'] - '+strText; ! }else{ ! // Save compressed data if(state=="complete"){ if(jsCLevel!='none' && (jsCLastFileName+'').toLowerCase()=='dynapi.js') { strText='// The DynAPI Distribution is distributed under the terms of the GNU LGPL license.\n' --- 78,109 ---- f.txtstatus.value='Compiling ['+jsCLastFileName+'] - '+strText; ! } ! else{ ! if (jsCCheck && state=="complete"){ ! // Check file for semi-colon errors ! // a much better error checking system is needed here ! var t='',l,exclude='{},;'; ! var ar = strText.split('\n'); ! for(var i=0;i<ar.length;i++){ ! l=strTrim(ar[i]); ! if (l && l.length){ ! ok=false; ! ch=l.substr(l.length-1,1); ! if(ar[i]!='}' && exclude.indexOf(ch)>=0) ok=true ! if(!ok){ ! l=l.replace(/</g,'<'); ! l=l.replace(/>/g,'>'); ! t+=' Line: '+(i+1)+': '+l+'<br>' ! +' File: '+jsCLastFile+'<br><br>'; ! } ! } ! } ! if(t){ ! var dv=document.all['dvscreen']; ! dv.innerHTML=dv.innerHTML+t+"<hr>"; ! } ! } if(state=="complete"){ + // Save compressed data if(jsCLevel!='none' && (jsCLastFileName+'').toLowerCase()=='dynapi.js') { strText='// The DynAPI Distribution is distributed under the terms of the GNU LGPL license.\n' *************** *** 125,129 **** Crunch(content,jsCLevel,CompressNextFile); ! }else { // finished compressing js files --- 152,157 ---- Crunch(content,jsCLevel,CompressNextFile); ! } ! else { // finished compressing js files *************** *** 171,172 **** --- 199,228 ---- return t.join(''); } + + + // Misc functions + + function showScreen(b){ + var dv=document.all['dvscreen']; + dv.innerHTML=''; + dv=document.all['dvscreenrow']; + if(b) dv.style.display='block'; + else dv.style.display='none'; + + } + + function showHideAbout() { + var dv=document.all['dvabout']; + if(dv.style.display=='block') dv.style.display='none'; + else dv.style.display='block'; + } + + function strTrim(s,dir){ + if(!s) return; + else s+=''; // make sure s is a string + dir=(dir)? dir:'<>'; + if(dir=='<'||dir=='<>') s=s.replace(/^(\s+)/g,''); + if(dir=='>'||dir=='<>') s=s.replace(/(\s+)$/g,''); + return s; + + }; \ No newline at end of file Index: dcompiler.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/bin/dcompiler.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** dcompiler.html 10 Feb 2003 22:35:26 -0000 1.1.1.1 --- dcompiler.html 30 Mar 2003 17:13:15 -0000 1.2 *************** *** 14,29 **** </tr> <tr> ! <td valign="top" width="100%"> ! <table border="0" width="100%" cellpadding="2" cellspacing="1"> <tr> ! <td width="25%"><font size="2" face="Arial">Compression Level:<br> ! </font><select size="1" name="cbolevel" style="width: 177; height: 23"> <option value="high" selected>High</option> <option value="low">Low</option> <option value="none">None</option> </select></td> ! <td width="36%"><font size="2" face="Arial">Source Path<br> <input type="text" name="txtsource" size="20" style="width: 100%"></font></td> ! <td width="39%"><font size="2" face="Arial">Destination Path<br> <input type="text" name="txttarget" size="20" style="width: 100%"> </font></td> --- 14,40 ---- </tr> <tr> ! <td valign="top" width="100%" align="right"> ! <table border="0" width="100%"> <tr> ! <td width="50%"><font size="2" face="Arial">Compression Level:<br> ! </font><select size="1" name="cbolevel" style="width: 98%; height: 23"> <option value="high" selected>High</option> <option value="low">Low</option> <option value="none">None</option> </select></td> ! <td width="50%"><a href="javascript:;" onclick="showHideAbout()" style="text-decoration:none;font-family: Arial"><img border="0" src="dc_icon.gif" width="32" height="32" align="absmiddle"> ! <b><font size="4" color="#000080">About DynAPI ! Compiler</font></b></a><b><font size="4" color="#000080"><a style="text-decoration: none; font-family: Arial"> </a></font></b></td> ! </tr> ! </table> ! </td> ! </tr> ! <tr> ! <td valign="top" width="100%"> ! <table border="0" width="100%" cellpadding="2" cellspacing="1"> ! <tr> ! <td width="50%"><font size="2" face="Arial">Source Path<br> <input type="text" name="txtsource" size="20" style="width: 100%"></font></td> ! <td width="50%"><font size="2" face="Arial">Destination Path<br> <input type="text" name="txttarget" size="20" style="width: 100%"> </font></td> *************** *** 85,89 **** <tr> <td width="100%" align="right"> ! <input language="javascript" type="button" value="Compile" name="cmdcompile" onclick="compile()"> </td> </tr> --- 96,101 ---- <tr> <td width="100%" align="right"> ! <input language="javascript" type="button" value="Check semi-colons" name="cmdtrace" onclick="compile(true)"> ! <input language="javascript" type="button" value="Compile" name="cmdcompile" onclick="compile()"> </td> </tr> *************** *** 94,109 **** </td> </tr> ! <tr> <td bgcolor="#D6D3CE" valign="top" width="100%"> <table border="0" style="font-family: Arial; font-size: 10pt; border-style: inset; border-width: 2" cellspacing="1" cellpadding="2"> <tr> <td bgcolor="#FFFFFF" valign="top"> - <table border="0" width="100%"> - <tr> - <td width="6%"><img border="0" src="dc_icon.gif" width="32" height="32" align="absmiddle"></td> - <td width="94%"><b><font size="4" color="#0099CC">About DynAPI - Compiler 1.0</font></b></td> - </tr> - </table> <p>The DynAPI Compiler is used to compress the DynAPI source code by removing comments, white spaces, etc from the source files. --- 106,115 ---- </td> </tr> ! <tr id="dvscreenrow" style="display:none"><td bgcolor="#FFFFFF" style="font-family: Arial; border-style: inset; border-width: 2"><div id="dvscreen"></div></td></tr> ! <tr id="dvabout" style="display:none"> <td bgcolor="#D6D3CE" valign="top" width="100%"> <table border="0" style="font-family: Arial; font-size: 10pt; border-style: inset; border-width: 2" cellspacing="1" cellpadding="2"> <tr> <td bgcolor="#FFFFFF" valign="top"> <p>The DynAPI Compiler is used to compress the DynAPI source code by removing comments, white spaces, etc from the source files. *************** *** 166,172 **** </table> </form> - <p> </p> - <p> </p> - <p> </p> - <p> </p> </body> --- 172,174 ---- |
From: Raymond I. <xw...@us...> - 2003-03-30 17:13:51
|
Update of /cvsroot/dynapi/dynapi3x/src/util In directory sc8-pr-cvs1:/tmp/cvs-serv11568/src/util Modified Files: datasource.js ioelement.js ioelement.soda.js Log Message: uploaded by raymond - includes kevin's patches Index: datasource.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/util/datasource.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** datasource.js 10 Mar 2003 03:31:20 -0000 1.2 --- datasource.js 30 Mar 2003 17:13:15 -0000 1.3 *************** *** 13,17 **** this.EventObject(); ! this.clsid=IOElement.createGUID(); DataSource.all[this.clsid]=this; --- 13,17 ---- this.EventObject(); ! this.clsid=dynapi.functions.getGUID(); DataSource.all[this.clsid]=this; *************** *** 83,89 **** if(act=='fetchpage') this._ticket=this.webservice.call(act,[this.pageNumber,this.pageSize,params.pageType],fn,cargo); else this._ticket=this.webservice.call(act,[this.rowIndex,data],fn,cargo); ! }else if(this.webservice && this.wsSync) { // Web Service - Sync ! if(act=='fetcpage') r=this.webservice.call(act,[this.pageNumber,this.pageSize,params.pageType],false); else r=this.webservice.call(act,[this.rowIndex,data],false); if(r.error) this.invokeEvent('alert',null,'DataSource: '+r.error.text); --- 83,90 ---- if(act=='fetchpage') this._ticket=this.webservice.call(act,[this.pageNumber,this.pageSize,params.pageType],fn,cargo); else this._ticket=this.webservice.call(act,[this.rowIndex,data],fn,cargo); ! } ! else if(this.webservice && this.wsSync) { // Web Service - Sync ! if(act=='fetchpage') r=this.webservice.call(act,[this.pageNumber,this.pageSize,params.pageType],false); else r=this.webservice.call(act,[this.rowIndex,data],false); if(r.error) this.invokeEvent('alert',null,'DataSource: '+r.error.text); *************** *** 93,97 **** DataSource.fnProcessResponse(cargo,data); } ! }else { // HTTP GET & POST - Async fn=DataSource.fnGETPOSTResponse; --- 94,99 ---- DataSource.fnProcessResponse(cargo,data); } ! } ! else { // HTTP GET & POST - Async fn=DataSource.fnGETPOSTResponse; Index: ioelement.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/util/ioelement.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ioelement.js 10 Mar 2003 03:31:20 -0000 1.2 --- ioelement.js 30 Mar 2003 17:13:16 -0000 1.3 *************** *** 37,41 **** if(useXFrames && dynapi.ua.ns4) { this._winXFrames=window.open("about:blank",null,'left=3000,top=3000,width=100,height=100,scrollbars=no,status=no,toolbar=no'); ! this._winXFrames.blur(); // hide the newly window } --- 37,45 ---- if(useXFrames && dynapi.ua.ns4) { this._winXFrames=window.open("about:blank",null,'left=3000,top=3000,width=100,height=100,scrollbars=no,status=no,toolbar=no'); ! this._winXFrames.blur(); // hide the new window ! var wxf=this._winXFrames; ! dynapi.onUnload(function() { // tidy up ! if(wxf.open && !wxf.closed) wxf.close(); ! }); } *************** *** 54,58 **** var t,r=['*'],html=[]; if (this._hidden) { ! if (this._winXFrames) html = ['<frame src="about:blank" name="',o._elmID,'" scrolling="none">']; else if (dynapi.ua.ns4) html = ['<ilayer name="',this._elmID,'" visibility="hide" width=0 height=0></ilayer>']; else html = ['<iframe name="',this._elmID,'" style="width:0px; height:0px; visibility:hidden"></iframe>']; --- 58,62 ---- var t,r=['*'],html=[]; if (this._hidden) { ! if (this._winXFrames) html = ['<frame src="about:blank" name="',this._elmID,'" scrolling="none">']; else if (dynapi.ua.ns4) html = ['<ilayer name="',this._elmID,'" visibility="hide" width=0 height=0></ilayer>']; else html = ['<iframe name="',this._elmID,'" style="width:0px; height:0px; visibility:hidden"></iframe>']; *************** *** 71,75 **** }else{ if (this._winXFrames) t = '<frame src="about:blank" name="',this._elmID,'" scrolling="none">'; ! else if (dynapi.ua.ns4) t = '<layer width='+this.w+' height='+this.h+' name="'+this._elmID+'" visibility="inherit"></ilayer>'; else t = '<iframe name="'+this._elmID+'" width='+this.w+' height='+this.h+' scrolling="no" frameborder="no" marginwidth=0 marginheight=0 style="overflow:hidden;"></iframe>'; this._elmThread=this._elmID; this._elmBusy[this._elmID]=false; --- 75,79 ---- }else{ if (this._winXFrames) t = '<frame src="about:blank" name="',this._elmID,'" scrolling="none">'; ! else if (dynapi.ua.ns4) t = '<ilayer width='+this.w+' height='+this.h+' name="'+this._elmID+'" visibility="inherit"></ilayer>'; else t = '<iframe name="'+this._elmID+'" width='+this.w+' height='+this.h+' scrolling="no" frameborder="no" marginwidth=0 marginheight=0 style="overflow:hidden;"></iframe>'; this._elmThread=this._elmID; this._elmBusy[this._elmID]=false; *************** *** 87,93 **** this._winXFrames.top.IOElement=IOElement; } ! }; IOElement.fnCreate = function() { ! if (this._SyncFn) window.setTimeout(o+'._initSync()',100); if (this.getScope()) { if (this._requestList.length>0) { --- 91,97 ---- this._winXFrames.top.IOElement=IOElement; } ! }; IOElement.fnCreate = function() { ! if (this._SyncFn) window.setTimeout(this+'._initSync()',100); if (this.getScope()) { if (this._requestList.length>0) { *************** *** 132,136 **** if(req){ this._elmBusy[req[4]]=false; ! delete(this._requests[id]); this._clearScope(); return true; --- 136,140 ---- if(req){ this._elmBusy[req[4]]=false; ! delete this._requests[id]; this._clearScope(); return true; *************** *** 217,221 **** url += (url.indexOf('?')==-1)? '?' : '&'; ! url += 'IORequestID='+id+'&IOElementID='+this.id+'&IOMethod='+method;; t=this+'._notify("'+id+'","'+url+'",false)'; --- 221,225 ---- url += (url.indexOf('?')==-1)? '?' : '&'; ! url += 'IORequestID='+id+'&IOElementID='+this.id+'&IOMethod='+method; t=this+'._notify("'+id+'","'+url+'",false)'; *************** *** 226,230 **** r[5] = window.setTimeout(t,this.failTime); ! if (method=="get" || (dynapi.ua.ns4 && !this._ns4Frames)) { if (data) { for (i in data) { --- 230,238 ---- r[5] = window.setTimeout(t,this.failTime); ! // reset document - this will help to prevent cross-domain access errors ! if (dynapi.ua.ns4) elm.src = 'about:blank'; ! else elm.document.location.href = 'about:blank'; ! ! if (method=="get" || (dynapi.ua.ns4 && !this._winXFrames)) { if (data) { for (i in data) { *************** *** 267,273 **** // begin transaction - data sent but awaiting reply // to-do work on a way to detech if caller is in the same domain as ! elm.document._tranState="begin"; ! if(!dynapi.ua.ns4) this._monitorTransactions(); ! this.invokeEvent("request"); } --- 275,282 ---- // begin transaction - data sent but awaiting reply // to-do work on a way to detech if caller is in the same domain as ! if(!dynapi.ua.ns4) { ! elm.document._tranState="begin"; ! this._monitorTransactions(); ! } this.invokeEvent("request"); } *************** *** 313,317 **** var s = (success!=null)? success : true; // delete transaction record ! delete(this._transactions[id]); if (!this._elmBusy[req[4]] && success) { dynapi.debug.print('IOElement Error: '+id+' '+this._elmID+' '+url); --- 322,326 ---- var s = (success!=null)? success : true; // delete transaction record ! delete this._transactions[id]; if (!this._elmBusy[req[4]] && success) { dynapi.debug.print('IOElement Error: '+id+' '+this._elmID+' '+url); *************** *** 336,340 **** } this._cargoID=''; ! if(s && id!=this._retryID) delete(this._requests[id]); else this._clearScope(); this._elmBusy[req[4]] = false; --- 345,349 ---- } this._cargoID=''; ! if(s && id!=this._retryID) delete this._requests[id]; else this._clearScope(); this._elmBusy[req[4]] = false; *************** *** 346,367 **** }; // Helper Methods ------------------------- - IOElement._Randomize = function(n) { - var t=new Date(); - return Math.round((Math.abs(Math.sin(t.getTime()))*(Math.random()*1000)))%n+1; - }; - IOElement._DecToHex = function(val){ - var 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); - }; - IOElement.createGUID = function() { - var l,r,m,n,c=Math.random()+'' - c=c.substr(c.indexOf('.')+1); - m=(c.length-1)/2; - l=c.substr(0,m); r=c.substr(m); - n=this._Randomize(1000)+this._DecToHex(this._Randomize(255))+'-' - +l+'-'+this._DecToHex(this._Randomize(255))+this._DecToHex(this._Randomize(255))+'-'+r; - return n; - }; IOElement.getAbsoluteUrl=function(url, docUrl) { // inspired by afroAPI urlToAbs() if(url && url.indexOf('://')>0) return url; --- 355,358 ---- Index: ioelement.soda.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/util/ioelement.soda.js,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ioelement.soda.js 10 Mar 2003 03:31:21 -0000 1.3 --- ioelement.soda.js 30 Mar 2003 17:13:16 -0000 1.4 *************** *** 5,9 **** The DynAPI Distribution is distributed under the terms of the GNU LGPL license. ! requires: dynapi.util.IOElement */ --- 5,9 ---- The DynAPI Distribution is distributed under the terms of the GNU LGPL license. ! requires: Math, IOElement */ *************** *** 23,27 **** o=this[name]={}; method=(method+'').toLowerCase(); ! o.sid=IOE.createGUID(); o._callback=fn; o._name=name; --- 23,27 ---- o=this[name]={}; method=(method+'').toLowerCase(); ! o.sid=dynapi.functions.getGUID(); o._callback=fn; o._name=name; *************** *** 87,91 **** var o,r,c,ws,et; ! if(!e||(e && !e.DynObject)) { // sync o=ws=this; --- 87,91 ---- var o,r,c,ws,et; ! if(!e||(e && e.constructor!=DynEvent)) { // sync o=ws=this; *************** *** 114,118 **** o.isConnected=s; } ! o._callback(ws,s,et); }; --- 114,118 ---- o.isConnected=s; } ! if (o._callback) o._callback(ws,s,et); }; |
From: Raymond I. <xw...@us...> - 2003-03-26 03:04:08
|
Update of /cvsroot/dynapi/dynapi3x/docs/docs In directory sc8-pr-cvs1:/tmp/cvs-serv21780/docs/docs Modified Files: revision.html Log Message: updated by raymond Index: revision.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/docs/docs/revision.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** revision.html 26 Mar 2003 02:22:30 -0000 1.9 --- revision.html 26 Mar 2003 03:04:04 -0000 1.10 *************** *** 51,54 **** --- 51,55 ---- [*] Modify insertAllChildren() and insertChild() to support blueprints. [+] Add generateBlueprint() to DynLayer Inline + [*] Modify DynLayer files to use a common/base file [+] Add swiper animation class [*] Modify DynEvent Object - DynEvent should not be a DynObject. |
From: Raymond I. <xw...@us...> - 2003-03-26 02:22:35
|
Update of /cvsroot/dynapi/dynapi3x/src/util In directory sc8-pr-cvs1:/tmp/cvs-serv6593/src/util Modified Files: cookie.js Log Message: updated/added by raymond Index: cookie.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/src/util/cookie.js,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** cookie.js 10 Feb 2003 22:35:59 -0000 1.1.1.1 --- cookie.js 26 Mar 2003 02:22:31 -0000 1.2 *************** *** 10,15 **** var c = new Cookie('mycookieset'); ! c.set('name','MyName'); // re-saves cookie each time a value is added ! c.add('array',[1,2,3]); var c = new Cookie('mycookieset'); // auto-retrieves saved cookie object --- 10,14 ---- var c = new Cookie('mycookieset'); ! c.add('array',[1,2,3]); // re-saves cookie each time a value is added var c = new Cookie('mycookieset'); // auto-retrieves saved cookie object *************** *** 21,32 **** */ ! function Cookie(name) { ! this.DynObject = DynObject; this.DynObject(); - this.name = name; this.data = {}; this.exists = false; var c = dynapi.functions.getCookie(this.name); if (c) { --- 20,32 ---- */ ! ! function Cookie(name,pDType) { this.DynObject = DynObject; this.DynObject(); this.data = {}; + this.name = name; this.exists = false; + this._pdt=pDType; var c = dynapi.functions.getCookie(this.name); if (c) { *************** *** 34,41 **** var a = c.split(','); var x,n,v; ! for (var i=0;i<a.length;a++) { x = a[i].split('='); n = x[0]; ! v = x[1]; if (n && v) this.data[n] = v; } --- 34,41 ---- var a = c.split(','); var x,n,v; ! for (var i=0;i<a.length;i++) { x = a[i].split('='); n = x[0]; ! v = Cookie.decode(x[1]); if (n && v) this.data[n] = v; } *************** *** 44,48 **** } else this._save(); ! } var p = dynapi.setPrototype('Cookie','DynObject'); p.get = function(name) { --- 44,113 ---- } else this._save(); ! }; ! // to-do: replace escape(),unescape() with better encoding functions ! Cookie.decode = function(t,_lvl){ ! var dt = (t+'').substring(0,2); ! if(isNaN(_lvl)) _lvl=0; else _lvl++; ! if(dt=='a[') { //array ! t=t.substring(2,t.length-1); ! t=t.split('\\'+_lvl); ! for(var i=0;i<t.length;i++) t[i]=Cookie.decode(t[i],_lvl); ! } ! else if(dt=='o[') { //object ! var a,n,v; ! t=t.substring(2,t.length-1); ! a=t.split('\\'+_lvl); ! t={}; ! for(var i=0;i<a.length;i++) { ! n=a[i].substring(0,a[i].indexOf(':')); ! if(n) v=a[i].substring(n.length+1); ! else v=null; ! t[n]=Cookie.decode(v,_lvl); ! } ! } ! else if(dt=='n[') { //number:float, integer ! t=parseFloat(t.substring(2,t.length-1)); ! } ! else if(dt=='d[') { //date ! t=new Date(unescape(t.substring(2,t.length-1))); ! } ! else if(dt=='b[') { //boolean ! t=(t.substring(2,t.length-1)=="1")? true:false; ! } ! else if(dt=='u[') { //null ! t=null; ! } ! else{ //string ! t=unescape(t); ! } ! return t; ! }; ! // to-do: replace escape(),unescape() with better encoding functions ! Cookie.encode = function(t,pDType,_lvl){ ! if (!pDType) t=escape(t); ! if (t==null) t='u[]'; ! else if(typeof(t)=='number') t='n['+t+']'; ! else if(typeof(t)=='boolean') t='b['+((t)? 1:0)+']'; ! else if(typeof(t)!='object') t=escape(t); ! else { ! if(isNaN(_lvl)) _lvl=0; else _lvl++; ! if(t.constructor==Date) t='d['+escape(t)+']'; ! else if(t.constructor==Array){ ! //encode array = a[n1\0n2...\0nN] ! var a=[]; ! for(var i=0;i<t.length;i++) a[i]=Cookie.encode(t[i],pDType); ! t='a['+a.join('\\'+_lvl)+']'; ! } ! else { ! //encode object = o[name1:value1\0name2:value2...\0nameN:valueN] ! var a=[]; ! for(var i in t){ ! a[a.length]=(i+':'+Cookie.encode(t[i],pDType,_lvl)); ! } ! t='o['+a.join('\\'+_lvl)+']'; ! } ! } ! return t; ! }; var p = dynapi.setPrototype('Cookie','DynObject'); p.get = function(name) { *************** *** 61,64 **** --- 126,133 ---- this._save(); }; + p.removeAll = function(){ + this.data = {}; + this._save(); + }; p.setExpires = function(days) { this.expires = days; *************** *** 71,75 **** for (var i in this.data) { var v = this.data[i]; ! if (v) s += i + '=' + escape(v) + ','; } s = s.substring(0,s.length-1); --- 140,144 ---- for (var i in this.data) { var v = this.data[i]; ! if (v) s += i + '=' + Cookie.encode(v,this._pdt) + ','; } s = s.substring(0,s.length-1); *************** *** 91,97 **** 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); --- 160,166 ---- dynapi.functions.getCookie = function(name) { var nameEQ = name+"="; ! var c,ca = dynapi.frame.document.cookie.split(';'); for(var i=0;i<ca.length;i++) { ! 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); |