Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- RaChartEnhancer.user.js 2020-01-26 12:02:20.526260263 +0100
- +++ mine.js 2020-01-26 12:01:22.590109728 +0100
- @@ -8,6 +8,7 @@
- // @supportURL https://www.steamgifts.com/discussion/riOvr/
- // @namespace Sighery
- // @match https://www.steamgifts.com/*
- +// @match https://www.steamtrades.com/*
- // @grant GM_xmlhttpRequest
- // @grant GM_notification
- // @grant GM_setValue
- @@ -57,10 +58,10 @@
- // ==================== MAIN ====================
- refactorStorage();
- -injectInterface();
- +injectInterface(window.location.hostname.match(/www.steamtrades.com/));
- -if ((window.location.href.match("(\.steamgifts\.com\/discussion\/)|(\.steamgifts\.com\/giveaway\/)")) !== null && confirmAuthor()) {
- - var apiKey = localStorage.getItem('APIKey');
- +if (((window.location.href.match("(\.steamgifts\.com\/discussion\/)|(\.steamgifts\.com\/giveaway\/)")) !== null && confirmAuthor() || window.location.href.match("(\.steamtrades\.com\/trade\/)"))) {
- +var apiKey = localStorage.getItem('APIKey');
- var steamID64 = localStorage.getItem('SteamID64');
- var bStoreMethod = localStorage.getItem('RCE-StoreMethod');
- if (bStoreMethod !== undefined && bStoreMethod !== null) bStoreMethod = true;
- @@ -707,11 +708,11 @@
- // ========== INJECT FUNCTIONS ==========
- -function injectInterface() {
- +function injectInterface(st) {
- injectDlgStyle();
- injectDialog();
- injectFunctions();
- - injectRow();
- + injectRow(st);
- }
- @@ -790,9 +791,9 @@
- }
- -function injectRow() {
- - var discDropdown = document.querySelector("a[class~='nav__button'][href^='/discussions']");
- - var newRow;
- +function injectRow(st) {
- + var discDropdown = document.querySelector(st ? "a[class~='nav_btn'][href='/']": "a[class~='nav__button'][href^='/discussions']");
- + var newRow;
- if (discDropdown.previousElementSibling === null) {
- // Not logged in, create a new button on the header
- @@ -807,11 +808,11 @@
- } else {
- newRow = document.createElement('a');
- - newRow.setAttribute('class', 'nav__row');
- + newRow.setAttribute('class', st ? 'dropdown_btn': 'nav__row');
- newRow.href = "javascript:void(0)";
- discDropdown = discDropdown.previousElementSibling.firstElementChild;
- - discDropdown.insertBefore(newRow, discDropdown.querySelector("a[class='nav__row'][href='/discussions/created']").nextElementSibling);
- + discDropdown.insertBefore(newRow, discDropdown.querySelector(st ? "a[class='dropdown_btn'][href~='/trades/new']": "a[class='nav__row'][href='/discussions/created']").nextElementSibling);
- newRow.appendChild(document.createElement('i'));
- @@ -823,10 +824,11 @@
- newRow.children[1].appendChild(document.createElement('p'));
- newRow.children[1].children[0].setAttribute('class', 'nav__row__summary__name');
- newRow.children[1].children[0].textContent = "RaChartâ„¢ Enhancer";
- -
- + if (!st){
- newRow.children[1].appendChild(document.createElement('p'));
- newRow.children[1].children[1].setAttribute('class', 'nav__row__summary__description');
- newRow.children[1].children[1].textContent = "Change the options for the enhancer.";
- + }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement