etherpad-lite/static/index.html

50 lines
1.7 KiB
HTML
Raw Normal View History

<!doctype html>
<html>
<title>Etherpad Lite</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<link href="static/css/index.css" rel="stylesheet">
<link href="static/custom/index.css" rel="stylesheet">
<div id="wrapper">
<div id="inner">
<div id="button" onclick="go2Random()" class="translate">New Pad</div>
<div id="label" class="translate">or create/open a Pad with the name</div>
<form action="#" onsubmit="go2Name();return false;">
<input type="text" id="padname" autofocus x-webkit-speech>
<button type="submit">OK</button>
</form>
</div>
</div>
<script src="static/custom/index.js"></script>
<script>
function go2Name()
{
var padname = document.getElementById("padname").value;
padname.length > 0 ? window.location = "p/" + padname : alert("Please enter a name")
}
function go2Random()
{
window.location = "p/" + randomPadName();
}
function randomPadName()
{
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++)
{
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum, rnum + 1);
2011-07-24 09:47:04 -07:00
}
return randomstring;
}
// start the custom js
if (typeof customStart == "function") customStart();
</script>
</html>