You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
3.9 KiB
JavaScript
135 lines
3.9 KiB
JavaScript
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
|
|
var routes = [
|
|
{
|
|
path: '/home',
|
|
templateUrl: './pages/home.html',
|
|
name: 'home',
|
|
keepAlive: true,
|
|
on: {
|
|
pageAfterIn: function () {
|
|
function tryToLoadHomePage() {
|
|
if (typeof loadHomePage != "function") {
|
|
setTimeout(tryToLoadHomePage, 100);
|
|
} else {
|
|
loadHomePage(function () {});
|
|
}
|
|
}
|
|
tryToLoadHomePage();
|
|
}
|
|
}
|
|
},
|
|
{
|
|
path: '/inventory',
|
|
templateUrl: './pages/inventory.html',
|
|
name: 'inventory',
|
|
on: {
|
|
pageAfterIn: function () {
|
|
loadInventory(function () {}, "#inventory-page");
|
|
}
|
|
}
|
|
},
|
|
{
|
|
path: '/profile/:playerid/:playername',
|
|
templateUrl: './pages/profile.html',
|
|
name: 'profile',
|
|
on: {
|
|
pageAfterIn: function () {
|
|
function tryToLoadProfile() {
|
|
if (typeof loadProfile === "function") {
|
|
loadProfile(function () {});
|
|
} else {
|
|
setTimeout(tryToLoadProfile, 100);
|
|
}
|
|
}
|
|
tryToLoadProfile();
|
|
}
|
|
}
|
|
},
|
|
{
|
|
path: '/signin',
|
|
url: './pages/signin.html',
|
|
name: 'signin'
|
|
},
|
|
{
|
|
path: '/chooseteam',
|
|
templateUrl: './pages/chooseteam.html',
|
|
name: 'chooseteam',
|
|
options: {
|
|
context: {
|
|
teams: SETTINGS['teams']
|
|
}
|
|
}
|
|
},
|
|
{
|
|
path: '/upgrade',
|
|
templateUrl: './pages/upgrade.html',
|
|
name: 'upgrade',
|
|
options: {
|
|
context: SETTINGS.download_links
|
|
}
|
|
},
|
|
{
|
|
path: '/connection',
|
|
url: './pages/connection.html',
|
|
name: 'connection'
|
|
},
|
|
{
|
|
path: '/settings',
|
|
name: 'settings',
|
|
templateUrl: './pages/settings.html',
|
|
on: {
|
|
pageAfterIn: function () {
|
|
function tryToLoadSettings() {
|
|
if (typeof loadSettings != "function") {
|
|
setTimeout(tryToLoadSettings, 500);
|
|
} else {
|
|
loadSettings();
|
|
}
|
|
}
|
|
tryToLoadSettings();
|
|
}
|
|
}
|
|
},
|
|
{
|
|
path: '/credits',
|
|
name: 'credits',
|
|
async: function (routeTo, routeFrom, resolve, reject) {
|
|
$.ajax({
|
|
url: 'code-credits.txt',
|
|
dataType: 'text',
|
|
type: 'GET',
|
|
async: true,
|
|
success: function (codecredits) {
|
|
$.ajax({
|
|
url: 'art-credits.html',
|
|
dataType: 'text',
|
|
type: 'GET',
|
|
async: true,
|
|
success: function (artcredits) {
|
|
resolve({
|
|
templateUrl: './pages/credits.html'
|
|
}, {
|
|
context: {
|
|
artcredits: artcredits,
|
|
codecredits: codecredits
|
|
}
|
|
});
|
|
},
|
|
error: function (jqXHR, status, errorThrown) {
|
|
reject();
|
|
}
|
|
});
|
|
},
|
|
error: function (jqXHR, status, errorThrown) {
|
|
reject();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
]; |