mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-19 21:09:13 +02:00
ViewerJS
addressbook
admin
api
images
inc
js
Resumable
dhtmlxMenu
dhtmlxtree
egw_action
etemplate
framework
jquery
jsapi
labjs
webodf
collab
app
backend
jsglobal
OperationRouter.js
Server.js
ServerFactory.js
SessionBackend.js
SessionList.js
pullbox
Server.js
ServerFactory.js
dijit
dojo
dojox
nbproject
resources
translations
widgets
EditorSession.js
FullWindowZoomHelper.js
MemberListView.js
ServerFactory.js
SessionListView.js
Tools.js
Translator.js
avatar-joe.png
dojo-amalgamation.js
webodf.js
welcome.odt
wodocollabpane.css
wodocollabtexteditor.js
wodotexteditor.css
wodotexteditor.js
AGPL-3.0.txt
template.odt
webodf-debug.js
webodf.js
egw_json.js
es6-promise.min.js
login.js
lang
ntlm
setup
src
templates
tests
anon_images.php
asyncservices.php
asyncwrapper.php
categories.php
config.php
emclient-signatures.php
images.php
lang.php
thumbnail.php
user.php
calendar
doc
emailadmin
filemanager
files
home
importexport
infolog
mail
notifications
pixelegg
preferences
resources
setup
timesheet
.gitignore
.htaccess
.mrconfig
.travis.yml
Gruntfile.js
README.md
about.php
composer.json
composer.lock
groupdav.htaccess
groupdav.php
header.inc.php.template
index.php
json.php
login.php
logout.php
package.json
redirect.php
remote.php
share.php
status.php
updateGruntfile.php
webdav.php
104 lines
3.2 KiB
JavaScript
104 lines
3.2 KiB
JavaScript
/**
|
|
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
|
*
|
|
* @licstart
|
|
* This file is part of WebODF.
|
|
*
|
|
* WebODF is free software: you can redistribute it and/or modify it
|
|
* under the terms of the GNU Affero General Public License (GNU AGPL)
|
|
* as published by the Free Software Foundation, either version 3 of
|
|
* the License, or (at your option) any later version.
|
|
*
|
|
* WebODF is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
|
|
* @licend
|
|
*
|
|
* @source: http://www.webodf.org/
|
|
* @source: https://github.com/kogmbh/WebODF/
|
|
*/
|
|
|
|
/*global define, window, runtime, core*/
|
|
|
|
webodfModule.define("webodf/editor/backend/jsglobal/Server", [], function () {
|
|
"use strict";
|
|
|
|
/**
|
|
* @constructor
|
|
* @implements ops.Server
|
|
*/
|
|
return function JsGlobalServer() {
|
|
var jsGlobalInstance;
|
|
|
|
this.getGenesisUrl = function () {
|
|
return "welcome.odt";
|
|
};
|
|
|
|
this.getJsGlobalServer = function() {
|
|
return jsGlobalInstance;
|
|
};
|
|
|
|
/*jslint unparam: true*/
|
|
/**
|
|
* @param {!number} timeout in milliseconds
|
|
* @param {!function(!string)} callback
|
|
* @return {undefined}
|
|
*/
|
|
this.connect = function (timeout, callback) {
|
|
var interval = window.setInterval(function() {
|
|
if (window.jsGlobalInstance) {
|
|
jsGlobalInstance = window.jsGlobalInstance;
|
|
window.clearInterval(interval);
|
|
callback("ready");
|
|
}
|
|
// TODO properly timeout
|
|
}, 100);
|
|
};
|
|
/*jslint unparam: false*/
|
|
|
|
/**
|
|
* @return {!string}
|
|
*/
|
|
this.networkStatus = function () {
|
|
return "ready";
|
|
};
|
|
|
|
/**
|
|
* @param {!string} login
|
|
* @param {!string} password
|
|
* @param {function(!Object)} successCb
|
|
* @param {function(!string)} failCb
|
|
* @return {undefined}
|
|
*/
|
|
this.login = function (login, password, successCb, failCb) {
|
|
jsGlobalInstance.login(login, password, successCb, failCb);
|
|
};
|
|
|
|
/**
|
|
* @param {!string} userId
|
|
* @param {!string} sessionId
|
|
* @param {!function(!string)} successCb
|
|
* @param {!function()} failCb
|
|
* @return {undefined}
|
|
*/
|
|
this.joinSession = function (userId, sessionId, successCb, failCb) {
|
|
jsGlobalInstance.joinSession(userId, sessionId, successCb, failCb);
|
|
};
|
|
|
|
/**
|
|
* @param {!string} sessionId
|
|
* @param {!string} memberId
|
|
* @param {!function()} successCb
|
|
* @param {!function()} failCb
|
|
* @return {undefined}
|
|
*/
|
|
this.leaveSession = function (sessionId, memberId, successCb, failCb) {
|
|
jsGlobalInstance.leaveSession(sessionId, memberId, successCb, failCb);
|
|
};
|
|
};
|
|
});
|