Skip to content

Commit a04df05

Browse files
authored
Merge pull request #32 from CodeDead/release/2.1.0
Release/2.1.0
2 parents 0985cae + cf6a683 commit a04df05

File tree

29 files changed

+981
-581
lines changed

29 files changed

+981
-581
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules
44
build
55
src/serviceWorker.js
66
README.md
7+
.eslintcache

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ dist/*
3333
!.yarn/sdks
3434
!.yarn/versions
3535
.pnp.*
36+
37+
.eslintcache

.yarn/releases/yarn-2.3.3.cjs

Lines changed: 0 additions & 55 deletions
This file was deleted.

.yarn/releases/yarn-2.4.0.cjs

Lines changed: 55 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ nodeLinker: node-modules
22

33
plugins:
44
- path: .yarn/plugins/yarn-up-all-plugin.cjs
5-
spec: "https://github.com/e5mode/yarn-up-all/releases/download/1.0.2/index.js"
5+
spec: "https://github.com/e5mode/yarn-up-all/releases/download/1.0.3/index.js"
66

7-
yarnPath: .yarn/releases/yarn-2.3.3.cjs
7+
yarnPath: .yarn/releases/yarn-2.4.0.cjs

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
![DeadHash](https://codedead.com/wp-content/uploads/2020/06/DeadHash.png)
1+
![DeadHash](https://i.imgur.com/PWrqQ67.png)
22

33
# DeadHash
44

55
![GitHub package.json version](https://img.shields.io/github/package-json/v/CodeDead/DeadHash-js)
66
![GitHub](https://img.shields.io/github/license/CodeDead/DeadHash-Js)
7-
![GitHub Releases (by Release)](https://img.shields.io/github/downloads/CodeDead/DeadHash-js/2.0.4/total)
7+
![GitHub Releases (by Release)](https://img.shields.io/github/downloads/CodeDead/DeadHash-js/2.1.0/total)
88

99
DeadHash is a free and open-source utility to calculate file and text hashes. The following hash calculations are supported:
10+
1011
* MD4
1112
* MD5
1213
* SHA-1

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deadhash",
3-
"version": "2.0.4",
3+
"version": "2.1.0",
44
"description": "File and text hash calculator",
55
"homepage": "./",
66
"private": true,
@@ -12,7 +12,7 @@
1212
"build": {
1313
"appId": "com.codedead.deadhash",
1414
"productName": "DeadHash",
15-
"copyright": "Copyright © 2020 ${author}",
15+
"copyright": "Copyright © 2021 ${author}",
1616
"win": {
1717
"target": [
1818
"nsis",
@@ -35,16 +35,16 @@
3535
},
3636
"main": "public/electron.js",
3737
"dependencies": {
38-
"@material-ui/core": "^4.11.0",
39-
"@material-ui/icons": "^4.9.1",
40-
"cross-env": "^7.0.2",
38+
"@material-ui/core": "^4.11.3",
39+
"@material-ui/icons": "^4.11.2",
40+
"cross-env": "^7.0.3",
4141
"electron-is-dev": "^1.2.0",
4242
"react": "^17.0.1",
43-
"react-contexify": "^4.1.1",
43+
"react-contexify": "^5.0.0",
4444
"react-dom": "^17.0.1",
4545
"react-router": "^5.2.0",
4646
"react-router-dom": "^5.2.0",
47-
"react-scripts": "^4.0.0"
47+
"react-scripts": "^4.0.1"
4848
},
4949
"scripts": {
5050
"react-start": "react-scripts start",
@@ -70,13 +70,13 @@
7070
},
7171
"devDependencies": {
7272
"concurrently": "^5.3.0",
73-
"electron": "^10.1.5",
73+
"electron": "^11.2.1",
7474
"electron-builder": "^22.9.1",
7575
"eslint-config-airbnb": "^18.2.1",
7676
"eslint-plugin-import": "^2.22.1",
7777
"eslint-plugin-jsx-a11y": "^6.4.1",
78-
"eslint-plugin-react": "^7.21.5",
78+
"eslint-plugin-react": "^7.22.0",
7979
"eslint-plugin-react-hooks": "^4.2.0",
80-
"wait-on": "^5.2.0"
80+
"wait-on": "^5.2.1"
8181
}
8282
}

public/electron.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const createWindow = () => {
1515
mainWindow = new BrowserWindow({
1616
webPreferences: {
1717
nodeIntegration: true,
18+
contextIsolation: false,
1819
},
1920
frame: false,
2021
title: 'DeadHash',
@@ -26,13 +27,13 @@ const createWindow = () => {
2627
fileWorkerWindow = new BrowserWindow({
2728
show: isDev,
2829
icon: path.join(__dirname, '../build/logo512.png'),
29-
webPreferences: { nodeIntegration: true },
30+
webPreferences: { nodeIntegration: true, contextIsolation: false },
3031
});
3132

3233
textWorkerWindow = new BrowserWindow({
3334
show: isDev,
3435
icon: path.join(__dirname, '../build/logo512.png'),
35-
webPreferences: { nodeIntegration: true },
36+
webPreferences: { nodeIntegration: true, contextIsolation: false },
3637
});
3738

3839
if (isDev) {

src/components/App/index.jsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,14 @@ const App = () => {
2626
const [, dispatch] = useContext(CryptoContext);
2727

2828
const enabled = state.canDragDrop;
29-
let { themeIndex } = state;
30-
31-
let themeType = 'light';
32-
if (themeIndex === 8) {
33-
themeType = 'dark';
34-
themeIndex = 2;
35-
}
29+
const { themeIndex, themeStyle } = state;
3630

3731
const color = ThemeSelector(themeIndex);
3832

3933
const theme = createMuiTheme({
4034
palette: {
4135
primary: color,
42-
type: themeType,
36+
type: themeStyle,
4337
},
4438
});
4539

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,52 @@
11
import React from 'react';
2-
import { Item, Menu, MenuProvider } from 'react-contexify';
2+
import { Item, Menu, useContextMenu } from 'react-contexify';
33
import CopyIcon from '@material-ui/icons/FileCopy';
44
import PasteIcon from '@material-ui/icons/Assignment';
55

66
const CopyPasteMenu = ({
77
id, children, copyData, pasteData, copy, paste,
8-
}) => (
9-
<>
10-
<MenuProvider id={`copyPasteMenu${id}`} style={{ width: '100%' }}>
11-
{children}
12-
</MenuProvider>
13-
<Menu id={`copyPasteMenu${id}`}>
14-
<Item onClick={() => copyData()}>
15-
<CopyIcon />
16-
{' '}
17-
{copy}
18-
</Item>
19-
<Item onClick={() => pasteData()}>
20-
<PasteIcon />
21-
{' '}
22-
{paste}
23-
</Item>
24-
</Menu>
25-
</>
26-
);
8+
}) => {
9+
const MENU_ID = `copyPasteMenu${id}`;
10+
11+
const { show } = useContextMenu({
12+
id: MENU_ID,
13+
});
14+
15+
/**
16+
* Handle the context menu event
17+
* @param event The event argument
18+
*/
19+
const handleContextMenu = (event) => {
20+
event.preventDefault();
21+
show(event, {
22+
props: {
23+
key: 'value',
24+
},
25+
});
26+
};
27+
28+
return (
29+
<>
30+
<div
31+
style={{ width: '100%' }}
32+
onContextMenu={handleContextMenu}
33+
>
34+
{children}
35+
</div>
36+
<Menu id={MENU_ID}>
37+
<Item onClick={() => copyData()}>
38+
<CopyIcon />
39+
{' '}
40+
{copy}
41+
</Item>
42+
<Item onClick={() => pasteData()}>
43+
<PasteIcon />
44+
{' '}
45+
{paste}
46+
</Item>
47+
</Menu>
48+
</>
49+
);
50+
};
2751

2852
export default CopyPasteMenu;

src/components/Hash/index.jsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Paper from '@material-ui/core/Paper';
33
import { makeStyles } from '@material-ui/core';
44
import Typography from '@material-ui/core/Typography';
55
import CheckIcon from '@material-ui/icons/Check';
6-
import { Menu, Item, MenuProvider } from 'react-contexify';
6+
import { Menu, Item, useContextMenu } from 'react-contexify';
77
import 'react-contexify/dist/ReactContexify.min.css';
88
import CopyIcon from '@material-ui/icons/FileCopy';
99

@@ -19,6 +19,7 @@ const useStyles = makeStyles((theme) => ({
1919
const Hash = ({
2020
hashType, content, compareString, id, copy,
2121
}) => {
22+
const MENU_ID = `hashMenu${id}`;
2223
const classes = useStyles();
2324

2425
let compareColor = null;
@@ -28,15 +29,32 @@ const Hash = ({
2829
compareColor = { color: 'green' };
2930
}
3031

32+
const { show } = useContextMenu({
33+
id: MENU_ID,
34+
});
35+
36+
/**
37+
* Handle the context menu event
38+
* @param event The event argument
39+
*/
40+
const handleContextMenu = (event) => {
41+
event.preventDefault();
42+
show(event, {
43+
props: {
44+
key: 'value',
45+
},
46+
});
47+
};
48+
3149
return (
3250
<Paper className={classes.paper}>
3351
<Typography variant="subtitle1" color="primary" gutterBottom>
3452
{hashType}
3553
{compareIcon}
3654
</Typography>
37-
<MenuProvider id={`hashMenu${id}`}>
55+
<div onContextMenu={handleContextMenu}>
3856
<span style={compareColor}>{content}</span>
39-
</MenuProvider>
57+
</div>
4058
<Menu id={`hashMenu${id}`}>
4159
<Item onClick={() => navigator.clipboard.writeText(content)}>
4260
<CopyIcon />

src/contexts/MainContextProvider/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import ru_RU from '../../languages/ru_RU';
2222
import tr_TR from '../../languages/tr_TR';
2323

2424
const languageIndex = localStorage.languageIndex ? parseFloat(localStorage.languageIndex) : 1;
25+
const themeStyle = localStorage.themeStyle ? localStorage.themeStyle : 'light';
2526
const themeIndex = localStorage.themeIndex ? parseFloat(localStorage.themeIndex) : 0;
2627
const autoUpdate = localStorage.autoUpdate && localStorage.autoUpdate === 'true' ? true : !localStorage.autoUpdate;
2728
const minimizeEnabled = localStorage.minimizeEnabled && localStorage.minimizeEnabled === 'true' ? true : !localStorage.minimizeEnabled;
@@ -45,6 +46,7 @@ const initState = {
4546
],
4647
drawerOpen: false,
4748
selectedListItem: 0,
49+
themeStyle,
4850
themeIndex,
4951
autoUpdate,
5052
checkedForUpdates: false,

src/languages/de_DE/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const de_DE = () => ({
77
help: 'Hilfe',
88
language: 'Sprache',
99
aboutSubtitle: 'Erfahren Sie mehr über DeadHash',
10-
aboutMessage: 'DeadHash wurde von DeadLine erstellt.\n\nEinige Bilder wurden von icons8 bereitgestellt: https://icons8.com\nLizenz: GPLv3\nVersion: {x}\n\nCopyright © 2020 CodeDead',
10+
aboutMessage: 'DeadHash wurde von DeadLine erstellt.\n\nEinige Bilder wurden von icons8 bereitgestellt: https://icons8.com\nLizenz: GPLv3\nVersion: {x}\n\nCopyright © 2021 CodeDead',
1111
codedead: 'CodeDead',
1212
theme: 'Thema',
1313
general: 'Allgemeines',
@@ -68,15 +68,18 @@ const de_DE = () => ({
6868
maximizeEnabled: 'Schaltfläche "Maximieren"',
6969
languageEnabled: 'Schaltfläche "Sprache"',
7070
exit: 'Schließen',
71-
darkTheme: 'Dunkel',
72-
darkThemeDescription: 'Schont die Augen.',
7371
export: 'Export',
7472
yourTextHere: 'Dein Text hier',
7573
filePath: 'Dateipfad',
7674
yes: 'Ja',
7775
no: 'Nein',
7876
confirmation: 'Bestätigung',
7977
confirmResetSettings: 'Möchten Sie wirklich alle Einstellungen zurücksetzen?',
78+
themeStyle: 'Themenstil',
79+
light: 'Licht',
80+
dark: 'Dunkel',
81+
orange: 'Orange',
82+
orangeThemeDescription: 'Lass uns Niederländisch werden.',
8083
});
8184

8285
// eslint-disable-next-line camelcase

src/languages/en_US/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const en_US = () => ({
77
help: 'Help',
88
language: 'Language',
99
aboutSubtitle: 'Learn more about DeadHash',
10-
aboutMessage: 'DeadHash was created by DeadLine.\n\nSome images were provided by icons8: https://icons8.com\nLicense: GPLv3\nVersion: {x}\n\nCopyright © 2020 CodeDead',
10+
aboutMessage: 'DeadHash was created by DeadLine.\n\nSome images were provided by icons8: https://icons8.com\nLicense: GPLv3\nVersion: {x}\n\nCopyright © 2021 CodeDead',
1111
codedead: 'CodeDead',
1212
theme: 'Theme',
1313
general: 'General',
@@ -68,15 +68,18 @@ const en_US = () => ({
6868
maximizeEnabled: 'Maximize button',
6969
languageEnabled: 'Language button',
7070
exit: 'Exit',
71-
darkTheme: 'Dark',
72-
darkThemeDescription: 'Easy on the eyes.',
7371
export: 'Export',
7472
yourTextHere: 'Your text here',
7573
filePath: 'File path',
7674
yes: 'Yes',
7775
no: 'No',
7876
confirmation: 'Confirmation',
7977
confirmResetSettings: 'Are you sure you want to reset all settings?',
78+
themeStyle: 'Theme style',
79+
light: 'Light',
80+
dark: 'Dark',
81+
orange: 'Orange',
82+
orangeThemeDescription: 'Let\'s get Dutch.',
8083
});
8184

8285
// eslint-disable-next-line camelcase

src/languages/es_ES/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const es_ES = () => ({
77
help: 'Ayuda',
88
language: 'Idioma',
99
aboutSubtitle: 'Obtenga más información sobre DeadHash',
10-
aboutMessage: 'DeadHash fue creado por DeadLine.\n\nAlgunas imágenes fueron proporcionadas por icons8: https://icons8.com\nLicencia: GPLv3\nVersión: {x}\n\nCopyright © 2020 CodeDead',
10+
aboutMessage: 'DeadHash fue creado por DeadLine.\n\nAlgunas imágenes fueron proporcionadas por icons8: https://icons8.com\nLicencia: GPLv3\nVersión: {x}\n\nCopyright © 2021 CodeDead',
1111
codedead: 'CodeDead',
1212
theme: 'Tema',
1313
general: 'General',
@@ -68,15 +68,18 @@ const es_ES = () => ({
6868
maximizeEnabled: 'Botón Maximizar',
6969
languageEnabled: 'Botón de idioma',
7070
exit: 'Salida',
71-
darkTheme: 'Oscuro',
72-
darkThemeDescription: 'Fácil para los ojos.',
7371
export: 'Exportar',
7472
yourTextHere: 'Tu texto aqui',
7573
filePath: 'Ruta de archivo',
7674
yes: 'Sí',
7775
no: 'No',
7876
confirmation: 'Confirmación',
7977
confirmResetSettings: '¿Estás seguro de que quieres restablecer todos los ajustes?',
78+
themeStyle: 'Estilo del tema',
79+
light: 'Ligero',
80+
dark: 'Oscuro',
81+
orange: 'Naranja',
82+
orangeThemeDescription: 'Vamos a holandeses.',
8083
});
8184

8285
// eslint-disable-next-line camelcase

src/languages/fr_FR/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const fr_FR = () => ({
77
help: 'Aide',
88
language: 'Langue',
99
aboutSubtitle: 'En savoir plus sur DeadHash',
10-
aboutMessage: 'DeadHash a été créé par DeadLine.\n\nCertaines images ont été fournies par icons8: https://icons8.com\nLicence: GPLv3\nVersion: {x}\n\nCopyright © 2020 CodeDead',
10+
aboutMessage: 'DeadHash a été créé par DeadLine.\n\nCertaines images ont été fournies par icons8: https://icons8.com\nLicence: GPLv3\nVersion: {x}\n\nCopyright © 2021 CodeDead',
1111
codedead: 'CodeDead',
1212
theme: 'Thème',
1313
general: 'Général',
@@ -68,15 +68,18 @@ const fr_FR = () => ({
6868
maximizeEnabled: 'Bouton Agrandir',
6969
languageEnabled: 'Bouton de langue',
7070
exit: 'Fermer',
71-
darkTheme: 'Foncé',
72-
darkThemeDescription: 'Facile sur les yeux.',
7371
export: 'Exporter',
7472
yourTextHere: 'Votre texte ici',
7573
filePath: 'Chemin du fichier',
7674
yes: 'Oui',
7775
no: 'Non',
7876
confirmation: 'Confirmation',
7977
confirmResetSettings: 'Voulez-vous vraiment réinitialiser tous les paramètres?',
78+
themeStyle: 'Style de thème',
79+
light: 'Clair',
80+
dark: 'Foncé',
81+
orange: 'Orange',
82+
orangeThemeDescription: 'Il faut que ça Néerlandais.',
8083
});
8184

8285
// eslint-disable-next-line camelcase

0 commit comments

Comments
 (0)