MCPcopy Create free account
hub / github.com/dajie111/nodeseek-userscript / insertReplyText

Function insertReplyText

quickReply.js:302–323  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

300
301 // 插入回复文本到编辑器
302 function insertReplyText(text) {
303 const editor = findEditor();
304 if (!editor) {
305 console.error('未找到编辑器');
306 return false;
307 }
308
309 const currentText = editor.getValue();
310 let newText;
311
312 if (currentText.trim() === '') {
313 newText = text;
314 } else {
315 // 如果已有内容,在末尾添加
316 newText = currentText + '\n\n' + text;
317 }
318
319 editor.setValue(newText);
320 editor.focus();
321
322 return true;
323 }
324
325 // 重置为默认回复
326 function resetToDefault() {

Callers 2

createQuickReplyContentFunction · 0.85
updateQuickReplyContentFunction · 0.85

Calls 1

findEditorFunction · 0.70

Tested by

no test coverage detected