Move scripts to the bottom of the page

This should help speed up page rendering.
This commit is contained in:
Francois Marier 2013-03-19 15:09:32 -04:00
Родитель 4fd71c1334
Коммит b1a8464363
4 изменённых файлов: 45 добавлений и 44 удалений

Просмотреть файл

@ -15,19 +15,6 @@ const loginform = `
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<script src="https://login.persona.org/include.js"></script>
<script>
function login() {
navigator.id.get(function(assertion) {
if (assertion) {
var assertion_field = document.getElementById("assertion-field");
assertion_field.value = assertion;
var login_form = document.getElementById("login-form");
login_form.submit();
}
});
}
</script>
</head>
<body>
<form id="login-form" method="POST">
@ -35,6 +22,20 @@ const loginform = `
</form>
<p><a href="javascript:login()">Login</a></p>
<script src="https://login.persona.org/include.js"></script>
<script>
function login() {
navigator.id.get(function(assertion) {
if (assertion) {
var assertion_field = document.getElementById("assertion-field");
assertion_field.value = assertion;
var login_form = document.getElementById("login-form");
login_form.submit();
}
});
}
</script>
</body>
</html>
`

Просмотреть файл

@ -4,6 +4,16 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>django browserid example</title>
</head>
<body>
<form id="login-form" method="POST" action="/status/">
{% csrf_token %}
<input id="assertion-field" type="hidden" name="assertion" value="" />
</form>
<p><a href="javascript:login()">Login</a></p>
<script src="https://login.persona.org/include.js"></script>
<script>
function login() {
@ -16,16 +26,6 @@
}
});
}
</script>
</head>
<body>
<form id="login-form" method="POST" action="/status/">
{% csrf_token %}
<input id="assertion-field" type="hidden" name="assertion" value="" />
</form>
<p><a href="javascript:login()">Login</a></p>
</script>
</body>
</html>

Просмотреть файл

@ -4,6 +4,15 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>tornado browserid example</title>
</head>
<body>
<form id="login-form" method="POST" action="status">
<input id="assertion-field" type="hidden" name="assertion" value="" />
</form>
<p><a href="javascript:login()">Login</a></p>
<script src="https://login.persona.org/include.js"></script>
<script>
function login() {
@ -16,15 +25,6 @@
}
});
}
</script>
</head>
<body>
<form id="login-form" method="POST" action="status">
<input id="assertion-field" type="hidden" name="assertion" value="" />
</form>
<p><a href="javascript:login()">Login</a></p>
</script>
</body>
</html>

Просмотреть файл

@ -4,6 +4,15 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>web.py browserid example</title>
</head>
<body>
<form id="login-form" method="POST" action="status">
<input id="assertion-field" type="hidden" name="assertion" value="" />
</form>
<p><a href="javascript:login()">Login</a></p>
<script src="https://login.persona.org/include.js"></script>
<script>
function login() {
@ -16,15 +25,6 @@
}
});
}
</script>
</head>
<body>
<form id="login-form" method="POST" action="status">
<input id="assertion-field" type="hidden" name="assertion" value="" />
</form>
<p><a href="javascript:login()">Login</a></p>
</script>
</body>
</html>