-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrawDependency.html
More file actions
231 lines (212 loc) · 6.36 KB
/
drawDependency.html
File metadata and controls
231 lines (212 loc) · 6.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!-- This file displays two tabs to enter user values and uses ajax calls to retrieve data without loading the page -->
<!DOCTYPE html>
<html>
<head>
<title>Dependency Depth</title>
<style type="text/css">
input[type='text'] {
border: 0;
border-bottom: 1px solid #CCCCCC;
height: 22px;
}
input[type='submit'] {
border: 1px solid #999999;
border-radius: 5px;
padding: 5px;
background-color: #666666;
letter-spacing: 26.7px;
color: #FFFFFF;
font-weight: bold;
cursor: pointer;
cursor: hand;
margin-top: lOpx;
}
label {
font-weight: bold;
color: #333333;
margin-right: lOpx;
}
.dependency {
border-left: 1px solid #EFEEEE;
} .
dependency>div {
margin: Spx;
margin-left: 20px;
padding-left: 5px;
}
.dependency .sp {
color: #993A33;
}
.dependency .variable {
color: #666633;
}
.aGet {
color: #009900;
font-size: 0.8em;
text-decoration: none;
}
.aHide {
color: #FF9900;
font-size: 0.8em;
text-decoration: none;
}
.aJavadoc {
font-weight: bold;
text-decoration: none;
color: #000000;
}
.hint {
color: #999999;
font-size: 0.8em;
}
.tabs {
margin: 0;
padding: 0;
padding-bottom: 5px;
}
.tabs .tabActive {
background-color: #609AAF;
border-top: 1px solid #DDDDDD;
}
.tabs .tabActive a {
color: #FFFFFF;
}
.tabs li {
display: inline;
padding: 5px;
}
.tabs a {
text-decoration: none;
color: #000000;
outline: none;
}
#tabContents {
border-left: 1px solid #AAAAAA;
border-top: 1px solid #AAAAAA;
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
display: inline-block;
padding: 20px;
width: 880px;
height: 110px;
}
</style>
<script type="text/javascript">
FORM_TYPES = {
BY_COMP : 0 // By Component path and function name
, BY_TXCODE : 1 // By TxCode
}
function pageLoad () {
showFrmByComp();
}
function submitForComp () {
getDependency('main', document.getElementById('mainComponent').value, document.getElementById('mainFunction').value);
}
function showFrmByComp () {
document.getElementById('tabByComp').setAttribute("class", "tabActive");
document.getElementById('tabByTxCode').removeAttribute("class");
document.frmByTxCode.style.display = "none";
document.frmByComp.style.display = "";
}
function showFrmByTxCode () {
document.getElementById('tabByTxCode').setAttribute("class", "tabActive");
document.getElementById('tabByComp').removeAttribute("class");
document.frmByComp.style.display = "none";
document.frmByTxCode.style.display = "";
}
</script>
</head>
<body onload="pageLoad()">
<ul class="tabs">
<li id="tabByComp"><a href="javascript:showFrmByComp()" accesskey="C">By Component / Function</a></li>
<li id="tabByTxCode"><a href="javascript:showFrmByTxCode()" accesskey="T">By TxCode</a></li>
</ul>
<div id="tabContents">
<div id="divByComp">
<form name="frmByComp" method="post" action="javascript:submitForComp();">
<table>
<tr>
<td><label for="mainComponent">Component Relative Path</label></td>
<td>
<input type="text" id="mainComponent" size="80" value="sites.backofficeportal" /> <span class="hint">(example: sites.backofficeportal)</span>
</td>
</tr>
<tr>
<td><label for="mainFunction">Function Name</label></td>
<td>
<input type="text" id="mainFunction" size="80" value="getPageByURL" /> <span class="hint">(example: getPageByURL)</span>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Get Dependency" />
</td>
</tr>
</table>
</form>
</div>
<div id="divByTxCode">
<form name="frmByTxCode" method="post" action="javascript:submitForTxCode();">
<table>
<tr>
<td><label for="txcode">Service Function TxCode</label></td>
<td>
<input type="text" id="txcode" size="80" value="3801" /> <span class="hint">(example: 3801)</span>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Get Dependency" />
</td>
</tr>
</table>
</form>
</div>
</div> <br /><br />
<div id="div main" class="dependency"> </div>
<script type="text/javascript">
function getDependency (elemID, comp, func) {
var xmlHTTP;
if (window.XMLHttpRequest) {
xmlHTTP = new XMLHttpRequest();
} else {
xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
}
divElem = document.getElementById('div_' + elemID);
divElem.innerHTML = "Getting dependency...";
xmlHTTP.onreadystatechange = function () {
if (xmlHTTP.readyState == 4 && xmlHTTP.status == 200) {
// Add sub function details to parent function
divElem.innerHTML = buildParentText(elemID, comp, func);
divElem.innerHTML = divElem.innerHTML + xmlHTTP.responseText;
}
}
xmlHTTP.open("GET", "qryDependency.cfm?comp=" + comp + "&func=" + func, true);
xmlHTTP.send();
}
function buildParentText (elemID, comp, func) {
// Javadoc link
compPath = comp.replace(/\./g, "/");
// Replace webAppName by coldfusion application name
compPath = compPath.replace(/^webAppName\//, "");
comp = comp.replace(/^webAppName\./, "");
hrefJavadoc = "http://my_doc/webAppName/" + compPath + ".html#" + func + "()";
htmlText = "<a href=\"" + hrefJavadoc + "\" class=\"aJavadoc\" target=\"_blank\">" + func + "</a> (" + comp + ")";
htmlText = htmlText + " <a id=\"a_" + elemID + "\" class=\"aHide\" href=\"javascript:hideDependency('" + elemID + "', '" + comp + "', '" + func + "')\">Hide Details</a>";
return htmlText;
}
function hideDependency (elemID, comp, func) (
// Reset div contents
divElem = document.getElementById('div_' + elemID);
divElem.innerHTML = buildParentText (elemID, comp, func);
// Enable get dependency link
aElem = document.getElementById('a_' + elemID);
aElem.setAttribute("href", "javascript:getDependency('" + elemID + "', '" + comp + "', '" + func + "')");
aElem.setAttribute("class", "aGet");
aElem.innerHTML = "Get Dependency";
}
</script>
</body>
</html>