Menu

#259 small bug & fix in debug.js and debug.html

open
nobody
None
5
2014-04-14
2005-09-01
ksj
No

I found a small "bug" with the debugger when I use
absolute path for dynapi.library.path, such as below:

dynapi.library.setPath\('/dynapi/src/'\);

The symptom is that you get "page does not exist" error
when you try to open the debugger.

The following 2 modifications can fix this problem:

1. In debug.js, find the code for opening the debugger
and use the dynapi.documentPath only if the
dynapi.library.path is not an absolute path:

-------------------------------------------------
// opens the debugger window
p.open = function() {
var p = dynapi.library.path;
if (!this.isLoaded() && p) {
var url;
var s = new String(p);
if( s.substr(0,1)== '/')
url = p
+ 'ext/debug.html#';
else
url =
dynapi.documentPath+p+'ext/debug.html#';
---------------------------------------------------------------

2. In debug.html, use the same method when any
resource URL is constructed. So far I just found the
following two locations where change is necessary:

----------------------------------------------------------------
<!--D4D0C8-->
<script>
var ua=dynapi.ua;
var url;
var s = new String(dynapi.library.path);
if( s.substr(0,1) == '/')
url = dynapi.library.path+'ext/';
else
url =
dynapi.documentPath+dynapi.library.path+'ext/';
-------------------------------------------------------------------
function setFocus(){
dynapi={'_imageHook':NullFn};
if(window.opener) dynapi =
window.opener.dynapi;
if(dynapi && dynapi.debug) {
if(!dynapi.debug.win)
dynapi.debug.win=win;
var url;

        var s = new String

(dynapi.library.path);
if( s.substr(0,1) == '/')
url =
dynapi.library.path+'ext/';
else
url =
dynapi.documentPath+dynapi.library.path+'ext/';
-------------------------------------------------------------------------

BTW, this might not be the best solution - just want to
share some experience with other dynapi users. And
tell the truth, I love dynapi's elegancy and really
appreciate the effort from dynapi creators and
contributors.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.