You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2022/04/07 09:45:14 UTC

[ofbiz-framework] branch trunk updated: Improved: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)

This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new b063216cde Improved: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)
b063216cde is described below

commit b063216cde4139f88d66f83a5785cd465c9a4183
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Thu Apr 7 11:45:22 2022 +0200

    Improved: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)
    
    Puts the Uglify script in package.json with an example of use for jquery.flot.js
    
    The size diff between jquery.flot.js and jquery.flot.min.js is only 2%, so it's
    more an example...
    
    Note: to run the Uglify task alone use "gradlew npm_run_uglify"
---
 themes/common-theme/template/includes/flotCharts/Bars.ftl    | 2 +-
 themes/common-theme/template/includes/flotCharts/Pie.ftl     | 2 +-
 themes/common-theme/webapp/common-theme/js/package-lock.json | 5 +++++
 themes/common-theme/webapp/common-theme/js/package.json      | 6 +++++-
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/themes/common-theme/template/includes/flotCharts/Bars.ftl b/themes/common-theme/template/includes/flotCharts/Bars.ftl
index 5aec338200..c24b0888b2 100644
--- a/themes/common-theme/template/includes/flotCharts/Bars.ftl
+++ b/themes/common-theme/template/includes/flotCharts/Bars.ftl
@@ -16,7 +16,7 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
-<script type="application/javascript" src="<@o...@ofbizContentUrl>"></script>
+<script type="application/javascript" src="<@o...@ofbizContentUrl>"></script>
 
 <div id="${chartId}Div" style="width:600px;height:300px;"></div>
 
diff --git a/themes/common-theme/template/includes/flotCharts/Pie.ftl b/themes/common-theme/template/includes/flotCharts/Pie.ftl
index 39bd639606..19cb4bec41 100644
--- a/themes/common-theme/template/includes/flotCharts/Pie.ftl
+++ b/themes/common-theme/template/includes/flotCharts/Pie.ftl
@@ -16,7 +16,7 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
-<script type="application/javascript" src="<@o...@ofbizContentUrl>"></script>
+<script type="application/javascript" src="<@o...@ofbizContentUrl>"></script>
 <script type="application/javascript" src="<@o...@ofbizContentUrl>"></script>
 
 
diff --git a/themes/common-theme/webapp/common-theme/js/package-lock.json b/themes/common-theme/webapp/common-theme/js/package-lock.json
index 57a5ba95d5..53ef775e3d 100644
--- a/themes/common-theme/webapp/common-theme/js/package-lock.json
+++ b/themes/common-theme/webapp/common-theme/js/package-lock.json
@@ -50,6 +50,11 @@
       "version": "2.25.1",
       "resolved": "https://registry.npmjs.org/trumbowyg/-/trumbowyg-2.25.1.tgz",
       "integrity": "sha512-bmmV1qC+fTLfyVpLE5iZjCzHG5DfAwM7p8K2fdq6L1kOi+IrVJk/qGFVEEmYyJ0Ofd1z3g2vavfABpmkVLzV6A=="
+    },
+    "uglify-js": {
+      "version": "3.15.3",
+      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.3.tgz",
+      "integrity": "sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg=="
     }
   }
 }
diff --git a/themes/common-theme/webapp/common-theme/js/package.json b/themes/common-theme/webapp/common-theme/js/package.json
index 350c311c9b..34d230075f 100644
--- a/themes/common-theme/webapp/common-theme/js/package.json
+++ b/themes/common-theme/webapp/common-theme/js/package.json
@@ -12,6 +12,10 @@
         "jquery-ui-dist": "^1.13.0",
         "trumbowyg": "^2.25.1",
         "flot": "^4.2.2",
-        "@chinchilla-software/jquery-ui-timepicker-addon": "^1.6.3"
+        "@chinchilla-software/jquery-ui-timepicker-addon": "^1.6.3",
+        "uglify-js": "latest"
+    },
+    "scripts": {
+        "uglify": "uglifyjs node_modules/flot/dist/es5/jquery.flot.js -c -m -o node_modules/flot/dist/es5/jquery.flot.min.js"
     }
 }