mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:17:45 +02:00
ask for OAuth token directly
This commit is contained in:
parent
aff83be768
commit
fabe19a92c
5 changed files with 28 additions and 59 deletions
5
domain-server/resources/web/js/query-string.js
Normal file
5
domain-server/resources/web/js/query-string.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
function qs(key) {
|
||||||
|
key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx meta chars
|
||||||
|
var match = location.search.match(new RegExp("[?&]"+key+"=([^&]+)(&|$)"));
|
||||||
|
return match && decodeURIComponent(match[1].replace(/\+/g, " "));
|
||||||
|
}
|
|
@ -26,7 +26,7 @@ var viewHelpers = {
|
||||||
form_group = "<div class='form-group " + (isAdvanced ? Settings.ADVANCED_CLASS : "") + "'>";
|
form_group = "<div class='form-group " + (isAdvanced ? Settings.ADVANCED_CLASS : "") + "'>";
|
||||||
setting_value = _(values).valueForKeyPath(keypath);
|
setting_value = _(values).valueForKeyPath(keypath);
|
||||||
|
|
||||||
if (setting_value === undefined || setting_value === null) {
|
if (typeof setting_value == 'undefined' || setting_value === null) {
|
||||||
if (_.has(setting, 'default')) {
|
if (_.has(setting, 'default')) {
|
||||||
setting_value = setting.default;
|
setting_value = setting.default;
|
||||||
} else {
|
} else {
|
||||||
|
@ -40,11 +40,11 @@ var viewHelpers = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_attrs(extra_classes) {
|
function common_attrs(extra_classes) {
|
||||||
extra_classes = typeof extra_classes !== 'undefined' ? extra_classes : "";
|
extra_classes = (typeof extra_classes !== 'undefined' ? extra_classes : "");
|
||||||
return " class='" + (setting.type !== 'checkbox' ? 'form-control' : '')
|
return " class='" + (setting.type !== 'checkbox' ? 'form-control' : '')
|
||||||
+ " " + Settings.TRIGGER_CHANGE_CLASS + " " + extra_classes + "' data-short-name='"
|
+ " " + Settings.TRIGGER_CHANGE_CLASS + " " + extra_classes + "' data-short-name='"
|
||||||
+ setting.name + "' name='" + keypath + "' "
|
+ setting.name + "' name='" + keypath + "' "
|
||||||
+ "id='" + (setting.id !== 'undefined' ? setting.id : keypath) + "'";
|
+ "id='" + (typeof setting.id !== 'undefined' ? setting.id : keypath) + "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setting.type === 'checkbox') {
|
if (setting.type === 'checkbox') {
|
||||||
|
@ -239,7 +239,9 @@ function setupHFAccountButton() {
|
||||||
// This is the hard coded client ID for a localhost domain.
|
// This is the hard coded client ID for a localhost domain.
|
||||||
// Users who access their domain remotely will in the future need to create an OAuth application and for now
|
// Users who access their domain remotely will in the future need to create an OAuth application and for now
|
||||||
// will need to generate an access token the old fashioned way
|
// will need to generate an access token the old fashioned way
|
||||||
buttonSetting.href = "https://metaverse.highfidelity.com/oauth/authorize?client_id=38e572ed35bc4d34c41fbf1fb4d00071bb7328b3d0ba06d1fba64aa3f44e71e4&redirect_uri=http%3A%2F%2Flocalhost%3A40100%2Foauth&response_type=code&scope=domains"
|
buttonSetting.href = "https://metaverse.highfidelity.com/oauth/authorize?" +
|
||||||
|
"client_id=38e572ed35bc4d34c41fbf1fb4d00071bb7328b3d0ba06d1fba64aa3f44e71e4" +
|
||||||
|
"&redirect_uri=http%3A%2F%2Flocalhost%3A40100%2Foauth&response_type=token&scope=domains"
|
||||||
}
|
}
|
||||||
|
|
||||||
// use the existing getFormGroup helper to ask for a button
|
// use the existing getFormGroup helper to ask for a button
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
$(document).ready(function(){
|
|
||||||
/*
|
|
||||||
* Clamped-width.
|
|
||||||
* Usage:
|
|
||||||
* <div data-clampedwidth=".myParent">This long content will force clamped width</div>
|
|
||||||
*
|
|
||||||
* Author: LV
|
|
||||||
*/
|
|
||||||
|
|
||||||
$('[data-clampedwidth]').each(function () {
|
|
||||||
var elem = $(this);
|
|
||||||
var parentPanel = elem.data('clampedwidth');
|
|
||||||
var resizeFn = function () {
|
|
||||||
var sideBarNavWidth = $(parentPanel).width() - parseInt(elem.css('paddingLeft')) - parseInt(elem.css('paddingRight')) - parseInt(elem.css('marginLeft')) - parseInt(elem.css('marginRight')) - parseInt(elem.css('borderLeftWidth')) - parseInt(elem.css('borderRightWidth'));
|
|
||||||
elem.css('width', sideBarNavWidth);
|
|
||||||
};
|
|
||||||
|
|
||||||
resizeFn();
|
|
||||||
$(window).resize(resizeFn);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
var listSource = $('#list-group-template').html();
|
|
||||||
var listTemplate = _.template(listSource);
|
|
||||||
|
|
||||||
reloadSettings();
|
|
||||||
|
|
||||||
function reloadSettings() {
|
|
||||||
$.getJSON('describe-setup.json', function(data){
|
|
||||||
$('.list-group').html(listTemplate(data));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
|
@ -5,6 +5,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12" id="stats-container"></div>
|
<div class="col-xs-12" id="stats-container"></div>
|
||||||
<!--#include virtual="footer.html"-->
|
<!--#include virtual="footer.html"-->
|
||||||
|
<script src='/js/query-string.js'></script>
|
||||||
<script src='js/stats.js'></script>
|
<script src='js/stats.js'></script>
|
||||||
<script src='js/json.human.js'></script>
|
<script src='js/json.human.js'></script>
|
||||||
<script src='js/highcharts-custom.js'></script>
|
<script src='js/highcharts-custom.js'></script>
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
function qs(key) {
|
|
||||||
key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx meta chars
|
|
||||||
var match = location.search.match(new RegExp("[?&]"+key+"=([^&]+)(&|$)"));
|
|
||||||
return match && decodeURIComponent(match[1].replace(/\+/g, " "));
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var currentHighchart;
|
var currentHighchart;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue