http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/f629d0f4/griffin-ui/bower_components/angular-smart-table/dist/smart-table.js ---------------------------------------------------------------------- diff --git a/griffin-ui/bower_components/angular-smart-table/dist/smart-table.js b/griffin-ui/bower_components/angular-smart-table/dist/smart-table.js deleted file mode 100644 index d8acea2..0000000 --- a/griffin-ui/bower_components/angular-smart-table/dist/smart-table.js +++ /dev/null @@ -1,539 +0,0 @@ -/** -* @version 2.1.6 -* @license MIT -*/ -(function (ng, undefined){ - 'use strict'; - -ng.module('smart-table', []).run(['$templateCache', function ($templateCache) { - $templateCache.put('template/smart-table/pagination.html', - '<nav ng-if="numPages && pages.length >= 2"><ul class="pagination">' + - '<li ng-repeat="page in pages" ng-class="{active: page==currentPage}"><a ng-click="selectPage(page)">{{page}}</a></li>' + - '</ul></nav>'); -}]); - - -ng.module('smart-table') - .constant('stConfig', { - pagination: { - template: 'template/smart-table/pagination.html', - itemsByPage: 10, - displayedPages: 5 - }, - search: { - delay: 400, // ms - inputEvent: 'input' - }, - select: { - mode: 'single', - selectedClass: 'st-selected' - }, - sort: { - ascentClass: 'st-sort-ascent', - descentClass: 'st-sort-descent', - skipNatural: false, - delay:300 - }, - pipe: { - delay: 100 //ms - } - }); -ng.module('smart-table') - .controller('stTableController', ['$scope', '$parse', '$filter', '$attrs', function StTableController ($scope, $parse, $filter, $attrs) { - var propertyName = $attrs.stTable; - var displayGetter = $parse(propertyName); - var displaySetter = displayGetter.assign; - var safeGetter; - var orderBy = $filter('orderBy'); - var filter = $filter('filter'); - var safeCopy = copyRefs(displayGetter($scope)); - var tableState = { - sort: {}, - search: {}, - pagination: { - start: 0, - totalItemCount: 0 - } - }; - var filtered; - var pipeAfterSafeCopy = true; - var ctrl = this; - var lastSelected; - - function copyRefs (src) { - return src ? [].concat(src) : []; - } - - function updateSafeCopy () { - safeCopy = copyRefs(safeGetter($scope)); - if (pipeAfterSafeCopy === true) { - ctrl.pipe(); - } - } - - function deepDelete (object, path) { - if (path.indexOf('.') != -1) { - var partials = path.split('.'); - var key = partials.pop(); - var parentPath = partials.join('.'); - var parentObject = $parse(parentPath)(object) - delete parentObject[key]; - if (Object.keys(parentObject).length == 0) { - deepDelete(object, parentPath); - } - } else { - delete object[path]; - } - } - - if ($attrs.stSafeSrc) { - safeGetter = $parse($attrs.stSafeSrc); - $scope.$watch(function () { - var safeSrc = safeGetter($scope); - return safeSrc && safeSrc.length ? safeSrc[0] : undefined; - }, function (newValue, oldValue) { - if (newValue !== oldValue) { - updateSafeCopy(); - } - }); - $scope.$watch(function () { - var safeSrc = safeGetter($scope); - return safeSrc ? safeSrc.length : 0; - }, function (newValue, oldValue) { - if (newValue !== safeCopy.length) { - updateSafeCopy(); - } - }); - $scope.$watch(function () { - return safeGetter($scope); - }, function (newValue, oldValue) { - if (newValue !== oldValue) { - tableState.pagination.start = 0; - updateSafeCopy(); - } - }); - } - - /** - * sort the rows - * @param {Function | String} predicate - function or string which will be used as predicate for the sorting - * @param [reverse] - if you want to reverse the order - */ - this.sortBy = function sortBy (predicate, reverse) { - tableState.sort.predicate = predicate; - tableState.sort.reverse = reverse === true; - - if (ng.isFunction(predicate)) { - tableState.sort.functionName = predicate.name; - } else { - delete tableState.sort.functionName; - } - - tableState.pagination.start = 0; - return this.pipe(); - }; - - /** - * search matching rows - * @param {String} input - the input string - * @param {String} [predicate] - the property name against you want to check the match, otherwise it will search on all properties - */ - this.search = function search (input, predicate) { - var predicateObject = tableState.search.predicateObject || {}; - var prop = predicate ? predicate : '$'; - - input = ng.isString(input) ? input.trim() : input; - $parse(prop).assign(predicateObject, input); - // to avoid to filter out null value - if (!input) { - deepDelete(predicateObject, prop); - } - tableState.search.predicateObject = predicateObject; - tableState.pagination.start = 0; - return this.pipe(); - }; - - /** - * this will chain the operations of sorting and filtering based on the current table state (sort options, filtering, ect) - */ - this.pipe = function pipe () { - var pagination = tableState.pagination; - var output; - filtered = tableState.search.predicateObject ? filter(safeCopy, tableState.search.predicateObject) : safeCopy; - if (tableState.sort.predicate) { - filtered = orderBy(filtered, tableState.sort.predicate, tableState.sort.reverse); - } - pagination.totalItemCount = filtered.length; - if (pagination.number !== undefined) { - pagination.numberOfPages = filtered.length > 0 ? Math.ceil(filtered.length / pagination.number) : 1; - pagination.start = pagination.start >= filtered.length ? (pagination.numberOfPages - 1) * pagination.number : pagination.start; - output = filtered.slice(pagination.start, pagination.start + parseInt(pagination.number)); - } - displaySetter($scope, output || filtered); - }; - - /** - * select a dataRow (it will add the attribute isSelected to the row object) - * @param {Object} row - the row to select - * @param {String} [mode] - "single" or "multiple" (multiple by default) - */ - this.select = function select (row, mode) { - var rows = copyRefs(displayGetter($scope)); - var index = rows.indexOf(row); - if (index !== -1) { - if (mode === 'single') { - row.isSelected = row.isSelected !== true; - if (lastSelected) { - lastSelected.isSelected = false; - } - lastSelected = row.isSelected === true ? row : undefined; - } else { - rows[index].isSelected = !rows[index].isSelected; - } - } - }; - - /** - * take a slice of the current sorted/filtered collection (pagination) - * - * @param {Number} start - start index of the slice - * @param {Number} number - the number of item in the slice - */ - this.slice = function splice (start, number) { - tableState.pagination.start = start; - tableState.pagination.number = number; - return this.pipe(); - }; - - /** - * return the current state of the table - * @returns {{sort: {}, search: {}, pagination: {start: number}}} - */ - this.tableState = function getTableState () { - return tableState; - }; - - this.getFilteredCollection = function getFilteredCollection () { - return filtered || safeCopy; - }; - - /** - * Use a different filter function than the angular FilterFilter - * @param filterName the name under which the custom filter is registered - */ - this.setFilterFunction = function setFilterFunction (filterName) { - filter = $filter(filterName); - }; - - /** - * Use a different function than the angular orderBy - * @param sortFunctionName the name under which the custom order function is registered - */ - this.setSortFunction = function setSortFunction (sortFunctionName) { - orderBy = $filter(sortFunctionName); - }; - - /** - * Usually when the safe copy is updated the pipe function is called. - * Calling this method will prevent it, which is something required when using a custom pipe function - */ - this.preventPipeOnWatch = function preventPipe () { - pipeAfterSafeCopy = false; - }; - }]) - .directive('stTable', function () { - return { - restrict: 'A', - controller: 'stTableController', - link: function (scope, element, attr, ctrl) { - - if (attr.stSetFilter) { - ctrl.setFilterFunction(attr.stSetFilter); - } - - if (attr.stSetSort) { - ctrl.setSortFunction(attr.stSetSort); - } - } - }; - }); - -ng.module('smart-table') - .directive('stSearch', ['stConfig', '$timeout','$parse', function (stConfig, $timeout, $parse) { - return { - require: '^stTable', - link: function (scope, element, attr, ctrl) { - var tableCtrl = ctrl; - var promise = null; - var throttle = attr.stDelay || stConfig.search.delay; - var event = attr.stInputEvent || stConfig.search.inputEvent; - - attr.$observe('stSearch', function (newValue, oldValue) { - var input = element[0].value; - if (newValue !== oldValue && input) { - ctrl.tableState().search = {}; - tableCtrl.search(input, newValue); - } - }); - - //table state -> view - scope.$watch(function () { - return ctrl.tableState().search; - }, function (newValue, oldValue) { - var predicateExpression = attr.stSearch || '$'; - if (newValue.predicateObject && $parse(predicateExpression)(newValue.predicateObject) !== element[0].value) { - element[0].value = $parse(predicateExpression)(newValue.predicateObject) || ''; - } - }, true); - - // view -> table state - element.bind(event, function (evt) { - evt = evt.originalEvent || evt; - if (promise !== null) { - $timeout.cancel(promise); - } - - promise = $timeout(function () { - tableCtrl.search(evt.target.value, attr.stSearch || ''); - promise = null; - }, throttle); - }); - } - }; - }]); - -ng.module('smart-table') - .directive('stSelectRow', ['stConfig', function (stConfig) { - return { - restrict: 'A', - require: '^stTable', - scope: { - row: '=stSelectRow' - }, - link: function (scope, element, attr, ctrl) { - var mode = attr.stSelectMode || stConfig.select.mode; - element.bind('click', function () { - scope.$apply(function () { - ctrl.select(scope.row, mode); - }); - }); - - scope.$watch('row.isSelected', function (newValue) { - if (newValue === true) { - element.addClass(stConfig.select.selectedClass); - } else { - element.removeClass(stConfig.select.selectedClass); - } - }); - } - }; - }]); - -ng.module('smart-table') - .directive('stSort', ['stConfig', '$parse', '$timeout', function (stConfig, $parse, $timeout) { - return { - restrict: 'A', - require: '^stTable', - link: function (scope, element, attr, ctrl) { - - var predicate = attr.stSort; - var getter = $parse(predicate); - var index = 0; - var classAscent = attr.stClassAscent || stConfig.sort.ascentClass; - var classDescent = attr.stClassDescent || stConfig.sort.descentClass; - var stateClasses = [classAscent, classDescent]; - var sortDefault; - var skipNatural = attr.stSkipNatural !== undefined ? attr.stSkipNatural : stConfig.sort.skipNatural; - var descendingFirst = attr.stDescendingFirst === 'true'; - var promise = null; - var throttle = attr.stDelay || stConfig.sort.delay; - - if (attr.stSortDefault) { - sortDefault = scope.$eval(attr.stSortDefault) !== undefined ? scope.$eval(attr.stSortDefault) : attr.stSortDefault; - } - - //view --> table state - function sort () { - if ( descendingFirst ) { - if ( index === 0 ) { - index = 2; - } else if ( index === 2 ) { - index = 1; - } else { - index = 0; - } - } else { - index++; - } - - var func; - predicate = ng.isFunction(getter(scope)) || ng.isArray(getter(scope)) ? getter(scope) : attr.stSort; - if (index % 3 === 0 && !!skipNatural !== true) { - //manual reset - index = 0; - ctrl.tableState().sort = {}; - ctrl.tableState().pagination.start = 0; - func = ctrl.pipe.bind(ctrl); - } else { - func = ctrl.sortBy.bind(ctrl, predicate, index % 2 === 0); - } - if (promise !== null) { - $timeout.cancel(promise); - } - if (throttle < 0) { - func(); - } else { - promise = $timeout(func, throttle); - } - } - - element.bind('click', function sortClick () { - if (predicate) { - scope.$apply(sort); - } - }); - - if (sortDefault) { - index = sortDefault === 'reverse' ? 1 : 0; - sort(); - } - - //table state --> view - scope.$watch(function () { - return ctrl.tableState().sort; - }, function (newValue) { - if (newValue.predicate !== predicate) { - index = 0; - element - .removeClass(classAscent) - .removeClass(classDescent); - } else { - index = newValue.reverse === true ? 2 : 1; - element - .removeClass(stateClasses[index % 2]) - .addClass(stateClasses[index - 1]); - } - }, true); - } - }; - }]); - -ng.module('smart-table') - .directive('stPagination', ['stConfig', function (stConfig) { - return { - restrict: 'EA', - require: '^stTable', - scope: { - stItemsByPage: '=?', - stDisplayedPages: '=?', - stPageChange: '&' - }, - templateUrl: function (element, attrs) { - if (attrs.stTemplate) { - return attrs.stTemplate; - } - return stConfig.pagination.template; - }, - link: function (scope, element, attrs, ctrl) { - - scope.stItemsByPage = scope.stItemsByPage ? +(scope.stItemsByPage) : stConfig.pagination.itemsByPage; - scope.stDisplayedPages = scope.stDisplayedPages ? +(scope.stDisplayedPages) : stConfig.pagination.displayedPages; - - scope.currentPage = 1; - scope.pages = []; - - function redraw () { - var paginationState = ctrl.tableState().pagination; - var start = 1; - var end; - var i; - var prevPage = scope.currentPage; - scope.totalItemCount = paginationState.totalItemCount; - scope.currentPage = Math.floor(paginationState.start / paginationState.number) + 1; - - start = Math.max(start, scope.currentPage - Math.abs(Math.floor(scope.stDisplayedPages / 2))); - end = start + scope.stDisplayedPages; - - if (end > paginationState.numberOfPages) { - end = paginationState.numberOfPages + 1; - start = Math.max(1, end - scope.stDisplayedPages); - } - - scope.pages = []; - scope.numPages = paginationState.numberOfPages; - - for (i = start; i < end; i++) { - scope.pages.push(i); - } - - if (prevPage !== scope.currentPage) { - scope.stPageChange({newPage: scope.currentPage}); - } - } - - //table state --> view - scope.$watch(function () { - return ctrl.tableState().pagination; - }, redraw, true); - - //scope --> table state (--> view) - scope.$watch('stItemsByPage', function (newValue, oldValue) { - if (newValue !== oldValue) { - scope.selectPage(1); - } - }); - - scope.$watch('stDisplayedPages', redraw); - - //view -> table state - scope.selectPage = function (page) { - if (page > 0 && page <= scope.numPages) { - ctrl.slice((page - 1) * scope.stItemsByPage, scope.stItemsByPage); - } - }; - - if (!ctrl.tableState().pagination.number) { - ctrl.slice(0, scope.stItemsByPage); - } - } - }; - }]); - -ng.module('smart-table') - .directive('stPipe', ['stConfig', '$timeout', function (config, $timeout) { - return { - require: 'stTable', - scope: { - stPipe: '=' - }, - link: { - - pre: function (scope, element, attrs, ctrl) { - - var pipePromise = null; - - if (ng.isFunction(scope.stPipe)) { - ctrl.preventPipeOnWatch(); - ctrl.pipe = function () { - - if (pipePromise !== null) { - $timeout.cancel(pipePromise) - } - - pipePromise = $timeout(function () { - scope.stPipe(ctrl.tableState(), ctrl); - }, config.pipe.delay); - - return pipePromise; - } - } - }, - - post: function (scope, element, attrs, ctrl) { - ctrl.pipe(); - } - } - }; - }]); - -})(angular); \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/f629d0f4/griffin-ui/bower_components/angular-smart-table/dist/smart-table.min.js ---------------------------------------------------------------------- diff --git a/griffin-ui/bower_components/angular-smart-table/dist/smart-table.min.js b/griffin-ui/bower_components/angular-smart-table/dist/smart-table.min.js deleted file mode 100644 index f9b0998..0000000 --- a/griffin-ui/bower_components/angular-smart-table/dist/smart-table.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/** -* @version 2.1.6 -* @license MIT -*/ -!function(t,e){"use strict";t.module("smart-table",[]).run(["$templateCache",function(t){t.put("template/smart-table/pagination.html",'<nav ng-if="numPages && pages.length >= 2"><ul class="pagination"><li ng-repeat="page in pages" ng-class="{active: page==currentPage}"><a ng-click="selectPage(page)">{{page}}</a></li></ul></nav>')}]),t.module("smart-table").constant("stConfig",{pagination:{template:"template/smart-table/pagination.html",itemsByPage:10,displayedPages:5},search:{delay:400,inputEvent:"input"},select:{mode:"single",selectedClass:"st-selected"},sort:{ascentClass:"st-sort-ascent",descentClass:"st-sort-descent",skipNatural:!1,delay:300},pipe:{delay:100}}),t.module("smart-table").controller("stTableController",["$scope","$parse","$filter","$attrs",function(a,n,s,i){function r(t){return t?[].concat(t):[]}function l(){b=r(o(a)),S===!0&&v.pipe()}function c(t,e){if(-1!=e.indexOf(".")){var a=e.split("."),s=a.pop(),i=a.join("."),r=n(i)(t);delete r[s],0==Object.keys(r).length&&c(t, i)}else delete t[e]}var o,u,p,g=i.stTable,f=n(g),d=f.assign,m=s("orderBy"),h=s("filter"),b=r(f(a)),P={sort:{},search:{},pagination:{start:0,totalItemCount:0}},S=!0,v=this;i.stSafeSrc&&(o=n(i.stSafeSrc),a.$watch(function(){var t=o(a);return t&&t.length?t[0]:e},function(t,e){t!==e&&l()}),a.$watch(function(){var t=o(a);return t?t.length:0},function(t){t!==b.length&&l()}),a.$watch(function(){return o(a)},function(t,e){t!==e&&(P.pagination.start=0,l())})),this.sortBy=function(e,a){return P.sort.predicate=e,P.sort.reverse=a===!0,t.isFunction(e)?P.sort.functionName=e.name:delete P.sort.functionName,P.pagination.start=0,this.pipe()},this.search=function(e,a){var s=P.search.predicateObject||{},i=a?a:"$";return e=t.isString(e)?e.trim():e,n(i).assign(s,e),e||c(s,i),P.search.predicateObject=s,P.pagination.start=0,this.pipe()},this.pipe=function(){var t,n=P.pagination;u=P.search.predicateObject?h(b,P.search.predicateObject):b,P.sort.predicate&&(u=m(u,P.sort.predicate,P.sort.reverse)),n.totalItem Count=u.length,n.number!==e&&(n.numberOfPages=u.length>0?Math.ceil(u.length/n.number):1,n.start=n.start>=u.length?(n.numberOfPages-1)*n.number:n.start,t=u.slice(n.start,n.start+parseInt(n.number))),d(a,t||u)},this.select=function(t,n){var s=r(f(a)),i=s.indexOf(t);-1!==i&&("single"===n?(t.isSelected=t.isSelected!==!0,p&&(p.isSelected=!1),p=t.isSelected===!0?t:e):s[i].isSelected=!s[i].isSelected)},this.slice=function(t,e){return P.pagination.start=t,P.pagination.number=e,this.pipe()},this.tableState=function(){return P},this.getFilteredCollection=function(){return u||b},this.setFilterFunction=function(t){h=s(t)},this.setSortFunction=function(t){m=s(t)},this.preventPipeOnWatch=function(){S=!1}}]).directive("stTable",function(){return{restrict:"A",controller:"stTableController",link:function(t,e,a,n){a.stSetFilter&&n.setFilterFunction(a.stSetFilter),a.stSetSort&&n.setSortFunction(a.stSetSort)}}}),t.module("smart-table").directive("stSearch",["stConfig","$timeout","$parse",function(t,e,a ){return{require:"^stTable",link:function(n,s,i,r){var l=r,c=null,o=i.stDelay||t.search.delay,u=i.stInputEvent||t.search.inputEvent;i.$observe("stSearch",function(t,e){var a=s[0].value;t!==e&&a&&(r.tableState().search={},l.search(a,t))}),n.$watch(function(){return r.tableState().search},function(t){var e=i.stSearch||"$";t.predicateObject&&a(e)(t.predicateObject)!==s[0].value&&(s[0].value=a(e)(t.predicateObject)||"")},!0),s.bind(u,function(t){t=t.originalEvent||t,null!==c&&e.cancel(c),c=e(function(){l.search(t.target.value,i.stSearch||""),c=null},o)})}}}]),t.module("smart-table").directive("stSelectRow",["stConfig",function(t){return{restrict:"A",require:"^stTable",scope:{row:"=stSelectRow"},link:function(e,a,n,s){var i=n.stSelectMode||t.select.mode;a.bind("click",function(){e.$apply(function(){s.select(e.row,i)})}),e.$watch("row.isSelected",function(e){e===!0?a.addClass(t.select.selectedClass):a.removeClass(t.select.selectedClass)})}}}]),t.module("smart-table").directive("stSort",[" stConfig","$parse","$timeout",function(a,n,s){return{restrict:"A",require:"^stTable",link:function(i,r,l,c){function o(){P?f=0===f?2:2===f?1:0:f++;var e;p=t.isFunction(g(i))||t.isArray(g(i))?g(i):l.stSort,f%3===0&&!!b!=!0?(f=0,c.tableState().sort={},c.tableState().pagination.start=0,e=c.pipe.bind(c)):e=c.sortBy.bind(c,p,f%2===0),null!==S&&s.cancel(S),0>v?e():S=s(e,v)}var u,p=l.stSort,g=n(p),f=0,d=l.stClassAscent||a.sort.ascentClass,m=l.stClassDescent||a.sort.descentClass,h=[d,m],b=l.stSkipNatural!==e?l.stSkipNatural:a.sort.skipNatural,P="true"===l.stDescendingFirst,S=null,v=l.stDelay||a.sort.delay;l.stSortDefault&&(u=i.$eval(l.stSortDefault)!==e?i.$eval(l.stSortDefault):l.stSortDefault),r.bind("click",function(){p&&i.$apply(o)}),u&&(f="reverse"===u?1:0,o()),i.$watch(function(){return c.tableState().sort},function(t){t.predicate!==p?(f=0,r.removeClass(d).removeClass(m)):(f=t.reverse===!0?2:1,r.removeClass(h[f%2]).addClass(h[f-1]))},!0)}}}]),t.module("smart-table").directive("stPagina tion",["stConfig",function(t){return{restrict:"EA",require:"^stTable",scope:{stItemsByPage:"=?",stDisplayedPages:"=?",stPageChange:"&"},templateUrl:function(e,a){return a.stTemplate?a.stTemplate:t.pagination.template},link:function(e,a,n,s){function i(){var t,a,n=s.tableState().pagination,i=1,r=e.currentPage;for(e.totalItemCount=n.totalItemCount,e.currentPage=Math.floor(n.start/n.number)+1,i=Math.max(i,e.currentPage-Math.abs(Math.floor(e.stDisplayedPages/2))),t=i+e.stDisplayedPages,t>n.numberOfPages&&(t=n.numberOfPages+1,i=Math.max(1,t-e.stDisplayedPages)),e.pages=[],e.numPages=n.numberOfPages,a=i;t>a;a++)e.pages.push(a);r!==e.currentPage&&e.stPageChange({newPage:e.currentPage})}e.stItemsByPage=e.stItemsByPage?+e.stItemsByPage:t.pagination.itemsByPage,e.stDisplayedPages=e.stDisplayedPages?+e.stDisplayedPages:t.pagination.displayedPages,e.currentPage=1,e.pages=[],e.$watch(function(){return s.tableState().pagination},i,!0),e.$watch("stItemsByPage",function(t,a){t!==a&&e.selectPage(1)} ),e.$watch("stDisplayedPages",i),e.selectPage=function(t){t>0&&t<=e.numPages&&s.slice((t-1)*e.stItemsByPage,e.stItemsByPage)},s.tableState().pagination.number||s.slice(0,e.stItemsByPage)}}}]),t.module("smart-table").directive("stPipe",["stConfig","$timeout",function(e,a){return{require:"stTable",scope:{stPipe:"="},link:{pre:function(n,s,i,r){var l=null;t.isFunction(n.stPipe)&&(r.preventPipeOnWatch(),r.pipe=function(){return null!==l&&a.cancel(l),l=a(function(){n.stPipe(r.tableState(),r)},e.pipe.delay)})},post:function(t,e,a,n){n.pipe()}}}}])}(angular); -//# sourceMappingURL=smart-table.min.js.map http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/f629d0f4/griffin-ui/bower_components/angular-spinner/angular-spinner.js ---------------------------------------------------------------------- diff --git a/griffin-ui/bower_components/angular-spinner/angular-spinner.js b/griffin-ui/bower_components/angular-spinner/angular-spinner.js deleted file mode 100644 index 6417909..0000000 --- a/griffin-ui/bower_components/angular-spinner/angular-spinner.js +++ /dev/null @@ -1,137 +0,0 @@ -/** - * angular-spinner version 0.8.0 - * License: MIT. - * Copyright (C) 2013, 2014, 2015, Uri Shaked and contributors. - */ - -'format amd'; - -(function (root) { - 'use strict'; - - function factory(angular, Spinner) { - - return angular - .module('angularSpinner', []) - - .constant('SpinJSSpinner', Spinner) - - .provider('usSpinnerConfig', function () { - var _config = {}, _themes = {}; - - return { - setDefaults: function (config) { - _config = config || _config; - }, - setTheme: function(name, config) { - _themes[name] = config; - }, - $get: function () { - return { - config: _config, - themes: _themes - }; - } - }; - }) - - .factory('usSpinnerService', ['$rootScope', function ($rootScope) { - var config = {}; - - config.spin = function (key) { - $rootScope.$broadcast('us-spinner:spin', key); - }; - - config.stop = function (key) { - $rootScope.$broadcast('us-spinner:stop', key); - }; - - return config; - }]) - - .directive('usSpinner', ['SpinJSSpinner', 'usSpinnerConfig', function (SpinJSSpinner, usSpinnerConfig) { - return { - scope: true, - link: function (scope, element, attr) { - scope.spinner = null; - - scope.key = angular.isDefined(attr.spinnerKey) ? attr.spinnerKey : false; - - scope.startActive = angular.isDefined(attr.spinnerStartActive) ? - scope.$eval(attr.spinnerStartActive) : scope.key ? - false : true; - - function stopSpinner() { - if (scope.spinner) { - scope.spinner.stop(); - } - } - - scope.spin = function () { - if (scope.spinner) { - scope.spinner.spin(element[0]); - } - }; - - scope.stop = function () { - scope.startActive = false; - stopSpinner(); - }; - - scope.$watch(attr.usSpinner, function (options) { - stopSpinner(); - - // order of precedence: element options, theme, defaults. - options = angular.extend( - usSpinnerConfig.config, - usSpinnerConfig.themes[attr.spinnerTheme], - options); - - scope.spinner = new SpinJSSpinner(options); - if ((!scope.key || scope.startActive) && !attr.spinnerOn) { - scope.spinner.spin(element[0]); - } - }, true); - - if (attr.spinnerOn) { - scope.$watch(attr.spinnerOn, function (spin) { - if (spin) { - scope.spin(); - } else { - scope.stop(); - } - }); - } - - scope.$on('us-spinner:spin', function (event, key) { - if (key === scope.key) { - scope.spin(); - } - }); - - scope.$on('us-spinner:stop', function (event, key) { - if (key === scope.key) { - scope.stop(); - } - }); - - scope.$on('$destroy', function () { - scope.stop(); - scope.spinner = null; - }); - } - }; - }]); - } - - if ((typeof module === 'object') && module.exports) { - /* CommonJS module */ - module.exports = factory(require('angular'), require('spin.js')); - } else if (typeof define === 'function' && define.amd) { - /* AMD module */ - define(['angular', 'spin'], factory); - } else { - /* Browser global */ - factory(root.angular, root.Spinner); - } -}(this)); http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/f629d0f4/griffin-ui/bower_components/angular-spinner/angular-spinner.min.js ---------------------------------------------------------------------- diff --git a/griffin-ui/bower_components/angular-spinner/angular-spinner.min.js b/griffin-ui/bower_components/angular-spinner/angular-spinner.min.js deleted file mode 100644 index bf60fb2..0000000 --- a/griffin-ui/bower_components/angular-spinner/angular-spinner.min.js +++ /dev/null @@ -1,2 +0,0 @@ -"format amd";!function(a){"use strict";function b(a,b){return a.module("angularSpinner",[]).constant("SpinJSSpinner",b).provider("usSpinnerConfig",function(){var a={},b={};return{setDefaults:function(b){a=b||a},setTheme:function(a,c){b[a]=c},$get:function(){return{config:a,themes:b}}}}).factory("usSpinnerService",["$rootScope",function(a){var b={};return b.spin=function(b){a.$broadcast("us-spinner:spin",b)},b.stop=function(b){a.$broadcast("us-spinner:stop",b)},b}]).directive("usSpinner",["SpinJSSpinner","usSpinnerConfig",function(b,c){return{scope:!0,link:function(d,e,f){function g(){d.spinner&&d.spinner.stop()}d.spinner=null,d.key=a.isDefined(f.spinnerKey)?f.spinnerKey:!1,d.startActive=a.isDefined(f.spinnerStartActive)?d.$eval(f.spinnerStartActive):d.key?!1:!0,d.spin=function(){d.spinner&&d.spinner.spin(e[0])},d.stop=function(){d.startActive=!1,g()},d.$watch(f.usSpinner,function(h){g(),h=a.extend(c.config,c.themes[f.spinnerTheme],h),d.spinner=new b(h),d.key&&!d.startActive||f.spinn erOn||d.spinner.spin(e[0])},!0),f.spinnerOn&&d.$watch(f.spinnerOn,function(a){a?d.spin():d.stop()}),d.$on("us-spinner:spin",function(a,b){b===d.key&&d.spin()}),d.$on("us-spinner:stop",function(a,b){b===d.key&&d.stop()}),d.$on("$destroy",function(){d.stop(),d.spinner=null})}}}])}"object"==typeof module&&module.exports?module.exports=b(require("angular"),require("spin.js")):"function"==typeof define&&define.amd?define(["angular","spin"],b):b(a.angular,a.Spinner)}(this); -//# sourceMappingURL=angular-spinner.min.js.map \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/f629d0f4/griffin-ui/bower_components/angular/angular-csp.css ---------------------------------------------------------------------- diff --git a/griffin-ui/bower_components/angular/angular-csp.css b/griffin-ui/bower_components/angular/angular-csp.css deleted file mode 100644 index f3cd926..0000000 --- a/griffin-ui/bower_components/angular/angular-csp.css +++ /dev/null @@ -1,21 +0,0 @@ -/* Include this file in your html if you are using the CSP mode. */ - -@charset "UTF-8"; - -[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], -.ng-cloak, .x-ng-cloak, -.ng-hide:not(.ng-hide-animate) { - display: none !important; -} - -ng\:form { - display: block; -} - -.ng-animate-shim { - visibility:hidden; -} - -.ng-anchor { - position:absolute; -}
