New apps for text, slide and spreadsheet

This commit is contained in:
yflory
2018-02-19 18:52:57 +01:00
parent 831c23b259
commit 7cb3282634
3200 changed files with 384 additions and 53 deletions

View File

@@ -9,7 +9,8 @@ define(function() {
/* Select the buttons displayed on the main page to create new collaborative sessions
* Existing types : pad, code, poll, slide
*/
config.availablePadTypes = ['drive', 'pad', 'code', 'slide', 'poll', 'whiteboard', 'file', 'todo', 'contacts'];
config.availablePadTypes = ['drive', 'pad', 'code', 'slide', 'poll', 'whiteboard',
'oodoc', 'ooslide', 'oocell', 'file', 'todo', 'contacts'];
config.registeredOnlyTypes = ['file', 'contacts'];
/* Cryptpad apps use a common API to display notifications to users
@@ -81,6 +82,9 @@ define(function() {
whiteboard: 'fa-paint-brush',
todo: 'fa-tasks',
contacts: 'fa-users',
oodoc: 'fa-file-word-o',
ooslide: 'fa-file-powerpoint-o',
oocell: 'fa-file-excel-o',
};
// EXPERIMENTAL: Enabling "displayCreationScreen" may cause UI issues and possible loss of data

View File

@@ -672,12 +672,24 @@ define([
});
});
break;
case 'save': // OnlyOffice save
button = $('<button>', {
'class': 'fa fa-save',
title: 'TODO OnlyOffice save',
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'})
.text('TODO: OnlyOffice save'))
.click(common.prepareFeedback(type));
if (callback) { button.click(callback); }
break;
default:
button = $('<button>', {
'class': "fa fa-question",
style: 'font:'+size+' FontAwesome'
})
.click(common.prepareFeedback(type));
if (callback) {
button.click(callback);
}
}
if (rightside) {
button.addClass('cp-toolbar-rightside-button');

View File

Before

Width:  |  Height:  |  Size: 477 KiB

After

Width:  |  Height:  |  Size: 477 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

View File

@@ -29,10 +29,13 @@ define([
{
var saveAs = window.saveAs;
/*
var ooReady = window.frames[0] && window.frames[0].frames[0] && window.frames[0].frames[0].editor;
window.onOOReady = function () {
console.log('ready!');
ooReady = true;
};
*/
var APP = window.APP = {
$: $
@@ -77,9 +80,12 @@ define([
var loadDocument = APP.loadDocument = function (content, file) {
console.log("Read " + content);
return;
/*
// TODO: load a document from server here
window.frames[0].frames[0].editor.asc_CloseFile();
var openResult = {bSerFormat: true, data: content, url: "http://localhost:3000/onlyoffice/", changes: null};
window.frames[0].frames[0].editor.openDocument(openResult);
*/
};
var readOnly = false;
@@ -119,7 +125,6 @@ define([
};
APP.onLocal = config.onLocal = function () {
console.log(initializing, readOnly);
if (initializing) { return; }
if (readOnly) { return; }
@@ -127,8 +132,9 @@ define([
console.log("Cannot access editor");
return;
}
console.log('ok');
var data = window.frames[0].frames[0].editor.asc_nativeGetFile();
console.log('onLocal, data avalable');
data = '';
var content = stringifyInner(data);
APP.realtime.contentUpdate(content);
};
@@ -169,14 +175,9 @@ define([
var $import = common.createButton('import', true, {}, loadDocument);
$rightside.append($import);
var $save = common.createButton('save', true, {}, saveToServer);
$save.click(function () {
saveToServer();
});
$rightside.append($save);
var $remote = common.createButton('remote', true, {}, callRemote);
$remote.click(function () {
callRemote();
});
$remote.attr('title', 'call onRemote');
$rightside.append($remote);
if (common.isLoggedIn()) {
@@ -293,9 +294,11 @@ define([
var common;
nThen(function (waitFor) {
/*
if (!ooReady) {
window.onOOReady = waitFor();
}
*/
$(waitFor(function () {
UI.addLoadingScreen();
}));

View File

@@ -20,8 +20,8 @@ define([
window.rc = requireConfig;
window.apiconf = ApiConfig;
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/onlyoffice/document/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
ApiConfig.httpSafeOrigin + window.location.pathname + 'inner.html?' +
requireConfig.urlArgs + '#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.

View File

@@ -0,0 +1 @@
{}

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 902 B

After

Width:  |  Height:  |  Size: 902 B

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

View File

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 163 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 540 KiB

After

Width:  |  Height:  |  Size: 540 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Some files were not shown because too many files have changed in this diff Show More