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

Threads controller UI and removing attachments #28

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
258e5a0
Merge remote-tracking branch 'e2email-org/master'
KamilaHasanbega Jun 24, 2016
bf409ca
Merge remote-tracking branch 'e2email-org/master'
KamilaHasanbega Jun 27, 2016
70904c4
Adding introductory pages
KamilaHasanbega Jul 12, 2016
fee5805
fixed the identation and comments issues
Jul 13, 2016
f62b388
Fixed the lint for the files and changed the css.
Jul 14, 2016
6a7d37d
Merge remote-tracking branch 'e2email-org/master'
KamilaHasanbega Jul 15, 2016
c2bce03
Authorization and design
KamilaHasanbega Jul 19, 2016
4b7ea4f
fixed the formatting for the authorization page commit
Jul 19, 2016
396dc4e
fixed according to the comments
Aug 8, 2016
d32c9e5
fixed the karma tests for secretcode input
Aug 8, 2016
0fc3788
Corrected linter and fixed getEmailAddress method
Aug 9, 2016
8e443e6
made possible encryption and sending of attachments
Aug 10, 2016
927c798
merged files with master
Aug 15, 2016
49b23b7
changed css
Aug 15, 2016
3d173ea
Added the file-upload directive
Aug 15, 2016
cce3d60
Merge branch 'master' of https://github.com/e2email-org/e2email
Aug 17, 2016
5eef612
changed messages page to support reply with attachments and it's tests
Aug 17, 2016
163687c
fixed merge conflicts
Aug 17, 2016
b94d025
Delete fileupload-directive.js
KamilaHasanbega Aug 17, 2016
2e78137
fixed css
Aug 17, 2016
7aaddd2
fixed css
Aug 17, 2016
c238259
fixed css
Aug 17, 2016
167b8b1
The file did not belong to this branch Merge branch 'show-attachments…
Aug 17, 2016
b66dce2
Merge branch 'show-attachments' of https://github.com/KamilaHasanbega…
Aug 17, 2016
75bbc71
removing not needed css
Aug 17, 2016
e8e9031
fixing merging details
Aug 17, 2016
4048749
added the typedef according to comments
Aug 17, 2016
48ed7a8
added the typedef according to comments
Aug 17, 2016
9de1f24
added more descriptions
Aug 17, 2016
f6ae85e
fixed styling according to comments
Aug 17, 2016
ca5350b
fixed the hovering-over-cursor bug
Aug 17, 2016
76e22aa
made the attach button responsive
Aug 18, 2016
3dcec24
changed linting
Aug 18, 2016
d48ad79
fixed typos and fixed the download tags
Aug 22, 2016
2071b8a
fixed linting
Aug 22, 2016
6a96d34
changed UI for attachments and added caceling attachments feature
Aug 23, 2016
c60c039
fixed the UI of threads and added the remove-attachments feature
Aug 24, 2016
30881f1
fixed css
Aug 24, 2016
ccc91c0
removed files form another CL
Aug 24, 2016
38444f1
removed purposeless-css and fixed UI for attachment img
Aug 24, 2016
a6ef384
removed purposeless css
Aug 24, 2016
e7ac26a
deleting attachments by index and removed unnecessary html
Aug 25, 2016
0add0a6
fixed css
Aug 25, 2016
f013f4c
moved inline css
Aug 25, 2016
7e059b9
fixed missing bracket
Aug 25, 2016
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
61 changes: 61 additions & 0 deletions chrome/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,67 @@ div.big-icon > img {
cursor: pointer;
}

.attach-icon {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are attachment-specific definitions needed in app.css? Do they need to be shared across pages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS for the attachment icon and attachment input/display is in two pages: Threads.html and Messages.html, I put it on app.css not to have repetitive code.

margin-top: 13px;
}

.attach-icon:hover {
fill: #66afe9;
}

.sidebtn {
width: 70px;
height: 30px;
font-size: 12px;
}

.single-attachment {
background-color: #f5f5f5;
border: 1px solid #dcdcdc;
font-weight: bold;
font-size: 13px;
margin: 0 7px 6px;
color: #1155CC !important;
text-align: left;
padding: 2px 6px;
max-width: 448px;
width: 80%;
height: 23px;
display: flex;
}

#textareaSpace {
min-height: 250px;
max-height: 500px;
overflow: auto;
background-color: white;
}

#textareaElement {
flex;flex-direction: column;
min-height: 250px;
text-align: left;
border: none;
background-color: white;
outline: none;
resize: none;
margin-bottom: 0px;
}

#attachmentRepeat {
background-color: white;
min-height: 20px;
padding-top: 10px;
display: flex;
flex-direction: column;
}

.removeAttachment {
border: none;
font-size: 13px;
color: gray;
background-color: inherit;
margin: 0 !important;
padding: 0;
float: right;
}
12 changes: 11 additions & 1 deletion chrome/pages/threads/threads-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ e2email.pages.threads.ThreadsCtrl = function(
* invalidRecipient: ?string,
* subject: ?string,
* message: ?string,
* attachments: Array<Object>
* attachments: Array<e2email.models.mail.Attachment>
* }}
*/
e2email.pages.threads.ThreadsCtrl.Compose;
Expand Down Expand Up @@ -478,6 +478,16 @@ ThreadsCtrl.prototype.onFileUpload = function(name, type, contents, size) {
};


/**
* Removes the attachment object from the list of attachments.
* @param {number} index The index of the file.
* @export
*/
ThreadsCtrl.prototype.removeObj = function(index) {
this.compose.attachments.splice(index, 1);
};


/**
* Requests the contents of the compose model to be delivered.
* @export
Expand Down
24 changes: 24 additions & 0 deletions chrome/pages/threads/threads.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,27 @@ input.email-select[type="checkbox"]:checked + label.email-select > span {
.email-no-threads {
margin-top: 1em;
}

.composebtn {
width: 100px;
height: 35px;
font-size: 15px;
padding: 0px;
}

.compose-content {
max-height: 700px;
overflow: auto;
}

#attachName {
margin: 0px;
padding:0px;
overflow-y: hidden;
width: 60%;
}

#attachSize {
width:30%;
overflow-y: hidden;
}
21 changes: 14 additions & 7 deletions chrome/pages/threads/threads.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,28 @@
</div>

<input tabindex="2" type="text" class="form-control ac-tabbable email-main-subject-input" placeholder="Subject" required="required" ng-hide="threadsCtrl.compose.missingRecipient" ng-model="threadsCtrl.compose.subject" ng-keypress="threadsCtrl.onSubjectKeyPress($event)"/>
<div class="compose-content">
<div tabindex="3" id="textareaSpace">
<textarea id="textareaElement" class="form-control email-main-compose-textarea" placeholder="{{threadsCtrl.compose.validRecipient ? 'typeMessagePlaceholder' : 'invalidRecipientPlaceholder' | translate}}" rows="10" ng-disabled="!threadsCtrl.compose.validRecipient" ng-model="threadsCtrl.compose.message" ng-hide="threadsCtrl.compose.missingRecipient" required="required">
</textarea>
</textarea> </div>
<div id="attachmentRepeat">
<div ng-repeat="x in threadsCtrl.compose.attachments" class="single-attachment">{{x.filename + ' (' + x.size + 'K)'}}</div>
</div>
<div ng-repeat="x in threadsCtrl.compose.attachments" class="single-attachment"><span id="attachName">{{ x.filename | limitTo: 20 }}{{x.filename.length > 20 ? '...' : ''}} </span> <span id="attachSize"> {{'(' + x.size + ')'}} </span> <span style="width:10%;">
<button ng-click="threadsCtrl.removeObj($index)" class="removeAttachment"> x </button> </span></div>
</div>
<div class="row email-main-compose-form-button-row" ng-hide="threadsCtrl.compose.missingRecipient">
</div>
<div class="row email-main-compose-form-button-row">
<div class="col-xs-12">
<button tabindex="4" type="submit" class="col-xs-3 btn btn-primary btn-focus sidebtn">{{'send' | translate}}</button>
<button tabindex="5" ng-click="threadsCtrl.showCompose(false)" class="btn btn-link btn-focus sidebtn">{{'cancel' | translate}}</button>
<img tabindex="6" src="assets/img/attach.png" class="attach-img" as-upload="threadsCtrl.onFileUpload(name, type, contents, size)"/>
<button tabindex="5" ng-click="threadsCtrl.showCompose(false)" class="btn btn-link btn-focus sidebtn pull-left">{{'cancel' | translate}}</button>
<span tabindex="6" class="attach-img" as-upload="threadsCtrl.onFileUpload(name, type, contents, size)">
<svg class="attach-icon" xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#757575">
<path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>
</span>
</div>
</div>
</form>
</form>

<ul class="list-unstyled">
<li class="email-subject-entry btn-focus" ng-repeat="thread in threadsCtrl.threads|orderBy:'-updated'" ng-click="threadsCtrl.showMessages(thread.id)">
Expand Down