added manual page

This commit is contained in:
printempw 2016-04-03 14:28:24 +08:00
parent 456372d085
commit 4db7176b6e
8 changed files with 457 additions and 52 deletions

36
assets/js/manual.utils.js Normal file
View File

@ -0,0 +1,36 @@
/*
* @Author: printempw
* @Date: 2016-04-03 13:44:36
* @Last Modified by: printempw
* @Last Modified time: 2016-04-03 14:25:52
*/
'use strict';
$(document).ready(function() {
$('pre').each(function(i, block) {
hljs.highlightBlock(block);
});
});
$('#mod-select').change(function() {
$('#version-select').children().each(function() { $(this).remove(); });
if ($(this).val() == "csl") {
$('#version-select').append('<option value="13_1-upper">13.1 版及以上(推荐)</option>');
$('#version-select').append('<option value="13_1-lower">13.1 版以下</option>');
} else if ($(this).val() == "usm") {
$('#version-select').append('<option value="1_4-upper">1.4 版及以上(推荐)</option>');
$('#version-select').append('<option value="1_2-1_3">1.2 及 1.3 版</option>');
$('#version-select').append('<option value="1_2-lower">1.2 版以下</option>');
}
});
$('#version-select').change(function() {
$('#config-13_1-upper').hide();
$('#config-13_1-lower').hide();
$('#config-1_4-upper').hide();
$('#config-1_2-1_3').hide();
$('#config-1_2-lower').hide();
$('#config-'+$(this).val()).show();
});

View File

@ -0,0 +1,24 @@
Copyright (c) 2006, Ivan Sagalaev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of highlight.js nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,141 @@
# Highlight.js
[![Build Status](https://travis-ci.org/isagalaev/highlight.js.svg?branch=master)](https://travis-ci.org/isagalaev/highlight.js)
Highlight.js is a syntax highlighter written in JavaScript. It works in
the browser as well as on the server. It works with pretty much any
markup, doesnt depend on any framework and has automatic language
detection.
## Getting Started
The bare minimum for using highlight.js on a web page is linking to the
library along with one of the styles and calling
[`initHighlightingOnLoad`][1]:
```html
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
```
This will find and highlight code inside of `<pre><code>` tags; it tries
to detect the language automatically. If automatic detection doesnt
work for you, you can specify the language in the `class` attribute:
```html
<pre><code class="html">...</code></pre>
```
The list of supported language classes is available in the [class
reference][2]. Classes can also be prefixed with either `language-` or
`lang-`.
To disable highlighting altogether use the `nohighlight` class:
```html
<pre><code class="nohighlight">...</code></pre>
```
## Custom Initialization
When you need a bit more control over the initialization of
highlight.js, you can use the [`highlightBlock`][3] and [`configure`][4]
functions. This allows you to control *what* to highlight and *when*.
Heres an equivalent way to calling [`initHighlightingOnLoad`][1] using
jQuery:
```javascript
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
```
You can use any tags instead of `<pre><code>` to mark up your code. If
you don't use a container that preserve line breaks you will need to
configure highlight.js to use the `<br>` tag:
```javascript
hljs.configure({useBR: true});
$('div.code').each(function(i, block) {
hljs.highlightBlock(block);
});
```
For other options refer to the documentation for [`configure`][4].
## Web Workers
You can run highlighting inside a web worker to avoid freezing the browser
window while dealing with very big chunks of code.
In your main script:
```javascript
addEventListener('load', function() {
var code = document.querySelector('#code');
var worker = new Worker('worker.js');
worker.onmessage = function(event) { code.innerHTML = event.data; }
worker.postMessage(code.textContent);
})
```
In worker.js:
```javascript
onmessage = function(event) {
importScripts('<path>/highlight.pack.js');
var result = self.hljs.highlightAuto(event.data);
postMessage(result.value);
}
```
## Getting the Library
You can get highlight.js as a hosted, or custom-build, browser script or
as a server module. Right out of the box the browser script supports
both AMD and CommonJS, so if you wish you can use RequireJS or
Browserify without having to build from source. The server module also
works perfectly fine with Browserify, but there is the option to use a
build specific to browsers rather than something meant for a server.
Head over to the [download page][5] for all the options.
**Note:** the library is not supposed to work straight from the source
on GitHub; it requires building. If none of the pre-packaged options
work for you refer to the [building documentation][6].
Also, if you are using something like almond, you need to use the
optimizer to give the module a name. The basic example would be:
```
r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js
```
## License
Highlight.js is released under the BSD License. See [LICENSE][7] file
for details.
## Links
The official site for the library is at <https://highlightjs.org/>.
Further in-depth documentation for the API and other topics is at
<http://highlightjs.readthedocs.org/>.
Authors and contributors are listed in the [AUTHORS.en.txt][8] file.
[1]: http://highlightjs.readthedocs.org/en/latest/api.html#inithighlightingonload
[2]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html
[3]: http://highlightjs.readthedocs.org/en/latest/api.html#highlightblock-block
[4]: http://highlightjs.readthedocs.org/en/latest/api.html#configure-options
[5]: https://highlightjs.org/download/
[6]: http://highlightjs.readthedocs.org/en/latest/building-testing.html
[7]: https://github.com/isagalaev/highlight.js/blob/master/LICENSE
[8]: https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.en.txt

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,88 @@
/*
Arduino® Light Theme - Stefania Mellai <s.mellai@arduino.cc>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #FFFFFF;
}
.hljs,
.hljs-subst {
color: #434f54;
}
.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
.hljs-doctag,
.hljs-name {
color: #00979D;
}
.hljs-built_in,
.hljs-literal,
.hljs-bullet,
.hljs-code,
.hljs-addition {
color: #D35400;
}
.hljs-regexp,
.hljs-symbol,
.hljs-variable,
.hljs-template-variable,
.hljs-link,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #00979D;
}
.hljs-type,
.hljs-string,
.hljs-selector-id,
.hljs-selector-class,
.hljs-quote,
.hljs-template-tag,
.hljs-deletion {
color: #005C5F;
}
.hljs-title,
.hljs-section {
color: #880000;
font-weight: bold;
}
.hljs-comment {
color: rgba(149,165,166,.8);
}
.hljs-meta-keyword {
color: #728E00;
}
.hljs-meta {
color: #728E00;
color: #434f54;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
.hljs-function {
color: #728E00;
}
.hljs-number {
color: #8A7B52;
}

View File

@ -102,38 +102,17 @@
<!-- Sidebar Menu -->
<ul class="sidebar-menu">
<li class="header">管理面板</li><?php
$pages = array(1 => "仪表盘",
2 => "用户管理",
3 => "添加用户",
4 => "个性化",
5 => "站点配置",
6 => "检查更新");
for ($i = 1; $i <= 6; $i++) {
if ($data['page_title'] == $pages[$i]) {
echo '<li class="active">';
} else {
echo '<li>';
}
switch ($i) {
case 1:
echo '<a href="index.php"><i class="fa fa-dashboard"></i> <span>'.$pages[$i].'</span></a>';
break;
case 2:
echo '<a href="manage.php"><i class="fa fa-users"></i> <span>'.$pages[$i].'</span></a>';
break;
case 3:
echo '<a href="adduser.php"><i class="fa fa-user-plus"></i> <span>'.$pages[$i].'</span></a>';
break;
case 4:
echo '<a href="customize.php"><i class="fa fa-paint-brush"></i> <span>'.$pages[$i].'</span></a>';
break;
case 5:
echo '<a href="options.php"><i class="fa fa-cog"></i> <span>'.$pages[$i].'</span></a>';
break;
case 6:
echo '<a href="update.php"><i class="fa fa-arrow-up"></i> <span>'.$pages[$i].'</span></a>';
break;
}
$pages = array(1 => ['title'=>'仪表盘', 'link'=>'index.php', 'icon'=>'fa-dashboard'],
2 => ['title'=>'用户管理', 'link'=>'manage.php', 'icon'=>'fa-users'],
3 => ['title'=>'添加用户', 'link'=>'adduser.php', 'icon'=>'fa-user-plus'],
4 => ['title'=>'个性化', 'link'=>'customize.php', 'icon'=>'fa-paint-brush'],
5 => ['title'=>'站点配置', 'link'=>'options.php', 'icon'=>'fa-cog'],
6 => ['title'=>'检查更新', 'link'=>'update.php', 'icon'=>'fa-arrow-up']);
foreach ($pages as $key => $value) {
echo ($data['page_title'] == $value['title']) ? '<li class="active">' : '<li>';
echo "<a href='{$value['link']}'><i class='fa {$value['icon']}'></i> <span>{$value['title']}</span></a>";
echo '</li>';
} ?>
<li class="header">返回</li>

View File

@ -100,28 +100,17 @@
<!-- Sidebar Menu -->
<ul class="sidebar-menu"><?php
$pages = array(1 => "用户中心",
2 => "皮肤上传",
3 => "个人资料");
for ($i = 1; $i <= 3; $i++) {
if ($data['page_title'] == $pages[$i]) {
echo '<li class="active">';
} else {
echo '<li>';
}
switch ($i) {
case 1:
echo '<a href="index.php"><i class="fa fa-dashboard"></i> <span>'.$pages[$i].'</span></a>';
break;
case 2:
echo '<a href="upload.php"><i class="fa fa-upload"></i> <span>'.$pages[$i].'</span></a>';
break;
case 3:
echo '<a href="profile.php"><i class="fa fa-user"></i> <span>'.$pages[$i].'</span></a>';
break;
}
$pages = array(1 => ['title'=>'用户中心', 'link'=>'index.php', 'icon'=>'fa-dashboard'],
2 => ['title'=>'皮肤上传', 'link'=>'upload.php', 'icon'=>'fa-upload'],
3 => ['title'=>'个人资料', 'link'=>'profile.php', 'icon'=>'fa-user'],
4 => ['title'=>'使用说明', 'link'=>'manual.php', 'icon'=>'fa-book']);
foreach ($pages as $key => $value) {
echo ($data['page_title'] == $value['title']) ? '<li class="active">' : '<li>';
echo "<a href='{$value['link']}'><i class='fa {$value['icon']}'></i> <span>{$value['title']}</span></a>";
echo '</li>';
}
if ($data['user']->is_admin): ?>
<li><a href="../admin"><i class="fa fa-cog"></i> <span>管理面板</span></a></li>
<?php endif; ?>

146
user/manual.php Normal file
View File

@ -0,0 +1,146 @@
<?php
/**
* @Author: printempw
* @Date: 2016-04-03 12:15:35
* @Last Modified by: printempw
* @Last Modified time: 2016-04-03 14:28:05
*/
require "../libraries/session.inc.php";
$data['style'] = <<< 'EOT'
<link rel="stylesheet" href="../assets/css/user.style.css">
<link rel="stylesheet" href="../assets/libs/highlight/styles/arduino-light.css">
<style>
pre { border: 0; }
td[class='key'], td[class='value'] { border-top: 0 !important; }
</style>
EOT;
$data['user'] = $user;
$data['page_title'] = "使用说明";
View::show('header', $data);
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
使用说明
<small>Manual</small>
</h1>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-6">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">MOD 需求</h3>
</div><!-- /.box-header -->
<div class="box-body">
<p>本站支持的皮肤 MOD <a href="http://www.mcbbs.net/forum.php?mod=viewthread&tid=358932" target="_blank">UniSkinMod</a><a href="http://www.mcbbs.net/thread-269807-1-1.html" target="_blank">CustomSkinLoader</a> 各自的新版和旧版,以及任何支持传统皮肤加载链接的皮肤 MOD。</p>
<p>详细教程:<a href="https://github.com/printempw/blessing-skin-server#客户端配置" target="_blank">@GitHub</a></p>
</div><!-- /.box-body -->
</div><!-- /.box -->
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">配置生成</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table class="table">
<tbody>
<tr>
<td class="key">MOD</td>
<td class="value">
<select class="form-control" id="mod-select">
<option value="csl">Custom Skin Loader</option>
<option value="usm">Universal Skin Mod</option>
</select>
</td>
</tr>
<tr>
<td class="key">版本</td>
<td class="value">
<select class="form-control" id="version-select">
<option value="13_1-upper">13.1 版及以上(推荐)</option>
<option value="13_1-lower">13.1 版以下</option>
</select>
</td>
</tr>
</tbody>
</table>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div>
<div class="col-md-6">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">配置文件</h3>
</div><!-- /.box-header -->
<div class="box-body">
<pre id="config-13_1-upper">
{
"enable": true,
"loadlist": [
{
"name": "<?php echo Option::get('site_name'); ?>",
"type": "CustomSkinAPI",
"root": "<?php echo Option::get('site_url')."/"; ?>"
},
{
"name": "Mojang",
"type": "MojangAPI"
}
]
}
</pre>
<pre id="config-13_1-lower" class="hljs ini" style="display: none;">
# skinurls.txt
<?php echo Option::get('site_url'); ?>/skin/*.png
http://skins.minecraft.net/MinecraftSkins/*.png
# capeurls.txt
<?php echo Option::get('site_url'); ?>/cape/*.png
</pre>
<pre id="config-1_4-upper" style="display: none;">
{
"rootURIs": [
"<?php echo Option::get('site_url'); ?>",
"http://www.skinme.cc/uniskin"
],
"legacySkinURIs": [],
"legacyCapeURIs": []
}
</pre>
<pre id="config-1_2-1_3" class="hljs ini" style="display: none;">
# <?php echo Option::get('site_name')."\n"; ?>
Root: <?php echo Option::get('site_url'); ?>
</pre>
<pre id="config-1_2-lower" class="hljs ini" style="display: none;">
# <?php echo Option::get('site_name')."\n"; ?>
Skin: <?php echo Option::get('site_url'); ?>/skin/%s.png
Cape: <?php echo Option::get('site_url'); ?>/cape/%s.png
# Mojang
Skin: http://skins.minecraft.net/MinecraftSkins/%s.png
Cape: http://skins.minecraft.net/MinecraftCloaks/%s.png
</pre>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div>
</div>
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<?php
$data['script'] = <<< 'EOT'
<script type="text/javascript" src="../assets/libs/highlight/highlight.min.js"></script>
<script type="text/javascript" src="../assets/js/manual.utils.js"></script>
EOT;
View::show('footer', $data); ?>