diff --git a/src/app/app.js b/src/app/app.js index f35552f..5b617e9 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -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'); -}]); \ No newline at end of file + 'ui.slimscroll', + + 'BlurAdmin.theme', + 'BlurAdmin.pages', + 'BlurAdmin.tplSkin' +]); \ No newline at end of file diff --git a/src/app/pages/dashboard/timeline/TimelineCtrl.js b/src/app/pages/dashboard/timeline/TimelineCtrl.js new file mode 100644 index 0000000..c55eb6a --- /dev/null +++ b/src/app/pages/dashboard/timeline/TimelineCtrl.js @@ -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'); + }); + } + } +})(); \ No newline at end of file diff --git a/src/app/pages/dashboard/timeline/timeline.js b/src/app/pages/dashboard/timeline/timeline.js deleted file mode 100644 index d30982c..0000000 --- a/src/app/pages/dashboard/timeline/timeline.js +++ /dev/null @@ -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'); - }); - } - -}]); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/select/select.js b/src/app/pages/form/inputs/widgets/select/select.js deleted file mode 100644 index 021296a..0000000 --- a/src/app/pages/form/inputs/widgets/select/select.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -blurAdminApp.directive('selectpicker', [function() { - return { - restrict: 'A', - link: function( $scope, elem) { - $(elem).selectpicker(); - } - }; -}]); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/select/selectpicker.directive.js b/src/app/pages/form/inputs/widgets/select/selectpicker.directive.js new file mode 100644 index 0000000..83af8dc --- /dev/null +++ b/src/app/pages/form/inputs/widgets/select/selectpicker.directive.js @@ -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(); + } + }; + } +})(); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/switch/switch.directive.js b/src/app/pages/form/inputs/widgets/switch/switch.directive.js new file mode 100644 index 0000000..19af514 --- /dev/null +++ b/src/app/pages/form/inputs/widgets/switch/switch.directive.js @@ -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: '
', + link: function (scope, elem, attr) { + $timeout(function(){ + scope.color = attr.color; + $(elem).find('input').bootstrapSwitch({ + size: 'small', + onColor: attr.color + }); + }); + } + }; + } +})(); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/switch/switch.html b/src/app/pages/form/inputs/widgets/switch/switch.html index 7c988d6..210ff3d 100644 --- a/src/app/pages/form/inputs/widgets/switch/switch.html +++ b/src/app/pages/form/inputs/widgets/switch/switch.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/pages/form/inputs/widgets/switch/switch.js b/src/app/pages/form/inputs/widgets/switch/switch.js deleted file mode 100644 index 9abac6b..0000000 --- a/src/app/pages/form/inputs/widgets/switch/switch.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -blurAdminApp.directive('switch', ['$timeout', function ($timeout) { - return { - restrict: 'EA', - replace: true, - scope: { - ngModel: '=' - }, - template: '
', - 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 ]; -}]); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.directive.js b/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.directive.js new file mode 100644 index 0000000..cdb1e97 --- /dev/null +++ b/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.directive.js @@ -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 + }); + } + }; + } +})(); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.js b/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.js deleted file mode 100644 index fbb67d2..0000000 --- a/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.js +++ /dev/null @@ -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 - }); - } - }; -}]); \ No newline at end of file diff --git a/src/app/pages/pages.module.js b/src/app/pages/pages.module.js index cf6d840..ab3ef78 100644 --- a/src/app/pages/pages.module.js +++ b/src/app/pages/pages.module.js @@ -23,6 +23,12 @@ 'BlurAdmin.pages.progressBars', 'BlurAdmin.pages.tables', 'BlurAdmin.pages.typography' - ]); + ]) + .config(routeConfig); + + /** @ngInject */ + function routeConfig($urlRouterProvider) { + $urlRouterProvider.otherwise('/dashboard'); + } })(); diff --git a/src/app/tplSkin/tplSkin.constants.js b/src/app/tplSkin/tplSkin.constants.js index 85e390a..65a1398 100644 --- a/src/app/tplSkin/tplSkin.constants.js +++ b/src/app/tplSkin/tplSkin.constants.js @@ -57,7 +57,7 @@ } }; - blurAdminApp + angular.module('BlurAdmin.tplSkin') .constant('tplSkinClassPrefix', SKIN_CLASS_PREFIX) .constant('tplSkinEnum', ADMIN_STYLES) .constant('tplSkinChartColors', SKIN_CHART_COLORS); diff --git a/src/app/tplSkin/tplSkin.module.js b/src/app/tplSkin/tplSkin.module.js new file mode 100644 index 0000000..fe48b37 --- /dev/null +++ b/src/app/tplSkin/tplSkin.module.js @@ -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', []); + +})(); diff --git a/src/app/tplSkin/tplSkinChartWatcherHelper.service.js b/src/app/tplSkin/tplSkinChartWatcherHelper.service.js index 1c9e679..40e5e9d 100644 --- a/src/app/tplSkin/tplSkinChartWatcherHelper.service.js +++ b/src/app/tplSkin/tplSkinChartWatcherHelper.service.js @@ -5,7 +5,7 @@ (function() { 'use strict'; - blurAdminApp + angular.module('BlurAdmin.tplSkin') .service('tplSkinChartWatcherHelper', tplSkinChartWatcherHelper); tplSkinChartWatcherHelper.$inject = ['tplSkinManager']; diff --git a/src/app/tplSkin/tplSkinManager.service.js b/src/app/tplSkin/tplSkinManager.service.js index 0534230..b2e5ba9 100644 --- a/src/app/tplSkin/tplSkinManager.service.js +++ b/src/app/tplSkin/tplSkinManager.service.js @@ -5,7 +5,7 @@ (function() { 'use strict'; - blurAdminApp + angular.module('BlurAdmin.tplSkin') .service('tplSkinManager', tplSkinManager); tplSkinManager.$inject = ['$rootScope', '$document', 'tplSkinClassPrefix', 'tplSkinChartColors', 'tplSkinEnum']; diff --git a/src/app/tplSkin/tplSkinPanel.directive.js b/src/app/tplSkin/tplSkinPanel.directive.js index ee279de..961e79d 100644 --- a/src/app/tplSkin/tplSkinPanel.directive.js +++ b/src/app/tplSkin/tplSkinPanel.directive.js @@ -5,7 +5,7 @@ (function() { 'use strict'; - blurAdminApp + angular.module('BlurAdmin.tplSkin') .directive('tplSkinPanel', tplSkinPanel); tplSkinPanel.$inject = ['tplSkinEnum', 'tplSkinManager'];