[更新]修改富文本编辑多图片上传

This commit is contained in:
Anyon 2017-05-15 18:42:57 +08:00
parent 66f9cd9c9f
commit 1dafee3acd
2 changed files with 13 additions and 11 deletions

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>{'app_name'|sysconf} {'app_version'|sysconf}</title>
<title>{:sysconf('app_name')} {:sysconf('app_version')}</title>
<meta charset="utf-8">
<link rel="icon" href="../image/favicon.ico">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@ -54,8 +54,7 @@
}
function confirmSelected() {
var srcs = new Array();
var md5s = new Array();
var srcs = new Array(), md5s = new Array();
$('[data-md5] .success').map(function () {
var $li = $(this).parents('[data-md5]');
md5s.push($li.attr('data-md5'));
@ -101,8 +100,7 @@
/*优化retina, 在retina下这个值是2*/
ratio = window.devicePixelRatio || 1,
/*缩略图大小*/
thumbnailWidth = 110 * ratio,
thumbnailHeight = 110 * ratio,
thumbnailWidth = 110 * ratio, thumbnailHeight = 110 * ratio,
/*可能有pedding, ready, uploading, confirm, done.*/
state = 'pedding',
/*所有文件的进度信息key为file id*/
@ -218,7 +216,11 @@
pick: {
id: '#filePicker',
label: '点击选择文件',
multiple: false
/*{if $mode === 'one'}*/
multiple: false,
/* {else} */
multiple: true,
/* {/if} */
},
accept: {
title: '选择文件',
@ -227,18 +229,18 @@
},
formData: {},
/*{if $mode === 'one'}*/
fileNumLimit: 1,
auto: true,
/* {else /} */
fileNumLimit: 1,
/* {else} */
auto: false,
fileNumLimit: 300,
/* {/if} */
server: '{:url("admin/plugs/upload")}',
swf: '__PUBLIC__/static/plugs/uploader/Uploader.swf',
chunked: false,
dnd: '#dndArea',
paste: document.body,
chunkSize: 512 * 1024,
server: '{:url("admin/plugs/upload")}',
disableGlobalDnd: true,
fileSizeLimit: 200 * 1024 * 1024, // 200 M
fileSingleSizeLimit: 200 * 1024 * 1024, // 200 M

View File

@ -7,7 +7,7 @@ define(['zeroclipboard'], function (ZeroClipboard) {
cssRules: 'background-position: -380px 0px;',
onclick: function () {
var field = '_editor_upload_' + Math.floor(Math.random() * 100000);
var url = window.ROOT_URL + '/index.php/admin/plugs/upfile/mode/one.html?uptype=qiniu&type=png,jpg,gif&field=' + field;
var url = window.ROOT_URL + '/index.php/admin/plugs/upfile.html?mode=one&type=png,jpg,gif,jpeg&field=' + field;
$('<input type="hidden">').attr('name', field).appendTo(editor.container).on('change', function () {
var srcs = this.value.split('|'), data = new Array();
for (var i in srcs) {
@ -37,7 +37,7 @@ define(['zeroclipboard'], function (ZeroClipboard) {
cssRules: 'background-position: -726px -77px;',
onclick: function () {
var field = '_editor_upload_' + Math.floor(Math.random() * 100000);
var url = window.ROOT_URL + '/index.php/admin/plugs/upfile/mode/two.html?uptype=qiniu&type=png,jpg,gif&field=' + field;
var url = window.ROOT_URL + '/index.php/admin/plugs/upfile.html?mode=two&type=png,jpg,gif,jpeg&field=' + field;
$('<input type="hidden">').attr('name', field).appendTo(editor.container).on('change', function () {
var srcs = this.value.split('|');
setTimeout(function () {