var PluginsPage = { onPageShow: function () { PluginsPage.reloadList(); }, reloadList: function () { Dashboard.showLoadingMsg(); var promise1 = ApiClient.getInstalledPlugins(); var promise2 = $.getJSON("configurationpages?pageType=PluginConfiguration"); $.when(promise1, promise2).done(function(response1, response2) { PluginsPage.populateList(response1[0], response2[0]); }); }, populateList: function (plugins, pluginConfigurationPages) { var page = $($.mobile.activePage); plugins = plugins.sort(function (plugin1, plugin2) { return (plugin1.IsCorePlugin.toString() + plugin1.Name) > (plugin2.IsCorePlugin.toString() + plugin2.Name) ? 1 : -1; }); var html = ""; for (var i = 0, length = plugins.length; i < length; i++) { var plugin = plugins[i]; if (plugin.IsCorePlugin) { continue; } var configPage = $.grep(pluginConfigurationPages, function (pluginConfigurationPage) { return pluginConfigurationPage.OwnerPluginName == plugin.Name; })[0]; html += "
" + plugin.Version + "
"; html += ""; if (!plugin.IsCorePlugin) { html += "Delete"; } html += "