Giter VIP home page Giter VIP logo

Comments (5)

sizzlemctwizzle avatar sizzlemctwizzle commented on July 20, 2024
myConfig.init($("div.content-mid"),
Your problem is that you are using jQuery and the $ function doesn't actually return the DOM element object but some weird object that jQuery uses. You need to replace that code with:
myConfig.init($("div.content-mid").get(0),
The I have to change in code every place where I'm using it.
Yeah basically. But pretty much every GUI framework would make you do something similar to change the order of elements. You might be able to cheat by using reverse().

from gm_config.

Hooch180 avatar Hooch180 commented on July 20, 2024

what about assaigning values to those list elements?
what about sth like that?

"type" : "select",
"options" : ["A" : 0, "B" : 1],
"default" : "A"
}

from gm_config.

sizzlemctwizzle avatar sizzlemctwizzle commented on July 20, 2024

That isn't valid JS syntax. It would have to be:

{
"type" : "select",
"options" : {"A" : 0, "B" : 1},
"default" : "A"
}
And even that doesn't solve your problem because you still have to change the numerical values to change the order, which isn't any less work than just changing the order. So yeah it's kind of inconvenient but it's a pretty small change to get the desired result. Personally I would wire the code like this myself:
var optionFunctions = [(function(){}), battleDesc.hide];
optionFunctions[myConfig.get("msgFightHiddenMode")]();
That way you could easily hook up a whole host of different behaviors based on the option that is selected.

from gm_config.

Hooch180 avatar Hooch180 commented on July 20, 2024

Can you explain me that syntax?

var optionFunctions = [(function(){}), battleDesc.hide];

optionFunctionsmyConfig.get("msgFightHiddenMode");

BTW.
{

"type" : "select",

"options" : {"A" : 0, "B" : 1},

"default" : "A"

}
In this one I could just drag the whole ""A" : 1" to reorder it.

One more question.
Can you give me all supored properties (like: min, max, options, type ....)?

from gm_config.

sizzlemctwizzle avatar sizzlemctwizzle commented on July 20, 2024
Can you explain me that syntax?
Which syntax are you referring to? The sample code I suggested or object literals versus arrays?
In this one I could just drag the whole ""A" : 1" to reorder it.
Oh I see what you mean now. You would have to make the change in two places to reorder it. Okay, I'll create an issue and add this alternative usage.
Can you give me all supored properties
That would take some time. I've become a little unfamiliar with GM_config since I haven't used or developed it much recently. You could bury your head in the code and find what is supported. This function is what controls the actual creation of elements based on their properties. And this function is what derives the value from the element.

from gm_config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.