Skip to content

Commit e039c1b

Browse files
committed
fix
1 parent 7095161 commit e039c1b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Select All Checkboxes/Select All Checkboxes.user.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @name:zh-CN 多选框伴侣
44
// @name:zh-TW 多選框伴侶
55
// @namespace hoothin
6-
// @version 0.5
6+
// @version 0.6
77
// @description A mate for checkbox, select all checkboxes by press Ctrl+Alt+mouse1, or select checkboxes with mouse over by press Alt, or select checkboxes between 2 marks by press Shift.
88
// @description:zh-CN Ctrl+Alt点击全选多选框,Alt加鼠标悬停选择多选框,Shift选择两个多选框之间的所有多选框
99
// @description:zh-TW Ctrl+Alt點擊全選多選框,Alt加鼠標懸停選擇多選框,Shift選擇兩個多選框之間的所有多選框
@@ -31,15 +31,16 @@
3131
langStr = "SelectAll";
3232
}
3333
GM_registerMenuCommand(langStr, selectAll);
34+
var selector="input:checkbox:enabled,.checkbox";
3435

3536
function selectAll(){
36-
$("input:checkbox:enabled").click();
37+
$(selector).click();
3738
}
3839

3940
var preObj;
40-
$(document).on("mousedown","input:checkbox:enabled",function (event) {
41+
$(document).on("mousedown",selector,function (event) {
4142
if(!event.shiftKey&&event.altKey&&event.ctrlKey){
42-
$("input:checkbox:enabled").click();
43+
$(selector).click();
4344
this.click();
4445
}else if(event.shiftKey&&!event.altKey&&!event.ctrlKey){
4546
var curParent=this;
@@ -51,7 +52,7 @@
5152
if(curParent==preParent){
5253
var target=this;
5354
var find=false;
54-
$(curParent).find("input:checkbox:enabled").each(function(){
55+
$(curParent).find(selector).each(function(){
5556
if(this==preObj||this==target){
5657
if(find){
5758
find=false;
@@ -68,7 +69,7 @@
6869
}
6970
preObj=this;
7071
});
71-
$(document).on("mouseover","input:checkbox:enabled",function (event) {
72+
$(document).on("mouseenter",selector,function (event) {
7273
if(!event.shiftKey&&event.altKey&&!event.ctrlKey){
7374
this.click();
7475
}

0 commit comments

Comments
 (0)