-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<?php | ||
|
||
namespace Skydiver\LaravelMaterializeCSS; | ||
namespace Skydiver\LaravelMaterializeCSS; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
use Illuminate\Support\Facades\Facade; | ||
|
||
class MaterializeCSS extends Facade { | ||
|
||
protected static function getFacadeAccessor() { return 'materialize-css'; } | ||
class MaterializeCSS extends Facade { | ||
|
||
protected static function getFacadeAccessor() { | ||
return 'materialize-css'; | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,73 @@ | ||
<?php | ||
|
||
namespace Skydiver\LaravelMaterializeCSS; | ||
namespace Skydiver\LaravelMaterializeCSS; | ||
|
||
class MaterializeCSSBuilder { | ||
class MaterializeCSSBuilder { | ||
|
||
private static $file_css = '/materialize-css/css/materialize.css'; | ||
private static $file_css_min = '/materialize-css/css/materialize.min.css'; | ||
private static $file_js = '/materialize-css/js/materialize.js'; | ||
private static $file_js_min = '/materialize-css/js/materialize.min.js'; | ||
private static $file_jquery = 'jquery-2.1.1.min.js'; | ||
private static $file_css = '/materialize-css/css/materialize.css'; | ||
private static $file_css_min = '/materialize-css/css/materialize.min.css'; | ||
private static $file_js = '/materialize-css/js/materialize.js'; | ||
private static $file_js_min = '/materialize-css/js/materialize.min.js'; | ||
private static $file_jquery = 'jquery-2.1.1.min.js'; | ||
|
||
|
||
public static function include_full() { | ||
$return = self::include_css(); | ||
$return .= self::tag_js('https://code.jquery.com/'.self::$file_jquery); | ||
$return .= self::include_js(); | ||
return $return; | ||
} | ||
public static function include_full() { | ||
$return = self::include_css(); | ||
$return .= self::tag_js('https://code.jquery.com/'.self::$file_jquery); | ||
$return .= self::include_js(); | ||
return $return; | ||
} | ||
|
||
public static function include_all() { | ||
$return = self::include_css(); | ||
$return .= self::include_js(); | ||
return $return; | ||
} | ||
public static function include_all() { | ||
$return = self::include_css(); | ||
$return .= self::include_js(); | ||
return $return; | ||
} | ||
|
||
public static function include_css() { | ||
return self::tag_css(asset(self::$file_css_min)); | ||
} | ||
public static function include_css() { | ||
return self::tag_css(asset(self::$file_css_min)); | ||
} | ||
|
||
public static function include_js() { | ||
return self::tag_js(asset(self::$file_js_min)); | ||
} | ||
public static function include_js() { | ||
return self::tag_js(asset(self::$file_js_min)); | ||
} | ||
|
||
public static function include_secure_css() { | ||
return self::tag_css(secure_asset(self::$file_css_min)); | ||
} | ||
public static function include_secure_css() { | ||
return self::tag_css(secure_asset(self::$file_css_min)); | ||
} | ||
|
||
public static function include_secure_js() { | ||
return self::tag_js(secure_asset(self::$file_js_min)); | ||
} | ||
public static function include_secure_js() { | ||
return self::tag_js(secure_asset(self::$file_js_min)); | ||
} | ||
|
||
public static function get_url_css($full=false, $secure=false) { | ||
if($full == true && $secure == true) { | ||
return secure_asset(self::$file_css_min); | ||
} | ||
if($full == true && $secure == false) { | ||
return asset(self::$file_css_min); | ||
} | ||
return self::$file_css_min; | ||
public static function get_url_css($full=false, $secure=false) { | ||
if($full == true && $secure == true) { | ||
return secure_asset(self::$file_css_min); | ||
} | ||
|
||
public static function get_url_js($full=false, $secure=false) { | ||
if($full == true && $secure == true) { | ||
return secure_asset(self::$file_js_min); | ||
} | ||
if($full == true && $secure == false) { | ||
return asset(self::$file_js_min); | ||
} | ||
return self::$file_js_min; | ||
if($full == true && $secure == false) { | ||
return asset(self::$file_css_min); | ||
} | ||
return self::$file_css_min; | ||
} | ||
|
||
private static function tag_css($path) { | ||
return '<link rel="stylesheet" charset="utf-8" href="'.$path.'">'; | ||
public static function get_url_js($full=false, $secure=false) { | ||
if($full == true && $secure == true) { | ||
return secure_asset(self::$file_js_min); | ||
} | ||
|
||
private static function tag_js($path) { | ||
return '<script type="text/javascript" src="'.$path.'"></script>'; | ||
if($full == true && $secure == false) { | ||
return asset(self::$file_js_min); | ||
} | ||
return self::$file_js_min; | ||
} | ||
|
||
private static function tag_css($path) { | ||
return '<link rel="stylesheet" charset="utf-8" href="'.$path.'">'; | ||
} | ||
|
||
private static function tag_js($path) { | ||
return '<script type="text/javascript" src="'.$path.'"></script>'; | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
<?php | ||
|
||
namespace Skydiver\LaravelMaterializeCSS; | ||
namespace Skydiver\LaravelMaterializeCSS; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class MaterializeCSSServiceProvider extends ServiceProvider { | ||
class MaterializeCSSServiceProvider extends ServiceProvider { | ||
|
||
protected $defer = true; | ||
protected $defer = true; | ||
|
||
public function register() { | ||
$this->publishes([ | ||
__DIR__.'/../assets' => public_path('materialize-css'), | ||
], 'materializecss'); | ||
$this->registerMaterializeCSSBuilder(); | ||
$this->app->alias('materialize-css', 'Skydiver\LaravelMaterializeCSS\MaterializeCSSBuilder'); | ||
} | ||
|
||
protected function registerMaterializeCSSBuilder() { | ||
$this->app->singleton('materialize-css', function($app) { | ||
return new MaterializeCSSBuilder($app['url']); | ||
}); | ||
} | ||
public function register() { | ||
$this->publishes([ | ||
__DIR__.'/../assets' => public_path('materialize-css'), | ||
], 'materializecss'); | ||
$this->registerMaterializeCSSBuilder(); | ||
$this->app->alias('materialize-css', 'Skydiver\LaravelMaterializeCSS\MaterializeCSSBuilder'); | ||
} | ||
|
||
public function provides() { | ||
return array('materialize-css'); | ||
} | ||
protected function registerMaterializeCSSBuilder() { | ||
$this->app->singleton('materialize-css', function ($app) { | ||
return new MaterializeCSSBuilder($app['url']); | ||
}); | ||
} | ||
|
||
public function provides() { | ||
return array('materialize-css'); | ||
} | ||
|
||
} | ||
|
||
?> |