├── .editorconfig
├── .gitignore
├── README.md
├── app
├── app.html
├── app.ts
├── components
│ └── post
│ │ ├── post.html
│ │ ├── post.scss
│ │ └── post.ts
├── pages
│ ├── category-list
│ │ ├── category-list.html
│ │ └── category-list.ts
│ ├── favorite
│ │ ├── favorite.html
│ │ └── favorite.ts
│ ├── post
│ │ ├── post.html
│ │ └── post.ts
│ ├── posts
│ │ ├── posts.html
│ │ └── posts.ts
│ ├── settings
│ │ ├── settings.html
│ │ └── settings.ts
│ ├── tabs
│ │ ├── tabs.html
│ │ └── tabs.ts
│ ├── wp-page-list
│ │ ├── wp-page-list.html
│ │ └── wp-page-list.ts
│ └── wp-page
│ │ ├── wp-page.html
│ │ └── wp-page.ts
├── pipes
│ └── htmlPipe.ts
├── providers
│ ├── constants.ts
│ ├── push-provider
│ │ └── push-provider.ts
│ ├── util-provider
│ │ └── util-provider.ts
│ └── wp-provider
│ │ └── wp-provider.ts
└── theme
│ ├── app.core.scss
│ ├── app.ios.scss
│ ├── app.md.scss
│ ├── app.variables.scss
│ └── app.wp.scss
├── config.xml
├── gulpfile.js
├── hooks
├── README.md
└── after_prepare
│ └── 010_add_platform_class.js
├── ionic.config.json
├── package.json
├── resources
├── android
│ ├── icon
│ │ ├── drawable-hdpi-icon.png
│ │ ├── drawable-ldpi-icon.png
│ │ ├── drawable-mdpi-icon.png
│ │ ├── drawable-xhdpi-icon.png
│ │ ├── drawable-xxhdpi-icon.png
│ │ └── drawable-xxxhdpi-icon.png
│ └── splash
│ │ ├── drawable-land-hdpi-screen.png
│ │ ├── drawable-land-ldpi-screen.png
│ │ ├── drawable-land-mdpi-screen.png
│ │ ├── drawable-land-xhdpi-screen.png
│ │ ├── drawable-land-xxhdpi-screen.png
│ │ ├── drawable-land-xxxhdpi-screen.png
│ │ ├── drawable-port-hdpi-screen.png
│ │ ├── drawable-port-ldpi-screen.png
│ │ ├── drawable-port-mdpi-screen.png
│ │ ├── drawable-port-xhdpi-screen.png
│ │ ├── drawable-port-xxhdpi-screen.png
│ │ └── drawable-port-xxxhdpi-screen.png
├── icon.png
├── ios
│ ├── icon
│ │ ├── icon-40.png
│ │ ├── icon-40@2x.png
│ │ ├── icon-50.png
│ │ ├── icon-50@2x.png
│ │ ├── icon-60.png
│ │ ├── icon-60@2x.png
│ │ ├── icon-60@3x.png
│ │ ├── icon-72.png
│ │ ├── icon-72@2x.png
│ │ ├── icon-76.png
│ │ ├── icon-76@2x.png
│ │ ├── icon-small.png
│ │ ├── icon-small@2x.png
│ │ ├── icon-small@3x.png
│ │ ├── icon.png
│ │ └── icon@2x.png
│ └── splash
│ │ ├── Default-568h@2x~iphone.png
│ │ ├── Default-667h.png
│ │ ├── Default-736h.png
│ │ ├── Default-Landscape-736h.png
│ │ ├── Default-Landscape@2x~ipad.png
│ │ ├── Default-Landscape~ipad.png
│ │ ├── Default-Portrait@2x~ipad.png
│ │ ├── Default-Portrait~ipad.png
│ │ ├── Default@2x~iphone.png
│ │ └── Default~iphone.png
└── splash.png
├── tsconfig.json
├── tslint.json
├── typings.json
├── typings
├── globals
│ └── es6-shim
│ │ ├── index.d.ts
│ │ └── typings.json
└── index.d.ts
└── www
└── index.html
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2 | # editorconfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | indent_style = space
8 | indent_size = 2
9 |
10 | # We recommend you to keep these unchanged
11 | end_of_line = lf
12 | charset = utf-8
13 | trim_trailing_whitespace = true
14 | insert_final_newline = true
15 |
16 | [*.md]
17 | trim_trailing_whitespace = false
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | www/build/
3 | platforms/
4 | plugins/
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Wordpress Client with Ionic 2
2 |
3 | # Steps to use
4 | * clone this repo
5 | * npm install
6 | * Install the required cordova plugins
7 | * Then ```ionic build android``` or ```ionic build ios```
8 |
9 | # Based on Ionic 2 Beta 10
--------------------------------------------------------------------------------
/app/app.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/app.ts:
--------------------------------------------------------------------------------
1 | import {ViewChild, Component} from '@angular/core';
2 | import {Platform,Nav, Storage, LocalStorage, ionicBootstrap} from 'ionic-angular';
3 | import {StatusBar, Network, GoogleAnalytics} from 'ionic-native';
4 | import {TabsPage} from './pages/tabs/tabs';
5 | import {CategoryListPage} from './pages/category-list/category-list';
6 | import {WpProvider} from './providers/wp-provider/wp-provider';
7 | import {PushProvider} from './providers/push-provider/push-provider';
8 | import {UtilProvider} from './providers/util-provider/util-provider';
9 | import {GOOGLE_ANALYTICS_ID} from './providers/constants';
10 |
11 | @Component({
12 | templateUrl: 'build/app.html',
13 | })
14 | class MyApp {
15 | @ViewChild(Nav) nav: Nav;
16 | rootPage: any = TabsPage;
17 | storage:Storage = new Storage(LocalStorage);
18 | settings = {};
19 | constructor(private platform: Platform, private push: PushProvider, public up: UtilProvider) {
20 | this.initializeApp();
21 | }
22 |
23 | initializeApp() {
24 | this.platform.ready().then(() => {
25 | let toast = this.up.getToast("You are not connected to Internet.");
26 | let disconnectSubscription = Network.onDisconnect().subscribe(() => {
27 | this.nav.present(toast);
28 | });
29 |
30 | GoogleAnalytics.startTrackerWithId(GOOGLE_ANALYTICS_ID);
31 | this.storage.get('settings')
32 | .then(data => {
33 | if(data === null) {
34 | let settings = {push: true, sort: 'desc'};
35 | this.storage.set('settings', JSON.stringify(settings));
36 | }
37 | });
38 |
39 | StatusBar.styleDefault();
40 | if(this.platform.is('mobile')) {
41 | this.push.init();
42 | }
43 | });
44 | }
45 | }
46 |
47 | ionicBootstrap(MyApp, [WpProvider,PushProvider, UtilProvider])
48 |
--------------------------------------------------------------------------------
/app/components/post/post.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{postData.title.rendered}}
5 | {{postData.date.substr(0,10)}}
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{authorData.name}}
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
25 |
26 |
27 |
31 |
32 |
33 |
34 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/components/post/post.scss:
--------------------------------------------------------------------------------
1 | .post-cmp {
2 | .post-title {
3 | text-align:center;
4 | background: #ECEFF1;
5 | color:#263238;
6 | .date {
7 | font-weight: bold;
8 | }
9 | }
10 | border-radius:1px;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/app/components/post/post.ts:
--------------------------------------------------------------------------------
1 | import {Component, Input,Output, EventEmitter, OnInit} from '@angular/core';
2 | import {Storage, LocalStorage} from 'ionic-angular';
3 | import {GoogleAnalytics} from 'ionic-native';
4 | import {HtmlPipe} from '../../pipes/htmlPipe';
5 | import {WpProvider} from '../../providers/wp-provider/wp-provider';
6 | import {SocialSharing} from 'ionic-native';
7 |
8 | @Component({
9 | selector: 'post',
10 | templateUrl: 'build/components/post/post.html',
11 | pipes: [HtmlPipe]
12 | })
13 |
14 | export class PostCmp {
15 | @Input() postData;
16 | @Output() read = new EventEmitter();
17 | @Output() favorite = new EventEmitter();
18 |
19 | featuredMedia = {};
20 | authorData = {};
21 | comments = [];
22 | favoriteList = [];
23 | constructor(public wp:WpProvider) {
24 | }
25 |
26 | ngOnInit() {
27 | this.authorData = this.postData["_embedded"].author[0];
28 | this.postData.featuredMedia = this.postData.featuredMedia || false;
29 | if(this.postData.featuredMedia) {
30 | this.postData.featuredMedia.subscribe(data => {
31 | this.featuredMedia = data;
32 | });
33 | }
34 |
35 | if(this.postData["_embedded"].replies) {
36 | this.comments = this.postData["_embedded"].replies[0];
37 | }
38 | }
39 |
40 | readBtn() {
41 | GoogleAnalytics.trackView(this.postData.link);
42 | this.read.emit({post: this.postData, author: this.authorData, media: this.featuredMedia, comments: this.comments});
43 | }
44 |
45 | favoriteBtn() {
46 | this.favorite.emit({post: this.postData, author: this.authorData, media: this.featuredMedia, comments: this.comments});
47 | }
48 |
49 | shareBtn() {
50 | let title = this.postData.title.rendered;
51 | let author = this.authorData['name'];
52 | let message = `Read this post on ${title} by ${author}.`;
53 | let url = this.postData.link;
54 |
55 | SocialSharing.share(message,"Read this post", null, url);
56 | }
57 |
58 |
59 | }
--------------------------------------------------------------------------------
/app/pages/category-list/category-list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Categories
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{category.name}}
11 | {{category.count}}
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/pages/category-list/category-list.ts:
--------------------------------------------------------------------------------
1 | import {Component} from '@angular/core';
2 | import {NavController} from 'ionic-angular';
3 | import {PostsPage} from '../posts/posts';
4 | import {WpProvider} from '../../providers/wp-provider/wp-provider';
5 | import {UtilProvider} from '../../providers/util-provider/util-provider/';
6 |
7 | @Component({
8 | templateUrl: 'build/pages/category-list/category-list.html',
9 | })
10 | export class CategoryListPage {
11 | list:Array;
12 | constructor(public nav:NavController, public wp:WpProvider, public up:UtilProvider) {
13 | let loader = this.up.getLoader("Loading Categories");
14 | this.nav.present(loader);
15 | this.wp.getCategories()
16 | .subscribe(data => {
17 | this.list = data;
18 | loader.dismiss();
19 | }, ()=> {
20 | loader.dismiss();
21 | })
22 |
23 | }
24 |
25 | openCategory(category) {
26 | this.nav.push(PostsPage, {"category": category});
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/pages/favorite/favorite.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Favorites
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | {{favorite.post.title.rendered}}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/pages/favorite/favorite.ts:
--------------------------------------------------------------------------------
1 | import {Component} from '@angular/core';
2 | import {Storage,LocalStorage, NavController} from 'ionic-angular';
3 | import {PostPage} from '../post/post';
4 |
5 | @Component({
6 | templateUrl: 'build/pages/favorite/favorite.html'
7 | })
8 | export class FavoritePage {
9 | favoriteList = [];
10 | storage = new Storage(LocalStorage);
11 | constructor(public nav:NavController) {}
12 |
13 | ionViewWillEnter() {
14 | this.storage.get('favorite')
15 | .then(data => {
16 | if(data !== null) {
17 | this.favoriteList = JSON.parse(data);
18 | }
19 | });
20 | }
21 |
22 | read(post) {
23 | this.nav.push(PostPage, {postData:post});
24 | }
25 |
26 | removeFavorite(index) {
27 | this.favoriteList.splice(index, 1);
28 | this.storage.set('favorite', this.favoriteList);
29 | }
30 | }
--------------------------------------------------------------------------------
/app/pages/post/post.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Post
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{postData.post.title.rendered}}
13 | {{postData.post.date.substr(0,10)}}
14 |
15 |
16 |
17 |
18 |
19 |
20 | {{postData.author.name}}
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | Comments
30 |
31 |
32 |
33 |
34 | {{comment.author_name}}
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/pages/post/post.ts:
--------------------------------------------------------------------------------
1 | import {Component} from '@angular/core';
2 | import {Page, NavController, NavParams} from 'ionic-angular';
3 | import {HtmlPipe} from '../../pipes/htmlPipe';
4 | @Component({
5 | templateUrl: 'build/pages/post/post.html',
6 | pipes: [HtmlPipe]
7 | })
8 | export class PostPage {
9 | postData:any;
10 | constructor(public nav:NavController, public params: NavParams) {
11 | this.postData = this.params.get('postData');
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/pages/posts/posts.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Posts
4 | {{category.name}}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/pages/posts/posts.ts:
--------------------------------------------------------------------------------
1 | import {Component} from '@angular/core';
2 | import {Control} from '@angular/common';
3 | import {NavController, NavParams, Modal, Storage, LocalStorage, Loading, Toast, Events} from 'ionic-angular';
4 | import {Observable} from 'rxjs/Rx';
5 | import {PostCmp} from '../../components/post/post';
6 | import {PostPage} from '../post/post';
7 | import {SettingsPage} from '../settings/settings';
8 | import {WpProvider} from '../../providers/wp-provider/wp-provider';
9 | import {UtilProvider} from '../../providers/util-provider/util-provider';
10 | import 'rxjs/add/operator/debounceTime';
11 | import 'rxjs/add/operator/filter';
12 | import 'rxjs/add/operator/distinctUntilChanged';
13 |
14 | @Component({
15 | templateUrl: 'build/pages/posts/posts.html',
16 | directives: [PostCmp]
17 | })
18 | export class PostsPage {
19 | hideSearch:Boolean = true;
20 | searchbar:Control = new Control();
21 | pageCount:number = 1;
22 | favoriteList = [];
23 | getData = true;
24 | sort:string;
25 | noMore:Boolean = false;
26 | posts:any;
27 | storage = new Storage(LocalStorage);
28 | category:any = {};
29 | query:{};
30 | constructor(public params:NavParams, public nav:NavController, public wp:WpProvider, public up:UtilProvider, public events: Events) {
31 | this.category = this.params.get('category');
32 |
33 | // Getting Favorite List
34 | this.storage.get('favorite')
35 | .then(data => {
36 | if(data === null) {
37 | data = "[]";
38 | }
39 | this.favoriteList = JSON.parse(data);
40 | });
41 |
42 | // Getting Settings
43 | this.storage.get('settings')
44 | .then(data => {
45 | this.sort = JSON.parse(data).sort;
46 | let query = this.createQuery();
47 | this.getPosts(query);
48 | });
49 |
50 |
51 | // Search Subscription
52 | this.searchbar.valueChanges
53 | .debounceTime(2000)
54 | .filter(value => value.length === 0 || value.trim().length > 2)
55 | .distinctUntilChanged()
56 | .subscribe((value)=> {
57 | this.resetSettings();
58 | let query = this.createQuery();
59 | this.getPosts(query);
60 | });
61 |
62 | // If Sort Order Changed
63 | this.events.subscribe("sort:changed", value => {
64 | this.resetSettings();
65 | this.sort = value;
66 | let query = this.createQuery();
67 | this.getPosts(query);
68 | });
69 | }
70 |
71 | getPosts(query) {
72 | let loader = this.up.getLoader("Loading Posts...");
73 | this.nav.present(loader);
74 | this.wp.getPosts(query)
75 | .subscribe(posts => {
76 | this.posts = posts;
77 | loader.dismiss();
78 | }, (error) => {
79 | loader.dismiss();
80 | });
81 |
82 | }
83 |
84 | loadMore(infinteScroll) {
85 | this.pageCount++;
86 | let query = this.createQuery();
87 |
88 | let toast = this.up.getToast("There are no more posts.");
89 | this.wp.getPosts(query)
90 | .subscribe(posts => {
91 | infinteScroll.complete();
92 | if(posts.length < 1) {
93 | this.noMore = true;
94 | infinteScroll.enable(!this.noMore);
95 | this.nav.present(toast);
96 | } else {
97 | this.posts = this.posts.concat(posts);
98 | }
99 | });
100 | }
101 |
102 | toggleSearch() {
103 | this.hideSearch = !this.hideSearch;
104 | }
105 |
106 | read(data) {
107 | this.nav.push(PostPage, {postData: data});
108 | }
109 |
110 | favorite(post) {
111 | let newPost:Boolean = true;
112 | let toast;
113 | let message:string;
114 | this.favoriteList.forEach(favPost => {
115 | if(JSON.stringify(favPost) === JSON.stringify(post)) {
116 | newPost = false;
117 | }
118 | });
119 |
120 | if(newPost) {
121 | this.favoriteList.push(post);
122 | this.storage.set('favorite', JSON.stringify(this.favoriteList));
123 | message = "This Post is saved in Favorite List";
124 | } else {
125 | message = "This Post is already in Favorite List";
126 | }
127 | toast = this.up.getToast(message);
128 | this.nav.present(toast);
129 | }
130 |
131 | openSettings() {
132 | this.nav.push(SettingsPage);
133 | }
134 |
135 | resetSettings() {
136 | this.noMore = false;
137 | this.pageCount = 1;
138 | }
139 |
140 | createQuery() {
141 | let query = {};
142 | query['page'] = this.pageCount;
143 | if(this.sort) {
144 | query['order'] = this.sort;
145 | }
146 | if(this.searchbar.value) {
147 | query['search'] = this.searchbar.value;
148 | }
149 | if(this.category) {
150 | query['categories'] = this.category.id;
151 | }
152 | return query;
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/app/pages/settings/settings.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Settings
4 |
5 |
6 |
7 |
8 |
9 |
10 | Push Notifications
11 |
12 |
13 |
14 |
15 | Posts Sorting
16 |
17 | Latest
18 | Oldest
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/pages/settings/settings.ts:
--------------------------------------------------------------------------------
1 | import {Component} from '@angular/core';
2 | import {ViewController, LocalStorage, Storage, Events} from 'ionic-angular';
3 | import {Control} from '@angular/common';
4 | import {PushProvider} from '../../providers/push-provider/push-provider';
5 | @Component({
6 | templateUrl: 'build/pages/settings/settings.html'
7 | })
8 | export class SettingsPage {
9 | pushToggle:Control = new Control();
10 | storage = new Storage(LocalStorage);
11 | settings:any;
12 | constructor(public pushProvider: PushProvider, public events:Events) {
13 | this.storage.get('settings')
14 | .then(data => {
15 | this.settings = JSON.parse(data);
16 | this.pushToggle.updateValue(this.settings.push);
17 | });
18 |
19 | this.pushToggle.valueChanges.skip(1)
20 | .subscribe(value => {
21 | this.changePush(value);
22 | });
23 | }
24 |
25 | saveSettings() {
26 | this.storage.set('settings', JSON.stringify(this.settings));
27 | }
28 |
29 | changeSort() {
30 | this.events.publish("sort:changed", this.settings.sort);
31 | this.saveSettings();
32 | }
33 |
34 | changePush(push) {
35 | if(push === true) {
36 | this.pushProvider.registerDevice()
37 | .then(() => {})
38 | } else {
39 | this.pushProvider.unregisterDevice()
40 | .then(() => {})
41 | }
42 | this.saveSettings();
43 | }
44 | }
--------------------------------------------------------------------------------
/app/pages/tabs/tabs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/pages/tabs/tabs.ts:
--------------------------------------------------------------------------------
1 | import {Component} from '@angular/core';
2 | import {CategoryListPage} from '../category-list/category-list';
3 | import {PostsPage} from '../posts/posts';
4 | import {FavoritePage} from '../favorite/favorite';
5 | import {WpPageList} from '../wp-page-list/wp-page-list';
6 |
7 | @Component({
8 | templateUrl: 'build/pages/tabs/tabs.html'
9 | })
10 | export class TabsPage {
11 | firstTab = PostsPage;
12 | secondTab = CategoryListPage;
13 | thirdTab = WpPageList;
14 | fourthTab = FavoritePage;
15 | }
--------------------------------------------------------------------------------
/app/pages/wp-page-list/wp-page-list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pages
4 |
5 |
6 |
7 |
8 |
9 | {{page.title.rendered}}
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/pages/wp-page-list/wp-page-list.ts:
--------------------------------------------------------------------------------
1 | import {Component} from '@angular/core';
2 | import {NavController} from 'ionic-angular';
3 | import {WpProvider} from '../../providers/wp-provider/wp-provider';
4 | import {UtilProvider} from '../../providers/util-provider/util-provider';
5 | import {WpPage} from '../wp-page/wp-page';
6 |
7 | @Component({
8 | templateUrl: 'build/pages/wp-page-list/wp-page-list.html'
9 | })
10 | export class WpPageList {
11 | pages:Array;
12 | constructor(public nav:NavController, public wp: WpProvider, public up: UtilProvider) {
13 | let loader = this.up.getLoader('Loading Pages ...');
14 | this.nav.present(loader);
15 | this.wp.getPages()
16 | .subscribe(pages => {
17 | this.pages = pages;
18 | loader.dismiss();
19 | }, ()=> {
20 | loader.dismiss();
21 | });
22 | }
23 |
24 | openPage(page) {
25 | this.nav.push(WpPage, {page: page});
26 | }
27 | }
--------------------------------------------------------------------------------
/app/pages/wp-page/wp-page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{page.title.rendered}}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/pages/wp-page/wp-page.ts:
--------------------------------------------------------------------------------
1 | import {Component} from '@angular/core';
2 | import {NavParams} from 'ionic-angular';
3 | import {HtmlPipe} from '../../pipes/htmlPipe';
4 | @Component({
5 | templateUrl: 'build/pages/wp-page/wp-page.html',
6 | pipes: [HtmlPipe]
7 | })
8 | export class WpPage {
9 | page:any;
10 | constructor(public params:NavParams) {
11 | this.page = this.params.get('page');
12 | }
13 | }
--------------------------------------------------------------------------------
/app/pipes/htmlPipe.ts:
--------------------------------------------------------------------------------
1 | import {Pipe, PipeTransform} from '@angular/core';
2 | @Pipe({
3 | name: 'htmlPipe'
4 | })
5 | export class HtmlPipe implements PipeTransform{
6 | transform(value:string, args) {
7 | if(args === "delete") {
8 | let test = value.match(" {
28 | this.storage.set('token', data.registrationId);
29 | this.registerDevice()
30 | .then(data => {});
31 | });
32 |
33 | this.push.on('notification', (data) => {
34 | console.log(data);
35 | });
36 | }
37 |
38 | transformRequest(obj) {
39 | let p, str;
40 | str = [];
41 | for (p in obj) {
42 | str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p]));
43 | }
44 | return str.join('&');
45 | }
46 |
47 | registerDevice() {
48 | let url = this.apiURL + '/pnfw/register';
49 | let os = Device.device.platform;
50 | return this.storage.get('token')
51 | .then(data => {
52 | let request = this.transformRequest({token: data, os: os});
53 | let headers = new Headers({'Content-Type':'application/x-www-form-urlencoded'});
54 | return this.http.post(url, request, {headers:headers}).toPromise();
55 | });
56 | }
57 |
58 | unregisterDevice() {
59 | let url = this.apiURL + '/pnfw/unregister';
60 | let os = Device.device.platform;
61 | return this.storage.get('token')
62 | .then(data => {
63 | let request = this.transformRequest({token: data, os: os});
64 | let headers = new Headers({'Content-Type':'application/x-www-form-urlencoded'});
65 | return this.http.post(url, request, {headers:headers}).toPromise();
66 | });
67 | }
68 | }
--------------------------------------------------------------------------------
/app/providers/util-provider/util-provider.ts:
--------------------------------------------------------------------------------
1 | import {Injectable} from '@angular/core';
2 | import {Loading, Toast} from 'ionic-angular';
3 |
4 | @Injectable()
5 | export class UtilProvider {
6 | getLoader(content) {
7 | let loading = Loading.create({
8 | content: content,
9 | duration: 3000
10 | });
11 | return loading;
12 | }
13 |
14 | getToast(message) {
15 | let toast = Toast.create({
16 | message: message,
17 | duration: 2000
18 | });
19 | return toast;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/providers/wp-provider/wp-provider.ts:
--------------------------------------------------------------------------------
1 | import {Injectable} from '@angular/core';
2 | import {Http} from '@angular/http';
3 | import {Observable} from 'rxjs/Rx';
4 | import 'rxjs/add/operator/map';
5 | import {SITE_URL} from '../constants';
6 |
7 | @Injectable()
8 | export class WpProvider {
9 | apiURL:string = SITE_URL + '/wp-json/wp/v2';
10 | constructor(public http:Http) {}
11 |
12 | getPosts(query) {
13 | query = this.transformRequest(query);
14 | let url = this.apiURL + `/posts?` + query + '&_embed';
15 | return this.http.get(url)
16 | .map(data => {
17 | let posts = data.json();
18 | posts.forEach(post => {
19 | if(post.featured_media) {
20 | post.featuredMedia = this.getMedia(post.featured_media);
21 | }
22 | });
23 | return posts;
24 | });
25 |
26 | }
27 |
28 | getMedia(id:number) {
29 | return this.http.get(this.apiURL + `/media/${id}`).map(data => data.json());
30 | }
31 |
32 | getPages() {
33 | return this.http.get(this.apiURL + '/pages').map(data => data.json());
34 | }
35 |
36 | getCategories() {
37 | return this.http.get(this.apiURL + '/categories').map(data => data.json());
38 | }
39 |
40 | transformRequest(obj) {
41 | let p, str;
42 | str = [];
43 | for (p in obj) {
44 | str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p]));
45 | }
46 | return str.join('&');
47 | }
48 |
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/app/theme/app.core.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/v2/theming/
2 |
3 |
4 | // App Shared Imports
5 | // --------------------------------------------------
6 | // These are the imports which make up the design of this app.
7 | // By default each design mode includes these shared imports.
8 | // App Shared Sass variables belong in app.variables.scss.
9 |
10 | @import '../components/post/post';
--------------------------------------------------------------------------------
/app/theme/app.ios.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/v2/theming/
2 |
3 |
4 | // App Shared Variables
5 | // --------------------------------------------------
6 | // Shared Sass variables go in the app.variables.scss file
7 | @import 'app.variables';
8 |
9 |
10 | // App iOS Variables
11 | // --------------------------------------------------
12 | // iOS only Sass variables can go here
13 |
14 |
15 | // Ionic iOS Sass
16 | // --------------------------------------------------
17 | // Custom App variables must be declared before importing Ionic.
18 | // Ionic will use its default values when a custom variable isn't provided.
19 | @import "ionic.ios";
20 |
21 |
22 | // App Shared Sass
23 | // --------------------------------------------------
24 | // All Sass files that make up this app goes into the app.core.scss file.
25 | // For simpler CSS overrides, custom app CSS must come after Ionic's CSS.
26 | @import 'app.core';
27 |
28 |
29 | // App iOS Only Sass
30 | // --------------------------------------------------
31 | // CSS that should only apply to the iOS app
32 |
--------------------------------------------------------------------------------
/app/theme/app.md.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/v2/theming/
2 |
3 |
4 | // App Shared Variables
5 | // --------------------------------------------------
6 | // Shared Sass variables go in the app.variables.scss file
7 | @import 'app.variables';
8 |
9 |
10 | // App Material Design Variables
11 | // --------------------------------------------------
12 | // Material Design only Sass variables can go here
13 |
14 |
15 | // Ionic Material Design Sass
16 | // --------------------------------------------------
17 | // Custom App variables must be declared before importing Ionic.
18 | // Ionic will use its default values when a custom variable isn't provided.
19 | @import "ionic.md";
20 |
21 |
22 | // App Shared Sass
23 | // --------------------------------------------------
24 | // All Sass files that make up this app goes into the app.core.scss file.
25 | // For simpler CSS overrides, custom app CSS must come after Ionic's CSS.
26 | @import 'app.core';
27 |
28 |
29 | // App Material Design Only Sass
30 | // --------------------------------------------------
31 | // CSS that should only apply to the Material Design app
32 |
--------------------------------------------------------------------------------
/app/theme/app.variables.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/v2/theming/
2 |
3 | // Ionic Shared Functions
4 | // --------------------------------------------------
5 | // Makes Ionic Sass functions available to your App
6 |
7 | @import 'globals.core';
8 |
9 | // App Shared Variables
10 | // --------------------------------------------------
11 | // To customize the look and feel of this app, you can override
12 | // the Sass variables found in Ionic's source scss files. Setting
13 | // variables before Ionic's Sass will use these variables rather than
14 | // Ionic's default Sass variable values. App Shared Sass imports belong
15 | // in the app.core.scss file and not this file. Sass variables specific
16 | // to the mode belong in either the app.ios.scss or app.md.scss files.
17 |
18 |
19 | // App Shared Color Variables
20 | // --------------------------------------------------
21 | // It's highly recommended to change the default colors
22 | // to match your app's branding. Ionic uses a Sass map of
23 | // colors so you can add, rename and remove colors as needed.
24 | // The "primary" color is the only required color in the map.
25 | // Both iOS and MD colors can be further customized if colors
26 | // are different per mode.
27 |
28 | $colors: (
29 | primary: #607D8B,
30 | secondary: #32db64,
31 | danger: #f53d3d,
32 | light: #f4f4f4,
33 | dark: #222,
34 | favorite: #69BB7B
35 | );
36 |
--------------------------------------------------------------------------------
/app/theme/app.wp.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/v2/theming/
2 |
3 |
4 | // App Shared Variables
5 | // --------------------------------------------------
6 | // Shared Sass variables go in the app.variables.scss file
7 | @import 'app.variables';
8 |
9 |
10 | // App Windows Variables
11 | // --------------------------------------------------
12 | // Windows only Sass variables can go here
13 |
14 |
15 | // Ionic Windows Sass
16 | // --------------------------------------------------
17 | // Custom App variables must be declared before importing Ionic.
18 | // Ionic will use its default values when a custom variable isn't provided.
19 | @import "ionic.wp";
20 |
21 |
22 | // App Shared Sass
23 | // --------------------------------------------------
24 | // All Sass files that make up this app goes into the app.core.scss file.
25 | // For simpler CSS overrides, custom app CSS must come after Ionic's CSS.
26 | @import 'app.core';
27 |
28 |
29 | // App Windows Only Sass
30 | // --------------------------------------------------
31 | // CSS that should only apply to the Windows app
32 |
--------------------------------------------------------------------------------
/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | beta10
4 | An Ionic Framework and Cordova project.
5 | Ionic Framework Team
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var gulp = require('gulp'),
2 | gulpWatch = require('gulp-watch'),
3 | del = require('del'),
4 | runSequence = require('run-sequence'),
5 | argv = process.argv;
6 |
7 |
8 | /**
9 | * Ionic hooks
10 | * Add ':before' or ':after' to any Ionic project command name to run the specified
11 | * tasks before or after the command.
12 | */
13 | gulp.task('serve:before', ['watch']);
14 | gulp.task('emulate:before', ['build']);
15 | gulp.task('deploy:before', ['build']);
16 | gulp.task('build:before', ['build']);
17 |
18 | // we want to 'watch' when livereloading
19 | var shouldWatch = argv.indexOf('-l') > -1 || argv.indexOf('--livereload') > -1;
20 | gulp.task('run:before', [shouldWatch ? 'watch' : 'build']);
21 |
22 | /**
23 | * Ionic Gulp tasks, for more information on each see
24 | * https://github.com/driftyco/ionic-gulp-tasks
25 | *
26 | * Using these will allow you to stay up to date if the default Ionic 2 build
27 | * changes, but you are of course welcome (and encouraged) to customize your
28 | * build however you see fit.
29 | */
30 | var buildBrowserify = require('ionic-gulp-browserify-typescript');
31 | var buildSass = require('ionic-gulp-sass-build');
32 | var copyHTML = require('ionic-gulp-html-copy');
33 | var copyFonts = require('ionic-gulp-fonts-copy');
34 | var copyScripts = require('ionic-gulp-scripts-copy');
35 | var tslint = require('ionic-gulp-tslint');
36 |
37 | var isRelease = argv.indexOf('--release') > -1;
38 |
39 | gulp.task('watch', ['clean'], function(done){
40 | runSequence(
41 | ['sass', 'html', 'fonts', 'scripts'],
42 | function(){
43 | gulpWatch('app/**/*.scss', function(){ gulp.start('sass'); });
44 | gulpWatch('app/**/*.html', function(){ gulp.start('html'); });
45 | buildBrowserify({ watch: true }).on('end', done);
46 | }
47 | );
48 | });
49 |
50 | gulp.task('build', ['clean'], function(done){
51 | runSequence(
52 | ['sass', 'html', 'fonts', 'scripts'],
53 | function(){
54 | buildBrowserify({
55 | minify: isRelease,
56 | browserifyOptions: {
57 | debug: !isRelease
58 | },
59 | uglifyOptions: {
60 | mangle: false
61 | }
62 | }).on('end', done);
63 | }
64 | );
65 | });
66 |
67 | gulp.task('sass', buildSass);
68 | gulp.task('html', copyHTML);
69 | gulp.task('fonts', copyFonts);
70 | gulp.task('scripts', copyScripts);
71 | gulp.task('clean', function(){
72 | return del('www/build');
73 | });
74 | gulp.task('lint', tslint);
75 |
--------------------------------------------------------------------------------
/hooks/README.md:
--------------------------------------------------------------------------------
1 |
21 | # Cordova Hooks
22 |
23 | Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. Hook scripts could be defined by adding them to the special predefined folder (`/hooks`) or via configuration files (`config.xml` and `plugin.xml`) and run serially in the following order:
24 | * Application hooks from `/hooks`;
25 | * Application hooks from `config.xml`;
26 | * Plugin hooks from `plugins/.../plugin.xml`.
27 |
28 | __Remember__: Make your scripts executable.
29 |
30 | __Note__: `.cordova/hooks` directory is also supported for backward compatibility, but we don't recommend using it as it is deprecated.
31 |
32 | ## Supported hook types
33 | The following hook types are supported:
34 |
35 | after_build/
36 | after_compile/
37 | after_docs/
38 | after_emulate/
39 | after_platform_add/
40 | after_platform_rm/
41 | after_platform_ls/
42 | after_plugin_add/
43 | after_plugin_ls/
44 | after_plugin_rm/
45 | after_plugin_search/
46 | after_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
47 | after_prepare/
48 | after_run/
49 | after_serve/
50 | before_build/
51 | before_compile/
52 | before_docs/
53 | before_emulate/
54 | before_platform_add/
55 | before_platform_rm/
56 | before_platform_ls/
57 | before_plugin_add/
58 | before_plugin_ls/
59 | before_plugin_rm/
60 | before_plugin_search/
61 | before_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
62 | before_plugin_uninstall/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being uninstalled
63 | before_prepare/
64 | before_run/
65 | before_serve/
66 | pre_package/ <-- Windows 8 and Windows Phone only.
67 |
68 | ## Ways to define hooks
69 | ### Via '/hooks' directory
70 | To execute custom action when corresponding hook type is fired, use hook type as a name for a subfolder inside 'hooks' directory and place you script file here, for example:
71 |
72 | # script file will be automatically executed after each build
73 | hooks/after_build/after_build_custom_action.js
74 |
75 |
76 | ### Config.xml
77 |
78 | Hooks can be defined in project's `config.xml` using `` elements, for example:
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | ...
89 |
90 |
91 |
92 |
93 |
94 |
95 | ...
96 |
97 |
98 | ### Plugin hooks (plugin.xml)
99 |
100 | As a plugin developer you can define hook scripts using `` elements in a `plugin.xml` like that:
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | ...
109 |
110 |
111 | `before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall` plugin hooks will be fired exclusively for the plugin being installed/uninstalled.
112 |
113 | ## Script Interface
114 |
115 | ### Javascript
116 |
117 | If you are writing hooks in Javascript you should use the following module definition:
118 | ```javascript
119 | module.exports = function(context) {
120 | ...
121 | }
122 | ```
123 |
124 | You can make your scipts async using Q:
125 | ```javascript
126 | module.exports = function(context) {
127 | var Q = context.requireCordovaModule('q');
128 | var deferral = new Q.defer();
129 |
130 | setTimeout(function(){
131 | console.log('hook.js>> end');
132 | deferral.resolve();
133 | }, 1000);
134 |
135 | return deferral.promise;
136 | }
137 | ```
138 |
139 | `context` object contains hook type, executed script full path, hook options, command-line arguments passed to Cordova and top-level "cordova" object:
140 | ```json
141 | {
142 | "hook": "before_plugin_install",
143 | "scriptLocation": "c:\\script\\full\\path\\appBeforePluginInstall.js",
144 | "cmdLine": "The\\exact\\command\\cordova\\run\\with arguments",
145 | "opts": {
146 | "projectRoot":"C:\\path\\to\\the\\project",
147 | "cordova": {
148 | "platforms": ["wp8"],
149 | "plugins": ["com.plugin.withhooks"],
150 | "version": "0.21.7-dev"
151 | },
152 | "plugin": {
153 | "id": "com.plugin.withhooks",
154 | "pluginInfo": {
155 | ...
156 | },
157 | "platform": "wp8",
158 | "dir": "C:\\path\\to\\the\\project\\plugins\\com.plugin.withhooks"
159 | }
160 | },
161 | "cordova": {...}
162 | }
163 |
164 | ```
165 | `context.opts.plugin` object will only be passed to plugin hooks scripts.
166 |
167 | You can also require additional Cordova modules in your script using `context.requireCordovaModule` in the following way:
168 | ```javascript
169 | var Q = context.requireCordovaModule('q');
170 | ```
171 |
172 | __Note__: new module loader script interface is used for the `.js` files defined via `config.xml` or `plugin.xml` only.
173 | For compatibility reasons hook files specified via `/hooks` folders are run via Node child_process spawn, see 'Non-javascript' section below.
174 |
175 | ### Non-javascript
176 |
177 | Non-javascript scripts are run via Node child_process spawn from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables:
178 |
179 | * CORDOVA_VERSION - The version of the Cordova-CLI.
180 | * CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios).
181 | * CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer)
182 | * CORDOVA_HOOK - Path to the hook that is being executed.
183 | * CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate)
184 |
185 | If a script returns a non-zero exit code, then the parent cordova command will be aborted.
186 |
187 | ## Writing hooks
188 |
189 | We highly recommend writing your hooks using Node.js so that they are
190 | cross-platform. Some good examples are shown here:
191 |
192 | [http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/)
193 |
194 | Also, note that even if you are working on Windows, and in case your hook scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example:
195 |
196 | #!/usr/bin/env [name_of_interpreter_executable]
197 |
--------------------------------------------------------------------------------
/hooks/after_prepare/010_add_platform_class.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | // Add Platform Class
4 | // v1.0
5 | // Automatically adds the platform class to the body tag
6 | // after the `prepare` command. By placing the platform CSS classes
7 | // directly in the HTML built for the platform, it speeds up
8 | // rendering the correct layout/style for the specific platform
9 | // instead of waiting for the JS to figure out the correct classes.
10 |
11 | var fs = require('fs');
12 | var path = require('path');
13 |
14 | var rootdir = process.argv[2];
15 |
16 | function addPlatformBodyTag(indexPath, platform) {
17 | // add the platform class to the body tag
18 | try {
19 | var platformClass = 'platform-' + platform;
20 | var cordovaClass = 'platform-cordova platform-webview';
21 |
22 | var html = fs.readFileSync(indexPath, 'utf8');
23 |
24 | var bodyTag = findBodyTag(html);
25 | if(!bodyTag) return; // no opening body tag, something's wrong
26 |
27 | if(bodyTag.indexOf(platformClass) > -1) return; // already added
28 |
29 | var newBodyTag = bodyTag;
30 |
31 | var classAttr = findClassAttr(bodyTag);
32 | if(classAttr) {
33 | // body tag has existing class attribute, add the classname
34 | var endingQuote = classAttr.substring(classAttr.length-1);
35 | var newClassAttr = classAttr.substring(0, classAttr.length-1);
36 | newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote;
37 | newBodyTag = bodyTag.replace(classAttr, newClassAttr);
38 |
39 | } else {
40 | // add class attribute to the body tag
41 | newBodyTag = bodyTag.replace('>', ' class="' + platformClass + ' ' + cordovaClass + '">');
42 | }
43 |
44 | html = html.replace(bodyTag, newBodyTag);
45 |
46 | fs.writeFileSync(indexPath, html, 'utf8');
47 |
48 | process.stdout.write('add to body class: ' + platformClass + '\n');
49 | } catch(e) {
50 | process.stdout.write(e);
51 | }
52 | }
53 |
54 | function findBodyTag(html) {
55 | // get the body tag
56 | try{
57 | return html.match(/])(.*?)>/gi)[0];
58 | }catch(e){}
59 | }
60 |
61 | function findClassAttr(bodyTag) {
62 | // get the body tag's class attribute
63 | try{
64 | return bodyTag.match(/ class=["|'](.*?)["|']/gi)[0];
65 | }catch(e){}
66 | }
67 |
68 | if (rootdir) {
69 |
70 | // go through each of the platform directories that have been prepared
71 | var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
72 |
73 | for(var x=0; x {
6 | done: boolean;
7 | value?: T;
8 | }
9 |
10 | interface IterableShim {
11 | /**
12 | * Shim for an ES6 iterable. Not intended for direct use by user code.
13 | */
14 | "_es6-shim iterator_"(): Iterator;
15 | }
16 |
17 | interface Iterator {
18 | next(value?: any): IteratorResult;
19 | return?(value?: any): IteratorResult;
20 | throw?(e?: any): IteratorResult;
21 | }
22 |
23 | interface IterableIteratorShim extends IterableShim, Iterator {
24 | /**
25 | * Shim for an ES6 iterable iterator. Not intended for direct use by user code.
26 | */
27 | "_es6-shim iterator_"(): IterableIteratorShim;
28 | }
29 |
30 | interface StringConstructor {
31 | /**
32 | * Return the String value whose elements are, in order, the elements in the List elements.
33 | * If length is 0, the empty string is returned.
34 | */
35 | fromCodePoint(...codePoints: number[]): string;
36 |
37 | /**
38 | * String.raw is intended for use as a tag function of a Tagged Template String. When called
39 | * as such the first argument will be a well formed template call site object and the rest
40 | * parameter will contain the substitution values.
41 | * @param template A well-formed template string call site representation.
42 | * @param substitutions A set of substitution values.
43 | */
44 | raw(template: TemplateStringsArray, ...substitutions: any[]): string;
45 | }
46 |
47 | interface String {
48 | /**
49 | * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
50 | * value of the UTF-16 encoded code point starting at the string element at position pos in
51 | * the String resulting from converting this object to a String.
52 | * If there is no element at that position, the result is undefined.
53 | * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
54 | */
55 | codePointAt(pos: number): number;
56 |
57 | /**
58 | * Returns true if searchString appears as a substring of the result of converting this
59 | * object to a String, at one or more positions that are
60 | * greater than or equal to position; otherwise, returns false.
61 | * @param searchString search string
62 | * @param position If position is undefined, 0 is assumed, so as to search all of the String.
63 | */
64 | includes(searchString: string, position?: number): boolean;
65 |
66 | /**
67 | * Returns true if the sequence of elements of searchString converted to a String is the
68 | * same as the corresponding elements of this object (converted to a String) starting at
69 | * endPosition – length(this). Otherwise returns false.
70 | */
71 | endsWith(searchString: string, endPosition?: number): boolean;
72 |
73 | /**
74 | * Returns a String value that is made from count copies appended together. If count is 0,
75 | * T is the empty String is returned.
76 | * @param count number of copies to append
77 | */
78 | repeat(count: number): string;
79 |
80 | /**
81 | * Returns true if the sequence of elements of searchString converted to a String is the
82 | * same as the corresponding elements of this object (converted to a String) starting at
83 | * position. Otherwise returns false.
84 | */
85 | startsWith(searchString: string, position?: number): boolean;
86 |
87 | /**
88 | * Returns an HTML anchor element and sets the name attribute to the text value
89 | * @param name
90 | */
91 | anchor(name: string): string;
92 |
93 | /** Returns a HTML element */
94 | big(): string;
95 |
96 | /** Returns a