Open gammagec opened 10 years ago
Hi this is great! Only ideally this should go through breach_core.
The idea would be to have the ability to add actions or apps to breach core and have whichever module you age using act on that central registry.
Do you think you can add a pr to breach core doing that and amend this one?
Hi Spolu,
Are you saying just to put the bar's data (url, size, name) into breach core and then mod_strip read from breach_core what bars are there and will render them inside it's UI or are you suggesting that in the core to have 'add_control' have ability to add multiple controls with the TOP parameter and they just stack? Either way sounds good to me, although if you want the modules to be more independent the second way seems better.
The former solution. Have the ability to write action parameters in the core module and have mod_strip read them and render them.
The good parameters probably are:
icon
: URL to an image to displaymethod
: the name of the method to call on the module that registered that action (the name of the module is in the src
parameter of the API call.size
cannot be influenced by the caller as it entirely depends on the module that will display these actions.
Make sense?
Hi Spolu,
I am planning to add entire bars from other modules underneath the mod_strip, not just actions.
so the bar mods themselves would define and render the icons. Mod strip would just create space underneath itself and put an iframe there that points to the new bar UI.
Although, I think you are right... mod_strip should also have the ability to have action buttons put inside of it. I felt that the mod_strip should be an empty container and the bar & tabs themselves should be separate modules that in turn push their content to the mod strip.
You should wait for next version to do that. Control will be able to inject arbitrary divs... But if you're still interested in doing the action API, let me know how I can help. This should be useful even in the next version.
I have added the ability to call breach.module('mod_strip').call('addbar', { url: 'http://localhost:' + port + '/bar', dimension: 45, id: 'bookmarks' }, cb);
Which increases the height of the mod_strip strip bar and inserts an iframe with the new module underneath it. This can be done multiple times to add multiple other bars underneath the strip bar.