From d5b1bc40ca045e53dbc720a8722c580858739a21 Mon Sep 17 00:00:00 2001 From: Heitor Mattosinho Date: Thu, 3 Sep 2020 04:37:05 -0300 Subject: [PATCH 01/15] chore: changing text editor --- src/adonisjs/public/dccs/css/dccs.css | 6 +++--- src/adonisjs/public/dccs/edit/inplace-editor.js | 10 +++++----- .../public/dccs/edit/inplace-text-editor.js | 16 ++++++++-------- src/adonisjs/public/themes/simple/css/theme.css | 4 ++-- src/adonisjs/resources/views/author/author.edge | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/adonisjs/public/dccs/css/dccs.css b/src/adonisjs/public/dccs/css/dccs.css index 30f577352..f97354ee2 100644 --- a/src/adonisjs/public/dccs/css/dccs.css +++ b/src/adonisjs/public/dccs/css/dccs.css @@ -36,7 +36,7 @@ } .inplace-editor-floating { - position: absolute; + position: relative; background-color: white; border-radius: 1px; box-shadow: 0px 0px 0px 5px rgba(0,0,0,0.5); @@ -45,7 +45,7 @@ .inplace-editor { background-color: white; - overflow: hidden; + /* overflow: hidden; */ } .annotation-bar { @@ -63,4 +63,4 @@ flex-direction: row; justify-content: flex-end; cursor: pointer; -} \ No newline at end of file +} diff --git a/src/adonisjs/public/dccs/edit/inplace-editor.js b/src/adonisjs/public/dccs/edit/inplace-editor.js index 6bc57ee46..f4c9cd6dc 100644 --- a/src/adonisjs/public/dccs/edit/inplace-editor.js +++ b/src/adonisjs/public/dccs/edit/inplace-editor.js @@ -76,11 +76,11 @@ class EditDCC { this._editorToolbar.classList.add('inplace-editor-floating') this._editorToolbar.innerHTML = html - this._editorToolbar.style.left = this._transformRelativeX( - this._elementWrapperRect.left - this._containerRect.left) - this._editorToolbar.style.bottom = this._transformRelativeY( - this._containerRect.height - - (this._elementWrapperRect.top - this._containerRect.top)) + // this._editorToolbar.style.left = this._transformRelativeX( + // this._elementWrapperRect.left - this._containerRect.left) + // this._editorToolbar.style.bottom = this._transformRelativeY( + // this._containerRect.height - + // (this._elementWrapperRect.top - this._containerRect.top)) this._editorWrapper.appendChild(this._editorToolbar) } diff --git a/src/adonisjs/public/dccs/edit/inplace-text-editor.js b/src/adonisjs/public/dccs/edit/inplace-text-editor.js index 6a37b6e4d..03407f13d 100644 --- a/src/adonisjs/public/dccs/edit/inplace-text-editor.js +++ b/src/adonisjs/public/dccs/edit/inplace-text-editor.js @@ -132,14 +132,14 @@ class EditDCCText extends EditDCC { _buildEditorPanel () { const editor = document.createElement('div') - editor.style.position = 'absolute' - editor.style.left = this._transformRelativeX( - this._elementWrapperRect.left - this._containerRect.left) - editor.style.top = this._transformRelativeY( - this._elementWrapperRect.top - this._containerRect.top) - editor.style.width = this._transformRelativeX(this._elementWrapperRect.width) - editor.style.height = - this._transformRelativeY(this._elementWrapperRect.height) + editor.style.position = 'sticky' + // editor.style.left = this._transformRelativeX( + // this._elementWrapperRect.left - this._containerRect.left) + // editor.style.top = this._transformRelativeY( + // this._elementWrapperRect.top - this._containerRect.top) + // editor.style.width = this._transformRelativeX(this._elementWrapperRect.width) + // editor.style.height = + // this._transformRelativeY(this._elementWrapperRect.height) if (this._svgDraw) { editor.innerHTML = EditDCCText.editorTemplate.svg diff --git a/src/adonisjs/public/themes/simple/css/theme.css b/src/adonisjs/public/themes/simple/css/theme.css index 1f696fe39..4ede88b8f 100644 --- a/src/adonisjs/public/themes/simple/css/theme.css +++ b/src/adonisjs/public/themes/simple/css/theme.css @@ -44,7 +44,7 @@ /* .styt-main, .styt-button, input[type="text"], textarea { */ .styt-main, .styt-button, .styt-button-option { /* font-size: 4vmin; */ - font-size: 3vmin; + font-size: 1.8rem; } .styt-main-text { @@ -121,4 +121,4 @@ padding: .375rem .75rem; width: 100%; margin-bottom: 1rem; -} \ No newline at end of file +} diff --git a/src/adonisjs/resources/views/author/author.edge b/src/adonisjs/resources/views/author/author.edge index 58851ca5d..1c1435642 100644 --- a/src/adonisjs/resources/views/author/author.edge +++ b/src/adonisjs/resources/views/author/author.edge @@ -145,7 +145,7 @@ -
+
diff --git a/src/adonisjs/public/themes/simple/exam_zoom.html b/src/adonisjs/public/themes/simple/exam_zoom.html index 4d1043f80..b3792e619 100644 --- a/src/adonisjs/public/themes/simple/exam_zoom.html +++ b/src/adonisjs/public/themes/simple/exam_zoom.html @@ -10,4 +10,4 @@
-
\ No newline at end of file +
diff --git a/src/adonisjs/public/themes/simple/input.html b/src/adonisjs/public/themes/simple/input.html index 37dc26e56..464845bfd 100644 --- a/src/adonisjs/public/themes/simple/input.html +++ b/src/adonisjs/public/themes/simple/input.html @@ -1,21 +1,30 @@ -
-
-
- - {knot} - -
-
-

-
-
-

-
-
-

-
-
+ + +
+
+
+
+ + {knot} + +
+
+

+
+
+

+
+
+

+
+
+
+ +
+ + +
+
+
+
-
-
-
\ No newline at end of file diff --git a/src/adonisjs/public/translator/translator.js b/src/adonisjs/public/translator/translator.js index c57fc3dcb..ed05e2b15 100644 --- a/src/adonisjs/public/translator/translator.js +++ b/src/adonisjs/public/translator/translator.js @@ -734,7 +734,7 @@ class Translator { scramble: true, options: {} }, compiled[c - 1]._source) - this._transferOption(optionGroup.options, compiled[c-1]) + this._transferOption(optionGroup.options, compiled[c - 1]) compiled[c - 1] = optionGroup } if (optionGroup != null) { @@ -748,19 +748,19 @@ class Translator { } } - _transferOption(options, compiledItem) { - options[compiledItem.label] = { - target: (compiledItem.target) - ? compiledItem.target : '(default)' - } - if (compiledItem.message) { - options[compiledItem.label].message = + _transferOption (options, compiledItem) { + options[compiledItem.label] = { + target: (compiledItem.target) + ? compiledItem.target : '(default)' + } + if (compiledItem.message) { + options[compiledItem.label].message = compiledItem.message - } - if (compiledItem.state) { - options[compiledItem.label].state = compiledItem.state - options[compiledItem.label].operation = compiledItem.operation - } + } + if (compiledItem.state) { + options[compiledItem.label].state = compiledItem.state + options[compiledItem.label].operation = compiledItem.operation + } } // check if both are quoted or subordinated @@ -1532,10 +1532,7 @@ class Translator { if (matchArray[3] != null) { option.divert = matchArray[3].trim() } if (matchArray[4] != null) { option.target = matchArray[4].trim() } if (matchArray[5] != null) { option.message = matchArray[5].trim() } - if (matchArray[6] != null) - { option.operation = matchArray[6].trim() } - else if (matchArray[8] != null) - { option.operation = matchArray[8].trim() } + if (matchArray[6] != null) { option.operation = matchArray[6].trim() } else if (matchArray[8] != null) { option.operation = matchArray[8].trim() } if (matchArray[7] != null) { option.state = matchArray[7].trim() } return option @@ -1582,8 +1579,7 @@ class Translator { _optionObjToMd (obj) { let state = '' - if (obj.state && obj.operation) - state = ' ' + ((obj.operation == ">") ? '>' : '') + '((' + obj.state + '))' + ((obj.operation == "?") ? '?' : '') + if (obj.state && obj.operation) { state = ' ' + ((obj.operation == '>') ? '>' : '') + '((' + obj.state + '))' + ((obj.operation == '?') ? '?' : '') } return Translator.markdownTemplates.option .replace('{subtype}', (obj.subtype == '_') ? '' : obj.subtype + ' ') .replace('{label}', (obj.label) ? obj.label : '') @@ -1956,8 +1952,7 @@ class Translator { first = false const option = obj.options[op] let state = '' - if (option.state && option.operation) - state = ' ' + ((option.operation == ">") ? '>' : '') + '((' + option.state + '))' + ((option.operation == "?") ? '?' : '') + if (option.state && option.operation) { state = ' ' + ((option.operation == '>') ? '>' : '') + '((' + option.state + '))' + ((option.operation == '?') ? '?' : '') } md += Translator.markdownTemplates.choice .replace('{label}', op) .replace('{target}', @@ -1965,7 +1960,7 @@ class Translator { ? option.target : '') .replace('{message}', (option.message ? '"' + option.message + '"' : '')) - .replace("{state}", state) + .replace('{state}', state) } } else { let extraAttr = '' diff --git a/src/adonisjs/resources/views/author/author.edge b/src/adonisjs/resources/views/author/author.edge index c99339f45..2ab981e4f 100644 --- a/src/adonisjs/resources/views/author/author.edge +++ b/src/adonisjs/resources/views/author/author.edge @@ -124,15 +124,16 @@
--> -
+
-