Skip to content

Commit

Permalink
1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ouyangyanhuo committed May 22, 2022
1 parent 9fb6def commit 8cc2a36
Show file tree
Hide file tree
Showing 96 changed files with 68 additions and 39,306 deletions.
35 changes: 22 additions & 13 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

/**
* AdminMD是一款基于Material Design设计的typecho后台美化插件
* <hr><a style="width:fit-content" id="AdminMD">版本检测中...&nbsp;</div>
* <script>var simversion="1.8";function update_detec(){var container=document.getElementById("AdminMD");if(!container){return}var ajax=new XMLHttpRequest();container.style.display="block";ajax.open("get","https://api.github.com/repos/ouyangyanhuo/AdminMD/releases/latest");ajax.send();ajax.onreadystatechange=function(){if(ajax.readyState===4&&ajax.status===200){var obj=JSON.parse(ajax.responseText);var newest=obj.tag_name;if(newest>simversion){container.innerHTML="发现新主题版本:"+obj.name+'。下载地址:<a href="'+obj.zipball_url+'">点击下载</a>'+"<br>您目前的版本:"+String(simversion)+"。"+'<a target="_blank" href="'+obj.html_url+'">👉查看新版亮点</a>'}else{container.innerHTML="您目前的版本:"+String(simversion)+"。"+"您目前使用的是最新版。"}}}};update_detec();</script>
*
* @package AdminMD
* @author Magneto
* @version 1.7
* @version 1.8
* @link https://www.fmcf.cc
*/

Expand Down Expand Up @@ -110,18 +113,24 @@ public static function config(Typecho_Widget_Helper_Form $form)
?>
<link rel="stylesheet" href="<?php Helper::options()->pluginUrl(); ?>/AdminMD/assets/css/login.css">
<?php


$TheNotice = new Typecho_Widget_Helper_Form_Element_Text('TheNotice', NULL, NULL, _t('<h2>基础外观</h2>'));
$TheNotice->input->setAttribute('style', 'display:none');
$form->addInput($TheNotice);

$url = Helper::options()->pluginUrl . '/AdminMD/';
$zz1 = '<div class="zz">绿色[你的名字]</div>';
$zz2 = '<div class="zz">蓝天和远山[网络]</div>';
$zz3 = '<div class="zz">后花园[Pixiv 95741043]</div>';
$zz4 = '<div class="zz">Default</div>';
$zz4 = '<div class="zz">枫[Pixiv 66986409]</div>';
$zz5 = '<div class="zz">Default</div>';
$bgfengge = new Typecho_Widget_Helper_Form_Element_Radio(
'bgfengge', array(
'Green' => _t('<div class="kuai"><img src="http://p5.qhimg.com/bdm/960_593_0/t01573b4f467fdf51e2.jpg" loading="lazy">' . $zz1 . '</div>'),
'BlueSkyAndMountains' => _t('<div class="kuai"><img src="https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/0531f7895a5627b8737e0690d7dcb4e5.png" loading="lazy">' . $zz2 . '</div>'),
'Back_garden' => _t('<div class="kuai"><img src="https://tva4.sinaimg.cn/large/008aATBzly8gze1cpfkuuj31i00u0k56.jpg" loading="lazy">' . $zz3 . '</div>'),
'Default' => _t('<div class="kuai"><img src="https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/05b54e433729eb89a067ff992176c442.png" loading="lazy">' . $zz4 . '</div>'),
'Maple' => _t('<div class="kuai"><img src="https://tva4.sinaimg.cn/large/008aATBzly1h07hmpmbj5j30yq0g6dvm.jpg" loading="lazy">' . $zz4 . '</div>'),
'Default' => _t('<div class="kuai"><img src="https://fastly.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/05b54e433729eb89a067ff992176c442.png" loading="lazy">' . $zz5 . '</div>'),
), 'Green', _t('登陆/注册页面样式'), _t(''));
$bgfengge->setAttribute('id', 'yangshi');
$form->addInput($bgfengge);
Expand Down Expand Up @@ -186,26 +195,26 @@ public static function renderHeader($hed)
$hed = $hed . '<style>' . $diycss . '</style>';
} else {
if ($skin == 'heike') {
$hed = $hed . '<link rel="stylesheet" href="' . $url . 'assets/skin/' . $skin . '.css?20220220">';
$hed = $hed . '<link rel="stylesheet" href="' . $url . 'assets/skin/' . $skin . '.css?' . $suffixVersion.'">';
} else {
$bgUrl = Typecho_Widget::widget('Widget_Options')->plugin('AdminMD')->bgUrl;
$zidingyi = "";
if ($bgUrl) {
$zidingyi = "<style>body{background-image: url(" . $bgUrl . ");}</style>";
}
$hed = $hed . '<link rel="stylesheet" href="' . $url . 'assets/skin/' . $skin . '.css?20220220">' . $zidingyi;
$hed = $hed . '<link rel="stylesheet" href="' . $url . 'assets/skin/' . $skin . '.css?' . $suffixVersion.'">' . $zidingyi;
}
}

echo $hed;
}else{
/* 添加 Material Design style */
$hed = $hed . '<link rel="stylesheet" href="' . $url . 'assets/css/style.min.css?v=' . $suffixVersion.'">';
$hed = $hed.'<link rel="stylesheet" href="' . $url . 'assets/vendors/mdi/css/materialdesignicons.min.css?v=' . $suffixVersion.'">';
$hed = $hed.'<link rel="stylesheet" href="' . $url . 'assets/vendors/css/vendor.bundle.base.css?v=' . $suffixVersion.'">';
$hed = $hed.'<script src="' . $url . 'assets/vendors/js/vendor.bundle.base.js?v=' . $suffixVersion.'"></script>';
$hed = $hed.'<script src="' . $url . 'assets/js/off-canvas.js?v=' . $suffixVersion.'"></script>';
$hed = $hed.'<script src="' . $url . 'assets/js/hoverable-collapse.js?v=' . $suffixVersion.'"></script>';
$hed = $hed . '<link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/ouyangyanhuo/[email protected]/assets/css/style.min.css?v=' . $suffixVersion.'">';
$hed = $hed.'<link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/ouyangyanhuo/[email protected]/assets/vendors/mdi/css/materialdesignicons.min.css?v=' . $suffixVersion.'">';
$hed = $hed.'<link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/ouyangyanhuo/[email protected]/assets/vendors/css/vendor.bundle.base.css?v=' . $suffixVersion.'">';
$hed = $hed.'<script src="https://fastly.jsdelivr.net/gh/ouyangyanhuo/[email protected]/assets/vendors/js/vendor.bundle.base.js?v=' . $suffixVersion.'"></script>';
$hed = $hed.'<script src="https://fastly.jsdelivr.net/gh/ouyangyanhuo/[email protected]/assets/js/off-canvas.js?v=' . $suffixVersion.'"></script>';
$hed = $hed.'<script src="https://fastly.jsdelivr.net/gh/ouyangyanhuo/[email protected]/assets/js/hoverable-collapse.js?v=' . $suffixVersion.'"></script>';
}

return $hed;
Expand All @@ -229,7 +238,7 @@ public static function renderFooter()
}
echo $ft;
}else{
echo '<script src="' . $url . 'assets/js/misc.js?v=' . $suffixVersion.'"></script>';
echo '<script src="https://fastly.jsdelivr.net/gh/ouyangyanhuo/[email protected]/assets/js/misc.js?v=' . $suffixVersion.'"></script>';
}

}
Expand Down
47 changes: 30 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
<!--
* @Author: ouyangyanhuo [email protected]
* @Date: 2022-05-22 15:06:27
* @LastEditors: ouyangyanhuo [email protected]
* @LastEditTime: 2022-05-22 15:07:15
* @FilePath: \undefinedc:\Users\PC_Magneto\.ssh\AdminMD\README.md
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
## AdminMD介绍

为Typecho博客程序专门美化的后台,框架主要采用MDUI

[![AdminMD](https://img.shields.io/badge/Magneto-AdminMD-brightgreen?style=for-the-badge&logo=github)](https://fmcf.cc/technology/37)
![Version](https://img.shields.io/badge/Version-1.7-critical?style=for-the-badge&logo=gitee)
![Repo-size](https://img.shields.io/github/repo-size/ouyangyanhuo/AdminMD?style=for-the-badge&logo=google)
![License](https://img.shields.io/github/license/ouyangyanhuo/AdminMD?style=for-the-badge&logo=twitter)
![Stars](https://img.shields.io/github/stars/ouyangyanhuo/AdminMD?style=for-the-badge&logo=Instagram)
![Forks](https://img.shields.io/github/forks/ouyangyanhuo/AdminMD?style=for-the-badge&logo=facebook)
![Version](https://img.shields.io/badge/Version-1.8-critical?style=for-the-badge)
![Repo-size](https://img.shields.io/github/repo-size/ouyangyanhuo/AdminMD?style=for-the-badge)
![License](https://img.shields.io/github/license/ouyangyanhuo/AdminMD?style=for-the-badge)
![Stars](https://img.shields.io/github/stars/ouyangyanhuo/AdminMD?style=for-the-badge)
![Forks](https://img.shields.io/github/forks/ouyangyanhuo/AdminMD?style=for-the-badge)

## 更新日志:

-新增鼠标美化
-新增更新检测

- 修复了自定义登录背景时的错误
- ✨ 新增一套背景

- 删除了部分无用内容
- 精简插件本体

- 优化了后台首页评论布局
- 后台首页覆写

- 重新定义了开发规范(相当于重写)

- 适配了Typecho 1.2

## 编程语言

PHP

## 安装教程
Expand All @@ -28,6 +41,12 @@ PHP

解压后文件夹名称必须为AdminMD

## 1.8 及以后版本注意事项

1.更改命名规则:Version1.8 → 1.8

2.将使用 Https 协议引用储存在仓库中的大部分静态资源,且使用Jsdeliv-Fastly线路,如果需要使用自建或本地静态资源,请自行研究。

## 使用须知

1.当前版本中仍存在部分不影响使用的未知Bug,一旦发现请务必反馈
Expand All @@ -36,7 +55,7 @@ PHP

3.由于 Typecho 程序默认使用的 Gravatar 官方的头像线路已被 GWF 屏蔽,因此会导致使用本主题时使后台完全加载缓慢。

4.部分用户使用本插件可能会有菜单栏不生效的问题
4.启用本插件后,若菜单栏未生效请清空缓存(服务器缓存)后,10分钟内会自动生效,禁用同理

### 解决 使用须知->3 问题的方法

Expand All @@ -58,12 +77,6 @@ $url = $isSecure ? 'https://sdn.geekzu.org' : 'http://www.gravatar.com';

其中 ``https://sdn.geekzu.org`` 可以替换为别的 Gravatar 国内代理地址

### 解决 使用须知->4 问题的方法

解决方法

复制插件目录中 ``/AdminMD/var/Widget/Meun.php`` 文件并粘贴到 ``/var/Widget`` 目录,并覆盖

## 下载渠道
1.Gitte [https://gitee.com/Magnetokuwan/AdminMD](https://gitee.com/Magnetokuwan/AdminMD) 适合国内(由GitHub同步至此)

Expand All @@ -73,4 +86,4 @@ $url = $isSecure ? 'https://sdn.geekzu.org' : 'http://www.gravatar.com';
![登录](https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/01/08/3af177c1328c3d1fc3da5ff26602feee.png "登录")
![后台首页](https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/748ba291663f8cb917662b703825cb4d.png "后台首页")
![文章撰写](https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/34c412ed6388b9ca1d72d65c89ce1f41.png "文章撰写")
![数据备份](https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/ff54bddcfd504694acaa493d67ee8eda.png "数据备份")
![数据备份](https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/ff54bddcfd504694acaa493d67ee8eda.png "数据备份")
6 changes: 3 additions & 3 deletions admin/common-js.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
<script src="<?php echo $options->pluginUrl . '/AdminMD/admin_js/jquery.js?v=' . $suffixVersion; ?>"></script>
<script src="<?php echo $options->pluginUrl . '/AdminMD/admin_js/jquery-ui.js?v=' . $suffixVersion; ?>"></script>
<script src="<?php echo $options->pluginUrl . '/AdminMD/admin_js/typecho.js?v=' . $suffixVersion;?>"></script>
<script src="https://fastly.jsdelivr.net/gh/ouyangyanhuo/AdminMD@Version1.7/admin_js/jquery.js?v=' . $suffixVersion; ?>"></script>
<script src="https://fastly.jsdelivr.net/gh/ouyangyanhuo/AdminMD@Version1.7/admin_js/jquery-ui.js?v=' . $suffixVersion; ?>"></script>
<script src="https://fastly.jsdelivr.net/gh/ouyangyanhuo/AdminMD@Version1.7/admin_js/typecho.js?v=' . $suffixVersion;?>"></script>
<script>
(function () {
$(document).ready(function() {
Expand Down
58 changes: 0 additions & 58 deletions admin/common.php

This file was deleted.

Loading

0 comments on commit 8cc2a36

Please sign in to comment.