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