2 * Copyright 2000-2011 JetBrains s.r.o.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
19 if (!BS.NuGet) BS.NuGet = {};
\r
22 refreshPackagesList : function() {
\r
23 $('nugetPackagesList').refresh();
\r
26 InstallPopup : OO.extend(BS.PluginPropertiesForm, OO.extend(BS.AbstractModalDialog, {
\r
27 getContainer : function() {
\r
28 return $('nugetInstallFormDialog');
\r
31 formElement : function() {
\r
32 return $('nugetInstallForm');
\r
35 disableSubmit : function() {
\r
36 $('installNuGetApplyButton').disabled = 'disabled';
\r
39 enableSubmit : function() {
\r
40 $('installNuGetApplyButton').disabled = '';
\r
43 refreshForm : function(fresh) {
\r
44 this.disableSubmit();
\r
45 BS.Util.hide($('nugetInstallFormResresh'));
\r
46 BS.Util.show($('nugetInstallFormLoading'));
\r
47 $('nugetInstallFormResresh').refresh("nugetInstallLinkSaving", fresh ? "fresh=1": "", function() {
\r
48 BS.Util.hide($('nugetInstallFormLoading'));
\r
49 BS.Util.show($('nugetInstallFormResresh'));
\r
50 BS.NuGet.Tools.InstallPopup.showCentered();
\r
57 that.showCentered();
\r
63 BS.Util.show($('installNuGetApplyProgress'));
\r
64 BS.FormSaver.save(this, this.formElement().action, OO.extend(BS.ErrorsAwareListener, {
\r
65 onCompleteSave: function(form, responseXML, err) {
\r
66 BS.Util.hide($('installNuGetApplyProgress'));
\r
67 var wereErrors = BS.XMLResponse.processErrors(responseXML, {}, form.propertiesErrorsHandler);
\r
68 BS.ErrorsAwareListener.onCompleteSave(form, responseXML, err);
\r
71 BS.NuGet.Tools.refreshPackagesList();
\r
74 BS.Util.reenableForm(form.formElement());
\r