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/05 14:35:37 UTC
[3/7] incubator-ponymail git commit: prep for inclusion of threaded
email view
prep for inclusion of threaded email view
rework the class for easier extendability
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/c1959d06
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/c1959d06
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/c1959d06
Branch: refs/heads/coffee-and-cake
Commit: c1959d06f74111e4c5c537d756bd12f2cb67a446
Parents: bbb5715
Author: Daniel Gruno <hu...@apache.org>
Authored: Mon Sep 5 16:32:54 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Mon Sep 5 16:32:54 2016 +0200
----------------------------------------------------------------------
site/js/coffee/email_display_basic.coffee | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/c1959d06/site/js/coffee/email_display_basic.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/email_display_basic.coffee b/site/js/coffee/email_display_basic.coffee
index d149ac1..ce6326a 100644
--- a/site/js/coffee/email_display_basic.coffee
+++ b/site/js/coffee/email_display_basic.coffee
@@ -42,8 +42,10 @@ readEmail = (obj) ->
break
if not closedOne
+ ### Get thread index value if set, for threads ###
+ index = parent.getAttribute("data-index")
### We have an(other) email open now ###
- ponymail_current_email = new BasicEmailDisplay(parent, mid)
+ ponymail_current_email = new ThreadedEmailDisplay(parent, mid, index)
ponymail_email_open.push(ponymail_current_email)
### Basic email display class ###
@@ -77,11 +79,13 @@ class BasicEmailDisplay
render: (json, state) ->
### Store email in cache if not there already ###
- if not ponymail_stored_email[@mid]
- ponymail_stored_email[@mid] = json
+ if not ponymail_stored_email[json.mid]
+ ponymail_stored_email[json.mid] = json
+
+ placeholder = get('placeholder_' + @mid + "_" + json.mid) || get('placeholder_' + json.mid)
### Display email headers ###
- headers = new HTML('div')
+ headers = new HTML('div', {class: "email_header"})
from_line = new HTML('div', {},
[
@@ -115,15 +119,15 @@ class BasicEmailDisplay
])
headers.inject(list_line)
- @placeholder.inject(headers)
+ placeholder.inject(headers)
### parse body, convert quotes ###
- @htmlbody = @quotify(json.body)
+ htmlbody = @quotify(json.body)
### Now inject the body ###
- b = new HTML('pre', {class: "email_body"}, @htmlbody)
- @placeholder.inject(b)
+ b = new HTML('pre', {class: "email_body"}, htmlbody)
+ placeholder.inject(b)
### quotify: put quotes inside quote blocks ###
quotify: (splicer) ->