From: Moritz Warning Date: Sun, 14 Jun 2020 22:08:46 +0000 (+0200) Subject: fix indentation X-Git-Tag: v2.2.1~8 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8c4ba8036a950babb57d1d66d39d9fb0913f39f9;p=web%2Ffirmware-selector-openwrt-org.git fix indentation --- diff --git a/index.js b/index.js index eafde38..497e9e1 100644 --- a/index.js +++ b/index.js @@ -397,40 +397,40 @@ function init() { url = config.asu_url + '/' + url + '/profiles.json'; } fetch(url) - .then(obj => { - build_date = obj.headers.get('last-modified'); - return obj.json(); - }) - .then(obj => { - // handle native openwrt json format - if ('profiles' in obj) { - obj['models'] = {} - for (const [key, value] of Object.entries(obj['profiles'])) { - obj['models'][get_model_titles(value.titles)] = value - obj['models'][get_model_titles(value.titles)]['id'] = key - } + .then(obj => { + build_date = obj.headers.get('last-modified'); + return obj.json(); + }) + .then(obj => { + // handle native openwrt json format + if ('profiles' in obj) { + obj['models'] = {} + for (const [key, value] of Object.entries(obj['profiles'])) { + obj['models'][get_model_titles(value.titles)] = value + obj['models'][get_model_titles(value.titles)]['id'] = key + } + } + return obj + }) + .then(obj => { + setupAutocompleteList($('models'), Object.keys(obj['models']), false, updateImages, models => { + var model = models.value; + if (model in obj['models']) { + var url = obj.url || 'unknown'; + var code = obj.version_code || 'unknown'; + var mobj = obj['models'][model]; + updateImages(version, code, build_date, model, url, mobj, false); + current_model = mobj; + } else { + updateImages(); + current_model = {}; } - return obj - }) - .then(obj => { - setupAutocompleteList($('models'), Object.keys(obj['models']), false, updateImages, models => { - var model = models.value; - if (model in obj['models']) { - var url = obj.url || 'unknown'; - var code = obj.version_code || 'unknown'; - var mobj = obj['models'][model]; - updateImages(version, code, build_date, model, url, mobj, false); - current_model = mobj; - } else { - updateImages(); - current_model = {}; - } - }); - - // trigger model update when selected version changes - $('models').onfocus(); }); + + // trigger model update when selected version changes + $('models').onfocus(); }); + }); if (config.asu_url) { show('custom');