Finding usage of jQuery UI in a big ugly codebase

My advice would be to look at the jQuery UI demo page - http://jqueryui.com/demos/ - and look at each demo and search for the main one or two keywords from each demo, like you would probably do for Scriptaculous. Good luck.


jQuery UI has a standard naming convention, you can view a full list of widgets/effects here. Comparing to that list you're looking for the corresponding methods mostly:

  • .draggable()
  • .droppable()
  • .dialog()
  • etc...

However, and this is a big however, if your main goal is to reduce page payload size, this should have no effect. Your users shouldn't be downloading this every page load, it should be cached on the client as determined by cache headers, additionally your scripts should be minified (already provided version when you download it) and delivered gzipped.

Also if it's an option, I'd consider using a CDN for both jQuery and jQuery UI, and the stylesheets as well, if you're using one of the default themes.


See this article: https://medium.com/software-developer/finding-jquery-ui-usage-in-a-project-b4fbcfc938c8

It is used for generate big ugly regexp.

I use it as base and got next regexp:

\.\s*(accordion|autocomplete|button|buttonset|datepicker|dialog|menu|progressbar|selectmenu|slider|spinner|tabs|tooltip|effect|switchClass|switchClass|draggable|droppable|mouse|resizable|selectable|sortable|disableSelection|enableSelection|removeUniqueId|scrollParent|uniqueId|zIndex)\s*\(|['"](blind|bounce|clip|drop|explode|fade|fold|highlight|puff|scale|shake|size|slide|transfer|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)['"]|:(data|focusable|tabbable)|\.ui\b

Here can be a lot false positives, but I think it is good start. In any case you need manually check all matches.