let structure; let components; let collections; changeVersion('1.14'); function changeVersion(version) { $.getJSON('schemas/' + version + '.json', json => { structure = json.root; components = json.components; collections = json.collections; }).fail((jqXHR, textStatus, errorThrown) => { let message = 'Failed loading ' + version + ' schema'; structure = { fields: [ { id: 'pools', type: 'error', message: message } ] }; console.error(message + '\n' + errorThrown); }).always(() => { $('#versionLabel').text(version); updateView(); }); } function updateView() { if (structure) { generateTable(); if (i18next.isInitialized) { $('html').localize(); } } $('#source').val(JSON.stringify(table, null, indentation)); } function generateTable() { $('#structure').removeClass('d-none').html(''); let type = structure.fields.find(e => e.id === 'type'); if (type) { $('.table-type').removeClass('d-none'); $('#tableType').html(''); for (let option of type.values) { $('#tableType').append(setValueAndName($('