Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert images from local device (or link) #1900

Merged
merged 63 commits into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
ba3fc84
begin to implement local image insertion, UI almost done
Oct 18, 2021
ab99206
basic upload ok
Oct 18, 2021
bc2e4d3
improve basic upload
Oct 18, 2021
477573d
create /Text if needed
Oct 18, 2021
b7234c0
insert link working
Oct 20, 2021
48e9828
loading animation when inserting image link or uploading image
Oct 20, 2021
361f265
show errors
Oct 20, 2021
cb463ea
fix link input reset issue
Oct 20, 2021
a103b98
upload image file via Text API call for more flexibility in saved fil…
Oct 21, 2021
7267f0b
display/upload/add-link works with attachment folder in user context
Oct 22, 2021
849b4f0
identify image by name instead of id in text file content
Oct 22, 2021
05098ce
serve attached images to public links
Oct 22, 2021
761d0dd
public upload/link-insertion almost done, issue with missing fileId i…
Oct 22, 2021
f3f03cf
fix upload/link-dl in single file share edition, get it from upload r…
Oct 22, 2021
7fde881
fix share link permissions check
Oct 22, 2021
6916b96
add user share permissions check
Oct 22, 2021
1fedc8f
cleanup server side stuff
Nov 2, 2021
09552de
check mime type on upload (client and server side)
Nov 2, 2021
b1fe365
provide content-type header when serving images
Nov 2, 2021
1b33096
serve image previews
Nov 2, 2021
c3a8e5d
hide image link input when closing image action popup
Nov 22, 2021
a541ad9
fix function naming
Nov 22, 2021
39114e0
rename menu items
Nov 22, 2021
65c69ff
change attachment folder name to .attachments.FILE_ID
Nov 22, 2021
2f6a92b
use attachment folder when inserting image from Files
Nov 22, 2021
340f788
avoid exposing exception msg to user
Nov 23, 2021
19d014b
provide preview only if mime type is supported
Nov 23, 2021
54ff445
add annotation
Nov 23, 2021
94572f8
remove useless path attribute in insert/upload response
Nov 23, 2021
f1c25a8
fix image serve endpoints
Nov 23, 2021
4e074e7
address review comments
Nov 23, 2021
f3b1559
psalm issues
Nov 23, 2021
ed48dcf
php-cs checks
Nov 23, 2021
fc56680
store file id (instead of name) in markdown image links, cleanup atta…
Nov 24, 2021
551729e
implement auto attachment management for file deletion/move/copy
Nov 25, 2021
cb42dae
fix php7.3 compat
Nov 26, 2021
0762feb
add class to image <actions>
Nov 26, 2021
a2fcb4d
fix moveAttachments in shared context (single file and directory share)
Nov 26, 2021
3e68770
small fixes
Nov 26, 2021
6245dd2
attempt to fix file copy
Nov 26, 2021
014d081
forgot something while solving rebase conflicts
Dec 3, 2021
4f54f4d
make image upload endpoints public and use session token to authenticate
Dec 6, 2021
32c0a37
use image file name instead of file ID in content links
Dec 21, 2021
81aebee
use Vuex to store current session and get it in the ImageView component
Dec 21, 2021
ed2f474
adjustments after rebase
Dec 21, 2021
b4b4f1d
fix stuff after PR comments
Dec 28, 2021
3905852
fix other stuff after PR comments
Dec 28, 2021
dc710f7
fix other stuff after PR comments
Dec 28, 2021
9b1c396
factorize getAttachmentDirectoryForFile and getOrCreateAttachmentDire…
Dec 28, 2021
2f23e2d
remove Unnecessary else
Dec 28, 2021
cde5784
fix stuff after PR comments
Dec 28, 2021
29b7e0f
stop returning null in getAttachmentDirectoryForFile, use exceptions …
Dec 28, 2021
d64bb66
remove unused param in simpleDownload
Dec 28, 2021
8794427
return 403 when session is invalid
Dec 28, 2021
7eaf9d6
add check on uploaded image
Dec 28, 2021
ef8358b
stream uploaded file to the storage with a resource
Dec 28, 2021
6ba9da8
safely get image mimetype
Dec 28, 2021
dc92e02
allow image upload/link-insertion with email links and from a Talk room
Dec 28, 2021
e628527
improve image link generation and getAttachmentNamesFromContent(), im…
Dec 28, 2021
f65698a
use specific exception on upload error
Dec 28, 2021
342952d
fix some CI errors
Dec 28, 2021
1f9cef4
add basic tests for ImageView.vue
Dec 30, 2021
dea3a59
fix some psalm false positives
Jan 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

return [
'routes' => [
['name' => 'Image#insertImageFile', 'url' => '/image/filepath', 'verb' => 'POST'],
['name' => 'Image#insertImageLink', 'url' => '/image/link', 'verb' => 'POST'],
['name' => 'Image#uploadImage', 'url' => '/image/upload', 'verb' => 'POST'],
['name' => 'Image#getImage', 'url' => '/image', 'verb' => 'GET'],

['name' => 'Session#create', 'url' => '/session/create', 'verb' => 'PUT'],
['name' => 'Session#fetch', 'url' => '/session/fetch', 'verb' => 'POST'],
['name' => 'Session#sync', 'url' => '/session/sync', 'verb' => 'POST'],
Expand Down
4 changes: 2 additions & 2 deletions js/editor-rich.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor-rich.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/files-modal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/files-modal.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/vendors.js

Large diffs are not rendered by default.

199 changes: 199 additions & 0 deletions js/vendors.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,27 @@

/*! https://mths.be/punycode v1.4.1 by @mathias */

/**
* @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
Expand Down Expand Up @@ -144,6 +165,74 @@
*
*/

/**
* @copyright Copyright (c) 2019 Georg Ehrke
*
* @author Georg Ehrke <georg-nextcloud@ehrke.email>
*
* @author Richard Steinmetz <richard@steinmetz.cloud>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2019 Georg Ehrke
*
* @author Georg Ehrke <georg-nextcloud@ehrke.email>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2019 Georg Ehrke
*
* @author Georg Ehrke <oc.list@georgehrke.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
Expand Down Expand Up @@ -255,6 +344,28 @@
*
*/

/**
* @copyright Copyright (c) 2020 Georg Ehrke
*
* @author Georg Ehrke <georg-nextcloud@ehrke.email>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2020 Georg Ehrke <georg-nextcloud@ehrke.email>
*
Expand All @@ -277,4 +388,92 @@
*
*/

/**
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2020 Raimund Schlüßler <raimund.schluessler@mailbox.org>
*
* @author Raimund Schlüßler <raimund.schluessler@mailbox.org>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2020 Raimund Schlüßler <raimund.schluessler@mailbox.org>
*
* @author Raimund Schlüßler <raimund.schluessler@mailbox.org>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2021 Christoph Wurst
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

//! moment.js
2 changes: 1 addition & 1 deletion js/vendors.js.map

Large diffs are not rendered by default.

Loading