/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/js/codeviewer.js

  • Committer: galaxyAbstractor
  • Date: 2013-04-10 15:49:32 UTC
  • mto: (19.1.5 lenasys)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: galaxyabstractor@gmail.com-20130410154932-4vizlzk0ar5gykvi
* Added an simple admin panel to the codeviewer-cmssy stuff
* Redesigned a bit like the mockups - still stuff to come
* Implemented the codeviewer + admin panel again using the Framework CodeIgniter instead 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
aceeditors = [];
2
 
 
3
 
function highlight(id, word){
4
 
        clearHighlights();
5
 
        for(var x = 0; x < id.length; x++) {
6
 
                var Search = require("ace/search").Search;
7
 
 
8
 
                var editor = ace.edit(id[x]);
9
 
 
10
 
                srch = new Search();
11
 
                srch.set({needle:word});
12
 
                numbers = [];
13
 
                numbers = srch.findAll(editor.getSession());
14
 
 
15
 
 
16
 
                for(var i = 0; i < numbers.length;i++){
17
 
                        editor.getSession().addMarker(numbers[i], "highlighted", "text",false);
18
 
                }
19
 
        }
20
 
 
21
 
}
22
 
 
23
 
function highlightrows(id, from, to){
24
 
        clearHighlights();
25
 
        for(var x = 0; x < id.length; x++) {
26
 
                var Range = require("ace/range").Range;
27
 
 
28
 
                var editor = ace.edit(id[x]);
29
 
 
30
 
                editor.getSession().addMarker(new Range(from, 0, to, Number.POSITIVE_INFINITY), "highlighted", "text",false);
31
 
        }
32
 
}
33
 
 
34
 
function clearHighlights(){
35
 
        for(var i = 0; i < aceeditors.length; i++){
36
 
                var editor = ace.edit(aceeditors[i]);
37
 
                markers = editor.getSession().getMarkers(false);
38
 
 
39
 
                $.each(markers, function(index, value){
40
 
                        if(value.clazz == "highlighted") {
41
 
                                editor.getSession().removeMarker(index);
42
 
                        }
43
 
                });
44
 
        }
45
 
}
 
 
b'\\ No newline at end of file'