From 8ae889e477a1b32c0650a19418fdd57073f8417f Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Wed, 1 Aug 2012 23:23:48 +0200 Subject: [PATCH] Enable new worker-based player for webkit browsers --- app/helpers/asciicasts_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/asciicasts_helper.rb b/app/helpers/asciicasts_helper.rb index 761abc2..d7ce908 100644 --- a/app/helpers/asciicasts_helper.rb +++ b/app/helpers/asciicasts_helper.rb @@ -9,7 +9,7 @@ module AsciicastsHelper if params[:fallback] player_class = "AsciiIo.FallbackPlayer" else - player_class = "AsciiIo.Player" + player_class = "$.browser.webkit ? AsciiIo.Player : AsciiIo.FallbackPlayer" end if custom_renderer = params[:renderer] @@ -21,7 +21,8 @@ module AsciicastsHelper return < $(function() { - window.player = new #{player_class}({ + var playerClass = #{player_class}; + window.player = new playerClass({ el: $('.player'), cols: #{asciicast.terminal_columns}, lines: #{asciicast.terminal_lines},