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/03 07:45:49 UTC

[01/12] incubator-ponymail git commit: link to static html version if no JS enabled

Repository: incubator-ponymail
Updated Branches:
  refs/heads/coffee-and-cake df07e2dbf -> cc66edfeb


link to static html version if no JS enabled


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

Branch: refs/heads/coffee-and-cake
Commit: 0c175efba276df1fddf646ad64fd98a505f14f45
Parents: df07e2d
Author: Daniel Gruno <hu...@apache.org>
Authored: Fri Sep 2 22:47:05 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Fri Sep 2 22:47:05 2016 +0200

----------------------------------------------------------------------
 site/list2.html | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/0c175efb/site/list2.html
----------------------------------------------------------------------
diff --git a/site/list2.html b/site/list2.html
index 15854b1..43965cf 100644
--- a/site/list2.html
+++ b/site/list2.html
@@ -21,6 +21,10 @@ the License. -->
     <title>Pony Mail!</title>
   </head>
   <body onLoad="listviewScaffolding();">
+    <noscript>
+      Sorry, this service relies on JavaScript in order to display results.
+      You may use the <a href="api/static.lua">Static HTML version</a> instead if you like.
+    </noscript>
     <script type="text/javascript" src="js/config.js"></script>
     <script type="text/javascript" src="js/ponymail-coffee.js"></script>
   </body>


[10/12] incubator-ponymail git commit: start work on a basic listview class

Posted by hu...@apache.org.
start work on a basic listview class

this is meant to be extended/cloned by other listview
styles later on.


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

Branch: refs/heads/coffee-and-cake
Commit: 40736a6cb033a14c3a187824944fb646cadcc4d7
Parents: 496d7b4
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 09:44:48 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 09:44:48 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/listview_basic.coffee | 93 +++++++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/40736a6c/site/js/coffee/listview_basic.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/listview_basic.coffee b/site/js/coffee/listview_basic.coffee
new file mode 100644
index 0000000..005ccdc
--- /dev/null
+++ b/site/js/coffee/listview_basic.coffee
@@ -0,0 +1,93 @@
+###
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+###
+
+###*
+# Basic listview class, to be extended by other designs
+###
+class BasicListView
+    ### json: from stats.lua, rpp = results per page, pos = starting position (from 0) ###
+    constructor: (@json, @rpp = 15, @pos = 0) ->
+        
+        ### Get and clear the list view ###
+        @lv = get('listview')
+        @lv = @lv.empty()
+        
+        ### If we got results, use scroll() to display from result 0 on ###
+        if isArray(@json.thread_struct) and @json.thread_struct.length > 0
+            @scroll(@rpp, @pos)
+        else
+            ### No results, just say...that ###
+            @lv.inject("No emails found matching this criterion.")
+            
+            
+    ### scroll: scroll to a position and show N emails/threads ###
+    scroll: (rpp, pos) ->
+        ### Clear the list view ###
+        @lv = @lv.empty()
+        
+        ### For each email result,...###
+        for item in @json.thread_struct
+            original = @findEmail(item.tid)
+            
+            ### Be sure we actually have an email here ###
+            if original
+                people = @countPeople(item)
+                noeml = @countEmail(item)
+                
+                ### Render the email in the LV ###
+                item = new HTML('div', {class: "listview_item"}, "#{original.subject} - #{people} and #{noeml} replies.")
+                @lv.inject(item)
+    
+    ### findEmail: find an email given an ID ###
+    findEmail: (id) ->
+        for email in @json.emails
+            if email.id == id
+                return email
+        return null
+    
+    ### countEmail: func for counting how many emails are in a thread ###
+    countEmail: (thread) ->
+        n = 0
+        if thread.children
+            for item in (if isArray(thread.children) then thread.children else [])
+                n++
+                if isArray(item.children) and item.children.length > 0
+                    n += @countEmail(item.children)
+        return n
+    
+    ### countPeople: func for counting how many people are in a thread ###
+    countPeople: (thread, p) ->
+        np = p || {}
+        n = 0
+        if thread.tid
+            eml = @findEmail(thread.tid)
+            if eml
+                np[eml.from] = true
+                for item in (if isArray(thread.children) then thread.children else [])
+                    t = item.tid
+                    email = @findEmail(t)
+                    if email
+                        np[email.from] = true
+                    if isArray(item.children) and item.children.length > 0
+                        np = @countPeople(item.children, np)
+        if p
+            return np
+        else
+            for k,v of np
+                n++
+            return n
+        
\ No newline at end of file


[04/12] incubator-ponymail git commit: un-stuck the http requests

Posted by hu...@apache.org.
un-stuck the http requests


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

Branch: refs/heads/coffee-and-cake
Commit: 43cb6cf2d84ca58fbb088a940cf3cb1245686086
Parents: 2ebe23d
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 08:02:40 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 08:02:40 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/http_utils.coffee | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/43cb6cf2/site/js/coffee/http_utils.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/http_utils.coffee b/site/js/coffee/http_utils.coffee
index f34b773..ea35036 100644
--- a/site/js/coffee/http_utils.coffee
+++ b/site/js/coffee/http_utils.coffee
@@ -152,7 +152,7 @@ class HTTPRequest
         @request.open(@method, @url, true)
         
         ### Send data ###
-        #@request.send(@rdata)
+        @request.send(@rdata)
         
         
         ### Set onChange behavior ###


[11/12] incubator-ponymail git commit: CSS changes

Posted by hu...@apache.org.
CSS changes

floats/widths for elements in list view
make spinner more funky


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

Branch: refs/heads/coffee-and-cake
Commit: cfe9f9d11f8559a3b6b9b0046c456d64251b2e18
Parents: 40736a6
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 09:45:16 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 09:45:16 2016 +0200

----------------------------------------------------------------------
 site/css/ponymail2.css | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/cfe9f9d1/site/css/ponymail2.css
----------------------------------------------------------------------
diff --git a/site/css/ponymail2.css b/site/css/ponymail2.css
index 46319b1..a5569e2 100644
--- a/site/css/ponymail2.css
+++ b/site/css/ponymail2.css
@@ -133,6 +133,7 @@ body, html {
     text-align: center;
     font-family: sans-serif;
     font-size: 14pt;
+    width: 100%;
 }
 
 #calendar {
@@ -158,6 +159,14 @@ body, html {
     font-family: sans-serif;
     font-size: 8pt;
     text-align: center;
+    float: left;
+    width: 100%;
+}
+
+#contents {
+    min-height: 400px;
+    width: 100%;
+    float: left;
 }
 
 h3, h2, h1 {
@@ -187,7 +196,7 @@ h3, h2, h1 {
     border-bottom: 10px solid rgba(120, 200, 30, 0.95);
     border-left: 10px solid rgba(220,190,30,0.95);
     transform: translateZ(0);
-    animation: spin1 1s 0s ease-in-out forwards, spin2 1s 1s ease-in-out forwards, spin3 1s 2s ease-in-out forwards, spin4 1s 3s ease-in-out forwards;
+    animation: spin1 1s 0s ease-in-out, spin2 1s 1s ease-in-out, spin3 1s 2s ease-in-out, spin4 1s 3s ease-in-out;
 }
 
 .spinwheel, .spinwheel:after {
@@ -230,7 +239,7 @@ h3, h2, h1 {
     }
 
     100% {
-        transform: rotate(90deg);
+        transform: rotate(450deg);
     }
 }
 
@@ -240,7 +249,7 @@ h3, h2, h1 {
     }
 
     100% {
-        transform: rotate(180deg);
+        transform: rotate(540deg);
     }
 }
 @keyframes spin3 {
@@ -249,7 +258,7 @@ h3, h2, h1 {
     }
 
     100% {
-        transform: rotate(270deg);
+        transform: rotate(630deg);
     }
 }
 @keyframes spin4 {
@@ -258,6 +267,6 @@ h3, h2, h1 {
     }
 
     100% {
-        transform: rotate(360deg);
+        transform: rotate(720deg);
     }
 }
\ No newline at end of file


[12/12] incubator-ponymail git commit: regen JS

Posted by hu...@apache.org.
regen JS

this actually does stuf now!


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

Branch: refs/heads/coffee-and-cake
Commit: cc66edfeb2c81792f68b12dcb6d112e8d684767f
Parents: cfe9f9d
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 09:45:33 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 09:45:33 2016 +0200

----------------------------------------------------------------------
 site/js/ponymail-coffee.js | 324 ++++++++++++++++++++++++++++++++++++----
 1 file changed, 296 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/cc66edfe/site/js/ponymail-coffee.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js
index 6eb7307..ddd8d7e 100644
--- a/site/js/ponymail-coffee.js
+++ b/site/js/ponymail-coffee.js
@@ -1,5 +1,5 @@
 // Generated by CoffeeScript 1.9.3
-var Calendar, HTML, HTTPRequest, calendar_months, cog, dbRead, dbWrite, e, genColors, get, hsl2rgb, isArray, isHash, listView, listviewScaffolding, pendingURLStatus, pending_url_operations, pm_storage_available, pm_storage_globvar, ponymail_version, set, testCoffee, testToggle, toggleMonth, toggleYear, txt;
+var BasicListView, Calendar, HTML, HTTPRequest, calendar_months, cog, dbRead, dbWrite, e, genColors, get, hsl2rgb, isArray, isHash, listView, listviewScaffolding, parseURL, pendingURLStatus, pending_spinner_at, pending_url_operations, pm_snap, pm_storage_available, pm_storage_globvar, ponymail_list, ponymail_lists, ponymail_month, ponymail_query, ponymail_version, renderListView, set, setupAccount, spinCheck, testCoffee, testToggle, toggleMonth, toggleYear, txt;
 
 calendar_months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
 
@@ -24,6 +24,11 @@ Calendar = (function() {
     /* If end year+month given, use it */
     if (end) {
       ref2 = String(end).split("-"), eYear = ref2[0], eMonth = ref2[1];
+
+      /* If end year is this year, restrict months to those that have passed */
+      if (parseInt(eYear) === now.getFullYear()) {
+        eMonth = now.getMonth() + 1;
+      }
     }
 
     /* Make sure months are there, otherwise set them */
@@ -259,6 +264,14 @@ genColors = function(numColors, saturation, lightness, hex) {
 
 ponymail_version = "0.10-coffee-and-cake";
 
+ponymail_lists = {};
+
+ponymail_list = "";
+
+ponymail_month = "";
+
+ponymail_query = "";
+
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one or more
@@ -427,6 +440,18 @@ HTMLElement.prototype.show = function(bool) {
 };
 
 
+/**
+ * prototype for emptying an html element
+ */
+
+HTMLElement.prototype.empty = function() {
+  var ndiv;
+  ndiv = this.cloneNode();
+  this.parentNode.replaceChild(ndiv, this);
+  return ndiv;
+};
+
+
 /* Cog: Loading panel for when waiting for a response */
 
 cog = function(div, size) {
@@ -481,28 +506,51 @@ cog = function(div, size) {
 
 pending_url_operations = {};
 
+pending_spinner_at = 0;
+
+spinCheck = function(div) {
+  var ndiv, now;
+  now = new Date().getTime();
+  if ((now - pending_spinner_at) >= 4000) {
+    pending_spinner_at = now;
+    ndiv = div.cloneNode(true);
+    ndiv.addEventListener('animationend', function(e) {
+      return spinCheck(ndiv);
+    });
+    return div.parentNode.replaceChild(ndiv, div);
+  }
+};
+
 pendingURLStatus = function() {
   var div, now, pending, time, url;
   pending = 0;
   now = new Date().getTime();
+  div = get('loading');
   for (url in pending_url_operations) {
     time = pending_url_operations[url];
 
     /* Is something taking too long?? */
     if ((now - time) > 1500) {
       pending++;
-      div = get('loading');
       if (!div) {
         div = new HTML('div', {
+          id: 'loading',
           "class": "spinner"
         }, [
-          new HTML('img', {
-            src: "images/spinner.gif"
-          }), new HTML('br'), "Loading, please wait..."
+          new HTML('div', {
+            "class": "spinwheel"
+          }, new HTML('div', {
+            "class": "spinwheel_md"
+          }, new HTML('div', {
+            "class": "spinwheel_sm"
+          }))), new HTML('br'), "Loading, please wait..."
         ]);
         document.body.inject(div);
+        pending_spinner_at = now;
+        div.addEventListener('animationend', function(e) {
+          return spinCheck(div);
+        });
       }
-      div.style.display = "block";
     }
   }
 
@@ -512,6 +560,8 @@ pendingURLStatus = function() {
     if (div) {
       return div.style.display = "none";
     }
+  } else if (div && div.style.display === "none") {
+    return div.style.display = "block";
   }
 };
 
@@ -546,7 +596,7 @@ window.setInterval(pendingURLStatus, 500);
 
 HTTPRequest = (function() {
   function HTTPRequest(url1, args1) {
-    var tmp;
+    var r, tmp;
     this.url = url1;
     this.args = args1;
 
@@ -609,15 +659,12 @@ HTTPRequest = (function() {
     this.request.send(this.rdata);
 
     /* Set onChange behavior */
-    this.request.onreadystatechange = this.onchange;
-
-    /* all done! */
-    return this;
+    r = this;
+    this.request.onreadystatechange = function() {
+      return r.onchange();
+    };
   }
 
-
-  /* HTTPRequest state change calback */
-
   HTTPRequest.prototype.onchange = function() {
 
     /* Mark operation as done */
@@ -653,7 +700,8 @@ HTTPRequest = (function() {
           return this.callback(this.response, this.state);
         } catch (_error) {
           e = _error;
-          return this.callback(this.request.responseText, this.state);
+          console.log("Callback failed: " + e);
+          return this.callback(JSON.parse(this.request.responseText), this.state);
         }
       }
     }
@@ -688,6 +736,160 @@ HTTPRequest = (function() {
 
 })();
 
+pm_snap = null;
+
+
+/*
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+
+/**
+ * Basic listview class, to be extended by other designs
+ */
+
+BasicListView = (function() {
+
+  /* json: from stats.lua, rpp = results per page, pos = starting position (from 0) */
+  function BasicListView(json1, rpp1, pos1) {
+    this.json = json1;
+    this.rpp = rpp1 != null ? rpp1 : 15;
+    this.pos = pos1 != null ? pos1 : 0;
+
+    /* Get and clear the list view */
+    this.lv = get('listview');
+    this.lv = this.lv.empty();
+
+    /* If we got results, use scroll() to display from result 0 on */
+    if (isArray(this.json.thread_struct) && this.json.thread_struct.length > 0) {
+      this.scroll(this.rpp, this.pos);
+    } else {
+
+      /* No results, just say...that */
+      this.lv.inject("No emails found matching this criterion.");
+    }
+  }
+
+
+  /* scroll: scroll to a position and show N emails/threads */
+
+  BasicListView.prototype.scroll = function(rpp, pos) {
+
+    /* Clear the list view */
+    var item, j, len, noeml, original, people, ref, results;
+    this.lv = this.lv.empty();
+
+    /* For each email result,... */
+    ref = this.json.thread_struct;
+    results = [];
+    for (j = 0, len = ref.length; j < len; j++) {
+      item = ref[j];
+      original = this.findEmail(item.tid);
+
+      /* Be sure we actually have an email here */
+      if (original) {
+        people = this.countPeople(item);
+        noeml = this.countEmail(item);
+
+        /* Render the email in the LV */
+        item = new HTML('div', {
+          "class": "listview_item"
+        }, original.subject + " - " + people + " and " + noeml + " replies.");
+        results.push(this.lv.inject(item));
+      } else {
+        results.push(void 0);
+      }
+    }
+    return results;
+  };
+
+
+  /* findEmail: find an email given an ID */
+
+  BasicListView.prototype.findEmail = function(id) {
+    var email, j, len, ref;
+    ref = this.json.emails;
+    for (j = 0, len = ref.length; j < len; j++) {
+      email = ref[j];
+      if (email.id === id) {
+        return email;
+      }
+    }
+    return null;
+  };
+
+
+  /* countEmail: func for counting how many emails are in a thread */
+
+  BasicListView.prototype.countEmail = function(thread) {
+    var item, j, len, n, ref;
+    n = 0;
+    if (thread.children) {
+      ref = (isArray(thread.children) ? thread.children : []);
+      for (j = 0, len = ref.length; j < len; j++) {
+        item = ref[j];
+        n++;
+        if (isArray(item.children) && item.children.length > 0) {
+          n += this.countEmail(item.children);
+        }
+      }
+    }
+    return n;
+  };
+
+
+  /* countPeople: func for counting how many people are in a thread */
+
+  BasicListView.prototype.countPeople = function(thread, p) {
+    var email, eml, item, j, k, len, n, np, ref, t, v;
+    np = p || {};
+    n = 0;
+    if (thread.tid) {
+      eml = this.findEmail(thread.tid);
+      if (eml) {
+        np[eml.from] = true;
+        ref = (isArray(thread.children) ? thread.children : []);
+        for (j = 0, len = ref.length; j < len; j++) {
+          item = ref[j];
+          t = item.tid;
+          email = this.findEmail(t);
+          if (email) {
+            np[email.from] = true;
+          }
+          if (isArray(item.children) && item.children.length > 0) {
+            np = this.countPeople(item.children, np);
+          }
+        }
+      }
+    }
+    if (p) {
+      return np;
+    } else {
+      for (k in np) {
+        v = np[k];
+        n++;
+      }
+      return n;
+    }
+  };
+
+  return BasicListView;
+
+})();
+
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one or more
@@ -718,10 +920,18 @@ window.onpopstate = function(event) {
   return listView(null, true);
 };
 
+parseURL = function() {
+  var list, month, query, ref;
+  ref = window.location.search.substr(1).split(":", 3), list = ref[0], month = ref[1], query = ref[2];
+  ponymail_list = list;
+  ponymail_month = month || "";
+  return ponymail_query = query || "";
+};
+
 listView = function(hash, reParse) {
 
   /* Get the HTML filename */
-  var args, d, etc, htmlfile, ponymail_list, ponymail_month, ponymail_query, r, ref;
+  var args, d, domain, etc, htmlfile, l, list, newhref, pargs, r, ref, ref1, ref2;
   ref = location.href.split("?"), htmlfile = ref[0], etc = ref[1];
 
   /* Do we need to call the URL parser here? */
@@ -743,20 +953,23 @@ listView = function(hash, reParse) {
   }
 
   /* First, check that we have a list to view! */
-  if (!(ponymail_list && ponymail_list.match(/.+@.+/))) {
+  if (!(ponymail_list && ponymail_list.match(/.+?@.+/))) {
 
     /* Do we at least have a domain part? */
     if (ponymail_list && ponymail_list.match(/.+?\..+/)) {
 
       /* Check if there's a $default list in this domain */
-      d = ponymail_list;
+      ref1 = ponymail_list.split("@", 2), l = ref1[0], d = ref1[1];
+      if (!d) {
+        d = l;
+      }
 
       /* Do we have this domain listed? If not, redirect to front page */
-      if (!ponymail_domains[d]) {
+      if (!d || !ponymail_lists[d]) {
         location.href = "./";
         return;
       }
-      if (ponymail_domains[d] && ponymail_domains[d][pm_config.default_list]) {
+      if (ponymail_lists[d](!ponymail_lists[d][l] && ponymail_lists[d][pm_config.default_list])) {
 
         /* Redirect to this list then ... */
         location.href = htmlfile + "?" + pm_config.default_list + "@" + d;
@@ -783,14 +996,33 @@ listView = function(hash, reParse) {
   }
 
   /* Push a new history state using new args */
-  window.history.pushState({}, "", htmlfile + "?" + args);
+  newhref = htmlfile + "?" + args;
+  if (location.href !== newhref) {
+    window.history.pushState({}, newhref);
+  }
+  ref2 = ponymail_list.split("@", 2), list = ref2[0], domain = ref2[1];
 
   /* Request month view from API, send to list view callback */
-  return r = new HTTPRequest("api/stats.lua?list=" + ponymail_list + "&d=" + ponymail_month, {
+  pargs = "d=30";
+  if (ponymail_month && ponymail_month.length > 0) {
+    pargs = "s=" + ponymail_month + "&e=" + ponymail_month;
+  }
+  return r = new HTTPRequest("api/stats.lua?list=" + list + "&domain=" + domain + "&" + pargs, {
     callback: renderListView
   });
 };
 
+renderListView = function(json, state) {
+
+  /* Start by adding the calendar */
+  var cal, lv;
+  if (json.firstYear && json.lastYear) {
+    cal = new Calendar(json.firstYear, json.lastYear);
+    get('calendar').empty().inject(cal);
+  }
+  return lv = new BasicListView(json);
+};
+
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one or more
@@ -943,13 +1175,45 @@ isHash = function(value) {
  limitations under the License.
  */
 
+setupAccount = function(json, state) {
+  var domain, lists, ref;
+  if (json && isArray(json.lists)) {
+    ref = json.lists;
+    for (domain in ref) {
+      lists = ref[domain];
+      ponymail_lists[domain] = lists;
+    }
+  }
+  if (state.listview) {
+    return listView(null, true);
+  }
+};
+
+
+/*
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
 
 /* This is the basic scaffolding for all pages */
 
 listviewScaffolding = function() {
 
   /* Start off by making the top menu */
-  var cal, calHolder, footer, header, item, j, len, li, listDiv, logo, mainDiv, menu, ref, ul;
+  var calHolder, footer, header, item, j, len, li, listDiv, logo, mainDiv, menu, r, ref, ul;
   menu = new HTML('div', {
     id: "topMenu"
   });
@@ -993,11 +1257,7 @@ listviewScaffolding = function() {
     id: "calendar"
   });
   mainDiv.inject(calHolder);
-
-  /* TEST: Insert fake calendar */
-  cal = new Calendar(2010);
   calHolder.inject(new HTML('h3', {}, "Archive:"));
-  calHolder.inject(cal);
 
   /* Finally, make the list view placeholder */
   listDiv = new HTML('div', {
@@ -1011,11 +1271,19 @@ listviewScaffolding = function() {
     id: "footer"
   });
   document.body.inject(footer);
-  return footer.inject([
+  footer.inject([
     "Powered by ", new HTML('a', {
       href: 'https://ponymail.incubator.apache.org/'
     }, "Apache Pony Mail (Incubating) v/" + ponymail_version), ". Copyright 2016, the Apache Software Foundation."
   ]);
+
+  /* Make an API call to the preferences script, have it call back to listView once done */
+  return r = new HTTPRequest("api/preferences.lua", {
+    callback: setupAccount,
+    state: {
+      listview: true
+    }
+  });
 };
 
 testCoffee = function() {


[03/12] incubator-ponymail git commit: going a little over-board with the spinner ; )

Posted by hu...@apache.org.
going a little over-board with the spinner ;)

colors!


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

Branch: refs/heads/coffee-and-cake
Commit: 2ebe23dba1aaa2c50e2343760723c3756fe43a81
Parents: 8d65a54
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 08:02:07 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 08:02:07 2016 +0200

----------------------------------------------------------------------
 site/css/ponymail2.css           | 85 +++++++++++++++++++++++++----------
 site/js/coffee/http_utils.coffee | 27 ++++++++---
 2 files changed, 83 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2ebe23db/site/css/ponymail2.css
----------------------------------------------------------------------
diff --git a/site/css/ponymail2.css b/site/css/ponymail2.css
index 1946889..46319b1 100644
--- a/site/css/ponymail2.css
+++ b/site/css/ponymail2.css
@@ -169,58 +169,95 @@ h3, h2, h1 {
 .spinner {
     z-index: 100;
     position: fixed;
-    top: calc(40% - 100px);
+    top: calc(40% - 90px);
     left: calc(50% - 150px);
     width: 300px;
     height: 200px;
     background: #3285BC;
     border-radius: 8px;
-    font-size: 12pt;
+    font-size: 9pt;
     color: #FFF;
     text-align: center;
     font-family: sans-serif;
 }
 .spinwheel {
-    margin: 5px auto;
-    font-size: 10px;
-    position: relative;
-    border-top: 1.1em solid rgba(220, 190, 30, 0.2);
-    border-right: 1.1em solid rgba(220, 190, 30, 0.2);
-    border-bottom: 1.1em solid rgba(220, 190, 30, 0.2);
-    border-left: 1.1em solid #E2BB1F;
-    -webkit-transform: translateZ(0);
-    -ms-transform: translateZ(0);
+    margin: 8px auto;
+    border-top: 10px solid rgba(30,190,200,0.95);
+    border-right: 10px solid rgba(220, 30, 120, 0.95);
+    border-bottom: 10px solid rgba(120, 200, 30, 0.95);
+    border-left: 10px solid rgba(220,190,30,0.95);
     transform: translateZ(0);
-    -webkit-animation: spinning 1.1s infinite linear;
-    animation: spinning 1.1s infinite linear;
+    animation: spin1 1s 0s ease-in-out forwards, spin2 1s 1s ease-in-out forwards, spin3 1s 2s ease-in-out forwards, spin4 1s 3s ease-in-out forwards;
 }
 
 .spinwheel, .spinwheel:after {
     border-radius: 50%;
-    width: 10em;
-    height: 10em;
+    width: 100px;
+    height: 100px;
+}
+
+.spinwheel_md {
+    margin: 10px 10px;
+    border-top: 10px solid rgba(30,190,200,0.95);
+    border-right: 10px solid rgba(220, 30, 120, 0.95);
+    border-bottom: 10px solid rgba(120, 200, 30, 0.95);
+    border-left: 10px solid rgba(220,190,30,0.95);
+}
+
+.spinwheel_md, .spinwheel_md:after {
+    border-radius: 50%;
+    width: 60px;
+    height: 60px;
 }
 
-@-webkit-keyframes spinning {
+.spinwheel_sm {
+    margin: 10px 10px;
+    border-top: 20px solid rgba(30,190,200,0.95);
+    border-right: 20px solid rgba(220, 30, 120, 0.95);
+    border-bottom: 20px solid rgba(120, 200, 30, 0.95);
+    border-left: 20px solid rgba(220,190,30,0.95);
+}
+
+.spinwheel_sm, .spinwheel_sm:after {
+    border-radius: 50%;
+    width: 0px;
+    height: 0px;
+}
+
+@keyframes spin1 {
     0% {
-        -webkit-transform: rotate(0deg);
         transform: rotate(0deg);
     }
 
     100% {
-        -webkit-transform: rotate(360deg);
-        transform: rotate(360deg);
+        transform: rotate(90deg);
     }
 }
 
-@keyframes spinning {
+@keyframes spin2 {
     0% {
-        -webkit-transform: rotate(0deg);
-        transform: rotate(0deg);
+        transform: rotate(90deg);
     }
 
     100% {
-        -webkit-transform: rotate(360deg);
-        transform: rotate(360deg);
+        transform: rotate(180deg);
+    }
+}
+@keyframes spin3 {
+    0% {
+        transform: rotate(180deg);
+    }
+
+    100% {
+        transform: rotate(270deg);
     }
 }
+@keyframes spin4 {
+    0% {
+        transform: rotate(270deg);
+    }
+
+    100% {
+        transform: rotate(360deg);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2ebe23db/site/js/coffee/http_utils.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/http_utils.coffee b/site/js/coffee/http_utils.coffee
index 0a013d9..f34b773 100644
--- a/site/js/coffee/http_utils.coffee
+++ b/site/js/coffee/http_utils.coffee
@@ -26,35 +26,52 @@
 # and shows the spinner if things are taking too long.
 ###
 pending_url_operations = {}
+pending_spinner_at = 0
 
+spinCheck = (div) ->
+    now = new Date().getTime()
+    if (now - pending_spinner_at) >= 4000
+        pending_spinner_at = now
+        ndiv = div.cloneNode(true)
+        ndiv.addEventListener('animationend', (e) -> spinCheck(ndiv))
+        div.parentNode.replaceChild(ndiv, div)
+    
+    
 pendingURLStatus = () ->
     pending = 0
     now = new Date().getTime()
+    div = get('loading')
     for url, time of pending_url_operations
         ### Is something taking too long?? ###
         if (now - time) > 1500
             pending++
-            div = get('loading')
             if not div
                 div = new HTML('div', {
                     id: 'loading'
                     class: "spinner"
                     },
                     [
-                        new HTML('div', {class: "spinwheel"}),
+                        new HTML('div', {class: "spinwheel"},
+                                 new HTML('div', {class:"spinwheel_md"},
+                                          new HTML('div', {class:"spinwheel_sm"}))),
                         new HTML('br'),
                         "Loading, please wait..."
                     ]
                 )
                 document.body.inject(div)
-            div.style.display = "block"
+                pending_spinner_at = now
+                div.addEventListener('animationend', (e) -> spinCheck(div))
+                
     
     ### If no pending operations, hide the spnner ###
     if pending == 0
         div = get('loading')
         if div
             div.style.display = "none"
-            
+    else if div and div.style.display == "none"
+        div.style.display = "block"
+        
+
 window.setInterval(pendingURLStatus, 500)
 
 
@@ -135,7 +152,7 @@ class HTTPRequest
         @request.open(@method, @url, true)
         
         ### Send data ###
-        @request.send(@rdata)
+        #@request.send(@rdata)
         
         
         ### Set onChange behavior ###


[09/12] incubator-ponymail git commit: start calling prefs and having that call back to listview

Posted by hu...@apache.org.
start calling prefs and having that call back to listview


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

Branch: refs/heads/coffee-and-cake
Commit: 496d7b492f36009bc241a2cfbfed91720f10e9c6
Parents: 2ee3d35
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 09:42:14 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 09:42:14 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/preferences.coffee |  6 +++++-
 site/js/coffee/scaffolding.coffee | 13 +++++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/496d7b49/site/js/coffee/preferences.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/preferences.coffee b/site/js/coffee/preferences.coffee
index bc1292c..4ec06ab 100644
--- a/site/js/coffee/preferences.coffee
+++ b/site/js/coffee/preferences.coffee
@@ -16,4 +16,8 @@
 ###
 
 setupAccount = (json, state) ->
-    
\ No newline at end of file
+    if json and isArray(json.lists)
+        for domain, lists of json.lists
+            ponymail_lists[domain] = lists
+    if state.listview
+        listView(null, true)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/496d7b49/site/js/coffee/scaffolding.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/scaffolding.coffee b/site/js/coffee/scaffolding.coffee
index 91783d0..26e2abe 100644
--- a/site/js/coffee/scaffolding.coffee
+++ b/site/js/coffee/scaffolding.coffee
@@ -57,11 +57,7 @@ listviewScaffolding = () ->
     ### Then make the calendar placeholder ###
     calHolder = new HTML('div', { id: "calendar"})
     mainDiv.inject(calHolder)
-    
-    ### TEST: Insert fake calendar ###
-    cal = new Calendar(2010)
     calHolder.inject(new HTML('h3', {}, "Archive:"))
-    calHolder.inject(cal)
     
     ### Finally, make the list view placeholder ###
     listDiv = new HTML('div', { id: "listview", class: "sbox"})
@@ -75,4 +71,13 @@ listviewScaffolding = () ->
         new HTML('a', { href: 'https://ponymail.incubator.apache.org/'}, "Apache Pony Mail (Incubating) v/#{ponymail_version}"),
         ". Copyright 2016, the Apache Software Foundation."
     ])
+    
+    ### Make an API call to the preferences script, have it call back to listView once done ###
+    r = new HTTPRequest("api/preferences.lua", {
+        callback: setupAccount
+        state: {
+            listview: true
+        }
+    })
+    
     
\ No newline at end of file


[07/12] incubator-ponymail git commit: add html prototype for emptying an element

Posted by hu...@apache.org.
add html prototype for emptying an element

we clone the element as a bare element (no kids!)
and then replace the old with the new element.


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

Branch: refs/heads/coffee-and-cake
Commit: b7fe4def4cbefd68379c0fc87e7f63169d883a66
Parents: 7e48948
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 09:41:04 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 09:41:04 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/dom_utils.coffee | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/b7fe4def/site/js/coffee/dom_utils.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/dom_utils.coffee b/site/js/coffee/dom_utils.coffee
index 563285c..b77e326 100644
--- a/site/js/coffee/dom_utils.coffee
+++ b/site/js/coffee/dom_utils.coffee
@@ -124,6 +124,14 @@ HTMLElement.prototype.show = (bool) ->
     this.style.display = d
     return d
 
+###*
+# prototype for emptying an html element
+###
+HTMLElement.prototype.empty = () ->
+    ndiv = this.cloneNode()
+    this.parentNode.replaceChild(ndiv, this)
+    return ndiv
+
 ### Cog: Loading panel for when waiting for a response ###
 cog = (div, size = 200) ->
         idiv = mk('div', {


[06/12] incubator-ponymail git commit: set some defaults

Posted by hu...@apache.org.
set some defaults

list, month, query


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

Branch: refs/heads/coffee-and-cake
Commit: 7e4894836770ae913d54c6ca4e2bff8a2b2d6142
Parents: 2ddc7f3
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 09:40:30 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 09:40:30 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/defaults.coffee | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/7e489483/site/js/coffee/defaults.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/defaults.coffee b/site/js/coffee/defaults.coffee
index 7f594e1..82af3d9 100644
--- a/site/js/coffee/defaults.coffee
+++ b/site/js/coffee/defaults.coffee
@@ -17,3 +17,8 @@
 
 ### Pony Mail defaults ###
 ponymail_version = "0.10-coffee-and-cake"
+
+ponymail_lists = {}
+ponymail_list = ""
+ponymail_month = ""
+ponymail_query = ""
\ No newline at end of file


[08/12] incubator-ponymail git commit: more work on the listview base functions

Posted by hu...@apache.org.
more work on the listview base functions

set up args properly, default to 30d if no month specified
start calling the listview class (TBD)


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

Branch: refs/heads/coffee-and-cake
Commit: 2ee3d35385ab3bd8f37bf0e29f558a4a12e1f86f
Parents: b7fe4de
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 09:41:53 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 09:41:53 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/listview.coffee | 35 +++++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2ee3d353/site/js/coffee/listview.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/listview.coffee b/site/js/coffee/listview.coffee
index fd0017a..5ace897 100644
--- a/site/js/coffee/listview.coffee
+++ b/site/js/coffee/listview.coffee
@@ -26,8 +26,9 @@ window.onpopstate = (event) ->
 parseURL = () ->
     [list, month, query] = window.location.search.substr(1).split(":", 3)
     ponymail_list = list
-    ponymail_month = month
-    ponymail_query = query
+    ponymail_month = month||""
+    ponymail_query = query||""
+    
     
 
 listView = (hash, reParse) ->
@@ -48,17 +49,20 @@ listView = (hash, reParse) ->
             ponymail_query = hash.query
     
     ### First, check that we have a list to view! ###
-    if not (ponymail_list and ponymail_list.match(/.+@.+/))
+    if not (ponymail_list and ponymail_list.match(/.+?@.+/))
         ### Do we at least have a domain part? ###
         if ponymail_list and ponymail_list.match(/.+?\..+/)
             ### Check if there's a $default list in this domain ###
-            d = ponymail_list
+            [l, d] = ponymail_list.split("@", 2)
+            if not d
+                d = l
+                
             ### Do we have this domain listed? If not, redirect to front page ###
-            if not ponymail_domains[d]
+            if not d or not ponymail_lists[d]
                 location.href = "./"
                 return
             
-            if ponymail_domains[d] and ponymail_domains[d][pm_config.default_list]
+            if ponymail_lists[d] not ponymail_lists[d][l] and ponymail_lists[d][pm_config.default_list]
                 ### Redirect to this list then ... ###
                 location.href = "#{htmlfile}?#{pm_config.default_list}@#{d}"
                 return
@@ -77,13 +81,28 @@ listView = (hash, reParse) ->
         args += ":" + ponymail_query
         
     ### Push a new history state using new args ###
-    window.history.pushState({}, "", "#{htmlfile}?#{args}")
+    newhref = "#{htmlfile}?#{args}"
+    if location.href != newhref
+        window.history.pushState({}, newhref)
     
+    [list, domain] = ponymail_list.split("@", 2)
     ### Request month view from API, send to list view callback ###
+    pargs = "d=30"
+    if ponymail_month and ponymail_month.length > 0
+        pargs = "s=#{ponymail_month}&e=#{ponymail_month}"
     r = new HTTPRequest(
-        "api/stats.lua?list=#{ponymail_list}&d=#{ponymail_month}",
+        "api/stats.lua?list=#{list}&domain=#{domain}&#{pargs}",
         {
             callback: renderListView
         }
         )
+    
+renderListView = (json, state) ->
+    
+    ### Start by adding the calendar ###
+    if json.firstYear and json.lastYear
+        cal = new Calendar(json.firstYear, json.lastYear)
+        get('calendar').empty().inject(cal)
+        
+    lv = new BasicListView(json)
     
\ No newline at end of file


[02/12] incubator-ponymail git commit: ditch the gif, use a css spinner

Posted by hu...@apache.org.
ditch the gif, use a css spinner


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

Branch: refs/heads/coffee-and-cake
Commit: 8d65a54ac0dd9a63c316f6365e02be540ea233a3
Parents: 0c175ef
Author: Daniel Gruno <hu...@apache.org>
Authored: Fri Sep 2 23:08:22 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Fri Sep 2 23:08:22 2016 +0200

----------------------------------------------------------------------
 site/css/ponymail2.css           | 62 ++++++++++++++++++++++++++++++++++-
 site/js/coffee/http_utils.coffee |  2 +-
 2 files changed, 62 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/8d65a54a/site/css/ponymail2.css
----------------------------------------------------------------------
diff --git a/site/css/ponymail2.css b/site/css/ponymail2.css
index 84eed57..1946889 100644
--- a/site/css/ponymail2.css
+++ b/site/css/ponymail2.css
@@ -163,4 +163,64 @@ body, html {
 h3, h2, h1 {
     margin-top: 5px;
     text-align: center;
-}
\ No newline at end of file
+}
+
+/* Spinner */
+.spinner {
+    z-index: 100;
+    position: fixed;
+    top: calc(40% - 100px);
+    left: calc(50% - 150px);
+    width: 300px;
+    height: 200px;
+    background: #3285BC;
+    border-radius: 8px;
+    font-size: 12pt;
+    color: #FFF;
+    text-align: center;
+    font-family: sans-serif;
+}
+.spinwheel {
+    margin: 5px auto;
+    font-size: 10px;
+    position: relative;
+    border-top: 1.1em solid rgba(220, 190, 30, 0.2);
+    border-right: 1.1em solid rgba(220, 190, 30, 0.2);
+    border-bottom: 1.1em solid rgba(220, 190, 30, 0.2);
+    border-left: 1.1em solid #E2BB1F;
+    -webkit-transform: translateZ(0);
+    -ms-transform: translateZ(0);
+    transform: translateZ(0);
+    -webkit-animation: spinning 1.1s infinite linear;
+    animation: spinning 1.1s infinite linear;
+}
+
+.spinwheel, .spinwheel:after {
+    border-radius: 50%;
+    width: 10em;
+    height: 10em;
+}
+
+@-webkit-keyframes spinning {
+    0% {
+        -webkit-transform: rotate(0deg);
+        transform: rotate(0deg);
+    }
+
+    100% {
+        -webkit-transform: rotate(360deg);
+        transform: rotate(360deg);
+    }
+}
+
+@keyframes spinning {
+    0% {
+        -webkit-transform: rotate(0deg);
+        transform: rotate(0deg);
+    }
+
+    100% {
+        -webkit-transform: rotate(360deg);
+        transform: rotate(360deg);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/8d65a54a/site/js/coffee/http_utils.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/http_utils.coffee b/site/js/coffee/http_utils.coffee
index 56d8190..0a013d9 100644
--- a/site/js/coffee/http_utils.coffee
+++ b/site/js/coffee/http_utils.coffee
@@ -41,7 +41,7 @@ pendingURLStatus = () ->
                     class: "spinner"
                     },
                     [
-                        new HTML('img', {src: "images/spinner.gif"}),
+                        new HTML('div', {class: "spinwheel"}),
                         new HTML('br'),
                         "Loading, please wait..."
                     ]


[05/12] incubator-ponymail git commit: if end year is this year, set last month to current one

Posted by hu...@apache.org.
if end year is this year, set last month to current one

we don't need December if we're only in November now


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

Branch: refs/heads/coffee-and-cake
Commit: 2ddc7f3e744e5ffa6dc3a2dd0a83e15a69460a92
Parents: 43cb6cf
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 09:40:18 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 09:40:18 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/calendar.coffee | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2ddc7f3e/site/js/coffee/calendar.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/calendar.coffee b/site/js/coffee/calendar.coffee
index 2492265..5dc0820 100644
--- a/site/js/coffee/calendar.coffee
+++ b/site/js/coffee/calendar.coffee
@@ -32,6 +32,9 @@ class Calendar
         ### If end year+month given, use it ###
         if end
             [eYear, eMonth] = String(end).split("-")
+            ### If end year is this year, restrict months to those that have passed ###
+            if parseInt(eYear) == now.getFullYear()
+                eMonth = now.getMonth() + 1
             
         ### Make sure months are there, otherwise set them ###
         if not sMonth