remove references to old emoji-panel package

pull/1387/head
Audric Ackermann 5 years ago
parent 8f92ae7812
commit f5818817e9
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1,8 +1,6 @@
/* global /* global
$, $,
_, _,
emojiData,
EmojiPanel,
extension, extension,
i18n, i18n,
Signal, Signal,
@ -372,7 +370,6 @@
this.$('.send-message').focus(this.focusBottomBar.bind(this)); this.$('.send-message').focus(this.focusBottomBar.bind(this));
this.$('.send-message').blur(this.unfocusBottomBar.bind(this)); this.$('.send-message').blur(this.unfocusBottomBar.bind(this));
this.$emojiPanelContainer = this.$('.emoji-panel-container');
this.model.updateTextInputState(); this.model.updateTextInputState();
this.selectMember = this.selectMember.bind(this); this.selectMember = this.selectMember.bind(this);
@ -414,7 +411,6 @@
'click .bottom-bar': 'focusMessageField', 'click .bottom-bar': 'focusMessageField',
'click .capture-audio .microphone': 'captureAudio', 'click .capture-audio .microphone': 'captureAudio',
'click .module-scroll-down': 'scrollToBottom', 'click .module-scroll-down': 'scrollToBottom',
'click button.emoji': 'toggleEmojiPanel',
'focus .send-message': 'focusBottomBar', 'focus .send-message': 'focusBottomBar',
'change .file-input': 'toggleMicrophone', 'change .file-input': 'toggleMicrophone',
'blur .send-message': 'unfocusBottomBar', 'blur .send-message': 'unfocusBottomBar',
@ -484,9 +480,10 @@
}, },
onDisableInput(disable) { onDisableInput(disable) {
this.$( this.$('button.microphone, button.paperclip, .send-message').attr(
'button.emoji, button.microphone, button.paperclip, .send-message' 'disabled',
).attr('disabled', disable); disable
);
}, },
onChangePlaceholder(type) { onChangePlaceholder(type) {
@ -1497,14 +1494,6 @@
this.model.resetMessageSelection(); this.model.resetMessageSelection();
}, },
toggleEmojiPanel(e) {
e.preventDefault();
if (!this.emojiPanel) {
this.openEmojiPanel();
} else {
this.closeEmojiPanel();
}
},
onKeyDown(event) { onKeyDown(event) {
if (event.key !== 'Escape') { if (event.key !== 'Escape') {
return; return;
@ -1516,44 +1505,6 @@
// Up and down arrows should scroll // Up and down arrows should scroll
// Alt + up and down should swap between conversations / setting categories // Alt + up and down should swap between conversations / setting categories
this.model.resetMessageSelection(); this.model.resetMessageSelection();
this.closeEmojiPanel();
},
openEmojiPanel() {
this.$emojiPanelContainer.outerHeight(200);
this.emojiPanel = new EmojiPanel(this.$emojiPanelContainer[0], {
onClick: this.insertEmoji.bind(this),
});
this.view.resetScrollPosition();
this.updateMessageFieldSize({});
},
closeEmojiPanel() {
if (this.emojiPanel === null) {
return;
}
this.$emojiPanelContainer.empty().outerHeight(0);
this.emojiPanel = null;
this.view.resetScrollPosition();
this.updateMessageFieldSize({});
},
insertEmoji(e) {
const colons = `:${emojiData[e.index].short_name}:`;
const textarea = this.$messageField[0];
if (textarea.selectionStart || textarea.selectionStart === 0) {
const startPos = textarea.selectionStart;
const endPos = textarea.selectionEnd;
textarea.value =
textarea.value.substring(0, startPos) +
colons +
textarea.value.substring(endPos, textarea.value.length);
textarea.selectionStart = startPos + colons.length;
textarea.selectionEnd = startPos + colons.length;
} else {
textarea.value += colons;
}
this.focusMessageField();
}, },
async setQuoteMessage(message) { async setQuoteMessage(message) {
@ -1621,13 +1572,11 @@
async sendMessage(e) { async sendMessage(e) {
this.removeLastSeenIndicator(); this.removeLastSeenIndicator();
this.closeEmojiPanel();
this.model.clearTypingTimers(); this.model.clearTypingTimers();
const input = this.$messageField; const input = this.$messageField;
let message = this.memberView.replaceMentions(input.val()); const message = this.memberView.replaceMentions(input.val());
message = window.Signal.Emoji.replaceColons(message).trim();
const toastOptions = { type: 'info' }; const toastOptions = { type: 'info' };
// let it pass if we're still trying to read it or it's false... // let it pass if we're still trying to read it or it's false...
@ -2275,7 +2224,6 @@
const height = const height =
this.$messageField.outerHeight() + this.$messageField.outerHeight() +
$attachmentPreviews.outerHeight() + $attachmentPreviews.outerHeight() +
this.$emojiPanelContainer.outerHeight() +
quoteHeight + quoteHeight +
parseInt($bottomBar.css('min-height'), 10); parseInt($bottomBar.css('min-height'), 10);

@ -78,11 +78,8 @@
"electron-is-dev": "^1.1.0", "electron-is-dev": "^1.1.0",
"electron-localshortcut": "^3.2.1", "electron-localshortcut": "^3.2.1",
"electron-updater": "^4.2.2", "electron-updater": "^4.2.2",
"emoji-datasource": "4.0.0",
"emoji-datasource-apple": "4.0.0",
"emoji-js": "3.4.0", "emoji-js": "3.4.0",
"emoji-mart": "^2.11.2", "emoji-mart": "^2.11.2",
"emoji-panel": "https://github.com/scottnonnenberg-signal/emoji-panel.git#v0.5.5",
"filesize": "3.6.1", "filesize": "3.6.1",
"firstline": "1.2.1", "firstline": "1.2.1",
"form-data": "^3.0.0", "form-data": "^3.0.0",

@ -372,8 +372,6 @@ const { autoOrientImage } = require('./js/modules/auto_orient_image');
window.autoOrientImage = autoOrientImage; window.autoOrientImage = autoOrientImage;
window.dataURLToBlobSync = require('blueimp-canvas-to-blob'); window.dataURLToBlobSync = require('blueimp-canvas-to-blob');
window.emojiData = require('emoji-datasource');
window.EmojiPanel = require('emoji-panel');
window.filesize = require('filesize'); window.filesize = require('filesize');
window.loadImage = require('blueimp-load-image'); window.loadImage = require('blueimp-load-image');
window.getGuid = require('uuid/v4'); window.getGuid = require('uuid/v4');

@ -102,33 +102,3 @@ button.emoji {
opacity: 1; opacity: 1;
} }
} }
// Import emoji panel css and override paths
@import '../node_modules/emoji-panel/lib/emoji-panel-apple-32.css';
@font-face {
font-family: 'apple-category';
src: url(../node_modules/emoji-panel/lib/asset/apple.ttf) format('truetype');
font-weight: normal;
font-style: normal;
}
.emoji-panel-container {
height: 0px;
.ep-emojies {
background-color: $color-white;
}
.ep-categories {
background-color: $color-light-10;
margin-bottom: 6px;
}
.ep-e {
background-image: url('../node_modules/emoji-datasource-apple/img/apple/sheets/64.png');
background-size: 1734px;
}
.ep-slide {
background-color: $blue;
}
}

@ -756,7 +756,7 @@ label {
.react-contexify { .react-contexify {
z-index: 3; z-index: 3;
min-width: 200px; min-width: 200px;
box-shadow: 0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19) !important; box-shadow: 0 10px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19) !important;
.react-contexify__item:not(.react-contexify__item--disabled):hover .react-contexify__item:not(.react-contexify__item--disabled):hover
> .react-contexify__item__content { > .react-contexify__item__content {

@ -243,10 +243,12 @@ export class SessionCompositionBox extends React.Component<Props, State> {
onKeyDown={this.onKeyDown} onKeyDown={this.onKeyDown}
role="button" role="button"
> >
<SessionEmojiPanel {showEmojiPanel && (
onEmojiClicked={this.onEmojiClick} <SessionEmojiPanel
show={showEmojiPanel} onEmojiClicked={this.onEmojiClick}
/> show={showEmojiPanel}
/>
)}
</div> </div>
</> </>
); );

@ -24,18 +24,6 @@ export function findImage(value: string, variation?: string) {
return instance.find_image(value, variation); return instance.find_image(value, variation);
} }
export function replaceColons(str: string) {
return str.replace(instance.rx_colons, m => {
const name = m.substr(1, m.length - 2).toLowerCase();
const code = instance.map.colons[name];
if (code) {
return instance.data[code][0][0];
}
return m;
});
}
function getCountOfAllMatches(str: string, regex: RegExp) { function getCountOfAllMatches(str: string, regex: RegExp) {
let match = regex.exec(str); let match = regex.exec(str);
let count = 0; let count = 0;

@ -2734,108 +2734,6 @@
"updated": "2018-09-18T19:19:27.699Z", "updated": "2018-09-18T19:19:27.699Z",
"reasonDetail": "It's setting the html of the element to the previous HTML, just with the emoji replaced" "reasonDetail": "It's setting the html of the element to the previous HTML, just with the emoji replaced"
}, },
{
"rule": "DOM-innerHTML",
"path": "node_modules/emoji-panel/dist/emoji-panel.js",
"line": "\t el.innerHTML = '';",
"lineNumber": 94,
"reasonCategory": "usageTrusted",
"updated": "2018-09-15T00:38:04.183Z",
"reasonDetail": "Hard-coded value"
},
{
"rule": "DOM-innerHTML",
"path": "node_modules/emoji-panel/dist/emoji-panel.js",
"line": "\t panelEl.innerHTML = _template2.default;",
"lineNumber": 154,
"reasonCategory": "usageTrusted",
"updated": "2018-09-18T19:19:27.699Z",
"reasonDetail": "In this file, _template2.default is a hardcoded string generated from emoji data"
},
{
"rule": "DOM-innerHTML",
"path": "node_modules/emoji-panel/dist/example.js",
"line": "\t codeEl.innerHTML = codeEl.innerHTML.replace(/dist\\/emoji-panel-.*-.*.min.css/g, newHref);",
"lineNumber": 67,
"reasonCategory": "exampleCode",
"updated": "2018-09-15T00:38:04.183Z"
},
{
"rule": "jQuery-$(",
"path": "node_modules/emoji-panel/dist/example.js",
"line": "\t$('#example-4-btn').click(function (e) {",
"lineNumber": 101,
"reasonCategory": "exampleCode",
"updated": "2018-09-19T21:59:32.770Z"
},
{
"rule": "jQuery-$(",
"path": "node_modules/emoji-panel/dist/example.js",
"line": "\t $('#example-4').dialog({",
"lineNumber": 102,
"reasonCategory": "exampleCode",
"updated": "2018-09-19T21:59:32.770Z"
},
{
"rule": "DOM-innerHTML",
"path": "node_modules/emoji-panel/lib/emoji-panel.js",
"line": "\t el.innerHTML = '';",
"lineNumber": 103,
"reasonCategory": "usageTrusted",
"updated": "2018-09-15T00:38:04.183Z",
"reasonDetail": "Hard-coded value"
},
{
"rule": "DOM-innerHTML",
"path": "node_modules/emoji-panel/lib/emoji-panel.js",
"line": "\t panelEl.innerHTML = _template2.default;",
"lineNumber": 163,
"reasonCategory": "usageTrusted",
"updated": "2018-09-18T19:19:27.699Z",
"reasonDetail": "In this file, _template2.default is a hardcoded string generated from emoji data"
},
{
"rule": "DOM-innerHTML",
"path": "node_modules/emoji-panel/lib/example.js",
"line": "\t codeEl.innerHTML = codeEl.innerHTML.replace(/dist\\/emoji-panel-.*-.*.min.css/g, newHref);",
"lineNumber": 76,
"reasonCategory": "exampleCode",
"updated": "2018-09-18T19:19:27.699Z"
},
{
"rule": "jQuery-$(",
"path": "node_modules/emoji-panel/lib/example.js",
"line": "\t$('#example-4-btn').click(function (e) {",
"lineNumber": 110,
"reasonCategory": "exampleCode",
"updated": "2018-09-19T21:59:32.770Z"
},
{
"rule": "jQuery-$(",
"path": "node_modules/emoji-panel/lib/example.js",
"line": "\t $('#example-4').dialog({",
"lineNumber": 111,
"reasonCategory": "exampleCode",
"updated": "2018-09-19T21:59:32.770Z"
},
{
"rule": "DOM-innerHTML",
"path": "node_modules/emoji-panel/src/create-panel.js",
"line": " panelEl.innerHTML = panelTemplate;",
"lineNumber": 7,
"reasonCategory": "usageTrusted",
"updated": "2018-09-18T19:19:27.699Z",
"reasonDetail": "In this file, panelTemplate is a hardcoded string generated from emoji data"
},
{
"rule": "DOM-innerHTML",
"path": "node_modules/emoji-panel/src/emoji-panel.js",
"line": " el.innerHTML = '';",
"lineNumber": 25,
"reasonCategory": "usageTrusted",
"updated": "2018-09-15T00:38:04.183Z",
"reasonDetail": "Hard-coded value"
},
{ {
"rule": "thenify-multiArgs", "rule": "thenify-multiArgs",
"path": "node_modules/es6-promisify/dist/promisify.js", "path": "node_modules/es6-promisify/dist/promisify.js",

@ -3432,11 +3432,6 @@ emoji-annotation-to-unicode@^0.3.0:
resolved "https://registry.yarnpkg.com/emoji-annotation-to-unicode/-/emoji-annotation-to-unicode-0.3.0.tgz#b76d18823e1d70a95a017c438c168eda12902f3b" resolved "https://registry.yarnpkg.com/emoji-annotation-to-unicode/-/emoji-annotation-to-unicode-0.3.0.tgz#b76d18823e1d70a95a017c438c168eda12902f3b"
integrity sha1-t20Ygj4dcKlaAXxDjBaO2hKQLzs= integrity sha1-t20Ygj4dcKlaAXxDjBaO2hKQLzs=
emoji-datasource-apple@4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/emoji-datasource-apple/-/emoji-datasource-apple-4.0.0.tgz#f31a2cbf9295c66b5cc1e78635ee7b617430a08b"
integrity sha1-8xosv5KVxmtcweeGNe57YXQwoIs=
emoji-datasource@4.0.0: emoji-datasource@4.0.0:
version "4.0.0" version "4.0.0"
resolved "https://registry.yarnpkg.com/emoji-datasource/-/emoji-datasource-4.0.0.tgz#3fc9c0c2f4fb321d9291138819f6d100603d3e2f" resolved "https://registry.yarnpkg.com/emoji-datasource/-/emoji-datasource-4.0.0.tgz#3fc9c0c2f4fb321d9291138819f6d100603d3e2f"
@ -3461,12 +3456,6 @@ emoji-mart@^2.11.2:
dependencies: dependencies:
prop-types "^15.6.0" prop-types "^15.6.0"
"emoji-panel@https://github.com/scottnonnenberg-signal/emoji-panel.git#v0.5.5":
version "0.5.5"
resolved "https://github.com/scottnonnenberg-signal/emoji-panel.git#81e236e03458a44d4a174ab5f367cb4b9b1b2f97"
dependencies:
emoji-datasource "4.0.0"
"emoji-regex@>=6.0.0 <=6.1.1": "emoji-regex@>=6.0.0 <=6.1.1":
version "6.1.1" version "6.1.1"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e"

Loading…
Cancel
Save