Lines Matching refs:diff

42 EditorUi.prototype.patchPages = function(pages, diff, markPages, resolver, updateEdgeParents)  argument
59 if (diff[EditorUi.DIFF_REMOVE] != null)
61 for (var i = 0; i < diff[EditorUi.DIFF_REMOVE].length; i++)
63 removed[diff[EditorUi.DIFF_REMOVE][i]] = true;
67 if (diff[EditorUi.DIFF_INSERT] != null)
69 for (var i = 0; i < diff[EditorUi.DIFF_INSERT].length; i++)
71 inserted[diff[EditorUi.DIFF_INSERT][i].previous] = diff[EditorUi.DIFF_INSERT][i];
75 if (diff[EditorUi.DIFF_UPDATE] != null)
77 for (var id in diff[EditorUi.DIFF_UPDATE])
79 var pageDiff = diff[EditorUi.DIFF_UPDATE][id];
99 (diff[EditorUi.DIFF_UPDATE] == null ||
100 diff[EditorUi.DIFF_UPDATE][pageId] == null ||
101 diff[EditorUi.DIFF_UPDATE][pageId].previous == null))
121 var pageDiff = (diff[EditorUi.DIFF_UPDATE] != null) ?
122 diff[EditorUi.DIFF_UPDATE][id] : null;
219 EditorUi.prototype.patchViewState = function(page, diff) argument
221 if (page.viewState != null && diff != null)
228 for (var key in diff)
232 page.viewState[key] = JSON.parse(diff[key]);
247 EditorUi.prototype.createParentLookup = function(model, diff) argument
264 if (diff[EditorUi.DIFF_INSERT] != null)
266 for (var i = 0; i < diff[EditorUi.DIFF_INSERT].length; i++)
268 var temp = diff[EditorUi.DIFF_INSERT][i];
275 if (diff[EditorUi.DIFF_UPDATE] != null)
277 for (var id in diff[EditorUi.DIFF_UPDATE])
279 var temp = diff[EditorUi.DIFF_UPDATE][id];
314 EditorUi.prototype.patchPage = function(page, diff, resolver, updateEdgeParents) argument
317 var parentLookup = this.createParentLookup(model, diff);
364 this.patchCellRecursive(page, model, model.root, parentLookup, diff);
367 if (diff[EditorUi.DIFF_REMOVE] != null)
369 for (var i = 0; i < diff[EditorUi.DIFF_REMOVE].length; i++)
371 var cell = model.getCell(diff[EditorUi.DIFF_REMOVE][i]);
381 if (diff[EditorUi.DIFF_UPDATE] != null)
386 for (var id in diff[EditorUi.DIFF_UPDATE])
389 diff[EditorUi.DIFF_UPDATE][id],
395 if (diff[EditorUi.DIFF_INSERT] != null)
397 for (var i = 0; i < diff[EditorUi.DIFF_INSERT].length; i++)
399 var cellDiff = diff[EditorUi.DIFF_INSERT][i];
433 EditorUi.prototype.patchCellRecursive = function(page, model, cell, parentLookup, diff) argument
451 (diff[EditorUi.DIFF_UPDATE] == null ||
452 diff[EditorUi.DIFF_UPDATE][cellId] == null ||
453 (diff[EditorUi.DIFF_UPDATE][cellId].previous == null &&
454 diff[EditorUi.DIFF_UPDATE][cellId].parent == null)))
485 child, parentLookup, diff);
549 EditorUi.prototype.patchCell = function(model, cell, diff, resolve) argument
551 if (cell != null && diff != null)
557 if ('value' in diff)
559 model.setValue(cell, diff.value);
561 else if (diff.xmlValue != null)
563 model.setValue(cell, mxUtils.parseXml(diff.xmlValue).documentElement);
568 if ((resolve == null || resolve.style == null) && diff.style != null)
570 model.setStyle(cell, diff.style);
573 if (diff.visible != null)
575 model.setVisible(cell, diff.visible == 1);
578 if (diff.collapsed != null)
580 model.setCollapsed(cell, diff.collapsed == 1);
583 if (diff.vertex != null)
586 cell.vertex = diff.vertex == 1;
589 if (diff.edge != null)
592 cell.edge = diff.edge == 1;
595 if (diff.connectable != null)
598 cell.connectable = diff.connectable == 1;
601 if (diff.geometry != null)
604 diff.geometry).documentElement));
607 if (diff.source != null)
609 model.setTerminal(cell, model.getCell(diff.source), true);
612 if (diff.target != null)
614 model.setTerminal(cell, model.getCell(diff.target), false);
617 for (var key in diff)
621 cell[key] = diff[key];
675 var diff = {};
729 diff[id] = pageDiff;
745 if (Object.keys(diff).length > 0)
747 result[EditorUi.DIFF_UPDATE] = diff;
787 EditorUi.prototype.diffCellRecursive = function(cell, prev, lookup, diff, removed) argument
789 diff = (diff != null) ? diff : {};
811 diff[cell.getId()] = temp;
821 this.diffCellRecursive(child, prev, lookup, diff, removed);
825 return diff;
841 var diff = this.diffCellRecursive(oldPage.root, null, lookup, diff, removed);
849 if (Object.keys(diff).length > 0)
851 result[EditorUi.DIFF_UPDATE] = diff;
1025 var diff = {};
1029 diff.vertex = (newCell.vertex) ? 1 : 0;
1034 diff.edge = (newCell.edge) ? 1 : 0;
1039 diff.connectable = (newCell.connectable) ? 1 : 0;
1046 diff.parent = (newCell.parent != null) ? newCell.parent.getId() : '';
1053 diff.source = (newCell.source != null) ? newCell.source.getId() : '';
1060 diff.target = (newCell.target != null) ? newCell.target.getId() : '';
1073 diff.xmlValue = mxUtils.getXml(newCell.value);
1080 diff.xmlValue = mxUtils.getXml(newCell.value);
1084 diff.value = (newCell.value != null) ? newCell.value : null;
1091 diff.style = newCell.style;
1096 diff.visible = (newCell.visible) ? 1 : 0;
1101 diff.collapsed = (newCell.collapsed) ? 1 : 0;
1111 diff.geometry = mxUtils.getXml(node);
1122 diff[key] = (newCell[key] === undefined) ? null : newCell[key];
1133 diff[key] = (newCell[key] === undefined) ? null : newCell[key];
1137 return diff;