-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
98 lines (70 loc) · 2.77 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html>
<title>Intent URI Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.light_green-indigo.min.css" />
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<!--<script async src="https://arc.io/widget.js#JnX5qiNK"></script>-->
<style>
.mycard {
margin-top: 50px;
width: 90%;
margin-bottom: 50px;
}
.center {
display: flex;
justify-content: center;
}
.border {
margin-top: 5px;
}
</style>
<body class="center">
<div class="mycard mdl-card mdl-shadow--2dp"><center><div class="mdl-card__supporting-text">
<h2>Intent URI Test</h2>
<p>
Testing URI intent via HTML, CSS, & JS. Will probably update it if enough interest (or you can suggest changes, GitHub link below).
</p>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label" style="width:12em">
<input class="mdl-textfield__input" type="text" id="urlbar" oninput="updateStatus()">
<label class="mdl-textfield__label" for="urlbar">URI</label>
</div>
</br>
<button id="openWeb" onclick="openWeb()" class="border mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored">Open</button>
</br>
</br>
<p>
Made by stevenfelix505. (V 0.0.1)</br>
The <a href="https://github.com/stevenfelix505/intent-uri-test" target="_blank">source code</a> is available on GitHub.</br>
(Uses the <a href="https://getmdl.io/index.html" target="_blank">Material Design Lite</a> library for a cleaner look.)</br>
<!--</br>
[Note: I'm also currently testing the <a href="https://arc.io/about/" target="_blank">arc.io</a> service. It is a no-ads alternative, but you can opt out from the blue circle at the bottom left (if it is not shown you probably have an adblocker so you are not using it) or from <a href="https://arc.io/optOut?referrerPropertyId=JnX5qiNK&referrerOrigin=https%3A%2F%2Ftrianguloy.github.io" target="_blank">here</a>.]-->
</p>
</div></center></div>
</body>
<script>
// ---------- variables ----------
var EL_NUMB = document.getElementById('urlbar');
var EL_OPWEB = document.getElementById('openWeb');
// ---------- main actions ----------
function openWeb(){
openLink(getUrlbar())
}
// ---------- secondary actions ----------
function updateStatus(){
var disabled = EL_NUMB.value.replace(/^0+/, '') == "";
EL_OPWEB.disabled = disabled;
}
// ---------- utils ----------
function openLink(url){
window.open(url,"_top")
}
function getUrlbar(){
return EL_NUMB.value.replace(/^0+/, '')
}
// ---------- initialization ----------
window.onload = function(){updateStatus()};
</script>
</html>