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

Commit

Permalink
merge with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
chekun committed Jan 17, 2017
2 parents ee1ba29 + b147be2 commit 09b4504
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 517 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ The missing plugins store for Typecho!
- [@chekun](https://github.com/chekun)
- [@jzwalk](https://github.com/jzwalk)
- [@fengyunljp](https://github.com/fengyunljp)
- [@aiwb](https://github.com/aiwb)

### 欢迎一起完善该项目.
4 changes: 0 additions & 4 deletions static/css/font-awesome.min.css

This file was deleted.

11 changes: 0 additions & 11 deletions static/css/pure.css

This file was deleted.

Binary file removed static/fonts/FontAwesome.otf
Binary file not shown.
Binary file removed static/fonts/fontawesome-webfont.eot
Binary file not shown.
414 changes: 0 additions & 414 deletions static/fonts/fontawesome-webfont.svg

This file was deleted.

Binary file removed static/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file removed static/fonts/fontawesome-webfont.woff
Binary file not shown.
16 changes: 11 additions & 5 deletions views/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ function init()
var $version = $(this).children(':selected');
var $card = $(this).parent().parent();

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

});

Expand Down Expand Up @@ -51,18 +51,24 @@ function init()
plugin: $card.data('name')
},
beforeSend: function() {
$this.attr('disabled', true).text('正在安装, 请稍后...');
$this.attr('disabled', true).text('安装中');
}
}).always(function() {
$this.attr('disabled', false).text('安装');
$this.attr('disabled', false);
}).fail(function() {
alert('安装失败');
if ($card.data('existed')) {
$this.text('重装');
} else {
$this.text('安装');
}
}).done(function(result) {
if (result.status) {
$card.data('existed', 1);
$version.data('activated', result.activated);
$this.next().children('i').addClass('as-existed active');
alert('安装成功');
window.location.reload();
} else {
alert(result.error);
}
Expand Down
89 changes: 42 additions & 47 deletions views/list.php
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
<?php if ($result): ?>
<div class="pure-g typecho-list">
<?php foreach ($result->packages as $plugin): ?>
<div class="pure-u-1-4 as-card" data-name="<?php echo $plugin->name; ?>" data-existed="<?php echo $plugin->existed ?>">
<h3><?php echo $plugin->name; ?></h3>
<p class="as-description" title="<?php echo $plugin->versions[0]->description; ?>">
<?php echo $plugin->versions[0]->description; ?>
</p>
<p class="as-author">
<?php echo _t('作者'); ?>:
<cite><?php echo $plugin->versions[0]->author; ?></cite>

</p>
<p class="as-versions">
<?php echo _t('版本'); ?>:
<select class="as-version-selector">
<?php foreach ($plugin->versions as $version): ?>
<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>
<?php endforeach; ?>
</select>
</p>

<p class="as-require">
<?php echo _t('版本要求'); ?>:
<cite><?php echo $plugin->versions[0]->require; ?></cite>
</p>
<p class="as-operations">
<?php if ($this->installale): ?>
<button class="btn-s as-install"><?php echo _t("安装"); ?></button>
<?php else: ?>
<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>
<?php endif; ?>
<span class="as-status" style="">
<?php if ($plugin->existed): ?>
<i class="fa fa-check-circle as-activated as-existed active" title="<?php echo _t('已安装'); ?>"></i>
<?php else: ?>
<i class="fa fa-check-circle as-activated" title="<?php echo _t('未安装'); ?>"></i>
<?php endif; ?>
</span>
</p>
</div>
<?php endforeach; ?>
<div class="col-mb-12 typecho-list">
<h4 class="typecho-list-table-title">已安装的插件</h4>
<div class="typecho-table-wrap">
<?php if ($result): ?>
<table class="typecho-list-table">
<thead>
<?php include 'row-title.php'; ?>
</thead>
<tbody>
<?php foreach ($result->packages as $plugin):
if ($plugin->existed) {
include 'row.php';
}
endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="message" style="width:20em;text-align: center;margin:0 auto">
<h3 style="font-size: 2em">没有找到任何插件</h3>
</div>
<?php endif; ?>
</div>
<?php else: ?>
<div class="message" style="width:20em;text-align: center;margin:0 auto">
<p><i class="fa fa-frown-o" style="font-size: 5em"></i></p>
<h3 style="font-size: 2em">没有找到任何插件</h3>
<h4 class="typecho-list-table-title">未安装的插件</h4>
<div class="typecho-table-wrap">
<?php if ($result): ?>
<table class="typecho-list-table">
<thead>
<?php include 'row-title.php'; ?>
</thead>
<tbody>
<?php foreach ($result->packages as $plugin):
if (!$plugin->existed) {
include 'row.php';
}
endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="message" style="width:20em;text-align: center;margin:0 auto">
<h3 style="font-size: 2em">没有找到任何插件</h3>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
55 changes: 19 additions & 36 deletions views/market.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,47 @@
list($version, $buildVersion) = explode('/', Typecho_Common::VERSION);
$typechoVersion = floatval($version);
?>
<link rel="stylesheet" href="<?php echo $options->pluginUrl('AppStore/static/css/font-awesome.min.css'); ?>">
<link rel="stylesheet" href="<?php echo $options->pluginUrl('AppStore/static/css/pure.css'); ?>">
<style>
.as-description {
height: 4.2em;
overflow: hidden;
}
.as-status {
float:right;
margin-right: 1em;
}
.as-status i {
color: #ccc;
margin: 0 0.2em;
font-size: 1.5em;
}
.as-status i.active {
color: green
.as-name,
.as-require,
.as-author,
.as-operations {
white-space: nowrap;
}
</style>

<?php if ($typechoVersion <= 0.8): ?>
<div class="main">
<div class="body body-950">
<div class="container typecho-page-title">
<div class="body container">
<div class="typecho-page-title">
<div class="column-24">
<h2><?php echo $menu->title; ?> <small><cite>The missing plugins' store for Typecho</cite></small></h2>
<p>
<i class="fa fa-heart" title="<?php echo _t('提建议/吐槽专用'); ?>"></i>
<a href="http://chekun.me/typecho-app-store.html" target="_blank"><?php echo _t('提建议/吐槽专用'); ?></a>
</p>
<div>
<a href="https://github.com/chekun/AppStore/issues" target="_blank"><?php echo _t('提建议/吐槽专用'); ?></a>
</div>
</div>
</div>
<div class="container typecho-page-main">
<div class="row typecho-page-main" role="main">
<?php include 'list.php'; ?>
</div>
</div>
</div>
<?php else: ?>
<div class="main">
<div class="body container">
<div class="colgroup">
<div class="typecho-page-title col-mb-12">
<h2>
<?php echo $menu->title; ?> <small><cite>The missing plugins' store for Typecho</cite></small>
<p style="float:right">
<a href="http://chekun.me/typecho-app-store.html" target="_blank"><i class="fa fa-heart" title="<?php echo _t('提建议/吐槽专用'); ?>"></i><?php echo _t('提建议/吐槽专用'); ?></a>
</p>
</h2>
</div>
<div class="typecho-page-title">
<h2>
<?php echo $menu->title; ?> <small><cite>The missing plugins' store for Typecho</cite></small>
<div style="float:right">
<a href="https://github.com/chekun/AppStore/issues" target="_blank"><?php echo _t('提建议/吐槽专用'); ?></a>
</div>
</h2>
</div>
<div class="colgroup typecho-page-main" role="main">
<div class="row typecho-page-main" role="main">
<?php include 'list.php'; ?>
</div>
</div>
</div>
<?php endif; ?>

<?php
include TYPEHO_ADMIN_PATH.'copyright.php';
include TYPEHO_ADMIN_PATH.'common-js.php';
Expand Down
8 changes: 8 additions & 0 deletions views/row-title.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<tr>
<th><?php echo _t('名称'); ?></th>
<th><?php echo _t('描述'); ?></th>
<th><?php echo _t('版本'); ?></th>
<th><?php echo _t('版本要求'); ?></th>
<th><?php echo _t('作者'); ?></th>
<th><?php echo _t('操作'); ?></th>
</tr>
24 changes: 24 additions & 0 deletions views/row.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<tr class="as-card" data-name="<?php echo $plugin->name; ?>" data-existed="<?php echo $plugin->existed ?>">
<td class="as-name"><?php echo $plugin->name; ?></td>
<td class="as-description"><?php echo $plugin->versions[0]->description; ?></td>
<td class="as-versions">
<select class="as-version-selector">
<?php foreach ($plugin->versions as $version): ?>
<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>
<?php endforeach; ?>
</select>
</td>
<td class="as-require" ><?php echo $plugin->versions[0]->require; ?></td>
<td class="as-author"><?php echo $plugin->versions[0]->author; ?></td>
<td class="as-operations">
<?php if ($this->installale): ?>
<?php if ($plugin->existed): ?>
<a class="as-install" href="javascript:;"><?php echo _t("重装"); ?></a>
<?php else: ?>
<a class="as-install" href="javascript:;"><?php echo _t("安装"); ?></a>
<?php endif; ?>
<?php else: ?>
<a onclick="return confirm('没有写入权限或者运行在云平台中\n点击确认后将进行下载,请手动传到服务器上!');" href="<?php echo $this->server.'archive/'.$plugin->name.'/'.str_replace(' ', '%20', $version->version);?>"><?php echo _t('下载'); ?></a>
<?php endif; ?>
</td>
</tr>

0 comments on commit 09b4504

Please sign in to comment.