-
Notifications
You must be signed in to change notification settings - Fork 0
/
description.js
73 lines (72 loc) · 1.93 KB
/
description.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
function iOSVersion() {
var match = (navigator.appVersion).split('OS ');
if (match.length > 1) {
return match[1].split(' ')[0].split('_').join('.');
}
return false;
}
$(function() {
$("li").on("click",function() {
if(this.id=="dnt") {
$("#dnt_txt").html("You can donate USD via PayPal mail: julioverne"+"@"+"icloud.com");
}
});
});
function loadPackageInfo() {
if (navigator.userAgent.search(/Cydia/) == -1) {
$("#showAddRepo_").show();
$("#showAddRepoUrl_").show();
}
var urlSelfParts = window.location.href.split('description.html?id=');
var form_url = urlSelfParts[0]+"packageInfo/"+urlSelfParts[1];
$.ajax({
url: form_url,
type: "GET",
cache: false,
crossDomain: true,
success: function (returnhtml) {
$("#tweakStatusInfo").hide();
var decodeResp = eval('('+returnhtml+')');
if(decodeResp.name) {
document.title = decodeResp.name;
$("#name").html(decodeResp.name);
$("#name").show();
}
if(decodeResp.desc_short) {
$("#desc_short").html(decodeResp.desc_short);
$("#desc_short_").show();
}
if(decodeResp.warning) {
$("#warning").html(decodeResp.warning);
$("#warning_").show();
}
if(decodeResp.desc_long) {
$("#desc_long").html(decodeResp.desc_long);
$("#desc_long_").show();
}
if(decodeResp.compatitle) {
$("#compatitle").html(decodeResp.compatitle);
$("#compatitle_").show();
var ios_ver = iOSVersion();
if(ios_ver) {
$("#your_ios").show();
$("#your_ios").html("إصدارك الحالي: "+ios_ver);
}
}
if(decodeResp.changelog) {
$("#changelog").html(decodeResp.changelog);
$("#changelog_").show();
}
if(decodeResp.screenshot) {
$("#screenshot").html(decodeResp.screenshot);
$("#screenshot_").show();
}
if(decodeResp.open == true) {
$("#is_open_source_").show();
}
},
error: function (err) {
$("#errorInfo").html("Description unavailable for "+urlSelfParts[1]);
}
});
}