Electron #1
No files matched your search
+4
-5
@@ -1,6 +1,5 @@
|
||||
node_modules/
|
||||
data/
|
||||
messages/
|
||||
data.db*
|
||||
errors.log
|
||||
build/
|
||||
build/
|
||||
dist/
|
||||
ts/lorem.ts
|
||||
yarn-error.log
|
||||
@@ -3,5 +3,6 @@
|
||||
"useTabs": true,
|
||||
"semi": false,
|
||||
"arrowParens": "avoid",
|
||||
"singleQuote": true
|
||||
"singleQuote": true,
|
||||
"quoteProps": "consistent"
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"search.useGlobalIgnoreFiles": true,
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
# messenger-archive
|
||||
|
||||
An explorer for exported Facebook Messenger messages
|
||||
|
||||
# development
|
||||
|
||||
`yarn build` runs only webpack
|
||||
|
||||
`yarn start` runs electron on built bundle
|
||||
|
||||
`yarn dev` builds and runs project
|
||||
|
||||
`web` runs only React in a dev server
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="64"
|
||||
height="64"
|
||||
viewBox="0 0 16.933 16.933"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
sodipodi:docname="icon.svg"
|
||||
xml:space="preserve"
|
||||
inkscape:version="1.2 (dc2aedaf03, 2022-05-15)"
|
||||
inkscape:export-filename="icon.png"
|
||||
inkscape:export-xdpi="192"
|
||||
inkscape:export-ydpi="192"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs12" /><sodipodi:namedview
|
||||
id="namedview10"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#eeeeee"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#505050"
|
||||
showgrid="false"
|
||||
showguides="false"
|
||||
inkscape:lockguides="false"
|
||||
inkscape:zoom="4.6790582"
|
||||
inkscape:cx="19.341499"
|
||||
inkscape:cy="30.241129"
|
||||
inkscape:window-width="1880"
|
||||
inkscape:window-height="1029"
|
||||
inkscape:window-x="40"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg8"><sodipodi:guide
|
||||
position="8.4665003,16.933"
|
||||
orientation="1,0"
|
||||
id="guide4397"
|
||||
inkscape:locked="false" /></sodipodi:namedview><ellipse
|
||||
style="display:inline;fill:#e4f2fb;fill-opacity:1;stroke:none;stroke-width:0.0594033;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4390"
|
||||
cx="8.4665003"
|
||||
cy="8.4664993"
|
||||
rx="8.4665003"
|
||||
ry="8.4664993"
|
||||
inkscape:label="bg" /><g
|
||||
id="g3609"
|
||||
style="display:inline;fill:#006aff;fill-opacity:1;stroke:none"
|
||||
inkscape:label="rects"
|
||||
transform="matrix(0.8251288,0,0,0.8251288,1.4805471,1.1537833)"><rect
|
||||
style="display:inline;fill:#006aff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0529156;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect553"
|
||||
width="12.195786"
|
||||
height="7.4559388"
|
||||
x="2.3686068"
|
||||
y="7.0964556"
|
||||
ry="0.42605168"
|
||||
rx="0" /><rect
|
||||
style="fill:#006aff;fill-opacity:1;stroke:none;stroke-width:0.0529156;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect1298"
|
||||
width="7.9086194"
|
||||
height="0.61245155"
|
||||
x="4.5121903"
|
||||
y="5.8049808"
|
||||
ry="0.15063256"
|
||||
rx="0" /><rect
|
||||
style="fill:#006aff;fill-opacity:1;stroke:none;stroke-width:0.0529156;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect1300"
|
||||
width="6.2136002"
|
||||
height="0.54604334"
|
||||
x="5.3596997"
|
||||
y="4.7135482"
|
||||
ry="0.15063256" /><path
|
||||
id="rect1302"
|
||||
style="fill:#006aff;fill-opacity:1;stroke:none;stroke-width:0.0529156;stroke-linejoin:round"
|
||||
d="m 4.2770269,2.7176647 h 8.3789461 c 0.32337,0 0.583701,0.2603308 0.583701,0.5837013 V 5.7209052 L 11.716071,4.130462 H 5.2117814 L 3.6933256,5.7209052 V 3.301366 c 0,-0.3233705 0.2603308,-0.5837013 0.5837013,-0.5837013 z"
|
||||
sodipodi:nodetypes="sssccccss" /></g><path
|
||||
d="M 7.6381327,10.151524 5.0183488,11.521238 7.6381327,8.6959968 9.2388826,10.151524 12.004714,8.9352842 9.2397077,11.607051"
|
||||
fill="#ffffff"
|
||||
id="path4"
|
||||
style="display:inline;stroke-width:0.825128"
|
||||
inkscape:label="logo" /></svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@babel/preset-env',
|
||||
'@babel/preset-typescript',
|
||||
['@babel/preset-react', { runtime: 'automatic' }],
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { BrowserWindow, dialog, ipcMain } from 'electron'
|
||||
import { Convos, scan } from '../ts'
|
||||
|
||||
import { readFileSync } from 'fs'
|
||||
|
||||
let listeners = (mainWindow: BrowserWindow) => {
|
||||
let events = {}
|
||||
|
||||
for (const chanel in events) ipcMain.on(chanel, events[chanel])
|
||||
|
||||
let handles = {
|
||||
'get-paths': async e => {
|
||||
return await dialog.showOpenDialog({
|
||||
properties: ['openDirectory', 'multiSelections'],
|
||||
})
|
||||
},
|
||||
'scan': async (e, { paths }) => {
|
||||
return await scan(paths, {}, (...progress) => {
|
||||
mainWindow.webContents.send('update-progress', progress)
|
||||
}).then(convosIds => {
|
||||
mainWindow.webContents.send('update-convos-ids', convosIds)
|
||||
|
||||
return convosIds
|
||||
})
|
||||
},
|
||||
'get-convo': async (e, id) => {
|
||||
if (id in Convos) return JSON.stringify(Convos[id])
|
||||
else return null
|
||||
},
|
||||
}
|
||||
|
||||
for (const chanel in handles) ipcMain.handle(chanel, handles[chanel])
|
||||
}
|
||||
|
||||
export default listeners
|
||||
@@ -0,0 +1,42 @@
|
||||
import { app, BrowserWindow } from 'electron'
|
||||
import path from 'path'
|
||||
import listeners from './listeners'
|
||||
|
||||
let mainWindow: Electron.BrowserWindow | null
|
||||
|
||||
function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1100,
|
||||
height: 700,
|
||||
icon: 'assets/icon.png',
|
||||
backgroundColor: '#efe9f4',
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
preload: path.join(__dirname, 'preload.js'),
|
||||
},
|
||||
})
|
||||
|
||||
mainWindow.loadFile('build/index.html')
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
app.on('ready', createWindow)
|
||||
.whenReady()
|
||||
.then(() => listeners(mainWindow!))
|
||||
.catch(e => console.error(e))
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
import { contextBridge, ipcRenderer } from 'electron'
|
||||
|
||||
export const events = {
|
||||
send: (channel: string, data?: any) => ipcRenderer.send(channel, data),
|
||||
|
||||
on: (channel: string, callback: (data: any) => void) => {
|
||||
ipcRenderer.on(channel, (e, data) => callback(data))
|
||||
},
|
||||
|
||||
off: (channel: string, callback: (_: any, data: any) => void) =>
|
||||
ipcRenderer.removeListener(channel, callback),
|
||||
}
|
||||
|
||||
contextBridge.exposeInMainWorld('events', events)
|
||||
|
||||
export const invoke = ipcRenderer.invoke
|
||||
|
||||
contextBridge.exposeInMainWorld('invoke', invoke)
|
||||
+41
-11
@@ -1,22 +1,52 @@
|
||||
{
|
||||
"name": "messenger-archive",
|
||||
"version": "1.0.0",
|
||||
"main": "build/index.js",
|
||||
"type": "module",
|
||||
"author": "Mateusz Pstrucha",
|
||||
"license": "MIT",
|
||||
"description": "",
|
||||
"main": "build/electron.js",
|
||||
"scripts": {
|
||||
"dev": "tsc-watch --onSuccess \"node .\""
|
||||
"build": "yarn webpack",
|
||||
"start": "yarn electron . --trace-warnings --inspect",
|
||||
"dev": "yarn build --mode development && yarn start",
|
||||
"web": "yarn webpack-dev-server --config react.webpack.config.js",
|
||||
"dist": "# TODO: add electron-builder and github actions config"
|
||||
},
|
||||
"author": "Mateusz Pstrucha",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.5",
|
||||
"@babel/preset-env": "^7.18.2",
|
||||
"@babel/preset-react": "^7.17.12",
|
||||
"@babel/preset-typescript": "^7.17.12",
|
||||
"babel-loader": "^8.2.5",
|
||||
"electron": "^19.0.6",
|
||||
"electron-builder": "^23.1.0",
|
||||
"electron-packager": "^15.5.1",
|
||||
"electron-rebuild": "^3.2.7",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"ts-loader": "^9.3.1",
|
||||
"webpack": "^5.73.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.9.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/react": "^18.0.14",
|
||||
"@types/react-dom": "^18.0.5",
|
||||
"chart.js": "^3.8.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"date-fns": "^2.28.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"fuse.js": "^6.6.2",
|
||||
"node-loader": "^2.0.0",
|
||||
"node-zip": "^1.1.1",
|
||||
"react": "^18.2.0",
|
||||
"react-chartjs-2": "^4.2.0",
|
||||
"react-date-range": "^1.4.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"sass": "^1.53.0",
|
||||
"sass-loader": "^13.0.2",
|
||||
"sqlite3": "^5.0.8",
|
||||
"style-loader": "^3.3.1",
|
||||
"typescript": "^4.7.4",
|
||||
"utf8": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/sqlite3": "^3.1.8",
|
||||
"@types/utf8": "^3.0.1",
|
||||
"tsc": "^2.0.4",
|
||||
"tsc-watch": "^5.0.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
|
||||
<title>electron</title>
|
||||
|
||||
<script>
|
||||
const global = globalThis
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,50 @@
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
entry: __dirname + '/src/index.tsx',
|
||||
target: 'web',
|
||||
devtool: 'source-map',
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.node$/,
|
||||
use: 'node-loader',
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ['style-loader', 'css-loader'],
|
||||
},
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: ['style-loader', 'css-loader', 'sass-loader'],
|
||||
},
|
||||
{
|
||||
test: /\.(js|ts|tsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif)$/i,
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[path][name].[ext]',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
output: {
|
||||
path: __dirname + '/build',
|
||||
filename: 'react.js',
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: './public/index.html',
|
||||
}),
|
||||
],
|
||||
}
|
||||
-127
@@ -1,127 +0,0 @@
|
||||
PRAGMA journal_mode = WAL;
|
||||
PRAGMA synchronous = NORMAL;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS group_photos (
|
||||
uri varchar,
|
||||
creation timestamp,
|
||||
inbox char(10),
|
||||
PRIMARY KEY (uri),
|
||||
FOREIGN KEY (inbox) REFERENCES inboxes(id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS inboxes (
|
||||
id char(10),
|
||||
cat varchar,
|
||||
title varchar,
|
||||
thread varchar,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS participants (
|
||||
inbox char(10),
|
||||
uname int,
|
||||
participates boolean,
|
||||
FOREIGN KEY (inbox) REFERENCES inboxes(id),
|
||||
UNIQUE (inbox, uname)
|
||||
);
|
||||
|
||||
--
|
||||
-- MEDIA
|
||||
--
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS photos (
|
||||
uri varchar,
|
||||
created timestamp,
|
||||
inbox char(10),
|
||||
message_sender varchar,
|
||||
message_created timestamp,
|
||||
PRIMARY KEY (uri),
|
||||
FOREIGN KEY (inbox) REFERENCES inboxes(id),
|
||||
FOREIGN KEY (message_sender) REFERENCES messages(sender),
|
||||
FOREIGN KEY (message_created) REFERENCES messages(created)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS files (
|
||||
uri varchar,
|
||||
created timestamp,
|
||||
inbox char(10),
|
||||
message_sender varchar,
|
||||
message_created timestamp,
|
||||
PRIMARY KEY (uri),
|
||||
FOREIGN KEY (inbox) REFERENCES inboxes(id),
|
||||
FOREIGN KEY (message_sender) REFERENCES messages(sender),
|
||||
FOREIGN KEY (message_created) REFERENCES messages(created)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS videos (
|
||||
uri varchar,
|
||||
created timestamp,
|
||||
inbox char(10),
|
||||
message_sender varchar,
|
||||
message_created timestamp,
|
||||
PRIMARY KEY (uri),
|
||||
FOREIGN KEY (inbox) REFERENCES inboxes(id),
|
||||
FOREIGN KEY (message_sender) REFERENCES messages(sender),
|
||||
FOREIGN KEY (message_created) REFERENCES messages(created)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS audios (
|
||||
uri varchar,
|
||||
created timestamp,
|
||||
inbox char(10),
|
||||
message_sender varchar,
|
||||
message_created timestamp,
|
||||
PRIMARY KEY (uri),
|
||||
FOREIGN KEY (inbox) REFERENCES inboxes(id),
|
||||
FOREIGN KEY (message_sender) REFERENCES messages(sender),
|
||||
FOREIGN KEY (message_created) REFERENCES messages(created)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS gifs (
|
||||
uri varchar,
|
||||
created timestamp,
|
||||
inbox char(10),
|
||||
message_sender varchar,
|
||||
message_created timestamp,
|
||||
PRIMARY KEY (uri),
|
||||
FOREIGN KEY (inbox) REFERENCES inboxes(id),
|
||||
FOREIGN KEY (message_sender) REFERENCES messages(sender),
|
||||
FOREIGN KEY (message_created) REFERENCES messages(created)
|
||||
);
|
||||
|
||||
--
|
||||
-- MESSAGES
|
||||
--
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS messages (
|
||||
sender varchar,
|
||||
created timestamp(3),
|
||||
inbox char(10),
|
||||
content varchar,
|
||||
cat varchar,
|
||||
unsent boolean,
|
||||
UNIQUE (sender, created, inbox)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS reactions (
|
||||
message_sender varchar,
|
||||
message_created timestamp(3),
|
||||
inbox char(10),
|
||||
reaction varchar,
|
||||
actor varchar,
|
||||
UNIQUE (message_sender, message_created, actor, inbox),
|
||||
FOREIGN KEY (inbox) REFERENCES inboxes(id),
|
||||
FOREIGN KEY (message_sender) REFERENCES messages(sender),
|
||||
FOREIGN KEY (message_created) REFERENCES messages(created)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS shares (
|
||||
message_sender varchar,
|
||||
message_created timestamp(3),
|
||||
inbox char(10),
|
||||
link varchar,
|
||||
UNIQUE (message_sender, message_created, inbox),
|
||||
FOREIGN KEY (inbox) REFERENCES inboxes(id),
|
||||
FOREIGN KEY (message_sender) REFERENCES messages(sender),
|
||||
FOREIGN KEY (message_created) REFERENCES messages(created)
|
||||
);
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
import { events, invoke } from '../../electron/preload'
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line
|
||||
interface Window {
|
||||
events: typeof events
|
||||
invoke: typeof invoke
|
||||
}
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
declare module '*.png';
|
||||
declare module '*.jpeg';
|
||||
declare module '*.jpg';
|
||||
declare module '*.gif';
|
||||
@@ -0,0 +1,39 @@
|
||||
import Convo from '../ts/Convo'
|
||||
import PartialConvo from './PartialConvo'
|
||||
|
||||
export function chunkRange(
|
||||
convo: Convo,
|
||||
at: number,
|
||||
[before, after]: [number, number]
|
||||
) {
|
||||
function getKeys() {
|
||||
let keys: [number, string][] = []
|
||||
|
||||
for (const sender in convo.messages) {
|
||||
let tooLate = 0
|
||||
for (const time in convo.messages[sender]) {
|
||||
keys.push([parseInt(time), sender])
|
||||
if (parseInt(time) > at) tooLate++
|
||||
if (tooLate >= after) break
|
||||
}
|
||||
}
|
||||
|
||||
return keys.sort(([a], [b]) => a - b)
|
||||
}
|
||||
|
||||
let keys = getKeys()
|
||||
|
||||
let middle = keys.findIndex(([time]) => time == at)
|
||||
|
||||
keys = keys.slice(middle > before ? middle - before : 0, middle + after + 1)
|
||||
|
||||
return [keys.at(0)?.[0], keys.at(-1)?.[0] ?? at] as [number, number]
|
||||
}
|
||||
|
||||
export default (
|
||||
convo: Convo,
|
||||
at: number,
|
||||
[before, after]: [number, number]
|
||||
) => {
|
||||
return new PartialConvo(convo, chunkRange(convo, at, [before, after]))
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { createContext } from 'react'
|
||||
import Convo from '../../ts/Convo'
|
||||
|
||||
export default createContext([] as { id: Convo['id']; title: Convo['title'] }[])
|
||||
@@ -0,0 +1,7 @@
|
||||
import { createContext } from 'react'
|
||||
import Convo from '../../ts/Convo'
|
||||
|
||||
export default createContext<[[Convo | null, any], [[number, number], any]]>([
|
||||
[null, undefined],
|
||||
[[0, Infinity], undefined],
|
||||
])
|
||||
@@ -0,0 +1,83 @@
|
||||
import { createContext, useContext, useEffect, useState } from 'react'
|
||||
|
||||
import Browse from './components/Browse/Browse'
|
||||
import ConvoSelector from './components/ConvoSelector/ConvoSelector'
|
||||
import Media from './components/Media/Media'
|
||||
import Search from './components/Search/Search'
|
||||
import Stats from './components/Stats/Stats'
|
||||
import Intro from './components/Intro/Intro'
|
||||
import Menu from './components/Menu/Menu'
|
||||
|
||||
import contextCurrentConvo from './Contexts/contextCurrentConvo'
|
||||
import contextConvos from './Contexts/contextConvos'
|
||||
|
||||
import { dateToUnixExtended } from './PartialConvo'
|
||||
import Convo from '../ts/Convo'
|
||||
|
||||
import './index.css'
|
||||
|
||||
const contextPane = createContext('')
|
||||
|
||||
function Pane({ children, id }: any) {
|
||||
const pane = useContext(contextPane)
|
||||
|
||||
return (
|
||||
<div
|
||||
className="pane"
|
||||
style={{ display: pane == id ? 'initial' : 'none' }}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default function Main() {
|
||||
const [pane, setPane] = useState('selector'),
|
||||
[convos, setConvos] = useState([])
|
||||
|
||||
const [currentConvo, setCurrentConvo] = useState<Convo | null>(null)
|
||||
|
||||
let [range, setRange] = useState<[number, number]>([
|
||||
dateToUnixExtended(new Date()) - 1.296e13,
|
||||
dateToUnixExtended(new Date()),
|
||||
])
|
||||
|
||||
useEffect(() => {
|
||||
// TODO: check if there are any already scanned convos
|
||||
window.events.on('update-convos-ids', convos => setConvos(convos))
|
||||
}, [])
|
||||
|
||||
async function changeConvo(id: string) {
|
||||
let data = await window.invoke('get-convo', id)
|
||||
data = JSON.parse(data)
|
||||
setCurrentConvo(data)
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Menu setPane={id => setPane(id)} initial={pane} />
|
||||
|
||||
<div className="container">
|
||||
<contextConvos.Provider value={convos}>
|
||||
<contextCurrentConvo.Provider
|
||||
value={[
|
||||
[currentConvo, changeConvo],
|
||||
[range, setRange],
|
||||
]}
|
||||
>
|
||||
<contextPane.Provider value={pane}>
|
||||
<Pane id="convo" children={<Browse />} />
|
||||
<Pane id="media" children={<Media />} />
|
||||
<Pane id="search" children={<Search />} />
|
||||
<Pane id="stats" children={<Stats />} />
|
||||
|
||||
<Pane id="import" children={<Intro />} />
|
||||
<Pane id="selector" children={<ConvoSelector />} />
|
||||
{/* TODO: settings */}
|
||||
</contextPane.Provider>
|
||||
</contextCurrentConvo.Provider>
|
||||
</contextConvos.Provider>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import Convo from '../ts/Convo'
|
||||
import Message from '../ts/Message'
|
||||
|
||||
export function dateToUnixExtended(date: Date) {
|
||||
return date.getTime() * 1e3
|
||||
}
|
||||
|
||||
export default class PartialConvo {
|
||||
from: number
|
||||
to: number
|
||||
messages: Message[]
|
||||
count: number
|
||||
|
||||
constructor(convo: Convo, [from, to]: [number, number]) {
|
||||
this.from = from
|
||||
this.to = to
|
||||
|
||||
this.messages = []
|
||||
|
||||
let temp = {}
|
||||
|
||||
for (const sender in convo.messages)
|
||||
for (const time in convo.messages[sender]) {
|
||||
let t = parseInt(time)
|
||||
if (t >= from && t <= to) temp[time] = convo.messages[sender][time]
|
||||
}
|
||||
|
||||
for (let time of Object.keys(temp).sort(
|
||||
(a, b) => parseInt(a) - parseInt(b)
|
||||
))
|
||||
this.messages.push(temp[time])
|
||||
|
||||
this.count = this.messages.length
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
import Convo from '../../../ts/Convo'
|
||||
import Message from '../../../ts/Message'
|
||||
import { messageMedia } from '../../../ts/types/takeout'
|
||||
import contextCurrentConvo from '../../Contexts/contextCurrentConvo'
|
||||
import PartialConvo from '../../PartialConvo'
|
||||
|
||||
import './browse.sass'
|
||||
|
||||
function Media({ type, contents }: { type: string; contents: messageMedia[] }) {
|
||||
// TODO: add image preview
|
||||
return (
|
||||
<div className={'media ' + type}>
|
||||
{{
|
||||
photos: contents.map(p => (
|
||||
<img key={p.uri} src={'file://' + p.uri} />
|
||||
)),
|
||||
gifs: contents.map(g => (
|
||||
<img key={g.uri} src={'file://' + g.uri} />
|
||||
)),
|
||||
videos: contents.map(v => (
|
||||
<video controls>
|
||||
<source src={v.uri} />
|
||||
</video>
|
||||
)),
|
||||
audios: contents.map(a => (
|
||||
<audio controls>
|
||||
<source src={a.uri} />
|
||||
</audio>
|
||||
)),
|
||||
}[type] ?? (
|
||||
<span>
|
||||
{type}: {JSON.stringify(contents)}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function MessageBubble({
|
||||
message: { sender, content, time, media, unsent, sticker, reactions },
|
||||
convo,
|
||||
type,
|
||||
init,
|
||||
close,
|
||||
reactions: hasReactions,
|
||||
highlight,
|
||||
}: {
|
||||
message: Message
|
||||
convo: Convo
|
||||
type: 'first' | 'middle' | 'last' | 'alone'
|
||||
init: boolean
|
||||
close: boolean
|
||||
reactions: boolean
|
||||
highlight: boolean
|
||||
}) {
|
||||
let date = new Date(time / 1e3)
|
||||
return (
|
||||
<div
|
||||
className={[
|
||||
'message',
|
||||
sender == convo.owner && 'self',
|
||||
type,
|
||||
init && 'init',
|
||||
close && 'close',
|
||||
unsent && 'unsent',
|
||||
media && 'media',
|
||||
sticker && 'sticker',
|
||||
hasReactions && 'reactions',
|
||||
highlight && 'highlight',
|
||||
]
|
||||
.filter(c => c)
|
||||
.join(' ')}
|
||||
data-time={date.toLocaleString()}
|
||||
data-media={media && Object.keys(media)}
|
||||
title={date.toISOString()}
|
||||
>
|
||||
<div className="sender">{sender}</div>
|
||||
<div className="content">
|
||||
{content}
|
||||
{media && (
|
||||
<div className="media">
|
||||
{Object.entries(media).map(([type, contents]) => (
|
||||
<Media key={type} type={type} contents={contents} />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{sticker && <img src={'file://' + sticker} />}
|
||||
{reactions && (
|
||||
<div className="reactions">
|
||||
{reactions.map(({ reaction, actor }) => (
|
||||
<span key={actor} title={actor}>
|
||||
{reaction}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function Chat({
|
||||
range,
|
||||
goto,
|
||||
}: {
|
||||
range: [number, number]
|
||||
goto?: number
|
||||
}) {
|
||||
const [[currentConvo]] = useContext(contextCurrentConvo)
|
||||
|
||||
const [partial, setPartial] = useState<PartialConvo>()
|
||||
|
||||
useEffect(() => {
|
||||
if (currentConvo) setPartial(new PartialConvo(currentConvo, range))
|
||||
}, [currentConvo, range])
|
||||
|
||||
useEffect(() => {
|
||||
document
|
||||
.querySelector<HTMLElement>('.browse .message.highlight')
|
||||
?.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
})
|
||||
})
|
||||
|
||||
return (
|
||||
(partial && currentConvo && (
|
||||
<div className="browse">
|
||||
<div className="timestamp">
|
||||
{/* TODO: add expand range buttons */}⇊{' '}
|
||||
{new Date(range[0] / 1e3).toLocaleString()} ⇊
|
||||
</div>
|
||||
{partial.messages.slice(0, 500).map((m, i, all) => (
|
||||
<MessageBubble
|
||||
key={m.time}
|
||||
message={m}
|
||||
convo={currentConvo}
|
||||
type={
|
||||
m.sender == all[i - 1]?.sender
|
||||
? m.sender == all[i + 1]?.sender
|
||||
? 'middle'
|
||||
: 'last'
|
||||
: m.sender == all[i + 1]?.sender
|
||||
? 'first'
|
||||
: 'alone'
|
||||
}
|
||||
init={m.time - all[i - 1]?.time > 9e8 || i == 0}
|
||||
close={all[i + 1]?.time - m.time > 9e8}
|
||||
reactions={!!m.reactions}
|
||||
highlight={m.time == goto}
|
||||
/>
|
||||
))}
|
||||
{partial.count < 1 && (
|
||||
<div className="timestamp">
|
||||
No messages in the selected range
|
||||
</div>
|
||||
)}
|
||||
<div className="timestamp">
|
||||
⇈ {new Date(range[1] / 1e3).toLocaleString()} ⇈
|
||||
</div>
|
||||
</div>
|
||||
)) || <></>
|
||||
)
|
||||
}
|
||||
|
||||
export default function Browse() {
|
||||
const [[currentConvo], [range]] = useContext(contextCurrentConvo)
|
||||
|
||||
const [partial, setPartial] = useState<PartialConvo>()
|
||||
|
||||
useEffect(() => {
|
||||
if (currentConvo) setPartial(new PartialConvo(currentConvo, range))
|
||||
}, [currentConvo, range])
|
||||
|
||||
return (
|
||||
<>
|
||||
{(partial && currentConvo && <Chat range={range} />) || (
|
||||
<div className="timestamp">Select a conversation</div>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
.browse
|
||||
padding: 1em 1em 0 0
|
||||
overflow-x: hidden
|
||||
width: 100%
|
||||
height: 100%
|
||||
|
||||
.timestamp
|
||||
width: 100%
|
||||
text-align: center
|
||||
margin-bottom: 1em
|
||||
text-decoration: underline
|
||||
|
||||
&:last-child
|
||||
text-decoration: overline
|
||||
|
||||
.message
|
||||
position: relative
|
||||
margin: 2px
|
||||
|
||||
.sender
|
||||
font-size: .8em
|
||||
position: absolute
|
||||
top: -1.3em
|
||||
left: 1em
|
||||
color: rgb(138, 141, 145)
|
||||
|
||||
.content
|
||||
background: rgb(228, 230, 235)
|
||||
display: inline-block
|
||||
padding: 0.4em 0.8em
|
||||
border-radius: 1em
|
||||
color: rgb(5, 5, 5)
|
||||
white-space: pre-line
|
||||
word-break: break-word
|
||||
max-width: 75%
|
||||
text-align: left
|
||||
position: relative
|
||||
|
||||
.reactions
|
||||
position: absolute
|
||||
right: 0
|
||||
background-color: white
|
||||
padding: .1em 0
|
||||
border-radius: 1em
|
||||
box-shadow: 0 0 2px 1px #0002
|
||||
color: black
|
||||
z-index: 2
|
||||
|
||||
span
|
||||
cursor: help
|
||||
padding: .1em 0.3em
|
||||
|
||||
&.reactions
|
||||
margin-bottom: 1.2em
|
||||
|
||||
&.highlight
|
||||
outline: 2px solid var(--color-secondary)
|
||||
scroll-margin: 40vh
|
||||
|
||||
&.last, &.alone
|
||||
margin-bottom: 2em
|
||||
|
||||
&.init
|
||||
margin-top: 3em
|
||||
&::before
|
||||
content: attr(data-time)
|
||||
color: #666
|
||||
width: 100%
|
||||
display: block
|
||||
position: absolute
|
||||
top: -2em
|
||||
text-align: center
|
||||
|
||||
&.unsent .content:after
|
||||
font-weight: bold
|
||||
font-style: italic
|
||||
content: 'Message Unsent'
|
||||
|
||||
&.media .content:after
|
||||
content: attr(data-media)
|
||||
|
||||
&.sticker
|
||||
img
|
||||
width: 30vh
|
||||
height: 30vh
|
||||
|
||||
.content .media
|
||||
.photos img, .videos video
|
||||
max-width: 50vw
|
||||
max-height: 50vh
|
||||
|
||||
&.audios
|
||||
background: unset
|
||||
padding-left: unset
|
||||
|
||||
.message.self
|
||||
text-align: right
|
||||
.sender
|
||||
left: unset
|
||||
right: 1em
|
||||
.content
|
||||
color: white
|
||||
background: var(--color-primary)
|
||||
|
||||
.reactions
|
||||
right: unset
|
||||
left: 0
|
||||
|
||||
.message.self
|
||||
&.first .content
|
||||
border-bottom-right-radius: 3px
|
||||
|
||||
&.middle .content
|
||||
border-top-right-radius: 3px
|
||||
border-bottom-right-radius: 3px
|
||||
|
||||
&.last .content
|
||||
border-top-right-radius: 3px
|
||||
|
||||
&.middle, &.last
|
||||
.sender
|
||||
display: none
|
||||
|
||||
&.init .content
|
||||
border-top-right-radius: 1em !important
|
||||
|
||||
&.close .content
|
||||
border-bottom-right-radius: 1em !important
|
||||
|
||||
.message:not(.self)
|
||||
&.first .content
|
||||
border-bottom-left-radius: 3px
|
||||
|
||||
&.middle .content
|
||||
border-top-left-radius: 3px
|
||||
border-bottom-left-radius: 3px
|
||||
|
||||
&.last .content
|
||||
border-top-left-radius: 3px
|
||||
|
||||
&.middle, &.last
|
||||
.sender
|
||||
display: none
|
||||
|
||||
&.init .content
|
||||
border-top-left-radius: 1em !important
|
||||
|
||||
&.close .content
|
||||
border-bottom-left-radius: 1em !important
|
||||
|
||||
// .message.self + .message:not(.self)
|
||||
// color: red
|
||||
// .content
|
||||
// border-bottom-left-radius: 1em
|
||||
@@ -0,0 +1,20 @@
|
||||
import './button.sass'
|
||||
|
||||
function Button({
|
||||
label,
|
||||
action,
|
||||
icon,
|
||||
}: {
|
||||
label: string
|
||||
action: () => any
|
||||
icon?: string
|
||||
}) {
|
||||
return (
|
||||
<span className="button" onClick={action}>
|
||||
{icon && <i className={`icon-${icon}`}></i>}
|
||||
{label}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
export default Button
|
||||
@@ -0,0 +1,22 @@
|
||||
.button
|
||||
cursor: pointer
|
||||
margin: 0 .2em
|
||||
padding: 0.3em .5em
|
||||
padding-left: .3em
|
||||
border: 2px solid var(--color-secondary)
|
||||
color: var(--color-secondary)
|
||||
background-color: var(--color-light)
|
||||
border-radius: .5em
|
||||
text-transform: uppercase
|
||||
// font-weight: bold
|
||||
font-family: 'Monsterrat'
|
||||
user-select: none
|
||||
|
||||
&:hover
|
||||
background-color: var(--color-secondary)
|
||||
color: var(--color-ternary)
|
||||
|
||||
i
|
||||
// border-right: 1px solid red
|
||||
padding-right: .3em
|
||||
margin-right: .2em
|
||||
@@ -0,0 +1,124 @@
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
import { DateRangePicker } from 'react-date-range'
|
||||
|
||||
import { dateToUnixExtended } from '../../PartialConvo'
|
||||
|
||||
import contextCurrentConvo from '../../Contexts/contextCurrentConvo'
|
||||
import contextConvos from '../../Contexts/contextConvos'
|
||||
|
||||
import './convoselector.sass'
|
||||
|
||||
import 'react-date-range/dist/styles.css' // picker main style file
|
||||
import 'react-date-range/dist/theme/default.css' // picker theme css file
|
||||
|
||||
function ConvoSelector() {
|
||||
const convos = useContext(contextConvos),
|
||||
[[currentConvo, setCurrentConvo], [range, setRange]] =
|
||||
useContext(contextCurrentConvo)
|
||||
|
||||
const [picker, setPicker] = useState({
|
||||
startDate: new Date(new Date().getTime() - 3.024e9),
|
||||
endDate: new Date(),
|
||||
key: 'selection',
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
setRange([
|
||||
dateToUnixExtended(picker.startDate),
|
||||
dateToUnixExtended(picker.endDate) + 8.64e10,
|
||||
])
|
||||
}, [picker])
|
||||
|
||||
return (
|
||||
<div className="selector">
|
||||
<div className="select">
|
||||
<span>Select an inbox: </span>
|
||||
<select
|
||||
onChange={({ target: { value } }) => setCurrentConvo(value)}
|
||||
defaultValue={currentConvo?.id}
|
||||
>
|
||||
{convos
|
||||
.sort((a, b) => a.title.localeCompare(b.title))
|
||||
.map(c => (
|
||||
<option key={c.id} value={c.id}>
|
||||
{c.title}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{currentConvo && (
|
||||
<div className="preview">
|
||||
<h2>{currentConvo.title}</h2>
|
||||
<div className="desc">
|
||||
<img src={currentConvo.image ?? ''} alt="photo unavailable" />
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Title</td>
|
||||
<td>{currentConvo.title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td>{currentConvo.type}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Category</td>
|
||||
<td>{'inbox'}</td>
|
||||
{/* TODO: pass category to convo from inbox */}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>First Message</td>
|
||||
<td>
|
||||
{new Date(
|
||||
currentConvo.firstMessage / 1e3
|
||||
).toLocaleString()}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last Message</td>
|
||||
<td>
|
||||
{new Date(
|
||||
currentConvo.lastMessage / 1e3
|
||||
).toLocaleString()}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h2>Members</h2>
|
||||
<div className="members">
|
||||
<ul>
|
||||
{currentConvo.members.map(m => (
|
||||
<li
|
||||
key={m.name}
|
||||
data-left={!m.participates}
|
||||
data-self={m.self}
|
||||
>
|
||||
{m.name}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{currentConvo && (
|
||||
<div className="picker">
|
||||
<h1>Select a range for displayed messages:</h1>
|
||||
<DateRangePicker
|
||||
onChange={item => setPicker(item.selection)}
|
||||
showSelectionPreview={true}
|
||||
moveRangeOnFirstSelection={false}
|
||||
minDate={new Date(currentConvo.firstMessage / 1e3)}
|
||||
maxDate={new Date(currentConvo.lastMessage / 1e3)}
|
||||
ranges={[picker]}
|
||||
direction="vertical"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ConvoSelector
|
||||
@@ -0,0 +1,35 @@
|
||||
.selector
|
||||
.select
|
||||
text-align: center
|
||||
font-size: 1.5em
|
||||
font-family: Monsterrat
|
||||
padding-bottom: .5em
|
||||
border-bottom: 1px solid gray
|
||||
display: flex
|
||||
|
||||
span
|
||||
width: 14em
|
||||
|
||||
select
|
||||
font-size: .75em
|
||||
width: 100%
|
||||
|
||||
.preview
|
||||
|
||||
.desc
|
||||
display: flex
|
||||
|
||||
img
|
||||
margin: .5em
|
||||
width: 6em
|
||||
height: 6em
|
||||
text-align: center
|
||||
display: inline-block
|
||||
border: 1px solid black
|
||||
border-radius: 3px
|
||||
|
||||
.members ul
|
||||
li[data-self=true]
|
||||
font-weight: bold
|
||||
li[data-left=true]
|
||||
text-decoration: line-through
|
||||
@@ -0,0 +1,101 @@
|
||||
import { useEffect, useReducer, useState } from 'react'
|
||||
import Button from '../Button/Button'
|
||||
import Progress from '../Progress/Progress'
|
||||
|
||||
import './intro.sass'
|
||||
|
||||
type status = [string, number]
|
||||
|
||||
const totalMasterParts = 4
|
||||
|
||||
function Intro() {
|
||||
const [paths, setPaths] = useState<string[]>([]),
|
||||
[mainProgress, setMainProgress] = useState<status>([
|
||||
'Waiting for paths',
|
||||
0,
|
||||
]),
|
||||
[subProgress, setSubProgress] = useState<status>(['', 0]),
|
||||
[log, addLog] = useState<any[]>([])
|
||||
|
||||
function beginScan(paths: string[]) {
|
||||
window.invoke('scan', { paths }).then(convosIds => {
|
||||
console.log(convosIds)
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
window.events.on('update-progress', ([level, message, status, err]) => {
|
||||
if (level == 'main') setMainProgress([message, status])
|
||||
if (level == 'sub') setSubProgress([message, status])
|
||||
addLog(prev => [...prev, [level, message, status, err]])
|
||||
})
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div
|
||||
className="intro"
|
||||
style={{
|
||||
cursor:
|
||||
mainProgress[1] > 0 && mainProgress[1] < totalMasterParts
|
||||
? 'wait'
|
||||
: 'default',
|
||||
}}
|
||||
>
|
||||
<span className="header">Select paths to scan</span>
|
||||
<p>
|
||||
Add folders with <code>filtered_threads</code>,{' '}
|
||||
<code>archived_threads</code>, <code>inbox</code> or{' '}
|
||||
<code>message_requests</code> inside
|
||||
</p>
|
||||
<div className="controls">
|
||||
<Button
|
||||
label="Open"
|
||||
action={() =>
|
||||
window.invoke('get-paths').then(({ canceled, filePaths }) => {
|
||||
!canceled &&
|
||||
setPaths(prev => [
|
||||
...prev,
|
||||
...filePaths.filter(p => !prev.includes(p)),
|
||||
])
|
||||
})
|
||||
}
|
||||
icon="plus-squared"
|
||||
/>
|
||||
</div>
|
||||
<div className="paths">
|
||||
{paths.map(path => (
|
||||
<div key={path}>
|
||||
{path}
|
||||
<i
|
||||
className="icon-cancel"
|
||||
onClick={() =>
|
||||
setPaths(prev => prev.filter(p => p != path))
|
||||
}
|
||||
></i>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{paths.length > 0 && (
|
||||
<Button
|
||||
label="Scan"
|
||||
action={() => beginScan(paths)}
|
||||
icon="search"
|
||||
/>
|
||||
)}
|
||||
|
||||
{log.length > 0 && (
|
||||
<div className="bars">
|
||||
<Progress
|
||||
label={mainProgress[0]}
|
||||
steps={[mainProgress[1], totalMasterParts]}
|
||||
/>
|
||||
<Progress label={subProgress[0]} status={subProgress[1]} />
|
||||
{/* TODO: display the logs */}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Intro
|
||||
@@ -0,0 +1,54 @@
|
||||
.intro
|
||||
top: 1em
|
||||
right: 1em
|
||||
bottom: 1em
|
||||
left: 1em
|
||||
color: var(--color-dark)
|
||||
padding: 1em
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
|
||||
.header
|
||||
font-size: 2em
|
||||
font-family: 'Roboto'
|
||||
|
||||
.controls
|
||||
margin: 1em 0
|
||||
|
||||
p
|
||||
max-width: 24em
|
||||
text-align: center
|
||||
|
||||
.paths
|
||||
min-width: 25em
|
||||
padding: 0.5em
|
||||
padding-bottom: .6em
|
||||
background-color: #0002
|
||||
border-radius: 3px
|
||||
margin-bottom: 1em
|
||||
|
||||
div:nth-child(2n)
|
||||
background-color: unset
|
||||
|
||||
div
|
||||
width: 100%
|
||||
background-color: #fff1
|
||||
|
||||
i
|
||||
float: right
|
||||
cursor: pointer
|
||||
|
||||
&:hover
|
||||
color: var(--color-secondary)
|
||||
|
||||
.bars
|
||||
margin: 1em 0
|
||||
width: 60%
|
||||
|
||||
.logs
|
||||
font-family: 'Roboto Mono'
|
||||
font-size: .75em
|
||||
|
||||
div span
|
||||
color: red
|
||||
@@ -0,0 +1,130 @@
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
import Message from '../../../ts/Message'
|
||||
import { messageMedia } from '../../../ts/types/takeout'
|
||||
import contextCurrentConvo from '../../Contexts/contextCurrentConvo'
|
||||
import PartialConvo from '../../PartialConvo'
|
||||
|
||||
import './media.sass'
|
||||
|
||||
function Entry({
|
||||
type,
|
||||
content,
|
||||
message,
|
||||
goto,
|
||||
}: {
|
||||
type: string
|
||||
content: messageMedia
|
||||
message: Message
|
||||
goto: (number) => void
|
||||
}) {
|
||||
const [open, setOpen] = useState(false)
|
||||
|
||||
return (
|
||||
<div className="entry" data-open={open}>
|
||||
<div className="header" onClick={() => setOpen(o => !o)}>
|
||||
{
|
||||
{
|
||||
photos: <i className="icon-picture"></i>,
|
||||
gifs: <i className="icon-picture"></i>,
|
||||
audios: <i className="icon-mic"></i>,
|
||||
videos: <i className="icon-video"></i>,
|
||||
files: <i className="icon-attach"></i>,
|
||||
}[type]
|
||||
}
|
||||
{message.sender} —
|
||||
{new Date(message.time / 1e3).toLocaleDateString()}
|
||||
</div>
|
||||
|
||||
{open && (
|
||||
<div className="preview">
|
||||
{
|
||||
{
|
||||
photos: (
|
||||
<img src={content.uri} alt="unable to load image" />
|
||||
),
|
||||
gifs: <img src={content.uri} alt="unable to load gif" />,
|
||||
audios: (
|
||||
<audio controls>
|
||||
<source src={content.uri} />
|
||||
</audio>
|
||||
),
|
||||
videos: (
|
||||
<video controls>
|
||||
<source src={content.uri} />
|
||||
</video>
|
||||
),
|
||||
files: <i className="icon-attach"></i>,
|
||||
}[type]
|
||||
}
|
||||
|
||||
<div className="info">
|
||||
<div>
|
||||
Time: {new Date(message.time / 1e3).toLocaleTimeString()}
|
||||
</div>
|
||||
{content.creation_timestamp && (
|
||||
<div>
|
||||
Created:{' '}
|
||||
{new Date(
|
||||
content.creation_timestamp * 1e3
|
||||
).toLocaleString()}
|
||||
</div>
|
||||
)}
|
||||
<div></div>
|
||||
<div></div>
|
||||
{message.reactions && (
|
||||
<div className="reactions">
|
||||
Reactions:
|
||||
{message.reactions.map(({ reaction, actor }) => (
|
||||
<span title={actor}>{reaction}</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<a href="#" onClick={goto}>
|
||||
Go to conversation
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function Preview() {
|
||||
return <span>lmao</span>
|
||||
}
|
||||
|
||||
// TODO: add optional grid view
|
||||
|
||||
export default function Media() {
|
||||
const [[currentConvo], [range, setRange]] = useContext(contextCurrentConvo)
|
||||
|
||||
const [partial, setPartial] = useState<PartialConvo>()
|
||||
|
||||
useEffect(() => {
|
||||
if (currentConvo) setPartial(new PartialConvo(currentConvo, range))
|
||||
}, [currentConvo, range])
|
||||
|
||||
return (
|
||||
<div className="media">
|
||||
{partial &&
|
||||
partial.messages
|
||||
.filter(({ media }) => media)
|
||||
.map(message =>
|
||||
Object.entries(message.media!).map(([type, entries]) =>
|
||||
entries.map(e => (
|
||||
<Entry
|
||||
key={e.uri}
|
||||
type={type}
|
||||
content={e}
|
||||
message={message}
|
||||
goto={() => {}} /* TODO: add goto in conversation feature */
|
||||
/>
|
||||
))
|
||||
)
|
||||
)
|
||||
.flat()}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
.media
|
||||
.entry
|
||||
padding: .5em
|
||||
border-bottom: 1px solid gray
|
||||
|
||||
&[data-open=true] .header
|
||||
border-bottom: 1px dashed gray
|
||||
padding-bottom: 0.5em
|
||||
|
||||
.header
|
||||
cursor: pointer
|
||||
user-select: none
|
||||
|
||||
i
|
||||
margin-right: .5em
|
||||
|
||||
.preview
|
||||
display: flex
|
||||
|
||||
.info
|
||||
padding: .5em
|
||||
|
||||
.reactions span
|
||||
cursor: help
|
||||
margin-left: .25em
|
||||
padding: 0 2px
|
||||
border-radius: 3px
|
||||
|
||||
& > :first-child
|
||||
min-width: 6em
|
||||
min-height: 6em
|
||||
max-height: 75vh
|
||||
max-width: 50%
|
||||
|
||||
img
|
||||
margin: 0.5em
|
||||
text-align: center
|
||||
display: inline-block
|
||||
border: 1px solid black
|
||||
border-radius: 3px
|
||||
@@ -0,0 +1,62 @@
|
||||
import { useState } from 'react'
|
||||
import './menu.sass'
|
||||
import icon from '../../../assets/icon.png'
|
||||
|
||||
function Menu({
|
||||
setPane,
|
||||
initial,
|
||||
}: {
|
||||
setPane: (id: string) => void
|
||||
initial: string
|
||||
}) {
|
||||
const [active, setActive] = useState(initial)
|
||||
|
||||
const options = [
|
||||
['convo', 'chat-empty', 'View conversation'],
|
||||
['media', 'picture', 'View media'],
|
||||
['search', 'search', 'Search'],
|
||||
['stats', 'chart-bar', 'View statistics'],
|
||||
],
|
||||
bottomOptions = [
|
||||
['selector', 'th-list', 'Select conversation'],
|
||||
['import', 'download', 'Import messages'],
|
||||
['settings', 'cog-alt', 'Settings'],
|
||||
]
|
||||
|
||||
function change(id: string) {
|
||||
setActive(id)
|
||||
setPane(id)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="menu">
|
||||
<img src={icon} alt="" />
|
||||
<div className="lists">
|
||||
<div className="list">
|
||||
{options.map(([id, icon, title]) => (
|
||||
<i
|
||||
key={id}
|
||||
data-active={id == active}
|
||||
className={`icon-${icon}`}
|
||||
title={title}
|
||||
onClick={() => change(id)}
|
||||
></i>
|
||||
))}
|
||||
</div>
|
||||
<div className="list bottom">
|
||||
{bottomOptions.map(([id, icon, title]) => (
|
||||
<i
|
||||
key={id}
|
||||
data-active={id == active}
|
||||
className={`icon-${icon}`}
|
||||
title={title}
|
||||
onClick={() => change(id)}
|
||||
></i>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Menu
|
||||
@@ -0,0 +1,67 @@
|
||||
.menu
|
||||
position: fixed
|
||||
left: 0
|
||||
top: 0
|
||||
height: 100%
|
||||
background-color: var(--color-primary)
|
||||
color: var(--color-light)
|
||||
padding: .75em
|
||||
font-size: 1.2em
|
||||
|
||||
display: flex
|
||||
flex-direction: column
|
||||
|
||||
img
|
||||
border-bottom: 1px solid #fffa
|
||||
padding-bottom: .75em
|
||||
margin-bottom: 1em
|
||||
width: 2em
|
||||
|
||||
.lists
|
||||
display: flex
|
||||
flex-direction: column
|
||||
height: 100%
|
||||
justify-content: space-between
|
||||
|
||||
.list
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
|
||||
&.bottom
|
||||
margin-bottom: unset
|
||||
margin-top: 1em
|
||||
|
||||
i
|
||||
margin-bottom: unset
|
||||
margin-top: 1em
|
||||
|
||||
i
|
||||
margin-bottom: 1em
|
||||
// padding: .5em
|
||||
width: 2em
|
||||
width: 1.5em
|
||||
height: 1.5em
|
||||
cursor: pointer
|
||||
position: relative
|
||||
|
||||
&:hover:after
|
||||
opacity: .5
|
||||
|
||||
&[data-active=true]:after
|
||||
opacity: 1
|
||||
|
||||
&:after
|
||||
content: ""
|
||||
opacity: 0
|
||||
width: 100%
|
||||
background-color: var(--color-light)
|
||||
height: 4px
|
||||
left: 0
|
||||
bottom: 0
|
||||
position: absolute
|
||||
border-radius: 2px
|
||||
|
||||
// border-radius: 100%
|
||||
// background-color: var(--color-light)
|
||||
// color: var(--color-primary)
|
||||
@@ -0,0 +1,31 @@
|
||||
import './progress.sass'
|
||||
|
||||
function Progress({
|
||||
label,
|
||||
status,
|
||||
steps,
|
||||
}: {
|
||||
label: string
|
||||
status?: number
|
||||
steps?: [number, number]
|
||||
}) {
|
||||
return (
|
||||
<div className="progress">
|
||||
<span className="label">
|
||||
{label} [
|
||||
{typeof status != 'undefined'
|
||||
? `${status}%`
|
||||
: steps
|
||||
? `${steps[0]}/${steps[1]}`
|
||||
: `?`}
|
||||
]
|
||||
</span>
|
||||
<div
|
||||
className="status"
|
||||
style={{ width: `${status ?? (steps![0] / steps![1]) * 100}%` }}
|
||||
></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Progress
|
||||
@@ -0,0 +1,15 @@
|
||||
.progress
|
||||
text-align: center
|
||||
background-color: #0001
|
||||
margin: .5em 0
|
||||
padding-top: 0.4em
|
||||
|
||||
.label
|
||||
// color: #fff
|
||||
font-family: 'Roboto Mono'
|
||||
font-size: .75em
|
||||
|
||||
.status
|
||||
margin-top: .5em
|
||||
border-bottom: 2px solid var(--color-primary)
|
||||
transition: .5s
|
||||
@@ -0,0 +1,108 @@
|
||||
import Fuse from 'fuse.js'
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
import Convo from '../../../ts/Convo'
|
||||
import Message from '../../../ts/Message'
|
||||
import { chunkRange } from '../../ChunkConvo'
|
||||
import contextCurrentConvo from '../../Contexts/contextCurrentConvo'
|
||||
import PartialConvo from '../../PartialConvo'
|
||||
import { Chat } from '../Browse/Browse'
|
||||
|
||||
import './search.sass'
|
||||
|
||||
function runSearch(convo: Convo, query: string, options: {}) {
|
||||
let fullPartial = new PartialConvo(convo, [0, Infinity])
|
||||
const fuse = new Fuse(fullPartial.messages, {
|
||||
keys: ['content'],
|
||||
...options,
|
||||
})
|
||||
|
||||
return fuse.search(query)
|
||||
}
|
||||
|
||||
export default function Search() {
|
||||
const [[currentConvo]] = useContext(contextCurrentConvo)
|
||||
|
||||
let [query, setQuery] = useState(''),
|
||||
[accuracy, setAccuracy] = useState(0.6),
|
||||
[caseSensitive, setCaseSensitive] = useState(false),
|
||||
[range, setRange] = useState<[number, number]>()
|
||||
|
||||
const [[results, n], setResults] = useState<
|
||||
[Fuse.FuseResult<Message>[], number]
|
||||
>([[], -1])
|
||||
|
||||
function search() {
|
||||
setResults([
|
||||
runSearch(currentConvo!, query, {
|
||||
threshold: accuracy,
|
||||
caseSensitive,
|
||||
}),
|
||||
0,
|
||||
])
|
||||
}
|
||||
|
||||
function browse(up: boolean) {
|
||||
if (up) {
|
||||
if (n < results.length - 1) setResults(([r, n]) => [r, ++n])
|
||||
} else {
|
||||
if (n > 0) setResults(([r, n]) => [r, --n])
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
currentConvo &&
|
||||
n != -1 &&
|
||||
setRange(chunkRange(currentConvo, results[n].item.time, [6, 8]))
|
||||
}, [results, n])
|
||||
|
||||
// TODO: add regex mode,
|
||||
// enter to search and next,
|
||||
// more search options
|
||||
|
||||
return (
|
||||
<div className="search">
|
||||
<div className="criteria">
|
||||
Search criteria
|
||||
<div>
|
||||
<input
|
||||
type="search"
|
||||
name="query"
|
||||
placeholder="Search query"
|
||||
onChange={e => setQuery(e.target.value)}
|
||||
/>
|
||||
Case sensisite:{' '}
|
||||
<input
|
||||
type="checkbox"
|
||||
name="case"
|
||||
onChange={e => setCaseSensitive(e.target.checked)}
|
||||
/>
|
||||
<input
|
||||
type="range"
|
||||
name="accuracy"
|
||||
min={0}
|
||||
max={1}
|
||||
step="0.025"
|
||||
onChange={e => setAccuracy(parseInt(e.target.value))}
|
||||
/>
|
||||
<input
|
||||
type="button"
|
||||
value="Search"
|
||||
onClick={() => currentConvo && search()}
|
||||
/>
|
||||
<input
|
||||
type="button"
|
||||
value="Previous"
|
||||
onClick={() => browse(false)}
|
||||
/>
|
||||
<input type="button" value="Next" onClick={() => browse(true)} />
|
||||
</div>
|
||||
{n > -1 && <div>Results: {results.length}</div>}
|
||||
</div>
|
||||
<div>
|
||||
{currentConvo && range && results.length > 0 && (
|
||||
<Chat goto={results[n].item.time} range={range} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
.search
|
||||
.criteria
|
||||
position: sticky
|
||||
top: 0
|
||||
z-index: 3
|
||||
padding: .5em
|
||||
backdrop-filter: blur(3px)
|
||||
@@ -0,0 +1,97 @@
|
||||
import 'chart.js/auto'
|
||||
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
import contextCurrentConvo from '../../Contexts/contextCurrentConvo'
|
||||
|
||||
import './stats.sass'
|
||||
|
||||
import messagesPerDay from './messages-per-day'
|
||||
import messagesPerMember from './messages-per-member'
|
||||
|
||||
// TODO: add missing renderers
|
||||
|
||||
const renderers = {
|
||||
messagesPerDay,
|
||||
messagesPerMember,
|
||||
}
|
||||
|
||||
export default function Stats() {
|
||||
const [[currentConvo]] = useContext(contextCurrentConvo)
|
||||
|
||||
const [statName, setStatName] = useState(''),
|
||||
[chartStyle, setChartStyle] = useState('')
|
||||
|
||||
const [stacked, setStacked] = useState(true),
|
||||
[year, setYear] = useState(new Date().getFullYear()) // TODO: add an input for this
|
||||
|
||||
useEffect(() => setChartStyle(''), [statName])
|
||||
|
||||
return (
|
||||
<div className="stats">
|
||||
<div className="settings">
|
||||
<select onChange={e => setStatName(e.target.value)}>
|
||||
<option value="">select a stat</option>
|
||||
{Object.entries(renderers).map(([id, { label }]) => (
|
||||
<option key={id} value={id}>
|
||||
{label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
{statName && (
|
||||
<select onChange={e => setChartStyle(e.target.value)}>
|
||||
<option value="">select a chart</option>
|
||||
|
||||
{Object.entries(renderers[statName])
|
||||
.filter(([, renderer]) => typeof renderer == 'function')
|
||||
.map(([id]) => (
|
||||
<option key={id} value={id}>
|
||||
{id}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
|
||||
{chartStyle && (
|
||||
<div>
|
||||
Stacked:
|
||||
<input
|
||||
type="checkbox"
|
||||
defaultChecked={stacked}
|
||||
onChange={e => setStacked(e.target.checked)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="view">
|
||||
{currentConvo ? (
|
||||
statName ? (
|
||||
chartStyle ? (
|
||||
currentConvo.stats[statName] ? (
|
||||
renderers[statName][chartStyle] ? (
|
||||
//
|
||||
renderers[statName][chartStyle]({
|
||||
// FIXME: charts often overflow offscreen
|
||||
convo: currentConvo,
|
||||
data: currentConvo.stats[statName],
|
||||
options: [stacked, year],
|
||||
})
|
||||
) : (
|
||||
<span>Selected chart is unavailable</span>
|
||||
)
|
||||
) : (
|
||||
<span>Selected stat is unavailable</span>
|
||||
)
|
||||
) : (
|
||||
<span>Select a chart</span>
|
||||
)
|
||||
) : (
|
||||
<span>Select a stat</span>
|
||||
)
|
||||
) : (
|
||||
<span>Select a conversation</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Bar } from 'react-chartjs-2'
|
||||
import {
|
||||
hueFromString,
|
||||
monthsLabels,
|
||||
statRendererProps,
|
||||
} from '../../../ts/types/Stat'
|
||||
|
||||
function bar({ data, convo, options: [stacked, year] }: statRendererProps) {
|
||||
return (
|
||||
<>
|
||||
<h1>Messages per day</h1>
|
||||
<div className="chart">
|
||||
<Bar
|
||||
about="asdf"
|
||||
data={{
|
||||
labels: monthsLabels.flat(),
|
||||
datasets: convo.members.map(({ name }) => ({
|
||||
label: name,
|
||||
stack: stacked ? 'stack' : name,
|
||||
data: data[name][year].flat(),
|
||||
backgroundColor: `hsl(${hueFromString(
|
||||
name
|
||||
)}deg, 50%, 50%)`,
|
||||
})),
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default {
|
||||
label: 'Messages per day',
|
||||
desc: 'Number of messages sent by each member during a day',
|
||||
bar,
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Doughnut } from 'react-chartjs-2'
|
||||
|
||||
import { hueFromString, statRendererProps } from '../../../ts/types/Stat'
|
||||
|
||||
export function donut({ data }: statRendererProps) {
|
||||
return (
|
||||
<>
|
||||
<h1>Messages per member</h1>
|
||||
<div className="chart">
|
||||
<Doughnut
|
||||
about="asdf"
|
||||
data={{
|
||||
labels: Object.keys(data),
|
||||
datasets: [
|
||||
{
|
||||
label: 'Messages',
|
||||
data: Object.values(data),
|
||||
backgroundColor: Object.keys(data).map(
|
||||
n => `hsl(${hueFromString(n)}deg, 50%, 50%)`
|
||||
),
|
||||
},
|
||||
],
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default {
|
||||
label: 'Messages per member',
|
||||
desc: 'Total number of messages sent by each member',
|
||||
donut,
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,30 @@
|
||||
Font license info
|
||||
|
||||
|
||||
## Font Awesome
|
||||
|
||||
Copyright (C) 2016 by Dave Gandy
|
||||
|
||||
Author: Dave Gandy
|
||||
License: SIL ()
|
||||
Homepage: http://fortawesome.github.com/Font-Awesome/
|
||||
|
||||
|
||||
## Fontelico
|
||||
|
||||
Copyright (C) 2012 by Fontello project
|
||||
|
||||
Author: Crowdsourced, for Fontello project
|
||||
License: SIL (http://scripts.sil.org/OFL)
|
||||
Homepage: http://fontello.com
|
||||
|
||||
|
||||
## MFG Labs
|
||||
|
||||
Copyright (C) 2012 by Daniel Bruce
|
||||
|
||||
Author: MFG Labs
|
||||
License: SIL (http://scripts.sil.org/OFL)
|
||||
Homepage: http://www.mfglabs.com/
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
This webfont is generated by https://fontello.com open source project.
|
||||
|
||||
|
||||
================================================================================
|
||||
Please, note, that you should obey original font licenses, used to make this
|
||||
webfont pack. Details available in LICENSE.txt file.
|
||||
|
||||
- Usually, it's enough to publish content of LICENSE.txt file somewhere on your
|
||||
site in "About" section.
|
||||
|
||||
- If your project is open-source, usually, it will be ok to make LICENSE.txt
|
||||
file publicly available in your repository.
|
||||
|
||||
- Fonts, used in Fontello, don't require a clickable link on your site.
|
||||
But any kind of additional authors crediting is welcome.
|
||||
================================================================================
|
||||
|
||||
|
||||
Comments on archive content
|
||||
---------------------------
|
||||
|
||||
- /font/* - fonts in different formats
|
||||
|
||||
- /css/* - different kinds of css, for all situations. Should be ok with
|
||||
twitter bootstrap. Also, you can skip <i> style and assign icon classes
|
||||
directly to text elements, if you don't mind about IE7.
|
||||
|
||||
- demo.html - demo file, to show your webfont content
|
||||
|
||||
- LICENSE.txt - license info about source fonts, used to build your one.
|
||||
|
||||
- config.json - keeps your settings. You can import it back into fontello
|
||||
anytime, to continue your work
|
||||
|
||||
|
||||
Why so many CSS files ?
|
||||
-----------------------
|
||||
|
||||
Because we like to fit all your needs :)
|
||||
|
||||
- basic file, <your_font_name>.css - is usually enough, it contains @font-face
|
||||
and character code definitions
|
||||
|
||||
- *-ie7.css - if you need IE7 support, but still don't wish to put char codes
|
||||
directly into html
|
||||
|
||||
- *-codes.css and *-ie7-codes.css - if you like to use your own @font-face
|
||||
rules, but still wish to benefit from css generation. That can be very
|
||||
convenient for automated asset build systems. When you need to update font -
|
||||
no need to manually edit files, just override old version with archive
|
||||
content. See fontello source code for examples.
|
||||
|
||||
- *-embedded.css - basic css file, but with embedded WOFF font, to avoid
|
||||
CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain.
|
||||
We strongly recommend to resolve this issue by `Access-Control-Allow-Origin`
|
||||
server headers. But if you ok with dirty hack - this file is for you. Note,
|
||||
that data url moved to separate @font-face to avoid problems with <IE9, when
|
||||
string is too long.
|
||||
|
||||
- animate.css - use it to get ideas about spinner rotation animation.
|
||||
|
||||
|
||||
Attention for server setup
|
||||
--------------------------
|
||||
|
||||
You MUST setup server to reply with proper `mime-types` for font files -
|
||||
otherwise some browsers will fail to show fonts.
|
||||
|
||||
Usually, `apache` already has necessary settings, but `nginx` and other
|
||||
webservers should be tuned. Here is list of mime types for our file extensions:
|
||||
|
||||
- `application/vnd.ms-fontobject` - eot
|
||||
- `application/x-font-woff` - woff
|
||||
- `application/x-font-ttf` - ttf
|
||||
- `image/svg+xml` - svg
|
||||
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"name": "",
|
||||
"css_prefix_text": "icon-",
|
||||
"css_use_suffix": false,
|
||||
"hinting": true,
|
||||
"units_per_em": 1000,
|
||||
"ascent": 850,
|
||||
"glyphs": [
|
||||
{
|
||||
"uid": "1a5cfa186647e8c929c2b17b9fc4dac1",
|
||||
"css": "plus-squared",
|
||||
"code": 61694,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "5211af474d3a9848f67f945e2ccaf143",
|
||||
"css": "cancel",
|
||||
"code": 59395,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "f755a58fb985eeb70bd47d9b31892a34",
|
||||
"css": "minus-squared",
|
||||
"code": 61766,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "ec21fe3492bb04d9e29103c319556ed8",
|
||||
"css": "search",
|
||||
"code": 62733,
|
||||
"src": "mfglabs"
|
||||
},
|
||||
{
|
||||
"uid": "381da2c2f7fd51f8de877c044d7f439d",
|
||||
"css": "picture",
|
||||
"code": 59392,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "31951fbb9820ed0690f675b3d495c8da",
|
||||
"css": "chat-empty",
|
||||
"code": 61670,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "266d5d9adf15a61800477a5acf9a4462",
|
||||
"css": "chart-bar",
|
||||
"code": 59393,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "98687378abd1faf8f6af97c254eb6cd6",
|
||||
"css": "cog-alt",
|
||||
"code": 59394,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "f0c301ac841dafc38d8eb1b933fc73e5",
|
||||
"css": "spin2",
|
||||
"code": 59441,
|
||||
"src": "fontelico"
|
||||
},
|
||||
{
|
||||
"uid": "9a76bc135eac17d2c8b8ad4a5774fc87",
|
||||
"css": "download",
|
||||
"code": 59396,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "f805bb95d40c7ef2bc51b3d50d4f2e5c",
|
||||
"css": "th-list",
|
||||
"code": 59397,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "872d9516df93eb6b776cc4d94bd97dac",
|
||||
"css": "video",
|
||||
"code": 59398,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "0d6ab6194c0eddda2b8c9cedf2ab248e",
|
||||
"css": "attach",
|
||||
"code": 59399,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "19c50c52858a81de58f9db488aba77bc",
|
||||
"css": "mic",
|
||||
"code": 61744,
|
||||
"src": "fontawesome"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+85
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
Animation example, for spinners
|
||||
*/
|
||||
.animate-spin {
|
||||
-moz-animation: spin 2s infinite linear;
|
||||
-o-animation: spin 2s infinite linear;
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
animation: spin 2s infinite linear;
|
||||
display: inline-block;
|
||||
}
|
||||
@-moz-keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@-o-keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@-ms-keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
.icon-picture:before { content: '\e800'; } /* '' */
|
||||
.icon-chart-bar:before { content: '\e801'; } /* '' */
|
||||
.icon-cog-alt:before { content: '\e802'; } /* '' */
|
||||
.icon-cancel:before { content: '\e803'; } /* '' */
|
||||
.icon-download:before { content: '\e804'; } /* '' */
|
||||
.icon-th-list:before { content: '\e805'; } /* '' */
|
||||
.icon-video:before { content: '\e806'; } /* '' */
|
||||
.icon-attach:before { content: '\e807'; } /* '' */
|
||||
.icon-spin2:before { content: '\e831'; } /* '' */
|
||||
.icon-chat-empty:before { content: '\f0e6'; } /* '' */
|
||||
.icon-plus-squared:before { content: '\f0fe'; } /* '' */
|
||||
.icon-mic:before { content: '\f130'; } /* '' */
|
||||
.icon-minus-squared:before { content: '\f146'; } /* '' */
|
||||
.icon-search:before { content: '\f50d'; } /* '' */
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.eot?9879669');
|
||||
src: url('../font/fontello.eot?9879669#iefix') format('embedded-opentype'),
|
||||
url('../font/fontello.svg?9879669#fontello') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('data:application/octet-stream;base64,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 truncated
|
||||
url('data:application/octet-stream;base64,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 truncated
|
||||
}
|
||||
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
|
||||
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
|
||||
/*
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.svg?9879669#fontello') format('svg');
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
[class^="icon-"]:before, [class*=" icon-"]:before {
|
||||
font-family: "fontello";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
speak: never;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
width: 1em;
|
||||
margin-right: .2em;
|
||||
text-align: center;
|
||||
/* opacity: .8; */
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
|
||||
/* fix buttons height, for twitter bootstrap */
|
||||
line-height: 1em;
|
||||
|
||||
/* Animation center compensation - margins should be symmetric */
|
||||
/* remove if not needed */
|
||||
margin-left: .2em;
|
||||
|
||||
/* you can be more comfortable with increased icons size */
|
||||
/* font-size: 120%; */
|
||||
|
||||
/* Font smoothing. That was taken from TWBS */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
/* Uncomment for 3D effect */
|
||||
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
||||
}
|
||||
|
||||
.icon-picture:before { content: '\e800'; } /* '' */
|
||||
.icon-chart-bar:before { content: '\e801'; } /* '' */
|
||||
.icon-cog-alt:before { content: '\e802'; } /* '' */
|
||||
.icon-cancel:before { content: '\e803'; } /* '' */
|
||||
.icon-download:before { content: '\e804'; } /* '' */
|
||||
.icon-th-list:before { content: '\e805'; } /* '' */
|
||||
.icon-video:before { content: '\e806'; } /* '' */
|
||||
.icon-attach:before { content: '\e807'; } /* '' */
|
||||
.icon-spin2:before { content: '\e831'; } /* '' */
|
||||
.icon-chat-empty:before { content: '\f0e6'; } /* '' */
|
||||
.icon-plus-squared:before { content: '\f0fe'; } /* '' */
|
||||
.icon-mic:before { content: '\f130'; } /* '' */
|
||||
.icon-minus-squared:before { content: '\f146'; } /* '' */
|
||||
.icon-search:before { content: '\f50d'; } /* '' */
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
.icon-picture { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-chart-bar { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-cog-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-cancel { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-download { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-th-list { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-video { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-attach { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-spin2 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-chat-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-plus-squared { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-mic { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-minus-squared { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-search { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
[class^="icon-"], [class*=" icon-"] {
|
||||
font-family: 'fontello';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
|
||||
/* fix buttons height */
|
||||
line-height: 1em;
|
||||
|
||||
/* you can be more comfortable with increased icons size */
|
||||
/* font-size: 120%; */
|
||||
}
|
||||
|
||||
.icon-picture { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-chart-bar { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-cog-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-cancel { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-download { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-th-list { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-video { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-attach { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-spin2 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-chat-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-plus-squared { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-mic { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-minus-squared { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-search { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.eot?36294298');
|
||||
src: url('../font/fontello.eot?36294298#iefix') format('embedded-opentype'),
|
||||
url('../font/fontello.woff2?36294298') format('woff2'),
|
||||
url('../font/fontello.woff?36294298') format('woff'),
|
||||
url('../font/fontello.ttf?36294298') format('truetype'),
|
||||
url('../font/fontello.svg?36294298#fontello') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
|
||||
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
|
||||
/*
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.svg?36294298#fontello') format('svg');
|
||||
}
|
||||
}
|
||||
*/
|
||||
[class^="icon-"]:before, [class*=" icon-"]:before {
|
||||
font-family: "fontello";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
speak: never;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
width: 1em;
|
||||
margin-right: .2em;
|
||||
text-align: center;
|
||||
/* opacity: .8; */
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
|
||||
/* fix buttons height, for twitter bootstrap */
|
||||
line-height: 1em;
|
||||
|
||||
/* Animation center compensation - margins should be symmetric */
|
||||
/* remove if not needed */
|
||||
margin-left: .2em;
|
||||
|
||||
/* you can be more comfortable with increased icons size */
|
||||
/* font-size: 120%; */
|
||||
|
||||
/* Font smoothing. That was taken from TWBS */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
/* Uncomment for 3D effect */
|
||||
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
||||
}
|
||||
|
||||
.icon-picture:before { content: '\e800'; } /* '' */
|
||||
.icon-chart-bar:before { content: '\e801'; } /* '' */
|
||||
.icon-cog-alt:before { content: '\e802'; } /* '' */
|
||||
.icon-cancel:before { content: '\e803'; } /* '' */
|
||||
.icon-download:before { content: '\e804'; } /* '' */
|
||||
.icon-th-list:before { content: '\e805'; } /* '' */
|
||||
.icon-video:before { content: '\e806'; } /* '' */
|
||||
.icon-attach:before { content: '\e807'; } /* '' */
|
||||
.icon-spin2:before { content: '\e831'; } /* '' */
|
||||
.icon-chat-empty:before { content: '\f0e6'; } /* '' */
|
||||
.icon-plus-squared:before { content: '\f0fe'; } /* '' */
|
||||
.icon-mic:before { content: '\f130'; } /* '' */
|
||||
.icon-minus-squared:before { content: '\f146'; } /* '' */
|
||||
.icon-search:before { content: '\f50d'; } /* '' */
|
||||
@@ -0,0 +1,266 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
html {
|
||||
font-size: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
}
|
||||
a:focus {
|
||||
outline: thin dotted #333;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
a:hover,
|
||||
a:active {
|
||||
outline: 0;
|
||||
}
|
||||
input {
|
||||
margin: 0;
|
||||
font-size: 100%;
|
||||
vertical-align: middle;
|
||||
*overflow: visible;
|
||||
line-height: normal;
|
||||
}
|
||||
input::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
color: #333;
|
||||
background-color: #fff;
|
||||
}
|
||||
a {
|
||||
color: #08c;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: #005580;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.row {
|
||||
margin-left: -20px;
|
||||
*zoom: 1;
|
||||
}
|
||||
.row:before,
|
||||
.row:after {
|
||||
display: table;
|
||||
content: "";
|
||||
line-height: 0;
|
||||
}
|
||||
.row:after {
|
||||
clear: both;
|
||||
}
|
||||
.span3 {
|
||||
float: left;
|
||||
min-height: 1px;
|
||||
margin-left: 20px;
|
||||
width: 220px;
|
||||
}
|
||||
.container {
|
||||
width: 940px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
*zoom: 1;
|
||||
}
|
||||
.container:before,
|
||||
.container:after {
|
||||
display: table;
|
||||
content: "";
|
||||
line-height: 0;
|
||||
}
|
||||
.container:after {
|
||||
clear: both;
|
||||
}
|
||||
small {
|
||||
font-size: 85%;
|
||||
}
|
||||
h1 {
|
||||
margin: 10px 0;
|
||||
font-family: inherit;
|
||||
font-weight: bold;
|
||||
line-height: 20px;
|
||||
color: inherit;
|
||||
text-rendering: optimizelegibility;
|
||||
line-height: 40px;
|
||||
font-size: 38.5px;
|
||||
}
|
||||
h1 small {
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
color: #999;
|
||||
font-size: 24.5px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin-top: 90px;
|
||||
}
|
||||
.header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
margin-left: -480px;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding-top: 10px;
|
||||
z-index: 10;
|
||||
}
|
||||
.footer {
|
||||
color: #ddd;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.footer a {
|
||||
color: #ccc;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.the-icons {
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
}
|
||||
.switch {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 10px;
|
||||
color: #666;
|
||||
}
|
||||
.switch input {
|
||||
margin-right: 0.3em;
|
||||
}
|
||||
.codesOn .i-name {
|
||||
display: none;
|
||||
}
|
||||
.codesOn .i-code {
|
||||
display: inline;
|
||||
}
|
||||
.i-code {
|
||||
display: none;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('./font/fontello.eot?98707866');
|
||||
src: url('./font/fontello.eot?98707866#iefix') format('embedded-opentype'),
|
||||
url('./font/fontello.woff?98707866') format('woff'),
|
||||
url('./font/fontello.ttf?98707866') format('truetype'),
|
||||
url('./font/fontello.svg?98707866#fontello') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
.demo-icon {
|
||||
font-family: "fontello";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
speak: never;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
width: 1em;
|
||||
margin-right: .2em;
|
||||
text-align: center;
|
||||
/* opacity: .8; */
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
|
||||
/* fix buttons height, for twitter bootstrap */
|
||||
line-height: 1em;
|
||||
|
||||
/* Animation center compensation - margins should be symmetric */
|
||||
/* remove if not needed */
|
||||
margin-left: .2em;
|
||||
|
||||
/* You can be more comfortable with increased icons size */
|
||||
/* font-size: 120%; */
|
||||
|
||||
/* Font smoothing. That was taken from TWBS */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
/* Uncomment for 3D effect */
|
||||
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="css/animation.css"><!--[if IE 7]><link rel="stylesheet" href="css/" + font.fontname + "-ie7.css"><![endif]-->
|
||||
<script>
|
||||
function toggleCodes(on) {
|
||||
var obj = document.getElementById('icons');
|
||||
|
||||
if (on) {
|
||||
obj.className += ' codesOn';
|
||||
} else {
|
||||
obj.className = obj.className.replace(' codesOn', '');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container header">
|
||||
<h1>fontello <small>font demo</small></h1>
|
||||
<label class="switch">
|
||||
<input type="checkbox" onclick="toggleCodes(this.checked)">show codes
|
||||
</label>
|
||||
</div>
|
||||
<div class="container" id="icons">
|
||||
<div class="row">
|
||||
<div class="span3" title="Code: 0xe800">
|
||||
<i class="demo-icon icon-picture"></i> <span class="i-name">icon-picture</span><span class="i-code">0xe800</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xe801">
|
||||
<i class="demo-icon icon-chart-bar"></i> <span class="i-name">icon-chart-bar</span><span class="i-code">0xe801</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xe802">
|
||||
<i class="demo-icon icon-cog-alt"></i> <span class="i-name">icon-cog-alt</span><span class="i-code">0xe802</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xe803">
|
||||
<i class="demo-icon icon-cancel"></i> <span class="i-name">icon-cancel</span><span class="i-code">0xe803</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span3" title="Code: 0xe804">
|
||||
<i class="demo-icon icon-download"></i> <span class="i-name">icon-download</span><span class="i-code">0xe804</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xe805">
|
||||
<i class="demo-icon icon-th-list"></i> <span class="i-name">icon-th-list</span><span class="i-code">0xe805</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xe806">
|
||||
<i class="demo-icon icon-video"></i> <span class="i-name">icon-video</span><span class="i-code">0xe806</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xe807">
|
||||
<i class="demo-icon icon-attach"></i> <span class="i-name">icon-attach</span><span class="i-code">0xe807</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span3" title="Code: 0xe831">
|
||||
<i class="demo-icon icon-spin2 animate-spin"></i> <span class="i-name">icon-spin2</span><span class="i-code">0xe831</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xf0e6">
|
||||
<i class="demo-icon icon-chat-empty"></i> <span class="i-name">icon-chat-empty</span><span class="i-code">0xf0e6</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xf0fe">
|
||||
<i class="demo-icon icon-plus-squared"></i> <span class="i-name">icon-plus-squared</span><span class="i-code">0xf0fe</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xf130">
|
||||
<i class="demo-icon icon-mic"></i> <span class="i-name">icon-mic</span><span class="i-code">0xf130</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span3" title="Code: 0xf146">
|
||||
<i class="demo-icon icon-minus-squared"></i> <span class="i-name">icon-minus-squared</span><span class="i-code">0xf146</span>
|
||||
</div>
|
||||
<div class="span3" title="Code: 0xf50d">
|
||||
<i class="demo-icon icon-search"></i> <span class="i-name">icon-search</span><span class="i-code">0xf50d</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container footer">Generated by <a href="https://fontello.com">fontello.com</a></div>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Copyright (C) 2022 by original authors @ fontello.com</metadata>
|
||||
<defs>
|
||||
<font id="fontello" horiz-adv-x="1000" >
|
||||
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
||||
<missing-glyph horiz-adv-x="1000" />
|
||||
<glyph glyph-name="picture" unicode="" d="M357 529q0-45-31-76t-76-32-76 32-31 76 31 76 76 31 76-31 31-76z m572-215v-250h-786v107l178 179 90-89 285 285z m53 393h-893q-7 0-12-5t-6-13v-678q0-7 6-13t12-5h893q7 0 13 5t5 13v678q0 8-5 13t-13 5z m89-18v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
|
||||
|
||||
<glyph glyph-name="chart-bar" unicode="" d="M357 350v-286h-143v286h143z m214 286v-572h-142v572h142z m572-643v-72h-1143v858h71v-786h1072z m-357 500v-429h-143v429h143z m214 214v-643h-143v643h143z" horiz-adv-x="1142.9" />
|
||||
|
||||
<glyph glyph-name="cog-alt" unicode="" d="M500 350q0 59-42 101t-101 42-101-42-42-101 42-101 101-42 101 42 42 101z m429-286q0 29-22 51t-50 21-50-21-21-51q0-29 21-50t50-21 51 21 21 50z m0 572q0 29-22 50t-50 21-50-21-21-50q0-30 21-51t50-21 51 21 21 51z m-215-235v-103q0-6-4-11t-8-6l-87-14q-6-19-18-42 19-27 50-64 4-6 4-11 0-7-4-11-12-17-46-50t-43-33q-7 0-12 4l-64 50q-21-11-43-17-6-60-13-87-4-13-17-13h-104q-6 0-11 4t-5 10l-13 85q-19 6-42 18l-66-50q-4-4-11-4-6 0-12 4-80 75-80 90 0 5 4 10 5 8 23 30t26 34q-13 24-20 46l-85 13q-5 1-9 5t-4 11v104q0 5 4 10t9 6l86 14q7 19 18 42-19 27-50 64-4 6-4 11 0 7 4 12 12 16 46 49t44 33q6 0 12-4l64-50q19 10 43 18 6 60 13 86 3 13 16 13h104q6 0 11-4t6-10l13-85q19-6 42-17l65 49q5 4 12 4 6 0 11-4 81-75 81-90 0-4-4-10-7-9-24-30t-25-34q13-27 19-46l85-12q6-2 9-6t4-11z m357-298v-78q0-9-83-17-6-15-16-29 28-63 28-77 0-2-2-4-68-40-69-40-5 0-26 27t-29 37q-11-1-17-1t-17 1q-7-11-29-37t-25-27q-1 0-69 40-3 2-3 4 0 14 29 77-10 14-17 29-83 8-83 17v78q0 9 83 18 7 16 17 29-29 63-29 77 0 2 3 4 2 1 19 11t33 19 17 9q4 0 25-26t29-38q12 1 17 1t17-1q28 40 51 63l4 1q2 0 69-39 2-2 2-4 0-14-28-77 9-13 16-29 83-9 83-18z m0 572v-78q0-9-83-18-6-15-16-29 28-63 28-77 0-2-2-4-68-39-69-39-5 0-26 26t-29 38q-11-1-17-1t-17 1q-7-12-29-38t-25-26q-1 0-69 39-3 2-3 4 0 14 29 77-10 14-17 29-83 9-83 18v78q0 9 83 17 7 16 17 29-29 63-29 77 0 2 3 4 2 1 19 11t33 19 17 9q4 0 25-26t29-37q12 1 17 1t17-1q28 39 51 62l4 1q2 0 69-39 2-2 2-4 0-14-28-77 9-13 16-29 83-8 83-17z" horiz-adv-x="1071.4" />
|
||||
|
||||
<glyph glyph-name="cancel" unicode="" d="M724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164 164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164 164-164q15-15 15-38z" horiz-adv-x="785.7" />
|
||||
|
||||
<glyph glyph-name="download" unicode="" d="M714 100q0 15-10 25t-25 11-25-11-11-25 11-25 25-11 25 11 10 25z m143 0q0 15-10 25t-26 11-25-11-10-25 10-25 25-11 26 11 10 25z m72 125v-179q0-22-16-37t-38-16h-821q-23 0-38 16t-16 37v179q0 22 16 38t38 16h259l75-76q33-32 76-32t76 32l76 76h259q22 0 38-16t16-38z m-182 318q10-23-8-39l-250-250q-10-11-25-11t-25 11l-250 250q-17 16-8 39 10 21 33 21h143v250q0 15 11 25t25 11h143q14 0 25-11t10-25v-250h143q24 0 33-21z" horiz-adv-x="928.6" />
|
||||
|
||||
<glyph glyph-name="th-list" unicode="" d="M286 154v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m0 285v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m714-285v-108q0-22-16-37t-38-16h-535q-23 0-38 16t-16 37v108q0 22 16 38t38 15h535q23 0 38-15t16-38z m-714 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m714-286v-107q0-22-16-38t-38-15h-535q-23 0-38 15t-16 38v107q0 23 16 38t38 16h535q23 0 38-16t16-38z m0 286v-107q0-22-16-38t-38-16h-535q-23 0-38 16t-16 38v107q0 22 16 38t38 16h535q23 0 38-16t16-38z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="video" unicode="" d="M214-43v72q0 14-10 25t-25 10h-72q-14 0-25-10t-11-25v-72q0-14 11-25t25-11h72q14 0 25 11t10 25z m0 214v72q0 14-10 25t-25 11h-72q-14 0-25-11t-11-25v-72q0-14 11-25t25-10h72q14 0 25 10t10 25z m0 215v71q0 15-10 25t-25 11h-72q-14 0-25-11t-11-25v-71q0-15 11-25t25-11h72q14 0 25 11t10 25z m572-429v286q0 14-11 25t-25 11h-429q-14 0-25-11t-10-25v-286q0-14 10-25t25-11h429q15 0 25 11t11 25z m-572 643v71q0 15-10 26t-25 10h-72q-14 0-25-10t-11-26v-71q0-14 11-25t25-11h72q14 0 25 11t10 25z m786-643v72q0 14-11 25t-25 10h-71q-15 0-25-10t-11-25v-72q0-14 11-25t25-11h71q15 0 25 11t11 25z m-214 429v285q0 15-11 26t-25 10h-429q-14 0-25-10t-10-26v-285q0-15 10-25t25-11h429q15 0 25 11t11 25z m214-215v72q0 14-11 25t-25 11h-71q-15 0-25-11t-11-25v-72q0-14 11-25t25-10h71q15 0 25 10t11 25z m0 215v71q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-71q0-15 11-25t25-11h71q15 0 25 11t11 25z m0 214v71q0 15-11 26t-25 10h-71q-15 0-25-10t-11-26v-71q0-14 11-25t25-11h71q15 0 25 11t11 25z m71 89v-750q0-37-26-63t-63-26h-893q-36 0-63 26t-26 63v750q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
|
||||
|
||||
<glyph glyph-name="attach" unicode="" d="M784 77q0-65-45-109t-109-44q-75 0-131 55l-434 434q-63 64-63 151 0 89 62 150t150 62q88 0 152-63l338-338q5-5 5-12 0-9-17-26t-26-17q-7 0-12 5l-339 339q-44 43-101 43-59 0-100-42t-40-101q0-58 42-101l433-433q35-36 81-36 36 0 59 24t24 59q0 46-35 81l-325 324q-14 14-33 14-16 0-27-11t-11-27q0-18 14-33l229-228q6-6 6-13 0-9-18-26t-26-17q-6 0-12 5l-229 229q-35 34-35 83 0 46 32 78t77 32q49 0 84-35l324-325q56-54 56-131z" horiz-adv-x="785.7" />
|
||||
|
||||
<glyph glyph-name="spin2" unicode="" d="M46 144l0 0c0 0-1 0-1 0-8 18-15 37-21 55-6 19-11 38-15 58-19 99-8 203 35 298 3 6 10 8 15 5 1 0 2 0 2-1l0 0 80-59c5-3 6-9 4-14-5-12-9-25-12-37-4-13-7-26-9-40-11-67-3-137 23-201 2-5 0-10-4-13l0 0-80-56c-5-4-12-2-16 3-1 0-1 1-1 2l0 0z m120 574l0 0c0 1 0 1 0 1 15 13 30 25 46 37 16 11 33 22 51 31 89 50 192 72 297 60 6-1 10-6 10-13 0-1-1-1-1-2l0 0-31-94c-2-5-8-8-13-7-13 0-27 0-40 0-14-1-27-2-40-4-68-11-133-40-186-84-4-3-10-3-14 0l0 0-79 58c-5 3-6 11-2 16 0 0 1 1 2 1l0 0z m588 65l0 0c0 0 1 0 1 0 17-10 34-21 50-32 16-12 31-25 46-38 74-69 127-160 148-262 2-6-2-12-9-13-1 0-1 0-2 0l0 0-100 1c-5 0-10 4-11 9-3 13-8 26-12 38-5 12-10 25-17 36-31 61-78 113-137 150-5 3-6 8-5 13l0 0 31 92c2 6 9 9 15 7 1 0 2-1 2-1l0 0z m244-535l0 0c0 0 0 0 0 0-4-20-9-39-15-57-7-19-14-37-22-55-44-92-114-170-205-221-6-3-13-1-16 4 0 1-1 2-1 2l0 0-30 94c-2 6 1 12 6 14 11 7 22 15 32 23 11 9 21 18 30 27 49 48 84 109 101 176 2 5 6 8 11 8l0 0 98-1c6 0 11-5 11-11 0-1 0-2 0-3l0 0z m-438-395l0 0c0 0 0 0 0 0-20-2-40-3-60-3-20 0-40 1-59 4-102 12-198 54-276 125-5 4-5 11 0 16 0 0 1 1 1 1l0 0 81 58c5 3 12 2 16-2 10-8 20-16 32-23 11-7 22-14 34-20 62-31 131-45 200-41 6 0 10-3 12-8l0 0 29-92c2-6-1-12-7-14-1-1-2-1-3-1l0 0z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="chat-empty" unicode="" d="M393 636q-85 0-160-29t-118-79-44-107q0-45 30-88t83-73l54-32-19-46q19 11 34 21l25 18 30-6q43-8 85-8 85 0 160 29t118 79 43 106-43 107-118 79-160 29z m0 71q106 0 197-38t143-104 53-144-53-143-143-104-197-38q-48 0-98 9-70-49-155-72-21-5-48-9h-2q-6 0-12 5t-6 12q-1 1-1 3t1 4 1 3l1 3t2 3 2 3 3 3 2 2q3 3 13 14t15 16 12 17 14 21 11 25q-69 40-108 98t-40 125q0 78 53 144t143 104 197 38z m459-652q5-14 11-25t14-21 13-16 14-17 13-14q0 0 2-2t3-3 2-3 2-3l1-3t1-3 1-4-1-3q-2-8-7-13t-12-4q-28 4-48 9-86 23-156 72-50-9-98-9-151 0-263 74 32-3 49-3 90 0 172 25t148 72q69 52 107 119t37 141q0 43-13 85 72-39 114-99t42-128q0-67-40-126t-108-98z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="plus-squared" unicode="" d="M714 314v72q0 14-10 25t-25 10h-179v179q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-179h-178q-15 0-25-10t-11-25v-72q0-14 11-25t25-10h178v-179q0-14 11-25t25-11h71q15 0 25 11t11 25v179h179q14 0 25 10t10 25z m143 304v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="mic" unicode="" d="M643 457v-71q0-124-82-215t-204-104v-74h143q15 0 25-11t11-25-11-25-25-11h-357q-15 0-25 11t-11 25 11 25 25 11h143v74q-121 13-204 104t-82 215v71q0 15 11 25t25 11 25-11 10-25v-71q0-103 74-177t176-73 177 73 73 177v71q0 15 11 25t25 11 25-11 11-25z m-143 214v-285q0-74-52-126t-127-53-126 53-52 126v285q0 74 52 127t126 52 127-52 52-127z" horiz-adv-x="642.9" />
|
||||
|
||||
<glyph glyph-name="minus-squared" unicode="" d="M714 314v72q0 14-10 25t-25 10h-500q-15 0-25-10t-11-25v-72q0-14 11-25t25-10h500q14 0 25 10t10 25z m143 304v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="search" unicode="" d="M11 375q-23 87 0 173t87 150q48 49 110 74t128 25q65 0 127-25t110-74q52-52 77-119t21-137-36-132q28-8 49-29l174-173q35-35 35-85t-35-85q-35-35-85-35t-85 35l-173 174q-22 20-30 49-70-35-149-35-66 0-128 25t-110 73q-64 64-87 151z m101 86q0-93 65-158 66-65 159-65 92 0 157 65t66 158-66 158q-66 66-157 66-92 0-159-66-65-65-65-158z" horiz-adv-x="892.6" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 528 B |
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
@@ -0,0 +1,70 @@
|
||||
@import url('fontello/css/animation.css');
|
||||
@import url('fontello/css/fontello.css');
|
||||
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
src: url('fonts/Lato-Bold.ttf');
|
||||
src: url('fonts/Lato-Italic.ttf');
|
||||
src: url('fonts/Lato-Light.ttf');
|
||||
src: url('fonts/Lato-Regular.ttf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Monsterrat';
|
||||
src: url('fonts/Montserrat-VariableFont_wght.ttf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
src: url('fonts/Roboto-Bold.ttf');
|
||||
src: url('fonts/Roboto-Light.ttf');
|
||||
src: url('fonts/Roboto-Medium.ttf');
|
||||
src: url('fonts/Roboto-Thin.ttf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Roboto Mono';
|
||||
src: url('fonts/RobotoMono-VariableFont_wght.ttf');
|
||||
}
|
||||
|
||||
:root {
|
||||
--color-primary: #006aff;
|
||||
--color-secondary: #16bac5;
|
||||
--color-ternary: #2b2d42;
|
||||
--color-light: #efe9f4;
|
||||
--color-dark: #171d1c;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Lato';
|
||||
background-blend-mode: luminosity;
|
||||
background: url('./img/terrazzo.webp'),
|
||||
linear-gradient(45deg, #a334fa, #0695ff);
|
||||
}
|
||||
|
||||
.container {
|
||||
position: fixed;
|
||||
overflow-y: auto;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 4.2rem;
|
||||
|
||||
padding: 1em;
|
||||
margin: 0.5em;
|
||||
|
||||
border: 1px solid #06f5;
|
||||
border-radius: 0.5em;
|
||||
backdrop-filter: blur(5px);
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: Roboto;
|
||||
border-bottom: 1px solid gray;
|
||||
}
|
||||
-509
@@ -1,509 +0,0 @@
|
||||
import sqlite from 'sqlite3'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import utf8 from 'utf8'
|
||||
|
||||
// TODO: some object can have better typing
|
||||
// TODO: no modules, need to separate into files
|
||||
// TODO: there for sure is an exception without a catch statement
|
||||
// FIXME: also some rejections are purposley left uncaught
|
||||
// the intention is to exit and for a user to intervene
|
||||
// but I don't think that behaves consistently
|
||||
// TODO: add electron
|
||||
// TODO: add cra-typescript
|
||||
|
||||
import { messagesPart } from 'takeoutSchema'
|
||||
|
||||
function prepareDirs() {
|
||||
const dirs = [
|
||||
'data',
|
||||
'data/photos',
|
||||
'data/videos',
|
||||
'data/audio',
|
||||
'data/gifs',
|
||||
'data/files',
|
||||
]
|
||||
for (let dir of dirs) {
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.info(` ✕ ${dir} not found, creating`)
|
||||
fs.mkdirSync(dir)
|
||||
}
|
||||
}
|
||||
|
||||
console.info(` ✓ dirs ok`)
|
||||
|
||||
if (!fs.existsSync(master)) {
|
||||
console.info(` ✕ supplied master dir doesn't exist`)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
function prepareDb() {
|
||||
return new Promise((resolve, reject) => {
|
||||
const sqlInit = fs.readFileSync('sql/init.sql').toString()
|
||||
|
||||
db.exec(sqlInit, err => {
|
||||
if (err) throw err
|
||||
else {
|
||||
resolve(true)
|
||||
console.info(` ✓ db ok `)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async function getInboxes(master: string) {
|
||||
const scanDirs = [
|
||||
'archived_threads',
|
||||
'filtered_threads',
|
||||
'inbox',
|
||||
'message_requests',
|
||||
],
|
||||
availableDirs = fs.readdirSync(master).filter(d => scanDirs.includes(d)),
|
||||
inboxes: [string, string][] = []
|
||||
|
||||
for (let dir of availableDirs) {
|
||||
let subs = fs.readdirSync(path.join(master, dir))
|
||||
for (let inbox of subs) {
|
||||
inboxes.push([path.join(dir, inbox), dir])
|
||||
}
|
||||
}
|
||||
|
||||
console.info(` ⇒ found ${inboxes.length} inboxes`)
|
||||
|
||||
return inboxes
|
||||
}
|
||||
|
||||
function parseInbox(
|
||||
dir: string,
|
||||
cat: string
|
||||
): Promise<{
|
||||
[inboxId: string]: { parts: string[]; dir: string; knownSenders: string[] }
|
||||
}> {
|
||||
// FIXME: inconsistent string escaping
|
||||
// didn't check if all variables/inserts have escaped string
|
||||
return new Promise((resolve, reject) => {
|
||||
const inboxIdPattern = /_[^\/]*?$/,
|
||||
groupPhotoPattern = /messages\/.+\/(\S+\..+)$/,
|
||||
messagePartRegex = /message_\d+\.json/
|
||||
|
||||
let inboxId = inboxIdPattern.exec(dir)![0].slice(-10)
|
||||
|
||||
console.info(` ⇒ parsing inbox '${inboxId}'`)
|
||||
|
||||
const messageParts = fs
|
||||
.readdirSync(path.join(master, dir))
|
||||
.filter(f => f.match(messagePartRegex))
|
||||
|
||||
fs.readFile(path.join(master, dir, messageParts[0]), (err, buffer) => {
|
||||
let { title, thread_type, participants, image }: messagesPart =
|
||||
JSON.parse(buffer.toString())
|
||||
|
||||
title = utf8.decode(title)
|
||||
|
||||
let knownSenders = participants.map((p: { name: string }) => p.name)
|
||||
|
||||
var inbox = {
|
||||
[inboxId]: { parts: messageParts, dir, knownSenders },
|
||||
}
|
||||
|
||||
// console.info(
|
||||
// ` ⇒ '${inboxId}' (${partData.title}) is a '${partData.thread_type}' `
|
||||
// )
|
||||
|
||||
// // update inbox metadata
|
||||
// db.run(
|
||||
// `UPDATE inboxes SET title="${partData.title}", thread="${partData.thread_type}" WHERE id="${inboxId}"`
|
||||
// )
|
||||
|
||||
db.run(
|
||||
`INSERT or FAIL INTO inboxes VALUES ($inbox, $cat, $title, $thread)`,
|
||||
{
|
||||
$inbox: inboxId,
|
||||
$cat: cat,
|
||||
$title: title,
|
||||
$thread: thread_type,
|
||||
},
|
||||
(err: ErrorQuery) => {
|
||||
if (!err || err?.errno == 19) {
|
||||
console.info(
|
||||
` ✓ inbox '${inboxId}' ${
|
||||
err?.errno == 19 ? 'exists' : 'added'
|
||||
} "${title}" (${thread_type}) with ${
|
||||
knownSenders.length
|
||||
} participants`
|
||||
)
|
||||
|
||||
if (image) {
|
||||
db.run(
|
||||
`INSERT or FAIL INTO group_photos VALUES ($uri, $creation, $inbox)`,
|
||||
{
|
||||
$uri:
|
||||
groupPhotoPattern.exec(image.uri)?.[1] ??
|
||||
image.uri,
|
||||
$creation: image.creation_timestamp,
|
||||
$inbox: inboxId,
|
||||
},
|
||||
(err: ErrorQuery) => {
|
||||
if (!err || err?.errno == 19) {
|
||||
console.info(` ✓ saved '${inboxId}' group photo `)
|
||||
resolve(inbox)
|
||||
} else reject(err)
|
||||
}
|
||||
)
|
||||
} else resolve(inbox)
|
||||
} else reject(err)
|
||||
}
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function parsePart(
|
||||
inboxId: string,
|
||||
knownSenders: string[],
|
||||
dir: string,
|
||||
partName: string
|
||||
): [
|
||||
number,
|
||||
Promise<{ [type: string]: { ok: number; dup: number; fail?: number } }>
|
||||
] {
|
||||
var results = {
|
||||
messages: { ok: 0, dup: 0 },
|
||||
reactions: { ok: 0, dup: 0 },
|
||||
shares: { ok: 0, dup: 0 },
|
||||
media: { ok: 0, dup: 0, fail: 0 },
|
||||
},
|
||||
pending: Promise<{}>[] = []
|
||||
|
||||
// new Promise((resolveFile) => {
|
||||
let buffer = fs.readFileSync(path.join(master, dir, partName))
|
||||
|
||||
let partData: messagesPart = JSON.parse(buffer.toString())
|
||||
|
||||
// console.info(` ✓ loaded ${inboxId}/${partName} `)
|
||||
|
||||
const scanMedia = ['photos', 'audio_files', 'files', 'gifs', 'videos'],
|
||||
mediaLables: { [key: string]: [string, string] } = {
|
||||
// key: [dir, table]
|
||||
photos: ['photos', 'photos'],
|
||||
videos: ['videos', 'videos'],
|
||||
audio_files: ['audio', 'audios'],
|
||||
files: ['files', 'files'],
|
||||
gifs: ['gifs', 'gifs'],
|
||||
}
|
||||
|
||||
let seenSenders: string[] = []
|
||||
|
||||
for (let message of partData.messages) {
|
||||
// fix encoding
|
||||
message.sender_name = utf8.decode(message.sender_name)
|
||||
message.content = message.content ? utf8.decode(message.content) : ''
|
||||
|
||||
// keep track of seen senders
|
||||
if (!seenSenders.includes(message.sender_name)) {
|
||||
seenSenders.push(message.sender_name)
|
||||
|
||||
parseParticipant(
|
||||
message.sender_name,
|
||||
inboxId,
|
||||
knownSenders.includes(message.sender_name)
|
||||
)
|
||||
}
|
||||
|
||||
// get media present in current message
|
||||
const availableMediaTypes = Object.keys(message).filter(k =>
|
||||
scanMedia.includes(k)
|
||||
)
|
||||
|
||||
// FIXME: wrong type label
|
||||
// labels, dirs, and tables need to be organised better
|
||||
|
||||
// override message category, based on included media
|
||||
message.type =
|
||||
availableMediaTypes.length > 0
|
||||
? availableMediaTypes.join('+')
|
||||
: message.type
|
||||
|
||||
// insert message to db
|
||||
pending.push(
|
||||
new Promise((resolveMessage, rejectMessage) => {
|
||||
db.run(
|
||||
`INSERT INTO messages VALUES ($sender, $timestamp, $inbox, $content, $type, $unsent)`,
|
||||
{
|
||||
$unsent: message.is_unsent,
|
||||
$type: message.type,
|
||||
$timestamp: message.timestamp_ms,
|
||||
$inbox: inboxId,
|
||||
$sender: message.sender_name,
|
||||
$content: message.content,
|
||||
},
|
||||
(err: ErrorQuery) => {
|
||||
if (!err || err?.errno == 19) {
|
||||
err?.errno == 19
|
||||
? results.messages.dup++
|
||||
: results.messages.ok++
|
||||
resolveMessage(results)
|
||||
} else rejectMessage(err)
|
||||
}
|
||||
)
|
||||
})
|
||||
)
|
||||
|
||||
// parse detected media
|
||||
for (let mediaType of availableMediaTypes)
|
||||
for (let { uri, creation_timestamp } of message[mediaType]!)
|
||||
pending.push(
|
||||
new Promise((resolveMedia, rejectMedia) => {
|
||||
const mediaFilenamePattern = /messages\/.+\/.+\/(\S+\..+)$/
|
||||
|
||||
// get filename only
|
||||
uri = mediaFilenamePattern.exec(uri)![1]
|
||||
|
||||
db.run(
|
||||
`INSERT INTO ${mediaLables[mediaType][1]} VALUES ($uri, $created, $inbox, $message_sender, $message_created)`,
|
||||
{
|
||||
$uri: uri,
|
||||
$created: creation_timestamp,
|
||||
$inbox: inboxId,
|
||||
$message_sender: message.sender_name,
|
||||
$message_created: message.timestamp_ms,
|
||||
},
|
||||
(dberr: ErrorQuery) => {
|
||||
if (!dberr || dberr?.errno == 19) {
|
||||
if (dberr?.errno == 19) {
|
||||
results.media.dup++
|
||||
logErrors(dberr, uri)
|
||||
resolveMedia(results)
|
||||
} else
|
||||
fs.rename(
|
||||
path.join(
|
||||
master,
|
||||
dir,
|
||||
mediaLables[mediaType][0],
|
||||
uri
|
||||
),
|
||||
path.join(
|
||||
'data',
|
||||
mediaLables[mediaType][0],
|
||||
uri
|
||||
),
|
||||
fserr => {
|
||||
if (fserr) {
|
||||
logErrors(fserr, uri)
|
||||
results.media.fail++
|
||||
} else {
|
||||
results.media.ok++
|
||||
}
|
||||
|
||||
resolveMedia(results)
|
||||
}
|
||||
)
|
||||
} else rejectMedia(dberr)
|
||||
}
|
||||
)
|
||||
})
|
||||
)
|
||||
|
||||
// parse reactions
|
||||
if ('reactions' in message)
|
||||
pending.push(
|
||||
new Promise((resolveReaction, rejectReaction) => {
|
||||
for (let { reaction, actor } of message.reactions!) {
|
||||
db.run(
|
||||
`INSERT INTO reactions VALUES ($sender, $timestamp, $inbox, $reaction, $actor)`,
|
||||
{
|
||||
$sender: message.sender_name,
|
||||
$timestamp: message.timestamp_ms,
|
||||
$inbox: inboxId,
|
||||
$reaction: reaction,
|
||||
$actor: actor,
|
||||
},
|
||||
(err: ErrorQuery) => {
|
||||
if (!err || err?.errno == 19) {
|
||||
err?.errno == 19
|
||||
? results.reactions.dup++
|
||||
: results.reactions.ok++
|
||||
resolveReaction(results)
|
||||
} else rejectReaction(err)
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
if ('share' in message)
|
||||
pending.push(
|
||||
new Promise((resolveShare, rejectShare) => {
|
||||
db.run(
|
||||
`INSERT INTO shares VALUES ($sender, $timestamp, $inbox, $link)`,
|
||||
{
|
||||
$sender: message.sender_name,
|
||||
$timestamp: message.timestamp_ms,
|
||||
$inbox: inboxId,
|
||||
$link: message.share?.link,
|
||||
},
|
||||
(err: ErrorQuery) => {
|
||||
if (!err || err?.errno == 19) {
|
||||
err?.errno == 19
|
||||
? results.shares.dup++
|
||||
: results.shares.ok++
|
||||
resolveShare(results)
|
||||
} else rejectShare(err)
|
||||
}
|
||||
)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
// console.log(pending)
|
||||
|
||||
// setTimeout(() => {
|
||||
// console.log(pending.map(p => p))
|
||||
// }, 5e3)
|
||||
|
||||
// Promise.all(pending).then(() => console.log('lmao'))
|
||||
|
||||
return [pending.length, Promise.all(pending).then(() => results)]
|
||||
}
|
||||
|
||||
function parseParticipant(
|
||||
name: string,
|
||||
inboxId: string,
|
||||
participates: boolean
|
||||
) {
|
||||
return new Promise((resolve, reject) => {
|
||||
db.run(
|
||||
`INSERT INTO participants VALUES ($inbox, $uname, $participates) ON CONFLICT(inbox, uname) DO UPDATE SET participates=$participates`,
|
||||
{
|
||||
$inbox: inboxId,
|
||||
$uname: name,
|
||||
$participates: participates,
|
||||
},
|
||||
err => {
|
||||
if (err) reject(err)
|
||||
else resolve(true)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
// db.all(
|
||||
// `SELECT uname FROM participants WHERE uname="${name}" and inbox="${inboxId}"`,
|
||||
// (err, names) => {
|
||||
// if (names.length < 1)
|
||||
// db.run(
|
||||
// `INSERT INTO participants VALUES ("${inboxId}", "${name}", ${participates})`
|
||||
// )
|
||||
// else
|
||||
// db.run(
|
||||
// `UPDATE participants SET participates=${participates} WHERE uname="${name}" AND inbox="${inboxId}"`
|
||||
// )
|
||||
// }
|
||||
// )
|
||||
}
|
||||
|
||||
function logErrors({ errno, code }: any, subject: string) {
|
||||
errors.write(`${errno} ${code} ${subject} \n`)
|
||||
}
|
||||
|
||||
// TODO: initialization is a mess, all vars are in a random order
|
||||
// works but ugly
|
||||
|
||||
const db = new sqlite.Database('data.db')
|
||||
|
||||
const master = './messages'
|
||||
|
||||
type ErrorQuery = (Error & { errno: number }) | null // TODO: tf is this doing here
|
||||
|
||||
const start = process.hrtime.bigint(),
|
||||
errors = fs.createWriteStream('errors.log', { flags: 'w' })
|
||||
|
||||
prepareDirs()
|
||||
|
||||
await prepareDb()
|
||||
|
||||
getInboxes(master)
|
||||
.then(inboxes =>
|
||||
Promise.all(inboxes.map(([dir, cat]) => parseInbox(dir, cat)))
|
||||
)
|
||||
.then(inboxParts =>
|
||||
inboxParts.reduce((namedParts, part) => {
|
||||
return { ...namedParts, ...part }
|
||||
}, {})
|
||||
)
|
||||
.then(inboxParts => {
|
||||
// FIXME: those types are a total mess
|
||||
var totalResults: { [key: string]: { [key: string]: {} } } = {
|
||||
messages: { ok: 0, dup: 0 },
|
||||
reactions: { ok: 0, dup: 0 },
|
||||
shares: { ok: 0, dup: 0 },
|
||||
media: { ok: 0, dup: 0, fail: 0 },
|
||||
},
|
||||
totalPending: Promise<any>[] = []
|
||||
|
||||
for (let inboxId in inboxParts) {
|
||||
const { dir, parts, knownSenders } = inboxParts[inboxId]
|
||||
parts
|
||||
.map(part => parsePart(inboxId, knownSenders, dir, part))
|
||||
.map(([nPending, pending], i) => {
|
||||
console.info(
|
||||
` ⇒ in '${inboxId}'/${i + 1} ${nPending} pending actions`
|
||||
)
|
||||
totalPending.push(pending)
|
||||
return pending
|
||||
})
|
||||
.map((pending, i) =>
|
||||
pending.then(() => {
|
||||
console.info(` ✓ resolved '${inboxId}'/${i + 1}`)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
Promise.all(totalPending).then(allResults => {
|
||||
allResults.forEach(results => {
|
||||
for (let type in results) {
|
||||
for (let status in results[type])
|
||||
totalResults[type][status] += results[type][status]
|
||||
}
|
||||
})
|
||||
// TODO: this can be done in a prettier way, right...?
|
||||
console.info(` ⇒ all parts resolved`)
|
||||
console.info(` ✓ ok ⇊ dup ✕ fail `)
|
||||
console.info(
|
||||
` media ${totalResults.media.ok
|
||||
.toString()
|
||||
.padEnd(6, ' ')} ${totalResults.media.dup
|
||||
.toString()
|
||||
.padEnd(6, ' ')} ${totalResults.media
|
||||
.fail!.toString()
|
||||
.padEnd(6, ' ')}`
|
||||
)
|
||||
console.info(
|
||||
` messages ${totalResults.messages.ok
|
||||
.toString()
|
||||
.padEnd(6, ' ')} ${totalResults.messages.dup
|
||||
.toString()
|
||||
.padEnd(6, ' ')}`
|
||||
)
|
||||
console.info(
|
||||
` shares ${totalResults.shares.ok
|
||||
.toString()
|
||||
.padEnd(6, ' ')} ${totalResults.shares.dup
|
||||
.toString()
|
||||
.padEnd(6, ' ')}`
|
||||
)
|
||||
console.info(
|
||||
` reactions ${totalResults.reactions.ok
|
||||
.toString()
|
||||
.padEnd(6, ' ')} ${totalResults.reactions.dup
|
||||
.toString()
|
||||
.padEnd(6, ' ')}`
|
||||
)
|
||||
|
||||
console.info(
|
||||
`\n ⏲ Total time: ${(
|
||||
Number(process.hrtime.bigint() - start) / 1e9
|
||||
).toFixed(2)} seconds`
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,21 @@
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import lorem from '../ts/lorem'
|
||||
import Main from './Main'
|
||||
|
||||
if (!window.events)
|
||||
window.events = {
|
||||
send: () => {},
|
||||
on: () => {},
|
||||
// @ts-ignore
|
||||
off: () => {},
|
||||
}
|
||||
|
||||
if (!window.invoke) {
|
||||
window.invoke = async (chanel, data) => {
|
||||
if (chanel == 'get-convo') return JSON.stringify(lorem?.[data]) ?? null
|
||||
if (chanel == 'scan')
|
||||
return Object.keys(lorem).map(id => ({ id, title: lorem[id].title }))
|
||||
}
|
||||
}
|
||||
|
||||
createRoot(document.getElementById('root')!).render(<Main />)
|
||||
@@ -1,129 +0,0 @@
|
||||
export type timestampSeconds = number;
|
||||
export type timestampMs = number;
|
||||
|
||||
export type unescapedString = string;
|
||||
|
||||
export type messagesPart = {
|
||||
title: unescapedString;
|
||||
thread_path: string;
|
||||
thread_type: string;
|
||||
participants: { name: unescapedString }[];
|
||||
magic_words: [];
|
||||
messages: (message & messageWithMedia)[];
|
||||
image?: {
|
||||
uri: string;
|
||||
creation_timestamp: timestampSeconds;
|
||||
};
|
||||
is_still_participant: boolean;
|
||||
joinable_mode: {
|
||||
mode: number;
|
||||
link: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type message = {
|
||||
sender_name: unescapedString;
|
||||
timestamp_ms: timestampMs;
|
||||
content: unescapedString;
|
||||
type: string; // 'Generic' | 'Call' | 'Share' | 'Subscribe' | 'Unsubscribe'
|
||||
is_unsent: boolean;
|
||||
is_taken_down: boolean;
|
||||
bumped_message_metadata: {
|
||||
bumped_message: unescapedString;
|
||||
is_bumped: boolean;
|
||||
};
|
||||
|
||||
call_duration?: number;
|
||||
missed?: boolean;
|
||||
|
||||
ip?: string;
|
||||
|
||||
reactions?: messageReaction[];
|
||||
|
||||
users?: { name: unescapedString }[];
|
||||
|
||||
share?: {
|
||||
link?: string;
|
||||
share_text?: unescapedString;
|
||||
};
|
||||
|
||||
sticker?: {
|
||||
uri: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type messageWithMedia = {
|
||||
photos?: messageMedia[];
|
||||
audio_files?: messageMedia[];
|
||||
files?: messageMedia[];
|
||||
gifs?: (messageMedia & { creation_timestamp: never })[];
|
||||
videos?: (messageMedia & { thumbnail: { uri: string } })[];
|
||||
[mediaType: string]: messageMedia[] | undefined;
|
||||
};
|
||||
|
||||
export type messageMedia = {
|
||||
uri: string;
|
||||
creation_timestamp: number;
|
||||
};
|
||||
|
||||
export type messageReaction = {
|
||||
reaction: unescapedString;
|
||||
actor: unescapedString;
|
||||
};
|
||||
|
||||
// all keys present in facebook takeouts
|
||||
|
||||
// "title":
|
||||
// "thread_path":
|
||||
// "thread_type":
|
||||
// "participants":
|
||||
// "name":
|
||||
// "magic_words":
|
||||
// "messages":
|
||||
// "image":
|
||||
// "is_still_participant":
|
||||
// "joinable_mode":
|
||||
|
||||
// "link":
|
||||
// "mode":
|
||||
// "uri":
|
||||
// "creation_timestamp":
|
||||
|
||||
// "sender_name":
|
||||
// "timestamp_ms":
|
||||
// "content":
|
||||
// "type":
|
||||
// "is_unsent":
|
||||
// "is_taken_down":
|
||||
// "bumped_message_metadata":
|
||||
// "bumped_message":
|
||||
// "is_bumped":
|
||||
|
||||
// "photos":
|
||||
// "videos":
|
||||
// "audio_files":
|
||||
// "gifs":
|
||||
// "files":
|
||||
// "uri":
|
||||
// "creation_timestamp":
|
||||
// "thumbnail":
|
||||
// "uri":
|
||||
|
||||
// "call_duration":
|
||||
// "missed":
|
||||
|
||||
// "ip":
|
||||
|
||||
// "reactions":
|
||||
// "reaction":
|
||||
// "actor":
|
||||
|
||||
// "users":
|
||||
// "name":
|
||||
|
||||
// "share":
|
||||
// "link":
|
||||
// "share_text":
|
||||
|
||||
// "sticker":
|
||||
// "uri":
|
||||
+189
@@ -0,0 +1,189 @@
|
||||
import utf8 from 'utf8'
|
||||
import { join, normalize } from 'path'
|
||||
|
||||
import Inbox from './Inbox'
|
||||
import Member from './Member'
|
||||
import Message from './Message'
|
||||
|
||||
import messagesPerMember from './stats/messagesPerMember'
|
||||
import wordsPerMember from './stats/wordsPerMember'
|
||||
import messagesPerDay from './stats/messagesPerDay'
|
||||
import messagesPerWeekday from './stats/messagesPerWeekday'
|
||||
import mediaPerMember from './stats/mediaPerMember'
|
||||
import messagesPerHour from './stats/messagesPerHour'
|
||||
import mostUsedEmoji from './stats/mostUsedEmoji'
|
||||
import mostUsedReactions from './stats/mostUsedReactions'
|
||||
import mostUsedWords from './stats/mostUsedWords'
|
||||
|
||||
const statParsers = [
|
||||
mediaPerMember,
|
||||
messagesPerDay,
|
||||
messagesPerHour,
|
||||
messagesPerMember,
|
||||
messagesPerWeekday,
|
||||
mostUsedEmoji,
|
||||
// FIXME: some inbox throws an error at ".used"
|
||||
// mostUsedReactions,
|
||||
mostUsedWords,
|
||||
wordsPerMember,
|
||||
]
|
||||
|
||||
export default class Convo {
|
||||
id: string
|
||||
owner: string
|
||||
type: string
|
||||
members: Member[]
|
||||
|
||||
firstMessage: number
|
||||
lastMessage: number
|
||||
|
||||
getMember: (string) => Member | undefined
|
||||
getOwner: () => Member | undefined
|
||||
|
||||
title: string
|
||||
image?: string
|
||||
|
||||
left?: boolean
|
||||
|
||||
messages: {
|
||||
[sender: string]: {
|
||||
[timestamp: number]: Message
|
||||
}
|
||||
}
|
||||
|
||||
stats: {
|
||||
[stat: string]: any
|
||||
}
|
||||
|
||||
constructor(inboxes: Inbox[], owner: string) {
|
||||
let prim = inboxes[0]
|
||||
|
||||
this.id = prim.id
|
||||
this.owner = owner
|
||||
this.type = prim.meta?.type!
|
||||
|
||||
this.getMember = (name: string) => this.members.find(m => m.name == name)
|
||||
this.getOwner = () => this.getMember(owner)
|
||||
|
||||
!prim.meta!.participates && (this.left = true)
|
||||
this.title = utf8.decode(prim.meta!.title)
|
||||
|
||||
prim.meta!.image &&
|
||||
// make the path absolute
|
||||
(this.image = normalize(
|
||||
join(
|
||||
prim.path,
|
||||
'../../',
|
||||
prim.meta!.image.uri.split('/').slice(1).join('/')
|
||||
)
|
||||
))
|
||||
|
||||
this.members = []
|
||||
this.messages = {}
|
||||
this.stats = {}
|
||||
|
||||
let seenMembers: string[] = [],
|
||||
members: Member[] = [],
|
||||
messages: typeof this.messages = {},
|
||||
firstLastMessage: [number, number] = [Infinity, 0]
|
||||
|
||||
for (const inbox of inboxes) {
|
||||
for (const message of inbox.messages) {
|
||||
let m = new Message(message, inbox.path)
|
||||
|
||||
// find begining and end of messages
|
||||
// FIXME: this could possibly have less impact on execution time,
|
||||
// if its done after sorting the keys
|
||||
if (m.time < firstLastMessage[0]) firstLastMessage[0] = m.time
|
||||
if (m.time > firstLastMessage[1]) firstLastMessage[1] = m.time
|
||||
|
||||
// add new member
|
||||
if (!seenMembers.includes(m.sender)) {
|
||||
seenMembers.push(m.sender)
|
||||
messages[m.sender] = {}
|
||||
members.push(new Member(m.sender, true, m.time))
|
||||
}
|
||||
|
||||
if (m.type?.endsWith('ubscribe'))
|
||||
for (let { name: rawName } of message.users!) {
|
||||
let participates = m.type == 'Subscribe',
|
||||
name = utf8.decode(rawName)
|
||||
|
||||
if (!seenMembers.includes(name)) {
|
||||
seenMembers.push(name)
|
||||
messages[name] = {}
|
||||
members.push(new Member(name, participates, m.time))
|
||||
} else {
|
||||
members
|
||||
.find(member => member.name == name)
|
||||
?.seen(participates, m.time)
|
||||
}
|
||||
}
|
||||
|
||||
messages[m.sender][m.time] = m
|
||||
}
|
||||
}
|
||||
|
||||
// sort keys in messages
|
||||
for (let sender in messages) {
|
||||
this.messages[sender] = Object.fromEntries(
|
||||
Object.entries(messages[sender]).sort(
|
||||
([a], [b]) => parseInt(a) - parseInt(b)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
for (let member of members) {
|
||||
// update the owner
|
||||
if (member.name == owner) member.self = true
|
||||
|
||||
// update participation, based on the last (oldest) inbox.participates
|
||||
// participates = false, points out that the member has sent a message before,
|
||||
// but is no longer added to the conversation
|
||||
if (!prim.meta?.participants.find(p => utf8.decode(p) == member.name))
|
||||
member.participates = false
|
||||
}
|
||||
|
||||
this.members = members
|
||||
|
||||
this.firstMessage = firstLastMessage[0]
|
||||
this.lastMessage = firstLastMessage[1]
|
||||
}
|
||||
|
||||
async runStats() {
|
||||
let prev: { [id: string]: {} } = {}
|
||||
|
||||
// prepare results
|
||||
statParsers.forEach(({ id, begin }) => (prev[id] = begin(this)))
|
||||
|
||||
// for every message run every stat
|
||||
for (const sender in this.messages) {
|
||||
for (const timestamp in this.messages[sender]) {
|
||||
const message = this.messages[sender][timestamp]
|
||||
|
||||
for (let { id, every } of statParsers) {
|
||||
prev[id] = await every(
|
||||
message,
|
||||
this.getMember(sender)!,
|
||||
this,
|
||||
prev[id],
|
||||
prev
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// cleanup the results
|
||||
statParsers.forEach(
|
||||
({ id, end }) => (prev[id] = end(this, prev[id], prev))
|
||||
)
|
||||
|
||||
for (let id in prev) this.addStat(id, prev[id])
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
private addStat(id, data) {
|
||||
this.stats[id] = data
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
import fs from 'fs'
|
||||
import { join } from 'path'
|
||||
|
||||
import { message, messagesPart, messageWithMedia } from './types/takeout'
|
||||
|
||||
const inboxIdRegex = /_[^\/]*?$/,
|
||||
inboxCatRegex = /\/([^\/])+\/[^\/]+$/,
|
||||
messagePartRegex = /message_\d+\.json/
|
||||
|
||||
const scanDirs = [
|
||||
'archived_threads',
|
||||
'filtered_threads',
|
||||
'inbox',
|
||||
'message_requests',
|
||||
]
|
||||
|
||||
export var findInboxes = (path: string): Promise<Inbox[]> =>
|
||||
new Promise((resolve, reject) => {
|
||||
if (!fs.existsSync(path)) return reject("Directory doesn't exist")
|
||||
|
||||
const availableDirs = fs
|
||||
.readdirSync(path)
|
||||
.filter(d => scanDirs.includes(d))
|
||||
|
||||
const inboxes: Inbox[] = []
|
||||
|
||||
for (let dir of availableDirs) {
|
||||
for (let inbox of fs.readdirSync(join(path, dir))) {
|
||||
inboxes.push(new Inbox(join(path, dir, inbox)))
|
||||
}
|
||||
}
|
||||
|
||||
resolve(inboxes)
|
||||
})
|
||||
|
||||
export default class Inbox {
|
||||
path: string
|
||||
id: string
|
||||
category: string
|
||||
parts: string[]
|
||||
|
||||
messages: (message & messageWithMedia)[]
|
||||
meta!: {
|
||||
title: string
|
||||
type: string
|
||||
participants: string[]
|
||||
participates: boolean
|
||||
image?: { uri: string; created: number }
|
||||
date: number
|
||||
}
|
||||
|
||||
constructor(path: string) {
|
||||
this.path = path
|
||||
this.id = inboxIdRegex.exec(path)![0].slice(-10)
|
||||
this.category = inboxCatRegex.exec(path)![0]
|
||||
this.parts = []
|
||||
this.messages = []
|
||||
|
||||
this.findParts()
|
||||
}
|
||||
|
||||
private async findParts() {
|
||||
if (this.parts.length != 0) return this.parts
|
||||
|
||||
const availableParts = fs
|
||||
.readdirSync(this.path)
|
||||
.filter(f => f.match(messagePartRegex))
|
||||
|
||||
this.parts.push(
|
||||
...availableParts
|
||||
.filter(p => !this.parts.includes(p))
|
||||
.map(p => join(this.path, p))
|
||||
)
|
||||
return this.parts
|
||||
}
|
||||
|
||||
async loadParts() {
|
||||
if (this.messages.length != 0) return this.messages
|
||||
|
||||
let metas: typeof this.meta[] = []
|
||||
|
||||
for (let partPath of this.parts) {
|
||||
let part: messagesPart = JSON.parse(
|
||||
fs.readFileSync(partPath).toString()
|
||||
)
|
||||
|
||||
metas.push({
|
||||
title: part.title,
|
||||
type: part.thread_type,
|
||||
participants: part.participants.map(p => p.name),
|
||||
participates: part.is_still_participant,
|
||||
date: part.messages.at(-1)?.timestamp_ms ?? 0,
|
||||
image: part.image && {
|
||||
uri: part.image.uri,
|
||||
created: part.image.creation_timestamp,
|
||||
},
|
||||
})
|
||||
|
||||
this.messages.push(...part.messages)
|
||||
}
|
||||
|
||||
this.meta = metas.sort(({ date: a }, { date: b }) => a - b)[0]
|
||||
|
||||
return this.messages
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
export default class Member {
|
||||
name: string
|
||||
participates: boolean
|
||||
lastSeen: number
|
||||
self: boolean
|
||||
|
||||
constructor(name: string, participates = false, seen = 0) {
|
||||
this.name = name
|
||||
this.participates = participates
|
||||
this.lastSeen = seen
|
||||
this.self = false
|
||||
}
|
||||
|
||||
seen(participates: boolean, time: number) {
|
||||
if (time >= this.lastSeen) {
|
||||
this.participates = participates
|
||||
}
|
||||
}
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
import utf8 from 'utf8'
|
||||
import { join } from 'path'
|
||||
import { message, messageMedia, messageWithMedia } from './types/takeout'
|
||||
|
||||
export default class Message {
|
||||
sender: string
|
||||
time: number
|
||||
content: string
|
||||
|
||||
type?: string
|
||||
unsent?: boolean
|
||||
|
||||
reactions?: {
|
||||
reaction: string
|
||||
actor: string
|
||||
}[]
|
||||
|
||||
media?: {
|
||||
[type: string]: messageMedia[]
|
||||
}
|
||||
|
||||
share?: {
|
||||
link?: string
|
||||
share_text?: string
|
||||
}
|
||||
|
||||
sticker?: string
|
||||
|
||||
call?: {
|
||||
duration?: number
|
||||
missed?: boolean
|
||||
}
|
||||
|
||||
takenDown?: boolean
|
||||
|
||||
constructor(raw: message & messageWithMedia, sourceInboxPath: string) {
|
||||
let rootInboxesPath =
|
||||
'/' + sourceInboxPath.split('/').slice(0, -2).join('/')
|
||||
|
||||
this.sender = utf8.decode(raw.sender_name)
|
||||
this.time = raw.timestamp_ms
|
||||
this.content = utf8.decode(raw.content ?? '')
|
||||
|
||||
raw.is_unsent && (this.unsent = raw.is_unsent)
|
||||
raw.type != 'Generic' && (this.type = raw.type)
|
||||
raw.share && (this.share = raw.share)
|
||||
raw.sticker &&
|
||||
(this.sticker = join(
|
||||
rootInboxesPath,
|
||||
raw.sticker.uri.split('/').slice(1).join('/')
|
||||
))
|
||||
|
||||
raw.is_taken_down && (this.takenDown = raw.is_taken_down)
|
||||
|
||||
raw.reactions &&
|
||||
(this.reactions = raw.reactions.map(r => ({
|
||||
actor: utf8.decode(r.actor),
|
||||
reaction: utf8.decode(r.reaction),
|
||||
})))
|
||||
|
||||
// NOTICE: ignoring raw.ip
|
||||
|
||||
var parseMediaPath = ({ uri, creation_timestamp }) => ({
|
||||
uri: join(sourceInboxPath, uri.split('/').slice(3).join('/')),
|
||||
creation_timestamp,
|
||||
})
|
||||
|
||||
// media
|
||||
if (
|
||||
raw.photos ||
|
||||
raw.audio_files ||
|
||||
raw.files ||
|
||||
raw.gifs ||
|
||||
raw.videos
|
||||
) {
|
||||
this.media = {}
|
||||
|
||||
raw.photos && (this.media.photos = raw.photos.map(parseMediaPath))
|
||||
raw.audio_files &&
|
||||
(this.media.audios = raw.audio_files.map(parseMediaPath))
|
||||
raw.files && (this.media.files = raw.files.map(parseMediaPath))
|
||||
raw.gifs && (this.media.gifs = raw.gifs.map(parseMediaPath))
|
||||
raw.videos && (this.media.videos = raw.videos.map(parseMediaPath))
|
||||
}
|
||||
|
||||
if (raw.call_duration || raw.missed || raw.type == 'Call') {
|
||||
this.call = {
|
||||
duration: raw.call_duration,
|
||||
missed: raw.missed,
|
||||
}
|
||||
}
|
||||
|
||||
this.extendTime()
|
||||
}
|
||||
|
||||
extendTime() {
|
||||
let stringTime = this.time.toString()
|
||||
|
||||
if (stringTime.length != 13) return
|
||||
|
||||
let total = 0
|
||||
|
||||
// sum all character codes
|
||||
for (let c = 0; c < this.content.length; c++)
|
||||
total += this.content.charCodeAt(c)
|
||||
|
||||
// limit to 3 digits
|
||||
total %= 1000
|
||||
|
||||
// append to end of current timestamp
|
||||
stringTime += total.toString().padStart(3, '0')
|
||||
|
||||
this.time = parseInt(stringTime)
|
||||
}
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
import utf8 from 'utf8'
|
||||
import Convo from './Convo'
|
||||
import Inbox, { findInboxes } from './Inbox'
|
||||
|
||||
function counter(n: number) {
|
||||
return [n, 1]
|
||||
}
|
||||
|
||||
function nextCounter(n: number, c: number) {
|
||||
return Math.floor((c / n) * 100)
|
||||
}
|
||||
|
||||
export const Convos = {}
|
||||
|
||||
export async function scan(
|
||||
paths: string[],
|
||||
options: any, // TODO: pass options from settings
|
||||
contact: updateProgress
|
||||
) {
|
||||
contact('main', 'Getting files', 1)
|
||||
contact('sub', 'Searching for inboxes', 0)
|
||||
|
||||
// give some time for the progress bar to render
|
||||
await new Promise(r => setTimeout(r, 500))
|
||||
|
||||
// get all person_1234567890/ directories from selected paths,
|
||||
// and initialize an Inbox for each
|
||||
const inboxes = (
|
||||
await Promise.all(paths.map(path => findInboxes(path)))
|
||||
).flat()
|
||||
|
||||
let [partsN, partsC] = counter(inboxes.length)
|
||||
|
||||
for (let inbox of inboxes)
|
||||
await inbox
|
||||
.loadParts() // load all message_*.json files per Inbox
|
||||
.then(() =>
|
||||
contact('sub', 'Loading inboxes', nextCounter(partsN, partsC++))
|
||||
)
|
||||
|
||||
// estimate the owner between all inboxes,
|
||||
// by getting the most common participant
|
||||
let owner = utf8.decode(
|
||||
Object.entries(
|
||||
inboxes
|
||||
.filter(i => i.meta?.type == 'Regular') // ignore groups
|
||||
.reduce((sum, { meta }) => {
|
||||
// count participant occurrences
|
||||
meta!.participants.forEach(p =>
|
||||
sum[p] ? sum[p]++ : (sum[p] = 1)
|
||||
)
|
||||
return sum
|
||||
}, {} as { [name: string]: number })
|
||||
).reduce(
|
||||
// reduce to the most common participant
|
||||
([name, count], next) => (next[1] > count ? next : [name, count]),
|
||||
['', 0]
|
||||
)[0]
|
||||
)
|
||||
|
||||
contact('main', 'Assembling conversations', 2)
|
||||
contact('sub', 'Merging inboxes', 0)
|
||||
|
||||
const groupedInboxes: {
|
||||
[id: string]: Inbox[]
|
||||
} = {}
|
||||
|
||||
// group into arrays based on Inbox.id,
|
||||
// this ensures no duplicates if,there are multiple parts with the same inbox
|
||||
for (let inbox of inboxes) {
|
||||
if (!groupedInboxes[inbox.id]) groupedInboxes[inbox.id] = []
|
||||
groupedInboxes[inbox.id].push(inbox)
|
||||
}
|
||||
|
||||
let [groupedN, groupedC] = counter(Object.keys(groupedInboxes).length)
|
||||
|
||||
const convos: Convo[] = []
|
||||
|
||||
// assign inbox(es) into convos
|
||||
for (let id in groupedInboxes) {
|
||||
contact('sub', 'Assigning messages', nextCounter(groupedN, groupedC++))
|
||||
|
||||
console.time(`join-${id}`) // internal assigning in Convo takes some time
|
||||
convos.push(
|
||||
new Convo( // sort inboxes chronologically
|
||||
groupedInboxes[id].sort((a, b) => b.meta.date - a.meta.date),
|
||||
owner
|
||||
)
|
||||
)
|
||||
console.timeEnd(`join-${id}`)
|
||||
}
|
||||
|
||||
contact('main', 'Generating statistics', 3)
|
||||
|
||||
let [convoN, convoC] = counter(convos.length)
|
||||
|
||||
for (let convo of convos) {
|
||||
contact('sub', `Analyzing ${convo.title}`, nextCounter(convoN, convoC++))
|
||||
|
||||
console.time(`stats-${convo.id}`)
|
||||
await convo.runStats()
|
||||
console.timeEnd(`stats-${convo.id}`)
|
||||
}
|
||||
|
||||
contact('main', 'Finished', 4)
|
||||
contact('sub', 'All tasks ok', 100)
|
||||
|
||||
console.info('scan: ', Convos)
|
||||
|
||||
convos.forEach(c => (Convos[c.id] = c)) // rearrange to global exported object
|
||||
|
||||
return Object.keys(Convos).map(id => ({ id, title: Convos[id].title })) // pass only ids to renderer
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { prepStatResults, statParser } from '../types/Stat'
|
||||
|
||||
export default {
|
||||
id: 'photosPerMember',
|
||||
|
||||
begin: ({ members }) =>
|
||||
prepStatResults(members, () => ({
|
||||
photos: 0,
|
||||
videos: 0,
|
||||
audios: 0,
|
||||
files: 0,
|
||||
gifs: 0,
|
||||
stickers: 0,
|
||||
})),
|
||||
|
||||
every: (message, member, convo, prev) => {
|
||||
if ('sticker' in message) prev[member.name].stickers += 1
|
||||
|
||||
// FIXME: this probably can be done in 3 lines but i can't be bothered right now
|
||||
if (message.media) {
|
||||
if ('photos' in message.media)
|
||||
prev[member.name].photos += message.media.photos.length
|
||||
if ('videos' in message.media)
|
||||
prev[member.name].videos += message.media.videos.length
|
||||
if ('audios' in message.media)
|
||||
prev[member.name].audios += message.media.audios.length
|
||||
if ('files' in message.media)
|
||||
prev[member.name].files += message.media.files.length
|
||||
if ('gifs' in message.media)
|
||||
prev[member.name].gifs += message.media.gifs.length
|
||||
}
|
||||
return prev
|
||||
},
|
||||
|
||||
end: (convo, prev) => prev,
|
||||
} as statParser
|
||||
@@ -0,0 +1,33 @@
|
||||
import { monthsEmpty, prepStatResults, statParser } from '../types/Stat'
|
||||
|
||||
export default {
|
||||
id: 'messagesPerDay',
|
||||
|
||||
begin: ({ firstMessage, lastMessage, members }) => {
|
||||
let firstYear = new Date(firstMessage / 1e3).getFullYear(),
|
||||
lastYear = new Date(lastMessage / 1e3).getFullYear()
|
||||
|
||||
return prepStatResults(members, () => {
|
||||
let prep: {
|
||||
[year: string]: number[][]
|
||||
} = {}
|
||||
for (let i = firstYear; i <= lastYear; i++) {
|
||||
prep[i] = monthsEmpty()
|
||||
}
|
||||
return prep
|
||||
})
|
||||
},
|
||||
|
||||
every: (message, member, convo, prev) => {
|
||||
let date = new Date(message.time / 1e3),
|
||||
y = date.getFullYear(),
|
||||
m = date.getMonth(),
|
||||
d = date.getDate()
|
||||
|
||||
prev[member.name][y][m][d - 1] += 1
|
||||
|
||||
return prev
|
||||
},
|
||||
|
||||
end: (convo, prev) => prev,
|
||||
} as statParser
|
||||
@@ -0,0 +1,14 @@
|
||||
import { prepStatResults, statParser } from '../types/Stat'
|
||||
|
||||
export default {
|
||||
id: 'messagesPerHour',
|
||||
|
||||
begin: ({ members }) => prepStatResults(members, () => Array(24).fill(0)),
|
||||
|
||||
every: (message, member, convo, prev, other) => {
|
||||
prev[member.name][new Date(message.time / 1e3).getHours()] += 1
|
||||
return prev
|
||||
},
|
||||
|
||||
end: (convo, prev, other) => prev,
|
||||
} as statParser
|
||||
@@ -0,0 +1,14 @@
|
||||
import { prepStatResults, statParser } from '../types/Stat'
|
||||
|
||||
export default {
|
||||
id: 'messagesPerMember',
|
||||
|
||||
begin: ({ members }) => prepStatResults(members, () => 0),
|
||||
|
||||
every: (message, member, convo, prev) => {
|
||||
prev[member.name] += 1
|
||||
return prev
|
||||
},
|
||||
|
||||
end: (convo, prev) => prev,
|
||||
} as statParser
|
||||
@@ -0,0 +1,15 @@
|
||||
import { prepStatResults, statParser } from '../types/Stat'
|
||||
|
||||
export default {
|
||||
id: 'messagesPerWeekday',
|
||||
|
||||
begin: ({ members }) =>
|
||||
prepStatResults(members, () => [0, 0, 0, 0, 0, 0, 0]),
|
||||
|
||||
every: (message, member, convo, prev) => {
|
||||
prev[member.name][new Date(message.time / 1e3).getDay()] += 1
|
||||
return prev
|
||||
},
|
||||
|
||||
end: (convo, prev) => prev,
|
||||
} as statParser
|
||||
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
prepStatResults,
|
||||
sortObjectbyValueNumber,
|
||||
statParser,
|
||||
} from '../types/Stat'
|
||||
|
||||
const emojiPattern =
|
||||
/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g
|
||||
|
||||
export default {
|
||||
id: 'mostUsedEmoji',
|
||||
|
||||
begin: ({ members }) => prepStatResults(members, () => ({})),
|
||||
|
||||
every: (message, member, convo, prev) => {
|
||||
if (message.content.length > 0) {
|
||||
let emojis = message.content.match(emojiPattern)
|
||||
if (emojis) {
|
||||
emojis.forEach(
|
||||
e => (prev[member.name][e] = (prev[member.name][e] + 1) | 1)
|
||||
)
|
||||
}
|
||||
}
|
||||
return prev
|
||||
},
|
||||
|
||||
end: (convo, prev) => {
|
||||
for (let name in prev) prev[name] = sortObjectbyValueNumber(prev[name])
|
||||
|
||||
return prev
|
||||
},
|
||||
} as statParser
|
||||
@@ -0,0 +1,34 @@
|
||||
import {
|
||||
prepStatResults,
|
||||
sortObjectbyValueNumber,
|
||||
statParser,
|
||||
} from '../types/Stat'
|
||||
|
||||
export default {
|
||||
id: 'mostUsedReactions',
|
||||
|
||||
begin: ({ members }) =>
|
||||
prepStatResults(members, () => ({ got: {}, used: {} })),
|
||||
|
||||
every: (message, member, convo, prev) => {
|
||||
if (message.reactions) {
|
||||
for (let { reaction, actor } of message.reactions) {
|
||||
const got = prev[member.name].got,
|
||||
used = prev[actor].used
|
||||
|
||||
got[reaction] = got[reaction] + 1 || 1
|
||||
used[reaction] = used[reaction] + 1 || 1
|
||||
}
|
||||
}
|
||||
|
||||
return prev
|
||||
},
|
||||
|
||||
end: (convo, prev) => {
|
||||
for (let { name } of convo.members) {
|
||||
prev[name].got = sortObjectbyValueNumber(prev[name].got)
|
||||
prev[name].used = sortObjectbyValueNumber(prev[name].used)
|
||||
}
|
||||
return prev
|
||||
},
|
||||
} as statParser
|
||||
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
prepStatResults,
|
||||
sortObjectbyValueNumber,
|
||||
statParser,
|
||||
} from '../types/Stat'
|
||||
|
||||
export default {
|
||||
id: 'mostUsedWords',
|
||||
|
||||
begin: ({ members }) => prepStatResults(members, () => ({})),
|
||||
|
||||
every: (message, member, convo, prev) => {
|
||||
if (message.content.length > 0)
|
||||
message.content.split(' ').forEach(word => {
|
||||
if (prev[member.name][word]) prev[member.name][word] += 1
|
||||
else prev[member.name][word] = 1
|
||||
})
|
||||
return prev
|
||||
},
|
||||
|
||||
end: (convo, prev) => {
|
||||
for (let name in prev) prev[name] = sortObjectbyValueNumber(prev[name])
|
||||
|
||||
return prev
|
||||
},
|
||||
} as statParser
|
||||
@@ -0,0 +1,15 @@
|
||||
import { prepStatResults, statParser } from '../types/Stat'
|
||||
|
||||
export default {
|
||||
id: 'wordsPerMember',
|
||||
|
||||
begin: ({ members }) => prepStatResults(members, () => 0),
|
||||
|
||||
every: (message, member, convo, prev) => {
|
||||
if (message.content.length > 0)
|
||||
prev[member.name] += message.content.split(' ').length
|
||||
return prev
|
||||
},
|
||||
|
||||
end: (convo, prev) => prev,
|
||||
} as statParser
|
||||
@@ -0,0 +1,81 @@
|
||||
import Convo from '../Convo'
|
||||
import Member from '../Member'
|
||||
import Message from '../Message'
|
||||
|
||||
export type statParser = {
|
||||
id: string
|
||||
|
||||
begin: (convo: Convo) => any
|
||||
every: (
|
||||
message: Message,
|
||||
member: Member,
|
||||
convo: Convo,
|
||||
previous: any,
|
||||
others: any
|
||||
) => any
|
||||
end: (convo: Convo, previous: any, others: any) => any
|
||||
}
|
||||
|
||||
// TODO: add a function for groups with more uniform hue spread
|
||||
export function hueFromString(s: string) {
|
||||
// TODO: offset character codes closer to 0
|
||||
return Array(...s).reduce((s, c) => s + c.charCodeAt(0), 0) % 360
|
||||
}
|
||||
|
||||
export type statRendererProps = {
|
||||
data: statParser
|
||||
convo: Convo
|
||||
options: [boolean, number]
|
||||
}
|
||||
|
||||
export function prepStatResults(members: Member[], initial: () => any) {
|
||||
let out: {
|
||||
[memberName: string]: ReturnType<typeof initial>
|
||||
} = {}
|
||||
|
||||
for (let { name } of members) {
|
||||
out[name] = initial()
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
export function nToMonthName(n: number) {
|
||||
return [
|
||||
'January',
|
||||
'February',
|
||||
'March',
|
||||
'April',
|
||||
'May',
|
||||
'June',
|
||||
'July',
|
||||
'August',
|
||||
'September',
|
||||
'October',
|
||||
'November',
|
||||
'December',
|
||||
][n]
|
||||
}
|
||||
|
||||
export const monthsEmpty = (): 0[][] => [
|
||||
new Array(31).fill(0),
|
||||
new Array(29).fill(0), // FIXME: this will cause problems
|
||||
new Array(31).fill(0),
|
||||
new Array(30).fill(0),
|
||||
new Array(31).fill(0),
|
||||
new Array(30).fill(0),
|
||||
new Array(31).fill(0),
|
||||
new Array(31).fill(0),
|
||||
new Array(30).fill(0),
|
||||
new Array(31).fill(0),
|
||||
new Array(30).fill(0),
|
||||
new Array(31).fill(0),
|
||||
]
|
||||
|
||||
export const monthsLabels = monthsEmpty().map((days, m) =>
|
||||
days.map((_, d) => `${nToMonthName(m)} ${d + 1}`)
|
||||
)
|
||||
|
||||
// TODO: add option/function for asc/desc
|
||||
export const sortObjectbyValueNumber = (o: { [key: string]: number }) =>
|
||||
Object.fromEntries(Object.entries(o).sort(([, a], [, b]) => b - a))
|
||||
@@ -0,0 +1,6 @@
|
||||
type updateProgress = (
|
||||
level: string,
|
||||
message: string,
|
||||
status: number,
|
||||
err?: Error
|
||||
) => void
|
||||
@@ -0,0 +1,129 @@
|
||||
export type timestampSeconds = number
|
||||
export type timestampMs = number
|
||||
|
||||
export type unescapedString = string
|
||||
|
||||
export type messagesPart = {
|
||||
title: unescapedString
|
||||
thread_path: string
|
||||
thread_type: string
|
||||
participants: { name: unescapedString }[]
|
||||
magic_words: []
|
||||
messages: (message & messageWithMedia)[]
|
||||
image?: {
|
||||
uri: string
|
||||
creation_timestamp: timestampSeconds
|
||||
}
|
||||
is_still_participant: boolean
|
||||
joinable_mode: {
|
||||
mode: number
|
||||
link: string
|
||||
}
|
||||
}
|
||||
|
||||
export type message = {
|
||||
sender_name: unescapedString
|
||||
timestamp_ms: timestampMs
|
||||
content?: unescapedString
|
||||
type: string // 'Generic' | 'Call' | 'Share' | 'Subscribe' | 'Unsubscribe'
|
||||
is_unsent: boolean
|
||||
is_taken_down: boolean
|
||||
bumped_message_metadata: {
|
||||
bumped_message: unescapedString
|
||||
is_bumped: boolean
|
||||
}
|
||||
|
||||
call_duration?: number
|
||||
missed?: boolean
|
||||
|
||||
ip?: string
|
||||
|
||||
reactions?: messageReaction[]
|
||||
|
||||
users?: { name: unescapedString }[]
|
||||
|
||||
share?: {
|
||||
link?: string
|
||||
share_text?: unescapedString
|
||||
}
|
||||
|
||||
sticker?: {
|
||||
uri: string
|
||||
}
|
||||
}
|
||||
|
||||
export type messageWithMedia = {
|
||||
photos?: messageMedia[]
|
||||
audio_files?: messageMedia[]
|
||||
files?: messageMedia[]
|
||||
gifs?: (messageMedia & { creation_timestamp: never })[]
|
||||
videos?: (messageMedia & { thumbnail: { uri: string } })[]
|
||||
[mediaType: string]: messageMedia[] | undefined
|
||||
}
|
||||
|
||||
export type messageMedia = {
|
||||
uri: string
|
||||
creation_timestamp: number
|
||||
}
|
||||
|
||||
export type messageReaction = {
|
||||
reaction: unescapedString
|
||||
actor: unescapedString
|
||||
}
|
||||
|
||||
// all keys present in facebook takeouts
|
||||
|
||||
// "title":
|
||||
// "thread_path":
|
||||
// "thread_type":
|
||||
// "participants":
|
||||
// "name":
|
||||
// "magic_words":
|
||||
// "messages":
|
||||
// "image":
|
||||
// "is_still_participant":
|
||||
// "joinable_mode":
|
||||
|
||||
// "link":
|
||||
// "mode":
|
||||
// "uri":
|
||||
// "creation_timestamp":
|
||||
|
||||
// "sender_name":
|
||||
// "timestamp_ms":
|
||||
// "content":
|
||||
// "type":
|
||||
// "is_unsent":
|
||||
// "is_taken_down":
|
||||
// "bumped_message_metadata":
|
||||
// "bumped_message":
|
||||
// "is_bumped":
|
||||
|
||||
// "photos":
|
||||
// "videos":
|
||||
// "audio_files":
|
||||
// "gifs":
|
||||
// "files":
|
||||
// "uri":
|
||||
// "creation_timestamp":
|
||||
// "thumbnail":
|
||||
// "uri":
|
||||
|
||||
// "call_duration":
|
||||
// "missed":
|
||||
|
||||
// "ip":
|
||||
|
||||
// "reactions":
|
||||
// "reaction":
|
||||
// "actor":
|
||||
|
||||
// "users":
|
||||
// "name":
|
||||
|
||||
// "share":
|
||||
// "link":
|
||||
// "share_text":
|
||||
|
||||
// "sticker":
|
||||
// "uri":
|
||||
+9
-26
@@ -1,31 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"module": "esnext",
|
||||
"target": "esnext",
|
||||
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"lib": ["dom", "es2015", "es2016", "es2017"],
|
||||
"allowJs": true,
|
||||
"jsx": "react-jsx",
|
||||
"sourceMap": true,
|
||||
"outDir": "build",
|
||||
|
||||
"paths": {
|
||||
"*": ["../node_modules/*", "*"]
|
||||
},
|
||||
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitAny": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
// "noUnusedLocals": true,
|
||||
|
||||
"outDir": "./dist",
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true
|
||||
},
|
||||
"compileOnSave": true,
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules/"]
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
|
||||
// webpack.config.js
|
||||
module.exports = [
|
||||
{
|
||||
mode: 'development',
|
||||
entry: './electron/main.ts',
|
||||
target: 'electron-main',
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
// include: /src/,
|
||||
use: [{ loader: 'ts-loader' }],
|
||||
},
|
||||
{
|
||||
test: /\.node$/,
|
||||
loader: 'node-loader',
|
||||
},
|
||||
],
|
||||
},
|
||||
output: {
|
||||
path: __dirname + '/build',
|
||||
filename: 'electron.js',
|
||||
},
|
||||
},
|
||||
{
|
||||
entry: './electron/preload.ts',
|
||||
target: 'electron-preload',
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
// include: /src/,
|
||||
use: [{ loader: 'ts-loader' }],
|
||||
},
|
||||
],
|
||||
},
|
||||
output: {
|
||||
path: __dirname + '/build',
|
||||
filename: 'preload.js',
|
||||
},
|
||||
},
|
||||
{
|
||||
mode: 'development',
|
||||
entry: __dirname + '/src/index.tsx',
|
||||
target: 'electron-renderer',
|
||||
devtool: 'source-map',
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.node$/,
|
||||
use: 'node-loader',
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ['style-loader', 'css-loader'],
|
||||
},
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: ['style-loader', 'css-loader', 'sass-loader'],
|
||||
},
|
||||
{
|
||||
test: /\.(js|ts|tsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif)$/i,
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[path][name].[ext]',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
output: {
|
||||
path: __dirname + '/build',
|
||||
filename: 'react.js',
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: './public/index.html',
|
||||
}),
|
||||
],
|
||||
},
|
||||
]
|
||||
Reference in new issue
Block a user