Skip to content

Commit

Permalink
1112
Browse files Browse the repository at this point in the history
  • Loading branch information
owen0o0 committed Nov 21, 2019
1 parent ebbf4a9 commit ec67eab
Show file tree
Hide file tree
Showing 14 changed files with 717 additions and 606 deletions.
48 changes: 38 additions & 10 deletions css/nav.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
})
}
})
$('.user-info-menu .hidden-sm').click(function(){
$('.user-info-menu .hidden-xs').click(function(){
if($('.sidebar-menu').hasClass('collapsed')) {
$('.has-sub.expanded > ul').attr("style","")
} else {
Expand Down
5 changes: 5 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@
//登陆界面logo的title为博客副标题
add_filter('login_headertext',function() {return get_bloginfo( 'description' );});

//WordPress 5.0+移除 block-library CSS
add_action( 'wp_enqueue_scripts', 'fanly_remove_block_library_css', 100 );
function fanly_remove_block_library_css() {
wp_dequeue_style( 'wp-block-library' );
}
3 changes: 1 addition & 2 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
<meta property="og:site_name" content="<?php echo io_get_option('seo_home_desc') ?>">
<link rel="shortcut icon" href="<?php echo io_get_option('favicon') ?>">
<link rel="apple-touch-icon" href="<?php echo io_get_option('apple_icon') ?>">
<link rel="stylesheet" href="//fonts.loli.net/css?family=Arimo:400,700,400italic">
<?php wp_head(); ?>
</head>
<body class="page-body">
<body class="page-body <?php echo io_get_option('theme_mode')?>">
<div class="page-container">

6 changes: 5 additions & 1 deletion inc/fav-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ function fav_con($mid) { ?>
<div class="xe-widget xe-conversations box2 label-info" onclick="window.open('<?php echo io_get_option('is_go')? '/go/?url='.base64_encode($link_url) : $link_url ?>', '_blank')" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="<?php echo $link_url ?>">
<div class="xe-comment-entry">
<a class="xe-user-img">
<img src="<?php echo get_post_meta($post->ID, '_thumbnail', true)? get_post_meta($post->ID, '_thumbnail', true): ('https://f.ydr.me/'.$link_url) ?>" onerror="javascript:this.src='<?php echo $default_ico; ?>'" class="img-circle" width="40">
<?php if(io_get_option('lazyload')): ?>
<img class="img-circle lazy" src="images/favicon.png" data-src="<?php echo get_post_meta($post->ID, '_thumbnail', true)? get_post_meta($post->ID, '_thumbnail', true): ('https://f.ydr.me/'.$link_url) ?>" onerror="javascript:this.src='<?php echo $default_ico; ?>'" width="40">
<?php else: ?>
<img class="img-circle lazy" src="<?php echo get_post_meta($post->ID, '_thumbnail', true)? get_post_meta($post->ID, '_thumbnail', true): ('https://f.ydr.me/'.$link_url) ?>" onerror="javascript:this.src='<?php echo $default_ico; ?>'" width="40">
<?php endif ?>
</a>
<div class="xe-comment">
<a href="javascript:void(0)" class="xe-user-name overflowClip_1">
Expand Down
29 changes: 23 additions & 6 deletions inc/frame/config/framework.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// ===============================================================================================
$settings = array(
'menu_title' => __('主题设置','io_setting'),
'menu_type' => 'theme', // menu, submenu, options, theme, etc.
'menu_type' => 'menu', // menu, submenu, options, theme, etc.
'menu_slug' => 'io_get_option',
'menu_position' => 59,
'menu_icon' => CS_URI.'/assets/images/setting.png',
Expand Down Expand Up @@ -72,12 +72,12 @@
'type' => 'radio',
'title' => '网址列数',
'desc' => '一行显示个数',
'default' => 'col-md-4 col-lg-3',
'default' => 'col-sm-4 col-md-3',
'class' => 'horizontal',
'options' => array(
'col-md-6' => '2',
'col-md-4' => '3',
'col-md-4 col-lg-3' => '4',
'col-sm-6' => '2',
'col-sm-4' => '3',
'col-sm-4 col-md-3' => '4',
'col-sm-4 col-md-3 col-lg-2' => '6'
),
),
Expand All @@ -86,11 +86,28 @@
'content' => '其他设置',
'class' => 'info',
),
array(
'id' => 'theme_mode',
'type' => 'radio',
'title' => '颜色主题',
'default' => 'white',
'class' => 'horizontal',
'options' => array(
'black' => '暗色',
'white' => '亮色'
),
),
array(
'id' => 'icp',
'type' => 'text',
'title' => '备案号',
),
array(
'id' => 'lazyload',
'type' => 'switcher',
'title' => '图标懒加载',
'default' => false,
),
array(
'id' => 'is_search',
'type' => 'switcher',
Expand All @@ -101,7 +118,7 @@
'id' => 'is_go',
'type' => 'switcher',
'title' => '内链跳转',
'default' => true,
'default' => false,
),
),
);
Expand Down
39 changes: 36 additions & 3 deletions inc/meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
"thumbnail" => array(
"name" => "_thumbnail",
"std" => "",
"title" => "添加图片地址,调用指定缩略图",
"type"=>"text"),
"title" => "添加图标地址,调用自定义图标",
"size" => "",
'button_text' => '添加图标',
"type"=>"upload"),
);

// 面板内容
Expand Down Expand Up @@ -73,7 +75,13 @@ function new_meta_sites_boxes() {
else $checked = '';
echo '<br /><label><input type="checkbox" name="' . $meta_box['name'] . '" value="true" ' . $checked . ' />';
echo '' . $meta_box['title'] . '</label><br />';
break;
break;
case 'upload':
$button_text = (isset($meta_box['button_text'])) ? $meta_box['button_text'] : 'Upload';
echo '<h4>' . $meta_box['title'] . '</h4>';
echo '<input class="damiwp_url_input" style="width: 95%;margin-bottom: 10px;" type="text" id="'.$meta_box['name'].'_input" size="'.$meta_box['size'].'" value="'.$meta_box['std'].'" name="'.$meta_box['name'].'"/><a href="#" id="'.$meta_box['name'].'" class="dami_upload_button button">'.$button_text.'</a>';
add_script_and_styles();
break;
}
}
}
Expand Down Expand Up @@ -103,3 +111,28 @@ function save_sites_postdata($post_id) {
add_action('admin_menu', 'create_meta_sites_box');
add_action('save_post', 'save_sites_postdata');

function add_script_and_styles() {
echo "<script>
jQuery(document).ready(function(){
var dami_upload_frame;
var value_id;
jQuery('.dami_upload_button').live('click',function(event){
value_id =jQuery( this ).attr('id');
event.preventDefault();
if( dami_upload_frame ){
dami_upload_frame.open();
return;
}
dami_upload_frame = wp.media({
title: '上传图片',
button: {
text: '确定',
},
multiple: false
});
dami_upload_frame.on('select',function(){
attachment = dami_upload_frame.state().get('selection').first().toJSON();
//jQuery('#'+value_id+'_input').val(attachment.url).trigger('change');
jQuery('input[name='+value_id+']').val(attachment.url).trigger('change');});dami_upload_frame.open();});});
</script>";
}
12 changes: 7 additions & 5 deletions inc/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ function theme_load_scripts() {

wp_register_script( 'bootstrap', THEME_URL.'/js/bootstrap.min.js', array('jquery'), $theme_version, true );
wp_register_script( 'TweenMax', THEME_URL.'/js/TweenMax.min.js', array('jquery'), $theme_version, true );
wp_register_script( 'app', THEME_URL.'/js/app.js', array('jquery'), $theme_version, true );
wp_register_script( 'appjs', THEME_URL.'/js/app.js', array('jquery'), $theme_version, true );
wp_register_script( 'lazyload', THEME_URL.'/js/lazyload.min.js', array('jquery'), $theme_version, true );

if( !is_admin() )
{
wp_enqueue_style('font-awesome');
wp_enqueue_style('bootstrap');
wp_enqueue_style('nav');

wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', THEME_URL.'/js/jquery-1.11.1.min.js', array(), $theme_version ,false);
wp_enqueue_script('jquery');

wp_enqueue_script('bootstrap');
wp_enqueue_script('TweenMax');
wp_enqueue_script('app');

wp_enqueue_script('appjs');

if(io_get_option('lazyload')) wp_enqueue_script('lazyload');

if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
Expand Down
Loading

0 comments on commit ec67eab

Please sign in to comment.