|
@@ -222,78 +222,6 @@ PWM_CHANGEPW.handleChangePasswordSubmit=function() {
|
|
|
PWM_VAR['dirtyPageLeaveFlag'] = false;
|
|
|
};
|
|
|
|
|
|
-PWM_CHANGEPW.doRandomGeneration=function(randomConfig) {
|
|
|
- randomConfig = randomConfig === undefined ? {} : randomConfig;
|
|
|
- var finishAction = 'finishAction' in randomConfig ? randomConfig['finishAction'] : function(password) {
|
|
|
- PWM_CHANGEPW.copyToPasswordFields(password)
|
|
|
- };
|
|
|
-
|
|
|
- var eventHandlers = [];
|
|
|
- var dialogBody = "";
|
|
|
- if (randomConfig['dialog'] != null && randomConfig['dialog'].length > 0) {
|
|
|
- dialogBody += randomConfig['dialog'];
|
|
|
- } else {
|
|
|
- dialogBody += PWM_MAIN.showString('Display_PasswordGeneration');
|
|
|
- }
|
|
|
- dialogBody += "<br/><br/>";
|
|
|
- dialogBody += '<table class="noborder">';
|
|
|
-
|
|
|
- for (var i = 0; i < 20; i++) {
|
|
|
- dialogBody += '<tr class="noborder">';
|
|
|
- for (var j = 0; j < 2; j++) {
|
|
|
- i = i + j;
|
|
|
- (function(index) {
|
|
|
- var elementID = "randomGen" + index;
|
|
|
- dialogBody += '<td class="noborder" style="padding-bottom: 5px;" width="20%"><div style="visibility:hidden" class="link-randomPasswordValue" href="#" id="' + elementID + '"> </div></td>';
|
|
|
- eventHandlers.push(function(){
|
|
|
- PWM_MAIN.addEventHandler(elementID,'click',function(){
|
|
|
- var value = PWM_MAIN.getObject(elementID).innerHTML;
|
|
|
- var parser = new DOMParser();
|
|
|
- var dom = parser.parseFromString(value, 'text/html');
|
|
|
- var domString = dom.body.textContent;
|
|
|
- finishAction(domString);
|
|
|
- });
|
|
|
- });
|
|
|
- })(i);
|
|
|
- }
|
|
|
- dialogBody += '</tr>';
|
|
|
- }
|
|
|
- dialogBody += "</table><br/><br/>";
|
|
|
-
|
|
|
- dialogBody += '<table class="noborder">';
|
|
|
- dialogBody += '<tr class="noborder"><td class="noborder"><button class="btn" id="moreRandomsButton" disabled="true"><span class="btn-icon pwm-icon pwm-icon-refresh"></span>' + PWM_MAIN.showString('Button_More') + '</button></td>';
|
|
|
- dialogBody += '<td class="noborder" style="text-align:right;"><button class="btn" id="cancelRandomsButton"><span class="btn-icon pwm-icon pwm-icon-times"></span>' + PWM_MAIN.showString('Button_Cancel') + '</button></td></tr>';
|
|
|
- dialogBody += "</table>";
|
|
|
-
|
|
|
- randomConfig['dialogBody'] = dialogBody;
|
|
|
-
|
|
|
- eventHandlers.push(function(){
|
|
|
- PWM_MAIN.addEventHandler('cancelRandomsButton','click',function(){
|
|
|
- PWM_MAIN.closeWaitDialog('dialogPopup');
|
|
|
- });
|
|
|
- PWM_MAIN.addEventHandler('moreRandomsButton','click',function(){
|
|
|
- PWM_CHANGEPW.beginFetchRandoms(randomConfig);
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- var titleString = randomConfig['title'] == null ? PWM_MAIN.showString('Title_RandomPasswords') : randomConfig['title'];
|
|
|
- PWM_MAIN.showDialog({
|
|
|
- title:titleString,
|
|
|
- dialogClass:'narrow',
|
|
|
- text:dialogBody,
|
|
|
- showOk:false,
|
|
|
- showClose:true,
|
|
|
- loadFunction:function(){
|
|
|
- PWM_CHANGEPW.beginFetchRandoms(randomConfig);
|
|
|
- for (var i = 0; i < eventHandlers.length; i++) {
|
|
|
- eventHandlers[i]();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
PWM_CHANGEPW.beginFetchRandoms=function(randomConfig) {
|
|
|
PWM_MAIN.getObject('moreRandomsButton').disabled = true;
|
|
|
var fetchList = new Array();
|
|
@@ -369,9 +297,9 @@ PWM_CHANGEPW.startupChangePasswordPage=function() {
|
|
|
var autoGenPasswordElement = PWM_MAIN.getObject("autogenerate-icon");
|
|
|
if (autoGenPasswordElement != null) {
|
|
|
autoGenPasswordElement.style.visibility = 'visible';
|
|
|
- PWM_MAIN.addEventHandler(autoGenPasswordElement,'click',function(){
|
|
|
- PWM_CHANGEPW.doRandomGeneration();
|
|
|
- });
|
|
|
+ // PWM_MAIN.addEventHandler(autoGenPasswordElement,'click',function(){
|
|
|
+ // PWM_CHANGEPW.doRandomGeneration();
|
|
|
+ // });
|
|
|
PWM_MAIN.showTooltip({
|
|
|
id: "autogenerate-icon",
|
|
|
text: PWM_MAIN.showString('Display_AutoGeneratedPassword')
|