diff --git a/webroot/rsrc/css/core/syntax.css b/webroot/rsrc/css/core/syntax.css index fc251e11e0..e51b6a1f3a 100644 --- a/webroot/rsrc/css/core/syntax.css +++ b/webroot/rsrc/css/core/syntax.css @@ -131,6 +131,7 @@ .remarkup-code .rbw_v { color: violet; } .repository-crossreference .remarkup-code .nc, +.repository-crossreference .remarkup-code .na, .repository-crossreference .remarkup-code .nf { cursor: help; border-bottom: 1px dotted #bbddbb; diff --git a/webroot/rsrc/js/application/repository/repository-crossreference.js b/webroot/rsrc/js/application/repository/repository-crossreference.js index 8184ad6ba3..6a8c4c6078 100644 --- a/webroot/rsrc/js/application/repository/repository-crossreference.js +++ b/webroot/rsrc/js/application/repository/repository-crossreference.js @@ -21,17 +21,23 @@ JX.behavior('repository-crossreference', function(config) { return; } var target = e.getTarget(); - var map = {nc : 'class', nf : 'function'}; + var map = {nc : 'class', nf : 'function', na : null}; while (target !== document.body) { if (JX.DOM.isNode(target, 'span') && (target.className in map)) { var symbol = target.textContent || target.innerText; var uri = JX.$U('/diffusion/symbol/' + symbol + '/'); - uri.addQueryParams({ - type : map[target.className], + var query = { lang : config.lang, projects : config.projects.join(','), jump : true - }); + }; + if (map[target.className]) { + query.type = map[target.className]; + } + if (target.hasAttribute('data-symbol-context')) { + query.context = target.getAttribute('data-symbol-context'); + } + uri.addQueryParams(query); window.open(uri); e.kill(); break;