2008-02-08 18:39:24 +01:00
|
|
|
var LSview = new Class({
|
|
|
|
initialize: function(){
|
|
|
|
$$('td.LSobject-list-names').each(function(el) {
|
|
|
|
el.addEvent('click',this.onTdLSobjectListNamesClick.bind(this,el));
|
|
|
|
}, this);
|
|
|
|
$$('td.LSobject-list-names').each(function(el) {
|
|
|
|
el.addEvent('mouseenter',this.onTdLSobjectListNamesOver.bind(this,el));
|
|
|
|
}, this);
|
|
|
|
$$('td.LSobject-list-names').each(function(el) {
|
|
|
|
el.addEvent('mouseleave',this.onTdLSobjectListNamesOut.bind(this,el));
|
|
|
|
}, this);
|
2008-11-10 15:00:43 +01:00
|
|
|
$$('a.LSobject-list-actions').each(function(el) {
|
|
|
|
var checkRemove = /remove\.php.*/;
|
|
|
|
if (checkRemove.exec(el.href)) {
|
|
|
|
el.addEvent('click',this.onRemoveListBtnClick.bindWithEvent(this,el));
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
$$('a.LSview-actions').each(function(el) {
|
|
|
|
var checkRemove = /remove\.php.*/;
|
|
|
|
if (checkRemove.exec(el.href)) {
|
|
|
|
el.addEvent('click',this.onRemoveViewBtnClick.bindWithEvent(this,el));
|
|
|
|
}
|
|
|
|
}, this);
|
2008-02-08 18:39:24 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
onTdLSobjectListNamesClick: function(td) {
|
|
|
|
window.location=td.getFirst().href;
|
|
|
|
},
|
|
|
|
|
|
|
|
onTdLSobjectListNamesOver: function(td){
|
|
|
|
td.imgEdit = new Element('img');
|
2008-10-09 03:31:33 +02:00
|
|
|
td.imgEdit.src = varLSdefault.imagePath('view.png');
|
2008-02-08 18:39:24 +01:00
|
|
|
td.imgEdit.injectInside(td);
|
|
|
|
},
|
|
|
|
|
|
|
|
onTdLSobjectListNamesOut: function(td) {
|
2008-07-05 22:28:49 +02:00
|
|
|
td.imgEdit.destroy();
|
2008-11-10 15:00:43 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
onRemoveListBtnClick: function(event,a) {
|
|
|
|
Event(event).stop();
|
|
|
|
if (!this._confirmBoxOpen) {
|
|
|
|
this._confirmBoxOpen = 1;
|
|
|
|
var name = a.getParent().getPrevious('td').getElement('a').innerHTML;
|
|
|
|
this.confirmBox = new LSconfirmBox({
|
2009-02-17 09:41:21 +01:00
|
|
|
text: varLSdefault.LSjsConfig['LSview_delete_label'] + ' "'+name+'" ?',
|
2008-11-10 15:00:43 +01:00
|
|
|
startElement: a,
|
|
|
|
onConfirm: this.removeFromA.bind(this,a),
|
|
|
|
onClose: this.onConfirmBoxClose.bind(this)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onRemoveViewBtnClick: function(event,a) {
|
|
|
|
Event(event).stop();
|
|
|
|
if (!this._confirmBoxOpen) {
|
|
|
|
this._confirmBoxOpen = 1;
|
|
|
|
var name = $('LSview_title').innerHTML;
|
|
|
|
this.confirmBox = new LSconfirmBox({
|
2009-02-17 09:41:21 +01:00
|
|
|
text: varLSdefault.LSjsConfig['LSview_delete_label'] + ' "'+name+'" ?',
|
2008-11-10 15:00:43 +01:00
|
|
|
startElement: a,
|
|
|
|
onConfirm: this.removeFromA.bind(this,a),
|
|
|
|
onClose: this.onConfirmBoxClose.bind(this)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onConfirmBoxClose: function() {
|
|
|
|
this._confirmBoxOpen = 0;
|
|
|
|
},
|
|
|
|
|
|
|
|
removeFromA: function(a) {
|
|
|
|
document.location = a.href+'&valid';
|
2008-02-08 18:39:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
window.addEvent(window.ie ? 'load' : 'domready', function() {
|
|
|
|
varLSview = new LSview();
|
|
|
|
});
|