Skip to content
This repository was archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Change to specifying framework in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebronner committed Mar 21, 2017
1 parent 03657e3 commit 9bcb01d
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 11,433 deletions.
19 changes: 19 additions & 0 deletions config/genealabs-laravel-casts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| CSS Framework Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the CSS framework to be used by Laravel-Casts.
| This allows you to switch or upgrade frameworks without having to
| recreate all your forms.
|
| Available Settings: "vanilla", "bootstrap3", "bootstrap4"
|
*/

'framework' => 'bootstrap3',
];
19 changes: 1 addition & 18 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@ function fontAwesomeIsLoaded()
return fontAwesomeIsLoaded;
}

function getFramework()
{
if ((typeof $.fn.alert.Constructor.VERSION !== 'undefined') &&
($.fn.alert.Constructor.VERSION.charAt(0) === '3')
) {
return "bootstrap3";
}

if ((typeof $.fn.alert.Constructor.VERSION !== undefined) &&
($.fn.alert.Constructor.VERSION.charAt(0) === '4')
) {
return "bootstrap4";
}

return 'vanilla';
}

function insertCssLink(path) {
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
Expand All @@ -50,7 +33,7 @@ if (! fontAwesomeIsLoaded()) {
}

window['genealabsLaravelCasts'] = window.genealabsLaravelCasts || {};
window.genealabsLaravelCasts['framework'] = getFramework();
window.genealabsLaravelCasts['framework'] = {{ config('genealabs-laravel-casts.framework') }};

if ((window.genealabsLaravelCasts.dateTimeLoaders || false) !== false) {
if (typeof moment === 'undefined') {
Expand Down
Loading

0 comments on commit 9bcb01d

Please sign in to comment.