major refactor
- moved everything to webpack
This commit is contained in:
parent
f51ee13176
commit
cff32999ba
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
tags
|
||||
node_modules/
|
||||
dist/
|
||||
|
13
dist/aes.html
vendored
Normal file
13
dist/aes.html
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>encryptme: Simple AES encryption/decryption</title>
|
||||
<meta name="description" content="Easy to use and simple online tool for AES encryption and decryption.
|
||||
Advanced settings allow control over the IV, AES mode, and PBKDF2 parameters.">
|
||||
<script defer src="src_style_css-src_templates_js.js"></script><script defer src="aes.js"></script></head>
|
||||
<body>
|
||||
<h1>AES</h1>
|
||||
</body>
|
||||
</html>
|
14
dist/index.html
vendored
Normal file
14
dist/index.html
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>encryptme</title>
|
||||
<meta name="description" content="Easy to use and simple online tools for encryption and decryption.">
|
||||
<script defer src="src_style_css-src_templates_js.js"></script><script defer src="index.js"></script></head>
|
||||
<body>
|
||||
<h2>Tools</h2>
|
||||
<h3>Encryption/decryption</h3>
|
||||
<a href="aes.html">AES</a>
|
||||
</body>
|
||||
</html>
|
2952
package-lock.json
generated
2952
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
13
package.json
13
package.json
@ -2,9 +2,11 @@
|
||||
"name": "encryptme",
|
||||
"version": "0.4.1",
|
||||
"description": "Simple online cryptography app.",
|
||||
"main": "scripts/interface.js",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "webpack",
|
||||
"lint": "eslint --ext .js,.jsx src"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -30,6 +32,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/dogeystamp/encryptme#readme",
|
||||
"devDependencies": {
|
||||
"eslint": "^8.33.0"
|
||||
"css-loader": "^6.7.3",
|
||||
"eslint": "^8.33.0",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
header = document.createElement("div");
|
||||
header.classList.add("page-header");
|
||||
|
||||
header.innerHTML = `
|
||||
<a href="index.html"><h1>encryptme</h1></a>
|
||||
`
|
||||
|
||||
document.body.appendChild(header);
|
@ -12,6 +12,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
|
||||
*/
|
||||
|
||||
import { generateHeader } from "./templates.js";
|
||||
import "./style.css";
|
||||
generateHeader();
|
||||
|
||||
import { TabList } from "./interface.js";
|
||||
import { bufToB64, b64ToBuf } from "./util.js";
|
||||
|
3
src/index.js
Normal file
3
src/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
import { generateHeader } from "./templates.js";
|
||||
import "./style.css";
|
||||
generateHeader();
|
@ -3,14 +3,11 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>encryptme: Simple AES encryption/decryption</title>
|
||||
<meta name="description" content="Easy to use and simple online tool for AES encryption and decryption.
|
||||
Advanced settings allow control over the IV, AES mode, and PBKDF2 parameters.">
|
||||
</head>
|
||||
<body>
|
||||
<script src="scripts/header-template.js"></script>
|
||||
<h1>AES</h1>
|
||||
<script type="module" src="scripts/aes.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -3,12 +3,10 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>encryptme</title>
|
||||
<meta name="description" content="Easy to use and simple online tools for encryption and decryption.">
|
||||
</head>
|
||||
<body>
|
||||
<script src="scripts/header-template.js"></script>
|
||||
<h2>Tools</h2>
|
||||
<h3>Encryption/decryption</h3>
|
||||
<a href="aes.html">AES</a>
|
11
src/templates.js
Normal file
11
src/templates.js
Normal file
@ -0,0 +1,11 @@
|
||||
function generateHeader() {
|
||||
let header = document.createElement("div");
|
||||
header.classList.add("page-header");
|
||||
|
||||
header.innerHTML = `
|
||||
<a href="index.html"><h1>encryptme</h1></a>
|
||||
`;
|
||||
document.body.prepend(header);
|
||||
}
|
||||
|
||||
export { generateHeader };
|
40
webpack.config.js
Normal file
40
webpack.config.js
Normal file
@ -0,0 +1,40 @@
|
||||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
const pages = ["index", "aes"];
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
entry: pages.reduce((config, page) => {
|
||||
config[page] = `./src/${page}.js`;
|
||||
return config;
|
||||
}, {}),
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
path: path.resolve(__dirname, "dist"),
|
||||
},
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
chunks: "all",
|
||||
},
|
||||
},
|
||||
plugins: [].concat(
|
||||
pages.map(
|
||||
(page) =>
|
||||
new HtmlWebpackPlugin({
|
||||
inject: true,
|
||||
template: `./src/pages/${page}.html`,
|
||||
filename: `${page}.html`,
|
||||
chunks: [page],
|
||||
})
|
||||
)
|
||||
),
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ['style-loader', 'css-loader'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user