{knot}
diff --git a/src/adonisjs/public/themes/jacinto/css/player.css b/src/adonisjs/public/player/css/player.css
similarity index 100%
rename from src/adonisjs/public/themes/jacinto/css/player.css
rename to src/adonisjs/public/player/css/player.css
diff --git a/src/adonisjs/public/player/images/ampliacao-eletro.gif b/src/adonisjs/public/player/images/ampliacao-eletro.gif
new file mode 100644
index 000000000..d1e8a47a1
Binary files /dev/null and b/src/adonisjs/public/player/images/ampliacao-eletro.gif differ
diff --git a/src/adonisjs/public/player/images/bubble-landscape.png b/src/adonisjs/public/player/images/bubble-landscape.png
new file mode 100644
index 000000000..2836a2680
Binary files /dev/null and b/src/adonisjs/public/player/images/bubble-landscape.png differ
diff --git a/src/adonisjs/public/player/images/bubble-portrait.png b/src/adonisjs/public/player/images/bubble-portrait.png
new file mode 100644
index 000000000..f3e856449
Binary files /dev/null and b/src/adonisjs/public/player/images/bubble-portrait.png differ
diff --git a/src/adonisjs/public/player/images/call-the-supervisor.svg b/src/adonisjs/public/player/images/call-the-supervisor.svg
new file mode 100644
index 000000000..8e8f19609
--- /dev/null
+++ b/src/adonisjs/public/player/images/call-the-supervisor.svg
@@ -0,0 +1,88 @@
+
+
+
+
diff --git a/src/adonisjs/public/player/images/case-forklift.png b/src/adonisjs/public/player/images/case-forklift.png
new file mode 100644
index 000000000..4dc882a1c
Binary files /dev/null and b/src/adonisjs/public/player/images/case-forklift.png differ
diff --git a/src/adonisjs/public/player/images/doctor-icon.png b/src/adonisjs/public/player/images/doctor-icon.png
new file mode 100644
index 000000000..3b373e0d2
Binary files /dev/null and b/src/adonisjs/public/player/images/doctor-icon.png differ
diff --git a/src/adonisjs/public/player/images/doctor.png b/src/adonisjs/public/player/images/doctor.png
new file mode 100644
index 000000000..a8c9ec3c1
Binary files /dev/null and b/src/adonisjs/public/player/images/doctor.png differ
diff --git a/src/adonisjs/public/player/images/ebm-clinical-history-aortic-dissection.png b/src/adonisjs/public/player/images/ebm-clinical-history-aortic-dissection.png
new file mode 100644
index 000000000..8b6771e8a
Binary files /dev/null and b/src/adonisjs/public/player/images/ebm-clinical-history-aortic-dissection.png differ
diff --git a/src/adonisjs/public/player/images/ebm-clinical-history-myocardial-infarction.png b/src/adonisjs/public/player/images/ebm-clinical-history-myocardial-infarction.png
new file mode 100644
index 000000000..8fc37278d
Binary files /dev/null and b/src/adonisjs/public/player/images/ebm-clinical-history-myocardial-infarction.png differ
diff --git a/src/adonisjs/public/player/images/ebm-pericarditis.png b/src/adonisjs/public/player/images/ebm-pericarditis.png
new file mode 100644
index 000000000..c7d64448f
Binary files /dev/null and b/src/adonisjs/public/player/images/ebm-pericarditis.png differ
diff --git a/src/adonisjs/public/player/images/ebm-physical-examination-aortic-dissection.png b/src/adonisjs/public/player/images/ebm-physical-examination-aortic-dissection.png
new file mode 100644
index 000000000..1d05f5eee
Binary files /dev/null and b/src/adonisjs/public/player/images/ebm-physical-examination-aortic-dissection.png differ
diff --git a/src/adonisjs/public/player/images/ebm-physical-examination-myocardial-infarction.png b/src/adonisjs/public/player/images/ebm-physical-examination-myocardial-infarction.png
new file mode 100644
index 000000000..a75ec55a7
Binary files /dev/null and b/src/adonisjs/public/player/images/ebm-physical-examination-myocardial-infarction.png differ
diff --git a/src/adonisjs/public/player/images/ebm-pulmonary-embolism-wells-criteria.png b/src/adonisjs/public/player/images/ebm-pulmonary-embolism-wells-criteria.png
new file mode 100644
index 000000000..f076c096e
Binary files /dev/null and b/src/adonisjs/public/player/images/ebm-pulmonary-embolism-wells-criteria.png differ
diff --git a/src/adonisjs/public/player/images/ekg-description.png b/src/adonisjs/public/player/images/ekg-description.png
new file mode 100644
index 000000000..60941ed93
Binary files /dev/null and b/src/adonisjs/public/player/images/ekg-description.png differ
diff --git a/src/adonisjs/public/player/images/ekg-detail-01.png b/src/adonisjs/public/player/images/ekg-detail-01.png
new file mode 100644
index 000000000..4286bccd2
Binary files /dev/null and b/src/adonisjs/public/player/images/ekg-detail-01.png differ
diff --git a/src/adonisjs/public/player/images/ekg-detail-02.png b/src/adonisjs/public/player/images/ekg-detail-02.png
new file mode 100644
index 000000000..d5ae3b77a
Binary files /dev/null and b/src/adonisjs/public/player/images/ekg-detail-02.png differ
diff --git a/src/adonisjs/public/player/images/ekg.png b/src/adonisjs/public/player/images/ekg.png
new file mode 100644
index 000000000..2953a82ce
Binary files /dev/null and b/src/adonisjs/public/player/images/ekg.png differ
diff --git a/src/adonisjs/public/player/images/entrance.jpg b/src/adonisjs/public/player/images/entrance.jpg
new file mode 100644
index 000000000..1dd4be7c5
Binary files /dev/null and b/src/adonisjs/public/player/images/entrance.jpg differ
diff --git a/src/adonisjs/public/player/images/generate-hypothesis.svg b/src/adonisjs/public/player/images/generate-hypothesis.svg
new file mode 100644
index 000000000..57d31831d
--- /dev/null
+++ b/src/adonisjs/public/player/images/generate-hypothesis.svg
@@ -0,0 +1,89 @@
+
+
+
+
diff --git a/src/adonisjs/public/player/images/hospital-background.png b/src/adonisjs/public/player/images/hospital-background.png
new file mode 100644
index 000000000..7f64e05c0
Binary files /dev/null and b/src/adonisjs/public/player/images/hospital-background.png differ
diff --git a/src/adonisjs/public/player/images/icon-back.svg b/src/adonisjs/public/player/images/icon-back.svg
new file mode 100644
index 000000000..63a7be8ba
--- /dev/null
+++ b/src/adonisjs/public/player/images/icon-back.svg
@@ -0,0 +1,77 @@
+
+
+
+
diff --git a/src/adonisjs/public/player/images/jacinto-icon.png b/src/adonisjs/public/player/images/jacinto-icon.png
new file mode 100644
index 000000000..1662c3c41
Binary files /dev/null and b/src/adonisjs/public/player/images/jacinto-icon.png differ
diff --git a/src/adonisjs/public/player/images/jacinto.png b/src/adonisjs/public/player/images/jacinto.png
new file mode 100644
index 000000000..4f4a65fbd
Binary files /dev/null and b/src/adonisjs/public/player/images/jacinto.png differ
diff --git a/src/adonisjs/public/player/images/more-information.svg b/src/adonisjs/public/player/images/more-information.svg
new file mode 100644
index 000000000..637071ce6
--- /dev/null
+++ b/src/adonisjs/public/player/images/more-information.svg
@@ -0,0 +1,80 @@
+
+
+
+
diff --git a/src/adonisjs/public/player/images/nurse-icon.png b/src/adonisjs/public/player/images/nurse-icon.png
new file mode 100644
index 000000000..54bbf995f
Binary files /dev/null and b/src/adonisjs/public/player/images/nurse-icon.png differ
diff --git a/src/adonisjs/public/player/images/nurse.png b/src/adonisjs/public/player/images/nurse.png
new file mode 100644
index 000000000..3e578849d
Binary files /dev/null and b/src/adonisjs/public/player/images/nurse.png differ
diff --git a/src/adonisjs/public/player/images/nurse_agnes.png b/src/adonisjs/public/player/images/nurse_agnes.png
new file mode 100644
index 000000000..f4ab542d0
Binary files /dev/null and b/src/adonisjs/public/player/images/nurse_agnes.png differ
diff --git a/src/adonisjs/public/player/images/patient-icon.png b/src/adonisjs/public/player/images/patient-icon.png
new file mode 100644
index 000000000..920ac87ab
Binary files /dev/null and b/src/adonisjs/public/player/images/patient-icon.png differ
diff --git a/src/adonisjs/public/player/images/patient-in-bed.svg b/src/adonisjs/public/player/images/patient-in-bed.svg
new file mode 100644
index 000000000..207440247
--- /dev/null
+++ b/src/adonisjs/public/player/images/patient-in-bed.svg
@@ -0,0 +1,178 @@
+
+
+
\ No newline at end of file
diff --git a/src/adonisjs/public/player/images/patient.png b/src/adonisjs/public/player/images/patient.png
new file mode 100644
index 000000000..899415e23
Binary files /dev/null and b/src/adonisjs/public/player/images/patient.png differ
diff --git a/src/adonisjs/public/player/images/patient_jakob.png b/src/adonisjs/public/player/images/patient_jakob.png
new file mode 100644
index 000000000..4e49da7ad
Binary files /dev/null and b/src/adonisjs/public/player/images/patient_jakob.png differ
diff --git a/src/adonisjs/public/player/images/supervisor_harry.png b/src/adonisjs/public/player/images/supervisor_harry.png
new file mode 100644
index 000000000..ce0c3dc1e
Binary files /dev/null and b/src/adonisjs/public/player/images/supervisor_harry.png differ
diff --git a/src/adonisjs/public/player/images/tablet.svg b/src/adonisjs/public/player/images/tablet.svg
new file mode 100644
index 000000000..efb362a82
--- /dev/null
+++ b/src/adonisjs/public/player/images/tablet.svg
@@ -0,0 +1,66 @@
+
+
+
+
diff --git a/src/adonisjs/public/player/index.html b/src/adonisjs/public/player/index.html
index a5cf84f37..8a7232fc9 100644
--- a/src/adonisjs/public/player/index.html
+++ b/src/adonisjs/public/player/index.html
@@ -5,35 +5,37 @@
Player
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
diff --git a/src/adonisjs/public/player/js/dcc-player-server-env.js b/src/adonisjs/public/player/js/dcc-player-server-env.js
index 4e738bb79..63771b8cd 100644
--- a/src/adonisjs/public/player/js/dcc-player-server-env.js
+++ b/src/adonisjs/public/player/js/dcc-player-server-env.js
@@ -1,3 +1,3 @@
(function() {
- DCCPlayerServer.storePrefix = "casenote_";
+ DCCPlayerServer.localEnv = false;
})();
\ No newline at end of file
diff --git a/src/adonisjs/public/player/js/dcc-player-server-proxy.js b/src/adonisjs/public/player/js/dcc-player-server-proxy.js
index df8357add..e1ceaeaf3 100644
--- a/src/adonisjs/public/player/js/dcc-player-server-proxy.js
+++ b/src/adonisjs/public/player/js/dcc-player-server-proxy.js
@@ -8,13 +8,17 @@ class DCCPlayerServer {
* *************
*/
+ /*
getCaseId() {
return DCCPlayerServer.playerObj.id;
}
+ */
+ /*
getStartKnot() {
return DCCPlayerServer.playerObj.start;
}
+ */
loadKnot(knotName) {
if (DCCPlayerServer.localEnv) {
@@ -25,7 +29,6 @@ class DCCPlayerServer {
}
}
-
/*
@@ -33,25 +36,24 @@ class DCCPlayerServer {
* *********************
*/
- generateRunningCase() {
- const caseid = this.getCaseId();
- const profile = this.getCurrentProfile();
+ generateRunningCase(userid, caseid) {
+ // const profile = this.getCurrentProfile();
const currentDateTime = new Date();
const caseuid = this.generateUID();
- const casekey = profile.id + "#" + caseid + "#" + caseuid;
- profile.cases.push(casekey);
- this.setProfile(profile);
- this.setRunningCasekey(casekey);
+ // const casekey = profile.id + "#" + caseid + "#" + caseuid;
+ // profile.cases.push(casekey);
+ // this.setProfile(profile);
+ // this.setRunningCasekey(casekey);
const casetrack = {
- userid : profile.id,
+ userid : userid,
caseid : caseid,
start : currentDateTime.toJSON(),
inputs : {},
route : []
};
- this.setCaseInstance(casekey, casetrack);
+ // this.setCaseInstance(casekey, casetrack);
return {runningId: caseuid, track: casetrack};
}
diff --git a/src/adonisjs/public/player/js/player.js b/src/adonisjs/public/player/js/player.js
index 6bf80621b..b02609d05 100644
--- a/src/adonisjs/public/player/js/player.js
+++ b/src/adonisjs/public/player/js/player.js
@@ -12,8 +12,8 @@ class PlayerManager {
constructor() {
this._server = new DCCPlayerServer();
this._tracker = new Tracker();
- this._state = new PlayState();
this._history = [];
+ this._translator = new Translator();
this.controlEvent = this.controlEvent.bind(this);
MessageBus.ext.subscribe("control/#", this.controlEvent);
@@ -56,17 +56,20 @@ class PlayerManager {
case "knot/ 0) {
this._history.pop();
const last = this._history[this._history.length - 1];
- this.loadKnot(last);
+ this.knotLoad(last);
}
break;
case "knot/< Improve the strategy
if (this._currentKnot == "entry")
@@ -215,7 +253,9 @@ class PlayerManager {
startCase() {
if (!PlayerManager.isCapsule) {
//
this._runningCase is provisory
- const runningCase = this._server.generateRunningCase();
+ const runningCase =
+ this._server.generateRunningCase(this._userid,
+ this._currentCaseId);
// console.log("************* Running case");
// console.log(runningCase);
diff --git a/src/adonisjs/public/author/icons/mono-slide.svg b/src/adonisjs/public/resources/icons/mono-slide.svg
similarity index 100%
rename from src/adonisjs/public/author/icons/mono-slide.svg
rename to src/adonisjs/public/resources/icons/mono-slide.svg
diff --git a/src/adonisjs/public/templates/basic/picture_up_left.md b/src/adonisjs/public/templates/basic/picture_up_left.md
new file mode 100644
index 000000000..f7b84b5c4
--- /dev/null
+++ b/src/adonisjs/public/templates/basic/picture_up_left.md
@@ -0,0 +1,5 @@
+# Knot (picture_up_left)
+
+![Landscape](templates/landscape.svg)
+
+Text of the scene.
\ No newline at end of file
diff --git a/src/adonisjs/public/templates/basic/picture_up_left.png b/src/adonisjs/public/templates/basic/picture_up_left.png
new file mode 100644
index 000000000..9435b8dfb
Binary files /dev/null and b/src/adonisjs/public/templates/basic/picture_up_left.png differ
diff --git a/src/adonisjs/public/templates/templates.json b/src/adonisjs/public/templates/templates.json
new file mode 100644
index 000000000..493d62826
--- /dev/null
+++ b/src/adonisjs/public/templates/templates.json
@@ -0,0 +1,4 @@
+{"Picture Up-Left":
+ {"description": "Template with a picture in the up-left corner.",
+ "path": "basic/picture_up_left"}
+}
\ No newline at end of file
diff --git a/src/adonisjs/public/themes/README.md b/src/adonisjs/public/themes/README.md
index 994b92d6f..84b78e7ab 100644
--- a/src/adonisjs/public/themes/README.md
+++ b/src/adonisjs/public/themes/README.md
@@ -1,10 +1,12 @@
-# Templates
+# Themes
-Templates are organized in template families or family sets. Each family has a subdirectory and they are exclusive alternatives, i.e., only one template family can be used in each translation.
+Themes are organized in theme families or family sets. Each family has a subdirectory and they are exclusive alternatives, i.e., only one theme family can be used in each translation.
The families currently available are:
* **classic** - Minimal template without extra format.
-* **jacinto** - Standard template for Jacinto cases.
+* **jacinto** - The standard template for the Jacinto cases.
+
+* **zombie** - The standard template for the Zombie Health cases.
Each template family has a HTML file for each available knot category. There is always a dafault `knot.html` template used for those knots that do not specify a category, or those that specify unknown categories.
diff --git a/src/adonisjs/public/themes/classic/css/player.css b/src/adonisjs/public/themes/classic/css/player.css
deleted file mode 100644
index 77f2fa67a..000000000
--- a/src/adonisjs/public/themes/classic/css/player.css
+++ /dev/null
@@ -1,68 +0,0 @@
-@charset "UTF-8";
-
-body {
- font-family: "Trebuchet MS", Helvetica, sans-serif;
- font-size: 14pt;
-}
-
-.std-border {
- border: 1px solid lightgray;
- border-radius: 5px;
- margin: 5px;
-}
-
-.sty-main-panel {
- /* the main box (body) occupies all the visible area */
- position: absolute;
- left: 0px;
- right: 0px;
- top: 0px;
- bottom: 0px;
-
- /* eliminate margins etc. */
- margin: 0px;
- padding: 0px;
- border-width: 0px;
-
- display: flex;
- flex-direction: column;
-}
-
-.sty-control-panel {
- flex: 10%;
- max-height: 48px;
- display: flex;
- flex-direction: row;
-}
-
-.control-button {
- flex: 10%;
- max-width: 48px;
- max-height: 48px;
- margin-right: 10px;
-}
-
-.sty-work-panel {
- flex: 90%;
- height: 90%;
- max-height: 90%;
- height: 100%;
- display: flex;
-}
-
-@media (orientation: landscape) {
- .work-panel {
- flex-direction: row;
- }
-}
-
-@media (orientation: portrait) {
- .work-panel {
- flex-direction: column;
- }
-}
-
-.sty-knot-panel {
- flex: 90%;
- max-height: 100%;
-}
diff --git a/src/adonisjs/public/themes/classic/css/templates.css b/src/adonisjs/public/themes/classic/css/templates.css
index fc21ec986..a302dc04a 100644
--- a/src/adonisjs/public/themes/classic/css/templates.css
+++ b/src/adonisjs/public/themes/classic/css/templates.css
@@ -1,5 +1,24 @@
@charset "UTF-8";
+/* picture-up-left
+ *****************/
+
+.tsty-pul-main {
+ width: 100%;
+ height: 100%;
+ font-size: 5vh;
+}
+
+.tsty-pul-main img {
+ width: 50%;
+ height: 50%;
+ object-fit: contain;
+ float: left;
+ margin-right: 10px;
+ margin-bottom: 10px;
+}
+
+
/* Knot (template) */
/*******************/
diff --git a/src/adonisjs/public/themes/classic/images/mono-slide.svg b/src/adonisjs/public/themes/classic/images/mono-slide.svg
new file mode 100644
index 000000000..526a6ea27
--- /dev/null
+++ b/src/adonisjs/public/themes/classic/images/mono-slide.svg
@@ -0,0 +1,127 @@
+
+
diff --git a/src/adonisjs/public/themes/classic/images/mountain-1849091.ai b/src/adonisjs/public/themes/classic/images/mountain-1849091.ai
new file mode 100644
index 000000000..702f949c1
Binary files /dev/null and b/src/adonisjs/public/themes/classic/images/mountain-1849091.ai differ
diff --git a/src/adonisjs/public/themes/classic/picture_up_left.html b/src/adonisjs/public/themes/classic/picture_up_left.html
new file mode 100644
index 000000000..ba5a00ad0
--- /dev/null
+++ b/src/adonisjs/public/themes/classic/picture_up_left.html
@@ -0,0 +1 @@
+{knot}
\ No newline at end of file
diff --git a/src/adonisjs/public/themes/classic/reset.html b/src/adonisjs/public/themes/classic/reset.html
deleted file mode 100644
index 581c72e86..000000000
--- a/src/adonisjs/public/themes/classic/reset.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
DANGER! Reset Page
-
-
Reset
-
-
\ No newline at end of file
diff --git a/src/adonisjs/public/themes/jacinto/images/mono-slide.svg b/src/adonisjs/public/themes/jacinto/images/mono-slide.svg
new file mode 100644
index 000000000..526a6ea27
--- /dev/null
+++ b/src/adonisjs/public/themes/jacinto/images/mono-slide.svg
@@ -0,0 +1,127 @@
+
+
diff --git a/src/adonisjs/public/themes/jacinto/start.html b/src/adonisjs/public/themes/jacinto/start.html
index 98ecb6bd2..fe4c72dbb 100644
--- a/src/adonisjs/public/themes/jacinto/start.html
+++ b/src/adonisjs/public/themes/jacinto/start.html
@@ -1,2 +1,2 @@
-
+
{knot}
\ No newline at end of file
diff --git a/src/adonisjs/public/themes/themes.json b/src/adonisjs/public/themes/themes.json
new file mode 100644
index 000000000..80bf6b602
--- /dev/null
+++ b/src/adonisjs/public/themes/themes.json
@@ -0,0 +1,13 @@
+{"Classic":
+ {"description": "Minimal theme without extra format.",
+ "path": "classic",
+ "icon": "mono-slide.svg"},
+ "Jacinto":
+ {"description": "The standard theme for the Jacinto cases.",
+ "path": "jacinto",
+ "icon": "mono-slide.svg"},
+ "Zombie":
+ {"description": "The standard theme for the Zombie Health cases.",
+ "path": "zombie",
+ "icon": "mono-slide.svg"}
+}
\ No newline at end of file
diff --git a/src/adonisjs/public/themes/zombie/css/player.css b/src/adonisjs/public/themes/zombie/css/player.css
deleted file mode 100644
index 5c2c21469..000000000
--- a/src/adonisjs/public/themes/zombie/css/player.css
+++ /dev/null
@@ -1,46 +0,0 @@
-@charset "UTF-8";
-
-body {
- font-family: "Trebuchet MS", Helvetica, sans-serif;
- font-size: 14pt;
-}
-
-.sty-main-panel {
- /* the main box (body) occupies all the visible area */
- position: absolute;
- left: 0px;
- right: 0px;
- top: 0px;
- bottom: 0px;
-
- /* eliminate margins etc. */
- margin: 0px;
- padding: 0px;
- border-width: 0px;
-
- display: flex;
- flex-direction: column;
-}
-
-.panel_center {
- position: absolute;
- width: 100%;
- top: 0px;
- bottom: 0px;
- left: 0px;
- right: 0px;
- margin-top: 60px;
- background-color: transparent;
-}
-
-.panel_inner_center {
- position: absolute;
- top: 0px;
- bottom: 0px;
- left: 0px;
- right: 0px;
- margin-left: 10%;
- margin-right: 10%;
- background-color: #fbfcd2;
-}
-
diff --git a/src/adonisjs/public/themes/zombie/images/mono-slide.svg b/src/adonisjs/public/themes/zombie/images/mono-slide.svg
new file mode 100644
index 000000000..526a6ea27
--- /dev/null
+++ b/src/adonisjs/public/themes/zombie/images/mono-slide.svg
@@ -0,0 +1,127 @@
+
+
diff --git a/src/adonisjs/public/translator/expressions/image.png b/src/adonisjs/public/translator/expressions/image.png
new file mode 100644
index 000000000..2a2908e24
Binary files /dev/null and b/src/adonisjs/public/translator/expressions/image.png differ
diff --git a/src/adonisjs/public/translator/item-templates.js b/src/adonisjs/public/translator/item-templates.js
index 6bb9bdf5c..7daa57f12 100644
--- a/src/adonisjs/public/translator/item-templates.js
+++ b/src/adonisjs/public/translator/item-templates.js
@@ -1,5 +1,7 @@
(function() {
Translator.htmlTemplates = {
+image:
+``,
option:
``,
divert:
diff --git a/src/adonisjs/public/translator/translator.js b/src/adonisjs/public/translator/translator.js
index f65eff67c..9e13cb31b 100644
--- a/src/adonisjs/public/translator/translator.js
+++ b/src/adonisjs/public/translator/translator.js
@@ -169,12 +169,12 @@ class Translator {
compileKnotMarkdown(knotSet, knotId) {
const mdToObj = {
knot : this._knotMdToObj,
+ image : this._imageMdToObj,
option : this._optionMdToObj,
divert : this._divertMdToObj,
talk : this._talkMdToObj,
talkopen : this._talkopenMdToObj,
talkclose: this._talkcloseMdToObj,
- // image : this.image,
input : this._inputMdToObj,
selctxopen : this._selctxopenMdToObj,
selctxclose : this._selctxcloseMdToObj,
@@ -325,14 +325,13 @@ class Translator {
*/
generateKnotHTML(knotObj) {
const objToHTML = {
- // knot :
text : this._textObjToHTML,
+ image : this._imageObjToHTML,
option : this._optionObjToHTML,
divert : this._divertObjToHTML,
talk : this._talkObjToHTML,
"talk-open" : this._talkopenObjToHTML,
"talk-close": this._talkcloseObjToHTML,
- // image : this.image,
input : this._inputObjToHTML,
"context-open" : this._selctxopenObjToHTML,
"context-close" : this._selctxcloseObjToHTML,
@@ -466,6 +465,49 @@ class Translator {
};
}
+ /*
+ * Text Obj to HTML
+ * Output: [content]
+ */
+ _textObjToHTML(obj) {
+ // return this._markdownTranslator.makeHtml(obj.content);
+ return obj.content;
+ }
+
+ /*
+ * Image Md to Obj
+ * Input: !\[alt-text\]([path] "[title]")
+ * Output:
+ * {
+ * type: "image"
+ * alt:
+ * path:
+ * title:
+ * }
+ */
+ _imageMdToObj(matchArray) {
+ let image = {
+ type: "image",
+ alt: matchArray[1].trim(),
+ path: matchArray[2].trim()
+ };
+ if (matchArray[3] != null)
+ image.title = matchArray[3].trim();
+ return image;
+ }
+
+ /*
+ * Image Obj to HTML
+ * Output:
+ */
+ _imageObjToHTML(obj) {
+ return Translator.htmlTemplates.image
+ .replace("[server]", DCCCommonServer.managerAddress + "artifacts/")
+ .replace("[path]", obj.path)
+ .replace("[alt]", (obj.title)
+ ? " alt='" + obj.title + "'" : "");
+ }
+
/*
* Context Open Md to Obj
* Input: {{ [context] #[evaluation]: [option-1], ..., [option-n]
@@ -481,7 +523,7 @@ class Translator {
_contextOpenMdToObj(matchArray) {
let context = {
type: "context",
- context: matchArray[1].trim(),
+ context: matchArray[1].trim()
};
if (matchArray[2] != null) {
@@ -572,15 +614,6 @@ class Translator {
return Translator.htmlTemplates.annotation.replace("[natural]", obj.natural.complete);
}
- /*
- * Text Obj to HTML
- * Output: [content]
- */
- _textObjToHTML(obj) {
- // return this._markdownTranslator.makeHtml(obj.content);
- return obj.content;
- }
-
/*
* Option Md to Obj
* Input: + [label] ([rule]) -> [target] or * [label] ([rule]) -> [target]
@@ -951,12 +984,13 @@ class Translator {
Translator.marks = {
knot : /(?:^[ \t]*(#+)[ \t]*(\w[\w \t]*)(?:\((\w[\w \t,]*)\))?[ \t]*#*[ \t]*$)|(?:^[ \t]*(\w[\w \t]*)(?:\((\w[\w \t,]*)\))?[ \t]*[\f\n\r][\n\r]?(==+|--+)$)/im,
+ image : /!\[([\w \t]*)\]\(([\w:.\/\?\-]+)[ \t]*(?:"([\w ]*)")?\)/im,
+ // image : //im,
option : /^[ \t]*([\+\*])[ \t]*([^\(&> \t][^\(&>\n\r\f]*)?(?:\(([\w \t-]+)\)[ \t]*)?(?:-(?:(?:>)|>)[ \t]*(\w[\w. \t]*))$/im,
divert : /-(?:(?:>)|>) *(\w[\w. ]*)/im,
talk : /^[ \t]*:[ \t]*(\w[\w \t]*):[ \t]*([^\n\r\f]+)$/im,
talkopen: /^[ \t]*:[ \t]*(\w[\w \t]*):[ \t]*$/im,
talkclose: /[ \t]*:[ \t]*:[ \t]*$/im,
- // image : //im,
input : /\{[ \t]*\?(\d+)?([\w \t]*)(?:\:([\w \t]+))?(?:#([\w \t\+\-\*"=\%\/,]+)(?:;([\w \t\+\-\*"=\%\/,]+))?)?\}/im,
selctxopen : Translator.marksAnnotation.ctxopen,
selctxclose: Translator.marksAnnotation.ctxclose,
diff --git a/src/adonisjs/resources/views/dcc-common-server-address.edge b/src/adonisjs/resources/views/dcc-common-server-address.edge
index 043b79ee1..d0d2aa863 100644
--- a/src/adonisjs/resources/views/dcc-common-server-address.edge
+++ b/src/adonisjs/resources/views/dcc-common-server-address.edge
@@ -4,5 +4,10 @@
*/
(function() {
- DCCCommonServer.serverAddress = "{{harena_manager_url}}";
+ DCCCommonServer.managerAddress = "{{harena_manager_url}}/";
+ DCCCommonServer.managerAddressAPI = DCCCommonServer.managerAddress +
+ "api/{{harena_manager_api_version}}/";
+ DCCCommonServer.loggerAddress = "{{harena_logger_url}}/";
+ DCCCommonServer.loggerAddressAPI = DCCCommonServer.loggerAddress +
+ "api/{{harena_logger_api_version}}/";
})();
\ No newline at end of file
diff --git a/src/adonisjs/start/routes.js b/src/adonisjs/start/routes.js
index eb225f52e..4e8d95306 100644
--- a/src/adonisjs/start/routes.js
+++ b/src/adonisjs/start/routes.js
@@ -23,13 +23,28 @@ let harenaManagerUrl =
Env.get("HARENA_MANAGER_URL", "http://localhost:3000/api/v1/");
*/
-const Env = use('Env')
+const Env = use("Env");
+Route.get("infra/dcc-common-server-address.js", async ({response, view}) =>{
+ const harena_manager_url = Env.get("HARENA_MANAGER_URL", "http://127.0.0.1:1020");
+ const harena_manager_api_version = Env.get("HARENA_MANAGER_API_VERSION", "v1");
+ const harena_logger_url = Env.get("HARENA_LOGGER_URL", "http://127.0.0.1:1030");
+ const harena_logger_api_version = Env.get("HARENA_LOGGER_API_VERSION", "v1");
+ response.header("Content-type", "application/javascript");
+ return view.render("dcc-common-server-address",
+ {"harena_manager_url": harena_manager_url,
+ "harena_manager_api_version": harena_manager_api_version,
+ "harena_logger_url": harena_logger_url,
+ "harena_logger_api_version": harena_logger_api_version});
+});
+
+/*
Route.get('infra/dcc-common-server-address.js', async ({response, view}) =>{
const harena_manager_url = Env.get('HARENA_MANAGER_URL', 'http://127.0.0.1:3000/api/v1');
response.header('Content-type', 'application/javascript');
return view.render('dcc-common-server-address',{ "harena_manager_url" : harena_manager_url });
});
+*/
/*
Route.on("/author/js/dcc-author-server-address.js")