Hey all,

I need to run a startup module without having to restart the server. 
Specifically, I am talking about the pinboard bookmarks plugin created by 
moderatemisbehaviour. 
<https://github.com/moderatemisbehaviour/TW5-get-pinboard-bookmarks> He 
mentions in the readme's roadmap that he might add this, but I need it 
sooner so I'm trying to make it myself. I want to reload my pinboard 
bookmarks by simply clicking a button.

The closest I have been able to get is this snippet:

$tw.boot.remainingStartupModules = []; // Array of startup modules
 $tw.modules.forEachModuleOfType("startup",function(title,module) {
 if(module.startup) {
 $tw.boot.remainingStartupModules.push(module);
 }
 });


    function isPIN(element) {
      return element.name = 
"$:/get-pinboard-bookmarks/create-pinboard-tiddlers.js";
    }
    
    task = $tw.boot.remainingStartupModules.find(isPIN);
    
    task.startup();

I think this gets the correct task, but I don't think startup function is 
executing. I'm pretty inexperienced in all of this, but I have a feeling 
this is some sort of scope issue. I don't fully understand what javascript 
all of the different agents in play have access to. I could be wrong 
though, and this might have nothing to do with scope. I have tried running 
this in both the dev tools and as a Chrome Extension, but neither works.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/24a60860-b093-495f-9128-9500a8980e1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to