Explorar el Código

de-dojoficiation of js

Jason Rivard hace 3 años
padre
commit
a114ae0ae7

+ 4 - 4
webapp/src/main/webapp/WEB-INF/jsp/configmanager-wordlists.jsp

@@ -50,13 +50,13 @@
         <table class="noborder">
         <table class="noborder">
             <tr class="buttonrow">
             <tr class="buttonrow">
                 <td class="buttoncell">
                 <td class="buttoncell">
-                    <button class="menubutton" id="MenuItem_UploadWordlist" style="visibility: hidden;">
+                    <button class="hidden menubutton" id="MenuItem_UploadWordlist">
                         <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-upload"></span></pwm:if>
                         <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-upload"></span></pwm:if>
                         Upload Word List
                         Upload Word List
                     </button>
                     </button>
                 </td>
                 </td>
                 <td class="buttoncell">
                 <td class="buttoncell">
-                    <button class="menubutton" id="MenuItem_ClearWordlist" style="visibility: hidden;">
+                    <button class="hidden menubutton" id="MenuItem_ClearWordlist">
                         <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-trash"></span></pwm:if>
                         <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-trash"></span></pwm:if>
                         Clear Word List
                         Clear Word List
                     </button>
                     </button>
@@ -72,13 +72,13 @@
         <table class="noborder">
         <table class="noborder">
             <tr class="buttonrow">
             <tr class="buttonrow">
                 <td class="buttoncell">
                 <td class="buttoncell">
-                    <button class="menubutton" id="MenuItem_UploadSeedlist" style="visibility: hidden;">
+                    <button class="hidden menubutton" id="MenuItem_UploadSeedlist">
                         <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-upload"></span></pwm:if>
                         <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-upload"></span></pwm:if>
                         Upload Seed List
                         Upload Seed List
                     </button>
                     </button>
                 </td>
                 </td>
                 <td class="buttoncell">
                 <td class="buttoncell">
-                    <button class="menubutton" id="MenuItem_ClearSeedlist" style="visibility: hidden;">
+                    <button class="hidden menubutton" id="MenuItem_ClearSeedlist">
                         <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-trash"></span></pwm:if>
                         <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-trash"></span></pwm:if>
                         Clear Seed List
                         Clear Seed List
                     </button>
                     </button>

+ 0 - 1
webapp/src/main/webapp/public/resources/js/changepassword.js

@@ -335,7 +335,6 @@ PWM_CHANGEPW.fetchRandoms=function(randomConfig) {
             var element = PWM_MAIN.getObject(elementID);
             var element = PWM_MAIN.getObject(elementID);
             if (element !== null) {
             if (element !== null) {
                 element.innerHTML = password;
                 element.innerHTML = password;
-                PWM_MAIN.setStyle(elementID,'visibility','visible');
             }
             }
             PWM_CHANGEPW.fetchRandoms(randomConfig);
             PWM_CHANGEPW.fetchRandoms(randomConfig);
         };
         };

+ 7 - 7
webapp/src/main/webapp/public/resources/js/configeditor.js

@@ -137,11 +137,11 @@ PWM_CFGEDIT.readSetting = function(keyName, valueWriter) {
         const showSetting = (PWM_SETTINGS['settings'][keyName] && PWM_SETTINGS['settings'][keyName]['syntax'] === 'PROFILE') ||   (!modifiedOnly || !isDefault) && (maxLevel < 0 || settingLevel  <= maxLevel );
         const showSetting = (PWM_SETTINGS['settings'][keyName] && PWM_SETTINGS['settings'][keyName]['syntax'] === 'PROFILE') ||   (!modifiedOnly || !isDefault) && (maxLevel < 0 || settingLevel  <= maxLevel );
         if (showSetting) {
         if (showSetting) {
             valueWriter(resultValue);
             valueWriter(resultValue);
-            PWM_MAIN.setStyle('outline_' + keyName,'display','inherit');
+            PWM_MAIN.removeCssClass('outline_' + keyName,'nodisplay');
             PWM_CFGEDIT.updateSettingDisplay(keyName, isDefault);
             PWM_CFGEDIT.updateSettingDisplay(keyName, isDefault);
             PWM_CFGEDIT.updateLastModifiedInfo(keyName, data);
             PWM_CFGEDIT.updateLastModifiedInfo(keyName, data);
         } else {
         } else {
-            PWM_MAIN.setStyle('outline_' + keyName,'display','none');
+            PWM_MAIN.addCssClass('outline_' + keyName,'nodisplay');
             PWM_VAR['skippedSettingCount']++;
             PWM_VAR['skippedSettingCount']++;
             if (PWM_VAR['skippedSettingCount'] > 0 && PWM_MAIN.getObject('panel-skippedSettingInfo')) {
             if (PWM_VAR['skippedSettingCount'] > 0 && PWM_MAIN.getObject('panel-skippedSettingInfo')) {
                 PWM_MAIN.getObject('panel-skippedSettingInfo').innerHTML = "" + PWM_VAR['skippedSettingCount'] + " items are not shown due to filter settings."
                 PWM_MAIN.getObject('panel-skippedSettingInfo').innerHTML = "" + PWM_VAR['skippedSettingCount'] + " items are not shown due to filter settings."
@@ -1041,7 +1041,7 @@ PWM_CFGEDIT.drawHtmlOutlineForSetting = function(settingInfo, options) {
     options = options === undefined ? {} : options;
     options = options === undefined ? {} : options;
     const settingKey = settingInfo['key'];
     const settingKey = settingInfo['key'];
     const settingLabel = settingInfo['label'];
     const settingLabel = settingInfo['label'];
-    let htmlBody = '<div id="outline_' + settingKey + '" class="setting_outline" style="display:none">'
+    let htmlBody = '<div id="outline_' + settingKey + '" class="setting_outline nodisplay">'
         + '<div class="setting_title" id="title_' + settingKey + '">'
         + '<div class="setting_title" id="title_' + settingKey + '">'
         + '<a id="setting-' + settingKey + '" class="text">' + settingLabel + '</a>'
         + '<a id="setting-' + settingKey + '" class="text">' + settingLabel + '</a>'
         + '<div class="pwm-icon pwm-icon-pencil-square modifiedNoticeIcon" title="' + PWM_CONFIG.showString('Tooltip_ModifiedNotice') + '" id="modifiedNoticeIcon-' + settingKey + '" style="display: none" ></div>';
         + '<div class="pwm-icon pwm-icon-pencil-square modifiedNoticeIcon" title="' + PWM_CONFIG.showString('Tooltip_ModifiedNotice') + '" id="modifiedNoticeIcon-' + settingKey + '" style="display: none" ></div>';
@@ -1100,11 +1100,11 @@ PWM_CFGEDIT.initSettingDisplay = function(setting, options) {
 PWM_CFGEDIT.drawNavigationMenu = function(nextFunction) {
 PWM_CFGEDIT.drawNavigationMenu = function(nextFunction) {
     console.log('drawNavigationMenu')
     console.log('drawNavigationMenu')
     PWM_MAIN.getObject('navigationTree').innerHTML = '';
     PWM_MAIN.getObject('navigationTree').innerHTML = '';
-    PWM_MAIN.setStyle('navigationTreeWrapper','display','none');
+    //PWM_MAIN.setStyle('navigationTreeWrapper','display','none');
 
 
     const makeTreeFunction = function(menuTreeData) {
     const makeTreeFunction = function(menuTreeData) {
-        require(["dojo/_base/window", "dojo/store/Memory", "dijit/tree/ObjectStoreModel", "dijit/Tree","dijit","dojo/domReady!"],
-            function(win, Memory, ObjectStoreModel, Tree)
+        require(["dojo","dojo/_base/window", "dojo/store/Memory", "dijit/tree/ObjectStoreModel", "dijit/Tree","dijit","dojo/domReady!"],
+            function(dojo, win, Memory, ObjectStoreModel, Tree)
             {
             {
                 PWM_MAIN.clearDijitWidget('navigationTree');
                 PWM_MAIN.clearDijitWidget('navigationTree');
                 // Create test store, adding the getChildren() method required by ObjectStoreModel
                 // Create test store, adding the getChildren() method required by ObjectStoreModel
@@ -1151,7 +1151,7 @@ PWM_CFGEDIT.drawNavigationMenu = function(nextFunction) {
                 PWM_MAIN.getObject('navigationTree').innerHTML = '';
                 PWM_MAIN.getObject('navigationTree').innerHTML = '';
                 tree.placeAt(PWM_MAIN.getObject('navigationTree'));
                 tree.placeAt(PWM_MAIN.getObject('navigationTree'));
                 tree.startup();
                 tree.startup();
-                PWM_MAIN.setStyle('navigationTreeWrapper','display','inherit');
+                //PWM_MAIN.setStyle('navigationTreeWrapper','display','inherit');
                 PWM_VAR['navigationTree'] = tree; // used for expand/collapse button events;
                 PWM_VAR['navigationTree'] = tree; // used for expand/collapse button events;
                 console.log('completed menu tree drawing');
                 console.log('completed menu tree drawing');
             }
             }

+ 70 - 73
webapp/src/main/webapp/public/resources/js/configmanager.js

@@ -26,8 +26,8 @@ var PWM_GLOBAL = PWM_GLOBAL || {};
 PWM_CONFIG.lockConfiguration=function() {
 PWM_CONFIG.lockConfiguration=function() {
     PWM_MAIN.showConfirmDialog({text:PWM_CONFIG.showString('Confirm_LockConfig'),okAction:function(){
     PWM_MAIN.showConfirmDialog({text:PWM_CONFIG.showString('Confirm_LockConfig'),okAction:function(){
             PWM_MAIN.showWaitDialog({loadFunction:function() {
             PWM_MAIN.showWaitDialog({loadFunction:function() {
-                    var url = 'ConfigManager?processAction=lockConfiguration';
-                    var loadFunction = function(data) {
+                    const url = 'ConfigManager?processAction=lockConfiguration';
+                    const loadFunction = function (data) {
                         if (data['error'] === true) {
                         if (data['error'] === true) {
                             PWM_MAIN.closeWaitDialog();
                             PWM_MAIN.closeWaitDialog();
                             PWM_MAIN.showDialog({
                             PWM_MAIN.showDialog({
@@ -44,13 +44,13 @@ PWM_CONFIG.lockConfiguration=function() {
 };
 };
 
 
 PWM_CONFIG.waitForRestart=function(options) {
 PWM_CONFIG.waitForRestart=function(options) {
-    var pingCycleTimeMs = 1000;
-    var maxWaitTimeMs = 120 * 1000;
+    const pingCycleTimeMs = 1000;
+    const maxWaitTimeMs = 120 * 1000;
 
 
     PWM_VAR['cancelHeartbeatCheck'] = true;
     PWM_VAR['cancelHeartbeatCheck'] = true;
 
 
-    var restartFunction = function() {
-        var redirectUrl = 'location' in options ? options['location'] : '/';
+    const restartFunction = function () {
+        const redirectUrl = 'location' in options ? options['location'] : '/';
         console.log("application appears to be restarted, redirecting to context url: " + redirectUrl);
         console.log("application appears to be restarted, redirecting to context url: " + redirectUrl);
         PWM_MAIN.gotoUrl(redirectUrl);
         PWM_MAIN.gotoUrl(redirectUrl);
     };
     };
@@ -59,22 +59,22 @@ PWM_CONFIG.waitForRestart=function(options) {
     if (!('failbackStartTime' in options)) {
     if (!('failbackStartTime' in options)) {
         options['failbackStartTime'] = Date.now();
         options['failbackStartTime'] = Date.now();
     } else {
     } else {
-        var elapsedMs = Date.now() - options['failbackStartTime'];
+        const elapsedMs = Date.now() - options['failbackStartTime'];
         if (elapsedMs > maxWaitTimeMs) {
         if (elapsedMs > maxWaitTimeMs) {
             restartFunction();
             restartFunction();
             return;
             return;
         }
         }
     }
     }
 
 
-    var originalRuntimeNonce = PWM_GLOBAL['runtimeNonce'];
+    const originalRuntimeNonce = PWM_GLOBAL['runtimeNonce'];
 
 
     console.log("beginning request to determine application status: ");
     console.log("beginning request to determine application status: ");
-    var loadFunction = function(data) {
+    const loadFunction = function (data) {
         try {
         try {
             if (data['error']) {
             if (data['error']) {
                 console.log('data error reading /ping endpoint: ' + JSON.stringify(data));
                 console.log('data error reading /ping endpoint: ' + JSON.stringify(data));
             } else {
             } else {
-                var currentNonce = data['data']['runtimeNonce'];
+                const currentNonce = data['data']['runtimeNonce'];
                 console.log("comparing declared nonce=" + originalRuntimeNonce + " and xhr read nonce=" + currentNonce);
                 console.log("comparing declared nonce=" + originalRuntimeNonce + " and xhr read nonce=" + currentNonce);
                 if (currentNonce !== originalRuntimeNonce) {
                 if (currentNonce !== originalRuntimeNonce) {
                     console.log("change detected, restarting page");
                     console.log("change detected, restarting page");
@@ -87,23 +87,23 @@ PWM_CONFIG.waitForRestart=function(options) {
         } catch (e) {
         } catch (e) {
             console.log("can't read current server nonce, will retry detection (current error: " + e + ")");
             console.log("can't read current server nonce, will retry detection (current error: " + e + ")");
         }
         }
-        setTimeout(function() {
+        setTimeout(function () {
             PWM_CONFIG.waitForRestart(options)
             PWM_CONFIG.waitForRestart(options)
         }, pingCycleTimeMs);
         }, pingCycleTimeMs);
     };
     };
-    var errorFunction = function(error) {
-        setTimeout(function() {
+    const errorFunction = function (error) {
+        setTimeout(function () {
             PWM_CONFIG.waitForRestart(options)
             PWM_CONFIG.waitForRestart(options)
         }, pingCycleTimeMs);
         }, pingCycleTimeMs);
         console.log('Waiting for server restart, unable to contact server: ' + error);
         console.log('Waiting for server restart, unable to contact server: ' + error);
     };
     };
-    var url = PWM_GLOBAL['url-context'] + "/public/api?processAction=ping";
+    const url = PWM_GLOBAL['url-context'] + "/public/api?processAction=ping";
     PWM_MAIN.ajaxRequest(url,loadFunction,{errorFunction:errorFunction,method:'GET',preventCache:true});
     PWM_MAIN.ajaxRequest(url,loadFunction,{errorFunction:errorFunction,method:'GET',preventCache:true});
 };
 };
 
 
 PWM_CONFIG.uploadConfigDialog=function() {
 PWM_CONFIG.uploadConfigDialog=function() {
     PWM_MAIN.preloadAll(function() {
     PWM_MAIN.preloadAll(function() {
-        var uploadOptions = {};
+        const uploadOptions = {};
         uploadOptions['url'] = window.location.pathname + '?processAction=uploadConfig';
         uploadOptions['url'] = window.location.pathname + '?processAction=uploadConfig';
         uploadOptions['title'] = 'Upload Configuration';
         uploadOptions['title'] = 'Upload Configuration';
         uploadOptions['nextFunction'] = function () {
         uploadOptions['nextFunction'] = function () {
@@ -122,7 +122,7 @@ PWM_CONFIG.uploadLocalDB=function() {
         PWM_MAIN.showConfirmDialog({
         PWM_MAIN.showConfirmDialog({
             text: PWM_CONFIG.showString('Confirm_UploadLocalDB'),
             text: PWM_CONFIG.showString('Confirm_UploadLocalDB'),
             okAction: function () {
             okAction: function () {
-                var uploadOptions = {};
+                const uploadOptions = {};
                 uploadOptions['url'] = 'localdb?processAction=importLocalDB';
                 uploadOptions['url'] = 'localdb?processAction=importLocalDB';
                 uploadOptions['title'] = 'Upload and Import LocalDB Archive';
                 uploadOptions['title'] = 'Upload and Import LocalDB Archive';
                 uploadOptions['nextFunction'] = function () {
                 uploadOptions['nextFunction'] = function () {
@@ -152,14 +152,15 @@ PWM_CONFIG.openHeaderWarningPanel = function() {
 };
 };
 
 
 PWM_CONFIG.handleWindowClickForHeaderWarningPanel = function(event) {
 PWM_CONFIG.handleWindowClickForHeaderWarningPanel = function(event) {
-    var headerMenuElement = document.getElementById('header-menu');
-    var match = headerMenuElement &&
-        ( headerMenuElement.contains(event.target) || headerMenuElement.contains(event.target) );
-
-    if (!match) {
-        var headerWarningElement = PWM_MAIN.getObject('header-warning');
-        if (!headerWarningElement.classList.contains('nodisplay')) {
-            headerWarningElement.classList.add('nodisplay');
+    const headerMenuElement = document.getElementById('header-menu');
+    if (headerMenuElement) {
+        const match = headerMenuElement.contains(event.target) || headerMenuElement.contains(event.target);
+
+        if (!match) {
+            const headerWarningElement = PWM_MAIN.getObject('header-warning');
+            if (!headerWarningElement.classList.contains('nodisplay')) {
+                headerWarningElement.classList.add('nodisplay');
+            }
         }
         }
     }
     }
 };
 };
@@ -172,29 +173,29 @@ PWM_CONFIG.showString=function (key, options) {
 };
 };
 
 
 PWM_CONFIG.showHeaderHealth = function() {
 PWM_CONFIG.showHeaderHealth = function() {
-    var refreshUrl = PWM_GLOBAL['url-context'] + "/public/api?processAction=health";
-    var parentDiv = PWM_MAIN.getObject('panel-header-healthData');
+    const refreshUrl = PWM_GLOBAL['url-context'] + "/public/api?processAction=health";
+    const parentDiv = PWM_MAIN.getObject('panel-header-healthData');
     if (!parentDiv) {
     if (!parentDiv) {
         return;
         return;
     }
     }
-    var headerDiv = PWM_MAIN.getObject('header-warning');
+    const headerDiv = PWM_MAIN.getObject('header-warning');
     if (parentDiv && headerDiv) {
     if (parentDiv && headerDiv) {
-        var loadFunction = function(data) {
+        const loadFunction = function (data) {
             if (data['data'] && data['data']['overall']) {
             if (data['data'] && data['data']['overall']) {
-                var hasWarnTopics = data['data']['overall'] === 'WARN';
+                const hasWarnTopics = data['data']['overall'] === 'WARN';
                 if (hasWarnTopics) {
                 if (hasWarnTopics) {
-                    PWM_MAIN.removeCssClass('header-menu-alert','display-none');
-                    PWM_MAIN.removeCssClass('panel-header-healthData','display-none');
+                    PWM_MAIN.removeCssClass('header-menu-alert', 'display-none');
+                    PWM_MAIN.removeCssClass('panel-header-healthData', 'display-none');
                 } else {
                 } else {
-                    PWM_MAIN.addCssClass('header-menu-alert','display-none');
-                    PWM_MAIN.addCssClass('panel-header-healthData','display-none');
+                    PWM_MAIN.addCssClass('header-menu-alert', 'display-none');
+                    PWM_MAIN.addCssClass('panel-header-healthData', 'display-none');
                 }
                 }
                 setTimeout(function () {
                 setTimeout(function () {
                     PWM_CONFIG.showHeaderHealth();
                     PWM_CONFIG.showHeaderHealth();
                 }, 30 * 1000);
                 }, 30 * 1000);
             }
             }
         };
         };
-        var errorFunction = function(error) {
+        const errorFunction = function (error) {
             console.log('unable to read header health status: ' + error);
             console.log('unable to read header health status: ' + error);
         };
         };
         PWM_MAIN.ajaxRequest(refreshUrl, loadFunction,{errorFunction:errorFunction,method:'GET'});
         PWM_MAIN.ajaxRequest(refreshUrl, loadFunction,{errorFunction:errorFunction,method:'GET'});
@@ -232,7 +233,7 @@ PWM_CONFIG.downloadConfig = function () {
 };
 };
 
 
 PWM_CONFIG.downloadSupportBundle = function() {
 PWM_CONFIG.downloadSupportBundle = function() {
-    var dialogText = '';
+    let dialogText = '';
     if (PWM_VAR['config_localDBLogLevel'] !== 'TRACE') {
     if (PWM_VAR['config_localDBLogLevel'] !== 'TRACE') {
         dialogText += PWM_CONFIG.showString("Warning_MakeSupportZipNoTrace");
         dialogText += PWM_CONFIG.showString("Warning_MakeSupportZipNoTrace");
         dialogText += '<br/><br/>';
         dialogText += '<br/><br/>';
@@ -260,7 +261,7 @@ PWM_CONFIG.downloadSupportBundle = function() {
 
 
 
 
 PWM_CONFIG.heartbeatCheck = function() {
 PWM_CONFIG.heartbeatCheck = function() {
-    var heartbeatFrequency = 10 * 1000;
+    const heartbeatFrequency = 10 * 1000;
     if (PWM_VAR['cancelHeartbeatCheck']) {
     if (PWM_VAR['cancelHeartbeatCheck']) {
         console.log('heartbeat check cancelled');
         console.log('heartbeat check cancelled');
         return;
         return;
@@ -272,29 +273,29 @@ PWM_CONFIG.heartbeatCheck = function() {
     }
     }
 
 
     console.log('beginning config-editor heartbeat check');
     console.log('beginning config-editor heartbeat check');
-    var handleErrorFunction = function(message) {
+    const handleErrorFunction = function (message) {
         console.log('config-editor heartbeat failed');
         console.log('config-editor heartbeat failed');
-        PWM_MAIN.showErrorDialog('There has been a problem communicating with the application server, please refresh your browser to continue.<br/><br/>' + message,{
-            showOk:false
+        PWM_MAIN.showErrorDialog('There has been a problem communicating with the application server, please refresh your browser to continue.<br/><br/>' + message, {
+            showOk: false
         });
         });
     };
     };
-    var loadFunction = function(data) {
+    const loadFunction = function (data) {
         try {
         try {
-            var serverStartTime = data['data']['PWM_GLOBAL']['startupTime'];
+            const serverStartTime = data['data']['PWM_GLOBAL']['startupTime'];
             if (serverStartTime !== PWM_GLOBAL['startupTime']) {
             if (serverStartTime !== PWM_GLOBAL['startupTime']) {
-                var message = "Application appears to have be restarted.";
+                const message = "Application appears to have be restarted.";
                 handleErrorFunction(message);
                 handleErrorFunction(message);
             } else {
             } else {
-                setTimeout(PWM_CONFIG.heartbeatCheck,heartbeatFrequency);
+                setTimeout(PWM_CONFIG.heartbeatCheck, heartbeatFrequency);
             }
             }
         } catch (e) {
         } catch (e) {
             handleErrorFunction('Error reading server status.');
             handleErrorFunction('Error reading server status.');
         }
         }
     };
     };
-    var errorFunction = function(e) {
+    const errorFunction = function (e) {
         handleErrorFunction('I/O error communicating with server.');
         handleErrorFunction('I/O error communicating with server.');
     };
     };
-    var url = PWM_GLOBAL['url-context'] + "/public/api?processAction=clientData&heartbeat=true";
+    let url = PWM_GLOBAL['url-context'] + "/public/api?processAction=clientData&heartbeat=true";
     url = PWM_MAIN.addParamToUrl(url,'pageUrl',window.location.href);
     url = PWM_MAIN.addParamToUrl(url,'pageUrl',window.location.href);
     PWM_MAIN.ajaxRequest(url,loadFunction,{errorFunction:errorFunction,method:'GET'});
     PWM_MAIN.ajaxRequest(url,loadFunction,{errorFunction:errorFunction,method:'GET'});
 };
 };
@@ -322,8 +323,8 @@ PWM_CONFIG.initConfigHeader = function() {
 };
 };
 
 
 PWM_CONFIG.initConfigManagerWordlistPage = function() {
 PWM_CONFIG.initConfigManagerWordlistPage = function() {
-    var uploadWordlist = function (type, label) {
-        var uploadOptions = {};
+    const uploadWordlist = function (type, label) {
+        const uploadOptions = {};
         uploadOptions['url'] = 'wordlists?processAction=uploadWordlist&wordlist=' + type;
         uploadOptions['url'] = 'wordlists?processAction=uploadWordlist&wordlist=' + type;
         uploadOptions['title'] = 'Upload ' + label;
         uploadOptions['title'] = 'Upload ' + label;
         uploadOptions['text'] = PWM_CONFIG.showString('Display_UploadWordlist');
         uploadOptions['text'] = PWM_CONFIG.showString('Display_UploadWordlist');
@@ -337,18 +338,18 @@ PWM_CONFIG.initConfigManagerWordlistPage = function() {
         PWM_MAIN.IdleTimeoutHandler.cancelCountDownTimer();
         PWM_MAIN.IdleTimeoutHandler.cancelCountDownTimer();
         UILibrary.uploadFileDialog(uploadOptions);
         UILibrary.uploadFileDialog(uploadOptions);
     };
     };
-    var clearWordlist = function (type, label) {
+    const clearWordlist = function (type, label) {
         PWM_MAIN.showConfirmDialog({
         PWM_MAIN.showConfirmDialog({
             okAction: function () {
             okAction: function () {
                 PWM_MAIN.showWaitDialog({
                 PWM_MAIN.showWaitDialog({
                     loadFunction: function () {
                     loadFunction: function () {
-                        var url = 'wordlists?processAction=clearWordlist&wordlist=' + type;
-                        var loadFunction = function (data) {
+                        const url = 'wordlists?processAction=clearWordlist&wordlist=' + type;
+                        const loadFunction = function (data) {
                             PWM_MAIN.showDialog({
                             PWM_MAIN.showDialog({
                                 title: PWM_MAIN.showString('Title_Success'),
                                 title: PWM_MAIN.showString('Title_Success'),
                                 text: data['successMessage'], okAction: function () {
                                 text: data['successMessage'], okAction: function () {
                                     PWM_MAIN.showWaitDialog({
                                     PWM_MAIN.showWaitDialog({
-                                        loadFunction: function(){
+                                        loadFunction: function () {
                                             PWM_MAIN.gotoUrl('wordlists');
                                             PWM_MAIN.gotoUrl('wordlists');
                                         }
                                         }
                                     });
                                     });
@@ -375,34 +376,30 @@ PWM_CONFIG.initConfigManagerWordlistPage = function() {
     });
     });
 
 
     function refreshWordlistInfoTables() {
     function refreshWordlistInfoTables() {
-        var makeTableData = function (tableData, title) {
-            var outputHtml = '';
+        const makeTableData = function (tableData, title) {
+            let outputHtml = '';
             outputHtml += '<tr><td colspan="2" class="title">' + title + '</td></tr>';
             outputHtml += '<tr><td colspan="2" class="title">' + title + '</td></tr>';
             outputHtml += UILibrary.displayElementsToTableContents(tableData);
             outputHtml += UILibrary.displayElementsToTableContents(tableData);
             return outputHtml;
             return outputHtml;
         };
         };
-        var updateWordlistActionButtons = function (data) {
-            var disabled;
-            disabled = !data['WORDLIST']['allowUpload'];
-            PWM_MAIN.setStyle('MenuItem_UploadWordlist','visibility', disabled ? 'hidden' : 'visible');
-
-            disabled = !data['WORDLIST']['allowClear'];
-            PWM_MAIN.setStyle('MenuItem_ClearWordlist','visibility', disabled ? 'hidden' : 'visible');
-
-            disabled = !data['SEEDLIST']['allowUpload'];
-            PWM_MAIN.setStyle('MenuItem_UploadSeedlist','visibility', disabled ? 'hidden' : 'visible');
+        const updateWordlistActionButtons = function (data) {
+            const buttonState = function(elementId,enabled) {
+                enabled ? PWM_MAIN.removeCssClass(elementId,'hidden') : PWM_MAIN.addCssClass(elementId,'hidden');
+            }
 
 
-            disabled = !data['SEEDLIST']['allowClear'];
-            PWM_MAIN.setStyle('MenuItem_ClearSeedlist','visibility', disabled ? 'hidden' : 'visible');
+            buttonState('MenuItem_UploadWordlist',data['WORDLIST']['allowUpload']);
+            buttonState('MenuItem_ClearWordlist',data['WORDLIST']['allowClear']);
+            buttonState('MenuItem_UploadSeedlist',data['SEEDLIST']['allowUpload']);
+            buttonState('MenuItem_ClearSeedlist',data['SEEDLIST']['allowClear']);
         };
         };
-        var dataHandler = function (data) {
-            var wordlistData = data['data']['WORDLIST']['presentableData'];
+        const dataHandler = function (data) {
+            const wordlistData = data['data']['WORDLIST']['presentableData'];
             PWM_MAIN.getObject('table-wordlistInfo').innerHTML = makeTableData(
             PWM_MAIN.getObject('table-wordlistInfo').innerHTML = makeTableData(
                 wordlistData,
                 wordlistData,
                 PWM_CONFIG.showString('Label_Wordlist')
                 PWM_CONFIG.showString('Label_Wordlist')
             );
             );
             UILibrary.initElementsToTableContents(wordlistData);
             UILibrary.initElementsToTableContents(wordlistData);
-            var seedlistData = data['data']['SEEDLIST']['presentableData'];
+            const seedlistData = data['data']['SEEDLIST']['presentableData'];
             PWM_MAIN.getObject('table-seedlistInfo').innerHTML = makeTableData(
             PWM_MAIN.getObject('table-seedlistInfo').innerHTML = makeTableData(
                 seedlistData,
                 seedlistData,
                 PWM_CONFIG.showString('Label_Seedlist')
                 PWM_CONFIG.showString('Label_Seedlist')
@@ -410,7 +407,7 @@ PWM_CONFIG.initConfigManagerWordlistPage = function() {
             UILibrary.initElementsToTableContents(seedlistData);
             UILibrary.initElementsToTableContents(seedlistData);
             updateWordlistActionButtons(data['data']);
             updateWordlistActionButtons(data['data']);
         };
         };
-        var errorHandler = function(data) {
+        const errorHandler = function (data) {
             console.log('error during info refresh: ' + data);
             console.log('error during info refresh: ' + data);
         };
         };
         PWM_MAIN.ajaxRequest('wordlists?processAction=readWordlistData', dataHandler,{errorFunction:errorHandler});
         PWM_MAIN.ajaxRequest('wordlists?processAction=readWordlistData', dataHandler,{errorFunction:errorHandler});
@@ -422,15 +419,15 @@ PWM_CONFIG.initConfigManagerWordlistPage = function() {
 
 
 
 
 PWM_CONFIG.convertListOfIdentitiesToHtml = function(data) {
 PWM_CONFIG.convertListOfIdentitiesToHtml = function(data) {
-    var html = '<div class="panel-large overflow-y">';
-    var users = data['users'];
+    let html = '<div class="panel-large overflow-y">';
+    const users = data['users'];
     if (users && !PWM_MAIN.JSLibrary.isEmpty(users)) {
     if (users && !PWM_MAIN.JSLibrary.isEmpty(users)) {
         html += '<table style="">';
         html += '<table style="">';
         html += '<thead><tr><td class="title" style="width: 75px">' + PWM_MAIN.showString('Field_LdapProfile') + '</td>';
         html += '<thead><tr><td class="title" style="width: 75px">' + PWM_MAIN.showString('Field_LdapProfile') + '</td>';
         html += '<td class="title" style="max-width: 375px">'+ PWM_MAIN.showString('Field_UserDN') + '</td></tr></thead>';
         html += '<td class="title" style="max-width: 375px">'+ PWM_MAIN.showString('Field_UserDN') + '</td></tr></thead>';
         html += '<tbody>';
         html += '<tbody>';
-        for (var iter in users) {
-            var userIdentity = users[iter];
+        for (let iter in users) {
+            const userIdentity = users[iter];
             html += '<tr ><td style="width: 75px">' + userIdentity['ldapProfile'] + '</td><td title="' + userIdentity['userDN'] + '">';
             html += '<tr ><td style="width: 75px">' + userIdentity['ldapProfile'] + '</td><td title="' + userIdentity['userDN'] + '">';
             html += '<div style="max-width: 375px; white-space: nowrap; overflow:hidden; text-overflow: ellipsis;">' + userIdentity['userDN'] + '</div></td></tr>';
             html += '<div style="max-width: 375px; white-space: nowrap; overflow:hidden; text-overflow: ellipsis;">' + userIdentity['userDN'] + '</div></td></tr>';
         }
         }

+ 34 - 83
webapp/src/main/webapp/public/resources/js/main.js

@@ -1097,23 +1097,6 @@ PWM_MAIN.flashDomElement = function(flashColor,elementName,durationMS) {
             //      PWM_MAIN.removeCssClass(element, 'background-alert-flash');
             //      PWM_MAIN.removeCssClass(element, 'background-alert-flash');
         },5000)
         },5000)
     }
     }
-    /*
-
-    if (!PWM_MAIN.getObject(elementName)) {
-        PWM_MAIN.log('cant flash non-existing element id ' + elementName);
-        return;
-    }
-    PWM_MAIN.log('will flash element id ' + elementName);
-    require(["dojo","dojo/window","dojo/domReady!"],function(dojo) {
-        var originalBGColor = PWM_MAIN.getRenderedStyle(elementName,'background-color');
-        PWM_MAIN.getObject(elementName).style.backgroundColor = flashColor;
-        dojo.animateProperty({
-            node:elementName,
-            duration: durationMS,
-            properties: { backgroundColor: originalBGColor}
-        }).play();
-    });
-     */
 };
 };
 
 
 PWM_MAIN.getRenderedStyle = function(el,styleProp) {
 PWM_MAIN.getRenderedStyle = function(el,styleProp) {
@@ -1538,7 +1521,7 @@ ShowHidePasswordHandler.toggle = function(nodeName) {
 
 
 ShowHidePasswordHandler.hide = function(nodeName) {
 ShowHidePasswordHandler.hide = function(nodeName) {
     ShowHidePasswordHandler.state[nodeName] = true;
     ShowHidePasswordHandler.state[nodeName] = true;
-    ShowHidePasswordHandler.changeInputTypeField(PWM_MAIN.getObject(nodeName),'password');
+    PWM_MAIN.getObject(nodeName).setAttribute('type','password');
     ShowHidePasswordHandler.setupTooltip(nodeName);
     ShowHidePasswordHandler.setupTooltip(nodeName);
     ShowHidePasswordHandler.renderIcon(nodeName);
     ShowHidePasswordHandler.renderIcon(nodeName);
     var node = PWM_MAIN.getObject(nodeName);
     var node = PWM_MAIN.getObject(nodeName);
@@ -1547,22 +1530,20 @@ ShowHidePasswordHandler.hide = function(nodeName) {
 
 
 ShowHidePasswordHandler.show = function(nodeName) {
 ShowHidePasswordHandler.show = function(nodeName) {
     ShowHidePasswordHandler.state[nodeName] = false;
     ShowHidePasswordHandler.state[nodeName] = false;
-    ShowHidePasswordHandler.changeInputTypeField(PWM_MAIN.getObject(nodeName),'text');
+    PWM_MAIN.getObject(nodeName).setAttribute('type','text');
     ShowHidePasswordHandler.setupTooltip(nodeName);
     ShowHidePasswordHandler.setupTooltip(nodeName);
     ShowHidePasswordHandler.renderIcon(nodeName);
     ShowHidePasswordHandler.renderIcon(nodeName);
 
 
     var node = PWM_MAIN.getObject(nodeName);
     var node = PWM_MAIN.getObject(nodeName);
     node.focus();
     node.focus();
-    require(["dojo/dom-construct", "dojo/dom-attr"], function(domConstruct, attr) {
-        var defaultType = attr.get(nodeName, "data-originalType");
-        if (defaultType === 'password') {
-            setTimeout(function () {
-                if (!ShowHidePasswordHandler.state[nodeName]) {
-                    ShowHidePasswordHandler.toggle(nodeName);
-                }
-            }, ShowHidePasswordHandler.toggleRevertTimeout);
-        }
-    });
+    var defaultType = node.getAttribute('data-originalType');
+    if (defaultType === 'password') {
+        setTimeout(function () {
+            if (!ShowHidePasswordHandler.state[nodeName]) {
+                ShowHidePasswordHandler.toggle(nodeName);
+            }
+        }, ShowHidePasswordHandler.toggleRevertTimeout);
+    }
 };
 };
 
 
 ShowHidePasswordHandler.addInputEvents = function(nodeName) {
 ShowHidePasswordHandler.addInputEvents = function(nodeName) {
@@ -1574,31 +1555,6 @@ ShowHidePasswordHandler.addInputEvents = function(nodeName) {
 
 
 };
 };
 
 
-ShowHidePasswordHandler.changeInputTypeField = function(object, type) {
-    require(["dojo","dojo/_base/lang", "dojo/dom", "dojo/dom-attr"], function(dojo, lang, dom, attr){
-        var newObject = null;
-        if(dojo.isIE <= 8){ // IE doesn't support simply changing the type of object
-            newObject = document.createElement(object.nodeName);
-            newObject.type = type;
-            if (object.size) newObject.size = object.size;
-            if (object.value) newObject.value = object.value;
-            if (object.name) newObject.name = object.name;
-            if (object.id) newObject.id = object.id;
-            if (object.className) newObject.className = object.className;
-            if (object.disabled) newObject.disabled = object.disabled;
-            if (object.readonly) newObject.readonly = object.readonly;
-            if (object.data) newObject.data = object.data;
-        } else {
-            newObject = object;
-            attr.set(newObject, "type", type);
-        }
-
-        object.parentNode.replaceChild(newObject, object);
-        ShowHidePasswordHandler.addInputEvents(object.id);
-        return newObject;
-    });
-};
-
 ShowHidePasswordHandler.setupTooltip = function(nodeName) {
 ShowHidePasswordHandler.setupTooltip = function(nodeName) {
     if (ShowHidePasswordHandler.debugOutput) PWM_MAIN.log('begin setupTooltip');
     if (ShowHidePasswordHandler.debugOutput) PWM_MAIN.log('begin setupTooltip');
     var state = ShowHidePasswordHandler.state[nodeName];
     var state = ShowHidePasswordHandler.state[nodeName];
@@ -1766,24 +1722,22 @@ PWM_MAIN.TimestampHandler.initElement = function(element) {
         return;
         return;
     }
     }
 
 
-    require(["dojo"], function(dojo) {
-        var innerText = dojo.attr(element, 'innerHTML');
-        innerText = innerText.trim(innerText);
-        PWM_MAIN.TimestampHandler.testIfStringIsTimestamp(innerText, function () {
-            element.setAttribute('data-timestamp-original', innerText);
-            PWM_MAIN.addEventHandler(element, 'click', function(){
-                var LocalizedState = !PWM_MAIN.Preferences.readSessionStorage(PWM_MAIN.TimestampHandler.PreferencesKey,true);
-                PWM_MAIN.Preferences.writeSessionStorage(PWM_MAIN.TimestampHandler.PreferencesKey, LocalizedState);
-                PWM_MAIN.TimestampHandler.updateAllElements();
-            });
-            if (!dojo.hasClass(element,"timestamp")) {
-                dojo.addClass(element,"timestamp");
-            }
-
-            element.setAttribute('data-timestamp-init', 'true');
-            PWM_MAIN.TimestampHandler.ElementList.push(element);
-            PWM_MAIN.TimestampHandler.updateElement(element);
+    var innerText = element.innerHTML;
+    innerText = innerText.trim(innerText);
+    PWM_MAIN.TimestampHandler.testIfStringIsTimestamp(innerText, function () {
+        element.setAttribute('data-timestamp-original', innerText);
+        PWM_MAIN.addEventHandler(element, 'click', function(){
+            var LocalizedState = !PWM_MAIN.Preferences.readSessionStorage(PWM_MAIN.TimestampHandler.PreferencesKey,true);
+            PWM_MAIN.Preferences.writeSessionStorage(PWM_MAIN.TimestampHandler.PreferencesKey, LocalizedState);
+            PWM_MAIN.TimestampHandler.updateAllElements();
         });
         });
+        if (!PWM_MAIN.hasCssClass(element,"timestamp")) {
+            PWM_MAIN.addCssClass(element,"timestamp");
+        }
+
+        element.setAttribute('data-timestamp-init', 'true');
+        PWM_MAIN.TimestampHandler.ElementList.push(element);
+        PWM_MAIN.TimestampHandler.updateElement(element);
     });
     });
 };
 };
 
 
@@ -1798,18 +1752,15 @@ PWM_MAIN.TimestampHandler.updateAllElements = function() {
 };
 };
 
 
 PWM_MAIN.TimestampHandler.updateElement = function(element) {
 PWM_MAIN.TimestampHandler.updateElement = function(element) {
-    require(["dojo"], function(dojo) {
-        var localized = PWM_MAIN.Preferences.readSessionStorage(PWM_MAIN.TimestampHandler.PreferencesKey,true);
-        if (localized) {
-            var isoDateStr = element.getAttribute('data-timestamp-original');
-            var date = new Date(Date.parse(isoDateStr));
-            var localizedStr = PWM_MAIN.TimestampHandler.formatDate(date);
-
-            dojo.attr(element,'innerHTML',localizedStr);
-        } else {
-            dojo.attr(element,'innerHTML',element.getAttribute('data-timestamp-original'));
-        }
-    })
+    var localized = PWM_MAIN.Preferences.readSessionStorage(PWM_MAIN.TimestampHandler.PreferencesKey,true);
+    if (localized) {
+        var isoDateStr = element.getAttribute('data-timestamp-original');
+        var date = new Date(Date.parse(isoDateStr));
+        var localizedStr = PWM_MAIN.TimestampHandler.formatDate(date);
+        element.innerHTML = localizedStr;
+    } else {
+        element.innerHTML = element.getAttribute('data-timestamp-original');
+    }
 };
 };
 
 
 PWM_MAIN.TimestampHandler.formatDate = function(dateObj) {
 PWM_MAIN.TimestampHandler.formatDate = function(dateObj) {

+ 1 - 1
webapp/src/main/webapp/public/resources/style.css

@@ -1765,7 +1765,7 @@ table.ias-table, table.ias-table td {
 }
 }
 
 
 .hidden {
 .hidden {
-   display: none;
+    visibility: hidden;
 }
 }
 
 
 .logViewer {
 .logViewer {

+ 1 - 0
webapp/src/main/webapp/public/resources/themes/pwm/configStyle.css

@@ -212,6 +212,7 @@ html {
      background:linear-gradient(to bottom, #B2B1B9 5%, #E8E1F6 100% );
      background:linear-gradient(to bottom, #B2B1B9 5%, #E8E1F6 100% );
  }
  }
 
 
+/** prevent an extra space in the dojo nav tree for a "node" icon. **/
 .tree-noicon {
 .tree-noicon {
     width:0;
     width:0;
     margin:0;
     margin:0;