UX: Lightbox support for image uploader. (#7034)

This commit is contained in:
Guo Xiang Tan
2019-02-21 10:13:37 +08:00
committed by GitHub
parent 3cb676bf42
commit 58b0e945bd
12 changed files with 160 additions and 55 deletions

View File

@ -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