• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionaeca84f13eb57ee3b3cc02cdf0952f330d81dca2 (tree)
Zeit2019-08-16 02:23:09
Autorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2489 search2 plugin - Async search now refers $show_passage

Ändern Zusammenfassung

Diff

--- a/lib/html.php
+++ b/lib/html.php
@@ -227,6 +227,7 @@ function get_html_scripting_data($page, $in_editing)
227227 global $external_link_cushion_page, $external_link_cushion;
228228 global $topicpath_title;
229229 global $ticket_jira_default_site;
230+ global $show_passage;
230231 if (!isset($ticket_link_sites) || !is_array($ticket_link_sites)) {
231232 return '';
232233 }
@@ -240,10 +241,12 @@ function get_html_scripting_data($page, $in_editing)
240241 EOS;
241242 return $empty_data;
242243 }
244+ $is_show_passage = (bool)($show_passage !== 0);
243245 // Site basic Properties
244246 $props = array(
245247 'is_utf8' => $is_utf8,
246248 'json_enabled' => $json_enabled,
249+ 'show_passage' => $is_show_passage,
247250 'base_uri_pathname' => get_base_uri(PKWK_URI_ROOT),
248251 'base_uri_absolute' => get_base_uri(PKWK_URI_ABSOLUTE)
249252 );
--- a/skin/search2.js
+++ b/skin/search2.js
@@ -658,6 +658,7 @@ window.addEventListener && window.addEventListener('DOMContentLoaded', function(
658658 * @param {boolean} insertTop
659659 */
660660 function addSearchResult(results, searchText, searchRegex, parentElement, insertTop) {
661+ var props = getSiteProps();
661662 var now = new Date();
662663 var parentFragment = document.createDocumentFragment();
663664 results.forEach(function(val) {
@@ -670,8 +671,12 @@ window.addEventListener && window.addEventListener('DOMContentLoaded', function(
670671 decoratedName = escapeHTML(val.name);
671672 }
672673 var updatedAt = val.updatedAt;
673- var liHtml = '<a href="' + escapeHTML(href) + '">' + decoratedName + '</a> ' +
674- getPassage(now, updatedAt);
674+ var passageHtml = '';
675+ if (props.show_passage) {
676+ passageHtml = ' ' + getPassage(now, updatedAt);
677+ }
678+ var liHtml = '<a href="' + escapeHTML(href) + '">' +
679+ decoratedName + '</a>' + passageHtml;
675680 li.innerHTML = liHtml;
676681 li.setAttribute('data-pagename', val.name);
677682 fragment.appendChild(li);