Remove unused code; move signal.js to js/modules for eslint
(noticed as I was doing this that signal.js doesn't get eslint coverage)
This commit is contained in:
parent
496e0499c4
commit
34f423b52c
7 changed files with 35 additions and 196 deletions
12
js/modules/link_text.d.ts
vendored
12
js/modules/link_text.d.ts
vendored
|
@ -1,12 +0,0 @@
|
|||
declare namespace LinkText {
|
||||
type Attributes = {
|
||||
[key: string]: string;
|
||||
};
|
||||
}
|
||||
|
||||
declare function linkText(
|
||||
value: string,
|
||||
attributes: LinkText.Attributes
|
||||
): string;
|
||||
|
||||
export = linkText;
|
|
@ -1,39 +0,0 @@
|
|||
// Fork of https://github.com/uiureo/link-text with HTML escaping disabled as we leverage
|
||||
// jQuery’s escaping mechanism:
|
||||
|
||||
const linkify = require('linkify-it')();
|
||||
|
||||
function createLink(url, text, attrs = {}) {
|
||||
const html = [];
|
||||
html.push('<a ');
|
||||
html.push(`href="${url}"`);
|
||||
Object.keys(attrs).forEach(key => {
|
||||
html.push(` ${key}="${attrs[key]}"`);
|
||||
});
|
||||
html.push('>');
|
||||
html.push(decodeURIComponent(text));
|
||||
html.push('</a>');
|
||||
|
||||
return html.join('');
|
||||
}
|
||||
|
||||
module.exports = (text, attrs = {}) => {
|
||||
const matchData = linkify.match(text) || [];
|
||||
|
||||
const result = [];
|
||||
let last = 0;
|
||||
|
||||
matchData.forEach(match => {
|
||||
if (last < match.index) {
|
||||
result.push(text.slice(last, match.index));
|
||||
}
|
||||
|
||||
result.push(createLink(match.url, match.text, attrs));
|
||||
|
||||
last = match.lastIndex;
|
||||
});
|
||||
|
||||
result.push(text.slice(last));
|
||||
|
||||
return result.join('');
|
||||
};
|
|
@ -1,60 +1,59 @@
|
|||
// The idea with this file is to make it webpackable for the style guide
|
||||
|
||||
const Backbone = require('../ts/backbone');
|
||||
const Crypto = require('./modules/crypto');
|
||||
const Database = require('./modules/database');
|
||||
const Emoji = require('../ts/util/emoji');
|
||||
const HTML = require('../ts/html');
|
||||
const Message = require('./modules/types/message');
|
||||
const Notifications = require('../ts/notifications');
|
||||
const OS = require('../ts/OS');
|
||||
const Settings = require('./modules/settings');
|
||||
const Startup = require('./modules/startup');
|
||||
const Util = require('../ts/util');
|
||||
const Backbone = require('../../ts/backbone');
|
||||
const Crypto = require('./crypto');
|
||||
const Database = require('./database');
|
||||
const Emoji = require('../../ts/util/emoji');
|
||||
const Message = require('./types/message');
|
||||
const Notifications = require('../../ts/notifications');
|
||||
const OS = require('../../ts/OS');
|
||||
const Settings = require('./settings');
|
||||
const Startup = require('./startup');
|
||||
const Util = require('../../ts/util');
|
||||
|
||||
// Components
|
||||
const {
|
||||
ContactDetail,
|
||||
} = require('../ts/components/conversation/ContactDetail');
|
||||
const { ContactName } = require('../ts/components/conversation/ContactName');
|
||||
} = require('../../ts/components/conversation/ContactDetail');
|
||||
const { ContactName } = require('../../ts/components/conversation/ContactName');
|
||||
const {
|
||||
ConversationTitle,
|
||||
} = require('../ts/components/conversation/ConversationTitle');
|
||||
} = require('../../ts/components/conversation/ConversationTitle');
|
||||
const {
|
||||
EmbeddedContact,
|
||||
} = require('../ts/components/conversation/EmbeddedContact');
|
||||
const { Emojify } = require('../ts/components/conversation/Emojify');
|
||||
const { Lightbox } = require('../ts/components/Lightbox');
|
||||
const { LightboxGallery } = require('../ts/components/LightboxGallery');
|
||||
} = require('../../ts/components/conversation/EmbeddedContact');
|
||||
const { Emojify } = require('../../ts/components/conversation/Emojify');
|
||||
const { Lightbox } = require('../../ts/components/Lightbox');
|
||||
const { LightboxGallery } = require('../../ts/components/LightboxGallery');
|
||||
const {
|
||||
MediaGallery,
|
||||
} = require('../ts/components/conversation/media-gallery/MediaGallery');
|
||||
const { MessageBody } = require('../ts/components/conversation/MessageBody');
|
||||
const { Quote } = require('../ts/components/conversation/Quote');
|
||||
} = require('../../ts/components/conversation/media-gallery/MediaGallery');
|
||||
const { MessageBody } = require('../../ts/components/conversation/MessageBody');
|
||||
const { Quote } = require('../../ts/components/conversation/Quote');
|
||||
|
||||
// Migrations
|
||||
const {
|
||||
getPlaceholderMigrations,
|
||||
} = require('./modules/migrations/get_placeholder_migrations');
|
||||
} = require('./migrations/get_placeholder_migrations');
|
||||
|
||||
const Migrations0DatabaseWithAttachmentData = require('./modules/migrations/migrations_0_database_with_attachment_data');
|
||||
const Migrations1DatabaseWithoutAttachmentData = require('./modules/migrations/migrations_1_database_without_attachment_data');
|
||||
const Migrations0DatabaseWithAttachmentData = require('./migrations/migrations_0_database_with_attachment_data');
|
||||
const Migrations1DatabaseWithoutAttachmentData = require('./migrations/migrations_1_database_without_attachment_data');
|
||||
|
||||
// Types
|
||||
const AttachmentType = require('./modules/types/attachment');
|
||||
const Contact = require('../ts/types/Contact');
|
||||
const Conversation = require('../ts/types/Conversation');
|
||||
const Errors = require('./modules/types/errors');
|
||||
const MediaGalleryMessage = require('../ts/components/conversation/media-gallery/types/Message');
|
||||
const MIME = require('../ts/types/MIME');
|
||||
const SettingsType = require('../ts/types/Settings');
|
||||
const AttachmentType = require('./types/attachment');
|
||||
const Contact = require('../../ts/types/Contact');
|
||||
const Conversation = require('../../ts/types/Conversation');
|
||||
const Errors = require('./types/errors');
|
||||
const MediaGalleryMessage = require('../../ts/components/conversation/media-gallery/types/Message');
|
||||
const MIME = require('../../ts/types/MIME');
|
||||
const SettingsType = require('../../ts/types/Settings');
|
||||
|
||||
// Views
|
||||
const Initialization = require('./modules/views/initialization');
|
||||
const Initialization = require('./views/initialization');
|
||||
|
||||
// Workflow
|
||||
const { IdleDetector } = require('./modules/idle_detector');
|
||||
const MessageDataMigrator = require('./modules/messages_data_migrator');
|
||||
const { IdleDetector } = require('./idle_detector');
|
||||
const MessageDataMigrator = require('./messages_data_migrator');
|
||||
|
||||
exports.setup = (options = {}) => {
|
||||
const { Attachments, userDataPath, getRegionCode } = options;
|
||||
|
@ -127,7 +126,6 @@ exports.setup = (options = {}) => {
|
|||
Crypto,
|
||||
Database,
|
||||
Emoji,
|
||||
HTML,
|
||||
Migrations,
|
||||
Notifications,
|
||||
OS,
|
Loading…
Add table
Add a link
Reference in a new issue