Skip to content

Commit 569183f

Browse files
committed
add validation link
1 parent b584132 commit 569183f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

assets/client.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,28 @@ function processObject(object, toplevel, followReferral=true, followingReferral=
465465
title.appendChild(document.createTextNode(titleText));
466466
card.appendChild(title);
467467

468+
if (toplevel) {
469+
const vbutton = document.createElement('button');
470+
vbutton.classList.add('btn', 'btn-link', 'btn-sm');
471+
vbutton.appendChild(document.createTextNode('Validate this record'));
472+
473+
vbutton.onclick = function() {
474+
const type = document.getElementById('type');
475+
const typeval = type.options[type.selectedIndex].value;
476+
477+
const url = 'https://validator.rdap.org/?' +
478+
'url=' + escape(lastQueriedURL) +
479+
'&response-type=' + escape('ip' === typeval ? 'ip network' : typeval);
480+
481+
window.open(url);
482+
};
483+
484+
// 160 = U+00A0 NO-BREAK SPACE
485+
title.appendChild(document.createTextNode(String.fromCharCode(160)));
486+
487+
title.appendChild(vbutton);
488+
}
489+
468490
var body = document.createElement('div');
469491
body.classList.add('card-body');
470492

0 commit comments

Comments
 (0)