提交 70dd60e0 编写于 作者: D devil

编辑器接口优化+涂鸦

上级 6c25c1a5
......@@ -11,7 +11,6 @@
namespace app\api\controller;
use app\service\UeditorService;
use app\service\ResourcesService;
/**
* 附件上传
......@@ -48,12 +47,7 @@ class Ueditor extends Common
*/
public function Index()
{
$ret = UeditorService::Run($this->data_request);
if($ret['code'] == 0 && !empty($ret['data']['url']))
{
$ret['data']['url'] = ResourcesService::AttachmentPathViewHandle(ResourcesService::AttachmentPathHandle($ret['data']['url']));
}
return $ret;
return UeditorService::Run($this->data_request);
}
}
?>
\ No newline at end of file
......@@ -198,6 +198,7 @@ class ResourcesService
]);
$params['id'] = $attachment_id;
$params['url'] = self::AttachmentPathViewHandle($data['url']);
$params['add_time'] = date('Y-m-d H:i:s', $data['add_time']);
return DataReturn('添加成功', 0, $params);
}
......
......@@ -49,7 +49,7 @@ class UeditorService
{
// 配置信息
case 'config':
$ret = self::$current_config;
$ret = DataReturn('success', 0, self::$current_config);
break;
/* 上传图片 */
......@@ -80,18 +80,7 @@ class UeditorService
/* 删除文件 */
case 'deletefile':
$ret = self::DeleteFile();
break;
}
// 输出结果
if(!empty($params['callback']))
{
if(preg_match("/^[\w_]+$/", $params['callback']))
{
return DataReturn(htmlspecialchars($params['callback']), -1);
} else {
return DataReturn('callback参数不合法', -1);
}
break;
}
return $ret;
}
......@@ -224,8 +213,8 @@ class UeditorService
$allow_files = substr(str_replace(".", "|", join("", $allow_files)), 1);
/* 获取参数 */
$size = isset(self::$params['size']) ? htmlspecialchars(self::$params['size']) : $list_size;
$start = isset(self::$params['start']) ? htmlspecialchars(self::$params['start']) : 0;
$size = isset(self::$params['size']) ? intval(self::$params['size']) : $list_size;
$start = isset(self::$params['start']) ? intval(self::$params['start']) : 0;
$end = $start + $size;
// 参数
......
......@@ -1612,7 +1612,14 @@ function TableContainerInit()
$('.am-table-scrollable-horizontal tbody tr').each(function(k, v)
{
// 容器
var height = $(this).data('height') || $(this).height() || 0;
var height = $(this).height() || 0;
// 自定义高度,仅大于默认高度的时候有效
var z_height = $(this).data('height') || 0;
if(z_height > height)
{
height = z_height;
}
if(height > 0)
{
$(this).find('td').css('height', height+'px');
......
......@@ -73,7 +73,7 @@ em{font-style: normal;}
/**
* 手机端自适应
*/
@media only screen and (max-width: 641px) {
@media only screen and (max-width: 500px) {
.main {
width: calc(100% - 16px);
}
......@@ -82,25 +82,35 @@ em{font-style: normal;}
}
.hot, .picBoard {
width: 100%;
height: 150px;
height: 340px;
}
.picBoard {
width: 100%;
}
.drawBoard {
height: 100%;
height: 300px;
}
.brushBorad {
width: 100%;
height: 100%
}
.operateBar {
width: 50%;
width: 100%;
}
.drawToolbar {
height: 185px;
width: 100%;
height: 110px;
overflow: hidden;
}
.drawToolbar #J_colorBar {
float: left;
}
.drawToolbar #J_colorBar table {
width: 110px;
}
.sectionBar {
margin-top: 6px;
margin-top: 5px;
text-align: right;
padding-right: 10px;
}
}
\ No newline at end of file
......@@ -11,7 +11,7 @@
<div class="main" id="J_wrap">
<div class="hot">
<div class="drawBoard border_style1">
<canvas id="J_brushBoard" class="brushBorad"></canvas>
<canvas id="J_brushBoard" class="brushBorad" width="360" height="300"></canvas>
<div id="J_picBoard" class="picBoard" style="width: 360px;height: 300px"></div>
</div>
<div id="J_operateBar" class="operateBar">
......
......@@ -14,6 +14,8 @@ var scrawl = function (options) {
drawStep = [], //undo redo存储
drawStepIndex = 0; //undo redo指针
//canvas.width = 400;
scrawl.prototype = {
isScrawl:false, //是否涂鸦
brushWidth:-1, //画笔粗细
......
......@@ -1172,7 +1172,7 @@ div.edui-box {
/* 弹出对话框按钮和对话框大小 */
.edui-default .edui-dialog {
position: absolute;
z-index: 1210 !important;
z-index: 1210;
}
.edui-dialog div{
......@@ -1306,7 +1306,7 @@ div.edui-box {
filter: alpha(opacity = 30);
background-color: #ccc;
position: absolute;
z-index: 1200 !important;
z-index: 1200;
}
.edui-default .edui-dialog-dragmask {
......@@ -1575,7 +1575,7 @@ div.edui-box {
margin-right: 1px;
font-size: 12px;
line-height: 14px;
height: 14px;
height: 20px;
border: 1px solid #333;
padding: 3px 5px;
cursor: pointer;
......
......@@ -8090,10 +8090,15 @@ UE.Editor.defaultOptions = function(editor){
'dataType': isJsonp ? 'jsonp':'',
'onsuccess':function(r){
try {
var config = isJsonp ? r:eval("("+r.responseText+")");
utils.extend(me.options, config);
me.fireEvent('serverConfigLoaded');
me._serverConfigLoaded = true;
var res = isJsonp ? r:eval("("+r.responseText+")");
if(res.code == 0)
{
utils.extend(me.options, res.data);
me.fireEvent('serverConfigLoaded');
me._serverConfigLoaded = true;
} else {
showErrorMsg(res.msg);
}
} catch (e) {
showErrorMsg(me.getLang('loadconfigFormatError'));
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册