Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
f949753b
Commit
f949753b
authored
9 years ago
by
Rodrigo Nascimento
Browse files
Options
Downloads
Patches
Plain Diff
Add upload preview
parent
e2d27b50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/stylesheets/base.less
+12
-0
12 additions, 0 deletions
client/stylesheets/base.less
client/views/avatar/avatar.coffee
+7
-2
7 additions, 2 deletions
client/views/avatar/avatar.coffee
client/views/avatar/avatar.html
+12
-1
12 additions, 1 deletion
client/views/avatar/avatar.html
with
31 additions
and
3 deletions
client/stylesheets/base.less
+
12
−
0
View file @
f949753b
...
...
@@ -2691,6 +2691,18 @@ a.github-fork {
display: inline-block;
top: -33px;
}
input[type=file] {
position: absolute !important;
width: 100%;
top: 0;
left: 0;
height: 100%;
opacity: 0;
z-index: 10000;
* {
cursor: pointer;
}
}
}
@media all and(max-width: 1100px) {
...
...
This diff is collapsed.
Click to expand it.
client/views/avatar/avatar.coffee
+
7
−
2
View file @
f949753b
Template
.
avatarPrompt
.
onCreated
->
self
=
this
self
.
suggestions
=
new
ReactiveVar
self
.
upload
=
new
ReactiveVar
Meteor
.
call
'getAvatarSuggestion'
,
(
error
,
avatars
)
->
self
.
suggestions
.
set
...
...
@@ -12,6 +13,9 @@ Template.avatarPrompt.helpers
suggestions
:
->
return
Template
.
instance
().
suggestions
.
get
()
upload
:
->
return
Template
.
instance
().
upload
.
get
()
Template
.
avatarPrompt
.
events
'click .select-service'
:
(
e
)
->
...
...
@@ -23,5 +27,6 @@ Template.avatarPrompt.events
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
blob
)
reader
.
onloadend
=
->
Meteor
.
call
'setAvatarFromService'
,
reader
.
result
,
'upload'
,
->
console
.
log
arguments
\ No newline at end of file
template
.
upload
.
set
service
:
'upload'
blob
:
reader
.
result
This diff is collapsed.
Click to expand it.
client/views/avatar/avatar.html
+
12
−
1
View file @
f949753b
...
...
@@ -46,7 +46,18 @@
{{> avatarSuggestionLogin 'github'}}
{{/unless}}
<input
type=
"file"
class=
"myFileInput"
>
<div
class=
"avatar-suggestion-item"
>
<div
style=
"background-image: url({{upload.blob}});"
>
</div>
{{#with upload}}
<button
type=
"button"
class=
"button primary select-service"
>
Use uploaded avatar
</button>
{{/with}}
{{#unless upload}}
<button
type=
"button"
class=
"button primary"
>
Select file
<input
type=
"file"
class=
"myFileInput"
>
</button>
{{/unless}}
</div>
{{else}}
{{_ "usernameRegistration.Loading_suggestion"}}
{{/if}}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment