xivanalysis Button

Jump from FFlogs fight to respective xivanalysis page with a button. Redirects to selected player and pull (if any), or to the report page per default.

Mint 2020.07.12.. Lásd a legutóbbi verzió

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         xivanalysis Button
// @namespace    dansa#5509
// @version      1.0
// @description  Jump from FFlogs fight to respective xivanalysis page with a button. Redirects to selected player and pull (if any), or to the report page per default.
// @author       dansa
// @match        https://*.fflogs.com/reports/*
// @match        https://fflogs.com/reports/*
// @run-at document-idle
// @grant GM_addStyle
// ==/UserScript==

GM_addStyle(".xivabtn { position: fixed; z-index: 2000; bottom:0; right:0; background-color: #202020;}");
GM_addStyle(".xivaimg { height:33px;width:33px;margin:5px;background-image: url(https://xivanalysis.com/logo.png);background-size: contain;}");

function xivaurl() {
  const re = /\/(?<id>[A-Za-z0-9]{16})(\#fight=(?<fight>\d{1,3}))?(.+source=(?<src>\d{1,3}))?/g;

  let result = re.exec($(location).attr('pathname')+$(location).attr('hash'));

  let goto = "https://xivanalysis.com/fflogs/" +
        (result.groups.id ? result.groups.id + "/" : "") +
        (result.groups.fight ? result.groups.fight + "/"  : "") +
        (result.groups.src ? result.groups.src + "/" : "");

  return goto;
}

(function () {
  $("body").append("<div class='report-overview-boss-box xivabtn'><a id='xivabtn' href='"+ xivaurl() +"'><div class='xivaimg'></div></a></div>");
})();

window.onhashchange = function() { 
  $("#xivabtn").attr("href", xivaurl());
};