From b69559541a502132cedcba16f0cc583a18c98c7f Mon Sep 17 00:00:00 2001 From: Ro Date: Tue, 25 Jan 2022 15:17:41 -0800 Subject: [PATCH 1/4] edit format bar always stays on screen --- brain/views/dash/start.twig | 2 +- public/assets/scripts/Start.js | 21 ++++++++------------- src/com/ui/TextEditor.js | 20 +++++++++----------- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/brain/views/dash/start.twig b/brain/views/dash/start.twig index 9eabc15..5dfe7db 100644 --- a/brain/views/dash/start.twig +++ b/brain/views/dash/start.twig @@ -5,7 +5,7 @@ {% endblock %} {% block stylesheets %} - + {% endblock %} {% block mainContent %} diff --git a/public/assets/scripts/Start.js b/public/assets/scripts/Start.js index 69283ad..bbefd26 100644 --- a/public/assets/scripts/Start.js +++ b/public/assets/scripts/Start.js @@ -140,9 +140,9 @@ this[globalName] = mainExports; } } -})({"jRsG2":[function(require,module,exports) { +})({"hFE32":[function(require,module,exports) { var HMR_HOST = null; -var HMR_PORT = 1234; +var HMR_PORT = 54262; var HMR_SECURE = false; var HMR_ENV_HASH = "4a236f9275d0a351"; module.bundle.HMR_BUNDLE_ID = "770375bf412ba982"; @@ -1959,21 +1959,16 @@ class TextEditor extends _eventEmitterDefault.default { result_element.scrollLeft = e.scrollLeft; }); document.getElementById("edit").dispatchEvent(new Event("input")); - this.setInputs(); + this.setInputs(); //freeze editor formatting so it doesn't scroll off screen window.addEventListener("scroll", ()=>{ - /** - * edit scroller needs work - if (window.pageYOffset >= fixLimit) { - document.getElementById('edit-control').style.position = 'fixed'; - } else { - document.getElementById('edit-control').style.position = 'relative'; - } - */ }); //this.refresh(); + var fixLimit = scrollLimit; + if (window.pageYOffset + 5 >= fixLimit) document.getElementById("edit-control").style.position = "fixed"; + else document.getElementById("edit-control").style.position = "relative"; + }); } // methods //-------------------------- setInputs() { - let self = this; var editorButtons = document.querySelectorAll(".editor-button"); for(var i = 0, length = editorButtons.length; i < length; i++)editorButtons[i].addEventListener("click", (e)=>this.handleEditorOption(e) , false); @@ -8358,6 +8353,6 @@ Sortable.mount(new AutoScrollPlugin()); Sortable.mount(Remove, Revert); exports.default = Sortable; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}]},["jRsG2","bEyX8"], "bEyX8", "parcelRequiredac0") +},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}]},["hFE32","bEyX8"], "bEyX8", "parcelRequiredac0") //# sourceMappingURL=Start.js.map diff --git a/src/com/ui/TextEditor.js b/src/com/ui/TextEditor.js index fc9e0c2..d59cfaa 100644 --- a/src/com/ui/TextEditor.js +++ b/src/com/ui/TextEditor.js @@ -41,24 +41,22 @@ class TextEditor extends EventEmitter { }); document.getElementById("edit").dispatchEvent(new Event("input")); this.setInputs(); + + //freeze editor formatting so it doesn't scroll off screen window.addEventListener("scroll", () => { - //var fixLimit = this.fixLimit; - /** - * edit scroller needs work - if (window.pageYOffset >= fixLimit) { - document.getElementById('edit-control').style.position = 'fixed'; - } else { - document.getElementById('edit-control').style.position = 'relative'; - } - */ + var fixLimit = scrollLimit; + + if (window.pageYOffset + 5 >= fixLimit) { + document.getElementById("edit-control").style.position = "fixed"; + } else { + document.getElementById("edit-control").style.position = "relative"; + } }); - //this.refresh(); } //-------------------------- // methods //-------------------------- setInputs() { - let self = this; var editorButtons = document.querySelectorAll(".editor-button"); for (var i = 0, length = editorButtons.length; i < length; i++) { editorButtons[i].addEventListener( From 601fd6b1ab9179fbe94a095452085c74da204f91 Mon Sep 17 00:00:00 2001 From: Ro Date: Wed, 26 Jan 2022 13:26:41 -0800 Subject: [PATCH 2/4] fix for weird css file deletion thing --- public/assets/scripts/Start.js | 12 ++++++++---- src/com/controllers/PageEditor.js | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/assets/scripts/Start.js b/public/assets/scripts/Start.js index bbefd26..442d621 100644 --- a/public/assets/scripts/Start.js +++ b/public/assets/scripts/Start.js @@ -140,9 +140,9 @@ this[globalName] = mainExports; } } -})({"hFE32":[function(require,module,exports) { +})({"ge7IN":[function(require,module,exports) { var HMR_HOST = null; -var HMR_PORT = 54262; +var HMR_PORT = 59915; var HMR_SECURE = false; var HMR_ENV_HASH = "4a236f9275d0a351"; module.bundle.HMR_BUNDLE_ID = "770375bf412ba982"; @@ -1764,7 +1764,11 @@ class PostEditor { e2.type == "drop" ? PostEditor.uploadFiles = e2.dataTransfer.files : PostEditor.uploadFiles = e2.target.files; for(var i = 0, f1; f1 = PostEditor.uploadFiles[i]; i++){ // Only process image files. - if (!f1.type.match("image.*")) continue; + //console.log("FILE TYPE", f.type); + if (!f1.type.match("image.*")) { + alert("This is not an image. \nBad user. BAD."); + continue; + } var reader = new FileReader(); // Closure to capture the file information. reader.onload = (function(theFile) { return function(f) { @@ -8353,6 +8357,6 @@ Sortable.mount(new AutoScrollPlugin()); Sortable.mount(Remove, Revert); exports.default = Sortable; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}]},["hFE32","bEyX8"], "bEyX8", "parcelRequiredac0") +},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}]},["ge7IN","bEyX8"], "bEyX8", "parcelRequiredac0") //# sourceMappingURL=Start.js.map diff --git a/src/com/controllers/PageEditor.js b/src/com/controllers/PageEditor.js index d3d8a82..f830abc 100644 --- a/src/com/controllers/PageEditor.js +++ b/src/com/controllers/PageEditor.js @@ -228,7 +228,9 @@ export default class PostEditor { : (PostEditor.uploadFiles = e.target.files); for (var i = 0, f; (f = PostEditor.uploadFiles[i]); i++) { // Only process image files. + //console.log("FILE TYPE", f.type); if (!f.type.match("image.*")) { + alert("This is not an image. \nBad user. BAD."); continue; } var reader = new FileReader(); From 53864becc18999c7b939a242bb281ce26449cf0e Mon Sep 17 00:00:00 2001 From: Ro Date: Wed, 26 Jan 2022 15:57:27 -0800 Subject: [PATCH 3/4] implemented progress upload indicator in notifications --- brain/views/dash/_frame.twig | 9 +- brain/views/dash/forms/login.twig | 2 +- brain/views/dash/page-edit.twig | 2 +- brain/views/dash/reset-password.twig | 2 +- brain/views/dash/start.twig | 2 +- public/assets/css/dash.css | 25 +- public/assets/scripts/Start.js | 8358 +------------------------- src/com/controllers/PageEditor.js | 5 +- src/com/ui/Notifications.js | 16 +- src/libraries/FipamoAdminAPI.js | 17 +- src/styles/main/_structure.sass | 24 +- 11 files changed, 83 insertions(+), 8379 deletions(-) diff --git a/brain/views/dash/_frame.twig b/brain/views/dash/_frame.twig index 5ec39d9..46f6f18 100644 --- a/brain/views/dash/_frame.twig +++ b/brain/views/dash/_frame.twig @@ -19,9 +19,14 @@
- +
-

+ +
+
+

MESSAGE TEXT

+
+
diff --git a/brain/views/dash/forms/login.twig b/brain/views/dash/forms/login.twig index e1f64d2..aa31550 100644 --- a/brain/views/dash/forms/login.twig +++ b/brain/views/dash/forms/login.twig @@ -1,7 +1,7 @@
-