quasi-update (manual) webodf
This commit is contained in:
parent
a629eda1b2
commit
a3348ae6f6
@ -86,7 +86,7 @@ var webodfEditor = (function () {
|
|||||||
server = new ops.NowjsServer();
|
server = new ops.NowjsServer();
|
||||||
} else if (backend === "owncloud") {
|
} else if (backend === "owncloud") {
|
||||||
runtime.loadClass("ops.PullBoxServer");
|
runtime.loadClass("ops.PullBoxServer");
|
||||||
server = new ops.PullBoxServer({url: "../../ajax/otpoll.php"});
|
server = new ops.PullBoxServer({url: "./office/ajax/otpoll.php"});
|
||||||
server.getGenesisUrl = function(sid) {
|
server.getGenesisUrl = function(sid) {
|
||||||
return "/owncloud/index.php/apps/files/download/welcome.odt";
|
return "/owncloud/index.php/apps/files/download/welcome.odt";
|
||||||
};
|
};
|
||||||
@ -252,6 +252,11 @@ var webodfEditor = (function () {
|
|||||||
editorOptions.networked = true;
|
editorOptions.networked = true;
|
||||||
editorOptions.networkSecurityToken = token;
|
editorOptions.networkSecurityToken = token;
|
||||||
|
|
||||||
|
// if pre-authentication has happened:
|
||||||
|
if (token) {
|
||||||
|
server.setToken(token);
|
||||||
|
}
|
||||||
|
|
||||||
require({ }, ["webodf/editor/Editor"],
|
require({ }, ["webodf/editor/Editor"],
|
||||||
function (Editor) {
|
function (Editor) {
|
||||||
// TODO: the networkSecurityToken needs to be retrieved via now.login
|
// TODO: the networkSecurityToken needs to be retrieved via now.login
|
||||||
|
@ -9136,6 +9136,9 @@ ops.PullBoxServer = function PullBoxServer(args) {
|
|||||||
this.getToken = function() {
|
this.getToken = function() {
|
||||||
return token
|
return token
|
||||||
};
|
};
|
||||||
|
this.setToken = function (a_token) {
|
||||||
|
token = a_token;
|
||||||
|
};
|
||||||
this.connect = function(timeout, callback) {
|
this.connect = function(timeout, callback) {
|
||||||
var accumulatedWaitingTime = 0;
|
var accumulatedWaitingTime = 0;
|
||||||
callback("ready")
|
callback("ready")
|
||||||
@ -10621,6 +10624,7 @@ gui.SelectionMover = function SelectionMover(cursor, rootNode) {
|
|||||||
if(!containerOffset) {
|
if(!containerOffset) {
|
||||||
containerOffset = getOffset(container)
|
containerOffset = getOffset(container)
|
||||||
}
|
}
|
||||||
|
runtime.assert(containerOffset, "getRect: invalid containerOffset");
|
||||||
rect.top = containerOffset.top;
|
rect.top = containerOffset.top;
|
||||||
rect.left = containerOffset.right;
|
rect.left = containerOffset.right;
|
||||||
rect.bottom = containerOffset.bottom
|
rect.bottom = containerOffset.bottom
|
||||||
@ -10639,6 +10643,9 @@ gui.SelectionMover = function SelectionMover(cursor, rootNode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
runtime.assert(rect, "getRect invalid rect");
|
||||||
|
runtime.assert(rect.top !== undefined, "getRect rect without top property");
|
||||||
|
|
||||||
return{top:rect.top, left:rect.left, bottom:rect.bottom}
|
return{top:rect.top, left:rect.left, bottom:rect.bottom}
|
||||||
}
|
}
|
||||||
function doMove(steps, extend, move) {
|
function doMove(steps, extend, move) {
|
||||||
@ -12642,8 +12649,10 @@ ops.PullBoxOperationRouter = function PullBoxOperationRouter(sessionId, memberId
|
|||||||
triggerPushingOps()
|
triggerPushingOps()
|
||||||
};
|
};
|
||||||
function init() {
|
function init() {
|
||||||
var base64 = server.getBase64();
|
var base64 = server.getBase64(),
|
||||||
server.call("join-session:" + base64.toBase64(server.getToken()) + ":" + base64.toBase64(sessionId) + ":" + base64.toBase64(memberId), function(responseData) {
|
token = server.getToken();
|
||||||
|
runtime.assert(token, "invalid token");
|
||||||
|
server.call("join-session:" + base64.toBase64(token) + ":" + base64.toBase64(sessionId) + ":" + base64.toBase64(memberId), function(responseData) {
|
||||||
var response = Boolean(runtime.fromJson(responseData));
|
var response = Boolean(runtime.fromJson(responseData));
|
||||||
runtime.log("join-session reply: " + responseData);
|
runtime.log("join-session reply: " + responseData);
|
||||||
runtime.assert(response, "Trying to join a session which does not exists or where we are already in")
|
runtime.assert(response, "Trying to join a session which does not exists or where we are already in")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user