<commit_before>import actionButtons from './actionButtons';
import adjustHeight from './adjustHeight';
import characterButtons from './characterButtons';
import currentGuildId from '../../common/currentGuildId';
import executeAll from '../../common/executeAll';
import getElementById from '../../common/getElement';
import getValue from '../../system/getValue';
import insertAfterParent from './insertAfterParent';
import insertHtmlAfterEnd from '../../common/insertHtmlAfterEnd';
import jQueryNotPresent from '../../common/jQueryNotPresent';
import navMenu from './navMenu';
import { pCL } from '../../support/layout';
import preFlight from './preFlight';
import {
  cmdUrl,
  defSubcmd,
  newGuildLogUrl,
  notepadBlankUrl,
} from '../../support/constants';

function updateQuestLink() {
  const lastActiveQuestPage = getValue('lastActiveQuestPage');
  if (getValue('storeLastQuestPage') && lastActiveQuestPage.length > 0) {
    getElementById('nav-character-questbook').href = lastActiveQuestPage;
  }
}

function updateScavLink() {
  const lastScavPage = getValue('lastScavPage');
  if (getValue('storeLastScavPage') && lastScavPage.length > 0) {
    getElementById('nav-actions-artisanship-scavenging').href = lastScavPage;
  }
}

function guildInventory() {
  if (currentGuildId()) {
    insertAfterParent('nav-guild-storehouse-inventory', insertHtmlAfterEnd,
      '<li class="nav-level-2"><a class="nav-link" '
      + `id="nav-guild-guildinvmanager" href="${
        notepadBlankUrl}guildinvmgr">Guild Inventory</a></li>`);
  }
}

function newGuildLogLink() {
  if (currentGuildId() && !getValue('useNewGuildLog')) {
    // if not using the new guild log, show it as a separate menu entry
    insertAfterParent('nav-guild-ledger-advisor', insertHtmlAfterEnd,
      `<li class="nav-level-2"><a class="nav-link" href="${
        newGuildLogUrl}">New Guild Log</a></li>`);
  }
}

function topRatedLink() {
  insertAfterParent('nav-toprated-players-level', insertHtmlAfterEnd,
    '<li class="nav-level-2"><a class="nav-link" id="nav-toprated-top250" '
    + `href="${cmdUrl}toprated${defSubcmd}xp">Top 250 Players</a></li>`);
}

function updateLinks() {
  updateQuestLink();
  updateScavLink();
}

function injectItems() {
  executeAll([
    characterButtons,
    guildInventory,
    newGuildLogLink,
    topRatedLink,
    actionButtons,
  ]);
}<commit_msg>bugfix - new guild log link<commit_after>import actionButtons from './actionButtons';
import adjustHeight from './adjustHeight';
import characterButtons from './characterButtons';
import currentGuildId from '../../common/currentGuildId';
import executeAll from '../../common/executeAll';
import getElementById from '../../common/getElement';
import getValue from '../../system/getValue';
import insertAfterParent from './insertAfterParent';
import insertHtmlAfterEnd from '../../common/insertHtmlAfterEnd';
import insertHtmlBeforeBegin from '../../common/insertHtmlBeforeBegin';
import jQueryNotPresent from '../../common/jQueryNotPresent';
import navMenu from './navMenu';
import { pCL } from '../../support/layout';
import preFlight from './preFlight';
import {
  cmdUrl,
  defSubcmd,
  newGuildLogUrl,
  notepadBlankUrl,
} from '../../support/constants';

function updateQuestLink() {
  const lastActiveQuestPage = getValue('lastActiveQuestPage');
  if (getValue('storeLastQuestPage') && lastActiveQuestPage.length > 0) {
    getElementById('nav-character-questbook').href = lastActiveQuestPage;
  }
}

function updateScavLink() {
  const lastScavPage = getValue('lastScavPage');
  if (getValue('storeLastScavPage') && lastScavPage.length > 0) {
    getElementById('nav-actions-artisanship-scavenging').href = lastScavPage;
  }
}

function guildInventory() {
  if (currentGuildId()) {
    insertAfterParent('nav-guild-storehouse-inventory', insertHtmlAfterEnd,
      '<li class="nav-level-2"><a class="nav-link" '
      + `id="nav-guild-guildinvmanager" href="${
        notepadBlankUrl}guildinvmgr">Guild Inventory</a></li>`);
  }
}

function newGuildLogLink() {
  if (currentGuildId() && !getValue('useNewGuildLog')) {
    // if not using the new guild log, show it as a separate menu entry
    insertAfterParent('nav-guild-ledger-guildlog', insertHtmlBeforeBegin,
      `<li class="nav-level-2"><a class="nav-link" href="${
        newGuildLogUrl}">New Guild Log</a></li>`);
  }
}

function topRatedLink() {
  insertAfterParent('nav-toprated-players-level', insertHtmlAfterEnd,
    '<li class="nav-level-2"><a class="nav-link" id="nav-toprated-top250" '
    + `href="${cmdUrl}toprated${defSubcmd}xp">Top 250 Players</a></li>`);
}

function updateLinks() {
  updateQuestLink();
  updateScavLink();
}

function injectItems() {
  executeAll([
    characterButtons,
    guildInventory,
    newGuildLogLink,
    topRatedLink,
    actionButtons,
  ]);
}
{'fraction_non_alphanumeric': 0.15676910299003322, 'fraction_numerical': 0.004568106312292359, 'mean_word_length': 4.627336448598131, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 31, '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': '2390337', 'n_tokens_mistral': 1494, 'n_tokens_neox': 1492, 'n_words': 298}