-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathgpx.js
99 lines (85 loc) · 2.15 KB
/
gpx.js
1
2
3
4
5
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
*
* Misc Functions
*
*/
// Information Box display (msg optional)
function infobox(type,msg)
{
// Success
if(type == 's')
{
$('.infobox').hide().html('<img src="images/icons/medium/success.png" border="0" /><br />').fadeIn();
var defmsg = 'Success!';
}
// Failure
else if(type == 'f')
{
$('.infobox').hide().html('<img src="images/icons/medium/error.png" border="0" /><br />').fadeIn();
var defmsg = '<b>Failure</b>!';
}
// Status Info
else if(type == 'i')
{
$('.infobox').hide().html('<img src="images/icons/medium/info.png" border="0" width="32" height="32" /><br />').fadeIn();
var defmsg = 'Please wait ...';
}
// Optionally append message
if(msg) $('.infobox').append(msg);
else $('.infobox').append(defmsg);
}
/* ****************************************************************** */
/*
*
* Load Main pages in /
*
*/
function mainpage(page,type,urlappend)
{
// OK Pages
var pages = ['servers','settings','userperms'];
$.each(pages,function(key,value){
if(page == value)
{
okPage = '1';
return false;
}
});
if(okPage != '1')
{
alert("Invalid Page: "+page);
return false;
}
// Servers
if(page == 'servers' && type != "")
{
if(type == "g") var addurl = '&t=g';
else if(type == "v") var addurl = '&t=v';
else var addurl = '';
}
// Use type as ID
else if(type)
{
var addurl = '&id='+type;
}
else
{
var addurl = '';
}
if(!urlappend) var urlappend = '';
// -----------------------------------
// Load page
$.ajax({
url: 'ajax/ajax.php',
data: 'a=main_'+page+addurl+urlappend,
success:function(html){
//$('#panel_center').html(html);
//window.location.href += '#'+page;
$('#panel_center').empty().html(html).hide().fadeIn();
},
error:function(a,b,c){
//alert("Error: "+a+", b: "+b+", c: "+c);
console.log("Error: "+a+", b: "+b+", c: "+c);
}
});
}