Thanks
Why I came up with that type of system so quickly is because of a ton of work with dynamic javascript stuff that I've done in the past, coupled with the fact that I use jQuery a lot and some of it's source it like that
Anywho, my options idea:
For options have it pass another variable to it in the plugin entry. So:
options: {
optionName:{
type: 'bool',
default: true
}
},
At startup it would then quickly parse all the options from the plugins into a Options variable or something for speed and then every time you open the options screen it would dynamically create it for you based on the current setting and what type of option it is. So you can have booleans, text, numbers etc
EDIT: Oh and for getting the options name, this might be useful
http://pietschsoft.com/post/2008/02/28/JavaScript-ForEach-Equivalent.aspx just in case you don't know about it. ( I'm pretty sure it works with objects )
EDIT2: yep it works!
>>> a = {t:'adlfj',bla:'herro'}; for(var i in a){console.log(i+": "+a[i]);}
t: adlfj
bla: herro
EDIT3: oh and
>>> a = {t:'adlfj',bla:'herro'};a[0]='test';for(var i in a){console.log(i+": "+a[i]);}
t: adlfj
bla: herro
0: test
EDIT4: I decided to write up a quick example of a plugin handler. Although it's missing some of the stuff for getting settings, and for displaying the options panel, but all the core stuff is there
http://pastebin.com/CnnhEgcHEDIT5: bug fixes/more comments
http://pastebin.com/FgyG7v3p