@seafile/sdoc-editor 0.1.23 → 0.1.24
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.
|
@@ -3,32 +3,49 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React, { Fragment } from 'react';
|
|
6
|
+
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
|
6
7
|
import CollaboratorsOperation from './collaborators-operation';
|
|
7
8
|
import context from '../../context';
|
|
9
|
+
import { withTranslation } from 'react-i18next';
|
|
8
10
|
import './style.css';
|
|
9
11
|
var DocOperations = /*#__PURE__*/function (_React$Component) {
|
|
10
12
|
_inherits(DocOperations, _React$Component);
|
|
11
13
|
var _super = _createSuper(DocOperations);
|
|
12
|
-
function DocOperations() {
|
|
14
|
+
function DocOperations(props) {
|
|
13
15
|
var _this;
|
|
14
16
|
_classCallCheck(this, DocOperations);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
_this = _super.call(this, props);
|
|
18
|
+
_this.toggleDropdown = function () {
|
|
19
|
+
_this.setState({
|
|
20
|
+
isDropdownOpen: !_this.state.isDropdownOpen
|
|
21
|
+
});
|
|
22
|
+
};
|
|
19
23
|
_this.toggleHistory = function (event) {
|
|
20
24
|
event.stopPropagation();
|
|
21
25
|
event.nativeEvent.stopImmediatePropagation();
|
|
22
26
|
var historyURL = context.getSetting('historyURL');
|
|
23
27
|
window.location.href = historyURL;
|
|
24
28
|
};
|
|
29
|
+
_this.state = {
|
|
30
|
+
isDropdownOpen: false
|
|
31
|
+
};
|
|
25
32
|
return _this;
|
|
26
33
|
}
|
|
27
34
|
_createClass(DocOperations, [{
|
|
28
35
|
key: "render",
|
|
29
36
|
value: function render() {
|
|
37
|
+
var t = this.props.t;
|
|
38
|
+
var isDropdownOpen = this.state.isDropdownOpen;
|
|
30
39
|
var docPerm = context.getSetting('docPerm');
|
|
31
40
|
var historyURL = context.getSetting('historyURL');
|
|
41
|
+
var parentFolderURL = context.getSetting('parentFolderURL');
|
|
42
|
+
var dropdownItems = [];
|
|
43
|
+
if (parentFolderURL) {
|
|
44
|
+
dropdownItems.push({
|
|
45
|
+
text: t('Open_parent_folder'),
|
|
46
|
+
URL: parentFolderURL
|
|
47
|
+
});
|
|
48
|
+
}
|
|
32
49
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
33
50
|
className: "doc-ops"
|
|
34
51
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -40,13 +57,25 @@ var DocOperations = /*#__PURE__*/function (_React$Component) {
|
|
|
40
57
|
onClick: this.toggleHistory
|
|
41
58
|
}, /*#__PURE__*/React.createElement("i", {
|
|
42
59
|
className: "iconfont icon-history"
|
|
43
|
-
})), /*#__PURE__*/React.createElement(CollaboratorsOperation, null), /*#__PURE__*/React.createElement(
|
|
44
|
-
|
|
60
|
+
})), /*#__PURE__*/React.createElement(CollaboratorsOperation, null), dropdownItems.length > 0 && /*#__PURE__*/React.createElement(Dropdown, {
|
|
61
|
+
isOpen: isDropdownOpen,
|
|
62
|
+
toggle: this.toggleDropdown
|
|
63
|
+
}, /*#__PURE__*/React.createElement(DropdownToggle, {
|
|
64
|
+
className: "op-item",
|
|
65
|
+
tag: "span"
|
|
45
66
|
}, /*#__PURE__*/React.createElement("i", {
|
|
46
67
|
className: "iconfont icon-menu"
|
|
47
|
-
}))
|
|
68
|
+
})), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
69
|
+
right: true
|
|
70
|
+
}, dropdownItems.map(function (item, index) {
|
|
71
|
+
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
72
|
+
tag: "a",
|
|
73
|
+
href: item.URL,
|
|
74
|
+
key: index
|
|
75
|
+
}, item.text);
|
|
76
|
+
})))));
|
|
48
77
|
}
|
|
49
78
|
}]);
|
|
50
79
|
return DocOperations;
|
|
51
80
|
}(React.Component);
|
|
52
|
-
export default DocOperations;
|
|
81
|
+
export default withTranslation('sdoc-editor')(DocOperations);
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var serverConfig = {
|
|
2
|
+
//serviceUrl: "http://127.0.0.1:8000",
|
|
3
|
+
serviceUrl: "http://192.168.1.100:8000",
|
|
4
|
+
username: "lj@11.com",
|
|
5
|
+
password: "11",
|
|
6
|
+
repoID: "79d1fa93-4b5f-4d6c-8fb5-ad3958e1fa47",
|
|
7
|
+
userInfo: {
|
|
8
|
+
username: 'lj@11.com',
|
|
9
|
+
name: 'lj-',
|
|
10
|
+
contact_email: 'lj@11.com'
|
|
11
|
+
},
|
|
12
|
+
filePath: '/xxx.md',
|
|
13
|
+
fileName: 'xxx.md',
|
|
14
|
+
dirPath: '/'
|
|
15
|
+
};
|
|
16
|
+
export { serverConfig };
|
package/package.json
CHANGED
|
@@ -235,5 +235,6 @@
|
|
|
235
235
|
"Server_is_disconnected_Reconnecting": "Server is disconnected. Reconnecting...",
|
|
236
236
|
"Server_is_reconnected": "Server is reconnected.",
|
|
237
237
|
"Outline": "Outline",
|
|
238
|
-
"Headings_you_add_to_the_document_will_appear_here": "Headings you add to the document will appear here"
|
|
238
|
+
"Headings_you_add_to_the_document_will_appear_here": "Headings you add to the document will appear here",
|
|
239
|
+
"Open_parent_folder": "Open parent folder"
|
|
239
240
|
}
|