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

Introduce hooks mechanism #1064

Closed
Jermolene opened this issue Nov 6, 2014 · 4 comments
Closed

Introduce hooks mechanism #1064

Jermolene opened this issue Nov 6, 2014 · 4 comments

Comments

@Jermolene
Copy link
Owner

Some plugins need to be able to alter quite fundamental aspects of TiddlyWiki's behaviour. For example, a plugin that @welford is working on needs to modify the default tiddlers that are displayed at startup.

It is proposed to introduce a new global hooks mechanism that can be used across the core to enable plugins to hook into and modify default functionality.

The example of modifying the list of default tiddlers would be something like this:

$tw.hooks.addHook("th-opening-default-tiddlers-list",function(list) {
list.push("Another tiddler");
return list;
});

Then, within the function openStartupTiddlers() in $:/core/modules/startup/story.js, we'd invoke the hooks like this:

storyList = $tw.hooks.invokeHook("th-opening-default-tiddlers-list",storyList);
@tobibeer
Copy link
Contributor

@welford 👍

begs young ol' me to start doing some more waddling through the muddy puddles like that myself

@inmysocks
Copy link
Contributor

This issue should be closed because it was acted upon already.

@tobibeer
Copy link
Contributor

tobibeer commented Dec 3, 2017

@Jermolene: anymore actionable items on this atm?

@Jermolene
Copy link
Owner Author

Thanks @tobibeer

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

No branches or pull requests

3 participants