This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new 001394a Put variables in separate file
001394a is described below
commit 001394a22a44d081a8cd4c64d2324d67f11def1a
Author: Sebb <[email protected]>
AuthorDate: Thu Nov 18 00:25:03 2021 +0000
Put variables in separate file
---
webui/js/ponymail.js | 107 +++++++++++++++-------------
webui/js/source/{init.js => aavariables.js} | 41 +----------
webui/js/source/init.js | 50 +------------
3 files changed, 60 insertions(+), 138 deletions(-)
diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 47e3a07..c34e4ae 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -16,11 +16,65 @@
*/
// THIS IS AN AUTOMATICALLY COMBINED FILE. PLEASE EDIT source/*.js!!
-const PONYMAIL_REVISION = "9c952ee";
+const PONYMAIL_REVISION = "fd180bb";
/******************************************
+ Fetched from source/aavariables.js
+******************************************/
+
+const PONYMAIL_VERSION = "1.0.1"; // Current version of Pony Mail Foal
+
+let apiURL = ''; // external API URL. Usually left blank.
+
+// Stuff regarding what we're doing right now
+let current_json = {};
+let current_state = {};
+let current_list = '';
+let current_domain = '';
+let current_year = 0;
+let current_month = 0;
+let current_quick_search = '';
+let current_query = '';
+let select_primed = false;
+let ponymail_preferences = {};
+let ponymail_search_list = 'this';
+
+let current_listmode = 'threaded';
+let ponymail_max_nesting = 10; // max nesting level before unthreading to save
space
+
+// thread state
+let current_email_idx = undefined;
+let chatty_layout = true;
+let ponymail_date_format = {
+ weekday: 'long',
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric'
+};
+let collated_json = {};
+
+if (pm_config.apiURL) {
+ apiURL = pm_config.apiURL;
+ console.log("Setting API URL to " + apiURL);
+}
+
+// check local storage for settings
+console.log("Checking localStorage availability");
+let can_store = false;
+if (window.localStorage && window.localStorage.setItem) {
+ try {
+ window.localStorage.setItem("ponymail_test", "foo");
+ can_store = true;
+ console.log("localStorage available!");
+ } catch (e) {
+ console.log("no localStorage available!");
+ }
+}
+
+
+/******************************************
Fetched from source/base-http-extensions.js
******************************************/
@@ -1686,69 +1740,20 @@ function showCalendarPicker(parent, seedDate) {
Fetched from source/init.js
******************************************/
-const PONYMAIL_VERSION = "1.0.1"; // Current version of Pony Mail Foal
-
-let apiURL = ''; // external API URL. Usually left blank.
-
-// Stuff regarding what we're doing right now
-let current_json = {};
-let current_state = {};
-let current_list = '';
-let current_domain = '';
-let current_year = 0;
-let current_month = 0;
-let current_quick_search = '';
-let current_query = '';
-let select_primed = false;
-let ponymail_preferences = {};
-let ponymail_search_list = 'this';
-
-let current_listmode = 'threaded';
-let ponymail_max_nesting = 10; // max nesting level before unthreading to save
space
-
-// thread state
-let current_email_idx = undefined;
-let chatty_layout = true;
-let ponymail_date_format = {
- weekday: 'long',
- year: 'numeric',
- month: 'long',
- day: 'numeric'
-};
-let collated_json = {};
-
console.log("/******* Apache Pony Mail (Foal v/%s) Initializing
********/".format(PONYMAIL_VERSION))
+
// Adjust titles:
document.title = prefs.title;
for (let title of document.getElementsByClassName("title")) {
title.innerText = prefs.title;
}
-// check local storage for settings
-console.log("Checking localStorage availability");
-let can_store = false;
-if (window.localStorage && window.localStorage.setItem) {
- try {
- window.localStorage.setItem("ponymail_test", "foo");
- can_store = true;
- console.log("localStorage available!");
- } catch (e) {
- console.log("no localStorage available!");
- }
-}
-
-
console.log("Initializing escrow checks");
window.setInterval(escrow_check, 250);
console.log("Initializing key command logger");
window.addEventListener('keyup', keyCommands);
-if (pm_config.apiURL) {
- apiURL = pm_config.apiURL;
- console.log("Setting API URL to %s".format(apiURL));
-}
-
window.addEventListener('load', function() {
document.body.appendChild(new HTML('footer', {
class: 'footer'
diff --git a/webui/js/source/init.js b/webui/js/source/aavariables.js
similarity index 65%
copy from webui/js/source/init.js
copy to webui/js/source/aavariables.js
index 193fd28..79c839c 100644
--- a/webui/js/source/init.js
+++ b/webui/js/source/aavariables.js
@@ -46,11 +46,9 @@ let ponymail_date_format = {
};
let collated_json = {};
-console.log("/******* Apache Pony Mail (Foal v/%s) Initializing
********/".format(PONYMAIL_VERSION))
-// Adjust titles:
-document.title = prefs.title;
-for (let title of document.getElementsByClassName("title")) {
- title.innerText = prefs.title;
+if (pm_config.apiURL) {
+ apiURL = pm_config.apiURL;
+ console.log("Setting API URL to " + apiURL);
}
// check local storage for settings
@@ -65,36 +63,3 @@ if (window.localStorage && window.localStorage.setItem) {
console.log("no localStorage available!");
}
}
-
-
-console.log("Initializing escrow checks");
-window.setInterval(escrow_check, 250);
-
-console.log("Initializing key command logger");
-window.addEventListener('keyup', keyCommands);
-
-if (pm_config.apiURL) {
- apiURL = pm_config.apiURL;
- console.log("Setting API URL to %s".format(apiURL));
-}
-
-window.addEventListener('load', function() {
- document.body.appendChild(new HTML('footer', {
- class: 'footer'
- }, [
- new HTML('div', {
- class: 'container'
- }, [
- new HTML('p', {
- class: 'muted'
- }, "Powered by Apache Pony Mail (Foal v/%s
~%s)".format(PONYMAIL_VERSION, PONYMAIL_REVISION))
- ])
- ]));
-});
-console.log("initializing pop state checker");
-window.onpopstate = function(event) {
- console.log("Popping state");
- return parseURL({
- cached: true
- });
-};
diff --git a/webui/js/source/init.js b/webui/js/source/init.js
index 193fd28..89128a6 100644
--- a/webui/js/source/init.js
+++ b/webui/js/source/init.js
@@ -15,69 +15,21 @@
limitations under the License.
*/
-const PONYMAIL_VERSION = "1.0.1"; // Current version of Pony Mail Foal
-
-let apiURL = ''; // external API URL. Usually left blank.
-
-// Stuff regarding what we're doing right now
-let current_json = {};
-let current_state = {};
-let current_list = '';
-let current_domain = '';
-let current_year = 0;
-let current_month = 0;
-let current_quick_search = '';
-let current_query = '';
-let select_primed = false;
-let ponymail_preferences = {};
-let ponymail_search_list = 'this';
-
-let current_listmode = 'threaded';
-let ponymail_max_nesting = 10; // max nesting level before unthreading to save
space
-
-// thread state
-let current_email_idx = undefined;
-let chatty_layout = true;
-let ponymail_date_format = {
- weekday: 'long',
- year: 'numeric',
- month: 'long',
- day: 'numeric'
-};
-let collated_json = {};
console.log("/******* Apache Pony Mail (Foal v/%s) Initializing
********/".format(PONYMAIL_VERSION))
+
// Adjust titles:
document.title = prefs.title;
for (let title of document.getElementsByClassName("title")) {
title.innerText = prefs.title;
}
-// check local storage for settings
-console.log("Checking localStorage availability");
-let can_store = false;
-if (window.localStorage && window.localStorage.setItem) {
- try {
- window.localStorage.setItem("ponymail_test", "foo");
- can_store = true;
- console.log("localStorage available!");
- } catch (e) {
- console.log("no localStorage available!");
- }
-}
-
-
console.log("Initializing escrow checks");
window.setInterval(escrow_check, 250);
console.log("Initializing key command logger");
window.addEventListener('keyup', keyCommands);
-if (pm_config.apiURL) {
- apiURL = pm_config.apiURL;
- console.log("Setting API URL to %s".format(apiURL));
-}
-
window.addEventListener('load', function() {
document.body.appendChild(new HTML('footer', {
class: 'footer'