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
6904f9a8
Commit
6904f9a8
authored
Oct 23, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use es2015 modules instead of UMD
parent
3a33d6f9
Changes
43
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
55295 additions
and
55281 deletions
+55295
-55281
.eslintrc.json
.eslintrc.json
+2
-1
CHANGES.md
CHANGES.md
+5
-0
Makefile
Makefile
+6
-2
dist/converse.js
dist/converse.js
+38171
-37859
spec/chatroom.js
spec/chatroom.js
+25
-27
spec/roomslist.js
spec/roomslist.js
+30
-35
src/converse-autocomplete.js
src/converse-autocomplete.js
+325
-326
src/converse-bookmarks.js
src/converse-bookmarks.js
+530
-540
src/converse-caps.js
src/converse-caps.js
+45
-47
src/converse-chatboxviews.js
src/converse-chatboxviews.js
+152
-159
src/converse-chatview.js
src/converse-chatview.js
+1233
-1259
src/converse-controlbox.js
src/converse-controlbox.js
+554
-568
src/converse-dragresize.js
src/converse-dragresize.js
+330
-333
src/converse-embedded.js
src/converse-embedded.js
+29
-31
src/converse-fullscreen.js
src/converse-fullscreen.js
+47
-52
src/converse-headline.js
src/converse-headline.js
+136
-142
src/converse-message-view.js
src/converse-message-view.js
+222
-239
src/converse-minimize.js
src/converse-minimize.js
+483
-495
src/converse-modal.js
src/converse-modal.js
+99
-105
src/converse-muc-views.js
src/converse-muc-views.js
+1959
-1990
src/converse-notification.js
src/converse-notification.js
+245
-246
src/converse-oauth.js
src/converse-oauth.js
+126
-133
src/converse-omemo.js
src/converse-omemo.js
+934
-938
src/converse-profile.js
src/converse-profile.js
+243
-255
src/converse-push.js
src/converse-push.js
+109
-110
src/converse-register.js
src/converse-register.js
+637
-650
src/converse-roomslist.js
src/converse-roomslist.js
+259
-261
src/converse-roster.js
src/converse-roster.js
+845
-847
src/converse-rosterview.js
src/converse-rosterview.js
+897
-912
src/converse-singleton.js
src/converse-singleton.js
+81
-84
src/headless/converse-chatboxes.js
src/headless/converse-chatboxes.js
+847
-854
src/headless/converse-core.js
src/headless/converse-core.js
+1568
-1572
src/headless/converse-disco.js
src/headless/converse-disco.js
+590
-592
src/headless/converse-mam.js
src/headless/converse-mam.js
+535
-538
src/headless/converse-muc.js
src/headless/converse-muc.js
+1394
-1403
src/headless/converse-ping.js
src/headless/converse-ping.js
+75
-76
src/headless/converse-vcard.js
src/headless/converse-vcard.js
+205
-206
src/headless/utils/core.js
src/headless/utils/core.js
+409
-445
src/headless/utils/emoji.js
src/headless/utils/emoji.js
+243
-250
src/headless/utils/form.js
src/headless/utils/form.js
+28
-35
src/headless/utils/muc.js
src/headless/utils/muc.js
+91
-90
src/utils/html.js
src/utils/html.js
+549
-574
tests/utils.js
tests/utils.js
+2
-0
No files found.
.eslintrc.json
View file @
6904f9a8
{
"parserOptions"
:
{
"ecmaVersion"
:
2017
"ecmaVersion"
:
2017
,
"sourceType"
:
"module"
},
"env"
:
{
"browser"
:
true
,
...
...
CHANGES.md
View file @
6904f9a8
# Changelog
## 4.1.0 (Unreleased)
-
Use
[
Lerna
](
https://lernajs.io/
)
to create the @converse/headless package
-
Use ES2015 modules instead of UMD.
## 4.0.3 (2018-10-22)
-
New translations: Arabic, Basque, Czech, French, German, Hungarian, Japanese, Norwegian Bokmål, Polish, Romanian, Spanish
...
...
Makefile
View file @
6904f9a8
...
...
@@ -157,12 +157,16 @@ watchcss: dev
$(SASS)
--watch
-I
$(BOURBON)
-I
$(BOOTSTRAP)
sass:css
.PHONY
:
watchjs
watchjs
:
dev
watchjs
:
dev
dist/converse-headless.js
./node_modules/.bin/npx webpack
--mode
=
development
--watch
.PHONY
:
watchjsheadless
watchjsheadless
:
dev
./node_modules/.bin/npx webpack
--mode
=
development
--watch
--type
=
headless
.PHONY
:
watch
watch
:
dev
make
-j
2 watchjs watchcss
make
-j
3 watchcss watchjsheadless watchjs
.PHONY
:
logo
logo
:
logo/conversejs-transparent16.png
\
...
...
dist/converse.js
View file @
6904f9a8
This diff is collapsed.
Click to expand it.
spec/chatroom.js
View file @
6904f9a8
...
...
@@ -1555,10 +1555,9 @@
it
(
"
properly handles notification that a room has been destroyed
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
async
function
(
done
,
_converse
)
{
test_utils
.
openChatRoomViaModal
(
_converse
,
'
problematic@muc.localhost
'
,
'
dummy
'
)
.
then
(
function
()
{
await
test_utils
.
openChatRoomViaModal
(
_converse
,
'
problematic@muc.localhost
'
,
'
dummy
'
)
const
presence
=
$pres
().
attrs
({
from
:
'
problematic@muc.localhost
'
,
id
:
'
n13mt3l
'
,
...
...
@@ -1582,7 +1581,6 @@
expect
(
view
.
el
.
querySelector
(
'
.chatroom-body .moved-link
'
).
textContent
.
trim
())
.
toBe
(
`other-room@chat.jabberfr.org`
);
done
();
}).
catch
(
_
.
partial
(
console
.
error
,
_
));
}));
it
(
"
will use the user's reserved nickname, if it exists
"
,
...
...
spec/roomslist.js
View file @
6904f9a8
...
...
@@ -15,27 +15,23 @@
null
,
[
'
rosterGroupsFetched
'
,
'
chatBoxesFetched
'
],
{
allow_bookmarks
:
false
// Makes testing easier, otherwise we
// have to mock stanza traffic.
},
function
(
done
,
_converse
)
{
},
async
function
(
done
,
_converse
)
{
test_utils
.
openControlBox
();
const
controlbox
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
);
let
list
=
controlbox
.
el
.
querySelector
(
'
div.rooms-list-container
'
);
expect
(
_
.
includes
(
list
.
classList
,
'
hidden
'
)).
toBeTruthy
();
let
room_els
;
test_utils
.
openChatRoom
(
_converse
,
'
room
'
,
'
conference.shakespeare.lit
'
,
'
JC
'
)
.
then
(()
=>
{
await
test_utils
.
openChatRoom
(
_converse
,
'
room
'
,
'
conference.shakespeare.lit
'
,
'
JC
'
);
expect
(
_
.
isUndefined
(
_converse
.
rooms_list_view
)).
toBeFalsy
();
room_els
=
_converse
.
rooms_list_view
.
el
.
querySelectorAll
(
"
.open-room
"
);
let
room_els
=
_converse
.
rooms_list_view
.
el
.
querySelectorAll
(
"
.open-room
"
);
expect
(
room_els
.
length
).
toBe
(
1
);
expect
(
room_els
[
0
].
innerText
).
toBe
(
'
room@conference.shakespeare.lit
'
);
return
test_utils
.
openChatRoom
(
_converse
,
'
lounge
'
,
'
localhost
'
,
'
dummy
'
);
}).
then
(()
=>
{
await
test_utils
.
openChatRoom
(
_converse
,
'
lounge
'
,
'
localhost
'
,
'
dummy
'
);
room_els
=
_converse
.
rooms_list_view
.
el
.
querySelectorAll
(
"
.open-room
"
);
expect
(
room_els
.
length
).
toBe
(
2
);
var
view
=
_converse
.
chatboxviews
.
get
(
'
room@conference.shakespeare.lit
'
);
let
view
=
_converse
.
chatboxviews
.
get
(
'
room@conference.shakespeare.lit
'
);
view
.
close
();
room_els
=
_converse
.
rooms_list_view
.
el
.
querySelectorAll
(
"
.open-room
"
);
expect
(
room_els
.
length
).
toBe
(
1
);
...
...
@@ -51,7 +47,6 @@
list
=
controlbox
.
el
.
querySelector
(
'
div.rooms-list-container
'
);
expect
(
_
.
includes
(
list
.
classList
,
'
hidden
'
)).
toBeTruthy
();
done
();
}).
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
));
}
));
});
...
...
src/converse-autocomplete.js
View file @
6904f9a8
...
...
@@ -7,15 +7,15 @@
// This plugin started as a fork of Lea Verou's Awesomplete
// https://leaverou.github.io/awesomplete/
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
],
factory
);
}(
this
,
function
(
converse
)
{
const
{
_
,
Backbone
}
=
converse
.
env
,
import
converse
from
"
@converse/headless/converse-core
"
;
const
{
_
,
Backbone
}
=
converse
.
env
,
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
"
converse-autocomplete
"
,
{
converse
.
plugins
.
add
(
"
converse-autocomplete
"
,
{
initialize
()
{
const
{
_converse
}
=
this
;
...
...
@@ -411,5 +411,4 @@
_converse
.
AutoComplete
=
AutoComplete
;
}
});
}));
});
src/converse-bookmarks.js
View file @
6904f9a8
...
...
@@ -9,28 +9,19 @@
/* This is a Converse.js plugin which add support for bookmarks specified
* in XEP-0048.
*/
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
@converse/headless/converse-muc
"
,
"
templates/chatroom_bookmark_form.html
"
,
"
templates/chatroom_bookmark_toggle.html
"
,
"
templates/bookmark.html
"
,
"
templates/bookmarks_list.html
"
],
factory
);
}(
this
,
function
(
converse
,
muc
,
tpl_chatroom_bookmark_form
,
tpl_chatroom_bookmark_toggle
,
tpl_bookmark
,
tpl_bookmarks_list
)
{
const
{
Backbone
,
Promise
,
Strophe
,
$iq
,
b64_sha1
,
sizzle
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-bookmarks
'
,
{
import
converse
from
"
@converse/headless/converse-core
"
;
import
muc
from
"
@converse/headless/converse-muc
"
;
import
tpl_bookmark
from
"
templates/bookmark.html
"
;
import
tpl_bookmarks_list
from
"
templates/bookmarks_list.html
"
import
tpl_chatroom_bookmark_form
from
"
templates/chatroom_bookmark_form.html
"
;
import
tpl_chatroom_bookmark_toggle
from
"
templates/chatroom_bookmark_toggle.html
"
;
const
{
Backbone
,
Promise
,
Strophe
,
$iq
,
b64_sha1
,
sizzle
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-bookmarks
'
,
{
/* Plugin dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
...
...
@@ -42,7 +33,7 @@
*
* NB: These plugins need to have already been loaded via require.js.
*/
dependencies
:
[
"
converse-chatboxes
"
,
"
@converse/headless/
converse-muc
"
,
"
converse-muc-views
"
],
dependencies
:
[
"
converse-chatboxes
"
,
"
converse-muc
"
,
"
converse-muc-views
"
],
overrides
:
{
// Overrides mentioned here will be picked up by converse.js's
...
...
@@ -583,5 +574,4 @@
});
}
});
}));
});
src/converse-caps.js
View file @
6904f9a8
...
...
@@ -4,19 +4,18 @@
// Copyright (c) 2013-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
],
factory
);
}(
this
,
function
(
converse
)
{
const
{
Strophe
,
$build
,
_
,
b64_sha1
}
=
converse
.
env
;
import
converse
from
"
@converse/headless/converse-core
"
;
Strophe
.
addNamespace
(
'
CAPS
'
,
"
http://jabber.org/protocol/caps
"
)
;
const
{
Strophe
,
$build
,
_
,
b64_sha1
}
=
converse
.
env
;
function
propertySort
(
array
,
property
)
{
Strophe
.
addNamespace
(
'
CAPS
'
,
"
http://jabber.org/protocol/caps
"
);
function
propertySort
(
array
,
property
)
{
return
array
.
sort
((
a
,
b
)
=>
{
return
a
[
property
]
>
b
[
property
]
?
-
1
:
1
});
}
}
function
generateVerificationString
(
_converse
)
{
function
generateVerificationString
(
_converse
)
{
const
identities
=
_converse
.
api
.
disco
.
own
.
identities
.
get
(),
features
=
_converse
.
api
.
disco
.
own
.
features
.
get
();
...
...
@@ -34,18 +33,18 @@
features
.
sort
();
S
=
_
.
reduce
(
features
,
(
result
,
feature
)
=>
`
${
result
}${
feature
}
<`
,
S
);
return
b64_sha1
(
S
);
}
}
function
createCapsNode
(
_converse
)
{
function
createCapsNode
(
_converse
)
{
return
$build
(
"
c
"
,
{
'
xmlns
'
:
Strophe
.
NS
.
CAPS
,
'
hash
'
:
"
sha-1
"
,
'
node
'
:
"
https://conversejs.org
"
,
'
ver
'
:
generateVerificationString
(
_converse
)
}).
nodeTree
;
}
}
converse
.
plugins
.
add
(
'
converse-caps
'
,
{
converse
.
plugins
.
add
(
'
converse-caps
'
,
{
overrides
:
{
// Overrides mentioned here will be picked up by converse.js's
...
...
@@ -59,5 +58,4 @@
}
}
}
});
}));
});
src/converse-chatboxviews.js
View file @
6904f9a8
...
...
@@ -4,20 +4,15 @@
// Copyright (c) 2012-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
templates/chatboxes.html
"
,
"
@converse/headless/converse-chatboxes
"
,
"
backbone.nativeview
"
,
"
backbone.overview
"
],
factory
);
}(
this
,
function
(
converse
,
tpl_chatboxes
)
{
"
use strict
"
;
import
"
@converse/headless/converse-chatboxes
"
;
import
"
backbone.nativeview
"
;
import
"
backbone.overview
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_chatboxes
from
"
templates/chatboxes.html
"
;
const
{
Backbone
,
_
}
=
converse
.
env
;
const
{
Backbone
,
_
}
=
converse
.
env
;
const
AvatarMixin
=
{
const
AvatarMixin
=
{
renderAvatar
(
el
)
{
el
=
el
||
this
.
el
;
...
...
@@ -47,10 +42,10 @@
img
.
src
=
img_src
;
});
},
};
};
converse
.
plugins
.
add
(
'
converse-chatboxviews
'
,
{
converse
.
plugins
.
add
(
'
converse-chatboxviews
'
,
{
dependencies
:
[
"
converse-chatboxes
"
],
...
...
@@ -174,6 +169,4 @@
_converse
.
api
.
listen
.
on
(
'
clearSession
'
,
()
=>
_converse
.
chatboxviews
.
closeAllChatBoxes
());
/************************ END Event Handlers ************************/
}
});
return
converse
;
}));
});
src/converse-chatview.js
View file @
6904f9a8
// Converse.js
// http://conversejs.org
//
// Copyright (c) 201
2
-2018, the Converse.js developers
// Copyright (c) 201
3
-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
utils/emoji
"
,
"
@converse/headless/converse-core
"
,
"
bootstrap
"
,
"
twemoji
"
,
"
xss
"
,
"
templates/chatbox.html
"
,
"
templates/chatbox_head.html
"
,
"
templates/chatbox_message_form.html
"
,
"
templates/emojis.html
"
,
"
templates/error_message.html
"
,
"
templates/help_message.html
"
,
"
templates/info.html
"
,
"
templates/new_day.html
"
,
"
templates/user_details_modal.html
"
,
"
templates/toolbar_fileupload.html
"
,
"
templates/spinner.html
"
,
"
templates/spoiler_button.html
"
,
"
templates/status_message.html
"
,
"
templates/toolbar.html
"
,
"
converse-modal
"
,
"
converse-chatboxviews
"
,
"
converse-message-view
"
],
factory
);
}(
this
,
function
(
u
,
converse
,
bootstrap
,
twemoji
,
xss
,
tpl_chatbox
,
tpl_chatbox_head
,
tpl_chatbox_message_form
,
tpl_emojis
,
tpl_error_message
,
tpl_help_message
,
tpl_info
,
tpl_new_day
,
tpl_user_details_modal
,
tpl_toolbar_fileupload
,
tpl_spinner
,
tpl_spoiler_button
,
tpl_status_message
,
tpl_toolbar
)
{
"
use strict
"
;
const
{
$msg
,
Backbone
,
Promise
,
Strophe
,
_
,
b64_sha1
,
f
,
sizzle
,
moment
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-chatview
'
,
{
import
"
converse-chatboxviews
"
;
import
"
converse-message-view
"
;
import
"
converse-modal
"
;
import
*
as
twemoji
from
"
twemoji
"
;
import
bootstrap
from
"
bootstrap
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_chatbox
from
"
templates/chatbox.html
"
;
import
tpl_chatbox_head
from
"
templates/chatbox_head.html
"
;
import
tpl_chatbox_message_form
from
"
templates/chatbox_message_form.html
"
;
import
tpl_emojis
from
"
templates/emojis.html
"
;
import
tpl_error_message
from
"
templates/error_message.html
"
;
import
tpl_help_message
from
"
templates/help_message.html
"
;
import
tpl_info
from
"
templates/info.html
"
;
import
tpl_new_day
from
"
templates/new_day.html
"
;
import
tpl_spinner
from
"
templates/spinner.html
"
;
import
tpl_spoiler_button
from
"
templates/spoiler_button.html
"
;
import
tpl_status_message
from
"
templates/status_message.html
"
;
import
tpl_toolbar
from
"
templates/toolbar.html
"
;
import
tpl_toolbar_fileupload
from
"
templates/toolbar_fileupload.html
"
;
import
tpl_user_details_modal
from
"
templates/user_details_modal.html
"
;
import
u
from
"
utils/emoji
"
;
import
xss
from
"
xss
"
;
const
{
$msg
,
Backbone
,
Promise
,
Strophe
,
_
,
b64_sha1
,
f
,
sizzle
,
moment
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-chatview
'
,
{
/* Plugin dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
* this plugin.
...
...
@@ -1340,7 +1317,4 @@
});
/************************ END API ************************/
}
});
return
converse
;
}));
});
src/converse-controlbox.js
View file @
6904f9a8
...
...
@@ -6,36 +6,23 @@
//
/*global define */
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
bootstrap
"
,
"
formdata-polyfill
"
,
"
@converse/headless/lodash.fp
"
,
"
templates/converse_brand_heading.html
"
,
"
templates/controlbox.html
"
,
"
templates/controlbox_toggle.html
"
,
"
templates/login_panel.html
"
,
"
converse-chatview
"
,
"
converse-rosterview
"
,
"
converse-profile
"
],
factory
);
}(
this
,
function
(
converse
,
bootstrap
,
_FormData
,
fp
,
tpl_brand_heading
,
tpl_controlbox
,
tpl_controlbox_toggle
,
tpl_login_panel
)
{
"
use strict
"
;
const
CHATBOX_TYPE
=
'
chatbox
'
;
const
{
Strophe
,
Backbone
,
Promise
,
_
,
moment
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
const
CONNECTION_STATUS_CSS_CLASS
=
{
import
"
converse-chatview
"
;
import
"
converse-profile
"
;
import
"
converse-rosterview
"
;
import
_FormData
from
"
formdata-polyfill
"
;
import
bootstrap
from
"
bootstrap
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
fp
from
"
@converse/headless/lodash.fp
"
;
import
tpl_brand_heading
from
"
templates/converse_brand_heading.html
"
;
import
tpl_controlbox
from
"
templates/controlbox.html
"
;
import
tpl_controlbox_toggle
from
"
templates/controlbox_toggle.html
"
;
import
tpl_login_panel
from
"
templates/login_panel.html
"
;
const
CHATBOX_TYPE
=
'
chatbox
'
;
const
{
Strophe
,
Backbone
,
Promise
,
_
,
moment
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
const
CONNECTION_STATUS_CSS_CLASS
=
{
'
Error
'
:
'
error
'
,
'
Connecting
'
:
'
info
'
,
'
Connection failure
'
:
'
error
'
,
...
...
@@ -47,9 +34,9 @@
'
Attached
'
:
'
info
'
,
'
Redirect
'
:
'
info
'
,
'
Reconnecting
'
:
'
warn
'
};
};
const
PRETTY_CONNECTION_STATUS
=
{
const
PRETTY_CONNECTION_STATUS
=
{
0
:
'
Error
'
,
1
:
'
Connecting
'
,
2
:
'
Connection failure
'
,
...
...
@@ -61,9 +48,9 @@
8
:
'
Attached
'
,
9
:
'
Redirect
'
,
10
:
'
Reconnecting
'
};
};
const
REPORTABLE_STATUSES
=
[
const
REPORTABLE_STATUSES
=
[
0
,
// ERROR'
1
,
// CONNECTING
2
,
// CONNFAIL
...
...
@@ -71,9 +58,9 @@
4
,
// AUTHFAIL
7
,
// DISCONNECTING
10
// RECONNECTING
];
];
converse
.
plugins
.
add
(
'
converse-controlbox
'
,
{
converse
.
plugins
.
add
(
'
converse-controlbox
'
,
{
/* Plugin dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
* this plugin.
...
...
@@ -624,5 +611,4 @@
_converse
.
on
(
'
disconnected
'
,
()
=>
disconnect
().
renderLoginPanel
());
_converse
.
on
(
'
will-reconnect
'
,
disconnect
);
}
});
}));
});
src/converse-dragresize.js
View file @
6904f9a8
...
...
@@ -6,17 +6,14 @@
//
/*global define, window, document */
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
templates/dragresize.html
"
,
"
converse-chatview
"
,
"
converse-controlbox
"
],
factory
);
}(
this
,
function
(
converse
,
tpl_dragresize
)
{
"
use strict
"
;
const
{
_
}
=
converse
.
env
;
function
renderDragResizeHandles
(
_converse
,
view
)
{
import
"
converse-chatview
"
;
import
"
converse-controlbox
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_dragresize
from
"
templates/dragresize.html
"
;
const
{
_
}
=
converse
.
env
;
function
renderDragResizeHandles
(
_converse
,
view
)
{
const
flyout
=
view
.
el
.
querySelector
(
'
.box-flyout
'
);
const
div
=
document
.
createElement
(
'
div
'
);
div
.
innerHTML
=
tpl_dragresize
();
...
...
@@ -24,10 +21,10 @@
div
,
flyout
.
firstChild
);
}
}
converse
.
plugins
.
add
(
'
converse-dragresize
'
,
{
converse
.
plugins
.
add
(
'
converse-dragresize
'
,
{
/* Plugin dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
* this plugin.
...
...
@@ -367,5 +364,5 @@
return
value
;
};
}
});
}));
});
src/converse-embedded.js
View file @
6904f9a8
// Converse.js
// http://conversejs.org
//
// Copyright (c) 201
2
-2018, the Converse.js developers
// Copyright (c) 201
3
-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
@converse/headless/converse-muc
"
],
factory
);
}(
this
,
function
(
converse
)
{
"
use strict
"
;
const
{
Backbone
,
_
}
=
converse
.
env
;
import
"
@converse/headless/converse-muc
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
converse
.
plugins
.
add
(
'
converse-embedded
'
,
{
const
{
Backbone
,
_
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-embedded
'
,
{
enabled
(
_converse
)
{
return
_converse
.
view_mode
===
'
embedded
'
;
...
...
@@ -36,5 +35,4 @@
"
since only one chat room can be open at any time.
"
);
}
}
});
}));
});
src/converse-fullscreen.js
View file @
6904f9a8
...
...
@@ -4,21 +4,17 @@
// Copyright (c) JC Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define */
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
templates/inverse_brand_heading.html
"
,
"
converse-chatview
"
,
"
converse-controlbox
"
,
"
@converse/headless/converse-muc
"
,
"
converse-singleton
"
],
factory
);
}(
this
,
function
(
converse
,
tpl_brand_heading
)
{
"
use strict
"
;
const
{
Strophe
,
_
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-fullscreen
'
,
{
import
"
@converse/headless/converse-muc
"
;
import
"
converse-chatview
"
;
import
"
converse-controlbox
"
;
import
"
converse-singleton
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_brand_heading
from
"
templates/inverse_brand_heading.html
"
;
const
{
Strophe
,
_
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-fullscreen
'
,
{
enabled
(
_converse
)
{
return
_
.
includes
([
'
fullscreen
'
,
'
embedded
'
],
_converse
.
view_mode
);
...
...
@@ -56,5 +52,4 @@
sticky_controlbox
:
true
});
}
});
}));
});
src/converse-headline.js
View file @
6904f9a8
...
...
@@ -3,20 +3,15 @@
//
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define */
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
templates/chatbox.html
"
,
"
converse-chatview
"
,
],
factory
);
}(
this
,
function
(
converse
,
tpl_chatbox
)
{
"
use strict
"
;
const
{
_
,
utils
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-headline
'
,
{
import
"
converse-chatview
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_chatbox
from
"
templates/chatbox.html
"
;
const
{
_
,
utils
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-headline
'
,
{
/* Plugin dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
* this plugin.
...
...
@@ -152,5 +147,4 @@
});
});
}
});
}));
});
src/converse-message-view.js
View file @
6904f9a8
...
...
@@ -4,36 +4,21 @@
// Copyright (c) 2013-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
./utils/html
"
,
"
utils/emoji
"
,
"
@converse/headless/converse-core
"
,
"
xss
"
,
"
filesize
"
,
"
templates/csn.html
"
,
"
templates/file_progress.html
"
,
"
templates/info.html
"
,
"
templates/message.html
"
,
"
templates/message_versions_modal.html
"
,
],
factory
);
}(
this
,
function
(
html
,
u
,
converse
,
xss
,
filesize
,
tpl_csn
,
tpl_file_progress
,
tpl_info
,
tpl_message
,
tpl_message_versions_modal
)
{
"
use strict
"
;
const
{
Backbone
,
_
,
moment
}
=
converse
.
env
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
filesize
from
"
filesize
"
;
import
html
from
"
./utils/html
"
;
import
tpl_csn
from
"
templates/csn.html
"
;
import
tpl_file_progress
from
"
templates/file_progress.html
"
;
import
tpl_info
from
"
templates/info.html
"
;
import
tpl_message
from
"
templates/message.html
"
;
import
tpl_message_versions_modal
from
"
templates/message_versions_modal.html
"
;
import
u
from
"
utils/emoji
"
;
import
xss
from
"
xss
"
;
const
{
Backbone
,
_
,
moment
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-message-view
'
,
{
converse
.
plugins
.
add
(
'
converse-message-view
'
,
{
initialize
()
{
/* The initialize function gets called as soon as the plugin is
...
...
@@ -271,6 +256,4 @@
}
});
}
});
return
converse
;
}));
});
src/converse-minimize.js
View file @
6904f9a8
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
// Copyright (c) 201
2-2017
, Jan-Carel Brand <jc@opkode.com>
// Copyright (c) 201
3-2018
, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define, window, document */
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
templates/chatbox_minimize.html
"
,
"
templates/toggle_chats.html
"
,
"
templates/trimmed_chat.html
"
,
"
templates/chats_panel.html
"
,
"
converse-chatview
"
],
factory
);
}(
this
,
function
(
converse
,
tpl_chatbox_minimize
,
tpl_toggle_chats
,
tpl_trimmed_chat
,
tpl_chats_panel
)
{
"
use strict
"
;
const
{
_
,
Backbone
,
Promise
,
Strophe
,
b64_sha1
,
moment
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-minimize
'
,
{
import
"
converse-chatview
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_chatbox_minimize
from
"
templates/chatbox_minimize.html
"
;
import
tpl_chats_panel
from
"
templates/chats_panel.html
"
;
import
tpl_toggle_chats
from
"
templates/toggle_chats.html
"
;
import
tpl_trimmed_chat
from
"
templates/trimmed_chat.html
"
;
const
{
_
,
Backbone
,
Promise
,
Strophe
,
b64_sha1
,
moment
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-minimize
'
,
{
/* Optional dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
* this plugin. They are called "optional" because they might not be
...
...
@@ -39,7 +28,7 @@
*
* NB: These plugins need to have already been loaded via require.js.
*/
dependencies
:
[
"
converse-chatview
"
,
"
converse-controlbox
"
,
"
@converse/headless/
converse-muc
"
,
"
converse-muc-views
"
,
"
converse-headline
"
],
dependencies
:
[
"
converse-chatview
"
,
"
converse-controlbox
"
,
"
converse-muc
"
,
"
converse-muc-views
"
,
"
converse-headline
"
],
enabled
(
_converse
)
{
return
_converse
.
view_mode
==
'
overlayed
'
;
...
...
@@ -548,5 +537,4 @@
}
});
}
});
}));
});
src/converse-modal.js
View file @
6904f9a8
// Converse.js
// http://conversejs.org
//
// Copyright (c) 2018, the Converse.js developers
// Copyright (c) 201
3-201
8, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
define
([
"
@converse/headless/converse-core
"
,
"
templates/alert_modal.html
"
,
"
bootstrap
"
,
"
backbone.vdomview
"
],
factory
);
}
}(
this
,
function
(
converse
,
tpl_alert_modal
,
bootstrap
)
{
"
use strict
"
;
import
"
backbone.vdomview
"
;
import
bootstrap
from
"
bootstrap
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_alert_modal
from
"
templates/alert_modal.html
"
;
const
{
Strophe
,
Backbone
,
_
}
=
converse
.
env
;
const
{
Strophe
,
Backbone
,
_
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-modal
'
,
{
converse
.
plugins
.
add
(
'
converse-modal
'
,
{
initialize
()
{
const
{
_converse
}
=
this
;
...
...
@@ -113,5 +107,5 @@
}
});
}
});
}));
});
src/converse-muc-views.js
View file @
6904f9a8
...
...
@@ -4,70 +4,39 @@
// Copyright (c) 2013-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
formdata-polyfill
"
,
"
utils/muc
"
,
"
xss
"
,
"
templates/add_chatroom_modal.html
"
,
"
templates/chatarea.html
"
,
"
templates/chatroom.html
"
,
"
templates/chatroom_details_modal.html
"
,
"
templates/chatroom_destroyed.html
"
,
"
templates/chatroom_disconnect.html
"
,
"
templates/chatroom_features.html
"
,
"
templates/chatroom_form.html
"
,
"
templates/chatroom_head.html
"
,
"
templates/chatroom_invite.html
"
,
"
templates/chatroom_nickname_form.html
"
,
"
templates/chatroom_password_form.html
"
,
"
templates/chatroom_sidebar.html
"
,
"
templates/info.html
"
,
"
templates/list_chatrooms_modal.html
"
,
"
templates/occupant.html
"
,
"
templates/room_description.html
"
,
"
templates/room_item.html
"
,
"
templates/room_panel.html
"
,
"
templates/rooms_results.html
"
,
"
templates/spinner.html
"
,
"
awesomplete
"
,
"
converse-modal
"
],
factory
);
}(
this
,
function
(
converse
,
_FormData
,
muc_utils
,
xss
,
tpl_add_chatroom_modal
,
tpl_chatarea
,
tpl_chatroom
,
tpl_chatroom_details_modal
,
tpl_chatroom_destroyed
,
tpl_chatroom_disconnect
,
tpl_chatroom_features
,
tpl_chatroom_form
,
tpl_chatroom_head
,
tpl_chatroom_invite
,
tpl_chatroom_nickname_form
,
tpl_chatroom_password_form
,
tpl_chatroom_sidebar
,
tpl_info
,
tpl_list_chatrooms_modal
,
tpl_occupant
,
tpl_room_description
,
tpl_room_item
,
tpl_room_panel
,
tpl_rooms_results
,
tpl_spinner
,
Awesomplete
)
{
"
use strict
"
;
const
{
Backbone
,
Promise
,
Strophe
,
b64_sha1
,
moment
,
f
,
sizzle
,
_
,
$build
,
$iq
,
$msg
,
$pres
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
const
ROOM_FEATURES_MAP
=
{
import
"
converse-modal
"
;
import
Awesomplete
from
"
awesomplete
"
;
import
_FormData
from
"
formdata-polyfill
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
muc_utils
from
"
utils/muc
"
;
import
tpl_add_chatroom_modal
from
"
templates/add_chatroom_modal.html
"
;
import
tpl_chatarea
from
"
templates/chatarea.html
"
;
import
tpl_chatroom
from
"
templates/chatroom.html
"
;
import
tpl_chatroom_destroyed
from
"
templates/chatroom_destroyed.html
"
;
import
tpl_chatroom_details_modal
from
"
templates/chatroom_details_modal.html
"
;
import
tpl_chatroom_disconnect
from
"
templates/chatroom_disconnect.html
"
;
import
tpl_chatroom_features
from
"
templates/chatroom_features.html
"
;
import
tpl_chatroom_form
from
"
templates/chatroom_form.html
"
;
import
tpl_chatroom_head
from
"
templates/chatroom_head.html
"
;
import
tpl_chatroom_invite
from
"
templates/chatroom_invite.html
"
;
import
tpl_chatroom_nickname_form
from
"
templates/chatroom_nickname_form.html
"
;
import
tpl_chatroom_password_form
from
"
templates/chatroom_password_form.html
"
;
import
tpl_chatroom_sidebar
from
"
templates/chatroom_sidebar.html
"
;
import
tpl_info
from
"
templates/info.html
"
;
import
tpl_list_chatrooms_modal
from
"
templates/list_chatrooms_modal.html
"
;
import
tpl_occupant
from
"
templates/occupant.html
"
;
import
tpl_room_description
from
"
templates/room_description.html
"
;
import
tpl_room_item
from
"
templates/room_item.html
"
;
import
tpl_room_panel
from
"
templates/room_panel.html
"
;
import
tpl_rooms_results
from
"
templates/rooms_results.html
"
;
import
tpl_spinner
from
"
templates/spinner.html
"
;
import
xss
from
"
xss
"
;
const
{
Backbone
,
Promise
,
Strophe
,
b64_sha1
,
moment
,
f
,
sizzle
,
_
,
$build
,
$iq
,
$msg
,
$pres
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
const
ROOM_FEATURES_MAP
=
{
'
passwordprotected
'
:
'
unsecured
'
,
'
unsecured
'
:
'
passwordprotected
'
,
'
hidden
'
:
'
publicroom
'
,
...
...
@@ -80,9 +49,9 @@
'
semianonymous
'
:
'
nonanonymous
'
,
'
moderated
'
:
'
unmoderated
'
,
'
unmoderated
'
:
'
moderated
'
};
};
converse
.
plugins
.
add
(
'
converse-muc-views
'
,
{
converse
.
plugins
.
add
(
'
converse-muc-views
'
,
{
/* Dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
* this plugin. They are "optional" because they might not be
...
...
@@ -2145,5 +2114,5 @@
}
});
}
});
}));
});
src/converse-notification.js
View file @
6904f9a8
...
...
@@ -6,14 +6,13 @@
//
/*global define */
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
],
factory
);
}(
this
,
function
(
converse
)
{
"
use strict
"
;
const
{
Strophe
,
_
,
sizzle
}
=
converse
.
env
,
import
converse
from
"
@converse/headless/converse-core
"
;
const
{
Strophe
,
_
,
sizzle
}
=
converse
.
env
,
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-notification
'
,
{
converse
.
plugins
.
add
(
'
converse-notification
'
,
{
dependencies
:
[
"
converse-chatboxes
"
],
...
...
@@ -287,5 +286,5 @@
_converse
.
on
(
'
connected
'
,
_converse
.
requestPermission
);
});
}
});
}));
});
src/converse-oauth.js
View file @
6904f9a8
...
...
@@ -4,24 +4,17 @@
// Copyright (c) 2013-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
// AMD. Register as a module called "myplugin"
define
([
"
@converse/headless/converse-core
"
,
"
templates/oauth_providers.html
"
,
"
hellojs
"
],
factory
);
}
else
{
// Browser globals. If you're not using a module loader such as require.js,
// then this line below executes. Make sure that your plugin's <script> tag
// appears after the one from converse.js.
factory
(
converse
);
}
}(
this
,
function
(
converse
,
tpl_oauth_providers
,
hello
)
{
'
use strict
'
;
const
_
=
converse
.
env
.
_
,
import
converse
from
"
@converse/headless/converse-core
"
;
import
hello
from
"
hellojs
"
;
import
tpl_oauth_providers
from
"
templates/oauth_providers.html
"
;
const
_
=
converse
.
env
.
_
,
Backbone
=
converse
.
env
.
Backbone
,
Strophe
=
converse
.
env
.
Strophe
;
// The following line registers your plugin.
converse
.
plugins
.
add
(
"
converse-oauth
"
,
{
// The following line registers your plugin.
converse
.
plugins
.
add
(
"
converse-oauth
"
,
{
/* Optional dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
...
...
@@ -142,5 +135,5 @@
}
});
}
});
}));
});
src/converse-omemo.js
View file @
6904f9a8
...
...
@@ -6,32 +6,28 @@
/* global libsignal, ArrayBuffer, parseInt, crypto */
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
templates/toolbar_omemo.html
"
],
factory
);
}(
this
,
function
(
converse
,
tpl_toolbar_omemo
)
{
const
{
Backbone
,
Promise
,
Strophe
,
moment
,
sizzle
,
$iq
,
$msg
,
_
,
f
,
b64_sha1
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
Strophe
.
addNamespace
(
'
OMEMO_DEVICELIST
'
,
Strophe
.
NS
.
OMEMO
+
"
.devicelist
"
);
Strophe
.
addNamespace
(
'
OMEMO_VERIFICATION
'
,
Strophe
.
NS
.
OMEMO
+
"
.verification
"
);
Strophe
.
addNamespace
(
'
OMEMO_WHITELISTED
'
,
Strophe
.
NS
.
OMEMO
+
"
.whitelisted
"
);
Strophe
.
addNamespace
(
'
OMEMO_BUNDLES
'
,
Strophe
.
NS
.
OMEMO
+
"
.bundles
"
);
const
UNDECIDED
=
0
;
const
TRUSTED
=
1
;
const
UNTRUSTED
=
-
1
;
const
TAG_LENGTH
=
128
;
const
KEY_ALGO
=
{
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_toolbar_omemo
from
"
templates/toolbar_omemo.html
"
;
const
{
Backbone
,
Promise
,
Strophe
,
moment
,
sizzle
,
$iq
,
$msg
,
_
,
f
,
b64_sha1
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
Strophe
.
addNamespace
(
'
OMEMO_DEVICELIST
'
,
Strophe
.
NS
.
OMEMO
+
"
.devicelist
"
);
Strophe
.
addNamespace
(
'
OMEMO_VERIFICATION
'
,
Strophe
.
NS
.
OMEMO
+
"
.verification
"
);
Strophe
.
addNamespace
(
'
OMEMO_WHITELISTED
'
,
Strophe
.
NS
.
OMEMO
+
"
.whitelisted
"
);
Strophe
.
addNamespace
(
'
OMEMO_BUNDLES
'
,
Strophe
.
NS
.
OMEMO
+
"
.bundles
"
);
const
UNDECIDED
=
0
;
const
TRUSTED
=
1
;
const
UNTRUSTED
=
-
1
;
const
TAG_LENGTH
=
128
;
const
KEY_ALGO
=
{
'
name
'
:
"
AES-GCM
"
,
'
length
'
:
128
};
};
function
parseBundle
(
bundle_el
)
{
function
parseBundle
(
bundle_el
)
{
/* Given an XML element representing a user's OMEMO bundle, parse it
* and return a map.
*/
...
...
@@ -56,10 +52,10 @@
},
'
prekeys
'
:
prekeys
}
}
}
converse
.
plugins
.
add
(
'
converse-omemo
'
,
{
converse
.
plugins
.
add
(
'
converse-omemo
'
,
{
enabled
(
_converse
)
{
return
!
_
.
isNil
(
window
.
libsignal
)
&&
!
f
.
includes
(
'
converse-omemo
'
,
_converse
.
blacklisted_plugins
);
...
...
@@ -1049,5 +1045,5 @@
_converse
.
generateFingerprints
(
_converse
.
bare_jid
).
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
ERROR
));
});
}
});
}));
});
src/converse-profile.js
View file @
6904f9a8
...
...
@@ -6,35 +6,23 @@
//
/*global define */
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
bootstrap
"
,
"
formdata-polyfill
"
,
"
templates/alert.html
"
,
"
templates/chat_status_modal.html
"
,
"
templates/profile_modal.html
"
,
"
templates/profile_view.html
"
,
"
templates/status_option.html
"
,
"
@converse/headless/converse-vcard
"
,
"
converse-modal
"
],
factory
);
}(
this
,
function
(
converse
,
bootstrap
,
_FormData
,
tpl_alert
,
tpl_chat_status_modal
,
tpl_profile_modal
,
tpl_profile_view
,
tpl_status_option
)
{
"
use strict
"
;
const
{
Strophe
,
Backbone
,
Promise
,
utils
,
_
,
moment
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-profile
'
,
{
import
"
@converse/headless/converse-vcard
"
;
import
"
converse-modal
"
;
import
_FormData
from
"
formdata-polyfill
"
;
import
bootstrap
from
"
bootstrap
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_alert
from
"
templates/alert.html
"
;
import
tpl_chat_status_modal
from
"
templates/chat_status_modal.html
"
;
import
tpl_profile_modal
from
"
templates/profile_modal.html
"
;
import
tpl_profile_view
from
"
templates/profile_view.html
"
;
import
tpl_status_option
from
"
templates/status_option.html
"
;
const
{
Strophe
,
Backbone
,
Promise
,
utils
,
_
,
moment
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-profile
'
,
{
dependencies
:
[
"
converse-modal
"
,
"
converse-vcard
"
,
"
converse-chatboxviews
"
],
...
...
@@ -272,5 +260,5 @@
}
});
}
});
}));
});
src/converse-push.js
View file @
6904f9a8
...
...
@@ -7,17 +7,16 @@
/* This is a Converse.js plugin which add support for registering
* an "App Server" as defined in XEP-0357
*/
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
],
factory
);
}(
this
,
function
(
converse
)
{
"
use strict
"
;
const
{
Strophe
,
$iq
,
_
}
=
converse
.
env
;
Strophe
.
addNamespace
(
'
PUSH
'
,
'
urn:xmpp:push:0
'
)
;
import
converse
from
"
@converse/headless/converse-core
"
;
const
{
Strophe
,
$iq
,
_
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-push
'
,
{
Strophe
.
addNamespace
(
'
PUSH
'
,
'
urn:xmpp:push:0
'
);
converse
.
plugins
.
add
(
'
converse-push
'
,
{
initialize
()
{
/* The initialize function gets called as soon as the plugin is
...
...
@@ -131,5 +130,5 @@
_converse
.
api
.
listen
.
on
(
'
chatBoxesInitialized
'
,
()
=>
_converse
.
chatboxes
.
on
(
'
add
'
,
onChatBoxAdded
));
}
}
});
}));
});
src/converse-register.js
View file @
6904f9a8
...
...
@@ -9,49 +9,36 @@
/* This is a Converse.js plugin which add support for in-band registration
* as specified in XEP-0077.
*/
(
function
(
root
,
factory
)
{
define
([
"
utils/form
"
,
"
@converse/headless/converse-core
"
,
"
templates/form_username.html
"
,
"
templates/register_link.html
"
,
"
templates/register_panel.html
"
,
"
templates/registration_form.html
"
,
"
templates/registration_request.html
"
,
"
templates/form_input.html
"
,
"
templates/spinner.html
"
,
"
converse-controlbox
"
],
factory
);
}(
this
,
function
(
utils
,
converse
,
tpl_form_username
,
tpl_register_link
,
tpl_register_panel
,
tpl_registration_form
,
tpl_registration_request
,
tpl_form_input
,
tpl_spinner
)
{
"
use strict
"
;
// Strophe methods for building stanzas
const
{
Strophe
,
Backbone
,
sizzle
,
$iq
,
_
}
=
converse
.
env
;
// Add Strophe Namespaces
Strophe
.
addNamespace
(
'
REGISTER
'
,
'
jabber:iq:register
'
);
// Add Strophe Statuses
let
i
=
0
;
_
.
each
(
_
.
keys
(
Strophe
.
Status
),
function
(
key
)
{
import
"
converse-controlbox
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_form_input
from
"
templates/form_input.html
"
;
import
tpl_form_username
from
"
templates/form_username.html
"
;
import
tpl_register_link
from
"
templates/register_link.html
"
;
import
tpl_register_panel
from
"
templates/register_panel.html
"
;
import
tpl_registration_form
from
"
templates/registration_form.html
"
;
import
tpl_registration_request
from
"
templates/registration_request.html
"
;
import
tpl_spinner
from
"
templates/spinner.html
"
;
import
utils
from
"
utils/form
"
;
// Strophe methods for building stanzas
const
{
Strophe
,
Backbone
,
sizzle
,
$iq
,
_
}
=
converse
.
env
;
// Add Strophe Namespaces
Strophe
.
addNamespace
(
'
REGISTER
'
,
'
jabber:iq:register
'
);
// Add Strophe Statuses
let
i
=
0
;
_
.
each
(
_
.
keys
(
Strophe
.
Status
),
function
(
key
)
{
i
=
Math
.
max
(
i
,
Strophe
.
Status
[
key
]);
});
Strophe
.
Status
.
REGIFAIL
=
i
+
1
;
Strophe
.
Status
.
REGISTERED
=
i
+
2
;
Strophe
.
Status
.
CONFLICT
=
i
+
3
;
Strophe
.
Status
.
NOTACCEPTABLE
=
i
+
5
;
});
Strophe
.
Status
.
REGIFAIL
=
i
+
1
;
Strophe
.
Status
.
REGISTERED
=
i
+
2
;
Strophe
.
Status
.
CONFLICT
=
i
+
3
;
Strophe
.
Status
.
NOTACCEPTABLE
=
i
+
5
;
converse
.
plugins
.
add
(
'
converse-register
'
,
{
converse
.
plugins
.
add
(
'
converse-register
'
,
{
'
overrides
'
:
{
// Overrides mentioned here will be picked up by converse.js's
...
...
@@ -698,5 +685,5 @@
}
});
}
});
}));
});
src/converse-roomslist.js
View file @
6904f9a8
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
// Copyright (c) 201
2-2017
, Jan-Carel Brand <jc@opkode.com>
// Copyright (c) 201
3-2018
, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define */
/* This is a non-core Converse.js plugin which shows a list of currently open
* rooms in the "Rooms Panel" of the ControlBox.
*/
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
@converse/headless/converse-muc
"
,
"
templates/rooms_list.html
"
,
"
templates/rooms_list_item.html
"
],
factory
);
}(
this
,
function
(
converse
,
muc
,
tpl_rooms_list
,
tpl_rooms_list_item
)
{
const
{
Backbone
,
Promise
,
Strophe
,
b64_sha1
,
sizzle
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-roomslist
'
,
{
import
converse
from
"
@converse/headless/converse-core
"
;
import
muc
from
"
@converse/headless/converse-muc
"
;
import
tpl_rooms_list
from
"
templates/rooms_list.html
"
;
import
tpl_rooms_list_item
from
"
templates/rooms_list_item.html
"
const
{
Backbone
,
Promise
,
Strophe
,
b64_sha1
,
sizzle
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-roomslist
'
,
{
/* Optional dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
...
...
@@ -33,7 +31,7 @@
*
* NB: These plugins need to have already been loaded via require.js.
*/
dependencies
:
[
"
converse-singleton
"
,
"
converse-controlbox
"
,
"
@converse/headless/
converse-muc
"
,
"
converse-bookmarks
"
],
dependencies
:
[
"
converse-singleton
"
,
"
converse-controlbox
"
,
"
converse-muc
"
,
"
converse-bookmarks
"
],
initialize
()
{
/* The initialize function gets called as soon as the plugin is
...
...
@@ -285,5 +283,5 @@
_converse
.
api
.
listen
.
on
(
'
reconnected
'
,
initRoomsListView
);
}
});
}));
});
src/converse-roster.js
View file @
6904f9a8
// Converse.js
// http://conversejs.org
//
// Copyright (c) 201
2
-2018, the Converse.js developers
// Copyright (c) 201
3
-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
],
factory
);
}(
this
,
function
(
converse
)
{
"
use strict
"
;
const
{
Backbone
,
Promise
,
Strophe
,
$iq
,
$pres
,
b64_sha1
,
moment
,
sizzle
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
import
converse
from
"
@converse/headless/converse-core
"
;
converse
.
plugins
.
add
(
'
converse-roster
'
,
{
const
{
Backbone
,
Promise
,
Strophe
,
$iq
,
$pres
,
b64_sha1
,
moment
,
sizzle
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-roster
'
,
{
dependencies
:
[
"
converse-vcard
"
],
...
...
@@ -933,5 +931,5 @@
}
});
}
});
}));
});
src/converse-rosterview.js
View file @
6904f9a8
// Converse.js
// http://conversejs.org
//
// Copyright (c) 201
2
-2018, the Converse.js developers
// Copyright (c) 201
3
-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
@converse/headless/converse-core
"
,
"
formdata-polyfill
"
,
"
templates/add_contact_modal.html
"
,
"
templates/group_header.html
"
,
"
templates/pending_contact.html
"
,
"
templates/requesting_contact.html
"
,
"
templates/roster.html
"
,
"
templates/roster_filter.html
"
,
"
templates/roster_item.html
"
,
"
templates/search_contact.html
"
,
"
awesomplete
"
,
"
@converse/headless/converse-chatboxes
"
,
"
converse-modal
"
],
factory
);
}(
this
,
function
(
converse
,
_FormData
,
tpl_add_contact_modal
,
tpl_group_header
,
tpl_pending_contact
,
tpl_requesting_contact
,
tpl_roster
,
tpl_roster_filter
,
tpl_roster_item
,
tpl_search_contact
,
Awesomplete
)
{
"
use strict
"
;
const
{
Backbone
,
Strophe
,
$iq
,
b64_sha1
,
sizzle
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-rosterview
'
,
{
import
"
@converse/headless/converse-chatboxes
"
;
import
"
converse-modal
"
;
import
Awesomplete
from
"
awesomplete
"
;
import
_FormData
from
"
formdata-polyfill
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
tpl_add_contact_modal
from
"
templates/add_contact_modal.html
"
;
import
tpl_group_header
from
"
templates/group_header.html
"
;
import
tpl_pending_contact
from
"
templates/pending_contact.html
"
;
import
tpl_requesting_contact
from
"
templates/requesting_contact.html
"
;
import
tpl_roster
from
"
templates/roster.html
"
;
import
tpl_roster_filter
from
"
templates/roster_filter.html
"
;
import
tpl_roster_item
from
"
templates/roster_item.html
"
;
import
tpl_search_contact
from
"
templates/search_contact.html
"
;
const
{
Backbone
,
Strophe
,
$iq
,
b64_sha1
,
sizzle
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-rosterview
'
,
{
dependencies
:
[
"
converse-roster
"
,
"
converse-modal
"
],
...
...
@@ -999,5 +984,5 @@
_converse
.
api
.
listen
.
on
(
'
rosterInitialized
'
,
initRoster
);
_converse
.
api
.
listen
.
on
(
'
rosterReadyAfterReconnection
'
,
initRoster
);
}
});
}));
});
src/converse-singleton.js
View file @
6904f9a8
// Converse.js
// http://conversejs.org
//
// Copyright (c) 201
2
-2018, the Converse.js developers
// Copyright (c) 201
3
-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
/* converse-singleton
...
...
@@ -13,26 +13,23 @@
*
* This plugin makes sense in mobile or fullscreen chat environments (as
* configured by the `view_mode` setting).
*
*/
(
function
(
root
,
factory
)
{
define
(
[
"
@converse/headless/converse-core
"
,
"
converse-chatview
"
],
factory
);
}(
this
,
function
(
converse
)
{
"
use strict
"
;
const
{
_
,
Strophe
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
import
"
converse-chatview
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
const
{
_
,
Strophe
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
function
hideChat
(
view
)
{
function
hideChat
(
view
)
{
if
(
view
.
model
.
get
(
'
id
'
)
===
'
controlbox
'
)
{
return
;
}
u
.
safeSave
(
view
.
model
,
{
'
hidden
'
:
true
});
view
.
hide
();
}
}
converse
.
plugins
.
add
(
'
converse-singleton
'
,
{
converse
.
plugins
.
add
(
'
converse-singleton
'
,
{
// It's possible however to make optional dependencies non-optional.
// If the setting "strict_plugin_dependencies" is set to true,
// an error will be raised if the plugin is not found.
...
...
@@ -114,5 +111,5 @@
}
}
}
});
}));
});
src/headless/converse-chatboxes.js
View file @
6904f9a8
...
...
@@ -4,24 +4,19 @@
// Copyright (c) 2012-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
./converse-core
"
,
"
filesize
"
,
"
./utils/form
"
,
"
./utils/emoji
"
],
factory
);
}(
this
,
function
(
converse
,
filesize
)
{
"
use strict
"
;
import
"
./utils/emoji
"
;
import
"
./utils/form
"
;
import
converse
from
"
./converse-core
"
;
import
filesize
from
"
filesize
"
;
const
{
$msg
,
Backbone
,
Promise
,
Strophe
,
b64_sha1
,
moment
,
sizzle
,
utils
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
const
{
$msg
,
Backbone
,
Promise
,
Strophe
,
b64_sha1
,
moment
,
sizzle
,
utils
,
_
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
Strophe
.
addNamespace
(
'
MESSAGE_CORRECT
'
,
'
urn:xmpp:message-correct:0
'
);
Strophe
.
addNamespace
(
'
REFERENCE
'
,
'
urn:xmpp:reference:0
'
);
Strophe
.
addNamespace
(
'
MESSAGE_CORRECT
'
,
'
urn:xmpp:message-correct:0
'
);
Strophe
.
addNamespace
(
'
REFERENCE
'
,
'
urn:xmpp:reference:0
'
);
converse
.
plugins
.
add
(
'
converse-chatboxes
'
,
{
converse
.
plugins
.
add
(
'
converse-chatboxes
'
,
{
dependencies
:
[
"
converse-roster
"
,
"
converse-vcard
"
],
...
...
@@ -953,6 +948,4 @@
});
/************************ END API ************************/
}
});
return
converse
;
}));
});
src/headless/converse-core.js
View file @
6904f9a8
This diff is collapsed.
Click to expand it.
src/headless/converse-disco.js
View file @
6904f9a8
...
...
@@ -6,13 +6,12 @@
/* This is a Converse plugin which add support for XEP-0030: Service Discovery */
(
function
(
root
,
factory
)
{
define
([
"
./converse-core
"
,
"
sizzle
"
],
factory
);
}(
this
,
function
(
converse
,
sizzle
)
{
import
converse
from
"
./converse-core
"
;
import
sizzle
from
"
sizzle
"
;
const
{
Backbone
,
Promise
,
Strophe
,
$iq
,
b64_sha1
,
utils
,
_
,
f
}
=
converse
.
env
;
const
{
Backbone
,
Promise
,
Strophe
,
$iq
,
b64_sha1
,
utils
,
_
,
f
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-disco
'
,
{
converse
.
plugins
.
add
(
'
converse-disco
'
,
{
initialize
()
{
/* The initialize function gets called as soon as the plugin is
...
...
@@ -682,5 +681,4 @@
}
});
}
});
}));
});
src/headless/converse-mam.js
View file @
6904f9a8
...
...
@@ -8,24 +8,22 @@
// XEP-0059 Result Set Management
(
function
(
root
,
factory
)
{
define
([
"
sizzle
"
,
"
./converse-core
"
,
"
./converse-disco
"
,
"
strophejs-plugin-rsm
"
],
factory
);
}(
this
,
function
(
sizzle
,
converse
)
{
"
use strict
"
;
const
CHATROOMS_TYPE
=
'
chatroom
'
;
const
{
Promise
,
Strophe
,
$iq
,
_
,
moment
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
const
RSM_ATTRIBUTES
=
[
'
max
'
,
'
first
'
,
'
last
'
,
'
after
'
,
'
before
'
,
'
index
'
,
'
count
'
];
// XEP-0313 Message Archive Management
const
MAM_ATTRIBUTES
=
[
'
with
'
,
'
start
'
,
'
end
'
];
function
getMessageArchiveID
(
stanza
)
{
import
"
./converse-disco
"
;
import
"
strophejs-plugin-rsm
"
;
import
converse
from
"
./converse-core
"
;
import
sizzle
from
"
sizzle
"
;
const
CHATROOMS_TYPE
=
'
chatroom
'
;
const
{
Promise
,
Strophe
,
$iq
,
_
,
moment
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
const
RSM_ATTRIBUTES
=
[
'
max
'
,
'
first
'
,
'
last
'
,
'
after
'
,
'
before
'
,
'
index
'
,
'
count
'
];
// XEP-0313 Message Archive Management
const
MAM_ATTRIBUTES
=
[
'
with
'
,
'
start
'
,
'
end
'
];
function
getMessageArchiveID
(
stanza
)
{
// See https://xmpp.org/extensions/xep-0313.html#results
//
// The result messages MUST contain a <result/> element with an 'id'
...
...
@@ -39,9 +37,9 @@
if
(
!
_
.
isUndefined
(
stanza_id
))
{
return
stanza_id
.
getAttribute
(
'
id
'
);
}
}
}
function
queryForArchivedMessages
(
_converse
,
options
,
callback
,
errback
)
{
function
queryForArchivedMessages
(
_converse
,
options
,
callback
,
errback
)
{
/* Internal function, called by the "archive.query" API method.
*/
let
date
;
...
...
@@ -121,10 +119,10 @@
},
_converse
.
message_archiving_timeout
);
}
}
converse
.
plugins
.
add
(
'
converse-mam
'
,
{
converse
.
plugins
.
add
(
'
converse-mam
'
,
{
dependencies
:
[
'
converse-chatview
'
,
'
converse-muc
'
,
'
converse-muc-views
'
],
...
...
@@ -592,5 +590,4 @@
}
});
}
});
}));
});
src/headless/converse-muc.js
View file @
6904f9a8
...
...
@@ -4,56 +4,51 @@
// Copyright (c) 2013-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
./utils/form
"
,
"
./converse-core
"
,
"
./converse-disco
"
,
"
backbone.overview/backbone.overview
"
,
"
backbone.overview/backbone.orderedlistview
"
,
"
backbone.vdomview
"
,
"
./utils/muc
"
,
"
./utils/emoji
"
],
factory
);
}(
this
,
function
(
u
,
converse
)
{
"
use strict
"
;
const
MUC_ROLE_WEIGHTS
=
{
import
"
./converse-disco
"
;
import
"
./utils/emoji
"
;
import
"
./utils/muc
"
;
import
"
backbone.overview/backbone.orderedlistview
"
;
import
"
backbone.overview/backbone.overview
"
;
import
"
backbone.vdomview
"
;
import
converse
from
"
./converse-core
"
;
import
u
from
"
./utils/form
"
;
const
MUC_ROLE_WEIGHTS
=
{
'
moderator
'
:
1
,
'
participant
'
:
2
,
'
visitor
'
:
3
,
'
none
'
:
2
,
};
};
const
{
Strophe
,
Backbone
,
Promise
,
$iq
,
$build
,
$msg
,
$pres
,
b64_sha1
,
sizzle
,
f
,
moment
,
_
}
=
converse
.
env
;
const
{
Strophe
,
Backbone
,
Promise
,
$iq
,
$build
,
$msg
,
$pres
,
b64_sha1
,
sizzle
,
f
,
moment
,
_
}
=
converse
.
env
;
// Add Strophe Namespaces
Strophe
.
addNamespace
(
'
MUC_ADMIN
'
,
Strophe
.
NS
.
MUC
+
"
#admin
"
);
Strophe
.
addNamespace
(
'
MUC_OWNER
'
,
Strophe
.
NS
.
MUC
+
"
#owner
"
);
Strophe
.
addNamespace
(
'
MUC_REGISTER
'
,
"
jabber:iq:register
"
);
Strophe
.
addNamespace
(
'
MUC_ROOMCONF
'
,
Strophe
.
NS
.
MUC
+
"
#roomconfig
"
);
Strophe
.
addNamespace
(
'
MUC_USER
'
,
Strophe
.
NS
.
MUC
+
"
#user
"
);
// Add Strophe Namespaces
Strophe
.
addNamespace
(
'
MUC_ADMIN
'
,
Strophe
.
NS
.
MUC
+
"
#admin
"
);
Strophe
.
addNamespace
(
'
MUC_OWNER
'
,
Strophe
.
NS
.
MUC
+
"
#owner
"
);
Strophe
.
addNamespace
(
'
MUC_REGISTER
'
,
"
jabber:iq:register
"
);
Strophe
.
addNamespace
(
'
MUC_ROOMCONF
'
,
Strophe
.
NS
.
MUC
+
"
#roomconfig
"
);
Strophe
.
addNamespace
(
'
MUC_USER
'
,
Strophe
.
NS
.
MUC
+
"
#user
"
);
converse
.
MUC_NICK_CHANGED_CODE
=
"
303
"
;
converse
.
MUC_NICK_CHANGED_CODE
=
"
303
"
;
converse
.
ROOM_FEATURES
=
[
converse
.
ROOM_FEATURES
=
[
'
passwordprotected
'
,
'
unsecured
'
,
'
hidden
'
,
'
publicroom
'
,
'
membersonly
'
,
'
open
'
,
'
persistent
'
,
'
temporary
'
,
'
nonanonymous
'
,
'
semianonymous
'
,
'
moderated
'
,
'
unmoderated
'
,
'
mam_enabled
'
];
];
converse
.
ROOMSTATUS
=
{
converse
.
ROOMSTATUS
=
{
CONNECTED
:
0
,
CONNECTING
:
1
,
NICKNAME_REQUIRED
:
2
,
PASSWORD_REQUIRED
:
3
,
DISCONNECTED
:
4
,
ENTERED
:
5
};
};
converse
.
plugins
.
add
(
'
converse-muc
'
,
{
converse
.
plugins
.
add
(
'
converse-muc
'
,
{
/* Optional dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
* this plugin. They are called "optional" because they might not be
...
...
@@ -1458,20 +1453,17 @@
* true
* );
*/
'
open
'
(
jids
,
attrs
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
_converse
.
api
.
waitUntil
(
'
chatBoxesFetched
'
).
then
(()
=>
{
'
open
'
:
async
function
(
jids
,
attrs
)
{
await
_converse
.
api
.
waitUntil
(
'
chatBoxesFetched
'
);
if
(
_
.
isUndefined
(
jids
))
{
const
err_msg
=
'
rooms.open: You need to provide at least one JID
'
;
_converse
.
log
(
err_msg
,
Strophe
.
LogLevel
.
ERROR
);
reject
(
new
TypeError
(
err_msg
));
throw
(
new
TypeError
(
err_msg
));
}
else
if
(
_
.
isString
(
jids
))
{
resolve
(
_converse
.
api
.
rooms
.
create
(
jids
,
attrs
).
trigger
(
'
show
'
)
);
return
_converse
.
api
.
rooms
.
create
(
jids
,
attrs
).
trigger
(
'
show
'
);
}
else
{
resolve
(
_
.
map
(
jids
,
(
jid
)
=>
_converse
.
api
.
rooms
.
create
(
jid
,
attrs
).
trigger
(
'
show
'
)
));
return
_
.
map
(
jids
,
(
jid
)
=>
_converse
.
api
.
rooms
.
create
(
jid
,
attrs
).
trigger
(
'
show
'
));
}
});
});
},
/**
...
...
@@ -1524,5 +1516,4 @@
});
/************************ END API ************************/
}
});
}));
});
src/headless/converse-ping.js
View file @
6904f9a8
...
...
@@ -7,14 +7,14 @@
/* This is a Converse.js plugin which add support for application-level pings
* as specified in XEP-0199 XMPP Ping.
*/
(
function
(
root
,
factory
)
{
define
([
"
./converse-core
"
,
"
strophejs-plugin-ping
"
],
factory
);
}(
this
,
function
(
converse
)
{
"
use strict
"
;
// Strophe methods for building stanzas
const
{
Strophe
,
_
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-ping
'
,
{
import
"
strophejs-plugin-ping
"
;
import
converse
from
"
./converse-core
"
;
// Strophe methods for building stanzas
const
{
Strophe
,
_
}
=
converse
.
env
;
converse
.
plugins
.
add
(
'
converse-ping
'
,
{
initialize
()
{
/* The initialize function gets called as soon as the plugin is
...
...
@@ -90,5 +90,4 @@
_converse
.
on
(
'
connected
'
,
onConnected
);
_converse
.
on
(
'
reconnected
'
,
onConnected
);
}
});
}));
});
src/headless/converse-vcard.js
View file @
6904f9a8
...
...
@@ -4,15 +4,15 @@
// Copyright (c) 2013-2018, the Converse.js developers
// Licensed under the Mozilla Public License (MPLv2)
(
function
(
root
,
factory
)
{
define
([
"
./converse-core
"
,
"
./templates/vcard.html
"
],
factory
);
}(
this
,
function
(
converse
,
tpl_vcard
)
{
"
use strict
"
;
const
{
Backbone
,
Promise
,
Strophe
,
_
,
$iq
,
$build
,
b64_sha1
,
moment
,
sizzle
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
import
converse
from
"
./converse-core
"
;
import
tpl_vcard
from
"
./templates/vcard.html
"
;
converse
.
plugins
.
add
(
'
converse-vcard
'
,
{
const
{
Backbone
,
Promise
,
Strophe
,
_
,
$iq
,
$build
,
b64_sha1
,
moment
,
sizzle
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
converse
.
plugins
.
add
(
'
converse-vcard
'
,
{
initialize
()
{
/* The initialize function gets called as soon as the plugin is
...
...
@@ -239,5 +239,4 @@
}
});
}
});
}));
});
src/headless/utils/core.js
View file @
6904f9a8
This diff is collapsed.
Click to expand it.
src/headless/utils/emoji.js
View file @
6904f9a8
This diff is collapsed.
Click to expand it.
src/headless/utils/form.js
View file @
6904f9a8
...
...
@@ -5,18 +5,12 @@
//
// Copyright (c) 2013-2018, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define */
(
function
(
root
,
factory
)
{
define
([
"
../lodash.noconflict
"
,
"
./core
"
,
"
../templates/field.html
"
],
factory
);
}(
this
,
function
(
_
,
u
,
tpl_field
)
{
"
use strict
"
;
u
.
webForm2xForm
=
function
(
field
)
{
import
_
from
"
../lodash.noconflict
"
;
import
tpl_field
from
"
../templates/field.html
"
;
import
u
from
"
./core
"
;
u
.
webForm2xForm
=
function
(
field
)
{
/* Takes an HTML DOM and turns it into an XForm field.
*
* Parameters:
...
...
@@ -38,6 +32,5 @@
'
value
'
:
value
})
);
};
return
u
;
}));
};
export
default
u
;
src/headless/utils/muc.js
View file @
6904f9a8
...
...
@@ -3,18 +3,19 @@
//
// This is the utilities module.
//
// Copyright (c) 201
2-2017
, Jan-Carel Brand <jc@opkode.com>
// Copyright (c) 201
3-2018
, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define, escape, Jed */
(
function
(
root
,
factory
)
{
define
([
"
../converse-core
"
,
"
./core
"
],
factory
);
}(
this
,
function
(
converse
,
u
)
{
"
use strict
"
;
/*global escape, Jed */
const
{
Strophe
,
sizzle
,
_
}
=
converse
.
env
;
u
.
computeAffiliationsDelta
=
function
computeAffiliationsDelta
(
exclude_existing
,
remove_absentees
,
new_list
,
old_list
)
{
import
converse
from
"
@converse/headless/converse-core
"
;
import
u
from
"
./core
"
;
const
{
Strophe
,
sizzle
,
_
}
=
converse
.
env
;
u
.
computeAffiliationsDelta
=
function
computeAffiliationsDelta
(
exclude_existing
,
remove_absentees
,
new_list
,
old_list
)
{
/* Given two lists of objects with 'jid', 'affiliation' and
* 'reason' properties, return a new list containing
* those objects that are new, changed or removed
...
...
@@ -69,9 +70,9 @@
);
}
return
delta
;
};
};
u
.
parseMemberListIQ
=
function
parseMemberListIQ
(
iq
)
{
u
.
parseMemberListIQ
=
function
parseMemberListIQ
(
iq
)
{
/* Given an IQ stanza with a member list, create an array of member objects.
*/
return
_
.
map
(
...
...
@@ -99,5 +100,5 @@
return
data
;
}
);
};
}));
};
src/utils/html.js
View file @
6904f9a8
This diff is collapsed.
Click to expand it.
tests/utils.js
View file @
6904f9a8
...
...
@@ -112,6 +112,8 @@
modal
.
el
.
querySelector
(
'
input[name="chatroom"]
'
).
value
=
jid
;
modal
.
el
.
querySelector
(
'
input[name="nickname"]
'
).
value
=
nick
;
modal
.
el
.
querySelector
(
'
form input[type="submit"]
'
).
click
();
await
utils
.
waitUntil
(()
=>
_converse
.
chatboxviews
.
get
(
jid
),
1000
);
return
_converse
.
chatboxviews
.
get
(
jid
);
};
utils
.
openChatRoom
=
function
(
_converse
,
room
,
server
,
nick
)
{
...
...
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