first time worked

This commit is contained in:
bob.rao
2023-04-21 12:33:49 +08:00
parent c766e8808c
commit a582bd1120
12 changed files with 209 additions and 859 deletions

21
addCheckboxes.js Normal file
View File

@@ -0,0 +1,21 @@
function addCheckboxes() {
const conversations = document.querySelectorAll(
'.flex.flex-col.gap-2.pb-2.text-gray-100.text-sm > .flex.py-3.px-3.items-center.gap-3.relative.rounded-md'
);
conversations.forEach((conversation, index) => {
const existingCheckbox = conversation.querySelector('.conversation-checkbox');
if (!existingCheckbox) {
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.className = 'conversation-checkbox';
checkbox.dataset.index = index; // 设置 data-index 属性
checkbox.addEventListener('click', (e) => {
e.stopPropagation();
});
conversation.insertBefore(checkbox, conversation.firstChild);
}
});
}
addCheckboxes();