mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 20:53:53 +01:00
Merge branch 'MDL-43302-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
f27e462b5f
44
lib/form/yui/build/moodle-form-passwordunmask/moodle-form-passwordunmask-debug.js
vendored
Normal file
44
lib/form/yui/build/moodle-form-passwordunmask/moodle-form-passwordunmask-debug.js
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
YUI.add('moodle-form-passwordunmask', function (Y, NAME) {
|
||||
|
||||
var PASSWORDUNMASK = function() {
|
||||
PASSWORDUNMASK.superclass.constructor.apply(this, arguments);
|
||||
};
|
||||
|
||||
Y.extend(PASSWORDUNMASK, Y.Base, {
|
||||
// Initialize checkbox if id is passed.
|
||||
initializer : function(params) {
|
||||
if (params && params.formid) {
|
||||
this.add_checkbox(params.formid, params.checkboxlabel, params.checkboxname);
|
||||
}
|
||||
},
|
||||
|
||||
// Create checkbox for unmasking password.
|
||||
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" name="'+
|
||||
checkboxname+'unmask">');
|
||||
unmaskdiv.appendChild(unmaskchb);
|
||||
// Attach event using static javascript function for unmasking password.
|
||||
unmaskchb.on('click', function() {unmaskPassword(elementid);});
|
||||
|
||||
// Add label for checkbox to unmaskdiv.
|
||||
var unmasklabel = Y.Node.create('<label for="'+elementid+'unmask">'+checkboxlabel+'</label>');
|
||||
unmaskdiv.appendChild(unmasklabel);
|
||||
|
||||
// Insert unmask div in the same div as password input.
|
||||
node.get('parentNode').insert(unmaskdiv, node.get('lastNode'));
|
||||
}
|
||||
});
|
||||
|
||||
M.form = M.form || {};
|
||||
M.form.passwordunmask = function(params) {
|
||||
return new PASSWORDUNMASK(params);
|
||||
};
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["node", "base"]});
|
1
lib/form/yui/build/moodle-form-passwordunmask/moodle-form-passwordunmask-min.js
vendored
Normal file
1
lib/form/yui/build/moodle-form-passwordunmask/moodle-form-passwordunmask-min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
YUI.add("moodle-form-passwordunmask",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(e){e&&e.formid&&this.add_checkbox(e.formid,e.checkboxlabel,e.checkboxname)},add_checkbox:function(t,n,r){var i=e.one("#"+t),s=e.Node.create('<div id="'+t+'unmaskdiv" class="unmask"></div>'),o=e.Node.create('<input id="'+t+'unmask" type="checkbox" name="'+r+'unmask">');s.appendChild(o),o.on("click",function(){unmaskPassword(t)});var u=e.Node.create('<label for="'+t+'unmask">'+n+"</label>");s.appendChild(u),i.get("parentNode").insert(s,i.get("lastNode"))}}),M.form=M.form||{},M.form.passwordunmask=function(e){return new n(e)}},"@VERSION@",{requires:["node","base"]});
|
44
lib/form/yui/build/moodle-form-passwordunmask/moodle-form-passwordunmask.js
vendored
Normal file
44
lib/form/yui/build/moodle-form-passwordunmask/moodle-form-passwordunmask.js
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
YUI.add('moodle-form-passwordunmask', function (Y, NAME) {
|
||||
|
||||
var PASSWORDUNMASK = function() {
|
||||
PASSWORDUNMASK.superclass.constructor.apply(this, arguments);
|
||||
};
|
||||
|
||||
Y.extend(PASSWORDUNMASK, Y.Base, {
|
||||
// Initialize checkbox if id is passed.
|
||||
initializer : function(params) {
|
||||
if (params && params.formid) {
|
||||
this.add_checkbox(params.formid, params.checkboxlabel, params.checkboxname);
|
||||
}
|
||||
},
|
||||
|
||||
// Create checkbox for unmasking password.
|
||||
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" name="'+
|
||||
checkboxname+'unmask">');
|
||||
unmaskdiv.appendChild(unmaskchb);
|
||||
// Attach event using static javascript function for unmasking password.
|
||||
unmaskchb.on('click', function() {unmaskPassword(elementid);});
|
||||
|
||||
// Add label for checkbox to unmaskdiv.
|
||||
var unmasklabel = Y.Node.create('<label for="'+elementid+'unmask">'+checkboxlabel+'</label>');
|
||||
unmaskdiv.appendChild(unmasklabel);
|
||||
|
||||
// Insert unmask div in the same div as password input.
|
||||
node.get('parentNode').insert(unmaskdiv, node.get('lastNode'));
|
||||
}
|
||||
});
|
||||
|
||||
M.form = M.form || {};
|
||||
M.form.passwordunmask = function(params) {
|
||||
return new PASSWORDUNMASK(params);
|
||||
};
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["node", "base"]});
|
40
lib/form/yui/passwordunmask/passwordunmask.js
vendored
40
lib/form/yui/passwordunmask/passwordunmask.js
vendored
@ -1,40 +0,0 @@
|
||||
YUI.add('moodle-form-passwordunmask', function(Y) {
|
||||
var PASSWORDUNMASK = function() {
|
||||
PASSWORDUNMASK.superclass.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
Y.extend(PASSWORDUNMASK, Y.Base, {
|
||||
//Initialize checkbox if id is passed
|
||||
initializer : function(params) {
|
||||
if (params && params.formid) {
|
||||
this.add_checkbox(params.formid, params.checkboxlabel, params.checkboxname);
|
||||
}
|
||||
},
|
||||
//Create checkbox for unmasking password
|
||||
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" name="'+
|
||||
checkboxname+'unmask">');
|
||||
unmaskdiv.appendChild(unmaskchb);
|
||||
//Attach event using static javascript function for unmasking password.
|
||||
unmaskchb.on('click', function() {unmaskPassword(elementid);});
|
||||
|
||||
//Add label for checkbox to unmaskdiv
|
||||
var unmasklabel = Y.Node.create('<label for="'+elementid+'unmask">'+checkboxlabel+'</label>');
|
||||
unmaskdiv.appendChild(unmasklabel);
|
||||
|
||||
//Insert unmask div in the same div as password input.
|
||||
node.get('parentNode').insert(unmaskdiv, node.get('lastNode'));
|
||||
}
|
||||
});
|
||||
|
||||
M.form = M.form || {};
|
||||
M.form.passwordunmask = function(params) {
|
||||
return new PASSWORDUNMASK(params);
|
||||
}
|
||||
}, '@VERSION@', {requires:['base', 'node']});
|
10
lib/form/yui/src/passwordunmask/build.json
Normal file
10
lib/form/yui/src/passwordunmask/build.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "moodle-form-passwordunmask",
|
||||
"builds": {
|
||||
"moodle-form-passwordunmask": {
|
||||
"jsfiles": [
|
||||
"passwordunmask.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
39
lib/form/yui/src/passwordunmask/js/passwordunmask.js
vendored
Normal file
39
lib/form/yui/src/passwordunmask/js/passwordunmask.js
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
var PASSWORDUNMASK = function() {
|
||||
PASSWORDUNMASK.superclass.constructor.apply(this, arguments);
|
||||
};
|
||||
|
||||
Y.extend(PASSWORDUNMASK, Y.Base, {
|
||||
// Initialize checkbox if id is passed.
|
||||
initializer : function(params) {
|
||||
if (params && params.formid) {
|
||||
this.add_checkbox(params.formid, params.checkboxlabel, params.checkboxname);
|
||||
}
|
||||
},
|
||||
|
||||
// Create checkbox for unmasking password.
|
||||
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" name="'+
|
||||
checkboxname+'unmask">');
|
||||
unmaskdiv.appendChild(unmaskchb);
|
||||
// Attach event using static javascript function for unmasking password.
|
||||
unmaskchb.on('click', function() {unmaskPassword(elementid);});
|
||||
|
||||
// Add label for checkbox to unmaskdiv.
|
||||
var unmasklabel = Y.Node.create('<label for="'+elementid+'unmask">'+checkboxlabel+'</label>');
|
||||
unmaskdiv.appendChild(unmasklabel);
|
||||
|
||||
// Insert unmask div in the same div as password input.
|
||||
node.get('parentNode').insert(unmaskdiv, node.get('lastNode'));
|
||||
}
|
||||
});
|
||||
|
||||
M.form = M.form || {};
|
||||
M.form.passwordunmask = function(params) {
|
||||
return new PASSWORDUNMASK(params);
|
||||
};
|
8
lib/form/yui/src/passwordunmask/meta/passwordunmask.json
Normal file
8
lib/form/yui/src/passwordunmask/meta/passwordunmask.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"moodle-form-passwordunmask": {
|
||||
"requires": [
|
||||
"node",
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user