From d9611763f17f0c411a7848b836069288c7794b24 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 23 Apr 2020 23:27:02 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 19 ++++----- ayanova/src/components/wiki-control.vue | 53 ++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index e2b6f121..ac5f3c28 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -66,17 +66,9 @@ CURRENT TODOs @@@@@@@@@@@ ROADMAP STAGE 2: - - -todo: attachments - form key for hiding / showing customization - - -todo: clean up recently added translation keys, some are not being used and were added willy nilly - - "File" I think might be one - -todo: Datadump EXPORT and RAVEN IMPORT of all attachment / wiki stuff - - v7 attached files, internal documents all handled - - Code it now +todo: drag and drop files on to attachments and have them stored and added automatically +todo: drag and drop image file on to wiki and have it added as attachment then linked automatically +todo: drag and drop image file from attachments and have it added to wiki automatically. todo: AFTER ATTACHMENTS WIKI IMAGES @@ -89,7 +81,7 @@ todo: AFTER ATTACHMENTS WIKI IMAGES todo: Picture input in attachments https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/2080 - +todo: attached files drag and drop todo: Look at attachment saving code on server, should it zip? @@ -102,6 +94,9 @@ todo: careful and thorough PERF tests remotely and local todo: after attachments - DATADUMP - v7 wiki to RAVEN markdown - https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3468 - Need to export images and attached docs as attachments +todo: Datadump EXPORT and RAVEN IMPORT of all attachment / wiki stuff + - v7 attached files, internal documents all handled + - Code it now todo: after attachments - integration tests update diff --git a/ayanova/src/components/wiki-control.vue b/ayanova/src/components/wiki-control.vue index 22c9a5f4..483e93f1 100644 --- a/ayanova/src/components/wiki-control.vue +++ b/ayanova/src/components/wiki-control.vue @@ -299,6 +299,9 @@ >
0) { + //handle file drop + console.log("DROP:Possible files", files); + //if an image then put it directly in viewable, if not an image then make a link and keep as an attach + } else { + //maybe an url? + let url = ev.dataTransfer.getData("text"); + if (url) { + //Attachment? + if (url.includes("Attachment/download/")) { + //it's an attachment url so fixup accordingly + //DROP:Possible url http://localhost:7575/api/v8.0/Attachment/download/4?t=CYs1xUgjdyaWmcq8rXlPpNNSaKpiMt8Xhi7mKRGeg8o wiki-control.vue:826 + //cow(.*)milk + let m = url.match(/Attachment\/download\/(.*)\?t=/); + if (m.length > 1) { + url = "[ATTACH:" + m[1] + "]"; + } else { + url = null; + } + if (url != null) { + //insert into textarea + let txt = this.getSelectedText(); + if (txt) { + this.replaceSelectedText( + "![" + txt + "](" + url + ' "' + txt + '") \n' + txt //keep original selected text otherwise it will vanish + ); + } else { + this.replaceSelectedText("![](" + url + ")"); + } + } + console.log("processed url:", url); + } else { + //External url + //todo: this + console.log("STUB: Handle external url drop"); + } + + //handle accordingly + } + } } + + //----------end methods---------- } };