Plasma Center Donor Links

Adds Links for donor profiles to queue pages, linking the User ID to their profile.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name Plasma Center Donor Links
// @namespace http://tampermonkey.net/
// @version 2.0
// @description Adds Links for donor profiles to queue pages, linking the User ID to their profile.
// @author Ayeliss
// @match https://nextgenprd.cslg1.cslg.net/st.dnr/ui/donorQueue/*
// @require https://code.jquery.com/jquery-3.6.0.min.js
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    //get each donor from the list
    $('table.tableSearchResultData td:first-child').each(function(){

      //get the donor number
      var donor=$(this)[0].innerHTML;

      //strip off the parentheses
      donor=(donor.slice(donor.indexOf("(") + 1,  donor.indexOf(")")));

      //create the link to the profile
      var donorlink="https://nextgenprd.cslg1.cslg.net/st.dnr/ui/donor/"+donor;

      //show profile link, and create a container for the visit
      $(this).html($(this)[0].innerHTML.replace(/ *\([^)]*\) */g, "<BR><a href='"+donorlink+"'>Donor Chart: "+donor+"</a><div id='"+donor+"L1'>"+donorlink+"</div>"));

      //get the donor URL
      donorlink = $('#'+donor+'L1').text();

      //target the visit link
      var donorelement = "#donorChartSideBar> div:nth-child(2)>div>a"

      //format the ajax call
      var ajaxcall = donorlink + " " + donorelement;

      //load visit via ajax
      $('#'+donor+'L1').load(ajaxcall, function(responseTxt, statusTxt, xhr){

        //create a container for the stage
        $("<div class='L2'>...</div>").appendTo('#'+donor+'L1');

        //get the visit URL
        var donorlink2 = $('#'+donor+'L1 a').attr('href');

        //target the stage link
        var donorelement2 = ".divCoreSection > div:nth-child(3) > div > div > div > div:nth-child(1) > div.formContentCell > span"

        //format the ajax call
        var ajaxcall2 = donorlink2 + " " + donorelement2;

      //load stage via ajax
        $('#'+donor+'L1 .L2').load(ajaxcall2, function(responseTxt, statusTxt, xhr){

          //show stage
          $('#'+donor+'L1 .L2').prepend("Stage: ");

        //close all the scopes
        });
      });
    });
})();