NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Act-On - Enable Mass Scoring Checkboxes // @namespace https://openuserjs.org/users/jfsaliba // @version 1.1 // @description Makes it possible to mass check/uncheck boxes when selecting media documents in the scoring rules or in segment filters // @author James Saliba // @homepageURL https://github.com/jfsaliba // @license Attribution-ShareAlike 4.0 International (CC BY-SA 4.0); http://creativecommons.org/licenses/by-sa/4.0/ // @match http://*.actonsoftware.com/acton/ng-ui/ // @grant none // ==/UserScript== var GO = function(){ ///////////BEGIN DESCRIBE START CONDITION////////////////////// if($('#content').contents().find('#divdoclist').is(':visible')){ ///////////END DESCRIBE START CONDITION////////////////////// ///////////SCRIPT STARTS HERE////////////////////// if(!($('#content').contents().find('#chooserTable tr > td.b').parent().hasClass('folders'))) { //make all our title rows selectable $('#content').contents().find('#chooserTable tr > td.b').parent().addClass('folders').css({cursor:'pointer'}); var i = 0; $('#content').contents().find('#chooserTable').on('click','tr.folders td.fgOrange', function(e){ if(i===0){ //check all: $('#content').contents().find('#chooserTable td.b:contains("'+$(this).text()+'")').parent().nextUntil('.folders').find('input').prop('checked', true); i = 1; } else { //uncheck all: $('#content').contents().find('#chooserTable td.b:contains("'+$(this).text()+'")').parent().nextUntil('.folders').find('input').prop('checked', false); i = 0; } }); } ///////////SCRIPT ENDS HERE////////////////////// } else { //unbind $('#content').contents().find('#chooserTable').off('click','tr.folders td.fgOrange'); } ///////////BEGIN DESCRIBE START CONDITION////////////////////// if($('#content').contents().find('#editFrame').contents().find('#divdoclist').is(':visible')){ ///////////END DESCRIBE START CONDITION////////////////////// ///////////SCRIPT STARTS HERE////////////////////// if(!($('#content').contents().find('#editFrame').contents().find('#chooserTable tr > td.b').parent().hasClass('folders'))) { //make all our title rows selectable $('#content').contents().find('#editFrame').contents().find('#chooserTable tr > td.b').parent().addClass('folders').css({cursor:'pointer'}); var ii = 0; $('#content').contents().find('#editFrame').contents().find('#chooserTable').on('click','tr.folders td.fgOrange', function(e){ if(ii===0){ //check all: $('#content').contents().find('#editFrame').contents().find('#chooserTable td.b:contains("'+$(this).text()+'")').parent().nextUntil('.folders').find('input').prop('checked', true); ii = 1; } else { //uncheck all: $('#content').contents().find('#editFrame').contents().find('#chooserTable td.b:contains("'+$(this).text()+'")').parent().nextUntil('.folders').find('input').prop('checked', false); ii = 0; } }); } ///////////SCRIPT ENDS HERE////////////////////// } else { //unbind $('#content').contents().find('#editFrame').contents().find('#chooserTable').on('click','tr.folders td.fgOrange'); } } var start = function() { GO(); setTimeout(function(){ start(); },1000); } start();