Merge branch 'ooslide' into staging
commit
4c8d142542
|
@ -20,7 +20,7 @@ define(function() {
|
|||
* users and these users will be redirected to the login page if they still try to access
|
||||
* the app
|
||||
*/
|
||||
config.registeredOnlyTypes = ['file', 'contacts', 'oodoc', 'ooslide', 'notifications', 'support'];
|
||||
config.registeredOnlyTypes = ['file', 'contacts', 'notifications', 'support'];
|
||||
|
||||
/* CryptPad is available is multiple languages, but only English and French are maintained
|
||||
* by the developers. The other languages may be outdated, and any missing string for a langauge
|
||||
|
|
|
@ -1089,7 +1089,7 @@ define([
|
|||
changes: parseChanges(obj.changes),
|
||||
changesIndex: ooChannel.cpIndex || 0,
|
||||
locks: getUserLock(getId()),
|
||||
excelAdditionalInfo: null
|
||||
excelAdditionalInfo: obj.excelAdditionalInfo
|
||||
}, null, function (err, hash) {
|
||||
if (err) {
|
||||
return void console.error(err);
|
||||
|
@ -1164,6 +1164,17 @@ define([
|
|||
}
|
||||
}
|
||||
break;
|
||||
case "cursor":
|
||||
cursor.updateCursor({
|
||||
type: "cursor",
|
||||
messages: [{
|
||||
cursor: obj.cursor,
|
||||
time: +new Date(),
|
||||
user: myUniqueOOId,
|
||||
useridoriginal: myOOId
|
||||
}]
|
||||
});
|
||||
break;
|
||||
case "getLock":
|
||||
handleLock(obj, send);
|
||||
break;
|
||||
|
@ -1438,6 +1449,29 @@ define([
|
|||
};
|
||||
*/
|
||||
|
||||
APP.getUserColor = function (userId) {
|
||||
var hex;
|
||||
Object.keys(content.ids || {}).some(function (k) {
|
||||
var u = content.ids[k];
|
||||
if (Number(u.ooid) === Number(userId)) {
|
||||
var md = common.getMetadataMgr().getMetadataLazy();
|
||||
if (md && md.users && md.users[u.netflux]) {
|
||||
hex = md.users[u.netflux].color;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (hex) {
|
||||
var rgb = Util.hexToRGB(hex);
|
||||
return {
|
||||
r: rgb[0],
|
||||
g: rgb[1],
|
||||
b: rgb[2],
|
||||
a: 255
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
APP.UploadImageFiles = function (files, type, id, jwt, cb) {
|
||||
return void cb();
|
||||
};
|
||||
|
@ -1500,6 +1534,12 @@ define([
|
|||
|
||||
APP.loadingImage = 0;
|
||||
APP.getImageURL = function(name, callback) {
|
||||
if (name && /^data:image/.test(name)) {
|
||||
var b = Util.dataURIToBlob(name);
|
||||
var url = URL.createObjectURL(blob);
|
||||
return void callback(url);
|
||||
}
|
||||
|
||||
var mediasSources = getMediasSources();
|
||||
var data = mediasSources[name];
|
||||
|
||||
|
@ -2243,6 +2283,7 @@ define([
|
|||
$contentContainer: $('#cp-app-oo-container')
|
||||
};
|
||||
toolbar = APP.toolbar = Toolbar.create(configTb);
|
||||
toolbar.showColors();
|
||||
Title.setToolbar(toolbar);
|
||||
|
||||
if (window.CP_DEV_MODE) {
|
||||
|
@ -2530,6 +2571,15 @@ define([
|
|||
initializing = false;
|
||||
common.openPadChat(APP.onLocal);
|
||||
|
||||
if (!readOnly) {
|
||||
common.openCursorChannel(APP.onLocal);
|
||||
cursor = common.createCursor(APP.onLocal);
|
||||
cursor.onCursorUpdate(function (data) {
|
||||
if (!data || !data.cursor) { return; }
|
||||
ooChannel.send(data.cursor);
|
||||
});
|
||||
}
|
||||
|
||||
if (APP.startWithTemplate) {
|
||||
var template = APP.startWithTemplate;
|
||||
loadTemplate(template.href, template.password, template.content);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -31,6 +31,7 @@ define([
|
|||
cursor: client.cursor
|
||||
};
|
||||
chan.sendMsg(JSON.stringify(data));
|
||||
console.error(data);
|
||||
ctx.emit('MESSAGE', data, chan.clients.filter(function (cl) {
|
||||
return cl !== clientId;
|
||||
}));
|
||||
|
|
|
@ -37,6 +37,7 @@ define([
|
|||
var $i = $('<iframe>').attr('id', 'sbox-iframe').attr('src',
|
||||
ApiConfig.httpSafeOrigin + (pathname || window.location.pathname) + 'inner.html?' +
|
||||
requireConfig.urlArgs + '#' + encodeURIComponent(JSON.stringify(req)));
|
||||
$i.attr('allowfullscreen', 'true');
|
||||
$('iframe-placeholder').after($i).remove();
|
||||
|
||||
// This is a cheap trick to avoid loading sframe-channel in parallel with the
|
||||
|
|
Loading…
Reference in New Issue