Commit MetaInfo

修订版06e9aa8418ee14e3db091607e0c3c7576be2673a (tree)
时间2017-10-05 04:33:10
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

Color simple qwq

更改概述

差异

--- a/skin/search2.js
+++ b/skin/search2.js
@@ -286,13 +286,6 @@ window.addEventListener && window.addEventListener('DOMContentLoaded', function(
286286 var liHtml = '<a href="' + escapeHTML(href) + '">' + decoratedName + '</a> ' +
287287 getPassage(now, updatedAt);
288288 li.innerHTML = liHtml;
289- var a = li.querySelector('a');
290- if (a && a.hash) {
291- if (a.hash !== hash) {
292- // Some browser execute encodeHTML(hash) automatically. Support them.
293- a.href = val.url + '#encq=' + encodeSearchTextForHash(searchText);
294- }
295- }
296289 li.setAttribute('data-pagename', val.name);
297290 fragment.appendChild(li);
298291 var div = document.createElement('div');
@@ -724,7 +717,6 @@ window.addEventListener && window.addEventListener('DOMContentLoaded', function(
724717 return null;
725718 }
726719 function getSearchTextInLocationHash() {
727- // TODO Cross browser
728720 var hash = location.hash;
729721 if (!hash) return '';
730722 var q = '';
@@ -733,6 +725,10 @@ window.addEventListener && window.addEventListener('DOMContentLoaded', function(
733725 } else if (hash.substr(0, 6) === '#encq=') {
734726 q = decodeURIComponent(hash.substr(6).replace(/\+/g, ' '));
735727 }
728+ var decodedQ = decodeURIComponent(q);
729+ if (q !== decodedQ) {
730+ q = decodedQ + ' OR ' + q;
731+ }
736732 return q;
737733 }
738734 function colorSearchTextInBody() {
Show on old repository browser