mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
Add support for multiline text fields.
This commit is contained in:
@@ -58,7 +58,13 @@ public class ProtocolParameter {
|
|||||||
* An enumerated parameter, whose legal values are fully enumerated
|
* An enumerated parameter, whose legal values are fully enumerated
|
||||||
* by a provided, finite list.
|
* by a provided, finite list.
|
||||||
*/
|
*/
|
||||||
ENUM
|
ENUM,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A text parameter that can span more than one line.
|
||||||
|
*/
|
||||||
|
MULTILINE
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -166,6 +166,11 @@ public class List extends AuthenticatingHttpServlet {
|
|||||||
xml.writeAttribute("type", "enum");
|
xml.writeAttribute("type", "enum");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Multiline parameter
|
||||||
|
case MULTILINE:
|
||||||
|
xml.writeAttribute("type", "multiline");
|
||||||
|
break;
|
||||||
|
|
||||||
// If unknown, fail explicitly
|
// If unknown, fail explicitly
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
|
@@ -61,6 +61,10 @@ public class ParamTagHandler implements TagHandler {
|
|||||||
else if ("enum".equals(type))
|
else if ("enum".equals(type))
|
||||||
protocolParameter.setType(ProtocolParameter.Type.ENUM);
|
protocolParameter.setType(ProtocolParameter.Type.ENUM);
|
||||||
|
|
||||||
|
// Multiline field
|
||||||
|
else if ("multiline".equals(type))
|
||||||
|
protocolParameter.setType(ProtocolParameter.Type.MULTILINE);
|
||||||
|
|
||||||
// Boolean field
|
// Boolean field
|
||||||
else if ("boolean".equals(type)) {
|
else if ("boolean".equals(type)) {
|
||||||
protocolParameter.setType(ProtocolParameter.Type.BOOLEAN);
|
protocolParameter.setType(ProtocolParameter.Type.BOOLEAN);
|
||||||
|
@@ -121,6 +121,36 @@ GuacAdmin.Field.TEXT = function() {
|
|||||||
GuacAdmin.Field.TEXT.prototype = new GuacAdmin.Field._HTML_INPUT();
|
GuacAdmin.Field.TEXT.prototype = new GuacAdmin.Field._HTML_INPUT();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A basic multiline text field.
|
||||||
|
*
|
||||||
|
* @augments GuacAdmin.Field
|
||||||
|
*/
|
||||||
|
GuacAdmin.Field.MULTILINE = function() {
|
||||||
|
|
||||||
|
// Call parent constructor
|
||||||
|
GuacAdmin.Field.apply(this);
|
||||||
|
|
||||||
|
// Create backing element
|
||||||
|
var element = GuacUI.createElement("textarea");
|
||||||
|
|
||||||
|
this.getValue = function() {
|
||||||
|
return element.value;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getElement = function() {
|
||||||
|
return element;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setValue = function(value) {
|
||||||
|
element.value = value;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
GuacAdmin.Field.MULTILINE.prototype = new GuacAdmin.Field();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A basic password field.
|
* A basic password field.
|
||||||
*
|
*
|
||||||
@@ -882,6 +912,11 @@ GuacAdmin.ConnectionEditor = function(connection, parameters) {
|
|||||||
field = new GuacAdmin.Field.ENUM(parameter.options);
|
field = new GuacAdmin.Field.ENUM(parameter.options);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Multiline text field
|
||||||
|
case GuacamoleService.Protocol.Parameter.MULTILINE:
|
||||||
|
field = new GuacAdmin.Field.MULTILINE();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@@ -1250,7 +1250,7 @@ GuacamoleService.Protocol.Parameter.Option = function(value, title) {
|
|||||||
/**
|
/**
|
||||||
* A free-form text field.
|
* A free-form text field.
|
||||||
*/
|
*/
|
||||||
GuacamoleService.Protocol.Parameter.TEXT = 0;
|
GuacamoleService.Protocol.Parameter.TEXT = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A password field.
|
* A password field.
|
||||||
@@ -1260,17 +1260,22 @@ GuacamoleService.Protocol.Parameter.PASSWORD = 1;
|
|||||||
/**
|
/**
|
||||||
* A numeric field.
|
* A numeric field.
|
||||||
*/
|
*/
|
||||||
GuacamoleService.Protocol.Parameter.NUMERIC = 2;
|
GuacamoleService.Protocol.Parameter.NUMERIC = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A boolean (checkbox) field.
|
* A boolean (checkbox) field.
|
||||||
*/
|
*/
|
||||||
GuacamoleService.Protocol.Parameter.BOOLEAN = 3;
|
GuacamoleService.Protocol.Parameter.BOOLEAN = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enumerated (select) field.
|
* An enumerated (select) field.
|
||||||
*/
|
*/
|
||||||
GuacamoleService.Protocol.Parameter.ENUM = 4;
|
GuacamoleService.Protocol.Parameter.ENUM = 4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A free-form, multi-line text field.
|
||||||
|
*/
|
||||||
|
GuacamoleService.Protocol.Parameter.MULTILINE = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collection of service functions which deal with protocols. Each function
|
* Collection of service functions which deal with protocols. Each function
|
||||||
@@ -1364,6 +1369,11 @@ GuacamoleService.Protocols = {
|
|||||||
parameter.type = GuacamoleService.Protocol.Parameter.ENUM;
|
parameter.type = GuacamoleService.Protocol.Parameter.ENUM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Multiline text parameter
|
||||||
|
case "multiline":
|
||||||
|
parameter.type = GuacamoleService.Protocol.Parameter.MULTILINE;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse all options
|
// Parse all options
|
||||||
|
@@ -31,19 +31,28 @@ input[type=submit], button {
|
|||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.location, input[type=text], input[type=number], input[type=password] {
|
div.location, input[type=text], input[type=number], input[type=password], textarea {
|
||||||
border: 1px solid #777;
|
border: 1px solid #777;
|
||||||
-moz-border-radius: 0.2em;
|
-moz-border-radius: 0.2em;
|
||||||
-webkit-border-radius: 0.2em;
|
-webkit-border-radius: 0.2em;
|
||||||
-khtml-border-radius: 0.2em;
|
-khtml-border-radius: 0.2em;
|
||||||
border-radius: 0.2em;
|
border-radius: 0.2em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-width: 16em;
|
||||||
padding: 0.25em;
|
padding: 0.25em;
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
background: white;
|
background: white;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
max-width: none;
|
||||||
|
width: 30em;
|
||||||
|
height: 10em;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
|
|
||||||
background: #8A6;
|
background: #8A6;
|
||||||
|
Reference in New Issue
Block a user