Web: Doceditor: added ejs

This commit is contained in:
Artem Tarasov 2022-07-13 14:08:20 +03:00
parent 776c0874d1
commit 1e321859d7
3 changed files with 379 additions and 60 deletions

View File

@ -12,10 +12,9 @@
"build:dev-client": "webpack --config webpack/dev/webpack.dev.client.js",
"build": "yarn clean && yarn build:client && yarn build:server",
"start:watch-client": "webpack --config webpack/dev/webpack.dev.client.js --watch --no-cache",
"start:watch-server": "webpack --config webpack/dev/webpack.dev.server.js ",
"start:server": "yarn build:dev-client && yarn build:dev-server && nodemon --watch dist/server.js --exec node dist/server.js",
"start-dev": "npm-run-all --parallel start:*",
"start-test": "shx rm -rf dist && webpack --mode=development --config webpack/dev/webpack.dev.server.js --config webpack/dev/webpack.dev.client.js && nodemon --watch dist/server.js --exec node dist/server.js"
"start:server": "nodemon --watch src --exec cross-env NODE_ENV=development node src/server/index.js",
"start-dev": "shx rm -rf dist && npm-run-all --parallel start:*",
"start-test": "shx rm -rf dist && webpack --mode=development --config webpack/dev/webpack.dev.client.js && yarn start:server"
},
"devDependencies": {
"@babel/core": "^7.18.6",
@ -24,6 +23,7 @@
"@babel/plugin-transform-runtime": "^7.18.6",
"@babel/preset-env": "^7.14.4",
"@babel/preset-react": "^7.13.13",
"@babel/register": "^7.18.6",
"@loadable/babel-plugin": "^5.13.2",
"@loadable/component": "^5.15.2",
"@loadable/server": "^5.15.2",
@ -33,10 +33,12 @@
"babel-plugin-styled-components": "^1.12.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"dotenv": "^16.0.1",
"external-remotes-plugin": "^1.0.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "5.3.2",
"json-loader": "^0.5.7",
"nodemon": "^2.0.7",
"npm-run-all": "^4.1.5",
@ -47,10 +49,11 @@
"style-loader": "^3.3.1",
"styled-components": "^5.3.5",
"terser-webpack-plugin": "^5.1.2",
"webpack": "5.52.0",
"webpack-cli": "4.9.2",
"webpack": "5.52.1",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.3.1",
"webpack-hot-middleware": "^2.25.0",
"webpack-manifest-plugin": "^5.0.0",
"webpack-merge": "^5.7.3",
"webpack-node-externals": "^3.0.0"
},
@ -58,6 +61,7 @@
"title": "ONLYOFFICE",
"dependencies": {
"compression": "^1.7.4",
"ejs": "^3.1.8",
"express": "^4.18.1",
"i18next-express-middleware": "^2.0.0",
"i18next-fs-backend": "^1.1.4"

View File

@ -0,0 +1,348 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no, viewport-fit=cover"
/>
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link id="favicon" rel="shortcut icon" sizes="any" href="/favicon.ico" />
<link rel="manifest" href="/manifest.json" />
<!-- Tell the browser it's a PWA -->
<!-- <meta name="mobile-web-app-capable" content="yes" /> -->
<!-- Tell iOS it's a PWA -->
<!-- <meta name="apple-mobile-web-app-capable" content="yes" /> -->
<link rel="apple-touch-icon" href="/appIcon-180.png" />
<style type="text/css">
.loadmask {
left: 0;
top: 0;
position: absolute;
height: 100%;
width: 100%;
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 1001;
}
.loader-page {
width: 100%;
height: 170px;
bottom: 42%;
position: absolute;
text-align: center;
line-height: 10px;
margin-bottom: 20px;
}
.loader-page-romb {
width: 40px;
display: inline-block;
}
.romb {
width: 40px;
height: 40px;
position: absolute;
background: red;
border-radius: 6px;
-webkit-transform: rotate(135deg) skew(20deg, 20deg);
-moz-transform: rotate(135deg) skew(20deg, 20deg);
-ms-transform: rotate(135deg) skew(20deg, 20deg);
-o-transform: rotate(135deg) skew(20deg, 20deg);
-webkit-animation: movedown 3s infinite ease;
-moz-animation: movedown 3s infinite ease;
-ms-animation: movedown 3s infinite ease;
-o-animation: movedown 3s infinite ease;
animation: movedown 3s infinite ease;
}
#blue {
z-index: 3;
background: #55bce6;
-webkit-animation-name: blue;
-moz-animation-name: blue;
-ms-animation-name: blue;
-o-animation-name: blue;
animation-name: blue;
}
#red {
z-index: 1;
background: #de7a59;
-webkit-animation-name: red;
-moz-animation-name: red;
-ms-animation-name: red;
-o-animation-name: red;
animation-name: red;
}
#green {
z-index: 2;
background: #a1cb5c;
-webkit-animation-name: green;
-moz-animation-name: green;
-ms-animation-name: green;
-o-animation-name: green;
animation-name: green;
}
@-webkit-keyframes red {
0% {
top: 120px;
background: #de7a59;
}
10% {
top: 120px;
background: #f2cbbf;
}
14% {
background: #f4f4f4;
top: 120px;
}
15% {
background: #f4f4f4;
top: 0;
}
20% {
background: #e6e4e4;
}
30% {
background: #d2d2d2;
}
40% {
top: 120px;
}
100% {
top: 120px;
background: #de7a59;
}
}
@keyframesred {
0% {
top: 120px;
background: #de7a59;
}
10% {
top: 120px;
background: #f2cbbf;
}
14% {
background: #f4f4f4;
top: 120px;
}
15% {
background: #f4f4f4;
top: 0;
}
20% {
background: #e6e4e4;
}
30% {
background: #d2d2d2;
}
40% {
top: 120px;
}
100% {
top: 120px;
background: #de7a59;
}
}
@-webkit-keyframes green {
0% {
top: 110px;
background: #a1cb5c;
opacity: 1;
}
10% {
top: 110px;
background: #cbe0ac;
opacity: 1;
}
14% {
background: #f4f4f4;
top: 110px;
opacity: 1;
}
15% {
background: #f4f4f4;
top: 0;
opacity: 1;
}
20% {
background: #f4f4f4;
top: 0;
opacity: 0;
}
25% {
background: #efefef;
top: 0;
opacity: 1;
}
30% {
background: #e6e4e4;
}
70% {
top: 110px;
}
100% {
top: 110px;
background: #a1cb5c;
}
}
@keyframes green {
0% {
top: 110px;
background: #a1cb5c;
opacity: 1;
}
10% {
top: 110px;
background: #cbe0ac;
opacity: 1;
}
14% {
background: #f4f4f4;
top: 110px;
opacity: 1;
}
15% {
background: #f4f4f4;
top: 0;
opacity: 1;
}
20% {
background: #f4f4f4;
top: 0;
opacity: 0;
}
25% {
background: #efefef;
top: 0;
opacity: 1;
}
30% {
background: #e6e4e4;
}
70% {
top: 110px;
}
100% {
top: 110px;
background: #a1cb5c;
}
}
@-webkit-keyframes blue {
0% {
top: 100px;
background: #55bce6;
opacity: 1;
}
10% {
top: 100px;
background: #bfe8f8;
opacity: 1;
}
14% {
background: #f4f4f4;
top: 100px;
opacity: 1;
}
15% {
background: #f4f4f4;
top: 0;
opacity: 1;
}
20% {
background: #f4f4f4;
top: 0;
opacity: 0;
}
25% {
background: #f4f4f4;
top: 0;
opacity: 0;
}
45% {
background: #efefef;
top: 0;
opacity: 0.2;
}
100% {
top: 100px;
background: #55bce6;
}
}
@keyframes blue {
0% {
top: 100px;
background: #55bce6;
opacity: 1;
}
10% {
top: 100px;
background: #bfe8f8;
opacity: 1;
}
14% {
background: #f4f4f4;
top: 100px;
opacity: 1;
}
15% {
background: #f4f4f4;
top: 0;
opacity: 1;
}
20% {
background: #f4f4f4;
top: 0;
opacity: 0;
}
25% {
background: #fff;
top: 0;
opacity: 0;
}
45% {
background: #efefef;
top: 0;
opacity: 0.2;
}
100% {
top: 100px;
background: #55bce6;
}
}
</style>
<title><%- title %></title>
</head>
<body>
<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="loader" class="loadmask">
<div class="loader-page">
<div class="loader-page-romb">
<div class="romb" id="blue"></div>
<div class="romb" id="green"></div>
<div class="romb" id="red"></div>
</div>
</div>
</div>
<div id="root"><%- component %></div>
<script defer="defer" src="<%= assets["client.js"] %>"></script>
<script defer="defer" src="<%= assets["runtime.js"] %>"></script>
<script defer="defer" src="<%= assets["vendor.js"] %>"></script>
<script>
window.__ASC_INITIAL_STATE__ = JSON.parse(`<%- parsedInitialState%>`);
const initialI18nStore = `<%- parsedI18nStore%>`
window.initialI18nStore = JSON.parse(initialI18nStore);
window.initialLanguage = '<%- initialLanguage%>';
const tempElm = document.getElementById("loader");
tempElm.style.backgroundColor =
localStorage.theme === "Dark" ? "#333333" : "#f4f4f4";
console.log("It's Editor INIT");
</script>
</body>
</html>

View File

@ -1288,7 +1288,7 @@
"@babel/helper-validator-option" "^7.18.6"
"@babel/plugin-transform-typescript" "^7.18.6"
"@babel/register@^7.12.1":
"@babel/register@^7.12.1", "@babel/register@^7.18.6":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.18.6.tgz#48a4520f1b2a7d7ac861e8148caeb0cefe6c59db"
integrity sha512-tkYtONzaO8rQubZzpBnvZPFcHgh8D9F55IjOsYton4X2IBoyRn2ZSWQqySTZnUn2guZbxbQiAB27hJEbvXamhQ==
@ -5420,19 +5420,19 @@
"@webassemblyjs/wast-parser" "1.9.0"
"@xtuc/long" "4.2.2"
"@webpack-cli/configtest@^1.1.1", "@webpack-cli/configtest@^1.2.0":
"@webpack-cli/configtest@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5"
integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==
"@webpack-cli/info@^1.4.1", "@webpack-cli/info@^1.5.0":
"@webpack-cli/info@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1"
integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==
dependencies:
envinfo "^7.7.3"
"@webpack-cli/serve@^1.6.1", "@webpack-cli/serve@^1.7.0":
"@webpack-cli/serve@^1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1"
integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==
@ -8181,6 +8181,13 @@ cross-env@^6.0.3:
dependencies:
cross-spawn "^7.0.0"
cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"
cross-fetch@3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
@ -8188,7 +8195,7 @@ cross-fetch@3.1.5:
dependencies:
node-fetch "2.6.7"
cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
@ -9137,7 +9144,7 @@ ee-first@1.1.1:
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
ejs@^3.1.6:
ejs@^3.1.6, ejs@^3.1.8:
version "3.1.8"
resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.8.tgz#758d32910c78047585c7ef1f92f9ee041c1c190b"
integrity sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==
@ -20826,24 +20833,6 @@ webpack-cli@4.10.0:
rechoir "^0.7.0"
webpack-merge "^5.7.3"
webpack-cli@4.9.2:
version "4.9.2"
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.2.tgz#77c1adaea020c3f9e2db8aad8ea78d235c83659d"
integrity sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ==
dependencies:
"@discoveryjs/json-ext" "^0.5.0"
"@webpack-cli/configtest" "^1.1.1"
"@webpack-cli/info" "^1.4.1"
"@webpack-cli/serve" "^1.6.1"
colorette "^2.0.14"
commander "^7.0.0"
execa "^5.0.0"
fastest-levenshtein "^1.0.12"
import-local "^3.0.2"
interpret "^2.2.0"
rechoir "^0.7.0"
webpack-merge "^5.7.3"
webpack-dev-middleware@^3.7.3:
version "3.7.3"
resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz#0639372b143262e2b84ab95d3b91a7597061c2c5"
@ -20920,6 +20909,14 @@ webpack-log@^2.0.0:
ansi-colors "^3.0.0"
uuid "^3.3.2"
webpack-manifest-plugin@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/webpack-manifest-plugin/-/webpack-manifest-plugin-5.0.0.tgz#084246c1f295d1b3222d36e955546433ca8df803"
integrity sha512-8RQfMAdc5Uw3QbCQ/CBV/AXqOR8mt03B6GJmRbhWopE8GzRfEpn+k0ZuWywxW+5QZsffhmFDY1J6ohqJo+eMuw==
dependencies:
tapable "^2.0.0"
webpack-sources "^2.2.0"
webpack-merge@^5.7.3:
version "5.8.0"
resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61"
@ -20990,36 +20987,6 @@ webpack@4:
watchpack "^1.7.4"
webpack-sources "^1.4.1"
webpack@5.52.0:
version "5.52.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.52.0.tgz#88d997c2c3ebb62abcaa453d2a26e0fd917c71a3"
integrity sha512-yRZOat8jWGwBwHpco3uKQhVU7HYaNunZiJ4AkAVQkPCUGoZk/tiIXiwG+8HIy/F+qsiZvSOa+GLQOj3q5RKRYg==
dependencies:
"@types/eslint-scope" "^3.7.0"
"@types/estree" "^0.0.50"
"@webassemblyjs/ast" "1.11.1"
"@webassemblyjs/wasm-edit" "1.11.1"
"@webassemblyjs/wasm-parser" "1.11.1"
acorn "^8.4.1"
acorn-import-assertions "^1.7.6"
browserslist "^4.14.5"
chrome-trace-event "^1.0.2"
enhanced-resolve "^5.8.0"
es-module-lexer "^0.7.1"
eslint-scope "5.1.1"
events "^3.2.0"
glob-to-regexp "^0.4.1"
graceful-fs "^4.2.4"
json-parse-better-errors "^1.0.2"
loader-runner "^4.2.0"
mime-types "^2.1.27"
neo-async "^2.6.2"
schema-utils "^3.1.0"
tapable "^2.1.1"
terser-webpack-plugin "^5.1.3"
watchpack "^2.2.0"
webpack-sources "^3.2.0"
webpack@5.52.1:
version "5.52.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.52.1.tgz#2dc1d9029ecb7acfb80da7bf67baab67baa517a7"