From 222740c6bb6c3bdb83c4989a0023952a4afd698e Mon Sep 17 00:00:00 2001 From: Keith Date: Wed, 1 May 2019 21:25:18 -0700 Subject: [PATCH 1/5] init --- index.html | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index a8a1aad9..02564e0d 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,4 @@ + @@ -11,8 +12,27 @@ -
- Build Me! +
+

GeeMail

+ +
+
+
+ + + + + + + \ No newline at end of file From 664cb0d6467663ac28c1c1d96dcfd6bbda0c8599 Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 2 May 2019 02:10:33 -0700 Subject: [PATCH 2/5] add table and data --- css/reset.css | 48 ++++++++++++++++++++++++++++ index.html | 88 +++++++++++++++++++++++++++++++++++++-------------- js/app.js | 1 + 3 files changed, 114 insertions(+), 23 deletions(-) create mode 100644 css/reset.css create mode 100644 js/app.js diff --git a/css/reset.css b/css/reset.css new file mode 100644 index 00000000..af944401 --- /dev/null +++ b/css/reset.css @@ -0,0 +1,48 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file diff --git a/index.html b/index.html index 02564e0d..3912101d 100644 --- a/index.html +++ b/index.html @@ -1,38 +1,80 @@ + GeeMail + + - - + + +

GeeMail

+ +
+ + + + + + + + + + + + + +
SubjectSenderDate
+
+
+
+
+
- - - - - - - \ No newline at end of file diff --git a/js/app.js b/js/app.js new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/js/app.js @@ -0,0 +1 @@ +'use strict'; From 0c8f25971e01ab614bf06a69d411f4a7cc82343f Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 2 May 2019 03:03:41 -0700 Subject: [PATCH 3/5] message --- index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 3912101d..6ef94674 100644 --- a/index.html +++ b/index.html @@ -10,10 +10,7 @@ // ALL OF YOUR JAVASCRIPT CODE SHOULD GO HERE. // We have to use window.onload so your JavaScript doesn't execute until the page has loaded and all HTML has been downloaded to your browser window.onload = function() { - console.log(window.geemails); - console.log(window.getNewMessage); - let tbl = document.getElementById('tbl'); let email = 0; @@ -26,16 +23,19 @@ document.getElementById('counter').innerHTML = `Inbox: ${email}`; let rows = tbl.insertRow(1); - let subjectCell = rows.insertCell(0); - subjectCell.innerHTML = msg.subject; - let senderCell = rows.insertCell(1); + let senderCell = rows.insertCell(0); senderCell.innerHTML = msg.sender; + let subjectCell = rows.insertCell(1); + subjectCell.innerHTML = msg.subject; let dateCell = rows.insertCell(2); dateCell.innerHTML = msg.date; let body = msg.body; - }; - + rows.onclick = function() { + document.getElementById('email-info').innerHTML = `${msg.date}
${msg.sender}
${msg.subject}`; + document.getElementById('email-content').innerHTML = `${body}`; + }; + }; }; From 5c83a2d00e96e732558772a2b95bd12c0e725a2d Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 2 May 2019 03:36:02 -0700 Subject: [PATCH 4/5] render new message --- index.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 6ef94674..1fd18708 100644 --- a/index.html +++ b/index.html @@ -20,8 +20,10 @@ function loadEmail(msg) { email++; - document.getElementById('counter').innerHTML = `Inbox: ${email}`; + // show number of messages + document.getElementById('inbox').innerHTML = `Inbox ${email}`; + // create row and cell for the email let rows = tbl.insertRow(1); let senderCell = rows.insertCell(0); senderCell.innerHTML = msg.sender; @@ -31,11 +33,16 @@ dateCell.innerHTML = msg.date; let body = msg.body; + // print info and message rows.onclick = function() { document.getElementById('email-info').innerHTML = `${msg.date}
${msg.sender}
${msg.subject}`; document.getElementById('email-content').innerHTML = `${body}`; - }; + } }; + // render new message + setInterval(function() { + loadEmail(getNewMessage()); + }, 8000) }; @@ -47,9 +54,8 @@

GeeMail