/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
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
aceeditors = [];

function highlight(id, word){
	clearHighlights();
	for(var x = 0; x < id.length; x++) {
		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 highlightrows(id, from, to){
	clearHighlights();
	for(var x = 0; x < id.length; x++) {
		var Range = require("ace/range").Range;

		var editor = ace.edit(id[x]);

		editor.getSession().addMarker(new Range(from, 0, to, Number.POSITIVE_INFINITY), "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){
			if(value.clazz == "highlighted") {
				editor.getSession().removeMarker(index);
			}
		});
	}
}

open = false;
function dropdown(){
    if(!open){
        $('#dropdown').show();
        open = true;
    } else {
        $('#dropdown').hide();
        open = false;
    }
}

$(function () {
	$('section.group div.heading').bind('click', function (e) {
		var heading1 = $(this);
		if (heading1.hasClass('open')) {
			heading1.removeClass('open').next().animate({
				height: 0
			}, 200, function () {
				heading1.css({
					height: "auto",
					overflow: "hidden"
				});
			});
			if (heading1.parent().parent().hasClass('content')) {
				heading1.parent().parent().css({
					height: "auto",
					overflow: "show"
				});
			}
		} else {
			var innerHeight = 0;
			heading1.next().children().each(function () {
				innerHeight += this.offsetHeight;
			});
			heading1.addClass('open').next().animate({
				height: innerHeight
			}, 200);
			if (heading1.parent().parent().hasClass('content')) {
				heading1.parent().parent().css({
					height: "auto",
					overflow: "show"
				});
			}
//heading1.parent().siblings().each(function(){
// $(this).find('div.heading1.open').removeClass('open').next().animate({height:0},200)
//});
}
});
});