Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
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
0
Merge Requests
0
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
converse.js
Commits
ffdd4e25
Commit
ffdd4e25
authored
Jul 16, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
emoji: remember category and skin tone selection
parent
8c4f6ffe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
src/converse-chatview.js
src/converse-chatview.js
+21
-8
src/converse-muc.js
src/converse-muc.js
+1
-2
No files found.
src/converse-chatview.js
View file @
ffdd4e25
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
tpl_spinner
tpl_spinner
)
{
)
{
"
use strict
"
;
"
use strict
"
;
const
{
$msg
,
Backbone
,
Strophe
,
_
,
moment
,
utils
}
=
converse
.
env
;
const
{
$msg
,
Backbone
,
Strophe
,
_
,
b64_sha1
,
moment
,
utils
}
=
converse
.
env
;
const
KEY
=
{
const
KEY
=
{
ENTER
:
13
,
ENTER
:
13
,
...
@@ -119,6 +119,11 @@
...
@@ -119,6 +119,11 @@
'
current_category
'
:
'
people
'
,
'
current_category
'
:
'
people
'
,
'
current_skintone
'
:
''
,
'
current_skintone
'
:
''
,
'
scroll_position
'
:
0
'
scroll_position
'
:
0
},
initialize
()
{
const
id
=
`converse.emoji-
${
_converse
.
bare_jid
}
`
;
this
.
id
=
id
;
this
.
browserStorage
=
new
Backbone
.
BrowserStorage
[
_converse
.
storage
](
id
);
}
}
});
});
...
@@ -185,7 +190,7 @@
...
@@ -185,7 +190,7 @@
},
},
setScrollPosition
(
ev
,
position
)
{
setScrollPosition
(
ev
,
position
)
{
this
.
model
.
s
et
(
'
scroll_position
'
,
ev
.
target
.
scrollTop
);
this
.
model
.
s
ave
(
'
scroll_position
'
,
ev
.
target
.
scrollTop
);
},
},
chooseSkinTone
(
ev
)
{
chooseSkinTone
(
ev
)
{
...
@@ -195,9 +200,9 @@
...
@@ -195,9 +200,9 @@
ev
.
target
.
parentElement
:
ev
.
target
;
ev
.
target
.
parentElement
:
ev
.
target
;
const
skintone
=
target
.
getAttribute
(
"
data-skintone
"
).
trim
();
const
skintone
=
target
.
getAttribute
(
"
data-skintone
"
).
trim
();
if
(
this
.
model
.
get
(
'
current_skintone
'
)
===
skintone
)
{
if
(
this
.
model
.
get
(
'
current_skintone
'
)
===
skintone
)
{
this
.
model
.
s
et
({
'
current_skintone
'
:
''
});
this
.
model
.
s
ave
({
'
current_skintone
'
:
''
});
}
else
{
}
else
{
this
.
model
.
s
et
({
'
current_skintone
'
:
skintone
});
this
.
model
.
s
ave
({
'
current_skintone
'
:
skintone
});
}
}
},
},
...
@@ -207,7 +212,7 @@
...
@@ -207,7 +212,7 @@
const
target
=
ev
.
target
.
nodeName
===
'
IMG
'
?
const
target
=
ev
.
target
.
nodeName
===
'
IMG
'
?
ev
.
target
.
parentElement
:
ev
.
target
;
ev
.
target
.
parentElement
:
ev
.
target
;
const
category
=
target
.
getAttribute
(
"
data-category
"
).
trim
();
const
category
=
target
.
getAttribute
(
"
data-category
"
).
trim
();
this
.
model
.
s
et
({
this
.
model
.
s
ave
({
'
current_category
'
:
category
,
'
current_category
'
:
category
,
'
scroll_position
'
:
0
'
scroll_position
'
:
0
});
});
...
@@ -232,9 +237,7 @@
...
@@ -232,9 +237,7 @@
},
},
initialize
()
{
initialize
()
{
this
.
emoji_picker_view
=
new
_converse
.
EmojiPickerView
({
this
.
createEmojiPicker
();
'
model
'
:
new
_converse
.
EmojiPicker
()
});
this
.
model
.
messages
.
on
(
'
add
'
,
this
.
onMessageAdded
,
this
);
this
.
model
.
messages
.
on
(
'
add
'
,
this
.
onMessageAdded
,
this
);
this
.
model
.
on
(
'
show
'
,
this
.
show
,
this
);
this
.
model
.
on
(
'
show
'
,
this
.
show
,
this
);
this
.
model
.
on
(
'
destroy
'
,
this
.
hide
,
this
);
this
.
model
.
on
(
'
destroy
'
,
this
.
hide
,
this
);
...
@@ -272,6 +275,16 @@
...
@@ -272,6 +275,16 @@
return
this
.
showStatusMessage
();
return
this
.
showStatusMessage
();
},
},
createEmojiPicker
()
{
if
(
_
.
isUndefined
(
_converse
.
emojipicker
))
{
_converse
.
emojipicker
=
new
_converse
.
EmojiPicker
();
_converse
.
emojipicker
.
fetch
();
}
this
.
emoji_picker_view
=
new
_converse
.
EmojiPickerView
({
'
model
'
:
_converse
.
emojipicker
});
},
afterMessagesFetched
()
{
afterMessagesFetched
()
{
this
.
insertIntoDOM
();
this
.
insertIntoDOM
();
this
.
scrollDown
();
this
.
scrollDown
();
...
...
src/converse-muc.js
View file @
ffdd4e25
...
@@ -443,8 +443,7 @@
...
@@ -443,8 +443,7 @@
this
.
model
.
on
(
'
change:description
'
,
this
.
renderHeading
,
this
);
this
.
model
.
on
(
'
change:description
'
,
this
.
renderHeading
,
this
);
this
.
model
.
on
(
'
change:name
'
,
this
.
renderHeading
,
this
);
this
.
model
.
on
(
'
change:name
'
,
this
.
renderHeading
,
this
);
this
.
emoji_picker_view
=
new
_converse
.
EmojiPickerView
({
model
:
new
_converse
.
EmojiPicker
()
});
this
.
createEmojiPicker
();
this
.
createOccupantsView
();
this
.
createOccupantsView
();
this
.
render
().
insertIntoDOM
();
this
.
render
().
insertIntoDOM
();
this
.
registerHandlers
();
this
.
registerHandlers
();
...
...
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