src/Adapter/ExtractAdapter.php
public function generateScripts(array $params = null)
    {
        $cball = <<<CBALL
(function(window,$){ 
            $('body').on('click', '#%s', function () {
                $('div.test-results').remove();
                var form=$(this).parents('form:first');                
                $.ajax({
                    url:"%s",
                    data:form.serialize(),
                    type:"POST",
                    beforeSend:function(){                        
                        form.find('input,button,select,textarea').addClass('btn-disabled').attr('disabled','disabled');
                    },
                    success:function(response){
                        $('<div/>').attr('class','test-results').html(response).insertAfter(form);
                        form.find('input,button,select,textarea').removeClass('btn-disabled').removeAttr('disabled');
                    },
                    error:function(response){
                        form.find('input,button,select,textarea').removeClass('btn-disabled').removeAttr('disabled');
                    }
                });
                return false;
            });      
   })(window,jQuery);

CBALL;

        $inlineScript = sprintf($cball, $params['id'], handles('antares::tools/tester/run', ['csrf' => true]));
        app('antares.asset')
                ->container(app('config')->get('antares/tester::container'))
                ->inlineScript($params['id'], $inlineScript);
    }
public function generateScripts(array $params = null)
    {
        $cball = <<<CBALL
(function(window,$){ 
            $('body').on('click', '#%s', function () {
                $('div.test-results').remove();
                var form=$(this).parents('form:first');                
                $.ajax({
                    url:"%s",
                    data:form.serialize(),
                    type:"POST",
                    beforeSend:function(){                        
                        form.find('input,button,select,textarea').addClass('btn-disabled').attr('disabled','disabled');
                    },
                    success:function(response){
                        $('<div/>').attr('class','test-results').html(response).insertAfter(form);
                        form.find('input,button,select,textarea').removeClass('btn-disabled').removeAttr('disabled');
                    },
                    error:function(response){
                        form.find('input,button,select,textarea').removeClass('btn-disabled').removeAttr('disabled');
                    }
                });
                return false;
            });      
   })(window,jQuery);

CBALL;

        $inlineScript = sprintf($cball, $params['id'], handles('antares::tools/tester/run', ['csrf' => true]));
        app('antares.asset')
                ->container(app('config')->get('antares/tester::container'))
                ->inlineScript($params['id'], $inlineScript);
    }
public function generateScripts ( array $ params = null ) { $ cball =  <<<CBALL
(function(window,$){ 
            $('body').on('click', '#%s', function () {
                $('div.test-results').remove();
                var form=$(this).parents('form:first');                
                $.ajax({
                    url:"%s",
                    data:form.serialize(),
                    type:"POST",
                    beforeSend:function(){                        
                        form.find('input,button,select,textarea').addClass('btn-disabled').attr('disabled','disabled');
                    },
                    success:function(response){
                        $('<div/>').attr('class','test-results').html(response).insertAfter(form);
                        form.find('input,button,select,textarea').removeClass('btn-disabled').removeAttr('disabled');
                    },
                    error:function(response){
                        form.find('input,button,select,textarea').removeClass('btn-disabled').removeAttr('disabled');
                    }
                });
                return false;
            });      
   })(window,jQuery);

CBALL ; $ inlineScript = sprintf ( $ cball , $ params [ 'id' ] , handles ( 'antares::tools/tester/run' , [ 'csrf' => true ] ) ) ; app ( 'antares.asset' ) -> container ( app ( 'config' ) -> get ( 'antares/tester::container' ) ) -> inlineScript ( $ params [ 'id' ] , $ inlineScript ) ; }
generates inline scripts to handle button click event

@param array $params
generates inline scripts to handle button click event