Handling Arrays?
|
|
Hiho, first: Great idea - I'm just looking for something like that! Any chance to handle arrays with it? To give an example: Have a look at this script. Right now, most configuration needs to take place in the file itself, which I want to move to a GUI. So I need e.g. to let the user manipulate the list of search terms, like: searchTerms = ("one","two","three"); Now in the GUI, the user should be able to add items to or remove them from that array. From the "visual side", this could be a multi-select box: Click one or more items (by holding the Ctrl or Shift keys), then click a button next to this to remove. Enter a new value into some input element next to it, and click a button to add. Possible? Are you going to implement something like this? Thankx in advance (at least to your reply - even more if it is "Yes" |
|
|
I'm thinking about it ... I think one would need the stored values as an array when USP.getValue is called ... Perhaps I can handle this by using an Array for "theDefault" and then show a multiselect box. And store the values as a JSON-String ... I will give it some more thoughts |
|
|
That's like the (only) other project does it (JSON storage - check the groups for GM_config to see yourself). Though I must admit there are three things I like more with your script: It uses GM_get/setValue with the original values (so I can even read/write them without the GUI being present), the style (dark layer etc. to make clear what's going on), and the easier-to-call. But the (a little bit more difficult) syntax for calling the other script also has a clear advantage: More flexibility... However: It's always good to have alternatives available. And when they use different approaches: What does not fit the one, is fine for the other. So keep up the good job, and all the best for it! I'm looking forward to its future |
|
|
Just to keep you up to date ... The script is beginning to get shape concerning the array handling. Storing, retrieving and displaying is already working. Now I have to work on the editing part. |
|
|
Glad to read - thanks for the update! May I invite you to the GM_config Developers group to share ideas? Maybe you even find some useful code to adapt there |
|
|
Done. Perhaps you can take a look at it or maybe even test it a bit before I set it to version 1.0.0 Thanks! |
|
|
Will do so ASAP. Thank you! Edit: I just tried - seems to work fine. Some additional suggestions, though:
Great design, I like it very much! Guess I will steal a bit of code for my GM_config Extender. Feel free to take revenge: Guess the localization system of my script could be of interest for you... |
),

