Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use American spelling of "favorite" #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
<div class="folders" id="folders">
<ul class="links">
<li id="inbox" class="inbox">
<a onclick="activePage = 'inbox';renderEmails(); setActiveFolder(this)" class="active">
<a onclick="activePage = 'inbox'; renderEmails(); setActiveFolder(this)" class="active">
<div>Inbox</div>
<div class="unread-count"></div>
</a>
</li>
<li>
<a onclick="activePage = 'favourites'; renderEmails(true); setActiveFolder(this)">
<div>Favourites</div>
<a onclick="activePage = 'favorites'; renderEmails(true); setActiveFolder(this)">
<div>Favorites</div>
<div></div>
</a>
</li>
Expand All @@ -39,25 +39,19 @@
</li>
<hr>
<li>
<div>
Integrated with <a target="_blank" href="https://maildrop.cc">MailDrop</a>
</div>
</li>
<li>
Developed by <a target="_blank" href="https://www.linkedin.com/in/abdul-sohail/">Sohail</a>
Developed by <a target="_blank" href="https://github.com/Zachary-Rude/">Zachary</a>
</li>

<li class="design">
Design inspired by <a target="_blank"
href="https://dribbble.com/shots/5771691-Email-Client-Ui-Exploration/attachments">Vishnu</a>
Design inspired by <a target="_blank" href="https://dribbble.com/shots/5771691-Email-Client-Ui-Exploration/attachments">Vishnu</a>
</li>
</ul>
</div>
<div class="email-list" id="emailList">
<div class="toolbar">
<div class="search">
<i class="mdi mdi-magnify"></i>
<input type="text" class="search" placeholder="Search ..."
<input type="search" class="search" placeholder="Search ..."
title="Smart Search: Match words out of order. For example if you search for 'Allan Fife' it would match an email containing the words Allan and Fife in 'from' or 'subject', regardless of the order or position that they appear."
onkeyup="searchEmails(this.value)">
</div>
Expand All @@ -80,4 +74,4 @@
<script src="script.js"></script>
</body>

</html>
</html>
14 changes: 7 additions & 7 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function renderEmails() {

var emailDataTemp = filteredEmailData;

if (activePage == 'favourites') {
if (activePage == 'favorites') {
emailDataTemp = emailDataTemp.filter(x => x.isFavorite)
}

Expand All @@ -53,8 +53,8 @@ function renderEmails() {
<div class="subject" title="${email.subject}">${email.subject.substr(0, 30)} ${email.subject.length > 30 ? '...' : ''}</div>
<div class="icons">
<span ${unread ? 'class="unread" title="unread"' : ''}></span>
<a onclick="toggleFavourite(event, '${email.id}')">
<i class="mdi ${email.isFavorite ? 'mdi-star' : 'mdi-star-outline'}" title="Toggle favourite"></i>
<a onclick="toggleFavorite(event, '${email.id}')">
<i class="mdi ${email.isFavorite ? 'mdi-star' : 'mdi-star-outline'}" title="Toggle favorite"></i>
</a>
</div>
</div>
Expand Down Expand Up @@ -162,11 +162,11 @@ async function setActiveEmail(id) {
}

/**
* @desc Toggle favourite against an email to add/remove email from favourites list
* @desc Toggle favorite against an email to add/remove email from favorites list
* @param {*} e
* @param {String} id
*/
function toggleFavourite(e, id) {
function toggleFavorite(e, id) {
// To prevent event bubbling
e.stopPropagation();

Expand Down Expand Up @@ -220,7 +220,7 @@ function getEmailFromApi(id = "") {
}

/**
* @desc set active folder (Inbox, Favourites)
* @desc set active folder (Inbox, Favorites)
*/
const foldersListElement = document.querySelector('#folders > ul').children;
function setActiveFolder(ele) {
Expand Down Expand Up @@ -275,4 +275,4 @@ getEmailFromApi()
*/

utility.makeResizable({ id: 'folders', minWidth: '15%', maxWidth: '400px' })
utility.makeResizable({ id: 'emailList', minWidth: '30%', maxWidth: '550px' })
utility.makeResizable({ id: 'emailList', minWidth: '30%', maxWidth: '550px' })