OSDN Git Service
(root)
/
wvm
/
gitlab.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3efcf7
)
add auto-completion for +1, -1 emoji
author
Nihad Abbasov
<narkoz.2008@gmail.com>
Tue, 25 Sep 2012 11:56:21 +0000
(
04:56
-0700)
committer
Nihad Abbasov
<narkoz.2008@gmail.com>
Tue, 25 Sep 2012 11:56:21 +0000
(
04:56
-0700)
app/views/notes/_common_form.html.haml
patch
|
blob
|
history
diff --git
a/app/views/notes/_common_form.html.haml
b/app/views/notes/_common_form.html.haml
index
f91e921
..
626a448
100644
(file)
--- a/
app/views/notes/_common_form.html.haml
+++ b/
app/views/notes/_common_form.html.haml
@@
-39,6
+39,12
@@
:javascript
$(function(){
- var names = #{@project.users.pluck(:name)};
- $('.note-text').atWho('@', { data: names });
+ var names = #{@project.users.pluck(:name)}, emoji = ['+1', '-1'];
+ var emoji = $.map(emoji, function(value, i) {return {key:value + ':', name:value}});
+ $('#note_note').
+ atWho('@', { data: names }).
+ atWho(':', {
+ data: emoji,
+ tpl: "<li data-value='${key}'>${name} #{escape_javascript image_tag('emoji/${name}.png', :size => '20x20')}</li>"
+ });
});