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
|
2019-09-21 05:06:49 +00:00
|
|
|
if (hash.length == 0){ return }
|
2019-11-14 03:06:04 +00:00
|
|
|
if (checkHex(hash) && hash.length >= 50 || hash.length == 52 || hash.length == 56){
|
2019-03-12 18:23:46 +00:00
|
|
|
window.location.href = '/site/' + hash
|
|
|
|
}
|
|
|
|
else{
|
2019-09-17 01:16:06 +00:00
|
|
|
PNotify.notice({
|
2019-11-14 03:06:04 +00:00
|
|
|
text: 'Invalid site hash/ID'
|
2019-09-17 01:16:06 +00:00
|
|
|
})
|
2019-03-12 18:23:46 +00:00
|
|
|
}
|
|
|
|
}
|