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
6b88513f
Commit
6b88513f
authored
Nov 15, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move render method below initialize
parent
d0073394
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
48 deletions
+48
-48
converse.js
converse.js
+48
-48
No files found.
converse.js
View file @
6b88513f
...
@@ -3326,54 +3326,6 @@
...
@@ -3326,54 +3326,6 @@
this
.
model
.
on
(
"
open
"
,
this
.
openChat
,
this
);
this
.
model
.
on
(
"
open
"
,
this
.
openChat
,
this
);
},
},
openChat
:
function
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
// XXX: Can this.model.attributes be used here, instead of
// manually specifying all attributes?
return
converse
.
chatboxviews
.
showChat
({
'
id
'
:
this
.
model
.
get
(
'
jid
'
),
'
jid
'
:
this
.
model
.
get
(
'
jid
'
),
'
fullname
'
:
this
.
model
.
get
(
'
fullname
'
),
'
image_type
'
:
this
.
model
.
get
(
'
image_type
'
),
'
image
'
:
this
.
model
.
get
(
'
image
'
),
'
url
'
:
this
.
model
.
get
(
'
url
'
),
'
status
'
:
this
.
model
.
get
(
'
status
'
)
});
},
removeContact
:
function
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
result
=
confirm
(
__
(
"
Are you sure you want to remove this contact?
"
));
if
(
result
===
true
)
{
var
bare_jid
=
this
.
model
.
get
(
'
jid
'
);
converse
.
connection
.
roster
.
remove
(
bare_jid
,
$
.
proxy
(
function
(
iq
)
{
converse
.
connection
.
roster
.
unauthorize
(
bare_jid
);
converse
.
rosterview
.
model
.
remove
(
bare_jid
);
this
.
model
.
destroy
();
this
.
remove
();
},
this
));
}
},
acceptRequest
:
function
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
jid
=
this
.
model
.
get
(
'
jid
'
);
converse
.
connection
.
roster
.
authorize
(
jid
);
converse
.
connection
.
roster
.
add
(
jid
,
this
.
model
.
get
(
'
fullname
'
),
[],
function
(
iq
)
{
converse
.
connection
.
roster
.
subscribe
(
jid
,
null
,
converse
.
xmppstatus
.
get
(
'
fullname
'
));
});
},
declineRequest
:
function
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
result
=
confirm
(
__
(
"
Are you sure you want to decline this contact request?
"
));
if
(
result
===
true
)
{
converse
.
connection
.
roster
.
unauthorize
(
this
.
model
.
get
(
'
jid
'
));
this
.
model
.
destroy
();
}
return
this
;
},
render
:
function
()
{
render
:
function
()
{
if
(
!
this
.
model
.
showInRoster
())
{
if
(
!
this
.
model
.
showInRoster
())
{
this
.
$el
.
hide
();
this
.
$el
.
hide
();
...
@@ -3439,6 +3391,54 @@
...
@@ -3439,6 +3391,54 @@
));
));
}
}
return
this
;
return
this
;
},
openChat
:
function
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
// XXX: Can this.model.attributes be used here, instead of
// manually specifying all attributes?
return
converse
.
chatboxviews
.
showChat
({
'
id
'
:
this
.
model
.
get
(
'
jid
'
),
'
jid
'
:
this
.
model
.
get
(
'
jid
'
),
'
fullname
'
:
this
.
model
.
get
(
'
fullname
'
),
'
image_type
'
:
this
.
model
.
get
(
'
image_type
'
),
'
image
'
:
this
.
model
.
get
(
'
image
'
),
'
url
'
:
this
.
model
.
get
(
'
url
'
),
'
status
'
:
this
.
model
.
get
(
'
status
'
)
});
},
removeContact
:
function
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
result
=
confirm
(
__
(
"
Are you sure you want to remove this contact?
"
));
if
(
result
===
true
)
{
var
bare_jid
=
this
.
model
.
get
(
'
jid
'
);
converse
.
connection
.
roster
.
remove
(
bare_jid
,
$
.
proxy
(
function
(
iq
)
{
converse
.
connection
.
roster
.
unauthorize
(
bare_jid
);
converse
.
rosterview
.
model
.
remove
(
bare_jid
);
this
.
model
.
destroy
();
this
.
remove
();
},
this
));
}
},
acceptRequest
:
function
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
jid
=
this
.
model
.
get
(
'
jid
'
);
converse
.
connection
.
roster
.
authorize
(
jid
);
converse
.
connection
.
roster
.
add
(
jid
,
this
.
model
.
get
(
'
fullname
'
),
[],
function
(
iq
)
{
converse
.
connection
.
roster
.
subscribe
(
jid
,
null
,
converse
.
xmppstatus
.
get
(
'
fullname
'
));
});
},
declineRequest
:
function
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
result
=
confirm
(
__
(
"
Are you sure you want to decline this contact request?
"
));
if
(
result
===
true
)
{
converse
.
connection
.
roster
.
unauthorize
(
this
.
model
.
get
(
'
jid
'
));
this
.
model
.
destroy
();
}
return
this
;
}
}
});
});
...
...
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