Commit a1b31cd1 authored by JC Brand's avatar JC Brand

Initial work on adding support for headline messages.

parent 86a1b662
...@@ -47,6 +47,7 @@ require.config({ ...@@ -47,6 +47,7 @@ require.config({
"converse-api": "src/converse-api", "converse-api": "src/converse-api",
"converse-controlbox": "src/converse-controlbox", "converse-controlbox": "src/converse-controlbox",
"converse-core": "src/converse-core", "converse-core": "src/converse-core",
"converse-headline": "src/converse-notification",
"converse-muc": "src/converse-muc", "converse-muc": "src/converse-muc",
"converse-notification": "src/converse-notification", "converse-notification": "src/converse-notification",
"converse-otr": "src/converse-otr", "converse-otr": "src/converse-otr",
...@@ -230,6 +231,7 @@ if (typeof define !== 'undefined') { ...@@ -230,6 +231,7 @@ if (typeof define !== 'undefined') {
"converse-register", // XEP-0077 In-band registration "converse-register", // XEP-0077 In-band registration
"converse-ping", // XEP-0199 XMPP Ping "converse-ping", // XEP-0199 XMPP Ping
"converse-notification",// HTML5 Notifications "converse-notification",// HTML5 Notifications
"converse-headline", // Support for headline messages
/* END: Removable components */ /* END: Removable components */
], function(converse_api) { ], function(converse_api) {
......
...@@ -1468,9 +1468,10 @@ ...@@ -1468,9 +1468,10 @@
.html(converse.templates.chatbox( .html(converse.templates.chatbox(
_.extend(this.model.toJSON(), { _.extend(this.model.toJSON(), {
show_toolbar: converse.show_toolbar, show_toolbar: converse.show_toolbar,
show_textarea: true,
title: this.model.get('fullname'),
info_close: __('Close this chat box'), info_close: __('Close this chat box'),
info_minimize: __('Minimize this chat box'), info_minimize: __('Minimize this chat box'),
info_view: __('View more information on this person'),
label_personal_message: __('Personal message') label_personal_message: __('Personal message')
} }
) )
......
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
// Copyright (c) 2012-2016, Jan-Carel Brand <jc@opkode.com>
// 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
}
});
}));
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
{[ if (url) { ]} {[ if (url) { ]}
<a href="{{url}}" target="_blank" class="user"> <a href="{{url}}" target="_blank" class="user">
{[ } ]} {[ } ]}
{{ fullname }} {{ title }}
{[ if (url) { ]} {[ if (url) { ]}
</a> </a>
{[ } ]} {[ } ]}
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
</div> </div>
<div class="chat-body"> <div class="chat-body">
<div class="chat-content"></div> <div class="chat-content"></div>
{[ if (show_textarea) { ]}
<form class="sendXMPPMessage" action="" method="post"> <form class="sendXMPPMessage" action="" method="post">
{[ if (show_toolbar) { ]} {[ if (show_toolbar) { ]}
<ul class="chat-toolbar no-text-select"></ul> <ul class="chat-toolbar no-text-select"></ul>
...@@ -27,5 +28,6 @@ ...@@ -27,5 +28,6 @@
class="chat-textarea" class="chat-textarea"
placeholder="{{label_personal_message}}"/> placeholder="{{label_personal_message}}"/>
</form> </form>
{[ } ]}
</div> </div>
</div> </div>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment