1 var LSview = new Class({
2 initialize: function(){
3 $$('td.LSobject-list-names').each(function(el) {
4 el.addEvent('click',this.onTdLSobjectListNamesClick.bind(this,el));
6 $$('td.LSobject-list-names').each(function(el) {
7 el.addEvent('mouseenter',this.onTdLSobjectListNamesOver.bind(this,el));
9 $$('td.LSobject-list-names').each(function(el) {
10 el.addEvent('mouseleave',this.onTdLSobjectListNamesOut.bind(this,el));
12 $$('a.LSobject-list-actions').each(function(el) {
13 var checkRemove = /remove\.php.*/;
14 if (checkRemove.exec(el.href)) {
15 el.addEvent('click',this.onRemoveListBtnClick.bindWithEvent(this,el));
18 $$('a.LSview-actions').each(function(el) {
19 var checkRemove = /remove\.php.*/;
20 if (checkRemove.exec(el.href)) {
21 el.addEvent('click',this.onRemoveViewBtnClick.bindWithEvent(this,el));
26 onTdLSobjectListNamesClick: function(td) {
27 window.location=td.getFirst().href;
30 onTdLSobjectListNamesOver: function(td){
31 td.imgEdit = new Element('img');
32 td.imgEdit.src = varLSdefault.imagePath('view.png');
33 td.imgEdit.injectInside(td);
36 onTdLSobjectListNamesOut: function(td) {
40 onRemoveListBtnClick: function(event,a) {
42 if (!this._confirmBoxOpen) {
43 this._confirmBoxOpen = 1;
44 var name = a.getParent().getPrevious('td').getElement('a').innerHTML;
45 this.confirmBox = new LSconfirmBox({
46 text: varLSdefault.LSjsConfig['LSview_delete_label'] + ' "'+name+'" ?',
48 onConfirm: this.removeFromA.bind(this,a),
49 onClose: this.onConfirmBoxClose.bind(this)
54 onRemoveViewBtnClick: function(event,a) {
56 if (!this._confirmBoxOpen) {
57 this._confirmBoxOpen = 1;
58 var name = $('LSview_title').innerHTML;
59 this.confirmBox = new LSconfirmBox({
60 text: varLSdefault.LSjsConfig['LSview_delete_confirm_text'] + ' "'+name+'" ?',
61 title: varLSdefault.LSjsConfig['LSview_delete_confirm_title'],
62 validate_label: varLSdefault.LSjsConfig['LSview_delete_confirm_yes_btn_label'],
63 cancel_label: varLSdefault.LSjsConfig['LSview_delete_confirm_no_btn_label'],
65 onConfirm: this.removeFromA.bind(this,a),
66 onClose: this.onConfirmBoxClose.bind(this)
71 onConfirmBoxClose: function() {
72 this._confirmBoxOpen = 0;
75 removeFromA: function(a) {
76 document.location = a.href+'&valid';
80 window.addEvent(window.ie ? 'load' : 'domready', function() {
81 varLSview = new LSview();