refactor(app): blurAdmin app completely removed

pull/3/head
Vladimir Lugovsky 2015-12-17 00:42:45 +03:00
parent cf4d8c9eb8
commit 119f4ab51a
16 changed files with 150 additions and 95 deletions

View File

@ -1,14 +1,14 @@
'use strict';
var blurAdminApp = angular.module('BlurAdmin', [
angular.module('BlurAdmin', [
'ui.sortable',
'ui.router',
'ngTouch',
'BlurAdmin.theme',
'BlurAdmin.pages',
'toastr',
'smart-table',
'ui.slimscroll'
]).config(['$urlRouterProvider', function ($urlRouterProvider) {
$urlRouterProvider.otherwise('/dashboard');
}]);
'ui.slimscroll',
'BlurAdmin.theme',
'BlurAdmin.pages',
'BlurAdmin.tplSkin'
]);

View File

@ -0,0 +1,44 @@
/**
* @author v.lugovksy
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.dashboard')
.service('TimelineCtrl', TimelineCtrl);
/** @ngInject */
function TimelineCtrl() {
var timelineBlocks = $('.cd-timeline-block'),
offset = 0.8;
//hide timeline blocks which are outside the viewport
hideBlocks(timelineBlocks, offset);
//on scolling, show/animate timeline blocks when enter the viewport
$(window).on('scroll', function () {
if (!window.requestAnimationFrame) {
setTimeout(function () {
showBlocks(timelineBlocks, offset);
}, 100);
} else {
window.requestAnimationFrame(function () {
showBlocks(timelineBlocks, offset);
});
}
});
function hideBlocks(blocks, offset) {
blocks.each(function () {
( $(this).offset().top > $(window).scrollTop() + $(window).height() * offset ) && $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden');
});
}
function showBlocks(blocks, offset) {
blocks.each(function () {
( $(this).offset().top <= $(window).scrollTop() + $(window).height() * offset && $(this).find('.cd-timeline-img').hasClass('is-hidden') ) && $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
});
}
}
})();

View File

@ -1,35 +0,0 @@
'use strict';
blurAdminApp.controller('timelineCtrl', [function () {
var timelineBlocks = $('.cd-timeline-block'),
offset = 0.8;
//hide timeline blocks which are outside the viewport
hideBlocks(timelineBlocks, offset);
//on scolling, show/animate timeline blocks when enter the viewport
$(window).on('scroll', function () {
if (!window.requestAnimationFrame) {
setTimeout(function () {
showBlocks(timelineBlocks, offset);
}, 100);
} else {
window.requestAnimationFrame(function () {
showBlocks(timelineBlocks, offset);
});
}
});
function hideBlocks(blocks, offset) {
blocks.each(function () {
( $(this).offset().top > $(window).scrollTop() + $(window).height() * offset ) && $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden');
});
}
function showBlocks(blocks, offset) {
blocks.each(function () {
( $(this).offset().top <= $(window).scrollTop() + $(window).height() * offset && $(this).find('.cd-timeline-img').hasClass('is-hidden') ) && $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
});
}
}]);

View File

@ -1,10 +0,0 @@
'use strict';
blurAdminApp.directive('selectpicker', [function() {
return {
restrict: 'A',
link: function( $scope, elem) {
$(elem).selectpicker();
}
};
}]);

View File

@ -0,0 +1,20 @@
/**
* @author v.lugovksy
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.form')
.directive('selectpicker', selectpicker);
/** @ngInject */
function selectpicker() {
return {
restrict: 'A',
link: function( $scope, elem) {
$(elem).selectpicker();
}
};
}
})();

View File

@ -0,0 +1,31 @@
/**
* @author v.lugovksy
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.form')
.service('switch', switchDirective);
/** @ngInject */
function switchDirective($timeout) {
return {
restrict: 'EA',
replace: true,
scope: {
ngModel: '='
},
template: '<div class="switch-container {{color}}"><input type="checkbox" ng-model="ngModel"></div>',
link: function (scope, elem, attr) {
$timeout(function(){
scope.color = attr.color;
$(elem).find('input').bootstrapSwitch({
size: 'small',
onColor: attr.color
});
});
}
};
}
})();

View File

@ -1,4 +1,4 @@
<div ng-controller="switchCtrl" class="switches clearfix">
<div ng-init="switches = [ true, true, true, true, true, true ]" class="switches clearfix">
<switch color="success" ng-model="switches[0]"></switch>
<switch color="warning" ng-model="switches[1]"></switch>
<switch color="danger" ng-model="switches[2]"></switch>

View File

@ -1,25 +0,0 @@
'use strict';
blurAdminApp.directive('switch', ['$timeout', function ($timeout) {
return {
restrict: 'EA',
replace: true,
scope: {
ngModel: '='
},
template: '<div class="switch-container {{color}}"><input type="checkbox" ng-model="ngModel"></div>',
link: function (scope, elem, attr) {
$timeout(function(){
scope.color = attr.color;
$(elem).find('input').bootstrapSwitch({
size: 'small',
onColor: attr.color
});
});
}
};
}])
.controller('switchCtrl', ['$scope', function ($scope) {
$scope.switches = [ true, true, true, true, true, true ];
}]);

View File

@ -0,0 +1,22 @@
/**
* @author v.lugovksy
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.form')
.service('tagsInput', tagsInput);
/** @ngInject */
function tagsInput() {
return {
restrict: 'A',
link: function( $scope, elem, attr) {
$(elem).tagsinput({
tagClass: 'label label-' + attr.tagInput
});
}
};
}
})();

View File

@ -1,12 +0,0 @@
'use strict';
blurAdminApp.directive('tagInput', [function() {
return {
restrict: 'A',
link: function( $scope, elem, attr) {
$(elem).tagsinput({
tagClass: 'label label-' + attr.tagInput
});
}
};
}]);

View File

@ -23,6 +23,12 @@
'BlurAdmin.pages.progressBars',
'BlurAdmin.pages.tables',
'BlurAdmin.pages.typography'
]);
])
.config(routeConfig);
/** @ngInject */
function routeConfig($urlRouterProvider) {
$urlRouterProvider.otherwise('/dashboard');
}
})();

View File

@ -57,7 +57,7 @@
}
};
blurAdminApp
angular.module('BlurAdmin.tplSkin')
.constant('tplSkinClassPrefix', SKIN_CLASS_PREFIX)
.constant('tplSkinEnum', ADMIN_STYLES)
.constant('tplSkinChartColors', SKIN_CHART_COLORS);

View File

@ -0,0 +1,14 @@
/**
* @author v.lugovksy
* created on 16.12.2015
*/
/**
* @author v.lugovsky
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.tplSkin', []);
})();

View File

@ -5,7 +5,7 @@
(function() {
'use strict';
blurAdminApp
angular.module('BlurAdmin.tplSkin')
.service('tplSkinChartWatcherHelper', tplSkinChartWatcherHelper);
tplSkinChartWatcherHelper.$inject = ['tplSkinManager'];

View File

@ -5,7 +5,7 @@
(function() {
'use strict';
blurAdminApp
angular.module('BlurAdmin.tplSkin')
.service('tplSkinManager', tplSkinManager);
tplSkinManager.$inject = ['$rootScope', '$document', 'tplSkinClassPrefix', 'tplSkinChartColors', 'tplSkinEnum'];

View File

@ -5,7 +5,7 @@
(function() {
'use strict';
blurAdminApp
angular.module('BlurAdmin.tplSkin')
.directive('tplSkinPanel', tplSkinPanel);
tplSkinPanel.$inject = ['tplSkinEnum', 'tplSkinManager'];