1
var global_timeout_id = null;
2
var global_search_request = null;
4
window.addEvent('domready', function()
6
var search_box = $('q');
11
if($('q').value == '')
13
$('search_terms').setStyle('display','none');
17
if (null != global_timeout_id)
19
clearTimeout(global_timeout_id);
21
global_timeout_id = setTimeout('$("q").fireEvent("search",$("q").value)',200);
25
search: function(query)
27
url = global_path + 'search?query=' + query;
29
if ($defined(global_search_request))
31
global_search_request.cancel();
33
global_search_request = new Request({'url':url,'method':'get','onComplete':cool_search});
34
global_search_request.send('');
35
var posicion = search_box.getPosition();
36
var size = search_box.getSize();
38
$('search_terms').setStyle('position','absolute');
39
$('search_terms').setStyle('left',posicion.x);
40
$('search_terms').setStyle('top',posicion.y + size.y);
41
$('search_terms').setStyle('display','block');
42
$('search_terms').set('html','Loading...');
44
new Request({'url':url,'method':'get','onComplete':cool_search}).send('');
51
function cool_search(response)
53
var posicion = $('q').getPosition();
54
var size = $('q').getSize();
55
$('search_terms').set('html',response);
56
$('search_terms').setStyle('display','block');
57
$('search_terms').setStyle('position','absolute');
58
$('search_terms').setStyle('left',posicion.x);
59
$('search_terms').setStyle('top',posicion.y + size.y);
62
function hide_search()
64
hide_div = setTimeout("$('search_terms').setStyle('display','none')", 300);
66
var Colapsable = new Class({
67
initialize: function(item,expand_icon,open_content,close_content,is_open)
70
if ($defined(is_open))
72
this.is_open = is_open;
75
item.set('colapsable',this);
76
this.open_content = open_content;
77
this.close_content = close_content;
78
this.expand_icon = expand_icon;
80
var expander = new Fx.Slide(this.item, { duration: 200 } );
84
if ($defined(this.expand_icon))
86
this.expand_icon.set('src',this.expand_icon.title);
91
if ($defined(this.expand_icon))
93
this.expand_icon.set('src',this.expand_icon.alt);
100
this.item.setStyle('display', 'block');
101
var expander = this.item.get('slide');
103
if ($defined(this.open_content))
105
for (var i=0;i<this.open_content.length;++i)
107
this.open_content[i].setStyle('display','block');
111
if ($defined(this.close_content))
113
for (var i=0;i<this.close_content.length;++i)
115
this.close_content[i].setStyle('display','none');
119
if ($defined(this.expand_icon))
121
this.expand_icon.set('src',this.expand_icon.alt);
128
var expander = this.item.get('slide');
130
if ($defined(this.open_content))
132
for (var i=0;i<this.open_content.length;++i)
134
this.open_content[i].setStyle('display','none');
138
if ($defined(this.close_content))
140
for (var i=0;i<this.close_content.length;++i)
142
this.close_content[i].setStyle('display','block');
145
if ($defined(this.expand_icon))
147
this.expand_icon.set('src',this.expand_icon.title);
149
this.is_open = false;
171
window.addEvent('domready', function()
173
$$('.revision_log').each(function(item, i)
175
var item_slide = item.getElement('.revisioninfo');
176
var open_content = new Array();
177
var close_content = new Array();
178
open_content.push(item.getElement('.long_description'));
179
close_content.push(item.getElement('.short_description'));
180
var expand_icon = item.getElement('.expand_icon');
181
var colapsable = new Colapsable(item_slide,expand_icon,open_content,close_content);
183
item.getElement('.expand_revisioninfo').addEvent('click',function(){colapsable.toggle();});
184
item.colapsable = colapsable;
187
$$('.diffBox').each(function(item, i)
189
var item_slide = item.getNext('.diffinfo');
190
var expand_icon = item.getElement( '.expand_diff' );
191
var colapsable = new Colapsable(item_slide,expand_icon,null,null,true);
192
item.getElement( '.expand_diff' ).addEvent( 'click', function(){colapsable.toggle();});
193
item.colapsable=colapsable;
197
function toggle_expand_all(action)
199
$$('.revision_log').each(function(item, i)
201
var colapsable = item.colapsable;
202
if(action == 'close')
204
$('expand_all').setStyle('display','block');
205
$('collapse_all').setStyle('display','none');
208
else if(action == 'open')
210
$('expand_all').setStyle('display','none');
211
$('collapse_all').setStyle('display','block');
217
function toggle_expand_all_revisionview(action)
219
$$('.diffBox').each(function(item, i)
221
var colapsable = item.colapsable;
222
if(action == 'close')
224
$('expand_all').setStyle('display','block');
225
$('collapse_all').setStyle('display','none');
228
else if(action == 'open')
230
$('expand_all').setStyle('display','none');
231
$('collapse_all').setStyle('display','block');