diff --git a/templates/settings.html b/templates/settings.html index aacebbf..994a46d 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -76,32 +76,29 @@ document.getElementById(catName).style.display = "block"; evt.currentTarget.className += " active"; } - function getIndexedPlugins() { - var url = '/api?custom=indexPlugins&action=getPlugins'; - requestAPI(url, function(d){ - var result = JSON.parse(d); - $('#pluginView').empty(); - for (i in result) { - var buttons = ''; - if (result[i].update == 'yes') { - buttons = buttons + ""; - $('#pluginView').append("
" + result[i].title + " - Author: " + result[i].author + " - version: " + result[i].version + ""+ buttons + "
" + result[i].description + "
"); - if (("structure" in result[i]) == true) { - $('#' + result[i].title + "_summary").append('
'); - $('#' + result[i].title + "_summary").append(''); - $('#' + result[i].title + "_summary").append('
'); - } + function getIndexedPlugins(d) { + var result = JSON.parse(d); + $('#pluginView').empty(); + for (i in result) { + var buttons = ''; + if (result[i].update == 'yes') { + buttons = buttons + ""; + $('#pluginView').append("
" + result[i].title + " - Author: " + result[i].author + " - version: " + result[i].version + ""+ buttons + "
" + result[i].description + "
"); + if (("structure" in result[i]) == true) { + $('#' + result[i].title + "_summary").append('
'); + $('#' + result[i].title + "_summary").append(''); + $('#' + result[i].title + "_summary").append('
'); + } + } + $('.fullSummary').hide(); } function installPlugin(plugin_id) { var url = "/api?custom=indexPlugins&action=installPlugin&folid=" + plugin_id; @@ -132,29 +129,7 @@ function automaticIndex() { var url = "/api?custom=indexPlugins"; requestAPI(url, function(d){ - var result = JSON.parse(d); - $('#pluginView').empty(); - for (i in result) { - var buttons = ''; - if (result[i].update == 'yes') { - buttons = buttons + ""; - $('#pluginView').append("
" + result[i].title + " - Author: " + result[i].author + " - version: " + result[i].version + ""+ buttons + "
" + result[i].description + "
"); - if (("structure" in result[i]) == true) { - $('#' + result[i].title + "_summary").append('
'); - $('#' + result[i].title + "_summary").append(''); - $('#' + result[i].title + "_summary").append('
'); - } - } - $('.fullSummary').hide(); - }); + indexPlugins(d); } function getSummary(div_id) {