diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js index 06762d0..e082c75 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js +++ b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js @@ -3,7 +3,7 @@ $(function() { $("#description").focus(); if (id = App.getUrlParameterByName('id')) { - BookmarkProxy.load(id).done(loadOk).fail(loadFailed); + BookmarkProxy.load(id).done(loadOk).fail(loadFail); } MetadataProxy.getDemoiselleVersion().done(function(data) { @@ -21,9 +21,9 @@ $(function() { }; if (id = $("#id").val()) { - BookmarkProxy.update(id, data).done(saveOk).fail(saveFailed); + BookmarkProxy.update(id, data).done(saveOk).fail(saveFail); } else { - BookmarkProxy.insert(data).done(saveOk).fail(saveFailed); + BookmarkProxy.insert(data).done(saveOk).fail(saveFail); } }); @@ -49,8 +49,8 @@ function loadOk(data) { $("#delete").show(); } -function loadFailed(request) { - switch (request.status) { +function loadFail(jqXHR) { + switch (jqXHR.status) { case 404: bootbox.alert("Você está tentando acessar um registro inexistente!", function() { location.href = "bookmark-list.html"; @@ -62,18 +62,18 @@ function loadFailed(request) { } } -function saveOk(data) { +function saveOk() { location.href = 'bookmark-list.html'; } -function saveFailed(request) { - switch (request.status) { +function saveFail(jqXHR) { + switch (jqXHR.status) { case 422: $($("form input").get().reverse()).each(function() { var id = $(this).attr('id'); var message = null; - $.each(request.responseJSON, function(index, value) { + $.each(jqXHR.responseJSON, function(index, value) { if (id == value.property) { message = value.message; return; @@ -94,6 +94,6 @@ function saveFailed(request) { } } -function removeOk(data) { +function removeOk() { location.href = 'bookmark-list.html'; } diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/home.js b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/home.js index fc24a5d..db553b3 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/home.js +++ b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/home.js @@ -1,5 +1,7 @@ $(function() { - MetadataProxy.getDemoiselleVersion().done(function(data) { - $("#demoiselle-version").html(data); - }); + MetadataProxy.getDemoiselleVersion().done(getVersionOk); }); + +function getVersionOk(data) { + $("#demoiselle-version").html(data); +} diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js index cebc55e..6fdc861 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js +++ b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js @@ -26,7 +26,7 @@ function loginOk(data, textStatus, jqXHR) { App.restoreSavedLocation(); } -function loginFail(jqXHR, textStatus, errorThrown) { +function loginFail(jqXHR) { switch (jqXHR.status) { case 401: $("#global-message").html(jqXHR.responseText).show(); -- libgit2 0.21.2