summaryrefslogtreecommitdiff
path: root/assets/js/main_new.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/main_new.js')
-rw-r--r--assets/js/main_new.js20
1 files changed, 0 insertions, 20 deletions
diff --git a/assets/js/main_new.js b/assets/js/main_new.js
index a6c10c6..c697391 100644
--- a/assets/js/main_new.js
+++ b/assets/js/main_new.js
@@ -1,22 +1,3 @@
-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 = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' };
-
- $('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 initCopyButtons() {
$('.copy').remove();
$('div.highlight').each(function () {
@@ -33,6 +14,5 @@ function initCopyButtons() {
}
$(function () {
- highlightKeyword();
initCopyButtons();
}); \ No newline at end of file