TeamLab Document Editors API Documentation
config > editorConfig
The editorConfig section allows to change the following editor settings:
- mode - defines the editor opening mode. Can be either view to open the document for viewing, or edit to open the document in the editing mode allowing to apply changes to the document data. parameter type: string
- lang - defines the editor interface language (if some other languages other than English are present). Is set using the two letter (de, ru, it, etc.) or four letter (en-US, fr-FR, etc.) language codes. parameter type: string
- canBackToFolder - defines the presence or absence of the Go to Documents link which will allow to return to the folder where the list of all the documents to be viewed or edited is present. parameter type: Boolean value
- canCreateNew - defines the presence or absence of the Create New... menu option which will allow to create new document of the same type. parameter type: Boolean value
- createUrl - defines the URL of the document where it will be created and available after creation. The editor will add '?title={document title}&action=create' parameter type: string
- user - the user currently viewing or editing the document.
parameter type: string
- id - the identification of the user parameter type: string
- name - the full name of the user parameter type: string
- recent - defines the presence or absence of the documents in the Open Recent... menu option where the following document parameters can be set:
- title - the document title that will be displayed in the Open Recent... menu option; parameter type: string
- url - the URL to the document where it is stored; parameter type: string
- folder - the folder where the document is stored (can be empty in case the document is stored in the root folder). parameter type: string
- The following section is for the embedded document type only (see the config section to find out how to define the embedded document type).embedded - defines the properties of the embedded document:
- embedUrl - the URL to the document serving as a source file for the document embedded into the web page; parameter type: string
- fullscreenUrl - the URL to the document which will open in full screen mode; parameter type: string
- saveUrl - the URL that will allow the document to be saved onto the user personal computer; parameter type: string
- shareUrl - the URL that will allow other users to share this document; parameter type: string
- toolbarDocked - the place for the embedded viewer toolbar, can be either top or bottom. parameter type: string
var docEditor = new DocsAPI.DocEditor('placeholder', { editorConfig: { mode: 'edit', lang: 'en-US', canBackToFolder: true, canCreateNew: true, createUrl: 'http://www.examplesite.com/url-to-example-document/', user: { id: '78e1e841-8314-48465-8fc0-e7d6451b6475', name: 'John Smith' }, recent: [ { title: 'exampledocument1.doc', url: 'http://www.examplesite.com/files/exampledocument1.doc', folder: 'Example Files' }, ... ], embedded: { embedUrl: 'http://www.examplesite.com/files/?action=embedded&doc=exampledocument1.doc', fullscreenUrl: 'http://www.examplesite.com/files/?action=embedded&doc=exampledocument1.doc#fullscreen', saveUrl: 'http://www.examplesite.com/files/?action=download&doc=exampledocument1.doc', shareUrl: 'http://www.examplesite.com/files/?action=view&doc=exampledocument1.doc', toolbarDocked: 'top' } } });
Please see other sections for more options: