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
a5daeb01
Commit
a5daeb01
authored
Oct 19, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emoticons now supported for single-user chat.
parent
546204be
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
21 deletions
+61
-21
CHANGES.rst
CHANGES.rst
+1
-1
converse.css
converse.css
+5
-0
converse.js
converse.js
+51
-19
mockup.html
mockup.html
+4
-1
No files found.
CHANGES.rst
View file @
a5daeb01
...
...
@@ -6,7 +6,7 @@ Changelog
* Add a toolbar for single user chat [jcbrand]
* Add support for OTR (off-the-record) encryption [jcbrand]
* Add smileys [jcbrand]
* Add s
upport for s
mileys [jcbrand]
* Simplified initial boilerplate markup [jcbrand]
0.6.6 (2013-10-16)
...
...
converse.css
View file @
a5daeb01
...
...
@@ -21,6 +21,11 @@
color
:
rgb
(
79
,
79
,
79
);
}
#chatpanel
.emoticon
{
font-size
:
14px
;
}
.hidden
{
display
:
none
}
...
...
converse.js
View file @
a5daeb01
...
...
@@ -70,6 +70,7 @@
this
.
prebind
=
false
;
this
.
show_controlbox_by_default
=
false
;
this
.
show_only_online_users
=
false
;
this
.
show_emoticons
=
true
;
this
.
show_toolbar
=
true
;
this
.
testing
=
false
;
// Exposes sensitive data for testing. Never set to true in production systems!
this
.
xhr_custom_status
=
false
;
...
...
@@ -93,6 +94,7 @@
'
prebind
'
,
'
rid
'
,
'
show_controlbox_by_default
'
,
'
show_emoticons
'
,
'
show_only_online_users
'
,
'
show_toolbar
'
,
'
sid
'
,
...
...
@@ -679,24 +681,25 @@
),
toolbar_template
:
_
.
template
(
'
<li class="toggle-smiley icon-happy" title="Insert a smilery">
'
+
'
<ul>
'
+
'
<li><a class="icon-smiley" href="#" data-emoticon=":)"></a></li>
'
+
'
<li><a class="icon-wink" href="#" data-emoticon=";)"></a></li>
'
+
'
<li><a class="icon-grin" href="#" data-emoticon=":D"></a></li>
'
+
'
<li><a class="icon-tongue" href="#" data-emoticon=":P"></a></li>
'
+
'
<li><a class="icon-cool" href="#" data-emoticon="8)"></a></li>
'
+
'
<li><a class="icon-evil" href="#" data-emoticon=">:)"></a></li>
'
+
'
<li><a class="icon-confused" href="#" data-emoticon=":S"></a></li>
'
+
'
<li><a class="icon-wondering" href="#" data-emoticon=":
\
"></a></li>
'
+
'
<li><a class="icon-angry" href="#" data-emoticon=">:("></a></li>
'
+
'
<li><a class="icon-sad" href="#" data-emoticon=":("></a></li>
'
+
'
<li><a class="icon-shocked" href="#" data-emoticon=":O"></a></li>
'
+
'
<li><a class="icon-thumbs-up" href="#" data-emoticon="(^.^)b"></a></li>
'
+
'
<li><a class="icon-heart" href="#" data-emoticon="<3"></a></li>
'
+
'
</ul>
'
+
'
</li>
'
+
'
{[ if (show_emoticons) { ]}
'
+
'
<li class="toggle-smiley icon-happy" title="Insert a smilery">
'
+
'
<ul>
'
+
'
<li><a class="icon-smiley" href="#" data-emoticon=":)"></a></li>
'
+
'
<li><a class="icon-wink" href="#" data-emoticon=";)"></a></li>
'
+
'
<li><a class="icon-grin" href="#" data-emoticon=":D"></a></li>
'
+
'
<li><a class="icon-tongue" href="#" data-emoticon=":P"></a></li>
'
+
'
<li><a class="icon-cool" href="#" data-emoticon="8)"></a></li>
'
+
'
<li><a class="icon-evil" href="#" data-emoticon=">:)"></a></li>
'
+
'
<li><a class="icon-confused" href="#" data-emoticon=":S"></a></li>
'
+
'
<li><a class="icon-wondering" href="#" data-emoticon=":
\
"></a></li>
'
+
'
<li><a class="icon-angry" href="#" data-emoticon=">:("></a></li>
'
+
'
<li><a class="icon-sad" href="#" data-emoticon=":("></a></li>
'
+
'
<li><a class="icon-shocked" href="#" data-emoticon=":O"></a></li>
'
+
'
<li><a class="icon-thumbs-up" href="#" data-emoticon="(^.^)b"></a></li>
'
+
'
<li><a class="icon-heart" href="#" data-emoticon="<3"></a></li>
'
+
'
</ul>
'
+
'
</li>
'
+
'
{[ } ]}
'
+
'
{[ if (allow_otr) { ]}
'
+
'
<li class="toggle-otr {{otr_status_class}}" title="{{otr_tooltip}}">
'
+
'
<span class="chat-toolbar-text">{{otr_translated_status}}</span>
'
+
...
...
@@ -783,6 +786,34 @@
this
.
scrollDown
();
},
insertEmoticons
:
function
(
text
)
{
if
(
converse
.
show_emoticons
)
{
text
=
text
.
replace
(
/:
\)
/g
,
'
<span class="emoticon icon-smiley"></span>
'
);
text
=
text
.
replace
(
/:
\-\)
/g
,
'
<span class="emoticon icon-smiley"></span>
'
);
text
=
text
.
replace
(
/;
\)
/g
,
'
<span class="emoticon icon-wink"></span>
'
);
text
=
text
.
replace
(
/;
\-\)
/g
,
'
<span class="emoticon icon-wink"></span>
'
);
text
=
text
.
replace
(
/:D/g
,
'
<span class="emoticon icon-grin"></span>
'
);
text
=
text
.
replace
(
/:
\-
D/g
,
'
<span class="emoticon icon-grin"></span>
'
);
text
=
text
.
replace
(
/:P/g
,
'
<span class="emoticon icon-tongue"></span>
'
);
text
=
text
.
replace
(
/:
\-
P/g
,
'
<span class="emoticon icon-tongue"></span>
'
);
text
=
text
.
replace
(
/:p/g
,
'
<span class="emoticon icon-tongue"></span>
'
);
text
=
text
.
replace
(
/:
\-
p/g
,
'
<span class="emoticon icon-tongue"></span>
'
);
text
=
text
.
replace
(
/8
\)
/g
,
'
<span class="emoticon icon-cool"></span>
'
);
text
=
text
.
replace
(
/>:
\)
/g
,
'
<span class="emoticon icon-evil"></span>
'
);
text
=
text
.
replace
(
/:S/g
,
'
<span class="emoticon icon-confused"></span>
'
);
text
=
text
.
replace
(
/:
\\
/g
,
'
<span class="emoticon icon-wondering"></span>
'
);
text
=
text
.
replace
(
/>:
\(
/g
,
'
<span class="emoticon icon-angry"></span>
'
);
text
=
text
.
replace
(
/:
\(
/g
,
'
<span class="emoticon icon-sad"></span>
'
);
text
=
text
.
replace
(
/:
\-\(
/g
,
'
<span class="emoticon icon-sad"></span>
'
);
text
=
text
.
replace
(
/:O/g
,
'
<span class="emoticon icon-shocked"></span>
'
);
text
=
text
.
replace
(
/:
\-
O/g
,
'
<span class="emoticon icon-shocked"></span>
'
);
text
=
text
.
replace
(
/
\=\-
O/g
,
'
<span class="emoticon icon-shocked"></span>
'
);
text
=
text
.
replace
(
/
\(\^
.
\^\)
b/g
,
'
<span class="emoticon icon-thumbs-up"></span>
'
);
text
=
text
.
replace
(
/<3/g
,
'
<span class="emoticon icon-heart"></span>
'
);
}
return
text
;
},
showMessage
:
function
(
$el
,
msg_dict
)
{
var
this_date
=
converse
.
parseISO8601
(
msg_dict
.
time
),
text
=
msg_dict
.
message
,
...
...
@@ -803,7 +834,7 @@
template
({
'
sender
'
:
sender
,
'
time
'
:
this_date
.
toTimeString
().
substring
(
0
,
5
),
'
message
'
:
t
ext
,
'
message
'
:
t
his
.
insertEmoticons
(
text
)
,
'
username
'
:
username
,
'
extra_classes
'
:
msg_dict
.
delayed
&&
'
delayed
'
||
''
}));
...
...
@@ -1143,6 +1174,7 @@
data
.
otr_tooltip
=
__
(
'
Your buddy has closed their end of the private session, you should do the same
'
);
}
data
.
allow_otr
=
converse
.
allow_otr
;
data
.
show_emoticons
=
converse
.
show_emoticons
;
data
.
otr_translated_status
=
OTR_TRANSLATED_MAPPING
[
data
.
otr_status
];
data
.
otr_status_class
=
OTR_CLASS_MAPPING
[
data
.
otr_status
];
this
.
$el
.
find
(
'
.chat-toolbar
'
).
html
(
this
.
toolbar_template
(
data
));
...
...
mockup.html
View file @
a5daeb01
...
...
@@ -208,7 +208,10 @@
<div
class=
"chat-error"
>
This is an error message
</div>
<div
class=
"chat-message"
>
<span
class=
"chat-message-me"
>
09:35 me:
</span>
<span
class=
"chat-message-content"
>
Hello world
</span>
<span
class=
"chat-message-content"
>
Hello world
<span
class=
"icon-smiley"
></span>
</span>
</div>
<div
class=
"chat-message "
>
<span
class=
"chat-message-them"
>
19:25 Benedict-John:
</span>
...
...
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