maybe take more advantage of your defaults?

var youtubeLocal = $('li.courseware-unit[data-locator="' + data.location + '"] .popup #local');
if (!data.isYoutubeMode) {
  youtubeLocal.removeClass().addClass('icon-thumbs-down icon-large');
}