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
99bdf235
Commit
99bdf235
authored
Aug 07, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Newly generated build
parent
2d054878
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
41 deletions
+46
-41
css/converse.css
css/converse.css
+2
-2
dist/converse.js
dist/converse.js
+44
-39
No files found.
css/converse.css
View file @
99bdf235
...
@@ -7507,7 +7507,7 @@ body.reset {
...
@@ -7507,7 +7507,7 @@ body.reset {
margin
:
0
;
margin
:
0
;
padding
:
0.25em
;
padding
:
0.25em
;
display
:
block
;
display
:
block
;
border-top
:
8
px
solid
#3AA569
;
border-top
:
4
px
solid
#3AA569
;
background-color
:
white
;
background-color
:
white
;
color
:
#3AA569
;
}
color
:
#3AA569
;
}
#conversejs
.chatbox
.sendXMPPMessage
.chat-toolbar
.fa
,
#conversejs
.chatbox
.sendXMPPMessage
.chat-toolbar
.fa
:hover
{
#conversejs
.chatbox
.sendXMPPMessage
.chat-toolbar
.fa
,
#conversejs
.chatbox
.sendXMPPMessage
.chat-toolbar
.fa
:hover
{
...
@@ -8672,7 +8672,7 @@ body.reset {
...
@@ -8672,7 +8672,7 @@ body.reset {
#conversejs
.converse-embedded
.chatroom
.sendXMPPMessage
.chat-toolbar
,
#conversejs
.converse-embedded
.chatroom
.sendXMPPMessage
.chat-toolbar
,
#conversejs
.chatroom
.sendXMPPMessage
.chat-toolbar
{
#conversejs
.chatroom
.sendXMPPMessage
.chat-toolbar
{
background-color
:
white
;
background-color
:
white
;
border-top
:
8
px
solid
#E77051
;
border-top
:
4
px
solid
#E77051
;
color
:
#E77051
;
}
color
:
#E77051
;
}
#conversejs
.converse-embedded
.chatroom
.sendXMPPMessage
.chat-toolbar
.fa
,
#conversejs
.converse-embedded
.chatroom
.sendXMPPMessage
.chat-toolbar
.fa
:hover
,
#conversejs
.converse-embedded
.chatroom
.sendXMPPMessage
.chat-toolbar
.fa
,
#conversejs
.converse-embedded
.chatroom
.sendXMPPMessage
.chat-toolbar
.fa
:hover
,
#conversejs
.chatroom
.sendXMPPMessage
.chat-toolbar
.fa
,
#conversejs
.chatroom
.sendXMPPMessage
.chat-toolbar
.fa
,
...
...
dist/converse.js
View file @
99bdf235
...
@@ -70191,7 +70191,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -70191,7 +70191,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.showMessage(message);
this.showMessage(message);
if (message.get('correcting')) {
if (message.get('correcting')) {
this.insertIntoTextArea(message.get('message'), true);
this.insertIntoTextArea(message.get('message'), true
, true
);
}
}
_converse.emit('messageAdded', {
_converse.emit('messageAdded', {
...
@@ -70332,10 +70332,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -70332,10 +70332,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
}
message.save('correcting', true);
message.save('correcting', true);
this.insertIntoTextArea(message.get('message'), true);
this.insertIntoTextArea(message.get('message'), true
, true
);
} else {
} else {
message.save('correcting', false);
message.save('correcting', false);
this.insertIntoTextArea('', true);
this.insertIntoTextArea('', true
, false
);
}
}
},
},
...
@@ -70358,10 +70358,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -70358,10 +70358,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
}
if (message) {
if (message) {
this.insertIntoTextArea(message.get('message'), true);
this.insertIntoTextArea(message.get('message'), true
, true
);
message.save('correcting', true);
message.save('correcting', true);
} else {
} else {
this.insertIntoTextArea('', true);
this.insertIntoTextArea('', true
, false
);
}
}
},
},
...
@@ -70386,7 +70386,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -70386,7 +70386,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
message = message || this.getOwnMessages().findLast(msg => msg.get('message'));
message = message || this.getOwnMessages().findLast(msg => msg.get('message'));
if (message) {
if (message) {
this.insertIntoTextArea(message.get('message'), true);
this.insertIntoTextArea(message.get('message'), true
, true
);
message.save('correcting', true);
message.save('correcting', true);
}
}
},
},
...
@@ -70414,10 +70414,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -70414,10 +70414,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return this;
return this;
},
},
insertIntoTextArea(value, replace = false) {
insertIntoTextArea(value, replace = false
, correcting = false
) {
const textarea = this.el.querySelector('.chat-textarea');
const textarea = this.el.querySelector('.chat-textarea');
if (correcting) {
u.addClass('correcting', textarea);
} else {
u.removeClass('correcting', textarea);
}
if (replace) {
if (replace) {
textarea.value = '';
textarea.value = value;
textarea.value = value;
} else {
} else {
let existing = textarea.value;
let existing = textarea.value;
...
@@ -70426,10 +70433,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -70426,10 +70433,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
existing = existing + ' ';
existing = existing + ' ';
}
}
textarea.value = '';
textarea.value = existing + value + ' ';
textarea.value = existing + value + ' ';
}
}
textarea.focus(
);
u.putCurserAtEnd(textarea
);
},
},
createEmojiPicker() {
createEmojiPicker() {
...
@@ -75823,11 +75831,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -75823,11 +75831,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
_converse.api.settings.update({
_converse.api.settings.update({
auto_list_rooms
: false,
'auto_list_rooms'
: false,
hide_muc_server
: false,
'hide_muc_server'
: false,
// TODO: no longer implemented...
// TODO: no longer implemented...
muc_disable_moderator_commands
: false,
'muc_disable_moderator_commands'
: false,
visible_toolbar_buttons
: {
'visible_toolbar_buttons'
: {
'toggle_occupants': true
'toggle_occupants': true
}
}
});
});
...
@@ -76143,6 +76151,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -76143,6 +76151,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
ev.preventDefault();
ev.preventDefault();
const data = this.parseRoomDataFromEvent(ev.target);
const data = this.parseRoomDataFromEvent(ev.target);
if (data.nick === "") {
// Make sure defaults apply if no nick is provided.
data.nick = undefined;
}
_converse.api.rooms.open(data.jid, data);
_converse.api.rooms.open(data.jid, data);
this.modal.hide();
this.modal.hide();
...
@@ -76244,6 +76257,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -76244,6 +76257,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.el.innerHTML = tpl_chatroom();
this.el.innerHTML = tpl_chatroom();
this.renderHeading();
this.renderHeading();
this.renderChatArea();
this.renderChatArea();
this.renderMessageForm();
if (this.model.get('connection_status') !== converse.ROOMSTATUS.ENTERED) {
if (this.model.get('connection_status') !== converse.ROOMSTATUS.ENTERED) {
this.showSpinner();
this.showSpinner();
...
@@ -76263,14 +76277,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -76263,14 +76277,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
if (_.isNull(this.el.querySelector('.chat-area'))) {
if (_.isNull(this.el.querySelector('.chat-area'))) {
const container_el = this.el.querySelector('.chatroom-body');
const container_el = this.el.querySelector('.chatroom-body');
container_el.insertAdjacentHTML('beforeend', tpl_chatarea({
container_el.insertAdjacentHTML('beforeend', tpl_chatarea({
'label_message': __('Message'),
'show_send_button': _converse.show_send_button
'label_send': __('Send'),
'show_send_button': _converse.show_send_button,
'show_toolbar': _converse.show_toolbar,
'unread_msgs': __('You have unread messages')
}));
}));
container_el.insertAdjacentElement('beforeend', this.occupantsview.el);
container_el.insertAdjacentElement('beforeend', this.occupantsview.el);
this.renderToolbar(tpl_chatroom_toolbar);
this.content = this.el.querySelector('.chat-content');
this.content = this.el.querySelector('.chat-content');
this.toggleOccupants(null, true);
this.toggleOccupants(null, true);
}
}
...
@@ -77841,7 +77850,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -77841,7 +77850,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
'affiliation': null,
'affiliation': null,
'connection_status': converse.ROOMSTATUS.DISCONNECTED,
'connection_status': converse.ROOMSTATUS.DISCONNECTED,
'name': '',
'name': '',
'nick': _converse.xmppstatus.get('nickname'),
'nick': _converse.xmppstatus.get('nickname')
|| _converse.nickname
,
'description': '',
'description': '',
'features_fetched': false,
'features_fetched': false,
'roomconfig': {},
'roomconfig': {},
...
@@ -84333,31 +84342,13 @@ return __p
...
@@ -84333,31 +84342,13 @@ return __p
var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
module.exports = function(o) {
module.exports = function(o) {
var __t, __p = '', __
e = _.escape, __
j = Array.prototype.join;
var __t, __p = '', __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
function print() { __p += __j.call(arguments, '') }
__p += '<!-- src/templates/chatarea.html -->\n<div class="chat-area col">\n <div class="chat-content ';
__p += '<!-- src/templates/chatarea.html -->\n<div class="chat-area col">\n <div class="chat-content ';
if (o.show_send_button) { ;
if (o.show_send_button) { ;
__p += 'chat-content-sendbutton';
__p += 'chat-content-sendbutton';
} ;
} ;
__p += '"></div>\n <div class="new-msgs-indicator hidden">▼ ' +
__p += '"></div>\n <div class="message-form-container"/>\n</div>\n';
__e( o.unread_msgs ) +
' ▼</div>\n <form class="sendXMPPMessage">\n ';
if (o.show_toolbar) { ;
__p += '\n <ul class="chat-toolbar no-text-select"></ul>\n ';
} ;
__p += '\n <textarea type="text" class="chat-textarea ';
if (o.show_send_button) { ;
__p += 'chat-textarea-send-button';
} ;
__p += '"\n placeholder="' +
__e(o.label_message) +
'"></textarea>\n ';
if (o.show_send_button) { ;
__p += '\n <button type="submit" class="pure-button send-button">' +
__e( o.label_send ) +
'</button>\n ';
} ;
__p += '\n </form>\n</div>\n';
return __p
return __p
};
};
...
@@ -88038,6 +88029,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -88038,6 +88029,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return result;
return result;
};
};
u.putCurserAtEnd = function (textarea) {
if (textarea !== document.activeElement) {
textarea.focus();
} // Double the length because Opera is inconsistent about whether a carriage return is one character or two.
const len = textarea.value.length * 2; // Timeout seems to be required for Blink
setTimeout(() => textarea.setSelectionRange(len, len), 1); // Scroll to the bottom, in case we're in a tall textarea
// (Necessary for Firefox and Chrome)
this.scrollTop = 999999;
};
u.getUniqueId = function () {
u.getUniqueId = function () {
return 'xxxxxxxx-xxxx'.replace(/[x]/g, function (c) {
return 'xxxxxxxx-xxxx'.replace(/[x]/g, function (c) {
var r = Math.random() * 16 | 0,
var r = Math.random() * 16 | 0,
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