#1086 CKEditor 스킨에 파일 업로드 추가

This commit is contained in:
bnu 2015-02-26 18:07:10 +09:00
parent 95154d6985
commit 8731b3cd8a
30 changed files with 5253 additions and 11 deletions

View file

@ -24,6 +24,47 @@
<div id="ckeditor_instance_{$editor_sequence}"></div>
<!--%load_js_plugin("jquery.fileupload")-->
<div id="fileUploaderContainer_{$editor_sequence}" class="xe-uploader-container clearfix" data-editor-sequence="{$editor_sequence}">
<div class="xe-uploader-preview">
<img />
</div>
<div style="display:inline-block; vertical-align:top;">
<div class="xe-uploader-filelist" style="">
<select id="uploaded_file_list_{$editor_sequence}" multiple="multiple" class="" style="width: 300px;">
</select>
</div>
<div style="display:inline-block;vertical-align:top;">
<!-- PROGRESS -->
<div id="progress" class="progress">
<div class="progress-bar progress-bar-success"></div>
</div>
<!-- END:PROGRESS -->
<div class="xe-fileupload-controll">
<span class="btn fileinput-button">
<span>파일첨부</span>
<input id="xe-fileupload" type="file" class="fileupload-processing" name="Filedata" data-auto-upload="true" data-editor-sequence="{$editor_sequence}" multiple />
</span>
<button type="button" class="btn xe-act-delete-selected">{$lang->edit->delete_selected}</button>
<button type="button" class="btn xe-act-link-selected">{$lang->edit->link_file}</button>
</div>
<div class="file_attach_info" style="display:inline-block;" id="uploader_status_{$editor_sequence}">{$upload_status}</div>
</div>
</div>
<script>
(function($) {/**/
$(function () {/**/
var uploader = $('#fileUploaderContainer_{$editor_sequence}').xeUploader();
});
}) (jQuery);
</script>
</div>
<script>
(function($){
"use strict";
@ -87,3 +128,17 @@
});
})(jQuery);
</script>
<style>
.clearfix:before, .clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
</style>

View file

@ -43,7 +43,8 @@ class fileController extends file
// Create if upload_target_srl is not defined in the session information
if(!$upload_target_srl) $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = getNextSequence();
return $this->insertFile($file_info, $module_srl, $upload_target_srl);
$output = $this->insertFile($file_info, $module_srl, $upload_target_srl);
Context::setResponseMethod('JSON');
}
/**

View file

@ -67,11 +67,19 @@ class fileModel extends file
$file_config = $this->getUploadConfig();
$left_size = $file_config->allowed_attach_size*1024*1024 - $attached_size;
// Settings of required information
$attached_size = FileHandler::filesize($attached_size);
$allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size*1024*1024);
$allowed_filesize = FileHandler::filesize($file_config->allowed_filesize*1024*1024);
$allowed_filetypes = $file_config->allowed_filetypes;
$this->add("files",$files);
$this->add("editor_sequence",$editor_sequence);
$this->add("upload_target_srl",$upload_target_srl);
$this->add("upload_status",$upload_status);
$this->add("left_size",$left_size);
$this->add('attached_size', $attached_size);
$this->add('allowed_attach_size', $allowed_attach_size);
$this->add('allowed_filesize', $allowed_filesize);
$this->add('allowed_filetypes', $allowed_filetypes);
}
/**

View file

@ -0,0 +1,24 @@
(function($){
"use strict";
var XeUploader = xe.createApp('XeUploader', {
init : function() {
}
});
// Shortcut function in jQuery
$.fn.uploader = function(opts) {
console.log();
var u = new XeUploader(this.eq(0), opts);
if(u) xe.registerApp(u);
return u;
};
// Shortcut function in XE
xe.createUploader = function(browseButton, opts) {
var u = new XeUploader(browseButton, opts);
if(u) xe.registerApp(u);
return u;
};
})(jQuery);