Reflect possibility to have arbitrary properties in Portal

This commit is contained in:
Disassembler 2017-12-03 22:46:23 +01:00
parent 0dd2c10b87
commit 6321ca9191

View File

@ -2,15 +2,11 @@ $(function() {
$.getJSON('js/apps.json', function(data) { $.getJSON('js/apps.json', function(data) {
$.each(data, function(id, props) { $.each(data, function(id, props) {
var div = $('#'+id).show(); var div = $('#'+id).show();
if (props.hasOwnProperty('url')) { if (props.hasOwnProperty('url'))
var url = props.url.replace('{host}', window.location.hostname); div.find('h2 a').attr('href', props.url.replace('{host}', window.location.hostname));
div.find('h2 a').attr('href', url); $.each(props, function(key, value) {
div.find('.url').text(url); div.find('.'+key).text(value.replace('{host}', window.location.hostname));
} });
if (props.hasOwnProperty('login'))
div.find('.login').text(props.login);
if (props.hasOwnProperty('password'))
div.find('.password').text(props.password);
}); });
}); });
}); });