mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
UX: Lightbox support for image uploader. (#7034)
This commit is contained in:
parent
3cb676bf42
commit
58b0e945bd
12 changed files with 160 additions and 55 deletions
|
@ -86,6 +86,19 @@ class UploadsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def metadata
|
||||
params.require(:url)
|
||||
upload = Upload.get_from_url(params[:url])
|
||||
raise Discourse::NotFound unless upload
|
||||
|
||||
render json: {
|
||||
original_filename: upload.original_filename,
|
||||
width: upload.width,
|
||||
height: upload.height,
|
||||
human_filesize: upload.human_filesize
|
||||
}
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def render_404
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue