Folder JS Hooks

Enterprise-style Google Drive Embedder folders fire Javascript events when certain things happen. Your own code could hook into these events.

The events available are:

gdm_loading_folder(folderid)

The folder with ID folderid (a string) is about to be fetched from Google’s API.

gdm_loaded_folder(folderid)

The folder with ID folderid (a string) has returned from Google’s API.

gdm_loaded_file_preview(filedata)

The user clicks on a file so that it displays in the preview lightbox. The filedata is a Javascript object containing the data supplied by the Drive API. e.g. filedata.title is the file’s title.

gdm_loaded_file_open(filedata)

The user clicks on a file so that it opens in a new window, or downloads. filedata as above.

Example

You could hook into the gdm_loading_folder and gdm_loaded_folder events to display/hide your own ‘loading’ spinner so the user knows they are waiting for something to happen. As basic examples using Javascript alerts to signal the start and finish of the load:

jQuery('body').on('gdm_loading_folder', function(e, folderid) { 
   alert("Loading "+folderid);
});

jQuery('body').on('gdm_loaded_folder', function(e, folderid) {
   alert("Completed "+folderid);}
);
Google Apps Login is trusted by thousands of organizations from small businesses to NASDAQ-listed companies and government organizations.
Users click their way through Login via Google (just one click after the first time)

Users click their way through Login via Google (just one click after the first time)

You can try it out by clicking below to auto-create a test account on this site! This will show you the basic Google login process.
Try out Google login
 

Logging in is only the start – Google Apps Login takes care of all your WordPress user management. Find out more here.

[user_show_avatar]

See [user_first_name] – that was easy!

Your account has been created, and you are now logged in. On your own site, you will specify your Google Apps domain – e.g. mycompany.com – and only users on that domain will be allowed to auto-create accounts.
Logging in is only the start – Google Apps Login takes care of all your WordPress user management.
Find out more

×