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/06 15:54:14 UTC

[2/2] incubator-ponymail git commit: ensure we display something even if no author/subject

ensure we display something even if no author/subject

it could happen!


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

Branch: refs/heads/coffee-and-cake
Commit: 1c88bbbd9cef2d9a69c7029ce17e1a856f6062f3
Parents: 42e499e
Author: Daniel Gruno <hu...@apache.org>
Authored: Tue Sep 6 17:53:58 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Tue Sep 6 17:53:58 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/listview_basic.coffee |  8 ++++++++
 site/js/ponymail-coffee.js           | 17 +++++++++++++++++
 2 files changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/1c88bbbd/site/js/coffee/listview_basic.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/listview_basic.coffee b/site/js/coffee/listview_basic.coffee
index 980bde8..f9bfe47 100644
--- a/site/js/coffee/listview_basic.coffee
+++ b/site/js/coffee/listview_basic.coffee
@@ -217,6 +217,13 @@ class BasicListView
             ### Gravatar ###
             avatar = new HTML('img', { class: "gravatar", src: "https://secure.gravatar.com/avatar/#{original.gravatar}.png?s=24&r=g&d=mm"})
             
+            
+            ### Make sure subject and author is...something ###
+            if original.subject.length == 0
+                original.subject = "(No subject)"
+            if original.from.length == 0
+                original.from = "(No author?)"
+            
             ### Sender, without the <fo...@bar> part - just the name ###
             sender = new HTML('div', {style: {fontWeight: "bold"}}, original.from.replace(/\s*<.+>/, "").replace(/"/g, ''))
             
@@ -225,6 +232,7 @@ class BasicListView
             if hasRead(thread.tid)
                 readStyle = "normal"
                 
+            
             ### Subject, PLUS a bit of the body with a break before ###
             subject = new HTML('div', {}, [
                 new HTML('a', { style: {fontWeight: readStyle}, href: "thread.html/#{thread.tid}", onclick: "readEmail(this.parentNode.parentNode.parentNode); this.style.fontWeight = 'normal'; return false;"}, original.subject),

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/1c88bbbd/site/js/ponymail-coffee.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js
index 744c8cc..1231e62 100644
--- a/site/js/ponymail-coffee.js
+++ b/site/js/ponymail-coffee.js
@@ -1873,6 +1873,14 @@ BasicListView = (function() {
         src: "https://secure.gravatar.com/avatar/" + original.gravatar + ".png?s=24&r=g&d=mm"
       });
 
+      /* Make sure subject and author is...something */
+      if (original.subject.length === 0) {
+        original.subject = "(No subject)";
+      }
+      if (original.from.length === 0) {
+        original.from = "(No author?)";
+      }
+
       /* Sender, without the <fo...@bar> part - just the name */
       sender = new HTML('div', {
         style: {
@@ -2785,6 +2793,9 @@ threadScaffolding = function() {
  limitations under the License.
  */
 
+
+/* Quick Search bar creation */
+
 quickSearchBar = function() {
   var button, datedata, input, list, listdata, listname, options, qs, span;
   qs = new HTML('form', {
@@ -2818,16 +2829,22 @@ quickSearchBar = function() {
     data: listdata
   }, listname);
   options.inject([span, new HTML('br'), list]);
+
+  /* Input field for text search */
   input = new HTML('input', {
     type: "text",
     id: 'qs_input',
     "class": "qs_input",
     placeholder: "Type search terms..."
   });
+
+  /* The blue search button */
   button = new HTML('input', {
     type: 'submit',
     "class": 'qs_button'
   });
+
+  /* Add it all to the form */
   qs.inject(options);
   qs.inject(input);
   qs.inject(button);