PageSourceSearch

https://warcraftpriests.github.io/src/app.module.js

js warcraftpriests.github.io collected 2026-10-03 10:09:46 UTC 1,678 bytes, 47 lines download raw bytes

1import { AppState } from './services/state/AppState.module.js';
2import { getQueryParameter } from './services/url/Parameterized.module.js';
3import { initializeButtons } from './modules/buttons/Buttons.module.js';
4import { copyURI } from './modules/talents/TalentBuild.module.js';
5import { SimRepoVersions, Sims } from './utils/Converter.module.js';
6import { version, defaultVersion, repoTemplateUrl, charts } from './utils/Constants.module.js';
7
8function resolveSimVersion(params) {
9  const selectedVersion = params.get(version);
10  return SimRepoVersions[selectedVersion] ? selectedVersion : defaultVersion;
11}
12
13function setDocumentTitleFromQuery(params) {
14  const selectedSim = params.get('sims');
15  if (selectedSim && Sims[selectedSim]) {
16    document.title = `${Sims[selectedSim]} | ${document.title}`;
17  }
18}
19
20export function initializeApp() {
21  const params = getQueryParameter();
22  const simVersion = resolveSimVersion(params);
23  AppState.setBaseUrl(repoTemplateUrl.replace('{version}', simVersion));
24
25  jQuery.get({ url: AppState.getBaseUrl() + '/internal/talents.yml', dataType: 'text' })
26    .done(function(data) {
27      AppState.setTalentData(jsyaml.load(data));
28    });
29
30  jQuery.get({ url: AppState.getBaseUrl() + '/config.yml', dataType: 'text' })
31    .done(function(data) {
32      AppState.setConfigData(jsyaml.load(data));
33      window.wowheadUrl = AppState.getConfigData()[charts].wowheadUrl;
34      initializeButtons();
35    });
36
37  setDocumentTitleFromQuery(params);
38
39  // Delegated event listener for talent import links in chart tooltips.
40  $(document).on('click', '.tooltipLink', function(event) {
41    copyURI(event);
42  });
43}
44
45export default {
46  initializeApp
47};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.