SelectAll

Ctrl+Alt点击全选多选框,Alt加鼠标悬浮选择多选框,Shift选择两个多选框之间的所有多选框 | Select all checkboxs,or select checkboxs with mouse over,or select checkbox with 2 signs

Verze ze dne 12. 10. 2016. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         SelectAll
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Ctrl+Alt点击全选多选框,Alt加鼠标悬浮选择多选框,Shift选择两个多选框之间的所有多选框 | Select all checkboxs,or select checkboxs with mouse over,or select checkbox with 2 signs
// @author       Hoothin
// @match        http*://*/*
// @require      http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js
// @grant       GM_registerMenuCommand
// ==/UserScript==

(function() {
    'use strict';
    var type=navigator.appName;
    var lang = null;
    if (type=="Netscape"){
        lang = navigator.language;
    }else{
        lang = navigator.userLanguage;
    }
    var langStr = lang.substr(0,2);
    if (langStr == "zh"){
        langStr = "全选";
    }else{
        langStr = "SelectAll";
    }
    GM_registerMenuCommand(langStr, selectAll);

    function selectAll(){
        $("input:checkbox:enabled").click();
    }

    var selectObj = $("input:checkbox:enabled");
    var preObj;
    selectObj.mousedown(function (event) {
        if(!event.shiftKey&&event.altKey&&event.ctrlKey){
            selectObj.click();
            this.click();
        }else if(event.shiftKey&&!event.altKey&&!event.ctrlKey){
            var curParent=this;
            var preParent=preObj;
            for(var i=0;i<5;i++){
                curParent=curParent.parentNode;
                preParent=preParent.parentNode;
                if(!curParent||!preParent)return;
                if(curParent==preParent){
                    var target=this;
                    var find=false;
                    $(curParent).find("input:checkbox:enabled").each(function(){
                        if(this==preObj||this==target){
                            if(find){
                                find=false;
                                return;
                            }
                            find=true;
                        }else if(find){
                            this.click();
                        }
                    });
                    break;
                }
            }
        }
        preObj=this;
    });
    selectObj.mouseover(function (event) {
        if(!event.shiftKey&&event.altKey&&!event.ctrlKey){
            this.click();
        }
    });
})();