<commit_before>import WinJS from 'winjs';
import Component from "../common/component";

export default class extends Component {
  constructor(application) {
    super(application);
  }

  ItemTemplateSelector(itemPromise) {
    var mediaTile = document.createElement("div");
    WinJS.Utilities.addClass(mediaTile, "item-template");
    var _renderCompletePromise = itemPromise.then(function(item) {
      var itemViewModel = item instanceof Array ? item[0].data : item.data;
      var viewKey = itemViewModel.item.contenType.toLowerCase();
      var viewTemplateUri = config.get("domain:" + viewKey + ":template");
      WinJS.Utilities.addClass(mediaTile, "item-template-" + viewKey);
      var viewClassDef = ioc.getItemViewDef(viewKey);
      winjsHelper.pageDefine(viewKey, viewTemplateUri, viewClassDef);
      return WinJS.UI.Pages.render(viewTemplateUri, mediaTile, itemViewModel);
    });
    return {
      element: mediaTile,
      renderComplete: _renderCompletePromise
    };
  }
}
<commit_msg>BugFix for typo in item template selector<commit_after>import WinJS from 'winjs';
import Component from "../common/component";

export default class extends Component {
  constructor(application) {
    super(application);
  }

  ItemTemplateSelector(itemPromise) {
    var that = this;
    var mediaTile = document.createElement("div");
    WinJS.Utilities.addClass(mediaTile, "item-template");
    var _renderCompletePromise = itemPromise.then(function(item) {
      var itemViewModel = item instanceof Array ? item[0].data : item.data;
      var viewKey = itemViewModel.item.contentType.toLowerCase();
      var viewTemplateUri = config.get("domain:" + viewKey + ":template");
      WinJS.Utilities.addClass(mediaTile, "item-template-" + viewKey);
      var viewClassDef = that.application.container.getItemViewDef(viewKey);
      winjsHelper.pageDefine(viewKey, viewTemplateUri, viewClassDef);
      return WinJS.UI.Pages.render(viewTemplateUri, mediaTile, itemViewModel);
    });
    return {
      element: mediaTile,
      renderComplete: _renderCompletePromise
    };
  }
}

{'fraction_non_alphanumeric': 0.11201531833413117, 'fraction_numerical': 0.0009573958831977022, 'mean_word_length': 4.160493827160494, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '1516056', 'n_tokens_mistral': 581, 'n_tokens_neox': 577, 'n_words': 123}