Skip to content

Commit

Permalink
0.842
Browse files Browse the repository at this point in the history
  • Loading branch information
solstice23 committed Feb 18, 2020
1 parent 823a770 commit 352f6e9
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Argon 使用 [GPL V3.0](https://github.com/solstice23/argon-theme/blob/master/LI

# 更新日志

## 20200219 v0.842
+ 添加 Mathjax 2,现在有 Mathjax 3 和 2 两个版本可以选择

## 20200217 v0.841
+ 增加 "留言板" 页面模板
+ 修复浮动操作按钮与 Font Awesome 5 的类名冲突兼容问题
Expand Down
5 changes: 5 additions & 0 deletions argontheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,11 @@ function pjaxLoadUrl(url , pushstate , scrolltop , oldscrolltop){
MathJax.typeset();
}
}catch (err){}
try{
if ($("script#mathjax_v2_script" , $vdom).length > 0){
MathJax.Hub.Typeset();
}
}catch (err){}

getGithubInfoCardContent();

Expand Down
21 changes: 21 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@
</script>
<script src="<?php echo get_option('argon_mathjax_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' : get_option('argon_mathjax_cdn_url'); ?>" id="MathJax-script" async></script>
<?php }?>
<?php if (get_option('argon_mathjax_v2_enable') == 'true' && get_option('argon_mathjax_enable') != 'true') { /*Mathjax V2 旧版本*/?>
<script type="text/x-mathjax-config" id="mathjax_v2_script">
MathJax.Hub.Config({
messageStyle: "none",
tex2jax: {
inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],
displayMath: [['$$','$$']],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
},
menuSettings: {
zoom: "Hover",
zscale: "200%"
},
"HTML-CSS": {
showMathMenu: "false"
}
});
</script>
<script src="<?php echo get_option('argon_mathjax_v2_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-AMS_HTML' : get_option('argon_mathjax_v2_cdn_url'); ?>"></script>
<?php }?>
</div>
</div>
<?php wp_footer(); ?>
Expand Down
36 changes: 35 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ function themeoptions_page(){
</tr>
<tr><th class="subtitle"><h2>Mathjax 渲染</h2></th></tr>
<tr>
<th><label>启用 Mathjax</label></th>
<th><label>启用 Mathjax (v3)</label></th>
<td>
<select name="argon_mathjax_enable">
<?php $argon_mathjax_enable = get_option('argon_mathjax_enable'); ?>
Expand All @@ -1489,6 +1489,38 @@ function themeoptions_page(){
<p class="description">Mathjax 3.0+,默认为 <code>//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js</code></p>
</td>
</tr>
<tr style="opacity: .6;" class="opacity-on-hover-1">
<th><label>启用旧版 Mathjax (v2)</label></th>
<td>
<select name="argon_mathjax_v2_enable">
<?php $argon_mathjax_v2_enable = get_option('argon_mathjax_v2_enable'); ?>
<option value="false" <?php if ($argon_mathjax_v2_enable=='false'){echo 'selected';} ?>>不启用</option>
<option value="true" <?php if ($argon_mathjax_v2_enable=='true'){echo 'selected';} ?>>启用</option>
</select>
<p class="description">
为了兼容性,Argon 保留了 Mathjax v2 旧版库的引用 (2.7.5 版本, jsdelivr CDN)</br>
推荐使用 Mathjax 3.0,而不要开启此选项</br>
该选项仅在 <strong>Mathjax 3.0 选项关闭时才生效</strong></br>
</p>
</td>
</tr>
<tr style="opacity: .6;" class="opacity-on-hover-1">
<th><label>Mathjax V2 CDN 地址</label></th>
<td>
<input type="text" class="regular-text" name="argon_mathjax_v2_cdn_url" value="<?php echo get_option('argon_mathjax_v2_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-AMS_HTML' : get_option('argon_mathjax_v2_cdn_url'); ?>"/>
<p class="description">Mathjax 2.0+,默认为 <code>//cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-AMS_HTML</code></br>
该地址仅对 Mathjax V2 生效
</p>
</td>
</tr>
<style>
.opacity-on-hover-1{
transition: all .3s ease;
}
.opacity-on-hover-1:hover{
opacity: 1 !important;
}
</style>
<tr><th class="subtitle"><h2>Lazyload</h2></th></tr>
<tr>
<th><label>是否启用 Lazyload</label></th>
Expand Down Expand Up @@ -1856,6 +1888,8 @@ function themeoptions_page(){
//Mathjax 相关配置项
update_option('argon_mathjax_enable', $_POST['argon_mathjax_enable']);
update_option('argon_mathjax_cdn_url', $_POST['argon_mathjax_cdn_url']);
update_option('argon_mathjax_v2_enable', $_POST['argon_mathjax_v2_enable']);
update_option('argon_mathjax_v2_cdn_url', $_POST['argon_mathjax_v2_cdn_url']);
/*update_option('argon_mathjax_loading_msg_type', $_POST['argon_mathjax_loading_msg_type']);
update_option('argon_mathjax_zoom_cond', $_POST['argon_mathjax_zoom_cond']);
update_option('argon_mathjax_zoom_scale', $_POST['argon_mathjax_zoom_scale']);
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" : "0.841",
"version" : "0.842",
"details_url" : "https://github.com/solstice23/argon-theme/releases",
"download_url" : "https://github.com/solstice23/argon-theme/releases/download/v0.841/argon.zip"
"download_url" : "https://github.com/solstice23/argon-theme/releases/download/v0.842/argon.zip"
}
2 changes: 1 addition & 1 deletion 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://abc233.site/
Description: 轻盈、简洁、美观的 Wordpress 主题
Version: 0.841
Version: 0.842
License: MIT License
License URI: https://opensource.org/licenses/MIT
Tags: 简约, 两栏, 侧栏在左边, 浮动侧栏, 文章目录, 自适应, 夜间模式, 可自定义
Expand Down

0 comments on commit 352f6e9

Please sign in to comment.