处理uEditor中的视频BUG

This commit is contained in:
wenc000 2020-04-05 00:36:39 +08:00
parent 5f95149b36
commit 523c35624a
3 changed files with 22 additions and 18 deletions

View File

@ -2,10 +2,11 @@
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="../../../../../../">
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js"></script>
<link rel="stylesheet" type="text/css" href="video.css" />
<script type="text/javascript" src="assets/js/vendor/ueditor/dialogs/internal.js"></script>
<link rel="stylesheet" type="text/css" href="assets/js/vendor/ueditor/dialogs/video/video.css" />
</head>
<body>
<div class="wrapper">
@ -74,13 +75,13 @@
</div>
<!-- jquery -->
<script type="text/javascript" src="../../third-party/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="assets/js/vendor/ueditor/third-party/jquery-1.10.2.min.js"></script>
<!-- webuploader -->
<script type="text/javascript" src="../../third-party/webuploader/webuploader.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css">
<script type="text/javascript" src="assets/js/vendor/ueditor/third-party/webuploader/webuploader.min.js"></script>
<link rel="stylesheet" type="text/css" href="assets/js/vendor/ueditor/third-party/webuploader/webuploader.css">
<!-- video -->
<script type="text/javascript" src="video.js"></script>
<script type="text/javascript" src="assets/js/vendor/ueditor/dialogs/video/video.js"></script>
</body>
</html>

View File

@ -220,7 +220,7 @@
var div = document.createElement( "div" );
div.setAttribute( "name", j );
if ( j == "none" ) div.className="focus";
div.style.cssText = "background:url(images/" + j + "_focus.jpg);";
div.style.cssText = "background:url(./assets/js/vendor/ueditor/dialogs/video/images/" + j + "_focus.jpg);";
div.setAttribute( "title", nameMaps[j] );
floatContainer.appendChild( div );
}
@ -272,13 +272,16 @@
conUrl = utils.unhtmlForUrl(conUrl);
$G("preview").innerHTML = '<div class="previewMsg"><span>'+lang.urlError+'</span></div>'+
'<embed class="previewVideo" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' +
' src="' + conUrl + '"' +
' width="' + 420 + '"' +
' height="' + 280 + '"' +
' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >' +
'</embed>';
$G("preview").innerHTML = '<video controls="" preload="none" width="420" height="280" src="'+ conUrl +'" data-setup="{}">' +
'<source src="'+ conUrl +'" type="video/mp4"/>' +
'</video>';
// $G("preview").innerHTML = '<div class="previewMsg"><span>'+lang.urlError+'</span></div>'+
// '<embed class="previewVideo" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' +
// ' src="' + conUrl + '"' +
// ' width="' + 420 + '"' +
// ' height="' + 280 + '"' +
// ' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >' +
// '</embed>';
}

View File

@ -362,14 +362,14 @@
//output xss过滤
,outputXssFilter: true
// xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js
,whitList: {
,whiteList: {
a: ['target', 'href', 'title', 'class', 'style'],
abbr: ['title', 'class', 'style'],
address: ['class', 'style'],
area: ['shape', 'coords', 'href', 'alt'],
article: [],
aside: [],
audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'class', 'style'],
audio: ['autoplay', 'controls', 'loop', 'preload', 'src', '_src', '_url', 'class', 'style'],
b: ['class', 'style'],
bdi: ['dir'],
bdo: ['dir'],
@ -400,7 +400,7 @@
header: [],
hr: [],
i: ['class', 'style'],
img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', 'loadingclass', 'class', 'data-latex'],
img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', '_url', 'loadingclass', 'class', 'data-latex'],
ins: ['datetime'],
li: ['class', 'style'],
mark: [],
@ -425,7 +425,7 @@
tt: [],
u: [],
ul: ['class', 'style'],
video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style']
video: ['autoplay', 'controls', 'loop', 'preload', 'src', '_src', '_url', 'height', 'width', 'class', 'style']
}
};