Skip to content

Commit

Permalink
8.0.1 release
Browse files Browse the repository at this point in the history
Former-commit-id: 04d4851
  • Loading branch information
alderg committed Jan 19, 2018
1 parent a89b59f commit b6a7be5
Show file tree
Hide file tree
Showing 72 changed files with 2,547 additions and 2,251 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
19-JAN-2018: 8.0.1

- Fixes ChangePageSetup
- Uses mxGraph 3.9.0

17-JAN-2018: 8.0.0

- New Google repository structure
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.0
8.0.1
28 changes: 14 additions & 14 deletions etc/mxgraph/mxClient.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/webapp/cache.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CACHE MANIFEST

# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 01/17/2018 05:49 PM
# 01/19/2018 06:48 PM

app.html
index.html?offline=1
Expand Down
664 changes: 335 additions & 329 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

1,078 changes: 542 additions & 536 deletions src/main/webapp/js/atlas-viewer.min.js

Large diffs are not rendered by default.

1,530 changes: 768 additions & 762 deletions src/main/webapp/js/atlas.min.js

Large diffs are not rendered by default.

123 changes: 93 additions & 30 deletions src/main/webapp/js/diagramly/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,12 @@
return graph.shadowVisible;
}, function(checked)
{
graph.model.execute(new ChangeShadow(ui, checked));
var change = new ChangePageSetup(ui);
change.ignoreColor = true;
change.ignoreImage = true;
change.shadowVisible = checked;

graph.model.execute(change);
},
{
install: function(apply)
Expand Down Expand Up @@ -2101,42 +2106,100 @@

this.container = div;
};

// Execute fit page on page setup changes
var changePageSetupExecute = ChangePageSetup.prototype.execute;

ChangePageSetup.prototype.execute = function()
{
if (this.page == null)
{
this.page = this.ui.currentPage;
}

// Workaround for redo existing change with different current page
if (this.page != this.ui.currentPage)
{
if (this.page.viewState != null)
{
if (!this.ignoreColor)
{
this.page.viewState.background = this.color;
}

if (!this.ignoreImage)
{
this.page.viewState.backgroundImage = this.image;
}

if (this.format != null)
{
this.page.viewState.pageFormat = this.format;
}

if (this.mathEnabled != null)
{
this.page.viewState.mathEnabled = this.mathEnabled;
}

if (this.shadowVisible != null)
{
this.page.viewState.shadowVisible = this.shadowVisible;
}
}
}
else
{
changePageSetupExecute.apply(this, arguments);

if (this.mathEnabled != null && this.mathEnabled != this.ui.isMathEnabled())
{
this.ui.setMathEnabled(this.mathEnabled);
this.mathEnabled = !this.mathEnabled;
}

if (this.shadowVisible != null && this.shadowVisible != this.ui.editor.graph.shadowVisible)
{
this.ui.editor.graph.setShadowVisible(this.shadowVisible);
this.shadowVisible = !this.shadowVisible;
}
}
};
})();

/**
* Change types
*/
function ChangeShadow(ui, visible)
{
this.ui = ui;
this.visible = visible;
this.previous = this.visible;
}

/**
* Implementation of the undoable page rename.
*/
ChangeShadow.prototype.execute = function()
{
this.visible = this.previous;
this.previous = this.ui.editor.graph.shadowVisible;
this.ui.editor.graph.setShadowVisible(this.visible);
};

//Registers codec for ChangePageSetup
// Extends codec for ChangePageSetup
(function()
{
var codec = new mxObjectCodec(new ChangeShadow(), ['ui', 'previous']);
var codec = new mxObjectCodec(new ChangePageSetup(), ['ui', 'previousColor', 'previousImage', 'previousFormat']);

codec.beforeDecode = function(dec, node, obj)
{
obj.ui = dec.ui;

return node;
};

/**
* Function: afterDecode
*
* Restores the state by assigning the previous value.
*/
codec.afterDecode = function(dec, node, obj)
{
obj.previous = obj.visible;

obj.previousColor = obj.color;
obj.previousImage = obj.image;
obj.previousFormat = obj.format;

if (obj.foldingEnabled != null)
{
obj.foldingEnabled = !obj.foldingEnabled;
}

if (obj.mathEnabled != null)
{
obj.mathEnabled = !obj.mathEnabled;
}

if (obj.shadowVisible != null)
{
obj.shadowVisible = !obj.shadowVisible;
}

return obj;
};

Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/js/diagramly/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -9864,17 +9864,17 @@
if (format == 'xml')
{
editorUi.hideDialog();
editorUi.saveData(name, 'xml', mxUtils.getXml(editorUi.editor.getGraphXml()), 'text/xml');
editorUi.saveData(name, 'xml', mxUtils.getXml(editorUi.editor.getGraphXml()), 'text/xml');
}
else if (format == 'svg')
{
editorUi.hideDialog();
editorUi.hideDialog();
editorUi.saveData(name, 'svg', mxUtils.getXml(graph.getSvg(bg, s, b)), 'image/svg+xml');
}
else
{
var data = editorUi.getFileData(true, null, null, null, null, true);
var bounds = graph.getGraphBounds();
var data = editorUi.getFileData(true, null, null, null, null, true);
var bounds = graph.getGraphBounds();
var w = Math.floor(bounds.width * s / graph.view.scale);
var h = Math.floor(bounds.height * s / graph.view.scale);

Expand Down
7 changes: 6 additions & 1 deletion src/main/webapp/js/diagramly/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,12 @@
{
var action = editorUi.actions.addAction('mathematicalTypesetting', function()
{
editorUi.setMathEnabled(!editorUi.isMathEnabled());
var change = new ChangePageSetup(editorUi);
change.ignoreColor = true;
change.ignoreImage = true;
change.mathEnabled = !editorUi.isMathEnabled();

graph.model.execute(change);
});

action.setToggleAction(true);
Expand Down
129 changes: 129 additions & 0 deletions src/main/webapp/js/diagramly/Pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1313,3 +1313,132 @@ EditorUi.prototype.createPageMenu = function(page, label)
}), parent);
});
};

//Registers codec for MovePage
(function()
{
var codec = new mxObjectCodec(new MovePage(), ['ui']);

codec.beforeDecode = function(dec, node, obj)
{
obj.ui = dec.ui;

return node;
};

mxCodecRegistry.register(codec);
})();

//Registers codec for RenamePage
(function()
{
var codec = new mxObjectCodec(new RenamePage(), ['ui', 'page', 'previous']);

codec.afterEncode = function(enc, obj, node)
{
node.setAttribute('page', obj.page.getId())

return node;
};

codec.beforeDecode = function(dec, node, obj)
{
obj.ui = dec.ui;

return node;
};

codec.afterDecode = function(dec, node, obj)
{
obj.page = dec.ui.getPageById(node.getAttribute('page'));
obj.previous = obj.name;

return obj;
};

mxCodecRegistry.register(codec);
})();

//Registers codec for ChangePage
(function()
{
var codec = new mxObjectCodec(new ChangePage(), ['ui', 'relatedPage', 'index', 'neverShown']);

codec.afterEncode = function(enc, obj, node)
{
node.setAttribute('relatedPage', obj.relatedPage.getId())

if (obj.index == null)
{
node.setAttribute('name', obj.relatedPage.getName());

if (obj.relatedPage.root != null)
{
enc.encodeCell(obj.relatedPage.root, node);
}
}

return node;
};

codec.beforeDecode = function(dec, node, obj)
{
obj.ui = dec.ui;
obj.relatedPage = obj.ui.getPageById(node.getAttribute('relatedPage'));

if (obj.relatedPage == null)
{
var temp = document.createElement('diagram');
temp.setAttribute('id', node.getAttribute('relatedPage'));
temp.setAttribute('name', node.getAttribute('name'));
obj.relatedPage = new DiagramPage(temp);

// Makes sure the original node isn't modified
node = node.cloneNode(true);
var tmp = node.firstChild;

if (tmp != null)
{
obj.relatedPage.root = dec.decodeCell(tmp, false);

var tmp2 = tmp.nextSibling;
tmp.parentNode.removeChild(tmp);
tmp = tmp2;

while (tmp != null)
{
tmp2 = tmp.nextSibling;

if (tmp.nodeType == mxConstants.NODETYPE_ELEMENT)
{
// Ignores all existing cells because those do not need to
// be re-inserted into the model. Since the encoded version
// of these cells contains the new parent, this would leave
// to an inconsistent state on the model (ie. a parent
// change without a call to parentForCellChanged).
var id = tmp.getAttribute('id');

if (dec.lookup(id) == null)
{
dec.decodeCell(tmp);
}
}

tmp.parentNode.removeChild(tmp);
tmp = tmp2;
}
}
}

return node;
};

codec.afterDecode = function(dec, node, obj)
{
obj.index = obj.previousIndex;

return obj;
};

mxCodecRegistry.register(codec);
})();
6 changes: 5 additions & 1 deletion src/main/webapp/js/diagramly/graphml/mxGraphMlCodec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1796,8 +1796,12 @@ mxGraphMlCodec.prototype.handleFixedRatio = function (node, styleMap)
else if (shape.indexOf(";rotation=90") > 0 || shape.indexOf(";rotation=-90") > 0 )
{
var h = geo.height;
geo.height = geo.width;
var w = geo.width;
geo.height = w;
geo.width = h;
var diff = (h - w) / 2;
geo.x -= diff;
geo.y += diff;
}
}
};
Expand Down
Loading

0 comments on commit b6a7be5

Please sign in to comment.