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 19:06:06 UTC
[2/4] incubator-ponymail git commit: scaffolding rework and permalink
addition
scaffolding rework and permalink addition
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/562a817b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/562a817b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/562a817b
Branch: refs/heads/coffee-and-cake
Commit: 562a817b131be614ec464ebcb423f1c0aaddd19d
Parents: 0ce9358
Author: Daniel Gruno <hu...@apache.org>
Authored: Mon Sep 5 21:05:23 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Mon Sep 5 21:05:23 2016 +0200
----------------------------------------------------------------------
site/js/coffee/scaffolding.coffee | 59 ++++++++++++++++++++++++++++------
1 file changed, 49 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/562a817b/site/js/coffee/scaffolding.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/scaffolding.coffee b/site/js/coffee/scaffolding.coffee
index 7abdd88..12c4ccf 100644
--- a/site/js/coffee/scaffolding.coffee
+++ b/site/js/coffee/scaffolding.coffee
@@ -17,7 +17,7 @@
### This is the basic scaffolding for all pages ###
-listviewScaffolding = () ->
+headerScaffolding = () ->
### Start off by making the top menu ###
menu = new HTML('div', { id: "topMenu"})
document.body.inject(menu)
@@ -41,6 +41,22 @@ listviewScaffolding = () ->
ul.inject(logo)
menu.inject(ul)
+footerScaffolding = () ->
+ ### Add a footer ###
+ footer = new HTML('div', { id: "footer"})
+ document.body.inject(footer)
+ 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."
+ ])
+
+
+
+listviewScaffolding = () ->
+
+ ### Header scaffolding ###
+ headerScaffolding()
### Now, make the base div ###
mainDiv = new HTML('div', { id: "contents"})
@@ -55,18 +71,14 @@ listviewScaffolding = () ->
mainDiv.inject(calHolder)
calHolder.inject(new HTML('h3', {}, "Archive:"))
+
+
### Finally, make the list view placeholder ###
listDiv = new HTML('div', { id: "listview", class: "sbox"})
mainDiv.inject(listDiv)
- ### And of course, a footer ###
- footer = new HTML('div', { id: "footer"})
- document.body.inject(footer)
- 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."
- ])
+ ### Footer ###
+ footerScaffolding()
### Make an API call to the preferences script, have it call back to listView once done ###
r = new HTTPRequest("api/preferences.lua", {
@@ -76,4 +88,31 @@ listviewScaffolding = () ->
}
})
-
\ No newline at end of file
+
+
+### Permalink view callback ###
+scaffoldingEmailCallback = (json, state) ->
+ e = new ThreadedEmailDisplay(null, null, null, json.thread)
+ return
+
+
+### Permalink view ###
+threadScaffolding = () ->
+
+ ### Header scaffolding ###
+ headerScaffolding()
+
+ ### Now, make the base div ###
+ mainDiv = new HTML('div', { id: "email_placeholder", style: { width: "90%"}})
+ document.body.inject(mainDiv)
+
+ ### Footer ###
+ footerScaffolding()
+
+ ### Make an API call to the preferences script, have it call back to listView once done ###
+ mid = location.href.match(/thread\.html\/(.+)/)[1]
+ r = new HTTPRequest("api/thread.lua?id=" + mid, {
+ callback: scaffoldingEmailCallback
+
+ })
+