MCPcopy Create free account
hub / github.com/KDAB/codebrowser / refreshHistoryBox

Function refreshHistoryBox

data/codebrowser.js:1294–1328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1292 }
1293
1294 function refreshHistoryBox() {
1295 try {
1296 historylog = JSON.parse(localStorage.getItem(historyKey));
1297 while(typeof historylog === "string") historylog = JSON.parse(historylog);
1298 } catch(e) {}
1299 if (historylog && historylog.length >= 1) {
1300 if ($("#historySideBox").length==0) {
1301 var dfnsDiv = $('<div id="historySideBox" class="sideBox"><h3>History</h3><ul></ul></div>');
1302 dfnsDiv.find('h3').click(function() {
1303 var hidden = !$("#historySideBox ul").toggle().is(":visible");
1304 createCookie('hisboxhid', hidden, 5);
1305 });
1306 dfnsDiv.attr("style", "top:" + document.getElementById('header').clientHeight + "px;");
1307
1308 $('#allSideBoxes').append(dfnsDiv);
1309 if (readCookie('hisboxhid') === "true")
1310 $("#historySideBox ul").hide()
1311 }
1312
1313 var html = "";
1314 historylog.forEach(function(o) {
1315 var name = o.name;
1316 if (!name) name = demangleFunctionName(o.ref);
1317 html = "<li><a href='"+o.url+"' data-ref='"+ o.ref +"' title='"+name+"'>"+escape_html(name)+"</a></li>" + html;
1318 } );
1319
1320 var theUl = $('#historySideBox ul');
1321 theUl.html(html);
1322
1323 var links = $("#historySideBox ul li a");
1324 links.on({"mouseenter": onMouseEnterRef,
1325 "mouseleave": onMouseLeave
1326 , "click": applyTo(onMouseEnterRef) });
1327 }
1328 }
1329 refreshHistoryBox(); // create/load
1330 if (location.hash && location.hash.length >= 0) {
1331 // Only do when non-numeric, e.g. if it is a real symbol and not a line number

Callers 2

pushHistoryLogFunction · 0.85
codebrowser.jsFile · 0.85

Calls 5

createCookieFunction · 0.85
readCookieFunction · 0.85
demangleFunctionNameFunction · 0.85
escape_htmlFunction · 0.85
applyToFunction · 0.85

Tested by

no test coverage detected