[READ-ONLY] Subtree split of Rocket Propelled Tortoise UI Script
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Support
assets/js
JS.php
README.md
composer.json
events.php
functions.php

README.md

Script queueing

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

In modern web applications, script execution should be done at the end of a page's loading. This class is a very simple wrapper for this: queue scripts and render them when needed

Install

Via Composer

$ composer require rocket/script

Service Provider

\Rocket\UI\Script\Support\Laravel5\ServiceProvider

Middleware

(App\Http\Kernel.php)

\Rocket\UI\Script\Support\Middleware\ScriptMiddleware

Usage

JS::ready(' console.log("you\'re a wizard, Harry!"); ');
JS::ready(' console.log("Dobby is freeeee!"); ');

Will produce

<script>
$(function() {
    console.log("you're a wizard, Harry!");

    //---

    console.log("Dobby is freeeee!");
});
</script>

Testing

All the tests live in the main project.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.