summaryrefslogtreecommitdiffstats
path: root/application/views
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-06-07 16:48:16 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-07-12 19:04:40 +0200
commit4650df72898250c027976a4335faef0bc33a4a16 (patch)
treecb2e1dd721a67199881281415d667d31583da914 /application/views
parent03d21abe6f2b092837f9c7b18958f6d78f29ce59 (diff)
Add asciinema support
This bypasses require.js for asciinema because apparently require.js can't deal with the embedded React library. The result is that React is not loaded properly and the asciinema player is unable to find it. Just load it like upstream tells you to. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/views')
-rw-r--r--application/views/file/fragments/asciinema-player.php8
-rw-r--r--application/views/header.php2
2 files changed, 10 insertions, 0 deletions
diff --git a/application/views/file/fragments/asciinema-player.php b/application/views/file/fragments/asciinema-player.php
new file mode 100644
index 000000000..5eb8041f7
--- /dev/null
+++ b/application/views/file/fragments/asciinema-player.php
@@ -0,0 +1,8 @@
+<div class="container-wide">
+<div class='panel panel-default'>
+ <div class='panel-heading'>
+ <?php echo anchor(site_url($filedata['id']), htmlspecialchars($filedata["filename"])); ?>
+ </div>
+ <div id="player-container-<?php echo $filedata['id']; ?>" class="asciinema_player" data-url="<?php echo site_url($filedata['id']); ?>"></div>
+</div>
+</div>
diff --git a/application/views/header.php b/application/views/header.php
index 0e1f174de..d4ee7a07c 100644
--- a/application/views/header.php
+++ b/application/views/header.php
@@ -17,6 +17,7 @@ if (is_cli_client() && !isset($force_full_html)) {
<link href="<?php echo link_with_mtime("/data/css/bootstrap.min.css"); ?>" rel="stylesheet">
<link href="<?php echo link_with_mtime("/data/css/style.css"); ?>" rel="stylesheet">
<link href="<?php echo link_with_mtime("/data/css/colorbox.css"); ?>" rel="stylesheet">
+ <link href="<?php echo link_with_mtime("/data/css/asciinema-player.css"); ?>" rel="stylesheet">
<?php
if (file_exists(FCPATH."data/local/style.css")) {
echo '<link href="'.link_with_mtime("/data/local/style.css").'" rel="stylesheet">';
@@ -26,6 +27,7 @@ if (is_cli_client() && !isset($force_full_html)) {
echo '<link href="'.link_with_mtime("/data/local/favicon.png").'" rel="shortcut icon">';
}
?>
+ <script src="<?php echo link_with_mtime("/data/js/vendor/asciinema-player.js"); ?>"></script>
<script src="<?php echo link_with_mtime("/data/js/vendor/require.js"); ?>"></script>
<script type="text/javascript">
/* <![CDATA[ */