TeamLab Document Editors API Documentation
TeamLab API is used to let the developers integrate the TeamLab Document/Spreadsheet/Presentation Editors into their own web sites and setup and manage the editors.
The API JavaScript file can normally be found in the following editors folder:
/apps/api/documents/api.js
The target HTML file where the editors are to be embedded need to have a placeholder div tag, where all the information about the editor parameters will be passed:
<div id="placeholder"></div> <script type="text/javascript" src="api.js"></script>
The page code containing the changeable parameters looks the following way:
var docEditor = new DocsAPI.DocEditor('placeholder', config)
Where config is an object:
config = { type: 'desktop', width: '100%', height: '100%', documentType: 'spreadsheet', document: { title: 'Example Document Title.doc', url: 'http://www.examplesite.com/url-to-example-document/', fileType: 'doc', key: 'Khirz6zTPdfd7riF8lgCc56Rya_ejbfYJSA=', vkey: 'd0hOVHBKdVVQaTBma1dHa1dBbFJjZz09fHsicGFpZCI6dHJ1ZSwiZXhwaXJlIjoiXC6a1BkZmQ3ck1TNW05NGRxaUY4bGdDYzU2UnlhX2VqYmZZSlNBPSIsImlwIjoiMTg0LjczLjE4OS4xNzMifQ2', info: { author: 'Jessie Jamieson', folder: 'Example Files', created: '12/12/2012 3:46 PM', sharingSettings: [ { user: 'John Smith', permissions: 'Full Access' }, ... ] }, permissions: { edit: true, download: false } }, 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' }, ... ], }, events: { 'onReady': onDocEditorReady, 'onDocumentStateChange': onDocumentStateChange, 'onRequestEditRights': onRequestEditRights, 'onSave': onDocumentSave, 'onError': onError, 'onBack': onBack } };
Please see other sections for more options: