@seafile/sdoc-editor 1.0.206-test0.4.5 → 1.0.206-test0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,7 +35,6 @@ const AddVideoLinkDialog = _ref => {
|
|
|
35
35
|
setLinkErrorMessage(t('The_link_address_is_invalid'));
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
console.log(url);
|
|
39
38
|
(0, _helpers.insertVideo)(editor, [{
|
|
40
39
|
name: url,
|
|
41
40
|
isEmbeddableLink: true
|
|
@@ -56,7 +55,6 @@ const AddVideoLinkDialog = _ref => {
|
|
|
56
55
|
const handleUrlChange = (0, _react.useCallback)(event => {
|
|
57
56
|
const videoUrl = event.target.value;
|
|
58
57
|
if (videoUrl === url) return;
|
|
59
|
-
console.log(videoUrl);
|
|
60
58
|
setURL(videoUrl);
|
|
61
59
|
}, [url]);
|
|
62
60
|
return /*#__PURE__*/_react.default.createElement(_reactstrap.Modal, {
|
|
@@ -66,8 +66,9 @@ const parseVideoLink = url => {
|
|
|
66
66
|
|
|
67
67
|
// Tencent url conversion
|
|
68
68
|
if (url.includes('v.qq.com')) {
|
|
69
|
-
const vidMatch = url.match(/\/([^\/]+)\.html
|
|
69
|
+
const vidMatch = url.match(/\/([^\/]+)\.html/);
|
|
70
70
|
const videoUrl = vidMatch !== null && vidMatch !== void 0 && vidMatch[1] ? `https://v.qq.com/txp/iframe/player.html?vid=${vidMatch[1]}` : false;
|
|
71
|
+
console.log(videoUrl);
|
|
71
72
|
return videoUrl;
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -100,14 +101,12 @@ const insertVideo = function (editor, videoFiles, srcList, selection) {
|
|
|
100
101
|
size: videoFiles[0].size || null,
|
|
101
102
|
isEmbeddableLink: videoFiles[0].isEmbeddableLink || false
|
|
102
103
|
};
|
|
103
|
-
console.log(videoInfo);
|
|
104
104
|
let videoNodes;
|
|
105
105
|
// Return when embedding an invalid youtube, tencent or bilibili video url
|
|
106
106
|
if (videoInfo.isEmbeddableLink) {
|
|
107
107
|
const parsedSrc = parseVideoLink(srcList[0]);
|
|
108
108
|
if (!parsedSrc) return;
|
|
109
109
|
videoNodes = generateVideoNode(parsedSrc, videoInfo);
|
|
110
|
-
console.log(videoNodes);
|
|
111
110
|
} else {
|
|
112
111
|
videoNodes = generateVideoNode(srcList[0], videoInfo);
|
|
113
112
|
}
|