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 2016/09/04 17:48:59 UTC

incubator-ponymail git commit: regen JS

Repository: incubator-ponymail
Updated Branches:
  refs/heads/coffee-and-cake ad6bdb5b1 -> 2cdd4bbf7


regen JS


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/2cdd4bbf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/2cdd4bbf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/2cdd4bbf

Branch: refs/heads/coffee-and-cake
Commit: 2cdd4bbf78bbab1f849219f0020dc2e7a36c3d5a
Parents: ad6bdb5
Author: Daniel Gruno <hu...@apache.org>
Authored: Sun Sep 4 19:48:48 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sun Sep 4 19:48:48 2016 +0200

----------------------------------------------------------------------
 site/js/ponymail-coffee.js | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2cdd4bbf/site/js/ponymail-coffee.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js
index e0174e6..ebbd78e 100644
--- a/site/js/ponymail-coffee.js
+++ b/site/js/ponymail-coffee.js
@@ -275,7 +275,7 @@ genColors = function(numColors, saturation, lightness, hex) {
 
 /* Pony Mail defaults */
 
-ponymail_version = "0.10-coffee-and-cake";
+ponymail_version = "0.10 (Coffee and Cake)";
 
 ponymail_lists = {};
 
@@ -836,29 +836,39 @@ dealWithKeyboard = function(e) {
   }
 
   /* Make sure the below shortcuts don't interfere with normal operations */
-  if (splash.style.display !== 'block' && document.activeElement.nodeName !== 'INPUT' && !e.ctrlKey) {
+  if (splash && splash.style.display !== 'block' && document.activeElement.nodeName !== 'INPUT' && !e.ctrlKey) {
 
     /* H key: show help */
     if (e.keyCode === 72) {
-      return popup("Keyboard shortcuts", "<pre><b>H:</b>Show this help menu<br/><b>C:</b>Compose a new email to the current list<br/><b>R:</b>Reply to the last opened email<br/><b>S:</b>Go to the quick search bar<br/><b>Esc:</b>Hide/collapse current email or thread<br/></pre>You can also, in some cases, use the mouse wheel to scroll up/down the list view", 10);
+      popup("Keyboard shortcuts", "<pre><b>H:</b>Show this help menu<br/><b>C:</b>Compose a new email to the current list<br/><b>R:</b>Reply to the last opened email<br/><b>S:</b>Go to the quick search bar<br/><b>Esc:</b>Hide/collapse current email or thread<br/></pre>You can also, in some cases, use the mouse wheel to scroll up/down the list view", 10);
     } else if (e.keyCode === 67) {
 
       /* C key: compose */
-      return compose(null, ponymail_list, 'new');
+      compose(null, ponymail_list, 'new');
     } else if (e.keyCode === 82) {
 
       /* R key: reply */
       if (openEmail() && last_opened_email) {
-        return compose(last_opened_email, null, 'reply');
+        compose(last_opened_email, null, 'reply');
       }
     } else if (e.keyCode === 83) {
 
       /* S key: quick search */
       if (get('q')) {
-        return get('q').focus();
+        get('q').focus();
       }
     }
   }
+
+  /* Page Up - scroll list view if possible */
+  if (e.keyCode === 33 && ponymail_current_listview) {
+    ponymail_current_listview.swipe('up');
+  }
+
+  /* Page Down - scroll list view if possible */
+  if (e.keyCode === 34 && ponymail_current_listview) {
+    return ponymail_current_listview.swipe('down');
+  }
 };
 
 
@@ -1225,7 +1235,12 @@ BasicListView = (function() {
 
   BasicListView.prototype.swipe = function(e) {
     var direction, obj, scrollBar, style;
-    direction = (e.wheelDelta || -e.detail) < 0 ? 'down' : 'up';
+    direction = "";
+    if (typeof e === 'string') {
+      direction = e;
+    } else {
+      direction = (e.wheelDelta || -e.detail) < 0 ? 'down' : 'up';
+    }
     style = document.body.currentStyle || window.getComputedStyle(document.body, "");
 
     /* Use the footer to determine whether scrollbar is present or not */
@@ -1349,6 +1364,9 @@ listView = function(hash, reParse) {
     }
   }
 
+  /* Set window title */
+  document.title = ponymail_list + " - Pony Mail!";
+
   /* Construct arg list for URL */
   args = "";
   if (ponymail_list && ponymail_list.length > 0) {
@@ -1763,7 +1781,7 @@ listviewScaffolding = function() {
   });
   mainDiv.inject(listDiv);
 
-  /* And of course, afooter */
+  /* And of course, a footer */
   footer = new HTML('div', {
     id: "footer"
   });