You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.1 KiB
73 lines
2.1 KiB
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<title>Ushio ShortenURL</title> |
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> |
|
<link rel="stylesheet" type="text/css" href="css/index.css"/> |
|
<link rel="stylesheet" type="text/css" href="css/layer.css"/> |
|
<link rel="stylesheet" type="text/css" href="css/jquery.css"/> |
|
<script type="text/javascript">block_aplayer = true;lang = ['zh', 'en'];</script> |
|
<script src="https://cdn.yimian.xyz/ushio-js/ushio-head.min.js"></script> |
|
<script type="text/javascript">page.proj = 'iotcat/ushio-shorturl';</script> |
|
<script>//page.auth = ['any'];</script> |
|
</head> |
|
<body> |
|
|
|
<div class="main_div"> |
|
<br><br><br><br><br><br><br><br> |
|
<div class="bottom_div"> |
|
<div class="bottom_text"> |
|
<span class=".zh">请输入需要缩短的链接:</span><span class=".en">Please input the URL you want to shorten:</span> |
|
</div> |
|
<div class="car_input"> |
|
<input type="text" name="url" id="url" placeholder="http://xxxx.xx/xxx/xx" /> |
|
</div> |
|
<div class="next_step"> |
|
<span class=".zh">生成</span><span class=".en">Generate</span> |
|
</div> |
|
<div class="car_input"> |
|
<input type="text" id="res"/> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<script type="text/javascript" src="js/jquery.min.js"></script> |
|
|
|
<script type="text/javascript"> |
|
|
|
|
|
function getURL(url, fun) { |
|
var strReg = /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/; |
|
var re = new RegExp(strReg); |
|
if(!re.test(url)) { |
|
fun(false); |
|
} else { |
|
fun(true); |
|
} |
|
} |
|
|
|
$('#res').hide(); |
|
|
|
$('.next_step').click(function(){ |
|
getURL($('#url').val(), function(flag){ |
|
if(flag){ |
|
$.get('https://shorturl.yimian.xyz/api.php?url='+window.btoa($('#url').val()), function(res){ |
|
res = JSON.parse(res); |
|
$('#res').show(); |
|
$('#res').val(res.key); |
|
|
|
}) |
|
}else{ |
|
if(page.tran.getLang() == 'zh') alert('请输入有效的链接!!'); |
|
else alert('Illegal URL!!'); |
|
} |
|
}) |
|
|
|
}) |
|
|
|
</script> |
|
<script src="https://cdn.yimian.xyz/ushio-js/ushio-footer.min.js"></script> |
|
</body> |
|
</html>
|
|
|