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

Action definition: include meta info to auto generate the editor menu #45

Closed
andrewxhill opened this issue May 29, 2014 · 2 comments
Closed

Comments

@andrewxhill
Copy link
Contributor

hey @javisantana,

we are going to need an easy way to expand the editor drop down menu for actions. i'm sure you are thinking about it, do you have a planned method? If not, I was thinking, why not include a description element in the Action object (e.g. https://github.com/CartoDB/odyssey.js/blob/master/lib/odyssey/actions/sleep.js) that would be read in at build time to generate the menu?

something like,

var Action = require('../story').Action;

function Sleep(ms) {

  return Action({

    enter: function() {
      setTimeout(this.finish, ms);
      return true;
    },
    describe: function() {
      return {
         name: "Sleep",
         description: "Invoke javascript sleep function",
         example: "Sleep(500)",
         addToEditor: true,
         group: "core" // or some way of allowing sub-menus later
      };
    }

  });
}

module.exports = Sleep;
@javisantana
Copy link
Contributor

the current way is doing this:

https://github.com/CartoDB/odyssey.js/blob/master/editor/torque.html#L99

each template adds it's own actions you can perform

@andrewxhill
Copy link
Contributor Author

gotcha

On Thu, May 29, 2014 at 11:32 AM, javi santana notifications@github.comwrote:

the current way is doing this:

https://github.com/CartoDB/odyssey.js/blob/master/editor/torque.html#L99

each template adds it's own actions you can perform


Reply to this email directly or view it on GitHubhttps://github.com//issues/45#issuecomment-44545365
.

andrew@vizzuality.com
http://www.vizzuality.com

@matallo matallo closed this as completed Jun 12, 2014
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

No branches or pull requests

3 participants