Skip to content

Additional Runtimes

Davit Barbakadze edited this page Aug 6, 2017 · 9 revisions

We've added two additional runtimes in 1.2.0 - GoogleDrive and Dropbox. They are fully functional, but not immediately available like other ones (HTML5, Flash, etc). You will need to compile them in manually. For building instructions check broad readme on moxie page.

GoogleDrive

As the name suggests it has something to do with Google and its Drive. The point is to let the users pick the files from their Google Drive and let you to manipulate them in some way - inspect the source, for example, or upload them to another server. Component instantiation logic stays the same, the only exception is that you need to supply API credentials (Client ID and API Key) in the config.

For example this is how you create FileInput instance:

var fi = new o.FileInput({
	runtime_order: 'googledrive',
	browse_button: 'browse_button',
	googledrive: {
		clientId: "CLIENT_ID_FOR_WEB_APPLICATION",
		apiKey: "API_KEY"
	}
});

Notice that option in the config where you provide the credentials has the same name as the runtime - this is how you pass in parameters.

Click here to create the project in Google Developer Console and obtain the credentials to supply.

Dropbox

On big part, everything that was said for the GoogleDrive runtime is true for the Dropbox runtime as well. Here's how FileInput example will look like in this case:

var fi = new o.FileInput({
	runtime_order: 'dropbox',
	browse_button: 'browse_button',
	dropbox: {
		appKey: "APP_KEY"
	}
});

Notice that the option bears the name of the runtime and sub-option name is appKey.

You need to create the Drop-in Application in the Dropbox App Console to obtain the key.

Clone this wiki locally