'
);
$('#navigator').prepend('');
$('#blog_nav_contact').parent().after(
' 我的收藏 ' +
' 园子 ' +
' 短消息 '
);
$('#blogTitle h1,#lnkBlogLogo').attr('title', $('#blogTitle h2').text());
$('#navigator').append(
' '
);
if (isLogined) {
$('#navList').append(
'' +
' 退出登录 '
);
} else {
$('#navList').append(
'' +
'登录 '
);
}
//导航下拉
$("#nav-home-btn").click(function(event) {
$('#navList').slideToggle('fast');
$(document).one('click', function() {
$('#navList').hide();
});
event.stopPropagation();
});
$('#navList').one('click', function(event) {
event.stopPropagation();
});
//侧边收起
$("#sidebar-toggler").bind('click', function() {
$('#sideBar').toggleClass('sideBar-open');
$("body").toggleClass('lyear-layout-sidebar-close');
$('#sidebar-toggler').toggleClass('sidebar-toggler-reverse');
if ($('.lyear-mask-modal').length == 0) {
$('').prependTo('body');
} else {
$('.lyear-mask-modal').remove();
}
$('.lyear-mask-modal').on('click', function() {
$(this).remove();
$('#sideBar').toggleClass('sideBar-open');
$('body').toggleClass('lyear-layout-sidebar-close');
});
});
// 悬浮按钮
$('#page_end_html').prepend(
'
');
$(".copyItem").css('position', 'relative');
$('pre').eq(i).before('');
$('pre').eq(i).attr('id', 'copy_target_' + i);
}
var clipboard = new ClipboardJS('.clipboard-button');
clipboard.on('success', function(e) {
e.trigger.innerHTML = '成功';
setTimeout(function() {
e.trigger.innerHTML = '';
}, 2 * 1000);
e.clearSelection();
});
clipboard.on('error', function(e) {
e.trigger.innerHTML = '失败';
setTimeout(function() {
e.trigger.innerHTML = '';
}, 2 * 1000);
e.clearSelection();
});
}
//*关闭作者的看图功能*/
// // fancybox
// $(".cnblogs-markdown img").each(function() {
// var element = document.createElement("a");
// $(element).attr("data-fancybox", "gallery");
// $(element).attr("href", $(this).attr("src"));
// $(this).wrap(element);
// })
});
// 设置网页favicon图标
setFavicon = function(favicon) {
$('head').append($('').attr('href', favicon));
}
// 设置滚动通知
setNews = function(news) {
str1 = "";
for (var i = 0; i ' + news[i] +
' ';
}
str = '- ' + str1 + '
' +
'
';
SlideShow = function(c) {
var a = document.getElementById("slideContainer"),
f = document.getElementById("slidesImgs").getElementsByTagName("li"),
h = document.getElementById("slideBar"),
n = h.getElementsByTagName("li"),
d = f.length,
c = c || 3000,
e = lastI = 0,
j, m;
b = function() {
m = setInterval(function() {
e = e + 1 >= d ? e + 1 - d : e + 1;
g()
}, c)
}
k = function() {
clearInterval(m)
}
g = function() {
f[lastI].style.display = "none";
n[lastI].className = "";
f[e].style.display = "block";
n[e].className = "on";
lastI = e
}
f[e].style.display = "block";
a.onmouseover = k;
a.onmouseout = b;
h.onmouseover = function(i) {
j = i ? i.target : window.event.srcElement;
if (j.nodeName === "LI") {
e = parseInt(j.innerHTML, 10) - 1;
g()
}
};
b()
};
if ($('.day').length > 0) {
$('.forFlow').prepend($(str)) //首页轮播
SlideShow(3000);
}
}
// 教学日历
getStudyCalendar = function() {
var start = ["2019-02-25", "2019-09-02", "2020-02-10", "2020-08-31", "2021-02-22", "2021-08-30", "2022-02-21",
"2022-08-22", "2023-02-06"
];
var end = ["2019-07-12", "2020-01-10", "2020-07-03", "2021-01-22", "2021-07-02", "2022-01-21", "2022-07-08",
"2023-01-06", "2023-06-23"
];
between = function(time1, time2) {
var time = Date.parse(new Date());
var date1 = Date.parse(new Date(time1.replace(/-/g, '/')));
var date2 = Date.parse(new Date(time2.replace(/-/g, '/')));
if (date1 = time) {
return true;
}
return false;
}
day = function(s1) {
s1 = new Date(s1.replace(/-/g, "/"));
s2 = new Date(); //当前日期
var days = s2.getTime() - s1.getTime();
var time = parseInt(days / (1000 * 60 * 60 * 24)) + 1;
return day = Math.ceil(time / 7);
}
study = function(s1) {
s1 = new Date(s1.replace(/-/g, "/"));
s2 = new Date(); //当前日期
var days = s2.getTime() - s1.getTime();
var time = parseInt(days / (1000 * 60 * 60 * 24)) + 1;
return time;
}
for (var i = 0; i ' +
'' +
'' +
'' +
'' +
'' +
'
' +
'' +
'
' +
'' +
'
' +
' ' +
' ' +
'