[ofbiz-framework] branch trunk updated: Add notes to js funcs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Add notes to js funcs

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

jamesyong 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 cc90994  Add notes to js funcs
cc90994 is described below

commit cc90994a4f7378557d10f33b72e242c4dc958939
Author: James Yong <[hidden email]>
AuthorDate: Sun Dec 20 15:01:09 2020 +0800

    Add notes to js funcs
---
 themes/common-theme/webapp/common/js/util/OfbizUtil.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/themes/common-theme/webapp/common/js/util/OfbizUtil.js b/themes/common-theme/webapp/common/js/util/OfbizUtil.js
index 8585ff8..dcffe7d 100644
--- a/themes/common-theme/webapp/common/js/util/OfbizUtil.js
+++ b/themes/common-theme/webapp/common/js/util/OfbizUtil.js
@@ -1489,6 +1489,13 @@ function sendJWT(targetUrl) {
     }
 }
 
+/**
+ * Load an array of external javascript and/or css files asynchronously.
+ * Run success function after the external files are loaded.
+ * @param urls array of js / css links
+ * @param onSuccessFn function to run when the files are loaded successfully
+ * @param onErrorFn optional function to run when any of the files are not loaded correctly
+ */
 var importLibrary = function() {
     var importLibraryFiles = new Map();
     return function (urls, onSuccessFn, onErrorFn) {
@@ -1530,6 +1537,10 @@ var importLibrary = function() {
     }
 }();
 
+/**
+ * Is browser accessing local server?
+ * @returns {boolean}
+ */
 function isLocalEnviron(){
     return ["localhost","127.0.0.1"].includes(window.location.hostname);
 }
\ No newline at end of file