Conflicts:
	package.json
	release/js/ionic-angular.js
	release/js/ionic-angular.min.js
	release/js/ionic.bundle.js
	release/js/ionic.bundle.min.js
	release/version.json
This commit is contained in:
Adam Bradley
2014-02-28 10:47:57 -06:00
21 changed files with 39631 additions and 43 deletions

View File

@@ -245,8 +245,8 @@ function($scope, $ionicViewService, $rootScope, $element) {
'<a ng-class="{active: isTabActive(), \'has-badge\':badge}" ' +
'ng-click="selectTab($event)" class="tab-item">' +
'<span class="badge {{badgeStyle}}" ng-if="badge">{{badge}}</span>' +
'<i class="icon {{iconOn}}" ng-if="iconOn && isTabActive()"></i>' +
'<i class="icon {{iconOff}}" ng-if="iconOff && !isTabActive()"></i>' +
'<i class="icon {{getIconOn()}}" ng-if="getIconOn() && isTabActive()"></i>' +
'<i class="icon {{getIconOff()}}" ng-if="getIconOff() && !isTabActive()"></i>' +
'<span class="tab-title" ng-bind-html="title"></span>' +
'</a>',
scope: {
@@ -258,14 +258,17 @@ function($scope, $ionicViewService, $rootScope, $element) {
badgeStyle: '@'
},
compile: function(element, attr, transclude) {
if (attr.icon) {
attr.$set('iconOn', attr.icon);
attr.$set('iconOff', attr.icon);
}
return function link($scope, $element, $attrs, ctrls) {
var tabsCtrl = ctrls[0],
tabCtrl = ctrls[1];
$scope.getIconOn = function() {
return $scope.iconOn || $scope.icon;
};
$scope.getIconOff = function() {
return $scope.iconOff || $scope.icon;
};
$scope.isTabActive = function() {
return tabsCtrl.selectedTab === tabCtrl.$scope;
};

View File

@@ -2,6 +2,7 @@
* Create a wrapping module to ease having to include too many
* modules.
*/
angular.module('ionic.service', [
'ionic.service.bind',
'ionic.service.platform',

View File

@@ -0,0 +1,57 @@
describe('Ionic Header Bar', function() {
var el, rootScope, compile;
beforeEach(module('ionic'));
beforeEach(inject(function($compile, $rootScope) {
compile = $compile;
rootScope = $rootScope;
}));
it('Should not add title-left or title-right classes when align-title=center', function() {
runs(function(){
el = compile('<ion-header-bar align-title="center"></ion-header-bar>')(rootScope);
});
//wait for headerBar View to align() the title
waits(500);
runs(function(){
var headerView = el.isolateScope().headerBarView;
var title = angular.element(headerView.el.querySelector('.title'));
expect(title.hasClass('title-left')).not.toEqual(true);
expect(title.hasClass('title-right')).not.toEqual(true);
});
});
it('Should add title-left class when align-title=left', function() {
runs(function(){
el = compile('<ion-header-bar align-title="left"></ion-header-bar>')(rootScope);
});
//wait for headerBar View to align() the title
waits(500);
runs(function(){
var headerView = el.isolateScope().headerBarView;
var title = angular.element(headerView.el.querySelector('.title'));
expect(title.hasClass('title-left')).toEqual(true);
});
});
it('Should add title-right class when align-title=right', function() {
runs(function(){
el = compile('<ion-header-bar align-title="right"></ion-header-bar>')(rootScope);
});
//wait for headerBar View to align() the title
waits(500);
runs(function(){
var headerView = el.isolateScope().headerBarView;
var title = angular.element(headerView.el.querySelector('.title'));
expect(title.hasClass('title-right')).toEqual(true);
});
});
});

View File

@@ -387,10 +387,21 @@ describe('tabs', function() {
expect(tabsCtrl.select).toHaveBeenCalledWith(tabCtrl.$scope, true);
});
it('should set iconOn and iconOff to icon if icon is given', function() {
it('should fallback to icon for icon-on and icon-off', function() {
var el = setup('icon=1');
expect(el.attr('icon-on')).toBe('1');
expect(el.attr('icon-off')).toBe('1');
expect(el.isolateScope().getIconOn()).toBe('1');
el.isolateScope().iconOn = 2;
expect(el.isolateScope().getIconOn()).toBe(2);
el.isolateScope().iconOn = null;
expect(el.isolateScope().getIconOn()).toBe('1');
expect(el.isolateScope().getIconOff()).toBe('1');
el.isolateScope().iconOff = 3;
expect(el.isolateScope().getIconOff()).toBe(3);
el.isolateScope().iconOff = null;
expect(el.isolateScope().getIconOff()).toBe('1');
});
it('should select tab on click', function() {
@@ -408,20 +419,36 @@ describe('tabs', function() {
el.scope().$apply('name = "joe"');
expect(el.find('.tab-title').html()).toBe('<b>hi, joe!</b>');
});
it('should change icon class with just icon', function() {
//In this case, icon-on and icon-off should be same
var el = setup('icon={{icon}}');
el.scope().icon="superIcon";
el.scope().$apply();
el.isolateScope().isTabActive = function() { return true; };
el.isolateScope().$apply();
expect(el.find('.icon.superIcon').length).toBe(1);
el.isolateScope().isTabActive = function() { return false; };
el.isolateScope().$apply();
expect(el.find('.icon.superIcon').length).toBe(1);
});
it('should change classes based on active', function() {
var el = setup('icon-on=on icon-off=off');
var el = setup('icon-on="{{true}}" icon-off="{{false}}"');
el.isolateScope().isTabActive = function() { return true; };
el.isolateScope().$apply();
expect(el.hasClass('active')).toBe(true);
expect(el.find('.icon.on').length).toBe(1);
expect(el.find('.icon.off').length).toBe(0);
expect(el.find('.icon.true').length).toBe(1);
expect(el.find('.icon.false').length).toBe(0);
el.isolateScope().isTabActive = function() { return false; };
el.isolateScope().$apply();
expect(el.hasClass('active')).toBe(false);
expect(el.find('.icon.on').length).toBe(0);
expect(el.find('.icon.off').length).toBe(1);
expect(el.find('.icon.true').length).toBe(0);
expect(el.find('.icon.false').length).toBe(1);
});
it('shouldnt has-badge without badge', function() {
var el = setup();

View File

@@ -1,5 +1,6 @@
// Create namespaces
// Create namespaces
//
window.ionic = {
controllers: {},
views: {},

View File

@@ -29,7 +29,7 @@
var childNodes = this.el.childNodes;
var leftWidth = 0;
var rightWidth = 0;
var isCountingRightWidth = true;
var isCountingRightWidth = false;
// Compute how wide the left children are
// Skip all titles (there may still be two titles, one leaving the dom)
@@ -37,7 +37,7 @@
for(i = 0; i < childNodes.length; i++) {
c = childNodes[i];
if (c.tagName && c.tagName.toLowerCase() == 'h1') {
isCountingRightWidth = false;
isCountingRightWidth = true;
continue;
}
@@ -71,12 +71,12 @@
}
}
} else if(this.alignTitle == 'left') {
titleEl.classList.add('titleEl-left');
titleEl.classList.add('title-left');
if(leftWidth > 0) {
titleEl.style.left = (leftWidth + 15) + 'px';
}
} else if(this.alignTitle == 'right') {
titleEl.classList.add('titleEl-right');
titleEl.classList.add('title-right');
if(rightWidth > 0) {
titleEl.style.right = (rightWidth + 15) + 'px';
}

View File

@@ -1,7 +1,7 @@
{
"name": "ionic",
"private": false,
"version": "0.10.0",
"version": "0.10.0-alpha",
"codename": "salamander",
"repository": {
"url": "git://github.com/driftyco/ionic.git"
@@ -10,17 +10,15 @@
"grunt": "~0.4.1",
"grunt-bump": "0.0.13",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "^0.6.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-uglify": "~0.3.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-conventional-changelog": "~1.1.0",
"grunt-ddescribe-iit": "0.0.4",
"grunt-merge-conflict": "0.0.2",
"grunt-remove-logging": "~0.2.0",
"grunt-sass": "^0.11.0"
"grunt-sass": "^0.11.0",
"grunt-string-replace": "~0.2.7",
"karma": "~0.11.13",
"karma-chrome-launcher": "~0.1.2",
@@ -29,7 +27,11 @@
"karma-sauce-launcher": "~0.2.0",
"karma-script-launcher": "~0.1.0",
"load-grunt-tasks": "~0.3.0",
"grunt-conventional-changelog": "~1.1.0",
"grunt-contrib-connect": "^0.6.0",
"sauce-connect-launcher": "^0.2.2",
"dgeni": "^0.1.1",
"dgeni-packages": "^0.2.4"
},
"licenses": [
{

52
package.json.orig Normal file
View File

@@ -0,0 +1,52 @@
{
"name": "ionic",
"private": false,
<<<<<<< HEAD
"version": "0.10.0",
=======
"version": "0.10.0-alpha",
>>>>>>> FETCH_HEAD
"codename": "salamander",
"repository": {
"url": "git://github.com/driftyco/ionic.git"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-bump": "0.0.13",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "^0.6.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-uglify": "~0.3.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-conventional-changelog": "~1.1.0",
"grunt-ddescribe-iit": "0.0.4",
"grunt-merge-conflict": "0.0.2",
"grunt-remove-logging": "~0.2.0",
<<<<<<< HEAD
"grunt-sass": "^0.11.0"
=======
"grunt-sass": "^0.11.0",
>>>>>>> FETCH_HEAD
"grunt-string-replace": "~0.2.7",
"karma": "~0.11.13",
"karma-chrome-launcher": "~0.1.2",
"karma-jasmine": "~0.1.5",
"karma-phantomjs-launcher": "~0.1.2",
"karma-sauce-launcher": "~0.2.0",
"karma-script-launcher": "~0.1.0",
"load-grunt-tasks": "~0.3.0",
<<<<<<< HEAD
=======
"grunt-conventional-changelog": "~1.1.0",
"grunt-contrib-connect": "^0.6.0",
>>>>>>> FETCH_HEAD
"sauce-connect-launcher": "^0.2.2",
},
"licenses": [
{
"type": "MIT"
}
]
}

View File

@@ -2716,8 +2716,8 @@ function($scope, $ionicViewService, $rootScope, $element) {
'<a ng-class="{active: isTabActive(), \'has-badge\':badge}" ' +
'ng-click="selectTab($event)" class="tab-item">' +
'<span class="badge {{badgeStyle}}" ng-if="badge">{{badge}}</span>' +
'<i class="icon {{iconOn}}" ng-if="iconOn && isTabActive()"></i>' +
'<i class="icon {{iconOff}}" ng-if="iconOff && !isTabActive()"></i>' +
'<i class="icon {{getIconOn()}}" ng-if="getIconOn() && isTabActive()"></i>' +
'<i class="icon {{getIconOff()}}" ng-if="getIconOff() && !isTabActive()"></i>' +
'<span class="tab-title" ng-bind-html="title"></span>' +
'</a>',
scope: {
@@ -2729,14 +2729,17 @@ function($scope, $ionicViewService, $rootScope, $element) {
badgeStyle: '@'
},
compile: function(element, attr, transclude) {
if (attr.icon) {
attr.$set('iconOn', attr.icon);
attr.$set('iconOff', attr.icon);
}
return function link($scope, $element, $attrs, ctrls) {
var tabsCtrl = ctrls[0],
tabCtrl = ctrls[1];
$scope.getIconOn = function() {
return $scope.iconOn || $scope.icon;
};
$scope.getIconOff = function() {
return $scope.iconOff || $scope.icon;
};
$scope.isTabActive = function() {
return tabsCtrl.selectedTab === tabCtrl.$scope;
};

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -19,7 +19,8 @@
*/
;
// Create namespaces
// Create namespaces
//
window.ionic = {
controllers: {},
views: {},
@@ -34380,8 +34381,8 @@ function($scope, $ionicViewService, $rootScope, $element) {
'<a ng-class="{active: isTabActive(), \'has-badge\':badge}" ' +
'ng-click="selectTab($event)" class="tab-item">' +
'<span class="badge {{badgeStyle}}" ng-if="badge">{{badge}}</span>' +
'<i class="icon {{iconOn}}" ng-if="iconOn && isTabActive()"></i>' +
'<i class="icon {{iconOff}}" ng-if="iconOff && !isTabActive()"></i>' +
'<i class="icon {{getIconOn()}}" ng-if="getIconOn() && isTabActive()"></i>' +
'<i class="icon {{getIconOff()}}" ng-if="getIconOff() && !isTabActive()"></i>' +
'<span class="tab-title" ng-bind-html="title"></span>' +
'</a>',
scope: {
@@ -34393,14 +34394,17 @@ function($scope, $ionicViewService, $rootScope, $element) {
badgeStyle: '@'
},
compile: function(element, attr, transclude) {
if (attr.icon) {
attr.$set('iconOn', attr.icon);
attr.$set('iconOff', attr.icon);
}
return function link($scope, $element, $attrs, ctrls) {
var tabsCtrl = ctrls[0],
tabCtrl = ctrls[1];
$scope.getIconOn = function() {
return $scope.iconOn || $scope.icon;
};
$scope.getIconOff = function() {
return $scope.iconOff || $scope.icon;
};
$scope.isTabActive = function() {
return tabsCtrl.selectedTab === tabCtrl.$scope;
};

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,8 @@
*/
;
// Create namespaces
// Create namespaces
//
window.ionic = {
controllers: {},
views: {},

View File

@@ -2,5 +2,5 @@
"version": "0.9.26",
"codename": "rabbit",
"date": "2014-02-26",
"time": "19:38:1"
}
"time": "21:16:43"
}

10
release/version.json.orig Normal file
View File

@@ -0,0 +1,10 @@
{
"version": "0.9.26",
"codename": "rabbit",
"date": "2014-02-26",
<<<<<<< HEAD
"time": "19:38:1"
=======
"time": "21:16:43"
>>>>>>> FETCH_HEAD
}

View File

@@ -52,7 +52,7 @@ function run {
echo "-- Committing and tagging ionic-bower"
git add -A
git commit -m "release: v$VERSION"
git tag v$VERSION
git tag -f v$VERSION
echo "-- Pushing ionic-bower"
cd $BOWER_DIR

View File

@@ -31,7 +31,7 @@ function prepare {
git add package.json bower.json component.json release CHANGELOG.md
git commit -m "chore(release): v$VERSION \"$CODENAME\""
git tag -m "v$VERSION" v$VERSION
git tag -f -m "v$VERSION" v$VERSION
echo "--"
echo "-- Version is now $VERSION, codename $CODENAME."