2009-01-21 18:08:09 +01:00
|
|
|
var LSformElement_maildir_field = new Class({
|
|
|
|
initialize: function(name,input){
|
|
|
|
this.name = name;
|
|
|
|
this.input = input;
|
|
|
|
this.params = varLSdefault.getParams(this.name);
|
|
|
|
this.initialiseLSformElement_maildir_field();
|
|
|
|
},
|
|
|
|
|
|
|
|
initialiseLSformElement_maildir_field: function() {
|
|
|
|
if (!$type(varLSform.idform)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if ($type(this.params.LSform[varLSform.idform])) {
|
|
|
|
this.doBtn = new Element('img');
|
|
|
|
this.doBtn.addClass('btn');
|
|
|
|
this.doBtn.addEvent('click',this.onDoBtnClick.bind(this));
|
|
|
|
this.doInput = new Element('input');
|
|
|
|
this.doInput.setProperties({
|
|
|
|
name: 'LSformElement_maildir_' + this.name + '_do',
|
|
|
|
type: 'hidden'
|
|
|
|
});
|
|
|
|
if (this.params.LSform[varLSform.idform]) {
|
|
|
|
this.doInput.value = 1;
|
2013-06-19 02:17:39 +02:00
|
|
|
this.doBtn.src = varLSdefault.imagePath('maildir_do');
|
2009-01-21 18:08:09 +01:00
|
|
|
varLSdefault.addHelpInfo(this.doBtn,'LSformElement_maildir','do');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
this.doInput.value = 0;
|
2013-06-19 02:17:39 +02:00
|
|
|
this.doBtn.src = varLSdefault.imagePath('maildir_nodo');
|
2009-01-21 18:08:09 +01:00
|
|
|
varLSdefault.addHelpInfo(this.doBtn,'LSformElement_maildir','nodo');
|
|
|
|
}
|
|
|
|
this.doBtn.injectAfter(this.input);
|
|
|
|
this.doInput.injectAfter(this.doBtn);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onDoBtnClick: function() {
|
|
|
|
if (this.doInput.value==0) {
|
|
|
|
this.doInput.value = 1;
|
2013-06-19 02:17:39 +02:00
|
|
|
this.doBtn.src = varLSdefault.imagePath('maildir_do');
|
2009-01-21 18:08:09 +01:00
|
|
|
varLSdefault.setHelpInfo(this.doBtn,'LSformElement_maildir','do');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
this.doInput.value = 0;
|
2013-06-19 02:17:39 +02:00
|
|
|
this.doBtn.src = varLSdefault.imagePath('maildir_nodo');
|
2009-01-21 18:08:09 +01:00
|
|
|
varLSdefault.setHelpInfo(this.doBtn,'LSformElement_maildir','nodo');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|