ffLogs2Xivanalysis

open ffxiv xivanalysis

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name ffLogs2Xivanalysis
// @version 1.2
// @description open ffxiv xivanalysis
// @match https://*.fflogs.com/reports/*
// @run-at document-idle
// @namespace com.ffxiv.police
// ==/UserScript==
(function() {
    var openPolice = function(){
        var r = new RegExp(`^http.://.*fflogs.com/reports/(?<id>[^\/]*)\/?#.*fight=(?<fight>[^&]*)`).exec(location.href);
        var fightId = r.groups.fight;
        if( fightId== "last"){
            var last = $("div.report-overview-boss-box:nth-child(2)>div>div>div>a.all-fights-entry:last").attr("onmousedown");
            fightId = /changeFightByIDAndIndex\((?<index>\d*), 0, this, true\)/.exec(last).groups.index;
        }
        var toUrl =`https://xivanalysis.com/fflogs/`+r.groups.id+"/"+ fightId +"/";

        var s = new RegExp(`source=(?<source>[^&]*)`).exec(location.href);
        if(s!= undefined){
            toUrl += s.groups.source;
        }
        window.open(toUrl,"_blank");
    }


    $("#filter-components-tab").remove();
    //"#filter-casts-tab").after(`<a  class="filter-type-tab" id="ffxiv-police"  >出警</a>`);
    //"#top-level-view-tabs").prepend(`<a class="big-tab view-type-tab" id="ffxiv-police"><span class="zmdi zmdi-help"></span> <span class="big-tab-text"><br>出警</span></a>`);
    $("#view-type-tabs").prepend(`<a class="big-tab view-type-tab" id="ffxiv-police"  ><span class="zmdi zmdi-help"></span><span class="big-tab-text"><br>出警</span></a>`);


     $("#ffxiv-police").on('click',(e)=>{

                openPolice()
     })


})();