Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #10 from paizi/master
Browse files Browse the repository at this point in the history
文章目录位置修复 & 友情链接随机排序开关
  • Loading branch information
FlyingSky-CN authored Oct 25, 2019
2 parents 23c1d0c + 23dd20e commit eeceb19
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
13 changes: 13 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,19 @@ classes: {
);
$form->addInput($mdrPray);


$RandomLinks = new Typecho_Widget_Helper_Form_Element_Radio(
'RandomLinks',
array(
true => _t(''),
false => _t('')
),
ture,
_t('友情链接随机排序'),
_t('开启后友情链接将按照随机顺序排列')
);
$form->addInput($RandomLinks);

$mdrHitokoto = new Typecho_Widget_Helper_Form_Element_Radio(
'mdrHitokoto',
array(
Expand Down
4 changes: 3 additions & 1 deletion page-links.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
<?php $this->need('comments.php'); ?>
</div>
<?php $this->need('footer.php'); ?>
<?php if ($this->options->RandomLinks): ?>
<script>
var cards = $(".mdui-col");
for (var i = 0; i < cards.length; i++) {
var target1 = Math.floor(Math.random() * cards.length - 1) + 1;
var target2 = Math.floor(Math.random() * cards.length - 1) + 1;
cards.eq(target1).before(cards.eq(target2));
}
</script>
</script>
<?php endif; ?>
4 changes: 2 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -730,13 +730,13 @@ button, input[type=submit], .menu-parent a, .rewards a {
margin:0
}
#catalog-col.catalog {
right:50px;
right:80px;
margin:0
}
}
@media(max-width:990px) {
#catalog-col.catalog {
right:45px
right:70px
}
}
@media(max-width:768px) {
Expand Down

0 comments on commit eeceb19

Please sign in to comment.