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

Setting Do-It links programmatically creates broken links #92

Closed
levjj opened this issue Jan 10, 2013 · 1 comment
Closed

Setting Do-It links programmatically creates broken links #92

levjj opened this issue Jan 10, 2013 · 1 comment
Assignees

Comments

@levjj
Copy link
Contributor

levjj commented Jan 10, 2013

Creating doit links in text can either be done by pressing Ctrl+O or programmatically by setting a TextEmphasis.

var txt = new lively.morphic.Text(rect(0,0,99,99), "foo");
txt.emphasize({doit: 'alert(1)'}, 2, 3);
txt.openInWorld();

The created link is green and underlined but, unfortunately, the alert code is not executed when clicking on the link.

@ghost ghost assigned levjj Jan 10, 2013
@levjj
Copy link
Contributor Author

levjj commented Jan 10, 2013

Alright, it seems to work if you use a JavaScript object with a code property inside the doit style.

txt.emphasize({doit: {code: "alert(1)"}}, 2, 3);

@levjj levjj closed this as completed Jan 10, 2013
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

1 participant