Merge branch '2.0' into pr/6370

This commit is contained in:
Brandy Carney
2016-05-20 17:46:18 -04:00
664 changed files with 6030 additions and 1888 deletions

View File

@ -3,11 +3,11 @@
# See config at https://github.com/brigade/scss-lint/blob/master/config/default.yml
exclude:
- 'ionic/components/slides/**'
- 'ionic/components/show-hide-when/**'
- 'ionic/components.*.scss'
- 'ionic/util/*.scss'
- 'ionic/platform/cordova.*.scss'
- 'src/components/slides/**'
- 'src/components/show-hide-when/**'
- 'src/components.*.scss'
- 'src/util/*.scss'
- 'src/platform/cordova.*.scss'
linters:

View File

@ -1,3 +1,229 @@
<a name="2.0.0-beta.7"></a>
# [2.0.0-beta.7](https://github.com/driftyco/ionic/compare/v2.0.0-beta.6...v2.0.0-beta.7) (2016-05-19)
### Features
* **datetime:** add ion-datetime ([1e331c9](https://github.com/driftyco/ionic/commit/1e331c9))
* **input:** added functionality for clear input option on ion-input ([d8e2849](https://github.com/driftyco/ionic/commit/d8e2849))
* **modal:** add inset modal feature ([a658524](https://github.com/driftyco/ionic/commit/a658524)), closes [#5423](https://github.com/driftyco/ionic/issues/5423)
* **modal:** start of inset modals ([a1a594d](https://github.com/driftyco/ionic/commit/a1a594d))
* **picker:** add ios/md/wp picker styles ([aa9a667](https://github.com/driftyco/ionic/commit/aa9a667))
* **picker:** init picker ([d5068f8](https://github.com/driftyco/ionic/commit/d5068f8))
* **platform:** add a readySource as ready resolved value ([f68ac8a](https://github.com/driftyco/ionic/commit/f68ac8a))
* **platform:** cordova pause/resume events ([532096b](https://github.com/driftyco/ionic/commit/532096b))
### Bug Fixes
* **app:** add status bar padding to navbar when a tab subpage ([62b97ce](https://github.com/driftyco/ionic/commit/62b97ce)), closes [#6368](https://github.com/driftyco/ionic/issues/6368)
* **app:** fix status bar padding for inset modals ([4d27680](https://github.com/driftyco/ionic/commit/4d27680))
* **build:** fix e2e, demos, and karma tests to use new angular module setup. ([4c19d15](https://github.com/driftyco/ionic/commit/4c19d15))
* **button:** add the solid class to bar buttons ([658b29b](https://github.com/driftyco/ionic/commit/658b29b))
* **button:** add transparent background for clear/outline windows buttons ([da5c065](https://github.com/driftyco/ionic/commit/da5c065))
* **button:** exclude solid from getting added to the button in the class ([4252448](https://github.com/driftyco/ionic/commit/4252448))
* **button:** remove unnecessary ion-button-effect elements ([369d78b](https://github.com/driftyco/ionic/commit/369d78b))
* **checkbox:** add ability to align checkboxes to the right ([e075ccd](https://github.com/driftyco/ionic/commit/e075ccd)), closes [#5925](https://github.com/driftyco/ionic/issues/5925)
* **datetime:** fix property dayNames (it was using dayShort) ([0bd736d](https://github.com/driftyco/ionic/commit/0bd736d))
* **datetime:** improve parseTemplate ([55ec80a](https://github.com/driftyco/ionic/commit/55ec80a))
* **grid:** add ion-grid element which wraps the rows/cols and adds padding ([a0c0228](https://github.com/driftyco/ionic/commit/a0c0228))
* **input:** clear text input ([bde103d](https://github.com/driftyco/ionic/commit/bde103d))
* **input:** remove old clearInput code and clean up UI, added onChange calls ([71cd297](https://github.com/driftyco/ionic/commit/71cd297))
* **loading:** include cssClass in the Loading options ([4c8ee95](https://github.com/driftyco/ionic/commit/4c8ee95)), closes [#6365](https://github.com/driftyco/ionic/issues/6365)
* **nav:** transition toolbars on iOS ([daa4ccc](https://github.com/driftyco/ionic/commit/daa4ccc)), closes [#5692](https://github.com/driftyco/ionic/issues/5692)
* **picker:** number of dom children != number of options (#6551) ([28cf16a](https://github.com/driftyco/ionic/commit/28cf16a))
* **radio:** add styling for radio when item-left/item-right is added ([4c5dd0b](https://github.com/driftyco/ionic/commit/4c5dd0b))
* **raf:** test for undefined raf ([1c16008](https://github.com/driftyco/ionic/commit/1c16008))
* **segment:** add disabled property to segment and segment button ([4fca31e](https://github.com/driftyco/ionic/commit/4fca31e))
* **select:** add min height to select text for windows since it shows border ([e9c1442](https://github.com/driftyco/ionic/commit/e9c1442))
* **show-hide-when:** add !important to display as this should always take precedence ([617b7ac](https://github.com/driftyco/ionic/commit/617b7ac)), closes [#6270](https://github.com/driftyco/ionic/issues/6270)
* **slides:** make slide method parameters optional ([f355087](https://github.com/driftyco/ionic/commit/f355087))
* **slides:** set class using renderer instead of host ([132d8e9](https://github.com/driftyco/ionic/commit/132d8e9)), closes [#6275](https://github.com/driftyco/ionic/issues/6275)
* **tabs:** move border to top for windows positioned bottom tabs ([af2085e](https://github.com/driftyco/ionic/commit/af2085e)), closes [#6526](https://github.com/driftyco/ionic/issues/6526)
* **tabs:** remove min-width from tab so 5 tabs will fit ([b4647cd](https://github.com/driftyco/ionic/commit/b4647cd)), closes [#6056](https://github.com/driftyco/ionic/issues/6056)
* **toast:** add toast back to the components export ([d7d4742](https://github.com/driftyco/ionic/commit/d7d4742))
* **toggle:** add styling for toggle when placed left ([ab82d53](https://github.com/driftyco/ionic/commit/ab82d53))
* **toolbar:** add the mode to the inverse function for a toolbar ([3ca3027](https://github.com/driftyco/ionic/commit/3ca3027)), closes [#6364](https://github.com/driftyco/ionic/issues/6364)
* **toolbar:** md mode use the color contrast for toolbar button/title ([9f54f16](https://github.com/driftyco/ionic/commit/9f54f16))
* **toolbar:** remove color change from outline buttons in toolbar ([6759074](https://github.com/driftyco/ionic/commit/6759074))
* **toolbar:** set the text color of the toolbar based on the contrast of the background ([74afc18](https://github.com/driftyco/ionic/commit/74afc18))
* **toolbar:** wp get title/button color from the contrast of toolbar background ([62bd13b](https://github.com/driftyco/ionic/commit/62bd13b))
* **virtual-scroll:** fixes from rc1 breaking changes ([158f717](https://github.com/driftyco/ionic/commit/158f717))
### BREAKING CHANGES
#### Angular Update to 2.0.0-rc.1
Angular has been updated to 2.0.0-rc.1, follow these steps to update Angular.
1. Edit your `package.json` and **remove** the `angular2` entry:
```
"angular2": "2.0.0-beta.15"
```
2. Then, run the following command from a terminal to update Ionic and Angular, or take a look at the starter's [package.json](https://github.com/driftyco/ionic2-app-base/commit/4861c099e2cc509eeb0eff4548554b34116c22a5) changes and update each version:
```
npm install --save ionic-angular@2.0.0-beta.7 @angular/core @angular/compiler @angular/common @angular/platform-browser @angular/platform-browser-dynamic @angular/router @angular/http rxjs@5.0.0-beta.6 zone.js@0.6.12 reflect-metadata
```
3. Run the following command from a terminal to update the gulp task for `ionic-gulp-scripts-copy`:
```
npm install --save-dev ionic-gulp-scripts-copy@2.0.0
```
4. Then, change any imports in your application from `angular2` to `@angular`. For example, the following:
```javascript
import {ViewChild} from 'angular2/core';
import {Http} from 'angular2/http';
```
becomes
```javascript
import {ViewChild} from '@angular/core';
import {Http} from '@angular/http';
```
5. Remove the import for `angular2-polyfills` in `index.html`:
```html
<script src="build/js/angular2-polyfills.js"></script>
```
and replace it with the following scripts:
```html
<script src="build/js/zone.js"></script>
<script src="build/js/Reflect.js"></script>
```
6. Replace all template variables in `ngFor` with `let`. For example:
```
*ngFor="#session of group.sessions"
```
becomes
```
*ngFor="let session of group.sessions"
```
7. Replace all template variables in `virtualScroll`. For example:
```
*virtualItem="#item"
```
becomes
```
*virtualItem="let item"
```
8. View the [Angular Changelog](https://github.com/angular/angular/blob/master/CHANGELOG.md) for more in depth changes.
#### IonicApp ([df32836](https://github.com/driftyco/ionic/commit/df32836)) references [#6199](https://github.com/driftyco/ionic/issues/6199)
The `getComponent` method of `IonicApp` has been removed. Please use Angular's [ViewChild](https://angular.io/docs/ts/latest/api/core/ViewChild-var.html) instead.
An example (in TypeScript) of getting the `Nav` ViewChild:
```html
<ion-nav [root]="rootPage" #content></ion-nav>
```
```javascript
import {ViewChild} from '@angular/core';
import {Nav} from 'ionic-angular';
@App({
templateUrl: 'build/app.html'
})
class myApp {
@ViewChild(Nav) nav: Nav;
...
}
```
and the same example (in JavaScript):
```javascript
import {ViewChild} from '@angular/core';
@App({
templateUrl: 'build/app.html',
queries: {
nav: new ViewChild('content')
}
})
class myApp {
}
```
Please see the [Ionic Conference App](https://github.com/driftyco/ionic-conference-app) for more usage examples.
#### Router
The Angular router is currently under heavy development and refactoring. As a result of this, Angulars router is currently disabled within Ionic. If your app requires use of the router we recommend waiting until a future release of Ionic when Angular has completed work on the new router. However, this does not affect Ionics navigation system and it continues to work with the same API from previous versions.
#### Sass Changes
##### Toolbar [#6364](https://github.com/driftyco/ionic/issues/6364)
**iOS Mode**
- `$toolbar-ios-button-color` now has a
default value of `color-contrast($colors-ios, $toolbar-ios-background,
ios)` which will evaluate to the primary color for light background
toolbars and white for dark background toolbars.
- `$bar-button-ios-color` has been renamed to `$toolbar-ios-button-color`
- `$bar-button-ios-border-radius` has been renamed to
`$toolbar-ios-button-border-radius`
- added variables for the toolbar ios title for easier styling:
```
$toolbar-ios-title-font-weight
$toolbar-ios-title-text-align
$toolbar-ios-title-text-color
```
**Windows Mode**
- `$bar-button-wp-color` was renamed to `$toolbar-wp-button-color`
- `$bar-button-wp-border-radius` was renamed to
`$toolbar-wp-button-border-radius`
- Added `$toolbar-wp-title-text-color` for better control of the title
color
- Removed `$toolbar-wp-button-color` from the default themes
**Material Design Mode**
- `$toolbar-md-button-color` no longer gets passed to the function that
sets the contrast color for toolbar buttons, but it can still be used
to set the default button color.
- `$bar-button-md-color` was renamed to `$toolbar-md-button-color`
- `$bar-button-md-border-radius` was renamed to
`$toolbar-md-button-border-radius`
##### Toggle, Checkbox, Radio ([4c5dd0b](https://github.com/driftyco/ionic/commit/4c5dd0b)), ([e075ccd](https://github.com/driftyco/ionic/commit/e075ccd)), ([ab82d53](https://github.com/driftyco/ionic/commit/ab82d53)) references [#5925](https://github.com/driftyco/ionic/issues/5925)
Renamed Sass variables in toggle, checkbox, and
radio. Changed the word `media` in `component-mode-media-padding` (for example)
to `item-left`.
<a name="2.0.0-beta.6"></a>
# [2.0.0-beta.6](https://github.com/driftyco/ionic/compare/v2.0.0-beta.5...v2.0.0-beta.6) (2016-04-21)

View File

@ -50,7 +50,7 @@ Looking for an issue to fix? Make sure to look through our issues with the [help
- Install the linter: `gem install scss_lint`
- Make sure to run the linter at the root of the repository.
- To check all component Sass files: `scss-lint ionic/**/**/*.scss`
- To check a specific Sass file: `scss-lint ionic/components/toolbar/toolbar.ios.scss`
- To check a specific Sass file: `scss-lint src/components/toolbar/toolbar.ios.scss`
#### Viewing Changes
@ -87,7 +87,7 @@ Looking for an issue to fix? Make sure to look through our issues with the [help
#### Adding Demos
1. Create or modify the demo in the `demos/` folder.
2. If it is new, link to the demo in the component's TypeScript (`*.ts`) file (under `ionic/components`) by adding a link to it in the documentation using `@demo`, for example:
2. If it is new, link to the demo in the component's TypeScript (`*.ts`) file (under `src/components`) by adding a link to it in the documentation using `@demo`, for example:
```
/**

View File

@ -6,7 +6,7 @@ Ionic 2 is the next generation of [Ionic](http://ionicframework.com/), the open-
Ionic 2 is based on the new [2.x version of AngularJS](https://angular.io/), and comes with many significant performance, usability, and feature improvements.
See [Adam Bradley](http://twitter.com/adamdbradley)'s [Building apps with Ionic 2](http://adamdbradley.github.io/building-with-ionic2) slides for a quick overview of Ionic 2.
See the [Building apps with Ionic 2](http://adamdbradley.github.io/building-with-ionic2) slides for a quick overview of Ionic 2.
### Try Ionic 2

View File

@ -3,6 +3,8 @@ general:
ignore:
- ins_n_outs
dependencies:
pre:
- ./scripts/docs/prepare.sh
cache_directories:
- "~/ionic-site" # cache ionic-site
machine:
@ -12,7 +14,7 @@ test:
override:
- echo "Automatically marking tests as passing for now"
deployment:
tasks:
branch: "2.0"
commands:
- ./scripts/ci/deploy.sh
tasks:
branch: "2.0"
commands:
- ./scripts/ci/deploy.sh

View File

@ -1 +1 @@
@import "../ionic/ionic.ios";
@import "../src/ionic.ios";

View File

@ -1 +1 @@
@import "../ionic/ionic.md";
@import "../src/ionic.md";

View File

@ -1 +1 @@
@import "../ionic/ionic.wp";
@import "../src/ionic.wp";

View File

@ -43,9 +43,9 @@
<!-- this has to be formatted weird for pre -->
<pre margin>@App({
config: {
backButtonIcon: {{initialConfig.backButtonIcon}}
iconMode: {{initialConfig.iconMode}}
tabbarPlacement: {{initialConfig.tabbarPlacement}}
backButtonIcon: "{{initialConfig.backButtonIcon}}"
iconMode: "{{initialConfig.iconMode}}"
tabbarPlacement: "{{initialConfig.tabbarPlacement}}"
}
})</pre>

71
demos/datetime/index.ts Normal file
View File

@ -0,0 +1,71 @@
import {App, Page} from 'ionic-angular';
@Page({
templateUrl: 'main.html'
})
class MainPage {
wwwReleased = '1991';
netscapeReleased = '1994-12-15T13:47:20.789';
operaReleased = '1995-04-15';
webkitReleased = '1998-11-04T11:06Z';
firefoxReleased = '2002-09-23T15:03:46.789';
chromeReleased = '2008-09-02';
tokyoTime: string;
parisTime: string;
madisonTime: string;
alertTime = '10:15';
operaShortDay = [
's\u00f8n',
'man',
'tir',
'ons',
'tor',
'fre',
'l\u00f8r'
];
constructor() {
this.tokyoTime = this.calculateTime('+9');
this.parisTime = this.calculateTime('+1');
this.madisonTime = this.calculateTime('-6');
// If it is Daylight Savings Time
if (this.dst(new Date())) {
this.parisTime = this.calculateTime('+2');
this.madisonTime = this.calculateTime('-5');
}
}
calculateTime(offset) {
// create Date object for current location
let d = new Date();
// create new Date object for different city
// using supplied offset
let nd = new Date(d.getTime() + (3600000 * offset));
return nd.toISOString();
}
// Determine if the client uses DST
stdTimezoneOffset(today) {
let jan = new Date(today.getFullYear(), 0, 1);
let jul = new Date(today.getFullYear(), 6, 1);
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}
dst(today) {
return today.getTimezoneOffset() < this.stdTimezoneOffset(today);
}
}
@App({
template: '<ion-nav [root]="root"></ion-nav>'
})
class ApiDemoApp {
root = MainPage;
}

69
demos/datetime/main.html Normal file
View File

@ -0,0 +1,69 @@
<ion-navbar *navbar>
<ion-title>DateTime</ion-title>
</ion-navbar>
<ion-content class="outer-content">
<ion-list>
<ion-list-header>Web Release Dates</ion-list-header>
<ion-item>
<ion-label>World Wide Web</ion-label>
<ion-datetime displayFormat="YYYY" min="1981" max="2002" [(ngModel)]="wwwReleased"></ion-datetime>
</ion-item>
<ion-item>
<ion-label>Netscape</ion-label>
<ion-datetime displayFormat="MMMM YY" min="1989" max="2004" [(ngModel)]="netscapeReleased"></ion-datetime>
</ion-item>
<ion-item>
<ion-label>Opera</ion-label>
<ion-datetime displayFormat="DDD DD.MM.YY" min="1990" max="2000" [dayShortNames]="operaShortDay" [(ngModel)]="operaReleased"></ion-datetime>
</ion-item>
<ion-item>
<ion-label>Webkit</ion-label>
<ion-datetime displayFormat="D MMM YYYY" min="1990-02" max="2010-10" [(ngModel)]="webkitReleased"></ion-datetime>
</ion-item>
<ion-item>
<ion-label>Firefox</ion-label>
<ion-datetime displayFormat="MMM DD, YYYY" min="1994-03-14" max="2012-12-09" [(ngModel)]="firefoxReleased"></ion-datetime>
</ion-item>
<ion-item>
<ion-label>Chrome</ion-label>
<ion-datetime displayFormat="DDDD MMM D" min="2005" max="2016" [(ngModel)]="chromeReleased"></ion-datetime>
</ion-item>
</ion-list>
<ion-list>
<ion-list-header>World Times</ion-list-header>
<ion-item>
<ion-label>Tokyo</ion-label>
<ion-datetime displayFormat="hh:mm A" [(ngModel)]="tokyoTime"></ion-datetime>
</ion-item>
<ion-item>
<ion-label>Paris</ion-label>
<ion-datetime displayFormat="HH:mm" [(ngModel)]="parisTime"></ion-datetime>
</ion-item>
<ion-item>
<ion-label>Madison</ion-label>
<ion-datetime displayFormat="h:mm a" [(ngModel)]="madisonTime"></ion-datetime>
</ion-item>
</ion-list>
<ion-list>
<ion-list-header>Set Alarm</ion-list-header>
<ion-item>
<ion-label>Alert</ion-label>
<ion-datetime displayFormat="mm" minuteValues="0,15,30,45" [(ngModel)]="alertTime"></ion-datetime>
</ion-item>
</ion-list>
</ion-content>

View File

@ -10,7 +10,7 @@
<ion-item *ngIf="loggedIn">
Welcome, Administrator!
</ion-item>
<button ion-item menuClose *ngFor="#p of pages" (click)="openPage(menu, p)" [hidden]="(loggedIn == true && p.showLoggedIn == false) || (loggedIn == false && p.showLoggedIn == true)">
<button ion-item menuClose *ngFor="let p of pages" (click)="openPage(menu, p)" [hidden]="(loggedIn == true && p.showLoggedIn == false) || (loggedIn == false && p.showLoggedIn == true)">
<ion-label primary>{{p.title}}</ion-label>
</button>

View File

@ -1,5 +1,5 @@
import {App, InfiniteScroll} from 'ionic-angular';
import {Injectable} from 'angular2/core';
import {Injectable} from '@angular/core';
/**
* Mock Data Access Object

View File

@ -5,7 +5,7 @@
<ion-content>
<ion-list>
<ion-item *ngFor="#item of items">
<ion-item *ngFor="let item of items">
{{ item }}
</ion-item>
</ion-list>

View File

@ -1,6 +1,6 @@
import {App, Page, IonicApp, Config, Platform} from 'ionic-angular';
import {Storage, LocalStorage} from 'ionic-angular';
import {Pipe, PipeTransform, Injectable} from 'angular2/core'
import {Pipe, PipeTransform, Injectable} from '@angular/core'
@Pipe({name: 'cleanLocalData'})

View File

@ -11,7 +11,7 @@
<ion-item>
<ion-label>Key</ion-label>
<ion-select [(ngModel)]="myItem.key">
<ion-option *ngFor="#key of keys" [value]="key">
<ion-option *ngFor="let key of keys" [value]="key">
{{ key }}
</ion-option>
</ion-select>
@ -20,7 +20,7 @@
<ion-item>
<ion-label>Value</ion-label>
<ion-select [(ngModel)]="myItem.value">
<ion-option *ngFor="#value of values" [value]="value">
<ion-option *ngFor="let value of values" [value]="value">
{{ value }}
</ion-option>
</ion-select>
@ -42,7 +42,7 @@
<ion-label>Key</ion-label>
<ion-select [(ngModel)]="delKey">
<ion-option checked>Select a Key</ion-option>
<ion-option *ngFor="#key of addedKeys" [value]="key">
<ion-option *ngFor="let key of addedKeys" [value]="key">
{{ key }}
</ion-option>
</ion-select>

View File

@ -33,4 +33,4 @@ $colors: (
bright: #FFC125
);
@import "../ionic/ionic.ios";
@import "../src/ionic.ios";

View File

@ -33,4 +33,4 @@ $colors: (
bright: #FFC125
);
@import "../ionic/ionic.md";
@import "../src/ionic.md";

View File

@ -3,4 +3,7 @@ import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class ApiDemoApp {}
class ApiDemoApp {
isDisabled = true;
}

View File

@ -34,6 +34,11 @@
Auto-Lock
</ion-list-header>
<ion-item>
<ion-label>Enable "Never"</ion-label>
<ion-toggle (change)="isDisabled = !isDisabled"></ion-toggle>
</ion-item>
<ion-item>
<ion-label>1 Minute</ion-label>
<ion-radio></ion-radio>
@ -41,7 +46,7 @@
<ion-item>
<ion-label>2 Minutes</ion-label>
<ion-radio checked="true"></ion-radio>
<ion-radio checked></ion-radio>
</ion-item>
<ion-item>
@ -51,7 +56,7 @@
<ion-item>
<ion-label>Never</ion-label>
<ion-radio></ion-radio>
<ion-radio [disabled]="isDisabled"></ion-radio>
</ion-item>
</ion-list>

View File

@ -1,5 +1,5 @@
import {App, Page, Refresher} from 'ionic-angular';
import {Injectable} from 'angular2/core';
import {Injectable} from '@angular/core';
/**
* Mock Data Access Object

View File

@ -12,7 +12,7 @@
</ion-refresher>
<ion-list>
<ion-item *ngFor="#item of items">
<ion-item *ngFor="let item of items">
{{ item }}
</ion-item>
</ion-list>

View File

@ -82,7 +82,7 @@
<ion-item>
<ion-label>Pets</ion-label>
<ion-select [(ngModel)]="pets" multiple="true" [alertOptions]="petAlertOpts">
<ion-option *ngFor="#o of petData" [value]="o.value">{{o.text}}</ion-option>
<ion-option *ngFor="let o of petData" [value]="o.value">{{o.text}}</ion-option>
</ion-select>
</ion-item>

View File

@ -1,5 +1,5 @@
<ion-slides loop="true" style="background-color: black">
<ion-slide *ngFor="#image of [1,2,3,4,5]">
<ion-slide *ngFor="let image of [1,2,3,4,5]">
<img data-src="./slide{{image}}.jpeg">
</ion-slide>
</ion-slides>

View File

@ -86,9 +86,9 @@ gulp.task('watch', ['build'], function() {
function watchTask(task){
watch([
'ionic/**/*.ts',
'!ionic/components/*/test/**/*',
'!ionic/util/test/*'
'src/**/*.ts',
'!src/components/*/test/**/*',
'!src/util/test/*'
],
function(file) {
if (file.event === "unlink") {
@ -99,7 +99,7 @@ function watchTask(task){
}
);
watch('ionic/**/*.scss', function() {
watch('src/**/*.scss', function() {
gulp.start('sass');
});
@ -201,7 +201,7 @@ gulp.task('bundle.system', function(){
var tsResult = tsCompile(getTscOptions('es6'), 'system')
.pipe(babel(babelOptions));
var swiper = gulp.src('ionic/components/slides/swiper-widget.system.js');
var swiper = gulp.src('src/components/slides/swiper-widget.system.js');
return merge([tsResult, swiper])
.pipe(remember('system'))
@ -246,13 +246,13 @@ gulp.task('transpile', function(){
function tsCompile(options, cacheName){
return gulp.src([
'typings/main.d.ts',
'ionic/**/*.ts',
'!ionic/**/*.d.ts',
'!ionic/components/*/test/**/*',
'!ionic/util/test/*',
'!ionic/config/test/*',
'!ionic/platform/test/*',
'!ionic/**/*.spec.ts'
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/components/*/test/**/*',
'!src/util/test/*',
'!src/config/test/*',
'!src/platform/test/*',
'!src/**/*.spec.ts'
])
.pipe(cache(cacheName, { optimizeMemory: true }))
.pipe(tsc(options, undefined, tscReporter));
@ -267,10 +267,10 @@ gulp.task('sass', function() {
var minifyCss = require('gulp-minify-css');
gulp.src([
'ionic/ionic.ios.scss',
'ionic/ionic.md.scss',
'ionic/ionic.wp.scss',
'ionic/ionic.scss'
'src/ionic.ios.scss',
'src/ionic.md.scss',
'src/ionic.wp.scss',
'src/ionic.scss'
])
.pipe(sass({
includePaths: [__dirname + '/node_modules/ionicons/dist/scss/'],
@ -312,7 +312,7 @@ gulp.task('sass.themes', function() {
*/
gulp.task('fonts', function() {
gulp.src([
'ionic/fonts/*.+(ttf|woff|woff2)',
'src/fonts/*.+(ttf|woff|woff2)',
'node_modules/ionicons/dist/fonts/*.+(ttf|woff|woff2)'
])
.pipe(gulp.dest('dist/fonts'));
@ -323,9 +323,9 @@ gulp.task('fonts', function() {
*/
gulp.task('copy.scss', function() {
return gulp.src([
'ionic/**/*.scss',
'!ionic/components/*/test/**/*',
'!ionic/util/test/*'
'src/**/*.scss',
'!src/components/*/test/**/*',
'!src/util/test/*'
])
.pipe(gulp.dest('dist'));
});
@ -337,9 +337,9 @@ gulp.task('lint.scss', function() {
var scsslint = require('gulp-scss-lint');
return gulp.src([
'ionic/**/*.scss',
'!ionic/components/*/test/**/*',
'!ionic/util/test/*'
'src/**/*.scss',
'!src/components/*/test/**/*',
'!src/util/test/*'
])
.pipe(scsslint())
.pipe(scsslint.failReporter());
@ -355,18 +355,16 @@ gulp.task('copy.libs', function() {
'node_modules/systemjs/node_modules/es6-module-loader/dist/es6-module-loader.src.js', //npm2
'node_modules/es6-module-loader/dist/es6-module-loader.src.js', //npm3
'node_modules/systemjs/dist/system.src.js',
'node_modules/angular2/bundles/angular2-polyfills.js',
'node_modules/angular2/bundles/angular2.dev.js',
'node_modules/angular2/bundles/router.dev.js',
'node_modules/angular2/bundles/http.dev.js',
'node_modules/rxjs/bundles/Rx.js'
'node_modules/rxjs/bundles/Rx.js',
'node_modules/zone.js/dist/zone.js',
'node_modules/reflect-metadata/Reflect.js'
])
.pipe(gulp.dest('dist/js'));
// for swiper-widget
var libs = gulp.src([
'ionic/**/*.js',
'ionic/**/*.d.ts'
'src/**/*.js',
'src/**/*.d.ts'
])
.pipe(gulp.dest('dist'));
@ -385,7 +383,7 @@ gulp.task('copy.libs', function() {
gulp.task('watch.e2e', ['e2e'], function() {
watchTask('bundle.system');
watch('ionic/components/*/test/**/*', function(file) {
watch('src/components/*/test/**/*', function(file) {
gulp.start('e2e.build');
});
});
@ -421,8 +419,8 @@ gulp.task('e2e.build', function() {
// Get each test folder with gulp.src
var tsResult = gulp.src([
'ionic/components/*/test/*/**/*.ts',
'!ionic/components/*/test/*/**/*.spec.ts'
'src/components/*/test/*/**/*.ts',
'!src/components/*/test/*/**/*.spec.ts'
])
.pipe(cache('e2e.ts'))
.pipe(tsc(getTscOptions(), undefined, tscReporter))
@ -433,8 +431,8 @@ gulp.task('e2e.build', function() {
.pipe(gulpif(/e2e.js$/, createPlatformTests()))
var testFiles = gulp.src([
'ionic/components/*/test/*/**/*',
'!ionic/components/*/test/*/**/*.ts'
'src/components/*/test/*/**/*',
'!src/components/*/test/*/**/*.ts'
])
.pipe(cache('e2e.files'))
@ -463,7 +461,7 @@ gulp.task('e2e.build', function() {
function createPlatformTests(file) {
return through2.obj(function(file, enc, next) {
var self = this;
var relativePath = path.dirname(file.path.replace(/^.*?ionic(\/|\\)components(\/|\\)/, ''));
var relativePath = path.dirname(file.path.replace(/^.*?src(\/|\\)components(\/|\\)/, ''));
relativePath = relativePath.replace('/test/', '/');
var contents = file.contents.toString();
platforms.forEach(function(platform) {
@ -488,7 +486,7 @@ gulp.task('e2e.build', function() {
* Builds Ionic unit tests to dist/tests.
*/
gulp.task('tests', function() {
return gulp.src('ionic/**/test/**/*.spec.ts')
return gulp.src('src/**/test/**/*.spec.ts')
.pipe(cache('tests'))
.pipe(tsc(getTscOptions(), undefined, tscReporter))
.pipe(rename(function(file) {
@ -499,7 +497,7 @@ gulp.task('tests', function() {
});
gulp.task('watch.tests', ['tests'], function(){
watch('ionic/**/test/**/*.spec.ts', function(){
watch('src/**/test/**/*.spec.ts', function(){
gulp.start('tests');
});
});
@ -814,7 +812,7 @@ gulp.task('package', function(done){
var templateVars = {};
var packageJSON = require('./package.json');
templateVars.ionicVersion = packageJSON.version;
templateVars.angularVersion = packageJSON.dependencies.angular2;
templateVars.angularVersion = packageJSON.dependencies['@angular/core'];
var packageTemplate = _.template(fs.readFileSync('scripts/npm/package.json'));
fs.writeFileSync(distDir + '/package.json', packageTemplate(templateVars));
done();
@ -985,8 +983,8 @@ gulp.task('validate', function(done) {
gulp.task('tslint', function() {
var tslint = require('gulp-tslint');
return gulp.src([
'ionic/**/*.ts',
'!ionic/**/test/**/*',
'src/**/*.ts',
'!src/**/test/**/*',
]).pipe(tslint())
.pipe(tslint.report('verbose'));
});

View File

@ -1,8 +0,0 @@
it('should navigate to page 2', function() {
element(by.css('.e2eCordovaPage2')).click();
});
it('should open modal', function() {
element(by.css('.e2eCordovaOpenModal')).click();
});

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,7 +0,0 @@
import {App} from 'ionic-angular';
@App({
templateUrl: 'main.html'
})
class E2EApp {}

View File

@ -1,11 +0,0 @@
@import "../../globals.ios";
// iOS Modals
// --------------------------------------------------
$modal-ios-background-color: $background-ios-color !default;
ion-page.modal {
background-color: $modal-ios-background-color;
}

View File

@ -1,11 +0,0 @@
@import "../../globals.core";
// Modals
// --------------------------------------------------
ion-page.modal {
z-index: $z-index-overlay;
// hidden by default to prevent flickers, the animation will show it
transform: translate3d(0, 100%, 0);
}

View File

@ -1,127 +0,0 @@
import {Directive, ViewContainerRef, DynamicComponentLoader, Attribute} from 'angular2/core';
import {
RouterOutlet,
Router,
ComponentInstruction,
Instruction} from 'angular2/router';
import {Nav} from './nav';
import {ViewController} from './view-controller';
/**
* @private
*/
@Directive({
selector: 'ion-nav'
})
export class NavRouter extends RouterOutlet {
private _lastUrl: string;
private _nav: Nav;
private _parent: Router;
constructor(
viewContainerRef: ViewContainerRef,
loader: DynamicComponentLoader,
parentRouter: Router,
@Attribute('name') nameAttr: string,
nav: Nav
) {
if (nav.parent) {
parentRouter = parentRouter.childRouter(nav);
}
super(viewContainerRef, loader, parentRouter, nameAttr);
this._nav = nav;
this._parent = parentRouter;
// register this router with Ionic's NavController
// Ionic's NavController will call this NavRouter's "stateChange"
// method when the NavController has...changed its state
nav.registerRouter(this);
}
stateChange(direction: string, viewCtrl: ViewController) {
// stateChange is called by Ionic's NavController
// viewCtrl is Ionic's ViewController class, which has the properties "componentType" and "params"
// only do an update if there's an actual view change
if (!viewCtrl) {
return;
}
// get the best PathRecognizer for this view's componentType
let pathRecognizer = this.getPathRecognizerByComponent(viewCtrl.componentType);
if (pathRecognizer) {
// generate a componentInstruction from the view's PathRecognizer and params
let componentInstruction = pathRecognizer.generate(viewCtrl.data);
// create a ResolvedInstruction from the componentInstruction
let instruction = new ResolvedInstruction(componentInstruction, null, null);
if (instruction) {
let url = instruction.toRootUrl();
if (url === this._lastUrl) return;
this._lastUrl = url;
this._parent.navigateByInstruction(instruction);
console.debug('NavRouter, stateChange, name:', viewCtrl.name, 'id:', viewCtrl.id, 'url:', url);
}
}
}
activate(nextInstruction: ComponentInstruction): Promise<any> {
var previousInstruction = this['_currentInstruction'];
this['_currentInstruction'] = nextInstruction;
var componentType = nextInstruction.componentType;
var childRouter = this._parent.childRouter(componentType);
// prevent double navigations to the same view
let instruction = new ResolvedInstruction(nextInstruction, null, null);
let url: string;
if (instruction) {
url = instruction.toRootUrl();
if (url === this._lastUrl) {
return Promise.resolve();
}
}
console.debug('NavRouter, activate:', componentType.name, 'url:', url);
// tell the NavController which componentType, and it's params, to navigate to
return this._nav.push(componentType, nextInstruction.params);
}
reuse(nextInstruction: ComponentInstruction) {
return Promise.resolve();
}
getPathRecognizerByComponent(componentType) {
// given a componentType, figure out the best PathRecognizer to use
let rules = this._parent.registry['_rules'];
let pathRecognizer = null;
rules.forEach((rule) => {
pathRecognizer = rule.rules.find(function(routeRule) {
return routeRule.handler.componentType === componentType;
});
});
return pathRecognizer;
}
}
// TODO: hacked from
// https://github.com/angular/angular/blob/6ddfff5cd59aac9099aa6da5118c5598eea7ea11/modules/angular2/src/router/instruction.ts#L207
class ResolvedInstruction extends Instruction {
constructor(public component: ComponentInstruction, public child: Instruction,
public auxInstruction: {[key: string]: Instruction}) {
super(component, child, auxInstruction);
}
resolveComponent(): Promise<ComponentInstruction> {
return Promise.resolve(this.component);
}
}

View File

@ -1,20 +0,0 @@
it('should go to Tab1 Page1', function() {
element(by.css('#signIn')).click();
});
it('should go to Tab1 Page2', function() {
element(by.css('#goToTab1Page2')).click();
});
it('should go back to Tab1 Page1', function() {
element(by.css('#backToTab1Page1')).click();
});
it('should go to Tab2 Page1', function() {
element(by.css('.tab-button:nth-of-type(2)')).click();
});
it('should go back to Tab1 Page1', function() {
element(by.css('.tab-button:nth-of-type(1)')).click();
});

View File

@ -1,8 +0,0 @@
it('should open toast', function() {
element(by.css('.e2eOpenToast')).click();
});
it('should close with backdrop click', function() {
element(by.css('.backdrop')).click();
});

View File

@ -1,41 +0,0 @@
@import "../globals.ios";
// iOS Cordova
// --------------------------------------------------
$cordova-ios-statusbar-padding: 20px !default;
ion-navbar-section.statusbar-padding {
height: calc(#{$toolbar-ios-height} + #{$cordova-ios-statusbar-padding});
min-height: calc(#{$toolbar-ios-height} + #{$cordova-ios-statusbar-padding});
}
ion-navbar-section.statusbar-padding > .toolbar ion-segment,
ion-navbar-section.statusbar-padding > .toolbar ion-title,
ion-navbar-section.statusbar-padding > .toolbar {
padding-top: $cordova-ios-statusbar-padding;
height: calc(#{$toolbar-ios-height} + #{$cordova-ios-statusbar-padding});
min-height: calc(#{$toolbar-ios-height} + #{$cordova-ios-statusbar-padding});
}
ion-nav > ion-page,
ion-menu {
> .toolbar.statusbar-padding:first-child ion-segment,
> .toolbar.statusbar-padding:first-child ion-title,
> .toolbar.statusbar-padding:first-child {
padding-top: $cordova-ios-statusbar-padding;
height: calc(#{$toolbar-ios-height} + #{$cordova-ios-statusbar-padding});
min-height: calc(#{$toolbar-ios-height} + #{$cordova-ios-statusbar-padding});
}
> ion-content.statusbar-padding:first-child scroll-content {
padding-top: $cordova-ios-statusbar-padding;
}
> ion-content.statusbar-padding:first-child[padding] scroll-content,
> ion-content.statusbar-padding:first-child[padding-top] scroll-content {
padding-top: calc(#{$content-ios-padding} + #{$cordova-ios-statusbar-padding});
}
}

View File

@ -1,37 +0,0 @@
@import "../globals.md";
// iOS Cordova
// --------------------------------------------------
$cordova-ios-statusbar-padding: 20px !default;
ion-navbar-section.statusbar-padding {
height: calc(#{$toolbar-md-height} + #{$cordova-ios-statusbar-padding});
min-height: calc(#{$toolbar-md-height} + #{$cordova-ios-statusbar-padding});
}
ion-navbar-section.statusbar-padding > .toolbar {
padding-top: $cordova-ios-statusbar-padding;
height: calc(#{$toolbar-md-height} + #{$cordova-ios-statusbar-padding});
min-height: calc(#{$toolbar-md-height} + #{$cordova-ios-statusbar-padding});
}
ion-nav > ion-page,
ion-menu {
> .toolbar.statusbar-padding:first-child {
padding-top: $cordova-ios-statusbar-padding;
height: calc(#{$toolbar-md-height} + #{$cordova-ios-statusbar-padding});
min-height: calc(#{$toolbar-md-height} + #{$cordova-ios-statusbar-padding});
}
> ion-content.statusbar-padding:first-child scroll-content {
padding-top: $cordova-ios-statusbar-padding;
}
> ion-content.statusbar-padding:first-child[padding] scroll-content,
> ion-content.statusbar-padding:first-child[padding-top] scroll-content {
padding-top: calc(#{$content-md-padding} + #{$cordova-ios-statusbar-padding});
}
}

View File

@ -1,37 +0,0 @@
@import "../globals.wp";
// iOS Cordova
// --------------------------------------------------
$cordova-ios-statusbar-padding: 20px !default;
ion-navbar-section.statusbar-padding {
height: calc(#{$toolbar-wp-height} + #{$cordova-ios-statusbar-padding});
min-height: calc(#{$toolbar-wp-height} + #{$cordova-ios-statusbar-padding});
}
ion-navbar-section.statusbar-padding > .toolbar {
padding-top: $cordova-ios-statusbar-padding;
height: calc(#{$toolbar-wp-height} + #{$cordova-ios-statusbar-padding});
min-height: calc(#{$toolbar-wp-height} + #{$cordova-ios-statusbar-padding});
}
ion-nav > ion-page,
ion-menu {
> .toolbar.statusbar-padding:first-child {
padding-top: $cordova-ios-statusbar-padding;
height: calc(#{$toolbar-wp-height} + #{$cordova-ios-statusbar-padding});
min-height: calc(#{$toolbar-wp-height} + #{$cordova-ios-statusbar-padding});
}
> ion-content.statusbar-padding:first-child scroll-content {
padding-top: $cordova-ios-statusbar-padding;
}
> ion-content.statusbar-padding:first-child[padding] scroll-content,
> ion-content.statusbar-padding:first-child[padding-top] scroll-content {
padding-top: calc(#{$content-wp-padding} + #{$cordova-ios-statusbar-padding});
}
}

View File

@ -1,399 +0,0 @@
import * as util from '../../../ionic/util';
export function run() {
describe('extend', function() {
describe('isCheckedProperty', function() {
it('should test a=undefined', () => {
expect(util.isCheckedProperty(undefined, undefined)).toBe(true);
expect(util.isCheckedProperty(undefined, null)).toBe(true);
expect(util.isCheckedProperty(undefined, '')).toBe(true);
expect(util.isCheckedProperty(undefined, 'string')).toBe(false);
expect(util.isCheckedProperty(undefined, 0)).toBe(false);
expect(util.isCheckedProperty(undefined, '0')).toBe(false);
expect(util.isCheckedProperty(undefined, 1000)).toBe(false);
expect(util.isCheckedProperty(undefined, '1000')).toBe(false);
expect(util.isCheckedProperty(undefined, -1)).toBe(false);
expect(util.isCheckedProperty(undefined, true)).toBe(false);
expect(util.isCheckedProperty(undefined, false)).toBe(false);
expect(util.isCheckedProperty(undefined, 'true')).toBe(false);
expect(util.isCheckedProperty(undefined, 'false')).toBe(false);
});
it('should test a=null', () => {
expect(util.isCheckedProperty(null, undefined)).toBe(true);
expect(util.isCheckedProperty(null, null)).toBe(true);
expect(util.isCheckedProperty(null, '')).toBe(true);
expect(util.isCheckedProperty(null, 'string')).toBe(false);
expect(util.isCheckedProperty(null, 0)).toBe(false);
expect(util.isCheckedProperty(null, '0')).toBe(false);
expect(util.isCheckedProperty(null, 1000)).toBe(false);
expect(util.isCheckedProperty(null, '1000')).toBe(false);
expect(util.isCheckedProperty(null, -1)).toBe(false);
expect(util.isCheckedProperty(null, true)).toBe(false);
expect(util.isCheckedProperty(null, false)).toBe(false);
expect(util.isCheckedProperty(null, 'true')).toBe(false);
expect(util.isCheckedProperty(null, 'false')).toBe(false);
});
it('should test a=""', () => {
expect(util.isCheckedProperty('', undefined)).toBe(true);
expect(util.isCheckedProperty('', null)).toBe(true);
expect(util.isCheckedProperty('', '')).toBe(true);
expect(util.isCheckedProperty('', 'string')).toBe(false);
expect(util.isCheckedProperty('', 0)).toBe(false);
expect(util.isCheckedProperty('', '0')).toBe(false);
expect(util.isCheckedProperty('', 1000)).toBe(false);
expect(util.isCheckedProperty('', '1000')).toBe(false);
expect(util.isCheckedProperty('', -1)).toBe(false);
expect(util.isCheckedProperty('', true)).toBe(false);
expect(util.isCheckedProperty('', false)).toBe(false);
expect(util.isCheckedProperty('', 'true')).toBe(false);
expect(util.isCheckedProperty('', 'false')).toBe(false);
});
it('should test a=true', () => {
expect(util.isCheckedProperty(true, undefined)).toBe(false);
expect(util.isCheckedProperty(true, null)).toBe(false);
expect(util.isCheckedProperty(true, '')).toBe(false);
expect(util.isCheckedProperty(true, 'string')).toBe(false);
expect(util.isCheckedProperty(true, 0)).toBe(false);
expect(util.isCheckedProperty(true, '0')).toBe(false);
expect(util.isCheckedProperty(true, 1000)).toBe(false);
expect(util.isCheckedProperty(true, '1000')).toBe(false);
expect(util.isCheckedProperty(true, -1)).toBe(false);
expect(util.isCheckedProperty(true, true)).toBe(true);
expect(util.isCheckedProperty(true, false)).toBe(false);
expect(util.isCheckedProperty(true, 'true')).toBe(true);
expect(util.isCheckedProperty(true, 'false')).toBe(false);
});
it('should test a="true"', () => {
expect(util.isCheckedProperty('true', undefined)).toBe(false);
expect(util.isCheckedProperty('true', null)).toBe(false);
expect(util.isCheckedProperty('true', '')).toBe(false);
expect(util.isCheckedProperty('true', 'string')).toBe(false);
expect(util.isCheckedProperty('true', 0)).toBe(false);
expect(util.isCheckedProperty('true', '0')).toBe(false);
expect(util.isCheckedProperty('true', 1000)).toBe(false);
expect(util.isCheckedProperty('true', '1000')).toBe(false);
expect(util.isCheckedProperty('true', -1)).toBe(false);
expect(util.isCheckedProperty('true', true)).toBe(true);
expect(util.isCheckedProperty('true', false)).toBe(false);
expect(util.isCheckedProperty('true', 'true')).toBe(true);
expect(util.isCheckedProperty('true', 'false')).toBe(false);
});
it('should test a=false', () => {
expect(util.isCheckedProperty(false, undefined)).toBe(false);
expect(util.isCheckedProperty(false, null)).toBe(false);
expect(util.isCheckedProperty(false, '')).toBe(false);
expect(util.isCheckedProperty(false, 'string')).toBe(false);
expect(util.isCheckedProperty(false, 0)).toBe(false);
expect(util.isCheckedProperty(false, '0')).toBe(false);
expect(util.isCheckedProperty(false, 1000)).toBe(false);
expect(util.isCheckedProperty(false, '1000')).toBe(false);
expect(util.isCheckedProperty(false, -1)).toBe(false);
expect(util.isCheckedProperty(false, true)).toBe(false);
expect(util.isCheckedProperty(false, false)).toBe(true);
expect(util.isCheckedProperty(false, 'true')).toBe(false);
expect(util.isCheckedProperty(false, 'false')).toBe(true);
});
it('should test a="false"', () => {
expect(util.isCheckedProperty('false', undefined)).toBe(false);
expect(util.isCheckedProperty('false', null)).toBe(false);
expect(util.isCheckedProperty('false', '')).toBe(false);
expect(util.isCheckedProperty('false', 'string')).toBe(false);
expect(util.isCheckedProperty('false', 0)).toBe(false);
expect(util.isCheckedProperty('false', '0')).toBe(false);
expect(util.isCheckedProperty('false', 1000)).toBe(false);
expect(util.isCheckedProperty('false', '1000')).toBe(false);
expect(util.isCheckedProperty('false', -1)).toBe(false);
expect(util.isCheckedProperty('false', true)).toBe(false);
expect(util.isCheckedProperty('false', false)).toBe(true);
expect(util.isCheckedProperty('false', 'true')).toBe(false);
expect(util.isCheckedProperty('false', 'false')).toBe(true);
});
it('should test a=0', () => {
expect(util.isCheckedProperty(0, undefined)).toBe(false);
expect(util.isCheckedProperty(0, null)).toBe(false);
expect(util.isCheckedProperty(0, '')).toBe(false);
expect(util.isCheckedProperty(0, 'string')).toBe(false);
expect(util.isCheckedProperty(0, 0)).toBe(true);
expect(util.isCheckedProperty(0, '0')).toBe(true);
expect(util.isCheckedProperty(0, 1000)).toBe(false);
expect(util.isCheckedProperty(0, '1000')).toBe(false);
expect(util.isCheckedProperty(0, -1)).toBe(false);
expect(util.isCheckedProperty(0, true)).toBe(false);
expect(util.isCheckedProperty(0, false)).toBe(false);
expect(util.isCheckedProperty(0, 'true')).toBe(false);
expect(util.isCheckedProperty(0, 'false')).toBe(false);
});
it('should test a="0"', () => {
expect(util.isCheckedProperty('0', undefined)).toBe(false);
expect(util.isCheckedProperty('0', null)).toBe(false);
expect(util.isCheckedProperty('0', '')).toBe(false);
expect(util.isCheckedProperty('0', 'string')).toBe(false);
expect(util.isCheckedProperty('0', 0)).toBe(true);
expect(util.isCheckedProperty('0', '0')).toBe(true);
expect(util.isCheckedProperty('0', 1000)).toBe(false);
expect(util.isCheckedProperty('0', '1000')).toBe(false);
expect(util.isCheckedProperty('0', -1)).toBe(false);
expect(util.isCheckedProperty('0', true)).toBe(false);
expect(util.isCheckedProperty('0', false)).toBe(false);
expect(util.isCheckedProperty('0', 'true')).toBe(false);
expect(util.isCheckedProperty('0', 'false')).toBe(false);
});
it('should test a=1000', () => {
expect(util.isCheckedProperty(1000, undefined)).toBe(false);
expect(util.isCheckedProperty(1000, null)).toBe(false);
expect(util.isCheckedProperty(1000, '')).toBe(false);
expect(util.isCheckedProperty(1000, 'string')).toBe(false);
expect(util.isCheckedProperty(1000, 0)).toBe(false);
expect(util.isCheckedProperty(1000, '0')).toBe(false);
expect(util.isCheckedProperty(1000, 1000)).toBe(true);
expect(util.isCheckedProperty(1000, '1000')).toBe(true);
expect(util.isCheckedProperty(1000, -1)).toBe(false);
expect(util.isCheckedProperty(1000, true)).toBe(false);
expect(util.isCheckedProperty(1000, false)).toBe(false);
expect(util.isCheckedProperty(1000, 'true')).toBe(false);
expect(util.isCheckedProperty(1000, 'false')).toBe(false);
});
it('should test a="1000"', () => {
expect(util.isCheckedProperty('1000', undefined)).toBe(false);
expect(util.isCheckedProperty('1000', null)).toBe(false);
expect(util.isCheckedProperty('1000', '')).toBe(false);
expect(util.isCheckedProperty('1000', 'string')).toBe(false);
expect(util.isCheckedProperty('1000', 0)).toBe(false);
expect(util.isCheckedProperty('1000', '0')).toBe(false);
expect(util.isCheckedProperty('1000', 1000)).toBe(true);
expect(util.isCheckedProperty('1000', '1000')).toBe(true);
expect(util.isCheckedProperty('1000', -1)).toBe(false);
expect(util.isCheckedProperty('1000', true)).toBe(false);
expect(util.isCheckedProperty('1000', false)).toBe(false);
expect(util.isCheckedProperty('1000', 'true')).toBe(false);
expect(util.isCheckedProperty('1000', 'false')).toBe(false);
});
it('should test a=-1', () => {
expect(util.isCheckedProperty(-1, undefined)).toBe(false);
expect(util.isCheckedProperty(-1, null)).toBe(false);
expect(util.isCheckedProperty(-1, '')).toBe(false);
expect(util.isCheckedProperty(-1, 'string')).toBe(false);
expect(util.isCheckedProperty(-1, 0)).toBe(false);
expect(util.isCheckedProperty(-1, '0')).toBe(false);
expect(util.isCheckedProperty(-1, 1000)).toBe(false);
expect(util.isCheckedProperty(-1, '1000')).toBe(false);
expect(util.isCheckedProperty(-1, -1)).toBe(true);
expect(util.isCheckedProperty(-1, true)).toBe(false);
expect(util.isCheckedProperty(-1, false)).toBe(false);
expect(util.isCheckedProperty(-1, 'true')).toBe(false);
expect(util.isCheckedProperty(-1, 'false')).toBe(false);
});
it('should test a="-1"', () => {
expect(util.isCheckedProperty('-1', undefined)).toBe(false);
expect(util.isCheckedProperty('-1', null)).toBe(false);
expect(util.isCheckedProperty('-1', '')).toBe(false);
expect(util.isCheckedProperty('-1', 'string')).toBe(false);
expect(util.isCheckedProperty('-1', 0)).toBe(false);
expect(util.isCheckedProperty('-1', '0')).toBe(false);
expect(util.isCheckedProperty('-1', 1000)).toBe(false);
expect(util.isCheckedProperty('-1', '1000')).toBe(false);
expect(util.isCheckedProperty('-1', -1)).toBe(true);
expect(util.isCheckedProperty('-1', true)).toBe(false);
expect(util.isCheckedProperty('-1', false)).toBe(false);
expect(util.isCheckedProperty('-1', 'true')).toBe(false);
expect(util.isCheckedProperty('-1', 'false')).toBe(false);
});
it('should test a="string"', () => {
expect(util.isCheckedProperty('string', undefined)).toBe(false);
expect(util.isCheckedProperty('string', null)).toBe(false);
expect(util.isCheckedProperty('string', '')).toBe(false);
expect(util.isCheckedProperty('string', 'string')).toBe(true);
expect(util.isCheckedProperty('string', 'otherstring')).toBe(false);
expect(util.isCheckedProperty('string', 0)).toBe(false);
expect(util.isCheckedProperty('string', '0')).toBe(false);
expect(util.isCheckedProperty('string', 1000)).toBe(false);
expect(util.isCheckedProperty('string', '1000')).toBe(false);
expect(util.isCheckedProperty('string', -1)).toBe(false);
expect(util.isCheckedProperty('string', true)).toBe(false);
expect(util.isCheckedProperty('string', false)).toBe(false);
expect(util.isCheckedProperty('string', 'true')).toBe(false);
expect(util.isCheckedProperty('string', 'false')).toBe(false);
});
});
describe('getQuerystring', function() {
it('should have no entries for empty url', () => {
expect(util.getQuerystring('')).toEqual({});
expect(util.getQuerystring(null)).toEqual({});
expect(util.getQuerystring(undefined)).toEqual({});
});
it('should have no entries when without ?', () => {
expect(util.getQuerystring('http://localhost:1234/')).toEqual({});
});
it('should have no entries with only ?', () => {
expect(util.getQuerystring('http://localhost:1234/?')).toEqual({});
});
it('should have no entries for key with no =', () => {
expect(util.getQuerystring('http://localhost:1234/?key')).toEqual({});
});
it('should have no entries with only #?', () => {
expect(util.getQuerystring('http://localhost:1234/#?')).toEqual({});
});
it('should have no entries with only #?=', () => {
expect(util.getQuerystring('http://localhost:1234/#?=')).toEqual({});
});
it('should have no entries for url with no "?" character', () => {
expect(util.getQuerystring('http://localhost:1234/#key1=1&key2=2')).toEqual({});
});
it('should contain key/value entries for all the parameters after "?" character', () => {
expect(util.getQuerystring('http://localhost:1234/#key1=1&key2x=2x?key3=3&key4=4')).toEqual({
key3: '3',
key4: '4'
});
});
it('should lowercase param keys', () => {
expect(util.getQuerystring('http://localhost:1234/#?KEY1=1&kEy2=2')).toEqual({
key1: '1',
key2: '2'
});
});
it('should not include any values when # comes after ?', () => {
expect(util.getQuerystring('http://localhost:1234/?key1=1#key2=2')).toEqual({
key1: '1'
});
});
it('should ignore empty ?& and &&', () => {
expect(util.getQuerystring('http://localhost:1234/#?&&')).toEqual({});
expect(util.getQuerystring('http://localhost:1234/#?&&key1=1&key2=2&&')).toEqual({
key1: '1',
key2: '2'
});
});
it('should get "" when key has no value', () => {
expect(util.getQuerystring('http://localhost:1234/#?key=')).toEqual({
key: ''
});
});
});
describe('isTrueProperty', function() {
it('should be true from boolean true', () => {
expect(util.isTrueProperty(true)).toBe(true);
});
it('should be true from string "true"', () => {
expect(util.isTrueProperty('true')).toBe(true);
expect(util.isTrueProperty('TRUE')).toBe(true);
expect(util.isTrueProperty(' true ')).toBe(true);
});
it('should be true from string "on"', () => {
expect(util.isTrueProperty(true)).toBe(true);
});
it('should be true from empty string ""', () => {
expect(util.isTrueProperty('')).toBe(true);
expect(util.isTrueProperty(' ')).toBe(true);
});
it('should be true from number greater than zero', () => {
expect(util.isTrueProperty(1)).toBe(true);
expect(util.isTrueProperty(999)).toBe(true);
});
it('should be false from boolean false', () => {
expect(util.isTrueProperty(false)).toBe(false);
});
it('should be false from string "off"', () => {
expect(util.isTrueProperty(true)).toBe(true);
});
it('should be false from null', () => {
expect(util.isTrueProperty(null)).toBe(false);
});
it('should be false from undefined', () => {
expect(util.isTrueProperty(undefined)).toBe(false);
});
it('should be false from string "false"', () => {
expect(util.isTrueProperty('false')).toBe(false);
expect(util.isTrueProperty(' FALSE ')).toBe(false);
expect(util.isTrueProperty('doesnt actually matter')).toBe(false);
});
});
it('should extend simple', () => {
var obj = { a: '0', c: '0' };
expect( util.assign(obj, { a: '1', b: '2' }) ).toBe(obj);
expect(obj).toEqual({ a: '1', b: '2', c: '0' });
});
it('should extend complex', () => {
expect(util.assign(
{ a: '0', b: '0' },
{ b: '1', c: '1' },
{ c: '2', d: '2' }
)).toEqual({
a: '0',
b: '1',
c: '2',
d: '2'
});
});
});
describe('defaults', function() {
it('should simple defaults', () => {
var obj = { a: '1' };
expect(util.defaults(obj, { a: '2', b: '2' })).toBe(obj);
expect(obj).toEqual({
a: '1', b: '2'
});
});
it('should complex defaults', () => {
expect(util.defaults(
{ a: '0', b: '0' },
{ b: '1', c: '1', e: '1' },
{ c: '2', d: '2' }
)).toEqual({
a: '0',
b: '0',
c: '2',
d: '2',
e: '1'
});
});
});
}

View File

@ -1,7 +1,7 @@
{
"private": "true",
"name": "ionic2",
"version": "2.0.0-beta.6",
"version": "2.0.0-beta.7",
"license": "MIT",
"repository": {
"type": "git",
@ -13,7 +13,14 @@
"link": "npm install && gulp src && npm link"
},
"dependencies": {
"angular2": "2.0.0-beta.16",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/platform-server": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"colors": "^1.1.2",
"es6-shim": "^0.35.0",
"inquirer": "0.11.0",
@ -21,8 +28,8 @@
"lodash": "3.10.1",
"mkdirp-no-bin": "0.5.1",
"q": "1.4.1",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12"
},
"devDependencies": {
@ -92,4 +99,4 @@
"path": "node_modules/ionic-cz-conventional-changelog"
}
}
}
}

View File

@ -108,4 +108,4 @@ If you'd like to manually update the demos, follow the steps on the preview app
Ionic API demos are automatically compiled and deployed to the [ionic staging site](http://ionic-site-staging.herokuapp.com/) on every commit. No action is necessary.
If you'd like to manually update the demos, clone the [`ionic-site`](https://github.com/driftyco/ionic-site) repo as a sibling of `ionic`. From `ionic` run gulp docs, and it'll compile and copy the demos to the `ionic-site` repo, ready for testing or committing.
If you'd like to manually update the demos, clone the [`ionic-site`](https://github.com/driftyco/ionic-site) repo as a sibling of `ionic`. From `ionic` run `gulp demos` and then `gulp docs`, and it'll compile and copy the demos to the `ionic-site` repo, ready for testing.

View File

@ -2,13 +2,13 @@
module.exports = {
dist: 'dist',
src: {
spec: ['ionic/**/test/*.spec.js'],
js: ['ionic/**/*.js'],
spec: ['src/**/test/*.spec.js'],
js: ['src/**/*.js'],
// Get all the non-js files and main.js
e2e: ['ionic/components/*/test/*/**/*'],
html: 'ionic/**/*.html',
scss: 'ionic/**/*.scss',
e2e: ['src/components/*/test/*/**/*'],
html: 'src/**/*.html',
scss: 'src/**/*.scss',
},
scripts: [

View File

@ -14,23 +14,34 @@
<script src="../../js/es6-module-loader.src.js"></script>
<script src="../../js/system.src.js"></script>
<script>
System.config({
map: {
'angular2': '/angular2'
System.config({
map: {
'@angular/core': '/node_modules/@angular/core/core.umd.js',
'@angular/compiler': '/node_modules/@angular/compiler/compiler.umd.js',
'@angular/common': '/node_modules/@angular/common/common.umd.js',
'@angular/http': '/node_modules/@angular/http/http.umd.js',
'@angular/platform-browser': '/node_modules/@angular/platform-browser/platform-browser.umd.js',
'@angular/platform-browser-dynamic': '/node_modules/@angular/platform-browser-dynamic/platform-browser-dynamic.umd.js',
'@angular/router': '/node_modules/@angular/router/router.umd.js',
'ionic-angular': '/src'
},
packages: {
'ionic-angular': {
main: 'index'
},
packages: {
'ionic-angular': {
main: 'index'
}
'rxjs': {
defaultExtension: 'js'
}
});
}
});
</script>
<script src="../../js/angular2-polyfills.js"></script>
<script src="../../js/angular2.dev.js"></script>
<script src="../../js/router.dev.js"></script>
<script src="../../js/http.dev.js"></script>
<script src="../../bundles/ionic.system.js"></script>
<script src="../../js/zone.js"></script>
<script src="../../js/Reflect.js"></script>
<script src="../../js/Rx.js"></script>
<script src="../../bundles/ionic.system.js"></script>
</head>
<body>
<ion-app>

View File

@ -18,19 +18,5 @@
</ion-app>
<script src="bundle.js"></script>
<!-- <script src="../../js/ionic.bundle.js"></script>
<script>
System.config({
"paths": {
"*": "*.js",
"ionic/*": "ionic/*",
"angular2/*": "angular2/*",
"rx": "rx"
}
})
System.import("index");
</script> -->
</body>
</html>

View File

@ -13,20 +13,6 @@ function init {
SITE_PATH=$(readJsonProp "config.json" "sitePath")
SITE_DIR=$IONIC_DIR/$SITE_PATH
DOCS_DEST=$(readJsonProp "config.json" "docsDest")
if [ ! -d "$SITE_DIR" ]; then
echo "checking out"
./git/clone.sh --repository="driftyco/ionic-site" \
--directory="$SITE_DIR" \
--branch="master" \
--depth=1
else
echo "using existing"
cd $SITE_DIR
git reset --hard
git pull origin master
cd $IONIC_DIR/scripts
fi
}
function run {
@ -58,6 +44,11 @@ function run {
else
git add -A
git commit -am "Automated build of ionic v$VERSION driftyco/$CIRCLE_PROJECT_REPONAME@$CIRCLE_SHA1"
# in case a different commit was pushed to ionic-site during doc/demo gen,
# try to rebase around it before pushing
git fetch
git rebase
git push origin master
echo "-- Updated docs for $VERSION_NAME succesfully!"

View File

@ -94,13 +94,13 @@ module.exports = function(currentVersion) {
docTypes: ['class', 'var', 'function', 'let'],
getOutputPath: function(doc) {
// strip ionic from path root
var docPath = doc.fileInfo.relativePath.replace(/^ionic\//, '');
var docPath = doc.fileInfo.relativePath.replace(/^src\//, '');
// remove filename since we have multiple docTypes per file
docPath = docPath.substring(0, docPath.lastIndexOf('/') + 1);
docPath += doc.name + '/index.md';
var path = config.v2DocsDir + '/' + (versionData.current.folder || '') +
'/api/' + docPath;
path = path.replace('/home/ubuntu/ionic/ionic', '')
path = path.replace('/home/ubuntu/ionic/src', '')
return path;
}
}];
@ -115,7 +115,7 @@ module.exports = function(currentVersion) {
readTypeScriptModules.basePath = path.resolve(path.resolve(__dirname, '../..'));
readTypeScriptModules.sourceFiles = [
'ionic/index.ts'
'src/index.ts'
];
})

View File

@ -55,7 +55,7 @@ module.exports = function(gulp, flags) {
});
}
return gulp.src('ionic/**/*.scss')
return gulp.src('src/**/*.scss')
.pipe(es.map(function(file, callback) {
var contents = file.contents.toString();
var variableLine, variableName, defaultValue, multiline;
@ -86,7 +86,7 @@ module.exports = function(gulp, flags) {
}));
callback();
}).on('end', function() {
gutil.log("Writing to file at", gutil.colors.cyan("/driftyco/ionic2/" + outputFile));
gutil.log("Writing to file at", gutil.colors.cyan("/driftyco/ionic/" + outputFile));
gutil.log("Place this file in", gutil.colors.cyan("/driftyco/ionic-site/" + config.v2DocsDir + "/theming/overriding-ionic-variables/"), "in order to update the docs");
mkdirp.sync('tmp');
fs.writeFileSync(outputFile, JSON.stringify(variables));

32
scripts/docs/prepare.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
echo "##### "
echo "##### prepare.sh"
echo "#####"
function init {
cd ..
SITE_PATH=$(readJsonProp "config.json" "sitePath")
cd ..
export IONIC_DIR=$PWD
SITE_DIR=$IONIC_DIR/$SITE_PATH
}
function run {
if [ ! -d "$SITE_DIR" ]; then
echo "checking out"
cd ./scripts
./git/clone.sh --repository="ionic-site" \
--directory="$SITE_DIR" \
--branch="master"
else
echo "using existing"
cd $SITE_DIR
git reset --hard
git pull origin master
fi
}
source $(dirname $0)/../utils.sh.inc

View File

@ -19,7 +19,7 @@ module.exports = function jekyll(renderDocsProcessor) {
docs.forEach(function(doc, i) {
docs[i].URL = doc.outputPath.replace('docs/v2//','docs/v2/')
.replace('/index.md','')
.replace('//home/ubuntu/ionic/ionic', '')
.replace('//home/ubuntu/ionic/src', '')
.replace('//', '/');
if (docs[i].relativePath) {
docs[i].relativePath = doc.relativePath

View File

@ -53,7 +53,7 @@ angular_controller: APIDemoCtrl <@ endif @>
<@- endmacro -@>
<@ macro githubViewLink(doc) -@>
<a href="https://github.com/<$ versionInfo.gitRepoInfo.owner $>/<$ versionInfo.gitRepoInfo.repo $>/tree/master/<$ doc.fileInfo.relativePath $>#L<$ doc.location.start.line+1 $>-L<$ doc.location.end.line+1 $>"><$ doc.fileInfo.relativePath $> (line <$ doc.location.start.line+1 $>)</a>
<a href="https://github.com/<$ versionInfo.gitRepoInfo.owner $>/<$ versionInfo.gitRepoInfo.repo $>/tree/2.0/<$ doc.fileInfo.relativePath $>#L<$ doc.location.start.line+1 $>-L<$ doc.location.end.line+1 $>"><$ doc.fileInfo.relativePath $> (line <$ doc.location.start.line+1 $>)</a>
<@- endmacro -@>
<@ macro paramTable(params, isDirective) -@>

View File

@ -38,23 +38,31 @@
<script src="../../../js/es6-shim.min.js"></script>
<script src="../../../js/es6-module-loader.src.js"></script>
<script src="../../../js/Reflect.js"></script>
<script src="../../../js/zone.js"></script>
<script src="../../../js/system.src.js"></script>
<script>
System.config({
map: {
'angular2': '/angular2'
'@angular/core': '/node_modules/@angular/core/core.umd.js',
'@angular/compiler': '/node_modules/@angular/compiler/compiler.umd.js',
'@angular/common': '/node_modules/@angular/common/common.umd.js',
'@angular/http': '/node_modules/@angular/http/http.umd.js',
'@angular/platform-browser': '/node_modules/@angular/platform-browser/platform-browser.umd.js',
'@angular/platform-browser-dynamic': '/node_modules/@angular/platform-browser-dynamic/platform-browser-dynamic.umd.js',
'@angular/router': '/node_modules/@angular/router/router.umd.js',
'ionic-angular': '/src'
},
packages: {
'ionic-angular': {
main: 'index'
},
'rxjs': {
defaultExtension: 'js'
}
}
});
</script>
<script src="../../../js/angular2-polyfills.js"></script>
<script src="../../../js/angular2.dev.js"></script>
<script src="../../../js/router.dev.js"></script>
<script src="../../../js/http.dev.js"></script>
<script src="../../../bundles/ionic.system.js"></script>
<script src="../../../js/Rx.js"></script>

View File

@ -1,6 +1,6 @@
// For E2E dark theme tests
@import "../../ionic/themes/dark.ios.scss";
@import "../../src/themes/dark.ios.scss";
@import "../../ionic/ionic.ios.scss";
@import "../../src/ionic.ios.scss";

View File

@ -1,6 +1,6 @@
// For E2E dark theme tests
@import "../../ionic/themes/dark.md.scss";
@import "../../src/themes/dark.md.scss";
@import "../../ionic/ionic.md.scss";
@import "../../src/ionic.md.scss";

View File

@ -1,6 +1,6 @@
// For E2E dark theme tests
@import "../../ionic/themes/dark.wp.scss";
@import "../../src/themes/dark.wp.scss";
@import "../../ionic/ionic.wp.scss";
@import "../../src/ionic.wp.scss";

View File

@ -1,27 +1,24 @@
module.exports = {
externals: [
{
'ionic/ionic': {
commonjs2: 'ionic/ionic'
'src/ionic': {
commonjs2: 'src/ionic'
},
'angular2/core': {
'@angular/core': {
commonjs2: ['angular2', 'core']
},
'angular2/common': {
'@angular/common': {
commonjs2: ['angular2', 'common']
},
'angular2/router' : {
'@angular/router' : {
commonjs2: ['angular2', 'router']
},
'angular2/http': {
'@angular/http': {
commonjs2: ['angular2', 'http']
},
'angular2/platform/browser': {
'@angular/platform-browser-dynamic': {
commonjs2: ['angular2', 'platform', 'browser']
},
'angular2/instrumentation': {
commonjs2: ['angular2', 'instrumentation']
},
}
],
module: {

View File

@ -3,7 +3,6 @@
ARG_DEFS=(
"--repository=(.*)"
"--directory=(.*)"
"[--depth=(.*)]"
"[--branch=(.*)]"
)
@ -13,13 +12,12 @@ function run {
echo "-- Cloning $REPOSITORY#$BRANCH to $DIRECTORY..."
ARGS="--branch=${BRANCH:-master}"
if [[ "$DEPTH" != "" ]]; then
ARGS="$ARGS --depth=$DEPTH"
else
ARGS="$ARGS --depth=2"
fi
git clone https://driftyco:$GH_TOKEN@github.com/$REPOSITORY $DIRECTORY $ARGS
ARGS="--branch=${BRANCH:-master} --depth=2"
git config --global user.email "hi@ionicframework.com"
git config --global user.name "Ionitron"
git clone git@github.com:driftyco/$REPOSITORY.git $DIRECTORY $ARGS
cd $DIRECTORY
git fetch origin --tags
cd ../

View File

@ -10,22 +10,23 @@ module.exports = function(config) {
frameworks: ['jasmine'],
files: [
'node_modules/es6-shim/es6-shim.min.js',
'node_modules/systemjs/node_modules/es6-module-loader/dist/es6-module-loader.js', //npm2
'node_modules/es6-module-loader/dist/es6-module-loader.js', //npm3
'node_modules/reflect-metadata/Reflect.js',
'node_modules/zone.js/dist/zone.js',
'node_modules/systemjs/dist/system.js',
'scripts/karma/system.config.js',
'node_modules/angular2/bundles/angular2-polyfills.min.js',
'node_modules/angular2/bundles/angular2.min.js',
'node_modules/angular2/bundles/router.min.js',
'node_modules/angular2/bundles/http.min.js',
'node_modules/rxjs/bundles/Rx.min.js',
'dist/bundles/ionic.system.js',
//'node_modules/angular2/bundles/test_lib.js',
{ pattern: 'node_modules/@angular/**/*.js', included: false},
{ pattern: 'dist/tests/**/*.spec.js', included: false },
{ pattern: 'src/**/*.js', included: false },
'scripts/karma/test-main.js'
],
exclude: ['ionic/components/*/test/*/**/*'],
exclude: ['src/components/*/test/*/**/*'],
logLevel: 'warn',

View File

@ -1,11 +1,60 @@
System.config({
baseURL: '/base',
map: {
'angular2': '/base/angular2',
'ionic-angular': '/base/ionic'
'ionic-angular': 'src',
'@angular': 'node_modules/@angular',
},
packages: {
'ionic-angular': {
main: 'index'
},
'rxjs': {
defaultExtension: 'js'
},
'@angular/core': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/compiler': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/common': {
main: 'index.js',
defaultExtension: 'js'
},
// remove after all tests imports are fixed
'@angular/facade': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/router': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/router-deprecated': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/http': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/upgrade': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser-dynamic': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-server': {
main: 'index.js',
defaultExtension: 'js'
}
}
});
});

View File

@ -4,8 +4,13 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 50;
// we will call `__karma__.start()` later, once all the specs are loaded.
__karma__.loaded = function() {};
System.import('angular2/src/platform/browser/browser_adapter').then(function(browser_adapter) {
browser_adapter.BrowserDomAdapter.makeCurrent();
System.import('@angular/core/testing').then(function(coreTesting) {
return System.import('@angular/platform-browser-dynamic/testing').then(function(browserTesting) {
coreTesting.setBaseTestProviders(
browserTesting.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
browserTesting.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS
);
});
}).then(function() {
return Promise.all(
Object.keys(window.__karma__.files) // All files served by Karma.

View File

@ -9,24 +9,21 @@ module.exports = {
},
externals: [
{
'angular2/core': {
'@angular/core': {
commonjs2: ['angular2', 'core']
},
'angular2/common': {
'@angular/common': {
commonjs2: ['angular2', 'common']
},
'angular2/router' : {
'@angular/router' : {
commonjs2: ['angular2', 'router']
},
'angular2/http': {
'@angular/http': {
commonjs2: ['angular2', 'http']
},
'angular2/platform/browser': {
'@angular/platform-browser': {
commonjs2: ['angular2', 'platform', 'browser']
},
'angular2/instrumentation': {
commonjs2: ['angular2', 'instrumentation']
},
}
]
};

View File

@ -16,6 +16,12 @@
"q": "1.4.1"
},
"peerDependencies": {
"angular2": "^<%= angularVersion %>"
"@angular/common": "^<%= angularVersion %>",
"@angular/compiler": "^<%= angularVersion %>",
"@angular/core": "^<%= angularVersion %>",
"@angular/platform-browser": "^<%= angularVersion %>",
"@angular/platform-browser-dynamic": "^<%= angularVersion %>",
"@angular/http": "^<%= angularVersion %>",
"@angular/router": "^<%= angularVersion %>"
}
}

View File

@ -11,7 +11,7 @@ exports.config = {
specs: 'dist/e2e/**/*e2e.js',
// specs: 'dist/e2e/button/**/*e2e.js',
sleepBetweenSpecs: 400,
sleepBetweenSpecs: 600,
platformDefauls: {
browser: 'chrome',

View File

@ -14,6 +14,7 @@
"components/checkbox/checkbox.ios",
"components/chip/chip.ios",
"components/content/content.ios",
"components/datetime/datetime.ios",
"components/input/input.ios",
"components/item/item.ios",
"components/label/label.ios",

View File

@ -5,6 +5,7 @@ export * from './components/badge/badge';
export * from './components/button/button';
export * from './components/checkbox/checkbox';
export * from './components/content/content';
export * from './components/datetime/datetime';
export * from './components/icon/icon';
export * from './components/img/img';
export * from './components/infinite-scroll/infinite-scroll';

View File

@ -1,5 +1,4 @@
import {Component, Renderer, ElementRef, HostListener, ChangeDetectionStrategy, ViewEncapsulation} from 'angular2/core';
import {NgFor, NgIf} from 'angular2/common';
import {Component, Renderer, ElementRef, HostListener, ViewEncapsulation} from '@angular/core';
import {Animation} from '../../animations/animation';
import {Transition, TransitionOptions} from '../../transitions/transition';
@ -222,17 +221,15 @@ export class ActionSheet extends ViewController {
'<div class="action-sheet-group">' +
'<div class="action-sheet-title" id="{{hdrId}}" *ngIf="d.title">{{d.title}}</div>' +
'<div class="action-sheet-sub-title" id="{{descId}}" *ngIf="d.subTitle">{{d.subTitle}}</div>' +
'<button category="action-sheet-button" (click)="click(b)" *ngFor="#b of d.buttons" class="disable-hover" [ngClass]="b.cssClass">' +
'<button category="action-sheet-button" (click)="click(b)" *ngFor="let b of d.buttons" class="disable-hover" [ngClass]="b.cssClass">' +
'<ion-icon [name]="b.icon" *ngIf="b.icon" class="action-sheet-icon"></ion-icon> ' +
'{{b.text}}' +
'<ion-button-effect></ion-button-effect>' +
'</button>' +
'</div>' +
'<div class="action-sheet-group" *ngIf="d.cancelButton">' +
'<button category="action-sheet-button" (click)="click(d.cancelButton)" class="action-sheet-cancel disable-hover" [ngClass]="d.cancelButton.cssClass">' +
'<ion-icon [name]="d.cancelButton.icon" *ngIf="d.cancelButton.icon" class="action-sheet-icon"></ion-icon> ' +
'{{d.cancelButton.text}}' +
'<ion-button-effect></ion-button-effect>' +
'</button>' +
'</div>' +
'</div>' +
@ -242,8 +239,6 @@ export class ActionSheet extends ViewController {
'[attr.aria-labelledby]': 'hdrId',
'[attr.aria-describedby]': 'descId'
},
directives: [NgFor, NgIf, Icon],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
})
class ActionSheetCmp {

View File

@ -1,4 +1,4 @@
import {App, Page, ActionSheet, Alert, Modal, NavController, ViewController, Platform} from 'ionic-angular';
import {App, Page, ActionSheet, Alert, Modal, NavController, ViewController, Platform} from '../../../../../src';
@Page({

View File

@ -55,6 +55,7 @@ $alert-ios-button-main-font-weight: bold !default;
$alert-ios-list-border-top: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color !default;
$alert-ios-radio-label-padding: 13px !default;
$alert-ios-radio-label-text-color-checked: $alert-ios-button-text-color !default;
$alert-ios-radio-min-width: 30px !default;
@ -68,6 +69,7 @@ $alert-ios-radio-icon-border-color: $alert-ios-button-text-color !de
$alert-ios-radio-icon-transform: rotate(45deg) !default;
$alert-ios-checkbox-label-padding: 13px !default;
$alert-ios-checkbox-label-text-color-checked: initial !default;
$alert-ios-checkbox-margin: 10px 6px 10px 16px !default;
$alert-ios-checkbox-size: 21px !default;
@ -178,7 +180,7 @@ $alert-ios-checkbox-icon-transform: rotate(45deg) !default;
}
// iOS Alert Radio
// iOS Alert Radio Label
// --------------------------------------------------
.alert-radio-label {
@ -194,6 +196,15 @@ $alert-ios-checkbox-icon-transform: rotate(45deg) !default;
white-space: nowrap;
}
// iOS Alert Radio Label: Checked
// --------------------------------------------------
.alert-radio[aria-checked=true] .alert-radio-label {
color: $alert-ios-radio-label-text-color-checked;
}
// iOS Alert Radio Checkmark: Unchecked
// -----------------------------------------
@ -205,12 +216,8 @@ $alert-ios-checkbox-icon-transform: rotate(45deg) !default;
min-width: $alert-ios-radio-min-width;
}
.alert-radio[aria-checked=true] {
color: $alert-ios-button-text-color;
}
// iOS Alert Radio Checkmark: Checked
// iOS Alert Radio Checked
// -----------------------------------------
.alert-radio[aria-checked=true] .alert-radio-inner {
@ -244,6 +251,9 @@ $alert-ios-checkbox-icon-transform: rotate(45deg) !default;
white-space: nowrap;
}
.alert-checkbox[aria-checked=true] .alert-checkbox-label {
color: $alert-ios-checkbox-label-text-color-checked;
}
// iOS Alert Checkbox Outer Circle: Unchecked
// -----------------------------------------

View File

@ -56,6 +56,7 @@ $alert-md-list-border-top: 1px solid $alert-md-input-border-c
$alert-md-list-border-bottom: $alert-md-list-border-top !default;
$alert-md-radio-label-padding: 13px 26px !default;
$alert-md-radio-label-text-color-checked: $alert-md-button-text-color !default;
$alert-md-radio-top: 0 !default;
$alert-md-radio-left: 13px !default;
@ -77,6 +78,7 @@ $alert-md-radio-icon-transform-on: scale3d(1, 1, 1) !default;
$alert-md-radio-icon-transition: transform 280ms cubic-bezier(.4, 0, .2, 1) !default;
$alert-md-checkbox-label-padding: 13px 26px !default;
$alert-md-checkbox-label-text-color-checked: initial !default;
$alert-md-checkbox-top: 0 !default;
$alert-md-checkbox-left: 13px !default;
@ -241,15 +243,19 @@ $alert-md-checkbox-icon-transform: rotate(45deg) !default;
// ---------------------------------------------------
.alert-radio[aria-checked=true] {
color: $alert-md-radio-border-color-on;
.alert-radio-label {
color: $alert-md-radio-label-text-color-checked;
}
.alert-radio-icon {
border-color: $alert-md-radio-border-color-on;
}
}
.alert-radio[aria-checked=true] .alert-radio-inner {
transform: $alert-md-radio-icon-transform-on;
.alert-radio-inner {
transform: $alert-md-radio-icon-transform-on;
}
}
@ -267,6 +273,10 @@ $alert-md-checkbox-icon-transform: rotate(45deg) !default;
white-space: nowrap;
}
.alert-checkbox[aria-checked=true] .alert-checkbox-label {
color: $alert-md-checkbox-label-text-color-checked;
}
// Material Design Alert Checkbox Outline: Unchecked
// --------------------------------------------------

View File

@ -1,5 +1,4 @@
import {Component, ElementRef, Renderer, HostListener, ChangeDetectionStrategy, ViewEncapsulation} from 'angular2/core';
import {NgClass, NgSwitch, NgIf, NgFor} from 'angular2/common';
import {Component, ElementRef, Renderer, HostListener, ViewEncapsulation} from '@angular/core';
import {Animation} from '../../animations/animation';
import {Transition, TransitionOptions} from '../../transitions/transition';
@ -323,7 +322,7 @@ export class Alert extends ViewController {
'<template ngSwitchWhen="radio">' +
'<div class="alert-radio-group" role="radiogroup" [attr.aria-labelledby]="hdrId" [attr.aria-activedescendant]="activeId">' +
'<button category="alert-radio-button" *ngFor="#i of d.inputs" (click)="rbClick(i)" [attr.aria-checked]="i.checked" [attr.id]="i.id" class="alert-tappable alert-radio" role="radio">' +
'<button category="alert-radio-button" *ngFor="let i of d.inputs" (click)="rbClick(i)" [attr.aria-checked]="i.checked" [attr.id]="i.id" class="alert-tappable alert-radio" role="radio">' +
'<div class="alert-radio-icon"><div class="alert-radio-inner"></div></div>' +
'<div class="alert-radio-label">' +
'{{i.label}}' +
@ -334,7 +333,7 @@ export class Alert extends ViewController {
'<template ngSwitchWhen="checkbox">' +
'<div class="alert-checkbox-group">' +
'<button category="alert-checkbox-button" *ngFor="#i of d.inputs" (click)="cbClick(i)" [attr.aria-checked]="i.checked" class="alert-tappable alert-checkbox" role="checkbox">' +
'<button category="alert-checkbox-button" *ngFor="let i of d.inputs" (click)="cbClick(i)" [attr.aria-checked]="i.checked" class="alert-tappable alert-checkbox" role="checkbox">' +
'<div class="alert-checkbox-icon"><div class="alert-checkbox-inner"></div></div>' +
'<div class="alert-checkbox-label">' +
'{{i.label}}' +
@ -345,7 +344,7 @@ export class Alert extends ViewController {
'<template ngSwitchDefault>' +
'<div class="alert-input-group">' +
'<div *ngFor="#i of d.inputs" class="alert-input-wrapper">' +
'<div *ngFor="let i of d.inputs" class="alert-input-wrapper">' +
'<input [placeholder]="i.placeholder" [(ngModel)]="i.value" [type]="i.type" class="alert-input">' +
'</div>' +
'</div>' +
@ -353,9 +352,8 @@ export class Alert extends ViewController {
'</div>' +
'<div class="alert-button-group" [ngClass]="{vertical: d.buttons.length>2}">' +
'<button category="alert-button" *ngFor="#b of d.buttons" (click)="btnClick(b)" [ngClass]="b.cssClass">' +
'<button category="alert-button" *ngFor="let b of d.buttons" (click)="btnClick(b)" [ngClass]="b.cssClass">' +
'{{b.text}}' +
'<ion-button-effect></ion-button-effect>' +
'</button>' +
'</div>' +
'</div>',
@ -364,8 +362,6 @@ export class Alert extends ViewController {
'[attr.aria-labelledby]': 'hdrId',
'[attr.aria-describedby]': 'descId'
},
directives: [NgClass, NgSwitch, NgIf, NgFor],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
})
class AlertCmp {

View File

@ -58,6 +58,7 @@ $alert-wp-radio-background: color($colors-wp, primary) !defau
$alert-wp-radio-border-color: $input-wp-border-color !default;
$alert-wp-radio-label-padding: 13px 26px !default;
$alert-wp-radio-label-text-color-checked: $alert-wp-button-text-color !default;
$alert-wp-radio-top: 0 !default;
$alert-wp-radio-left: 13px !default;
@ -75,6 +76,7 @@ $alert-wp-radio-icon-height: 8px !default;
$alert-wp-radio-icon-border-radius: $alert-wp-radio-border-radius !default;
$alert-wp-checkbox-label-padding: 13px 26px !default;
$alert-wp-checkbox-label-text-color-checked: initial !default;
$alert-wp-checkbox-top: 0 !default;
$alert-wp-checkbox-left: 13px !default;
@ -245,15 +247,17 @@ ion-alert {
// ---------------------------------------------------
.alert-radio[aria-checked=true] {
color: $alert-wp-button-text-color;
.alert-radio-label {
color: $alert-wp-radio-label-text-color-checked;
}
.alert-radio-icon {
border-color: $alert-wp-radio-border-color;
}
}
.alert-radio[aria-checked=true] .alert-radio-inner {
display: block;
.alert-radio-inner {
display: block;
}
}
@ -271,6 +275,10 @@ ion-alert {
white-space: nowrap;
}
.alert-checkbox[aria-checked=true] .alert-checkbox-label {
color: $alert-wp-checkbox-label-text-color-checked;
}
// Windows Alert Checkbox Outline: Unchecked
// --------------------------------------------------

View File

@ -1,4 +1,4 @@
import {App, Page, Alert, Modal, NavController, ViewController} from 'ionic-angular';
import {App, Page, Alert, Modal, NavController, ViewController} from '../../../../../src';
@Page({

Some files were not shown because too many files have changed in this diff Show More