From 694e8b03515f25e36cef855eddb835355eff4c51 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 13 Jan 2013 10:58:05 +0100 Subject: PagingTableService: o Adding support for showing a spinner if the query takes more than 500ms. o Adding a spinner when searching for people. --- .../esper/testing/web/resource/CoreResource.java | 5 + .../resources/webapp/WEB-INF/tags/common/head.tagx | 7 +- src/main/resources/webapp/apps/app.js | 28 ++ .../webapp/apps/core/PagingTableService.js | 30 +- .../webapp/apps/frontPageApp/frontPageApp.js | 4 +- .../webapp/apps/frontPageApp/personList.html | 11 +- .../resources/webapp/external/spin-1.2.7/spin.js | 320 +++++++++++++++++++++ .../webapp/external/spin-1.2.7/spin.min.js | 2 + 8 files changed, 400 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/webapp/external/spin-1.2.7/spin.js create mode 100644 src/main/resources/webapp/external/spin-1.2.7/spin.min.js diff --git a/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java b/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java index 11935cf..e95b7fa 100755 --- a/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java +++ b/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java @@ -35,6 +35,11 @@ public class CoreResource extends AbstractResource { @Path("/person") public List getPersons(@MagicParam final PageRequest pageRequest, @QueryParam("query") final String query) throws Exception { + + int sleep = 1; + System.out.println("Awesome"); + Thread.sleep(sleep * 1000); + return da.inTransaction(new CoreDaosCallback>() { protected List run() throws SQLException { List list = new ArrayList<>(); diff --git a/src/main/resources/webapp/WEB-INF/tags/common/head.tagx b/src/main/resources/webapp/WEB-INF/tags/common/head.tagx index edb00d7..7121fe1 100755 --- a/src/main/resources/webapp/WEB-INF/tags/common/head.tagx +++ b/src/main/resources/webapp/WEB-INF/tags/common/head.tagx @@ -24,11 +24,12 @@