solve code swift

master
IoTgod 5 years ago
parent d7b194e3b1
commit fddc374e1b
  1. 408
      server/cn/home/www/IoTgod-www/kiri.css
  2. 6
      server/cn/home/www/IoTgod-www/kirini.css
  3. 153
      server/cn/home/www/IoTgod-www/usr/plugins/CommentApprove/Plugin.php
  4. 2
      server/cn/home/www/cdn/js/snowflakes.min.js

@ -0,0 +1,408 @@
.markdown-body,.markdown-body blockquote {
color: #24292e;
word-wrap: break-word;
font-size: 14px;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
line-height: 1.5;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
.markdown-body a {
border-bottom: none!important;
background-color: transparent;
color: #0366d6!important;
text-decoration: none;
}
.markdown-body a:hover {
border-bottom: 1px solid #0366d6 !important;
}
.markdown-body a:active,.markdown-body a:hover {
outline-width: 0;
}
.markdown-body strong {
font-weight: bolder;
}
.markdown-body h1 {
margin: .67em 0;
font-size: 2em;
}
.markdown-body img {
border-style: none;
}
.markdown-body code,.markdown-body kbd,.markdown-body pre {
font-size: 1em;
font-family: monospace,monospace;
}
.markdown-body hr {
overflow: visible;
box-sizing: content-box;
height: 0;
}
.markdown-body input {
margin: 0;
font: inherit;
}
.markdown-body input {
overflow: visible;
}
.markdown-body [type=checkbox] {
box-sizing: border-box;
padding: 0;
}
.markdown-body * {
box-sizing: border-box;
}
.markdown-body input {
font-size: inherit;
font-family: inherit;
line-height: inherit;
}
.markdown-body hr {
overflow: hidden;
margin: 15px 0;
height: 0;
border: 0;
border-bottom: 1px solid #dfe2e5;
background: 0 0;
}
.markdown-body hr::before {
display: table;
content: "";
}
.markdown-body hr::after {
clear: both;
display: table;
content: "";
}
.markdown-body table {
border-collapse: collapse;
word-break: keep-all;
border-spacing: 0;
}
.markdown-body td,.markdown-body th {
padding: 0;
}
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6 {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body h1 {
font-weight: 600;
font-size: 32px;
}
.markdown-body h2 {
font-weight: 600;
font-size: 24px;
}
.markdown-body h3 {
font-weight: 600;
font-size: 20px;
}
.markdown-body h4 {
font-weight: 600;
font-size: 16px;
}
.markdown-body h5 {
font-weight: 600;
font-size: 14px;
}
.markdown-body h6 {
font-weight: 600;
font-size: 12px;
}
.markdown-body p {
margin-top: 0;
margin-bottom: 10px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ol,.markdown-body ul {
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.markdown-body ol ol,.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ol ol ol,.markdown-body ol ul ol,.markdown-body ul ol ol,.markdown-body ul ul ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-size: 14px;
font-family: SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font-size: 12px;
font-family: SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;
}
.markdown-body::before {
display: table;
content: "";
}
.markdown-body::after {
clear: both;
display: table;
content: "";
}
.markdown-body>:first-child {
margin-top: 0!important;
}
.markdown-body>:last-child {
margin-bottom: 0!important;
}
.markdown-body a:not([href]) {
color: inherit;
text-decoration: none;
}
.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body hr {
margin: 24px 0;
padding: 0;
height: .25em;
border: 0;
background-color: #e1e4e8;
}
.markdown-body blockquote {
padding: 0 1em;
border-left: .25em solid #dfe2e5;
color: #6a737d;
}
.markdown-body blockquote>:first-child {
margin-top: 0;
}
.markdown-body blockquote>:last-child {
margin-bottom: 0;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
border: solid 1px #c6cbd1;
border-radius: 3px;
background-color: #fafbfc;
box-shadow: inset 0 -1px 0 #959da5;
color: #444d56;
vertical-align: middle;
font-size: 11px;
line-height: 10px;
border-bottom-color: #959da5;
}
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6 {
margin-top: 24px;
margin-bottom: 16px;
font-weight: 600;
line-height: 1.25;
}
.markdown-body h1 {
padding-bottom: .3em;
border-bottom: 1px solid #bbb;
font-size: 2em;
}
.markdown-body h2 {
padding-bottom: .3em;
border-bottom: 1px solid #bbb;
font-size: 1.5em;
}
.markdown-body h3 {
font-size: 1.25em;
}
.markdown-body h4 {
font-size: 1em;
}
.markdown-body h5 {
font-size: .875em;
}
.markdown-body h6 {
color: #6a737d;
font-size: .85em;
}
.markdown-body ol,.markdown-body ul {
padding-left: 2em;
}
.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li {
word-wrap: break-all;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body li+li {
margin-top: .25em;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
margin-top: 16px;
padding: 0;
font-weight: 600;
font-style: italic;
font-size: 1em;
}
.markdown-body dl dd {
margin-bottom: 16px;
padding: 0 16px;
}
.markdown-body table {
display: block;
overflow: auto;
width: 100%;
}
.markdown-body table th {
font-weight: 600;
}
.markdown-body table td,.markdown-body table th {
padding: 6px 13px;
border: 1px solid #dfe2e5;
}
.markdown-body table tr {
border-top: 1px solid #c6cbd1;
background-color: #fff;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f6f8fa;
}
.markdown-body img {
box-sizing: content-box;
max-width: 100%;
background-color: #fff;
}
.markdown-body img[align=right] {
padding-left: 20px;
}
.markdown-body img[align=left] {
padding-right: 20px;
}
.markdown-body code {
margin: 0;
padding: .2em .4em;
border-radius: 3px;
background-color: rgba(27,31,35,.05);
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre>code {
margin: 0;
padding: 0;
border: 0;
background: 0 0;
white-space: pre;
font-size: 100%;
word-break: normal;
}
.markdown-body pre code {
display: inline;
overflow: visible;
margin: 0;
padding: 0;
max-width: auto;
border: 0;
background-color: transparent;
word-wrap: normal;
line-height: inherit;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
border: solid 1px #d1d5da;
border-radius: 3px;
background-color: #fafbfc;
box-shadow: inset 0 -1px 0 #c6cbd1;
color: #444d56;
vertical-align: middle;
font: 11px SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;
line-height: 10px;
border-bottom-color: #c6cbd1;
}
.markdown-body hr {
border-bottom-color: #bbb;
}
.markdown-body li>pre {
margin-top: 5px;
}

@ -303,7 +303,7 @@
}
#post-content .highlight {
margin-bottom:16px
}
}/*
#post-content .highlight pre,#post-content pre {
padding:16px;
overflow-y:hidden;
@ -315,12 +315,12 @@
#post-content .highlight pre {
margin-bottom:0;
word-break:normal
}
}*/
#post-content pre code{
display:block;
max-width:initial;
padding:0px;
margin: 0px 0px 0px 40px;
margin: 10px 0px 0px 40px;
overflow:auto;
line-height:inherit;
word-wrap:normal;

@ -0,0 +1,153 @@
<?php
/**
* 评论者认证
*
* @package CommentApprove
* @author kuye
* @version 0.1.0
* @update: 2016.08.48
* @link http://www.yuzhiwei.com.cn/
*/
class CommentApprove_Plugin implements Typecho_Plugin_Interface
{
/**
* 激活插件方法,如果激活失败,直接抛出异常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate(){}
/**
* 禁用插件方法,如果禁用失败,直接抛出异常
*
* @static
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function deactivate(){}
/**
* 获取插件配置面板
*
* @access public
* @param Typecho_Widget_Helper_Form $form 配置面板
* @return void
*/
public static function config(Typecho_Widget_Helper_Form $form)
{
$type = new Typecho_Widget_Helper_Form_Element_Radio('type',array(
'1' => '使用自带样式',
'2' => '使用自填样式'),
'1', _t('角色样式选择'), _t('如选择自填样式,则在角色名称那边带入样式') );
$form->addInput($type);
//角色1
$name_1 = new Typecho_Widget_Helper_Form_Element_Text('name_1',
NULL,'博主',_t('角色1'),_t('填入角色1的名称'));
$form->addInput($name_1);
$color_1 = new Typecho_Widget_Helper_Form_Element_Text('color_1',
NULL,'#1ba1e2',_t('角色1样式颜色'),_t('填入颜色代码,只有使用自带样式时才生效'));
$form->addInput($color_1);
$email_1 = new Typecho_Widget_Helper_Form_Element_Textarea('email_1',
NULL,'',_t('邮箱地址列表1'),_t('每个邮箱地址之间以英文半角逗号隔开'));
$form->addInput($email_1);
//角色2
$name_2 = new Typecho_Widget_Helper_Form_Element_Text('name_2',
NULL,'好友',_t('角色2'),_t('填入角色2的名称'));
$form->addInput($name_2);
$color_2 = new Typecho_Widget_Helper_Form_Element_Text('color_2',
NULL,'#1ba1e2',_t('角色2样式颜色'),_t('填入颜色代码,只有使用自带样式时才生效'));
$form->addInput($color_2);
$email_2 = new Typecho_Widget_Helper_Form_Element_Textarea('email_2',
NULL,'',_t('邮箱地址列表2'),_t('每个邮箱地址之间以英文半角逗号隔开'));
$form->addInput($email_2);
//角色3
$name_3 = new Typecho_Widget_Helper_Form_Element_Text('name_3',
NULL,'',_t('角色3'),_t('填入角色3的名称'));
$form->addInput($name_3);
$color_3 = new Typecho_Widget_Helper_Form_Element_Text('color_3',
NULL,'#1ba1e2',_t('角色3样式颜色'),_t('填入颜色代码,只有使用自带样式时才生效'));
$form->addInput($color_3);
$email_3 = new Typecho_Widget_Helper_Form_Element_Textarea('email_3',
NULL,'',_t('邮箱地址列表3'),_t('每个邮箱地址之间以英文半角逗号隔开'));
$form->addInput($email_3);
}
/**
* 个人用户的配置面板
*
* @access public
* @param Typecho_Widget_Helper_Form $form
* @return void
*/
public static function personalConfig(Typecho_Widget_Helper_Form $form){}
/**
* 插件实现方法
*
* @access public
* @param str $email 评论者邮箱地址
* @return void
*/
public static function identify($email = NULL)
{
if (empty($email)){
return;
}
$status = 0;
$type = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->type;
//判断角色1
$email_1 = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->email_1;
if (!empty($email_1)){
$email_1 = explode(',',$email_1);
if (in_array($email, $email_1)) {
$status = 1;
}
}
//判断角色2
$email_2 = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->email_2;
if (!empty($email_2)){
$email_2 = explode(',',$email_2);
if (in_array($email, $email_2)) {
$status = 2;
}
}
//判断角色3
$email_3 = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->email_3;
if (!empty($email_3)){
$email_2 = explode(',',$email_3);
if (in_array($email, $email_3)) {
$status = 3;
}
}
//角色名
switch ($status){
case 0: $name="";break;
case 1: $name = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->name_1;break;
case 2: $name = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->name_2;break;
case 3: $name = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->name_3;break;
}
if (!empty($name)){
if ($type == 1){
switch ($status){
case 0: $color = "";break;
case 1: $color = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->color_1;break;
case 2: $color = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->color_2;break;
case 3: $color = Typecho_Widget::widget('Widget_Options')->plugin('CommentApprove')->color_3;break;
}
$str = '<span class="commentapprove" '.
'style="color: #FFF;padding: 2px 4px;font-size: 12px;border-radius: 3px;'.
'background-color: '.$color.';" >'.$name.'</span>';
echo $str;
}else{
echo $name;
}
}else{
return;
}
}
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save