protected function addJquery(Request $request, Response $response)
    {
        if (!$this->config->get('general/add_jquery', false) &&
            !$this->config->get('theme/add_jquery', false)) {
            return;
        }

        // Check zone to skip expensive regex
        if (Zone::isFrontend($request) === false) {
            return;
        }

        $html = $response->getContent();
        $regex = '/<script(.*)jquery(-latest|-[0-9\.]*)?(\.min)?\.js/';
        if (preg_match($regex, $html)) {
            return;
        }

        $this->add(
            (new JavaScript('js/jquery-2.2.4.min.js', 'bolt'))
                ->setLocation(Target::BEFORE_JS)
        );
    }
protected function addJquery(Request $request, Response $response)
    {
        if (!$this->config->get('general/add_jquery', false) &&
            !$this->config->get('theme/add_jquery', false)) {
            return;
        }

        // Check zone to skip expensive regex
        if (Zone::isFrontend($request) === false) {
            return;
        }

        $html = $response->getContent();
        $regex = '/<script(.*)jquery(-latest|-[0-9\.]*)?(\.min)?\.js/';
        if (preg_match($regex, $html)) {
            return;
        }

        $this->add(
            (new JavaScript('js/jquery-2.2.4.min.js', 'bolt'))
                ->setLocation(Target::BEFORE_JS)
        );
    }
protected function addJquery ( Request $ request , Response $ response ) { if ( ! $ this -> config -> get ( 'general/add_jquery' , false ) && ! $ this -> config -> get ( 'theme/add_jquery' , false ) ) { return ; } // Check zone to skip expensive regex if ( Zone :: isFrontend ( $ request ) === false ) { return ; } $ html = $ response -> getContent ( ) ; $ regex = '/<script(.*)jquery(-latest|-[0-9\.]*)?(\.min)?\.js/' ; if ( preg_match ( $ regex , $ html ) ) { return ; } $ this -> add ( ( new JavaScript ( 'js/jquery-2.2.4.min.js' , 'bolt' ) ) -> setLocation ( Target :: BEFORE_JS ) ) ; }
Insert jQuery, if it's not inserted already.

Some of the patterns that 'match' are:
- jquery.js
- jquery.min.js
- jquery-latest.js
- jquery-latest.min.js
- jquery-1.8.2.min.js
- jquery-1.5.js

@param Request  $request
@param Response $response
Insert jQuery if it s not inserted already .