You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

contributors.js 1.1KB

12345678910111213141516171819202122232425262728
  1. import {createApp} from 'vue';
  2. export async function initRepoContributors() {
  3. const el = document.getElementById('repo-contributors-chart');
  4. if (!el) return;
  5. const {default: RepoContributors} = await import(/* webpackChunkName: "contributors-graph" */'../components/RepoContributors.vue');
  6. try {
  7. const View = createApp(RepoContributors, {
  8. locale: {
  9. filterLabel: el.getAttribute('data-locale-filter-label'),
  10. contributionType: {
  11. commits: el.getAttribute('data-locale-contribution-type-commits'),
  12. additions: el.getAttribute('data-locale-contribution-type-additions'),
  13. deletions: el.getAttribute('data-locale-contribution-type-deletions'),
  14. },
  15. loadingTitle: el.getAttribute('data-locale-loading-title'),
  16. loadingTitleFailed: el.getAttribute('data-locale-loading-title-failed'),
  17. loadingInfo: el.getAttribute('data-locale-loading-info'),
  18. },
  19. });
  20. View.mount(el);
  21. } catch (err) {
  22. console.error('RepoContributors failed to load', err);
  23. el.textContent = el.getAttribute('data-locale-component-failed-to-load');
  24. }
  25. }