forked from MitanOmar/plugins_updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_plugin_update.html
executable file
·64 lines (56 loc) · 1.65 KB
/
check_plugin_update.html
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
<IF NAME="current_smt == general">
<!-- Breadcrumbs -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="./">{lang.R_CPINDEX}</a></li>
<li class="breadcrumb-item active">{olang.CHECK_PLUGIN_UPDATE}</li>
</ol>
<div id="updateInfo" class="alert">
<img src="{STYLE_PATH_ADMIN}images/ajax-loader-small.gif" />
</div>
<script>
setTimeout(function(){
$.ajax({
url: './?cp=p_check_plugins_update&smt=check&_ajax_=1',
dataType: 'json',
cache: false,
success: function (data) {
if(data.content){
$('#updateInfo').html('');
$.each(data.content, function(i, item) {
var div = item.pluginName +' : '+ item.report;
if(item.error == 'warning') {
div += '( {olang.U_VERSION} = ' + item.local_version +' / {olang.AP_VERSION} =' + item.online_version +' )'
if(item.from_kleeja_github) {
div += '<a href="javascript:void" onclick="updatePlugin(\''+item.pluginName+'\')" class="btn btn-link">{olang.UPDT}</a>';
}
}
$('#updateInfo').append('<div id="d_'+item.pluginName+'" class="alert alert-'+item.error+'">'+ div +'</div>');
});
} else {
this.error();
}
},
error: function(data) {
$('#updateInfo').html(data.responseJSON.content).addClass('alert-danger');
}
});
}, 300);
function updatePlugin(plugin) {
$.ajax({
url: './?cp=p_check_plugins_update&smt=update&plugin='+plugin+'&_ajax_=1',
dataType: 'json',
cache: false,
success: function (data) {
if(data.content){
$('#d_'+plugin).html(data.content);
} else {
this.error();
}
},
error: function(data) {
$('#d_'+plugin).html(data.responseJSON.content).addClass('alert-danger');
}
});
}
</script>
</IF>