adds .local/share/millennium and easyeffects
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
(function() {
|
||||
const params = JSON.parse(document.currentScript.dataset.params);
|
||||
|
||||
g_rgDelayedLoadImages = params.images;
|
||||
|
||||
// Clear registered image lazy loader watchers
|
||||
CScrollOffsetWatcher.sm_rgWatchers = [];
|
||||
|
||||
// Recreate image lazy loader watchers
|
||||
for (const node of document.querySelectorAll("div[id^=image_group_scroll_badge_images_]")) {
|
||||
LoadImageGroupOnScroll(node.id, node.id.slice(19));
|
||||
}
|
||||
})();
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
(function() {
|
||||
// Recalculate offsets for each watcher
|
||||
CScrollOffsetWatcher.sm_rgWatchers.forEach(watcher => { watcher.Recalc(); });
|
||||
|
||||
// CScrollOffsetWatcher.OnScroll() expects watchers to be sorted by offset trigger
|
||||
CScrollOffsetWatcher.sm_rgWatchers.sort((a, b) => a.nOffsetTopTrigger - b.nOffsetTopTrigger);
|
||||
|
||||
// Start loading images that meet their thresholds immediately
|
||||
CScrollOffsetWatcher.OnScroll();
|
||||
})();
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
document.addEventListener("as_GroupsManager", async function(e) {
|
||||
const {action} = e.detail;
|
||||
|
||||
switch(action) {
|
||||
case "updateSelection":
|
||||
UpdateSelection();
|
||||
break;
|
||||
|
||||
case "toggleManageFriends":
|
||||
ToggleManageFriends();
|
||||
break;
|
||||
|
||||
case "selectAll":
|
||||
SelectAll();
|
||||
break;
|
||||
|
||||
case "selectNone":
|
||||
SelectNone();
|
||||
break;
|
||||
|
||||
case "selectInverse":
|
||||
SelectInverse();
|
||||
break;
|
||||
|
||||
}
|
||||
});
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
(function() {
|
||||
const params = JSON.parse(document.currentScript.dataset.params);
|
||||
const {groupId} = params;
|
||||
|
||||
ToggleManageFriends();
|
||||
$J("#es_invite_to_group").on("click", () => {
|
||||
const friends = GetCheckedAccounts("#search_results > .selectable.selected:visible");
|
||||
InviteUserToGroup(null, groupId, friends);
|
||||
});
|
||||
})();
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
(function() {
|
||||
document.getElementById("es_invite_to_group").addEventListener("click", () => {
|
||||
ExecFriendAction("group_invite", "friends/all");
|
||||
});
|
||||
})();
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
(function() {
|
||||
$J(document).ajaxSuccess((event, xhr, settings) => {
|
||||
if (/\/(friends|groups)(\/common)?\/?\?ajax=1$/.test(settings.url)) {
|
||||
document.dispatchEvent(new CustomEvent("as_subpageNav"));
|
||||
}
|
||||
});
|
||||
})();
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
(function() {
|
||||
function ensureFn() {
|
||||
// g_ActiveInventory is sometimes set to null or a different inventory, thus clearing our GoToPage fn
|
||||
|
||||
if (typeof g_ActiveInventory.GoToPage === "function") { return; }
|
||||
g_ActiveInventory.GoToPage = function(page) {
|
||||
const nPageWidth = this.m_$Inventory.children(".inventory_page:first").width();
|
||||
const iCurPage = this.m_iCurrentPage;
|
||||
const iNextPage = Math.min(Math.max(0, --page), this.m_cPages - 1);
|
||||
const iPages = this.m_cPages;
|
||||
if (iCurPage < iNextPage) {
|
||||
if (iCurPage < iPages - 1) {
|
||||
this.PrepPageTransition(nPageWidth, iCurPage, iNextPage);
|
||||
this.m_$Inventory.css("left", "0");
|
||||
this.m_$Inventory.animate({"left": -nPageWidth}, 250, null, () => this.FinishPageTransition(iCurPage, iNextPage));
|
||||
}
|
||||
} else if (iCurPage > iNextPage) {
|
||||
if (iCurPage > 0) {
|
||||
this.PrepPageTransition(nPageWidth, iCurPage, iNextPage);
|
||||
this.m_$Inventory.css("left", "-" + nPageWidth + "px");
|
||||
this.m_$Inventory.animate({"left": 0}, 250, null, () => this.FinishPageTransition(iCurPage, iNextPage));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
document.getElementById("pagebtn_first").addEventListener("click", () => {
|
||||
ensureFn();
|
||||
g_ActiveInventory.GoToPage(1);
|
||||
});
|
||||
|
||||
document.getElementById("pagebtn_last").addEventListener("click", () => {
|
||||
ensureFn();
|
||||
g_ActiveInventory.GoToPage(g_ActiveInventory.m_cPages);
|
||||
});
|
||||
|
||||
document.getElementById("es_gotopage_btn").addEventListener("click", () => {
|
||||
ensureFn();
|
||||
const page = $("es_pagenumber").value;
|
||||
if (isNaN(page)) { return; }
|
||||
g_ActiveInventory.GoToPage(parseInt(page));
|
||||
});
|
||||
})();
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
(function() {
|
||||
let lastItem = null;
|
||||
|
||||
function dispatchMarketInfo() {
|
||||
const inv = window.g_ActiveInventory;
|
||||
const wallet = window.g_rgWalletInfo;
|
||||
const item = inv.selectedItem;
|
||||
|
||||
if (item === lastItem) {
|
||||
return;
|
||||
}
|
||||
lastItem = item;
|
||||
|
||||
if (!item) {
|
||||
document.dispatchEvent(new CustomEvent("as_marketInfo", {detail: null}));
|
||||
return;
|
||||
}
|
||||
|
||||
// https://github.com/SteamDatabase/SteamTracking/blob/b3abe9c82f9e9d260265591320cac6304e500e58/steamcommunity.com/public/javascript/economy_common.js#L161
|
||||
const hashName = GetMarketHashName(item.description);
|
||||
|
||||
/*
|
||||
* See https://github.com/IsThereAnyDeal/AugmentedSteam/pull/1047#discussion_r571444376
|
||||
* Update: For non-Steam items, the text may not have a color, so test date only
|
||||
*/
|
||||
const restriction = Array.isArray(item.description.owner_descriptions)
|
||||
&& item.description.owner_descriptions.some(desc => /\[date\]\d+\[\/date\]/.test(desc.value));
|
||||
|
||||
// https://github.com/SteamDatabase/SteamTracking/blob/f26cfc1ec42b8a0c27ca11f4343edbd8dd293255/steamcommunity.com/public/javascript/economy_v2.js#L4468
|
||||
const publisherFee = item.description.market_fee ?? wallet.wallet_publisher_fee_percent_default;
|
||||
|
||||
const contextId = Number(item.contextid);
|
||||
const globalId = Number(inv.appid);
|
||||
|
||||
// Only parse these if the item is a Steam item
|
||||
let appid, itemType;
|
||||
if (contextId === 6 && globalId === 753) {
|
||||
appid = parseInt(hashName); // Should start with "real" appid
|
||||
|
||||
itemType = item.description.tags.find(tag => tag.category === "item_class")?.internal_name;
|
||||
|
||||
// https://github.com/JustArchiNET/ArchiSteamFarm/blob/f55f58a8ef61ba830ed1bee88e5e895b9e4f479d/ArchiSteamFarm/Steam/Data/InventoryResponse.cs#L150
|
||||
switch (itemType) {
|
||||
case "item_class_2":
|
||||
itemType = "card";
|
||||
break;
|
||||
case "item_class_3":
|
||||
itemType = "profilebackground";
|
||||
break;
|
||||
case "item_class_4":
|
||||
itemType = "emoticon";
|
||||
break;
|
||||
case "item_class_5":
|
||||
itemType = "booster";
|
||||
break;
|
||||
case "item_class_6":
|
||||
itemType = "consumable";
|
||||
break;
|
||||
case "item_class_7":
|
||||
itemType = "gems";
|
||||
break;
|
||||
case "item_class_8":
|
||||
itemType = "profilemodifier";
|
||||
break;
|
||||
case "item_class_10":
|
||||
itemType = "saleitem";
|
||||
break;
|
||||
case "item_class_11":
|
||||
itemType = "sticker";
|
||||
break;
|
||||
case "item_class_12":
|
||||
itemType = "chateffect";
|
||||
break;
|
||||
case "item_class_13":
|
||||
itemType = "miniprofilebackground";
|
||||
break;
|
||||
case "item_class_14":
|
||||
itemType = "avatarframe";
|
||||
break;
|
||||
case "item_class_15":
|
||||
itemType = "animatedavatar";
|
||||
break;
|
||||
case "item_class_16":
|
||||
itemType = "keyboardskin";
|
||||
break;
|
||||
default:
|
||||
itemType = "unknown";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let hasGooOption = false;
|
||||
const ownerActions = item.description.owner_actions ?? [];
|
||||
for (const action of ownerActions) {
|
||||
if (/GetGooValue/.test(action.link)) {
|
||||
hasGooOption = true;
|
||||
}
|
||||
}
|
||||
|
||||
document.dispatchEvent(new CustomEvent("as_marketInfo", {
|
||||
detail: {
|
||||
view: window.iActiveSelectView,
|
||||
sessionId: window.g_sessionID,
|
||||
marketAllowed: window.g_bMarketAllowed,
|
||||
country: window.g_strCountryCode,
|
||||
assetId: item.assetid, // DO NOT cast this to a number as the value might exceed Number.MAX_SAFE_INTEGER
|
||||
contextId,
|
||||
globalId,
|
||||
walletCurrency: wallet.wallet_currency,
|
||||
marketable: item.description.marketable,
|
||||
hashName,
|
||||
publisherFee,
|
||||
restriction,
|
||||
appid,
|
||||
itemType,
|
||||
hasGooOption
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
dispatchMarketInfo();
|
||||
});
|
||||
observer.observe(
|
||||
document.querySelector("#iteminfo0"), {attributes: true}
|
||||
)
|
||||
observer.observe(
|
||||
document.querySelector("#iteminfo1"), {attributes: true}
|
||||
)
|
||||
}());
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Modified version of GrindIntoGoo from badges.js
|
||||
* https://github.com/SteamDatabase/SteamTracking/blob/ca5145acba077bee42de2593f6b17a6ed045b5f6/steamcommunity.com/public/javascript/badges.js#L521
|
||||
*/
|
||||
(function() {
|
||||
const params = JSON.parse(document.currentScript.dataset.params);
|
||||
const {sessionId, assetId, appid} = params;
|
||||
|
||||
const ajaxParams = {
|
||||
sessionid: sessionId,
|
||||
appid,
|
||||
assetid: assetId,
|
||||
contextid: 6
|
||||
};
|
||||
|
||||
$J.get(`${g_strProfileURL}/ajaxgetgoovalue/`, ajaxParams).done(data => {
|
||||
ajaxParams.goo_value_expected = data.goo_value;
|
||||
|
||||
$J.post(`${g_strProfileURL}/ajaxgrindintogoo/`, ajaxParams)
|
||||
.done(() => {
|
||||
ReloadCommunityInventory();
|
||||
});
|
||||
});
|
||||
})();
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
(function(){
|
||||
pricehistory_zoomDays(g_plotPriceHistory, g_timePriceHistoryEarliest, g_timePriceHistoryLatest, 365);
|
||||
})();
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
(function(){
|
||||
pricehistory_zoomDays(
|
||||
SellItemDialog.m_plotPriceHistory,
|
||||
SellItemDialog.m_timePriceHistoryEarliest,
|
||||
SellItemDialog.m_timePriceHistoryLatest,
|
||||
365
|
||||
);
|
||||
})();
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
(function(){
|
||||
// Fix undefined function when clicking on the "show all x comments" button under "uploaded a screenshot" type activity
|
||||
if (typeof window.Blotter_ShowLargeScreenshot !== "function") {
|
||||
|
||||
window.Blotter_ShowLargeScreenshot = (galleryid, showComments) => {
|
||||
const gallery = g_BlotterGalleries[galleryid];
|
||||
const ss = gallery.shots[gallery.m_screenshotActive];
|
||||
ShowModalContent(`${ss.m_modalContentLink}&insideModal=1&showComments=${showComments}`, ss.m_modalContentLinkText, ss.m_modalContentLink, true);
|
||||
};
|
||||
}
|
||||
})();
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
(function(){
|
||||
const oldShowNicknameModal = window.ShowNicknameModal;
|
||||
|
||||
// Show current nickname in input box
|
||||
window.ShowNicknameModal = function() {
|
||||
oldShowNicknameModal();
|
||||
|
||||
const nicknameNode = document.querySelector(".persona_name .nickname");
|
||||
if (nicknameNode !== null) {
|
||||
document.querySelector(".newmodal input[type=text]").value = nicknameNode.textContent.trim().slice(1, -1);
|
||||
}
|
||||
};
|
||||
|
||||
document.querySelector("#es_nickname")?.addEventListener("click", () => {
|
||||
window.ShowNicknameModal();
|
||||
window.HideMenu("profile_action_dropdown_link", "profile_action_dropdown");
|
||||
});
|
||||
})();
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
(function(){
|
||||
const params = JSON.parse(document.currentScript.dataset.params);
|
||||
const {query, totalCount, count} = params;
|
||||
|
||||
g_oSearchResults.m_iCurrentPage = 0;
|
||||
g_oSearchResults.m_strQuery = query;
|
||||
g_oSearchResults.m_cTotalCount = totalCount;
|
||||
g_oSearchResults.m_cPageSize = count;
|
||||
g_oSearchResults.UpdatePagingDisplay();
|
||||
})();
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
|
||||
(function() {
|
||||
const params = JSON.parse(document.currentScript.dataset.params);
|
||||
|
||||
// `CCommentThread` is defined in global.js
|
||||
if (typeof window.CCommentThread === "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
// https://github.com/SteamDatabase/SteamTracking/blob/18d1c0eed3dcedc81656e3d278b3896253cc5b84/steamcommunity.com/public/javascript/global.js#L2465
|
||||
const oldDeleteComment = window.CCommentThread.DeleteComment;
|
||||
|
||||
window.CCommentThread.DeleteComment = function(id, gidcomment) {
|
||||
|
||||
/**
|
||||
* Forum topics have special handling and show a prompt already
|
||||
* https://github.com/SteamDatabase/SteamTracking/blob/18d1c0eed3dcedc81656e3d278b3896253cc5b84/steamcommunity.com/public/javascript/forums.js#L1347
|
||||
*/
|
||||
if (id.startsWith("ForumTopic")) {
|
||||
oldDeleteComment.call(this, id, gidcomment);
|
||||
return;
|
||||
}
|
||||
|
||||
const modal = window.SteamFacade.showConfirmDialog(
|
||||
"Augmented Steam",
|
||||
`${params.prompt}<br><br>
|
||||
<label><input type="checkbox">${params.label}</label>`
|
||||
);
|
||||
|
||||
let checked = false;
|
||||
|
||||
document.querySelector(".newmodal input[type=checkbox]").addEventListener("change", e => {
|
||||
checked = e.currentTarget.checked;
|
||||
});
|
||||
|
||||
modal.then((result) => {
|
||||
if (checked) {
|
||||
|
||||
/*
|
||||
* Restore old method if don't show is checked, so the prompt is not shown
|
||||
* when deleting more comments on the same page
|
||||
*/
|
||||
window.CCommentThread.DeleteComment = oldDeleteComment;
|
||||
document.dispatchEvent(new CustomEvent("noDeletionConfirm"));
|
||||
}
|
||||
|
||||
if (result === "OK") oldDeleteComment.call(this, id, gidcomment);
|
||||
});
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user