// ==UserScript== // @name Neopets - Search Helper Enhanced // @version 1.1.4 // @namespace neopets // @description Adds convenient search icons to many Neopets pages with cleaner handling, fewer duplicates, and improved SSW support // @author diceroll123, enhanced // @match *://*.neopets.com/auctions.phtml* // @match *://*.neopets.com/closet.phtml* // @match *://*.neopets.com/dome/neopets.phtml* // @match *://*.neopets.com/faerieland/darkfaerie.phtml* // @match *://*.neopets.com/faerieland/employ/employment.phtml* // @match *://*.neopets.com/faerieland/hiddentower938.phtml // @match *://*.neopets.com/gallery/index.phtml?* // @match *://*.neopets.com/games/kadoatery/* // @match *://*.neopets.com/generalstore.phtml* // @match *://*.neopets.com/genie.phtml* // @match *://*.neopets.com/halloween/esophagor*.phtml* // @match *://*.neopets.com/halloween/witchtower*.phtml* // @match *://*.neopets.com/hospital.phtml // @match *://*.neopets.com/inventory.phtml* // @match *://*.neopets.com/island/*training.phtml?*type=status* // @match *://*.neopets.com/island/kitchen*.phtml* // @match *://*.neopets.com/island/tradingpost.phtml* // @match *://*.neopets.com/market.phtml* // @match *://*.neopets.com/market_your.phtml* // @match *://*.neopets.com/medieval/earthfaerie.phtml* // @match *://*.neopets.com/objects.phtml* // @match *://*.neopets.com/pirates/academy.phtml?type=status* // @match *://*.neopets.com/process_cash_object.phtml // @match *://*.neopets.com/quests.phtml // @match *://*.neopets.com/quickstock.phtml* // @match *://*.neopets.com/safetydeposit.phtml* // @match *://*.neopets.com/shops/wizard.phtml* // @match *://*.neopets.com/space/coincidence.phtml // @match *://*.neopets.com/winter/igloo.phtml* // @match *://*.neopets.com/winter/snowfaerie*.phtml* // @match *://*.neopets.com/questlog/ // @match *://*.neopets.com/games/teatime/ // @match *://*.neopets.com/browseshop.phtml* // @icon https://www.neopets.com/favicon.ico // @grant none // @downloadURL https://www.scriptneo.com/scripts/download.php?id=45 // @updateURL https://www.scriptneo.com/scripts/download.php?id=45 // ==/UserScript== (function () { "use strict"; const WAIT_FOR_JQUERY_MS = 0; const MAX_JQUERY_WAIT_ATTEMPTS = 100; let waitAttempts = 0; function waitForJquery() { if (typeof window.jQuery === "function") { main(window.jQuery); return; } waitAttempts++; if (waitAttempts <= MAX_JQUERY_WAIT_ATTEMPTS) { setTimeout(waitForJquery, WAIT_FOR_JQUERY_MS); } } waitForJquery(); function main($) { const imgSize = 20; const currentUrl = document.URL; const linkmap = { ssw: { title: "Super Shop Wizard", img: "https://images.neopets.com/premium/shopwizard/ssw-icon.svg", }, sw: { title: "Shop Wizard", url: "https://www.neopets.com/shops/wizard.phtml?string=%s", img: "https://images.neopets.com/themes/h5/basic/images/shopwizard-icon.png", }, tp: { title: "Trading Post", url: "https://www.neopets.com/island/tradingpost.phtml?type=browse&criteria=item_exact&search_string=%s", img: "https://images.neopets.com/themes/h5/basic/images/tradingpost-icon.png", }, au: { title: "Auction Genie", url: "https://www.neopets.com/genie.phtml?type=process_genie&criteria=exact&auctiongenie=%s", img: "https://images.neopets.com/themes/h5/basic/images/auction-icon.png", }, sdb: { title: "Safety Deposit Box", url: "https://www.neopets.com/safetydeposit.phtml?obj_name=%s&category=0", img: "https://images.neopets.com/themes/h5/basic/images/v3/safetydeposit-icon.svg", }, closet: { title: "Closet", url: "https://www.neopets.com/closet.phtml?obj_name=%s", img: "https://images.neopets.com/items/ffu_illusen_armoire.gif", }, jni: { title: "Jellyneo Item Database", url: "https://items.jellyneo.net/search/?name=%s&name_type=3", img: "https://images.neopets.com/items/toy_plushie_negg_fish.gif", }, battlepedia: { title: "Jellyneo Battlepedia", url: "https://battlepedia.jellyneo.net/index.php?search=%s", img: "https://images.neopets.com/favicon.ico", }, dti: { title: "Dress to Impress", url: "https://impress.openneo.net/items?q=%scommit=search", img: "https://impress.openneo.net/assets/favicon-97a5bb419325a3c6559f3109f2374aa5ebf6c5f282e01c0e6a58407ee3f97c77.png", }, idb: { title: "ItemDB", url: "https://itemdb.com.br/item/%s", img: "https://images.neopets.com/themes/h5/basic/images/v3/quickstock-icon.svg", }, }; injectCss(); $.fn.exists = function () { return this.length > 0; }; $.fn.justtext = function () { return $(this).clone().children().remove().end().text(); }; const isBeta = $("[class^='nav-pet-menu-icon']").exists(); let premium = false; if (isBeta) { premium = $("[class^='navsub-ssw-icon']").exists(); } else { premium = $("#sswmenu .imgmenu").exists(); } function injectCss() { if (document.getElementById("search-helper-enhanced-css")) { return; } $("