<commit_before>//= require_self
//= require_tree .

function showMobile() {  
  var modalContents = $('#myModal').html();
  var selectedRow   = $('#video_0_0');
  var playerRow     = selectedRow.after('<tr><td colspan=3>' + modalContents + '</td></tr>');

  $('#myModal').remove();

  var offset = selectedRow.offset();
  window.scrollTo(offset.left, offset.top);
}

function showDesktop() {
  $('#myModal').modal();
  $('#myModal').on('hide', function() {
    window.location.href = '/course';
  });
}

function playerResizeListener() {
  $(window).bind('resize orientationchange', resizePlayer);
}

function resizePlayer() {
  var parentHeight = $('.modal-video-box').height();
  var parentWidth  = $('.modal-video-box').width();

  $('#theme_video').css({'width': parentWidth, 'height': parentHeight});
  $('#theme_video').attr('width', parseInt(parentWidth));
  $('#theme_video').attr('height', parseInt(parentHeight));
}

$(document).ready(function() {
  var showingPlayer = showingPlayer || false;

  if (showingPlayer) {
    if ($(window).width() < 768) {
      showMobile();
    } else {
      showDesktop();
    }

    playerResizeListener();
    resizePlayer();
  }
});<commit_msg>Fixed playback on IE9 and parseInt issue<commit_after>//= require_self
//= require_tree .

var showingPlayer;

function showMobile() {
  var modalContents = $('#myModal').html();
  var selectedRow   = $('#video_0_0');
  var playerRow     = selectedRow.after('<tr><td colspan=3>' + modalContents + '</td></tr>');

  $('#myModal').remove();

  var offset = selectedRow.offset();
  window.scrollTo(offset.left, offset.top);
}

function showDesktop() {
  $('#myModal').modal();
  $('#myModal').on('hide', function() {
    window.location.href = '/course';
  });
}

function playerResizeListener() {
  $(window).bind('resize orientationchange', resizePlayer);
}

function resizePlayer() {
  var parentHeight = $('.modal-video-box').height();
  var parentWidth  = $('.modal-video-box').width();

  $('#theme_video').css({'width': parentWidth, 'height': parentHeight});

  // assume we are parsing a decimal -- http://stackoverflow.com/questions/850341/workarounds-for-javascript-parseint-octal-bug
  $('#theme_video').attr('width', parseInt(parentWidth, 10));
  $('#theme_video').attr('height', parseInt(parentHeight, 10));
}

$(document).ready(function() {

  if (showingPlayer) {
    if ($(window).width() < 768) {
      showMobile();
    } else {
      showDesktop();
    }

    playerResizeListener();
    resizePlayer();
  }
});
{'fraction_non_alphanumeric': 0.20611596505162827, 'fraction_numerical': 0.009134233518665607, 'mean_word_length': 4.348195329087049, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '364318', 'n_tokens_mistral': 799, 'n_tokens_neox': 773, 'n_words': 145}