|
@@ -85,6 +85,17 @@ export default class RichTextEditor extends Component {
|
85
|
85
|
}
|
86
|
86
|
}
|
87
|
87
|
break;
|
|
88
|
+ case messages.TITLE_TEXT_RESPONSE:
|
|
89
|
+ if (this.titleTextResolve) {
|
|
90
|
+ this.titleTextResolve(message.data);
|
|
91
|
+ this.titleTextResolve = undefined;
|
|
92
|
+ this.titleTextReject = undefined;
|
|
93
|
+ if (this.pendingTitleText) {
|
|
94
|
+ clearTimeout(this.pendingTitleText);
|
|
95
|
+ this.pendingTitleText = undefined;
|
|
96
|
+ }
|
|
97
|
+ }
|
|
98
|
+ break;
|
88
|
99
|
case messages.CONTENT_HTML_RESPONSE:
|
89
|
100
|
if (this.contentResolve) {
|
90
|
101
|
this.contentResolve(message.data);
|
|
@@ -440,6 +451,20 @@ export default class RichTextEditor extends Component {
|
440
|
451
|
});
|
441
|
452
|
}
|
442
|
453
|
|
|
454
|
+ async getTitleText() {
|
|
455
|
+ return new Promise((resolve, reject) => {
|
|
456
|
+ this.titleTextResolve = resolve;
|
|
457
|
+ this.titleTextReject = reject;
|
|
458
|
+ this._sendAction(actions.getTitleText);
|
|
459
|
+
|
|
460
|
+ this.pendingTitleText = setTimeout(() => {
|
|
461
|
+ if (this.titleTextReject) {
|
|
462
|
+ this.titleTextReject('timeout');
|
|
463
|
+ }
|
|
464
|
+ }, 5000);
|
|
465
|
+ });
|
|
466
|
+ }
|
|
467
|
+
|
443
|
468
|
async getContentHtml() {
|
444
|
469
|
return new Promise((resolve, reject) => {
|
445
|
470
|
this.contentResolve = resolve;
|