From 371385659c0487fd36f3cfb2e6d7c3ca12007c45 Mon Sep 17 00:00:00 2001 From: Grigory Kislin Date: Thu, 25 Sep 2014 23:45:15 +0400 Subject: [PATCH 1/2] Update jquery to 2.1.1 Update jquery-ui to 1.11.1 Add webjars-datatables dependency to eliminate cdn Add dandelion-webjars to handel webjars in bundles Override dandelion bundles to eliminate cdn Add bundle petclinic to all request in dandelion.properties and remove js/css from headTag.jsp Move jquery js call in jsp with date after body as dandelion insert js bundles just before end of body --- pom.xml | 23 ++++++++++++++++--- .../resources/dandelion/dandelion.properties | 11 +++++++++ .../datatables/datatables.properties | 6 ----- .../bootstrap2/ddl-dt-theme-bootstrap2.json | 4 ++++ src/main/resources/dandelion/petclinic.json | 12 ++++++++++ .../dandelion/vendor/bootstrap2.json | 22 ++++++++++++++++++ .../dandelion/vendor/datatables.json | 22 ++++++++++++++++++ .../resources/dandelion/vendor/jquery.json | 13 +++++++++++ .../resources/dandelion/vendor/jqueryui.json | 22 ++++++++++++++++++ .../webapp/WEB-INF/jsp/fragments/headTag.jsp | 21 ----------------- .../jsp/pets/createOrUpdatePetForm.jsp | 11 ++++----- .../jsp/pets/createOrUpdateVisitForm.jsp | 11 ++++----- 12 files changed, 136 insertions(+), 42 deletions(-) create mode 100644 src/main/resources/dandelion/dandelion.properties delete mode 100644 src/main/resources/dandelion/datatables/datatables.properties create mode 100644 src/main/resources/dandelion/datatables/themes/bootstrap2/ddl-dt-theme-bootstrap2.json create mode 100644 src/main/resources/dandelion/petclinic.json create mode 100644 src/main/resources/dandelion/vendor/bootstrap2.json create mode 100644 src/main/resources/dandelion/vendor/datatables.json create mode 100644 src/main/resources/dandelion/vendor/jquery.json create mode 100644 src/main/resources/dandelion/vendor/jqueryui.json diff --git a/pom.xml b/pom.xml index 86181d8f1..ebe0b40c5 100644 --- a/pom.xml +++ b/pom.xml @@ -60,8 +60,9 @@ 2.3.0 - 1.10.3 - 2.0.3-1 + 1.11.1 + 2.1.1 + 1.9.4-2 0.10.1 5.1.22 @@ -264,7 +265,12 @@ jquery ${webjars-jquery.version} - + + org.webjars + datatables + ${webjars-datatables.version} + + org.springframework @@ -310,6 +316,17 @@ datatables-export-itext ${dandelion.version} + + + + com.github.dandelion + dandelion-webjars + ${dandelion.version} + + diff --git a/src/main/resources/dandelion/dandelion.properties b/src/main/resources/dandelion/dandelion.properties new file mode 100644 index 000000000..f92a2cb57 --- /dev/null +++ b/src/main/resources/dandelion/dandelion.properties @@ -0,0 +1,11 @@ +############################################ +# Dandelion configuration +############################################ + +# The 'petclinic' bundle will be included in all requests +# http://dandelion-forum.48353.x6.nabble.com/Error-in-bundle-dependencies-resolving-td1677.html +# http://dandelion-forum.48353.x6.nabble.com/Overriding-asset-bundles-doesn-t-work-td1678.html + +bundle.includes=petclinic + +#dandelion.mode=production \ No newline at end of file diff --git a/src/main/resources/dandelion/datatables/datatables.properties b/src/main/resources/dandelion/datatables/datatables.properties deleted file mode 100644 index 08b1e439c..000000000 --- a/src/main/resources/dandelion/datatables/datatables.properties +++ /dev/null @@ -1,6 +0,0 @@ -# ================================== -# Dandelion-Datatables configuration -# ================================== - -# Disable the asset management of Dandelion-Core for all non-DataTable-related assets -main.standalone=true \ No newline at end of file diff --git a/src/main/resources/dandelion/datatables/themes/bootstrap2/ddl-dt-theme-bootstrap2.json b/src/main/resources/dandelion/datatables/themes/bootstrap2/ddl-dt-theme-bootstrap2.json new file mode 100644 index 000000000..f6928e668 --- /dev/null +++ b/src/main/resources/dandelion/datatables/themes/bootstrap2/ddl-dt-theme-bootstrap2.json @@ -0,0 +1,4 @@ +{ + "bundle" : "ddl-dt-theme-bootstrap2", + "dependencies": [ "bootstrap2", "datatables" ] +} \ No newline at end of file diff --git a/src/main/resources/dandelion/petclinic.json b/src/main/resources/dandelion/petclinic.json new file mode 100644 index 000000000..05f72ac0a --- /dev/null +++ b/src/main/resources/dandelion/petclinic.json @@ -0,0 +1,12 @@ +{ + "bundle" : "petclinic", + "dependencies" : [ "bootstrap2", "jqueryui" ], + "assets": [{ + "name": "petclinic", + "version": "1.0.0", + "type": "css", + "locations": { + "webapp": "/resources/css/petclinic.css" + } + }] +} \ No newline at end of file diff --git a/src/main/resources/dandelion/vendor/bootstrap2.json b/src/main/resources/dandelion/vendor/bootstrap2.json new file mode 100644 index 000000000..756632c4b --- /dev/null +++ b/src/main/resources/dandelion/vendor/bootstrap2.json @@ -0,0 +1,22 @@ +{ + "bundle": "bootstrap2", + "dependencies": [], + "assets": [ + { + "name": "bootstrap2", + "version": "2.3.0", + "type": "js", + "locations": { + "webjar": "bootstrap.min.js" + } + }, + { + "name": "bootstrap2", + "version": "2.3.0", + "type": "css", + "locations": { + "webjar": "bootstrap.min.css" + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/dandelion/vendor/datatables.json b/src/main/resources/dandelion/vendor/datatables.json new file mode 100644 index 000000000..ec069e5ba --- /dev/null +++ b/src/main/resources/dandelion/vendor/datatables.json @@ -0,0 +1,22 @@ +{ + "bundle" : "datatables", + "dependencies": [ "jquery" ], + "assets": [ + { + "name": "datatables", + "version": "1.10.2", + "type": "js", + "locations": { + "webjar": "jquery.dataTables.min.js" + } + }, + { + "name": "datatables", + "version": "1.10.2", + "type": "css", + "locations": { + "webjar": "jquery.dataTables.css" + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/dandelion/vendor/jquery.json b/src/main/resources/dandelion/vendor/jquery.json new file mode 100644 index 000000000..91d13ceea --- /dev/null +++ b/src/main/resources/dandelion/vendor/jquery.json @@ -0,0 +1,13 @@ +{ + "bundle": "jquery", + "assets": [ + { + "name": "jquery", + "version": "2.1.1", + "type": "js", + "locations": { + "webjar": "jquery.min.js" + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/dandelion/vendor/jqueryui.json b/src/main/resources/dandelion/vendor/jqueryui.json new file mode 100644 index 000000000..dcaef9556 --- /dev/null +++ b/src/main/resources/dandelion/vendor/jqueryui.json @@ -0,0 +1,22 @@ +{ + "bundle": "jqueryui", + "dependencies": [ "jquery" ], + "assets": [ + { + "name": "jqueryui", + "version": "1.11.1", + "type": "js", + "locations": { + "webjar": "jquery-ui.min.js" + } + }, + { + "name": "jqueryui", + "version": "1.11.1", + "type": "css", + "locations": { + "webjar": "jquery-ui.min.css" + } + } + ] +} \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fragments/headTag.jsp b/src/main/webapp/WEB-INF/jsp/fragments/headTag.jsp index f1eea21e6..d1f861571 100644 --- a/src/main/webapp/WEB-INF/jsp/fragments/headTag.jsp +++ b/src/main/webapp/WEB-INF/jsp/fragments/headTag.jsp @@ -7,27 +7,6 @@ PetClinic :: a Spring Framework demonstration PetClinic :: a Spring Framework demonstration - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdatePetForm.jsp b/src/main/webapp/WEB-INF/jsp/pets/createOrUpdatePetForm.jsp index 6a740609c..29b81fa9a 100644 --- a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdatePetForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/pets/createOrUpdatePetForm.jsp @@ -11,11 +11,6 @@ -
@@ -60,5 +55,9 @@
- + diff --git a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp b/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp index 4c65be890..f19a34dc0 100644 --- a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp @@ -12,11 +12,6 @@ -

New Visit

@@ -82,5 +77,9 @@
- + From c40e80e7967567583759c3cfdadf173744538b76 Mon Sep 17 00:00:00 2001 From: Grigory Kislin Date: Fri, 26 Sep 2014 00:10:31 +0400 Subject: [PATCH 2/2] Fix comment in dandelion properties --- src/main/resources/dandelion/dandelion.properties | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/dandelion/dandelion.properties b/src/main/resources/dandelion/dandelion.properties index f92a2cb57..5dd77ca11 100644 --- a/src/main/resources/dandelion/dandelion.properties +++ b/src/main/resources/dandelion/dandelion.properties @@ -3,9 +3,10 @@ ############################################ # The 'petclinic' bundle will be included in all requests -# http://dandelion-forum.48353.x6.nabble.com/Error-in-bundle-dependencies-resolving-td1677.html -# http://dandelion-forum.48353.x6.nabble.com/Overriding-asset-bundles-doesn-t-work-td1678.html bundle.includes=petclinic +# Use for production: +# http://dandelion.github.io/dandelion/features/development-mode/ +# http://dandelion.github.io/dandelion/features/production-mode/ #dandelion.mode=production \ No newline at end of file