Fix errors

pull/1/head
yflory 5 years ago
parent d35b015c3f
commit 7c17d34d12

@ -1053,6 +1053,10 @@ define([
}).forEach(function (obj) {
opts[obj.name.slice(11)] = obj.value;
});
if (!el.getAttribute('data-cptippy-html') && !el.fixHTML) {
el.setAttribute('title', Util.fixHTML(el.getAttribute('title'))); // fixHTML
el.fixHTML = true; // Don't clean HTML twice on the same element
}
Tippy(el, opts);
};
// This is the robust solution to remove dangling tooltips

@ -2754,6 +2754,7 @@ define([
var origin = privateData.origin;
var createHelper = function (href, text) {
var q = h('a.cp-creation-help.fa.fa-question-circle', {
'data-cptippy-html': true,
title: text,
href: origin + href,
target: "_blank",
@ -2777,7 +2778,7 @@ define([
common.displayAvatar($(avatar), data.avatar, data.name);
return h('div.cp-creation-team', {
'data-id': id,
title: data.name,
title: Util.fixHTML(data.name),
},[
avatar,
h('span.cp-creation-team-name', data.name)

@ -1903,7 +1903,8 @@ define([
}
if (data.filename && data.filename !== data.title) {
var $renamed = $renamedIcon.clone().appendTo($state);
$renamed.attr('title', Messages._getKey('fm_renamedPad', [data.title]));
$renamed.attr('data-cptippy-html', 'true');
$renamed.attr('title', Messages._getKey('fm_renamedPad', [Util.fixHTML(data.title)]));
}
if (hrefData.hashData && hrefData.hashData.password) {
var $password = $passwordIcon.clone().appendTo($state);
@ -2407,6 +2408,7 @@ define([
var createHelper = function (href, text) {
var q = h('a.fa.fa-question-circle', {
style: 'text-decoration: none !important;',
'data-cptippy-html': true,
title: text,
href: APP.origin + href,
target: "_blank",

@ -27,9 +27,7 @@ define([
var userData = data.msg.content.user || data.msg.content;
// Check if the request is valid (send by the correct user)
if (data.msg.author !== userData.curvePublic) {
return void cb(true);
}
if (data.msg.author !== userData.curvePublic) { return void cb(true); }
if (isMuted(ctx, data)) { return void cb(true); }

@ -509,11 +509,12 @@ define([
var cursorPosS = posToCursor(cursor.selectionStart, doc);
var el = makeCursor(id);
if (cursor.color) {
$(el).css('border-color', cursor.color);
$(el).css('background-color', cursor.color);
$(el).css('border-color', cursor.color)
.css('background-color', cursor.color);
}
if (cursor.name) {
$(el).attr('title', makeTippy(cursor));
$(el).attr('title', makeTippy(cursor))
.attr('data-cptippy-html', true);
}
marks[id] = editor.setBookmark(cursorPosS, { widget: el });
} else {
@ -524,6 +525,7 @@ define([
: 'background-color: rgba(255,0,0,0.2)';
marks[id] = editor.markText(pos1, pos2, {
css: css,
'data-cptippy-html': true,
title: makeTippy(cursor),
className: 'cp-tippy-html'
});

@ -312,7 +312,8 @@ MessengerUI, Messages) {
} else if (friendRequests[data.curvePublic]) {
$('<button>', {
'class': 'fa fa-bell cp-toolbar-userlist-button',
'title': Messages._getKey('friendRequest_received', [name]),
'data-cptippy-html': true,
'title': Messages._getKey('friendRequest_received', [Util.fixHTML(name)]),
}).appendTo($nameSpan).click(function (e) {
e.stopPropagation();
UIElements.displayFriendRequestModal(Common, friendRequests[data.curvePublic]);
@ -321,8 +322,9 @@ MessengerUI, Messages) {
} else {
$('<button>', {
'class': 'fa fa-user-plus cp-toolbar-userlist-button',
'data-cptippy-html': true,
'title': Messages._getKey('userlist_addAsFriendTitle', [
name
Util.fixHTML(name)
])
}).appendTo($nameSpan).click(function (e) {
e.stopPropagation();
@ -334,7 +336,7 @@ MessengerUI, Messages) {
} else if (Common.isLoggedIn() && data.curvePublic && friends[data.curvePublic]) {
$('<button>', {
'class': 'fa fa-comments-o cp-toolbar-userlist-button',
'title': Messages.userlist_chat
'title': Messages.contact_chat
}).appendTo($nameSpan).click(function (e) {
e.stopPropagation();
Common.openURL('/contacts/');

@ -102,6 +102,7 @@ define([
}
var avatar = h('span.cp-cursor.cp-tippy-html', {
style: "background-color: " + (cursor.color || 'red') + ";"+text,
'data-cptippy-html': true,
title: html
}, l);
if (!noClear) {

Loading…
Cancel
Save