Skip to content

Commit

Permalink
1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
solstice23 committed Oct 24, 2020
1 parent 2918bf4 commit 7a6893e
Show file tree
Hide file tree
Showing 435 changed files with 85 additions and 82,812 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ Argon 使用 [GPL V3.0](https://github.com/solstice23/argon-theme/blob/master/LI

# 更新日志

## 20201025 v1.1.1
+ 回滚 HTML Parse 代码
+ 修复 Fancybox 导致的一系列显示错误问题
+ 合并移动端割裂的 UI
+ 增加禁用 Google 字体选项

## 20201024 v1.1.1
+ 修复 Fancybox 可能会出现的 HTML Tag 提前闭合问题

Expand Down
17 changes: 16 additions & 1 deletion argontheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,21 @@ $(document).on("keydown" , "#navbar_search_input_container #navbar_search_input"
url: argonConfig.wp_path + "?s=" + encodeURI(word)
});
});
/*顶栏搜索 (Mobile)*/
$(document).on("keydown" , "#navbar_search_input_mobile" , function(e){
if (e.keyCode != 13){
return;
}
let word = $(this).val();
$("#navbar_global .collapse-close button").click();
if (word == ""){
return;
}
let scrolltop = $(document).scrollTop();
$.pjax({
url: argonConfig.wp_path + "?s=" + encodeURI(word)
});
});
/*侧栏搜索*/
$(document).on("click" , "#leftbar_search_container" , function(){
$(".leftbar-search-button").addClass("open");
Expand Down Expand Up @@ -1474,7 +1489,7 @@ $(document).on("click" , "#blog_categories .tag" , function(){

/*侧栏 & 顶栏菜单手机适配*/
!function(){
$(document).on("click" , "#fabtn_open_sidebar" , function(){
$(document).on("click" , "#fabtn_open_sidebar, #open_sidebar" , function(){
$("html").addClass("leftbar-opened");
});
$(document).on("click" , "#sidebar_mask" , function(){
Expand Down
4 changes: 2 additions & 2 deletions assets/argon_css_merged.css

Large diffs are not rendered by default.

34 changes: 14 additions & 20 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ function theme_slug_setup() {
}
add_action('after_setup_theme','theme_slug_setup');

require_once('vendor/autoload.php');

$GLOBALS['theme_version'] = wp_get_theme() -> Version;
$argon_assets_path = get_option("argon_assets_path");
if ($argon_assets_path== "jsdelivr"){
Expand Down Expand Up @@ -1425,29 +1423,13 @@ function argon_lazyload($content){
}
return $content;
}
use DiDom\Document;
use DiDom\Element;
function argon_fancybox($content){
if(!is_feed() && !is_robots() && !is_home()){
$document = new Document("<div id='DIDOM_ROOT_DIV'>" . $content . "</div>");
//$document = $document -> find('#DIDOM_ROOT_DIV')[0];
$imgs = $document -> find('img');
foreach ($imgs as $img){
if ($img -> hasAttribute('data-original')){
$href = $img -> getAttribute('data-original');
}else{
$href = $img -> getAttribute('src');
}
$tmp = new Element("div", null, array('class' => 'fancybox-wrapper', 'data-fancybox' => 'post-images', 'href' => $href));
$tmp -> appendChild($img);
$img -> replace($tmp);
}
/*if (get_option('argon_enable_lazyload') != 'false'){
if (get_option('argon_enable_lazyload') != 'false'){
$content = preg_replace('/<img(.*?)data-original=[\'"](.*?)[\'"](.*?)((\/>)|>|(<\/img>))/i',"<div class='fancybox-wrapper' data-fancybox='post-images' href='$2'>$0</div>" , $content);
}else{
$content = preg_replace('/<img(.*?)src=[\'"](.*?)[\'"](.*?)((\/>)|>|(<\/img>))/i',"<div class='fancybox-wrapper' data-fancybox='post-images' href='$2'>$0</div>" , $content);
}*/
$content = $document -> find('#DIDOM_ROOT_DIV')[0] -> innerHtml();
}
}
return $content;
}
Expand Down Expand Up @@ -3696,6 +3678,17 @@ function themeoptions_page(){
<p class="description"></p>
</td>
</tr>
<tr>
<th><label><?php _e('禁用 Google 字体', 'argon');?></label></th>
<td>
<select name="argon_disable_googlefont">
<?php $argon_disable_googlefont = get_option('argon_disable_googlefont'); ?>
<option value="false" <?php if ($argon_disable_googlefont=='false'){echo 'selected';} ?>><?php _e('不禁用', 'argon');?></option>
<option value="true" <?php if ($argon_disable_googlefont=='true'){echo 'selected';} ?>><?php _e('禁用', 'argon');?></option>
</select>
<p class="description"><?php _e('Google 字体在中国大陆访问可能会阻塞,禁用可以解决页面加载被阻塞的问题。禁用后,Serif 字体将失效。', 'argon');?></p>
</td>
</tr>
<tr>
<th><label><?php _e('检测更新源', 'argon');?></label></th>
<td>
Expand Down Expand Up @@ -4104,6 +4097,7 @@ function argon_update_themeoptions(){
argon_update_option('argon_related_post_limit');
argon_update_option('argon_article_header_style');
argon_update_option('argon_text_gravatar');
argon_update_option('argon_disable_googlefont');

//LazyLoad 相关
argon_update_option('argon_enable_lazyload');
Expand Down
47 changes: 21 additions & 26 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<?php
wp_enqueue_style("argon_css_merged", $GLOBALS['assets_path'] . "/assets/argon_css_merged.css", null, $GLOBALS['theme_version']);
wp_enqueue_style("style", $GLOBALS['assets_path'] . "/style.css", null, $GLOBALS['theme_version']);
wp_enqueue_style("googlefont", "//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|Noto+Serif+SC:300,600&display=swap");
if (get_option('argon_disable_googlefont') != 'true') {wp_enqueue_style("googlefont", "//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|Noto+Serif+SC:300,600&display=swap");}
wp_enqueue_script("argon_js_merged", $GLOBALS['assets_path'] . "/assets/argon_js_merged.js", null, $GLOBALS['theme_version']);
wp_enqueue_script("argonjs", $GLOBALS['assets_path'] . "/assets/js/argon.min.js", null, $GLOBALS['theme_version']);
?>
Expand Down Expand Up @@ -259,19 +259,21 @@ function toggleAmoledDarkMode(){
<header class="header-global">
<nav id="navbar-main" class="navbar navbar-main navbar-expand-lg navbar-transparent navbar-light bg-primary headroom--not-bottom headroom--not-top headroom--pinned">
<div class="container">
<?php if (get_option('argon_toolbar_icon') != '') { /*顶栏ICON(如果选项中开启)*/?>
<a class="navbar-brand navbar-icon mr-lg-5" href="<?php echo get_option('argon_toolbar_icon_link'); ?>">
<img src="<?php echo get_option('argon_toolbar_icon'); ?>">
</a>
<?php }?>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar_global" aria-controls="navbar_global" aria-expanded="false" aria-label="Toggle navigation">
<button id="open_sidebar" class="navbar-toggler" type="button" aria-expanded="false" aria-label="Toggle sidebar">
<span class="navbar-toggler-icon"></span>
</button>
<?php /*顶栏标题*/?>
<a class="navbar-brand" href="<?php bloginfo('url'); ?>"><?php echo get_option('argon_toolbar_title') == '' ? bloginfo('name') : get_option('argon_toolbar_title'); ?></a>
<div class="navbar-brand mr-0">
<?php if (get_option('argon_toolbar_icon') != '') { /*顶栏ICON(如果选项中开启)*/?>
<a class="navbar-brand navbar-icon mr-lg-5" href="<?php echo get_option('argon_toolbar_icon_link'); ?>">
<img src="<?php echo get_option('argon_toolbar_icon'); ?>">
</a>
<?php }?>
<?php /*顶栏标题*/?>
<a class="navbar-brand navbar-title" href="<?php bloginfo('url'); ?>"><?php echo get_option('argon_toolbar_title') == '' ? bloginfo('name') : get_option('argon_toolbar_title'); ?></a>
</div>
<div class="navbar-collapse collapse" id="navbar_global">
<div class="navbar-collapse-header">
<div class="row">
<div class="row" style="display: none;">
<div class="col-6 collapse-brand"></div>
<div class="col-6 collapse-close">
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar_global" aria-controls="navbar_global" aria-expanded="false" aria-label="Toggle navigation">
Expand All @@ -280,15 +282,13 @@ function toggleAmoledDarkMode(){
</button>
</div>
</div>
<div class="input-group input-group-alternative">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-search"></i></span>
</div>
<input id="navbar_search_input_mobile" class="form-control" placeholder="搜索什么..." type="text" autocomplete="off">
</div>
</div>
<ul id="navbar_search_btn_mobile" class="navbar-nav align-items-lg-center ml-lg-auto">
<li class="nav-item" data-toggle="modal" data-target="#argon_search_modal" style="padding-left: 5px;">
<a class="nav-link nav-link-icon">
<i class="fa fa-search"></i>
<span class="nav-link-inner--text d-lg-none"><?php _e('搜索', 'argon');?></span>
</a>
</li>
</ul>
<?php
/*顶栏菜单*/
class toolbarMenuWalker extends Walker_Nav_Menu{
Expand Down Expand Up @@ -352,12 +352,10 @@ public function end_el( &$output, $object, $depth = 0, $args = array(), $current
</li>
</ul>
</div>
<?php if (get_option('argon_toolbar_icon') != '') { /*顶栏ICON (Mobile)*/?>
<a class="navbar-brand navbar-icon-mobile" href="<?php echo get_option('argon_toolbar_icon_link'); ?>">
<img src="<?php echo get_option('argon_toolbar_icon'); ?>">
</a>
<?php }?>
<div id="navbar_menu_mask" data-toggle="collapse" data-target="#navbar_global"></div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar_global" aria-controls="navbar_global" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon navbar-toggler-searcg-icon"></span>
</button>
</div>
</nav>
</header>
Expand Down Expand Up @@ -544,9 +542,6 @@ public function end_el( &$output, $object, $depth = 0, $args = array(), $current
</div>
<?php }?>
</div>
<button id="fabtn_open_sidebar" class="btn btn-icon btn-neutral fabtn shadow-sm" type="button" aria-label="Open Sidebar Menu" tooltip="<?php _e('菜单', 'argon'); ?>">
<span class="btn-inner--icon"><i class="fa fa-bars"></i></span>
</button>
<button id="fabtn_reading_progress" class="btn btn-icon btn-neutral fabtn shadow-sm" type="button" aria-hidden="true" tooltip="<?php _e('阅读进度', 'argon'); ?>">
<div id="fabtn_reading_progress_bar" style="width: 0%;"></div>
<span id="fabtn_reading_progress_details">0%</span>
Expand Down
4 changes: 2 additions & 2 deletions info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version" : "1.1.1",
"version" : "1.1.2",
"details_url" : "https://github.com/solstice23/argon-theme/releases",
"download_url" : "https://github.com/solstice23/argon-theme/releases/download/v1.1.1/argon.zip"
"download_url" : "https://github.com/solstice23/argon-theme/releases/download/v1.1.2/argon.zip"
}
31 changes: 24 additions & 7 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Theme Name: argon
Author: solstice23
Author URI: https://solstice23.top/
Description: 轻盈、简洁、美观的 Wordpress 主题
Version: 1.1.1
Version: 1.1.2
License: GNU General Public License v3.0
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: 简约, 两栏, 侧栏在左边, 浮动侧栏, 文章目录, 自适应, 夜间模式, 可自定义
Expand Down Expand Up @@ -462,7 +462,7 @@ html.darkmode.amoled-dark #navbar-main{
max-width: 1200px !important;
}
}
@media (min-width: 992px){
@media (min-width: 900px){
.navbar-main .container {
max-width: 100%;
}
Expand All @@ -472,6 +472,7 @@ html.darkmode.amoled-dark #navbar-main{
}
.navbar-brand {
text-transform: none;
vertical-align: middle;
}
.navbar-brand:focus , .navbar-brand:hover{
color: #fff !important;
Expand Down Expand Up @@ -2647,7 +2648,7 @@ html.darkmode.amoled-dark .friend-links-style1 .friend-link-description:after {
.friend-links-style2.friend-links-style2-big .friend-link-links > a {
margin-right: 12px;
}
@media (min-width: 992px){
@media (min-width: 900px){
.friend-links.friend-links-style2-big .link {
max-width: 33.33333%;
flex: 0 0 33.33333%;
Expand Down Expand Up @@ -4198,10 +4199,16 @@ html.darkmode.amoled-dark #content:before , html.darkmode.amoled-dark #content:a
height: 20px;
}
}
@media screen and (max-width:991.98px){
@media screen and (max-width:900px){
.navbar-toggler{
outline: none !important;
}
.navbar-collapse-header{
border: none !important;
}
.navbar-collapse .navbar-collapse-header{
margin-bottom: 0 !important;
}
html.darkmode #navbar_global {
background: #424242;
}
Expand All @@ -4212,17 +4219,19 @@ html.darkmode.amoled-dark #content:before , html.darkmode.amoled-dark #content:a
background: #eee;
}
html.darkmode .navbar-collapse .navbar-collapse-header {
border-bottom: 1px solid rgba(255,255,255,.1);
/*border-bottom: 1px solid rgba(255,255,255,.1);*/
}

.navbar-brand.navbar-icon {
/*.navbar-brand.navbar-icon {
display: none;
}
.navbar-brand.navbar-icon-mobile {
display: block;
margin-right: 5px;
}*/
.navbar-title{
margin-right: 0;
}

#navbar_search_btn_mobile{
display: list-item;
}
Expand All @@ -4245,6 +4254,14 @@ html.darkmode.amoled-dark #content:before , html.darkmode.amoled-dark #content:a
text-align: center;
width: 14px;
}

.navbar-transparent .navbar-toggler-icon {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNC4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0i5Zu+5bGCXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzAgMzAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMwIDMwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxsaW5lIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIyLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiB4MT0iNi4zIiB5MT0iNCIgeDI9IjI3LjEiIHkyPSI0Ii8+DQo8bGluZSBmaWxsPSJub25lIiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMi41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgeDE9IjYuMyIgeTE9IjEyLjUiIHgyPSIyNy4xIiB5Mj0iMTIuNSIvPg0KPGxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjRkZGRkZGIiBzdHJva2Utd2lkdGg9IjIuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHgxPSI2LjMiIHkxPSIyMSIgeDI9IjI3LjEiIHkyPSIyMSIvPg0KPC9zdmc+DQo=);
}
.navbar-toggler-searcg-icon {
background-image: url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMzAgMzAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMwIDMwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48Zz48Y2lyY2xlIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIyLjUiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgY3g9IjE0IiBjeT0iMTEuNiIgcj0iOC44Ii8+PGxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjRkZGRkZGIiBzdHJva2Utd2lkdGg9IjIuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHgxPSIyMC43IiB5MT0iMTcuNCIgeDI9IjI3LjMiIHkyPSIyNCIvPjwvZz48L3N2Zz4=) !important;
}

}
@media screen and (min-width:900px) and (max-width:1000px){
#leftbar_part2.sticky {
Expand Down
7 changes: 0 additions & 7 deletions vendor/autoload.php

This file was deleted.

Loading

0 comments on commit 7a6893e

Please sign in to comment.