Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8dc1fa0d
Commit
8dc1fa0d
authored
Jun 04, 2016
by
Fatih Acet
Committed by
Z.J. van de Weg
Jun 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated MR notes.
parent
7d3f8f54
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
22 deletions
+21
-22
app/assets/javascripts/awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+11
-13
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+2
-2
app/assets/javascripts/lib/emoji_aliases.js.coffee.erb
app/assets/javascripts/lib/emoji_aliases.js.coffee.erb
+1
-1
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+2
-2
config/routes.rb
config/routes.rb
+1
-0
spec/javascripts/awards_handler_spec.js.coffee
spec/javascripts/awards_handler_spec.js.coffee
+4
-4
No files found.
app/assets/javascripts/awards_handler.coffee
View file @
8dc1fa0d
...
...
@@ -2,7 +2,7 @@ class @AwardsHandler
constructor
:
->
@
aliases
=
emojiAliases
()
@
aliases
=
gl
.
emojiAliases
()
$
(
document
)
.
off
'click'
,
'.js-add-award'
...
...
@@ -172,7 +172,7 @@ class @AwardsHandler
decrementCounter
:
(
$emojiButton
,
emoji
)
->
counter
=
$
(
'.js-counter'
,
$emojiButton
)
counter
=
$
'.js-counter'
,
$emojiButton
counterNumber
=
parseInt
counter
.
text
(),
10
if
counterNumber
>
1
...
...
@@ -218,9 +218,7 @@ class @AwardsHandler
awardBlock
.
closest
'.js-emoji-btn'
.
removeData
'original-title'
.
removeData
'title'
.
attr
'data-original-title'
,
newAuthors
.
attr
'data-title'
,
newAuthors
@
resetTooltip
awardBlock
...
...
@@ -258,8 +256,8 @@ class @AwardsHandler
</button>"
$emojiButton
=
$
buttonHtml
emoji_node
=
$emojiButton
.
insertBefore
votesBlock
.
find
'.js-award-holder
:not(.js-award-action-btn)
'
$emojiButton
.
insertBefore
votesBlock
.
find
'.js-award-holder'
.
find
'.emoji-icon'
.
data
'emoji'
,
emoji
...
...
@@ -281,21 +279,21 @@ class @AwardsHandler
if
$
(
'.emoji-menu'
).
length
return
@
createEmoji_
votesBlock
,
emoji
@
createEmojiMenu
@
getAwardMenuUrl
(),
=>
@
createEmoji
votesBlock
,
emoji
@
createEmojiMenu
@
getAwardMenuUrl
(),
=>
@
createEmoji
_
votesBlock
,
emoji
getAwardMenuUrl
:
->
return
gl
.
awardMenuUrl
or
'/emojis'
getAwardMenuUrl
:
->
return
gl
.
awardMenuUrl
resolveNameToCssClass
:
(
emoji
)
->
emoji
_icon
=
$
(
".emoji-menu-content [data-emoji='
#{
emoji
}
']"
)
emoji
Icon
=
$
".emoji-menu-content [data-emoji='
#{
emoji
}
']"
if
emoji
_i
con
.
length
>
0
unicodeName
=
emoji
_icon
.
data
(
'unicode-name'
)
if
emoji
I
con
.
length
>
0
unicodeName
=
emoji
Icon
.
data
'unicode-name'
else
# Find by alias
unicodeName
=
$
(
".emoji-menu-content [data-aliases*=':
#{
emoji
}
:']"
).
data
(
'unicode-name'
)
unicodeName
=
$
(
".emoji-menu-content [data-aliases*=':
#{
emoji
}
:']"
).
data
'unicode-name'
return
"emoji-
#{
unicodeName
}
"
...
...
@@ -303,7 +301,7 @@ class @AwardsHandler
postEmoji
:
(
awardUrl
,
emoji
,
callback
)
->
$
.
post
awardUrl
,
{
name
:
emoji
},
(
data
)
->
callback
.
call
()
if
data
.
ok
callback
()
if
data
.
ok
findEmojiIcon
:
(
votesBlock
,
emoji
)
->
...
...
app/assets/javascripts/dispatcher.js.coffee
View file @
8dc1fa0d
...
...
@@ -23,7 +23,7 @@ class Dispatcher
new
Issue
()
shortcut_handler
=
new
ShortcutsIssuable
()
new
ZenMode
()
window
.
awardsHandler
=
new
AwardsHandler
()
gl
.
awardsHandler
=
new
AwardsHandler
()
when
'projects:milestones:show'
,
'groups:milestones:show'
,
'dashboard:milestones:show'
new
Milestone
()
when
'dashboard:todos:index'
...
...
@@ -54,7 +54,7 @@ class Dispatcher
new
Diff
()
shortcut_handler
=
new
ShortcutsIssuable
(
true
)
new
ZenMode
()
window
.
awardsHandler
=
new
AwardsHandler
()
gl
.
awardsHandler
=
new
AwardsHandler
()
when
"projects:merge_requests:diffs"
new
Diff
()
new
ZenMode
()
...
...
app/assets/javascripts/lib/emoji_aliases.js.coffee.erb
View file @
8dc1fa0d
window
.emojiAliases = ->
gl
.emojiAliases = ->
JSON.parse('
<%=
Gitlab
::
AwardEmoji
.
aliases
.
to_json
%>
')
app/assets/javascripts/notes.js.coffee
View file @
8dc1fa0d
...
...
@@ -168,8 +168,8 @@ class @Notes
if
note
.
award
votesBlock
=
$
(
'.js-awards-block'
).
eq
0
awardsHandler
.
addAwardToEmojiBar
votesBlock
,
note
.
name
awardsHandler
.
scrollToAwards
()
gl
.
awardsHandler
.
addAwardToEmojiBar
votesBlock
,
note
.
name
gl
.
awardsHandler
.
scrollToAwards
()
# render note if it not present in loaded list
# or skip if rendered
...
...
config/routes.rb
View file @
8dc1fa0d
...
...
@@ -757,6 +757,7 @@ Rails.application.routes.draw do
resources
:notes
,
only:
[
:index
,
:create
,
:destroy
,
:update
],
constraints:
{
id:
/\d+/
}
do
member
do
post
:toggle_award_emoji
delete
:delete_attachment
end
end
...
...
spec/javascripts/awards_handler_spec.js.coffee
View file @
8dc1fa0d
...
...
@@ -5,8 +5,8 @@
awardsHandler
=
null
window
.
gl
or=
{}
window
.
gl
.
awardMenuUrl
=
'/emojis'
window
.
emojiAliases
=
->
return
{
'+1'
:
'thumbsup'
,
'-1'
:
'thumbsdown'
}
gl
.
emojiAliases
=
->
return
{
'+1'
:
'thumbsup'
,
'-1'
:
'thumbsdown'
}
gl
.
awardMenuUrl
=
'/emojis'
lazyAssert
=
(
done
,
assertFn
)
->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment