Skip to content

Commit 62100e2

Browse files
committed
cvb
2 parents 52f3ff0 + 6a76068 commit 62100e2

File tree

139 files changed

+5050
-19797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+5050
-19797
lines changed

README.md

Lines changed: 1 addition & 217 deletions
Original file line numberDiff line numberDiff line change
@@ -1,217 +1 @@
1-
# react.cordova-navigation_controller
2-
3-
## Plugin for react
4-
It's manager for your pages like mobile app.<br>
5-
6-
#### `import Navigator from './mobile-navigation-controller';`
7-
8-
<br>
9-
For example:
10-
In the render function return
11-
12-
```
13-
<Navigator onRef={ref => (this.navigatorRef = ref)} >
14-
15-
16-
<MyHomePage key="home" levelPage={0} />
17-
18-
<AboutPage key="about"
19-
levelPage={1}
20-
/>
21-
22-
23-
</Navigator>
24-
```
25-
**Note: prop `levelPage` important to manage the returs (from back button) in the structure of a tree**<br><br>
26-
27-
28-
29-
30-
To change page you get the ref and do:
31-
#### `this.navigatorRef.changePage("about");`
32-
the option to changePage it's:
33-
```
34-
this.navigatorRef.changePage(
35-
goToPage //Required
36-
,{options}// Not requred
37-
);
38-
```
39-
options => { animationIn:integer // have defult
40-
, animationOut:string // have defult
41-
, timeAnimationInMS:integer // defult=250(ms)
42-
, callbackFun:function
43-
, props:{...}
44-
}
45-
46-
*`animationIn` and `animationOut` need name animate from [here](https://daneden.github.io/animate.css/) <br>
47-
*the animate.css includ in this package
48-
49-
## Options:
50-
51-
### Navigator props
52-
53-
54-
<table>
55-
<thead>
56-
<tr>
57-
<th>prop</th>
58-
<th>type</th>
59-
<th>required</th>
60-
<th>defult</th>
61-
<th>node</th>
62-
</tr>
63-
</thead>
64-
<tbody>
65-
<tr>
66-
<td>onRef</td>
67-
<td></td>
68-
<td>required</td>
69-
<td>-</td>
70-
<td> onRef={ref => (this.navigatorRef = ref)} </td>
71-
</tr>
72-
<tr>
73-
<td>key</td>
74-
<td>string</td>
75-
<td>required</td>
76-
<td>-</td>
77-
<td></td>
78-
</tr>
79-
<tr>
80-
<td>height</td>
81-
<td>string or integer</td>
82-
<td>optional</td>
83-
<td>"100%"</td>
84-
<td></td>
85-
</tr>
86-
<tr>
87-
<td>onChangePage</td>
88-
<td>function</td>
89-
<td>optional</td>
90-
<td>-</td>
91-
<td>(nowPageKey,levelAction) => { ... }</td>
92-
</tr>
93-
<tr>
94-
<td>beforChangePage</td>
95-
<td>function</td>
96-
<td>optional</td>
97-
<td>-</td>
98-
<td>(goToPageKey,levelAction) => { ... }</td>
99-
</tr>
100-
<tr>
101-
<tr>
102-
<td>changeRoute</td>
103-
<td>boolean</td>
104-
<td>optional</td>
105-
<td>true (on cordova native platforms => false)</td>
106-
<td>Determines whether to change the URL to the component key</td>
107-
</tr>
108-
<td>homePageKey</td>
109-
<td>string</td>
110-
<td>optional</td>
111-
<td>The key of the first child</td>
112-
<td>(nowPageKey,levelAction) => { ... }</td>
113-
</tr>
114-
</tbody>
115-
</table>
116-
*levelAction return "Out" or "In" or "SameLevel"
117-
118-
119-
120-
### Child props
121-
122-
123-
<table>
124-
<thead>
125-
<tr>
126-
<th>prop</th>
127-
<th>type</th>
128-
<th>required</th>
129-
<th>defult</th>
130-
<th>node</th>
131-
</tr>
132-
</thead>
133-
<tbody>
134-
<tr>
135-
<td>levelPage</td>
136-
<td>integer</td>
137-
<td>required</td>
138-
<td>-</td>
139-
<td>important!</td>
140-
</tr>
141-
<tr>
142-
<td>backgroundColor</td>
143-
<td>string</td>
144-
<td>optional</td>
145-
<td>#fff</td>
146-
<td></td>
147-
</tr>
148-
<tr>
149-
<td>height</td>
150-
<td>string or integer</td>
151-
<td>optional</td>
152-
<td>"100%"</td>
153-
<td></td>
154-
</tr>
155-
<tr>
156-
<td>backOnSwipeRight</td>
157-
<td>boolean</td>
158-
<td>optional</td>
159-
<td>false</td>
160-
<td>May be problematic with css "padding-left" </td>
161-
</tr>
162-
<tr>
163-
<td>alwaysLive</td>
164-
<td>boolean</td>
165-
<td>optional</td>
166-
<td>false</td>
167-
<td>Don't kill the child. Life is always in the background</td>
168-
</tr>
169-
170-
</tbody>
171-
</table>
172-
173-
174-
#### Check what is page now
175-
```
176-
const nowPage= this.navigatorRef.nowPage;
177-
```
178-
#### Get the historyPages list
179-
```
180-
const historyPages= this.navigatorRef.historyPages();
181-
```
182-
183-
#### Get the listLevelPages list
184-
```
185-
const listLevelPages= this.navigatorRef.listLevelPages();
186-
```
187-
#### Back 1 page history
188-
```
189-
this.navigatorRef.back();
190-
```
191-
or
192-
```
193-
this.navigatorRef.back({options...});
194-
```
195-
options => { animationIn:integer // have defult , animationOut:string // have defult , timeAnimationInMS:integer // defult=250(ms) , callbackFun:function , props:{...} }
196-
197-
198-
#### Check if the mangerPages is busy
199-
```
200-
const navigator_busy= this.navigatorRef.busy;
201-
```
202-
*busy return boolean
203-
<br><br><br>
204-
205-
206-
207-
## If you have any problem, please let us know [here](https://github.com/orchoban/react.cordova-navigation_controller/issues), and we will make an effort to resolve it soon
208-
## Feel free to editing the code yourself: go to [src/index.js](https://github.com/orchoban/react.cordova-navigation_controller/blob/master/src/index.js)
209-
210-
211-
212-
213-
Credit:
214-
Arik Wald
215-
<br><br>
216-
Credit animated:
217-
***animate.css -https://daneden.github.io/animate.css/***
1+
ackage for [reco cli: react.cordova](https://www.npmjs.com/package/react.cordova)

dist/corodva_URL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test from corodva_URL

dist/index.js

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
'use strict';
22

3-
Object.defineProperty(exports, "__esModule", {
4-
value: true
5-
});
3+
var isLocalhost = Boolean(window.location.hostname === 'localhost' ||
4+
// [::1] is the IPv6 localhost address.
5+
window.location.hostname === '[::1]' ||
6+
// 127.0.0.1/8 is considered localhost for IPv4.
7+
window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));
68

7-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
9+
var cordovaScript_URL = "";
810

9-
var _react = require('react');
11+
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
12+
//production
13+
} else {
14+
cordovaScript_URL = document.URL.slice(0, document.URL.lastIndexOf(":")) + ":8597/browser/www";
15+
}
1016

11-
var _react2 = _interopRequireDefault(_react);
17+
window.addEventListener('load', function (e) {
1218

13-
var _jquery = require('./jquery-3.3.1.min');
19+
var tag = document.createElement('script');
20+
tag.async = true;
21+
tag.src = cordovaScript_URL + process.env.PUBLIC_URL + '/cordova.js';
1422

23+
<<<<<<< HEAD
1524
var _jquery2 = _interopRequireDefault(_jquery);
1625

1726
require('./styles.css');
@@ -431,4 +440,9 @@ var Navigator = function (_React$Component) {
431440
return Navigator;
432441
}(_react2.default.Component);
433442

434-
exports.default = Navigator;
443+
exports.default = Navigator;
444+
=======
445+
e.currentTarget.document.body.appendChild(document.createComment("This is an automatic switching src according to the run method. Comes from cordova_script"));
446+
e.currentTarget.document.body.appendChild(tag);
447+
});
448+
>>>>>>> 6a7606801b0f33ab81caeedb46a890842d4e0626

examples/.gitignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

examples/README.md

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)