From 2175c21ff5fe96129ca7faaca1440620158301a9 Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Sun, 5 Feb 2017 20:55:44 -0500 Subject: [PATCH] GUACAMOLE-197: Add comments to the AngularJS files. --- .../src/main/resources/config/radiusConfig.js | 6 ++--- .../controllers/guacRadiusController.js | 23 ++++++++++++------- .../src/main/resources/radiusModule.js | 2 +- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/extensions/guacamole-auth-radius/src/main/resources/config/radiusConfig.js b/extensions/guacamole-auth-radius/src/main/resources/config/radiusConfig.js index 4f5036234..bc14e63c3 100644 --- a/extensions/guacamole-auth-radius/src/main/resources/config/radiusConfig.js +++ b/extensions/guacamole-auth-radius/src/main/resources/config/radiusConfig.js @@ -21,10 +21,10 @@ * Config block which registers Radius-specific field types. */ angular.module('guacRadius').config(['formServiceProvider', - function guacRadiusConfig(formServiceProvider) { - console.log("In guacRadiusConfig() method."); + function guacRadiusConfig(formServiceProvider) { + console.log("In guacRadiusConfig() method."); - // Define field for the signed response from the RADIUS service + // Define field for the challenge from the RADIUS service formServiceProvider.registerFieldType('GUAC_RADIUS_CHALLENGE_RESPONSE', { module : 'guacRadius', controller : 'guacRadiusController', diff --git a/extensions/guacamole-auth-radius/src/main/resources/controllers/guacRadiusController.js b/extensions/guacamole-auth-radius/src/main/resources/controllers/guacRadiusController.js index 6a5f7e263..beb544d88 100644 --- a/extensions/guacamole-auth-radius/src/main/resources/controllers/guacRadiusController.js +++ b/extensions/guacamole-auth-radius/src/main/resources/controllers/guacRadiusController.js @@ -23,14 +23,21 @@ * signed response from the Duo service. */ angular.module('guacRadius').controller('guacRadiusController', ['$scope', '$element', - function guacRadiusController($scope, $element) { - console.log("In guacRadiusController() method."); + function guacRadiusController($scope, $element) { + console.log("In guacRadiusController() method."); - var radiusChallenge = $element.find(document.querySelector('#radius-challenge-text')); - var radiusState = $element.find(document.querySelector('#radius-state')); - console.log("RADIUS Reply Message: " + $scope.field.replyMsg); - radiusChellenge.html($scope.field.replyMsg); - console.log("RADIUS State: " + scope.field.radiusState); - radiusState.value = $scope.field.radiusState; + // Find the area to display the challenge message + var radiusChallenge = $element.find(document.querySelector('#radius-challenge-text')); + + // Find the hidden input to put the state in + var radiusState = $element.find(document.querySelector('#radius-state')); + + // Populate the reply message field + console.log("RADIUS Reply Message: " + $scope.field.replyMsg); + radiusChellenge.html($scope.field.replyMsg); + + // Populate the input area for the connection state + console.log("RADIUS State: " + scope.field.radiusState); + radiusState.value = $scope.field.radiusState; }]); diff --git a/extensions/guacamole-auth-radius/src/main/resources/radiusModule.js b/extensions/guacamole-auth-radius/src/main/resources/radiusModule.js index 6806a9242..7868b1277 100644 --- a/extensions/guacamole-auth-radius/src/main/resources/radiusModule.js +++ b/extensions/guacamole-auth-radius/src/main/resources/radiusModule.js @@ -27,5 +27,5 @@ angular.module('guacRadius', [ 'form' ]); -// Ensure the guacDuo module is loaded along with the rest of the app +// Ensure the guacRadius module is loaded along with the rest of the app angular.module('index').requires.push('guacRadius');