From f9385130fe297088754d4ce46d6c318c8be2121d Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Thu, 14 May 2020 01:29:19 -0700 Subject: server side restructure, some documentation to accompany new wiki overview entry --- webpack.config.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js index 6265883fd..67d492e1f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,22 +16,21 @@ const plugins = [ new webpack.HotModuleReplacementPlugin(), ]; -const dotenv = require('dotenv'); - -function transferEnvironmentVariables() { +(function transferEnvironmentVariables() { const prefix = "_CLIENT_"; - const env = dotenv.config().parsed; - if (env) { - plugins.push(new webpack.DefinePlugin(Object.keys(env).reduce((mapping, envKey) => { - if (envKey.startsWith(prefix)) { - mapping[`process.env.${envKey.replace(prefix, "")}`] = JSON.stringify(env[envKey]); - } - return mapping; - }, {}))); + const { + parsed + } = require('dotenv').config(); + if (!parsed) { + return; } -} - -transferEnvironmentVariables(); + plugins.push(new webpack.DefinePlugin(Object.keys(parsed).reduce((mapping, envKey) => { + if (envKey.startsWith(prefix)) { + mapping[`process.env.${envKey.replace(prefix, "")}`] = JSON.stringify(parsed[envKey]); + } + return mapping; + }, {}))); +})(); module.exports = { mode: 'development', -- cgit v1.2.3-70-g09d2 From 55d76fc76d19cac3e36f73dca983723273820193 Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Fri, 15 May 2020 17:50:36 -0700 Subject: env fixes? --- src/client/views/DocumentDecorations.tsx | 2 +- webpack.config.js | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'webpack.config.js') diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index fc7c16296..6639f1cce 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -483,7 +483,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
{`${this.selectionTitle}`}
- + ; bounds.x = Math.max(0, bounds.x - this._resizeBorderWidth / 2) + this._resizeBorderWidth / 2; bounds.y = Math.max(0, bounds.y - this._resizeBorderWidth / 2 - this._titleHeight) + this._resizeBorderWidth / 2 + this._titleHeight; diff --git a/webpack.config.js b/webpack.config.js index 67d492e1f..1351008ea 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,7 +16,7 @@ const plugins = [ new webpack.HotModuleReplacementPlugin(), ]; -(function transferEnvironmentVariables() { +function transferEnvironmentVariables() { const prefix = "_CLIENT_"; const { parsed @@ -24,13 +24,16 @@ const plugins = [ if (!parsed) { return; } - plugins.push(new webpack.DefinePlugin(Object.keys(parsed).reduce((mapping, envKey) => { + const resolvedClientSide = Object.keys(parsed).reduce((mapping, envKey) => { if (envKey.startsWith(prefix)) { - mapping[`process.env.${envKey.replace(prefix, "")}`] = JSON.stringify(parsed[envKey]); + mapping[`process.env.${envKey.replace(prefix, "")}`] = parsed[envKey]; } return mapping; - }, {}))); -})(); + }, {}); + plugins.push(new webpack.DefinePlugin(resolvedClientSide)); +} + +transferEnvironmentVariables(); module.exports = { mode: 'development', -- cgit v1.2.3-70-g09d2 From 28985a26b4f852dffeb02a43d135776314a1f600 Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Fri, 15 May 2020 17:58:30 -0700 Subject: undoing env fixes lol --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js index 1351008ea..737882fe2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,7 +26,7 @@ function transferEnvironmentVariables() { } const resolvedClientSide = Object.keys(parsed).reduce((mapping, envKey) => { if (envKey.startsWith(prefix)) { - mapping[`process.env.${envKey.replace(prefix, "")}`] = parsed[envKey]; + mapping[`process.env.${envKey.replace(prefix, "")}`] = JSON.stringify(parsed[envKey]); } return mapping; }, {}); -- cgit v1.2.3-70-g09d2 From b9a3c4adb81b38f550f0ab18be5c40a38aea4597 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Fri, 15 May 2020 20:59:35 -0400 Subject: cleaned up frame animation buttons. Added server code for https? removed unused devserver from webpack.config --- .../collectionFreeForm/CollectionFreeFormView.scss | 18 ++++++ .../collectionFreeForm/CollectionFreeFormView.tsx | 6 +- src/server/server_Initialization.ts | 17 +++++ webpack.config.js | 74 +++++++++------------- 4 files changed, 69 insertions(+), 46 deletions(-) (limited to 'webpack.config.js') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss index 60c39c825..7a84fcde1 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss @@ -41,6 +41,24 @@ // touch action none means that the browser will handle none of the touch actions. this allows us to implement our own actions. touch-action: none; + .fwdKeyframe, .numKeyframe, .backKeyframe{ + cursor: pointer; + position: absolute; + width: 20; + height:20; + bottom:0; + background:gray; + } + .backKeyframe { + right:45; + } + .numKeyframe { + right:25; + } + .fwdKeyframe { + right:5; + } + .collectionfreeformview-placeholder { background: gray; width: 100%; diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 751ee03d2..4be671a76 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1352,13 +1352,13 @@ export class CollectionFreeFormView extends CollectionSubView {this.isAnnotationOverlay ? (null) : <> -
+
-
+
{NumCast(this.props.Document.timecode)}
-
+
} diff --git a/src/server/server_Initialization.ts b/src/server/server_Initialization.ts index 4b3094616..14b0dedc3 100644 --- a/src/server/server_Initialization.ts +++ b/src/server/server_Initialization.ts @@ -53,6 +53,23 @@ export default async function InitializeServer(routeSetter: RouteSetter) { logPort("server", serverPort); console.log(); }); + + // var express = require('express') + // var fs = require('fs') + // var https = require('https') + // var app = express() + + // app.get('/', function (req, res) { + // res.send('hello world') + // }) + + // https.createServer({ + // key: fs.readFileSync('server.key'), + // cert: fs.readFileSync('server.cert') + // }, app) + // .listen(3000, function () { + // console.log('Example app listening on port 3000! Go to https://localhost:3000/') + // }) disconnect = async () => new Promise(resolve => server.close(resolve)); return isRelease; diff --git a/webpack.config.js b/webpack.config.js index 67d492e1f..480ed7aa3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -63,57 +63,45 @@ module.exports = { }, module: { rules: [{ - test: [/\.tsx?$/], - use: [{ - loader: 'ts-loader', - options: { - transpileOnly: true - } - }] + test: [/\.tsx?$/], + use: [{ + loader: 'ts-loader', + options: { + transpileOnly: true + } + }] + }, + { + test: /\.scss|css$/, + use: [{ + loader: "style-loader" }, { - test: /\.scss|css$/, - use: [{ - loader: "style-loader" - }, - { - loader: "css-loader" - }, - { - loader: "sass-loader" - } - ] + loader: "css-loader" }, { - test: /\.(jpg|png|pdf)$/, - use: [{ - loader: 'file-loader' - }] - }, - { - test: /\.(png|jpg|gif)$/i, - use: [{ - loader: 'url-loader', - options: { - limit: 8192 - } - }] + loader: "sass-loader" } + ] + }, + { + test: /\.(jpg|png|pdf)$/, + use: [{ + loader: 'file-loader' + }] + }, + { + test: /\.(png|jpg|gif)$/i, + use: [{ + loader: 'url-loader', + options: { + limit: 8192 + } + }] + } ] }, plugins, - devServer: { - compress: false, - host: "localhost", - contentBase: path.join(__dirname, 'deploy'), - port: 4321, - hot: true, - https: false, - overlay: { - warnings: true, - errors: true - } - }, externals: [ 'child_process' ] -- cgit v1.2.3-70-g09d2