@seafile/sdoc-editor 0.1.14-beta → 0.1.14

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.
@@ -38,7 +38,7 @@ var HeaderMenu = /*#__PURE__*/function (_React$Component) {
38
38
  };
39
39
  _this.onToggleClick = function (event) {
40
40
  event.stopPropagation();
41
- event.nativeEvent.stopImmediatePropagation();
41
+ event.nativeEvent.stopImmediatePropagation;
42
42
  var isShowHeaderPopover = !_this.state.isShowHeaderPopover;
43
43
  if (isShowHeaderPopover) {
44
44
  _this.setState({
@@ -4,42 +4,25 @@ 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
6
  import CollaboratorsOperation from './collaborators-operation';
7
- import context from '../../context';
8
- import { encodePath } from '../../utils';
9
7
  import './style.css';
10
8
  var DocOperations = /*#__PURE__*/function (_React$Component) {
11
9
  _inherits(DocOperations, _React$Component);
12
10
  var _super = _createSuper(DocOperations);
13
11
  function DocOperations() {
14
- var _this;
15
12
  _classCallCheck(this, DocOperations);
16
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
17
- args[_key] = arguments[_key];
18
- }
19
- _this = _super.call.apply(_super, [this].concat(args));
20
- _this.toggleHistory = function (event) {
21
- event.stopPropagation();
22
- event.nativeEvent.stopImmediatePropagation();
23
- var siteRoot = context.getSetting('siteRoot');
24
- var repoID = context.getSetting('repoID');
25
- var docPath = context.getSetting('docPath');
26
- window.location.href = siteRoot + 'repo/file_revisions/' + repoID + '/?p=' + encodePath(docPath);
27
- };
28
- return _this;
13
+ return _super.apply(this, arguments);
29
14
  }
30
15
  _createClass(DocOperations, [{
31
16
  key: "render",
32
17
  value: function render() {
33
- var docPerm = context.getSetting('docPerm');
34
18
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
35
19
  className: "doc-ops"
36
20
  }, /*#__PURE__*/React.createElement("span", {
37
21
  className: "op-item"
38
22
  }, /*#__PURE__*/React.createElement("i", {
39
23
  className: "iconfont icon-share"
40
- })), docPerm === 'rw' && /*#__PURE__*/React.createElement("span", {
41
- className: "op-item",
42
- onClick: this.toggleHistory
24
+ })), /*#__PURE__*/React.createElement("span", {
25
+ className: "op-item"
43
26
  }, /*#__PURE__*/React.createElement("i", {
44
27
  className: "iconfont icon-history"
45
28
  })), /*#__PURE__*/React.createElement(CollaboratorsOperation, null), /*#__PURE__*/React.createElement("span", {
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 };
@@ -18,15 +18,4 @@ export var generateDefaultDocContent = function generateDefaultDocContent() {
18
18
  }]
19
19
  };
20
20
  return defaultValue;
21
- };
22
-
23
- // IE8 not support map, so use push
24
- export var encodePath = function encodePath(path) {
25
- if (!path) return '';
26
- var path_arr = path.split('/');
27
- var path_arr_ = [];
28
- for (var i = 0, len = path_arr.length; i < len; i++) {
29
- path_arr_.push(encodeURIComponent(path_arr[i]));
30
- }
31
- return path_arr_.join('/');
32
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.1.14beta",
3
+ "version": "0.1.14",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",