Browse Source

cloudteam#2412

narrowizard 5 years ago
parent
commit
e87ad96384

+ 1
- 1
assets/example.html View File

@@ -20,7 +20,7 @@
20 20
   </div>
21 21
   
22 22
   <script src="http://gosspublic.alicdn.com/aliyun-oss-sdk.min.js"></script>
23
-  <script type="text/javascript" src="./static/js/main.6b539ef0.js"></script>
23
+  <script type="text/javascript" src="./static/js/main.2b09a9d7.js"></script>
24 24
   <script type="text/javascript" src="example.js"></script>
25 25
 </body>
26 26
 </html>

assets/static/js/main.2b09a9d7.js
File diff suppressed because it is too large
View File


+ 1
- 0
assets/static/js/main.2b09a9d7.js.map
File diff suppressed because it is too large
View File


+ 0
- 1
assets/static/js/main.6b539ef0.js.map
File diff suppressed because it is too large
View File


+ 1
- 4
lib/components/Editor/index.js View File

@@ -301,10 +301,7 @@ var Editor = function (_React$Component) {
301 301
               "comment-editor-toolbar-error": inputValue.length > maxLength
302 302
             })
303 303
           },
304
-          _reactIntlUniversal2.default.get("editor.alreadyEntered", {
305
-            count: inputValue.length,
306
-            maxLength: maxLength
307
-          })
304
+          "\u3000"
308 305
         ),
309 306
         _react2.default.createElement(
310 307
           "div",

+ 1
- 1
lib/components/Editor/index.js.map
File diff suppressed because it is too large
View File


+ 12
- 11
lib/index.js View File

@@ -58,17 +58,18 @@ function renderComment(config) {
58 58
 
59 59
 window.renderComment = renderComment;
60 60
 
61
-// 测试的时候把这句注释取消掉
62
-// renderComment({
63
-//   id: "root-comment",
64
-//   type: 1,
65
-//   businessId: "test",
66
-//   businessUserId: 4,
67
-//   userId: 71299,
68
-//   onCountChange: c => {
69
-//     console.log(c);
70
-//   }
71
-// });
61
+if (process.env.NODE_ENV !== 'production') {
62
+  renderComment({
63
+    id: "root-comment",
64
+    type: 1,
65
+    businessId: "test",
66
+    businessUserId: 4,
67
+    userId: 71299,
68
+    onCountChange: function onCountChange(c) {
69
+      console.log(c);
70
+    }
71
+  });
72
+}
72 73
 
73 74
 // renderComment({
74 75
 //   id: "root-comment",

+ 1
- 1
lib/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../src/index.js"],"names":["Index","props","editorProps","renderComment","config","id","Error","type","businessId","console","warn","API","ReactDOM","render","document","getElementById","window"],"mappings":";;;;AAAA;;;;AACA;;;;AACA;;;;;;AACA;;AAEA,IAAMA,QAAQ,SAARA,KAAQ;AAAA,SACZ;AAAC,iBAAD;AAAA,eAAK,sBAAL,EAAsB,oBAAtB,EAAqC,oBAArC,EAAoD,eAApD,IAAkEC,KAAlE;AACE,kCAAC,WAAD,aAAQ,WAAW,CAAnB,EAAsB,eAAtB,IAAoCA,MAAMC,WAA1C;AADF,GADY;AAAA,CAAd;;AAMA;;;;;;;;AAQA,SAASC,aAAT,CAAuBC,MAAvB,EAA+B;AAC7B,MAAI,CAACA,OAAOC,EAAZ,EAAgB;AACd,UAAM,IAAIC,KAAJ,CAAU,gBAAV,CAAN;AACD;AACD,MAAI,CAACF,OAAOG,IAAZ,EAAkB;AAChB,UAAM,IAAID,KAAJ,CAAU,kBAAV,CAAN;AACD;AACD,MAAI,CAACF,OAAOI,UAAZ,EAAwB;AACtB;AACAJ,WAAOI,UAAP,GAAoB,MAApB;AACAC,YAAQC,IAAR,CAAa,+BAAb;AACD;AACD,MAAI,CAACN,OAAOO,GAAZ,EAAiB;AACf;AACAP,WAAOO,GAAP,GAAa,oCAAb;AACAF,YAAQC,IAAR,CACE,sDADF;AAGD;;AAEDE,qBAASC,MAAT,CAAgB,8BAAC,KAAD,EAAWT,MAAX,CAAhB,EAAuCU,SAASC,cAAT,CAAwBX,OAAOC,EAA/B,CAAvC;AACA;AACD;;AAEDW,OAAOb,aAAP,GAAuBA,aAAvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["import React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport App, { Editor } from \"./App\";\r\n// import registerServiceWorker from \"./registerServiceWorker\";\r\n\r\nconst Index = props => (\r\n  <App showAlertComment showAlertReply showAlertFavor showError {...props}>\r\n    <Editor maxUpload={9} autoFocus {...props.editorProps} />\r\n  </App>\r\n);\r\n\r\n/**\r\n * 渲染评论组件\r\n * @param {object} config 编辑器配置\r\n *  - {string} id 渲染评论的DOM的 ID\r\n *  - {number} type 评论的 type\r\n *  - {string} businessId 评论的 businessId\r\n *  - {string} API, API 前缀, 默认 http://api.links123.net/comment/v1\r\n */\r\nfunction renderComment(config) {\r\n  if (!config.id) {\r\n    throw new Error(\"id is required\");\r\n  }\r\n  if (!config.type) {\r\n    throw new Error(\"type is required\");\r\n  }\r\n  if (!config.businessId) {\r\n    // throw new Error(\"businessId is required\");\r\n    config.businessId = \"test\";\r\n    console.warn(\"没有传入 businessId 参数,默认使用: test\");\r\n  }\r\n  if (!config.API) {\r\n    // throw new Error(\"API is required\");\r\n    config.API = \"http://api.links123.net/comment/v1\";\r\n    console.warn(\r\n      \"没有传入 API 参数,默认使用: http://api.links123.net/comment/v1\"\r\n    );\r\n  }\r\n\r\n  ReactDOM.render(<Index {...config} />, document.getElementById(config.id));\r\n  // registerServiceWorker();\r\n}\r\n\r\nwindow.renderComment = renderComment;\r\n\r\n// 测试的时候把这句注释取消掉\r\n// renderComment({\r\n//   id: \"root-comment\",\r\n//   type: 1,\r\n//   businessId: \"test\",\r\n//   businessUserId: 4,\r\n//   userId: 71299,\r\n//   onCountChange: c => {\r\n//     console.log(c);\r\n//   }\r\n// });\r\n\r\n// renderComment({\r\n//   id: \"root-comment\",\r\n//   type: 1,\r\n//   businessId: \"test\",\r\n//   API: 'http://api.links123.net/comment/v1',\r\n// });\r\n"]}
1
+{"version":3,"sources":["../src/index.js"],"names":["Index","props","editorProps","renderComment","config","id","Error","type","businessId","console","warn","API","ReactDOM","render","document","getElementById","window","process","env","NODE_ENV","businessUserId","userId","onCountChange","log","c"],"mappings":";;;;AAAA;;;;AACA;;;;AACA;;;;;;AACA;;AAEA,IAAMA,QAAQ,SAARA,KAAQ;AAAA,SACZ;AAAC,iBAAD;AAAA,eAAK,sBAAL,EAAsB,oBAAtB,EAAqC,oBAArC,EAAoD,eAApD,IAAkEC,KAAlE;AACE,kCAAC,WAAD,aAAQ,WAAW,CAAnB,EAAsB,eAAtB,IAAoCA,MAAMC,WAA1C;AADF,GADY;AAAA,CAAd;;AAMA;;;;;;;;AAQA,SAASC,aAAT,CAAuBC,MAAvB,EAA+B;AAC7B,MAAI,CAACA,OAAOC,EAAZ,EAAgB;AACd,UAAM,IAAIC,KAAJ,CAAU,gBAAV,CAAN;AACD;AACD,MAAI,CAACF,OAAOG,IAAZ,EAAkB;AAChB,UAAM,IAAID,KAAJ,CAAU,kBAAV,CAAN;AACD;AACD,MAAI,CAACF,OAAOI,UAAZ,EAAwB;AACtB;AACAJ,WAAOI,UAAP,GAAoB,MAApB;AACAC,YAAQC,IAAR,CAAa,+BAAb;AACD;AACD,MAAI,CAACN,OAAOO,GAAZ,EAAiB;AACf;AACAP,WAAOO,GAAP,GAAa,oCAAb;AACAF,YAAQC,IAAR,CACE,sDADF;AAGD;;AAEDE,qBAASC,MAAT,CAAgB,8BAAC,KAAD,EAAWT,MAAX,CAAhB,EAAuCU,SAASC,cAAT,CAAwBX,OAAOC,EAA/B,CAAvC;AACA;AACD;;AAEDW,OAAOb,aAAP,GAAuBA,aAAvB;;AAEA,IAAIc,QAAQC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;AACzChB,gBAAc;AACZE,QAAI,cADQ;AAEZE,UAAM,CAFM;AAGZC,gBAAY,MAHA;AAIZY,oBAAgB,CAJJ;AAKZC,YAAQ,KALI;AAMZC,mBAAe,0BAAK;AAClBb,cAAQc,GAAR,CAAYC,CAAZ;AACD;AARW,GAAd;AAUD;;AAED;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["import React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport App, { Editor } from \"./App\";\r\n// import registerServiceWorker from \"./registerServiceWorker\";\r\n\r\nconst Index = props => (\r\n  <App showAlertComment showAlertReply showAlertFavor showError {...props}>\r\n    <Editor maxUpload={9} autoFocus {...props.editorProps} />\r\n  </App>\r\n);\r\n\r\n/**\r\n * 渲染评论组件\r\n * @param {object} config 编辑器配置\r\n *  - {string} id 渲染评论的DOM的 ID\r\n *  - {number} type 评论的 type\r\n *  - {string} businessId 评论的 businessId\r\n *  - {string} API, API 前缀, 默认 http://api.links123.net/comment/v1\r\n */\r\nfunction renderComment(config) {\r\n  if (!config.id) {\r\n    throw new Error(\"id is required\");\r\n  }\r\n  if (!config.type) {\r\n    throw new Error(\"type is required\");\r\n  }\r\n  if (!config.businessId) {\r\n    // throw new Error(\"businessId is required\");\r\n    config.businessId = \"test\";\r\n    console.warn(\"没有传入 businessId 参数,默认使用: test\");\r\n  }\r\n  if (!config.API) {\r\n    // throw new Error(\"API is required\");\r\n    config.API = \"http://api.links123.net/comment/v1\";\r\n    console.warn(\r\n      \"没有传入 API 参数,默认使用: http://api.links123.net/comment/v1\"\r\n    );\r\n  }\r\n\r\n  ReactDOM.render(<Index {...config} />, document.getElementById(config.id));\r\n  // registerServiceWorker();\r\n}\r\n\r\nwindow.renderComment = renderComment;\r\n\r\nif (process.env.NODE_ENV !== 'production') {\r\n  renderComment({\r\n    id: \"root-comment\",\r\n    type: 1,\r\n    businessId: \"test\",\r\n    businessUserId: 4,\r\n    userId: 71299,\r\n    onCountChange: c => {\r\n      console.log(c);\r\n    }\r\n  });\r\n}\r\n\r\n// renderComment({\r\n//   id: \"root-comment\",\r\n//   type: 1,\r\n//   businessId: \"test\",\r\n//   API: 'http://api.links123.net/comment/v1',\r\n// });\r\n"]}

+ 3
- 3
src/components/Editor/index.js View File

@@ -199,11 +199,11 @@ class Editor extends React.Component {
199 199
             "comment-editor-toolbar-error": inputValue.length > maxLength
200 200
           })}
201 201
         >
202
-          {intl.get("editor.alreadyEntered", {
202
+           
203
+          {/* {intl.get("editor.alreadyEntered", {
203 204
             count: inputValue.length,
204 205
             maxLength
205
-          })}
206
-          {/* 已输入 {inputValue.length} / {maxLength} 字 */}
206
+          })} */}
207 207
         </div>
208 208
         <div className="comment-editor">
209 209
           <TextArea

+ 12
- 11
src/index.js View File

@@ -43,17 +43,18 @@ function renderComment(config) {
43 43
 
44 44
 window.renderComment = renderComment;
45 45
 
46
-// 测试的时候把这句注释取消掉
47
-// renderComment({
48
-//   id: "root-comment",
49
-//   type: 1,
50
-//   businessId: "test",
51
-//   businessUserId: 4,
52
-//   userId: 71299,
53
-//   onCountChange: c => {
54
-//     console.log(c);
55
-//   }
56
-// });
46
+if (process.env.NODE_ENV !== "production") {
47
+  renderComment({
48
+    id: "root-comment",
49
+    type: 1,
50
+    businessId: "test",
51
+    businessUserId: 4,
52
+    userId: 71299,
53
+    onCountChange: c => {
54
+      console.log(c);
55
+    }
56
+  });
57
+}
57 58
 
58 59
 // renderComment({
59 60
 //   id: "root-comment",