/** * Execute the console command. * * @return void */ public function run() { $collections = Basset::getCollections(); foreach ($collections as $collection) { echo $collection->getName() . ":\n"; $assets = $collection->getAssets(); echo ' Styles: ' . (isset($assets['style']) ? $collection->isCompiled('style') ? 'Compiled' : 'Uncompiled or needs re-compiling' : 'None available'); echo "\n"; echo ' Scripts: ' . (isset($assets['script']) ? $collection->isCompiled('script') ? 'Compiled' : 'Uncompiled or needs re-compiling' : 'None available'); echo "\n"; } echo "\nTotal collections: " . count($collections); }
/** * Execute the console command. * * @return void */ public function run($arguments) { if (!empty($arguments)) { $collection = $arguments[0]; if (!Basset::hasCollection($collection)) { echo "Oops! Could not find collection: {$collection}"; return; } echo "Gathering assets for collection...\n"; $collections = array(Basset::collection($collection)); } else { echo "Gathering collections to compile...\n"; $collections = Basset::getCollections(); } // Spin through and compile each of the collections. foreach ($collections as $collection) { $this->compile($collection); } echo "\nDone!"; }
$collection->add('js/libs/bootstrap/bootstrap-alert.js'); $collection->add('js/libs/bootstrap/bootstrap-fileupload.js'); }); Basset::collection('styles-dashboard-events_new', function ($collection) { $collection->add('css/normalize.css'); $collection->add('css/bootstrap.css'); $collection->add('css/bootstrap-responsive.css'); $collection->add('css/styles.css'); $collection->add('css/datepicker.css'); }); Basset::collection('scripts-dashboard-events_new', function ($collection) { $collection->add('js/libs/jquery.min.js'); $collection->add('js/libs/bootstrap/bootstrap-dropdown.js'); $collection->add('js/libs/bootstrap/bootstrap-alert.js'); $collection->add('js/libs/bootstrap/bootstrap-datepicker.js'); $collection->add('js/events.js'); }); Basset::collection('styles-dashboard-events_edit', function ($collection) { $collection->add('css/normalize.css'); $collection->add('css/bootstrap.css'); $collection->add('css/bootstrap-responsive.css'); $collection->add('css/styles.css'); $collection->add('css/datepicker.css'); }); Basset::collection('scripts-dashboard-events_edit', function ($collection) { $collection->add('js/libs/jquery.min.js'); $collection->add('js/libs/bootstrap/bootstrap-dropdown.js'); $collection->add('js/libs/bootstrap/bootstrap-alert.js'); $collection->add('js/libs/bootstrap/bootstrap-datepicker.js'); $collection->add('js/events.js'); });
<?php Basset::collection('application', function ($collection) { $collection->add('components/normalize-css/normalize.css'); $collection->add('app/css/styles.css'); $collection->add('components/jquery/jquery.min.js'); $collection->add('components/jquery-waypoints/waypoints.min.js'); $collection->add('components/jquery-linkify/jquery.linkify.js'); $collection->add('app/js/scripts.js'); $collection->add('app/js/infinite-scrolling.js'); });
* This is what makes it possible for Basset routes to be adjusted prior to them being displayed. */ $handler = Bundle::handles(URI::current()); Route::filter("{$handler}::before", function () { Config::set('session.driver', ''); return Basset::compiled(); }); /** * After the Basset route is run we'll adjust the response object setting the appropriate content * type for the assets. */ Route::filter("{$handler}::after", function ($response) { $types = array('less' => 'text/css', 'sass' => 'text/css', 'scss' => 'text/css', 'css' => 'text/css', 'js' => 'text/javascript'); $extension = File::extension(Request::uri()); if (array_key_exists($extension, $types)) { $response->header('Content-Type', $types[$extension]); } // To prevent any further output being added to any Basset routes we'll clear any events listening // for the laravel.done event. Event::clear('laravel.done'); }); } /** * If the current URI is not being handled by Basset then all registered Basset routes will be * compiled once Laravel has finished doing its thing. */ if (!starts_with(URI::current(), Bundle::option('basset', 'handles'))) { Event::listen('laravel.done', function () { Basset::compile(); }); }
<?php echo Section::yield('content'); ?> </div> <!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> --> <script>window.jQuery || document.write('<script src="/js/jquery-1.7.1.min.js"><\/script>')</script> <script src="/js/jquery-ui-1.8.22.custom.min.js"></script> <?php echo Section::yield('additional-scripts'); ?> <?php echo Basset::show('website.js'); ?> <?php echo HTML::script('js/bootstrap.js'); ?> <script> var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']]; (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; s.parentNode.insertBefore(g,s)}(document,'script')); </script> </body> </html>
Basset::collection('bootstrap_js', function ($collection) { $collection->add('./assets/js/jquery.min.js'); $collection->add('./assets/bootstrap/js/bootstrap.min.js'); })->apply('JsMin'); Basset::collection('dashboard', function ($collection) { $collection->add('./assets/css/style.css'); $collection->add('./assets/css/style_responsive.css'); $collection->add('./assets/css/style_default.css'); })->apply('UriRewriteFilter')->setArguments(public_path())->andApply('CssMin'); Basset::collection('dashboard_js', function ($collection) { $collection->add('./assets/js/highcharts.js'); $collection->add('./js/jquery.input-ip-address-control-1.0.min.js'); $collection->add('./assets/js/main.js'); $collection->add('./assets/js/add_another_site.js'); $collection->add('./assets/js/site_more_info.js'); })->apply('JsMin'); Basset::collection('walkthrough', function ($collection) { $collection->add('./assets/css/dashboard.pagewalkthrough.css'); })->apply('UriRewriteFilter')->setArguments(public_path())->andApply('CssMin'); Basset::collection('walkthrough_js', function ($collection) { $collection->add('./assets/js/jquery.pagewalkthrough-1.1.0.js'); $collection->add('./assets/js/settings.pagewalkthrough.js'); })->apply('JsMin'); Basset::collection('jquery_main_js', function ($collection) { $collection->add('./assets/js/jquery.min.js'); $collection->add('./assets/js/main.js'); })->apply('JsMin'); Basset::collection('account_js', function ($collection) { $collection->add('./assets/js/account.js'); })->apply('JsMin'); return $app;
Route::get('templates/new', array('uses' => 'sowtemplates@new')); Route::post('templates', array('uses' => 'sowtemplates@create')); /* |-------------------------------------------------------------------------- | Basset Routes |-------------------------------------------------------------------------- */ Bundle::start('basset'); if (Config::get('basset')) { Basset\Config::extend(Config::get('basset')); } Basset::styles('website', function ($basset) { $basset->add('main', 'main.css')->add('font-awesome', 'font-awesome.css'); }); Basset::scripts('website', function ($basset) { $basset->add('bootstrap-datepicker', 'bootstrap-datepicker.js')->add('autogrow-input', 'autogrow-input.js')->add('main', 'main.js'); }); /* |-------------------------------------------------------------------------- | Application 404 & 500 Error Handlers |-------------------------------------------------------------------------- | | To centralize and simplify 404 handling, Laravel uses an awesome event | system to retrieve the response. Feel free to modify this function to | your tastes and the needs of your application. | | Similarly, we use an event to handle the display of 500 level errors | within the application. These errors are fired when there is an | uncaught exception thrown in the application. | */
| to the user if maintenace mode is in effect for this application. | */ App::down(function () { return Response::make("Be right back!", 503); }); $publicdir = __DIR__ . '/../../public/'; require app_path() . '/filters.php'; /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ Basset::collection('bootstrap', function ($collection) { $collection->add('../public/css/bootstrap.min.css'); $collection->add('../public/css/bootstrap-responsive.min.css'); $collection->add('../public/js/jquery-1.9.0.min.js'); $collection->add('../public/js/jquery-2.0.2-min.js'); $collection->add('../public/js/bootstrap.min.js'); $collection->add('../public/js/jquery.validate.min.js'); $collection->add('../public/js/additional-methods.min.js'); }); Basset::collection('grans', function ($collection) { // Collection definition. $collection->add('../public/css/system/main.css'); });
$commonPath = 'packages/codenamegary/l4layouts/common'; Basset::collection('jquery-1.9.1', function ($collection) use($commonPath) { $collection->javascript($commonPath . '/js/jquery-1.9.1.min.js'); }); $bootstrapVersions = Config::get('l4layouts::settings.bootstrap.versions'); foreach ($bootstrapVersions as $version) { $dirName = 'bootstrap-' . $version; $basePath = 'packages/codenamegary/l4layouts/' . $dirName; Basset::collection($dirName, function ($collection) use($basePath) { $collection->stylesheet($basePath . '/css/bootstrap.min.css'); $collection->javascript($basePath . '/js/bootstrap.min.js'); }); } $foundationVersions = Config::get('l4layouts::settings.foundation.versions'); foreach ($foundationVersions as $version) { $dirName = 'foundation-' . $version; $basePath = 'packages/codenamegary/l4layouts/' . $dirName; Basset::collection($dirName, function ($collection) use($basePath, $commonPath) { $collection->stylesheet($basePath . '/css/foundation.min.css'); //$collection->javascript($commonPath.'/js/jquery-1.9.1.min.js'); $collection->javascript($basePath . '/js/foundation.min.js'); }); } $fontAwesomeVersions = Config::get('l4layouts::settings.font-awesome.versions'); foreach ($fontAwesomeVersions as $version) { $dirName = 'font-awesome-' . $version; $basePath = 'packages/codenamegary/l4layouts/' . $dirName; Basset::collection($dirName, function ($collection) use($basePath, $commonPath) { $collection->stylesheet($basePath . '/css/font-awesome.css'); }); }