define(['jQuery'], function ($) { function loadProfiles(page) { Dashboard.showLoadingMsg(); ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function (result) { renderUserProfiles(page, result); renderSystemProfiles(page, result); Dashboard.hideLoadingMsg(); }); } function renderUserProfiles(page, profiles) { renderProfiles(page, page.querySelector('.customProfiles'), profiles.filter(function (p) { return p.Type == 'User'; })); } function renderSystemProfiles(page, profiles) { renderProfiles(page, page.querySelector('.systemProfiles'), profiles.filter(function (p) { return p.Type == 'System'; })); } function renderProfiles(page, element, profiles) { require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () { var html = ''; if (profiles.length) { html += '