10.7.1 release

This commit is contained in:
Gaudenz Alder 2019-05-29 15:29:43 +02:00
parent 8e787dad54
commit 1ac174041a
13 changed files with 1241 additions and 1142 deletions

View file

@ -1,3 +1,10 @@
29-MAY-2019: 10.7.1
- Adds JSON string for layouts in CSV import
- Fixes zoomed position for data store label
- Fixes changing of link colors in Firefox
- Fixes limitations for Google docs add-on
28-MAY-2019: 10.7.0
- Replaces octet-stream with vnd.jgraph.mxfile in Drive

View file

@ -1 +1 @@
10.7.0
10.7.1

View file

@ -1,7 +1,7 @@
CACHE MANIFEST
# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 05/28/2019 12:55 PM
# 05/29/2019 03:12 PM
app.html
index.html?offline=1

View file

@ -22,6 +22,7 @@
<script src="js/app.min.js"></script>
<script>
var mxIsElectron = navigator.userAgent.toLowerCase().indexOf(' electron/') > -1;
var GOOGLE_APPS_MAX_AREA = 25000000;
Editor.initMath();
@ -382,6 +383,13 @@
{
s = 2;
}
//The image cannot exceed 25 MP to be included in Google Apps
if (b.width * s * b.height * s > GOOGLE_APPS_MAX_AREA)
{
//Subtracting 0.01 to prevent any other rounding that can make slightly over 25 MP
s = Math.sqrt(GOOGLE_APPS_MAX_AREA / (b.width * b.height)) - 0.01;
}
}
graph.view.scaleAndTranslate(s,

File diff suppressed because it is too large Load diff

View file

@ -5296,8 +5296,8 @@ App.prototype.updateHeader = function()
this.toolbarContainer.appendChild(this.toggleElement);
}
// Enable compact mode for small screens
if (screen.height <= 740 && typeof this.toggleElement.click !== 'undefined')
// Enable compact mode for small screens except for Firefox where the height is wrong
if (!mxClient.IS_FF && screen.height <= 740 && typeof this.toggleElement.click !== 'undefined')
{
window.setTimeout(mxUtils.bind(this, function()
{

View file

@ -295,12 +295,13 @@
'#\n' +
'# levelspacing: 100\n' +
'#\n' +
'## Spacing between parallel edges. Default is 40.\n' +
'## Spacing between parallel edges. Default is 40. Use 0 to disable.\n' +
'#\n' +
'# edgespacing: 40\n' +
'#\n' +
'## Name of layout. Possible values are auto, none, verticaltree, horizontaltree,\n' +
'## verticalflow, horizontalflow, organic, circle. Default is auto.\n' +
'## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n' +
'## verticalflow, horizontalflow, organic, circle or a JSON string as used in Layout, Apply.\n' +
'## Default is auto.\n' +
'#\n' +
'# layout: auto\n' +
'#\n' +

View file

@ -10734,8 +10734,37 @@
this.importCsvDialog.init();
};
/**
* TODO: Move to Editor
* Runs the layout from the given JavaScript array which is of the form [{layout: name, config: obj}, ...]
* where name is the layout constructor name and config contains the properties of the layout instance.
*/
EditorUi.prototype.executeLayoutList = function(layoutList, done)
{
var graph = this.editor.graph;
var cells = graph.getSelectionCells();
for (var i = 0; i < layoutList.length; i++)
{
var layout = new window[layoutList[i].layout](graph);
if (layoutList[i].config != null)
{
for (var key in layoutList[i].config)
{
layout[key] = layoutList[i].config[key];
}
}
this.executeLayout(function()
{
layout.execute(graph.getDefaultParent(), cells.length == 0 ? null : cells);
}, i == layoutList.length - 1, done);
}
};
/**
*
*/
EditorUi.prototype.importCsv = function(text, done)
{
@ -11162,8 +11191,11 @@
edgeLayout.spacing = edgespacing;
var postProcess = function()
{
if (edgeLayout.spacing > 0)
{
edgeLayout.execute(graph.getDefaultParent());
}
// Aligns cells to grid and/or rounds positions
for (var i = 0; i < cells.length; i++)
@ -11184,7 +11216,19 @@
}
};
if (layout == 'circle')
if (layout.charAt(0) == '[')
{
// Required for layouts to work with new cells
var temp = afterInsert;
graph.view.validate();
this.executeLayoutList(JSON.parse(layout), function()
{
postProcess();
temp();
});
afterInsert = null;
}
else if (layout == 'circle')
{
var circleLayout = new mxCircleLayout(graph);
circleLayout.resetEdges = false;

View file

@ -822,8 +822,6 @@
// Adds action
editorUi.actions.addAction('runLayout', function()
{
var graph = editorUi.editor.graph;
var dlg = new TextareaDialog(editorUi, 'Run Layouts:',
JSON.stringify(editorUi.customLayoutConfig, null, 2),
function(newValue)
@ -832,29 +830,9 @@
{
try
{
var json = JSON.parse(newValue);
for (var i = 0; i < json.length; i++)
{
var layout = new window[json[i].layout](graph);
if (json[i].config != null)
{
for (var key in json[i].config)
{
layout[key] = json[i].config[key];
}
}
editorUi.executeLayout(function()
{
var selectionCells = graph.getSelectionCells();
layout.execute(graph.getDefaultParent(), selectionCells.length == 0 ?
null : selectionCells);
}, i == json.length - 1);
}
editorUi.customLayoutConfig = json;
var layoutList = JSON.parse(newValue);
editorUi.executeLayoutList(layoutList)
editorUi.customLayoutConfig = layoutList;
}
catch (e)
{

View file

@ -1092,7 +1092,7 @@ EditorUi.prototype.updateTabContainer = function()
}));
wrapper.appendChild(tab);
}))(i, this.createTabForPage(this.pages[i], tabWidth, this.pages[i] != this.currentPage));
}))(i, this.createTabForPage(this.pages[i], tabWidth, this.pages[i] != this.currentPage, i + 1));
}
this.tabContainer.innerHTML = '';
@ -1348,12 +1348,12 @@ EditorUi.prototype.createPageInsertTab = function()
/**
* Returns true if the given string contains an mxfile.
*/
EditorUi.prototype.createTabForPage = function(page, tabWidth, hoverEnabled)
EditorUi.prototype.createTabForPage = function(page, tabWidth, hoverEnabled, pageNumber)
{
var tab = this.createTab(hoverEnabled);
var name = page.getName() || mxResources.get('untitled');
var id = page.getId();
tab.setAttribute('title', name + ((id != null) ? ' (' + id + ')' : ''));
tab.setAttribute('title', name + ((id != null) ? ' (' + id + ')' : '') + ' [' + pageNumber + ']');
mxUtils.write(tab, name);
tab.style.maxWidth = tabWidth + 'px';
tab.style.width = tabWidth + 'px';

View file

@ -2996,7 +2996,65 @@ TextFormatPanel.prototype.addFont = function(container)
return currentFontColor;
}, function(color)
{
document.execCommand('forecolor', false, (color != mxConstants.NONE) ? color : 'transparent');
if (mxClient.IS_FF)
{
// Workaround for Firefox that adds the font element around
// anchor elements which ignore inherited colors is to move
// the font element inside anchor elements
var tmp = graph.cellEditor.textarea.getElementsByTagName('font');
var oldFonts = [];
for (var i = 0; i < tmp.length; i++)
{
oldFonts.push(
{
node: tmp[i],
color: tmp[i].getAttribute('color')
});
}
document.execCommand('forecolor', false, (color != mxConstants.NONE) ?
color : 'transparent');
// Finds the new or changed font element
var newFonts = graph.cellEditor.textarea.getElementsByTagName('font');
for (var i = 0; i < newFonts.length; i++)
{
if (i >= oldFonts.length || newFonts[i] != oldFonts[i].node ||
(newFonts[i] == oldFonts[i].node &&
newFonts[i].getAttribute('color') != oldFonts[i].color))
{
var child = newFonts[i].firstChild;
// Moves the font element to inside the anchor element and adopts all children
if (child != null && child.nodeName == 'A' && child.nextSibling ==
null &&
child.firstChild != null)
{
var parent = newFonts[i].parentNode;
parent.insertBefore(child, newFonts[i]);
var tmp = child.firstChild;
while (tmp != null)
{
var next = tmp.nextSibling;
newFonts[i].appendChild(tmp);
tmp = next;
}
child.appendChild(newFonts[i]);
}
break;
}
}
}
else
{
document.execCommand('forecolor', false, (color != mxConstants.NONE) ?
color : 'transparent');
}
}, '#000000',
{
install: function(apply) { fontColorApply = apply; },

View file

@ -211,8 +211,8 @@
};
DataStoreShape.prototype.getLabelMargins = function(rect)
{
return new mxRectangle(0, 2.5 * Math.min(rect.height / 2, Math.round(rect.height / 8) +
this.strokewidth - 1) * this.scale, 0, 0);
return new mxRectangle(0, 2.5 * Math.min(rect.height / 2,
Math.round(rect.height / 8) + this.strokewidth - 1), 0, 0);
}
mxCellRenderer.registerShape('datastore', DataStoreShape);

File diff suppressed because one or more lines are too long