Merge pull request #252 from Xelio/patch-hook-iitcLoaded

Add 'iitcLoaded' hook to notify that IITC and all plugins loaded.
This commit is contained in:
Jon Atkins 2013-05-09 20:42:21 -07:00
commit d1d1fa85ce
2 changed files with 3 additions and 2 deletions

View File

@ -420,6 +420,7 @@ function boot() {
setTimeout('window.map.invalidateSize(false);', 500); setTimeout('window.map.invalidateSize(false);', 500);
window.iitcLoaded = true; window.iitcLoaded = true;
window.runHooks('iitcLoaded');
} }
// this is the minified load.js script that allows us to easily load // this is the minified load.js script that allows us to easily load

View File

@ -53,14 +53,14 @@
// set reached to true. // set reached to true.
// requestFinished: called after each request finished. Argument is // requestFinished: called after each request finished. Argument is
// {success: boolean} indicated the request success or fail. // {success: boolean} indicated the request success or fail.
// iitcLoaded: called after IITC and all plugins loaded
window._hooks = {} window._hooks = {}
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated', window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
'publicChatDataAvailable', 'factionChatDataAvailable', 'portalDataLoaded', 'publicChatDataAvailable', 'factionChatDataAvailable', 'portalDataLoaded',
'beforePortalReRender', 'checkRenderLimit', 'requestFinished', 'nicknameClicked', 'beforePortalReRender', 'checkRenderLimit', 'requestFinished', 'nicknameClicked',
'geoSearch']; 'geoSearch', 'iitcLoaded'];
window.runHooks = function(event, data) { window.runHooks = function(event, data) {
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event); if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);