diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/bookmark-edit.html b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/bookmark-edit.html index d3b8134..ab08c85 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/bookmark-edit.html +++ b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/bookmark-edit.html @@ -37,15 +37,16 @@

Aplicação de exemplo do Demoiselle +

- - - - - - - - - - + + + + + + + + + + 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 a47ac58..87bb256 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 @@ -2,16 +2,14 @@ $(function() { $("#delete").hide(); $("#description").focus(); + if (id = $.url().param('id')) { + BookmarkProxy.load(id).done(loadOk).fail(loadFailed); + } + MetadataProxy.getDemoiselleVersion().done(function(data) { $("#demoiselle-version").html(data); }); - $(document).ready(function() { - if (id = $.url().param('id')) { - BookmarkProxy.load(id).done(loadOk).fail(loadFailed); - } - }); - $("form").submit(function(event) { event.preventDefault(); }); diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-list.js b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-list.js index 2fd5b61..4f89b62 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-list.js +++ b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-list.js @@ -1,14 +1,12 @@ $(function() { $("#new").focus(); + BookmarkProxy.findAll().done(findAllOk); + MetadataProxy.getDemoiselleVersion().done(function(data) { $("#demoiselle-version").html(data); }); - $(document).ready(function() { - BookmarkProxy.findAll().done(findAllOk); - }); - $("form").submit(function(event) { event.preventDefault(); }); 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 48ffd40..913dc62 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 @@ -33,7 +33,7 @@ function loginOk(data) { function loginFail(request) { switch (request.status) { case 401: - $("#global-message").html("Usuário ou senha inválidos.").show(); + $("#global-message").html(request.responseText).show(); break; case 422: diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js index 59f3f57..0cafe38 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js +++ b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js @@ -12,16 +12,6 @@ var AuthProxy = { }); }, - logout : function() { - return $.ajax({ - url : this.url, - type : "DELETE", - beforeSend : function(request) { - request.setRequestHeader("Authorization", App.getToken()); - } - }); - }, - getUser : function() { return $.ajax({ url : this.url, -- libgit2 0.21.2