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
5406df1b
Commit
5406df1b
authored
Jan 31, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an animated spinner when generating a private key.
parent
8232cdaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
19 deletions
+27
-19
converse.css
converse.css
+1
-1
converse.js
converse.js
+26
-18
No files found.
converse.css
View file @
5406df1b
...
...
@@ -333,7 +333,6 @@ you can use the generic selector below, but it's slower:
span
.spinner
{
background
:
url(images/spinner.gif)
no-repeat
center
;
width
:
22px
;
height
:
22px
;
padding
:
0
2px
0
2px
;
display
:
block
;
...
...
@@ -1166,6 +1165,7 @@ ul.chat-toolbar li {
list-style
:
none
;
padding
:
0
3px
0
3px
;
cursor
:
pointer
;
margin-top
:
1px
;
}
ul
.chat-toolbar
li
:hover
{
...
...
converse.js
View file @
5406df1b
...
...
@@ -554,8 +554,12 @@
// We need to generate a new key and instance tag
instance_tag
=
OTR
.
makeInstanceTag
();
this
.
trigger
(
'
showHelpMessages
'
,
[
__
(
'
Generating private key.
'
)]);
this
.
trigger
(
'
showHelpMessages
'
,
[
__
(
'
Your browser might become unresponsive.
'
)]);
this
.
trigger
(
'
showHelpMessages
'
,
[
__
(
'
Generating private key.
'
),
__
(
'
Your browser might become unresponsive.
'
)],
null
,
true
// show spinner
);
var
clb
=
callback
;
setTimeout
(
$
.
proxy
(
function
()
{
...
...
@@ -568,7 +572,7 @@
window
.
sessionStorage
[
hex_sha1
(
this
.
id
+
'
instance_tag
'
)]
=
instance_tag
;
this
.
save
({
'
pass_check
'
:
cipher
.
encrypt
(
CryptoJS
.
algo
.
AES
,
'
match
'
,
pass
).
toString
()});
}
this
.
trigger
(
'
showHelpMessages
'
,
[
__
(
'
Private key generated.
'
)]);
this
.
trigger
(
'
showHelpMessages
'
,
[
__
(
'
Private key generated.
'
)]
,
null
,
false
);
clb
({
'
key
'
:
key
,
'
instance_tag
'
:
instance_tag
...
...
@@ -712,23 +716,22 @@
if
((
!
text
)
||
(
!
converse
.
allow_otr
))
{
return
this
.
createMessage
(
message
);
}
if
(
_
.
contains
([
UNVERIFIED
,
VERIFIED
],
this
.
get
(
'
otr_status
'
)))
{
if
(
text
.
match
(
/^
\?
OTRv23
?
/
))
{
this
.
initiateOTR
(
text
);
}
else
{
this
.
otr
.
receiveMsg
(
text
);
}
if
(
text
.
match
(
/^
\?
OTRv23
?
/
))
{
this
.
initiateOTR
(
text
);
}
else
{
if
(
text
.
match
(
/^
\?
OTR/
))
{
// They want to initiate OTR
if
(
!
this
.
otr
)
{
this
.
initiateOTR
(
text
);
if
(
_
.
contains
([
UNVERIFIED
,
VERIFIED
],
this
.
get
(
'
otr_status
'
)))
{
this
.
otr
.
receiveMsg
(
text
);
}
else
{
if
(
text
.
match
(
/^
\?
OTR/
))
{
if
(
!
this
.
otr
)
{
this
.
initiateOTR
(
text
);
}
else
{
this
.
otr
.
receiveMsg
(
text
);
}
}
else
{
this
.
otr
.
receiveMsg
(
text
);
// Normal unencrypted message.
this
.
createMessage
(
message
);
}
}
else
{
// Normal unencrypted message.
this
.
createMessage
(
message
);
}
}
}
...
...
@@ -960,12 +963,17 @@
return
this
.
scrollDown
();
},
showHelpMessages
:
function
(
msgs
,
type
)
{
showHelpMessages
:
function
(
msgs
,
type
,
spinner
)
{
var
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
),
i
,
msgs_length
=
msgs
.
length
;
for
(
i
=
0
;
i
<
msgs_length
;
i
++
)
{
$chat_content
.
append
(
$
(
'
<div class="chat-
'
+
(
type
||
'
info
'
)
+
'
">
'
+
msgs
[
i
]
+
'
</div>
'
));
}
if
(
spinner
===
true
)
{
$chat_content
.
append
(
'
<span class="spinner"/>
'
);
}
else
if
(
spinner
===
false
)
{
$chat_content
.
find
(
'
span.spinner
'
).
remove
();
}
return
this
.
scrollDown
();
},
...
...
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