-
Notifications
You must be signed in to change notification settings - Fork 5
/
frontend_body.js
74 lines (74 loc) · 3.19 KB
/
frontend_body.js
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
function helpme(id,msg,title,help) {
if( document.getElementById(id).parentNode.parentNode.parentNode.parentNode.tagName.toUpperCase()=="TABLE" ){
// document.getElementById(id).parentNode.tagName!="DIV"){
var theTableBody = document.getElementById(id).parentNode.parentNode.parentNode.parentNode.tBodies[0];
var row = 1+document.getElementById(id).parentNode.parentNode.rowIndex;
if ((theRowOpened == row) && (theTableOpened == theTableBody)) {
removeRow(theRowOpened, theTableOpened);
theRowOpened = -1;
} else {
if (theRowOpened > 0) {
if(theRowOpened<row) row--;
removeRow(theRowOpened, theTableOpened);
}
insertTableRow(row,msg,title,help,theTableBody);
theRowOpened = row;
theTableOpened = theTableBody;
}
} else {
var theLinkDiv=document.getElementById(id).parentNode;
var theHelpDiv=document.getElementById(id+"HelpDiv");
if(!theHelpDiv){
theHelpDiv=document.createElement("div");
theHelpDiv.id=id+"HelpDiv";
theHelpDiv.className="HelpDiv";
var theHelpDivContent=document.createElement("div");
theHelpDivContent.className="HelpDiv-content";
var closeSpan=document.createElement("span");
closeSpan.className="close";
closeSpan.onclick= function(event){document.getElementById(theHelpDiv.id).style.display="none";};
var closeCross=document.createTextNode("x ");
theHelpDiv.appendChild(theHelpDivContent);
var para=document.createElement("p");
para.innerHTML=insertInnerHTML(msg,title,help);
closeSpan.appendChild(closeCross);
theHelpDivContent.appendChild(closeSpan);
theHelpDivContent.appendChild(para);
theLinkDiv.appendChild(theHelpDiv);
}
theHelpDiv.style.display="block";
}
}
function insertTableRow(row,msg,title,help,theTableBody) {
var newCell;
var newRow = theTableBody.insertRow(row);
newCell = newRow.insertCell(0);
newCell = newRow.insertCell(1);
newCell.colSpan = 2;
newCell.className = MPFORM_CLASS_PREFIX+"help_box_td";
newCell.innerHTML = insertInnerHTML(msg,title,help);
}
function insertInnerHTML(msg,title,help){
return '<div class="'
+MPFORM_CLASS_PREFIX
+'"help_box_div">'
+((title)
? '<h5 class="'
+MPFORM_CLASS_PREFIX
+'help_box_h5">'
+help
+': '
+title
+'</h5><hr class="'
+MPFORM_CLASS_PREFIX
+'help_box_hr" noshade="noshade" size="1" />'
: '')
+'<h6 class="'
+MPFORM_CLASS_PREFIX
+'help_box_h6">'
+msg
+'</h6></div>';
}
function removeRow(row,theTableBody) {
theTableBody.deleteRow(row);
}