mirror of
https://github.com/Mabbs/mabbs.github.io
synced 2026-06-30 14:22:40 -03:00
Update 5 files
- /_data/other_repo_list.csv - /index.html - /_posts/2026-07-01-vibe-coding.md - /assets/js/main_new.js - /assets/js/main.js
This commit is contained in:
@@ -17,6 +17,25 @@ function initVisitors() {
|
||||
}
|
||||
}
|
||||
|
||||
function highlightKeyword() {
|
||||
var match = location.search.match(/[?&]kw=([^&]+)/);
|
||||
var kw = match ? $.trim(decodeURIComponent(match[1].replace(/\+/g, ' '))) : '';
|
||||
if (!kw) return;
|
||||
|
||||
var reg = new RegExp('(' + kw.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + ')', 'gi');
|
||||
var escapeMap = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' };
|
||||
|
||||
$('section, section *').not('script, style, textarea').contents().filter(function () {
|
||||
return this.nodeType === 3;
|
||||
}).each(function () {
|
||||
var escapedText = this.nodeValue.replace(/[&<>"']/g, function (m) { return escapeMap[m]; });
|
||||
var highlighted = escapedText.replace(reg, '<mark>$1</mark>');
|
||||
if (escapedText !== highlighted) {
|
||||
$(this).replaceWith(highlighted);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
(function () {
|
||||
var $backToTopTxt = "返回顶部", $backToTopEle = $('<div class="backToTop"></div>').appendTo($("body"))
|
||||
@@ -42,6 +61,7 @@ $(function () {
|
||||
});
|
||||
console.warn("Mayx may already be Dead");
|
||||
}
|
||||
highlightKeyword();
|
||||
});
|
||||
|
||||
function getSearchJSON(callback) {
|
||||
|
||||
Reference in New Issue
Block a user