Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
03281fd2
ShopXO
项目概览
starsw001
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
03281fd2
编写于
1月 31, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
编辑器图片、附件、视频多选支持按照顺序选择插入编辑器
上级
a692a1ae
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
325 addition
and
46 deletion
+325
-46
public/static/common/lib/ueditor/dialogs/attachment/attachment.css
...atic/common/lib/ueditor/dialogs/attachment/attachment.css
+17
-0
public/static/common/lib/ueditor/dialogs/attachment/attachment.js
...tatic/common/lib/ueditor/dialogs/attachment/attachment.js
+86
-14
public/static/common/lib/ueditor/dialogs/image/image.css
public/static/common/lib/ueditor/dialogs/image/image.css
+17
-0
public/static/common/lib/ueditor/dialogs/image/image.html
public/static/common/lib/ueditor/dialogs/image/image.html
+12
-0
public/static/common/lib/ueditor/dialogs/image/image.js
public/static/common/lib/ueditor/dialogs/image/image.js
+92
-21
public/static/common/lib/ueditor/dialogs/video/video.css
public/static/common/lib/ueditor/dialogs/video/video.css
+17
-0
public/static/common/lib/ueditor/dialogs/video/video.js
public/static/common/lib/ueditor/dialogs/video/video.js
+84
-11
未找到文件。
public/static/common/lib/ueditor/dialogs/attachment/attachment.css
浏览文件 @
03281fd2
...
@@ -737,6 +737,23 @@ i.file-preview.file-type-psd{
...
@@ -737,6 +737,23 @@ i.file-preview.file-type-psd{
padding
:
2px
0
;
padding
:
2px
0
;
}
}
/**
* 选择计数
*/
#fileList
.select-count
{
position
:
absolute
;
top
:
25px
;
left
:
5px
;
background
:
#1194fa
;
color
:
#fff
;
font-weight
:
bold
;
padding
:
2px
5px
;
border-radius
:
15px
;
min-width
:
12px
;
text-align
:
center
;
display
:
none
;
}
/**
/**
* 右侧小导航
* 右侧小导航
...
...
public/static/common/lib/ueditor/dialogs/attachment/attachment.js
浏览文件 @
03281fd2
...
@@ -515,7 +515,8 @@
...
@@ -515,7 +515,8 @@
var
responseText
=
(
ret
.
_raw
||
ret
),
var
responseText
=
(
ret
.
_raw
||
ret
),
json
=
utils
.
str2json
(
responseText
);
json
=
utils
.
str2json
(
responseText
);
if
(
json
.
code
==
0
)
{
if
(
json
.
code
==
0
)
{
_this
.
fileList
.
push
(
json
.
data
);
//_this.fileList.push(json.data);
_this
.
fileList
[
$file
.
index
()]
=
json
.
data
;
$file
.
append
(
'
<span class="success"></span>
'
);
$file
.
append
(
'
<span class="success"></span>
'
);
}
else
{
}
else
{
$file
.
find
(
'
.error
'
).
text
(
json
.
msg
).
show
();
$file
.
find
(
'
.error
'
).
text
(
json
.
msg
).
show
();
...
@@ -564,12 +565,15 @@
...
@@ -564,12 +565,15 @@
var
i
,
link
,
data
,
list
=
[],
var
i
,
link
,
data
,
list
=
[],
prefix
=
editor
.
getOpt
(
'
fileUrlPrefix
'
);
prefix
=
editor
.
getOpt
(
'
fileUrlPrefix
'
);
for
(
i
=
0
;
i
<
this
.
fileList
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
this
.
fileList
.
length
;
i
++
)
{
data
=
this
.
fileList
[
i
];
data
=
this
.
fileList
[
i
]
||
null
;
link
=
data
.
url
;
if
(
data
!=
null
&&
(
data
.
url
||
null
)
!=
null
)
list
.
push
({
{
title
:
data
.
original
||
link
.
substr
(
link
.
lastIndexOf
(
'
/
'
)
+
1
),
link
=
data
.
url
;
url
:
prefix
+
link
list
.
push
({
});
title
:
data
.
original
||
link
.
substr
(
link
.
lastIndexOf
(
'
/
'
)
+
1
),
url
:
prefix
+
link
});
}
}
}
return
list
;
return
list
;
}
}
...
@@ -616,14 +620,62 @@
...
@@ -616,14 +620,62 @@
li
=
target
.
parentNode
;
li
=
target
.
parentNode
;
if
(
li
.
tagName
.
toLowerCase
()
==
'
li
'
)
{
if
(
li
.
tagName
.
toLowerCase
()
==
'
li
'
)
{
// 选择顺序 start
var
$select_count_container
=
$
(
li
).
find
(
'
.select-count
'
);
// 选择顺序 end
if
(
domUtils
.
hasClass
(
li
,
'
selected
'
))
{
if
(
domUtils
.
hasClass
(
li
,
'
selected
'
))
{
domUtils
.
removeClasses
(
li
,
'
selected
'
);
domUtils
.
removeClasses
(
li
,
'
selected
'
);
// 选择顺序 start
$select_count_container
.
css
(
'
display
'
,
'
none
'
);
$select_count_container
.
text
(
''
);
// 选择顺序 end
}
else
{
}
else
{
domUtils
.
addClass
(
li
,
'
selected
'
);
domUtils
.
addClass
(
li
,
'
selected
'
);
// 选择顺序 start
var
count
=
0
;
$
(
$G
(
'
fileList
'
)).
find
(
'
li.selected
'
).
each
(
function
(
k
,
v
)
{
var
temp
=
parseInt
(
$
(
this
).
find
(
'
.select-count
'
).
text
());
if
(
temp
>
count
)
{
count
=
temp
;
}
});
$select_count_container
.
css
(
'
display
'
,
'
block
'
);
$select_count_container
.
text
(
count
+
1
);
// 选择顺序 end
}
}
// 选择顺序 start
_this
.
selectSortHandle
();
// 选择顺序 end
}
}
});
});
},
},
/* 选择顺序处理 */
selectSortHandle
:
function
()
{
var
arr
=
[];
$
(
$G
(
'
fileList
'
)).
find
(
'
li.selected
'
).
each
(
function
(
k
,
v
)
{
var
count
=
parseInt
(
$
(
this
).
find
(
'
.select-count
'
).
text
())
-
1
;
arr
[
count
]
=
{
"
count
"
:
count
,
"
e
"
:
$
(
this
)
};
});
if
(
arr
.
length
>
0
)
{
arr
=
arr
.
sort
();
for
(
var
i
in
arr
)
{
$
(
arr
[
i
][
'
e
'
]).
find
(
'
.select-count
'
).
text
(
parseInt
(
i
)
+
1
);
}
}
},
/* 初始化第一次的数据 */
/* 初始化第一次的数据 */
initData
:
function
()
{
initData
:
function
()
{
...
@@ -723,6 +775,14 @@
...
@@ -723,6 +775,14 @@
original
.
innerHTML
=
list
[
i
].
original
;
original
.
innerHTML
=
list
[
i
].
original
;
item
.
appendChild
(
original
);
item
.
appendChild
(
original
);
// 原名功能 end
// 原名功能 end
// 选择计数 start
var
select_count
=
document
.
createElement
(
'
span
'
);
select_count
.
setAttribute
(
'
class
'
,
'
select-count
'
);
select_count
.
style
.
display
=
'
none
'
;
select_count
.
innerHTML
=
''
;
item
.
appendChild
(
select_count
);
// 选择计数 end
// 文件添加删除功能 start
// 文件添加删除功能 start
item
.
appendChild
(
$
(
"
<span class='delbtn' data-id='
"
+
list
[
i
].
id
+
"
'>x</span>
"
).
click
(
function
()
{
item
.
appendChild
(
$
(
"
<span class='delbtn' data-id='
"
+
list
[
i
].
id
+
"
'>x</span>
"
).
click
(
function
()
{
...
@@ -735,8 +795,16 @@
...
@@ -735,8 +795,16 @@
}
finally
{
}
finally
{
if
(
!
confirm
(
"
确定要删除吗?
"
))
return
;
if
(
!
confirm
(
"
确定要删除吗?
"
))
return
;
$
.
post
(
editor
.
getOpt
(
"
serverUrl
"
)
+
"
?action=deletefile
"
,
{
"
id
"
:
del
.
attr
(
"
data-id
"
)
},
function
(
response
)
{
$
.
post
(
editor
.
getOpt
(
"
serverUrl
"
)
+
"
?action=deletefile
"
,
{
"
id
"
:
del
.
attr
(
"
data-id
"
)
},
function
(
response
)
{
if
(
response
.
code
==
0
)
del
.
parent
().
remove
();
if
(
response
.
code
==
0
)
else
alert
(
response
.
msg
);
{
del
.
parent
().
remove
();
// 选择顺序 start
_this
.
selectSortHandle
();
// 选择顺序 end
}
else
{
alert
(
response
.
msg
);
}
});
});
}
}
})[
0
]);
})[
0
]);
...
@@ -779,13 +847,17 @@
...
@@ -779,13 +847,17 @@
if
(
domUtils
.
hasClass
(
lis
[
i
],
'
selected
'
))
{
if
(
domUtils
.
hasClass
(
lis
[
i
],
'
selected
'
))
{
var
url
=
lis
[
i
].
getAttribute
(
'
data-url
'
);
var
url
=
lis
[
i
].
getAttribute
(
'
data-url
'
);
var
title
=
lis
[
i
].
getAttribute
(
'
data-title
'
)
||
url
.
substr
(
url
.
lastIndexOf
(
'
/
'
)
+
1
);
var
title
=
lis
[
i
].
getAttribute
(
'
data-title
'
)
||
url
.
substr
(
url
.
lastIndexOf
(
'
/
'
)
+
1
);
list
.
push
({
if
((
lis
[
i
]
||
null
)
!=
null
)
title
:
title
,
{
url
:
url
var
index
=
parseInt
(
$
(
lis
[
i
]).
find
(
'
.select-count
'
).
text
())
-
1
;
});
list
[
index
]
=
{
title
:
title
,
url
:
url
}
}
}
}
}
}
return
list
;
return
list
.
length
?
list
.
sort
()
:
list
;
}
}
};
};
...
...
public/static/common/lib/ueditor/dialogs/image/image.css
浏览文件 @
03281fd2
...
@@ -734,6 +734,23 @@
...
@@ -734,6 +734,23 @@
padding
:
2px
0
;
padding
:
2px
0
;
}
}
/**
* 选择计数
*/
#imageList
.select-count
{
position
:
absolute
;
top
:
25px
;
left
:
5px
;
background
:
#1194fa
;
color
:
#fff
;
font-weight
:
bold
;
padding
:
2px
5px
;
border-radius
:
15px
;
min-width
:
12px
;
text-align
:
center
;
display
:
none
;
}
/**
/**
* 右侧小导航
* 右侧小导航
*/
*/
...
...
public/static/common/lib/ueditor/dialogs/image/image.html
浏览文件 @
03281fd2
...
@@ -93,5 +93,17 @@
...
@@ -93,5 +93,17 @@
</div>
</div>
<script
type=
"text/javascript"
src=
"image.js"
></script>
<script
type=
"text/javascript"
src=
"image.js"
></script>
<!-- 拖拽 -->
<script
type=
'text/javascript'
src=
"../../../dragsort/jquery.dragsort-0.5.2.min.js"
></script>
<script
type=
"text/javascript"
>
$
(
function
()
{
// 上传预览拖拽排序
$
(
'
ul.filelist
'
).
dragsort
({
dragSelector
:
'
img
'
,
placeHolderTemplate
:
'
<li></li>
'
});
});
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
public/static/common/lib/ueditor/dialogs/image/image.js
浏览文件 @
03281fd2
...
@@ -354,7 +354,7 @@
...
@@ -354,7 +354,7 @@
width
:
imageCompressBorder
,
width
:
imageCompressBorder
,
height
:
imageCompressBorder
,
height
:
imageCompressBorder
,
// 图片质量,只有type为`image/jpeg`的时候才有效。
// 图片质量,只有type为`image/jpeg`的时候才有效。
quality
:
9
0
,
quality
:
10
0
,
// 是否允许放大,如果想要生成小图的时候不失真,此选项应该设置为false.
// 是否允许放大,如果想要生成小图的时候不失真,此选项应该设置为false.
allowMagnify
:
false
,
allowMagnify
:
false
,
// 是否允许裁剪。
// 是否允许裁剪。
...
@@ -694,7 +694,8 @@
...
@@ -694,7 +694,8 @@
var
responseText
=
(
ret
.
_raw
||
ret
),
var
responseText
=
(
ret
.
_raw
||
ret
),
json
=
utils
.
str2json
(
responseText
);
json
=
utils
.
str2json
(
responseText
);
if
(
json
.
code
==
0
)
{
if
(
json
.
code
==
0
)
{
_this
.
imageList
.
push
(
json
.
data
);
//_this.imageList.push(json.data);
_this
.
imageList
[
$file
.
index
()]
=
json
.
data
;
$file
.
append
(
'
<span class="success"></span>
'
);
$file
.
append
(
'
<span class="success"></span>
'
);
}
else
{
}
else
{
$file
.
find
(
'
.error
'
).
text
(
json
.
msg
).
show
();
$file
.
find
(
'
.error
'
).
text
(
json
.
msg
).
show
();
...
@@ -747,14 +748,17 @@
...
@@ -747,14 +748,17 @@
align
=
getAlign
(),
align
=
getAlign
(),
prefix
=
editor
.
getOpt
(
'
imageUrlPrefix
'
);
prefix
=
editor
.
getOpt
(
'
imageUrlPrefix
'
);
for
(
i
=
0
;
i
<
this
.
imageList
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
this
.
imageList
.
length
;
i
++
)
{
data
=
this
.
imageList
[
i
];
data
=
this
.
imageList
[
i
]
||
null
;
list
.
push
({
if
(
data
!=
null
&&
(
data
.
url
||
null
)
!=
null
)
src
:
prefix
+
data
.
url
,
{
_src
:
prefix
+
data
.
url
,
list
.
push
({
title
:
data
.
title
,
src
:
prefix
+
data
.
url
,
alt
:
data
.
original
,
_src
:
prefix
+
data
.
url
,
floatStyle
:
align
title
:
data
.
title
,
});
alt
:
data
.
original
,
floatStyle
:
align
});
}
}
}
return
list
;
return
list
;
}
}
...
@@ -798,16 +802,64 @@
...
@@ -798,16 +802,64 @@
domUtils
.
on
(
this
.
container
,
'
click
'
,
function
(
e
)
{
domUtils
.
on
(
this
.
container
,
'
click
'
,
function
(
e
)
{
var
target
=
e
.
target
||
e
.
srcElement
,
var
target
=
e
.
target
||
e
.
srcElement
,
li
=
target
.
parentNode
;
li
=
target
.
parentNode
;
var
index
=
0
;
if
(
li
.
tagName
.
toLowerCase
()
==
'
li
'
)
{
if
(
li
.
tagName
.
toLowerCase
()
==
'
li
'
)
{
// 选择顺序 start
var
$select_count_container
=
$
(
li
).
find
(
'
.select-count
'
);
// 选择顺序 end
if
(
domUtils
.
hasClass
(
li
,
'
selected
'
))
{
if
(
domUtils
.
hasClass
(
li
,
'
selected
'
))
{
domUtils
.
removeClasses
(
li
,
'
selected
'
);
domUtils
.
removeClasses
(
li
,
'
selected
'
);
// 选择顺序 start
$select_count_container
.
css
(
'
display
'
,
'
none
'
);
$select_count_container
.
text
(
''
);
// 选择顺序 end
}
else
{
}
else
{
domUtils
.
addClass
(
li
,
'
selected
'
);
domUtils
.
addClass
(
li
,
'
selected
'
);
// 选择顺序 start
var
count
=
0
;
$
(
$G
(
'
imageList
'
)).
find
(
'
li.selected
'
).
each
(
function
(
k
,
v
)
{
var
temp
=
parseInt
(
$
(
this
).
find
(
'
.select-count
'
).
text
());
if
(
temp
>
count
)
{
count
=
temp
;
}
});
$select_count_container
.
css
(
'
display
'
,
'
block
'
);
$select_count_container
.
text
(
count
+
1
);
// 选择顺序 end
}
}
// 选择顺序 start
_this
.
selectSortHandle
();
// 选择顺序 end
}
}
});
});
},
},
/* 选择顺序处理 */
selectSortHandle
:
function
()
{
var
arr
=
[];
$
(
$G
(
'
imageList
'
)).
find
(
'
li.selected
'
).
each
(
function
(
k
,
v
)
{
var
count
=
parseInt
(
$
(
this
).
find
(
'
.select-count
'
).
text
())
-
1
;
arr
[
count
]
=
{
"
count
"
:
count
,
"
e
"
:
$
(
this
)
};
});
if
(
arr
.
length
>
0
)
{
arr
=
arr
.
sort
();
for
(
var
i
in
arr
)
{
$
(
arr
[
i
][
'
e
'
]).
find
(
'
.select-count
'
).
text
(
parseInt
(
i
)
+
1
);
}
}
},
/* 初始化第一次的数据 */
/* 初始化第一次的数据 */
initData
:
function
()
{
initData
:
function
()
{
...
@@ -898,6 +950,14 @@
...
@@ -898,6 +950,14 @@
original
.
innerHTML
=
list
[
i
].
original
;
original
.
innerHTML
=
list
[
i
].
original
;
item
.
appendChild
(
original
);
item
.
appendChild
(
original
);
// 原名功能 end
// 原名功能 end
// 选择计数 start
var
select_count
=
document
.
createElement
(
'
span
'
);
select_count
.
setAttribute
(
'
class
'
,
'
select-count
'
);
select_count
.
style
.
display
=
'
none
'
;
select_count
.
innerHTML
=
''
;
item
.
appendChild
(
select_count
);
// 选择计数 end
// 图片添加删除功能 start
// 图片添加删除功能 start
item
.
appendChild
(
$
(
"
<span class='delbtn' data-id='
"
+
list
[
i
].
id
+
"
'>x</span>
"
).
click
(
function
()
{
item
.
appendChild
(
$
(
"
<span class='delbtn' data-id='
"
+
list
[
i
].
id
+
"
'>x</span>
"
).
click
(
function
()
{
...
@@ -910,8 +970,16 @@
...
@@ -910,8 +970,16 @@
}
finally
{
}
finally
{
if
(
!
confirm
(
"
确定要删除吗?
"
))
return
;
if
(
!
confirm
(
"
确定要删除吗?
"
))
return
;
$
.
post
(
editor
.
getOpt
(
"
serverUrl
"
)
+
"
?action=deletefile
"
,
{
"
id
"
:
del
.
attr
(
"
data-id
"
)
},
function
(
response
)
{
$
.
post
(
editor
.
getOpt
(
"
serverUrl
"
)
+
"
?action=deletefile
"
,
{
"
id
"
:
del
.
attr
(
"
data-id
"
)
},
function
(
response
)
{
if
(
response
.
code
==
0
)
del
.
parent
().
remove
();
if
(
response
.
code
==
0
)
else
alert
(
response
.
msg
);
{
del
.
parent
().
remove
();
// 选择顺序 start
_this
.
selectSortHandle
();
// 选择顺序 end
}
else
{
alert
(
response
.
msg
);
}
});
});
}
}
})[
0
]);
})[
0
]);
...
@@ -954,16 +1022,19 @@
...
@@ -954,16 +1022,19 @@
if
(
domUtils
.
hasClass
(
lis
[
i
],
'
selected
'
))
{
if
(
domUtils
.
hasClass
(
lis
[
i
],
'
selected
'
))
{
var
img
=
lis
[
i
].
firstChild
,
var
img
=
lis
[
i
].
firstChild
,
src
=
img
.
getAttribute
(
'
_src
'
);
src
=
img
.
getAttribute
(
'
_src
'
);
list
.
push
({
if
((
lis
[
i
]
||
null
)
!=
null
)
src
:
src
,
{
_src
:
src
,
var
index
=
parseInt
(
$
(
lis
[
i
]).
find
(
'
.select-count
'
).
text
())
-
1
;
alt
:
src
.
substr
(
src
.
lastIndexOf
(
'
/
'
)
+
1
),
list
[
index
]
=
{
floatStyle
:
align
src
:
src
,
});
_src
:
src
,
alt
:
src
.
substr
(
src
.
lastIndexOf
(
'
/
'
)
+
1
),
floatStyle
:
align
}
}
}
}
}
}
return
list
;
return
list
.
length
?
list
.
sort
()
:
list
;
}
}
};
};
})();
})();
public/static/common/lib/ueditor/dialogs/video/video.css
浏览文件 @
03281fd2
...
@@ -805,6 +805,23 @@ i.file-preview.file-type-psd{
...
@@ -805,6 +805,23 @@ i.file-preview.file-type-psd{
padding
:
2px
0
;
padding
:
2px
0
;
}
}
/**
* 选择计数
*/
#videoList
.select-count
{
position
:
absolute
;
top
:
25px
;
left
:
5px
;
background
:
#1194fa
;
color
:
#fff
;
font-weight
:
bold
;
padding
:
2px
5px
;
border-radius
:
15px
;
min-width
:
12px
;
text-align
:
center
;
display
:
none
;
}
/**
/**
* 右侧小导航
* 右侧小导航
...
...
public/static/common/lib/ueditor/dialogs/video/video.js
浏览文件 @
03281fd2
...
@@ -180,14 +180,62 @@
...
@@ -180,14 +180,62 @@
li
=
target
.
parentNode
;
li
=
target
.
parentNode
;
if
(
li
.
tagName
.
toLowerCase
()
==
'
li
'
)
{
if
(
li
.
tagName
.
toLowerCase
()
==
'
li
'
)
{
// 选择顺序 start
var
$select_count_container
=
$
(
li
).
find
(
'
.select-count
'
);
// 选择顺序 end
if
(
domUtils
.
hasClass
(
li
,
'
selected
'
))
{
if
(
domUtils
.
hasClass
(
li
,
'
selected
'
))
{
domUtils
.
removeClasses
(
li
,
'
selected
'
);
domUtils
.
removeClasses
(
li
,
'
selected
'
);
// 选择顺序 start
$select_count_container
.
css
(
'
display
'
,
'
none
'
);
$select_count_container
.
text
(
''
);
// 选择顺序 end
}
else
{
}
else
{
domUtils
.
addClass
(
li
,
'
selected
'
);
domUtils
.
addClass
(
li
,
'
selected
'
);
// 选择顺序 start
var
count
=
0
;
$
(
$G
(
'
videoList
'
)).
find
(
'
li.selected
'
).
each
(
function
(
k
,
v
)
{
var
temp
=
parseInt
(
$
(
this
).
find
(
'
.select-count
'
).
text
());
if
(
temp
>
count
)
{
count
=
temp
;
}
});
$select_count_container
.
css
(
'
display
'
,
'
block
'
);
$select_count_container
.
text
(
count
+
1
);
// 选择顺序 end
}
}
// 选择顺序 start
_this
.
selectSortHandle
();
// 选择顺序 end
}
}
});
});
},
},
/* 选择顺序处理 */
selectSortHandle
:
function
()
{
var
arr
=
[];
$
(
$G
(
'
videoList
'
)).
find
(
'
li.selected
'
).
each
(
function
(
k
,
v
)
{
var
count
=
parseInt
(
$
(
this
).
find
(
'
.select-count
'
).
text
())
-
1
;
arr
[
count
]
=
{
"
count
"
:
count
,
"
e
"
:
$
(
this
)
};
});
if
(
arr
.
length
>
0
)
{
arr
=
arr
.
sort
();
for
(
var
i
in
arr
)
{
$
(
arr
[
i
][
'
e
'
]).
find
(
'
.select-count
'
).
text
(
parseInt
(
i
)
+
1
);
}
}
},
/* 初始化第一次的数据 */
/* 初始化第一次的数据 */
initData
:
function
()
{
initData
:
function
()
{
...
@@ -275,6 +323,14 @@
...
@@ -275,6 +323,14 @@
original
.
innerHTML
=
list
[
i
].
original
;
original
.
innerHTML
=
list
[
i
].
original
;
item
.
appendChild
(
original
);
item
.
appendChild
(
original
);
// 原名功能 end
// 原名功能 end
// 选择计数 start
var
select_count
=
document
.
createElement
(
'
span
'
);
select_count
.
setAttribute
(
'
class
'
,
'
select-count
'
);
select_count
.
style
.
display
=
'
none
'
;
select_count
.
innerHTML
=
''
;
item
.
appendChild
(
select_count
);
// 选择计数 end
// 视频添加删除功能 start
// 视频添加删除功能 start
item
.
appendChild
(
$
(
"
<span class='delbtn' data-id='
"
+
list
[
i
].
id
+
"
'>x</span>
"
).
click
(
function
()
{
item
.
appendChild
(
$
(
"
<span class='delbtn' data-id='
"
+
list
[
i
].
id
+
"
'>x</span>
"
).
click
(
function
()
{
...
@@ -287,8 +343,16 @@
...
@@ -287,8 +343,16 @@
}
finally
{
}
finally
{
if
(
!
confirm
(
"
确定要删除吗?
"
))
return
;
if
(
!
confirm
(
"
确定要删除吗?
"
))
return
;
$
.
post
(
editor
.
getOpt
(
"
serverUrl
"
)
+
"
?action=deletefile
"
,
{
"
id
"
:
del
.
attr
(
"
data-id
"
)
},
function
(
response
)
{
$
.
post
(
editor
.
getOpt
(
"
serverUrl
"
)
+
"
?action=deletefile
"
,
{
"
id
"
:
del
.
attr
(
"
data-id
"
)
},
function
(
response
)
{
if
(
response
.
code
==
0
)
del
.
parent
().
remove
();
if
(
response
.
code
==
0
)
else
alert
(
response
.
msg
);
{
del
.
parent
().
remove
();
// 选择顺序 start
_this
.
selectSortHandle
();
// 选择顺序 end
}
else
{
alert
(
response
.
msg
);
}
});
});
}
}
})[
0
]);
})[
0
]);
...
@@ -304,16 +368,20 @@
...
@@ -304,16 +368,20 @@
if
(
domUtils
.
hasClass
(
lis
[
i
],
'
selected
'
))
{
if
(
domUtils
.
hasClass
(
lis
[
i
],
'
selected
'
))
{
var
video
=
lis
[
i
].
firstChild
,
var
video
=
lis
[
i
].
firstChild
,
src
=
video
.
getAttribute
(
'
_src
'
);
src
=
video
.
getAttribute
(
'
_src
'
);
list
.
push
({
if
((
lis
[
i
]
||
null
)
!=
null
)
src
:
src
,
{
_src
:
src
,
var
index
=
parseInt
(
$
(
lis
[
i
]).
find
(
'
.select-count
'
).
text
())
-
1
;
alt
:
src
.
substr
(
src
.
lastIndexOf
(
'
/
'
)
+
1
),
list
[
index
]
=
{
floatStyle
:
align
src
:
src
,
});
_src
:
src
,
alt
:
src
.
substr
(
src
.
lastIndexOf
(
'
/
'
)
+
1
),
floatStyle
:
align
}
}
}
}
}
}
return
list
;
return
list
.
length
?
list
.
sort
()
:
list
;
}
}
};
};
...
@@ -964,11 +1032,16 @@
...
@@ -964,11 +1032,16 @@
var
responseText
=
(
ret
.
_raw
||
ret
),
var
responseText
=
(
ret
.
_raw
||
ret
),
json
=
utils
.
str2json
(
responseText
);
json
=
utils
.
str2json
(
responseText
);
if
(
json
.
code
==
0
)
{
if
(
json
.
code
==
0
)
{
uploadVideoList
.
push
({
// uploadVideoList.push({
// 'url': json.data.url,
// 'type': json.data.type,
// 'original':json.data.original
// });
uploadVideoList
[
$file
.
index
()]
=
{
'
url
'
:
json
.
data
.
url
,
'
url
'
:
json
.
data
.
url
,
'
type
'
:
json
.
data
.
type
,
'
type
'
:
json
.
data
.
type
,
'
original
'
:
json
.
data
.
original
'
original
'
:
json
.
data
.
original
}
)
;
};
$file
.
append
(
'
<span class="success"></span>
'
);
$file
.
append
(
'
<span class="success"></span>
'
);
}
else
{
}
else
{
$file
.
find
(
'
.error
'
).
text
(
json
.
msg
).
show
();
$file
.
find
(
'
.error
'
).
text
(
json
.
msg
).
show
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录