{"size": 1093, "ext": "js", "max_stars_repo_path": "assets/js/keybindings.js", "max_stars_repo_name": "clwluvw/docs-v2", "max_stars_repo_stars_event_min_datetime": "2019-10-14T18:38:17.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T15:34:49.000Z", "max_issues_repo_path": "assets/js/keybindings.js", "max_issues_repo_name": "clwluvw/docs-v2", "max_issues_repo_issues_event_min_datetime": "2019-10-14T17:03:50.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T22:23:24.000Z", "max_forks_repo_path": "assets/js/keybindings.js", "max_forks_repo_name": "clwluvw/docs-v2", "max_forks_repo_forks_event_min_datetime": "2019-11-08T19:40:05.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-25T10:01:02.000Z"}
{"max_stars_count": 42, "max_issues_count": 1870, "max_forks_count": 181, "avg_line_length": 26.0238095238, "max_line_length": 151, "alphanum_fraction": 0.5800548948}
// Dynamically update keybindings or hotkeys
function getPlatform() {
  if (/Mac/.test(navigator.platform)) {
    return "osx"
  } else if (/Win/.test(navigator.platform)) {
    return "win"
  } else if (/Linux/.test(navigator.platform)) {
    return "linux"
  } else {
    return "other"
  }
}

const platform = getPlatform()

function addOSClass(osClass) {
  $('.keybinding').addClass(osClass)
}

function updateKeyBindings() {
  $('.keybinding').each(function() {
    var osx = $(this).data("osx")
    var linux = $(this).data("linux")
    var win = $(this).data("win")

    if (platform === "other") {
      if (win != linux) {
        var keybind = '<code class="osx">' + osx + '</code> for macOS, <code>' + linux + '</code> for Linux, and <code>' + win + '</code> for Windows';
      } else {
        var keybind = '<code>' + linux + '</code> for Linux and Windows and <code class="osx">' + osx + '</code> for macOS';
      }
    } else {
      var keybind = '<code>' + $(this).data(platform) + '</code>'
    }

    $(this).html(keybind)
  })
}

addOSClass(platform)
updateKeyBindings()
