mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-08-06 22:09:45 +08:00
[更新]修改富文本编辑多图片上传
This commit is contained in:
parent
66f9cd9c9f
commit
1dafee3acd
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh-CN">
|
<html lang="zh-CN">
|
||||||
<head>
|
<head>
|
||||||
<title>{'app_name'|sysconf} {'app_version'|sysconf}</title>
|
<title>{:sysconf('app_name')} {:sysconf('app_version')}</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<link rel="icon" href="../image/favicon.ico">
|
<link rel="icon" href="../image/favicon.ico">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
@ -54,8 +54,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function confirmSelected() {
|
function confirmSelected() {
|
||||||
var srcs = new Array();
|
var srcs = new Array(), md5s = new Array();
|
||||||
var md5s = new Array();
|
|
||||||
$('[data-md5] .success').map(function () {
|
$('[data-md5] .success').map(function () {
|
||||||
var $li = $(this).parents('[data-md5]');
|
var $li = $(this).parents('[data-md5]');
|
||||||
md5s.push($li.attr('data-md5'));
|
md5s.push($li.attr('data-md5'));
|
||||||
@ -101,8 +100,7 @@
|
|||||||
/*优化retina, 在retina下这个值是2*/
|
/*优化retina, 在retina下这个值是2*/
|
||||||
ratio = window.devicePixelRatio || 1,
|
ratio = window.devicePixelRatio || 1,
|
||||||
/*缩略图大小*/
|
/*缩略图大小*/
|
||||||
thumbnailWidth = 110 * ratio,
|
thumbnailWidth = 110 * ratio, thumbnailHeight = 110 * ratio,
|
||||||
thumbnailHeight = 110 * ratio,
|
|
||||||
/*可能有pedding, ready, uploading, confirm, done.*/
|
/*可能有pedding, ready, uploading, confirm, done.*/
|
||||||
state = 'pedding',
|
state = 'pedding',
|
||||||
/*所有文件的进度信息,key为file id*/
|
/*所有文件的进度信息,key为file id*/
|
||||||
@ -218,7 +216,11 @@
|
|||||||
pick: {
|
pick: {
|
||||||
id: '#filePicker',
|
id: '#filePicker',
|
||||||
label: '点击选择文件',
|
label: '点击选择文件',
|
||||||
multiple: false
|
/*{if $mode === 'one'}*/
|
||||||
|
multiple: false,
|
||||||
|
/* {else} */
|
||||||
|
multiple: true,
|
||||||
|
/* {/if} */
|
||||||
},
|
},
|
||||||
accept: {
|
accept: {
|
||||||
title: '选择文件',
|
title: '选择文件',
|
||||||
@ -227,18 +229,18 @@
|
|||||||
},
|
},
|
||||||
formData: {},
|
formData: {},
|
||||||
/*{if $mode === 'one'}*/
|
/*{if $mode === 'one'}*/
|
||||||
fileNumLimit: 1,
|
|
||||||
auto: true,
|
auto: true,
|
||||||
/* {else /} */
|
fileNumLimit: 1,
|
||||||
|
/* {else} */
|
||||||
auto: false,
|
auto: false,
|
||||||
fileNumLimit: 300,
|
fileNumLimit: 300,
|
||||||
/* {/if} */
|
/* {/if} */
|
||||||
|
server: '{:url("admin/plugs/upload")}',
|
||||||
swf: '__PUBLIC__/static/plugs/uploader/Uploader.swf',
|
swf: '__PUBLIC__/static/plugs/uploader/Uploader.swf',
|
||||||
chunked: false,
|
chunked: false,
|
||||||
dnd: '#dndArea',
|
dnd: '#dndArea',
|
||||||
paste: document.body,
|
paste: document.body,
|
||||||
chunkSize: 512 * 1024,
|
chunkSize: 512 * 1024,
|
||||||
server: '{:url("admin/plugs/upload")}',
|
|
||||||
disableGlobalDnd: true,
|
disableGlobalDnd: true,
|
||||||
fileSizeLimit: 200 * 1024 * 1024, // 200 M
|
fileSizeLimit: 200 * 1024 * 1024, // 200 M
|
||||||
fileSingleSizeLimit: 200 * 1024 * 1024, // 200 M
|
fileSingleSizeLimit: 200 * 1024 * 1024, // 200 M
|
||||||
|
@ -7,7 +7,7 @@ define(['zeroclipboard'], function (ZeroClipboard) {
|
|||||||
cssRules: 'background-position: -380px 0px;',
|
cssRules: 'background-position: -380px 0px;',
|
||||||
onclick: function () {
|
onclick: function () {
|
||||||
var field = '_editor_upload_' + Math.floor(Math.random() * 100000);
|
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 () {
|
$('<input type="hidden">').attr('name', field).appendTo(editor.container).on('change', function () {
|
||||||
var srcs = this.value.split('|'), data = new Array();
|
var srcs = this.value.split('|'), data = new Array();
|
||||||
for (var i in srcs) {
|
for (var i in srcs) {
|
||||||
@ -37,7 +37,7 @@ define(['zeroclipboard'], function (ZeroClipboard) {
|
|||||||
cssRules: 'background-position: -726px -77px;',
|
cssRules: 'background-position: -726px -77px;',
|
||||||
onclick: function () {
|
onclick: function () {
|
||||||
var field = '_editor_upload_' + Math.floor(Math.random() * 100000);
|
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 () {
|
$('<input type="hidden">').attr('name', field).appendTo(editor.container).on('change', function () {
|
||||||
var srcs = this.value.split('|');
|
var srcs = this.value.split('|');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user