mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 05:19:41 +00:00
Add optional dark theme for the docs
This commit is contained in:
@@ -4,7 +4,16 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Telethon API</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/docs.css" rel="stylesheet">
|
||||
<link id="style" href="css/docs.light.css" rel="stylesheet">
|
||||
<script>
|
||||
try {
|
||||
which = document.cookie.split('=')[1].split(';')[0];
|
||||
if (which) {
|
||||
document.getElementById("style").href = "css/" + which;
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
@@ -21,7 +30,7 @@
|
||||
on what the methods, constructors and types mean. Nevertheless, this
|
||||
page aims to provide easy access to all the available methods, their
|
||||
definition and parameters.</p>
|
||||
|
||||
<p id="themeSelect"></p>
|
||||
<p>Please note that when you see this:</p>
|
||||
<pre>---functions---
|
||||
users.getUsers#0d91a548 id:Vector<InputUser> = Vector<User></pre>
|
||||
@@ -145,5 +154,17 @@ users.getUsers#0d91a548 id:Vector<InputUser> = Vector<User></pre>
|
||||
</p>
|
||||
</div>
|
||||
<script src="js/search.js"></script>
|
||||
<script>
|
||||
document.getElementById("themeSelect").innerHTML = `
|
||||
Select
|
||||
<a href="#" onclick="setTheme('docs.light.css')">light</a> /
|
||||
<a href="#" onclick="setTheme('docs.dark.css')">dark</a> theme.
|
||||
`;
|
||||
|
||||
function setTheme(which) {
|
||||
style.href = "css/" + which;
|
||||
document.cookie = "css=" + which + "; path=/";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user