From 09156af47563a91c10c0ecef15479a27a3ab15c0 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 3 May 2014 19:49:50 +0100 Subject: [PATCH] Add support for "before" field on startup modules --- boot/boot.js | 11 +++++++++++ .../tw5.com/tiddlers/mechanisms/StartupMechanism.tid | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 14b9b4615..1e15653d0 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1750,6 +1750,7 @@ $tw.boot.executeNextStartupTask = function() { if($tw.boot.isStartupTaskEligible(task)) { // Remove this task from the list $tw.boot.remainingStartupModules.splice(taskIndex,1); +console.log("Executing task",task.name); // Execute it if(!$tw.utils.hop(task,"synchronous") || task.synchronous) { task.startup(); @@ -1783,6 +1784,16 @@ $tw.boot.isStartupTaskEligible = function(taskModule) { } } } + // Check that no other outstanding tasks must be executed before this one + var name = taskModule.name, + remaining = $tw.boot.remainingStartupModules; + if(name) { + for(t=0; t