2008-02-05 17:11:21 +01:00
|
|
|
var LSdefault = new Class({
|
|
|
|
initialize: function(){
|
2008-02-08 18:39:24 +01:00
|
|
|
this.LSdebug = $('LSdebug');
|
|
|
|
this.LSdebugInfos = $('LSdebug_infos');
|
|
|
|
this.LSdebug.setOpacity(0);
|
|
|
|
if (this.LSdebugInfos.innerHTML != '') {
|
|
|
|
this.displayDebugBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
this.LSdebugHidden = $('LSdebug_hidden');
|
|
|
|
this.LSdebugHidden.addEvent('click',this.onLSdebugHiddenClick.bindWithEvent(this));
|
|
|
|
this.LSerror = $('LSerror');
|
|
|
|
this.LSerror.setOpacity(0);
|
|
|
|
if (this.LSerror.innerHTML != '') {
|
|
|
|
this.displayLSerror();
|
|
|
|
}
|
2008-02-26 18:40:05 +01:00
|
|
|
|
|
|
|
this.loading_img=[];
|
|
|
|
LSdebug(this.loading_img);
|
|
|
|
this.loading_img_id=-1;
|
2008-04-25 15:48:12 +02:00
|
|
|
|
|
|
|
this.LSsession_topDn = $('LSsession_topDn');
|
|
|
|
if (this.LSsession_topDn) {
|
|
|
|
this.LSsession_topDn.addEvent('change',this.onLSsession_topDnChange.bind(this));
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onLSsession_topDnChange: function() {
|
|
|
|
$('LSsession_topDn_form').submit();
|
2008-02-05 17:11:21 +01:00
|
|
|
},
|
|
|
|
|
2008-02-08 18:39:24 +01:00
|
|
|
onLSdebugHiddenClick: function(event){
|
|
|
|
new Event(event).stop();
|
|
|
|
new Fx.Style(this.LSdebug,'opacity',{duration:500}).start(1,0);
|
|
|
|
},
|
2008-02-05 17:11:21 +01:00
|
|
|
|
2008-02-08 18:39:24 +01:00
|
|
|
displayDebugBox: function() {
|
2008-02-26 18:40:05 +01:00
|
|
|
this.LSdebug.setStyle('top',getScrollTop()+10);
|
2008-02-08 18:39:24 +01:00
|
|
|
new Fx.Style(this.LSdebug,'opacity',{duration:500}).start(0,0.8);
|
|
|
|
},
|
2008-02-05 17:11:21 +01:00
|
|
|
|
2008-02-08 18:39:24 +01:00
|
|
|
displayError: function(html) {
|
|
|
|
this.LSerror.empty();
|
|
|
|
this.LSerror.setHTML(html);
|
|
|
|
this.displayLSerror();
|
|
|
|
},
|
2008-02-05 17:11:21 +01:00
|
|
|
|
2008-04-25 15:48:12 +02:00
|
|
|
displayDebug: function(html) {
|
|
|
|
this.LSdebug.empty();
|
|
|
|
this.LSdebug.setHTML(html);
|
|
|
|
this.displayDebugBox();
|
|
|
|
},
|
|
|
|
|
2008-02-08 18:39:24 +01:00
|
|
|
displayLSerror: function() {
|
2008-02-26 18:40:05 +01:00
|
|
|
this.LSerror.setStyle('top',getScrollTop()+10);
|
2008-02-08 18:39:24 +01:00
|
|
|
new Fx.Style(this.LSerror,'opacity',{duration:500}).start(0,0.8);
|
|
|
|
(function(){new Fx.Style(this.LSerror,'opacity',{duration:500}).start(0.8,0);}).delay(5000, this);
|
|
|
|
},
|
2008-02-05 17:11:21 +01:00
|
|
|
|
2008-02-26 18:40:05 +01:00
|
|
|
loadingImgDisplay: function(el,position) {
|
|
|
|
this.loading_img_id++;
|
|
|
|
this.loading_img[this.loading_img_id] = new Element('img');
|
|
|
|
this.loading_img[this.loading_img_id].src='templates/images/ajax-loader.gif';
|
|
|
|
if (position=='inside') {
|
|
|
|
this.loading_img[this.loading_img_id].injectInside(el);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
this.loading_img[this.loading_img_id].injectAfter(el);
|
|
|
|
}
|
|
|
|
LSdebug(this.loading_img_id);
|
|
|
|
return this.loading_img_id;
|
2008-02-08 18:39:24 +01:00
|
|
|
},
|
2008-02-05 17:11:21 +01:00
|
|
|
|
2008-02-26 18:40:05 +01:00
|
|
|
loadingImgHide: function(id) {
|
|
|
|
if (isNaN(id)) {
|
|
|
|
this.loading_img.each(function(el) {
|
|
|
|
if (typeof(el) != 'undefined')
|
|
|
|
el.remove();
|
|
|
|
},this);
|
|
|
|
this.loading_img_id=-1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
this.loading_img[id].remove();
|
|
|
|
}
|
2008-02-08 18:39:24 +01:00
|
|
|
}
|
2008-02-05 17:11:21 +01:00
|
|
|
|
|
|
|
});
|
|
|
|
window.addEvent(window.ie ? 'load' : 'domready', function() {
|
2008-02-08 18:39:24 +01:00
|
|
|
varLSdefault = new LSdefault();
|
2008-02-05 17:11:21 +01:00
|
|
|
});
|
|
|
|
|
2008-02-26 18:40:05 +01:00
|
|
|
LSdebug_active = 0;
|
2008-02-05 17:11:21 +01:00
|
|
|
|
|
|
|
function LSdebug() {
|
|
|
|
if (LSdebug_active != 1) return;
|
|
|
|
if (typeof console == 'undefined') return;
|
|
|
|
console.log.apply(this, arguments);
|
|
|
|
}
|