2018-04-20 19:11:56 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-04-05 22:30:40 +00:00
|
|
|
/* global window: false */
|
2018-04-03 22:56:12 +00:00
|
|
|
|
2018-04-05 22:30:40 +00:00
|
|
|
// Because we aren't hosting the Style Guide in Electron, we can't rely on preload.js
|
2018-04-03 22:56:12 +00:00
|
|
|
// to set things up for us. This gives us the minimum bar shims for everything it
|
|
|
|
// provdes.
|
|
|
|
//
|
|
|
|
// Remember, the idea here is just to enable visual testing, no full functionality. Most
|
|
|
|
// of thise can be very simple.
|
|
|
|
|
|
|
|
window.PROTO_ROOT = '/protos';
|
|
|
|
window.nodeSetImmediate = () => {};
|
|
|
|
|
2018-04-05 16:19:00 +00:00
|
|
|
window.libphonenumber = {
|
|
|
|
parse: number => ({
|
|
|
|
e164: number,
|
|
|
|
isValidNumber: true,
|
|
|
|
getCountryCode: () => '1',
|
|
|
|
getNationalNumber: () => number,
|
|
|
|
}),
|
|
|
|
isValidNumber: () => true,
|
|
|
|
getRegionCodeForNumber: () => '1',
|
|
|
|
format: number => number.e164,
|
|
|
|
PhoneNumberFormat: {},
|
|
|
|
};
|
|
|
|
|
2018-04-03 22:56:12 +00:00
|
|
|
window.Signal = {};
|
|
|
|
window.Signal.Backup = {};
|
|
|
|
window.Signal.Crypto = {};
|
|
|
|
window.Signal.Logs = {};
|
2018-04-05 15:31:19 +00:00
|
|
|
window.Signal.Migrations = {
|
2018-04-05 16:19:00 +00:00
|
|
|
getPlaceholderMigrations: () => [{
|
|
|
|
migrate: (transaction, next) => {
|
|
|
|
console.log('migration version 1');
|
|
|
|
transaction.db.createObjectStore('conversations');
|
|
|
|
next();
|
|
|
|
},
|
2018-04-10 17:23:09 +00:00
|
|
|
version: 1,
|
2018-04-17 01:17:38 +00:00
|
|
|
}, {
|
|
|
|
migrate: (transaction, next) => {
|
|
|
|
console.log('migration version 2');
|
|
|
|
const messages = transaction.db.createObjectStore('messages');
|
|
|
|
messages.createIndex('expires_at', 'expireTimer', { unique: false });
|
|
|
|
next();
|
|
|
|
},
|
|
|
|
version: 2,
|
2018-04-05 16:19:00 +00:00
|
|
|
}],
|
|
|
|
loadAttachmentData: attachment => Promise.resolve(attachment),
|
2018-04-05 15:31:19 +00:00
|
|
|
};
|
2018-04-03 22:56:12 +00:00
|
|
|
|
2018-04-05 23:10:59 +00:00
|
|
|
window.Signal.Components = {};
|
2018-04-03 22:56:12 +00:00
|
|
|
|
|
|
|
window.EmojiConvertor = function EmojiConvertor() {};
|
2018-04-05 00:26:57 +00:00
|
|
|
window.EmojiConvertor.prototype.init_colons = () => {};
|
2018-04-03 22:56:12 +00:00
|
|
|
window.EmojiConvertor.prototype.signalReplace = html => html;
|
|
|
|
window.EmojiConvertor.prototype.replace_unified = string => string;
|
|
|
|
window.EmojiConvertor.prototype.img_sets = {
|
2018-04-05 22:30:40 +00:00
|
|
|
apple: {},
|
2018-04-03 22:56:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
window.i18n = () => '';
|
|
|
|
|
2018-04-13 02:02:20 +00:00
|
|
|
// Ideally we don't need to add things here. We want to add them in StyleGuideUtil, which
|
|
|
|
// means that references to these things can't be early-bound, not capturing the direct
|
|
|
|
// reference to the function on file load.
|
2018-04-03 22:56:12 +00:00
|
|
|
window.Signal.Migrations.V17 = {};
|
|
|
|
window.Signal.OS = {};
|
|
|
|
window.Signal.Types = {};
|
|
|
|
window.Signal.Types.Attachment = {};
|
2018-04-11 23:23:03 +00:00
|
|
|
window.Signal.Types.Conversation = {};
|
2018-04-03 22:56:12 +00:00
|
|
|
window.Signal.Types.Errors = {};
|
|
|
|
window.Signal.Types.Message = {
|
|
|
|
initializeSchemaVersion: attributes => attributes,
|
|
|
|
};
|
|
|
|
window.Signal.Types.MIME = {};
|
|
|
|
window.Signal.Types.Settings = {};
|
|
|
|
window.Signal.Views = {};
|
|
|
|
window.Signal.Views.Initialization = {};
|
|
|
|
window.Signal.Workflow = {};
|