diff --git a/programs/editor/wodocollabtexteditor.js b/programs/editor/wodocollabtexteditor.js index 540cb4cb..f744f344 100644 --- a/programs/editor/wodocollabtexteditor.js +++ b/programs/editor/wodocollabtexteditor.js @@ -179,7 +179,7 @@ window.Wodo = window.Wodo || (function () { imageEditingEnabled = isEnabled(editorOptions.imageEditingEnabled, true), hyperlinkEditingEnabled = isEnabled(editorOptions.hyperlinkEditingEnabled, true), reviewModeEnabled = isEnabled(editorOptions.reviewModeEnabled, true), - annotationsEnabled = reviewModeEnabled || isEnabled(editorOptions.annotationsEnabled, true), + annotationsEnabled = reviewModeEnabled || isEnabled(editorOptions.annotationsEnabled), undoRedoEnabled = false, // no proper mechanism yet for collab zoomingEnabled = isEnabled(editorOptions.zoomingEnabled), // diff --git a/webodf/lib/manifest.json b/webodf/lib/manifest.json index bfd636c5..57576a10 100644 --- a/webodf/lib/manifest.json +++ b/webodf/lib/manifest.json @@ -505,11 +505,13 @@ "ops.OperationFactory" ], "ops.OperationTransformMatrix": [ + "ops.OpAddAnnotation", "ops.OpAddStyle", "ops.OpApplyDirectStyling", "ops.OpInsertText", "ops.OpMergeParagraph", "ops.OpMoveCursor", + "ops.OpRemoveAnnotation", "ops.OpRemoveCursor", "ops.OpRemoveStyle", "ops.OpRemoveText", diff --git a/webodf/lib/ops/OperationTransformMatrix.js b/webodf/lib/ops/OperationTransformMatrix.js index c4a743ca..bfd28073 100644 --- a/webodf/lib/ops/OperationTransformMatrix.js +++ b/webodf/lib/ops/OperationTransformMatrix.js @@ -273,6 +273,258 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { /* Transformation methods */ + /** + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpecA + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpecB + * @param {!boolean} hasAPriority + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformAddAnnotationAddAnnotation(addAnnotationSpecA, addAnnotationSpecB, hasAPriority) { + var firstAnnotationSpec, secondAnnotationSpec; + + if (addAnnotationSpecA.position < addAnnotationSpecB.position) { + firstAnnotationSpec = addAnnotationSpecA; + secondAnnotationSpec = addAnnotationSpecB; + } else if (addAnnotationSpecB.position < addAnnotationSpecA.position) { + firstAnnotationSpec = addAnnotationSpecB; + secondAnnotationSpec = addAnnotationSpecA; + } else { + firstAnnotationSpec = hasAPriority ? addAnnotationSpecA : addAnnotationSpecB; + secondAnnotationSpec = hasAPriority ? addAnnotationSpecB : addAnnotationSpecA; + } + + if (secondAnnotationSpec.position < firstAnnotationSpec.position + firstAnnotationSpec.length) { + firstAnnotationSpec.length += 2; + } + secondAnnotationSpec.position += 2; + + return { + opSpecsA: [addAnnotationSpecA], + opSpecsB: [addAnnotationSpecB] + }; + } + + /** + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpec + * @param {!ops.OpApplyDirectStyling.Spec} applyDirectStylingSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformAddAnnotationApplyDirectStyling(addAnnotationSpec, applyDirectStylingSpec) { + if (addAnnotationSpec.position <= applyDirectStylingSpec.position) { + applyDirectStylingSpec.position += 2; + } else if (addAnnotationSpec.position <= applyDirectStylingSpec.position + applyDirectStylingSpec.length) { + applyDirectStylingSpec.length += 2; + } + + return { + opSpecsA: [addAnnotationSpec], + opSpecsB: [applyDirectStylingSpec] + }; + } + + /** + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpec + * @param {!ops.OpInsertText.Spec} insertTextSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformAddAnnotationInsertText(addAnnotationSpec, insertTextSpec) { + if (insertTextSpec.position <= addAnnotationSpec.position) { + addAnnotationSpec.position += insertTextSpec.text.length; + } else { + if (addAnnotationSpec.length !== undefined) { + if (insertTextSpec.position <= addAnnotationSpec.position + addAnnotationSpec.length) { + addAnnotationSpec.length += insertTextSpec.text.length; + } + } + // 2, because 1 for pos inside annotation comment, 1 for new pos before annotated range + insertTextSpec.position += 2; + } + + return { + opSpecsA: [addAnnotationSpec], + opSpecsB: [insertTextSpec] + }; + } + + /** + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpec + * @param {!ops.OpMergeParagraph.Spec} mergeParagraphSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformAddAnnotationMergeParagraph(addAnnotationSpec, mergeParagraphSpec) { + if (mergeParagraphSpec.sourceStartPosition <= addAnnotationSpec.position) { + addAnnotationSpec.position -= 1; + } else { + if (addAnnotationSpec.length !== undefined) { + if (mergeParagraphSpec.sourceStartPosition <= addAnnotationSpec.position + addAnnotationSpec.length) { + addAnnotationSpec.length -= 1; + } + } + + // 2, because 1 for pos inside annotation comment, 1 for new pos before annotated range + mergeParagraphSpec.sourceStartPosition += 2; + + if (addAnnotationSpec.position < mergeParagraphSpec.destinationStartPosition) { + mergeParagraphSpec.destinationStartPosition += 2; + } + } + + return { + opSpecsA: [addAnnotationSpec], + opSpecsB: [mergeParagraphSpec] + }; + } + + /** + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpec + * @param {!ops.OpMoveCursor.Spec} moveCursorSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformAddAnnotationMoveCursor(addAnnotationSpec, moveCursorSpec) { + var isMoveCursorSpecRangeInverted = invertMoveCursorSpecRangeOnNegativeLength(moveCursorSpec); + + // adapt movecursor spec to inserted positions + if (addAnnotationSpec.position < moveCursorSpec.position) { + // 2, because 1 for pos inside annotation comment, 1 for new pos before annotated range + moveCursorSpec.position += 2; + } else if (addAnnotationSpec.position < moveCursorSpec.position + moveCursorSpec.length) { + // 2, because 1 for pos inside annotation comment, 1 for new pos before annotated range + moveCursorSpec.length += 2; + } + + if (isMoveCursorSpecRangeInverted) { + invertMoveCursorSpecRange(moveCursorSpec); + } + + return { + opSpecsA: [addAnnotationSpec], + opSpecsB: [moveCursorSpec] + }; + } + + /** + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpec + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformAddAnnotationRemoveAnnotation(addAnnotationSpec, removeAnnotationSpec) { + // adapt movecursor spec to inserted positions + if (addAnnotationSpec.position < removeAnnotationSpec.position) { + if (removeAnnotationSpec.position < addAnnotationSpec.position + addAnnotationSpec.length) { + addAnnotationSpec.length -= removeAnnotationSpec.length + 2; + } + // 2, because 1 for pos inside annotation comment, 1 for new pos before annotated range + removeAnnotationSpec.position += 2; + } else { + // 2, because 1 for pos inside annotation comment, 1 for new pos before annotated range + addAnnotationSpec.position -= removeAnnotationSpec.length + 2; + } + + return { + opSpecsA: [addAnnotationSpec], + opSpecsB: [removeAnnotationSpec] + }; + } + + /** + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpec + * @param {!ops.OpRemoveText.Spec} removeTextSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformAddAnnotationRemoveText(addAnnotationSpec, removeTextSpec) { + var removeTextSpecPosition = removeTextSpec.position, + removeTextSpecEnd = removeTextSpec.position + removeTextSpec.length, + annotationSpecEnd, + helperOpspec, + addAnnotationSpecResult = [addAnnotationSpec], + removeTextSpecResult = [removeTextSpec]; + + // adapt removeTextSpec + if (addAnnotationSpec.position <= removeTextSpec.position) { + // 2, because 1 for pos inside annotation comment, 1 for new pos before annotated range + removeTextSpec.position += 2; + } else if (addAnnotationSpec.position < removeTextSpecEnd) { + // we have to split the removal into two ops, before and after the annotation start + removeTextSpec.length = addAnnotationSpec.position - removeTextSpec.position; + helperOpspec = { + optype: "RemoveText", + memberid: removeTextSpec.memberid, + timestamp: removeTextSpec.timestamp, + position: addAnnotationSpec.position + 2, + length: removeTextSpecEnd - addAnnotationSpec.position + }; + removeTextSpecResult.unshift(helperOpspec); // helperOp first, so its position is not affected by the real op + } + + // adapt addAnnotationSpec (using already changed removeTextSpec and new helperOpspec, be aware) + if (removeTextSpec.position + removeTextSpec.length <= addAnnotationSpec.position) { + addAnnotationSpec.position -= removeTextSpec.length; + if ((addAnnotationSpec.length !== undefined) && helperOpspec) { + if (helperOpspec.length >= addAnnotationSpec.length) { + addAnnotationSpec.length = 0; + } else { + addAnnotationSpec.length -= helperOpspec.length; + } + } + } else if (addAnnotationSpec.length !== undefined) { + annotationSpecEnd = addAnnotationSpec.position + addAnnotationSpec.length; + if (removeTextSpecEnd <= annotationSpecEnd) { + addAnnotationSpec.length -= removeTextSpec.length; + } else if (removeTextSpecPosition < annotationSpecEnd) { + addAnnotationSpec.length = removeTextSpecPosition - addAnnotationSpec.position; + } + } + + return { + opSpecsA: addAnnotationSpecResult, + opSpecsB: removeTextSpecResult + }; + } + + /** + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpec + * @param {!ops.OpSetParagraphStyle.Spec} setParagraphStyleSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformAddAnnotationSetParagraphStyle(addAnnotationSpec, setParagraphStyleSpec) { + if (addAnnotationSpec.position < setParagraphStyleSpec.position) { + setParagraphStyleSpec.position += 2; + } + + return { + opSpecsA: [addAnnotationSpec], + opSpecsB: [setParagraphStyleSpec] + }; + } + + /** + * @param {!ops.OpAddAnnotation.Spec} addAnnotationSpec + * @param {!ops.OpSplitParagraph.Spec} splitParagraphSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformAddAnnotationSplitParagraph(addAnnotationSpec, splitParagraphSpec) { + if (addAnnotationSpec.position < splitParagraphSpec.sourceParagraphPosition) { + splitParagraphSpec.sourceParagraphPosition += 2; + } + + if (splitParagraphSpec.position <= addAnnotationSpec.position) { + addAnnotationSpec.position += 1; + } else { + if (addAnnotationSpec.length !== undefined) { + if (splitParagraphSpec.position <= addAnnotationSpec.position + addAnnotationSpec.length) { + addAnnotationSpec.length += 1; + } + } + // 2, because 1 for pos inside annotation comment, 1 for new pos before annotated range + splitParagraphSpec.position += 2; + } + + return { + opSpecsA: [addAnnotationSpec], + opSpecsB: [splitParagraphSpec] + }; + } + /** * @param {!ops.OpAddStyle.Spec} addStyleSpec * @param {!ops.OpRemoveStyle.Spec} removeStyleSpec @@ -463,6 +715,39 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { }; } + /** + * @param {!ops.OpApplyDirectStyling.Spec} applyDirectStylingSpec + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformApplyDirectStylingRemoveAnnotation(applyDirectStylingSpec, removeAnnotationSpec) { + var pointA = applyDirectStylingSpec.position, + pointB = applyDirectStylingSpec.position + applyDirectStylingSpec.length, + removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, + applyDirectStylingSpecResult = [applyDirectStylingSpec], + removeAnnotationSpecResult = [removeAnnotationSpec]; + + // check if inside removed annotation + if (removeAnnotationSpec.position <= pointA && pointB <= removeAnnotationEnd) { + applyDirectStylingSpecResult = []; + } else { + // adapt applyDirectStyling spec to removed annotation content + if (removeAnnotationEnd < pointA) { + pointA -= removeAnnotationSpec.length + 2; + } + if (removeAnnotationEnd < pointB) { + pointB -= removeAnnotationSpec.length + 2; + } + applyDirectStylingSpec.position = pointA; + applyDirectStylingSpec.length = pointB - pointA; + } + + return { + opSpecsA: applyDirectStylingSpecResult, + opSpecsB: removeAnnotationSpecResult + }; + } + /** * @param {!ops.OpApplyDirectStyling.Spec} applyDirectStylingSpec * @param {!ops.OpRemoveText.Spec} removeTextSpec @@ -603,6 +888,36 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { }; } + /** + * @param {!ops.OpInsertText.Spec} insertTextSpec + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformInsertTextRemoveAnnotation(insertTextSpec, removeAnnotationSpec) { + var insertTextSpecPosition = insertTextSpec.position, + removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, + insertTextSpecResult = [insertTextSpec], + removeAnnotationSpecResult = [removeAnnotationSpec]; + + // check if inside removed annotation + if (removeAnnotationSpec.position <= insertTextSpecPosition && insertTextSpecPosition <= removeAnnotationEnd) { + insertTextSpecResult = []; + removeAnnotationSpec.length += insertTextSpec.text.length; + } else { + // adapt insertText spec to removed annotation content + if (removeAnnotationEnd < insertTextSpec.position) { + insertTextSpec.position -= removeAnnotationSpec.length + 2; + } else { + removeAnnotationSpec.position += insertTextSpec.text.length; + } + } + + return { + opSpecsA: insertTextSpecResult, + opSpecsB: removeAnnotationSpecResult + }; + } + /** * @param {!ops.OpInsertText.Spec} insertTextSpec * @param {!ops.OpRemoveText.Spec} removeTextSpec @@ -795,6 +1110,39 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { }; } + /** + * @param {!ops.OpMergeParagraph.Spec} mergeParagraphSpec + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformMergeParagraphRemoveAnnotation(mergeParagraphSpec, removeAnnotationSpec) { + var removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, + mergeParagraphSpecResult = [mergeParagraphSpec], + removeAnnotationSpecResult = [removeAnnotationSpec]; + + // check if inside removed annotation + if (removeAnnotationSpec.position <= mergeParagraphSpec.destinationStartPosition && mergeParagraphSpec.sourceStartPosition <= removeAnnotationEnd) { + mergeParagraphSpecResult = []; + removeAnnotationSpec.length -= 1; + } else { + if (mergeParagraphSpec.sourceStartPosition < removeAnnotationSpec.position) { + removeAnnotationSpec.position -= 1; + } else { + if (removeAnnotationEnd < mergeParagraphSpec.destinationStartPosition) { + mergeParagraphSpec.destinationStartPosition -= removeAnnotationSpec.length + 2; + } + if (removeAnnotationEnd < mergeParagraphSpec.sourceStartPosition) { + mergeParagraphSpec.sourceStartPosition -= removeAnnotationSpec.length + 2; + } + } + } + + return { + opSpecsA: mergeParagraphSpecResult, + opSpecsB: removeAnnotationSpecResult + }; + } + /** * @param {!ops.OpMergeParagraph.Spec} mergeParagraphSpec * @param {!ops.OpRemoveText.Spec} removeTextSpec @@ -1112,6 +1460,37 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { }; } + /** + * @param {!ops.OpMoveCursor.Spec} moveCursorSpec + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformMoveCursorRemoveAnnotation(moveCursorSpec, removeAnnotationSpec) { + var isMoveCursorSpecRangeInverted = invertMoveCursorSpecRangeOnNegativeLength(moveCursorSpec), + moveCursorSpecEnd = moveCursorSpec.position + moveCursorSpec.length, + removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length; + + // check if inside removed annotation + if (removeAnnotationSpec.position <= moveCursorSpec.position && moveCursorSpecEnd <= removeAnnotationEnd) { + moveCursorSpec.position = removeAnnotationSpec.position - 1; + moveCursorSpec.length = 0; + } else { + if (removeAnnotationEnd < moveCursorSpec.position) { + moveCursorSpec.position -= removeAnnotationSpec.length + 2; + } else if (removeAnnotationEnd < moveCursorSpecEnd) { + moveCursorSpec.length -= removeAnnotationSpec.length + 2; + } + if (isMoveCursorSpecRangeInverted) { + invertMoveCursorSpecRange(moveCursorSpec); + } + } + + return { + opSpecsA: [moveCursorSpec], + opSpecsB: [removeAnnotationSpec] + }; + } + /** * @param {!ops.OpMoveCursor.Spec} moveCursorSpec * @param {!ops.OpRemoveCursor.Spec} removeCursorSpec @@ -1200,6 +1579,123 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { }; } + /** + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpecA + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpecB + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformRemoveAnnotationRemoveAnnotation(removeAnnotationSpecA, removeAnnotationSpecB) { + var removeAnnotationSpecAResult = [removeAnnotationSpecA], + removeAnnotationSpecBResult = [removeAnnotationSpecB]; + + // check if removing the same annotation + if (removeAnnotationSpecA.position === removeAnnotationSpecB.position && removeAnnotationSpecA.length === removeAnnotationSpecB.length) { + removeAnnotationSpecAResult = []; + removeAnnotationSpecBResult = []; + } else { + if (removeAnnotationSpecA.position < removeAnnotationSpecB.position) { + removeAnnotationSpecB.position -= removeAnnotationSpecA.length + 2; + } else { + removeAnnotationSpecA.position -= removeAnnotationSpecB.length + 2; + } + } + + return { + opSpecsA: removeAnnotationSpecAResult, + opSpecsB: removeAnnotationSpecBResult + }; + } + + /** + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpec + * @param {!ops.OpRemoveText.Spec} removeTextSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformRemoveAnnotationRemoveText(removeAnnotationSpec, removeTextSpec) { + var removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, + removeTextSpecEnd = removeTextSpec.position + removeTextSpec.length, + removeAnnotationSpecResult = [removeAnnotationSpec], + removeTextSpecResult = [removeTextSpec]; + + // check if inside removed annotation + if (removeAnnotationSpec.position <= removeTextSpec.position && removeTextSpecEnd <= removeAnnotationEnd) { + removeTextSpecResult = []; + removeAnnotationSpec.length -= removeTextSpec.length; + } else { + if (removeTextSpecEnd < removeAnnotationSpec.position) { + removeAnnotationSpec.position -= removeTextSpec.length; + } else if (removeTextSpec.position < removeAnnotationSpec.position) { + removeAnnotationSpec.position = removeTextSpec.position + 1; + removeTextSpec.length -= removeAnnotationSpec.length + 2; + } else { + removeTextSpec.position -= removeAnnotationSpec.length + 2; + } + } + + return { + opSpecsA: removeAnnotationSpecResult, + opSpecsB: removeTextSpecResult + }; + } + + /** + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpec + * @param {!ops.OpSetParagraphStyle.Spec} setParagraphStyleSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformRemoveAnnotationSetParagraphStyle(removeAnnotationSpec, setParagraphStyleSpec) { + var setParagraphStyleSpecPosition = setParagraphStyleSpec.position, + removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, + removeAnnotationSpecResult = [removeAnnotationSpec], + setParagraphStyleSpecResult = [setParagraphStyleSpec]; + + // check if inside removed annotation + if (removeAnnotationSpec.position <= setParagraphStyleSpecPosition && setParagraphStyleSpecPosition <= removeAnnotationEnd) { + setParagraphStyleSpecResult = []; + } else { + if (removeAnnotationEnd < setParagraphStyleSpecPosition) { + setParagraphStyleSpec.position -= removeAnnotationSpec.length + 2; + } + } + + return { + opSpecsA: removeAnnotationSpecResult, + opSpecsB: setParagraphStyleSpecResult + }; + } + + /** + * @param {!ops.OpRemoveAnnotation.Spec} removeAnnotationSpec + * @param {!ops.OpSplitParagraph.Spec} splitParagraphSpec + * @return {?{opSpecsA:!Array., opSpecsB:!Array.}} + */ + function transformRemoveAnnotationSplitParagraph(removeAnnotationSpec, splitParagraphSpec) { + var splitParagraphSpecPosition = splitParagraphSpec.position, + removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, + removeAnnotationSpecResult = [removeAnnotationSpec], + splitParagraphSpecResult = [splitParagraphSpec]; + + // check if inside removed annotation + if (removeAnnotationSpec.position <= splitParagraphSpecPosition && splitParagraphSpecPosition <= removeAnnotationEnd) { + splitParagraphSpecResult = []; + removeAnnotationSpec.length += 1; + } else { + if (removeAnnotationEnd < splitParagraphSpec.sourceParagraphPosition) { + splitParagraphSpec.sourceParagraphPosition -= removeAnnotationSpec.length + 2; + } + if (removeAnnotationEnd < splitParagraphSpecPosition) { + splitParagraphSpec.position -= removeAnnotationSpec.length + 2; + } else { + removeAnnotationSpec.position += 1; + } + } + + return { + opSpecsA: removeAnnotationSpecResult, + opSpecsB: splitParagraphSpecResult + }; + } + /** * @param {!ops.OpRemoveCursor.Spec} removeCursorSpecA * @param {!ops.OpRemoveCursor.Spec} removeCursorSpecB @@ -1488,6 +1984,26 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { */ transformations; transformations = { + "AddAnnotation": { + "AddAnnotation": transformAddAnnotationAddAnnotation, + "AddCursor": passUnchanged, + "AddMember": passUnchanged, + "AddStyle": passUnchanged, + "ApplyDirectStyling": transformAddAnnotationApplyDirectStyling, + "InsertText": transformAddAnnotationInsertText, + "MergeParagraph": transformAddAnnotationMergeParagraph, + "MoveCursor": transformAddAnnotationMoveCursor, + "RemoveAnnotation": transformAddAnnotationRemoveAnnotation, + "RemoveCursor": passUnchanged, + "RemoveMember": passUnchanged, + "RemoveStyle": passUnchanged, + "RemoveText": transformAddAnnotationRemoveText, + "SetParagraphStyle": transformAddAnnotationSetParagraphStyle, + "SplitParagraph": transformAddAnnotationSplitParagraph, + "UpdateMember": passUnchanged, + "UpdateMetadata": passUnchanged, + "UpdateParagraphStyle": passUnchanged + }, "AddCursor": { "AddCursor": passUnchanged, "AddMember": passUnchanged, @@ -1496,6 +2012,7 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { "InsertText": passUnchanged, "MergeParagraph": passUnchanged, "MoveCursor": passUnchanged, + "RemoveAnnotation": passUnchanged, "RemoveCursor": passUnchanged, "RemoveMember": passUnchanged, "RemoveStyle": passUnchanged, @@ -1512,6 +2029,7 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { "InsertText": passUnchanged, "MergeParagraph": passUnchanged, "MoveCursor": passUnchanged, + "RemoveAnnotation": passUnchanged, "RemoveCursor": passUnchanged, "RemoveStyle": passUnchanged, "RemoveText": passUnchanged, @@ -1526,6 +2044,7 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { "InsertText": passUnchanged, "MergeParagraph": passUnchanged, "MoveCursor": passUnchanged, + "RemoveAnnotation": passUnchanged, "RemoveCursor": passUnchanged, "RemoveMember": passUnchanged, "RemoveStyle": transformAddStyleRemoveStyle, @@ -1541,6 +2060,7 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { "InsertText": transformApplyDirectStylingInsertText, "MergeParagraph": transformApplyDirectStylingMergeParagraph, "MoveCursor": passUnchanged, + "RemoveAnnotation": transformApplyDirectStylingRemoveAnnotation, "RemoveCursor": passUnchanged, "RemoveMember": passUnchanged, "RemoveStyle": passUnchanged, @@ -1555,6 +2075,7 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { "InsertText": transformInsertTextInsertText, "MergeParagraph": transformInsertTextMergeParagraph, "MoveCursor": transformInsertTextMoveCursor, + "RemoveAnnotation": transformInsertTextRemoveAnnotation, "RemoveCursor": passUnchanged, "RemoveMember": passUnchanged, "RemoveStyle": passUnchanged, @@ -1568,6 +2089,7 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { "MergeParagraph": { "MergeParagraph": transformMergeParagraphMergeParagraph, "MoveCursor": transformMergeParagraphMoveCursor, + "RemoveAnnotation": transformMergeParagraphRemoveAnnotation, "RemoveCursor": passUnchanged, "RemoveMember": passUnchanged, "RemoveStyle": passUnchanged, @@ -1580,6 +2102,7 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { }, "MoveCursor": { "MoveCursor": passUnchanged, + "RemoveAnnotation": transformMoveCursorRemoveAnnotation, "RemoveCursor": transformMoveCursorRemoveCursor, "RemoveMember": passUnchanged, "RemoveStyle": passUnchanged, @@ -1590,6 +2113,18 @@ ops.OperationTransformMatrix = function OperationTransformMatrix() { "UpdateMetadata": passUnchanged, "UpdateParagraphStyle": passUnchanged }, + "RemoveAnnotation": { + "RemoveAnnotation": transformRemoveAnnotationRemoveAnnotation, + "RemoveCursor": passUnchanged, + "RemoveMember": passUnchanged, + "RemoveStyle": passUnchanged, + "RemoveText": transformRemoveAnnotationRemoveText, + "SetParagraphStyle": transformRemoveAnnotationSetParagraphStyle, + "SplitParagraph": transformRemoveAnnotationSplitParagraph, + "UpdateMember": passUnchanged, + "UpdateMetadata": passUnchanged, + "UpdateParagraphStyle": passUnchanged + }, "RemoveCursor": { "RemoveCursor": transformRemoveCursorRemoveCursor, "RemoveMember": passUnchanged, diff --git a/webodf/tests/manifest.json b/webodf/tests/manifest.json index f550e119..cac860cd 100644 --- a/webodf/tests/manifest.json +++ b/webodf/tests/manifest.json @@ -245,6 +245,7 @@ "odf.Namespaces", "odf.OdfCanvas", "odf.OdfContainer", + "ops.Member", "ops.OdtDocument", "ops.Operation", "ops.OperationFactory", diff --git a/webodf/tests/ops/TransformationTests.js b/webodf/tests/ops/TransformationTests.js index bd5d616b..6fdb1fa9 100644 --- a/webodf/tests/ops/TransformationTests.js +++ b/webodf/tests/ops/TransformationTests.js @@ -32,7 +32,7 @@ */ ops.TransformationTests = function TransformationTests(runner) { "use strict"; - var r = runner, t, tests, + var self = this, r = runner, t, tests, opsTestHelper = new ops.OperationTestHelper(); function serialize(element) { @@ -308,14 +308,16 @@ ops.TransformationTests = function TransformationTests(runner) { /** * @param {!string} name * @param {!Element} element - * @return {!{before, opspecsA, opspecsB, after}} + * @return {!{isFailing, setup, before, opspecsA, opspecsB, after}} */ function parseTest(name, element) { var before = element.getElementsByTagName("before")[0], opsAElement = element.getElementsByTagName("opsA")[0], opsBElement = element.getElementsByTagName("opsB")[0], after = element.getElementsByTagName("after")[0], - isFailing = element.getAttribute("isFailing") === "true"; + setupName = element.getAttribute("setup"), + isFailing = element.getAttribute("isFailing") === "true", + setup; runtime.assert(Boolean(before), "Expected in " + name + "."); runtime.assert(checkWhitespace(before), "Unexpanded test:s element or text:c attribute found in " + name + "."); @@ -324,8 +326,13 @@ ops.TransformationTests = function TransformationTests(runner) { runtime.assert(Boolean(after), "Expected in " + name + "."); runtime.assert(checkWhitespace(after), "Unexpanded test:s element or text:c attribute found in " + name + "."); opsTestHelper.removeInsignificantTextNodes(element); + setup = self.setUps.hasOwnProperty(setupName) ? self.setUps[setupName]() : null; + if (setupName) { + runtime.assert(Boolean(setup), "Required setup for " + name + " was not found."); + } return { isFailing: isFailing, + setup : setup, before: before, opspecsA: parseOpspecs(name, opsAElement), opspecsB: parseOpspecs(name, opsBElement), @@ -396,9 +403,16 @@ ops.TransformationTests = function TransformationTests(runner) { return getOfficeNSElement(element, "meta"); } - function compareOpsExecution(opspecs, transformedOpspecs, before, after) { - var odfContainer, - odtDocument, + /** + * @param {!Array.} opspecs + * @param {!Array.} transformedOpspecs + * @param {!Element} before + * @param {!Element} after + * @param {?{setUp:!function(), tearDown:!function()}} setup + * @return {undefined} + */ + function compareOpsExecution(opspecs, transformedOpspecs, before, after, setup) { + var odtDocument, text, textbefore = getOfficeTextElement(before), textafter = getOfficeTextElement(after), @@ -412,12 +426,19 @@ ops.TransformationTests = function TransformationTests(runner) { i, op; - odfContainer = new odf.OdfContainer(odf.OdfContainer.DocumentType.TEXT, null); - t.odfcanvas.setOdfContainer(odfContainer); + t.odfContainer = new odf.OdfContainer(odf.OdfContainer.DocumentType.TEXT, null); + t.odfcanvas.setOdfContainer(t.odfContainer); odtDocument = new ops.OdtDocument(t.odfcanvas); + ["Alice", "Bob"].forEach(function(name) { + var properties = new ops.MemberProperties(); + properties.color = "black"; + properties.fullName = name; + properties.imageUrl = ""; + odtDocument.addMember(new ops.Member(name, properties)); + }); text = odtDocument.getRootNode(); - styles = odfContainer.rootElement.styles; - meta = /**@type{!Element}*/(odfContainer.rootElement.meta); + styles = t.odfContainer.rootElement.styles; + meta = /**@type{!Element}*/(t.odfContainer.rootElement.meta); runtime.assert(Boolean(meta), "Missing !"); // inject test data @@ -428,6 +449,9 @@ ops.TransformationTests = function TransformationTests(runner) { copyChildNodes(meta, metabefore); } copyChildNodes(text, textbefore); + if (setup) { + setup.setUp(); + } // execute opspecs for (i = 0; i < opspecs.length; i += 1) { @@ -489,6 +513,9 @@ ops.TransformationTests = function TransformationTests(runner) { t.text = t.after = "OK"; } r.shouldBe(t, "t.text", "t.after"); + if (setup) { + setup.tearDown(); + } } function runTest(test) { @@ -497,8 +524,8 @@ ops.TransformationTests = function TransformationTests(runner) { t.transformResult = transformer.transform(cloneSpecs(test.opspecsA), cloneSpecs(test.opspecsB)); r.shouldBeNonNull(t, "t.transformResult"); if (t.transformResult) { - compareOpsExecution(test.opspecsA, t.transformResult.opSpecsB, test.before, test.after); - compareOpsExecution(test.opspecsB, t.transformResult.opSpecsA, test.before, test.after); + compareOpsExecution(test.opspecsA, t.transformResult.opSpecsB, test.before, test.after, test.setup); + compareOpsExecution(test.opspecsB, t.transformResult.opSpecsA, test.before, test.after, test.setup); } } @@ -568,6 +595,33 @@ ops.TransformationTests = function TransformationTests(runner) { return [ ]; }; + + /*jslint emptyblock: true*/ + function linkAnnotationEndToStart() { + return { + setUp: function () { + var rootElement = t.odfContainer.rootElement, + annotationElements = rootElement.getElementsByTagNameNS(odf.Namespaces.officens, "annotation"), + annotationEndElements = rootElement.getElementsByTagNameNS(odf.Namespaces.officens, "annotation-end"), + annotations = {}, + i, name; + for (i = 0; i < annotationElements.length; i += 1) { + name = annotationElements[i].getAttributeNS(odf.Namespaces.officens, "name"); + annotations[name] = annotationElements[i]; + } + for (i = 0; i < annotationEndElements.length; i += 1) { + name = annotationEndElements[i].getAttributeNS(odf.Namespaces.officens, "name"); + annotations[name].annotationEndElement = annotationEndElements[i]; + } + }, + tearDown: function () {} + }; + } + /*jslint emptyblock: false*/ + + this.setUps = { + "linkAnnotationEndToStart" : linkAnnotationEndToStart + }; }; ops.TransformationTests.prototype.description = function () { diff --git a/webodf/tests/ops/transformationtests.xml b/webodf/tests/ops/transformationtests.xml index cae358a0..d8a8f4bd 100644 --- a/webodf/tests/ops/transformationtests.xml +++ b/webodf/tests/ops/transformationtests.xml @@ -1989,4 +1989,6819 @@ 2013-08-05T12:34:07.061Z + + + + + abcde + + + + + + + + + + + + Bob + 2013-08-05T12:34:07.061Z + + + + + + abc + Alice + 2013-08-05T12:34:07.061Z + + + + + + de + + + + + Order of office:annotation and office:annotation-end at same position not defined + + + abcde + + + + + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + + + + bc + Alice + 2013-08-05T12:34:07.061Z + + + + + + de + + + + + + + abcde + + + + + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + + + + c + Alice + 2013-08-05T12:34:07.061Z + + + + + + de + + + + + Order of multiple office:annotation-end at same position not defined + + + abcde + + + + + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + + + + c + Alice + 2013-08-05T12:34:07.061Z + + + + + + de + + + + + + + abcdef + + + + + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + + + + c + Alice + 2013-08-05T12:34:07.061Z + + + + + + def + + + + + Order of office:annotation and office:annotation-end at same position not defined + + + abcde + + + + + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + abcde + + + + + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + Order of multiple office:annotation-end at same position not defined + + + abcde + + + + + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + + ab + + + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + ab + + + + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + abcd + + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + abcd + + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + fails, because the order of office:annotation-end and /text:span is random, needs to be defined + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + fails, because the order of office:annotation-end and /text:span is random, needs to be defined + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + fails, because the order of office:annotation-end and /text:span is random, needs to be defined + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abc + + + + + + + + + + + Va + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + Va + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + aV + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + aV + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bVcd + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bVc + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcV + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcV + + + + + + + + abcd + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + + abcd + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abcd + + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + + ab + + + + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + ab + + + + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + abc + Alice + 2013-08-05T12:34:07.061Z + + + + + + de + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + abc + Alice + 2013-08-05T12:34:07.061Z + + + + + + de + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + abc + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + de + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcde + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcde + + + + + + + ab + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcde + + + + + + + abc + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + de + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcde + + + + + + + abc + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + de + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcde + + + + + + + abc + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + de + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcde + + + + + + + + abcd + + + + + + + + + + + b + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + + abcd + + + + + + + + + + + b + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + + abcd + + + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + + abcd + + + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + d + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + d + + + + + + + abcde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + e + + + + + + + abcde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + cd + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + d + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + + + + + + + + abcde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bde + + + + + + + abcde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bde + + + + + + + abcde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + be + + + + + + + abcde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + b + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abcde + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abc + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + abc + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + abc + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + abc + + + + + abc + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + abc + + + + + abc + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + ab + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + b + + + + + ab + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + b + + + + + ab + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + b + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abcd + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bcd + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + abc + + + + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + + + + bc + + + + + + + Eve2013-08-05T12:34:07.061Z + + ab + + + + + + + + + + Bob2013-08-05T12:34:07.061Z + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + ab + + + + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + + + ab + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + + + + ab + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cd + + + + + + + + + + + + + + abcd + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cd + + + + + + + + + + + + + + abcd + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cd + + + + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + + + abcd + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cd + + + + + + + + + + + + + + abcd + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cd + + + + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + + + + abcde + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + + + + abcde + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + + + + abcde + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + + + + abcde + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcde + + + + + + + + + + + + + + abcde + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + Vabcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + aVbcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + aVbcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abVcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcVd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcdV + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + + abcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + + abcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + + abcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + + abcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + + abcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + + abcde + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + + abcd + + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + bc + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + d + + + + + + + + + + + abcd + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + bc + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + d + + + + + + + + + + + abcd + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + b + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cd + + + + + + + + + + + abcd + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + b + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cd + + + + + + + + + + + abcd + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + b + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cd + + + + + + + + + + + abcd + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Bob + 2013-08-05T12:34:07.061Z + + + AA + + + + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + + + + ab + + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + + + + ab + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + + + + cde + + + + + + + + + + + bcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + cde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + cde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + de + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + e + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + abcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + abcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AAA + + + cde + + + + + + + + + + + abcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + abcde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + abde + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + abe + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cde + + + + + + + + + + + ab + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cdef + + + + + + + + + + + abcef + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cdef + + + + + + + + + + + abcf + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cdef + + + + + + + + + + + abc + + + + + + + ab + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + cdef + + + + + + + + + + + abcde + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + abcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + a + Alice + 2013-08-05T12:34:07.061Z + + + AA + + + bcd + + + + + + + + + + + abcd + + + + + + + Eve2013-08-05T12:34:07.061Z + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + + Bob2013-08-05T12:34:07.061Z + + ab + + + + + + + + + Alice + 2013-08-05T12:34:07.061Z + + + + + + ab + + + + + + + + + + + + ab + + +