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) {
$.each(data, function(id, props) {
var div = $('#'+id).show();
if (props.hasOwnProperty('url')) {
var url = props.url.replace('{host}', window.location.hostname);
div.find('h2 a').attr('href', url);
div.find('.url').text(url);
}
if (props.hasOwnProperty('login'))
div.find('.login').text(props.login);
if (props.hasOwnProperty('password'))
div.find('.password').text(props.password);
if (props.hasOwnProperty('url'))
div.find('h2 a').attr('href', props.url.replace('{host}', window.location.hostname));
$.each(props, function(key, value) {
div.find('.'+key).text(value.replace('{host}', window.location.hostname));
});
});
});
});