~ubuntu-branches/ubuntu/vivid/venkman/vivid

« back to all changes in this revision

Viewing changes to chrome/content/venkman/venkman-bpprops.js

  • Committer: Bazaar Package Importer
  • Author(s): Michele Angrisano
  • Date: 2007-12-13 15:51:50 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20071213155150-mah0sgu2j2u2b5fz
Tags: 0.9.87.2-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/control:
    + Changed debians ice* dependencies to mozilla-based Ubuntu packages
      (firefox, mozilla-browser, thunderbird)
    + Update maintainer field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
 
 *
3
 
 * ***** BEGIN LICENSE BLOCK *****
4
 
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
 
 *
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/
10
 
 *
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
14
 
 * License.
15
 
 *
16
 
 * The Original Code is The JavaScript Debugger.
17
 
 *
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.
22
 
 *
23
 
 * Contributor(s):
24
 
 *   Robert Ginda, <rginda@netscape.com>, original author
25
 
 *
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.
37
 
 *
38
 
 * ***** END LICENSE BLOCK ***** */
39
 
 
40
 
var dialog = new Object();
41
 
var breakpoint;
42
 
 
43
 
function onLoad()
44
 
{
45
 
    function cacheElement(id)
46
 
    {
47
 
        dialog[id] = document.getElementById(id);
48
 
    };
49
 
    
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");
63
 
 
64
 
    cacheElement("apply-button");
65
 
    cacheElement("revert-button");
66
 
    cacheElement("close-button");
67
 
    
68
 
    populateFromBreakpoint();
69
 
}
70
 
 
71
 
function onUnload()
72
 
{
73
 
    delete breakpoint.propsWindow;
74
 
}
75
 
 
76
 
function onBreakpointTriggered()
77
 
{
78
 
    dialog["trigger-textbox"].value = breakpoint.triggerCount;
79
 
}
80
 
 
81
 
function onConditionKeyPress(event)
82
 
{
83
 
    if (event.keyCode == 9)
84
 
    {
85
 
        opener.dd(dialog["condition-textbox"].selectionStart);
86
 
        event.preventDefault();
87
 
    }
88
 
}
89
 
 
90
 
function populateFromBreakpoint()
91
 
{
92
 
    dialog["url-textbox"].value = breakpoint.url;
93
 
    dialog["line-textbox"].value = breakpoint.lineNumber;
94
 
 
95
 
    dialog["condition-checkbox"].checked = breakpoint.conditionEnabled;
96
 
    if ("scriptWrapper" in breakpoint)
97
 
    {
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;
105
 
    }
106
 
    else
107
 
    {
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;
115
 
    }
116
 
 
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();
124
 
    makeClean();
125
 
}
126
 
 
127
 
function copyToBreakpoint()
128
 
{
129
 
    breakpoint.conditionEnabled = dialog["condition-checkbox"].checked;
130
 
    if ("scriptWrapper" in breakpoint)
131
 
    {
132
 
        breakpoint.oneTime = dialog["onetime-checkbox"].checked;
133
 
        breakpoint.triggerCount = dialog["trigger-textbox"].value;
134
 
    }
135
 
 
136
 
    breakpoint.enabled = dialog["enabled-checkbox"].checked;
137
 
    for (var i = 0; i < 4; ++i)
138
 
    {
139
 
        if (dialog["result-radio"].childNodes[i] ==
140
 
            dialog["result-radio"].selectedItem)
141
 
        {
142
 
            breakpoint.resultAction = i;
143
 
            break;
144
 
        }
145
 
    }
146
 
    breakpoint.condition = dialog["condition-textbox"].value;
147
 
    breakpoint.passExceptions = dialog["exception-checkbox"].checked;
148
 
    breakpoint.logResult = dialog["log-checkbox"].checked;
149
 
    makeClean();
150
 
}
151
 
 
152
 
function updateConditionGroup()
153
 
{
154
 
    function ableNode (node)
155
 
    {
156
 
        node.disabled = !state;
157
 
        if (node.childNodes.length > 0)
158
 
        {
159
 
            for (var i = 0; i < node.childNodes.length; ++i)
160
 
                ableNode(node.childNodes[i]);
161
 
        }
162
 
    };
163
 
 
164
 
    var state = dialog["condition-checkbox"].checked;
165
 
 
166
 
    var kid = dialog["condition-checkbox"].parentNode.nextSibling;
167
 
    
168
 
    while (kid)
169
 
    {
170
 
        ableNode(kid);
171
 
        kid = kid.nextSibling;
172
 
    }
173
 
}
174
 
 
175
 
function makeDirty()
176
 
{
177
 
    dialog["apply-button"].disabled  = false;
178
 
    dialog["revert-button"].disabled = false;
179
 
    dialog["close-button"].disabled  = true;
180
 
}
181
 
 
182
 
function makeClean()
183
 
{
184
 
    dialog["apply-button"].disabled  = true;
185
 
    dialog["revert-button"].disabled = true;
186
 
    dialog["close-button"].disabled  = false;
187
 
}
188
 
 
189
 
    
190
 
    
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 
2
 *
 
3
 * ***** BEGIN LICENSE BLOCK *****
 
4
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
5
 *
 
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/
 
10
 *
 
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
 
14
 * License.
 
15
 *
 
16
 * The Original Code is The JavaScript Debugger.
 
17
 *
 
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.
 
22
 *
 
23
 * Contributor(s):
 
24
 *   Robert Ginda, <rginda@netscape.com>, original author
 
25
 *
 
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.
 
37
 *
 
38
 * ***** END LICENSE BLOCK ***** */
 
39
 
 
40
var dialog = new Object();
 
41
var breakpoint;
 
42
 
 
43
function onLoad()
 
44
{
 
45
    function cacheElement(id)
 
46
    {
 
47
        dialog[id] = document.getElementById(id);
 
48
    };
 
49
    
 
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");
 
63
 
 
64
    cacheElement("apply-button");
 
65
    cacheElement("revert-button");
 
66
    cacheElement("close-button");
 
67
    
 
68
    populateFromBreakpoint();
 
69
}
 
70
 
 
71
function onUnload()
 
72
{
 
73
    delete breakpoint.propsWindow;
 
74
}
 
75
 
 
76
function onBreakpointTriggered()
 
77
{
 
78
    dialog["trigger-textbox"].value = breakpoint.triggerCount;
 
79
}
 
80
 
 
81
function onConditionKeyPress(event)
 
82
{
 
83
    if (event.keyCode == 9)
 
84
    {
 
85
        opener.dd(dialog["condition-textbox"].selectionStart);
 
86
        event.preventDefault();
 
87
    }
 
88
}
 
89
 
 
90
function populateFromBreakpoint()
 
91
{
 
92
    dialog["url-textbox"].value = breakpoint.url;
 
93
    dialog["line-textbox"].value = breakpoint.lineNumber;
 
94
 
 
95
    dialog["condition-checkbox"].checked = breakpoint.conditionEnabled;
 
96
    if ("scriptWrapper" in breakpoint)
 
97
    {
 
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;
 
105
    }
 
106
    else
 
107
    {
 
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;
 
115
    }
 
116
 
 
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();
 
124
    makeClean();
 
125
}
 
126
 
 
127
function copyToBreakpoint()
 
128
{
 
129
    breakpoint.conditionEnabled = dialog["condition-checkbox"].checked;
 
130
    if ("scriptWrapper" in breakpoint)
 
131
    {
 
132
        breakpoint.oneTime = dialog["onetime-checkbox"].checked;
 
133
        breakpoint.triggerCount = dialog["trigger-textbox"].value;
 
134
    }
 
135
 
 
136
    breakpoint.enabled = dialog["enabled-checkbox"].checked;
 
137
    for (var i = 0; i < 4; ++i)
 
138
    {
 
139
        if (dialog["result-radio"].childNodes[i] ==
 
140
            dialog["result-radio"].selectedItem)
 
141
        {
 
142
            breakpoint.resultAction = i;
 
143
            break;
 
144
        }
 
145
    }
 
146
    breakpoint.condition = dialog["condition-textbox"].value;
 
147
    breakpoint.passExceptions = dialog["exception-checkbox"].checked;
 
148
    breakpoint.logResult = dialog["log-checkbox"].checked;
 
149
    makeClean();
 
150
}
 
151
 
 
152
function updateConditionGroup()
 
153
{
 
154
    function ableNode (node)
 
155
    {
 
156
        node.disabled = !state;
 
157
        if (node.childNodes.length > 0)
 
158
        {
 
159
            for (var i = 0; i < node.childNodes.length; ++i)
 
160
                ableNode(node.childNodes[i]);
 
161
        }
 
162
    };
 
163
 
 
164
    var state = dialog["condition-checkbox"].checked;
 
165
 
 
166
    var kid = dialog["condition-checkbox"].parentNode.nextSibling;
 
167
    
 
168
    while (kid)
 
169
    {
 
170
        ableNode(kid);
 
171
        kid = kid.nextSibling;
 
172
    }
 
173
}
 
174
 
 
175
function makeDirty()
 
176
{
 
177
    dialog["apply-button"].disabled  = false;
 
178
    dialog["revert-button"].disabled = false;
 
179
    dialog["close-button"].disabled  = true;
 
180
}
 
181
 
 
182
function makeClean()
 
183
{
 
184
    dialog["apply-button"].disabled  = true;
 
185
    dialog["revert-button"].disabled = true;
 
186
    dialog["close-button"].disabled  = false;
 
187
}
 
188
 
 
189
    
 
190