From 7c17d34d125e3b33cfa3e7f0fce446626a9f1f4b Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 29 Apr 2020 12:30:59 +0200 Subject: [PATCH] Fix errors --- www/common/common-interface.js | 4 ++++ www/common/common-ui-elements.js | 3 ++- www/common/drive-ui.js | 4 +++- www/common/outer/mailbox-handlers.js | 4 +--- www/common/sframe-common-codemirror.js | 8 +++++--- www/common/toolbar3.js | 8 +++++--- www/kanban/inner.js | 1 + 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index b2cd042a8..74209dedd 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -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 diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index a5c1396c2..e1264b853 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -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) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 6638e02db..36aa241e5 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -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", diff --git a/www/common/outer/mailbox-handlers.js b/www/common/outer/mailbox-handlers.js index fec467fc5..a8a9e44fd 100644 --- a/www/common/outer/mailbox-handlers.js +++ b/www/common/outer/mailbox-handlers.js @@ -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); } diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index dc046cd62..e6ed9ded2 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -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' }); diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 09f7784a6..e2be585d1 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -312,7 +312,8 @@ MessengerUI, Messages) { } else if (friendRequests[data.curvePublic]) { $('