mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 21:12:15 +09:00
Merge #1758 이미지 파일 업로드시 본문 자동삽입되도록 수정 by YJSoft
* pr/1758: source_filename으로 확장자 체크하도록 수정 이미지 파일 업로드시 본문 자동삽입되도록 수정
This commit is contained in:
commit
fa32b47539
2 changed files with 14 additions and 1 deletions
|
|
@ -93,6 +93,7 @@
|
||||||
},
|
},
|
||||||
done: function(e, res) {
|
done: function(e, res) {
|
||||||
var result = res.response().result;
|
var result = res.response().result;
|
||||||
|
var temp_code = '';
|
||||||
|
|
||||||
if(!result) return;
|
if(!result) return;
|
||||||
|
|
||||||
|
|
@ -101,6 +102,12 @@
|
||||||
if(!result) return;
|
if(!result) return;
|
||||||
|
|
||||||
if(result.error == 0) {
|
if(result.error == 0) {
|
||||||
|
if(/\.(jpe?g|png|gif)$/i.test(result.source_filename)) {
|
||||||
|
temp_code += '<img src="' + window.request_uri + result.download_url + '" alt="' + result.source_filename + '" editor_component="image_link" data-file-srl="' + result.file_srl + '" />';
|
||||||
|
temp_code += "\r\n<p><br></p>\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
_getCkeInstance(settings.formData.editor_sequence).insertHtml(temp_code, "unfiltered_html");
|
||||||
} else {
|
} else {
|
||||||
alert(result.message);
|
alert(result.message);
|
||||||
}
|
}
|
||||||
|
|
@ -236,7 +243,7 @@
|
||||||
|
|
||||||
if(!fileinfo) return;
|
if(!fileinfo) return;
|
||||||
|
|
||||||
if(/\.(jpe?g|png|gif)$/i.test(fileinfo.download_url)) {
|
if(/\.(jpe?g|png|gif)$/i.test(fileinfo.source_filename)) {
|
||||||
temp_code += '<img src="' + window.request_uri + fileinfo.download_url + '" alt="' + fileinfo.source_filename + '" editor_component="image_link" data-file-srl="' + fileinfo.file_srl + '" />';
|
temp_code += '<img src="' + window.request_uri + fileinfo.download_url + '" alt="' + fileinfo.source_filename + '" editor_component="image_link" data-file-srl="' + fileinfo.file_srl + '" />';
|
||||||
temp_code += "\r\n<p><br></p>\r\n";
|
temp_code += "\r\n<p><br></p>\r\n";
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,12 @@ class fileController extends file
|
||||||
|
|
||||||
$output = $this->insertFile($file_info, $module_srl, $upload_target_srl);
|
$output = $this->insertFile($file_info, $module_srl, $upload_target_srl);
|
||||||
Context::setResponseMethod('JSON');
|
Context::setResponseMethod('JSON');
|
||||||
|
$this->add('file_srl',$output->get('file_srl'));
|
||||||
|
$this->add('file_size',$output->get('file_size'));
|
||||||
|
$this->add('direct_download',$output->get('direct_download'));
|
||||||
|
$this->add('source_filename',$output->get('source_filename'));
|
||||||
|
$this->add('download_url',$output->get('uploaded_filename'));
|
||||||
|
$this->add('upload_target_srl',$output->get('upload_target_srl'));
|
||||||
if($output->error != '0') $this->stop($output->message);
|
if($output->error != '0') $this->stop($output->message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue