diff --git a/converse.js b/converse.js index 6811c2fbe..13deaf649 100644 --- a/converse.js +++ b/converse.js @@ -47,6 +47,7 @@ require.config({ "converse-api": "src/converse-api", "converse-controlbox": "src/converse-controlbox", "converse-core": "src/converse-core", + "converse-headline": "src/converse-notification", "converse-muc": "src/converse-muc", "converse-notification": "src/converse-notification", "converse-otr": "src/converse-otr", @@ -230,6 +231,7 @@ if (typeof define !== 'undefined') { "converse-register", // XEP-0077 In-band registration "converse-ping", // XEP-0199 XMPP Ping "converse-notification",// HTML5 Notifications + "converse-headline", // Support for headline messages /* END: Removable components */ ], function(converse_api) { diff --git a/src/converse-core.js b/src/converse-core.js index 0a40d71be..206f2f3f7 100755 --- a/src/converse-core.js +++ b/src/converse-core.js @@ -1468,9 +1468,10 @@ .html(converse.templates.chatbox( _.extend(this.model.toJSON(), { show_toolbar: converse.show_toolbar, + show_textarea: true, + title: this.model.get('fullname'), info_close: __('Close this chat box'), info_minimize: __('Minimize this chat box'), - info_view: __('View more information on this person'), label_personal_message: __('Personal message') } ) diff --git a/src/converse-headline.js b/src/converse-headline.js new file mode 100644 index 000000000..56336a2bf --- /dev/null +++ b/src/converse-headline.js @@ -0,0 +1,33 @@ +// Converse.js (A browser based XMPP chat client) +// http://conversejs.org +// +// Copyright (c) 2012-2016, Jan-Carel Brand +// Licensed under the Mozilla Public License (MPLv2) +// +/*global define */ + +(function (root, factory) { + define("converse-headline", ["converse-core", "converse-api"], factory); +}(this, function (converse, converse_api) { + "use strict"; + var $ = converse_api.env.jQuery, + utils = converse_api.env.utils, + Strophe = converse_api.env.Strophe, + _ = converse_api.env._; + // For translations + var __ = utils.__.bind(converse); + var ___ = utils.___; + + var supports_html5_notification = "Notification" in window; + + + converse_api.plugins.add('headline', { + + initialize: function () { + /* The initialize function gets called as soon as the plugin is + * loaded by converse.js's plugin machinery. + */ + // TODO + } + }); +})); diff --git a/src/templates/chatbox.html b/src/templates/chatbox.html index 5a185fc1a..39dd7efbf 100644 --- a/src/templates/chatbox.html +++ b/src/templates/chatbox.html @@ -9,7 +9,7 @@ {[ if (url) { ]} {[ } ]} - {{ fullname }} + {{ title }} {[ if (url) { ]} {[ } ]} @@ -18,6 +18,7 @@
+ {[ if (show_textarea) { ]}
{[ if (show_toolbar) { ]}
    @@ -27,5 +28,6 @@ class="chat-textarea" placeholder="{{label_personal_message}}"/>
    + {[ } ]}