From 6cd3328389ebbffb4fdf80d524ce1f4ff3b2e63d Mon Sep 17 00:00:00 2001 From: Xelio Date: Wed, 8 May 2013 20:47:41 +0800 Subject: [PATCH] Add 'iitcLoaded' hook to notify that IITC and all plugins loaded. --- code/boot.js | 1 + code/hooks.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/boot.js b/code/boot.js index fcc04011..eeb3f52c 100644 --- a/code/boot.js +++ b/code/boot.js @@ -431,6 +431,7 @@ function boot() { setTimeout('window.map.invalidateSize(false);', 500); window.iitcLoaded = true; + window.runHooks('iitcLoaded'); } // this is the minified load.js script that allows us to easily load diff --git a/code/hooks.js b/code/hooks.js index 5b4eb167..35fef550 100644 --- a/code/hooks.js +++ b/code/hooks.js @@ -53,14 +53,14 @@ // set reached to true. // requestFinished: called after each request finished. Argument is // {success: boolean} indicated the request success or fail. - +// iitcLoaded: called after IITC and all plugins loaded window._hooks = {} window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated', 'publicChatDataAvailable', 'factionChatDataAvailable', 'portalDataLoaded', 'beforePortalReRender', 'checkRenderLimit', 'requestFinished', 'nicknameClicked', - 'geoSearch']; + 'geoSearch', 'iitcLoaded']; window.runHooks = function(event, data) { if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);