add button handling for describe settings

This commit is contained in:
Stephen Birarda 2015-05-11 13:32:09 -07:00
parent e7433adc96
commit 27f06e2d37
2 changed files with 24 additions and 1 deletions

View file

@ -3,10 +3,20 @@
"name": "metaverse",
"label": "Metaverse Registration",
"settings": [
{
"name": "connected_account",
"label": "Connected Account",
"type": "button",
"help": "Click the button above to connect your High Fidelity metaverse account.",
"button_label": "Connect High Fidelity Account",
"href": "https://metaverse.highfidelity.com/oauth/authorize?client_id=38e572ed35bc4d34c41fbf1fb4d00071bb7328b3d0ba06d1fba64aa3f44e71e4&redirect_uri=http%3A%2F%2Flocalhost%3A40100%2Foauth&response_type=code&scope=domains",
"persist": false
},
{
"name": "access_token",
"label": "Access Token",
"help": "This is an access token generated on the <a href='https://metaverse.highfidelity.com/user/security' target='_blank'>My Security</a> page of your High Fidelity account.<br/>Generate a token with the 'domains' scope and paste it here.<br/>This is required to associate this domain-server with a domain in your account."
"help": "This is your OAuth access token to connect this domain-server with your High Fidelity account. <br/>It can be generated by clicking the 'Connect Account' button above.<br/>Alternatively, you can go to the <a href='https://metaverse.highfidelity.com/user/security' target='_blank'>My Security</a> page of your account and generate a token with the 'domains' scope and paste it here.",
"advanced": true
},
{
"name": "id",

View file

@ -73,6 +73,19 @@ var viewHelpers = {
form_group += "</select>"
form_group += "<input type='hidden'" + common_attrs + "value='" + setting_value + "'>"
} else if (input_type === 'button') {
// Is this a button that should link to something directly?
// If so, we use an anchor tag instead of a button tag
if (setting.href) {
form_group += "<a href='" + setting.href + "' class='btn btn-primary form-control' style='display: block;' role='button'"
+ common_attrs + ">"
+ setting.button_label + "</a>";
} else {
form_group += "<button class='btn btn-primary form-control'" + common_attrs + ">"
+ setting.button_label + "</button>";
}
} else {
if (input_type == 'integer') {