From cbafd7032860c818f8048622db42170525a90baf Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 22 Nov 2012 20:28:02 +0000 Subject: [PATCH] use .empty() rather than .html('') as handlers removed too. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1412658 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/artifacts-management.js | 2 +- .../src/main/webapp/js/archiva/repositories.js | 4 ++-- .../src/main/webapp/js/archiva/search.js | 6 +++--- .../archiva-webapp-js/src/main/webapp/js/archiva/utils.js | 8 ++++---- .../archiva-webapp-js/src/main/webapp/js/redback/user.js | 8 ++++---- .../archiva-webapp-js/src/main/webapp/js/redback/users.js | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js index 61cf260b2..efeaf7d4c 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js @@ -57,7 +57,7 @@ define("archiva.artifacts-management",["jquery","i18n","utils","jquery.tmpl","kn success: function(data) { displaySuccessMessage($.i18n.prop("fileupload.artifacts.saved")); self.artifactUploads=[]; - $("#main-content" ).find("#uploaded-files-list" ).html(''); + $("#main-content" ).find("#uploaded-files-list" ).empty(); $.ajax("restServices/archivaUiServices/fileUploadService/clearUploadedFiles", {type: "GET", dataType: 'json'}); clearForm("#main-content #fileupload"); }, 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 bd8a6f74a..7ca34435f 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 @@ -880,7 +880,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { addExtraParameter=function(){ var mainContent=$("#main-content"); - mainContent.find("#extra-parameters-error" ).html(""); + mainContent.find("#extra-parameters-error" ).empty(); var key=mainContent.find("#extraParameter-key").val(); if($.trim(key).length<1){ displayErrorMessage( $.i18n.prop("key.empty.error.message"),"extra-parameters-error"); @@ -909,7 +909,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { addExtraHeader=function(){ var mainContent=$("#main-content"); - mainContent.find("#extra-headers-error" ).html(""); + mainContent.find("#extra-headers-error" ).empty(); var key=mainContent.find("#extraHeader-key").val(); if( $.trim(key).length<1){ if($.trim(key).length<1){ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index 71211b861..84aeac701 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -567,7 +567,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno self.groupId=groupId; self.artifactId=artifactId; self.version=version; - $("#main-content" ).find("#browse_artifact_detail" ).html(""); + $("#main-content" ).find("#browse_artifact_detail" ).empty(); window.sammyArchivaApplication.setLocation(location); } @@ -734,8 +734,8 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno $.get(artifactDownloadInfosUrl,function(data){ $("#artifact-details-files-content" ).html($("#artifact-details-files-content_tmpl").tmpl({artifactDownloadInfos:data})); mainContent.find("#artifact-content-list-files li" ).on("click",function(){ - mainContent.find("#artifact_content_tree").html(""); - mainContent.find("#artifact-content-text" ).html(""); + mainContent.find("#artifact_content_tree").empty(); + mainContent.find("#artifact-content-text" ).empty(); var idValue = $(this ).attr("id"); var splitted = idValue.split(":"); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js index 61fb2dcd4..6a2378e0b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js @@ -126,7 +126,7 @@ require(["jquery","jquery.tmpl","i18n","knockout"], function(jquery,jqueryTmpl,i */ screenChange=function(){ var mainContent=$("#main-content"); - mainContent.html(""); + mainContent.empty(); mainContent.removeAttr("data-bind"); $("#body_content" ).find(".popover" ).hide(); clearUserMessages(); @@ -142,7 +142,7 @@ require(["jquery","jquery.tmpl","i18n","knockout"], function(jquery,jqueryTmpl,i */ clearUserMessages=function(idToAppend){ var textId = idToAppend ? $("#"+idToAppend) : $("#user-messages"); - $(textId).html(''); + $(textId).empty(); } /** @@ -172,8 +172,8 @@ require(["jquery","jquery.tmpl","i18n","knockout"], function(jquery,jqueryTmpl,i if (window.modalConfirmDialog==null) { window.modalConfirmDialog = $("#dialog-confirm-modal").modal(); window.modalConfirmDialog.bind('hidden', function () { - $("#dialog-confirm-modal-header-title").html(""); - $("#dialog-confirm-modal-body-text").html(""); + $("#dialog-confirm-modal-header-title").empty(); + $("#dialog-confirm-modal-body-text").empty(); }) dialogCancel.on("click", function(){ window.modalConfirmDialog.modal('hide'); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js index 865be4fff..77c07b42d 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js @@ -498,7 +498,7 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid,purl) { }, statusCode: { 500: function(data){ - $("#modal-password-change-err-message" ).html(''); + $("#modal-password-change-err-message" ).empty(); displayRestError($.parseJSON(data.responseText),"modal-password-change-err-message"); $("#modal-password-change-err-message" ).show(); } @@ -556,7 +556,7 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid,purl) { login=function(){ $.log("user.js#login"); - $("#modal-login-err-message").html(""); + $("#modal-login-err-message").empty(); var valid = $("#user-login-form").valid(); if (!valid) { @@ -653,7 +653,7 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid,purl) { editUserDetailsBox=function(){ clearUserMessages(); $("#modal-user-edit-err-message").hide(); - $("#modal-user-edit-err-message").html(""); + $("#modal-user-edit-err-message").empty(); if (window.modalEditUserBox == null) { window.modalEditUserBox = $("#modal-user-edit").modal({backdrop:'static',show:false}); window.modalEditUserBox.bind('hidden', function () { @@ -702,7 +702,7 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid,purl) { * @param user */ editUserDetails=function(user){ - $("#modal-user-edit-err-message").html(""); + $("#modal-user-edit-err-message").empty(); $.ajax("restServices/redbackServices/userService/updateMe", { data: ko.toJSON(user), contentType: 'application/json', diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js index 871d00dde..b3e5aa53b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js @@ -46,7 +46,7 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) { this.addUser=function() { clearUserMessages(); var mainContent = $("#main-content"); - mainContent.find("#createUserForm").html(""); + mainContent.find("#createUserForm").empty(); mainContent.find("#user-edit").remove(); mainContent.find("#user-create").show(); var viewModel = new UserViewModel(new User(),false,self); -- 2.39.5