94923a244d
LibreOffice Online/loleaflet-help (Esperanto) Currently translated at 86.5% (360 of 416 strings) Change-Id: I56d0230add8f8e93905dde4b958a4e9707747971 update translations LibreOffice Online/loleaflet-ui (French) Currently translated at 100.0% (322 of 322 strings) Change-Id: I81a950df9d51a5820c0ad220cde7f0f85097e546 update translations LibreOffice Online/loleaflet-help (Esperanto) Currently translated at 80.7% (336 of 416 strings) Change-Id: I66b141fb61f8badcf829fd6b5074d59b172b08e1 update translations LibreOffice Online/loleaflet-ui (Galician) Currently translated at 99.6% (321 of 322 strings) Change-Id: If22224d8b00ea80cbfe13c856336aa2bdf0d9d95 update translations LibreOffice Online/loleaflet-ui (English (United Kingdom)) Currently translated at 100.0% (322 of 322 strings) Change-Id: I2c844a1e4dbcb167321f281139c8a821da752c21 update translations LibreOffice Online/android-lib (Japanese) Currently translated at 33.3% (4 of 12 strings) Change-Id: Id6cbfb9db94b839c2b2a43ef4f58483b4261de5f update translations LibreOffice Online/loleaflet-help (Esperanto) Currently translated at 77.4% (322 of 416 strings) Change-Id: I2813c634ba83f16d4dcdaebab249aa2f9e0d814f update translations LibreOffice Online/loleaflet-help (Esperanto) Currently translated at 71.3% (297 of 416 strings) Change-Id: Ibf18ba501b7fc92fbf75360e054b7775beea3e17 update translations LibreOffice Online/loleaflet-help (Turkish) Currently translated at 62.5% (260 of 416 strings) Change-Id: I214808407c2e32cab8268cdd4d32a980ce652d06 update translations LibreOffice Online/loleaflet-help (Esperanto) Currently translated at 64.4% (268 of 416 strings) Change-Id: I65026aa394bb29075e4230e16269ca32a7690cde update translations LibreOffice Online/android-lib (Esperanto) Currently translated at 100.0% (12 of 12 strings) Change-Id: Iea02beaab3688f4356ce9d3f5e0c6667c017f5f4 update translations LibreOffice Online/ios (Esperanto) Currently translated at 100.0% (5 of 5 strings) Change-Id: I01ea8721c4b7fc0ad1b3c1fe7974c28ef6d5cd6c update translations LibreOffice Online/loleaflet-help (Esperanto) Currently translated at 55.5% (231 of 416 strings) Change-Id: I1386d42ed78446b6090d46527b4c8124f187fd8d update translations LibreOffice Online/loleaflet-ui (Esperanto) Currently translated at 100.0% (322 of 322 strings) Change-Id: I7f1bc4c0ccd996fb29eef23e9fbee45753649f5a update translations LibreOffice Online/loleaflet-help (Chinese (Simplified)) Currently translated at 70.4% (293 of 416 strings) Change-Id: I2b8282d3311d0bb6200fc74b1d26a2937086f5f5 update translations LibreOffice Online/loleaflet-help (Turkish) Currently translated at 62.0% (258 of 416 strings) Change-Id: Ieff6b116164158baf2d66340f85923a5c08b960f update translations LibreOffice Online/loleaflet-help (Turkish) Currently translated at 62.0% (258 of 416 strings) Change-Id: I45f59ea6402f681bb408564c997be4646db571b5 update translations LibreOffice Online/loleaflet-ui (Chinese (Simplified)) Currently translated at 99.6% (321 of 322 strings) Change-Id: Ib4c273101799fe0039c7b5810e8fbf0ad6f50685 update translations LibreOffice Online/loleaflet-ui (Turkish) Currently translated at 100.0% (322 of 322 strings) Change-Id: Ic877245a7891bb299a585d4bd597a4fbe14774d5 update translations LibreOffice Online/loleaflet-help (Chinese (Simplified)) Currently translated at 69.7% (290 of 416 strings) Change-Id: I5999a8a4d2788ef84643a67905b36f52030afe81 update translations LibreOffice Online/loleaflet-help (Chinese (Simplified)) Currently translated at 69.7% (290 of 416 strings) Change-Id: Ica27c7ea84ccd7a778d4fb5c3cd2ab5e86209b34 update translations LibreOffice Online/loleaflet-help (Chinese (Simplified)) Currently translated at 69.4% (289 of 416 strings) Change-Id: I48fb3125bceedb79c644d27d6bcac40f34d055c9 update translations LibreOffice Online/loleaflet-help (Chinese (Simplified)) Currently translated at 69.4% (289 of 416 strings) Change-Id: Ie5b169fbfc72b5611466dbf630ee3168615562a8 update translations LibreOffice Online/loleaflet-help (Chinese (Simplified)) Currently translated at 69.2% (288 of 416 strings) Change-Id: I05d20e4ca50566a0c3d5bb8ff56058f465fe7961 update translations LibreOffice Online/loleaflet-help (Chinese (Simplified)) Currently translated at 69.2% (288 of 416 strings) Change-Id: I6c9f9a21c7086fb70a5e225830f5c9aca222831b update translations LibreOffice Online/loleaflet-help (Turkish) Currently translated at 60.8% (253 of 416 strings) Change-Id: I1268459e093f58df8f95f47d2c9cfad9cffb8846 update translations LibreOffice Online/android-app (Esperanto) Currently translated at 100.0% (102 of 102 strings) Change-Id: I1725fff86a2ca0aae73005e1026571db491e1ba9 update translations LibreOffice Online/loleaflet-ui (Chinese (Traditional)) Currently translated at 97.5% (314 of 322 strings) Change-Id: I36f93a4bc595f7ce1d41b4c19a451d3c56ae23e4 update translations LibreOffice Online/loleaflet-ui (Chinese (Simplified)) Currently translated at 96.2% (310 of 322 strings) Change-Id: I87fe346a7db57bc79b7c781b83e8a41e0ccc8c74 update translations LibreOffice Online/loleaflet-ui (Chinese (Simplified)) Currently translated at 96.2% (310 of 322 strings) Change-Id: I7acc9c4583391144414fed1ca91e9ac35a4c7074 update translations LibreOffice Online/loleaflet-ui (Turkish) Currently translated at 96.8% (312 of 322 strings) Change-Id: I08e477f78062116042f9ef326eeb56aef37e10a8 update translations LibreOffice Online/loleaflet-ui (Turkish) Currently translated at 96.8% (312 of 322 strings) Change-Id: I5c7d356d4d56c815c42e39edeca0ca016377e943 update translations LibreOffice Online/loleaflet-ui (Slovak) Currently translated at 100.0% (322 of 322 strings) Change-Id: I09a00c871f71d29401e5f61ec8082742a225a44d update translations LibreOffice Online/loleaflet-ui (Italian) Currently translated at 100.0% (322 of 322 strings) Change-Id: I3c2e634aec9f9d21788532a87d4cd70b19624957 update translations LibreOffice Online/loleaflet-ui (Basque) Currently translated at 100.0% (322 of 322 strings) Change-Id: I498defcad98311b2cbe86a97f475aad797ca23ab update translations LibreOffice Online/loleaflet-ui (Chinese (Simplified)) Currently translated at 95.9% (309 of 322 strings) Change-Id: I2a6fe0df0497e02881ba4e80550960ea58d28137 update translations LibreOffice Online/loleaflet-ui (Slovenian) Currently translated at 100.0% (322 of 322 strings) Change-Id: I4c942a5f4bef50d0270df6c996d63d0abb1e3bc4 update translations LibreOffice Online/loleaflet-ui (Turkish) Currently translated at 92.8% (299 of 322 strings) Change-Id: Ib10b0348b486f0b15e5b526a797afba38100679e update translations LibreOffice Online/loleaflet-ui (Slovenian) Currently translated at 99.6% (321 of 322 strings) Change-Id: I723dc21aa74dbee24216a36503f444d59d5c002a update translations LibreOffice Online/loleaflet-ui (Welsh) Currently translated at 100.0% (322 of 322 strings) Change-Id: I0831f58b29a2f38d5930c1151822cd46228cc401 update translations LibreOffice Online/android-app (Esperanto) Currently translated at 24.5% (25 of 102 strings) Change-Id: I617ddf6110fb298ce1748c0f625f549bba720ef0 update translations LibreOffice Online/loleaflet-ui (Portuguese) Currently translated at 100.0% (322 of 322 strings) Change-Id: I453bcf9ed586f02947a0fcff6a0b32b278a8e27c update translations LibreOffice Online/loleaflet-ui (Polish) Currently translated at 100.0% (322 of 322 strings) Change-Id: I50ed9754d43f53981f569612daefea5060e420bc update translations LibreOffice Online/loleaflet-ui (Norwegian Bokmål) Currently translated at 100.0% (322 of 322 strings) Change-Id: I291186bf2449502b70807e74ec5de18a47edde2c update translations LibreOffice Online/loleaflet-ui (German) Currently translated at 100.0% (322 of 322 strings) Change-Id: Id2e5807b8256b6955a3d5264c5c46f85a3cf7076 update translations LibreOffice Online/loleaflet-ui (Catalan) Currently translated at 100.0% (322 of 322 strings) Change-Id: I530b95c303d0732abf521f34cbdad3bc0e1342b7 update translations LibreOffice Online/android-app (Dutch) Currently translated at 100.0% (102 of 102 strings) Change-Id: I11b0bbb1c9d555abbda75388cc4c4b57e37009c7 update translations LibreOffice Online/loleaflet-help (Dutch) Currently translated at 62.7% (261 of 416 strings) Change-Id: I023dac41e040fc0ff8d0ba2a9e668e647003964a update translations LibreOffice Online/loleaflet-ui (Dutch) Currently translated at 100.0% (322 of 322 strings) Change-Id: I0c52e2a8ae753222a6f2ab94d44bf20e87e8f45c update translations LibreOffice Online/loleaflet-ui (Spanish) Currently translated at 100.0% (322 of 322 strings) Change-Id: Id64266b21b81478bc656de6afa5f469d631881d2 update translations LibreOffice Online/loleaflet-ui (Czech) Currently translated at 100.0% (322 of 322 strings) Change-Id: Ib16320c130dd9d5121a25166afd53bbe3cf9a34a update translations LibreOffice Online/loleaflet-ui (Catalan) Currently translated at 98.1% (316 of 322 strings) Change-Id: Ia59bd51ebb14374365b0e5a63190f247953ab3eb update translations LibreOffice Online/loleaflet-ui (Asturian) Currently translated at 44.7% (144 of 322 strings) Change-Id: I4ffb03883e3b280a7a8ed09698e007e5e0816cc2 update translations LibreOffice Online/loleaflet-ui (Turkish) Currently translated at 92.2% (297 of 322 strings) Change-Id: I8cd95951d1374aa14f2f52315658d42ee5e17d1e update translations LibreOffice Online/loleaflet-ui (Portuguese (Brazil)) Currently translated at 100.0% (322 of 322 strings) Change-Id: I0b00b2f86cfd7781aed0a50da4952585e47c48f2 update translations LibreOffice Online/loleaflet-ui (Bulgarian) Currently translated at 100.0% (322 of 322 strings) Change-Id: I79f0ba16edc4148c476f284e3f39f9df65283b2b update translations LibreOffice Online/android-app (Slovenian) Currently translated at 100.0% (102 of 102 strings) Change-Id: I43d97c7bdf717c1c2b8212461498d4348ea95dc5 update translations LibreOffice Online/loleaflet-ui (Slovenian) Currently translated at 97.8% (315 of 322 strings) Change-Id: I99920ccb45ce23d130ba7771c4442124438aa47e update translations LibreOffice Online/loleaflet-ui (Polish) Currently translated at 100.0% (322 of 322 strings) Change-Id: I1ae60e074497c69b34b03a2b7427f6f51ecf5156 update translations LibreOffice Online/loleaflet-ui (Hungarian) Currently translated at 97.5% (314 of 322 strings) Change-Id: I745de31cd69a83bce820ac61845e331196c9c399 update translations LibreOffice Online/loleaflet-ui (Upper Sorbian) Currently translated at 100.0% (322 of 322 strings) Change-Id: I22e457737aaf6c9f6f6f17b9fe1ac290534c2b64 update translations LibreOffice Online/loleaflet-ui (Lower Sorbian) Currently translated at 100.0% (322 of 322 strings) Change-Id: Ief15cc27aa4b751dc42970b540684058e32ce88a Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Change-Id: I05ecc42fe7a49869b8865c502ad716f57554e029 Translation: LibreOffice Online/loleaflet-ui Translate-URL: https://weblate.documentfoundation.org/projects/libo_online/loleaflet-ui/ update translations LibreOffice Online/loleaflet-ui (Dutch) Currently translated at 100.0% (311 of 311 strings) Change-Id: Ie8bd9e8ebd6d1d511e83a02e13a0b433c4e58236 update translations LibreOffice Online/loleaflet-ui (Italian) Currently translated at 100.0% (311 of 311 strings) Change-Id: If3405ae6814e6d339174f1b6bd0fb6228ec9959c update translations LibreOffice Online/loleaflet-ui (Bulgarian) Currently translated at 100.0% (311 of 311 strings) Change-Id: I4a86f7d0c1ee8132c1a1246d433d75fed0326124 update translations LibreOffice Online/loleaflet-ui (Slovenian) Currently translated at 95.1% (296 of 311 strings) Change-Id: Idd97e0241eab71ae4507943c78e7c5dd0cfde6b8 update translations LibreOffice Online/loleaflet-ui (Norwegian Nynorsk) Currently translated at 78.1% (243 of 311 strings) Change-Id: Ib38821773823e15eeb5d0b088eb3c3f5532159b8 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Change-Id: I97138a367211ca306243e04f7e894876c9551091 Translation: LibreOffice Online/loleaflet-help Translate-URL: https://weblate.documentfoundation.org/projects/libo_online/loleaflet-help/ update translations LibreOffice Online/android-lib (Afrikaans) Currently translated at 100.0% (12 of 12 strings) Change-Id: I064b9621e82ace5bb77c5228a06d8f7ad4c9c008 update translations LibreOffice Online/loleaflet-ui (Slovak) Currently translated at 100.0% (311 of 311 strings) Change-Id: I1432b78958facf4f3a27839a863dd404f128540f update translations LibreOffice Online/loleaflet-ui (German) Currently translated at 100.0% (311 of 311 strings) Change-Id: If1be390f305b9f68dbadc50cdc0e4441c32544b8 update translations LibreOffice Online/loleaflet-ui (Afrikaans) Currently translated at 43.0% (134 of 311 strings) Change-Id: I81fa513e9a783a582b67cb449395528a855621c6 update translations LibreOffice Online/loleaflet-ui (Asturian) Currently translated at 44.7% (139 of 311 strings) Change-Id: Ib2293d0074960d9d28b29a0295937870cea7bfe1 update translations LibreOffice Online/loleaflet-ui (Aragonese) Currently translated at 1.9% (6 of 311 strings) Change-Id: Ifd437408ce3ac388a3e0b558ca5dd1409e9cc9b5 update translations LibreOffice Online/loleaflet-ui (French) Currently translated at 100.0% (311 of 311 strings) Change-Id: I59af48d270c9b8483502d6755e2993fa5189ece7 update translations LibreOffice Online/loleaflet-ui (Spanish) Currently translated at 100.0% (311 of 311 strings) Change-Id: I241199ef18c9d1131b994372096605901c83096b update translations LibreOffice Online/loleaflet-ui (Czech) Currently translated at 100.0% (311 of 311 strings) Change-Id: I6d233f3490882f37408f089d139d8e22332bd3a5 update translations LibreOffice Online/loleaflet-ui (Catalan) Currently translated at 100.0% (311 of 311 strings) Change-Id: If1eab5168f8494ce0a310d9d77c6d7ff58c91051 update translations LibreOffice Online/loleaflet-ui (Asturian) Currently translated at 44.1% (137 of 311 strings) Change-Id: I86d7be3d6f8e0c2ec8ad39841c3f5a5e1d8e42d5 update translations LibreOffice Online/loleaflet-ui (Portuguese (Brazil)) Currently translated at 100.0% (311 of 311 strings) Change-Id: Ic9c3a343a32cd63cd11bdd9261a29fd437810f74 update translations LibreOffice Online/loleaflet-ui (Basque) Currently translated at 100.0% (311 of 311 strings) Change-Id: Icf1fb226cd6d0ef55129370b014804f29cc39dc2 update translations LibreOffice Online/loleaflet-ui (Welsh) Currently translated at 100.0% (311 of 311 strings) Change-Id: Iddfe9de524a5f3ec9fb102d299bce88dea0d437a update translations LibreOffice Online/loleaflet-ui (English (United Kingdom)) Currently translated at 100.0% (311 of 311 strings) Change-Id: I9935200a16bb50bcc3b4b61c93fbb4c412ff3723 update translations LibreOffice Online/loleaflet-ui (Greek) Currently translated at 100.0% (311 of 311 strings) Change-Id: I5f2c47a133b1e0cf70ad7fc2dd19d4417377b203 update translations LibreOffice Online/loleaflet-ui (Polish) Currently translated at 100.0% (311 of 311 strings) Change-Id: I6ba4eed8864c8c61d5f3d74011a47106785f9174 update translations LibreOffice Online/loleaflet-ui (Hungarian) Currently translated at 100.0% (311 of 311 strings) Change-Id: I5356eb178fdca761afd8e6860a9d0d4e9b8adfc7 update translations LibreOffice Online/loleaflet-ui (Upper Sorbian) Currently translated at 100.0% (311 of 311 strings) Change-Id: I02e6fd4be08d6e2b970be2e61caba30322fd9fef update translations LibreOffice Online/loleaflet-ui (Lower Sorbian) Currently translated at 100.0% (311 of 311 strings) Change-Id: If1a10d5ce6487844f853a230d21e688ff8ccfc77 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Change-Id: I792cfd0edc9ed992d175fe7f93b8288f71e1cc0e Translation: LibreOffice Online/loleaflet-ui Translate-URL: https://weblate.documentfoundation.org/projects/libo_online/loleaflet-ui/ update translations LibreOffice Online/loleaflet-ui (Czech) Currently translated at 100.0% (310 of 310 strings) Change-Id: Icdd8e95a3bcad9dc90808b704d48160e6f12cf44 update translations LibreOffice Online/loleaflet-ui (Chinese (Traditional)) Currently translated at 100.0% (310 of 310 strings) Change-Id: If9a117838ac4d93ada913b0a3b7c87d4416c3143 |
||
---|---|---|
.. | ||
admin | ||
archived-packages | ||
css | ||
docs | ||
html | ||
images | ||
js | ||
l10n | ||
po | ||
src | ||
test | ||
util | ||
welcome | ||
.eslintignore | ||
.eslintrc | ||
.gitattributes | ||
.gitignore | ||
.npmignore | ||
.travis.yml | ||
bundle.js.m4 | ||
LICENSE | ||
loleaflet-src.js.m4 | ||
Makefile.am | ||
npm-shrinkwrap.json.in | ||
package.json | ||
README | ||
reference.html | ||
tsconfig.json |
Leaflet platform for LibreOffice Online ======================================== This is the client part of LibreOffice Online. For the server part, see the ../wsd/README, and install it first. Build dependencies ------------------ npm is provided by the nodejs package. npm should be at least 2.14, if not 3.x. Use `npm -v` to find the current version. Upgrade npm (as root): npm install -g npm Another way is to use npm as a user, but set its prefix to a directory where you have write access. If you want that, you need to have an ~/.npmrc with the line e.g. prefix=/opt/npm All of the dependency tree is locked in the repository, so there is no need to fetch data from npm registry at all. An npm install will use the tarballs in node_shrinkwrap/ directory, so build process can move forward even without an internet connection. To update any of the dependency, process often goes like this: 1.) Change version of the dependency in package.json 2.) Do an `npm update <package_name>', which fetches the new module from npm registry. Make sure that only the module that you want to update is updated. 3.) `npm shrinkwrap --dev` to update npm-shrinkwrap.json with newer information. You might see that this tool updates path convention of tarballs inside node_shrinkwrap/ also, but this should get corrected in next step. 4.) Do `shrinkpack', which should remove the old tarball, add new one, and make appropriate changes to npm-shrinkwrap.json (removing path convention changes by step 3). If you have not installed `shrinkpack' globally using `npm install -g shrinkpack@next', it should be in node_modules/.bin/shrinkpack, so you can use the binary from there. If you need to get the sources: make libs To bundle the file sanitize-url.js browserify braintree-sanitize-url/index.js --standalone sanitizeUrl > sanitize-url.js Building -------- Just do: make Above step would create a non-minified bundle.js and admin-bundle.js without source-maps in dist/ for main loleaflet and admin console respectively. To build with debug-info, i.e with sourcemaps: make DEBUG=true Above will produce source-map files, bundle.js.map and admin-bundle.js.map, for bundle.js and admin-bundle.js respectively. It will also link existing bundle.js and admin-bundle.js to their map files by adding a sourceMappingURL to them. While debugging, these .map files will be fetched from the server if present in dist/, otherwise there is no way to debug while browsing without these source-map files. To minify our bundle.js and admin-bundle.js passing a MINIFY=true flag to 'make' will minify it. This can be helpful in production environments. make MINIFY=true 'make dist' forces minifying. Running ------- To see an example: * run loolwsd, like: ./loolwsd --o:sys_template_path=${SYSTEMPLATE} --o:child_root_path=${ROOTFORJAILS} Note that this will, by default, set the loolwsd's file server's root to the parent directory of loolwsd, which means you can access all the files in loleaflet using /loleaflet/ path. It is advised to set file_server_root_path manually for more control. See wsd/README for more information. * open dist/loleaflet.html through loolwsd's fileserver https://localhost:9980/loleaflet/dist/loleaflet.html?file_path=file:///PATH/TO_DOC&host=wss://localhost:9980 and you should see the document in the browser. Note that accessing local storage is disabled by default for security reasons. You need to explicitly enable it with the --o:storage.filesystem[@allow]=true option of loolwsd. In case anything goes wrong, check the loolwsd console for the debugging output. You might be asked to confirm the certificate if you are using self-signed certificate for loolwsd. Development ----------- For faster development you might want to install browser-sync which can reload app in your browsers automatically after you edit and save the source code (so for .css only): npm install -g browser-sync Remember to add '--enable-browsersync' argument for './configure' script and delete `dist` directory. Run server and start browser-sync: LOOL_SERVE_FROM_FS=1 make run and in the second terminal: make sync-[writer|calc|impress] Your browser will open example document and now you can edit .css files and see the result without server restart. To run another document use: browser-sync start --config browsersync-config.js --startPath "loleaflet/96c23f663/loleaflet.html?file_path=file:///path/to/the/file.ods" Admin Panel ----------- You can do live monitoring of all the user sessions running on loolwsd instance. To access the admin console you need to ask for admin.html file from loolwsd which resides in dist/admin/admin.html. For example: https://localhost:9980/loleaflet/dist/admin/admin.html It will ask for username and password which is set by the admin_console options of loolwsd. For example you can pass --o:admin_console.username=admin --o:admin_console.password=admin in command line, or set these values in loolwsd.xml. After entering the correct password you should be able to monitor the live documents opened, total users, memory consumption, document URLs with number of users viewing that document etc. You can also kill the documents directly from the panel which would result in closing the socket connection to the respective document. API & events ------------ ####################################################################### # See /loleaflet/reference.html for a better formatted documentation. # # See /wsd/reference.md for the HTTP API documentation. # ####################################################################### Search: - API: map.search(text, [backward]) map.highlightAll(text) - events: map.on('search', function (e) {}) (currently only fired when no search result is found) where: + e.originalPhrase = the phrase that has been searched for + e.count = number of results + e.results = [SearchResult], where SearchResult = {part: part, rectangles: [Bounds]} Zoom: - API: map.zoomIn(amount) map.zoomOut(amount) map.getMinZoom() map.getMaxZoom() - events: map.on('zoomend zoomlevelschange', function) Edit, view, readOnly: - API: map.setPermission('edit' | 'view' | 'readonly') - events: map.on('updatepermission', function (e) {}) where: + e.perm == 'edit' | 'view' | 'readonly' Buttons like Bold, Italic, Strike through etc. - API: map.toggleCommandState('.uno:' + 'Bold' | 'Italic' | 'Underline' | 'Strikeout' | 'LeftPara' | 'CenterPara' | 'RightPara' | 'JustifyPara' | 'IncrementIndent' | 'DecrementIndent' - events: map.on('commandstatechanged', function (e) {}) where: + e.commandName == '.uno:' + 'Bold' | 'Italic' | 'StyleApply' | 'CharFontName' | 'FontHeight' etc. + e.state = 'true' | 'false' + e.state = fontName | fontSize | styleName map.on('commandresult', function (e) {}) where: + e.commandName == '.uno:' + 'Bold' | 'Italic' | 'StyleApply' | 'CharFontName' | 'FontHeight' etc. + e.success = true | false | undefined Parts (like slides in presentation, or sheets in spreadsheets): - API: map.setPart('next' | 'prev' | partNumber) map.getNumberOfParts() map.getCurrentPartNumber() map.getPreview(id, index, maxWidth, maxHeight, [options], forAllClients) + id = the ID of the request so that the response can be identified + index = the part / page 's number + maxWidth / maxHeight = max dimensions so that the ratio is preserved + options = {autoUpdate: <boolean>, broadcast: <boolean>} - + autoUpdate - boolean, automatically updates the previews + broadcast - boolean, whether the response (a preview of a slide) should be sent to all clients viewing the same presentation map.getCustomPreview(id, part, width, height, tilePosX, tilePosY, tileWidth, tileHeight, [options]) + id = the ID of the request so that the response can be identified + part = the part containing the desired preview + width / height = the preview's size in pixels + tilePosX / tilePosY = the rectangles's starting position in twips + tileWidth / tileHeight = the rectangle's dimension in twips + options = {autoUpdate: true} - automatically updates the previews map.removePreviewUpdate(id) + id = the preview's id - events: map.on('updateparts', function (e) {}) where: + e.selectedPart is the current part + e.parts == the number of parts that the document has + e.docType == 'text' | 'spreadsheet' | 'presentation' | 'drawing' | 'other' + [e.partNames] if present, part names (e.g. sheet names) map.on('tilepreview', function (e) {}) where: + e.tile - the preview image + e.id - the preview id + e.width - width of the image + e.height - height of the image + [e.part] - if the preview is for a part + e.docType Statusindicator (when the document is loading): - events map.on('statusindicator', function (e) {}) where: + e.statusType = 'start' | 'setvalue' | 'finish' | 'loleafletloaded' | 'alltilesloaded' + e.value == a value from 0 to 100 indicating the status if the statusType is 'setvalue + 'loleafletloaded' is fired when the JS code is initialized and the document load request is sent and we're waiting for the tiles + 'alltilesloaded' is fired when all newly requested (empty tiles) have been loaded it is not fired during pre-fetching and during editing Save: - API: map.saveAs(url, [format, options]) map.downloadAs(name, [format, options]) Scroll (the following are measured in pixels): - API: + options = An object with members: update (type: Boolean, default: false) like {update: true} map.scroll(x,y, options) + scroll right by 'x' and down by 'y' (or left and up if negative) map.scrollDown(y, options) + scroll down by 'y' (or up if negative) map.scrollRight(x, options) + scroll right by 'x' (or left if negative) map.scrollTop(y, options) + scroll to 'y' offset relative to the beginning of the document map.scrollLeft(x, options) + scroll to 'x' offset relative to the beginning of the document map.scrollOffset() + returns the scroll offset relative to the beginning of the document map.getDocSize() + returns the document's size in pixels map.getDocType() + returns 'text' | 'spreadsheet' | 'presentation' | 'drawing' | 'other' - events map.on('docsize', function (e) {}) where: + e.x = document width + e.y = document height map.on('updatescrolloffset', function (e) {}) where: + e.x = difference between document's left and current view's left (how much has the document been scrolled right) + e.y = difference between document's top and current view's top (how much has the document been scrolled down) - this event is fired when zooming and the current view is maintained but the document shrinks or grow OR when the document is panned OR when the container is resized map.on('scrollto', function (e) {}) where: + e.x = view's left position (so that the cursor/search result is in the center) + e.y = view's top position (so that the cursor/search result is in the center) map.on('scrollby', function (e) {}) where: + e.x = the amount scrolled to the right (or left if negative) + e.y = the amount scrolled to the bottom (or top if negative) Writer pages: - API: map.goToPage(page) map.getNumberOfPages() map.getCurrentPageNumber() map.getPreview(id, index, maxWidth, maxHeight, [options]) + id = the ID of the request so that the response can be identified + index = the part / page 's number + maxWidth / maxHeight = max dimensions so that the ratio is preserved + options = {autoUpdate: true} - automatically updates the previews map.getCustomPreview(id, part, width, height, tilePosX, tilePosY, tileWidth, tileHeight, [options]) + id = the ID of the request so that the response can be identified + part = the part containing the desired preview + width / height = the preview's size in pixels + tilePosX / tilePosY = the rectangles's starting position in twips + tileWidth / tileHeight = the rectangle's dimension in twips + options = {autoUpdate: true} - automatically updates the previews map.removePreviewUpdate(id) + id = the preview's id map.getPageSizes() + returns {twips: [Bounds], pixels: [Bounds]} - events map.on('pagenumberchanged', function (e) {}) where: + e.currentPage = the page on which the cursor lies + e.pages = number of pages + e.docType = document type, should be 'text' Error: - events map.on('error', function (e) {}) where + [e.msg] = a message describing the error + [e.cmd] = the command that caused the error + [e.kind] = the kind of error Infobars: - events map.on('infobar', function (e) {}) where + [e.msg] = a message + [e.actionlabel] = Label for the action button + [e.action] = A link (starting with http). Please extend to allow other actions when needed. CommandValues: - api: map.getToolbarCommandValues(command) + returns a JSON mapping of all possible values for the command map.applyFont(fontName) map.applyFontSize(fontSize) map.applyStyle(style, styleFamily) - events map.on('updatetoolbarcommandvalues', function (e) {}) where + e.commandName = '.uno:StyleApply', etc + e.commandValues = a JSON mapping of all possible values for the command Print: - events map.on('print', function (e) {}) where + e.url = file download url Contributing ------------ Code conventions: * files should have unix line terminators (LF) * tools to convert files: dos2unix or fromdos Implementation details ---------------------- Loading a document: The map should have the following options: - server address - doc - path to the document that will be loaded - edit = the initial permission - readOnly - whether the document is read only - [timestamp] - optionally provided for remote documents How zooming works: The zoom level goes from 1 to 20 (those limits can be changed) and the initial level is 10, which represents the 100% zoom level. The zoom factor is 1.2 Controls are added above the map in a div called "controls" is intended to be used as a toolbar. There is no leaflet method of adding them in a separate div, so for now this is done in the html document after the map initialization. To enable scrollbars the map is placed above a div that contains a bigger div of the document's size (a mock document). So the div under the map gets scrollbars which are independent of the map's div, thus enabling us to link them to the map as needed. When the user scrolls, the map is panned by the same amount as it would've been scrolled. Also, some custom jquery scrollbars are used, to trigger the same scroll events across browsers. Z-index values: ------------------------------------------- leaflet ------------------------------------------- 10 map 11 ruler ------------------------------------------- under menu ------------------------------------------- 990 sidebar 999 toolbar-up ------------------------------------------- menu items ------------------------------------------- 1000 main-menu(desktop-only), toolbar-down 1050 closebuttonwrapper (not being used currently) ------------------------------------------- on the top ------------------------------------------- 1105 dialogs 1001 mobile-edit-button 1500 mobile-wizard (with class=menuwizard) 1501 toolbar-hamburger (with class=menuwizard-opened) 2000 vex-overlay 2001 vex dialog (vex-content) -------------------------------------------