@seafile/sdoc-editor 3.0.242 → 3.0.243
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.
|
@@ -105,8 +105,8 @@ var InsertElementDialog = function InsertElementDialog(_ref) {
|
|
|
105
105
|
}, []);
|
|
106
106
|
var onVideoFileChanged = (0, _react.useCallback)(function (event) {
|
|
107
107
|
var files = event.target.files;
|
|
108
|
-
// Show warning for 3s and no further insertion if video file
|
|
109
|
-
if (files[0].size > _index3.
|
|
108
|
+
// Show warning for 3s and no further insertion if the video file exceeds the configured limit.
|
|
109
|
+
if (files[0].size > (0, _index3.getSeadocVideoSizeLimit)(_context["default"].getSetting('seadocVideoSizeLimit'))) {
|
|
110
110
|
handleDisplayAlert();
|
|
111
111
|
event.target.value = null;
|
|
112
112
|
return;
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
6
|
+
exports.getSeadocVideoSizeLimit = exports.SEADOC_VIDEO_SIZE_LIMIT = exports.ONE_MB = exports.ONE_KB = exports.ONE_GB = void 0;
|
|
7
|
+
var SEADOC_VIDEO_SIZE_LIMIT = exports.SEADOC_VIDEO_SIZE_LIMIT = 5 * 1024 * 1024;
|
|
8
|
+
var getSeadocVideoSizeLimit = exports.getSeadocVideoSizeLimit = function getSeadocVideoSizeLimit(sizeLimit) {
|
|
9
|
+
var parsedSizeLimit = Number(sizeLimit);
|
|
10
|
+
return Number.isFinite(parsedSizeLimit) && parsedSizeLimit > 0 ? parsedSizeLimit : SEADOC_VIDEO_SIZE_LIMIT;
|
|
11
|
+
};
|
|
8
12
|
var ONE_GB = exports.ONE_GB = 1000 * 1000 * 1000;
|
|
9
13
|
var ONE_MB = exports.ONE_MB = 1000 * 1000;
|
|
10
14
|
var ONE_KB = exports.ONE_KB = 1000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.243",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "e7130251c03d8260518c262a4d7cb6bb248f4793"
|
|
75
75
|
}
|