diff --git a/README.md b/README.md index 5bd20acc9..d1a6c73dc 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,10 @@ git checkout v2.4.7 cp .env.model .env # Build the dockers -docker-compose build +docker compose build # Run IRIS -docker-compose up +docker compose up ``` Iris shall be available on the host interface, port 443, protocol HTTPS - ``https://``. diff --git a/source/app/static/assets/js/iris/case.notes.js b/source/app/static/assets/js/iris/case.notes.js index aae0b4ab3..91a9917fc 100644 --- a/source/app/static/assets/js/iris/case.notes.js +++ b/source/app/static/assets/js/iris/case.notes.js @@ -21,6 +21,10 @@ const preventFormDefaultBehaviourOnSubmit = (event) => { return false; }; +var editor = ace.edit("editor_detail", + {autoScrollEditorIntoView: true, + minLines: 4 + }); function Collaborator( session_id, n_id ) { this.collaboration_socket = collaborator_socket; @@ -358,6 +362,45 @@ async function note_detail(id) { }); } +function handle_ed_paste(event) { + filename = null; + const { items } = event.originalEvent.clipboardData; + for (let i = 0; i < items.length; i += 1) { + const item = items[i]; + + if (item.kind === 'string') { + item.getAsString(function (s){ + filename = $.trim(s.replace(/\t|\n|\r/g, '')).substring(0, 40); + }); + } + + if (item.kind === 'file') { + const blob = item.getAsFile(); + + if (blob !== null) { + const reader = new FileReader(); + reader.onload = (e) => { + notify_success('The file is uploading in background. Don\'t leave the page'); + + if (filename === null) { + filename = random_filename(25); + } + + upload_interactive_data(e.target.result, filename, function(data){ + url = data.data.file_url + case_param(); + event.preventDefault(); + note_editor.insertSnippet(`\n![${filename}](${url} =100%x40%)\n`); + }); + }; + reader.readAsDataURL(blob); + } else { + notify_error('Unsupported direct paste of this item. Use datastore to upload.'); + } + } + } +} + + function refresh_ppl_list() { $('#ppl_list_viewing').empty(); for (let [key, value] of ppl_viewing) {