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

Function updateQuickReplyContent

quickReply.js:1077–1377  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1075
1076 // 更新内容函数
1077 function updateQuickReplyContent() {
1078 // 重建分类标签(防止分类发生变化)
1079 rebuildTabs();
1080
1081 // 更新回复列表
1082 const replies = getCategoryReplies(activeCategory);
1083 contentContainer.innerHTML = '';
1084
1085 // 拖拽相关变量
1086 let replyDraggedElement = null;
1087 let replyDraggedIndex = -1;
1088 let replyTouchStartY = 0;
1089 let replyTouchCurrentY = 0;
1090 let isReplyTouchDragging = false;
1091
1092 // 回复拖拽处理函数
1093 function handleReplyDragStart(e) {
1094 replyDraggedElement = this;
1095 replyDraggedIndex = parseInt(this.dataset.index);
1096 this.classList.add('reply-item-dragging');
1097 e.dataTransfer.effectAllowed = 'move';
1098 e.dataTransfer.setData('text/html', this.outerHTML);
1099 }
1100
1101 function handleReplyDragOver(e) {
1102 if (e.preventDefault) {
1103 e.preventDefault();
1104 }
1105 e.dataTransfer.dropEffect = 'move';
1106
1107 const targetIndex = parseInt(this.dataset.index);
1108 if (targetIndex !== replyDraggedIndex) {
1109 this.classList.add('reply-item-drag-over');
1110 }
1111 return false;
1112 }
1113
1114 function handleReplyDrop(e) {
1115 if (e.stopPropagation) {
1116 e.stopPropagation();
1117 }
1118
1119 const targetIndex = parseInt(this.dataset.index);
1120 if (replyDraggedIndex !== targetIndex) {
1121 reorderRepliesAfterDrag(replyDraggedIndex, targetIndex);
1122 }
1123
1124 // 清理样式
1125 document.querySelectorAll('.reply-item-drag-over').forEach(el => {
1126 el.classList.remove('reply-item-drag-over');
1127 });
1128
1129 return false;
1130 }
1131
1132 function handleReplyDragEnd() {
1133 this.classList.remove('reply-item-dragging');
1134 document.querySelectorAll('.reply-item-drag-over').forEach(el => {

Callers 4

createQuickReplyContentFunction · 0.85
rebuildTabsFunction · 0.85
reorderRepliesAfterDragFunction · 0.85
editQuickReplyFunction · 0.85

Calls 5

rebuildTabsFunction · 0.85
getCategoryRepliesFunction · 0.85
editQuickReplyFunction · 0.85
deleteReplyFromCategoryFunction · 0.85
insertReplyTextFunction · 0.85

Tested by

no test coverage detected