From 458d77821098453cdc146fe53a4eeadbfc24ad82 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Wed, 5 Feb 2020 12:27:18 +0100 Subject: [PATCH] [Major] Refactored webapp to use behaviors for re-usable code --- .../{ => behaviors}/c-compute-behavior.html | 14 +- .../main/webapp/app/src/c-app-behavior.html | 235 +++++++++++++++++ .../src/main/webapp/app/src/c-app.html | 249 +----------------- .../webapp/app/src/styles/c-app-style.html | 78 ++++++ .../webapp/app/src/{ => views}/c-view404.html | 0 5 files changed, 337 insertions(+), 239 deletions(-) rename li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/{ => behaviors}/c-compute-behavior.html (97%) create mode 100644 li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-app-behavior.html create mode 100644 li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/styles/c-app-style.html rename li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/{ => views}/c-view404.html (100%) diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-compute-behavior.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-compute-behavior.html similarity index 97% rename from li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-compute-behavior.html rename to li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-compute-behavior.html index e2129f9c4..35dcc94f2 100644 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-compute-behavior.html +++ b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-compute-behavior.html @@ -8,9 +8,15 @@ return CustomWeb.baseRestPath; } }, + baseWsPath: { + type: String, + value: function () { + return CustomWeb.baseWsPath; + } + }, localesPath: { type: String, - value: '../../locales.json' + value: '../../../locales.json' } }, @@ -432,7 +438,8 @@ this.fire("cx-show-confirmation", { title: title, text: text, - callback: callback + callback: callback, + bind: this }); }, @@ -447,7 +454,8 @@ action2: action2, callback2: callback2, action3: action3, - callback3: callback3 + callback3: callback3, + bind: this }); }, clearNotification: function (id) { diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-app-behavior.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-app-behavior.html new file mode 100644 index 000000000..36e72d3fe --- /dev/null +++ b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-app-behavior.html @@ -0,0 +1,235 @@ + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-app.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-app.html index 385903413..911419640 100644 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-app.html +++ b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-app.html @@ -33,21 +33,21 @@ - + + + - + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-view404.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-view404.html similarity index 100% rename from li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/c-view404.html rename to li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-view404.html