Onionr/onionr/static-data/www/shared/sites.js

20 lines
436 B
JavaScript
Raw Normal View History

2019-03-12 18:23:46 +00:00
function checkHex(str) {
regexp = /^[0-9a-fA-F]+$/
if (regexp.test(str)){
return true
}
return false
}
document.getElementById('openSite').onclick = function(){
var hash = document.getElementById('siteViewer').value
if (checkHex(hash) && hash.length == 64){
window.location.href = '/site/' + hash
}
else{
2019-09-17 06:56:13 +00:00
PNotify.notice({
2019-09-17 01:16:06 +00:00
text: 'Invalid site hash'
})
2019-03-12 18:23:46 +00:00
}
}