jQuery

Build Status GitHub release Jenkins Plugin Installs

This plugin is a library plugin that provides a shared version of jQuery (1.12.4) and the jQuery ColorBox extension (hudson.plugins.jquery.colorbox) for other Jenkins plugins.

Note

For newly developed plugins that require jQuery 3.x without global PageDecorator injection on every page, consider using the jQuery3 API Plugin. This plugin continues to be maintained for existing dependent plugins that rely on the Q (jQuery.noConflict()) binding or org.kohsuke.stapler.jquery adjunct.

Usage

Because historical Jenkins views used prototype.js in core, this plugin binds jQuery.noConflict() to the global Q variable so $ is not clobbered globally. You can use Q directly, or pass Q into an immediately invoked function expression (IIFE) to alias $ locally:

(function($) {
    $(function() {
        // Use $ safely as jQuery inside this scope
    });
})(Q);
jQuery usage example

This plugin registers a global PageDecorator (hudson.plugins.jquery.JQuery) that injects org.kohsuke.stapler.jquery and hudson.plugins.jquery.JQuery.jquery-no-conflict into the header of pages rendered by Jenkins.

Optional ColorBox Adjunct

Plugins that wish to include the bundled jQuery ColorBox script and stylesheet can add the following Stapler adjunct to their Jelly views:

<st:adjunct includes="hudson.plugins.jquery.colorbox"/>

Changelog