From 83bf7632f2d4d82c7c39bb1f5fb581dcdd4fe447 Mon Sep 17 00:00:00 2001 From: mhartington Date: Fri, 4 Dec 2015 13:14:09 -0500 Subject: [PATCH 1/5] docs(actionSheet): add detail options --- ionic/components/action-sheet/action-sheet.ts | 14 ++++++++++++-- scripts/docs/templates/common.template.html | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ionic/components/action-sheet/action-sheet.ts b/ionic/components/action-sheet/action-sheet.ts index 8c55137457..06f2152dc9 100644 --- a/ionic/components/action-sheet/action-sheet.ts +++ b/ionic/components/action-sheet/action-sheet.ts @@ -120,8 +120,18 @@ export class ActionSheet { * public API, and most often you will only use ActionSheet.open() * * @param {Object} [opts={}] An object containing optional settings. - * @param {String} [opts.pageType='action-sheet'] The page type that determines how the page renders and animates. - * @param {String} [opts.enterAnimation='action-sheet-slide-in'] The class used to animate an actionSheet that is entering. + * - `[Object]` `buttons` Which buttons to show. Each button is an object with a `text` field. + * - `{string}` `titleText` The title to show on the action sheet. + * - `{string=}` `cancelText` the text for a 'cancel' button on the action sheet. + * - `{string=}` `destructiveText` The text for a 'danger' on the action sheet. + * - `{function=}` `cancel` Called if the cancel button is pressed, the backdrop is tapped or + * the hardware back button is pressed. + * - `{function=}` `buttonClicked` Called when one of the non-destructive buttons is clicked, + * with the index of the button that was clicked and the button object. Return true to close + * the action sheet, or false to keep it opened. + * - `{function=}` `destructiveButtonClicked` Called when the destructive button is clicked. + * Return true to close the action sheet, or false to keep it opened. + * @param {String} [opts.enterAnimation='action-sheet-slide-in'] The class used to animate an actionSheet that is entering. * @param {String} [opts.leaveAnimation='action-sheet-slide-out'] The class used to animate an actionSheet that is leaving. * @return {Promise} Promise that resolves when the action sheet is open. */ diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index 6948c341ea..ed4cf04820 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -151,8 +151,8 @@ Delegate: <$ doc.delegate $> <@ endif -@> -

Usage

<@ if doc.usage @> +

Usage

<@ block usage @> <$ doc.usage | marked $> <@ endblock @> From fa295f9bbe4858f88b0ba83fd30abf77df9ff068 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Fri, 4 Dec 2015 12:51:44 -0600 Subject: [PATCH 2/5] fix(storage): bad defaults in options. Fixes #647 --- ionic/platform/storage/sql.ts | 36 ++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/ionic/platform/storage/sql.ts b/ionic/platform/storage/sql.ts index db30899b13..15d1397498 100644 --- a/ionic/platform/storage/sql.ts +++ b/ionic/platform/storage/sql.ts @@ -22,7 +22,7 @@ const DB_NAME = '__ionicstorage'; * }); * * // Sql storage also exposes the full engine underneath - * storage.query('insert into projects(name, data) values('Cool Project', 'blah');' + * storage.query('insert into projects(name, data) values('Cool Project', 'blah')'); * storage.query('select * from projects').then((resp) => {}) * ``` * @@ -39,7 +39,7 @@ export class SqlStorage extends StorageEngine { static BACKUP_LIBRARY = 1 static BACKUP_DOCUMENTS = 0 - constructor(options) { + constructor(options={}) { super(); let dbOptions = util.defaults(options, { @@ -98,19 +98,25 @@ export class SqlStorage extends StorageEngine { */ query(query, ...params) { return new Promise((resolve, reject) => { - this._db.transaction((tx) => { - tx.executeSql(query, params, (tx, res) => { - resolve({ - tx: tx, - res: res - }); - }, (tx, err) => { - reject({ - tx: tx, - err: err - }); - }) - }); + try { + this._db.transaction((tx) => { + tx.executeSql(query, params, (tx, res) => { + resolve({ + tx: tx, + res: res + }); + }, (tx, err) => { + reject({ + tx: tx, + err: err + }); + }) + }, err => { + reject(err); + }); + } catch(e) { + reject(e); + } }) } From 322d68f88609bdb825f54ccebf24710571f4c069 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Fri, 4 Dec 2015 12:51:53 -0600 Subject: [PATCH 3/5] Storage tesT --- ionic/components/app/test/storage/index.ts | 42 +++++++++++++++++++++ ionic/components/app/test/storage/main.html | 11 ++++++ 2 files changed, 53 insertions(+) create mode 100644 ionic/components/app/test/storage/index.ts create mode 100644 ionic/components/app/test/storage/main.html diff --git a/ionic/components/app/test/storage/index.ts b/ionic/components/app/test/storage/index.ts new file mode 100644 index 0000000000..1f34536d9c --- /dev/null +++ b/ionic/components/app/test/storage/index.ts @@ -0,0 +1,42 @@ +import {Component, Control, ControlGroup} from 'angular2/angular2'; + +import {App, Storage, LocalStorage, SqlStorage} from 'ionic/ionic'; + +@App({ + templateUrl: 'main.html' +}) +class IonicApp { + constructor() { + this.local = new Storage(LocalStorage); + this.sql = new Storage(SqlStorage); + } + getLocal() { + this.local.get('name').then(value => { + alert('Your name is: ' + value); + }); + } + setLocal() { + let name = prompt('Your name?'); + + this.local.set('name', name); + } + removeLocal() { + this.local.remove('name'); + } + + getSql() { + this.sql.get('name').then(value => { + alert('Your name is: ' + value); + }, (errResult) => { + console.error('Unable to get item from SQL db:', errResult); + }); + } + setSql() { + let name = prompt('Your name?'); + + this.sql.set('name', name); + } + removeSql() { + this.sql.remove('name'); + } +} diff --git a/ionic/components/app/test/storage/main.html b/ionic/components/app/test/storage/main.html new file mode 100644 index 0000000000..f675c1b570 --- /dev/null +++ b/ionic/components/app/test/storage/main.html @@ -0,0 +1,11 @@ + +

Local Storage

+ + + + +

SQL Storage

+ + + +
From 2c761a49489522abea19831190a8dd62b02fd2f8 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Fri, 4 Dec 2015 13:54:24 -0500 Subject: [PATCH 4/5] chore(publish): updating npm version to alpha.40 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 927fdcf1df..da676d7771 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ionic-framework", - "version": "2.0.0-alpha.39", + "version": "2.0.0-alpha.40", "license": "Apache-2.0", "repository": { "type": "git", From bc289cce8a97efea126662c75fe51273547dfb09 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Fri, 4 Dec 2015 14:04:04 -0500 Subject: [PATCH 5/5] fix(segment): fixed opacity of activated default segment in toolbar --- ionic/components/segment/modes/md.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/ionic/components/segment/modes/md.scss b/ionic/components/segment/modes/md.scss index 958a3b041d..ebec62ca90 100644 --- a/ionic/components/segment/modes/md.scss +++ b/ionic/components/segment/modes/md.scss @@ -44,6 +44,7 @@ ion-segment { ion-segment-button[button][outline].activated, ion-segment-button[button][outline].segment-activated { background-color: transparent; + opacity: 1; } }