From 57c691c2e2f072b0b84e722acd47bc791a096246 Mon Sep 17 00:00:00 2001 From: Andreas Date: Mon, 28 Jun 2010 13:45:25 +0200 Subject: [PATCH] Make CPBundle post a notification on successfull load --- Foundation/CPBundle.j | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Foundation/CPBundle.j b/Foundation/CPBundle.j index 89c082c4b..8c8f54bbe 100644 --- a/Foundation/CPBundle.j +++ b/Foundation/CPBundle.j @@ -22,8 +22,12 @@ @import "CPDictionary.j" @import "CPObject.j" +@import "CPNotification.j" +@import "CPNotificationCenter.j" +CPBundleDidLoadNotification = "CPBundleDidLoadNotification"; + /*! @class CPBundle @ingroup foundation @@ -150,6 +154,9 @@ var CPBundlesForURLStrings = { }; _bundle.addEventListener("load", function() { [_delegate bundleDidFinishLoading:self]; + // userInfo should contain a list of all classes loaded from this bundle. When writing this there + // seems to be no efficient way to get it though. + [[CPNotificationCenter defaultCenter] postNotificationName:CPBundleDidLoadNotification object:self userInfo:nil]; }); _bundle.addEventListener("error", function()