-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogHistory.js
More file actions
61 lines (54 loc) · 1.59 KB
/
LogHistory.js
File metadata and controls
61 lines (54 loc) · 1.59 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
var HISTORY = [];
var BEGIN = "";
var END = "";
var DOM = "";
function LOG(str)
{
if (str instanceof Array)
{
//var blank_line = false;
//var title = "";
if (str.length != 1)
{
// blank_line = true;
// BEGIN = BEGIN.substring(2);
// HISTORY.pop();
DOM += "</div></div>";
}
else
{
// title = str[0].toString();
// HISTORY.push(str[0]);
DOM += "<div><label onclick=\"var div=this.parentNode.children[1];console.log(div); if (div.style.display == 'none'){div.style.display='block';this.innerHTML='-'+this.innerHTML.substring(1);}else{div.style.display='none'; this.innerHTML = '+'+this.innerHTML.substring(1);}\">+ " + str[0].toString() + '</label><div style="display:none;margin-left:30px; border:1px solid #000;">';
}
/*
var end_stuff = "";
for(var i = title.length; i < 80; i++)
end_stuff += "-";
print(BEGIN + "+--" + title + end_stuff);
if (blank_line)
print(BEGIN);
if (str.length == 1) BEGIN += "| ";
*/
}
else
{
DOM += '<pre style="margin: 0; padding: 0;">' + str.toString() + '</pre>';
/*
var split = str !== undefined ? str.toString().split('\n') : ["undefined"];
for (var i = 0; i < split.length; i++){
print(BEGIN + split[i]);
DOM += split[i];
}
*/
}
document.getElementById("LOG_DIV").innerHTML = DOM;
}
NLOG = function(){};
if (print === undefined)
{
function print(str)
{
document.getElementById("output").value += str + "\n";
}
}