Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight auction items based on preference of keywords #182

Open
mehmetkaradeniz opened this issue Jun 15, 2020 · 1 comment
Open

Highlight auction items based on preference of keywords #182

mehmetkaradeniz opened this issue Jun 15, 2020 · 1 comment

Comments

@mehmetkaradeniz
Copy link
Contributor

mehmetkaradeniz commented Jun 15, 2020

The idea is adding a toggle checkbox on auction. If it's checked, items are highlighted based on description that matches the keyword..

Example scenario:

  1. User saves keywords preferences on settings. (e.g "Lucius", "Delicacy").
  2. User visits auction and checks the checkbox
  3. System highlight items (e.g red border around item html element)

I have some sample code that does the job. It can be improved.

var itemHighlightKeywords = new Array("Lucius", "Delicacy"); // read from settings

function highlightItems() {
    let items = jQuery(".auction_item_div .ui-draggable");
    for (let i = 0; i < items.length; i++) {
        let itemProps = jQuery(items[i]).data().tooltip[0];
        for (let j = 0; j < itemProps.length; j++) {

            for (let k = 0; k < itemHighlightKeywords.length; k++) {
                let prop = itemProps[j][0].toString().toLowerCase();
                let keyword = itemHighlightKeywords[k].toLowerCase();
                if (prop.contains(keyword)) {
                    jQuery(items[i]).closest(".section-header").css("border", "red solid 4px");
                    break;
                }
            }
        }
    }
}

It looks like this:
image

@FrutyX
Copy link
Collaborator

FrutyX commented Dec 25, 2021

What if you applied the merchant item search on this? In theory, it could work, if you can read the item names, but if it works in merchants shops...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants