@seafile/sdoc-editor 1.0.206-test0.1.7 → 1.0.206-test0.1.9

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.
@@ -61,6 +61,7 @@ const InsertElementDialog = _ref => {
61
61
  }, []);
62
62
  const onVideoFileChanged = (0, _react.useCallback)(event => {
63
63
  const files = event.target.files;
64
+ console.log(files);
64
65
  // Show warning for 3s and no further insertion if video file is more than 5MB
65
66
  if (files[0].size > _index5.VIDEO_MAX_SIZE_5MB) {
66
67
  handleDisplayAlert();
@@ -93,6 +93,13 @@ const SelectSdocFileDialog = _ref => {
93
93
 
94
94
  // Insert video element in sdoc
95
95
  if (dialogType === _constants.ELEMENT_TYPE.VIDEO) {
96
+ console.log(0);
97
+ _context.default.getSeafileVideo(fileInfo.name).then(res => {
98
+ console.log(2, res);
99
+ if (res.status === 200) {
100
+ console.log(5, res);
101
+ }
102
+ });
96
103
  console.log(1, fileInfo);
97
104
  insertFile(fileInfo);
98
105
  closeDialog();
package/dist/context.js CHANGED
@@ -51,6 +51,16 @@ class Context {
51
51
  return relative_path;
52
52
  });
53
53
  });
54
+ (0, _defineProperty2.default)(this, "getSeafileVideo", videoName => {
55
+ const docUuid = this.getSetting('docUuid');
56
+ return this.api.getSdocDownloadImageUrl(docUuid, videoName).then(res => {
57
+ console.log(3, docUuid, videoName, res);
58
+ const {
59
+ relative_path
60
+ } = res.data;
61
+ return relative_path;
62
+ });
63
+ });
54
64
  this.settings = null;
55
65
  this.sdocServerApi = null;
56
66
  this.api = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "1.0.206-test0.1.7",
3
+ "version": "1.0.206-test0.1.9",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",