Merge branch 'soon' into staging

This commit is contained in:
yflory
2020-03-25 16:33:47 +01:00
21 changed files with 95 additions and 42 deletions

View File

@@ -66,7 +66,7 @@ define([
}), {
network: network
});
}).nThen(function (waitFor) {
}).nThen(function () {
var origin = ApiConfig.fileHost || window.location.origin;
// Get contacts and extract their avatar channel and key
var getData = function (obj, href) {

View File

@@ -15913,7 +15913,7 @@ CParagraphContentWithContentBase.prototype.protected_GetRangesCount=function(Lin
CParagraphContentWithContentBase.prototype.protected_AddRange=function(LineIndex,RangeIndex){if(this.Lines[0]>=LineIndex+1){var RangeOffset=this.protected_GetRangeOffset(LineIndex,0)+RangeIndex*2;this.Lines.splice(RangeOffset,this.Lines.length-RangeOffset);if(this.Lines[0]!==LineIndex+1&&0===RangeIndex)this.Lines.splice(LineIndex+1,this.Lines[0]-LineIndex);else if(this.Lines[0]!==LineIndex+1&&0!==RangeIndex){this.Lines.splice(LineIndex+2,this.Lines[0]-LineIndex-1);this.Lines[0]=LineIndex+1}}if(0===
RangeIndex)if(this.Lines[0]!==LineIndex+1){var OffsetValue=this.Lines.length-LineIndex-1;this.Lines.splice(LineIndex+1,0,OffsetValue);this.Lines[0]=LineIndex+1}var RangeOffset=1+this.Lines[0]+this.Lines[LineIndex+1]+RangeIndex*2;this.Lines[RangeOffset+0]=0;this.Lines[RangeOffset+1]=0;if(0!==LineIndex||0!==RangeIndex)return this.Lines[RangeOffset-1];else return 0};
CParagraphContentWithContentBase.prototype.protected_FillRange=function(LineIndex,RangeIndex,StartPos,EndPos){var RangeOffset=this.protected_GetRangeOffset(LineIndex,RangeIndex);this.Lines[RangeOffset+0]=StartPos;this.Lines[RangeOffset+1]=EndPos};CParagraphContentWithContentBase.prototype.protected_FillRangeEndPos=function(LineIndex,RangeIndex,EndPos){var RangeOffset=this.protected_GetRangeOffset(LineIndex,RangeIndex);this.Lines[RangeOffset+1]=EndPos};
CParagraphContentWithContentBase.prototype.private_UpdateSpellChecking=function(){if(this.Paragraph){this.Paragraph.SpellChecker.ClearPausedEngine();this.Paragraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All)}};CParagraphContentWithContentBase.prototype.Is_UseInDocument=function(Id){if(this.Paragraph){for(var i=0;i<this.Content.length;++i)if(this.Content[i].Get_Id&&this.Content[i].Get_Id()===Id)break;if(i<this.Content.length)return this.Paragraph.Is_UseInDocument(this.Get_Id())}return false};
CParagraphContentWithContentBase.prototype.private_UpdateSpellChecking=function(){if(this.Paragraph&&this.Paragraph.SpellChecker){this.Paragraph.SpellChecker.ClearPausedEngine();this.Paragraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All)}};CParagraphContentWithContentBase.prototype.Is_UseInDocument=function(Id){if(this.Paragraph){for(var i=0;i<this.Content.length;++i)if(this.Content[i].Get_Id&&this.Content[i].Get_Id()===Id)break;if(i<this.Content.length)return this.Paragraph.Is_UseInDocument(this.Get_Id())}return false};
CParagraphContentWithContentBase.prototype.protected_GetPrevRangeEndPos=function(LineIndex,RangeIndex){var RangeCount=this.protected_GetRangesCount(LineIndex-1);var RangeOffset=this.protected_GetRangeOffset(LineIndex-1,RangeCount-1);return LineIndex==0&&RangeIndex==0?0:this.Lines[RangeOffset+1]};
CParagraphContentWithContentBase.prototype.private_UpdateTrackRevisions=function(){if(this.Paragraph&&this.Paragraph.LogicDocument&&this.Paragraph.LogicDocument.GetTrackRevisionsManager){var RevisionsManager=this.Paragraph.LogicDocument.GetTrackRevisionsManager();RevisionsManager.CheckElement(this.Paragraph)}};CParagraphContentWithContentBase.prototype.CanSplit=function(){return true};CParagraphContentWithContentBase.prototype.PreDelete=function(){};
CParagraphContentWithContentBase.prototype.private_UpdateDocumentOutline=function(){if(this.Paragraph)this.Paragraph.UpdateDocumentOutline()};CParagraphContentWithContentBase.prototype.IsSolid=function(){return false};

View File

@@ -15729,7 +15729,7 @@ CParagraphContentWithContentBase.prototype.protected_GetRangesCount=function(Lin
CParagraphContentWithContentBase.prototype.protected_AddRange=function(LineIndex,RangeIndex){if(this.Lines[0]>=LineIndex+1){var RangeOffset=this.protected_GetRangeOffset(LineIndex,0)+RangeIndex*2;this.Lines.splice(RangeOffset,this.Lines.length-RangeOffset);if(this.Lines[0]!==LineIndex+1&&0===RangeIndex)this.Lines.splice(LineIndex+1,this.Lines[0]-LineIndex);else if(this.Lines[0]!==LineIndex+1&&0!==RangeIndex){this.Lines.splice(LineIndex+2,this.Lines[0]-LineIndex-1);this.Lines[0]=LineIndex+1}}if(0===
RangeIndex)if(this.Lines[0]!==LineIndex+1){var OffsetValue=this.Lines.length-LineIndex-1;this.Lines.splice(LineIndex+1,0,OffsetValue);this.Lines[0]=LineIndex+1}var RangeOffset=1+this.Lines[0]+this.Lines[LineIndex+1]+RangeIndex*2;this.Lines[RangeOffset+0]=0;this.Lines[RangeOffset+1]=0;if(0!==LineIndex||0!==RangeIndex)return this.Lines[RangeOffset-1];else return 0};
CParagraphContentWithContentBase.prototype.protected_FillRange=function(LineIndex,RangeIndex,StartPos,EndPos){var RangeOffset=this.protected_GetRangeOffset(LineIndex,RangeIndex);this.Lines[RangeOffset+0]=StartPos;this.Lines[RangeOffset+1]=EndPos};CParagraphContentWithContentBase.prototype.protected_FillRangeEndPos=function(LineIndex,RangeIndex,EndPos){var RangeOffset=this.protected_GetRangeOffset(LineIndex,RangeIndex);this.Lines[RangeOffset+1]=EndPos};
CParagraphContentWithContentBase.prototype.private_UpdateSpellChecking=function(){if(this.Paragraph){this.Paragraph.SpellChecker.ClearPausedEngine();this.Paragraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All)}};CParagraphContentWithContentBase.prototype.Is_UseInDocument=function(Id){if(this.Paragraph){for(var i=0;i<this.Content.length;++i)if(this.Content[i].Get_Id&&this.Content[i].Get_Id()===Id)break;if(i<this.Content.length)return this.Paragraph.Is_UseInDocument(this.Get_Id())}return false};
CParagraphContentWithContentBase.prototype.private_UpdateSpellChecking=function(){if(this.Paragraph&&this.Paragraph.SpellChecker){this.Paragraph.SpellChecker.ClearPausedEngine();this.Paragraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All)}};CParagraphContentWithContentBase.prototype.Is_UseInDocument=function(Id){if(this.Paragraph){for(var i=0;i<this.Content.length;++i)if(this.Content[i].Get_Id&&this.Content[i].Get_Id()===Id)break;if(i<this.Content.length)return this.Paragraph.Is_UseInDocument(this.Get_Id())}return false};
CParagraphContentWithContentBase.prototype.protected_GetPrevRangeEndPos=function(LineIndex,RangeIndex){var RangeCount=this.protected_GetRangesCount(LineIndex-1);var RangeOffset=this.protected_GetRangeOffset(LineIndex-1,RangeCount-1);return LineIndex==0&&RangeIndex==0?0:this.Lines[RangeOffset+1]};
CParagraphContentWithContentBase.prototype.private_UpdateTrackRevisions=function(){if(this.Paragraph&&this.Paragraph.LogicDocument&&this.Paragraph.LogicDocument.GetTrackRevisionsManager){var RevisionsManager=this.Paragraph.LogicDocument.GetTrackRevisionsManager();RevisionsManager.CheckElement(this.Paragraph)}};CParagraphContentWithContentBase.prototype.CanSplit=function(){return true};CParagraphContentWithContentBase.prototype.PreDelete=function(){};
CParagraphContentWithContentBase.prototype.private_UpdateDocumentOutline=function(){if(this.Paragraph)this.Paragraph.UpdateDocumentOutline()};CParagraphContentWithContentBase.prototype.IsSolid=function(){return false};

View File

@@ -11268,7 +11268,7 @@ CParagraphContentWithContentBase.prototype.protected_GetRangesCount=function(Lin
CParagraphContentWithContentBase.prototype.protected_AddRange=function(LineIndex,RangeIndex){if(this.Lines[0]>=LineIndex+1){var RangeOffset=this.protected_GetRangeOffset(LineIndex,0)+RangeIndex*2;this.Lines.splice(RangeOffset,this.Lines.length-RangeOffset);if(this.Lines[0]!==LineIndex+1&&0===RangeIndex)this.Lines.splice(LineIndex+1,this.Lines[0]-LineIndex);else if(this.Lines[0]!==LineIndex+1&&0!==RangeIndex){this.Lines.splice(LineIndex+2,this.Lines[0]-LineIndex-1);this.Lines[0]=LineIndex+1}}if(0===
RangeIndex)if(this.Lines[0]!==LineIndex+1){var OffsetValue=this.Lines.length-LineIndex-1;this.Lines.splice(LineIndex+1,0,OffsetValue);this.Lines[0]=LineIndex+1}var RangeOffset=1+this.Lines[0]+this.Lines[LineIndex+1]+RangeIndex*2;this.Lines[RangeOffset+0]=0;this.Lines[RangeOffset+1]=0;if(0!==LineIndex||0!==RangeIndex)return this.Lines[RangeOffset-1];else return 0};
CParagraphContentWithContentBase.prototype.protected_FillRange=function(LineIndex,RangeIndex,StartPos,EndPos){var RangeOffset=this.protected_GetRangeOffset(LineIndex,RangeIndex);this.Lines[RangeOffset+0]=StartPos;this.Lines[RangeOffset+1]=EndPos};CParagraphContentWithContentBase.prototype.protected_FillRangeEndPos=function(LineIndex,RangeIndex,EndPos){var RangeOffset=this.protected_GetRangeOffset(LineIndex,RangeIndex);this.Lines[RangeOffset+1]=EndPos};
CParagraphContentWithContentBase.prototype.private_UpdateSpellChecking=function(){if(this.Paragraph){this.Paragraph.SpellChecker.ClearPausedEngine();this.Paragraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All)}};CParagraphContentWithContentBase.prototype.Is_UseInDocument=function(Id){if(this.Paragraph){for(var i=0;i<this.Content.length;++i)if(this.Content[i].Get_Id&&this.Content[i].Get_Id()===Id)break;if(i<this.Content.length)return this.Paragraph.Is_UseInDocument(this.Get_Id())}return false};
CParagraphContentWithContentBase.prototype.private_UpdateSpellChecking=function(){if(this.Paragraph&&this.Paragraph.SpellChecker){this.Paragraph.SpellChecker.ClearPausedEngine();this.Paragraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All)}};CParagraphContentWithContentBase.prototype.Is_UseInDocument=function(Id){if(this.Paragraph){for(var i=0;i<this.Content.length;++i)if(this.Content[i].Get_Id&&this.Content[i].Get_Id()===Id)break;if(i<this.Content.length)return this.Paragraph.Is_UseInDocument(this.Get_Id())}return false};
CParagraphContentWithContentBase.prototype.protected_GetPrevRangeEndPos=function(LineIndex,RangeIndex){var RangeCount=this.protected_GetRangesCount(LineIndex-1);var RangeOffset=this.protected_GetRangeOffset(LineIndex-1,RangeCount-1);return LineIndex==0&&RangeIndex==0?0:this.Lines[RangeOffset+1]};
CParagraphContentWithContentBase.prototype.private_UpdateTrackRevisions=function(){if(this.Paragraph&&this.Paragraph.LogicDocument&&this.Paragraph.LogicDocument.GetTrackRevisionsManager){var RevisionsManager=this.Paragraph.LogicDocument.GetTrackRevisionsManager();RevisionsManager.CheckElement(this.Paragraph)}};CParagraphContentWithContentBase.prototype.CanSplit=function(){return true};CParagraphContentWithContentBase.prototype.PreDelete=function(){};
CParagraphContentWithContentBase.prototype.private_UpdateDocumentOutline=function(){if(this.Paragraph)this.Paragraph.UpdateDocumentOutline()};CParagraphContentWithContentBase.prototype.IsSolid=function(){return false};

View File

@@ -582,7 +582,8 @@
"a": "<em>Pad</em> è un termine popolare per <a href='http://etherpad.org/' target='_blank'>Etherpad</a>, un editor collaborativo in tempo reale.\nSi riferisce ad un documento che puoi modificare nel tuo browser, generalmente con le modifiche di altri utenti visibili in modo quasi istantaneo."
},
"expiring": {
"q": "Cos'è un pad effimero?"
"q": "Cos'è un pad effimero?",
"a": "Un <em>expiring pad</em> è un pad creato con una scadenza, raggiunta il pad verrà automaticamente cancellato dal server. Gli expiring pad possono essere configurati per durare da un minimo di un'ora ad un massimo di 100 mesi. Il pad e tutta la sua cronologia diventeranno permanentemente non disponibili anche se vengono modificati nel momento in cui scadono.<br><br>Se un pad è impostato con una scadenza, puoi controllare il suo tempo di durata visualizzando le sue <em> proprietà </em>, sia facendo clic con il tasto destro del mouse sul pad in CryptDrive, sia usando la <em> proprietà </em> -menu dalla barra degli strumenti di un'applicazione."
},
"owned": {
"a": "Un <em>pad di proprietà</em> è un pad creato da un esplicito <em>proprietario</em>, identificato dal server dalla sua <em>chiave di crittografia pubblica</em>. Il proprietario di un pad può scegliere di cancellare i suoi pad dal server, rendendoli invalidi per gli altri collaboratori nel futuro, sia che essi li avessero oppure no nei loro Cryptdrive.",

View File

@@ -457,9 +457,9 @@ define([
APP.editor.save();
};
Messages.profile_copyKey = "Copy edPublic key"; // XXX
var addPublicKey = function ($container) {
if (!APP.readOnly) { return; }
if (!Messages.profile_copyKey) { return; } // XXX
var $div = $(h('div.cp-sidebarlayout-element')).appendTo($container);
APP.$edPublic = $('<button>', {
@@ -473,6 +473,7 @@ define([
};
var setPublicKeyButton = function (data) {
if (!data.edPublic || APP.getEdPublic || !APP.readOnly) { return; }
if (!Messages.profile_copyKey) { return; } // XXX
APP.$edPublic.show();
APP.getEdPublic = function () {
var metadataMgr = APP.common.getMetadataMgr();

View File

@@ -35,7 +35,6 @@
#cp-app-whiteboard-container {
flex: 1;
display: flex;
flex-flow: column;
overflow: auto;
}
@@ -43,14 +42,17 @@
#cp-app-whiteboard-canvas-area {
flex: 1;
display: flex;
min-height: 0;
}
// created by fabricjs. styled so defaults don't break anything
.cp-app-whiteboard-canvas-container {
width: 100%;
margin: auto;
background: white;
flex: 1;
min-height: 0;
& > canvas {
width: 100%;
border: 1px solid black;
}
}

View File

@@ -137,7 +137,7 @@ define([
canvas.discardActiveGroup();
}
canvas.renderAll();
framework.localChange();
APP.onLocal();
};
$deleteButton.click(deleteSelection);
$(window).on('keyup', function (e) {
@@ -220,7 +220,7 @@ define([
var metadata = JSON.parse(JSON.stringify(metadataMgr.getMetadata()));
metadata.palette = newPalette;
metadataMgr.updateMetadata(metadata);
framework.localChange();
APP.onLocal();
};
var makeColorButton = function ($container) {
@@ -284,6 +284,34 @@ define([
});
var $canvas = $('canvas');
var $canvasContainer = $('canvas').parents('.cp-app-whiteboard-canvas-container');
var $container = $('#cp-app-whiteboard-container');
// Max for old macs: 2048×1464
// Max for IE: 8192x8192
var MAX = 8192;
var onResize = APP.onResize = function () {
var w = $container.width();
var h = $container.height();
canvas.forEachObject(function (obj) {
var c = obj.getCoords();
Object.keys(c).forEach(function (k) {
if (c[k].x > w) { w = c[k].x + 1; }
if (c[k].y > h) { h = c[k].y + 1; }
});
});
w = Math.min(w, MAX);
h = Math.min(h, MAX);
canvas.setWidth(w);
canvas.setHeight(h);
canvas.calcOffset();
};
$(window).on('resize', onResize);
var onLocal = APP.onLocal = function () {
framework.localChange();
APP.onResize();
};
var $controls = $('#cp-app-whiteboard-controls');
var metadataMgr = framework._.cpNfInner.metadataMgr;
@@ -333,7 +361,7 @@ define([
}
var cImg = new Fabric.Image(img, { left:0, top:0, angle:0, });
APP.canvas.add(cImg);
framework.localChange();
onLocal();
};
// Embed image
@@ -403,7 +431,7 @@ define([
$('#cp-app-whiteboard-clear').on('click', function () {
canvas.clear();
framework.localChange();
onLocal();
});
// ---------------------------------------------
@@ -432,6 +460,7 @@ define([
var content = newContent.content;
canvas.loadFromJSON(content, waitFor(function () {
canvas.renderAll();
onResize();
}));
});
@@ -461,7 +490,7 @@ define([
window.setTimeout(mkThumbnail, Thumb.UPDATE_FIRST);
});
canvas.on('mouse:up', framework.localChange);
canvas.on('mouse:up', onLocal);
framework.start();
};
@@ -471,8 +500,6 @@ define([
h('div#cp-app-whiteboard-canvas-area',
h('div#cp-app-whiteboard-container',
h('canvas#cp-app-whiteboard-canvas', {
width: 600,
height: 600
})
)
),