2010-02-03 16:53:41 +00:00
|
|
|
|
2011-11-02 11:24:44 +01:00
|
|
|
M.report_participation = {};
|
2010-02-03 16:53:41 +00:00
|
|
|
|
2011-11-02 11:24:44 +01:00
|
|
|
M.report_participation.init = function(Y) {
|
2010-02-03 16:53:41 +00:00
|
|
|
|
|
|
|
Y.on('submit', function(e) {
|
|
|
|
Y.one('#formactionselect').get('options').each(function() {
|
|
|
|
if (this.get('selected') && this.get('value') == '') {
|
|
|
|
// no action selected
|
|
|
|
e.preventDefault();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
var ok = false;
|
|
|
|
Y.all('input.usercheckbox').each(function() {
|
|
|
|
if (this.get('checked')) {
|
|
|
|
ok = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if (!ok) {
|
|
|
|
// no checkbox selected
|
|
|
|
e.preventDefault();
|
|
|
|
}
|
|
|
|
}, '#studentsform');
|
|
|
|
|
|
|
|
Y.on('click', function(e) {
|
|
|
|
Y.all('input.usercheckbox').each(function() {
|
|
|
|
this.set('checked', 'checked');
|
|
|
|
});
|
|
|
|
}, '#checkall');
|
|
|
|
|
|
|
|
Y.on('click', function(e) {
|
|
|
|
Y.all('input.usercheckbox').each(function() {
|
|
|
|
this.set('checked', '');
|
|
|
|
});
|
|
|
|
}, '#checknone');
|
|
|
|
|
|
|
|
Y.on('click', function(e) {
|
|
|
|
Y.all('input.usercheckbox').each(function() {
|
|
|
|
if (this.get('value') == 0) {
|
|
|
|
this.set('checked', 'checked');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}, '#checknos');
|
|
|
|
};
|