@fonixtree/magic-design 0.0.112 → 0.0.114
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.
- package/es/composite-comp/bol/components/Video/components/ShareBtn/index.js +26 -3
- package/es/composite-comp/bol/components/Video/components/VideoTag/index.js +7 -3
- package/es/composite-comp/bol/components/Video/mobile/Layout1/index.js +7 -1
- package/es/composite-comp/bol/components/Video/mobile/Layout2/index.js +7 -1
- package/es/composite-comp/bol/components/Video/mobile/Layout3/index.js +7 -1
- package/es/composite-comp/bol/components/Video/pc/Layout1/index.js +7 -1
- package/es/composite-comp/bol/components/Video/pc/Layout2/index.js +6 -1
- package/es/composite-comp/bol/components/Video/pc/Layout3/index.js +6 -1
- package/es/composite-comp/bol/components/Video/pc/Layout4/index.js +6 -1
- package/es/composite-comp/bol/components/Video/pc/Layout5/index.js +6 -1
- package/es/composite-comp/bol/config-panels/VideoConfig/VideoShareConfig/index.js +0 -1
- package/es/core/Renderer/index.js +21 -3
- package/es/utils/commonUtil.js +76 -3
- package/lib/composite-comp/bol/components/Video/components/ShareBtn/index.js +26 -3
- package/lib/composite-comp/bol/components/Video/components/VideoTag/index.js +7 -3
- package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.js +7 -1
- package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.js +7 -1
- package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.js +7 -1
- package/lib/composite-comp/bol/components/Video/pc/Layout1/index.js +7 -1
- package/lib/composite-comp/bol/components/Video/pc/Layout2/index.js +6 -1
- package/lib/composite-comp/bol/components/Video/pc/Layout3/index.js +6 -1
- package/lib/composite-comp/bol/components/Video/pc/Layout4/index.js +6 -1
- package/lib/composite-comp/bol/components/Video/pc/Layout5/index.js +6 -1
- package/lib/composite-comp/bol/config-panels/VideoConfig/VideoShareConfig/index.js +0 -1
- package/lib/core/Renderer/index.js +21 -3
- package/lib/utils/commonUtil.js +76 -3
- package/package.json +1 -1
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
10
12
|
var _videoShare = _interopRequireDefault(require("./imgs/video-share.png"));
|
|
11
13
|
|
|
12
14
|
var _facebookIcon = _interopRequireDefault(require("./imgs/facebook-icon.png"));
|
|
@@ -19,9 +21,9 @@ var _twitterIcon = _interopRequireDefault(require("./imgs/twitter-icon.png"));
|
|
|
19
21
|
|
|
20
22
|
var _arrowRight = _interopRequireDefault(require("./imgs/arrow-right.png"));
|
|
21
23
|
|
|
22
|
-
require("
|
|
24
|
+
var _commonUtil = require("../../../../../../utils/commonUtil");
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
require("./index.less");
|
|
25
27
|
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
29
|
|
|
@@ -70,7 +72,8 @@ function (_super) {
|
|
|
70
72
|
|
|
71
73
|
var _a = this.props,
|
|
72
74
|
pc = _a.pc,
|
|
73
|
-
padding = _a.padding
|
|
75
|
+
padding = _a.padding,
|
|
76
|
+
data = _a.data;
|
|
74
77
|
var show = this.state.show;
|
|
75
78
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
76
79
|
className: (0, _classnames["default"])('video-share-btn', {
|
|
@@ -96,18 +99,38 @@ function (_super) {
|
|
|
96
99
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
97
100
|
alt: "",
|
|
98
101
|
className: "share-img",
|
|
102
|
+
onClick: function onClick(e) {
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
(0, _commonUtil.shareFacebook)(data);
|
|
105
|
+
},
|
|
99
106
|
src: _facebookIcon["default"]
|
|
100
107
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
101
108
|
alt: "",
|
|
102
109
|
className: "share-img",
|
|
110
|
+
onClick: function onClick(e) {
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
(0, _commonUtil.shareLinkedin)(data);
|
|
113
|
+
},
|
|
103
114
|
src: _linkedInIcon["default"]
|
|
104
115
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
105
116
|
alt: "",
|
|
106
117
|
className: "share-img",
|
|
118
|
+
onClick: function onClick(e) {
|
|
119
|
+
e.stopPropagation();
|
|
120
|
+
(0, _commonUtil.shareTwitter)(data);
|
|
121
|
+
},
|
|
107
122
|
src: _twitterIcon["default"]
|
|
108
123
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
109
124
|
alt: "",
|
|
110
125
|
className: "share-img",
|
|
126
|
+
onClick: function onClick(e) {
|
|
127
|
+
e.stopPropagation();
|
|
128
|
+
(0, _commonUtil.copy2ClipBoard)(data.url);
|
|
129
|
+
|
|
130
|
+
_this.setState({
|
|
131
|
+
show: false
|
|
132
|
+
});
|
|
133
|
+
},
|
|
111
134
|
src: _linkIcon["default"]
|
|
112
135
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
113
136
|
alt: "",
|
|
@@ -63,7 +63,8 @@ function (_super) {
|
|
|
63
63
|
_b = _a.position,
|
|
64
64
|
position = _b === void 0 ? 'absolute' : _b,
|
|
65
65
|
noShare = _a.noShare,
|
|
66
|
-
padding = _a.padding
|
|
66
|
+
padding = _a.padding,
|
|
67
|
+
share = _a.share;
|
|
67
68
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
68
69
|
className: "video-tag-container",
|
|
69
70
|
style: {
|
|
@@ -103,11 +104,14 @@ function (_super) {
|
|
|
103
104
|
className: "text-text"
|
|
104
105
|
}, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
105
106
|
data: data.text
|
|
106
|
-
}), !noShare && /*#__PURE__*/_react["default"].createElement(_index["default"],
|
|
107
|
+
}), !noShare && /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
108
|
+
data: share
|
|
109
|
+
})))));
|
|
107
110
|
};
|
|
108
111
|
|
|
109
112
|
VideoTag.defaultProps = {
|
|
110
|
-
data: {}
|
|
113
|
+
data: {},
|
|
114
|
+
noShare: false
|
|
111
115
|
};
|
|
112
116
|
return VideoTag;
|
|
113
117
|
}(_react["default"].Component);
|
|
@@ -141,7 +141,13 @@ function (_super) {
|
|
|
141
141
|
alt: "",
|
|
142
142
|
src: _playCircle["default"]
|
|
143
143
|
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
144
|
-
data: group
|
|
144
|
+
data: group,
|
|
145
|
+
noShare: !data.share.open,
|
|
146
|
+
share: __assign({
|
|
147
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
148
|
+
scroll: 'node-' + data.id
|
|
149
|
+
})
|
|
150
|
+
}, data.share)
|
|
145
151
|
}));
|
|
146
152
|
}));
|
|
147
153
|
};
|
|
@@ -176,7 +176,13 @@ function (_super) {
|
|
|
176
176
|
alt: "",
|
|
177
177
|
src: _playCircle["default"]
|
|
178
178
|
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
179
|
-
data: group
|
|
179
|
+
data: group,
|
|
180
|
+
noShare: !data.share.open,
|
|
181
|
+
share: __assign({
|
|
182
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
183
|
+
scroll: 'node-' + data.id
|
|
184
|
+
})
|
|
185
|
+
}, data.share)
|
|
180
186
|
}));
|
|
181
187
|
}))), /*#__PURE__*/_react["default"].createElement(_common.SwiperBan, {
|
|
182
188
|
data: data.groupSource,
|
|
@@ -144,7 +144,13 @@ function (_super) {
|
|
|
144
144
|
src: _playCircle["default"]
|
|
145
145
|
}))), /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
146
146
|
data: group,
|
|
147
|
-
|
|
147
|
+
noShare: !data.share.open,
|
|
148
|
+
position: "relative",
|
|
149
|
+
share: __assign({
|
|
150
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
151
|
+
scroll: 'node-' + data.id
|
|
152
|
+
})
|
|
153
|
+
}, data.share)
|
|
148
154
|
}));
|
|
149
155
|
}));
|
|
150
156
|
};
|
|
@@ -86,6 +86,7 @@ function (_super) {
|
|
|
86
86
|
var _this = this;
|
|
87
87
|
|
|
88
88
|
var data = this.props.data;
|
|
89
|
+
console.log('data: ', data);
|
|
89
90
|
var hasPlaying = Object.keys(this.videoRefMap).find(function (key) {
|
|
90
91
|
return _this.videoRefMap[key].playing;
|
|
91
92
|
});
|
|
@@ -148,7 +149,12 @@ function (_super) {
|
|
|
148
149
|
noShare: true,
|
|
149
150
|
padding: 48
|
|
150
151
|
}));
|
|
151
|
-
})), !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
152
|
+
})), data.share.open && !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
153
|
+
data: __assign({
|
|
154
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
155
|
+
scroll: 'node-' + data.id
|
|
156
|
+
})
|
|
157
|
+
}, data.share),
|
|
152
158
|
pc: true
|
|
153
159
|
}));
|
|
154
160
|
};
|
|
@@ -189,12 +189,17 @@ function (_super) {
|
|
|
189
189
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
190
190
|
alt: "",
|
|
191
191
|
src: _playCircle["default"]
|
|
192
|
-
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
192
|
+
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
193
193
|
data: group,
|
|
194
194
|
noShare: true,
|
|
195
195
|
padding: 32
|
|
196
196
|
}));
|
|
197
197
|
})), !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
198
|
+
data: __assign({
|
|
199
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
200
|
+
scroll: 'node-' + data.id
|
|
201
|
+
})
|
|
202
|
+
}, data.share),
|
|
198
203
|
pc: true
|
|
199
204
|
}));
|
|
200
205
|
};
|
|
@@ -95,6 +95,11 @@ function (_super) {
|
|
|
95
95
|
height: data.pcHeight
|
|
96
96
|
}
|
|
97
97
|
}, !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
98
|
+
data: __assign({
|
|
99
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
100
|
+
scroll: 'node-' + data.id
|
|
101
|
+
})
|
|
102
|
+
}, data.share),
|
|
98
103
|
pc: true
|
|
99
104
|
}), data.groupSource.map(function (group) {
|
|
100
105
|
var _a;
|
|
@@ -141,7 +146,7 @@ function (_super) {
|
|
|
141
146
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
142
147
|
alt: "",
|
|
143
148
|
src: _playCircle["default"]
|
|
144
|
-
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
149
|
+
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
145
150
|
data: group,
|
|
146
151
|
noShare: true,
|
|
147
152
|
padding: 20
|
|
@@ -138,7 +138,12 @@ function (_super) {
|
|
|
138
138
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
139
139
|
alt: "",
|
|
140
140
|
src: _playCircle["default"]
|
|
141
|
-
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
141
|
+
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
142
|
+
data: __assign({
|
|
143
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
144
|
+
scroll: 'node-' + data.id
|
|
145
|
+
})
|
|
146
|
+
}, data.share),
|
|
142
147
|
padding: 20,
|
|
143
148
|
pc: true
|
|
144
149
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -138,7 +138,12 @@ function (_super) {
|
|
|
138
138
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
139
139
|
alt: "",
|
|
140
140
|
src: _playCircle["default"]
|
|
141
|
-
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
141
|
+
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
142
|
+
data: __assign({
|
|
143
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
144
|
+
scroll: 'node-' + data.id
|
|
145
|
+
})
|
|
146
|
+
}, data.share),
|
|
142
147
|
padding: 20,
|
|
143
148
|
pc: true
|
|
144
149
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -66,7 +66,6 @@ function (_super) {
|
|
|
66
66
|
var _this = this;
|
|
67
67
|
|
|
68
68
|
var data = this.props.data;
|
|
69
|
-
console.log('data: ', data);
|
|
70
69
|
|
|
71
70
|
var ShareSetting = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
72
71
|
title: (0, _locale.i18n)('SOCIAL_IMAGE')
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports["default"] = void 0;
|
|
7
9
|
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _commonUtil = require("../../utils/commonUtil");
|
|
9
13
|
|
|
10
14
|
var _componentTypes = require("../../constants/component-types");
|
|
11
15
|
|
|
12
16
|
var _coreUtil = require("../../utils/coreUtil");
|
|
13
17
|
|
|
14
|
-
function
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
21
|
|
|
16
22
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
17
23
|
__assign = Object.assign || function (t) {
|
|
@@ -31,6 +37,7 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
31
37
|
/* eslint-disable consistent-return */
|
|
32
38
|
|
|
33
39
|
|
|
40
|
+
// import { deviceTypeMap } from '../../constants';
|
|
34
41
|
var setDesignConfig = function setDesignConfig(props) {
|
|
35
42
|
var config = props.config,
|
|
36
43
|
device = props.device,
|
|
@@ -67,6 +74,16 @@ var Renderer = function Renderer(props) {
|
|
|
67
74
|
return source;
|
|
68
75
|
};
|
|
69
76
|
|
|
77
|
+
(0, _react.useEffect)(function () {
|
|
78
|
+
setTimeout(function () {
|
|
79
|
+
var _a;
|
|
80
|
+
|
|
81
|
+
var scrollId = (0, _commonUtil.getUrlParams)('scroll');
|
|
82
|
+
(_a = document.querySelector("#" + scrollId)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
83
|
+
behavior: 'smooth'
|
|
84
|
+
});
|
|
85
|
+
}, 300);
|
|
86
|
+
});
|
|
70
87
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
88
|
className: "render_wrap",
|
|
72
89
|
magic_design: "",
|
|
@@ -86,7 +103,8 @@ var Renderer = function Renderer(props) {
|
|
|
86
103
|
});
|
|
87
104
|
|
|
88
105
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
89
|
-
key: nodeData.id
|
|
106
|
+
key: nodeData.id,
|
|
107
|
+
id: 'node-' + nodeData.id
|
|
90
108
|
}, /*#__PURE__*/_react["default"].createElement(Clazz, __assign({}, newInstanceProps), null));
|
|
91
109
|
}));
|
|
92
110
|
};
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.addZero = void 0;
|
|
6
|
+
exports.addZero = exports.addUrlQuery = void 0;
|
|
7
7
|
exports.asyncDataURLtoImage = asyncDataURLtoImage;
|
|
8
8
|
exports.checkFileName = exports.calcLastTime = void 0;
|
|
9
9
|
exports.commonFetch = commonFetch;
|
|
10
10
|
exports.convertImageUrl = convertImageUrl;
|
|
11
|
+
exports.copy2ClipBoard = copy2ClipBoard;
|
|
11
12
|
exports.dragSource = void 0;
|
|
12
13
|
exports.ensure = ensure;
|
|
13
|
-
exports.
|
|
14
|
+
exports.navigateTo = exports.importAsync = exports.getUrlParams = exports.getColorRgba = void 0;
|
|
15
|
+
exports.shareFacebook = shareFacebook;
|
|
16
|
+
exports.shareLinkedin = shareLinkedin;
|
|
17
|
+
exports.shareTwitter = shareTwitter;
|
|
18
|
+
exports.styleStringify = void 0;
|
|
14
19
|
|
|
15
20
|
var _axios = _interopRequireDefault(require("axios"));
|
|
16
21
|
|
|
@@ -115,6 +120,16 @@ var navigateTo = function navigateTo(url) {
|
|
|
115
120
|
|
|
116
121
|
exports.navigateTo = navigateTo;
|
|
117
122
|
|
|
123
|
+
var addUrlQuery = function addUrlQuery(url, queryObj) {
|
|
124
|
+
if (/\?/.test(url)) {
|
|
125
|
+
return url + '&' + _qs["default"].stringify(queryObj);
|
|
126
|
+
} else {
|
|
127
|
+
return url + '?' + _qs["default"].stringify(queryObj);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
exports.addUrlQuery = addUrlQuery;
|
|
132
|
+
|
|
118
133
|
var dragSource = function dragSource(source, from, to) {
|
|
119
134
|
var out = source.splice(from, 1);
|
|
120
135
|
|
|
@@ -318,4 +333,62 @@ var importAsync = function importAsync(fileUrl) {
|
|
|
318
333
|
});
|
|
319
334
|
};
|
|
320
335
|
|
|
321
|
-
exports.importAsync = importAsync;
|
|
336
|
+
exports.importAsync = importAsync;
|
|
337
|
+
|
|
338
|
+
function shareFacebook(_a) {
|
|
339
|
+
var url = _a.url,
|
|
340
|
+
image = _a.image,
|
|
341
|
+
title = _a.title,
|
|
342
|
+
description = _a.description;
|
|
343
|
+
window.open('http://www.facebook.com/sharer.php' + _qs["default"].stringify({
|
|
344
|
+
u: url,
|
|
345
|
+
t: title
|
|
346
|
+
}, {
|
|
347
|
+
addQueryPrefix: true
|
|
348
|
+
}));
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function shareTwitter(_a) {
|
|
352
|
+
var url = _a.url,
|
|
353
|
+
image = _a.image,
|
|
354
|
+
title = _a.title,
|
|
355
|
+
description = _a.description;
|
|
356
|
+
window.open('http://twitter.com/share' + _qs["default"].stringify({
|
|
357
|
+
url: url,
|
|
358
|
+
text: title
|
|
359
|
+
}, {
|
|
360
|
+
addQueryPrefix: true
|
|
361
|
+
}));
|
|
362
|
+
} // export function sharewhatsApp({ url, image, title, description }) {
|
|
363
|
+
// window.open(`https://api.whatsapp.com/send?text=${encodeURIComponent(url)}`, '_self');
|
|
364
|
+
// }
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
function shareLinkedin(_a) {
|
|
368
|
+
var url = _a.url,
|
|
369
|
+
image = _a.image,
|
|
370
|
+
title = _a.title,
|
|
371
|
+
description = _a.description;
|
|
372
|
+
window.open('http://www.linkedin.com/shareArticle' + _qs["default"].stringify({
|
|
373
|
+
mini: true,
|
|
374
|
+
url: url,
|
|
375
|
+
title: title
|
|
376
|
+
}, {
|
|
377
|
+
addQueryPrefix: true
|
|
378
|
+
}));
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* 复制到剪切板
|
|
382
|
+
* @param {*} text 复制内容
|
|
383
|
+
*/
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
function copy2ClipBoard(text) {
|
|
387
|
+
var tag = document.createElement('input');
|
|
388
|
+
tag.setAttribute('id', 'cp_hgz_input');
|
|
389
|
+
tag.value = text;
|
|
390
|
+
document.getElementsByTagName('body')[0].appendChild(tag);
|
|
391
|
+
document.getElementById('cp_hgz_input').select();
|
|
392
|
+
document.execCommand('copy');
|
|
393
|
+
document.getElementById('cp_hgz_input').remove();
|
|
394
|
+
}
|
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
10
12
|
var _videoShare = _interopRequireDefault(require("./imgs/video-share.png"));
|
|
11
13
|
|
|
12
14
|
var _facebookIcon = _interopRequireDefault(require("./imgs/facebook-icon.png"));
|
|
@@ -19,9 +21,9 @@ var _twitterIcon = _interopRequireDefault(require("./imgs/twitter-icon.png"));
|
|
|
19
21
|
|
|
20
22
|
var _arrowRight = _interopRequireDefault(require("./imgs/arrow-right.png"));
|
|
21
23
|
|
|
22
|
-
require("
|
|
24
|
+
var _commonUtil = require("../../../../../../utils/commonUtil");
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
require("./index.less");
|
|
25
27
|
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
29
|
|
|
@@ -70,7 +72,8 @@ function (_super) {
|
|
|
70
72
|
|
|
71
73
|
var _a = this.props,
|
|
72
74
|
pc = _a.pc,
|
|
73
|
-
padding = _a.padding
|
|
75
|
+
padding = _a.padding,
|
|
76
|
+
data = _a.data;
|
|
74
77
|
var show = this.state.show;
|
|
75
78
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
76
79
|
className: (0, _classnames["default"])('video-share-btn', {
|
|
@@ -96,18 +99,38 @@ function (_super) {
|
|
|
96
99
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
97
100
|
alt: "",
|
|
98
101
|
className: "share-img",
|
|
102
|
+
onClick: function onClick(e) {
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
(0, _commonUtil.shareFacebook)(data);
|
|
105
|
+
},
|
|
99
106
|
src: _facebookIcon["default"]
|
|
100
107
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
101
108
|
alt: "",
|
|
102
109
|
className: "share-img",
|
|
110
|
+
onClick: function onClick(e) {
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
(0, _commonUtil.shareLinkedin)(data);
|
|
113
|
+
},
|
|
103
114
|
src: _linkedInIcon["default"]
|
|
104
115
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
105
116
|
alt: "",
|
|
106
117
|
className: "share-img",
|
|
118
|
+
onClick: function onClick(e) {
|
|
119
|
+
e.stopPropagation();
|
|
120
|
+
(0, _commonUtil.shareTwitter)(data);
|
|
121
|
+
},
|
|
107
122
|
src: _twitterIcon["default"]
|
|
108
123
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
109
124
|
alt: "",
|
|
110
125
|
className: "share-img",
|
|
126
|
+
onClick: function onClick(e) {
|
|
127
|
+
e.stopPropagation();
|
|
128
|
+
(0, _commonUtil.copy2ClipBoard)(data.url);
|
|
129
|
+
|
|
130
|
+
_this.setState({
|
|
131
|
+
show: false
|
|
132
|
+
});
|
|
133
|
+
},
|
|
111
134
|
src: _linkIcon["default"]
|
|
112
135
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
113
136
|
alt: "",
|
|
@@ -63,7 +63,8 @@ function (_super) {
|
|
|
63
63
|
_b = _a.position,
|
|
64
64
|
position = _b === void 0 ? 'absolute' : _b,
|
|
65
65
|
noShare = _a.noShare,
|
|
66
|
-
padding = _a.padding
|
|
66
|
+
padding = _a.padding,
|
|
67
|
+
share = _a.share;
|
|
67
68
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
68
69
|
className: "video-tag-container",
|
|
69
70
|
style: {
|
|
@@ -103,11 +104,14 @@ function (_super) {
|
|
|
103
104
|
className: "text-text"
|
|
104
105
|
}, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
105
106
|
data: data.text
|
|
106
|
-
}), !noShare && /*#__PURE__*/_react["default"].createElement(_index["default"],
|
|
107
|
+
}), !noShare && /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
108
|
+
data: share
|
|
109
|
+
})))));
|
|
107
110
|
};
|
|
108
111
|
|
|
109
112
|
VideoTag.defaultProps = {
|
|
110
|
-
data: {}
|
|
113
|
+
data: {},
|
|
114
|
+
noShare: false
|
|
111
115
|
};
|
|
112
116
|
return VideoTag;
|
|
113
117
|
}(_react["default"].Component);
|
|
@@ -141,7 +141,13 @@ function (_super) {
|
|
|
141
141
|
alt: "",
|
|
142
142
|
src: _playCircle["default"]
|
|
143
143
|
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
144
|
-
data: group
|
|
144
|
+
data: group,
|
|
145
|
+
noShare: !data.share.open,
|
|
146
|
+
share: __assign({
|
|
147
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
148
|
+
scroll: 'node-' + data.id
|
|
149
|
+
})
|
|
150
|
+
}, data.share)
|
|
145
151
|
}));
|
|
146
152
|
}));
|
|
147
153
|
};
|
|
@@ -176,7 +176,13 @@ function (_super) {
|
|
|
176
176
|
alt: "",
|
|
177
177
|
src: _playCircle["default"]
|
|
178
178
|
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
179
|
-
data: group
|
|
179
|
+
data: group,
|
|
180
|
+
noShare: !data.share.open,
|
|
181
|
+
share: __assign({
|
|
182
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
183
|
+
scroll: 'node-' + data.id
|
|
184
|
+
})
|
|
185
|
+
}, data.share)
|
|
180
186
|
}));
|
|
181
187
|
}))), /*#__PURE__*/_react["default"].createElement(_common.SwiperBan, {
|
|
182
188
|
data: data.groupSource,
|
|
@@ -144,7 +144,13 @@ function (_super) {
|
|
|
144
144
|
src: _playCircle["default"]
|
|
145
145
|
}))), /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
146
146
|
data: group,
|
|
147
|
-
|
|
147
|
+
noShare: !data.share.open,
|
|
148
|
+
position: "relative",
|
|
149
|
+
share: __assign({
|
|
150
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
151
|
+
scroll: 'node-' + data.id
|
|
152
|
+
})
|
|
153
|
+
}, data.share)
|
|
148
154
|
}));
|
|
149
155
|
}));
|
|
150
156
|
};
|
|
@@ -86,6 +86,7 @@ function (_super) {
|
|
|
86
86
|
var _this = this;
|
|
87
87
|
|
|
88
88
|
var data = this.props.data;
|
|
89
|
+
console.log('data: ', data);
|
|
89
90
|
var hasPlaying = Object.keys(this.videoRefMap).find(function (key) {
|
|
90
91
|
return _this.videoRefMap[key].playing;
|
|
91
92
|
});
|
|
@@ -148,7 +149,12 @@ function (_super) {
|
|
|
148
149
|
noShare: true,
|
|
149
150
|
padding: 48
|
|
150
151
|
}));
|
|
151
|
-
})), !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
152
|
+
})), data.share.open && !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
153
|
+
data: __assign({
|
|
154
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
155
|
+
scroll: 'node-' + data.id
|
|
156
|
+
})
|
|
157
|
+
}, data.share),
|
|
152
158
|
pc: true
|
|
153
159
|
}));
|
|
154
160
|
};
|
|
@@ -189,12 +189,17 @@ function (_super) {
|
|
|
189
189
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
190
190
|
alt: "",
|
|
191
191
|
src: _playCircle["default"]
|
|
192
|
-
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
192
|
+
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
193
193
|
data: group,
|
|
194
194
|
noShare: true,
|
|
195
195
|
padding: 32
|
|
196
196
|
}));
|
|
197
197
|
})), !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
198
|
+
data: __assign({
|
|
199
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
200
|
+
scroll: 'node-' + data.id
|
|
201
|
+
})
|
|
202
|
+
}, data.share),
|
|
198
203
|
pc: true
|
|
199
204
|
}));
|
|
200
205
|
};
|
|
@@ -95,6 +95,11 @@ function (_super) {
|
|
|
95
95
|
height: data.pcHeight
|
|
96
96
|
}
|
|
97
97
|
}, !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
98
|
+
data: __assign({
|
|
99
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
100
|
+
scroll: 'node-' + data.id
|
|
101
|
+
})
|
|
102
|
+
}, data.share),
|
|
98
103
|
pc: true
|
|
99
104
|
}), data.groupSource.map(function (group) {
|
|
100
105
|
var _a;
|
|
@@ -141,7 +146,7 @@ function (_super) {
|
|
|
141
146
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
142
147
|
alt: "",
|
|
143
148
|
src: _playCircle["default"]
|
|
144
|
-
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
149
|
+
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
145
150
|
data: group,
|
|
146
151
|
noShare: true,
|
|
147
152
|
padding: 20
|
|
@@ -138,7 +138,12 @@ function (_super) {
|
|
|
138
138
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
139
139
|
alt: "",
|
|
140
140
|
src: _playCircle["default"]
|
|
141
|
-
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
141
|
+
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
142
|
+
data: __assign({
|
|
143
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
144
|
+
scroll: 'node-' + data.id
|
|
145
|
+
})
|
|
146
|
+
}, data.share),
|
|
142
147
|
padding: 20,
|
|
143
148
|
pc: true
|
|
144
149
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -138,7 +138,12 @@ function (_super) {
|
|
|
138
138
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
139
139
|
alt: "",
|
|
140
140
|
src: _playCircle["default"]
|
|
141
|
-
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
141
|
+
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
142
|
+
data: __assign({
|
|
143
|
+
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
144
|
+
scroll: 'node-' + data.id
|
|
145
|
+
})
|
|
146
|
+
}, data.share),
|
|
142
147
|
padding: 20,
|
|
143
148
|
pc: true
|
|
144
149
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -66,7 +66,6 @@ function (_super) {
|
|
|
66
66
|
var _this = this;
|
|
67
67
|
|
|
68
68
|
var data = this.props.data;
|
|
69
|
-
console.log('data: ', data);
|
|
70
69
|
|
|
71
70
|
var ShareSetting = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
72
71
|
title: (0, _locale.i18n)('SOCIAL_IMAGE')
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports["default"] = void 0;
|
|
7
9
|
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _commonUtil = require("../../utils/commonUtil");
|
|
9
13
|
|
|
10
14
|
var _componentTypes = require("../../constants/component-types");
|
|
11
15
|
|
|
12
16
|
var _coreUtil = require("../../utils/coreUtil");
|
|
13
17
|
|
|
14
|
-
function
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
21
|
|
|
16
22
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
17
23
|
__assign = Object.assign || function (t) {
|
|
@@ -31,6 +37,7 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
31
37
|
/* eslint-disable consistent-return */
|
|
32
38
|
|
|
33
39
|
|
|
40
|
+
// import { deviceTypeMap } from '../../constants';
|
|
34
41
|
var setDesignConfig = function setDesignConfig(props) {
|
|
35
42
|
var config = props.config,
|
|
36
43
|
device = props.device,
|
|
@@ -67,6 +74,16 @@ var Renderer = function Renderer(props) {
|
|
|
67
74
|
return source;
|
|
68
75
|
};
|
|
69
76
|
|
|
77
|
+
(0, _react.useEffect)(function () {
|
|
78
|
+
setTimeout(function () {
|
|
79
|
+
var _a;
|
|
80
|
+
|
|
81
|
+
var scrollId = (0, _commonUtil.getUrlParams)('scroll');
|
|
82
|
+
(_a = document.querySelector("#" + scrollId)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
83
|
+
behavior: 'smooth'
|
|
84
|
+
});
|
|
85
|
+
}, 300);
|
|
86
|
+
});
|
|
70
87
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
88
|
className: "render_wrap",
|
|
72
89
|
magic_design: "",
|
|
@@ -86,7 +103,8 @@ var Renderer = function Renderer(props) {
|
|
|
86
103
|
});
|
|
87
104
|
|
|
88
105
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
89
|
-
key: nodeData.id
|
|
106
|
+
key: nodeData.id,
|
|
107
|
+
id: 'node-' + nodeData.id
|
|
90
108
|
}, /*#__PURE__*/_react["default"].createElement(Clazz, __assign({}, newInstanceProps), null));
|
|
91
109
|
}));
|
|
92
110
|
};
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.addZero = void 0;
|
|
6
|
+
exports.addZero = exports.addUrlQuery = void 0;
|
|
7
7
|
exports.asyncDataURLtoImage = asyncDataURLtoImage;
|
|
8
8
|
exports.checkFileName = exports.calcLastTime = void 0;
|
|
9
9
|
exports.commonFetch = commonFetch;
|
|
10
10
|
exports.convertImageUrl = convertImageUrl;
|
|
11
|
+
exports.copy2ClipBoard = copy2ClipBoard;
|
|
11
12
|
exports.dragSource = void 0;
|
|
12
13
|
exports.ensure = ensure;
|
|
13
|
-
exports.
|
|
14
|
+
exports.navigateTo = exports.importAsync = exports.getUrlParams = exports.getColorRgba = void 0;
|
|
15
|
+
exports.shareFacebook = shareFacebook;
|
|
16
|
+
exports.shareLinkedin = shareLinkedin;
|
|
17
|
+
exports.shareTwitter = shareTwitter;
|
|
18
|
+
exports.styleStringify = void 0;
|
|
14
19
|
|
|
15
20
|
var _axios = _interopRequireDefault(require("axios"));
|
|
16
21
|
|
|
@@ -115,6 +120,16 @@ var navigateTo = function navigateTo(url) {
|
|
|
115
120
|
|
|
116
121
|
exports.navigateTo = navigateTo;
|
|
117
122
|
|
|
123
|
+
var addUrlQuery = function addUrlQuery(url, queryObj) {
|
|
124
|
+
if (/\?/.test(url)) {
|
|
125
|
+
return url + '&' + _qs["default"].stringify(queryObj);
|
|
126
|
+
} else {
|
|
127
|
+
return url + '?' + _qs["default"].stringify(queryObj);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
exports.addUrlQuery = addUrlQuery;
|
|
132
|
+
|
|
118
133
|
var dragSource = function dragSource(source, from, to) {
|
|
119
134
|
var out = source.splice(from, 1);
|
|
120
135
|
|
|
@@ -318,4 +333,62 @@ var importAsync = function importAsync(fileUrl) {
|
|
|
318
333
|
});
|
|
319
334
|
};
|
|
320
335
|
|
|
321
|
-
exports.importAsync = importAsync;
|
|
336
|
+
exports.importAsync = importAsync;
|
|
337
|
+
|
|
338
|
+
function shareFacebook(_a) {
|
|
339
|
+
var url = _a.url,
|
|
340
|
+
image = _a.image,
|
|
341
|
+
title = _a.title,
|
|
342
|
+
description = _a.description;
|
|
343
|
+
window.open('http://www.facebook.com/sharer.php' + _qs["default"].stringify({
|
|
344
|
+
u: url,
|
|
345
|
+
t: title
|
|
346
|
+
}, {
|
|
347
|
+
addQueryPrefix: true
|
|
348
|
+
}));
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function shareTwitter(_a) {
|
|
352
|
+
var url = _a.url,
|
|
353
|
+
image = _a.image,
|
|
354
|
+
title = _a.title,
|
|
355
|
+
description = _a.description;
|
|
356
|
+
window.open('http://twitter.com/share' + _qs["default"].stringify({
|
|
357
|
+
url: url,
|
|
358
|
+
text: title
|
|
359
|
+
}, {
|
|
360
|
+
addQueryPrefix: true
|
|
361
|
+
}));
|
|
362
|
+
} // export function sharewhatsApp({ url, image, title, description }) {
|
|
363
|
+
// window.open(`https://api.whatsapp.com/send?text=${encodeURIComponent(url)}`, '_self');
|
|
364
|
+
// }
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
function shareLinkedin(_a) {
|
|
368
|
+
var url = _a.url,
|
|
369
|
+
image = _a.image,
|
|
370
|
+
title = _a.title,
|
|
371
|
+
description = _a.description;
|
|
372
|
+
window.open('http://www.linkedin.com/shareArticle' + _qs["default"].stringify({
|
|
373
|
+
mini: true,
|
|
374
|
+
url: url,
|
|
375
|
+
title: title
|
|
376
|
+
}, {
|
|
377
|
+
addQueryPrefix: true
|
|
378
|
+
}));
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* 复制到剪切板
|
|
382
|
+
* @param {*} text 复制内容
|
|
383
|
+
*/
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
function copy2ClipBoard(text) {
|
|
387
|
+
var tag = document.createElement('input');
|
|
388
|
+
tag.setAttribute('id', 'cp_hgz_input');
|
|
389
|
+
tag.value = text;
|
|
390
|
+
document.getElementsByTagName('body')[0].appendChild(tag);
|
|
391
|
+
document.getElementById('cp_hgz_input').select();
|
|
392
|
+
document.execCommand('copy');
|
|
393
|
+
document.getElementById('cp_hgz_input').remove();
|
|
394
|
+
}
|