<commit_before>/**
 * Loads specific scripts, depending on the parameters.
 * @class SDK Loader
 * @param {Object} options
 *   @param {Integer} [options.kit] Represent the serveral bookmarklet types (default: tricket-print).
 *   @param {Integer} [options.env] Represent the environment aka branch name (default: master).
 *   @param {String}  [options.path] Host url path of where the actual resource to be loaded.
 */
(function (options) {
  'use strict';

  options = options || {};
  options.kit = options.kit || 0;
  options.env = options.env || 0;
  options.path = options.path || '//source.xing.com/xws/jira-helpers/raw/';

  var doc = document,
    scriptTag = doc.createElement('script'),
    environments = ['master', 'develop'],
    kits = [
      'ticket-print',
      'add-ticket',
      'ticket-print-lay-scrum',
      'add-ticket-lay-scrum'
    ],
    environment = environments[options.env],
    kit = kits[options.kit],
    url = options.path + environment + '/build/' + kit + '-bookmarklet.js'
  ;
  scriptTag.setAttribute('src', url);
  doc.head.appendChild(scriptTag);
})(options);<commit_msg>Use an external service to deliver JS resource with ‘Content-Type: application/javascript;’<commit_after>/**
 * Loads specific scripts, depending on the parameters.
 * @class SDK Loader
 * @param {Object} options
 *   @param {Integer} [options.kit] Represent the serveral bookmarklet types (default: tricket-print).
 *   @param {Integer} [options.env] Represent the environment aka branch name (default: master).
 *   @param {String}  [options.path] Host url path of where the actual resource to be loaded.
 */
(function (options) {
  'use strict';

  options = options || {};
  options.kit = options.kit || 0;
  options.env = options.env || 0;
  options.path = options.path || '//rawgit.com/cange/jira-bookmarklets/';

  var doc = document,
    scriptTag = doc.createElement('script'),
    environments = ['master', 'develop'],
    kits = [
      'ticket-print',
      'add-ticket',
      'ticket-print-lay-scrum',
      'add-ticket-lay-scrum'
    ],
    environment = environments[options.env],
    kit = kits[options.kit],
    url = options.path + environment + '/build/' + kit + '-bookmarklet.js'
  ;
  scriptTag.setAttribute('src', url);
  doc.head.appendChild(scriptTag);
})(options);
{'fraction_non_alphanumeric': 0.1519097222222222, 'fraction_numerical': 0.001736111111111111, 'mean_word_length': 3.49317738791423, 'pattern_counts': {'":': 0, '<': 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': '5732267', 'n_tokens_mistral': 717, 'n_tokens_neox': 697, 'n_words': 191}