Merge branch 'master' into alpha38

Conflicts:
	ionic/components/search-bar/search-bar.ts
	ionic/config/decorators.ts
This commit is contained in:
Adam Bradley
2015-10-07 10:59:15 -05:00
9 changed files with 163 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
export * from 'ionic/components/app/app'
export * from 'ionic/components/app/id'
export * from 'ionic/components/action-sheet/action-sheet'
export * from 'ionic/components/blur/blur'
export * from 'ionic/components/button/button'
export * from 'ionic/components/card/card'
export * from 'ionic/components/checkbox/checkbox'

View File

@@ -0,0 +1,10 @@
import {Directive, Renderer, ElementRef} from 'angular2/angular2';
@Directive({
selector: '[ion-blur]'
})
export class Blur {
constructor(private elementRef: ElementRef, private renderer: Renderer) {
renderer.setElementStyle(elementRef, '-webkit-backdrop-filter', 'blur(10px)');
}
}

View File

@@ -1,3 +1,11 @@
/**
* @ngdoc service
* @name Config
* @module ionic
* @description
* IonicConfig allows you to set the modes of your components
*/
import {IonicPlatform} from '../platform/platform';
import {isObject, isDefined, isFunction, extend} from '../util/util';
@@ -18,6 +26,29 @@ export class IonicConfig {
/**
* For setting and getting multiple config values
*/
/**
* @name settings()
* @description
* IonicConfig lets you change multiple or a single value in an apps mode configuration. Things such as tab placement, icon changes, and view animations can be set here.
*
*
* @usage
* ```ts
* import {IonicConfig} from 'ionic/ionic';
* @App({
* template: `<ion-nav [root]="root"></ion-nav>`
* config: {
* backButtonText: 'Go Back',
* iconMode: 'ios',
* modalEnter: 'modal-slide-in',
* modalLeave: 'modal-slide-out',
* tabBarPlacement: 'bottom',
* viewTransition: 'ios',
* }
* })
* ```
*/
settings() {
const args = arguments;

View File

@@ -5,6 +5,7 @@ import {Menu} from '../components/menu/menu';
import {MenuToggle} from '../components/menu/menu-toggle';
import {MenuClose} from '../components/menu/menu-close';
import {Button} from '../components/button/button';
import {Blur} from '../components/blur/blur';
import {Content} from '../components/content/content';
import {Scroll} from '../components/scroll/scroll';
import {Refresher} from '../components/scroll/pull-to-refresh';
@@ -48,6 +49,7 @@ export const IONIC_DIRECTIVES = [
MenuClose,
Button,
Blur,
Content,
Scroll,
Refresher,

View File

@@ -1,3 +1,12 @@
/**
+* @ngdoc service
+* @name platform
+* @module ionic
+* @description
+* IonicPlatform returns the availble information about your current platform
+*/
import * as util from '../util/util';
import * as dom from '../util/dom';
@@ -20,17 +29,44 @@ export class IonicPlatform {
// **********************************************
/**
* TODO
* @param {TODO} platformName TODO
* @returns {TODO} TODO
* @param {string} platformName
* @returns {bool}
*
* ```
* import {IonicPlatform} 'ionic/ionic';
* export MyClass {
* constructor(platform: IonicPlatform){
* this.platform = platform;
* if(this.platform.is('ios'){
* // what ever you need to do for
* // if the platfomr is ios
* }
* }
* }
* ```
*/
is(platformName) {
return (this._platforms.indexOf(platformName) > -1);
}
/**
* TODO
* @returns {TODO} TODO
* @returns {array} the array of platforms
* @description
* Depending on what device you are on, `platforms` can return multiple values.
* Each possible value is a hierarchy of platforms. For example, on an iPhone,
* it would return mobile, ios, and iphone.
*
* ```
* import {IonicPlatform} 'ionic/ionic';
* export MyClass {
* constructor(platform: IonicPlatform){
* this.platform = platform;
* console.log(this.platform.platforms());
* // This will return an array of all the availble platforms
* // From if your on mobile, to mobile os, and device name
* }
* }
* ```
*/
platforms() {
// get the array of active platforms, which also knows the hierarchy,
@@ -40,8 +76,24 @@ export class IonicPlatform {
/**
* TODO
* @param {TODO} platformName TODO
* @returns {TODO} TODO
* @param {string} platformName
* @returns {object}
* @description
* Returns an object containing the os version
*
* ```
* import {IonicPlatform} 'ionic/ionic';
* export MyClass {
* constructor(platform: IonicPlatform){
* this.platform = platform;
* console.log(this.platform.versions('android'));
* // Returns an object with the os version as a string,
* // The Major version as a string
* // The Minor version as a string
* }
* }
* ```
*
*/
versions(platformName) {
if (arguments.length) {
@@ -55,7 +107,22 @@ export class IonicPlatform {
/**
* TODO
* @returns {TODO} TODO
* @returns {promise}
* @description
* Returns a promise when the platform is ready and native functionality can be called
*
* ```
* import {IonicPlatform} 'ionic/ionic';
* export MyClass {
* constructor(platform: IonicPlatform){
* this.platform = platform;
* this.platform.ready().then(() => {
* console.log('Platform ready');
* // The platform is now ready, execute any native code you want
* });
* }
* }
* ```
*/
ready() {
return this._readyPromise;