1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3
* ***** BEGIN LICENSE BLOCK *****
4
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
* The contents of this file are subject to the Mozilla Public License Version
7
* 1.1 (the "License"); you may not use this file except in compliance with
8
* the License. You may obtain a copy of the License at
9
* http://www.mozilla.org/MPL/
11
* Software distributed under the License is distributed on an "AS IS" basis,
12
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
* for the specific language governing rights and limitations under the
16
* The Original Code is The JavaScript Debugger.
18
* The Initial Developer of the Original Code is
19
* Netscape Communications Corporation.
20
* Portions created by the Initial Developer are Copyright (C) 1998
21
* the Initial Developer. All Rights Reserved.
24
* Robert Ginda, <rginda@netscape.com>, original author
26
* Alternatively, the contents of this file may be used under the terms of
27
* either the GNU General Public License Version 2 or later (the "GPL"), or
28
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
* in which case the provisions of the GPL or the LGPL are applicable instead
30
* of those above. If you wish to allow use of your version of this file only
31
* under the terms of either the GPL or the LGPL, and not to allow others to
32
* use your version of this file under the terms of the MPL, indicate your
33
* decision by deleting the provisions above and replace them with the notice
34
* and other provisions required by the GPL or the LGPL. If you do not delete
35
* the provisions above, a recipient may use your version of this file under
36
* the terms of any one of the MPL, the GPL or the LGPL.
38
* ***** END LICENSE BLOCK ***** */
40
var dialog = new Object();
45
function cacheElement(id)
47
dialog[id] = document.getElementById(id);
50
breakpoint = window.arguments[0];
51
cacheElement("url-textbox");
52
cacheElement("line-textbox");
53
cacheElement("function-textbox");
54
cacheElement("pc-textbox");
55
cacheElement("condition-checkbox");
56
cacheElement("trigger-textbox");
57
cacheElement("enabled-checkbox");
58
cacheElement("onetime-checkbox");
59
cacheElement("condition-textbox");
60
cacheElement("result-radio");
61
cacheElement("exception-checkbox");
62
cacheElement("log-checkbox");
64
cacheElement("apply-button");
65
cacheElement("revert-button");
66
cacheElement("close-button");
68
populateFromBreakpoint();
73
delete breakpoint.propsWindow;
76
function onBreakpointTriggered()
78
dialog["trigger-textbox"].value = breakpoint.triggerCount;
81
function onConditionKeyPress(event)
83
if (event.keyCode == 9)
85
opener.dd(dialog["condition-textbox"].selectionStart);
86
event.preventDefault();
90
function populateFromBreakpoint()
92
dialog["url-textbox"].value = breakpoint.url;
93
dialog["line-textbox"].value = breakpoint.lineNumber;
95
dialog["condition-checkbox"].checked = breakpoint.conditionEnabled;
96
if ("scriptWrapper" in breakpoint)
98
document.title = opener.MSG_BPPROPS_TITLE;
99
dialog["enabled-checkbox"].setAttribute("label",
100
opener.MSG_BPPROPS_ENABLED);
101
dialog["function-textbox"].value = breakpoint.scriptWrapper.functionName;
102
dialog["pc-textbox"].value = breakpoint.pc;
103
dialog["onetime-checkbox"].checked = breakpoint.oneTime;
104
dialog["trigger-textbox"].value = breakpoint.triggerCount;
108
document.title = opener.MSG_FBPPROPS_TITLE;
109
dialog["enabled-checkbox"].setAttribute("label",
110
opener.MSG_FBPPROPS_ENABLED);
111
dialog["function-textbox"].value = opener.MSG_VAL_NA;
112
dialog["pc-textbox"].value = opener.MSG_VAL_NONE;
113
dialog["onetime-checkbox"].disabled = true;
114
dialog["trigger-textbox"].disabled = true;
117
dialog["enabled-checkbox"].checked = breakpoint.enabled;
118
dialog["condition-textbox"].value = breakpoint.condition;
119
dialog["result-radio"].selectedItem =
120
dialog["result-radio"].childNodes[breakpoint.resultAction];
121
dialog["exception-checkbox"].checked = breakpoint.passExceptions;
122
dialog["log-checkbox"].checked = breakpoint.logResult;
123
updateConditionGroup();
127
function copyToBreakpoint()
129
breakpoint.conditionEnabled = dialog["condition-checkbox"].checked;
130
if ("scriptWrapper" in breakpoint)
132
breakpoint.oneTime = dialog["onetime-checkbox"].checked;
133
breakpoint.triggerCount = dialog["trigger-textbox"].value;
136
breakpoint.enabled = dialog["enabled-checkbox"].checked;
137
for (var i = 0; i < 4; ++i)
139
if (dialog["result-radio"].childNodes[i] ==
140
dialog["result-radio"].selectedItem)
142
breakpoint.resultAction = i;
146
breakpoint.condition = dialog["condition-textbox"].value;
147
breakpoint.passExceptions = dialog["exception-checkbox"].checked;
148
breakpoint.logResult = dialog["log-checkbox"].checked;
152
function updateConditionGroup()
154
function ableNode (node)
156
node.disabled = !state;
157
if (node.childNodes.length > 0)
159
for (var i = 0; i < node.childNodes.length; ++i)
160
ableNode(node.childNodes[i]);
164
var state = dialog["condition-checkbox"].checked;
166
var kid = dialog["condition-checkbox"].parentNode.nextSibling;
171
kid = kid.nextSibling;
177
dialog["apply-button"].disabled = false;
178
dialog["revert-button"].disabled = false;
179
dialog["close-button"].disabled = true;
184
dialog["apply-button"].disabled = true;
185
dialog["revert-button"].disabled = true;
186
dialog["close-button"].disabled = false;
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3
* ***** BEGIN LICENSE BLOCK *****
4
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
* The contents of this file are subject to the Mozilla Public License Version
7
* 1.1 (the "License"); you may not use this file except in compliance with
8
* the License. You may obtain a copy of the License at
9
* http://www.mozilla.org/MPL/
11
* Software distributed under the License is distributed on an "AS IS" basis,
12
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
* for the specific language governing rights and limitations under the
16
* The Original Code is The JavaScript Debugger.
18
* The Initial Developer of the Original Code is
19
* Netscape Communications Corporation.
20
* Portions created by the Initial Developer are Copyright (C) 1998
21
* the Initial Developer. All Rights Reserved.
24
* Robert Ginda, <rginda@netscape.com>, original author
26
* Alternatively, the contents of this file may be used under the terms of
27
* either the GNU General Public License Version 2 or later (the "GPL"), or
28
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
* in which case the provisions of the GPL or the LGPL are applicable instead
30
* of those above. If you wish to allow use of your version of this file only
31
* under the terms of either the GPL or the LGPL, and not to allow others to
32
* use your version of this file under the terms of the MPL, indicate your
33
* decision by deleting the provisions above and replace them with the notice
34
* and other provisions required by the GPL or the LGPL. If you do not delete
35
* the provisions above, a recipient may use your version of this file under
36
* the terms of any one of the MPL, the GPL or the LGPL.
38
* ***** END LICENSE BLOCK ***** */
40
var dialog = new Object();
45
function cacheElement(id)
47
dialog[id] = document.getElementById(id);
50
breakpoint = window.arguments[0];
51
cacheElement("url-textbox");
52
cacheElement("line-textbox");
53
cacheElement("function-textbox");
54
cacheElement("pc-textbox");
55
cacheElement("condition-checkbox");
56
cacheElement("trigger-textbox");
57
cacheElement("enabled-checkbox");
58
cacheElement("onetime-checkbox");
59
cacheElement("condition-textbox");
60
cacheElement("result-radio");
61
cacheElement("exception-checkbox");
62
cacheElement("log-checkbox");
64
cacheElement("apply-button");
65
cacheElement("revert-button");
66
cacheElement("close-button");
68
populateFromBreakpoint();
73
delete breakpoint.propsWindow;
76
function onBreakpointTriggered()
78
dialog["trigger-textbox"].value = breakpoint.triggerCount;
81
function onConditionKeyPress(event)
83
if (event.keyCode == 9)
85
opener.dd(dialog["condition-textbox"].selectionStart);
86
event.preventDefault();
90
function populateFromBreakpoint()
92
dialog["url-textbox"].value = breakpoint.url;
93
dialog["line-textbox"].value = breakpoint.lineNumber;
95
dialog["condition-checkbox"].checked = breakpoint.conditionEnabled;
96
if ("scriptWrapper" in breakpoint)
98
document.title = opener.MSG_BPPROPS_TITLE;
99
dialog["enabled-checkbox"].setAttribute("label",
100
opener.MSG_BPPROPS_ENABLED);
101
dialog["function-textbox"].value = breakpoint.scriptWrapper.functionName;
102
dialog["pc-textbox"].value = breakpoint.pc;
103
dialog["onetime-checkbox"].checked = breakpoint.oneTime;
104
dialog["trigger-textbox"].value = breakpoint.triggerCount;
108
document.title = opener.MSG_FBPPROPS_TITLE;
109
dialog["enabled-checkbox"].setAttribute("label",
110
opener.MSG_FBPPROPS_ENABLED);
111
dialog["function-textbox"].value = opener.MSG_VAL_NA;
112
dialog["pc-textbox"].value = opener.MSG_VAL_NONE;
113
dialog["onetime-checkbox"].disabled = true;
114
dialog["trigger-textbox"].disabled = true;
117
dialog["enabled-checkbox"].checked = breakpoint.enabled;
118
dialog["condition-textbox"].value = breakpoint.condition;
119
dialog["result-radio"].selectedItem =
120
dialog["result-radio"].childNodes[breakpoint.resultAction];
121
dialog["exception-checkbox"].checked = breakpoint.passExceptions;
122
dialog["log-checkbox"].checked = breakpoint.logResult;
123
updateConditionGroup();
127
function copyToBreakpoint()
129
breakpoint.conditionEnabled = dialog["condition-checkbox"].checked;
130
if ("scriptWrapper" in breakpoint)
132
breakpoint.oneTime = dialog["onetime-checkbox"].checked;
133
breakpoint.triggerCount = dialog["trigger-textbox"].value;
136
breakpoint.enabled = dialog["enabled-checkbox"].checked;
137
for (var i = 0; i < 4; ++i)
139
if (dialog["result-radio"].childNodes[i] ==
140
dialog["result-radio"].selectedItem)
142
breakpoint.resultAction = i;
146
breakpoint.condition = dialog["condition-textbox"].value;
147
breakpoint.passExceptions = dialog["exception-checkbox"].checked;
148
breakpoint.logResult = dialog["log-checkbox"].checked;
152
function updateConditionGroup()
154
function ableNode (node)
156
node.disabled = !state;
157
if (node.childNodes.length > 0)
159
for (var i = 0; i < node.childNodes.length; ++i)
160
ableNode(node.childNodes[i]);
164
var state = dialog["condition-checkbox"].checked;
166
var kid = dialog["condition-checkbox"].parentNode.nextSibling;
171
kid = kid.nextSibling;
177
dialog["apply-button"].disabled = false;
178
dialog["revert-button"].disabled = false;
179
dialog["close-button"].disabled = true;
184
dialog["apply-button"].disabled = true;
185
dialog["revert-button"].disabled = true;
186
dialog["close-button"].disabled = false;