Browse Source

js refactor, some dojo removal

Jason Rivard 7 năm trước cách đây
mục cha
commit
cb4aa658e3

+ 21 - 24
server/src/main/webapp/public/resources/js/admin.js

@@ -74,7 +74,7 @@ PWM_ADMIN.initAdminNavMenu = function() {
                         PWM_MAIN.newWindowOpen(PWM_GLOBAL['url-context'] + '/public/reference/','referencedoc');
                     }
                 }));
-                if (PWM_GLOBAL['setting-displayEula'] == true) {
+                if (PWM_GLOBAL['setting-displayEula'] === true) {
                     pMenu.addChild(new MenuItem({
                         label: 'View EULA',
                         id: 'viewEULA_dropitem',
@@ -174,17 +174,17 @@ PWM_ADMIN.initReportDataGrid=function() {
 };
 
 PWM_ADMIN.initDownloadUserReportCsvForm = function() {
-    require(["dojo/on", "dojo/query"], function(on, query) {
-        query("#downloadUserReportCsvForm").on("click", function(e) {
+    PWM_MAIN.doQuery("#downloadUserReportCsvForm", function(node){
+        PWM_MAIN.addEventHandler(node, "click", function() {
             var selectedColumns = [];
 
-            query("#grid-hider-menu input:checked").forEach(function(node, index, nodeList) {
-                selectedColumns.push(node.id.replace('grid-hider-menu-check-', ''));
+            PWM_MAIN.doQuery("#grid-hider-menu input:checked",function(element){
+                selectedColumns.push(element.id.replace('grid-hider-menu-check-', ''));
             });
 
             console.log("Selected columns: " + selectedColumns);
             downloadUserReportCsvForm.selectedColumns.value = selectedColumns;
-        });
+        })
     });
 };
 
@@ -563,7 +563,7 @@ PWM_ADMIN.showStatChart = function(statName,days,divName,options) {
                         for (var loopEpsDurationsIndex = 0; loopEpsDurationsIndex < epsDurations.length; loopEpsDurationsIndex++) { // clear all the gauges
                             var loopEpsDuration = epsDurations[loopEpsDurationsIndex] + '';
                             var loopEpsID = "EPS-GAUGE-" + loopEpsName + "_" + loopEpsDuration;
-                            if (PWM_MAIN.getObject(loopEpsID) != null) {
+                            if (PWM_MAIN.getObject(loopEpsID) !== null) {
                                 if (registry.byId(loopEpsID)) {
                                     registry.byId(loopEpsID).setAttribute('value','0');
                                 }
@@ -586,13 +586,13 @@ PWM_ADMIN.showStatChart = function(statName,days,divName,options) {
                                 var loopEpsValue = data['EPS'][loopEpsName + "_" + loopEpsDuration];
                                 var loopEpmValue = (loopEpsValue * 60).toFixed(3);
                                 var loopTop = PWM_GLOBAL['client.activityMaxEpsRate'];
-                                if (loopEpsDuration == "HOURLY") {
+                                if (loopEpsDuration === "HOURLY") {
                                     activityCount += loopEpsValue;
                                 }
-                                if (PWM_MAIN.getObject(loopFieldEpsID) != null) {
+                                if (PWM_MAIN.getObject(loopFieldEpsID) !== null) {
                                     PWM_MAIN.getObject(loopFieldEpsID).innerHTML = loopEpmValue;
                                 }
-                                if (PWM_MAIN.getObject(loopEpsID) != null) {
+                                if (PWM_MAIN.getObject(loopEpsID) !== null) {
                                     console.log('EpsID=' + loopEpsID + ', ' + 'Eps=' + loopEpsValue + ', ' + 'Epm=' + loopEpmValue);
                                     if (registry.byId(loopEpsID)) {
                                         registry.byId(loopEpsID).setAttribute('value',loopEpmValue);
@@ -617,7 +617,7 @@ PWM_ADMIN.showStatChart = function(statName,days,divName,options) {
                         }
                         PWM_GLOBAL['epsActivityCount'] = activityCount;
                     }
-                    if (divName != null && PWM_MAIN.getObject(divName)) { // stats chart
+                    if (divName !== null && PWM_MAIN.getObject(divName)) { // stats chart
                         var values = [];
                         for(var key in data['nameData']) {
                             var value = data['nameData'][key];
@@ -656,7 +656,7 @@ PWM_ADMIN.showAppHealth = function(parentDivID, options, refreshNow) {
     console.log('starting showPwmHealth: refreshTime=' + refreshTime);
     require(["dojo"],function(dojo){
         var parentDiv = dojo.byId(parentDivID);
-        if (PWM_GLOBAL['inhibitHealthUpdate'] == true) {
+        if (PWM_GLOBAL['inhibitHealthUpdate'] === true) {
             try { parentDiv.innerHTML = ''; } catch (e) { console.log('unable to update health div' + e) };
             return;
         }
@@ -702,7 +702,7 @@ PWM_ADMIN.showAppHealth = function(parentDivID, options, refreshNow) {
         };
 
         var errorFunction = function(error) {
-            if (error != null) {
+            if (error !== null) {
                 console.log('error reaching server: ' + error);
             }
             var htmlBody = '<div style="text-align:center; background-color: #d20734">';
@@ -772,30 +772,27 @@ PWM_ADMIN.detailView = function(evt, headers, grid){
         (function(key){
             var value = key in row.data ? row.data[key] : '';
             var label = headers[key];
+            var id = "record-detail-" + key;
             text += '<tr><td class="key">' + label + '</td>';
-            text += '<td>';
+            text += '<td><span id="' + id + '" style="max-height: 200px; overflow: auto; max-width: 400px" class="timestamp">';
             if (key.toLowerCase().indexOf('time') >= 0) {
-                text += '<span class="timestamp" id="field-detail-' + key + '">' + value + '</span>';
                 PWM_MAIN.TimestampHandler.testIfStringIsTimestamp(value,function(){
                     postExecuteFunctions.push(function() {
-                        PWM_MAIN.TimestampHandler.initElement(PWM_MAIN.getObject('field-detail-' + key));
+                        PWM_MAIN.TimestampHandler.initElement(PWM_MAIN.getObject(id));
                     });
                 });
-            } else if (key == 'message') {
-                var out = value.replace('\n', '<br/>');
-                text += '<div style="max-height: 200px; overflow: auto; max-width: 400px">' + out + '</div>'
-            } else {
-                text += value;
             }
-            text += '</td></tr>';
+            text += '</span></td></tr>';
+            postExecuteFunctions.push(function(){
+                PWM_MAIN.getObject(id).appendChild(document.createTextNode(value));
+            });
         })(item);
     }
     text += '</table>';
     PWM_MAIN.showDialog({title:"Record Detail",text:text,showClose:true,allowMove:true,loadFunction:function(){
-        for (i = 0; i < postExecuteFunctions.length; i++) {
+        for (var i = 0; i < postExecuteFunctions.length; i++) {
             postExecuteFunctions[i]();
         }
-
     }});
 };
 

+ 33 - 53
server/src/main/webapp/public/resources/js/changepassword.js

@@ -41,7 +41,7 @@ PWM_CHANGEPW.validatePasswords = function(userDN)
         return;
     }
 
-    if (PWM_GLOBAL['previousP1'] != PWM_MAIN.getObject("password1").value) {  // if p1 is changing, then clear out p2.
+    if (PWM_GLOBAL['previousP1'] !== PWM_MAIN.getObject("password1").value) {  // if p1 is changing, then clear out p2.
         PWM_MAIN.getObject("password2").value = "";
         PWM_GLOBAL['previousP1'] = PWM_MAIN.getObject("password1").value;
     }
@@ -69,9 +69,9 @@ PWM_CHANGEPW.validatePasswords = function(userDN)
 
 
 PWM_CHANGEPW.updateDisplay = function(resultInfo) {
-    if (resultInfo == null) {
+    if (!resultInfo) {
         var passwordButton = PWM_MAIN.getObject("password_button");
-        if (passwordButton != null) {
+        if (passwordButton !== null) {
             passwordButton.disabled = false;
         }
         PWM_MAIN.showSuccess(PWM_MAIN.showString('Display_PasswordPrompt'));
@@ -82,14 +82,14 @@ PWM_CHANGEPW.updateDisplay = function(resultInfo) {
 
     var message = resultInfo["message"];
 
-    if (resultInfo["version"] != "2") {
+    if (resultInfo["version"] !== 2) {
         PWM_MAIN.showError("[ unexpected version string from server ]");
         return;
     }
 
-    if (resultInfo["passed"] == true) {
+    if (resultInfo["passed"] === true) {
         //PWM_MAIN.getObject('password2').disabled = false;
-        if (resultInfo["match"] == "MATCH") {
+        if (resultInfo["match"] === "MATCH") {
             PWM_MAIN.getObject("password_button").disabled = false;
             PWM_MAIN.showSuccess(message);
         } else {
@@ -117,12 +117,12 @@ PWM_CHANGEPW.updateDisplay = function(resultInfo) {
 
 PWM_CHANGEPW.markConfirmationCheck = function(matchStatus) {
     if (PWM_MAIN.getObject("confirmCheckMark") && PWM_MAIN.getObject("confirmCrossMark")) {
-        if (matchStatus == "MATCH") {
+        if (matchStatus === "MATCH") {
             PWM_MAIN.getObject("confirmCheckMark").style.visibility = 'visible';
             PWM_MAIN.getObject("confirmCrossMark").style.visibility = 'hidden';
             PWM_MAIN.getObject("confirmCheckMark").width = '15';
             PWM_MAIN.getObject("confirmCrossMark").width = '0';
-        } else if (matchStatus == "NO_MATCH") {
+        } else if (matchStatus === "NO_MATCH") {
             PWM_MAIN.getObject("confirmCheckMark").style.visibility = 'hidden';
             PWM_MAIN.getObject("confirmCrossMark").style.visibility = 'visible';
             PWM_MAIN.getObject("confirmCheckMark").width = '0';
@@ -137,7 +137,7 @@ PWM_CHANGEPW.markConfirmationCheck = function(matchStatus) {
 };
 
 PWM_CHANGEPW.markStrength = function(strength) { //strength meter
-    if (PWM_MAIN.getObject("strengthBox") == null) {
+    if (PWM_MAIN.getObject("strengthBox") === null) {
         return;
     }
 
@@ -162,14 +162,14 @@ PWM_CHANGEPW.markStrength = function(strength) { //strength meter
     var gradColor = colorFade(COLOR_BAR_BOTTOM, COLOR_BAR_TOP, strength / 100).toString(16) + '';
 
     var barObject = PWM_MAIN.getObject("strengthBar");
-    if (barObject != null) {
+    if (barObject !== null) {
         barObject.style.width = strength + '%';
         barObject.style.backgroundColor = '#' + gradColor;
     }
 
     var labelObject = PWM_MAIN.getObject("strengthLabel");
-    if (labelObject != null) {
-        labelObject.innerHTML = strengthLabel == null ? "" : strengthLabel;
+    if (labelObject !== null) {
+        labelObject.innerHTML = strengthLabel === null ? "" : strengthLabel;
     }
 };
 
@@ -197,24 +197,6 @@ PWM_CHANGEPW.showPasswordGuide=function() {
         title: PWM_MAIN.showString('Title_PasswordGuide'),
         text: '<div id="passwordGuideTextContent">' + PWM_GLOBAL['passwordGuideText'] + '</div>'
     });
-    /*
-    PWM_MAIN.clearDijitWidget('dialogPopup');
-    require(["dojo","dijit/Dialog"],function(dojo, Dialog){
-        var theDialog = new Dialog({
-            title: PWM_MAIN.showString('Title_PasswordGuide'),
-            style: "border: 2px solid #D4D4D4; min-width: 300px",
-            content: '<div id="passwordGuideTextContent">' + PWM_GLOBAL['passwordGuideText'] + '</div>',
-            closable: true,
-            draggable: true,
-            id: "dialogPopup"
-        });
-        theDialog.show();
-
-        dojo.connect(theDialog, "hide", function(){
-            dojo.destroy(PWM_MAIN.getObject("passwordGuideTextContent"));
-        });
-    });
-    */
 };
 
 PWM_CHANGEPW.handleChangePasswordSubmit=function() {
@@ -230,7 +212,7 @@ PWM_CHANGEPW.doRandomGeneration=function(randomConfig) {
 
     var eventHandlers = [];
     var dialogBody = "";
-    if (randomConfig['dialog'] != null && randomConfig['dialog'].length > 0) {
+    if (randomConfig['dialog'] && randomConfig['dialog'].length > 0) {
         dialogBody += randomConfig['dialog'];
     } else {
         dialogBody += PWM_MAIN.showString('Display_PasswordGeneration');
@@ -278,7 +260,7 @@ PWM_CHANGEPW.doRandomGeneration=function(randomConfig) {
 
 
 
-    var titleString = randomConfig['title'] == null ? PWM_MAIN.showString('Title_RandomPasswords') : randomConfig['title'];
+    var titleString = randomConfig['title'] === null ? PWM_MAIN.showString('Title_RandomPasswords') : randomConfig['title'];
     PWM_MAIN.showDialog({
         title:titleString,
         dialogClass:'narrow',
@@ -309,7 +291,7 @@ PWM_CHANGEPW.beginFetchRandoms=function(randomConfig) {
 PWM_CHANGEPW.fetchRandoms=function(randomConfig) {
     if (randomConfig['fetchList'].length < 1) {
         var moreButton = PWM_MAIN.getObject('moreRandomsButton');
-        if (moreButton != null) {
+        if (moreButton !== null) {
             moreButton.disabled = false;
             moreButton.focus();
         }
@@ -321,7 +303,7 @@ PWM_CHANGEPW.fetchRandoms=function(randomConfig) {
             var password = resultInfo['data']["password"];
             var elementID = randomConfig['fetchList'].pop();
             var element = PWM_MAIN.getObject(elementID);
-            if (element != null) {
+            if (element !== null) {
                 element.innerHTML = password;
                 PWM_MAIN.setStyle(elementID,'visibility','visible');
             }
@@ -329,7 +311,7 @@ PWM_CHANGEPW.fetchRandoms=function(randomConfig) {
         };
 
         var url = PWM_MAIN.addParamToUrl(window.location.pathname, 'processAction','randomPassword');
-        var content = randomConfig['dataInput'] == null ? { } : randomConfig['dataInput'];
+        var content = randomConfig['dataInput'] === null ? { } : randomConfig['dataInput'];
 
         PWM_MAIN.ajaxRequest(url,successFunction,{content:content});
     }
@@ -348,26 +330,24 @@ PWM_CHANGEPW.startupChangePasswordPage=function() {
     PWM_CHANGEPW.markStrength(0);
 
     // add handlers for main form
-    require(["dojo/on"], function(on){
-        var changePasswordForm = PWM_MAIN.getObject('changePasswordForm');
-        on(changePasswordForm,"keyup, change",function(){
-            PWM_CHANGEPW.validatePasswords(null);
-        });
-        on(changePasswordForm,"submit",function(event){
-            PWM_CHANGEPW.handleChangePasswordSubmit();
-            PWM_MAIN.handleFormSubmit(changePasswordForm, event);
-            return false;
-        });
-        on(changePasswordForm,"reset",function(){
-            PWM_CHANGEPW.validatePasswords(null);
-            PWM_CHANGEPW.setInputFocus();
-            return false;
-        });
+    var changePasswordForm = PWM_MAIN.getObject('changePasswordForm');
+    PWM_MAIN.addEventHandler(changePasswordForm,"keyup, change",function(){
+        PWM_CHANGEPW.validatePasswords(null);
+    });
+    PWM_MAIN.addEventHandler(changePasswordForm,"submit",function(event){
+        PWM_CHANGEPW.handleChangePasswordSubmit();
+        PWM_MAIN.handleFormSubmit(changePasswordForm, event);
+        return false;
+    });
+    PWM_MAIN.addEventHandler(changePasswordForm,"reset",function(){
+        PWM_CHANGEPW.validatePasswords(null);
+        PWM_CHANGEPW.setInputFocus();
+        return false;
     });
 
     // show the auto generate password panel
     var autoGenPasswordElement = PWM_MAIN.getObject("autogenerate-icon");
-    if (autoGenPasswordElement != null) {
+    if (autoGenPasswordElement !== null) {
         autoGenPasswordElement.style.visibility = 'visible';
         PWM_MAIN.addEventHandler(autoGenPasswordElement,'click',function(){
             PWM_CHANGEPW.doRandomGeneration();
@@ -430,7 +410,7 @@ PWM_CHANGEPW.startupChangePasswordPage=function() {
 
 PWM_CHANGEPW.setInputFocus=function() {
     var currentPassword = PWM_MAIN.getObject('currentPassword');
-    if (currentPassword != null) {
+    if (currentPassword !== null) {
         setTimeout(function() { currentPassword.focus(); },10);
     } else {
         var password1 = PWM_MAIN.getObject('password1');
@@ -480,7 +460,7 @@ PWM_CHANGEPW.refreshCreateStatus=function(refreshInterval) {
                 console.log('unable to update progressMessageTable, error: ' + e);
             }
 
-            if (data['data']['complete'] == true) {
+            if (data['data']['complete'] === true) {
                 PWM_MAIN.goto(completedUrl,{delay:1000})
             } else {
                 setTimeout(function(){

+ 3 - 4
server/src/main/webapp/public/resources/js/configeditor-settings-challenges.js

@@ -66,7 +66,7 @@ ChallengeSettingHandler.draw = function(settingKey) {
 
             bodyText += '<table class="noborder"><tr><td>';
             bodyText += '<table class="setting-challenge-question-summary">';
-            var localeLabel = localeName == '' ? 'Default Locale' : PWM_GLOBAL['localeInfo'][localeName] + " (" + localeName + ")";
+            var localeLabel = localeName === '' ? 'Default Locale' : PWM_GLOBAL['localeInfo'][localeName] + " (" + localeName + ")";
             if (PWM_MAIN.JSLibrary.itemCount(PWM_VAR['clientSettingCache'][settingKey]) > 1) {
                 bodyText += '<tr><td class="title" style="font-size:100%; font-weight:normal">' + localeLabel + '</td></tr>';
             }
@@ -90,7 +90,7 @@ ChallengeSettingHandler.draw = function(settingKey) {
             bodyText += '</td></tr>';
 
             bodyText += '</table></td><td class="noborder" style="width:20px; vertical-align:top">';
-            if (localeName != '' || PWM_MAIN.JSLibrary.itemCount(PWM_VAR['clientSettingCache'][settingKey]) < 2) { // add remove locale x
+            if (localeName !== '' || PWM_MAIN.JSLibrary.itemCount(PWM_VAR['clientSettingCache'][settingKey]) < 2) { // add remove locale x
                 bodyText += '<div id="button-deleteRow-' + settingKey + '-' + localeKey + '" style="vertical-align:top" class="delete-row-icon action-icon pwm-icon pwm-icon-times"></div>';
             }
             bodyText += '</td></tr></table><br/>';
@@ -147,7 +147,7 @@ ChallengeSettingHandler.draw = function(settingKey) {
 };
 
 ChallengeSettingHandler.editLocale = function(keyName, localeKey) {
-    var localeDisplay = localeKey == "" ? "Default" : localeKey;
+    var localeDisplay = localeKey === "" ? "Default" : localeKey;
     var dialogBody = '<div id="challengeLocaleDialogDiv" style="max-height:500px; overflow-x: auto">';
 
     var localeName = localeKey;
@@ -218,7 +218,6 @@ ChallengeSettingHandler.editLocale = function(keyName, localeKey) {
             PWM_MAIN.addEventHandler('button-addValue','click',function(){
                 ChallengeSettingHandler.addRow(keyName,localeKey);
             });
-            //dojoParser.parse(PWM_MAIN.getObject('challengeLocaleDialogDiv'));
             for (var iteration in multiValues) {
                 (function(rowKey) {
                     var inputID = "value-" + keyName + "-" + localeName + "-" + rowKey;

+ 4 - 6
server/src/main/webapp/public/resources/js/configeditor-settings-customlink.js

@@ -72,7 +72,6 @@ CustomLinkHandler.redraw = function(keyName) {
 };
 
 CustomLinkHandler.drawRow = function(parentDiv, settingKey, iteration, value) {
-    require(["dojo/json"], function(JSON){
         var itemCount = PWM_MAIN.JSLibrary.itemCount(PWM_VAR['clientSettingCache'][settingKey]);
         var inputID = 'value_' + settingKey + '_' + iteration + "_";
         var options = PWM_SETTINGS['settings'][settingKey]['options'];
@@ -89,13 +88,13 @@ CustomLinkHandler.drawRow = function(parentDiv, settingKey, iteration, value) {
         htmlRow += '<td class="noborder" style="min-width:90px;"><button id="' + inputID + 'optionsButton"><span class="btn-icon pwm-icon pwm-icon-sliders"/> Options</button></td>';
 
         htmlRow += '<td style="width:10px">';
-        if (itemCount > 1 && iteration != (itemCount -1)) {
+        if (itemCount > 1 && iteration !== (itemCount -1)) {
             htmlRow += '<span id="' + inputID + '-moveDown" class="action-icon pwm-icon pwm-icon-chevron-down"></span>';
         }
         htmlRow += '</td>';
 
         htmlRow += '<td style="width:10px">';
-        if (itemCount > 1 && iteration != 0) {
+        if (itemCount > 1 && iteration !== 0) {
             htmlRow += '<span id="' + inputID + '-moveUp" class="action-icon pwm-icon pwm-icon-chevron-up"></span>';
         }
         htmlRow += '</td>';
@@ -133,7 +132,6 @@ CustomLinkHandler.drawRow = function(parentDiv, settingKey, iteration, value) {
             PWM_VAR['clientSettingCache'][settingKey][iteration]['type'] = PWM_MAIN.getObject(inputID + "type").value;
             CustomLinkHandler.write(settingKey);
         });
-    });
 };
 
 CustomLinkHandler.write = function(settingKey, finishFunction) {
@@ -180,7 +178,7 @@ CustomLinkHandler.addRow = function(keyName) {
         placeholder:'KeyName',
         completeFunction:function(value){
             for (var i in PWM_VAR['clientSettingCache'][keyName]) {
-                if (PWM_VAR['clientSettingCache'][keyName][i]['name'] == value) {
+                if (PWM_VAR['clientSettingCache'][keyName][i]['name'] === value) {
                     alert('key name already exists');
                     return;
                 }
@@ -276,7 +274,7 @@ CustomLinkHandler.multiLocaleStringDialog = function(keyName, iteration, setting
             var localeID = inputID + localeName;
             bodyText += '<td>' + localeName + '</td>';
             bodyText += '<td><input style="width:420px" class="configStringInput" type="text" value="' + value + '" id="' + localeID + '-input"></input></td>';
-            if (localeName != '') {
+            if (localeName !== '') {
                 bodyText += '<td><span class="delete-row-icon action-icon pwm-icon pwm-icon-times" id="' + localeID + '-removeLocaleButton"></span></td>';
             }
             bodyText += '</tr><tr>';

+ 52 - 52
server/src/main/webapp/public/resources/js/configeditor-settings.js

@@ -66,7 +66,7 @@ LocalizedStringValueHandler.draw = function(settingKey) {
         PWM_MAIN.addEventHandler('button-' + settingKey + '-addValue','click',function(){
             UILibrary.stringEditorDialog({
                 title:'Add Value',
-                textarea:('LOCALIZED_TEXT_AREA' == settingData['syntax']),
+                textarea:('LOCALIZED_TEXT_AREA' === settingData['syntax']),
                 regex:'pattern' in settingData ? settingData['pattern'] : '.+',
                 placeholder:settingData['placeholder'],
                 value:'',
@@ -95,7 +95,7 @@ LocalizedStringValueHandler.drawRow = function(parentDiv, settingKey, localeStri
     newTableRow.setAttribute("style", "border-width: 0");
 
     var tableHtml = '<td style="border-width:0; width: 15px">';
-    if (localeString != null && localeString.length > 0) {
+    if (localeString !== null && localeString.length > 0) {
         tableHtml += localeString;
     }
     tableHtml += '</td>';
@@ -106,7 +106,7 @@ LocalizedStringValueHandler.drawRow = function(parentDiv, settingKey, localeStri
     tableHtml += '<div id="value-' + inputID + '" class="configStringPanel"></div>';
     tableHtml += '</td>';
 
-    var defaultLocale = (localeString == null || localeString.length < 1);
+    var defaultLocale = (localeString === null || localeString.length < 1);
     var required = settingData['required'];
     var hasNonDefaultValues = PWM_MAIN.JSLibrary.itemCount(PWM_VAR['clientSettingCache'][settingKey]) > 1 ;
 
@@ -122,12 +122,12 @@ LocalizedStringValueHandler.drawRow = function(parentDiv, settingKey, localeStri
     PWM_MAIN.addEventHandler("button-" + settingKey + '-' + localeString + "-deleteRow","click",function(){
         LocalizedStringValueHandler.removeLocaleSetting(settingKey, localeString);
     });
-    UILibrary.addTextValueToElement('value-' + inputID, (value != null && value.length > 0) ? value : ' ');
+    UILibrary.addTextValueToElement('value-' + inputID, (value !== null && value.length > 0) ? value : ' ');
 
     var editFunction = function() {
         UILibrary.stringEditorDialog({
             title:'Edit Value',
-            textarea:('LOCALIZED_TEXT_AREA' == settingData['syntax']),
+            textarea:('LOCALIZED_TEXT_AREA' === settingData['syntax']),
             regex:'pattern' in settingData ? settingData['pattern'] : '.+',
             placeholder:settingData['placeholder'],
             value:value,
@@ -163,7 +163,7 @@ LocalizedStringValueHandler.addLocaleSetting = function(settingKey, localeKey) {
     } else {
         UILibrary.stringEditorDialog({
             title:'Add Value - ' + localeKey,
-            textarea:('LOCALIZED_TEXT_AREA' == settingData['syntax']),
+            textarea:('LOCALIZED_TEXT_AREA' === settingData['syntax']),
             regex:'pattern' in settingData ? settingData['pattern'] : '.+',
             placeholder:settingData['placeholder'],
             value:'',
@@ -196,7 +196,7 @@ StringArrayValueHandler.init = function(keyName) {
         StringArrayValueHandler.draw(keyName);
 
         var syntax = PWM_SETTINGS['settings'][keyName]['syntax'];
-        if (syntax == 'PROFILE') {
+        if (syntax === 'PROFILE') {
             PWM_MAIN.getObject("resetButton-" + keyName).style.display = 'none';
             PWM_MAIN.getObject("helpButton-" + keyName).style.display = 'none';
             PWM_MAIN.getObject("modifiedNoticeIcon-" + keyName).style.display = 'none';
@@ -216,7 +216,7 @@ StringArrayValueHandler.draw = function(settingKey) {
     tableElement.setAttribute("style", "border-width: 0;");
 
     var syntax = PWM_SETTINGS['settings'][settingKey]['syntax'];
-    if (syntax == 'PROFILE') {
+    if (syntax === 'PROFILE') {
         var divDescriptionElement = document.createElement("div");
         var text = PWM_SETTINGS['settings'][settingKey]['description'];
         text += '<br/>' + PWM_CONFIG.showString('Display_ProfileNamingRules');
@@ -246,7 +246,7 @@ StringArrayValueHandler.draw = function(settingKey) {
         addItemButton.setAttribute("type", "button");
         addItemButton.setAttribute("class", "btn");
         addItemButton.setAttribute("id", "button-" + settingKey + "-addItem");
-        addItemButton.innerHTML = '<span class="btn-icon pwm-icon pwm-icon-plus-square"></span>' + (syntax == 'PROFILE' ? "Add Profile" : "Add Value");
+        addItemButton.innerHTML = '<span class="btn-icon pwm-icon pwm-icon-plus-square"></span>' + (syntax === 'PROFILE' ? "Add Profile" : "Add Value");
         parentDivElement.appendChild(addItemButton);
 
         PWM_MAIN.addEventHandler('button-' + settingKey + '-addItem', 'click', function () {
@@ -266,12 +266,12 @@ StringArrayValueHandler.drawRow = function(settingKey, iteration, value, itemCou
     valueRow.setAttribute("id",inputID + "_row");
 
     var rowHtml = '';
-    if (syntax != 'PROFILE') {
+    if (syntax !== 'PROFILE') {
         rowHtml = '<td id="button-' + inputID + '" style="border-width:0; width: 15px"><span class="pwm-icon pwm-icon-edit"/></td>';
     }
     rowHtml += '<td style=""><div class="configStringPanel" id="' + inputID + '"></div></td>';
 
-    if (syntax == 'PROFILE') {
+    if (syntax === 'PROFILE') {
         var copyButtonID = 'button-' + settingKey + '-' + iteration + '-copy';
         rowHtml += '<td class="noborder nopadding" style="width:10px" title="Copy">';
         rowHtml += '<span id="' + copyButtonID + '" class="action-icon pwm-icon pwm-icon-copy"></span>';
@@ -280,14 +280,14 @@ StringArrayValueHandler.drawRow = function(settingKey, iteration, value, itemCou
 
     var downButtonID = 'button-' + settingKey + '-' + iteration + '-moveDown';
     rowHtml += '<td class="noborder nopadding" style="width:10px" title="Move Down">';
-    if (itemCount > 1 && iteration != (itemCount -1)) {
+    if (itemCount > 1 && iteration !== (itemCount -1)) {
         rowHtml += '<span id="' + downButtonID + '" class="action-icon pwm-icon pwm-icon-chevron-down"></span>';
     }
     rowHtml += '</td>';
 
     var upButtonID = 'button-' + settingKey + '-' + iteration + '-moveUp';
     rowHtml += '<td class="noborder nopadding" style="width:10px" title="Move Up">';
-    if (itemCount > 1 && iteration != 0) {
+    if (itemCount > 1 && iteration !== 0) {
         rowHtml += '<span id="' + upButtonID + '" class="action-icon pwm-icon pwm-icon-chevron-up"></span>';
     }
     rowHtml += '</td>';
@@ -305,7 +305,7 @@ StringArrayValueHandler.drawRow = function(settingKey, iteration, value, itemCou
     parentDivElement.appendChild(valueRow);
 
     UILibrary.addTextValueToElement(inputID, value);
-    if (syntax != 'PROFILE') {
+    if (syntax !== 'PROFILE') {
         PWM_MAIN.addEventHandler(inputID,'click',function(){
             StringArrayValueHandler.valueHandler(settingKey,iteration);
         });
@@ -338,11 +338,11 @@ StringArrayValueHandler.drawRow = function(settingKey, iteration, value, itemCou
         });
     }
 
-    if (itemCount > 1 && iteration != (itemCount -1)) {
+    if (itemCount > 1 && iteration !== (itemCount -1)) {
         PWM_MAIN.addEventHandler(downButtonID,'click',function(){StringArrayValueHandler.move(settingKey,false,iteration)});
     }
 
-    if (itemCount > 1 && iteration != 0) {
+    if (itemCount > 1 && iteration !== 0) {
         PWM_MAIN.addEventHandler(upButtonID,'click',function(){StringArrayValueHandler.move(settingKey,true,iteration)});
     }
 
@@ -400,7 +400,7 @@ StringArrayValueHandler.removeValue = function(settingKey, iteration) {
         currentValues.splice(iteration,1);
         StringArrayValueHandler.writeSetting(settingKey,false);
     };
-    if (syntax == 'PROFILE') {
+    if (syntax === 'PROFILE') {
         PWM_MAIN.showConfirmDialog({
             text:PWM_CONFIG.showString('Confirm_RemoveProfile',{value1:profileName}),
             okAction:function(){
@@ -415,7 +415,7 @@ StringArrayValueHandler.removeValue = function(settingKey, iteration) {
 StringArrayValueHandler.writeSetting = function(settingKey, reload) {
     var syntax = PWM_SETTINGS['settings'][settingKey]['syntax'];
     var nextFunction = function() {
-        if (syntax == 'PROFILE') {
+        if (syntax === 'PROFILE') {
             PWM_MAIN.goto('editor');
         }
         if (reload) {
@@ -479,7 +479,7 @@ MultiLocaleTableHandler.draw = function(keyName) {
                 // clear the old dijit node (if it exists)
                 var inputID = "value-" + keyName + "-" + localeName + "-" + iteration;
                 var oldDijitNode = registry.byId(inputID);
-                if (oldDijitNode != null) {
+                if (oldDijitNode !== null) {
                     try {
                         oldDijitNode.destroy();
                     } catch (error) {
@@ -525,7 +525,7 @@ MultiLocaleTableHandler.draw = function(keyName) {
                 localeTableElement.appendChild(newTableRow);
             }
 
-            if (localeName != '') { // add remove locale x
+            if (localeName !== '') { // add remove locale x
                 var imgElement2 = document.createElement("div");
                 imgElement2.setAttribute("id", "div-" + keyName + "-" + localeName + "-remove");
                 imgElement2.setAttribute("class", "delete-row-icon action-icon pwm-icon pwm-icon-times");
@@ -580,15 +580,15 @@ MultiLocaleTableHandler.draw = function(keyName) {
 };
 
 MultiLocaleTableHandler.writeMultiLocaleSetting = function(settingKey, locale, iteration, value) {
-    if (locale != null) {
-        if (PWM_VAR['clientSettingCache'][settingKey][locale] == null) {
+    if (locale !== null) {
+        if (PWM_VAR['clientSettingCache'][settingKey][locale] === null) {
             PWM_VAR['clientSettingCache'][settingKey][locale] = [ "" ];
         }
 
-        if (iteration == null) {
+        if (iteration === null) {
             delete PWM_VAR['clientSettingCache'][settingKey][locale];
         } else {
-            if (value == null) {
+            if (value === null) {
                 PWM_VAR['clientSettingCache'][settingKey][locale].splice(iteration,1);
             } else {
                 PWM_VAR['clientSettingCache'][settingKey][locale][iteration] = value;
@@ -670,14 +670,14 @@ FormTableHandler.drawRow = function(parentDiv, settingKey, iteration, value) {
         htmlRow += '<td style="width:1px" id="icon-editLabel-' + inputID + '"><span class="btn-icon pwm-icon pwm-icon-edit"></span></td>';
         htmlRow += '<td style="background: #f6f9f8; border:1px solid #dae1e1; width:170px"><div style="" class="noWrapTextBox " id="' + inputID + 'label"><span>' + value['labels'][''] + '</span></div></td>';
 
-        var userDNtypeAllowed = options['type-userDN'] == 'show';
+        var userDNtypeAllowed = options['type-userDN'] === 'show';
         if (!PWM_MAIN.JSLibrary.isEmpty(options)) {
             htmlRow += '<td style="width:15px;">';
             htmlRow += '<select id="' + inputID + 'type">';
             for (var optionItem in options) {
-                //if (optionList[optionItem] != 'userDN' || userDNtypeAllowed) {
+                //if (optionList[optionItem] !== 'userDN' || userDNtypeAllowed) {
                 var optionName = options[optionItem];
-                var selected = (optionName == PWM_VAR['clientSettingCache'][settingKey][iteration]['type']);
+                var selected = (optionName === PWM_VAR['clientSettingCache'][settingKey][iteration]['type']);
                 htmlRow += '<option value="' + optionName + '"' + (selected ? " selected" : "") + '>' + optionName + '</option>';
                 //}
             }
@@ -691,13 +691,13 @@ FormTableHandler.drawRow = function(parentDiv, settingKey, iteration, value) {
         }
 
         htmlRow += '<td style="width:10px">';
-        if (itemCount > 1 && iteration != (itemCount -1)) {
+        if (itemCount > 1 && iteration !== (itemCount -1)) {
             htmlRow += '<span id="' + inputID + '-moveDown" class="action-icon pwm-icon pwm-icon-chevron-down"></span>';
         }
         htmlRow += '</td>';
 
         htmlRow += '<td style="width:10px">';
-        if (itemCount > 1 && iteration != 0) {
+        if (itemCount > 1 && iteration !== 0) {
             htmlRow += '<span id="' + inputID + '-moveUp" class="action-icon pwm-icon pwm-icon-chevron-up"></span>';
         }
         htmlRow += '</td>';
@@ -781,7 +781,7 @@ FormTableHandler.addRow = function(keyName) {
         placeholder:'FieldName',
         completeFunction:function(value){
             for (var i in PWM_VAR['clientSettingCache'][keyName]) {
-                if (PWM_VAR['clientSettingCache'][keyName][i]['name'] == value) {
+                if (PWM_VAR['clientSettingCache'][keyName][i]['name'] === value) {
                     alert('field already exists');
                     return;
                 }
@@ -804,11 +804,11 @@ FormTableHandler.showOptionsDialog = function(keyName, iteration) {
     var currentValue = PWM_VAR['clientSettingCache'][keyName][iteration];
 
     var hideStandardOptions = PWM_MAIN.JSLibrary.arrayContains(settings['flags'],'Form_HideStandardOptions');
-    var showRequired = PWM_MAIN.JSLibrary.arrayContains(settings['flags'],'Form_ShowRequiredOption') && (type != 'checkbox');
+    var showRequired = PWM_MAIN.JSLibrary.arrayContains(settings['flags'],'Form_ShowRequiredOption') && (type !== 'checkbox');
     var showUnique = PWM_MAIN.JSLibrary.arrayContains(settings['flags'],'Form_ShowUniqueOption');
     var showReadOnly = PWM_MAIN.JSLibrary.arrayContains(settings['flags'],'Form_ShowReadOnlyOption');
     var showMultiValue = PWM_MAIN.JSLibrary.arrayContains(settings['flags'],'Form_ShowMultiValueOption');
-    var showConfirmation = type != 'checkbox' && type != 'select' && !hideStandardOptions;
+    var showConfirmation = type !== 'checkbox' && type !== 'select' && !hideStandardOptions;
     var showSource = PWM_MAIN.JSLibrary.arrayContains(settings['flags'],'Form_ShowSource');
 
 
@@ -1004,7 +1004,7 @@ FormTableHandler.multiLocaleStringDialog = function(keyName, iteration, settingT
             var localeID = inputID + localeName;
             bodyText += '<td>' + localeName + '</td>';
             bodyText += '<td><input style="width:420px" class="configStringInput" type="text" value="' + value + '" id="' + localeID + '-input"></input></td>';
-            if (localeName != '') {
+            if (localeName !== '') {
                 bodyText += '<td><span class="delete-row-icon action-icon pwm-icon pwm-icon-times" id="' + localeID + '-removeLocaleButton"></span></td>';
             }
             bodyText += '</tr><tr>';
@@ -1103,12 +1103,12 @@ FormTableHandler.showSelectOptionsDialog = function(keyName, iteration) {
 };
 
 FormTableHandler.addSelectOptionsOption = function(keyName, iteration, optionName, optionValue) {
-    if (optionName == null || optionName.length < 1) {
+    if (optionName === null || optionName.length < 1) {
         alert('Name field is required');
         return;
     }
 
-    if (optionValue == null || optionValue.length < 1) {
+    if (optionValue === null || optionValue.length < 1) {
         alert('Value field is required');
         return;
     }
@@ -1209,7 +1209,7 @@ ChangePasswordHandler.validatePasswordPopupFields = function(settingKey) {
         PWM_MAIN.removeCssClass('field-password-length','invalid-value');
         if (password2.length > 0) {
 
-            if (password1 == password2) {
+            if (password1 === password2) {
                 matchStatus = "MATCH";
                 PWM_MAIN.getObject('button-storePassword').disabled = false;
             } else {
@@ -1222,12 +1222,12 @@ ChangePasswordHandler.validatePasswordPopupFields = function(settingKey) {
 };
 
 ChangePasswordHandler.markConfirmationCheck = function(matchStatus) {
-    if (matchStatus == "MATCH") {
+    if (matchStatus === "MATCH") {
         PWM_MAIN.getObject("confirmCheckMark").style.visibility = 'visible';
         PWM_MAIN.getObject("confirmCrossMark").style.visibility = 'hidden';
         PWM_MAIN.getObject("confirmCheckMark").width = '15';
         PWM_MAIN.getObject("confirmCrossMark").width = '0';
-    } else if (matchStatus == "NO_MATCH") {
+    } else if (matchStatus === "NO_MATCH") {
         PWM_MAIN.getObject("confirmCheckMark").style.visibility = 'hidden';
         PWM_MAIN.getObject("confirmCrossMark").style.visibility = 'visible';
         PWM_MAIN.getObject("confirmCheckMark").width = '0';
@@ -1464,7 +1464,7 @@ ActionHandler.drawRow = function(settingKey, iteration, value) {
     htmlRow += '</td><td>';
     htmlRow += '<select id="select-' + inputID + '-type">';
     for (var optionItem in optionList) {
-        var selected = optionList[optionItem] == PWM_VAR['clientSettingCache'][settingKey][iteration]['type'];
+        var selected = optionList[optionItem] === PWM_VAR['clientSettingCache'][settingKey][iteration]['type'];
         htmlRow += '<option value="' + optionList[optionItem] + '"' + (selected ? ' selected' : '') + '>' + optionList[optionItem] + '</option>';
     }
     htmlRow += '</select>';
@@ -1563,7 +1563,7 @@ ActionHandler.showOptionsDialog = function(keyName, iteration) {
             for (var optionItem in ActionHandler.httpMethodOptions) {
                 var label = ActionHandler.httpMethodOptions[optionItem]['label'];
                 var optionValue = ActionHandler.httpMethodOptions[optionItem]['value'];
-                var selected = optionValue == value['method'];
+                var selected = optionValue === value['method'];
                 bodyText += '<option value="' + optionValue + '"' + (selected ? ' selected' : '') + '>' + label + '</option>';
             }
             bodyText += '</td>';
@@ -1596,7 +1596,7 @@ ActionHandler.showOptionsDialog = function(keyName, iteration) {
             for (var optionItem in ActionHandler.ldapMethodOptions) {
                 var label = ActionHandler.ldapMethodOptions[optionItem]['label'];
                 var optionValue = ActionHandler.ldapMethodOptions[optionItem]['value'];
-                var selected = optionValue == value['ldapMethod'];
+                var selected = optionValue === value['ldapMethod'];
                 bodyText += '<option value="' + optionValue + '"' + (selected ? ' selected' : '') + '>' + label + '</option>';
             }
             bodyText += '</td></tr>';
@@ -1681,7 +1681,7 @@ ActionHandler.showOptionsDialog = function(keyName, iteration) {
                         });
                     }
 
-                } else if (value['type'] == 'ldap') {
+                } else if (value['type'] === 'ldap') {
                     PWM_MAIN.addEventHandler('input-' + inputID + '-attributeName','input',function(){
                         value['attributeName'] = PWM_MAIN.getObject('input-' + inputID + '-attributeName').value;
                         ActionHandler.write(keyName);
@@ -1845,7 +1845,7 @@ EmailTableHandler.draw = function(settingKey) {
 };
 
 EmailTableHandler.drawRowHtml = function(settingKey, localeName) {
-    var localeLabel = localeName == '' ? 'Default Locale' : PWM_GLOBAL['localeInfo'][localeName] + " (" + localeName + ")";
+    var localeLabel = localeName === '' ? 'Default Locale' : PWM_GLOBAL['localeInfo'][localeName] + " (" + localeName + ")";
     var idPrefix = "setting-" + localeName + "-" + settingKey;
     var htmlBody = '';
     htmlBody += '<table class="noborder" style=""><tr ><td class="noborder" style="max-width: 440px">';
@@ -1866,7 +1866,7 @@ EmailTableHandler.drawRowHtml = function(settingKey, localeName) {
     outputFunction('HTML Body', 'bodyHtml');
 
     htmlBody += '</table></td><td class="noborder" style="width:20px; vertical-align:top">';
-    if (localeName != '' || PWM_MAIN.JSLibrary.itemCount(PWM_VAR['clientSettingCache'][settingKey]) < 2) { // add remove locale x
+    if (localeName !== '' || PWM_MAIN.JSLibrary.itemCount(PWM_VAR['clientSettingCache'][settingKey]) < 2) { // add remove locale x
         htmlBody += '<div id="button-deleteRow-' + idPrefix + '" style="vertical-align:top" class="delete-row-icon action-icon pwm-icon pwm-icon-times"></div>';
     }
     htmlBody += '</td></tr></table><br/>';
@@ -2039,7 +2039,7 @@ UserPermissionHandler.draw = function(keyName) {
                 + '<datalist id="' + inputID + '-datalist"/></td>'
                 + '</tr>';
 
-            if (resultValue[rowKey]['type'] != 'ldapGroup') {
+            if (resultValue[rowKey]['type'] !== 'ldapGroup') {
                 htmlBody += '<tr>'
                     + '<td><span id="' + inputID + '_FilterHeader' + '">' + PWM_CONFIG.showString('Setting_Permission_Filter') + '</span></td>'
                     + '<td id="icon-edit-query-' + inputID + '"><div title="Edit Value" class="btn-icon pwm-icon pwm-icon-edit"></div></td>'
@@ -2049,7 +2049,7 @@ UserPermissionHandler.draw = function(keyName) {
 
             htmlBody += '<tr>'
                 + '<td><span id="' + inputID + '_BaseHeader' + '">'
-                + PWM_CONFIG.showString((resultValue[rowKey]['type'] == 'ldapGroup') ?  'Setting_Permission_Base_Group' : 'Setting_Permission_Base')
+                + PWM_CONFIG.showString((resultValue[rowKey]['type'] === 'ldapGroup') ?  'Setting_Permission_Base_Group' : 'Setting_Permission_Base')
                 + '</span></td>'
                 + '<td id="icon-edit-base-' + inputID + '"><div title="Edit Value" class="btn-icon pwm-icon pwm-icon-edit"></div></td>'
                 + '<td><div style="width: 350px; padding: 5px;" class="configStringPanel noWrapTextBox border" id="' + inputID + '-base">&nbsp;</div></td>'
@@ -2080,7 +2080,7 @@ UserPermissionHandler.draw = function(keyName) {
                     UserPermissionHandler.write(keyName);
                 });
 
-                if (resultValue[rowKey]['type'] != 'ldapGroup') {
+                if (resultValue[rowKey]['type'] !== 'ldapGroup') {
                     UILibrary.addTextValueToElement(inputID + '-query', PWM_VAR['clientSettingCache'][keyName][rowKey]['ldapQuery']);
                     var queryEditor = function(){
                         UILibrary.stringEditorDialog({
@@ -2275,9 +2275,9 @@ NumericValueHandler.impl = function(settingKey, type, defaultMin, defaultMax) {
     var max = 'Maximum' in properties ? parseInt(properties['Maximum']) : defaultMax;
 
     var htmlBody = '<input type="number" id="value_' + settingKey + '" class="configNumericInput" min="'+min+'" max="'+max+'"/>';
-    if (type == 'number') {
+    if (type === 'number') {
         htmlBody += '<span class="configNumericLimits">' + min + ' - ' + max + '</span>';
-    } else if (type == 'duration') {
+    } else if (type === 'duration') {
         htmlBody +=  '<span class="configNumericLimits">' + PWM_MAIN.showString('Display_Seconds')  + '</span>'
         htmlBody +=  '<span style="margin-left:20px" id="display-' + settingKey + '-duration"></span>';
     }
@@ -2301,7 +2301,7 @@ NumericValueHandler.updateDurationDisplay = function(settingKey, numberValue) {
     numberValue = parseInt(numberValue);
     var displayElement = PWM_MAIN.getObject('display-' + settingKey + '-duration');
     if (displayElement) {
-        displayElement.innerHTML = (numberValue && numberValue != 0)
+        displayElement.innerHTML = (numberValue && numberValue !== 0)
             ? PWM_MAIN.convertSecondsToDisplayTimeDuration(numberValue, true)
             : '';
     }
@@ -2366,7 +2366,7 @@ StringValueHandler.init = function(settingKey) {
             } else {
                 UILibrary.stringEditorDialog({
                     title:'Edit Value - ' + settingData['label'],
-                    textarea:('TEXT_AREA' == settingData['syntax']),
+                    textarea:('TEXT_AREA' === settingData['syntax']),
                     regex:'pattern' in settingData ? settingData['pattern'] : '.+',
                     placeholder:settingData['placeholder'],
                     value:value,
@@ -2803,7 +2803,7 @@ PrivateKeyHandler.draw = function(keyName) {
 
     var htmlBody = '<div style="max-height: 300px; overflow-y: auto">';
 
-    var hasValue = resultValue != null && 'key' in resultValue;
+    var hasValue = resultValue !== null && 'key' in resultValue;
 
     if (hasValue) {
         var certificates = resultValue['certificates'];

+ 27 - 27
server/src/main/webapp/public/resources/js/configeditor.js

@@ -51,7 +51,7 @@ PWM_CFGEDIT.readSetting = function(keyName, valueWriter) {
         if (PWM_SETTINGS['settings'][keyName] && PWM_SETTINGS['settings'][keyName]['level']) {
             settingLevel = PWM_SETTINGS['settings'][keyName]['level'];
         }
-        var showSetting = (PWM_SETTINGS['settings'][keyName] && PWM_SETTINGS['settings'][keyName]['syntax'] == 'PROFILE') ||   (!modifiedOnly || !isDefault) && (maxLevel < 0 || settingLevel  <= maxLevel );
+        var showSetting = (PWM_SETTINGS['settings'][keyName] && PWM_SETTINGS['settings'][keyName]['syntax'] === 'PROFILE') ||   (!modifiedOnly || !isDefault) && (maxLevel < 0 || settingLevel  <= maxLevel );
         if (showSetting) {
             valueWriter(resultValue);
             PWM_MAIN.setStyle('outline_' + keyName,'display','inherit');
@@ -87,7 +87,7 @@ PWM_CFGEDIT.updateLastModifiedInfo = function(keyName, data) {
     if (PWM_MAIN.getObject('panel-' + keyName + '-modifyUser')) {
         if (data['data']['modifyUser']) {
             var output = 'Modified by ' + data['data']['modifyUser']['userDN'];
-            if (data['data']['modifyUser']['ldapProfile'] && data['data']['modifyUser']['ldapProfile'] != "default") {
+            if (data['data']['modifyUser']['ldapProfile'] && data['data']['modifyUser']['ldapProfile'] !== "default") {
                 output += ' [' + data['data']['modifyUser']['ldapProfile'] + ']';
             }
             PWM_MAIN.getObject('panel-' + keyName + '-modifyUser').innerHTML = output;
@@ -195,7 +195,7 @@ PWM_CFGEDIT.getSettingValueElement = function(settingKey) {
 
 PWM_CFGEDIT.clearDivElements = function(parentDiv) {
     var parentDivElement = PWM_MAIN.getObject(parentDiv);
-    if (parentDivElement != null) {
+    if (parentDivElement !== null) {
         if (parentDivElement.hasChildNodes()) {
             while (parentDivElement.childNodes.length >= 1) {
                 var firstChild = parentDivElement.firstChild;
@@ -247,7 +247,7 @@ PWM_CFGEDIT.saveConfiguration = function() {
         var confirmFunction = function(){
             var url = "editor?processAction=finishEditing";
             var loadFunction = function(data) {
-                if (data['error'] == true) {
+                if (data['error'] === true) {
                     PWM_MAIN.showErrorDialog(data);
                 } else {
                     console.log('save completed');
@@ -390,10 +390,10 @@ PWM_CFGEDIT.showChangeLog=function(confirmText, confirmFunction) {
                     bodyText += '</ul></div>';
                 }
 
-                if (confirmText != undefined) {
+                if (confirmText !== undefined) {
                     bodyText += '<br/><div>' + confirmText + '</div>';
                 }
-                if (confirmFunction == undefined) {
+                if (confirmFunction === undefined) {
                     PWM_MAIN.showDialog({title: "Unsaved Configuration Editor Changes", text: bodyText, dialogClass:'wide', showClose: true});
                 } else {
                     PWM_MAIN.showConfirmDialog({title: "Unsaved Configuration Editor Changes", text: bodyText, dialogClass:'wide', showClose: true, okAction:confirmFunction});
@@ -599,7 +599,7 @@ PWM_CFGEDIT.cancelEditing = function() {
             if (data['error']) {
                 PWM_MAIN.showDialog({title: PWM_MAIN.showString("Title_Error"), text: data['errorMessage']});
             } else {
-                if (data['data']['modified'] == true) {
+                if (data['data']['modified'] === true) {
                     var bodyText = '<div class="changeLogViewBox">';
                     bodyText += data['data']['html'];
                     bodyText += '</div><br/><div>';
@@ -799,7 +799,7 @@ PWM_CFGEDIT.loadMainPageBody = function() {
         var uri = window.location.href;
         var queryString = uri.substring(uri.indexOf("?") + 1, uri.length);
         var queryParams = ioQuery.queryToObject(queryString);
-        if (queryParams['processAction'] == 'gotoSetting') {
+        if (queryParams['processAction'] === 'gotoSetting') {
             PWM_CFGEDIT.gotoSetting(queryParams['category'],queryParams['settingKey'],queryParams['profile']);
             return;
         }
@@ -818,15 +818,15 @@ PWM_CFGEDIT.displaySettingsCategory = function(category) {
     }
     var htmlSettingBody = '';
 
-    if (category == 'LDAP_BASE') {
+    if (category === 'LDAP_BASE') {
         htmlSettingBody += '<div style="width: 100%; text-align: center">'
             + '<button class="btn" id="button-test-LDAP_BASE"><span class="btn-icon pwm-icon pwm-icon-bolt"></span>Test LDAP Profile</button>'
             + '</div>';
-    } else if (category == 'DATABASE_SETTINGS') {
+    } else if (category === 'DATABASE_SETTINGS') {
         htmlSettingBody += '<div style="width: 100%; text-align: center">'
             + '<button class="btn" id="button-test-DATABASE_SETTINGS"><span class="btn-icon pwm-icon pwm-icon-bolt"></span>Test Database Connection</button>'
             + '</div>';
-    } else if (category == 'SMS_GATEWAY') {
+    } else if (category === 'SMS_GATEWAY') {
         htmlSettingBody += '<div style="width: 100%; text-align: center">'
             + '<button class="btn" id="button-test-SMS"><span class="btn-icon pwm-icon pwm-icon-bolt"></span>Test SMS Settings</button>'
             + '</div>';
@@ -836,7 +836,7 @@ PWM_CFGEDIT.displaySettingsCategory = function(category) {
     for (var loopSetting in PWM_SETTINGS['settings']) {
         (function(settingKey) {
             var settingInfo = PWM_SETTINGS['settings'][settingKey];
-            if (settingInfo['category'] == category && !settingInfo['hidden']) {
+            if (settingInfo['category'] === category && !settingInfo['hidden']) {
                 htmlSettingBody += PWM_CFGEDIT.drawHtmlOutlineForSetting(settingInfo);
             }
         })(loopSetting);
@@ -847,18 +847,18 @@ PWM_CFGEDIT.displaySettingsCategory = function(category) {
     for (var loopSetting in PWM_SETTINGS['settings']) {
         (function(settingKey) {
             var settingInfo = PWM_SETTINGS['settings'][settingKey];
-            if (settingInfo['category'] == category && !settingInfo['hidden']) {
+            if (settingInfo['category'] === category && !settingInfo['hidden']) {
                 PWM_CFGEDIT.initSettingDisplay(settingInfo);
             }
         })(loopSetting);
     }
-    if (category == 'LDAP_BASE') {
+    if (category === 'LDAP_BASE') {
         PWM_MAIN.addEventHandler('button-test-LDAP_BASE', 'click', function(){PWM_CFGEDIT.ldapHealthCheck();});
-    } else if (category == 'DATABASE_SETTINGS') {
+    } else if (category === 'DATABASE_SETTINGS') {
         PWM_MAIN.addEventHandler('button-test-DATABASE_SETTINGS', 'click', function(){PWM_CFGEDIT.databaseHealthCheck();});
-    } else if (category == 'SMS_GATEWAY') {
+    } else if (category === 'SMS_GATEWAY') {
         PWM_MAIN.addEventHandler('button-test-SMS', 'click', function(){PWM_CFGEDIT.smsHealthCheck();});
-    } else if (category == 'HTTPS_SERVER') {
+    } else if (category === 'HTTPS_SERVER') {
         PWM_MAIN.addEventHandler('button-test-HTTPS_SERVER', 'click', function(){PWM_CFGEDIT.httpsCertificateView();});
     }
     PWM_CFGEDIT.applyGotoSettingHandlers();
@@ -1053,7 +1053,7 @@ PWM_CFGEDIT.drawNavigationMenu = function() {
                     store: myStore,
                     query: {id: 'ROOT'},
                     mayHaveChildren: function(object){
-                        return object.type == 'navigation';
+                        return object.type === 'navigation';
                     }
                 });
 
@@ -1105,23 +1105,23 @@ PWM_CFGEDIT.dispatchNavigationItem = function(item) {
     var currentID = item['id'];
     var type = item['type'];
     //debugger;
-    if  (type == 'navigation') {
+    if  (type === 'navigation') {
         /* not used, nav tree set to auto-expand */
-    } else if (type == 'category') {
+    } else if (type === 'category') {
         var category = item['category'];
         if (item['profile']) {
             PWM_CFGEDIT.gotoSetting(category,null,item['profile']);
         } else {
             PWM_CFGEDIT.gotoSetting(category);
         }
-    } else if (type == 'displayText') {
+    } else if (type === 'displayText') {
         var keys = item['keys'];
         PWM_CFGEDIT.setBreadcrumbText('Display Text - ' + item['name']);
         PWM_CFGEDIT.drawDisplayTextPage(currentID,keys);
-    } else if (type == 'profile') {
+    } else if (type === 'profile') {
         var category = item['category'];
         PWM_CFGEDIT.gotoSetting(category,null,currentID);
-    } else if (type == 'profileDefinition') {
+    } else if (type === 'profileDefinition') {
         var profileSettingKey = item['profileSetting'];
         PWM_CFGEDIT.drawProfileEditorPage(profileSettingKey);
     }
@@ -1171,7 +1171,7 @@ PWM_CFGEDIT.drawDisplayTextPage = function(settingKey, keys) {
     var checkForFinishFunction = function() {
         console.log('checking for finish function...');
         setTimeout(function(){
-            if (PWM_VAR['outstandingOperations'] == 0) {
+            if (PWM_VAR['outstandingOperations'] === 0) {
                 PWM_MAIN.getObject('displaytext-loading-panel').style.display = 'none';
                 PWM_MAIN.getObject('localetext-editor-wrapper').style.display = 'inherit';
             } else {
@@ -1186,7 +1186,7 @@ PWM_CFGEDIT.drawDisplayTextPage = function(settingKey, keys) {
 PWM_CFGEDIT.initConfigSettingsDefinition=function(nextFunction) {
     var clientConfigUrl = PWM_GLOBAL['url-context'] + "/private/config/editor?processAction=settingData";
     var loadFunction = function(data) {
-        if (data['error'] == true) {
+        if (data['error'] === true) {
             console.error('unable to load ' + clientConfigUrl + ', error: ' + data['errorDetail'])
         } else {
             for (var settingKey in data['data']) {
@@ -1210,7 +1210,7 @@ PWM_CFGEDIT.displaySettingHelp = function(settingKey) {
     var helpExpandedPrefs = PWM_MAIN.Preferences.readSessionStorage('helpExpanded',{});
     var element = PWM_MAIN.getObject('pane-help-' + settingKey);
     if (element) {
-        if (element.style.display == 'none') {
+        if (element.style.display === 'none') {
             element.style.display = 'inherit';
             helpExpandedPrefs[settingKey] = true;
         } else {
@@ -1241,7 +1241,7 @@ PWM_CFGEDIT.showSettingFilter = function() {
         PWM_MAIN.getObject('panel-settingLevelDescription').innerHTML = descriptionText;
     };
     var updateIcon = function() {
-        var isDefault = PWM_VAR['settingFilter_modifiedSettingsOnly'] == false && PWM_VAR['settingFilter_level'] == 2;
+        var isDefault = PWM_VAR['settingFilter_modifiedSettingsOnly'] === false && PWM_VAR['settingFilter_level'] === 2;
         if (isDefault) {
             PWM_MAIN.removeCssClass('settingFilter_icon', "modified");
         } else {

+ 1 - 1
server/src/main/webapp/public/resources/js/configguide.js

@@ -32,7 +32,7 @@ PWM_GUIDE.selectTemplate = function(template) {
         url = PWM_MAIN.addParamToUrl(url, 'template', template);
         PWM_MAIN.showDialog(url,function(result){
             if (!result['error']) {
-                PWM_MAIN.getObject('button_next').disabled = template == "NOTSELECTED";
+                PWM_MAIN.getObject('button_next').disabled = template === "NOTSELECTED";
                 PWM_MAIN.closeWaitDialog();
             } else {
                 PWM_MAIN.showError(result['errorDetail']);

+ 4 - 4
server/src/main/webapp/public/resources/js/configmanager.js

@@ -30,7 +30,7 @@ PWM_CONFIG.lockConfiguration=function() {
         PWM_MAIN.showWaitDialog({loadFunction:function() {
             var url = 'ConfigManager?processAction=lockConfiguration';
             var loadFunction = function(data) {
-                if (data['error'] == true) {
+                if (data['error'] === true) {
                     PWM_MAIN.closeWaitDialog();
                     PWM_MAIN.showDialog({
                         title: PWM_MAIN.showString('Title_Error'),
@@ -208,7 +208,7 @@ PWM_CONFIG.showHeaderHealth = function() {
     if (parentDiv && headerDiv) {
         var loadFunction = function(data) {
             if (data['data'] && data['data']['overall']) {
-                var hasWarnTopics = data['data']['overall'] == 'WARN';
+                var hasWarnTopics = data['data']['overall'] === 'WARN';
                 console.log('has health errors: ' + hasWarnTopics);
                 if (hasWarnTopics) {
                     PWM_MAIN.removeCssClass('header-menu-alert','display-none');
@@ -261,7 +261,7 @@ PWM_CONFIG.downloadConfig = function () {
 
 PWM_CONFIG.downloadSupportBundle = function() {
     var dialogText = '';
-    if (PWM_VAR['config_localDBLogLevel'] != 'TRACE') {
+    if (PWM_VAR['config_localDBLogLevel'] !== 'TRACE') {
         dialogText += PWM_CONFIG.showString("Warning_MakeSupportZipNoTrace");
         dialogText += '<br/><br/>';
     }
@@ -313,7 +313,7 @@ PWM_CONFIG.heartbeatCheck = function() {
     var loadFunction = function(data) {
         try {
             var serverStartTime = data['data']['PWM_GLOBAL']['startupTime'];
-            if (serverStartTime != PWM_GLOBAL['startupTime']) {
+            if (serverStartTime !== PWM_GLOBAL['startupTime']) {
                 var message = "Application appears to have be restarted.";
                 handleErrorFunction(message);
             } else {

+ 17 - 17
server/src/main/webapp/public/resources/js/helpdesk.js

@@ -40,7 +40,7 @@ PWM_HELPDESK.executeAction = function(actionName) {
                 url = PWM_MAIN.addParamToUrl(url, "name", actionName);
                 var loadFunction = function(data) {
                     PWM_MAIN.closeWaitDialog();
-                    if (data['error'] == true) {
+                    if (data['error'] === true) {
                         PWM_MAIN.showDialog({title: PWM_MAIN.showString('Title_Error'), text: data['errorDetail']});
                     } else {
                         PWM_MAIN.showDialog({title: PWM_MAIN.showString('Title_Success'), text: data['successMessage'], nextAction: function () {
@@ -86,7 +86,7 @@ PWM_HELPDESK.doPasswordChange = function(password, random) {
         var url = "helpdesk?processAction=setPassword";
         var loadFunction = function(results) {
             var bodyText = "";
-            if (results['error'] == true) {
+            if (results['error'] === true) {
                 bodyText += results['errorMessage'];
                 if (results['errorMessage']) {
                     bodyText += '<br/><br/>';
@@ -109,7 +109,7 @@ PWM_HELPDESK.doPasswordChange = function(password, random) {
             }
             bodyText += '<br/><br/><button class="btn" id="button-continue">'
                 + '<span class="btn-icon pwm-icon pwm-icon-forward"></span>' + PWM_MAIN.showString('Button_OK') + '</button>';
-            if (PWM_VAR['helpdesk_setting_clearResponses'] == 'ask') {
+            if (PWM_VAR['helpdesk_setting_clearResponses'] === 'ask') {
                 bodyText += '<span style="padding-left: 10px">&nbsp;</span>';
                 bodyText += '<button class="btn" id="button-clearResponses">';
                 bodyText += '<span class="btn-icon pwm-icon pwm-icon-eraser"></span>' + PWM_MAIN.showString('Button_ClearResponses') + '</button>';
@@ -188,7 +188,7 @@ PWM_HELPDESK.changePasswordPopup = function() {
 
     bodyText += '</tr></table><br/>';
     bodyText += '<button name="change" class="btn" id="password_button" disabled="true"><span class="btn-icon pwm-icon pwm-icon-key"></span>' + PWM_MAIN.showString('Button_ChangePassword') + '</button>';
-    if (PWM_VAR['helpdesk_setting_PwUiMode'] == 'both') {
+    if (PWM_VAR['helpdesk_setting_PwUiMode'] === 'both') {
         bodyText += '<button name="random" class="btn" id="button-autoGeneratePassword"><span class="btn-icon pwm-icon pwm-icon-retweet"></span>' + PWM_MAIN.showString('Title_RandomPasswords') + '</button>';
     }
 
@@ -225,9 +225,9 @@ PWM_HELPDESK.changePasswordPopup = function() {
 };
 
 PWM_HELPDESK.initiateChangePasswordDialog = function() {
-    if (PWM_VAR['helpdesk_setting_PwUiMode'] == 'autogen') {
+    if (PWM_VAR['helpdesk_setting_PwUiMode'] === 'autogen') {
         PWM_HELPDESK.generatePasswordPopup();
-    } else if (PWM_VAR['helpdesk_setting_PwUiMode'] == 'random') {
+    } else if (PWM_VAR['helpdesk_setting_PwUiMode'] === 'random') {
         PWM_HELPDESK.setRandomPasswordPopup();
     } else {
         PWM_HELPDESK.changePasswordPopup();
@@ -338,7 +338,7 @@ PWM_HELPDESK.processHelpdeskSearch = function() {
         PWM_MAIN.getObject('searchIndicator').style.display = 'none';
     };
     validationProps['processResultsFunction'] = function(data) {
-        if (data == null) {
+        if (data === null) {
             PWM_MAIN.showErrorDialog(PWM_MAIN.showString('Display_HelpdeskNoData'));
         } else {
             var grid = PWM_VAR['heldesk_search_grid'];
@@ -409,7 +409,7 @@ PWM_HELPDESK.deleteUser = function() {
             var url = "helpdesk?processAction=deleteUser&userKey=" + PWM_VAR['helpdesk_obfuscatedDN'];
             var loadFunction = function(data) {
                 PWM_MAIN.closeWaitDialog();
-                if (data['error'] == true) {
+                if (data['error'] === true) {
                     PWM_MAIN.showErrorDialog(error);
                 } else {
                     PWM_MAIN.showDialog({title: PWM_MAIN.showString('Title_Success'), text: data['successMessage'], okAction: function () {
@@ -491,7 +491,7 @@ PWM_HELPDESK.validateCode = function(options) {
         + '</tr></td></table></div>';
 
     var successFunction = function() {
-        if (PWM_MAIN.getObject('application-info').getAttribute('data-jsp-name') == 'helpdesk.jsp') {
+        if (PWM_MAIN.getObject('application-info').getAttribute('data-jsp-name') === 'helpdesk.jsp') {
             PWM_HELPDESK.loadSearchDetails(userKey);
         }
     };
@@ -512,7 +512,7 @@ PWM_HELPDESK.validateCode = function(options) {
 
 PWM_HELPDESK.sendVerificationToken = function(userKey, methods) {
     var sendMethodSetting = PWM_VAR["helpdesk_setting_tokenSendMethod"];
-    var tokenChoiceFlag = sendMethodSetting == 'CHOICE_SMS_EMAIL';
+    var tokenChoiceFlag = sendMethodSetting === 'CHOICE_SMS_EMAIL';
 
     var sendTokenAction = function(choice) {
         var sendContent = {};
@@ -542,11 +542,11 @@ PWM_HELPDESK.sendVerificationToken = function(userKey, methods) {
             + '<span class="btn-icon pwm-icon pwm-icon-database "></span>' + PWM_MAIN.showString('Button_Attributes') + '</button><br/>';
     }
     if (PWM_MAIN.JSLibrary.arrayContains(methods,'TOKEN')) {
-        if (tokenChoiceFlag || sendMethodSetting == 'EMAILONLY') {
+        if (tokenChoiceFlag || sendMethodSetting === 'EMAILONLY') {
             dialogText += '<br/><button class="btn" type="button" name="emailChoiceButton" id="emailChoiceButton">'
                 + '<span class="btn-icon pwm-icon pwm-icon-envelope-o"></span>' + PWM_MAIN.showString('Button_Email') + '</button>';
         }
-        if (tokenChoiceFlag || sendMethodSetting == 'SMSONLY') {
+        if (tokenChoiceFlag || sendMethodSetting === 'SMSONLY') {
             dialogText += '<br/><br/><button class="btn" type="button" name="smsChoiceButton" id="smsChoiceButton">'
                 + '<span class="btn-icon pwm-icon pwm-icon-phone"></span>' + PWM_MAIN.showString('Button_SMS') + '</button>';
         }
@@ -680,7 +680,7 @@ PWM_HELPDESK.initHelpdeskDetailPage = function() {
 PWM_HELPDESK.initPage = function() {
     var applicationData = PWM_MAIN.getObject("application-info");
     var jspName = applicationData ? applicationData.getAttribute("data-jsp-name") : "";
-    if ("helpdesk.jsp" == jspName || "helpdesk-detail.jsp" == jspName) {
+    if ("helpdesk.jsp" === jspName || "helpdesk-detail.jsp" === jspName) {
         PWM_MAIN.ajaxRequest("helpdesk?processAction=clientData",function(data){
             if (data['error']) {
                 PWM_MAIN.showErrorDialog(data);
@@ -690,10 +690,10 @@ PWM_HELPDESK.initPage = function() {
                 PWM_VAR[keyName] = data['data'][keyName];
             }
             console.log('loaded helpdesk clientData');
-            if ("helpdesk.jsp" == jspName) {
+            if ("helpdesk.jsp" === jspName) {
                 PWM_HELPDESK.initHelpdeskSearchPage();
             }
-            if ("helpdesk-detail.jsp" == jspName) {
+            if ("helpdesk-detail.jsp" === jspName) {
                 PWM_HELPDESK.initHelpdeskDetailPage();
             }
         },{method:"GET"});
@@ -714,7 +714,7 @@ PWM_HELPDESK.unlockIntruder = function() {
                     var url = PWM_MAIN.addParamToUrl(window.location.href,"processAction", "unlockIntruder");
                     url = PWM_MAIN.addParamToUrl(url, "userKey", PWM_VAR['helpdesk_obfuscatedDN']);
                     var load = function(data) {
-                        if (data['error'] == true) {
+                        if (data['error'] === true) {
                             PWM_MAIN.showErrorDialog(error);
                         } else {
                             PWM_MAIN.showDialog({
@@ -739,7 +739,7 @@ PWM_HELPDESK.doOtpClear = function() {
     PWM_MAIN.showWaitDialog({loadFunction:function() {
         var url = PWM_MAIN.addParamToUrl(window.location.href,"processAction", "clearOtpSecret");
         var loadFunction = function(results) {
-            if (results['error'] != true) {
+            if (results['error'] !== true) {
                 PWM_MAIN.showDialog({
                     title: PWM_MAIN.showString('Button_HelpdeskClearOtpSecret'),
                     text: results['successMessage'],

+ 149 - 218
server/src/main/webapp/public/resources/js/main.js

@@ -61,7 +61,7 @@ PWM_MAIN.pageLoadHandler = function() {
             var seenBundles = [];
             PWM_GLOBAL['localeBundle'].push('Display');
             array.forEach(PWM_GLOBAL['localeBundle'], function(bundleName){
-                if (array.indexOf(seenBundles, bundleName)  == -1) {
+                if (array.indexOf(seenBundles, bundleName)  === -1) {
                     var displayLoadDeferred = new Deferred();
                     PWM_MAIN.loadLocaleBundle(bundleName,function(){displayLoadDeferred.resolve()});
                     promises.push(displayLoadDeferred.promise);
@@ -99,7 +99,7 @@ PWM_MAIN.loadLocaleBundle = function(bundleName, completeFunction) {
     var clientConfigUrl = PWM_GLOBAL['url-context'] + "/public/rest/app-data/strings/" + bundleName;
     clientConfigUrl = PWM_MAIN.addParamToUrl(clientConfigUrl,'etag',PWM_GLOBAL['clientEtag']);
     var loadFunction = function(data){
-        if (data['error'] == true) {
+        if (data['error'] === true) {
             console.error('unable to load locale bundle from ' + clientConfigUrl + ', error: ' + data['errorDetail'])
         } else {
             PWM_GLOBAL['localeStrings'] = PWM_GLOBAL['localeStrings'] || {};
@@ -123,12 +123,6 @@ PWM_MAIN.loadLocaleBundle = function(bundleName, completeFunction) {
 PWM_MAIN.initPage = function() {
     PWM_MAIN.applyFormAttributes();
 
-    try {
-        PWM_MAIN.autofocusSupportExtension();
-    } catch(e) {
-        console.log('error during autofocus support extension: ' + e);
-    }
-
     require(["dojo"], function (dojo) {
         if (dojo.isIE) {
             document.body.setAttribute('data-browserType','ie');
@@ -139,20 +133,13 @@ PWM_MAIN.initPage = function() {
         }
     });
 
-    require(["dojo", "dojo/on"], function (dojo, on) {
-        on(document, "keypress", function (event) {
-            PWM_MAIN.checkForCapsLock(event);
-        });
+    PWM_MAIN.addEventHandler(document, "keypress", function (event) {
+        PWM_MAIN.checkForCapsLock(event);
+    });
 
-        require(["dojo/query","dojo/on"], function(query,on){
-            var results = query('.pwm-link-print');
-            for (var i = 0; i < results.length; i++) {
-                (function(formIter){
-                    var element = results[formIter];
-                    on(element, "click", function(){ window.print(); });
-                })(i);
-            }
-        });
+
+    PWM_MAIN.doQuery('.pwm-link-print',function(element){
+        PWM_MAIN.addEventHandler(element, "click", function(){ window.print(); });
     });
 
     if (PWM_MAIN.getObject('ldapProfile')) {
@@ -165,7 +152,7 @@ PWM_MAIN.initPage = function() {
         PWM_MAIN.showDialog({title:'Notice - Configuration Mode',text:PWM_MAIN.showString('Display_ConfigOpenInfo',{bundle:'Config'})});
     });
 
-    if (PWM_GLOBAL['applicationMode'] == 'CONFIGURATION') {
+    if (PWM_GLOBAL['applicationMode'] === 'CONFIGURATION') {
         var configModeNoticeSeen = PWM_MAIN.Preferences.readSessionStorage('configModeNoticeSeen');
         if (!configModeNoticeSeen) {
             PWM_MAIN.Preferences.writeSessionStorage('configModeNoticeSeen',true);
@@ -174,8 +161,8 @@ PWM_MAIN.initPage = function() {
     }
 
     if (PWM_GLOBAL['pageLeaveNotice'] > 0) {
-        require(["dojo","dojo/on"], function(dojo,on){
-            on(document, "beforeunload", function(){
+        require(["dojo"], function(dojo){
+            PWM_MAIN.addEventHandler(document, "beforeunload", function(){
                 dojo.xhrPost({
                     url: PWM_GLOBAL['url-command'] + "?processAction=pageLeaveNotice&pwmFormID=" + PWM_GLOBAL['pwmFormID'],
                     preventCache: true,
@@ -187,13 +174,13 @@ PWM_MAIN.initPage = function() {
 
     if (PWM_MAIN.getObject('message')) {
         PWM_GLOBAL['message_originalStyle'] = PWM_MAIN.getObject('message').style;
-        require(["dojo","dojo/on"], function(dojo,on){
+        require(["dojo"], function(dojo){
             if(dojo.isIE <= 8){
                 return;
             }
 
-            on(window, "resize", function(){ PWM_MAIN.messageDivFloatHandler() });
-            on(window, "scroll", function(){ PWM_MAIN.messageDivFloatHandler() });
+            PWM_MAIN.addEventHandler(window, "resize", function(){ PWM_MAIN.messageDivFloatHandler() });
+            PWM_MAIN.addEventHandler(window, "scroll", function(){ PWM_MAIN.messageDivFloatHandler() });
         });
     }
 
@@ -229,39 +216,36 @@ PWM_MAIN.initPage = function() {
 };
 
 PWM_MAIN.applyFormAttributes = function() {
+    PWM_MAIN.doQuery('form',function(formElement) {
+        formElement.setAttribute('autocomplete', 'off');
 
-    require(["dojo/_base/array", "dojo/query", "dojo/on"], function(array, query, on){
-        PWM_MAIN.doQuery('form',function(formElement) {
-            formElement.setAttribute('autocomplete', 'off');
-
-            //ios/webkit
-            formElement.setAttribute('autocapitalize', 'none');
-            formElement.setAttribute('autocorrect', 'off');
-        });
+        //ios/webkit
+        formElement.setAttribute('autocapitalize', 'none');
+        formElement.setAttribute('autocorrect', 'off');
+    });
 
-        PWM_MAIN.doQuery('.pwm-form',function(formElement) {
-            on(formElement, "submit", function(event){
-                PWM_MAIN.handleFormSubmit(formElement, event);
-            });
+    PWM_MAIN.doQuery('.pwm-form',function(formElement) {
+        PWM_MAIN.addEventHandler(formElement, "submit", function(event){
+            PWM_MAIN.handleFormSubmit(formElement, event);
         });
+    });
 
-        PWM_MAIN.doQuery('a:not([target])',function(linkElement) {
-            try {
-                if (linkElement.classList.contains('pwm-basic-link')) {
-                    return;
-                }
-            } catch (e) { /* ignore for browsers that don't support classList */ }
-            var hrefValue = linkElement.getAttribute('href');
-            if (hrefValue && hrefValue.charAt(0) != '#') {
-                on(linkElement, "click", function (event) {
-                    event.preventDefault();
-                    PWM_MAIN.showWaitDialog({loadFunction: function () {
-                        PWM_MAIN.goto(hrefValue);
-                    }});
-                });
-                linkElement.removeAttribute('href');
+    PWM_MAIN.doQuery('a:not([target])',function(linkElement) {
+        try {
+            if (linkElement.classList.contains('pwm-basic-link')) {
+                return;
             }
-        });
+        } catch (e) { /* ignore for browsers that don't support classList */ }
+        var hrefValue = linkElement.getAttribute('href');
+        if (hrefValue && hrefValue.charAt(0) !== '#') {
+            PWM_MAIN.addEventHandler(linkElement, "click", function (event) {
+                event.preventDefault();
+                PWM_MAIN.showWaitDialog({loadFunction: function () {
+                    PWM_MAIN.goto(hrefValue);
+                }});
+            });
+            linkElement.removeAttribute('href');
+        }
     });
 
     // handle html5 form attribute in JS in case browser (IE) doesn't support it.
@@ -279,13 +263,14 @@ PWM_MAIN.applyFormAttributes = function() {
 };
 
 PWM_MAIN.preloadAll = function(nextFunction) {
-    require(["dijit/Dialog","dijit/ProgressBar","dijit/registry","dojo/_base/array","dojo/on","dojo/data/ObjectStore",
+    require(["dijit/Dialog","dijit/ProgressBar","dijit/registry","dojo/_base/array","dojo/data/ObjectStore",
         "dojo/store/Memory","dijit/Tooltip","dijit/Menu","dijit/MenuItem","dijit/MenuSeparator"],function(){
         PWM_MAIN.preloadResources(nextFunction);
     });
 };
 
 PWM_MAIN.preloadResources = function(nextFunction) {
+    /*
     var prefix = PWM_GLOBAL['url-resources'] + '/dojo/dijit/themes/';
     var images = [
         prefix + 'a11y/indeterminate_progress.gif',
@@ -295,6 +280,7 @@ PWM_MAIN.preloadResources = function(nextFunction) {
         prefix + 'nihilo/images/titleBar.png'
     ];
     PWM_MAIN.preloadImages(images);
+    */
     if (nextFunction) {
         nextFunction();
     }
@@ -323,11 +309,8 @@ PWM_MAIN.showString = function (key, options) {
 PWM_MAIN.addEventHandler = function(nodeId,eventType,functionToAdd) {
     var element = PWM_MAIN.getObject(nodeId);
     if (element) {
+        //element.addEventListener(eventType, functionToAdd);
         require(["dojo", "dojo/on"], function (dojo, on) {
-            if (dojo.isIE <= 9 && eventType == 'input') {
-                on(element, 'change', functionToAdd);
-                on(element, 'keyup', functionToAdd);
-            }
             on(element, eventType, functionToAdd);
         });
     }
@@ -337,14 +320,14 @@ PWM_MAIN.addEventHandler = function(nodeId,eventType,functionToAdd) {
 PWM_MAIN.goto = function(url,options) {
     PWM_VAR['dirtyPageLeaveFlag'] = false;
     options = options === undefined ? {} : options;
-    if (!('noContext' in options) && url.indexOf(PWM_GLOBAL['url-context']) != 0) {
-        if (url.substring(0,1) == '/') {
+    if (!('noContext' in options) && url.indexOf(PWM_GLOBAL['url-context']) !== 0) {
+        if (url.substring(0,1) === '/') {
             url = PWM_GLOBAL['url-context'] + url;
         }
     }
 
     if ('addFormID' in options) {
-        if (url.indexOf('pwmFormID') == -1) {
+        if (url.indexOf('pwmFormID') === -1) {
             url = PWM_MAIN.addPwmFormIDtoURL(url);
         }
     }
@@ -384,7 +367,7 @@ PWM_MAIN.handleLoginFormSubmit = function(form, event) {
             delete options['content']['pwmFormID'];
             var url = 'login?processAction=restLogin&skipCaptcha=' + options['content']['skipCaptcha'];
             var loadFunction = function(data) {
-                if (data['error'] == true) {
+                if (data['error'] === true) {
                     PWM_MAIN.getObject('password').value = '';
                     PWM_MAIN.showErrorDialog(data,{
                         okAction:function(){
@@ -402,9 +385,9 @@ PWM_MAIN.handleLoginFormSubmit = function(form, event) {
                 }
             };
             PWM_MAIN.ajaxRequest(url,loadFunction,options);
-            if(typeof grecaptcha != 'undefined'){
+            if(typeof grecaptcha !== 'undefined'){
                 try {
-                   grecaptcha.reset(); // reset the
+                    grecaptcha.reset(); // reset the
                 } catch (e) {
                     console.log("error resetting the captcha: " + e)
                 }
@@ -422,7 +405,7 @@ PWM_MAIN.handleFormSubmit = function(form, event) {
     var formElements = form.elements;
     for (var i = 0; i < formElements.length; i++) {
         formElements[i].readOnly = true;
-        if (formElements[i].type == 'button' || formElements[i].type == 'submit') {
+        if (formElements[i].type === 'button' || formElements[i].type === 'submit') {
             formElements[i].disabled = true;
         }
     }
@@ -433,48 +416,26 @@ PWM_MAIN.handleFormSubmit = function(form, event) {
     return false;
 };
 
-PWM_MAIN.handleFormClear = function() {
-    var focusSet = false;
-    var clearableFields = ['text','email','number','password','random','tel','hidden','date','datetime','time','week','month','url','select'];
-
-    require(["dojo/_base/array"],function(array){
-        for (var j = 0; j < document.forms.length; j++) {
-            for (var i = 0; i < document.forms[j].length; i++) {
-                var current = document.forms[j].elements[i];
-                if (current.type && array.indexOf(clearableFields,current.type.toLowerCase()) >= 0) {
-                    current.value = '';
-                    if (!focusSet) {
-                        current.focus();
-                        focusSet = true;
-                    }
-                } else if (current.type == 'select') {
-                    current.selectedIndex = -1;
-                }
-            }
-        }
-    });
-    return false;
-};
 
 PWM_MAIN.checkForCapsLock = function(e) {
     require(["dojo","dojo/_base/fx","dojo/domReady!"],function(dojo,fx){
         var capsLockWarningElement = PWM_MAIN.getObject('capslockwarning');
-        if (capsLockWarningElement == null) {
+        if (capsLockWarningElement === null || capsLockWarningElement === undefined) {
             return;
         }
 
         var capsLockKeyDetected = false;
         {
             var elementTarget = null;
-            if (e.target != null) {
+            if (e.target) {
                 elementTarget = e.target;
-            } else if (e.srcElement != null) {
+            } else if (e.srcElement) {
                 elementTarget = e.srcElement;
             }
-            if (elementTarget != null) {
-                if (elementTarget.nodeName == 'input' || elementTarget.nodeName == 'INPUT') {
+            if (elementTarget) {
+                if (elementTarget.nodeName === 'input' || elementTarget.nodeName === 'INPUT') {
                     var kc = e.keyCode ? e.keyCode : e.which;
-                    var sk = e.shiftKey ? e.shiftKey : ((kc == 16));
+                    var sk = e.shiftKey ? e.shiftKey : ((kc === 16));
                     if (((kc >= 65 && kc <= 90) && !sk) || ((kc >= 97 && kc <= 122) && sk)) {
                         capsLockKeyDetected = true;
                     }
@@ -521,7 +482,7 @@ PWM_MAIN.checkForCapsLock = function(e) {
 };
 
 PWM_MAIN.getObject = function(name) {
-    if (name == null) {
+    if (name === null || name === undefined) {
         return null;
     }
 
@@ -529,6 +490,10 @@ PWM_MAIN.getObject = function(name) {
         return name;
     }
 
+    if (name === document) {
+        return name;
+    }
+
     var ns4 = document.layers;
     var w3c = document.getElementById;
     var ie4 = document.all;
@@ -608,7 +573,7 @@ PWM_MAIN.clearDijitWidget = function (widgetName) {
     require(["dojo","dijit/registry"],function(dojo, registry){
 
         var oldDijitNode = registry.byId(widgetName);
-        if (oldDijitNode != null) {
+        if (oldDijitNode) {
             try {
                 oldDijitNode.destroyRecursive();
             } catch (error) {
@@ -625,46 +590,43 @@ PWM_MAIN.clearDijitWidget = function (widgetName) {
 };
 
 PWM_MAIN.showLocaleSelectionMenu = function(nextFunction, options) {
-    require(["dojo/_base/array","dojo/_base/Deferred","dojo/promise/all"], function(array,Deferred,all) {
-        options = options === undefined ? {} : options;
-        var excludeLocales = 'excludeLocales' in options ? options['excludeLocales'] : [];
+    options = options === undefined ? {} : options;
+    var excludeLocales = 'excludeLocales' in options ? options['excludeLocales'] : [];
 
-        var localeData = PWM_GLOBAL['localeInfo'];
-        var localeIterator = function(f) {
-            for (var iter in localeData)
-                f(iter);
+    var localeData = PWM_GLOBAL['localeInfo'];
+    var localeIterator = function(f) {
+        for (var iter in localeData)
+            f(iter);
 
-        };
+    };
 
-        var bodyHtml = '<table class="noborder" style="width:auto;margin-right:auto;margin-left:auto">';
-        localeIterator(function(localeKey){
-            if (array.indexOf(excludeLocales, localeKey) == -1) {
-                var loopDisplayName = localeData[localeKey];
-                var flagCode = PWM_GLOBAL['localeFlags'][localeKey];
-                var flagUrl = PWM_GLOBAL['url-resources'] + '/webjars/famfamfam-flags/dist/png/' + flagCode + '.png';
-                bodyHtml += '<tr style="cursor:pointer" id="locale-row-' + localeKey + '">';
-                bodyHtml += '<td><img src="' + flagUrl + '"/></td>';
-                bodyHtml += '<td>' + loopDisplayName + '</td>';
-                bodyHtml += '</tr>';
-            }
-        });
-        bodyHtml += '</table>';
-
-        PWM_MAIN.showDialog({
-            showClose:true,
-            showOk:false,
-            text:bodyHtml,
-            title:PWM_MAIN.showString('Title_LocaleSelect'),
-            loadFunction:function(){
-                localeIterator(function(localeKey) {
-                    PWM_MAIN.addEventHandler('locale-row-' + localeKey, 'click', function () {
-                        PWM_MAIN.closeWaitDialog();
-                        nextFunction(localeKey);
-                    });
+    var bodyHtml = '<table class="noborder" style="width:auto;margin-right:auto;margin-left:auto">';
+    localeIterator(function(localeKey){
+        if (!PWM_MAIN.JSLibrary.arrayContains(excludeLocales, localeKey)) {
+            var loopDisplayName = localeData[localeKey];
+            var flagCode = PWM_GLOBAL['localeFlags'][localeKey];
+            var flagUrl = PWM_GLOBAL['url-resources'] + '/webjars/famfamfam-flags/dist/png/' + flagCode + '.png';
+            bodyHtml += '<tr style="cursor:pointer" id="locale-row-' + localeKey + '">';
+            bodyHtml += '<td><img src="' + flagUrl + '"/></td>';
+            bodyHtml += '<td>' + loopDisplayName + '</td>';
+            bodyHtml += '</tr>';
+        }
+    });
+    bodyHtml += '</table>';
+
+    PWM_MAIN.showDialog({
+        showClose:true,
+        showOk:false,
+        text:bodyHtml,
+        title:PWM_MAIN.showString('Title_LocaleSelect'),
+        loadFunction:function(){
+            localeIterator(function(localeKey) {
+                PWM_MAIN.addEventHandler('locale-row-' + localeKey, 'click', function () {
+                    PWM_MAIN.closeWaitDialog();
+                    nextFunction(localeKey);
                 });
-            }
-        });
-
+            });
+        }
     });
 };
 
@@ -704,7 +666,7 @@ PWM_MAIN.showErrorDialog = function(error, options) {
     }
     if (error && error['error']) {
         var code = error['errorCode'];
-        if (code == 5028 || code == 5034 || code == 5035) {
+        if (code === 5028 || code === 5034 || code === 5035) {
             forceReload = true;
         }
         titleMsg += ' ' + error['errorCode'];
@@ -775,7 +737,7 @@ PWM_MAIN.html5DialogSupport = function() {
     if (PWM_GLOBAL['client.js.enableHtml5Dialog']) {
         var testdialog = document.createElement("dialog");
         testdialog.setAttribute("open", "");
-        return (testdialog.open == true);
+        return (testdialog.open === true);
     }
     return false;
 };
@@ -937,8 +899,8 @@ PWM_MAIN.showEula = function(requireAgreement, agreeFunction) {
 
     require(["dojo/request/xhr"], function (xhr) {
         var loadFunction = function (data) {
-                displayEula(data);
-            };
+            displayEula(data);
+        };
         var postOptions = {
             method: 'GET'
         };
@@ -954,7 +916,7 @@ PWM_MAIN.showEula = function(requireAgreement, agreeFunction) {
 };
 
 PWM_MAIN.showConfirmDialog = function(options) {
-    options = options == undefined ? {} : options;
+    options = options === undefined ? {} : options;
     options['showCancel'] = true;
     options['title'] = 'title' in options ? options['title'] : PWM_MAIN.showString('Button_Confirm');
     options['text'] = 'text' in options ? options['text'] : PWM_MAIN.showString('Confirm');
@@ -970,7 +932,7 @@ PWM_MAIN.closeWaitDialog = function(idName) {
         return;
     }
 
-    idName = idName == undefined ? 'dialogPopup' : idName;
+    idName = idName === undefined ? 'dialogPopup' : idName;
     PWM_MAIN.clearDijitWidget(idName);
 };
 
@@ -996,11 +958,11 @@ PWM_MAIN.showSuccess=function(successMsg) {
 
 PWM_MAIN.doShow = function(destClass, message, fromFloatHandler) {
     var messageElement = PWM_MAIN.getObject("message");
-    if (messageElement == null || messageElement.firstChild == null || messageElement.firstChild.nodeValue == null) {
+    if (messageElement === null || messageElement.firstChild === null || messageElement.firstChild.nodeValue === null) {
         return;
     }
 
-    if (destClass == '') {
+    if (destClass === '') {
         require(["dojo/dom", "dojo/_base/fx"],function(dom, fx){
             var fadeArgs = { node: "message", duration: 500 };
             fx.fadeOut(fadeArgs).play();
@@ -1055,7 +1017,7 @@ PWM_MAIN.createCSSClass = function(selector, style) {
     // using information found at: http://www.quirksmode.org/dom/w3c_css.html
     // doesn't work in older versions of Opera (< 9) due to lack of styleSheets support
     if(!document.styleSheets) return;
-    if(document.getElementsByTagName("head").length == 0) return;
+    if(document.getElementsByTagName("head").length === 0) return;
     var styleSheet;
     var mediaType;
     if(document.styleSheets.length > 0)
@@ -1066,28 +1028,28 @@ PWM_MAIN.createCSSClass = function(selector, style) {
             var media = document.styleSheets[i].media;
             mediaType = typeof media;
             // IE
-            if(mediaType == "string")
+            if(mediaType === "string")
             {
-                if(media == "" || media.indexOf("screen") != -1)
+                if(media === "" || media.indexOf("screen") !== -1)
                 {
                     styleSheet = document.styleSheets[i];
                 }
             }
-            else if(mediaType == "object")
+            else if(mediaType === "object")
             {
                 try {
-                    if(media.mediaText == "" || media.mediaText.indexOf("screen") != -1)
+                    if(media.mediaText === "" || media.mediaText.indexOf("screen") !== -1)
                     {
                         styleSheet = document.styleSheets[i];
                     }
                 } catch (e) { /* noop */ }
             }
             // stylesheet found, so break out of loop
-            if(typeof styleSheet != "undefined") break;
+            if(typeof styleSheet !== "undefined") break;
         }
     }
     // if no style sheet is found
-    if(typeof styleSheet == "undefined")
+    if(typeof styleSheet === "undefined")
     {
         // create a new style sheet
         var styleSheetElement = document.createElement("style");
@@ -1105,13 +1067,13 @@ PWM_MAIN.createCSSClass = function(selector, style) {
         mediaType = typeof media;
     }
     // IE
-    if(mediaType == "string")
+    if(mediaType === "string")
     {
         for(i = 0;i<styleSheet.rules.length;i++)
         {
             // if there is an existing rule set up, replace it
             try {
-                if(styleSheet.cssRules[i].selectorText && styleSheet.rules[i].selectorText.toLowerCase() == selector.toLowerCase())
+                if(styleSheet.cssRules[i].selectorText && styleSheet.rules[i].selectorText.toLowerCase() === selector.toLowerCase())
                 {
                     styleSheet.rules[i].style.cssText = style;
                     return;
@@ -1123,12 +1085,12 @@ PWM_MAIN.createCSSClass = function(selector, style) {
         // or add a new rule
         styleSheet.addRule(selector,style);
     }
-    else if(mediaType == "object")
+    else if(mediaType === "object")
     {
         for(i = 0;i<styleSheet.cssRules.length;i++)
         {
             // if there is an existing rule set up, replace it
-            if(styleSheet.cssRules[i].selectorText && styleSheet.cssRules[i].selectorText.toLowerCase() == selector.toLowerCase())
+            if(styleSheet.cssRules[i].selectorText && styleSheet.cssRules[i].selectorText.toLowerCase() === selector.toLowerCase())
             {
                 styleSheet.cssRules[i].style.cssText = style;
                 return;
@@ -1200,13 +1162,13 @@ PWM_MAIN.messageDivFloatHandler = function() {
         return;
     }
 
-    if (messageObj.style.display == 'none') {
+    if (messageObj.style.display === 'none') {
         return;
     }
 
-    var doFloatDisplay = !(PWM_MAIN.elementInViewport(messageWrapperObj,false) || PWM_GLOBAL['messageStatus'] == '');
+    var doFloatDisplay = !(PWM_MAIN.elementInViewport(messageWrapperObj,false) || PWM_GLOBAL['messageStatus'] === '');
 
-    if (PWM_GLOBAL['message_scrollToggle'] != doFloatDisplay) {
+    if (PWM_GLOBAL['message_scrollToggle'] !== doFloatDisplay) {
         PWM_GLOBAL['message_scrollToggle'] = doFloatDisplay;
 
         if (doFloatDisplay) {
@@ -1251,7 +1213,7 @@ PWM_MAIN.pwmFormValidator = function(validationProps, reentrant) {
 
     {
         var cachedResult = PWM_VAR['validationCache'][formKey];
-        if (cachedResult != null) {
+        if (cachedResult) {
             processResultsFunction(cachedResult);
             if (CONSOLE_DEBUG) console.log('pwmFormValidator: processed cached data, exiting');
             completeFunction();
@@ -1275,7 +1237,7 @@ PWM_MAIN.pwmFormValidator = function(validationProps, reentrant) {
     if (CONSOLE_DEBUG) console.log('pwmFormValidator: user no longer typing, continuing..');
 
     //check to see if a validation is already in progress, if it is then ignore keypress.
-    if (PWM_VAR['validationInProgress'] == true) {
+    if (PWM_VAR['validationInProgress'] === true) {
         if (CONSOLE_DEBUG) console.log('pwmFormValidator: waiting for a previous validation to complete, exiting...');
         return;
     }
@@ -1284,7 +1246,7 @@ PWM_MAIN.pwmFormValidator = function(validationProps, reentrant) {
     // show in-progress message if load takes too long.
     if (showMessage) {
         setTimeout(function () {
-            if (PWM_VAR['validationInProgress'] == true) {
+            if (PWM_VAR['validationInProgress'] === true) {
                 PWM_MAIN.showInfo(messageWorking);
             }
         }, 5);
@@ -1430,14 +1392,10 @@ ShowHidePasswordHandler.initAllForms = function() {
         return;
     }
 
-    require(["dojo/query"], function(query){
-        var inputFields = query('.passwordfield');
-        for (var i = 0; i < inputFields.length; i++) {
-            var field = inputFields[i];
-            if (field.id) {
-                if (ShowHidePasswordHandler.debugOutput) console.log('adding show/hide option on fieldID=' + field.id);
-                ShowHidePasswordHandler.init(field.id);
-            }
+    PWM_MAIN.doQuery('.passwordfield',function(field){
+        if (field.id) {
+            if (ShowHidePasswordHandler.debugOutput) console.log('adding show/hide option on fieldID=' + field.id);
+            ShowHidePasswordHandler.init(field.id);
         }
     });
 };
@@ -1471,7 +1429,7 @@ ShowHidePasswordHandler.init = function(nodeName) {
         divElement.setAttribute('class','pwm-icon icon-showhidepassword');
         domConstruct.place(divElement,node,'after');
 
-        ShowHidePasswordHandler.state[nodeName] = (defaultType == "password");
+        ShowHidePasswordHandler.state[nodeName] = (defaultType === "password");
         ShowHidePasswordHandler.setupTooltip(nodeName, false);
         ShowHidePasswordHandler.addInputEvents(nodeName);
     });
@@ -1517,7 +1475,7 @@ ShowHidePasswordHandler.show = function(nodeName) {
     node.focus();
     require(["dojo/dom-construct", "dojo/on", "dojo/dom-attr"], function(domConstruct, on, attr) {
         var defaultType = attr.get(nodeName, "data-originalType");
-        if (defaultType == 'password') {
+        if (defaultType === 'password') {
             setTimeout(function () {
                 if (!ShowHidePasswordHandler.state[nodeName]) {
                     ShowHidePasswordHandler.toggle(nodeName);
@@ -1598,11 +1556,9 @@ PWM_MAIN.IdleTimeoutHandler.initCountDownTimer = function(secondsRemaining) {
     PWM_MAIN.IdleTimeoutHandler.realWindowTitle = document.title;
     PWM_MAIN.IdleTimeoutHandler.resetIdleCounter();
     setInterval(function(){PWM_MAIN.IdleTimeoutHandler.pollActivity()}, PWM_MAIN.IdleTimeoutHandler.SETTING_LOOP_FREQUENCY); //poll scrolling
-    require(["dojo/on"], function(on){
-        on(document, "click", function(){PWM_MAIN.IdleTimeoutHandler.resetIdleCounter()});
-        on(document, "keypress", function(){PWM_MAIN.IdleTimeoutHandler.resetIdleCounter()});
-        on(document, "scroll", function(){PWM_MAIN.IdleTimeoutHandler.resetIdleCounter()});
-    });
+    PWM_MAIN.addEventHandler(document, "click", function(){PWM_MAIN.IdleTimeoutHandler.resetIdleCounter()});
+    PWM_MAIN.addEventHandler(document, "keypress", function(){PWM_MAIN.IdleTimeoutHandler.resetIdleCounter()});
+    PWM_MAIN.addEventHandler(document, "scroll", function(){PWM_MAIN.IdleTimeoutHandler.resetIdleCounter()});
 };
 
 PWM_MAIN.IdleTimeoutHandler.cancelCountDownTimer = function() {
@@ -1619,12 +1575,12 @@ PWM_MAIN.IdleTimeoutHandler.pollActivity = function() {
     var secondsRemaining = PWM_MAIN.IdleTimeoutHandler.calcSecondsRemaining();
     var idleDisplayString = PWM_MAIN.IdleTimeoutHandler.makeIdleDisplayString(secondsRemaining);
     var idleStatusFooter = PWM_MAIN.getObject("idle_status");
-    if (idleStatusFooter != null) {
+    if (idleStatusFooter) {
         idleStatusFooter.firstChild.nodeValue = idleDisplayString;
     }
 
     var warningDialogText = PWM_MAIN.getObject("IdleDialogWindowIdleText");
-    if (warningDialogText != null) {
+    if (warningDialogText) {
         warningDialogText.firstChild.nodeValue = idleDisplayString;
     }
 
@@ -1648,7 +1604,7 @@ PWM_MAIN.IdleTimeoutHandler.pollActivity = function() {
     if (secondsRemaining < PWM_MAIN.IdleTimeoutHandler.SETTING_WARN_SECONDS) {
         if (!PWM_GLOBAL['idle_suspendTimeout']) {
             PWM_MAIN.IdleTimeoutHandler.showIdleWarning();
-            if (secondsRemaining % 2 == 0) {
+            if (secondsRemaining % 2 === 0) {
                 document.title = PWM_MAIN.IdleTimeoutHandler.realWindowTitle;
             } else {
                 document.title = idleDisplayString;
@@ -1707,10 +1663,8 @@ PWM_MAIN.TimestampHandler.PreferencesKey = 'timestampLocalized';
 PWM_MAIN.TimestampHandler.ElementList = [];
 
 PWM_MAIN.TimestampHandler.initAllElements = function() {
-    require(["dojo/query", "dojo/NodeList-dom"], function(query){
-        query(".timestamp").forEach(function(node){
-            PWM_MAIN.TimestampHandler.initElement(node);
-        });
+    PWM_MAIN.doQuery(".timestamp",function(node){
+        PWM_MAIN.TimestampHandler.initElement(node);
     });
 };
 
@@ -1826,12 +1780,12 @@ PWM_MAIN.ajaxRequest = function(url,loadFunction,options) {
     var requestHeaders = {};
     requestHeaders['Accept'] = "application/json";
     requestHeaders['X-RestClientKey'] = PWM_GLOBAL['restClientKey'];
-    if (content != null) {
+    if (content) {
         requestHeaders['Content-Type'] = "application/json";
     }
 
     require(["dojo/request/xhr","dojo","dojo/json"], function (xhr,dojo,dojoJson) {
-        loadFunction = loadFunction != undefined ? loadFunction : function (data) {
+        loadFunction = loadFunction !== undefined ? loadFunction : function (data) {
             alert('missing load function, return results:' + dojo.toJson(data))
         };
         if (addPwmFormID) {
@@ -1849,7 +1803,7 @@ PWM_MAIN.ajaxRequest = function(url,loadFunction,options) {
             timeout: ajaxTimeout
         };
 
-        if (content != null) {
+        if (content) {
             postOptions['data'] = dojoJson.stringify(content);
         }
 
@@ -1877,9 +1831,9 @@ PWM_MAIN.convertSecondsToDisplayTimeDuration = function(amount, fullLength) {
 
     // write number of days
     var positions = 0;
-    if (days != 0) {
+    if (days !== 0) {
         output += days + " ";
-        if (days != 1) {
+        if (days !== 1) {
             output += PWM_MAIN.showString('Display_Days');
         } else {
             output += PWM_MAIN.showString('Display_Day');
@@ -1888,13 +1842,13 @@ PWM_MAIN.convertSecondsToDisplayTimeDuration = function(amount, fullLength) {
     }
 
     // write number of hours
-    if (days != 0 || hours != 0) {
+    if (days !== 0 || hours !== 0) {
         if (output.length > 0) {
             output += ", ";
         }
 
         output += hours + " ";
-        if (hours != 1) {
+        if (hours !== 1) {
             output += PWM_MAIN.showString('Display_Hours');
         } else {
             output += PWM_MAIN.showString('Display_Hour');
@@ -1904,12 +1858,12 @@ PWM_MAIN.convertSecondsToDisplayTimeDuration = function(amount, fullLength) {
 
     // write number of minutes
     if (positions < 2 || fullLength) {
-        if (days != 0 || hours != 0 || mins != 0 || fullLength) {
+        if (days !== 0 || hours !== 0 || mins !== 0 || fullLength) {
             if (output.length > 0) {
                 output += ", ";
             }
             output += mins + " ";
-            if (mins != 1) {
+            if (mins !== 1) {
                 output += PWM_MAIN.showString('Display_Minutes');
             } else {
                 output += PWM_MAIN.showString('Display_Minute');
@@ -1927,7 +1881,7 @@ PWM_MAIN.convertSecondsToDisplayTimeDuration = function(amount, fullLength) {
 
             output += secs + " ";
 
-            if (secs != 1) {
+            if (secs !== 1) {
                 output += PWM_MAIN.showString('Display_Seconds');
             } else {
                 output += PWM_MAIN.showString('Display_Second');
@@ -1976,29 +1930,6 @@ PWM_MAIN.newWindowOpen=function(windowUrl,windowName) {
     var viewLog = window.open(windowUrl,windowName,windowParams).focus();
 };
 
-PWM_MAIN.autofocusSupportExtension = function() {
-    var supportAutofocus = 'autofocus' in (document.createElement('input'));
-    if (!supportAutofocus) {
-        console.log("no browser support for autofocus, implementing manual dom check for focused item");
-        require(["dojo/query"], function(query){
-            var found = false;
-            var results = query('form *');
-            for (var i = 0; i < results.length; i++) {
-                if (found) {
-                    break
-                }
-                (function (itemIterator) {
-                    var element = results[itemIterator];
-                    if (element.hasAttribute('autofocus')) {
-                        element.focus();
-                        found = true;
-                    }
-                })(i);
-            }
-        });
-    }
-};
-
 PWM_MAIN.cancelEvent = function(event) {
     if (event) {
         if (event.preventDefault) {
@@ -2081,10 +2012,10 @@ PWM_MAIN.Preferences.readLocalStorage = function(key,valueIfMissing) {
     if(typeof(Storage) !== "undefined") {
         try {
             var baseObjStr = localStorage.getItem(PWM_MAIN.Preferences.StorageKeyName);
-            if (baseObjStr != null) {
+            if (baseObjStr) {
                 var baseJson = JSON.parse(baseObjStr);
                 var wrappedValue = baseJson[key];
-                if (wrappedValue != null) {
+                if (wrappedValue !== null) {
                     var timestamp = new Date(Date.parse(wrappedValue[PWM_MAIN.Preferences.Key_Timestamp]));
                     var expireSeconds = parseInt(wrappedValue[PWM_MAIN.Preferences.Key_ExpireSeconds]);
                     var valueAgeSeconds = (new Date().getTime()) - timestamp.getTime();
@@ -2110,7 +2041,7 @@ PWM_MAIN.Preferences.writeLocalStorage = function(key, value, lifetimeSeconds) {
     if(typeof(Storage) !== "undefined") {
         try {
             var baseObjStr = localStorage.getItem(PWM_MAIN.Preferences.StorageKeyName);
-            var baseJson = baseObjStr != null ? JSON.parse(baseObjStr) : {};
+            var baseJson = baseObjStr !== null ? JSON.parse(baseObjStr) : {};
             var wrapperValue = {};
             wrapperValue[PWM_MAIN.Preferences.Key_Timestamp] = new Date().toISOString();
             wrapperValue[PWM_MAIN.Preferences.Key_ExpireSeconds] = lifetimeSeconds;
@@ -2129,7 +2060,7 @@ PWM_MAIN.Preferences.readSessionStorage = function(key,valueIfMissing) {
     if(typeof(Storage) !== "undefined") {
         try {
             var baseObjStr = sessionStorage.getItem(PWM_MAIN.Preferences.StorageKeyName);
-            if (baseObjStr != null) {
+            if (baseObjStr !== null) {
                 var baseJson = JSON.parse(baseObjStr);
                 return key in baseJson ? baseJson[key] : valueIfMissing;
             }
@@ -2146,7 +2077,7 @@ PWM_MAIN.Preferences.writeSessionStorage = function(key, value) {
     if(typeof(Storage) !== "undefined") {
         try {
             var baseObjStr = sessionStorage.getItem(PWM_MAIN.Preferences.StorageKeyName);
-            var baseJson = baseObjStr != null ? JSON.parse(baseObjStr) : {};
+            var baseJson = baseObjStr !== null ? JSON.parse(baseObjStr) : {};
             baseJson[key] = value;
             sessionStorage.setItem(PWM_MAIN.Preferences.StorageKeyName,JSON.stringify(baseJson));
         } catch (e) {

+ 9 - 9
server/src/main/webapp/public/resources/js/newuser.js

@@ -65,8 +65,8 @@ PWM_NEWUSER.updateDisplay=function(data) {
         var resultInfo = data['data'];
         var message = resultInfo["message"];
 
-        if (resultInfo["passed"] == true) {
-            if (resultInfo["match"] == "MATCH") {
+        if (resultInfo["passed"] === true) {
+            if (resultInfo["match"] === "MATCH") {
                 PWM_MAIN.getObject("submitBtn").disabled = false;
                 PWM_MAIN.showSuccess(message);
             } else {
@@ -85,12 +85,12 @@ PWM_NEWUSER.updateDisplay=function(data) {
 
 PWM_NEWUSER.markConfirmationCheck=function(matchStatus) {
     if (PWM_MAIN.getObject("confirmCheckMark") || PWM_MAIN.getObject("confirmCrossMark")) {
-        if (matchStatus == "MATCH") {
+        if (matchStatus === "MATCH") {
             PWM_MAIN.getObject("confirmCheckMark").style.visibility = 'visible';
             PWM_MAIN.getObject("confirmCrossMark").style.visibility = 'hidden';
             PWM_MAIN.getObject("confirmCheckMark").width = '15';
             PWM_MAIN.getObject("confirmCrossMark").width = '0';
-        } else if (matchStatus == "NO_MATCH") {
+        } else if (matchStatus === "NO_MATCH") {
             PWM_MAIN.getObject("confirmCheckMark").style.visibility = 'hidden';
             PWM_MAIN.getObject("confirmCrossMark").style.visibility = 'visible';
             PWM_MAIN.getObject("confirmCheckMark").width = '0';
@@ -105,7 +105,7 @@ PWM_NEWUSER.markConfirmationCheck=function(matchStatus) {
 };
 
 PWM_NEWUSER.markStrength=function(strength) { //strength meter
-    if (PWM_MAIN.getObject("strengthBox") == null) {
+    if (PWM_MAIN.getObject("strengthBox") === null) {
         return;
     }
 
@@ -130,14 +130,14 @@ PWM_NEWUSER.markStrength=function(strength) { //strength meter
     var gradColor = colorFade(COLOR_BAR_BOTTOM, COLOR_BAR_TOP, strength / 100).toString(16) + '';
 
     var barObject = PWM_MAIN.getObject("strengthBar");
-    if (barObject != null && strength != null) {
+    if (barObject !== null && strength !== null) {
         barObject.style.width = strength + '%';
         barObject.style.backgroundColor = '#' + gradColor;
     }
 
     var labelObject = PWM_MAIN.getObject("strengthLabel");
-    if (labelObject != null) {
-        labelObject.innerHTML = strengthLabel == null ? "" : strengthLabel;
+    if (labelObject !== null) {
+        labelObject.innerHTML = strengthLabel === null ? "" : strengthLabel;
     }
 };
 
@@ -158,7 +158,7 @@ PWM_NEWUSER.refreshCreateStatus=function(refreshInterval) {
                 progressBar.set("value",data['data']['percentComplete']);
             }
 
-            if (data['data']['complete'] == true) {
+            if (data['data']['complete'] === true) {
                 PWM_MAIN.goto(completedUrl,{delay:1000})
             } else {
                 setTimeout(function(){

+ 28 - 30
server/src/main/webapp/public/resources/js/peoplesearch.js

@@ -108,10 +108,10 @@ PWM_PS.convertDetailResultToHtml = function(data) {
     htmlBody += '<div id="peopleSearch-userDetailWrapper">';
 
 //    if (data['hasOrgChart']) {
-        htmlBody += '<div style="text-align: center"><button class="btn" id="button-peoplesearch-orgChart">'
-            + '<span class="btn-icon pwm-icon pwm-icon-sitemap"></span>'
-            + PWM_MAIN.showString('Title_OrgChart')
-            + '</div>';
+    htmlBody += '<div style="text-align: center"><button class="btn" id="button-peoplesearch-orgChart">'
+        + '<span class="btn-icon pwm-icon pwm-icon-sitemap"></span>'
+        + PWM_MAIN.showString('Title_OrgChart')
+        + '</div>';
 //    }
 
     htmlBody += '<table class="peopleSearch-userDetails">';
@@ -122,7 +122,7 @@ PWM_PS.convertDetailResultToHtml = function(data) {
             var type = attributeData['type'];
             htmlBody += '<tr><td class="key">' + label + '</td><td><div style="width:100%">';
 
-            if (type == 'userDN') {
+            if (type === 'userDN') {
                 var userReferences = attributeData['userReferences'];
                 htmlBody += '<div style="max-height: 100px; overflow-y: auto">';
                 for (var refIter in userReferences) {
@@ -143,12 +143,12 @@ PWM_PS.convertDetailResultToHtml = function(data) {
                     if (i > 0) {
                         htmlBody += '</br>'
                     }
-                    if (type == 'email') {
+                    if (type === 'email') {
                         htmlBody += '<a href="mailto:' + values[i] + '">' + values[i] + '</a>';
                     } else {
                         htmlBody += values[i];
                     }
-                    if (attributeData['searchable'] == true) {
+                    if (attributeData['searchable'] === true) {
                         var likeSearchID = 'link-' + attributeData['name'] + '-' + values[i] + '-likeUserSearch';
                         htmlBody += '<span id="' + likeSearchID + '" class="icon-likeUserSearch btn-icon pwm-icon pwm-icon-search" title="' + PWM_MAIN.showString('Button_Search') + ' &quot;' + values[i] + '&quot;"></span>';
                     }
@@ -158,7 +158,7 @@ PWM_PS.convertDetailResultToHtml = function(data) {
         })(iter);
     }
     htmlBody += '</table></div>';
-    
+
     return htmlBody;
 };
 
@@ -171,21 +171,21 @@ PWM_PS.applyEventHandlersToDetailView = function(data) {
 
 //  TODO: need to get this setting from: /peoplesearch?processAction=clientData, see line 426
 //    if (data['hasOrgChart']) {
-        PWM_MAIN.addEventHandler('button-peoplesearch-orgChart', 'click', function () {
+    PWM_MAIN.addEventHandler('button-peoplesearch-orgChart', 'click', function () {
 
-            // Access the angular StateService on this page, and use it to navigate to the orgchart using the provided person ID
-            angular.element(document.body).injector().get('$state').go('orgchart', {personId: data['userKey']});
+        // Access the angular StateService on this page, and use it to navigate to the orgchart using the provided person ID
+        angular.element(document.body).injector().get('$state').go('orgchart', {personId: data['userKey']});
 
-            PWM_MAIN.clearDijitWidget('dialogPopup');
+        PWM_MAIN.clearDijitWidget('dialogPopup');
 //            PWM_PS.showOrgChartView(data['userKey']);
-        });
+    });
 //    }
 
 
     for (var iter in data['detail']) {
         (function(iterCount){
             var attributeData = data['detail'][iterCount];
-            if (attributeData['searchable'] == true) {
+            if (attributeData['searchable'] === true) {
                 var values = attributeData['values'];
                 for (var i in values) {
                     var likeSearchID = 'link-' + attributeData['name'] + '-' + values[i] + '-likeUserSearch';
@@ -195,7 +195,7 @@ PWM_PS.applyEventHandlersToDetailView = function(data) {
                 }
             }
             var type = attributeData['type'];
-            if (type == 'userDN') {
+            if (type === 'userDN') {
                 var userReferences = attributeData['userReferences'];
                 for (var refIter in userReferences) {
                     (function(refIterInner){
@@ -224,7 +224,7 @@ PWM_PS.showUserDetail = function(userKey) {
         loadFunction:function(){
             var url = "PeopleSearch?processAction=detail&userKey=" + userKey;
             var loadFunction = function(data) {
-                if (data['error'] == true) {
+                if (data['error'] === true) {
                     PWM_MAIN.closeWaitDialog();
                     PWM_MAIN.showErrorDialog(data);
                     return;
@@ -343,7 +343,7 @@ PWM_PS.showOrgChartView = function(userKey, asParent) {
         loadFunction:function(){
             var url = "PeopleSearch?processAction=orgChartData";
             var loadFunction = function(data) {
-                if (data['error'] == true) {
+                if (data['error'] === true) {
                     PWM_MAIN.closeWaitDialog();
                     PWM_MAIN.showErrorDialog(data);
                     return;
@@ -404,25 +404,23 @@ PWM_PS.makeSearchGrid = function(nextFunction) {
 };
 
 PWM_PS.loadPicture = function(parentDiv,url,cssClass) {
-    require(["dojo/on"], function(on){
-        var image = new Image();
-        image.setAttribute('class',cssClass);
-        on(image,"load",function(){
-            if (parentDiv) {
-                while (parentDiv.firstChild) {
-                    parentDiv.removeChild(parentDiv.firstChild);
-                }
-                parentDiv.appendChild(image);
+    var image = new Image();
+    image.setAttribute('class',cssClass);
+    PWM_MAIN.addEventHandler(image,"load",function(){
+        if (parentDiv) {
+            while (parentDiv.firstChild) {
+                parentDiv.removeChild(parentDiv.firstChild);
             }
-        });
-        image.src = url;
+            parentDiv.appendChild(image);
+        }
     });
+    image.src = url;
 };
 
 PWM_PS.initPeopleSearchPage = function() {
     var applicationData = PWM_MAIN.getObject("application-info");
     var jspName = applicationData ? applicationData.getAttribute("data-jsp-name") : "";
-    if ("peoplesearch.jsp" == jspName) {
+    if ("peoplesearch.jsp" === jspName) {
         var url = PWM_MAIN.addParamToUrl(window.location.href.replace(window.location.hash, ''),'processAction','clientData');
         PWM_MAIN.ajaxRequest(url,function(data){
             if (data['error']) {
@@ -443,7 +441,7 @@ PWM_PS.initPeopleSearchPage = function() {
                 }
 
                 PWM_MAIN.addEventHandler('username', "keyup, input", function () {
-                   try {
+                    try {
                         var fieldUsername = PWM_MAIN.getObject('username').value;
                         PWM_MAIN.Preferences.writeSessionStorage("peoplesearch_field_username", fieldUsername);
                     } catch (e) {

+ 10 - 10
server/src/main/webapp/public/resources/js/responses.js

@@ -57,14 +57,14 @@ PWM_RESPONSES.validateResponses=function() {
 };
 
 PWM_RESPONSES.updateDisplay=function(resultInfo) {
-    if (resultInfo == null) {
+    if (resultInfo === null) {
         PWM_MAIN.getObject("button-setResponses").disabled = false;
         return;
     }
 
     var result = resultInfo["message"];
 
-    if (resultInfo["success"] == true) {
+    if (resultInfo["success"] === true) {
         PWM_MAIN.getObject("button-setResponses").disabled = false;
         PWM_MAIN.showSuccess(result);
     } else {
@@ -95,7 +95,7 @@ PWM_RESPONSES.makeSelectOptionsDistinct=function() {
             var selectedElement = PWM_MAIN.getObject(questionID);
             var selectedIndex = selectedElement.selectedIndex;
             var selectedValue = selectedElement.options[selectedIndex].value;
-            if ('UNSELECTED' != selectedValue) {
+            if ('UNSELECTED' !== selectedValue) {
                 currentlySelectedTexts.push(selectedValue);
             }
         }(loopID));
@@ -110,7 +110,7 @@ PWM_RESPONSES.makeSelectOptionsDistinct=function() {
             var selectedValue = selectedElement.options[selectedIndex].value;
             var responseID = selectedElement.getAttribute('data-response-id');
             selectedElement.innerHTML = '';
-            if (selectedValue == 'UNSELECTED') {
+            if (selectedValue === 'UNSELECTED') {
                 var unselectedOption = document.createElement('option');
                 unselectedOption.value = 'UNSELECTED';
                 unselectedOption.innerHTML = '&nbsp;&mdash;&nbsp;' + initialChoiceText + '&nbsp;&mdash;&nbsp;';
@@ -125,8 +125,8 @@ PWM_RESPONSES.makeSelectOptionsDistinct=function() {
                 optionElement.innerHTML = loopText;
 
                 require(["dojo/_base/array"], function(array){
-                    if (loopText == selectedValue || array.indexOf(currentlySelectedTexts,loopText) == -1) {
-                        if (loopText == selectedValue) {
+                    if (loopText === selectedValue || array.indexOf(currentlySelectedTexts,loopText) === -1) {
+                        if (loopText === selectedValue) {
                             optionElement.selected = true;
                         }
                         selectedElement.appendChild(optionElement);
@@ -142,7 +142,7 @@ PWM_RESPONSES.makeSelectOptionsDistinct=function() {
 PWM_RESPONSES.startupResponsesPage=function() {
     PWM_MAIN.doIfQueryHasResults('#pwm-setupResponsesDiv',function(){
         var initialPrompt = PWM_MAIN.showString('Display_ResponsesPrompt');
-        if (initialPrompt != null && initialPrompt.length > 1) {
+        if (initialPrompt !== null && initialPrompt.length > 1) {
             var messageElement = PWM_MAIN.getObject("message");
             if (messageElement.firstChild.nodeValue.length < 2) {
                 PWM_MAIN.showInfo(initialPrompt);
@@ -167,7 +167,7 @@ PWM_RESPONSES.initSimpleRandomElements = function() {
 
     var updateResponseInputField = function(element) {
         var responseID = element.getAttribute('data-response-id');
-        if (element.value == 'UNSELECTED') {
+        if (element.value === 'UNSELECTED') {
             PWM_MAIN.getObject(responseID).disabled = true;
             PWM_MAIN.getObject(responseID).readonly = true;
         } else {
@@ -187,10 +187,10 @@ PWM_RESPONSES.initSimpleRandomElements = function() {
             PWM_VAR['focusInValues'][element.id] = element.selectedIndex;
         });
         PWM_MAIN.addEventHandler(element.id,"click,blur",function(){
-            if (PWM_VAR['focusInValues'][element.id] != element.selectedIndex) {
+            if (PWM_VAR['focusInValues'][element.id] !== element.selectedIndex) {
                 var selectedIndex = element.selectedIndex;
                 var selectedValue = element.options[selectedIndex].value;
-                if (selectedValue != 'UNSELECTED') {
+                if (selectedValue !== 'UNSELECTED') {
                     var responseID = element.getAttribute('data-response-id');
                     var responseElement = PWM_MAIN.getObject(responseID);
                     responseElement.value = '';

+ 10 - 10
server/src/main/webapp/public/resources/js/uilibrary.js

@@ -38,7 +38,7 @@ UILibrary.stringEditorDialog = function(options){
     text += '<div style="visibility: hidden;" id="panel-valueWarning"><span class="pwm-icon pwm-icon-warning message-error"></span>&nbsp;' + PWM_CONFIG.showString('Warning_ValueIncorrectFormat') + '</div>';
     text += '<br/>';
 
-    if (instructions != null) {
+    if (instructions !== null) {
         text += '<div id="panel-valueInstructions">&nbsp;' + options['instructions'] + '</div>';
         text += '<br/>';
     }
@@ -55,7 +55,7 @@ UILibrary.stringEditorDialog = function(options){
 
         var value = PWM_MAIN.getObject('addValueDialog_input').value;
         if (value.length > 0) {
-            var passedValidation = regexObject  != null && regexObject.test(value);
+            var passedValidation = regexObject  !== null && regexObject.test(value);
 
             if (passedValidation) {
                 PWM_MAIN.getObject('dialog_ok_button').disabled = false;
@@ -141,7 +141,7 @@ UILibrary.manageNumericInput = function(elementID, readFunction) {
         if (!value) {
             return false;
         }
-        if (value.match('^[0-9]*$') == null) {
+        if (value.match('^[0-9]*$') === null) {
             return false;
         }
         if (element.hasAttribute('min')) {
@@ -281,7 +281,7 @@ UILibrary.editLdapDN = function(nextFunction, options) {
                         var optionElement = document.createElement('option');
                         optionElement.innerHTML = loopProfile;
                         optionElement.value = loopProfile;
-                        if (loopProfile == profile) {
+                        if (loopProfile === profile) {
                             optionElement.selected = true;
                         }
                         profileSelect.appendChild(optionElement);
@@ -335,7 +335,7 @@ UILibrary.uploadFileDialog = function(options) {
 
     var completeFunction = function(data){
         console.log('upload dialog completeFunction() starting');
-        if (data['error'] == true) {
+        if (data['error'] === true) {
             var errorText = 'The file upload has failed.  Please try again or check the server logs for error information.';
             PWM_MAIN.showErrorDialog(data,{text:errorText,okAction:function(){
                 location.reload();
@@ -392,9 +392,9 @@ UILibrary.uploadFileDialog = function(options) {
         var fd = new FormData();
         xhr.onreadystatechange = function() {
             console.log('upload handler onreadystate change: ' + xhr.readyState);
-            if (xhr.readyState == 4) {
+            if (xhr.readyState === 4) {
                 xhr.upload.onprogress = null;
-                if( xhr.status == 200) {
+                if( xhr.status === 200) {
                     // Every thing ok, file uploaded
                     console.log(xhr.responseText); // handle response.
                     try {
@@ -480,12 +480,12 @@ UILibrary.passwordDialogPopup = function(options, state) {
     state['randomLength'] = 'randomLength' in state ? state['randomLength'] : option_randomLength;
 
     var markConfirmationCheckFunction = function(matchStatus) {
-        if (matchStatus == "MATCH") {
+        if (matchStatus === "MATCH") {
             PWM_MAIN.getObject("confirmCheckMark").style.visibility = 'visible';
             PWM_MAIN.getObject("confirmCrossMark").style.visibility = 'hidden';
             PWM_MAIN.getObject("confirmCheckMark").width = '15';
             PWM_MAIN.getObject("confirmCrossMark").width = '0';
-        } else if (matchStatus == "NO_MATCH") {
+        } else if (matchStatus === "NO_MATCH") {
             PWM_MAIN.getObject("confirmCheckMark").style.visibility = 'hidden';
             PWM_MAIN.getObject("confirmCrossMark").style.visibility = 'visible';
             PWM_MAIN.getObject("confirmCheckMark").width = '0';
@@ -544,7 +544,7 @@ UILibrary.passwordDialogPopup = function(options, state) {
         } else {
             PWM_MAIN.removeCssClass('field-password-length','invalid-value');
             if (password2.length > 0) {
-                if (password1 == password2) {
+                if (password1 === password2) {
                     matchStatus = "MATCH";
                     PWM_MAIN.getObject('button-storePassword').disabled = false;
                 } else {

+ 1 - 1
server/src/main/webapp/public/resources/js/updateprofile.js

@@ -43,7 +43,7 @@ PWM_UPDATE.validateForm = function() {
     };
     validationProps['processResultsFunction'] = function(data){
         data = data['data'];
-        if (data["success"] == "true") {
+        if (data["success"] === "true") {
             PWM_MAIN.getObject("submitBtn").disabled = false;
             PWM_MAIN.showSuccess(data["message"]);
         } else {