Skip to content

Commit

Permalink
1.1.4: minification of JS files, favicon, gulpfile.js beautify and cl…
Browse files Browse the repository at this point in the history
…ean up, added owl carousel into demo, demo setup & contact & slider update
  • Loading branch information
jozef butko committed Apr 4, 2015
1 parent 761b23e commit 297a566
Show file tree
Hide file tree
Showing 17 changed files with 292 additions and 185 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Simple AngularJS Boilerplate to kick start your new project with SASS support an
* queryService $http wrapper to handle calls
* clear folder structure
* less than 10 request in build version
* minified CSS and JS build files
* google analytics snippet

## Download
```bash
Expand Down Expand Up @@ -45,8 +47,9 @@ gulp build
* clean _build folder
* compile SASS files, minify and uncss compiled css
* copy and optimize images
* copy all HTML files into $templateCache
* minify and copy all HTML files into $templateCache
* build index.html
* minify and copy all JS files
* copy fonts
* show build folder size

Expand All @@ -67,12 +70,20 @@ Copyright (C) 2015 Jozef Butko<br>
[@jozefbutko](http://www.twitter.com/jozefbutko)

## Changelog
### 1.1.4
- added minification of JS files in build task<br>
- added favicon<br>
- gulpfile.js beautify and clean up<br>
- added owl carousel into demo<br>
04.04.2015

### 1.1.3
- index.html update: added browserupgrade tag<br>
- index.html update: http-equiv meta tag, google analytics support<br>
- comments update in gulpfile.js<br>
- gulpfile.js formatting<br>
- pull request #1: removed duplicate gulp require in gulpfile.js<br>
04.04.2015

### 1.1.2
- package.json and gulpfile.js clean up<br>
Expand Down
73 changes: 44 additions & 29 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @description Description
* @author Jozef Butko // www.jozefbutko.com/resume
* @url www.jozefbutko.com
* @version 1.1.2
* @version 1.1.4
* @date March 2015
*
*/
Expand All @@ -20,8 +20,9 @@
])
.config(config);

// safe dependency injection
// this prevents minification issues
config.$inject = ['$routeProvider', '$locationProvider', '$httpProvider', '$compileProvider'];


/**
* App routing
Expand All @@ -46,16 +47,15 @@
controller: 'MainController',
controllerAs: 'main'
})
.when('/about', {
templateUrl: 'views/about.html',
.when('/setup', {
templateUrl: 'views/setup.html',
controller: 'MainController',
controllerAs: 'main'
})
.otherwise({
redirectTo: '/'
});


$httpProvider.interceptors.push('authInterceptor');

}
Expand All @@ -68,32 +68,47 @@
*/
angular
.module('boilerplate')
.factory('authInterceptor', function($rootScope, $q, LocalStorage, $location) {

return {

// intercept every request
request: function(config) {
config.headers = config.headers || {};
return config;
},

// Catch 404 errors
responseError: function(response) {
if (response.status === 404) {
$location.path('/');
return $q.reject(response);
} else {
return $q.reject(response);
}
.factory('authInterceptor', authInterceptor);

authInterceptor.$inject = ['$rootScope', '$q', 'LocalStorage', '$location'];

function authInterceptor($rootScope, $q, LocalStorage, $location) {

return {

// intercept every request
request: function(config) {
config.headers = config.headers || {};
return config;
},

// Catch 404 errors
responseError: function(response) {
if (response.status === 404) {
$location.path('/');
return $q.reject(response);
} else {
return $q.reject(response);
}
};
})
.run(function($rootScope, $location) {
}
};
}


// put here everything that you need to run on page start
/**
* Run block
*/
angular
.module('boilerplate')
.run(run);

});
run.$inject = ['$rootScope', '$location'];

function run($rootScope, $location) {

// put here everything that you need to run on page load

}


})();
})();
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AngularJS Boilerplate",
"version": "1.1.2",
"version": "1.1.4",
"authors": [
"jozef butko <jbutko@gmail.com> / jozefbutko.com/resume"
],
Expand All @@ -23,6 +23,6 @@
"angular": "~1.3.13",
"angular-route": "~1.3.13",
"angular-sanitize": "~1.3.13",
"owl.carousel": "https://github.com/smashingboxes/OwlCarousel2.git"
"OwlCarousel": "https://github.com/OwlFonk/OwlCarousel.git#~1.3.2"
}
}
6 changes: 3 additions & 3 deletions components/directives/main-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ <h1 id="logo" class="text-hide h1 pull-left" itemscope itemtype="http://schema.o
<nav role="navigation" class="main-nav text-center" itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul class="menu cf">
<li><a href="#/home">Home</a></li>
<li><a href="#/setup">Setup</a></li>
<li><a href="#/contact">Contact</a></li>
<li><a href="#/about">About</a></li>
</ul>
</nav>
</div>
Expand All @@ -25,8 +25,8 @@ <h1 id="logo" class="text-hide h1 pull-left" itemscope itemtype="http://schema.o
<ul class="cf responsive-nav option-set">
<li><a href="#/home">Home</a></li><!--
remove gap
--><li><a href="#/contact">Contact</a></li><!--
--><li><a href="#/setup">Setup</a></li><!--
remove gap
--><li><a href="#/about">About</a></li>
--><li><a href="#/contact">Contact</a></li>
</ul>
</div>
28 changes: 18 additions & 10 deletions components/directives/owl.slider.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
* Owl slider directive
*
* Usage:
* <div myslider></div>
* <div myslider>
* <ul class="slider">
* ...
* </ul>
* </div>
*
* or
*
* <myslider></myslider>
* <myslider>
* <ul class="slider">
* ...
* </ul>
* </myslider>
*
* @url http://owlgraphic.com/owlcarousel/index.html#customizing
*
*/
angular
Expand All @@ -27,18 +37,16 @@
link: function(scope, element, attrs) {

scope.$watch(function() {
angular.element(document).ready(function(i) {
$('.gallery').owlCarousel({
center: true,
angular.element(document).ready(function() {
$('.slider').owlCarousel({
autoPlay: 2500,
items: 1,
singleItem: true,
itemsScaleUp: false,
loop: true,
//singleItem: true,
margin: 0,
nav: true,
dots: false,
autoplay: true,
navText: ''
navText: '',
pauseOnHover: true
});
});
});
Expand Down
Loading

0 comments on commit 297a566

Please sign in to comment.