From 4650df72898250c027976a4335faef0bc33a4a16 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 7 Jun 2016 16:48:16 +0200 Subject: 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 --- public_html/data/js/application.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'public_html/data/js/application.js') diff --git a/public_html/data/js/application.js b/public_html/data/js/application.js index 51b2c0c6d..50968fa41 100644 --- a/public_html/data/js/application.js +++ b/public_html/data/js/application.js @@ -12,7 +12,7 @@ define( 'jquery', 'jquery.lazyload', 'bootstrap', - 'jquery.checkboxes' + 'jquery.checkboxes', ], function ( require, @@ -52,6 +52,7 @@ define( this.setupLineWrapToggle(); this.setupLazyLoadingImages(); this.setupTableRangeSelect(); + this.setupAsciinema(); }, setupTableRangeSelect: function () { @@ -101,6 +102,13 @@ define( if ($(ui.lazyLoadingImages).length > 0) { $(ui.lazyLoadingImages).lazyload({treshold: 200}); } + }, + + setupAsciinema: function () { + _.each($('.asciinema_player'), function (item) { + item = $(item); + asciinema.player.js.CreatePlayer(item.attr("id"), item.data("url")); + }); } }; -- cgit v1.2.3-24-g4f1b