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

Function pushHistoryLog

data/codebrowser.js:1280–1292  ·  view source on GitHub ↗
(hist)

Source from the content-addressed store, hash-verified

1278 })();
1279
1280 function pushHistoryLog(hist) {
1281 if (!historylog) historylog = [];
1282 // don't add if recent history already constains this item
1283 if (historylog.length >= 1 && historylog[historylog.length - 1].ref === hist.ref) return;
1284 if (historylog.length >= 2 && historylog[historylog.length - 2].ref === hist.ref) return;
1285 if (historylog.length >= 3 && historylog[historylog.length - 3].ref === hist.ref) return;
1286 historylog.push(hist);
1287 if (historylog.length > 100)
1288 historylog = historylog.slice(-100);
1289 if (localStorage)
1290 localStorage.setItem(historyKey, JSON.stringify(historylog))
1291 refreshHistoryBox();
1292 }
1293
1294 function refreshHistoryBox() {
1295 try {

Callers 2

onMouseClickFunction · 0.85
codebrowser.jsFile · 0.85

Calls 1

refreshHistoryBoxFunction · 0.85

Tested by

no test coverage detected