I'm sure there's a better way to approach the following. I'm writing a plugin where users can enter settings in the following format:
Setting: "object1setting -> object2setting"
It's done this way to allow for multiple objects to be passed within the same JS call. I'm breaking the the strings apart at the "->" symbol and saving them, however there are many settings and I'm thinking there has to be a more efficient way of writing this:
// START PLUGIN, SETUP DEFAULT OPTIONS, EXTEND OPTIONS TO "O" ..... // I'VE JUST PULLED SOME RANDOM SETTINGS AS AN EXAMPLE. bg_x_speed_in_set = o.bg_x_speed_in.toString().split("->"), // X PROPERTY SPEED IN bg_x_speed_out_set = o.bg_x_speed_out.toString().split("->"), // X PROPERTY SPEED OUT bg_y_speed_out_set = o.bg_y_speed_out.toString().split("->"), // Y PROPERTY SPEED OUT ... // ETC
This continues on and gets lengthy. Everything works perfectly in all browsers. I'm just trying to clean up the code.