You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2019/03/03 16:51:11 UTC

[incubator-ponymail] branch master updated (d06debc -> 6a7db43)

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

humbedooh pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git.


    from d06debc  Regen JS
     new d1b35b1  assign to a constant instead of hardcoding inline, find a better func name
     new 6a7db43  regen JS

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 site/js/dev/ponymail_assign_vars.js |  1 +
 site/js/dev/ponymail_helperfuncs.js |  4 ++--
 site/js/dev/ponymail_pagebuilder.js |  6 +++---
 site/js/dev/ponymail_trends.js      |  4 ++--
 site/js/ponymail.js                 | 15 ++++++++-------
 5 files changed, 16 insertions(+), 14 deletions(-)


[incubator-ponymail] 02/02: regen JS

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git

commit 6a7db4345878fd889450ab0da3ecf291dc79d876
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sun Mar 3 17:50:55 2019 +0100

    regen JS
---
 site/js/ponymail.js | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index b5f105c..701be87 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -68,6 +68,7 @@ var pending_urls = {} // URL list for GetAsync's support functions (such as the
 var pb_refresh = 0
 var treeview_guard = {}
 var mbox_month = null
+var INVALID_MAGIC_MARKER = "$INVALID"
 
 var URL_BASE = pm_config.URLBase ? pm_config.URLBase.replace(/\/+/g, "/") : ""
 
@@ -2322,9 +2323,9 @@ function isArray(obj) {
 
 
 // ML address: only accept valid mailing list IDs
-function sanitize_address(val) {
+function validate_address(val) {
     var m = val.match(/^[-@A-Za-z.0-9]+$/);
-    return m ? m[0] : "INVALID";
+    return m ? m[0] : INVALID_MAGIC_STRING;
 }
 // Check for slow URLs every 0.1 seconds
 window.setInterval(checkForSlows, 100)
@@ -4044,11 +4045,11 @@ function getListInfo(list, xdomain, nopush) {
         xdomain = list.replace(/^.*?@/, "")
     }
     
-    if (list) list = sanitize_address(list);
-    if (xdomain) xdomain = sanitize_address(xdomain);
+    if (list) list = validate_address(list);
+    if (xdomain) xdomain = validate_address(xdomain);
     
     // If invalid address passed, complain and exit - no need to attempt fetching stats
-    if (list == 'INVALID' || xdomain == 'INVALID') {
+    if (list == INVALID_MAGIC_STRING || xdomain == INVALID_MAGIC_STRING) {
         alert("Invalid mailing list address supplied!");
         return
     }
@@ -5090,8 +5091,8 @@ function gatherTrends() {
     var dspan = a_arr[1]
     var query = a_arr[2]
     
-    list = sanitize_address(list);
-    if (list == 'INVALID') {
+    list = validate_address(list);
+    if (list == INVALID_MAGIC_STRING) {
         alert("Invalid mailing list address supplied!");
         return
     }


[incubator-ponymail] 01/02: assign to a constant instead of hardcoding inline, find a better func name

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git

commit d1b35b10a02c976ec1389d230aa573f9a040de48
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sun Mar 3 17:50:46 2019 +0100

    assign to a constant instead of hardcoding inline, find a better func name
---
 site/js/dev/ponymail_assign_vars.js | 1 +
 site/js/dev/ponymail_helperfuncs.js | 4 ++--
 site/js/dev/ponymail_pagebuilder.js | 6 +++---
 site/js/dev/ponymail_trends.js      | 4 ++--
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/site/js/dev/ponymail_assign_vars.js b/site/js/dev/ponymail_assign_vars.js
index ef2df5e..1d03dcc 100644
--- a/site/js/dev/ponymail_assign_vars.js
+++ b/site/js/dev/ponymail_assign_vars.js
@@ -60,6 +60,7 @@ var pending_urls = {} // URL list for GetAsync's support functions (such as the
 var pb_refresh = 0
 var treeview_guard = {}
 var mbox_month = null
+var INVALID_MAGIC_MARKER = "$INVALID"
 
 var URL_BASE = pm_config.URLBase ? pm_config.URLBase.replace(/\/+/g, "/") : ""
 
diff --git a/site/js/dev/ponymail_helperfuncs.js b/site/js/dev/ponymail_helperfuncs.js
index b6ad259..7f38d44 100644
--- a/site/js/dev/ponymail_helperfuncs.js
+++ b/site/js/dev/ponymail_helperfuncs.js
@@ -177,9 +177,9 @@ function isArray(obj) {
 
 
 // ML address: only accept valid mailing list IDs
-function sanitize_address(val) {
+function validate_address(val) {
     var m = val.match(/^[-@A-Za-z.0-9]+$/);
-    return m ? m[0] : "INVALID";
+    return m ? m[0] : INVALID_MAGIC_STRING;
 }
 // Check for slow URLs every 0.1 seconds
 window.setInterval(checkForSlows, 100)
diff --git a/site/js/dev/ponymail_pagebuilder.js b/site/js/dev/ponymail_pagebuilder.js
index cda67ca..9a1d4bb 100644
--- a/site/js/dev/ponymail_pagebuilder.js
+++ b/site/js/dev/ponymail_pagebuilder.js
@@ -393,11 +393,11 @@ function getListInfo(list, xdomain, nopush) {
         xdomain = list.replace(/^.*?@/, "")
     }
     
-    if (list) list = sanitize_address(list);
-    if (xdomain) xdomain = sanitize_address(xdomain);
+    if (list) list = validate_address(list);
+    if (xdomain) xdomain = validate_address(xdomain);
     
     // If invalid address passed, complain and exit - no need to attempt fetching stats
-    if (list == 'INVALID' || xdomain == 'INVALID') {
+    if (list == INVALID_MAGIC_STRING || xdomain == INVALID_MAGIC_STRING) {
         alert("Invalid mailing list address supplied!");
         return
     }
diff --git a/site/js/dev/ponymail_trends.js b/site/js/dev/ponymail_trends.js
index eeec976..7de7668 100644
--- a/site/js/dev/ponymail_trends.js
+++ b/site/js/dev/ponymail_trends.js
@@ -287,8 +287,8 @@ function gatherTrends() {
     var dspan = a_arr[1]
     var query = a_arr[2]
     
-    list = sanitize_address(list);
-    if (list == 'INVALID') {
+    list = validate_address(list);
+    if (list == INVALID_MAGIC_STRING) {
         alert("Invalid mailing list address supplied!");
         return
     }