Merge branch 'MDL-30438_b' of git://github.com/rwijaya/moodle

This commit is contained in:
Damyon Wiese
2013-03-26 14:29:57 +08:00
4 changed files with 47 additions and 30 deletions
+4 -3
View File
@@ -7,18 +7,19 @@ YUI.add('moodle-form-passwordunmask', function(Y) {
//Initialize checkbox if id is passed
initializer : function(params) {
if (params && params.formid) {
this.add_checkbox(params.formid, params.checkboxname);
this.add_checkbox(params.formid, params.checkboxlabel, params.checkboxname);
}
},
//Create checkbox for unmasking password
add_checkbox : function(elementid, checkboxlabel) {
add_checkbox : function(elementid, checkboxlabel, checkboxname) {
var node = Y.one('#'+elementid);
//retaining unmask div from previous implementation.
var unmaskdiv = Y.Node.create('<div id="'+elementid+'unmaskdiv" class="unmask"></div>');
//Add checkbox for unmasking to unmaskdiv
var unmaskchb = Y.Node.create('<input id="'+elementid+'unmask" type="checkbox">');
var unmaskchb = Y.Node.create('<input id="'+elementid+'unmask" type="checkbox" name="'+
checkboxname+'unmask">');
unmaskdiv.appendChild(unmaskchb);
//Attach event using static javascript function for unmasking password.
unmaskchb.on('click', function() {unmaskPassword(elementid);});