diff --git a/demos/component-docs/actionSheet/actionSheet.html b/demos/component-docs/actionSheet/actionSheet.html new file mode 100644 index 0000000000..3a4444307f --- /dev/null +++ b/demos/component-docs/actionSheet/actionSheet.html @@ -0,0 +1,9 @@ + + Action Sheet + + + + + diff --git a/demos/component-docs/actionSheet/actionSheet.ts b/demos/component-docs/actionSheet/actionSheet.ts new file mode 100644 index 0000000000..749cc8f51b --- /dev/null +++ b/demos/component-docs/actionSheet/actionSheet.ts @@ -0,0 +1,64 @@ +import {IonicPlatform, IonicView, ActionSheet} from 'ionic/ionic'; + +@IonicView({ + templateUrl: 'actionSheet/actionSheet.html', +}) +export class ActionSheetPage { + + constructor(actionSheet: ActionSheet, platform: IonicPlatform) { + this.actionSheet = actionSheet; + this.platform = platform; + } + + openMenu() { + if (this.platform.is('android')) { + var androidSheet = { + + buttons: [ + { text: 'Share', icon: 'share' }, + { text: 'Play', icon: 'arrow-dropright-circle'}, + { text: 'Favorite', icon: 'ion-md-heart-outline'} + ], + destructiveText: 'Delete', + titleText: 'Purchased', + cancelText: 'Cancel', + cancel: function() { + console.log('Canceled'); + }, + destructiveButtonClicked: () => { + console.log('Destructive clicked'); + }, + buttonClicked: function(index) { + console.log('Button clicked', index); + if (index == 1) { return false; } + return true; + } + }; + } + + this.actionSheet.open(androidSheet || { + buttons: [ + { text: 'Share This' }, + { text: 'Move' } + ], + destructiveText: 'Delete', + titleText: 'You Opened Action Sheet', + cancelText: 'Cancel', + cancel: function() { + console.log('Canceled'); + }, + destructiveButtonClicked: () => { + console.log('Destructive clicked'); + }, + buttonClicked: function(index) { + console.log('Button clicked', index); + if (index == 1) { return false; } + return true; + } + + }).then(actionSheetRef => { + this.actionSheetRef = actionSheetRef; + }); + } + +} \ No newline at end of file diff --git a/demos/component-docs/buttons/block.html b/demos/component-docs/buttons/block.html new file mode 100644 index 0000000000..f5177f5944 --- /dev/null +++ b/demos/component-docs/buttons/block.html @@ -0,0 +1,26 @@ + + Block Buttons + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+
+ diff --git a/demos/component-docs/buttons/buttons.html b/demos/component-docs/buttons/buttons.html new file mode 100644 index 0000000000..56c7b8a8b3 --- /dev/null +++ b/demos/component-docs/buttons/buttons.html @@ -0,0 +1,27 @@ + + Buttons + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+
+ + diff --git a/demos/component-docs/buttons/buttons.ts b/demos/component-docs/buttons/buttons.ts new file mode 100644 index 0000000000..fb1880085a --- /dev/null +++ b/demos/component-docs/buttons/buttons.ts @@ -0,0 +1,73 @@ +import {IonicPlatform, IonicView} from 'ionic/ionic'; + +@IonicView({ + templateUrl: 'buttons/buttons.html', +}) +export class ButtonsPage { + constructor() { + + } +} + +@IonicView({ + templateUrl: 'buttons/block.html', +}) +export class BlockButtonsPage { + constructor() { + + } +} + +@IonicView({ + templateUrl: 'buttons/full.html', +}) +export class FullButtonsPage { + constructor() { + + } +} + +@IonicView({ + templateUrl: 'buttons/outline.html', +}) +export class OutlineButtonsPage { + constructor() { + + } +} + +@IonicView({ + templateUrl: 'buttons/round.html', +}) +export class RoundButtonsPage { + constructor() { + + } +} + +@IonicView({ + templateUrl: 'buttons/fab.html', +}) +export class FabPage { + constructor() { + + } +} + +@IonicView({ + templateUrl: 'buttons/sizes.html', +}) +export class ButtonSizesPage { + constructor() { + + } +} + +@IonicView({ + templateUrl: 'buttons/icons.html', +}) +export class IconButtonsPage { + constructor() { + + } +} \ No newline at end of file diff --git a/demos/component-docs/buttons/fab.html b/demos/component-docs/buttons/fab.html new file mode 100644 index 0000000000..15b7396b66 --- /dev/null +++ b/demos/component-docs/buttons/fab.html @@ -0,0 +1,15 @@ + + Floating Action Buttons + + + +

+ +

+
+ + + + diff --git a/demos/component-docs/buttons/full.html b/demos/component-docs/buttons/full.html new file mode 100644 index 0000000000..8c4efb0a51 --- /dev/null +++ b/demos/component-docs/buttons/full.html @@ -0,0 +1,29 @@ + + Full Buttons + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+
+ + + + diff --git a/demos/component-docs/buttons/icons.html b/demos/component-docs/buttons/icons.html new file mode 100644 index 0000000000..fcdf5ba799 --- /dev/null +++ b/demos/component-docs/buttons/icons.html @@ -0,0 +1,44 @@ + + + Icon Buttons + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +
+ + + + diff --git a/demos/component-docs/buttons/outline.html b/demos/component-docs/buttons/outline.html new file mode 100644 index 0000000000..9413d1aff9 --- /dev/null +++ b/demos/component-docs/buttons/outline.html @@ -0,0 +1,29 @@ + + Outline Buttons + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+
+ + + + diff --git a/demos/component-docs/buttons/round.html b/demos/component-docs/buttons/round.html new file mode 100644 index 0000000000..61be74abbb --- /dev/null +++ b/demos/component-docs/buttons/round.html @@ -0,0 +1,29 @@ + + Round Buttons + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+
+ + + + diff --git a/demos/component-docs/buttons/sizes.html b/demos/component-docs/buttons/sizes.html new file mode 100644 index 0000000000..b1d996a92d --- /dev/null +++ b/demos/component-docs/buttons/sizes.html @@ -0,0 +1,29 @@ + + Button Sizes + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+
+ + + + diff --git a/demos/component-docs/cards/cards.html b/demos/component-docs/cards/cards.html new file mode 100644 index 0000000000..f0de786baa --- /dev/null +++ b/demos/component-docs/cards/cards.html @@ -0,0 +1,62 @@ + + + Cards + + + + + + + Menu + + + + + + Home + + + + + Friends + + + + + + + + + + + + + + + Schedule + + + + + + + + + + Trophies + + + + + + + + + + diff --git a/demos/component-docs/cards/cards.ts b/demos/component-docs/cards/cards.ts new file mode 100644 index 0000000000..c48f892ab9 --- /dev/null +++ b/demos/component-docs/cards/cards.ts @@ -0,0 +1,10 @@ +import {IonicPlatform, IonicView} from 'ionic/ionic'; + +@IonicView({ + templateUrl: 'cards/cards.html', +}) +export class CardsPage { + constructor() { + + } +} \ No newline at end of file diff --git a/demos/component-docs/forms/forms.html b/demos/component-docs/forms/forms.html new file mode 100644 index 0000000000..aa18cfbe9a --- /dev/null +++ b/demos/component-docs/forms/forms.html @@ -0,0 +1,23 @@ + + Forms + + + +
+ + + + + + + + +
+ +
+
+
+ + + + diff --git a/demos/component-docs/forms/forms.ts b/demos/component-docs/forms/forms.ts new file mode 100644 index 0000000000..37a03c6ac5 --- /dev/null +++ b/demos/component-docs/forms/forms.ts @@ -0,0 +1,25 @@ +import {FORM_DIRECTIVES, FormBuilder, Validators, Control, ControlGroup} from 'angular2/forms'; +import {IonicView} from 'ionic/ionic'; + + +@IonicView({ + templateUrl: 'forms/forms.html', + bindings: [FormBuilder] +}) +export class FormsPage { + + constructor() { + this.form = new ControlGroup({ + firstName: new Control("", Validators.required), + lastName: new Control("", Validators.required) + }); + } + + processForm(event) { + // TODO: display input in a popup + console.log(event); + } + + +} + diff --git a/demos/component-docs/helpers.ts b/demos/component-docs/helpers.ts index 1f0bd7a166..e65f250883 100644 --- a/demos/component-docs/helpers.ts +++ b/demos/component-docs/helpers.ts @@ -1,3 +1,52 @@ +import {ActionSheetPage} from 'actionSheet/actionSheet'; + +import {ButtonsPage, + BlockButtonsPage, + FullButtonsPage, + OutlineButtonsPage, + RoundButtonsPage, + FabPage, + ButtonSizesPage, + IconButtonsPage} from 'buttons/buttons'; + +import {CardsPage} from 'cards/cards'; +import {FormsPage} from 'forms/forms'; +import {IconsPage} from 'icons/icons'; +import {ListsPage} from 'lists/lists'; +import {MenusPage} from 'menus/menus'; +import {ModalsPage} from 'modals/modals'; +import {NavigationPage} from 'navigation/navigation'; +import {PopupsPage} from 'popups/popups'; +import {SlidesPage} from 'slides/slides'; +import {TabsPage} from 'tabs/tabs'; + + export function toTitleCase(str) { return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); -} \ No newline at end of file +} + +export function getPageFor(hash) { + return { + 'action-sheets': ActionSheetPage, + 'buttons': ButtonsPage, + 'block-buttons': BlockButtonsPage, + 'full-buttons': FullButtonsPage, + 'outline-buttons': OutlineButtonsPage, + 'round-buttons': RoundButtonsPage, + 'floating-action-buttons': FabPage, + 'button-sizes': ButtonSizesPage, + 'icon-buttons': IconButtonsPage, + 'cards': CardsPage, + 'forms': FormsPage, + 'icons': IconsPage, + 'lists': ListsPage, + 'menus': MenusPage, + 'modals': ModalsPage, + 'navigation': NavigationPage, + 'popups': PopupsPage, + 'slides': SlidesPage, + 'tabs': TabsPage + }[hash] +} + + diff --git a/demos/component-docs/icons/icons.html b/demos/component-docs/icons/icons.html new file mode 100644 index 0000000000..f328076f9d --- /dev/null +++ b/demos/component-docs/icons/icons.html @@ -0,0 +1,78 @@ + + + Icons + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/component-docs/icons/icons.ts b/demos/component-docs/icons/icons.ts new file mode 100644 index 0000000000..02ca95dbe2 --- /dev/null +++ b/demos/component-docs/icons/icons.ts @@ -0,0 +1,10 @@ +import {IonicPlatform, IonicView} from 'ionic/ionic'; + +@IonicView({ + templateUrl: 'icons/icons.html', +}) +export class IconsPage { + constructor() { + + } +} \ No newline at end of file diff --git a/demos/component-docs/index.ts b/demos/component-docs/index.ts index 46226cc577..bc867c01b8 100644 --- a/demos/component-docs/index.ts +++ b/demos/component-docs/index.ts @@ -1,186 +1,33 @@ -import {FORM_DIRECTIVES, FormBuilder, Validators, Control, ControlGroup} from 'angular2/forms'; -import {App, IonicApp, IonicPlatform, ActionSheet, NavController, NavParams} from 'ionic/ionic'; -import {Popup, Modal, IonicView, IonicConfig, Events, Animation} from 'ionic/ionic'; -import {NavigationDetailsPage} from 'navigation'; - -import {TabsPage} from 'tabs'; -import {DemoModal} from 'modal'; +import {App, IonicApp, IonicPlatform, ActionSheet} from 'ionic/ionic'; +import {IonicView, IonicConfig, Events} from 'ionic/ionic'; +import {ActionSheetPage} from 'actionSheet/actionSheet'; import * as helpers from 'helpers'; -@IonicView({ - templateUrl: 'main.html', - bindings: [FormBuilder] +@App({ + template: '' }) -export class MainPage { +class DemoApp { - component: any = { title: 'Action Sheets' }; + constructor(app: IonicApp) { + this.app = app; + this.rootPage = ActionSheetPage; - constructor(app: IonicApp, - nav: NavController, - actionSheet: ActionSheet, - params: NavParams, - popup: Popup, - platform: IonicPlatform, - modal: Modal, - events: Events) { - this.params = params; - this.nav = nav; - this.platform = platform; - this.modal = modal; - this.popup = popup; - this.actionSheet = actionSheet; - this.navDetailsPage = NavigationDetailsPage; - this.demoModal = DemoModal; - this.form = new ControlGroup({ - firstName: new Control("", Validators.required), - lastName: new Control("", Validators.required) - }); - - if (params.data.location) { this.component.title = params.data.location; } - else if (window.location.hash) { this.component.title = window.location.hash; } + // if (params.data.location) { this.nextPage = helpers.getPageFor(params.data.location); } + // else if (window.location.hash) { this.nextPage = helpers.getPageFor(window.location.hash); } + // else { this.nextPage = helpers.getPageFor('action-sheet'); } window.addEventListener('message', (e) => { zone.run(() => { if (e.data) { var data = JSON.parse(e.data); - this.component.title = helpers.toTitleCase(data.hash.replace(/-/g, ' ')); - if (this.component.title === 'Tabs') { - this.nav.setRoot(TabsPage); - } + this.nextPage = helpers.getPageFor(data.hash); + this.title = helpers.toTitleCase(data.hash.replace(/-/g, ' ')); + let nav = this.app.getComponent('nav'); + nav.setRoot(this.nextPage); } }); }); - events.subscribe('page:locationChange', (data) => { - this.component.title = data[0].componentName; - }); - } - - // ************************** - // Action Sheets - // ************************** - openMenu() { - if (this.platform.is('android')) { - var androidSheet = { - - buttons: [ - { text: 'Share', icon: 'share' }, - { text: 'Play', icon: 'arrow-dropright-circle'}, - { text: 'Favorite', icon: 'ion-md-heart-outline'} - ], - destructiveText: 'Delete', - titleText: 'Purchased', - cancelText: 'Cancel', - cancel: function() { - console.log('Canceled'); - }, - destructiveButtonClicked: () => { - console.log('Destructive clicked'); - }, - buttonClicked: function(index) { - console.log('Button clicked', index); - if (index == 1) { return false; } - return true; - } - }; - } - - this.actionSheet.open(androidSheet || { - buttons: [ - { text: 'Share This' }, - { text: 'Move' } - ], - destructiveText: 'Delete', - titleText: 'You Opened Action Sheet', - cancelText: 'Cancel', - cancel: function() { - console.log('Canceled'); - }, - destructiveButtonClicked: () => { - console.log('Destructive clicked'); - }, - buttonClicked: function(index) { - console.log('Button clicked', index); - if (index == 1) { return false; } - return true; - } - - }).then(actionSheetRef => { - this.actionSheetRef = actionSheetRef; - }); - } - - // ************************** - // Navigation - // ************************** - openNavDetailsPage(item) { - this.nav.push(NavigationDetailsPage, { name: item }); - } - - - // ************************** - // Modal - // ************************** - openModal() { - this.modal.open(this.demoModal, { - handle: 'my-awesome-modal', - enterAnimation: 'my-fade-in', - leaveAnimation: 'my-fade-out' - }); - } - - // ************************** - // Popup - // ************************** - showPopup() { - this.popup.alert("Popup Title").then(() => { - }); - } - - - // ************************** - // Form - // ************************** - processForm(event) { - // TODO: display input in a popup - console.log(event); - } - -} - -class FadeIn extends Animation { - constructor(element) { - super(element); - this - .easing('ease') - .duration(450) - .fadeIn(); } } - -Animation.register('my-fade-in', FadeIn); - -class FadeOut extends Animation { - constructor(element) { - super(element); - this - .easing('ease') - .duration(250) - .fadeOut(); - } -} - -Animation.register('my-fade-out', FadeOut); - - -@App({ - template: '' -}) -class DemoApp { - - constructor() { - this.rootPage = MainPage; - } - -} diff --git a/demos/component-docs/lists/lists.html b/demos/component-docs/lists/lists.html new file mode 100644 index 0000000000..b8dc74a791 --- /dev/null +++ b/demos/component-docs/lists/lists.html @@ -0,0 +1,58 @@ + + + Lists + + + + + + + Classes + + + + + Dark Arts + + + + + Astronomy + + + + + Potions + + + + + Charms + + + + + + + + + Menu + + + + + Invisibility Cloak + + + + + Call Ron + Maybe later + + + + + + + + diff --git a/demos/component-docs/lists/lists.ts b/demos/component-docs/lists/lists.ts new file mode 100644 index 0000000000..66e78d0bfd --- /dev/null +++ b/demos/component-docs/lists/lists.ts @@ -0,0 +1,10 @@ +import {IonicPlatform, IonicView} from 'ionic/ionic'; + +@IonicView({ + templateUrl: 'lists/lists.html', +}) +export class ListsPage { + constructor() { + + } +} \ No newline at end of file diff --git a/demos/component-docs/menus/menus.html b/demos/component-docs/menus/menus.html new file mode 100644 index 0000000000..51705e2f64 --- /dev/null +++ b/demos/component-docs/menus/menus.html @@ -0,0 +1,12 @@ + + + Menus + + + + TODO + + + + + diff --git a/demos/component-docs/menus/menus.ts b/demos/component-docs/menus/menus.ts new file mode 100644 index 0000000000..bf6cbfa992 --- /dev/null +++ b/demos/component-docs/menus/menus.ts @@ -0,0 +1,10 @@ +import {IonicPlatform, IonicView} from 'ionic/ionic'; + +@IonicView({ + templateUrl: 'menus/menus.html', +}) +export class MenusPage { + constructor() { + + } +} \ No newline at end of file diff --git a/demos/component-docs/modal.html b/demos/component-docs/modal.html deleted file mode 100644 index dc34228232..0000000000 --- a/demos/component-docs/modal.html +++ /dev/null @@ -1 +0,0 @@ -

TODO

diff --git a/demos/component-docs/modal.ts b/demos/component-docs/modal.ts deleted file mode 100644 index 94089f578e..0000000000 --- a/demos/component-docs/modal.ts +++ /dev/null @@ -1,46 +0,0 @@ -import {App, IonicApp, Modal, NavController, IonicView, Events} from 'ionic/ionic'; -import * as helpers from 'helpers'; - -@IonicView({ - templateUrl: 'modal.html' -}) -class ModalFirstPage { - - constructor( - nav: NavController, - modal: Modal, - events: Events - ) { - this.nav = nav; - this.modal = modal; - window.onmessage = (e) => { - zone.run(() => { - if (e.data) { - var data = JSON.parse(e.data); - var componentTitle = helpers.toTitleCase(data.hash.replace('-', ' ')); - events.publish('page:locationChange', { componentName: componentTitle }); - this.closeModal(); - } - }); - }; - } - - closeModal() { - let modal = this.modal.get(); - if (modal) { - modal.close(); - } - } - -} - -@IonicView({ - template: '' -}) -export class DemoModal { - constructor() { - this.rootView = ModalFirstPage; - } -} - - diff --git a/demos/component-docs/modals/modals-content.html b/demos/component-docs/modals/modals-content.html new file mode 100644 index 0000000000..8d9c8d52d0 --- /dev/null +++ b/demos/component-docs/modals/modals-content.html @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/demos/component-docs/modals/modals.html b/demos/component-docs/modals/modals.html new file mode 100644 index 0000000000..572380a046 --- /dev/null +++ b/demos/component-docs/modals/modals.html @@ -0,0 +1,14 @@ + + + Modals + + + + + + + + + diff --git a/demos/component-docs/modals/modals.ts b/demos/component-docs/modals/modals.ts new file mode 100644 index 0000000000..4234adf900 --- /dev/null +++ b/demos/component-docs/modals/modals.ts @@ -0,0 +1,80 @@ +import {App, IonicApp, Animation, Modal, NavController, IonicView, Events} from 'ionic/ionic'; +import * as helpers from 'helpers'; + + +@IonicView({ + templateUrl: 'modals/modals.html' +}) +class ModalsFirstPage { + + constructor( + nav: NavController, + modal: Modal, + events: Events + ) { + this.nav = nav; + this.modal = modal; + } + + openModal() { + this.modal.open(ModalsContentPage, { + handle: 'my-awesome-modal', + enterAnimation: 'my-fade-in', + leaveAnimation: 'my-fade-out' + }); + } + +} + +@IonicView({ + templateUrl: 'modals/modals-content.html' +}) +class ModalsContentPage { + + constructor( + modal: Modal, + events: Events + ) { + this.modal = modal; + } + + closeModal() { + let modal = this.modal.get(); + if (modal) { + modal.close(); + } + } +} + +@IonicView({ + template: '' +}) +export class ModalsPage { + constructor() { + this.rootView = ModalsFirstPage; + } +} + +class FadeIn extends Animation { + constructor(element) { + super(element); + this + .easing('ease') + .duration(450) + .fadeIn(); + } +} + +Animation.register('my-fade-in', FadeIn); + +class FadeOut extends Animation { + constructor(element) { + super(element); + this + .easing('ease') + .duration(250) + .fadeOut(); + } +} + +Animation.register('my-fade-out', FadeOut); diff --git a/demos/component-docs/navigation.html b/demos/component-docs/navigation.html deleted file mode 100644 index 5d734ef310..0000000000 --- a/demos/component-docs/navigation.html +++ /dev/null @@ -1,8 +0,0 @@ - - - {{ selection.title }} - - - -{{ selection.content }} - \ No newline at end of file diff --git a/demos/component-docs/navigation/navigation-details.html b/demos/component-docs/navigation/navigation-details.html new file mode 100644 index 0000000000..d278f76b49 --- /dev/null +++ b/demos/component-docs/navigation/navigation-details.html @@ -0,0 +1,8 @@ + + + {{selection.title}} + + + + {{selection.content}} + \ No newline at end of file diff --git a/demos/component-docs/navigation/navigation.html b/demos/component-docs/navigation/navigation.html new file mode 100644 index 0000000000..3263158fdf --- /dev/null +++ b/demos/component-docs/navigation/navigation.html @@ -0,0 +1,30 @@ + + + Navigation + + + + + + + + Angular + + + + + CSS3 + + + + + + + + \ No newline at end of file diff --git a/demos/component-docs/navigation.ts b/demos/component-docs/navigation/navigation.ts similarity index 72% rename from demos/component-docs/navigation.ts rename to demos/component-docs/navigation/navigation.ts index 60f6a8b36c..5c5f5250e2 100644 --- a/demos/component-docs/navigation.ts +++ b/demos/component-docs/navigation/navigation.ts @@ -3,9 +3,9 @@ import {IonicView, Events} from 'ionic/ionic'; import * as helpers from 'helpers'; @IonicView({ - templateUrl: 'navigation.html' + templateUrl: 'navigation/navigation-details.html' }) -export class NavigationDetailsPage { +class NavigationDetailsPage { constructor(nav: NavController, params: NavParams, events: Events) { this.nav = nav; this.selection = { title: params.data.name }; @@ -23,16 +23,20 @@ export class NavigationDetailsPage { }; this.selection['content'] = navData[this.selection.title]; this.selection['icon'] = navIcons[this.selection.title]; - window.onmessage = (e) => { - zone.run(() => { - if (e.data) { - var data = JSON.parse(e.data); - var componentTitle = helpers.toTitleCase(data.hash.replace('-', ' ')); - events.publish('page:locationChange', { componentName: componentTitle }); - this.nav.pop(); - } - }); - }; - } +} + +@IonicView({ + templateUrl: 'navigation/navigation.html', +}) +export class NavigationPage { + + constructor(nav: NavController) { + this.nav = nav; + } + + openNavDetailsPage(item) { + this.nav.push(NavigationDetailsPage, { name: item }); + } + } \ No newline at end of file diff --git a/demos/component-docs/popups/popups.html b/demos/component-docs/popups/popups.html new file mode 100644 index 0000000000..1398388f0b --- /dev/null +++ b/demos/component-docs/popups/popups.html @@ -0,0 +1,10 @@ + + + Popups + + + + + diff --git a/demos/component-docs/popups/popups.ts b/demos/component-docs/popups/popups.ts new file mode 100644 index 0000000000..609975601b --- /dev/null +++ b/demos/component-docs/popups/popups.ts @@ -0,0 +1,16 @@ +import {IonicPlatform, IonicView, Popup} from 'ionic/ionic'; + +@IonicView({ + templateUrl: 'popups/popups.html', +}) +export class PopupsPage { + + constructor(popup: Popup) { + this.popup = popup; + } + + showPopup() { + this.popup.alert("Popup Title").then(() => { + }); + } +} \ No newline at end of file diff --git a/demos/component-docs/slides/slides.html b/demos/component-docs/slides/slides.html new file mode 100644 index 0000000000..08d81d2e51 --- /dev/null +++ b/demos/component-docs/slides/slides.html @@ -0,0 +1,24 @@ + + + Slides + + + + + +
+ Slide 1 +
+
+ +
+ Slide 2 +
+
+ +
+ Slide 3 +
+
+
+
diff --git a/demos/component-docs/slides/slides.ts b/demos/component-docs/slides/slides.ts new file mode 100644 index 0000000000..dfaf615154 --- /dev/null +++ b/demos/component-docs/slides/slides.ts @@ -0,0 +1,10 @@ +import {IonicPlatform, IonicView} from 'ionic/ionic'; + +@IonicView({ + templateUrl: 'slides/slides.html', +}) +export class SlidesPage { + constructor() { + + } +} \ No newline at end of file diff --git a/demos/component-docs/tabs.ts b/demos/component-docs/tabs.ts deleted file mode 100644 index 357ab55d72..0000000000 --- a/demos/component-docs/tabs.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {NavController, NavParams} from 'ionic/ionic'; -import {IonicView, ViewController, Events} from 'ionic/ionic'; -import {MainPage} from 'index'; -import * as helpers from 'helpers'; - -@IonicView({ - template: 'Hello 1', -}) -class TabOneCtrl { - constructor(nav: NavController, view: ViewController) { - this.nav = nav; - this.view = view; - } -} - -@IonicView({ - templateUrl: 'tabs.html' -}) -export class TabsPage { - constructor(nav: NavController, params: NavParams, events: Events) { - this.nav = nav; - this.TabOneRoot = TabOneCtrl; - window.onmessage = (e) => { - zone.run(() => { - if (e.data) { - var data = JSON.parse(e.data); - var componentTitle = helpers.toTitleCase(data.hash.replace('-', ' ')); - this.nav.setRoot(MainPage, {location: componentTitle}); - events.publish('page:locationChange', { componentName: componentTitle }); - } - }); - }; - - } -} \ No newline at end of file diff --git a/demos/component-docs/tabs.html b/demos/component-docs/tabs/tabs.html similarity index 82% rename from demos/component-docs/tabs.html rename to demos/component-docs/tabs/tabs.html index c6566ddd7f..f69ce0c9d0 100644 --- a/demos/component-docs/tabs.html +++ b/demos/component-docs/tabs/tabs.html @@ -4,7 +4,7 @@ - + diff --git a/demos/component-docs/tabs/tabs.ts b/demos/component-docs/tabs/tabs.ts new file mode 100644 index 0000000000..22e1a53966 --- /dev/null +++ b/demos/component-docs/tabs/tabs.ts @@ -0,0 +1,22 @@ +import {NavController, NavParams} from 'ionic/ionic'; +import {IonicView, ViewController} from 'ionic/ionic'; +import * as helpers from 'helpers'; + +@IonicView({ + template: 'Hello 1', +}) +class TabOneCtrl { + constructor(nav: NavController, view: ViewController) { + this.nav = nav; + this.view = view; + } +} + +@IonicView({ + templateUrl: 'tabs.html' +}) +export class TabsPage { + constructor(nav: NavController, params: NavParams) { + this.nav = nav; + } +} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 808c405ff8..5333b45dde 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -416,8 +416,8 @@ gulp.task('demos', function(){ gulp.task('demos:all', ['demos'], function() { return gulp - .src('dist/demos/component-docs/*') - .pipe(gulp.dest('dist/ionic-site/docs/v2/components/demo/')) + .src('dist/demos/component-docs/**/*') + .pipe(gulp.dest('dist/ionic-site/docs/v2/components/demo/')) }); gulp.task('publish', function(done) {