Created
April 25, 2022 02:18
-
-
Save brianantonelli/361547ae2e2f91564161b79c3612dfed to your computer and use it in GitHub Desktop.
Etsy Orders Mods Bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://caiorss.github.io/bookmarklet-maker/ | |
$.expr[":"].contains = $.expr.createPseudo(function (arg) { | |
return function (elem) { | |
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0; | |
}; | |
}); | |
const $reset = $( | |
'<button id="aafilter" style="margin:10px 10px 0 10px;" class="ml3 wt-btn wt-btn--tertiary wt-btn--small">Clear Filter</button>' | |
); | |
const $filter = $( | |
'<button id="aafilter" style="margin-top:10px;" class="ml3 wt-btn wt-btn--tertiary wt-btn--small">Filter by Product</button>' | |
); | |
$("#mission-control-topbar-heading") | |
.html("🎉 Amy's Orders & Shipping 🎉<br/>") | |
.append($reset) | |
.append($filter); | |
$filter.on("click", () => { | |
const keyword = prompt("Enter Listing Title Keyword"); | |
if (!keyword || !keyword.length) { | |
return; | |
} | |
$(".panel-body-row").hide(); | |
$(`.panel-body-row span:contains("${keyword}")`) | |
.closest(".panel-body-row") | |
.show(); | |
}); | |
$reset.on("click", () => { | |
$(".panel-body-row").show(); | |
}); | |
$('.mr-xs-1 span:contains("Ship tomorrow")') | |
.css({ "background-color": "#FFFF00", "font-size": "2em" }) | |
.html("⚠️ SHIP TOMORROW ⚠️"); | |
const orderIds = $('.panel-body-row a.text-gray:contains("#")'); | |
orderIds.each(function () { | |
const str = $(this).text(); | |
$(this).html( | |
`${str.slice( | |
0, | |
-4 | |
)}<span style="font-weight:bold;font-color:blue;font-size:16px">${str.slice( | |
-4 | |
)}</span>` | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment