Skip to content
This repository was archived by the owner on May 9, 2019. It is now read-only.

Commit 09b4504

Browse files
committed
merge with develop
2 parents ee1ba29 + b147be2 commit 09b4504

13 files changed

Lines changed: 105 additions & 517 deletions

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ The missing plugins store for Typecho!
1414
- [@chekun](https://github.com/chekun)
1515
- [@jzwalk](https://github.com/jzwalk)
1616
- [@fengyunljp](https://github.com/fengyunljp)
17+
- [@aiwb](https://github.com/aiwb)
1718

1819
### 欢迎一起完善该项目.

static/css/font-awesome.min.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

static/css/pure.css

Lines changed: 0 additions & 11 deletions
This file was deleted.

static/fonts/FontAwesome.otf

-61.4 KB
Binary file not shown.
-37.3 KB
Binary file not shown.

static/fonts/fontawesome-webfont.svg

Lines changed: 0 additions & 414 deletions
This file was deleted.
-78.8 KB
Binary file not shown.
-43.4 KB
Binary file not shown.

views/js.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function init()
2121
var $version = $(this).children(':selected');
2222
var $card = $(this).parent().parent();
2323

24-
$card.children('.as-require').children('cite').html($version.data('require'));
25-
$card.children('.as-description').html($version.data('description')).attr('title', $version.data('description'));
26-
$card.children('.as-author').children('cite').html($version.data('author'));
24+
$card.children('.as-require').html($version.data('require'));
25+
$card.children('.as-description').html($version.data('description'));
26+
$card.children('.as-author').html($version.data('author'));
2727

2828
});
2929

@@ -51,18 +51,24 @@ function init()
5151
plugin: $card.data('name')
5252
},
5353
beforeSend: function() {
54-
$this.attr('disabled', true).text('正在安装, 请稍后...');
54+
$this.attr('disabled', true).text('安装中');
5555
}
5656
}).always(function() {
57-
$this.attr('disabled', false).text('安装');
57+
$this.attr('disabled', false);
5858
}).fail(function() {
5959
alert('安装失败');
60+
if ($card.data('existed')) {
61+
$this.text('重装');
62+
} else {
63+
$this.text('安装');
64+
}
6065
}).done(function(result) {
6166
if (result.status) {
6267
$card.data('existed', 1);
6368
$version.data('activated', result.activated);
6469
$this.next().children('i').addClass('as-existed active');
6570
alert('安装成功');
71+
window.location.reload();
6672
} else {
6773
alert(result.error);
6874
}

views/list.php

Lines changed: 42 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,44 @@
1-
<?php if ($result): ?>
2-
<div class="pure-g typecho-list">
3-
<?php foreach ($result->packages as $plugin): ?>
4-
<div class="pure-u-1-4 as-card" data-name="<?php echo $plugin->name; ?>" data-existed="<?php echo $plugin->existed ?>">
5-
<h3><?php echo $plugin->name; ?></h3>
6-
<p class="as-description" title="<?php echo $plugin->versions[0]->description; ?>">
7-
<?php echo $plugin->versions[0]->description; ?>
8-
</p>
9-
<p class="as-author">
10-
<?php echo _t('作者'); ?>:
11-
<cite><?php echo $plugin->versions[0]->author; ?></cite>
12-
13-
</p>
14-
<p class="as-versions">
15-
<?php echo _t('版本'); ?>:
16-
<select class="as-version-selector">
17-
<?php foreach ($plugin->versions as $version): ?>
18-
<option value="<?php echo $version->version; ?>" data-activated="<?php echo $version->activated; ?>" data-author="<?php echo $version->author; ?>" data-require="<?php echo $version->require; ?>" data-description="<?php echo $version->description; ?>"><?php echo $version->version; ?></option>
19-
<?php endforeach; ?>
20-
</select>
21-
</p>
22-
23-
<p class="as-require">
24-
<?php echo _t('版本要求'); ?>:
25-
<cite><?php echo $plugin->versions[0]->require; ?></cite>
26-
</p>
27-
<p class="as-operations">
28-
<?php if ($this->installale): ?>
29-
<button class="btn-s as-install"><?php echo _t("安装"); ?></button>
30-
<?php else: ?>
31-
<a class="btn-s" onclick="return confirm('没有写入权限或者运行在云平台中\n点击确认后将进行下载,请手动传到服务器上!');" href="<?php echo $this->server.'archive/'.$plugin->name.'/'.str_replace(' ', '%20', $version->version);?>"><?php echo _t('下载'); ?></a>
32-
<?php endif; ?>
33-
<span class="as-status" style="">
34-
<?php if ($plugin->existed): ?>
35-
<i class="fa fa-check-circle as-activated as-existed active" title="<?php echo _t('已安装'); ?>"></i>
36-
<?php else: ?>
37-
<i class="fa fa-check-circle as-activated" title="<?php echo _t('未安装'); ?>"></i>
38-
<?php endif; ?>
39-
</span>
40-
</p>
41-
</div>
42-
<?php endforeach; ?>
1+
<div class="col-mb-12 typecho-list">
2+
<h4 class="typecho-list-table-title">已安装的插件</h4>
3+
<div class="typecho-table-wrap">
4+
<?php if ($result): ?>
5+
<table class="typecho-list-table">
6+
<thead>
7+
<?php include 'row-title.php'; ?>
8+
</thead>
9+
<tbody>
10+
<?php foreach ($result->packages as $plugin):
11+
if ($plugin->existed) {
12+
include 'row.php';
13+
}
14+
endforeach; ?>
15+
</tbody>
16+
</table>
17+
<?php else: ?>
18+
<div class="message" style="width:20em;text-align: center;margin:0 auto">
19+
<h3 style="font-size: 2em">没有找到任何插件</h3>
20+
</div>
21+
<?php endif; ?>
4322
</div>
44-
<?php else: ?>
45-
<div class="message" style="width:20em;text-align: center;margin:0 auto">
46-
<p><i class="fa fa-frown-o" style="font-size: 5em"></i></p>
47-
<h3 style="font-size: 2em">没有找到任何插件</h3>
23+
<h4 class="typecho-list-table-title">未安装的插件</h4>
24+
<div class="typecho-table-wrap">
25+
<?php if ($result): ?>
26+
<table class="typecho-list-table">
27+
<thead>
28+
<?php include 'row-title.php'; ?>
29+
</thead>
30+
<tbody>
31+
<?php foreach ($result->packages as $plugin):
32+
if (!$plugin->existed) {
33+
include 'row.php';
34+
}
35+
endforeach; ?>
36+
</tbody>
37+
</table>
38+
<?php else: ?>
39+
<div class="message" style="width:20em;text-align: center;margin:0 auto">
40+
<h3 style="font-size: 2em">没有找到任何插件</h3>
41+
</div>
42+
<?php endif; ?>
4843
</div>
49-
<?php endif; ?>
44+
</div>

0 commit comments

Comments
 (0)