Add cordova project template with framework7

This commit is contained in:
dario-cfpt
2019-12-10 11:36:05 +01:00
parent c30b24245e
commit 0ac148d899
42 changed files with 91485 additions and 9 deletions

79
mobile/www/js/routes.js Normal file
View File

@ -0,0 +1,79 @@
routes = [
{
path: '/',
url: './index.html',
},
{
path: '/about/',
url: './pages/about.html',
},
{
path: '/form/',
url: './pages/form.html',
},
// Page Loaders & Router
{
path: '/page-loader-template7/:user/:userId/:posts/:postId/',
templateUrl: './pages/page-loader-template7.html',
},
{
path: '/page-loader-component/:user/:userId/:posts/:postId/',
componentUrl: './pages/page-loader-component.html',
},
{
path: '/request-and-load/user/:userId/',
async: function (routeTo, routeFrom, resolve, reject) {
// Router instance
var router = this;
// App instance
var app = router.app;
// Show Preloader
app.preloader.show();
// User ID from request
var userId = routeTo.params.userId;
// Simulate Ajax Request
setTimeout(function () {
// We got user data from request
var user = {
firstName: 'Vladimir',
lastName: 'Kharlampidi',
about: 'Hello, i am creator of Framework7! Hope you like it!',
links: [
{
title: 'Framework7 Website',
url: 'http://framework7.io',
},
{
title: 'Framework7 Forum',
url: 'http://forum.framework7.io',
},
]
};
// Hide Preloader
app.preloader.hide();
// Resolve route to load page
resolve(
{
componentUrl: './pages/request-and-load.html',
},
{
context: {
user: user,
}
}
);
}, 1000);
},
},
// Default route (404 page). MUST BE THE LAST
{
path: '(.*)',
url: './pages/404.html',
},
];