var PluginsPage = { onPageShow: function () { PluginsPage.reloadList(this); }, reloadList: function (page) { Dashboard.showLoadingMsg(); var promise1 = ApiClient.getInstalledPlugins(); var promise2 = ApiClient.getJSON(ApiClient.getUrl("dashboard/configurationpages") + "?pageType=PluginConfiguration"); $.when(promise1, promise2).done(function (response1, response2) { PluginsPage.populateList(page, response1[0], response2[0]); }); }, showNoConfigurationMessage: function() { Dashboard.alert({ message: Globalize.translate('NoPluginConfigurationMessage') }); }, showConnectMessage: function () { Dashboard.alert({ message: Globalize.translate('MessagePluginConfigurationRequiresLocalAccess') }); }, populateList: function (page, plugins, pluginConfigurationPages) { plugins = plugins.sort(function (plugin1, plugin2) { return (plugin1.Name) > (plugin2.Name) ? 1 : -1; }); var html = ""; for (var i = 0, length = plugins.length; i < length; i++) { var plugin = plugins[i]; var configPage = $.grep(pluginConfigurationPages, function (pluginConfigurationPage) { return pluginConfigurationPage.PluginId == plugin.Id; })[0]; html += "
" + plugin.Version + "
"; html += ""; html += "" + Globalize.translate('Delete') + ""; html += "' + Globalize.translate('MessageNoPluginsInstalled') + '
'; html += ''; html += Globalize.translate('BrowsePluginCatalogMessage'); html += '
'; html += '