From fa295f9bbe4858f88b0ba83fd30abf77df9ff068 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Fri, 4 Dec 2015 12:51:44 -0600 Subject: [PATCH 1/6] 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 2/6] 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 3/6] 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 4/6] 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; } } From 0b3e0e7c659e86a906bd9245bf98ac469ebb60b9 Mon Sep 17 00:00:00 2001 From: perry Date: Fri, 4 Dec 2015 13:27:09 -0600 Subject: [PATCH 5/6] docs(dgeni): setting API demo URL to be part of the meta data to be handled by jekyll --- scripts/docs/templates/common.template.html | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index ed4cf04820..35d6cb5476 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -9,6 +9,8 @@ title: "<@ if doc.docType == "directive" @><$ doc.name | dashCase $><@ else @><$ header_sub_title: "<$ doc.docType | capital $> in module <$ doc.module $>" doc: "<$ doc.name $>" docType: "<$ doc.docType $>" +<@- if doc.demo and false -@>show_preview_device: true +preview_device_url= "<$ doc.demo $>"<@- endif -@> --- @@ -84,24 +86,6 @@ docType: "<$ doc.docType $>" Improve this doc - - <@- if doc.demo and false -@> - - <@ endif @> - <@ block content @> @@ -252,4 +236,3 @@ Delegate: <$ doc.delegate $> <@ endblock @> - From 28bb668d43dd7e08b24c8183ff7932b690fbb60d Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Fri, 4 Dec 2015 13:55:26 -0600 Subject: [PATCH 6/6] docs(api): add links to component sections --- ionic/components/action-sheet/action-sheet.ts | 2 ++ ionic/components/button/button.ts | 2 ++ ionic/components/checkbox/checkbox.ts | 1 + ionic/components/icon/icon.ts | 1 + ionic/components/item/item.ts | 2 ++ ionic/components/list/list.ts | 1 + ionic/components/menu/menu-close.ts | 2 ++ ionic/components/menu/menu-toggle.ts | 2 ++ ionic/components/menu/menu-types.ts | 1 + ionic/components/menu/menu.ts | 4 ++++ ionic/components/modal/modal.ts | 1 + ionic/components/nav/nav-controller.ts | 1 + ionic/components/nav/nav-push.ts | 1 + ionic/components/nav/nav.ts | 1 + ionic/components/popup/popup.ts | 1 + ionic/components/radio/radio.ts | 4 +++- ionic/components/searchbar/searchbar.ts | 1 + ionic/components/segment/segment.ts | 2 ++ ionic/components/slides/slides.ts | 1 + ionic/components/switch/switch.ts | 1 + ionic/components/tabs/tabs.ts | 4 ++-- scripts/docs/templates/common.template.html | 3 +-- 22 files changed, 34 insertions(+), 5 deletions(-) diff --git a/ionic/components/action-sheet/action-sheet.ts b/ionic/components/action-sheet/action-sheet.ts index 06f2152dc9..50203083d7 100644 --- a/ionic/components/action-sheet/action-sheet.ts +++ b/ionic/components/action-sheet/action-sheet.ts @@ -106,6 +106,8 @@ class ActionSheetCmp { * * } * ``` + * + * @see {@link /docs/v2/components#action-sheets ActionSheet Component Docs} */ @Injectable() export class ActionSheet { diff --git a/ionic/components/button/button.ts b/ionic/components/button/button.ts index b181c992d5..b2022aad2a 100644 --- a/ionic/components/button/button.ts +++ b/ionic/components/button/button.ts @@ -26,6 +26,8 @@ import {Config} from '../../config/config'; * @property [fab-bottom] - position a fab button towards the bottom * @description * Buttons are simple components in Ionic, can consist of text, an icon, or both, and can be enhanced with a wide range of attributes. + * @see {@link /docs/v2/components#buttons Button Component Docs} + */ @Directive({ selector: 'button,[button]' diff --git a/ionic/components/checkbox/checkbox.ts b/ionic/components/checkbox/checkbox.ts index 38a56394ee..17704a8b86 100644 --- a/ionic/components/checkbox/checkbox.ts +++ b/ionic/components/checkbox/checkbox.ts @@ -17,6 +17,7 @@ import {Form} from '../../util/form'; * HTML5 * * ``` + * @see {@link /docs/v2/components#checkbox Checkbox Component Docs} */ @Component({ selector: 'ion-checkbox', diff --git a/ionic/components/icon/icon.ts b/ionic/components/icon/icon.ts index 0c675bac23..14a9b4b43c 100644 --- a/ionic/components/icon/icon.ts +++ b/ionic/components/icon/icon.ts @@ -13,6 +13,7 @@ import {Config} from '../../config/config'; * If there is not an outlined version for the particular icon, it will use the default (full) version. * @property {string} [ios] - Explicitly set the icon to use on iOS. * @property {string} [md] - Explicitly set the icon to use on Android. + * @see {@link /docs/v2/components#icons Icon Component Docs} * */ @Directive({ diff --git a/ionic/components/item/item.ts b/ionic/components/item/item.ts index 25bbff20ba..d89d9e181d 100644 --- a/ionic/components/item/item.ts +++ b/ionic/components/item/item.ts @@ -37,6 +37,8 @@ import {Component} from 'angular2/angular2'; * * * ``` + * @see {@link /docs/v2/components#lists List Component Docs} + * @see {@link ../../list/List List API Docs} */ @Component({ selector: 'ion-item,[ion-item]', diff --git a/ionic/components/list/list.ts b/ionic/components/list/list.ts index f8cbb9defd..d5e932bac2 100644 --- a/ionic/components/list/list.ts +++ b/ionic/components/list/list.ts @@ -16,6 +16,7 @@ import * as util from 'ionic/util'; * Using the List and Item components make it easy to support various * interaction modes such as swipe to edit, drag to reorder, and removing items. * @demo /docs/v2/demos/list/ + * @see {@link /docs/v2/components#lists List Component Docs} * * */ diff --git a/ionic/components/menu/menu-close.ts b/ionic/components/menu/menu-close.ts index 56ac93df47..ea68257162 100644 --- a/ionic/components/menu/menu-close.ts +++ b/ionic/components/menu/menu-close.ts @@ -6,6 +6,8 @@ import {IonicApp} from '../app/app'; /** * TODO +* @see {@link /docs/v2/components#menus Menu Component Docs} +* @see {@link ../../menu/Menu Menu API Docs} */ @Directive({ selector: '[menu-close]', diff --git a/ionic/components/menu/menu-toggle.ts b/ionic/components/menu/menu-toggle.ts index ea9bff80ad..6f1fdb3e35 100644 --- a/ionic/components/menu/menu-toggle.ts +++ b/ionic/components/menu/menu-toggle.ts @@ -8,6 +8,8 @@ import {Navbar} from '../navbar/navbar'; /** * TODO +* @see {@link /docs/v2/components#menus Menu Component Docs} +* @see {@link ../../menu/Menu Menu API Docs} */ @Directive({ selector: '[menu-toggle]', diff --git a/ionic/components/menu/menu-types.ts b/ionic/components/menu/menu-types.ts index 094cc6c8f9..db1e7614a4 100644 --- a/ionic/components/menu/menu-types.ts +++ b/ionic/components/menu/menu-types.ts @@ -7,6 +7,7 @@ import {Animation} from 'ionic/animations/animation'; * Base class which is extended by the various types. Each * type will provide their own animations for open and close * and registers itself with Menu. + * @private */ export class MenuType { diff --git a/ionic/components/menu/menu.ts b/ionic/components/menu/menu.ts index a00c3e6aea..39fc69c370 100644 --- a/ionic/components/menu/menu.ts +++ b/ionic/components/menu/menu.ts @@ -42,6 +42,10 @@ import * as gestures from './menu-gestures'; * ```html * * ``` + * @see {@link /docs/v2/components#menus Menu Component Docs} + * @see {@link /docs/v2/components#navigation Navigation Component Docs} + * @see {@link ../../nav/Nav Nav API Docs} + * */ @Component({ selector: 'ion-menu', diff --git a/ionic/components/modal/modal.ts b/ionic/components/modal/modal.ts index 8baae9ab48..604966fe81 100644 --- a/ionic/components/modal/modal.ts +++ b/ionic/components/modal/modal.ts @@ -33,6 +33,7 @@ import {extend} from 'ionic/util'; * * } * ``` + * @see {@link /docs/v2/components#modals Modal Component Docs} */ @Injectable() export class Modal { diff --git a/ionic/components/nav/nav-controller.ts b/ionic/components/nav/nav-controller.ts index 50f7caae31..aba79056be 100644 --- a/ionic/components/nav/nav-controller.ts +++ b/ionic/components/nav/nav-controller.ts @@ -97,6 +97,7 @@ import {raf, rafFrames} from '../../util/dom'; * - `onPageWillUnload` - Runs when the page is about to be destroyed and have its elements removed. * - `onPageDidUnload` - Runs after the page has been destroyed and its elements have been removed. * + * @see {@link /docs/v2/components#navigation Navigation Component Docs} */ export class NavController extends Ion { diff --git a/ionic/components/nav/nav-push.ts b/ionic/components/nav/nav-push.ts index c33fd21f35..4f5038d29b 100644 --- a/ionic/components/nav/nav-push.ts +++ b/ionic/components/nav/nav-push.ts @@ -36,6 +36,7 @@ import {NavRegistry} from './nav-registry'; * ```html * * ``` + * @see {@link /docs/v2/components#navigation Navigation Component Docs} */ @Directive({ selector: '[nav-push]', diff --git a/ionic/components/nav/nav.ts b/ionic/components/nav/nav.ts index 757871d8ff..92259c920c 100644 --- a/ionic/components/nav/nav.ts +++ b/ionic/components/nav/nav.ts @@ -96,6 +96,7 @@ import {ViewController} from './view-controller'; * * * + * @see {@link /docs/v2/components#navigation Navigation Component Docs} */ @ConfigComponent({ selector: 'ion-nav', diff --git a/ionic/components/popup/popup.ts b/ionic/components/popup/popup.ts index ae812f5e87..125197776e 100644 --- a/ionic/components/popup/popup.ts +++ b/ionic/components/popup/popup.ts @@ -61,6 +61,7 @@ import {extend} from '../../util/util'; * } * } * ``` + * @see {@link /docs/v2/components#popups Popup Component Docs} */ @Injectable() export class Popup { diff --git a/ionic/components/radio/radio.ts b/ionic/components/radio/radio.ts index 7c674e89c9..b331ff4615 100644 --- a/ionic/components/radio/radio.ts +++ b/ionic/components/radio/radio.ts @@ -40,6 +40,7 @@ import {ListHeader} from '../list/list'; * * * ``` + * @see {@link /docs/v2/components#radio Radio Component Docs} */ @Directive({ selector: '[radio-group]', @@ -161,7 +162,8 @@ export class RadioGroup extends Ion { * Radio Label * * ``` - * + * + * @see {@link /docs/v2/components#radio Radio Component Docs} */ @Component({ selector: 'ion-radio', diff --git a/ionic/components/searchbar/searchbar.ts b/ionic/components/searchbar/searchbar.ts index cdea0b3d9c..cb69280e8a 100644 --- a/ionic/components/searchbar/searchbar.ts +++ b/ionic/components/searchbar/searchbar.ts @@ -20,6 +20,7 @@ import {Icon} from '../icon/icon'; * @property [show-cancel] - shows the cancel button based on boolean value passed in * @property [cancel-text] - sets the cancel button text to the value passed in * @property [cancel-action] - the function that gets called by clicking the cancel button + * @see {@link /docs/v2/components#search Search Component Docs} */ @ConfigComponent({ selector: 'ion-searchbar', diff --git a/ionic/components/segment/segment.ts b/ionic/components/segment/segment.ts index 523e71f4d5..b53c2c4dd3 100644 --- a/ionic/components/segment/segment.ts +++ b/ionic/components/segment/segment.ts @@ -36,6 +36,8 @@ import {Config} from '../../config/config'; * * * ``` + * + * @see {@link /docs/v2/components#segment Segment Component Docs} */ @Directive({ selector: 'ion-segment' diff --git a/ionic/components/slides/slides.ts b/ionic/components/slides/slides.ts index 045352be2f..9b54f15a0e 100644 --- a/ionic/components/slides/slides.ts +++ b/ionic/components/slides/slides.ts @@ -27,6 +27,7 @@ import {Scroll} from '../scroll/scroll'; * * Licensed under MIT * + * @see {@link /docs/v2/components#slides Slides Component Docs} */ @Component({ selector: 'ion-slides', diff --git a/ionic/components/switch/switch.ts b/ionic/components/switch/switch.ts index 6315b0fc09..c4d18729b6 100644 --- a/ionic/components/switch/switch.ts +++ b/ionic/components/switch/switch.ts @@ -64,6 +64,7 @@ class MediaSwitch { * * ``` * + * @see {@link /docs/v2/components#switch Switch Component Docs} */ @Component({ selector: 'ion-switch', diff --git a/ionic/components/tabs/tabs.ts b/ionic/components/tabs/tabs.ts index 4c5741fbdb..67aa6f9cc4 100644 --- a/ionic/components/tabs/tabs.ts +++ b/ionic/components/tabs/tabs.ts @@ -31,8 +31,8 @@ import {rafFrames} from '../../util/dom'; * individual Tab components. On iOS, the TabBar is placed on the bottom of * the screen, while on Android it is at the top. * - * See the [Tab API reference](../Tab/) for more details on individual Tab components. - * + * @see {@link /docs/v2/components#tabs Tabs Component Docs} + * @see {@link ../Tab Tab API Docs} */ @ConfigComponent({ selector: 'ion-tabs', diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index 35d6cb5476..0ef2b20331 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -222,8 +222,7 @@ Delegate: <$ doc.delegate $> <@- if doc.see @> -

Related

- +

Related

<@ for s in doc.see @> <$ s | safe $> <@- endfor -@>