mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 22:51:22 +00:00
GUAC-968: Reduce number of namespaces. Adopt consistent string naming. Reorganize and reformat. Remove unused strings.
This commit is contained in:
@@ -57,7 +57,11 @@ angular.module('manage').directive('guacConnectionParameter', [function connecti
|
||||
|
||||
},
|
||||
templateUrl: 'app/manage/templates/connectionParameter.html',
|
||||
controller: ['$scope', '$q', function connectionParameterController($scope, $q) {
|
||||
controller: ['$scope', '$injector', function connectionParameterController($scope, $injector) {
|
||||
|
||||
// Required services
|
||||
var $q = $injector.get('$q');
|
||||
var translationStringService = $injector.get('translationStringService');
|
||||
|
||||
/**
|
||||
* Deferred load of the parameter definition, pending availability
|
||||
@@ -152,6 +156,31 @@ angular.module('manage').directive('guacConnectionParameter', [function connecti
|
||||
|
||||
}); // end watch typedValue
|
||||
|
||||
/**
|
||||
* Given the internal name of a protocol, the internal name of a
|
||||
* parameter for that protocol, and the internal name for a valid
|
||||
* value of that parameter, produces the translation string for the
|
||||
* localized, human-readable name of that parameter value.
|
||||
*
|
||||
* @param {String} protocolName
|
||||
* The name of the protocol.
|
||||
*
|
||||
* @param {String} parameterName
|
||||
* The name of the protocol parameter.
|
||||
*
|
||||
* @param {String} parameterValue
|
||||
* The name of the parameter value.
|
||||
*
|
||||
* @returns {String}
|
||||
* The translation string which produces the translated name of the
|
||||
* parameter value specified.
|
||||
*/
|
||||
$scope.getProtocolParameterOption = function getProtocolParameterOption(protocolName, parameterName, parameterValue) {
|
||||
return 'PROTOCOL_' + translationStringService.canonicalize(protocolName)
|
||||
+ '.FIELD_OPTION_' + translationStringService.canonicalize(parameterName)
|
||||
+ '_' + translationStringService.canonicalize(parameterValue || 'EMPTY');
|
||||
};
|
||||
|
||||
}] // end controller
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user