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
90d1071d
Commit
90d1071d
authored
Sep 23, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load templates in the respective plugins
parent
aef32fed
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
245 additions
and
1482 deletions
+245
-1482
config.js
config.js
+0
-4
dist/templates.js
dist/templates.js
+0
-1282
docs/CHANGES.md
docs/CHANGES.md
+1
-0
docs/source/builds.rst
docs/source/builds.rst
+19
-16
non_amd.html
non_amd.html
+20
-20
src/converse-chatview.js
src/converse-chatview.js
+24
-2
src/converse-controlbox.js
src/converse-controlbox.js
+46
-4
src/converse-core.js
src/converse-core.js
+6
-3
src/converse-minimize.js
src/converse-minimize.js
+14
-1
src/converse-muc.js
src/converse-muc.js
+41
-1
src/converse-otr.js
src/converse-otr.js
+4
-2
src/converse-register.js
src/converse-register.js
+20
-1
src/converse-rosterview.js
src/converse-rosterview.js
+23
-2
src/converse-templates.js
src/converse-templates.js
+0
-119
src/converse-vcard.js
src/converse-vcard.js
+0
-1
src/templates/pending_contacts.html
src/templates/pending_contacts.html
+0
-1
src/templates/requesting_contacts.html
src/templates/requesting_contacts.html
+0
-1
src/templates/vcard.html
src/templates/vcard.html
+0
-12
src/utils.js
src/utils.js
+27
-10
No files found.
config.js
View file @
90d1071d
...
@@ -60,7 +60,6 @@ require.config({
...
@@ -60,7 +60,6 @@ require.config({
"
converse-ping
"
:
"
src/converse-ping
"
,
"
converse-ping
"
:
"
src/converse-ping
"
,
"
converse-register
"
:
"
src/converse-register
"
,
"
converse-register
"
:
"
src/converse-register
"
,
"
converse-rosterview
"
:
"
src/converse-rosterview
"
,
"
converse-rosterview
"
:
"
src/converse-rosterview
"
,
"
converse-templates
"
:
"
src/converse-templates
"
,
"
converse-vcard
"
:
"
src/converse-vcard
"
,
"
converse-vcard
"
:
"
src/converse-vcard
"
,
// Off-the-record-encryption
// Off-the-record-encryption
...
@@ -155,13 +154,11 @@ require.config({
...
@@ -155,13 +154,11 @@ require.config({
"
new_day
"
:
"
src/templates/new_day
"
,
"
new_day
"
:
"
src/templates/new_day
"
,
"
occupant
"
:
"
src/templates/occupant
"
,
"
occupant
"
:
"
src/templates/occupant
"
,
"
pending_contact
"
:
"
src/templates/pending_contact
"
,
"
pending_contact
"
:
"
src/templates/pending_contact
"
,
"
pending_contacts
"
:
"
src/templates/pending_contacts
"
,
"
register_panel
"
:
"
src/templates/register_panel
"
,
"
register_panel
"
:
"
src/templates/register_panel
"
,
"
register_tab
"
:
"
src/templates/register_tab
"
,
"
register_tab
"
:
"
src/templates/register_tab
"
,
"
registration_form
"
:
"
src/templates/registration_form
"
,
"
registration_form
"
:
"
src/templates/registration_form
"
,
"
registration_request
"
:
"
src/templates/registration_request
"
,
"
registration_request
"
:
"
src/templates/registration_request
"
,
"
requesting_contact
"
:
"
src/templates/requesting_contact
"
,
"
requesting_contact
"
:
"
src/templates/requesting_contact
"
,
"
requesting_contacts
"
:
"
src/templates/requesting_contacts
"
,
"
room_description
"
:
"
src/templates/room_description
"
,
"
room_description
"
:
"
src/templates/room_description
"
,
"
room_item
"
:
"
src/templates/room_item
"
,
"
room_item
"
:
"
src/templates/room_item
"
,
"
room_panel
"
:
"
src/templates/room_panel
"
,
"
room_panel
"
:
"
src/templates/room_panel
"
,
...
@@ -174,7 +171,6 @@ require.config({
...
@@ -174,7 +171,6 @@ require.config({
"
toolbar
"
:
"
src/templates/toolbar
"
,
"
toolbar
"
:
"
src/templates/toolbar
"
,
"
toolbar_otr
"
:
"
src/templates/toolbar_otr
"
,
"
toolbar_otr
"
:
"
src/templates/toolbar_otr
"
,
"
trimmed_chat
"
:
"
src/templates/trimmed_chat
"
,
"
trimmed_chat
"
:
"
src/templates/trimmed_chat
"
,
"
vcard
"
:
"
src/templates/vcard
"
,
"
chatbox_minimize
"
:
"
src/templates/chatbox_minimize
"
"
chatbox_minimize
"
:
"
src/templates/chatbox_minimize
"
},
},
...
...
dist/templates.js
deleted
100644 → 0
View file @
aef32fed
This diff is collapsed.
Click to expand it.
docs/CHANGES.md
View file @
90d1071d
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
listeners with
`converse.listen.on`
and
`converse.listen.once`
. [jcbrand]
listeners with
`converse.listen.on`
and
`converse.listen.once`
. [jcbrand]
-
New event
[
'rosterContactsFetched'
](
https://conversejs.org/docs/html/development.html#rosterContactsFetched
)
[
jcbrand
]
-
New event
[
'rosterContactsFetched'
](
https://conversejs.org/docs/html/development.html#rosterContactsFetched
)
[
jcbrand
]
-
New event
[
'rosterGroupsFetched'
](
https://conversejs.org/docs/html/development.html#rosterGroupsFetched
)
[
jcbrand
]
-
New event
[
'rosterGroupsFetched'
](
https://conversejs.org/docs/html/development.html#rosterGroupsFetched
)
[
jcbrand
]
-
HTML templates are now loaded in the respective modules/plugins. [jcbrand]
## 2.0.0 (2016-09-16)
## 2.0.0 (2016-09-16)
-
#656 Online users count not shown initially [amanzur]
-
#656 Online users count not shown initially [amanzur]
...
...
docs/source/builds.rst
View file @
90d1071d
...
@@ -23,38 +23,41 @@ Creating builds
...
@@ -23,38 +23,41 @@ Creating builds
Creating builds and distribution files
Creating builds and distribution files
======================================
======================================
We use `require.js <http://requirejs.org>`_ to keep track of *Converse.js* and
Converse.js uses `AMD (Asynchronous Modules Definition) <http://requirejs.org/docs/whyamd.html#amd>`_
its dependencies and to to bundle them together in a single file fit for
to define modules and their dependencies.
deployment to a production site.
To create the distributable bundles, simply run::
Dependencies can then be loaded on-the-fly with `require.js <http://requirejs.org>`_.
This is very useful during development, but when it comes to
deployement, it's usually desired to create a single, minified distribution build.
For this, the `r.js optimizer <http://requirejs.org/docs/optimization.html>`_
is used together with `almond.js <https://github.com/requirejs/almond>`_, which
is a minimal AMD API implementation that replaces require.js in builds (in
order to keep the build smaller).
To create the distribution build, simply run::
make dist
make dist
This command does the following:
This command does the following:
* It creates different Javascript bundles of Converse.js.
* It creates different builds of Converse.js in the ``./dist/`` directory.
The individual javascript files will be bundled and minified with `require.js`_'s
optimization tool, using `almond <https://github.com/jrburke/almond>`_.
You can `read more about require.js's optimizer here <http://requirejs.org/docs/optimization.html>`_.
* It bundles the HTML templates in ``./src/templates/`` into a single file called ``templates.js``.
This file can then be included via the ``<script>`` tag. See for example the ``non_amd.html`` example page.
* It bundles all the translation files in ``./locale/`` into a single file ``locales.js``.
* It bundles all the translation files in ``./locale/`` into a single file ``locales.js``.
This file can then be included via the ``<script>`` tag. See for example the ``non_amd.html`` example page.
This file can then be included via the ``<script>`` tag. See for example the ``non_amd.html`` example page.
* Also, the CSS files in the ``./css`` directory will be minified.
* Also, the CSS files in the ``./css`` directory will be minified.
The
built Javasript bund
les are contained in the ``./dist`` directory:
The
Javascript build fi
les are contained in the ``./dist`` directory:
.. code-block:: bash
.. code-block:: bash
jc@conversejs:~/converse.js (master)$ ls dist/
jc@conversejs:~/converse.js (master)$ ls dist/
converse.js converse-no-dependencies.js
converse-mobile.js converse.min.js
converse.min.js converse-no-dependencies.min.js
converse-mobile.min.js converse.nojquery.js
converse.nojquery.js locales.js
converse-no-dependencies.js converse.nojquery.min.js
converse.nojquery.min.js templates.js
converse-no-dependencies.min.js locales.js
converse.js
.. _`minification`:
.. _`minification`:
...
...
non_amd.html
View file @
90d1071d
...
@@ -14,31 +14,31 @@
...
@@ -14,31 +14,31 @@
<link
type=
"text/css"
rel=
"stylesheet"
media=
"screen"
href=
"css/converse.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
media=
"screen"
href=
"css/converse.css"
/>
<!-- BEGIN JQUERY -->
<!-- BEGIN JQUERY -->
<script
type=
"text/javascript"
src=
"
component
s/jquery/dist/jquery.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/jquery/dist/jquery.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/jquery.browser/dist/jquery.browser.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/jquery.browser/dist/jquery.browser.js"
></script>
<script
type=
"text/javascript"
src=
"components/typeahead.js/index.js"
></script>
<script
type=
"text/javascript"
src=
"components/typeahead.js/index.js"
></script>
<!-- END JQUERY -->
<!-- END JQUERY -->
<!-- BEGIN OTR: Off-the-record encryption stuff. Can be omitted if OTR is not used. -->
<!-- BEGIN OTR: Off-the-record encryption stuff. Can be omitted if OTR is not used. -->
<script
type=
"text/javascript"
src=
"
component
s/otr/build/dep/salsa20.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/build/dep/salsa20.js"
></script>
<script
type=
"text/javascript"
src=
"src/bigint.js"
></script>
<script
type=
"text/javascript"
src=
"src/bigint.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/vendor/cryptojs/core.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/vendor/cryptojs/core.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/vendor/cryptojs/enc-base64.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/vendor/cryptojs/enc-base64.js"
></script>
<script
type=
"text/javascript"
src=
"components/crypto-js-evanvosberg/src/md5.js"
></script>
<script
type=
"text/javascript"
src=
"components/crypto-js-evanvosberg/src/md5.js"
></script>
<script
type=
"text/javascript"
src=
"components/crypto-js-evanvosberg/src/evpkdf.js"
></script>
<script
type=
"text/javascript"
src=
"components/crypto-js-evanvosberg/src/evpkdf.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/vendor/cryptojs/cipher-core.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/vendor/cryptojs/cipher-core.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/vendor/cryptojs/aes.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/vendor/cryptojs/aes.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/vendor/cryptojs/sha1.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/vendor/cryptojs/sha1.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/vendor/cryptojs/sha256.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/vendor/cryptojs/sha256.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/vendor/cryptojs/hmac.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/vendor/cryptojs/hmac.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/vendor/cryptojs/pad-nopadding.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/vendor/cryptojs/pad-nopadding.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/vendor/cryptojs/mode-ctr.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/vendor/cryptojs/mode-ctr.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/otr/build/dep/eventemitter.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/otr/build/dep/eventemitter.js"
></script>
<script
type=
"text/javascript"
src=
"src/otr.js"
></script>
<script
type=
"text/javascript"
src=
"src/otr.js"
></script>
<!-- END OTR -->
<!-- END OTR -->
<!-- BEGIN STROPHE -->
<!-- BEGIN STROPHE -->
<script
type=
"text/javascript"
src=
"
components/strophe
js/strophe.js"
></script>
<script
type=
"text/javascript"
src=
"
node_modules/strophe.
js/strophe.js"
></script>
<script
type=
"text/javascript"
src=
"components/strophejs-plugins/vcard/strophe.vcard.js"
></script>
<script
type=
"text/javascript"
src=
"components/strophejs-plugins/vcard/strophe.vcard.js"
></script>
<script
type=
"text/javascript"
src=
"components/strophejs-plugins/disco/strophe.disco.js"
></script>
<script
type=
"text/javascript"
src=
"components/strophejs-plugins/disco/strophe.disco.js"
></script>
<script
type=
"text/javascript"
src=
"components/strophejs-plugins/rsm/strophe.rsm.js"
></script>
<script
type=
"text/javascript"
src=
"components/strophejs-plugins/rsm/strophe.rsm.js"
></script>
...
@@ -46,10 +46,10 @@
...
@@ -46,10 +46,10 @@
<!-- END STROPHE -->
<!-- END STROPHE -->
<!-- BEGIN BACKBONE -->
<!-- BEGIN BACKBONE -->
<script
type=
"text/javascript"
src=
"
component
s/underscore/underscore.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/underscore/underscore.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/backbone//backbone.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/backbone//backbone.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/backbone.browserStorage/backbone.browserStorage.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/backbone.browserStorage/backbone.browserStorage.js"
></script>
<script
type=
"text/javascript"
src=
"
component
s/backbone.overview/backbone.overview.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/backbone.overview/backbone.overview.js"
></script>
<!-- END BACKBONE -->
<!-- END BACKBONE -->
<!-- BEGIN I18N -->
<!-- BEGIN I18N -->
...
@@ -59,11 +59,11 @@
...
@@ -59,11 +59,11 @@
src/locales.js to remove those you don't need, and then run `make
src/locales.js to remove those you don't need, and then run `make
build` to generates a new dist/locales.js file.
build` to generates a new dist/locales.js file.
-->
-->
<script
type=
"text/javascript"
src=
"
component
s/jed/jed.js"
></script>
<script
type=
"text/javascript"
src=
"
node_module
s/jed/jed.js"
></script>
<script
type=
"text/javascript"
src=
"dist/locales.js"
></script>
<script
type=
"text/javascript"
src=
"dist/locales.js"
></script>
<!-- END I18N -->
<!-- END I18N -->
<script
type=
"text/javascript"
src=
"
components/momentjs
/min/moment-with-locales.js"
></script>
<script
type=
"text/javascript"
src=
"
node_modules/moment
/min/moment-with-locales.js"
></script>
<script
type=
"text/javascript"
src=
"dist/converse-no-dependencies.js"
></script>
<script
type=
"text/javascript"
src=
"dist/converse-no-dependencies.js"
></script>
</head>
</head>
<body
id=
"page-top"
data-spy=
"scroll"
data-target=
".navbar-custom"
>
<body
id=
"page-top"
data-spy=
"scroll"
data-target=
".navbar-custom"
>
...
...
src/converse-chatview.js
View file @
90d1071d
...
@@ -7,9 +7,31 @@
...
@@ -7,9 +7,31 @@
/*global Backbone, define */
/*global Backbone, define */
(
function
(
root
,
factory
)
{
(
function
(
root
,
factory
)
{
define
(
"
converse-chatview
"
,
[
"
converse-core
"
,
"
converse-api
"
],
factory
);
define
(
"
converse-chatview
"
,
[
}(
this
,
function
(
converse
,
converse_api
)
{
"
converse-core
"
,
"
converse-api
"
,
"
tpl!chatbox
"
,
"
tpl!new_day
"
,
"
tpl!action
"
,
"
tpl!message
"
,
"
tpl!toolbar
"
],
factory
);
}(
this
,
function
(
converse
,
converse_api
,
tpl_chatbox
,
tpl_new_day
,
tpl_action
,
tpl_message
,
tpl_toolbar
)
{
"
use strict
"
;
"
use strict
"
;
converse
.
templates
.
chatbox
=
tpl_chatbox
;
converse
.
templates
.
new_day
=
tpl_new_day
;
converse
.
templates
.
action
=
tpl_action
;
converse
.
templates
.
message
=
tpl_message
;
converse
.
templates
.
toolbar
=
tpl_toolbar
;
var
$
=
converse_api
.
env
.
jQuery
,
var
$
=
converse_api
.
env
.
jQuery
,
utils
=
converse_api
.
env
.
utils
,
utils
=
converse_api
.
env
.
utils
,
Strophe
=
converse_api
.
env
.
Strophe
,
Strophe
=
converse_api
.
env
.
Strophe
,
...
...
src/converse-controlbox.js
View file @
90d1071d
...
@@ -10,12 +10,54 @@
...
@@ -10,12 +10,54 @@
define
(
"
converse-controlbox
"
,
[
define
(
"
converse-controlbox
"
,
[
"
converse-core
"
,
"
converse-core
"
,
"
converse-api
"
,
"
converse-api
"
,
// TODO: The next two dependencies can be made optional
"
tpl!add_contact_dropdown
"
,
"
converse-rosterview
"
,
"
tpl!add_contact_form
"
,
"
converse-chatview
"
"
tpl!change_status_message
"
,
"
tpl!chat_status
"
,
"
tpl!choose_status
"
,
"
tpl!contacts_panel
"
,
"
tpl!contacts_tab
"
,
"
tpl!controlbox
"
,
"
tpl!controlbox_toggle
"
,
"
tpl!login_panel
"
,
"
tpl!login_tab
"
,
"
tpl!search_contact
"
,
"
tpl!status_option
"
,
"
converse-chatview
"
,
"
converse-rosterview
"
],
factory
);
],
factory
);
}(
this
,
function
(
converse
,
converse_api
)
{
}(
this
,
function
(
converse
,
converse_api
,
tpl_add_contact_dropdown
,
tpl_add_contact_form
,
tpl_change_status_message
,
tpl_chat_status
,
tpl_choose_status
,
tpl_contacts_panel
,
tpl_contacts_tab
,
tpl_controlbox
,
tpl_controlbox_toggle
,
tpl_login_panel
,
tpl_login_tab
,
tpl_search_contact
,
tpl_status_option
)
{
"
use strict
"
;
"
use strict
"
;
converse
.
templates
.
add_contact_dropdown
=
tpl_add_contact_dropdown
;
converse
.
templates
.
add_contact_form
=
tpl_add_contact_form
;
converse
.
templates
.
change_status_message
=
tpl_change_status_message
;
converse
.
templates
.
chat_status
=
tpl_chat_status
;
converse
.
templates
.
choose_status
=
tpl_choose_status
;
converse
.
templates
.
contacts_panel
=
tpl_contacts_panel
;
converse
.
templates
.
contacts_tab
=
tpl_contacts_tab
;
converse
.
templates
.
controlbox
=
tpl_controlbox
;
converse
.
templates
.
controlbox_toggle
=
tpl_controlbox_toggle
;
converse
.
templates
.
login_panel
=
tpl_login_panel
;
converse
.
templates
.
login_tab
=
tpl_login_tab
;
converse
.
templates
.
search_contact
=
tpl_search_contact
;
converse
.
templates
.
status_option
=
tpl_status_option
;
// Strophe methods for building stanzas
// Strophe methods for building stanzas
var
Strophe
=
converse_api
.
env
.
Strophe
,
var
Strophe
=
converse_api
.
env
.
Strophe
,
utils
=
converse_api
.
env
.
utils
;
utils
=
converse_api
.
env
.
utils
;
...
...
src/converse-core.js
View file @
90d1071d
...
@@ -22,13 +22,16 @@
...
@@ -22,13 +22,16 @@
"
utils
"
,
"
utils
"
,
"
moment_with_locales
"
,
"
moment_with_locales
"
,
"
strophe
"
,
"
strophe
"
,
"
converse-templates
"
,
"
pluggable
"
,
"
pluggable
"
,
"
tpl!chats_panel
"
,
"
strophe.disco
"
,
"
strophe.disco
"
,
"
backbone.browserStorage
"
,
"
backbone.browserStorage
"
,
"
backbone.overview
"
,
"
backbone.overview
"
,
],
factory
);
],
factory
);
}(
this
,
function
(
$
,
_
,
dummy
,
utils
,
moment
,
Strophe
,
templates
,
pluggable
)
{
}(
this
,
function
(
$
,
_
,
dummy
,
utils
,
moment
,
Strophe
,
pluggable
,
tpl_chats_panel
)
{
/*
/*
* Cannot use this due to Safari bug.
* Cannot use this due to Safari bug.
* See https://github.com/jcbrand/converse.js/issues/196
* See https://github.com/jcbrand/converse.js/issues/196
...
@@ -59,7 +62,7 @@
...
@@ -59,7 +62,7 @@
var
event_context
=
{};
var
event_context
=
{};
var
converse
=
{
var
converse
=
{
templates
:
templates
,
templates
:
{
'
chats_panel
'
:
tpl_chats_panel
}
,
emit
:
function
(
evt
,
data
)
{
emit
:
function
(
evt
,
data
)
{
$
(
event_context
).
trigger
(
evt
,
data
);
$
(
event_context
).
trigger
(
evt
,
data
);
...
...
src/converse-minimize.js
View file @
90d1071d
...
@@ -10,12 +10,25 @@
...
@@ -10,12 +10,25 @@
define
(
"
converse-minimize
"
,
[
define
(
"
converse-minimize
"
,
[
"
converse-core
"
,
"
converse-core
"
,
"
converse-api
"
,
"
converse-api
"
,
"
tpl!chatbox_minimize
"
,
"
tpl!toggle_chats
"
,
"
tpl!trimmed_chat
"
,
"
converse-controlbox
"
,
"
converse-controlbox
"
,
"
converse-chatview
"
,
"
converse-chatview
"
,
"
converse-muc
"
"
converse-muc
"
],
factory
);
],
factory
);
}(
this
,
function
(
converse
,
converse_api
)
{
}(
this
,
function
(
converse
,
converse_api
,
tpl_chatbox_minimize
,
tpl_toggle_chats
,
tpl_trimmed_chat
)
{
"
use strict
"
;
"
use strict
"
;
converse
.
templates
.
chatbox_minimize
=
tpl_chatbox_minimize
;
converse
.
templates
.
toggle_chats
=
tpl_toggle_chats
;
converse
.
templates
.
trimmed_chat
=
tpl_trimmed_chat
;
var
$
=
converse_api
.
env
.
jQuery
,
var
$
=
converse_api
.
env
.
jQuery
,
_
=
converse_api
.
env
.
_
,
_
=
converse_api
.
env
.
_
,
b64_sha1
=
converse_api
.
env
.
b64_sha1
,
b64_sha1
=
converse_api
.
env
.
b64_sha1
,
...
...
src/converse-muc.js
View file @
90d1071d
...
@@ -13,11 +13,51 @@
...
@@ -13,11 +13,51 @@
define
(
"
converse-muc
"
,
[
define
(
"
converse-muc
"
,
[
"
converse-core
"
,
"
converse-core
"
,
"
converse-api
"
,
"
converse-api
"
,
"
tpl!chatarea
"
,
"
tpl!chatroom
"
,
"
tpl!chatroom_form
"
,
"
tpl!chatroom_nickname_form
"
,
"
tpl!chatroom_password_form
"
,
"
tpl!chatroom_sidebar
"
,
"
tpl!chatrooms_tab
"
,
"
tpl!info
"
,
"
tpl!occupant
"
,
"
tpl!room_description
"
,
"
tpl!room_item
"
,
"
tpl!room_panel
"
,
"
typeahead
"
,
"
typeahead
"
,
"
converse-chatview
"
"
converse-chatview
"
],
factory
);
],
factory
);
}(
this
,
function
(
converse
,
converse_api
)
{
}(
this
,
function
(
converse
,
converse_api
,
tpl_chatarea
,
tpl_chatroom
,
tpl_chatroom_form
,
tpl_chatroom_nickname_form
,
tpl_chatroom_password_form
,
tpl_chatroom_sidebar
,
tpl_chatrooms_tab
,
tpl_info
,
tpl_occupant
,
tpl_room_description
,
tpl_room_item
,
tpl_room_panel
)
{
"
use strict
"
;
"
use strict
"
;
converse
.
templates
.
chatarea
=
tpl_chatarea
;
converse
.
templates
.
chatroom
=
tpl_chatroom
;
converse
.
templates
.
chatroom_form
=
tpl_chatroom_form
;
converse
.
templates
.
chatroom_nickname_form
=
tpl_chatroom_nickname_form
;
converse
.
templates
.
chatroom_password_form
=
tpl_chatroom_password_form
;
converse
.
templates
.
chatroom_sidebar
=
tpl_chatroom_sidebar
;
converse
.
templates
.
chatrooms_tab
=
tpl_chatrooms_tab
;
converse
.
templates
.
info
=
tpl_info
;
converse
.
templates
.
occupant
=
tpl_occupant
;
converse
.
templates
.
room_description
=
tpl_room_description
;
converse
.
templates
.
room_item
=
tpl_room_item
;
converse
.
templates
.
room_panel
=
tpl_room_panel
;
// Strophe methods for building stanzas
// Strophe methods for building stanzas
var
Strophe
=
converse_api
.
env
.
Strophe
,
var
Strophe
=
converse_api
.
env
.
Strophe
,
$iq
=
converse_api
.
env
.
$iq
,
$iq
=
converse_api
.
env
.
$iq
,
...
...
src/converse-otr.js
View file @
90d1071d
...
@@ -13,10 +13,12 @@
...
@@ -13,10 +13,12 @@
define
(
"
converse-otr
"
,
[
define
(
"
converse-otr
"
,
[
"
otr
"
,
"
otr
"
,
"
converse-core
"
,
"
converse-core
"
,
"
converse-api
"
"
converse-api
"
,
"
tpl!toolbar_otr
"
],
factory
);
],
factory
);
}(
this
,
function
(
otr
,
converse
,
converse_api
)
{
}(
this
,
function
(
otr
,
converse
,
converse_api
,
tpl_toolbar_otr
)
{
"
use strict
"
;
"
use strict
"
;
converse
.
templates
.
toolbar_otr
=
tpl_toolbar_otr
;
// Strophe methods for building stanzas
// Strophe methods for building stanzas
var
Strophe
=
converse_api
.
env
.
Strophe
,
var
Strophe
=
converse_api
.
env
.
Strophe
,
utils
=
converse_api
.
env
.
utils
,
utils
=
converse_api
.
env
.
utils
,
...
...
src/converse-register.js
View file @
90d1071d
...
@@ -13,10 +13,29 @@
...
@@ -13,10 +13,29 @@
define
(
"
converse-register
"
,
[
define
(
"
converse-register
"
,
[
"
converse-core
"
,
"
converse-core
"
,
"
converse-api
"
,
"
converse-api
"
,
"
tpl!form_username
"
,
"
tpl!register_panel
"
,
"
tpl!register_tab
"
,
"
tpl!registration_form
"
,
"
tpl!registration_request
"
,
"
converse-controlbox
"
"
converse-controlbox
"
],
factory
);
],
factory
);
}(
this
,
function
(
converse
,
converse_api
)
{
}(
this
,
function
(
converse
,
converse_api
,
tpl_form_username
,
tpl_register_panel
,
tpl_register_tab
,
tpl_registration_form
,
tpl_registration_request
)
{
"
use strict
"
;
"
use strict
"
;
converse
.
templates
.
form_username
=
tpl_form_username
;
converse
.
templates
.
register_panel
=
tpl_register_panel
;
converse
.
templates
.
register_tab
=
tpl_register_tab
;
converse
.
templates
.
registration_form
=
tpl_registration_form
;
converse
.
templates
.
registration_request
=
tpl_registration_request
;
// Strophe methods for building stanzas
// Strophe methods for building stanzas
var
Strophe
=
converse_api
.
env
.
Strophe
,
var
Strophe
=
converse_api
.
env
.
Strophe
,
utils
=
converse_api
.
env
.
utils
,
utils
=
converse_api
.
env
.
utils
,
...
...
src/converse-rosterview.js
View file @
90d1071d
...
@@ -7,9 +7,30 @@
...
@@ -7,9 +7,30 @@
/*global Backbone, define */
/*global Backbone, define */
(
function
(
root
,
factory
)
{
(
function
(
root
,
factory
)
{
define
(
"
converse-rosterview
"
,
[
"
converse-core
"
,
"
converse-api
"
],
factory
);
define
(
"
converse-rosterview
"
,
[
}(
this
,
function
(
converse
,
converse_api
)
{
"
converse-core
"
,
"
converse-api
"
,
"
tpl!group_header
"
,
"
tpl!pending_contact
"
,
"
tpl!requesting_contact
"
,
"
tpl!roster
"
,
"
tpl!roster_item
"
],
factory
);
}(
this
,
function
(
converse
,
converse_api
,
tpl_group_header
,
tpl_pending_contact
,
tpl_requesting_contact
,
tpl_roster
,
tpl_roster_item
)
{
"
use strict
"
;
"
use strict
"
;
converse
.
templates
.
group_header
=
tpl_group_header
;
converse
.
templates
.
pending_contact
=
tpl_pending_contact
;
converse
.
templates
.
requesting_contact
=
tpl_requesting_contact
;
converse
.
templates
.
roster
=
tpl_roster
;
converse
.
templates
.
roster_item
=
tpl_roster_item
;
var
$
=
converse_api
.
env
.
jQuery
,
var
$
=
converse_api
.
env
.
jQuery
,
utils
=
converse_api
.
env
.
utils
,
utils
=
converse_api
.
env
.
utils
,
Strophe
=
converse_api
.
env
.
Strophe
,
Strophe
=
converse_api
.
env
.
Strophe
,
...
...
src/converse-templates.js
deleted
100644 → 0
View file @
aef32fed
define
(
"
converse-templates
"
,
[
"
tpl!action
"
,
"
tpl!add_contact_dropdown
"
,
"
tpl!add_contact_form
"
,
"
tpl!change_status_message
"
,
"
tpl!chat_status
"
,
"
tpl!chatarea
"
,
"
tpl!chatbox
"
,
"
tpl!chatroom
"
,
"
tpl!chatroom_form
"
,
"
tpl!chatroom_password_form
"
,
"
tpl!chatroom_nickname_form
"
,
"
tpl!chatroom_sidebar
"
,
"
tpl!chatrooms_tab
"
,
"
tpl!chats_panel
"
,
"
tpl!choose_status
"
,
"
tpl!contacts_panel
"
,
"
tpl!contacts_tab
"
,
"
tpl!controlbox
"
,
"
tpl!controlbox_toggle
"
,
"
tpl!field
"
,
"
tpl!form_captcha
"
,
"
tpl!form_checkbox
"
,
"
tpl!form_input
"
,
"
tpl!form_select
"
,
"
tpl!form_textarea
"
,
"
tpl!form_username
"
,
"
tpl!group_header
"
,
"
tpl!info
"
,
"
tpl!login_panel
"
,
"
tpl!login_tab
"
,
"
tpl!message
"
,
"
tpl!new_day
"
,
"
tpl!occupant
"
,
"
tpl!pending_contact
"
,
"
tpl!pending_contacts
"
,
"
tpl!register_panel
"
,
"
tpl!register_tab
"
,
"
tpl!registration_form
"
,
"
tpl!registration_request
"
,
"
tpl!requesting_contact
"
,
"
tpl!requesting_contacts
"
,
"
tpl!room_description
"
,
"
tpl!room_item
"
,
"
tpl!room_panel
"
,
"
tpl!roster
"
,
"
tpl!roster_item
"
,
"
tpl!search_contact
"
,
"
tpl!select_option
"
,
"
tpl!status_option
"
,
"
tpl!toggle_chats
"
,
"
tpl!toolbar
"
,
"
tpl!toolbar_otr
"
,
"
tpl!trimmed_chat
"
,
"
tpl!vcard
"
,
// Can be removed together with converse-minimize.js
// if minimization/trimming features not needed (for example for mobile
// apps).
"
tpl!chatbox_minimize
"
,
],
function
()
{
return
{
action
:
arguments
[
0
],
add_contact_dropdown
:
arguments
[
1
],
add_contact_form
:
arguments
[
2
],
change_status_message
:
arguments
[
3
],
chat_status
:
arguments
[
4
],
chatarea
:
arguments
[
5
],
chatbox
:
arguments
[
6
],
chatroom
:
arguments
[
7
],
chatroom_form
:
arguments
[
8
],
chatroom_password_form
:
arguments
[
9
],
chatroom_nickname_form
:
arguments
[
10
],
chatroom_sidebar
:
arguments
[
11
],
chatrooms_tab
:
arguments
[
12
],
chats_panel
:
arguments
[
13
],
choose_status
:
arguments
[
14
],
contacts_panel
:
arguments
[
15
],
contacts_tab
:
arguments
[
16
],
controlbox
:
arguments
[
17
],
controlbox_toggle
:
arguments
[
18
],
field
:
arguments
[
19
],
form_captcha
:
arguments
[
20
],
form_checkbox
:
arguments
[
21
],
form_input
:
arguments
[
22
],
form_select
:
arguments
[
23
],
form_textarea
:
arguments
[
24
],
form_username
:
arguments
[
25
],
group_header
:
arguments
[
26
],
info
:
arguments
[
27
],
login_panel
:
arguments
[
28
],
login_tab
:
arguments
[
29
],
message
:
arguments
[
30
],
new_day
:
arguments
[
31
],
occupant
:
arguments
[
32
],
pending_contact
:
arguments
[
33
],
pending_contacts
:
arguments
[
34
],
register_panel
:
arguments
[
35
],
register_tab
:
arguments
[
36
],
registration_form
:
arguments
[
37
],
registration_request
:
arguments
[
38
],
requesting_contact
:
arguments
[
39
],
requesting_contacts
:
arguments
[
40
],
room_description
:
arguments
[
41
],
room_item
:
arguments
[
42
],
room_panel
:
arguments
[
43
],
roster
:
arguments
[
44
],
roster_item
:
arguments
[
45
],
search_contact
:
arguments
[
46
],
select_option
:
arguments
[
47
],
status_option
:
arguments
[
48
],
toggle_chats
:
arguments
[
49
],
toolbar
:
arguments
[
50
],
toolbar_otr
:
arguments
[
51
],
trimmed_chat
:
arguments
[
52
],
vcard
:
arguments
[
53
],
chatbox_minimize
:
arguments
[
54
]
};
});
src/converse-vcard.js
View file @
90d1071d
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
_
=
converse_api
.
env
.
_
,
_
=
converse_api
.
env
.
_
,
moment
=
converse_api
.
env
.
moment
;
moment
=
converse_api
.
env
.
moment
;
converse_api
.
plugins
.
add
(
'
converse-vcard
'
,
{
converse_api
.
plugins
.
add
(
'
converse-vcard
'
,
{
overrides
:
{
overrides
:
{
...
...
src/templates/pending_contacts.html
deleted
100644 → 0
View file @
aef32fed
<dt
class=
"roster-group"
id=
"pending-xmpp-contacts"
><a
href=
"#"
class=
"group-toggle icon-{{toggle_state}}"
title=
"{{desc_group_toggle}}"
>
{{label_pending_contacts}}
</a></dt>
src/templates/requesting_contacts.html
deleted
100644 → 0
View file @
aef32fed
<dt
class=
"roster-group"
id=
"xmpp-contact-requests"
><a
href=
"#"
class=
"group-toggle icon-{{toggle_state}}"
title=
"{{desc_group_toggle}}"
>
{{label_contact_requests}}
</a></dt>
src/templates/vcard.html
deleted
100644 → 0
View file @
aef32fed
<form
class=
"pure-form converse-form vcard-info"
>
<fieldset>
<legend>
The VCard info gets rendered here
</legend>
<label>
Full name:
</label>
{{fullname}}
<label>
URL:
</label>
{{url}}
</fieldset>
<fieldset>
<input
type=
"button"
class=
"pure-button button-cancel"
value=
"{{label_return}}"
/>
</fieldset>
</form>
src/utils.js
View file @
90d1071d
...
@@ -4,9 +4,26 @@
...
@@ -4,9 +4,26 @@
"
jquery
"
,
"
jquery
"
,
"
jquery.browser
"
,
"
jquery.browser
"
,
"
underscore
"
,
"
underscore
"
,
"
converse-templates
"
"
tpl!field
"
,
"
tpl!select_option
"
,
"
tpl!form_select
"
,
"
tpl!form_textarea
"
,
"
tpl!form_checkbox
"
,
"
tpl!form_username
"
,
"
tpl!form_input
"
,
"
tpl!form_captcha
"
],
factory
);
],
factory
);
}(
this
,
function
(
$
,
dummy
,
_
,
templates
)
{
}(
this
,
function
(
$
,
dummy
,
_
,
tpl_field
,
tpl_select_option
,
tpl_form_select
,
tpl_form_textarea
,
tpl_form_checkbox
,
tpl_form_username
,
tpl_form_input
,
tpl_form_captcha
)
{
"
use strict
"
;
"
use strict
"
;
var
XFORM_TYPE_MAP
=
{
var
XFORM_TYPE_MAP
=
{
...
@@ -249,7 +266,7 @@
...
@@ -249,7 +266,7 @@
}
else
{
}
else
{
value
=
$input
.
val
();
value
=
$input
.
val
();
}
}
return
$
(
t
emplates
.
field
({
return
$
(
t
pl_
field
({
name
:
$input
.
attr
(
'
name
'
),
name
:
$input
.
attr
(
'
name
'
),
value
:
value
value
:
value
}))[
0
];
}))[
0
];
...
@@ -291,14 +308,14 @@
...
@@ -291,14 +308,14 @@
$options
=
$field
.
children
(
'
option
'
);
$options
=
$field
.
children
(
'
option
'
);
for
(
j
=
0
;
j
<
$options
.
length
;
j
++
)
{
for
(
j
=
0
;
j
<
$options
.
length
;
j
++
)
{
value
=
$
(
$options
[
j
]).
find
(
'
value
'
).
text
();
value
=
$
(
$options
[
j
]).
find
(
'
value
'
).
text
();
options
.
push
(
t
emplates
.
select_option
({
options
.
push
(
t
pl_
select_option
({
value
:
value
,
value
:
value
,
label
:
$
(
$options
[
j
]).
attr
(
'
label
'
),
label
:
$
(
$options
[
j
]).
attr
(
'
label
'
),
selected
:
(
values
.
indexOf
(
value
)
>=
0
),
selected
:
(
values
.
indexOf
(
value
)
>=
0
),
required
:
$field
.
find
(
'
required
'
).
length
required
:
$field
.
find
(
'
required
'
).
length
}));
}));
}
}
return
t
emplates
.
form_select
({
return
t
pl_
form_select
({
name
:
$field
.
attr
(
'
var
'
),
name
:
$field
.
attr
(
'
var
'
),
label
:
$field
.
attr
(
'
label
'
),
label
:
$field
.
attr
(
'
label
'
),
options
:
options
.
join
(
''
),
options
:
options
.
join
(
''
),
...
@@ -308,14 +325,14 @@
...
@@ -308,14 +325,14 @@
}
else
if
(
$field
.
attr
(
'
type
'
)
===
'
fixed
'
)
{
}
else
if
(
$field
.
attr
(
'
type
'
)
===
'
fixed
'
)
{
return
$
(
'
<p class="form-help">
'
).
text
(
$field
.
find
(
'
value
'
).
text
());
return
$
(
'
<p class="form-help">
'
).
text
(
$field
.
find
(
'
value
'
).
text
());
}
else
if
(
$field
.
attr
(
'
type
'
)
===
'
jid-multi
'
)
{
}
else
if
(
$field
.
attr
(
'
type
'
)
===
'
jid-multi
'
)
{
return
t
emplates
.
form_textarea
({
return
t
pl_
form_textarea
({
name
:
$field
.
attr
(
'
var
'
),
name
:
$field
.
attr
(
'
var
'
),
label
:
$field
.
attr
(
'
label
'
)
||
''
,
label
:
$field
.
attr
(
'
label
'
)
||
''
,
value
:
$field
.
find
(
'
value
'
).
text
(),
value
:
$field
.
find
(
'
value
'
).
text
(),
required
:
$field
.
find
(
'
required
'
).
length
required
:
$field
.
find
(
'
required
'
).
length
});
});
}
else
if
(
$field
.
attr
(
'
type
'
)
===
'
boolean
'
)
{
}
else
if
(
$field
.
attr
(
'
type
'
)
===
'
boolean
'
)
{
return
t
emplates
.
form_checkbox
({
return
t
pl_
form_checkbox
({
name
:
$field
.
attr
(
'
var
'
),
name
:
$field
.
attr
(
'
var
'
),
type
:
XFORM_TYPE_MAP
[
$field
.
attr
(
'
type
'
)],
type
:
XFORM_TYPE_MAP
[
$field
.
attr
(
'
type
'
)],
label
:
$field
.
attr
(
'
label
'
)
||
''
,
label
:
$field
.
attr
(
'
label
'
)
||
''
,
...
@@ -323,7 +340,7 @@
...
@@ -323,7 +340,7 @@
required
:
$field
.
find
(
'
required
'
).
length
required
:
$field
.
find
(
'
required
'
).
length
});
});
}
else
if
(
$field
.
attr
(
'
type
'
)
&&
$field
.
attr
(
'
var
'
)
===
'
username
'
)
{
}
else
if
(
$field
.
attr
(
'
type
'
)
&&
$field
.
attr
(
'
var
'
)
===
'
username
'
)
{
return
t
emplates
.
form_username
({
return
t
pl_
form_username
({
domain
:
'
@
'
+
this
.
domain
,
domain
:
'
@
'
+
this
.
domain
,
name
:
$field
.
attr
(
'
var
'
),
name
:
$field
.
attr
(
'
var
'
),
type
:
XFORM_TYPE_MAP
[
$field
.
attr
(
'
type
'
)],
type
:
XFORM_TYPE_MAP
[
$field
.
attr
(
'
type
'
)],
...
@@ -332,7 +349,7 @@
...
@@ -332,7 +349,7 @@
required
:
$field
.
find
(
'
required
'
).
length
required
:
$field
.
find
(
'
required
'
).
length
});
});
}
else
if
(
$field
.
attr
(
'
type
'
))
{
}
else
if
(
$field
.
attr
(
'
type
'
))
{
return
t
emplates
.
form_input
({
return
t
pl_
form_input
({
name
:
$field
.
attr
(
'
var
'
),
name
:
$field
.
attr
(
'
var
'
),
type
:
XFORM_TYPE_MAP
[
$field
.
attr
(
'
type
'
)],
type
:
XFORM_TYPE_MAP
[
$field
.
attr
(
'
type
'
)],
label
:
$field
.
attr
(
'
label
'
)
||
''
,
label
:
$field
.
attr
(
'
label
'
)
||
''
,
...
@@ -343,7 +360,7 @@
...
@@ -343,7 +360,7 @@
if
(
$field
.
attr
(
'
var
'
)
===
'
ocr
'
)
{
// Captcha
if
(
$field
.
attr
(
'
var
'
)
===
'
ocr
'
)
{
// Captcha
return
_
.
reduce
(
_
.
map
(
$field
.
find
(
'
uri
'
),
return
_
.
reduce
(
_
.
map
(
$field
.
find
(
'
uri
'
),
$
.
proxy
(
function
(
uri
)
{
$
.
proxy
(
function
(
uri
)
{
return
t
emplates
.
form_captcha
({
return
t
pl_
form_captcha
({
label
:
this
.
$field
.
attr
(
'
label
'
),
label
:
this
.
$field
.
attr
(
'
label
'
),
name
:
this
.
$field
.
attr
(
'
var
'
),
name
:
this
.
$field
.
attr
(
'
var
'
),
data
:
this
.
$stanza
.
find
(
'
data[cid="
'
+
uri
.
textContent
.
replace
(
/^cid:/
,
''
)
+
'
"]
'
).
text
(),
data
:
this
.
$stanza
.
find
(
'
data[cid="
'
+
uri
.
textContent
.
replace
(
/^cid:/
,
''
)
+
'
"]
'
).
text
(),
...
...
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