From c36736b9b82ad6282c5a112f7325c642c4641d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Tue, 31 May 2016 02:58:52 +0200 Subject: [PATCH 1/5] Disable compiler watch, not needed for production --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 594d254..fe05d06 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, - "watch": true + "watch": false }, "filesGlob": [ "./server.ts", From 9be3f5482a3e288087e118119131e909574b8c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Tue, 31 May 2016 03:24:22 +0200 Subject: [PATCH 2/5] Fixes type error on compile --- server/services/documentService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/services/documentService.ts b/server/services/documentService.ts index 048807b..c705f1d 100644 --- a/server/services/documentService.ts +++ b/server/services/documentService.ts @@ -217,7 +217,7 @@ export class DocumentService { lines[fromLine]._raw = beginning + diff.text[0] + end; } else { lines[fromLine]._raw = beginning + diff.text[0]; - for (var i = 1; i < diff.text.length - 1; i++) { + for (let i: any = 1; i < diff.text.length - 1; i++) { lines.splice(fromLine + i, 0, { _raw: diff.text[i], _metadata: [] }) } lines.splice(toLine + diff.text.length - 1, 0, { _raw: diff.text[diff.text.length - 1] + end, _metadata: [] }) @@ -225,7 +225,7 @@ export class DocumentService { } else if (fromLine != toLine) { lines.splice(fromLine + 1, (toLine - fromLine)); lines[fromLine]._raw = beginning + diff.text[0]; - for (var i = 1; i < diff.text.length - 1; i++) { + for (let i: any; i < diff.text.length - 1; i++) { lines.splice(i, 0, { _raw: diff.text[i], _metadata: [] }) } if (diff.text.length != 1) { From 2eb0715b2b57a8f161e366a7fbfa7d167d71fb7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Tue, 31 May 2016 04:46:10 +0200 Subject: [PATCH 3/5] Add option to set ip of websocket-server, useful in development --- server.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/server.ts b/server.ts index e055fa0..f0127da 100644 --- a/server.ts +++ b/server.ts @@ -34,6 +34,7 @@ var documentRoutes = require('./server/resources/document'); var indexroutes = require('./server/resources/index') var wsPort: number = process.env.PORT || 3001; +var wsIp: string = process.env.IP || 'localhost'; var databaseUrl: string = 'localhost'; var httpPort = 3000; @@ -133,9 +134,13 @@ app.get('/documents/:documentid/:chapterIndex', (req, res) => { }) app.get('/wsip', (req, res) => { - publicIp.v4((err, ip) => { - res.jsonp({ ip: ip, httpPort: httpPort, wsPort: wsPort }) - }); + if(!process.env.prod) { + publicIp.v4((err, ip) => { + res.jsonp({ ip: ip, httpPort: httpPort, wsPort: wsPort }); + }); + } else { + res.jsonp({ ip: wsIp, httpPort: httpPort, wsPort: wsPort }); + } }) app.get('/*', indexroutes.index); From b086740750db23b75fad1c8ace6b401e375b32af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Tue, 31 May 2016 06:21:03 +0200 Subject: [PATCH 4/5] fix inconsistent language --- public/views/modals/imageuploader.html | 2 +- public/views/modals/pluginuploader.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/views/modals/imageuploader.html b/public/views/modals/imageuploader.html index ca5a1db..20cfb59 100644 --- a/public/views/modals/imageuploader.html +++ b/public/views/modals/imageuploader.html @@ -2,7 +2,7 @@ -

Images

+

Uploaded images

diff --git a/public/views/modals/pluginuploader.html b/public/views/modals/pluginuploader.html index 5107c71..556340e 100644 --- a/public/views/modals/pluginuploader.html +++ b/public/views/modals/pluginuploader.html @@ -1,11 +1,11 @@ -

Last opp plugin

+

Upload plugin

- + From e0baefc384463e710583ca618be9f6bf4fd67fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Tue, 31 May 2016 06:26:45 +0200 Subject: [PATCH 5/5] add documentation for using docker --- docs/running.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/running.md b/docs/running.md index 55382ee..51ee4f6 100644 --- a/docs/running.md +++ b/docs/running.md @@ -38,3 +38,5 @@ Note: All commands entered need to be performed from within *this directory*. ``` 8. Open Google Chrome or Mozilla Firefox and navigate to `http://localhost:3000/` to access the app. + +### Alternatively - you can use [docker](https://github.com/zalox/docker-images/tree/master/Texd)