/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to codehighlighterimpl/index.php

  • Committer: Gustav Hartvigsson
  • Date: 2013-04-05 15:54:35 UTC
  • mfrom: (19.1.4 lenasys)
  • Revision ID: gustav.hartvigsson@gmail.com-20130405155435-lf76rf1vwcacin4p
Merged from implementation group 1's team branch into trunk, 20130405 end of
day.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php include 'showcode.php'; ?>
 
2
<!DOCTYPE html>
2
3
<html>
3
4
<head>
4
5
        <script src="../js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
5
6
        <script src="../js/jquery-1.8.0.min.js" type="text/javascript" charset="utf-8"></script>
6
 
        <script type="text/javascript">
7
 
        aceeditors = [];
8
 
        </script>
9
 
        <style type="text/css" media="screen">
10
 
        body {
11
 
                margin:  0;
12
 
                padding: 0;
13
 
        }
14
 
 
15
 
        #header {
16
 
                clear:both;
17
 
                float:left;
18
 
                width:100%;
19
 
                background-color:  #eee;
20
 
        }
21
 
        .colleft {
22
 
                float:left;
23
 
                width:100%;
24
 
                position:relative;
25
 
        }
26
 
        .col1,
27
 
        .col2,
28
 
        .col3 {
29
 
                float:left;
30
 
                position:relative;
31
 
                padding:0 0 0 0;
32
 
                overflow:hidden;
33
 
        }
34
 
 
35
 
        /* column container */
36
 
        .colmask {
37
 
                position:relative;      /* This fixes the IE7 overflow hidden bug */
38
 
                clear:both;
39
 
                float:left;
40
 
                width:100%;                     /* width of whole page */
41
 
                overflow:hidden;                /* This chops off any overhanging divs */
42
 
        }
43
 
 
44
 
        /* 2 Column (left menu) settings */
45
 
        .leftmenu {
46
 
                background:#fff;                /* right column background colour */
47
 
        }
48
 
        .leftmenu .colleft {
49
 
                right:60%;                      /* right column width */
50
 
                background:#f4f4f4;     /* left column background colour */
51
 
        }
52
 
        .leftmenu .col1 {
53
 
                width:60%;                      /* right column content width */
54
 
                left:100%;                      /* 100% plus left column left padding */
55
 
        }
56
 
        .leftmenu .col2 {
57
 
                width:31%;                      /* left column content width (column width minus left and right padding) */
58
 
                left:4%;                        /* (right column left and right padding) plus (left column left padding) */
59
 
        }
60
 
        .ace { 
61
 
                height:500px;
62
 
                width:100%;
63
 
        }
64
 
 
65
 
        .highlighted {
66
 
                background-color:  #ff00ff;
67
 
                opacity: 0.5;
68
 
                position: absolute;
69
 
                z-index: 4;
70
 
        }
71
 
        </style>
 
7
        <script src="js/codeviewer.js" type="text/javascript" charset="utf-8"></script>
 
8
        <link rel="stylesheet" type="text/css" href="css/codeviewer.css">
72
9
 
73
10
</head>
74
11
<body>
86
23
                                
87
24
                                <div id="doc">
88
25
                                        <?php
89
 
                                        showdoc("DomExample1.htm");
 
26
                                                include("DomExample1.php");
90
27
                                        ?>
91
28
                                </div>
92
29
                        </div>
96
33
 
97
34
</body>
98
35
 
99
 
<script type="text/javascript">
100
 
 
101
 
function highlight(id, word){
102
 
        clearHighlights();
103
 
        for(var x = 0; x < id.length; x++) {
104
 
                var Range = require("ace/range").Range;
105
 
                var Search = require("ace/search").Search;
106
 
 
107
 
                var editor = ace.edit(id[x]);
108
 
 
109
 
                srch = new Search();
110
 
                srch.set({needle:word});
111
 
                numbers = [];
112
 
                numbers = srch.findAll(editor.getSession());
113
 
 
114
 
 
115
 
                for(var i = 0; i < numbers.length;i++){
116
 
                        editor.getSession().addMarker(numbers[i], "highlighted", "text",false);
117
 
                }}
118
 
 
119
 
        }
120
 
 
121
 
        function clearHighlights(){
122
 
                for(var i = 0; i < aceeditors.length; i++){
123
 
                        var editor = ace.edit(aceeditors[i]);
124
 
                        markers = editor.getSession().getMarkers(false);
125
 
 
126
 
                        $.each(markers, function(index, value){
127
 
                                editor.getSession().removeMarker(index);
128
 
                        });
129
 
                }
130
 
        }
131
 
        </script>
132
 
        </html>
 
 
b'\\ No newline at end of file'
 
36
 
 
37
</html>
 
 
b'\\ No newline at end of file'