mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-09-26 21:46:39 +02:00
update build
This commit is contained in:
@@ -1,2 +0,0 @@
|
|||||||
@echo off
|
|
||||||
google-closure-compiler src/js/Const.js src/js/Util.js src/js/FileDownloader.js src/js/VBF.js src/js/autodownloader.js --js_output_file dist/void_auto_loader.js --language_out ECMASCRIPT_NEXT
|
|
@@ -1,2 +0,0 @@
|
|||||||
@echo off
|
|
||||||
google-closure-compiler src/js/Const.js src/js/Util.js src/js/FileDownloader.js src/js/VBF.js --js_output_file dist/void_lib.js --language_out ECMASCRIPT_NEXT
|
|
@@ -5,7 +5,7 @@
|
|||||||
<title>void.cat</title>
|
<title>void.cat</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="dist/style.css" />
|
<link rel="stylesheet" href="dist/bundle.css" />
|
||||||
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
||||||
<script>
|
<script>
|
||||||
(adsbygoogle = window.adsbygoogle || []).push({
|
(adsbygoogle = window.adsbygoogle || []).push({
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="./dist/bundle.js"></script>
|
<script type="text/javascript" src="dist/bundle.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
13
package.json
13
package.json
@@ -7,9 +7,9 @@
|
|||||||
"url": "git+https://github.com/v0l/void.cat.git"
|
"url": "git+https://github.com/v0l/void.cat.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "sass src/css/style.scss dist/style.css && webpack-cli --entry ./src/js/index.js --mode production --output ./dist/bundle.js && webpack-cli --entry ./src/js/Worker.js --mode production --output ./sw.js",
|
"build": "webpack",
|
||||||
"debug": "webpack-cli --entry ./src/js/index.js --mode development --watch --output ./dist/bundle.js",
|
"debug": "webpack-cli --entry ./src/js/index.js --mode development --watch --output ./dist/bundle.js",
|
||||||
"debug-worker": "webpack-cli --entry ./src/js/Worker.js --mode development --watch --output ./sw.js"
|
"debug:worker": "webpack-cli --entry ./src/js/Worker.js --mode development --watch --output ./sw.js"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"upload",
|
"upload",
|
||||||
@@ -25,10 +25,11 @@
|
|||||||
"homepage": "https://github.com/v0l/void.cat#readme",
|
"homepage": "https://github.com/v0l/void.cat#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"asmcrypto.js": "^2.3.2",
|
"asmcrypto.js": "^2.3.2",
|
||||||
|
"css-loader": "^2.1.1",
|
||||||
|
"mini-css-extract-plugin": "^0.6.0",
|
||||||
|
"node-sass": "^4.12.0",
|
||||||
|
"optimize-css-assets-webpack-plugin": "^5.0.1",
|
||||||
|
"sass-loader": "^7.1.0",
|
||||||
"webpack": "^4.31.0"
|
"webpack": "^4.31.0"
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"saas": "^1.0.0",
|
|
||||||
"webpack-cli": "^3.3.2"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,8 +26,9 @@ const VoidFetch = function (event) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
let resp = await fd.StreamResponse();
|
let resp = await fd.StreamResponse();
|
||||||
resp.headers.set("Content-Type", fd.fileHeader.mime != "" ? fd.fileHeader.mime : "application/octet-stream");
|
let head = await fd.waitForHeader;
|
||||||
resp.headers.set("Content-Disposition", `inline; filename="${fd.fileHeader.name}"`);
|
resp.headers.set("Content-Type", head.mime != "" ? head.mime : "application/octet-stream");
|
||||||
|
resp.headers.set("Content-Disposition", `inline; filename="${head.name}"`);
|
||||||
return resp;
|
return resp;
|
||||||
} else {
|
} else {
|
||||||
return Response.error();
|
return Response.error();
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import * as App from './modules/App.js';
|
import * as App from './modules/App.js';
|
||||||
|
import '../scss/style.scss';
|
||||||
|
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
navigator.serviceWorker.register('/sw.js').then(function (registration) {
|
navigator.serviceWorker.register('/sw.js').then(function (registration) {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import * as Const from './Const.js';
|
import * as Const from './Const.js';
|
||||||
import { VBF } from './VBF.js';
|
import { VBF } from './VBF.js';
|
||||||
import { XHR, Utils, Log } from './Util.js';
|
import { XHR, Utils, Log } from './Util.js';
|
||||||
import { bytes_to_base64, HmacSha256, AES_CBC } from 'asmcrypto.js';
|
import { HmacSha256, AES_CBC } from 'asmcrypto.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File download and decryption class
|
* File download and decryption class
|
||||||
@@ -80,8 +80,14 @@ function FileDownloader(fileinfo, key, iv) {
|
|||||||
mode: 'cors'
|
mode: 'cors'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//hack
|
||||||
|
var completeHeader;
|
||||||
|
this.waitForHeader = new Promise((resolve, reject) => {
|
||||||
|
completeHeader = resolve;
|
||||||
|
});
|
||||||
|
|
||||||
let void_download = {
|
let void_download = {
|
||||||
SetFileHeader: function (fh) { this.fileHeader = fh; }.bind(this),
|
SetFileHeader: function (fh) { completeHeader(fh); }.bind({ completeHeader }),
|
||||||
HandleProgress: this.HandleProgress.bind(this),
|
HandleProgress: this.HandleProgress.bind(this),
|
||||||
downloadStats: this.downloadStats,
|
downloadStats: this.downloadStats,
|
||||||
isStart: true,
|
isStart: true,
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
self::$Instance = new Redis();
|
self::$Instance = new Redis();
|
||||||
$con = self::$Instance->pconnect(REDIS_CONFIG);
|
$con = self::$Instance->pconnect(REDIS_CONFIG);
|
||||||
if($con){
|
if($con){
|
||||||
|
self::$Instance->select(REDIS_DB);
|
||||||
$rep = self::$Instance->info();
|
$rep = self::$Instance->info();
|
||||||
if($rep["role"] == "slave"){
|
if($rep["role"] == "slave"){
|
||||||
self::$IsConnectedToSlave = true;
|
self::$IsConnectedToSlave = true;
|
||||||
@@ -29,9 +30,6 @@
|
|||||||
return $con && $mcon;
|
return $con && $mcon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(REDIS_DB !== 0 && $con){
|
|
||||||
self::$Instance->select(REDIS_DB);
|
|
||||||
}
|
|
||||||
return $con;
|
return $con;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
35
webpack.config.js
Normal file
35
webpack.config.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
const path = require('path');
|
||||||
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
|
const TerserJSPlugin = require('terser-webpack-plugin');
|
||||||
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: {
|
||||||
|
bundle: './src/js/index.js',
|
||||||
|
sw: './src/js/Worker.js'
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
filename: '[name].js',
|
||||||
|
path: path.resolve(__dirname, 'dist')
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.scss$/,
|
||||||
|
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
mode: 'production',
|
||||||
|
optimization: {
|
||||||
|
usedExports: true,
|
||||||
|
minimizer: [new TerserJSPlugin(), new OptimizeCSSAssetsPlugin()]
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new MiniCssExtractPlugin({
|
||||||
|
filename: '[name].css',
|
||||||
|
chunkFilename: '[id].css',
|
||||||
|
path: path.resolve(__dirname, 'dist')
|
||||||
|
})
|
||||||
|
]
|
||||||
|
};
|
Reference in New Issue
Block a user