update webodf
This commit is contained in:
parent
f81e9a0607
commit
7e8715a785
@ -265,13 +265,11 @@ define("webodf/editor/Editor", [
|
||||
*/
|
||||
self.loadSession = function (sessionId, editorReadyCallback) {
|
||||
initGuiAndDoc("/session/" + sessionId + "/genesis", function () {
|
||||
// use the nowjs op-router when connected
|
||||
// opRouter = opRouter || new ops.NowjsOperationRouter(sessionId, memberid, server);
|
||||
opRouter = opRouter || new ops.PullBoxOperationRouter(sessionId, memberid, server);
|
||||
// get router and user model
|
||||
opRouter = opRouter || server.createOperationRouter(sessionId, memberid);
|
||||
session.setOperationRouter(opRouter);
|
||||
|
||||
// userModel = userModel || new ops.NowjsUserModel(server);
|
||||
userModel = userModel || new ops.PullBoxUserModel(server);
|
||||
userModel = userModel || server.createUserModel();
|
||||
session.setUserModel(userModel);
|
||||
|
||||
opRouter.requestReplay(function done() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright (C) 2012 KO GmbH <copyright@kogmbh.com>
|
||||
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
||||
*
|
||||
* @licstart
|
||||
* The JavaScript code in this page is free software: you can redistribute it
|
||||
@ -44,10 +44,6 @@ define("webodf/editor/EditorSession", [
|
||||
|
||||
runtime.loadClass("ops.OdtDocument");
|
||||
runtime.loadClass("ops.Session");
|
||||
// runtime.loadClass("ops.NowjsOperationRouter");
|
||||
// runtime.loadClass("ops.NowjsUserModel");
|
||||
runtime.loadClass("ops.PullBoxOperationRouter");
|
||||
runtime.loadClass("ops.PullBoxUserModel");
|
||||
runtime.loadClass("odf.OdfCanvas");
|
||||
runtime.loadClass("gui.CaretFactory");
|
||||
runtime.loadClass("gui.Caret");
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright (C) 2012 KO GmbH <copyright@kogmbh.com>
|
||||
* Copyright (C) 2012-2013 KO GmbH <copyright@kogmbh.com>
|
||||
*
|
||||
* @licstart
|
||||
* The JavaScript code in this page is free software: you can redistribute it
|
||||
|
@ -210,7 +210,10 @@ var webodfEditor = (function () {
|
||||
editorOptions.loadCallback = load;
|
||||
editorOptions.saveCallback = save;
|
||||
|
||||
runtime.assert(docUrl, "docUrl needs to be specified");
|
||||
if (docUrl === undefined) {
|
||||
docUrl = guessDocUrl();
|
||||
}
|
||||
runtime.assert(docUrl, "docUrl needs to be specified");
|
||||
runtime.assert(editorInstance === null, "cannot boot with instanciated editor");
|
||||
|
||||
document.getElementById("mainContainer").style.display = "";
|
||||
@ -350,13 +353,10 @@ var webodfEditor = (function () {
|
||||
args = args || {};
|
||||
|
||||
if (args.collaborative === undefined) {
|
||||
args.collaborative = "auto";
|
||||
args.collaborative = "standalone";
|
||||
} else {
|
||||
args.collaborative = String(args.collaborative).toLowerCase();
|
||||
}
|
||||
if (args.docUrl === undefined) {
|
||||
args.docUrl = guessDocUrl();
|
||||
}
|
||||
|
||||
if (args.saveCallback) {
|
||||
editorOptions.saveCallback = args.saveCallback;
|
||||
|
@ -8993,10 +8993,16 @@ ops.Server.prototype.login = function(login, password, successCb, failCb) {
|
||||
@source: http://gitorious.org/webodf/webodf/
|
||||
*/
|
||||
ops.NowjsServer = function NowjsServer() {
|
||||
var nowObject;
|
||||
var self = this, nowObject;
|
||||
this.getNowObject = function() {
|
||||
return nowObject
|
||||
};
|
||||
function createOperationRouter(sid, mid) {
|
||||
return new ops.NowjsOperationRouter(sid, mid, self)
|
||||
}
|
||||
function createUserModel() {
|
||||
return new ops.NowjsUserModel(self)
|
||||
}
|
||||
this.connect = function(timeout, callback) {
|
||||
var accumulatedWaitingTime = 0;
|
||||
if(nowObject) {
|
||||
@ -9036,7 +9042,9 @@ ops.NowjsServer = function NowjsServer() {
|
||||
}else {
|
||||
nowObject.login(login, password, successCb, failCb)
|
||||
}
|
||||
}
|
||||
};
|
||||
this.createOperationRouter = createOperationRouter;
|
||||
this.createUserModel = createUserModel
|
||||
};
|
||||
/*
|
||||
|
||||
@ -9078,6 +9086,12 @@ ops.PullBoxServer = function PullBoxServer(args) {
|
||||
var self = this, token, base64 = new core.Base64;
|
||||
args = args || {};
|
||||
args.url = args.url || "/WSER";
|
||||
function createOperationRouter(sid, mid) {
|
||||
return new ops.PullBoxOperationRouter(sid, mid, self)
|
||||
}
|
||||
function createUserModel() {
|
||||
return new ops.PullBoxUserModel(self)
|
||||
}
|
||||
function call(message, cb) {
|
||||
var xhr = new XMLHttpRequest, byteArrayWriter = new core.ByteArrayWriter("utf8"), data;
|
||||
function handleResult() {
|
||||
@ -9135,7 +9149,9 @@ ops.PullBoxServer = function PullBoxServer(args) {
|
||||
failCb(responseData)
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
this.createOperationRouter = createOperationRouter;
|
||||
this.createUserModel = createUserModel
|
||||
};
|
||||
/*
|
||||
|
||||
|
816
js/webodf.js
816
js/webodf.js
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user