Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to add bars from other modules #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added ability to add bars from other modules #60

wants to merge 2 commits into from

Conversation

gammagec
Copy link

@gammagec gammagec commented Aug 2, 2014

I have added the ability to call breach.module('mod_strip').call('add_bar', {
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.

top: 45px;
right: 0;
bottom: 0;
background-color: green;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, forgot to remove this

removed camelHump
added comments
changed parameters format
@spolu
Copy link
Member

spolu commented Aug 4, 2014

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?

@gammagec
Copy link
Author

gammagec commented Aug 5, 2014

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.

@spolu
Copy link
Member

spolu commented Aug 5, 2014

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 display
  • method: 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?

@gammagec
Copy link
Author

gammagec commented Aug 5, 2014

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.

@spolu
Copy link
Member

spolu commented Aug 7, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants