From: Olivier Lamy Date: Mon, 19 Nov 2012 21:02:08 +0000 (+0000) Subject: reuse selector! X-Git-Tag: archiva-1.4-M4~613 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=90e2c0072712e408ba04546b17d6ed2aea9936ad;p=archiva.git reuse selector! git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1411408 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js index f7b435a8f..31559507a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js @@ -521,9 +521,10 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" this.networkConfiguration=ko.observable(networkConfiguration); save=function(){ - $("#user-messages" ).html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); var mainContent=$("#main-content"); - if (!$("#main-content" ).find("#network-configuration-edit-form").valid()){ + if (!mainContent.find("#network-configuration-edit-form").valid()){ return; } mainContent.find("#network-configuration-btn-save" ).button('loading'); @@ -536,7 +537,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" displaySuccessMessage( $.i18n.prop("network-configuration.updated")); }, complete: function(){ - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); mainContent.find("#network-configuration-btn-save" ).button('reset'); } }); @@ -605,7 +606,8 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" var self=this; save=function(){ var mainContent=$("#main-content" ); - $("#user-messages").html( mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html( mediumSpinnerImg()); mainContent.find("#ui-configuration-btn-save" ).button('loading'); $.ajax("restServices/archivaServices/archivaAdministrationService/setUiConfiguration", { type: "POST", @@ -616,7 +618,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" displaySuccessMessage( $.i18n.prop("ui-configuration.updated")); }, complete: function(){ - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); mainContent.find("#ui-configuration-btn-save" ).button('reset'); } }); @@ -856,7 +858,8 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" return; } clearUserMessages(); - $("#user-messages" ).html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); mainContent.find("#appearance-configuration-btn-save" ).button('loading'); $.ajax("restServices/archivaServices/archivaAdministrationService/setOrganisationInformation", { type: "POST", @@ -871,7 +874,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" displayErrorMessage($.i18n.prop('appearance-configuration.updating-error')); }, complete: function(){ - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); mainContent.find("#appearance-configuration-btn-save" ).button('reset'); } }); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js index 5ce7afb10..583fa43c9 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js @@ -88,7 +88,8 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra this.saveProxyConnectorRule=function(proxyConnectorRule,url,add,completeFnCallback){ $.log("saveProxyConnectorRule:"+url); - $("#user-messages" ).html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); $.ajax(url, { type: "POST", @@ -112,7 +113,7 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra displayRestError(res); }, complete:function(data){ - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); if(completeFnCallback){ completeFnCallback(); } @@ -134,7 +135,8 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra this.deleteProxyConnectorRule=function(proxyConnectorRule){ $("#main-content" ).find("proxy-connectors-rules-view-tabsTable").find(".btn").button("loading"); - $("#user-messages" ).html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); $.ajax("restServices/archivaServices/proxyConnectorRuleService/deleteProxyConnectorRule", { type:"POST", @@ -151,7 +153,7 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra displayRestError(res); }, complete:function(data){ - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); $("#main-content" ).find("proxy-connectors-rules-view-tabsTable").find(".btn").button("reset"); } } @@ -278,7 +280,8 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra screenChange(); var mainContent = $("#main-content"); mainContent.html($("#proxyConnectorsRulesMain").tmpl()); - $("#user-messages").html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); loadAllProxyConnectors(function(data){ var proxyConnectors = mapProxyConnectors(data); @@ -292,7 +295,7 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra activateProxyConnectorRulesGridTab(); }, complete: function(data){ - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); } }); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js index bcf84acc9..b1f346b7a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js @@ -204,7 +204,8 @@ define("archiva.proxy-connectors",["jquery","i18n","jquery.tmpl","bootstrap","jq this.save=function(){ //FIXME data controls !!! clearUserMessages(); - $("#user-messages" ).html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); $("#proxy-connector-btn-save" ).button("loading"); // update is delete then add if (this.update){ @@ -224,7 +225,7 @@ define("archiva.proxy-connectors",["jquery","i18n","jquery.tmpl","bootstrap","jq displayRestError(res); }, complete: function(){ - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); $("#proxy-connector-btn-save" ).button("reset"); } } @@ -248,7 +249,7 @@ define("archiva.proxy-connectors",["jquery","i18n","jquery.tmpl","bootstrap","jq displayRestError(res); }, complete: function(){ - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); $("#proxy-connector-btn-save" ).button("reset"); } } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js index de2badbce..5d6b59a69 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js @@ -244,7 +244,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { }, complete: function(){ $("#managed-repository-save-button" ).button('reset'); - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); } }); } @@ -561,7 +561,8 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { } mergeRepo=function(managedRepository){ - $("#user-messages" ).html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); // is there any artifacts to merge ? var artifactsNumberUrl = "restServices/archivaServices/browseService/artifacts/"+encodeURIComponent(managedRepository.id()); $.ajax(artifactsNumberUrl,{ @@ -595,8 +596,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { }, complete: function(){ - $.log("complete removeMediumSpinnerImg"); - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); } } ); @@ -647,7 +647,8 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { doMerge=function(sourceRepository,targetRepository,skipConflicts){ $.log("doMerge:"+sourceRepository+" to " + targetRepository + ", skipConflicts: " + skipConflicts); window.modalMergeRepoDialog.modal('hide'); - $("#user-messages" ).html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); var url = "restServices/archivaServices/mergeRepositoriesService/mergeRepositories/"+encodeURIComponent(sourceRepository); url+="/"+encodeURIComponent(targetRepository); url+="/"+skipConflicts; @@ -658,7 +659,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { displaySuccessMessage($.i18n.prop("managedrepository.merge.success", sourceRepository,targetRepository)); }, complete: function(){ - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); } }); } @@ -1181,7 +1182,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { ko.applyBindings(managedRepositoriesViewModel,mainContent.find("#managed-repositories-view").get(0)); activatePopoverDoc(); mainContent.find("#managed-repositories-pills #managed-repositories-view-a").tab('show'); - removeMediumSpinnerImg("#main-content #managed-repositories-content"); + removeMediumSpinnerImg(mainContent.find("#managed-repositories-content")); activateManagedRepositoriesGridTab(); if(successFnManagedRepositories){ successFnManagedRepositories(managedRepositoriesViewModel); @@ -1220,7 +1221,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { var mainContent = $("#main-content"); ko.applyBindings(remoteRepositoriesViewModel,mainContent.find("#remote-repositories-view").get(0)); mainContent.find("#remote-repositories-pills #remote-repositories-view-a").tab('show') - removeMediumSpinnerImg("#main-content #remote-repositories-content"); + removeMediumSpinnerImg(mainContent.find("#remote-repositories-content")); activatePopoverDoc(); if(successFnRemoteRepositories){ successFnRemoteRepositories(managedRepositoriesViewModel); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js index 0f07f35eb..98cdd9323 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js @@ -207,7 +207,8 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) { this.saveRepositoryGroup=function(repositoryGroup){ clearUserMessages(); - $("#user-messages").html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); $("#repository-group-save" ).button('loading'); $.ajax("restServices/archivaServices/repositoryGroupService/updateRepositoryGroup", { @@ -227,7 +228,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) { }, complete:function(data){ $("#repository-group-save" ).button('reset'); - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); } } ); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html index 790d696ca..739cb1476 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html @@ -86,15 +86,12 @@ {{/each}} Releases Snapshots - ${$.i18n.prop('managedrepository.actions')} ${$.i18n.prop('edit')} ${$.i18n.prop('delete')} ${$.i18n.prop('modified')} - ${$.i18n.prop('managed.repository.rss.header')} ${$.i18n.prop('managedrepository.stats.grid.header')} - @@ -187,15 +184,6 @@ -