Unverified Commit e4f84728 authored by ir1d's avatar ir1d Committed by GitHub
Browse files

Update extra.js

parent 4fe445e8
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -61,23 +61,23 @@ function foo(response) {
  } else if (!url.endsWith('index')) {
    url += '/index';
    var script = document.createElement('script');
    document.getElementsByClassName('edit_history')[0].setAttribute('href', `https://github.com/24OI/OI-wiki/commits/master/docs/${url}.md`);
    script.src = `https://api.github.com/repos/24OI/OI-WIki/commits?path=docs/${url}.md&callback=foo`;
    document.getElementsByClassName('edit_history')[0].setAttribute('href', `https://github.com/OI-wiki/OI-wiki/commits/master/docs/${url}.md`);
    script.src = `https://api.github.com/repos/OI-wiki/OI-WIki/commits?path=docs/${url}.md&callback=foo`;
    document.getElementsByTagName('head')[0].appendChild(script);
  }
}

if (url == "") {
  // HomePage
  document.getElementsByClassName('edit_history')[0].setAttribute('href', `https://github.com/24OI/OI-wiki/commits/master/docs/index.md`);
  script.src = `https://api.github.com/repos/24OI/OI-WIki/commits?path=docs/index.md&callback=foo`;
  document.getElementsByClassName('edit_history')[0].setAttribute('href', `https://github.com/OI-wiki/OI-wiki/commits/master/docs/index.md`);
  script.src = `https://api.github.com/repos/OI-wiki/OI-WIki/commits?path=docs/index.md&callback=foo`;
  document.getElementsByTagName('head')[0].appendChild(script);
} else if (url != "404.htm") {
  document.getElementsByClassName('edit_history')[0].setAttribute('href', `https://github.com/24OI/OI-wiki/commits/master/docs/${url}.md`);
  script.src = `https://api.github.com/repos/24OI/OI-WIki/commits?path=docs/${url}.md&callback=foo`;
  document.getElementsByClassName('edit_history')[0].setAttribute('href', `https://github.com/OI-wiki/OI-wiki/commits/master/docs/${url}.md`);
  script.src = `https://api.github.com/repos/OI-wiki/OI-WIki/commits?path=docs/${url}.md&callback=foo`;
  document.getElementsByTagName('head')[0].appendChild(script);
} else {
  document.getElementsByClassName('edit_history')[0].setAttribute('href', `https://github.com/24OI/OI-wiki/commits/master`);
  document.getElementsByClassName('edit_history')[0].setAttribute('href', `https://github.com/OI-wiki/OI-wiki/commits/master`);
  document.getElementsByClassName('facts_modified')[0].innerHTML = ('最近没更新过这个页面');
  document.getElementsByClassName('page_contributors')[0].innerHTML = ('本页面是自动生成的');
  document.getElementsByClassName('page_edit_url')[0].setAttribute('href', `#`);