diff --git a/.gitignore b/.gitignore index 398a55a6d..0d55adda3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ dcc-author-server-address.js + +package-lock\.json diff --git a/author/images/bubble-landscape.png b/author/images/bubble-landscape.png new file mode 100644 index 000000000..2836a2680 Binary files /dev/null and b/author/images/bubble-landscape.png differ diff --git a/author/images/bubble-portrait.png b/author/images/bubble-portrait.png new file mode 100644 index 000000000..f3e856449 Binary files /dev/null and b/author/images/bubble-portrait.png differ diff --git a/author/images/call-the-supervisor.svg b/author/images/call-the-supervisor.svg new file mode 100644 index 000000000..8e8f19609 --- /dev/null +++ b/author/images/call-the-supervisor.svg @@ -0,0 +1,88 @@ + + + + diff --git a/author/images/doctor-icon.png b/author/images/doctor-icon.png new file mode 100644 index 000000000..3b373e0d2 Binary files /dev/null and b/author/images/doctor-icon.png differ diff --git a/author/images/doctor.png b/author/images/doctor.png new file mode 100644 index 000000000..a8c9ec3c1 Binary files /dev/null and b/author/images/doctor.png differ diff --git a/author/images/entrance.jpg b/author/images/entrance.jpg new file mode 100644 index 000000000..1dd4be7c5 Binary files /dev/null and b/author/images/entrance.jpg differ diff --git a/author/images/generate-hypothesis.svg b/author/images/generate-hypothesis.svg new file mode 100644 index 000000000..57d31831d --- /dev/null +++ b/author/images/generate-hypothesis.svg @@ -0,0 +1,89 @@ + + + + diff --git a/author/images/icon-back.svg b/author/images/icon-back.svg new file mode 100644 index 000000000..63a7be8ba --- /dev/null +++ b/author/images/icon-back.svg @@ -0,0 +1,77 @@ + + + + diff --git a/author/images/jacinto-icon.png b/author/images/jacinto-icon.png new file mode 100644 index 000000000..1662c3c41 Binary files /dev/null and b/author/images/jacinto-icon.png differ diff --git a/author/images/jacinto.png b/author/images/jacinto.png new file mode 100644 index 000000000..4f4a65fbd Binary files /dev/null and b/author/images/jacinto.png differ diff --git a/author/images/mono-slide.svg b/author/images/mono-slide.svg new file mode 100644 index 000000000..526a6ea27 --- /dev/null +++ b/author/images/mono-slide.svg @@ -0,0 +1,127 @@ + + diff --git a/author/images/more-information.svg b/author/images/more-information.svg new file mode 100644 index 000000000..637071ce6 --- /dev/null +++ b/author/images/more-information.svg @@ -0,0 +1,80 @@ + + + + diff --git a/author/images/nurse-icon.png b/author/images/nurse-icon.png new file mode 100644 index 000000000..54bbf995f Binary files /dev/null and b/author/images/nurse-icon.png differ diff --git a/author/images/nurse.png b/author/images/nurse.png new file mode 100644 index 000000000..3e578849d Binary files /dev/null and b/author/images/nurse.png differ diff --git a/author/images/tablet.svg b/author/images/tablet.svg new file mode 100644 index 000000000..efb362a82 --- /dev/null +++ b/author/images/tablet.svg @@ -0,0 +1,66 @@ + + + + diff --git a/src/adonisjs/public/author/icons/icon-edit-case.svg b/src/adonisjs/public/author/icons/icon-edit-case.svg new file mode 100644 index 000000000..37d6d408a --- /dev/null +++ b/src/adonisjs/public/author/icons/icon-edit-case.svg @@ -0,0 +1,99 @@ + + + + diff --git a/src/adonisjs/public/author/index.html b/src/adonisjs/public/author/index.html index 976475ce6..90ed563a6 100644 --- a/src/adonisjs/public/author/index.html +++ b/src/adonisjs/public/author/index.html @@ -48,6 +48,7 @@
+ diff --git a/src/adonisjs/public/author/js/author.js b/src/adonisjs/public/author/js/author.js index 95227d0ce..09e8edd56 100644 --- a/src/adonisjs/public/author/js/author.js +++ b/src/adonisjs/public/author/js/author.js @@ -22,6 +22,7 @@ class AuthorManager { // new DCCAuthorServer(); // this._currentThemeFamily = "jacinto"; + this._themeSVG = true; this._currentCaseId = null; this._knotSelected = null; this._htmlKnot = null; @@ -66,6 +67,8 @@ class AuthorManager { break; case "control/case/save": this.caseSave(); break; + case "control/case/edit": this.caseEdit(); + break; case "control/knot/new": this.knotNew(); break; case "control/knot/edit": this.knotEdit(); @@ -115,16 +118,24 @@ class AuthorManager { */ async caseNew() { this._temporaryCase = true; - const caseId = await MessageBus.ext.request("data/case//new"); - + await this._themeSelect(); let template = await this._templateSelect(); const templateMd = await MessageBus.ext.request("data/template/" + template.replace("/", ".") + "/get"); + const caseId = await MessageBus.ext.request("data/case//new", + {format: "markdown", + name: "Untitled", + source: templateMd.message}); + + /* const status = await MessageBus.ext.request("data/case/" + caseId.message + "/set", - {format: "markdown", source: templateMd.message}); + {format: "markdown", + name: "Untitled", + source: templateMd.message}); + */ this._caseLoad(caseId.message); } @@ -185,6 +196,21 @@ class AuthorManager { } } + /* + * ACTION: control/case/edit + */ + async caseEdit() { + let md = this._translator.assembleMarkdown(this._compiledCase); + this._knotPanel.innerHTML = ""; + this._editor = new Quill("#editor-space", { + theme: "snow", + formats: { + font: "Courier New" + } + }); + this._editor.insertText(0, md); + } + /* * ACTION: control/knot/new */ @@ -221,7 +247,6 @@ class AuthorManager { if (this._checkKnotModification()) this._htmlKnot = await this._translator.generateHTML( this._knots[this._knotSelected]); - // this._htmlKnot = await this._generateHTML(this._knotSelected); this._renderSlide = !this._renderSlide; this._renderKnot(); } @@ -290,6 +315,7 @@ class AuthorManager { this._translator.currentThemeFamily = await DCCNoticeInput.displayNotice( "Select a theme to be applied.", "list", "Select", "Cancel", families.message); + this._themeSVG = families.message[this._translator.currentThemeFamily].svg; } /* diff --git a/src/adonisjs/public/author/js/dcc-author-server-proxy.js b/src/adonisjs/public/author/js/dcc-author-server-proxy.js index 5fee35893..a923d91fa 100644 --- a/src/adonisjs/public/author/js/dcc-author-server-proxy.js +++ b/src/adonisjs/public/author/js/dcc-author-server-proxy.js @@ -81,24 +81,15 @@ class DCCAuthorServer { "headers": { "Content-Type": "application/json", "Authorization": "Bearer " + DCCCommonServer.instance.token - } + }, + "body": JSON.stringify({name: message.name, + source: message.source}) }; const response = - await fetch(DCCCommonServer.managerAddressAPI + "case/new", header); + await fetch(DCCCommonServer.managerAddressAPI + "case", header); const jsonResponse = await response.json(); MessageBus.ext.publish(MessageBus.buildResponseTopic(topic, message), jsonResponse.uuid); - - /* - const response = await fetch(DCCCommonServer.managerAddressAPI + "new-case", { - method: "POST", - headers:{ - "Content-Type": "application/json" - } - }); - const jsonResponse = await response.json(); - MessageBus.ext.publish("case/" + jsonResponse.caseName + "/set/status", "ok"); - */ } async saveCase(topic, message) { diff --git a/src/adonisjs/public/author/js/navigator.js b/src/adonisjs/public/author/js/navigator.js index ec6fa44e3..27f0bdd42 100644 --- a/src/adonisjs/public/author/js/navigator.js +++ b/src/adonisjs/public/author/js/navigator.js @@ -408,6 +408,8 @@ async _createMiniature(knot, krender) { iframe.srcdoc = this._capsule.message .replace(/{width}/g, Navigator.miniKnot[this._retracted].width) .replace(/{height}/g, Navigator.miniKnot[this._retracted].height-6) + .replace(/{scale}/g, (this._author._themeSVG) + ? "" : ";transform-origin:top left;transform:scale(0.1)") .replace("{knot}", htmlKnot); miniature.appendChild(iframe); diff --git a/src/adonisjs/public/dccs/components/dcc-character.js b/src/adonisjs/public/dccs/components/dcc-character.js index 96caf3d39..70412ade8 100644 --- a/src/adonisjs/public/dccs/components/dcc-character.js +++ b/src/adonisjs/public/dccs/components/dcc-character.js @@ -154,8 +154,12 @@ class DCCCharacter extends DCCBase { let extension = this.image.lastIndexOf("."); let icon = this.image.substring(0, extension) + "-icon" + this.image.substring(extension); - return "" + - ""; + return "