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
|
<?php include 'showcode.php'; ?>
<html>
<head>
<script src="../js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-1.8.0.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
aceeditors = [];
</script>
<style type="text/css" media="screen">
body {
margin: 0;
padding: 0;
}
#header {
clear:both;
float:left;
width:100%;
background-color: #eee;
}
.colleft {
float:left;
width:100%;
position:relative;
}
.col1,
.col2,
.col3 {
float:left;
position:relative;
padding:0 0 0 0;
overflow:hidden;
}
/* column container */
.colmask {
position:relative; /* This fixes the IE7 overflow hidden bug */
clear:both;
float:left;
width:100%; /* width of whole page */
overflow:hidden; /* This chops off any overhanging divs */
}
/* 2 Column (left menu) settings */
.leftmenu {
background:#fff; /* right column background colour */
}
.leftmenu .colleft {
right:60%; /* right column width */
background:#f4f4f4; /* left column background colour */
}
.leftmenu .col1 {
width:60%; /* right column content width */
left:100%; /* 100% plus left column left padding */
}
.leftmenu .col2 {
width:31%; /* left column content width (column width minus left and right padding) */
left:4%; /* (right column left and right padding) plus (left column left padding) */
}
.ace {
height:500px;
width:100%;
}
.highlighted {
background-color: #ff00ff;
opacity: 0.5;
position: absolute;
z-index: 4;
}
</style>
</head>
<body>
<div id="header">
Test test test<br>
test test hhh
</div>
<div class="colmask leftmenu">
<div class="colleft">
<div class="col1">
<?php showfile("showcode.php", "php");?>
<?php showfile("index.php", "html");?>
</div>
<div class="col2">
<div id="doc">
<?php
showdoc("DomExample1.htm");
?>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript">
function highlight(id, word){
clearHighlights();
for(var x = 0; x < id.length; x++) {
var Range = require("ace/range").Range;
var Search = require("ace/search").Search;
var editor = ace.edit(id[x]);
srch = new Search();
srch.set({needle:word});
numbers = [];
numbers = srch.findAll(editor.getSession());
for(var i = 0; i < numbers.length;i++){
editor.getSession().addMarker(numbers[i], "highlighted", "text",false);
}}
}
function clearHighlights(){
for(var i = 0; i < aceeditors.length; i++){
var editor = ace.edit(aceeditors[i]);
markers = editor.getSession().getMarkers(false);
$.each(markers, function(index, value){
editor.getSession().removeMarker(index);
});
}
}
</script>
</html>
|