Skip to content

Commit cfb24d4

Browse files
committed
Revert "cvb"
This reverts commit 62100e2, reversing changes made to 52f3ff0.
1 parent 62100e2 commit cfb24d4

File tree

139 files changed

+19797
-5050
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

+19797
-5050
lines changed

README.md

Lines changed: 217 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,217 @@
1-
ackage for [reco cli: react.cordova](https://www.npmjs.com/package/react.cordova)
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/***

dist/corodva_URL

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/index.js

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

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}$/));
3+
Object.defineProperty(exports, "__esModule", {
4+
value: true
5+
});
86

9-
var cordovaScript_URL = "";
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; }; }();
108

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-
}
9+
var _react = require('react');
1610

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

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

23-
<<<<<<< HEAD
2415
var _jquery2 = _interopRequireDefault(_jquery);
2516

2617
require('./styles.css');
@@ -440,9 +431,4 @@ var Navigator = function (_React$Component) {
440431
return Navigator;
441432
}(_react2.default.Component);
442433

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
434+
exports.default = Navigator;

examples/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

examples/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
## Available Scripts
4+
5+
In the project directory, you can run:
6+
7+
### `npm start`
8+
9+
Runs the app in the development mode.<br />
10+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11+
12+
The page will reload if you make edits.<br />
13+
You will also see any lint errors in the console.
14+
15+
### `npm test`
16+
17+
Launches the test runner in the interactive watch mode.<br />
18+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19+
20+
### `npm run build`
21+
22+
Builds the app for production to the `build` folder.<br />
23+
It correctly bundles React in production mode and optimizes the build for the best performance.
24+
25+
The build is minified and the filenames include the hashes.<br />
26+
Your app is ready to be deployed!
27+
28+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29+
30+
### `npm run eject`
31+
32+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33+
34+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35+
36+
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37+
38+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39+
40+
## Learn More
41+
42+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43+
44+
To learn React, check out the [React documentation](https://reactjs.org/).
45+
46+
### Code Splitting
47+
48+
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49+
50+
### Analyzing the Bundle Size
51+
52+
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53+
54+
### Making a Progressive Web App
55+
56+
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57+
58+
### Advanced Configuration
59+
60+
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61+
62+
### Deployment
63+
64+
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65+
66+
### `npm run build` fails to minify
67+
68+
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

0 commit comments

Comments
 (0)