Skip to content

Commit

Permalink
style(all): enforce no trailing white space
Browse files Browse the repository at this point in the history
  • Loading branch information
bekos committed Jan 20, 2014
1 parent bb85213 commit 23b7baa
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 78 deletions.
1 change: 1 addition & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"boss": true,
"eqnull": true,
"quotmark": "single",
"trailing": true,
"globals": {
"angular": true
}
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function(grunt) {
modules: 'angular.module("ui.bootstrap", [<%= srcModules %>]);',
tplmodules: 'angular.module("ui.bootstrap.tpls", [<%= tplModules %>]);',
all: 'angular.module("ui.bootstrap", ["ui.bootstrap.tpls", <%= srcModules %>]);',
banner: ['/*',
banner: ['/*',
' * <%= pkg.name %>',
' * <%= pkg.homepage %>\n',
' * Version: <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>',
Expand Down
4 changes: 2 additions & 2 deletions src/accordion/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
});
}
};

// This is called from the accordion-group directive to add itself to the accordion
this.addGroup = function(groupScope) {
var that = this;
Expand Down Expand Up @@ -61,7 +61,7 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
transclude:true, // It transcludes the contents of the directive into the template
replace: true, // The element containing the directive will be replaced with the template
templateUrl:'template/accordion/accordion-group.html',
scope: {
scope: {
heading: '@', // Interpolate the heading attribute onto this scope
isOpen: '=?',
isDisabled: '=?'
Expand Down
2 changes: 1 addition & 1 deletion src/accordion/docs/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function AccordionDemoCtrl($scope) {
var newItemNo = $scope.items.length + 1;
$scope.items.push('Item ' + newItemNo);
};

$scope.status = {
isFirstOpen: true,
isFirstDisabled: false
Expand Down
12 changes: 6 additions & 6 deletions src/accordion/test/accordion.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ describe('accordion', function () {
expect(scope.groups[0].open).toBe(false);
});
});

describe('`is-disabled` attribute', function() {
var groupBody;
beforeEach(function () {
Expand All @@ -324,18 +324,18 @@ describe('accordion', function () {
it('should open the panel with isOpen set to true', function () {
expect(groupBody.scope().isOpen).toBeFalsy();
});

it('should not toggle if disabled', function() {
findGroupLink(0).click();
scope.$digest();
expect(groupBody.scope().isOpen).toBeFalsy();
});

it('should toggle after enabling', function() {
scope.disabled = false;
scope.$digest();
expect(groupBody.scope().isOpen).toBeFalsy();

findGroupLink(0).click();
scope.$digest();
expect(groupBody.scope().isOpen).toBeTruthy();
Expand All @@ -344,7 +344,7 @@ describe('accordion', function () {

describe('accordion-heading element', function() {
beforeEach(function() {
var tpl =
var tpl =
'<accordion ng-init="a = [1,2,3]">' +
'<accordion-group heading="I get overridden">' +
'<accordion-heading>Heading Element <span ng-repeat="x in a">{{x}}</span> </accordion-heading>' +
Expand All @@ -366,7 +366,7 @@ describe('accordion', function () {

describe('accordion-heading attribute', function() {
beforeEach(function() {
var tpl =
var tpl =
'<accordion ng-init="a = [1,2,3]">' +
'<accordion-group heading="I get overridden">' +
'<div accordion-heading>Heading Element <span ng-repeat="x in a">{{x}}</span> </div>' +
Expand Down
4 changes: 2 additions & 2 deletions src/alert/test/alert.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ describe('alert', function () {
var element;

beforeEach(module('ui.bootstrap.alert'));
beforeEach(module('template/alert/alert.html'));
beforeEach(module('template/alert/alert.html'));

beforeEach(inject(function ($rootScope, _$compile_, $controller) {

scope = $rootScope;
$compile = _$compile_;

element = angular.element(
'<div>' +
'<div>' +
'<alert ng-repeat="alert in alerts" type="alert.type"' +
'close="removeAlert($index)">{{alert.msg}}' +
'</alert>' +
Expand Down
2 changes: 1 addition & 1 deletion src/buttons/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ angular.module('ui.bootstrap.buttons', [])
function getFalseValue() {
return getCheckboxValue(attrs.btnCheckboxFalse, false);
}

function getCheckboxValue(attributeValue, defaultValue) {
var val = scope.$eval(attributeValue);
return angular.isDefined(val) ? val : defaultValue;
Expand Down
32 changes: 16 additions & 16 deletions src/carousel/test/carousel.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('carousel', function() {
beforeEach(module('ui.bootstrap.carousel'));
beforeEach(module('template/carousel/carousel.html', 'template/carousel/slide.html'));

var $rootScope, $compile, $controller, $timeout;
beforeEach(inject(function(_$rootScope_, _$compile_, _$controller_, _$timeout_) {
$rootScope = _$rootScope_;
Expand All @@ -24,7 +24,7 @@ describe('carousel', function() {
'<slide ng-repeat="slide in slides" active="slide.active">' +
'{{slide.content}}' +
'</slide>' +
'</carousel>'
'</carousel>'
)(scope);
scope.interval = 5000;
scope.nopause = undefined;
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('carousel', function() {
var indicators = elm.find('ol.carousel-indicators > li');
expect(indicators.length).toBe(3);
});

it('should hide navigation when only one slide', function () {
scope.slides=[{active:false,content:'one'}];
scope.$apply();
Expand All @@ -69,25 +69,25 @@ describe('carousel', function() {
'<slide ng-repeat="slide in slides" active="slide.active">' +
'{{slide.content}}' +
'</slide>' +
'</carousel>'
'</carousel>'
)(scope);
var indicators = elm.find('ol.carousel-indicators > li');
expect(indicators.length).toBe(0);

var navNext = elm.find('a.right');
expect(navNext.length).toBe(0);

var navPrev = elm.find('a.left');
expect(navPrev.length).toBe(0);
});
it('should show navigation when there are 3 slides', function () {

it('should show navigation when there are 3 slides', function () {
var indicators = elm.find('ol.carousel-indicators > li');
expect(indicators.length).not.toBe(0);

var navNext = elm.find('a.right');
expect(navNext.length).not.toBe(0);

var navPrev = elm.find('a.left');
expect(navPrev.length).not.toBe(0);
});
Expand Down Expand Up @@ -175,7 +175,7 @@ describe('carousel', function() {
$timeout.flush();
testSlideActive(2);
});

it('should not pause on mouseover if noPause', function() {
scope.$apply('nopause = true');
testSlideActive(0);
Expand All @@ -185,7 +185,7 @@ describe('carousel', function() {
elm.trigger('mouseleave');
$timeout.flush();
testSlideActive(2);
});
});

it('should remove slide from dom and change active slide', function() {
scope.$apply('slides[2].active = true');
Expand Down Expand Up @@ -255,15 +255,15 @@ describe('carousel', function() {
describe('addSlide', function() {
it('should set first slide to active = true and the rest to false', function() {
angular.forEach(ctrl.slides, function(slide, i) {
if (i !== 0) {
expect(slide.active).not.toBe(true);
if (i !== 0) {
expect(slide.active).not.toBe(true);
} else {
expect(slide.active).toBe(true);
}
});
});

it('should add new slide and change active to true if active is true on the added slide', function() {
it('should add new slide and change active to true if active is true on the added slide', function() {
var newSlide = {active: true};
expect(ctrl.slides.length).toBe(4);
ctrl.addSlide(newSlide);
Expand All @@ -272,7 +272,7 @@ describe('carousel', function() {
expect(ctrl.slides[0].active).toBe(false);
});

it('should add a new slide and not change the active slide', function() {
it('should add a new slide and not change the active slide', function() {
var newSlide = {active: false};
expect(ctrl.slides.length).toBe(4);
ctrl.addSlide(newSlide);
Expand Down
6 changes: 3 additions & 3 deletions src/datepicker/test/datepicker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1346,13 +1346,13 @@ describe('datepicker directive', function () {
expect($body.children().length).toEqual(bodyLength);
});
});

describe('with setting datepickerConfig.showWeeks to false', function() {
var originalConfig = {};
beforeEach(inject(function(datepickerConfig) {
angular.extend(originalConfig, datepickerConfig);
datepickerConfig.showWeeks = false;

var wrapElement = $compile('<div><input ng-model="date" datepicker-popup><div>')($rootScope);
$rootScope.$digest();
assignElements(wrapElement);
Expand All @@ -1361,7 +1361,7 @@ describe('datepicker directive', function () {
// return it to the original state
angular.extend(datepickerConfig, originalConfig);
}));

it('changes initial visibility for weeks', function() {
expect(getLabelsRow().find('th').eq(0)).toBeHidden();
var tr = element.find('tbody').find('tr');
Expand Down
4 changes: 2 additions & 2 deletions src/dropdownToggle/test/dropdownToggle.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('dropdownToggle', function() {
function dropdown() {
return $compile('<li class="dropdown"><a dropdown-toggle></a><ul dropdown-toggle><li>Hello</li></ul></li>')($rootScope);
}

it('should toggle on `a` click', function() {
var elm = dropdown();
expect(elm.hasClass('open')).toBe(false);
Expand Down Expand Up @@ -65,4 +65,4 @@ describe('dropdownToggle', function() {
expect(elm2.hasClass('open')).toBe(true);
});
});

2 changes: 1 addition & 1 deletion src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
backdropDomEl = $compile('<div modal-backdrop></div>')(backdropScope);
body.append(backdropDomEl);
}

var angularDomEl = angular.element('<div modal-window></div>');
angularDomEl.attr('window-class', modal.windowClass);
angularDomEl.attr('index', openedWindows.length() - 1);
Expand Down
2 changes: 1 addition & 1 deletion src/pagination/test/pagination.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ describe('pagination directive', function () {
updateCurrentPage('04');
expect(getPaginationEl(4)).toHaveClass('active');
});

it('defaults to 1 if non-numeric', function() {
updateCurrentPage('pizza');
expect(getPaginationEl(1)).toHaveClass('active');
Expand Down
2 changes: 1 addition & 1 deletion src/popover/test/popover.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ describe('popover', function() {
}));
});


6 changes: 3 additions & 3 deletions src/progressbar/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var ProgressDemoCtrl = function ($scope) {

$scope.max = 200;

$scope.random = function() {
Expand All @@ -22,11 +22,11 @@ var ProgressDemoCtrl = function ($scope) {
$scope.type = type;
};
$scope.random();

$scope.randomStacked = function() {
$scope.stacked = [];
var types = ['success', 'info', 'warning', 'danger'];

for (var i = 0, n = Math.floor((Math.random() * 4) + 1); i < n; i++) {
var index = Math.floor((Math.random() * 4));
$scope.stacked.push({
Expand Down
2 changes: 1 addition & 1 deletion src/progressbar/test/progressbar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('progressbar directive', function () {
$rootScope.value += 1;
$rootScope.$digest();

var barEl = getBar(0);
var barEl = getBar(0);
expect(barEl).toHaveClass(BAR_CLASS);
expect(barEl).not.toHaveClass(BAR_CLASS + '-success');
expect(barEl).toHaveClass(BAR_CLASS + '-warning');
Expand Down
6 changes: 3 additions & 3 deletions src/rating/rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ angular.module('ui.bootstrap.rating', [])
this.maxRange = angular.isDefined($attrs.max) ? $scope.$parent.$eval($attrs.max) : ratingConfig.max;
this.stateOn = angular.isDefined($attrs.stateOn) ? $scope.$parent.$eval($attrs.stateOn) : ratingConfig.stateOn;
this.stateOff = angular.isDefined($attrs.stateOff) ? $scope.$parent.$eval($attrs.stateOff) : ratingConfig.stateOff;

this.init = function(ngModelCtrl_) {
ngModelCtrl = ngModelCtrl_;
ngModelCtrl.$render = this.render;

$scope.range = this.buildTemplateObjects(
angular.isDefined($attrs.ratingStates) ? $scope.$parent.$eval($attrs.ratingStates) : new Array(this.maxRange)
);
Expand Down Expand Up @@ -52,7 +52,7 @@ angular.module('ui.bootstrap.rating', [])
$scope.val = ngModelCtrl.$viewValue;
$scope.onLeave();
};

this.render = function() {
$scope.val = ngModelCtrl.$viewValue;
};
Expand Down
4 changes: 2 additions & 2 deletions src/tabs/test/tabs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ describe('tabs', function() {

describe('tabset controller', function() {
function mockTab(isActive) {
return {
active: !!isActive,
return {
active: !!isActive,
onSelect : angular.noop,
onDeselect : angular.noop
};
Expand Down
6 changes: 3 additions & 3 deletions src/timepicker/test/timepicker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('timepicker directive', function () {
e.wheelDelta = delta;
return e;
}

function wheelThatOtherMouse(delta) {
var e = $.Event('wheel');
e.deltaY = delta;
Expand Down Expand Up @@ -136,7 +136,7 @@ describe('timepicker directive', function () {
expect(getTimeState()).toEqual(['02', '39', 'PM']);
expect(getModelState()).toEqual([14, 39]);
});

it('meridian button has correct type', function() {
var button = getMeridianButton();
expect(button.attr('type')).toBe('button');
Expand Down Expand Up @@ -485,7 +485,7 @@ describe('timepicker directive', function () {
expect(getTimeState()).toEqual(['02', '00', 'PM']);
expect(getModelState()).toEqual([14, 0]);
});

it('responds properly on "wheel" events with configurable steps', function() {
var inputs = element.find('input');
var hoursEl = inputs.eq(0), minutesEl = inputs.eq(1);
Expand Down
Loading

0 comments on commit 23b7baa

Please sign in to comment.