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.

43 lines
1.3 KiB

4 years ago
<html>
<head>
<link rel="stylesheet" type="text/css" href="/player/asciinema-player.css" />
</head>
<body>
4 years ago
<!--
4 years ago
<asciinema-player title="Linux" author="swarmlab.io" author-url="http://www.swarmlab.io" font-size="small" speed="2" theme="monokai" src="/player/demo.cast"></asciinema-player>
4 years ago
-->
4 years ago
<script src="/player/asciinema-player.js"></script>
4 years ago
<script>
var url_string = window.location.href
var url = new URL(url_string);
var item = url.searchParams.get("item");
var llo = url.searchParams.get("llo");
4 years ago
var src = '/player/'+llo+'/'+item+'.cast'
4 years ago
var div = document.createElement('asciinema-player');
document.body.appendChild(div); //appending the element
4 years ago
4 years ago
var att = document.createAttribute( "src" );
att.value = src ;
div.setAttributeNode(att);
4 years ago
var speed = document.createAttribute( "speed" );
att.value = 2 ;
div.setAttributeNode(speed);
var author = document.createAttribute( "author" );
att.value = 'swarmlab.io' ;
div.setAttributeNode(author);
var authorurl = document.createAttribute( "author-url" );
att.value = 'http://www.swarmlab.io' ;
div.setAttributeNode(authorurl);
var theme = document.createAttribute( "theme" );
att.value = 'monokai' ;
div.setAttributeNode(theme);
4 years ago
</script>
4 years ago
</body>
</html>