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
8e18d736
Commit
8e18d736
authored
Mar 19, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed indentation of comments
parent
fa69bb1b
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
231 additions
and
232 deletions
+231
-232
src/converse-chatview.js
src/converse-chatview.js
+66
-66
src/converse-controlbox.js
src/converse-controlbox.js
+2
-2
src/converse-mam.js
src/converse-mam.js
+17
-18
src/converse-minimize.js
src/converse-minimize.js
+6
-6
src/converse-muc.js
src/converse-muc.js
+56
-56
src/converse-register.js
src/converse-register.js
+45
-45
src/converse-rosterview.js
src/converse-rosterview.js
+39
-39
No files found.
src/converse-chatview.js
View file @
8e18d736
This diff is collapsed.
Click to expand it.
src/converse-controlbox.js
View file @
8e18d736
...
...
@@ -247,8 +247,8 @@
initRoster
:
function
()
{
/* We initialize the roster, which will appear inside the
* Contacts Panel.
*/
* Contacts Panel.
*/
var
rostergroups
=
new
converse
.
RosterGroups
();
rostergroups
.
browserStorage
=
new
Backbone
.
BrowserStorage
[
converse
.
storage
](
b64_sha1
(
'
converse.roster.groups
'
+
converse
.
bare_jid
));
...
...
src/converse-mam.js
View file @
8e18d736
...
...
@@ -61,7 +61,6 @@
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
this
.
updateSettings
({
archived_messages_page_size
:
'
20
'
,
message_archiving
:
'
never
'
,
// Supported values are 'always', 'never', 'roster' (https://xmpp.org/extensions/xep-0313.html#prefs)
...
...
@@ -70,22 +69,22 @@
converse
.
queryForArchivedMessages
=
function
(
options
,
callback
,
errback
)
{
/* Do a MAM (XEP-0313) query for archived messages.
*
* Parameters:
* (Object) options - Query parameters, either MAM-specific or also for Result Set Management.
* (Function) callback - A function to call whenever we receive query-relevant stanza.
* (Function) errback - A function to call when an error stanza is received.
*
* The options parameter can also be an instance of
* Strophe.RSM to enable easy querying between results pages.
*
* The callback function may be called multiple times, first
* for the initial IQ result and then for each message
* returned. The last time the callback is called, a
* Strophe.RSM object is returned on which "next" or "previous"
* can be called before passing it in again to this method, to
* get the next or previous page in the result set.
*/
*
* Parameters:
* (Object) options - Query parameters, either MAM-specific or also for Result Set Management.
* (Function) callback - A function to call whenever we receive query-relevant stanza.
* (Function) errback - A function to call when an error stanza is received.
*
* The options parameter can also be an instance of
* Strophe.RSM to enable easy querying between results pages.
*
* The callback function may be called multiple times, first
* for the initial IQ result and then for each message
* returned. The last time the callback is called, a
* Strophe.RSM object is returned on which "next" or "previous"
* can be called before passing it in again to this method, to
* get the next or previous page in the result set.
*/
var
date
,
messages
=
[];
if
(
typeof
options
===
"
function
"
)
{
callback
=
options
;
...
...
@@ -153,7 +152,7 @@
_
.
extend
(
converse_api
,
{
/* Extend default converse.js API to add methods specific to MAM
*/
*/
'
archive
'
:
{
'
query
'
:
converse
.
queryForArchivedMessages
.
bind
(
converse
)
}
...
...
src/converse-minimize.js
View file @
8e18d736
...
...
@@ -125,12 +125,12 @@
trimChats
:
function
(
newchat
)
{
/* This method is called when a newly created chat box will
* be shown.
*
* It checks whether there is enough space on the page to show
* another chat box. Otherwise it minimizes the oldest chat box
* to create space.
*/
* be shown.
*
* It checks whether there is enough space on the page to show
* another chat box. Otherwise it minimizes the oldest chat box
* to create space.
*/
if
(
converse
.
no_trimming
||
(
this
.
model
.
length
<=
1
))
{
return
;
}
...
...
src/converse-muc.js
View file @
8e18d736
This diff is collapsed.
Click to expand it.
src/converse-register.js
View file @
8e18d736
...
...
@@ -120,8 +120,8 @@
registerHooks
:
function
()
{
/* Hook into Strophe's _connect_cb, so that we can send an IQ
* requesting the registration fields.
*/
* requesting the registration fields.
*/
var
conn
=
converse
.
connection
;
var
connect_cb
=
conn
.
_connect_cb
.
bind
(
conn
);
conn
.
_connect_cb
=
function
(
req
,
callback
,
raw
)
{
...
...
@@ -137,11 +137,11 @@
getRegistrationFields
:
function
(
req
,
_callback
,
raw
)
{
/* Send an IQ stanza to the XMPP server asking for the
* registration fields.
* Parameters:
* (Strophe.Request) req - The current request
* (Function) callback
*/
* registration fields.
* Parameters:
* (Strophe.Request) req - The current request
* (Function) callback
*/
converse
.
log
(
"
sendQueryStanza was called
"
);
var
conn
=
converse
.
connection
;
conn
.
connected
=
true
;
...
...
@@ -172,10 +172,10 @@
onRegistrationFields
:
function
(
stanza
)
{
/* Handler for Registration Fields Request.
*
* Parameters:
* (XMLElement) elem - The query stanza.
*/
*
* Parameters:
* (XMLElement) elem - The query stanza.
*/
if
(
stanza
.
getElementsByTagName
(
"
query
"
).
length
!==
1
)
{
converse
.
connection
.
_changeConnectStatus
(
Strophe
.
Status
.
REGIFAIL
,
"
unknown
"
);
return
false
;
...
...
@@ -204,11 +204,11 @@
onProviderChosen
:
function
(
ev
)
{
/* Callback method that gets called when the user has chosen an
* XMPP provider.
*
* Parameters:
* (Submit Event) ev - Form submission event.
*/
* XMPP provider.
*
* Parameters:
* (Submit Event) ev - Form submission event.
*/
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
$form
=
$
(
ev
.
target
),
$domain_input
=
$form
.
find
(
'
input[name=domain]
'
),
...
...
@@ -287,11 +287,11 @@
renderRegistrationForm
:
function
(
stanza
)
{
/* Renders the registration form based on the XForm fields
* received from the XMPP server.
*
* Parameters:
* (XMLElement) stanza - The IQ stanza received from the XMPP server.
*/
* received from the XMPP server.
*
* Parameters:
* (XMLElement) stanza - The IQ stanza received from the XMPP server.
*/
var
$form
=
this
.
$
(
'
form
'
),
$stanza
=
$
(
stanza
),
$fields
,
$input
;
...
...
@@ -344,12 +344,12 @@
reportErrors
:
function
(
stanza
)
{
/* Report back to the user any error messages received from the
* XMPP server after attempted registration.
*
* Parameters:
* (XMLElement) stanza - The IQ stanza received from the
* XMPP server.
*/
* XMPP server after attempted registration.
*
* Parameters:
* (XMLElement) stanza - The IQ stanza received from the
* XMPP server.
*/
var
$form
=
this
.
$
(
'
form
'
),
flash
;
var
$errmsgs
=
$
(
stanza
).
find
(
'
error text
'
);
var
$flash
=
$form
.
find
(
'
.form-errors
'
);
...
...
@@ -377,7 +377,7 @@
cancelRegistration
:
function
(
ev
)
{
/* Handler, when the user cancels the registration form.
*/
*/
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
converse
.
connection
.
reset
();
this
.
render
();
...
...
@@ -385,12 +385,12 @@
submitRegistrationForm
:
function
(
ev
)
{
/* Handler, when the user submits the registration form.
* Provides form error feedback or starts the registration
* process.
*
* Parameters:
* (Event) ev - the submit event.
*/
* Provides form error feedback or starts the registration
* process.
*
* Parameters:
* (Event) ev - the submit event.
*/
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
$empty_inputs
=
this
.
$
(
'
input.required:emptyVal
'
);
if
(
$empty_inputs
.
length
)
{
...
...
@@ -418,11 +418,11 @@
setFields
:
function
(
stanza
)
{
/* Stores the values that will be sent to the XMPP server
* during attempted registration.
*
* Parameters:
* (XMLElement) stanza - the IQ stanza that will be sent to the XMPP server.
*/
* during attempted registration.
*
* Parameters:
* (XMLElement) stanza - the IQ stanza that will be sent to the XMPP server.
*/
var
$query
=
$
(
stanza
).
find
(
'
query
'
),
$xform
;
if
(
$query
.
length
>
0
)
{
$xform
=
$query
.
find
(
'
x[xmlns="
'
+
Strophe
.
NS
.
XFORM
+
'
"]
'
);
...
...
@@ -470,12 +470,12 @@
_onRegisterIQ
:
function
(
stanza
)
{
/* Callback method that gets called when a return IQ stanza
* is received from the XMPP server, after attempting to
* register a new user.
*
* Parameters:
* (XMLElement) stanza - The IQ stanza.
*/
* is received from the XMPP server, after attempting to
* register a new user.
*
* Parameters:
* (XMLElement) stanza - The IQ stanza.
*/
var
error
=
null
,
query
=
stanza
.
getElementsByTagName
(
"
query
"
);
if
(
query
.
length
>
0
)
{
...
...
src/converse-rosterview.js
View file @
8e18d736
...
...
@@ -140,20 +140,20 @@
success
:
function
(
collection
)
{
if
(
collection
.
length
===
0
)
{
/* We don't have any roster contacts stored in sessionStorage,
* so lets fetch the roster from the XMPP server. We pass in
* 'sendPresence' as callback method, because after initially
* fetching the roster we are ready to receive presence
* updates from our contacts.
*/
* so lets fetch the roster from the XMPP server. We pass in
* 'sendPresence' as callback method, because after initially
* fetching the roster we are ready to receive presence
* updates from our contacts.
*/
converse
.
roster
.
fetchFromServer
(
function
()
{
converse
.
xmppstatus
.
sendPresence
();
});
}
else
if
(
converse
.
send_initial_presence
)
{
/* We're not going to fetch the roster again because we have
* it already cached in sessionStorage, but we still need to
* send out a presence stanza because this is a new session.
* See: https://github.com/jcbrand/converse.js/issues/536
*/
* it already cached in sessionStorage, but we still need to
* send out a presence stanza because this is a new session.
* See: https://github.com/jcbrand/converse.js/issues/536
*/
converse
.
xmppstatus
.
sendPresence
();
}
}
...
...
@@ -326,13 +326,13 @@
positionFetchedGroups
:
function
(
model
,
resp
,
options
)
{
/* Instead of throwing an add event for each group
* fetched, we wait until they're all fetched and then
* we position them.
* Works around the problem of positionGroup not
* working when all groups besides the one being
* positioned aren't already in inserted into the
* roster DOM element.
*/
* fetched, we wait until they're all fetched and then
* we position them.
* Works around the problem of positionGroup not
* working when all groups besides the one being
* positioned aren't already in inserted into the
* roster DOM element.
*/
model
.
sort
();
model
.
each
(
function
(
group
,
idx
)
{
var
view
=
this
.
get
(
group
.
get
(
'
name
'
));
...
...
@@ -350,8 +350,8 @@
positionGroup
:
function
(
view
)
{
/* Place the group's DOM element in the correct alphabetical
* position amongst the other groups in the roster.
*/
* position amongst the other groups in the roster.
*/
var
$groups
=
this
.
$roster
.
find
(
'
.roster-group
'
),
index
=
$groups
.
length
?
this
.
model
.
indexOf
(
view
.
model
)
:
0
;
if
(
index
===
0
)
{
...
...
@@ -366,7 +366,7 @@
appendGroup
:
function
(
view
)
{
/* Add the group at the bottom of the roster
*/
*/
var
$last
=
this
.
$roster
.
find
(
'
.roster-group
'
).
last
();
var
$siblings
=
$last
.
siblings
(
'
dd
'
);
if
(
$siblings
.
length
>
0
)
{
...
...
@@ -379,8 +379,8 @@
getGroup
:
function
(
name
)
{
/* Returns the group as specified by name.
* Creates the group if it doesn't exist.
*/
* Creates the group if it doesn't exist.
*/
var
view
=
this
.
get
(
name
);
if
(
view
)
{
return
view
.
model
;
...
...
@@ -466,16 +466,16 @@
if
((
ask
===
'
subscribe
'
)
||
(
subscription
===
'
from
'
))
{
/* ask === 'subscribe'
* Means we have asked to subscribe to them.
*
* subscription === 'from'
* They are subscribed to use, but not vice versa.
* We assume that there is a pending subscription
* from us to them (otherwise we're in a state not
* supported by converse.js).
*
* So in both cases the user is a "pending" contact.
*/
* Means we have asked to subscribe to them.
*
* subscription === 'from'
* They are subscribed to use, but not vice versa.
* We assume that there is a pending subscription
* from us to them (otherwise we're in a state not
* supported by converse.js).
*
* So in both cases the user is a "pending" contact.
*/
this
.
$el
.
addClass
(
'
pending-xmpp-contact
'
);
this
.
$el
.
html
(
converse
.
templates
.
pending_contact
(
_
.
extend
(
item
.
toJSON
(),
{
...
...
@@ -618,8 +618,8 @@
positionContact
:
function
(
contact
)
{
/* Place the contact's DOM element in the correct alphabetical
* position amongst the other contacts in this group.
*/
* position amongst the other contacts in this group.
*/
var
view
=
this
.
get
(
contact
.
get
(
'
id
'
));
var
index
=
this
.
model
.
contacts
.
indexOf
(
contact
);
view
.
$el
.
detach
();
...
...
@@ -648,10 +648,10 @@
filter
:
function
(
q
)
{
/* Filter the group's contacts based on the query "q".
* The query is matched against the contact's full name.
* If all contacts are filtered out (i.e. hidden), then the
* group must be filtered out as well.
*/
* The query is matched against the contact's full name.
* If all contacts are filtered out (i.e. hidden), then the
* group must be filtered out as well.
*/
var
matches
;
if
(
q
.
length
===
0
)
{
if
(
this
.
model
.
get
(
'
state
'
)
===
converse
.
OPENED
)
{
...
...
@@ -738,8 +738,8 @@
model
:
converse
.
RosterGroup
,
comparator
:
function
(
a
,
b
)
{
/* Groups are sorted alphabetically, ignoring case.
* However, Ungrouped, Requesting Contacts and Pending Contacts
* appear last and in that order. */
* However, Ungrouped, Requesting Contacts and Pending Contacts
* appear last and in that order. */
a
=
a
.
get
(
'
name
'
);
b
=
b
.
get
(
'
name
'
);
var
special_groups
=
_
.
keys
(
HEADER_WEIGHTS
);
...
...
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