MDL-42208 fix JS get_string usage and remove unnecessary params from auth password unmask init

This commit is contained in:
Petr Škoda 2013-10-23 07:32:24 +02:00
parent 6e0ace3885
commit a668a7e420
2 changed files with 5 additions and 5 deletions

View File

@ -78,9 +78,8 @@ echo '<p style="text-align: center"><input type="submit" value="' . get_string("
echo "</div>\n";
echo "</form>\n";
$unmask = get_string('unmaskpassword', 'core_form');
$attributes = array('formid' => 'authmenu', 'checkboxlabel' => $unmask);
$PAGE->requires->yui_module('moodle-auth-passwordunmask', 'M.auth.passwordunmask', array($attributes));
$PAGE->requires->string_for_js('unmaskpassword', 'core_form');
$PAGE->requires->yui_module('moodle-auth-passwordunmask', 'M.auth.passwordunmask');
echo $OUTPUT->footer();
exit;

View File

@ -6,11 +6,12 @@ YUI.add('moodle-auth-passwordunmask', function(Y) {
Y.extend(PASSWORDUNMASK, Y.Base, {
// Initialize checkboxes.
initializer : function(params) {
this.add_checkboxes(params.checkboxlabel);
this.add_checkboxes();
},
// Create checkboxes for all unmasking passwords.
add_checkboxes : function(checkboxlabel) {
add_checkboxes : function() {
Y.all('#authmenu input[type=password]').each(function(node) {
var checkboxlabel = M.util.get_string('unmaskpassword', 'core_form');
var elementid = node.get('id');
var elementname = node.get('name');