jQuery UI Finder Regex
Generates a jQuery UI matcher to be used to search a code base for jQuery UI usage.
by Bruno G.
HTML
<textarea id="results" style="width: 300px; height: 500px;">
</textarea>
JavaScript
'use strict';
/*
Based on jQuery UI Version 1.11; you may need to update the methods/params to find, if you use a different version.
I break these out into categories to mirror how jQuery UI site breaks them out. Makes it maybe easier to decide what you care about searching for or not.
I am sure there is a more elegant way, so please fork/show me if so.
You can copy and paste this into, e.g., VS Code's search box. Surprisingly, it can handle this monstrosity pretty well.
*/
let widgets = [
'accordion',
'autocomplete',
'button',
'buttonset',
'controlgroup',
'datepicker',
'dialog',
'menu',
'progressbar',
'selectmenu',
'slider',
'spinner',
'tabs',
'tooltip'
];
let effectMethods = [
'effect',
'switchClass',
'switchClass'
];
let effectNames = [
'blind',
'bounce',
'clip',
'drop',
'explode',
'fade',
'fold',
'highlight',
'puff',
'scale',
'shake',
'size',
'slide',
'transfer'
];
let easings = [
'easeInQuad',
'easeOutQuad',
'easeInOutQuad',
'easeInCubic',
'easeOutCubic',
'easeInOutCubic',
'easeInQuart',
'easeOutQuart',
'easeInOutQuart',
'easeInQuint',
'easeOutQuint',
'easeInOutQuint',
'easeInExpo',
'easeOutExpo',
'easeInOutExpo',
'easeInSine',
'easeOutSine',
'easeInOutSine',
'easeInCirc',
'easeOutCirc',
'easeInOutCirc',
'easeInElastic',
'easeOutElastic',
'easeInOutElastic',
'easeInBack',
'easeOutBack',
'easeInOutBack',
'easeInBounce',
'easeOutBounce',
'easeInOutBounce'
];
let interactions = [
'draggable',
'droppable',
'mouse',
'resizable',
'selectable',
'sortable'
];
// These are things the docs claim to override/augment in base jQuery.
// I found it to produce too many false positives in my code base to include them.
let jQueryMods = [
'toggle',
'addClass',
...