parent
a8c3d86336
commit
f54cc44a36
19 changed files with 441 additions and 311 deletions
|
@ -1,3 +1,7 @@
|
|||
21-NOV-2016: 6.0.1.6
|
||||
|
||||
- Fixes missing auth header in Google client API
|
||||
|
||||
18-NOV-2016: 6.0.1.5
|
||||
|
||||
- Replaces prompts in Atlassian cloud plugins
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
6.0.1.5
|
||||
6.0.1.6
|
|
@ -4,11 +4,9 @@
|
|||
*/
|
||||
package com.mxgraph.io;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -95,7 +93,7 @@ public class mxVsdxCodec
|
|||
* @param point Point to which coordinates are calculated.
|
||||
* @return The point in absolute coordinates.
|
||||
*/
|
||||
private static mxPoint calculateAbsolutePoint(mxCell cellParent,
|
||||
private static mxPoint calculateAbsolutePoint(Object cellParent,
|
||||
mxGraph graph, mxPoint point)
|
||||
{
|
||||
if (cellParent != null)
|
||||
|
@ -685,161 +683,152 @@ public class mxVsdxCodec
|
|||
ShapePageId edgeId = new ShapePageId(pageId, fromSheet);
|
||||
VsdxShape edgeShape = edgeShapeMap.get(edgeId);
|
||||
|
||||
if (edgeShape != null)
|
||||
if (edgeShape == null)
|
||||
{
|
||||
Object parent = parentsMap.get(new ShapePageId(pageId,
|
||||
edgeShape.getId()));
|
||||
return null;
|
||||
}
|
||||
|
||||
double parentHeight = pageHeight;
|
||||
Object parent = parentsMap.get(new ShapePageId(pageId,
|
||||
edgeShape.getId()));
|
||||
double parentHeight = pageHeight;
|
||||
|
||||
mxCell parentCell = (mxCell) parent;
|
||||
if (parent != null)
|
||||
{
|
||||
mxGeometry parentGeo = graph.getModel().getGeometry(parent);
|
||||
|
||||
if (parentCell != null)
|
||||
if (parentGeo != null)
|
||||
{
|
||||
mxGeometry parentGeometry = parentCell.getGeometry();
|
||||
parentHeight = parentGeo.getHeight();
|
||||
}
|
||||
}
|
||||
|
||||
if (parentGeometry != null)
|
||||
{
|
||||
parentHeight = parentGeometry.getHeight();
|
||||
}
|
||||
//Get beginXY and endXY coordinates.
|
||||
mxPoint beginXY = edgeShape.getStartXY(parentHeight);
|
||||
beginXY = calculateAbsolutePoint(parent, graph, beginXY);
|
||||
|
||||
mxPoint fromConstraint = null;
|
||||
Integer sourceSheet = connect.getSourceToSheet();
|
||||
|
||||
VsdxShape fromShape = sourceSheet != null ? vertexShapeMap
|
||||
.get(new ShapePageId(pageId, sourceSheet)) : null;
|
||||
|
||||
mxCell source = sourceSheet != null ? vertexMap
|
||||
.get(new ShapePageId(pageId, sourceSheet)) : null;
|
||||
|
||||
if (fromShape == null || source == null)
|
||||
{
|
||||
// Source is dangling
|
||||
source = (mxCell) graph.insertVertex(parent, null, null,
|
||||
beginXY.getX(), beginXY.getY(), 0, 0);
|
||||
fromConstraint = new mxPoint(0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
mxPoint dimensionFrom = fromShape.getDimensions();
|
||||
|
||||
//Get From shape origin and begin/end of edge in absolutes values.
|
||||
double height = pageHeight;
|
||||
|
||||
if ((source.getParent() != null)
|
||||
&& (source.getParent().getGeometry() != null))
|
||||
{
|
||||
height = source.getParent().getGeometry().getHeight();
|
||||
}
|
||||
|
||||
//Get beginXY and endXY coordinates.
|
||||
mxPoint beginXY = edgeShape.getStartXY(parentHeight);
|
||||
beginXY = calculateAbsolutePoint((mxCell) parent, graph, beginXY);
|
||||
mxPoint originFrom = fromShape.getOriginPoint(height, false);
|
||||
Integer sourceToPart = connect.getSourceToPart();
|
||||
|
||||
mxPoint endXY = edgeShape.getEndXY(parentHeight);
|
||||
endXY = calculateAbsolutePoint((mxCell) parent, graph, endXY);
|
||||
|
||||
mxPoint fromConstraint = null;
|
||||
mxPoint toConstraint = null;
|
||||
|
||||
//Defines text label
|
||||
String textLabel = edgeShape.getTextLabel();
|
||||
|
||||
Integer sourceSheet = connect.getSourceToSheet();
|
||||
Integer toSheet = connect.getTargetToSheet();
|
||||
|
||||
VsdxShape fromShape = sourceSheet != null ? vertexShapeMap
|
||||
.get(new ShapePageId(pageId, sourceSheet)) : null;
|
||||
VsdxShape toShape = toSheet != null ? vertexShapeMap
|
||||
.get(new ShapePageId(pageId, toSheet)) : null;
|
||||
|
||||
mxCell source = sourceSheet != null ? vertexMap
|
||||
.get(new ShapePageId(pageId, sourceSheet)) : null;
|
||||
mxCell target = toSheet != null ? vertexMap.get(new ShapePageId(
|
||||
pageId, toSheet)) : null;
|
||||
|
||||
if (fromShape == null || source == null)
|
||||
if (sourceToPart != mxVsdxConstants.CONNECT_TO_PART_WHOLE_SHAPE)
|
||||
{
|
||||
// Source is dangling
|
||||
source = (mxCell) graph.insertVertex(parent, null, null,
|
||||
beginXY.getX(), beginXY.getY(), 0, 0);
|
||||
fromConstraint = new mxPoint(0, 0);
|
||||
mxPoint absOriginFrom = calculateAbsolutePoint(source.getParent(), graph, originFrom);
|
||||
fromConstraint = new mxPoint(
|
||||
(beginXY.getX() - absOriginFrom.getX())
|
||||
/ dimensionFrom.getX(),
|
||||
(beginXY.getY() - absOriginFrom.getY())
|
||||
/ dimensionFrom.getY());
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
mxPoint endXY = edgeShape.getEndXY(parentHeight);
|
||||
endXY = calculateAbsolutePoint(parent, graph, endXY);
|
||||
|
||||
mxPoint toConstraint = null;
|
||||
Integer toSheet = connect.getTargetToSheet();
|
||||
|
||||
VsdxShape toShape = toSheet != null ? vertexShapeMap
|
||||
.get(new ShapePageId(pageId, toSheet)) : null;
|
||||
|
||||
mxCell target = toSheet != null ? vertexMap.get(new ShapePageId(
|
||||
pageId, toSheet)) : null;
|
||||
|
||||
if (toShape == null || target == null)
|
||||
{
|
||||
// Target is dangling
|
||||
target = (mxCell) graph.insertVertex(parent, null, null,
|
||||
endXY.getX(), endXY.getY(), 0, 0);
|
||||
toConstraint = new mxPoint(0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
target = vertexMap.get(new ShapePageId(pageId, toSheet));
|
||||
|
||||
mxPoint dimentionTo = toShape.getDimensions();
|
||||
|
||||
//Get To shape origin.
|
||||
double height = pageHeight;
|
||||
|
||||
if ((target.getParent() != null)
|
||||
&& (target.getParent().getGeometry() != null))
|
||||
{
|
||||
mxPoint dimensionFrom = fromShape.getDimensions();
|
||||
|
||||
//Get From shape origin and begin/end of edge in absolutes values.
|
||||
double height = pageHeight;
|
||||
|
||||
if ((source.getParent() != null)
|
||||
&& (source.getParent().getGeometry() != null))
|
||||
{
|
||||
height = source.getParent().getGeometry().getHeight();
|
||||
}
|
||||
|
||||
mxPoint originFrom = fromShape.getOriginPoint(height, false);
|
||||
mxPoint absOriginFrom = calculateAbsolutePoint(
|
||||
(mxCell) source.getParent(), graph, originFrom);
|
||||
|
||||
Integer sourceToPart = connect.getSourceToPart();
|
||||
|
||||
if (sourceToPart != mxVsdxConstants.CONNECT_TO_PART_WHOLE_SHAPE)
|
||||
{
|
||||
fromConstraint = new mxPoint(
|
||||
(beginXY.getX() - absOriginFrom.getX())
|
||||
/ dimensionFrom.getX(),
|
||||
(beginXY.getY() - absOriginFrom.getY())
|
||||
/ dimensionFrom.getY());
|
||||
}
|
||||
|
||||
height = target.getParent().getGeometry().getHeight();
|
||||
}
|
||||
|
||||
if (toShape == null || target == null)
|
||||
mxPoint originTo = toShape.getOriginPoint(height, false);
|
||||
Integer targetToPart = connect.getTargetToPart();
|
||||
|
||||
if (targetToPart != mxVsdxConstants.CONNECT_TO_PART_WHOLE_SHAPE)
|
||||
{
|
||||
// Target is dangling
|
||||
target = (mxCell) graph.insertVertex(parent, null, null,
|
||||
endXY.getX(), endXY.getY(), 0, 0);
|
||||
toConstraint = new mxPoint(0, 0);
|
||||
mxPoint absOriginTo = calculateAbsolutePoint( target.getParent(), graph, originTo);
|
||||
toConstraint = new mxPoint(
|
||||
(endXY.getX() - absOriginTo.getX())
|
||||
/ dimentionTo.getX(),
|
||||
(endXY.getY() - absOriginTo.getY())
|
||||
/ dimentionTo.getY());
|
||||
}
|
||||
else
|
||||
{
|
||||
target = vertexMap.get(new ShapePageId(pageId, toSheet));
|
||||
}
|
||||
|
||||
mxPoint dimentionTo = toShape.getDimensions();
|
||||
//Defines the style of the edge.
|
||||
Map<String, String> styleMap = edgeShape
|
||||
.getStyleFromEdgeShape(parentHeight);
|
||||
//Insert new edge and set constraints.
|
||||
Object edge = graph.insertEdge(parent, null, edgeShape.getTextLabel(), source,
|
||||
target, ";" + mxVsdxUtils.getStyleString(styleMap, "="));
|
||||
|
||||
//Get To shape origin.
|
||||
double height = pageHeight;
|
||||
mxGeometry edgeGeometry = graph.getModel().getGeometry(edge);
|
||||
edgeGeometry.setPoints(edgeShape.getRoutingPoints(parentHeight, beginXY));
|
||||
|
||||
if ((target.getParent() != null)
|
||||
&& (target.getParent().getGeometry() != null))
|
||||
{
|
||||
height = target.getParent().getGeometry().getHeight();
|
||||
}
|
||||
if (fromConstraint != null)
|
||||
{
|
||||
graph.setConnectionConstraint(edge, source, true,
|
||||
new mxConnectionConstraint(fromConstraint, false));
|
||||
}
|
||||
if (toConstraint != null)
|
||||
{
|
||||
graph.setConnectionConstraint(edge, target, false,
|
||||
new mxConnectionConstraint(toConstraint, false));
|
||||
}
|
||||
|
||||
mxPoint originTo = toShape.getOriginPoint(height, false);
|
||||
mxPoint absOriginTo = calculateAbsolutePoint(
|
||||
(mxCell) target.getParent(), graph, originTo);
|
||||
|
||||
Integer targetToPart = connect.getTargetToPart();
|
||||
|
||||
if (targetToPart != mxVsdxConstants.CONNECT_TO_PART_WHOLE_SHAPE)
|
||||
{
|
||||
toConstraint = new mxPoint(
|
||||
(endXY.getX() - absOriginTo.getX())
|
||||
/ dimentionTo.getX(),
|
||||
(endXY.getY() - absOriginTo.getY())
|
||||
/ dimentionTo.getY());
|
||||
}
|
||||
}
|
||||
|
||||
//Defines the style of the edge.
|
||||
Map<String, String> styleMap = edgeShape
|
||||
.getStyleFromEdgeShape(parentHeight);
|
||||
//Insert new edge and set constraints.
|
||||
Object edge = graph.insertEdge(parent, null, textLabel, source,
|
||||
target, ";" + mxVsdxUtils.getStyleString(styleMap, "="));
|
||||
|
||||
mxGeometry edgeGeometry = graph.getModel().getGeometry(edge);
|
||||
edgeGeometry.setPoints(edgeShape.getRoutingPoints(parentHeight));
|
||||
|
||||
if (fromConstraint != null)
|
||||
{
|
||||
graph.setConnectionConstraint(edge, source, true,
|
||||
new mxConnectionConstraint(fromConstraint, false));
|
||||
}
|
||||
if (toConstraint != null)
|
||||
{
|
||||
graph.setConnectionConstraint(edge, target, false,
|
||||
new mxConnectionConstraint(toConstraint, false));
|
||||
}
|
||||
|
||||
//Gets and sets routing points of the edge.
|
||||
if (styleMap.containsKey("curved")
|
||||
&& styleMap.get("curved").equals("1"))
|
||||
{
|
||||
edgeGeometry = graph.getModel().getGeometry(edge);
|
||||
List<mxPoint> pointList = edgeShape
|
||||
.getControlPoints(parentHeight);
|
||||
edgeGeometry.setPoints(pointList);
|
||||
}
|
||||
|
||||
return edgeId;
|
||||
//Gets and sets routing points of the edge.
|
||||
if (styleMap.containsKey("curved")
|
||||
&& styleMap.get("curved").equals("1"))
|
||||
{
|
||||
edgeGeometry = graph.getModel().getGeometry(edge);
|
||||
List<mxPoint> pointList = edgeShape
|
||||
.getControlPoints(parentHeight);
|
||||
edgeGeometry.setPoints(pointList);
|
||||
}
|
||||
|
||||
return null;
|
||||
return edgeId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -851,16 +840,11 @@ public class mxVsdxCodec
|
|||
*/
|
||||
protected Object addUnconnectedEdge(mxGraph graph, Object parent, VsdxShape edgeShape, double pageHeight)
|
||||
{
|
||||
//Defines the label of the edge.
|
||||
String textLabel = edgeShape.getTextLabel();
|
||||
|
||||
double parentHeight = pageHeight;
|
||||
|
||||
mxCell parentCell = (mxCell) parent;
|
||||
|
||||
if (parentCell != null)
|
||||
if (parent != null)
|
||||
{
|
||||
mxGeometry parentGeometry = parentCell.getGeometry();
|
||||
mxGeometry parentGeometry = graph.getModel().getGeometry(parent);
|
||||
|
||||
if (parentGeometry != null)
|
||||
{
|
||||
|
@ -877,9 +861,9 @@ public class mxVsdxCodec
|
|||
//TODO add style numeric entries rounding option
|
||||
|
||||
//Insert new edge and set constraints.
|
||||
Object edge = graph.insertEdge(parent, null, textLabel, null, null, ";" + mxVsdxUtils.getStyleString(styleMap, "="));
|
||||
Object edge = graph.insertEdge(parent, null, edgeShape.getTextLabel(), null, null, ";" + mxVsdxUtils.getStyleString(styleMap, "="));
|
||||
mxGeometry edgeGeometry = graph.getModel().getGeometry(edge);
|
||||
edgeGeometry.setPoints(edgeShape.getRoutingPoints(parentHeight));
|
||||
edgeGeometry.setPoints(edgeShape.getRoutingPoints(parentHeight, beginXY));
|
||||
|
||||
edgeGeometry.setTerminalPoint(beginXY, true);
|
||||
edgeGeometry.setTerminalPoint(endXY, false);
|
||||
|
|
53
src/com/mxgraph/io/vsdx/Section.java
Normal file
53
src/com/mxgraph/io/vsdx/Section.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
/**
|
||||
* Copyright (c) 2006-2016, JGraph Ltd
|
||||
* Copyright (c) 2006-2016, Gaudenz Alder
|
||||
*/
|
||||
package com.mxgraph.io.vsdx;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
public class Section
|
||||
{
|
||||
protected Element elem = null;
|
||||
|
||||
public Section(Element elem)
|
||||
{
|
||||
this.elem = elem;
|
||||
}
|
||||
|
||||
public Element getCell(String[] keys)
|
||||
{
|
||||
if (keys == null || keys.length != 3)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
ArrayList<Element> rows = mxVsdxUtils.getDirectChildNamedElements(this.elem, "row");
|
||||
|
||||
for (int i=0; i < rows.size(); i++)
|
||||
{
|
||||
Element row = rows.get(i);
|
||||
String n = row.getAttribute("N");
|
||||
|
||||
if (n.equals(keys[1]))
|
||||
{
|
||||
ArrayList<Element> cells = mxVsdxUtils.getDirectChildNamedElements(row, "cell");
|
||||
|
||||
for (int j=0; j < cells.size(); j++)
|
||||
{
|
||||
Element cell = cells.get(j);
|
||||
n = cell.getAttribute("N");
|
||||
|
||||
if (n.equals(keys[2]))
|
||||
{
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
* Copyright (c) 2006-2016, JGraph Ltd
|
||||
* Copyright (c) 2006-2016, Gaudenz Alder
|
||||
*/
|
||||
package com.mxgraph.io.vsdx;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -152,18 +156,21 @@ public class Shape extends Style {
|
|||
*/
|
||||
protected void parseSection(Element elem)
|
||||
{
|
||||
super.parseSection(elem);
|
||||
String n = elem.getAttribute("N");
|
||||
|
||||
if (geom == null)
|
||||
{
|
||||
geom = new ArrayList<Element>();
|
||||
}
|
||||
|
||||
if (n.equals("Geometry"))
|
||||
{
|
||||
if (geom == null)
|
||||
{
|
||||
geom = new ArrayList<Element>();
|
||||
}
|
||||
|
||||
this.geom.add(elem);
|
||||
}
|
||||
else
|
||||
{
|
||||
super.parseSection(elem);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
* Copyright (c) 2006-2016, JGraph Ltd
|
||||
* Copyright (c) 2006-2016, Gaudenz Alder
|
||||
*/
|
||||
package com.mxgraph.io.vsdx;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -26,6 +30,8 @@ public abstract class Style
|
|||
|
||||
// .vsdx cells elements that contain one style each
|
||||
protected Map<String, Element> cellElements = new HashMap<String, Element>();
|
||||
|
||||
protected Map<String, Section> sections = new HashMap<String, Section>();
|
||||
|
||||
protected mxPropertiesManager pm;
|
||||
|
||||
|
@ -152,8 +158,7 @@ public abstract class Style
|
|||
|
||||
if (childName.equals("Cell"))
|
||||
{
|
||||
String n = elem.getAttribute("N");
|
||||
this.cellElements.put(n, elem);
|
||||
this.cellElements.put(elem.getAttribute("N"), elem);
|
||||
}
|
||||
else if (childName.equals("Section"))
|
||||
{
|
||||
|
@ -171,7 +176,8 @@ public abstract class Style
|
|||
*/
|
||||
protected void parseSection(Element elem)
|
||||
{
|
||||
|
||||
Section sect = new Section(elem);
|
||||
this.sections.put(elem.getAttribute("N"), sect);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -443,15 +449,35 @@ public abstract class Style
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds a cell key in a Section hierarchy
|
||||
* @param keys the Section/Row/Cell keys
|
||||
* @return the Cell Element
|
||||
*/
|
||||
protected Element getSectionCell(String[] keys)
|
||||
{
|
||||
Section section = this.sections.get(keys[0]);
|
||||
|
||||
return section.getCell(keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Locates the first entry for the specified style string in the style hierarchy.
|
||||
* The order is to look locally, then delegate the request to the relevant parent style
|
||||
* if it doesn't exist locally
|
||||
* @param key The key of the style to find
|
||||
* @param key The key of the cell to find
|
||||
* @return the Element that first resolves to that style key or null or none is found
|
||||
*/
|
||||
protected Element getStyleNode(String key)
|
||||
protected Element getCellElement(String key)
|
||||
{
|
||||
String[] keys = key.split(".");
|
||||
|
||||
if (keys.length > 1)
|
||||
{
|
||||
// Section being referenced
|
||||
return getSectionCell(keys);
|
||||
}
|
||||
|
||||
Element elem = this.cellElements.get(key);
|
||||
boolean inherit = false;
|
||||
|
||||
|
@ -469,7 +495,7 @@ public abstract class Style
|
|||
else if (form.equals("THEMEVAL()") && value.equals("Themed") && theme != null)
|
||||
{
|
||||
// Use "no style" style
|
||||
Element themeElem = theme.getStyleNode(key);
|
||||
Element themeElem = theme.getCellElement(key);
|
||||
|
||||
if (themeElem != null)
|
||||
{
|
||||
|
@ -486,7 +512,7 @@ public abstract class Style
|
|||
|
||||
if (parentStyle != null)
|
||||
{
|
||||
Element parentElem = parentStyle.getStyleNode(key);
|
||||
Element parentElem = parentStyle.getCellElement(key);
|
||||
|
||||
if (parentElem != null)
|
||||
{
|
||||
|
@ -509,13 +535,13 @@ public abstract class Style
|
|||
{
|
||||
String color = "";
|
||||
|
||||
if (this.getText(this.getStyleNode(mxVsdxConstants.LINE_PATTERN), "1").equals("0"))
|
||||
if (this.getText(this.getCellElement(mxVsdxConstants.LINE_PATTERN), "1").equals("0"))
|
||||
{
|
||||
color = "none";
|
||||
}
|
||||
else
|
||||
{
|
||||
color = this.getColor(this.getStyleNode(mxVsdxConstants.LINE_COLOR));
|
||||
color = this.getColor(this.getCellElement(mxVsdxConstants.LINE_COLOR));
|
||||
}
|
||||
|
||||
return color;
|
||||
|
@ -531,8 +557,8 @@ public abstract class Style
|
|||
*/
|
||||
protected String getFillColor()
|
||||
{
|
||||
String fillForeColor = this.getColor(this.getStyleNode(mxVsdxConstants.FILL_FOREGND));
|
||||
String fillPattern = this.getText(this.getStyleNode(mxVsdxConstants.FILL_PATTERN), "0");
|
||||
String fillForeColor = this.getColor(this.getCellElement(mxVsdxConstants.FILL_FOREGND));
|
||||
String fillPattern = this.getText(this.getCellElement(mxVsdxConstants.FILL_PATTERN), "0");
|
||||
|
||||
if (fillPattern != null && fillPattern.equals("0"))
|
||||
{
|
||||
|
@ -594,7 +620,7 @@ public abstract class Style
|
|||
*/
|
||||
public double getLineWeight()
|
||||
{
|
||||
return getNumericalValue(this.getStyleNode(mxVsdxConstants.LINE_WEIGHT), 0);
|
||||
return getNumericalValue(this.getCellElement(mxVsdxConstants.LINE_WEIGHT), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -603,7 +629,7 @@ public abstract class Style
|
|||
*/
|
||||
public double getStrokeTransparency()
|
||||
{
|
||||
return getNumericalValue(this.getStyleNode(mxVsdxConstants.LINE_COLOR_TRANS), 0);
|
||||
return getNumericalValue(this.getCellElement(mxVsdxConstants.LINE_COLOR_TRANS), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -720,7 +746,7 @@ public abstract class Style
|
|||
*/
|
||||
public double getTextTopMargin()
|
||||
{
|
||||
return getScreenNumericalValue(this.getStyleNode(mxVsdxConstants.TOP_MARGIN), 0);
|
||||
return getScreenNumericalValue(this.getCellElement(mxVsdxConstants.TOP_MARGIN), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -729,7 +755,7 @@ public abstract class Style
|
|||
*/
|
||||
public double getTextBottomMargin()
|
||||
{
|
||||
return getScreenNumericalValue(this.getStyleNode(mxVsdxConstants.BOTTOM_MARGIN), 0);
|
||||
return getScreenNumericalValue(this.getCellElement(mxVsdxConstants.BOTTOM_MARGIN), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -738,7 +764,7 @@ public abstract class Style
|
|||
*/
|
||||
public double getTextLeftMargin()
|
||||
{
|
||||
return getScreenNumericalValue(this.getStyleNode(mxVsdxConstants.LEFT_MARGIN), 0);
|
||||
return getScreenNumericalValue(this.getCellElement(mxVsdxConstants.LEFT_MARGIN), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -747,7 +773,7 @@ public abstract class Style
|
|||
*/
|
||||
public double getTextRightMargin()
|
||||
{
|
||||
return getScreenNumericalValue(this.getStyleNode(mxVsdxConstants.RIGHT_MARGIN), 0);
|
||||
return getScreenNumericalValue(this.getCellElement(mxVsdxConstants.RIGHT_MARGIN), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
* Copyright (c) 2006-2016, JGraph Ltd
|
||||
* Copyright (c) 2006-2016, Gaudenz Alder
|
||||
*/
|
||||
package com.mxgraph.io.vsdx;
|
||||
|
||||
import com.mxgraph.model.mxCell;
|
||||
|
@ -211,7 +215,7 @@ public class VsdxShape extends Shape
|
|||
|
||||
if (elem == null && this.masterShape != null)
|
||||
{
|
||||
return this.masterShape.getStyleNode(key);
|
||||
return this.masterShape.getCellElement(key);
|
||||
}
|
||||
|
||||
return elem;
|
||||
|
@ -331,7 +335,7 @@ public class VsdxShape extends Shape
|
|||
// need to translate the origin
|
||||
if (rotation && (lpy != h/2 || lpx != w/2))
|
||||
{
|
||||
double angle = Double.valueOf(this.getText(this.getStyleNode(mxVsdxConstants.ANGLE), "0"));
|
||||
double angle = Double.valueOf(this.getText(this.getCellElement(mxVsdxConstants.ANGLE), "0"));
|
||||
|
||||
if (angle != 0)
|
||||
{
|
||||
|
@ -433,7 +437,7 @@ public class VsdxShape extends Shape
|
|||
opacity = 0;
|
||||
}
|
||||
|
||||
opacity = getNumericalValue(this.getStyleNode(key), 0);
|
||||
opacity = getNumericalValue(this.getCellElement(key), 0);
|
||||
|
||||
opacity = 100 - opacity * 100;
|
||||
opacity = Math.max(opacity, 0);
|
||||
|
@ -450,11 +454,11 @@ public class VsdxShape extends Shape
|
|||
private String getGradient()
|
||||
{
|
||||
String gradient = "";
|
||||
String fillPattern = this.getText(this.getStyleNode(mxVsdxConstants.FILL_PATTERN), "0");
|
||||
String fillPattern = this.getText(this.getCellElement(mxVsdxConstants.FILL_PATTERN), "0");
|
||||
|
||||
if (fillPattern.equals("25") || fillPattern.equals("27") || fillPattern.equals("28") || fillPattern.equals("30"))
|
||||
{
|
||||
gradient = this.getColor(this.getStyleNode(mxVsdxConstants.FILL_BKGND));
|
||||
gradient = this.getColor(this.getCellElement(mxVsdxConstants.FILL_BKGND));
|
||||
}
|
||||
|
||||
return gradient;
|
||||
|
@ -468,7 +472,7 @@ public class VsdxShape extends Shape
|
|||
private String getGradientDirection()
|
||||
{
|
||||
String direction = "";
|
||||
String fillPattern = this.getText(this.getStyleNode(mxVsdxConstants.FILL_PATTERN), "0");
|
||||
String fillPattern = this.getText(this.getCellElement(mxVsdxConstants.FILL_PATTERN), "0");
|
||||
|
||||
if (fillPattern.equals("25"))
|
||||
{
|
||||
|
@ -496,7 +500,7 @@ public class VsdxShape extends Shape
|
|||
*/
|
||||
public double getRotation()
|
||||
{
|
||||
double rotation = Double.valueOf(this.getText(this.getStyleNode(mxVsdxConstants.ANGLE), "0"));
|
||||
double rotation = Double.valueOf(this.getText(this.getCellElement(mxVsdxConstants.ANGLE), "0"));
|
||||
|
||||
rotation = Math.toDegrees(rotation);
|
||||
rotation = rotation % 360;
|
||||
|
@ -562,7 +566,7 @@ public class VsdxShape extends Shape
|
|||
{
|
||||
String vertical = mxConstants.ALIGN_MIDDLE;
|
||||
|
||||
int align = Integer.parseInt(getText(this.getStyleNode(mxVsdxConstants.VERTICAL_ALIGN), "1"));
|
||||
int align = Integer.parseInt(getText(this.getCellElement(mxVsdxConstants.VERTICAL_ALIGN), "1"));
|
||||
|
||||
if (align == 0)
|
||||
{
|
||||
|
@ -587,7 +591,7 @@ public class VsdxShape extends Shape
|
|||
boolean hor = true;
|
||||
//Defines rotation.
|
||||
double rotation = this.getRotation();
|
||||
double angle = Double.valueOf(this.getText(this.getStyleNode(mxVsdxConstants.TXT_ANGLE), "0"));
|
||||
double angle = Double.valueOf(this.getText(this.getCellElement(mxVsdxConstants.TXT_ANGLE), "0"));
|
||||
|
||||
angle = Math.toDegrees(angle);
|
||||
angle = angle - rotation;
|
||||
|
@ -874,7 +878,7 @@ public class VsdxShape extends Shape
|
|||
*/
|
||||
public boolean isDashed()
|
||||
{
|
||||
String linePattern = this.getText(this.getStyleNode(mxVsdxConstants.LINE_PATTERN), "0");
|
||||
String linePattern = this.getText(this.getCellElement(mxVsdxConstants.LINE_PATTERN), "0");
|
||||
|
||||
if (linePattern.equals("Themed"))
|
||||
{
|
||||
|
@ -929,7 +933,7 @@ public class VsdxShape extends Shape
|
|||
*/
|
||||
public float getStartArrowSize()
|
||||
{
|
||||
String baSize = getText(this.getStyleNode(mxVsdxConstants.BEGIN_ARROW_SIZE), "4");
|
||||
String baSize = getText(this.getCellElement(mxVsdxConstants.BEGIN_ARROW_SIZE), "4");
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -951,7 +955,7 @@ public class VsdxShape extends Shape
|
|||
*/
|
||||
public float getFinalArrowSize()
|
||||
{
|
||||
String eaSize = getText(this.getStyleNode(mxVsdxConstants.END_ARROW_SIZE), "4");
|
||||
String eaSize = getText(this.getCellElement(mxVsdxConstants.END_ARROW_SIZE), "4");
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -972,7 +976,7 @@ public class VsdxShape extends Shape
|
|||
*/
|
||||
public boolean isRounded()
|
||||
{
|
||||
String val = getText(this.getStyleNode(mxVsdxConstants.ROUNDING), "0");
|
||||
String val = getText(this.getCellElement(mxVsdxConstants.ROUNDING), "0");
|
||||
return Double.valueOf(val) > 0;
|
||||
}
|
||||
|
||||
|
@ -986,7 +990,7 @@ public class VsdxShape extends Shape
|
|||
// https://msdn.microsoft.com/en-us/library/office/jj230454.aspx TODO
|
||||
// double shdwShow = this.getNumericalValue(this.getStyleNode(mxVdxConstants.SHDW_PATTERN), 0);
|
||||
|
||||
String shdw = this.getText(this.getStyleNode(mxVsdxConstants.SHDW_PATTERN), "0");
|
||||
String shdw = this.getText(this.getCellElement(mxVsdxConstants.SHDW_PATTERN), "0");
|
||||
|
||||
if (shdw.equals("Themed"))
|
||||
{
|
||||
|
@ -1668,8 +1672,8 @@ public class VsdxShape extends Shape
|
|||
*/
|
||||
public mxPoint getStartXY(double parentHeight)
|
||||
{
|
||||
double startX = getScreenNumericalValue(this.getStyleNode(mxVsdxConstants.BEGIN_X), 0);
|
||||
double startY = parentHeight - getScreenNumericalValue(this.getStyleNode(mxVsdxConstants.BEGIN_Y), 0);
|
||||
double startX = getScreenNumericalValue(this.getCellElement(mxVsdxConstants.BEGIN_X), 0);
|
||||
double startY = parentHeight - getScreenNumericalValue(this.getCellElement(mxVsdxConstants.BEGIN_Y), 0);
|
||||
|
||||
return new mxPoint(startX, startY);
|
||||
}
|
||||
|
@ -1681,8 +1685,8 @@ public class VsdxShape extends Shape
|
|||
*/
|
||||
public mxPoint getEndXY(double parentHeight)
|
||||
{
|
||||
double endX = getScreenNumericalValue(this.getStyleNode(mxVsdxConstants.END_X), 0);
|
||||
double endY = parentHeight- getScreenNumericalValue(this.getStyleNode(mxVsdxConstants.END_Y), 0);
|
||||
double endX = getScreenNumericalValue(this.getCellElement(mxVsdxConstants.END_X), 0);
|
||||
double endY = parentHeight- getScreenNumericalValue(this.getCellElement(mxVsdxConstants.END_Y), 0);
|
||||
|
||||
return new mxPoint(endX, endY);
|
||||
}
|
||||
|
@ -1692,9 +1696,8 @@ public class VsdxShape extends Shape
|
|||
* @param parentHeight Height of the parent of the shape.
|
||||
* @return List of mxPoint that represents the routing points.
|
||||
*/
|
||||
public List<mxPoint> getRoutingPoints(double parentHeight)
|
||||
public List<mxPoint> getRoutingPoints(double parentHeight, mxPoint startPoint)
|
||||
{
|
||||
mxPoint startXY = getStartXY(parentHeight);
|
||||
List<mxPoint> points = new ArrayList<mxPoint>();
|
||||
|
||||
if (!(this.hasGeom()))
|
||||
|
@ -1704,6 +1707,8 @@ public class VsdxShape extends Shape
|
|||
|
||||
int controlPointCount = 0;
|
||||
int currentPointCount = 0;
|
||||
double lastX = startPoint.getX();
|
||||
double lastY = startPoint.getY();
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
|
@ -1744,15 +1749,28 @@ public class VsdxShape extends Shape
|
|||
String yValue = children.get("Y");
|
||||
double x = 0, y = 0;
|
||||
|
||||
if (xValue != null && yValue != null)
|
||||
if (xValue != null)
|
||||
{
|
||||
x = Double.parseDouble(xValue) * mxVsdxUtils.conversionFactor;
|
||||
y = (Double.parseDouble(yValue) * mxVsdxUtils.conversionFactor) * -1;
|
||||
lastX = x;
|
||||
x += startPoint.getX();
|
||||
}
|
||||
else
|
||||
{
|
||||
x = lastX;
|
||||
}
|
||||
|
||||
if (yValue != null)
|
||||
{
|
||||
y = (Double.parseDouble(yValue) * mxVsdxUtils.conversionFactor) * -1;
|
||||
lastY = y;
|
||||
y += startPoint.getY();
|
||||
}
|
||||
else
|
||||
{
|
||||
y = lastY;
|
||||
}
|
||||
|
||||
x += startXY.getX();
|
||||
y += startXY.getY();
|
||||
|
||||
x = Math.round(x * 100.0) / 100.0;
|
||||
y = Math.round(y * 100.0) / 100.0;
|
||||
|
||||
|
@ -1846,6 +1864,7 @@ public class VsdxShape extends Shape
|
|||
public Map<String, String> getStyleFromEdgeShape(double parentHeight)
|
||||
{
|
||||
Map<String, String> styleMap = new Hashtable<String, String>();
|
||||
styleMap.put("vsdxID", this.getId().toString());
|
||||
|
||||
//Defines Edge Shape
|
||||
Map<String, String> edgeShape = getForm();
|
||||
|
@ -1964,7 +1983,7 @@ public class VsdxShape extends Shape
|
|||
public Map<String, String> resolveCommonStyles(Map<String, String> styleMap)
|
||||
{
|
||||
/** LABEL BACKGROUND COLOR **/
|
||||
String lbkgnd = this.getTextBkgndColor(this.getStyleNode(mxVsdxConstants.TEXT_BKGND));
|
||||
String lbkgnd = this.getTextBkgndColor(this.getCellElement(mxVsdxConstants.TEXT_BKGND));
|
||||
|
||||
if (!lbkgnd.equals(""))
|
||||
{
|
||||
|
@ -1980,7 +1999,7 @@ public class VsdxShape extends Shape
|
|||
*/
|
||||
public String getEdgeMarker(boolean start)
|
||||
{
|
||||
String marker = this.getText(this.getStyleNode(start ? mxVsdxConstants.BEGIN_ARROW : mxVsdxConstants.END_ARROW), "0");
|
||||
String marker = this.getText(this.getCellElement(start ? mxVsdxConstants.BEGIN_ARROW : mxVsdxConstants.END_ARROW), "0");
|
||||
return VsdxShape.arrowTypes.get(marker);
|
||||
}
|
||||
|
||||
|
@ -1991,13 +2010,13 @@ public class VsdxShape extends Shape
|
|||
* @param key The key of the style to find
|
||||
* @return the Element that first resolves to that style key or null or none is found
|
||||
*/
|
||||
protected Element getStyleNode(String key)
|
||||
protected Element getCellElement(String key)
|
||||
{
|
||||
Element elem = super.getStyleNode(key);
|
||||
Element elem = super.getCellElement(key);
|
||||
|
||||
if (elem == null && this.masterShape != null)
|
||||
{
|
||||
return this.masterShape.getStyleNode(key);
|
||||
return this.masterShape.getCellElement(key);
|
||||
}
|
||||
|
||||
return elem;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* Copyright (c) 2015, JGraph Ltd
|
||||
* Copyright (c) 2006-2016, JGraph Ltd
|
||||
* Copyright (c) 2006-2016, Gaudenz Alder
|
||||
*/
|
||||
package com.mxgraph.io.vsdx;
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
* Copyright (c) 2006-2016, JGraph Ltd
|
||||
* Copyright (c) 2006-2016, Gaudenz Alder
|
||||
*/
|
||||
package com.mxgraph.io.vsdx;
|
||||
|
||||
import com.mxgraph.util.mxConstants;
|
||||
|
@ -149,6 +153,27 @@ public class mxVsdxUtils
|
|||
return copy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a collection of direct child Elements that match the specified tag name
|
||||
* @param parent the parent whose direct children will be processed
|
||||
* @param name the child tag name to match
|
||||
* @return a collection of matching Elements
|
||||
*/
|
||||
public static ArrayList<Element> getDirectChildNamedElements(Element parent, String name)
|
||||
{
|
||||
ArrayList<Element> result = new ArrayList<Element>();
|
||||
|
||||
for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling())
|
||||
{
|
||||
if (child instanceof Element && name.equals(child.getNodeName()))
|
||||
{
|
||||
result.add((Element)child);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string that represents the content of a given style map.
|
||||
* @param styleMap Map with the styles values
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 11/18/2016 01:11 PM
|
||||
# 11/21/2016 09:53 AM
|
||||
|
||||
/app.html
|
||||
/index.html?offline=1
|
||||
|
|
64
war/js/app.min.js
vendored
64
war/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
40
war/js/atlas-viewer.min.js
vendored
40
war/js/atlas-viewer.min.js
vendored
|
@ -2770,27 +2770,27 @@ this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var C=th
|
|||
C!=this.editor.graph&&C.container.parentNode.removeChild(C.container);z(a.substring(a.lastIndexOf(",")+1))}),null,null,null,null,null,null,null,null,null,null,C)}else(new mxXmlRequest(EXPORT_URL,"format\x3dpng\x26embedXml\x3d"+("xmlpng"==u.format?"1":"0")+"\x26base64\x3d1\x26xml\x3d"+encodeURIComponent(encodeURIComponent(x)))).send(mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();200==a.getStatus()&&z(a.getText())}),mxUtils.bind(this,function(){this.spinner.stop()}))}}else{null!=
|
||||
u.xml&&0<u.xml.length&&this.setFileData(u.xml);y=this.createLoadMessage("export");if("html2"==u.format||"html"==u.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))v=this.getXmlFileData(),y.xml=mxUtils.getXml(v),y.data=this.getFileData(null,null,!0,null,null,null,v),y.format=u.format;else if("html"==u.format)x=this.editor.getGraphXml(),y.data=this.getHtml(x,this.editor.graph),y.xml=mxUtils.getXml(x),y.format=u.format;else{mxSvgCanvas2D.prototype.foAltText=null;v=this.editor.graph.background;
|
||||
v==mxConstants.NONE&&(v=null);y.xml=this.getFileData(!0);y.format="svg";if(u.embedImages||null==u.embedImages){if(null==u.spin&&null==u.spinKey||this.spinner.spin(document.body,null!=u.spinKey?mxResources.get(u.spinKey):u.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==u.format?this.getEmbeddedSvg(y.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();y.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(y),"*")})):this.convertImages(this.editor.graph.getSvg(v),
|
||||
mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();y.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(y),"*")}));return}v="xmlsvg"==u.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(v));y.data=this.createSvgDataUri(v)}g.postMessage(JSON.stringify(y),"*")}return}"load"==u.action?(d=1==u.autosave,this.hideDialog(),null!=u.modified&&null==urlParams.modified&&(urlParams.modified=
|
||||
mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();y.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(y),"*")}));return}v="xmlsvg"==u.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(v));y.data=this.createSvgDataUri(v)}g.postMessage(JSON.stringify(y),"*")}return}if("load"==u.action)d=1==u.autosave,this.hideDialog(),null!=u.modified&&null==urlParams.modified&&(urlParams.modified=
|
||||
u.modified),null!=u.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=u.saveAndExit),null!=u.title&&null!=this.buttonContainer&&(v=document.createElement("span"),mxUtils.write(v,u.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),this.buttonContainer.appendChild(v)),u=null!=u.xmlpng?this.extractGraphModelFromPng(u.xmlpng):null!=
|
||||
u.xml&&"data:image/png;base64,"==u.xml.substring(0,22)?this.extractGraphModelFromPng(u.xml):u.xml):u=null}u=r(u);c=!0;try{a(u,f)}catch(F){this.handleError(F)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var G=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=G();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=G();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=
|
||||
d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",
|
||||
b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));("1"==urlParams.returnbounds||"json"==urlParams.proto)&&g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position=
|
||||
"absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" (Ctrl+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&
|
||||
(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft=
|
||||
"6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px";"atlas"==uiTheme&&(this.statusContainer.style.color="#707070",this.statusContainer.style.paddingLeft="26px",this.toolbar.staticElements.push(this.statusContainer),this.toolbar.container.appendChild(this.statusContainer))}};
|
||||
EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"\x3d"+urlParams[d],c="\x26")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle url embed client create title splash".split(" "),
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"\x26",null!=urlParams[d]&&(a+=d+"\x3d"+urlParams[d],b++))}return a};var f=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=f.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-
|
||||
2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&
|
||||
null!=this.source.minimumGraphSize){var d=this.source.getPagePadding(),e=Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2),f=Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2);return new mxPoint(Math.round(e-d.x),Math.round(f-d.y-5/a))}return new mxPoint(8/a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*
|
||||
(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;
|
||||
null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed;this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c="1"!=urlParams.embed&&(null==a||a.isRestricted());
|
||||
this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);a="1"==urlParams.embed||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);
|
||||
null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){if((mxClient.IS_GC||mxClient.IS_IOS&&mxClient.IS_SF)&&null!=applicationCache){var d=applicationCache;if(null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top=
|
||||
"2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);var e=window.setTimeout(mxUtils.bind(this,function(){d.status==d.IDLE&&(this.offlineStatus.innerHTML='[\x3cimg title\x3d"Cached" border\x3d"0" src\x3d"'+IMAGE_PATH+'/checkmark.gif"/\x3e]',window.clearTimeout(e))}),
|
||||
5E3)}}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),c=null!=b&&b.isEditable()||"1"==urlParams.embed;this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(c);
|
||||
this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!=
|
||||
b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed||null!=b&&!b.isRestricted());this.actions.get("imgur").setEnabled(null!=b&&!b.isRestricted());this.actions.get("twitter").setEnabled(null!=b&&!b.isRestricted());this.actions.get("facebook").setEnabled(null!=b&&!b.isRestricted());this.actions.get("github").setEnabled(null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=b&&!b.isRestricted());
|
||||
this.menus.get("publish").setEnabled(null!=b&&!b.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=a&&null!=a.shape&&null!=a.shape.stencil)}})();function DiagramPage(a){this.node=a}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,c){this.ui=a;this.page=b;this.previous=c}
|
||||
u.xml&&"data:image/png;base64,"==u.xml.substring(0,22)?this.extractGraphModelFromPng(u.xml):u.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage"}),"*");return}}u=r(u);c=!0;try{a(u,f)}catch(F){this.handleError(F)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var G=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=G();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=
|
||||
G();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",
|
||||
b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));("1"==urlParams.returnbounds||"json"==urlParams.proto)&&g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=
|
||||
document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" (Ctrl+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));
|
||||
a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));
|
||||
b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px";"atlas"==uiTheme&&(this.statusContainer.style.color="#707070",this.statusContainer.style.paddingLeft="26px",this.toolbar.staticElements.push(this.statusContainer),
|
||||
this.toolbar.container.appendChild(this.statusContainer))}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"\x3d"+urlParams[d],c="\x26")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;
|
||||
else{var c="tmp libs clibs state fileId code share notitle url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"\x26",null!=urlParams[d]&&(a+=d+"\x3d"+urlParams[d],b++))}return a};var f=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=f.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=
|
||||
this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*
|
||||
a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding(),e=Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2),f=Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2);return new mxPoint(Math.round(e-d.x),Math.round(f-d.y-5/a))}return new mxPoint(8/
|
||||
a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
|
||||
e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=
|
||||
this.getCurrentFile(),b=null!=a||"1"==urlParams.embed;this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c="1"!=urlParams.embed&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);a="1"==urlParams.embed||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);
|
||||
this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){if((mxClient.IS_GC||mxClient.IS_IOS&&mxClient.IS_SF)&&null!=applicationCache){var d=applicationCache;if(null==
|
||||
this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
|
||||
var e=window.setTimeout(mxUtils.bind(this,function(){d.status==d.IDLE&&(this.offlineStatus.innerHTML='[\x3cimg title\x3d"Cached" border\x3d"0" src\x3d"'+IMAGE_PATH+'/checkmark.gif"/\x3e]',window.clearTimeout(e))}),5E3)}}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),
|
||||
c=null!=b&&b.isEditable()||"1"==urlParams.embed;this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(c);this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&!a.isSelectionEmpty());
|
||||
this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!=b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed||null!=b&&!b.isRestricted());this.actions.get("imgur").setEnabled(null!=b&&!b.isRestricted());this.actions.get("twitter").setEnabled(null!=
|
||||
b&&!b.isRestricted());this.actions.get("facebook").setEnabled(null!=b&&!b.isRestricted());this.actions.get("github").setEnabled(null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=b&&!b.isRestricted());this.menus.get("publish").setEnabled(null!=b&&!b.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=a&&null!=a.shape&&null!=a.shape.stencil)}})();function DiagramPage(a){this.node=a}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,c){this.ui=a;this.page=b;this.previous=c}
|
||||
RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(a,b,c){this.ui=a;this.oldIndex=b;this.newIndex=c}
|
||||
MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))}
|
||||
SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,b=this.ui.editor,c=b.graph,d=b.graph.compress(c.zapGremlins(mxUtils.getXml(b.getGraphXml(!0))));mxUtils.setTextContent(a.node,d);a.viewState=c.getViewState();a.root=c.model.root;c.view.clear(a.root,!0);c.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;c.model.rootChanged(a.root);c.setViewState(a.viewState);
|
||||
|
|
60
war/js/atlas.min.js
vendored
60
war/js/atlas.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -385,7 +385,15 @@ DriveClient.prototype.executeRequest = function(req, success, error)
|
|||
}));
|
||||
});
|
||||
|
||||
fn();
|
||||
// Must get token before first request in this case
|
||||
if (gapi.auth.getToken() == null)
|
||||
{
|
||||
this.execute(fn);
|
||||
}
|
||||
else
|
||||
{
|
||||
fn();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -6133,8 +6133,10 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
// Unknown message
|
||||
data = null;
|
||||
// Unknown message must stop execution
|
||||
parent.postMessage(JSON.stringify({error: 'unknownMessage'}), '*');
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
war/js/embed-static.min.js
vendored
2
war/js/embed-static.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+u+"}":"{"+v.join(",")+"}";f=u;return r}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();var mxBasePath="https://www.draw.io/mxgraph/",mxLoadStylesheets=mxLoadResources=!1,mxLanguage="en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||1E8;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"6.0.1.5",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"6.0.1.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
|
@ -2766,7 +2766,7 @@ var LayersWindow = function(editorUi, x, y, w, h)
|
|||
listDiv.style.left = '0px';
|
||||
listDiv.style.right = '0px';
|
||||
listDiv.style.top = '0px';
|
||||
listDiv.style.bottom = tbarHeight;
|
||||
listDiv.style.bottom = (parseInt(tbarHeight) + 7) + 'px';
|
||||
div.appendChild(listDiv);
|
||||
|
||||
var dragSource = null;
|
||||
|
|
2
war/js/reader.min.js
vendored
2
war/js/reader.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+u+"}":"{"+v.join(",")+"}";f=u;return r}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();var mxBasePath="https://www.draw.io/mxgraph/",mxLoadStylesheets=mxLoadResources=!1,mxLanguage="en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||1E8;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"6.0.1.5",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"6.0.1.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
45
war/js/viewer.min.js
vendored
45
war/js/viewer.min.js
vendored
|
@ -2783,29 +2783,30 @@ this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var C=th
|
|||
C!=this.editor.graph&&C.container.parentNode.removeChild(C.container);z(a.substring(a.lastIndexOf(",")+1))}),null,null,null,null,null,null,null,null,null,null,C)}else(new mxXmlRequest(EXPORT_URL,"format\x3dpng\x26embedXml\x3d"+("xmlpng"==u.format?"1":"0")+"\x26base64\x3d1\x26xml\x3d"+encodeURIComponent(encodeURIComponent(x)))).send(mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();200==a.getStatus()&&z(a.getText())}),mxUtils.bind(this,function(){this.spinner.stop()}))}}else{null!=
|
||||
u.xml&&0<u.xml.length&&this.setFileData(u.xml);y=this.createLoadMessage("export");if("html2"==u.format||"html"==u.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))v=this.getXmlFileData(),y.xml=mxUtils.getXml(v),y.data=this.getFileData(null,null,!0,null,null,null,v),y.format=u.format;else if("html"==u.format)x=this.editor.getGraphXml(),y.data=this.getHtml(x,this.editor.graph),y.xml=mxUtils.getXml(x),y.format=u.format;else{mxSvgCanvas2D.prototype.foAltText=null;v=this.editor.graph.background;
|
||||
v==mxConstants.NONE&&(v=null);y.xml=this.getFileData(!0);y.format="svg";if(u.embedImages||null==u.embedImages){if(null==u.spin&&null==u.spinKey||this.spinner.spin(document.body,null!=u.spinKey?mxResources.get(u.spinKey):u.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==u.format?this.getEmbeddedSvg(y.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();y.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(y),"*")})):this.convertImages(this.editor.graph.getSvg(v),
|
||||
mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();y.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(y),"*")}));return}v="xmlsvg"==u.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(v));y.data=this.createSvgDataUri(v)}g.postMessage(JSON.stringify(y),"*")}return}"load"==u.action?(d=1==u.autosave,this.hideDialog(),null!=u.modified&&null==urlParams.modified&&(urlParams.modified=
|
||||
mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();y.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(y),"*")}));return}v="xmlsvg"==u.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(v));y.data=this.createSvgDataUri(v)}g.postMessage(JSON.stringify(y),"*")}return}if("load"==u.action)d=1==u.autosave,this.hideDialog(),null!=u.modified&&null==urlParams.modified&&(urlParams.modified=
|
||||
u.modified),null!=u.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=u.saveAndExit),null!=u.title&&null!=this.buttonContainer&&(v=document.createElement("span"),mxUtils.write(v,u.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),this.buttonContainer.appendChild(v)),u=null!=u.xmlpng?this.extractGraphModelFromPng(u.xmlpng):null!=
|
||||
u.xml&&"data:image/png;base64,"==u.xml.substring(0,22)?this.extractGraphModelFromPng(u.xml):u.xml):u=null}u=r(u);c=!0;try{a(u,f)}catch(F){this.handleError(F)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var G=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=G();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=G();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=
|
||||
d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",
|
||||
b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));("1"==urlParams.returnbounds||"json"==urlParams.proto)&&g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position=
|
||||
"absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" (Ctrl+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&
|
||||
(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft=
|
||||
"6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px";"atlas"==uiTheme&&(this.statusContainer.style.color="#707070",this.statusContainer.style.paddingLeft="26px",this.toolbar.staticElements.push(this.statusContainer),this.toolbar.container.appendChild(this.statusContainer))}};
|
||||
EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"\x3d"+urlParams[d],c="\x26")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle url embed client create title splash".split(" "),
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"\x26",null!=urlParams[d]&&(a+=d+"\x3d"+urlParams[d],b++))}return a};var f=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=f.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-
|
||||
2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&
|
||||
null!=this.source.minimumGraphSize){var d=this.source.getPagePadding(),e=Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2),f=Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2);return new mxPoint(Math.round(e-d.x),Math.round(f-d.y-5/a))}return new mxPoint(8/a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*
|
||||
(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;
|
||||
null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed;this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c="1"!=urlParams.embed&&(null==a||a.isRestricted());
|
||||
this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);a="1"==urlParams.embed||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);
|
||||
null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){if((mxClient.IS_GC||mxClient.IS_IOS&&mxClient.IS_SF)&&null!=applicationCache){var d=applicationCache;if(null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top=
|
||||
"2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);var e=window.setTimeout(mxUtils.bind(this,function(){d.status==d.IDLE&&(this.offlineStatus.innerHTML='[\x3cimg title\x3d"Cached" border\x3d"0" src\x3d"'+IMAGE_PATH+'/checkmark.gif"/\x3e]',window.clearTimeout(e))}),
|
||||
5E3)}}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),c=null!=b&&b.isEditable()||"1"==urlParams.embed;this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(c);
|
||||
this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!=
|
||||
b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed||null!=b&&!b.isRestricted());this.actions.get("imgur").setEnabled(null!=b&&!b.isRestricted());this.actions.get("twitter").setEnabled(null!=b&&!b.isRestricted());this.actions.get("facebook").setEnabled(null!=b&&!b.isRestricted());this.actions.get("github").setEnabled(null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=b&&!b.isRestricted());
|
||||
this.menus.get("publish").setEnabled(null!=b&&!b.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=a&&null!=a.shape&&null!=a.shape.stencil)}})();function DiagramPage(a){this.node=a}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};
|
||||
DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,c){this.ui=a;this.page=b;this.previous=c}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(a,b,c){this.ui=a;this.oldIndex=b;this.newIndex=c}
|
||||
MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))}
|
||||
u.xml&&"data:image/png;base64,"==u.xml.substring(0,22)?this.extractGraphModelFromPng(u.xml):u.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage"}),"*");return}}u=r(u);c=!0;try{a(u,f)}catch(F){this.handleError(F)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var G=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=G();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=
|
||||
G();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",
|
||||
b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));("1"==urlParams.returnbounds||"json"==urlParams.proto)&&g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=
|
||||
document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" (Ctrl+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));
|
||||
a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));
|
||||
b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px";"atlas"==uiTheme&&(this.statusContainer.style.color="#707070",this.statusContainer.style.paddingLeft="26px",this.toolbar.staticElements.push(this.statusContainer),
|
||||
this.toolbar.container.appendChild(this.statusContainer))}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"\x3d"+urlParams[d],c="\x26")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;
|
||||
else{var c="tmp libs clibs state fileId code share notitle url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"\x26",null!=urlParams[d]&&(a+=d+"\x3d"+urlParams[d],b++))}return a};var f=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=f.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=
|
||||
this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*
|
||||
a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding(),e=Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2),f=Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2);return new mxPoint(Math.round(e-d.x),Math.round(f-d.y-5/a))}return new mxPoint(8/
|
||||
a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
|
||||
e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=
|
||||
this.getCurrentFile(),b=null!=a||"1"==urlParams.embed;this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c="1"!=urlParams.embed&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);a="1"==urlParams.embed||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);
|
||||
this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){if((mxClient.IS_GC||mxClient.IS_IOS&&mxClient.IS_SF)&&null!=applicationCache){var d=applicationCache;if(null==
|
||||
this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
|
||||
var e=window.setTimeout(mxUtils.bind(this,function(){d.status==d.IDLE&&(this.offlineStatus.innerHTML='[\x3cimg title\x3d"Cached" border\x3d"0" src\x3d"'+IMAGE_PATH+'/checkmark.gif"/\x3e]',window.clearTimeout(e))}),5E3)}}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),
|
||||
c=null!=b&&b.isEditable()||"1"==urlParams.embed;this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(c);this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&!a.isSelectionEmpty());
|
||||
this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!=b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed||null!=b&&!b.isRestricted());this.actions.get("imgur").setEnabled(null!=b&&!b.isRestricted());this.actions.get("twitter").setEnabled(null!=
|
||||
b&&!b.isRestricted());this.actions.get("facebook").setEnabled(null!=b&&!b.isRestricted());this.actions.get("github").setEnabled(null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=b&&!b.isRestricted());this.menus.get("publish").setEnabled(null!=b&&!b.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=a&&null!=a.shape&&null!=a.shape.stencil)}})();function DiagramPage(a){this.node=a}DiagramPage.prototype.node=null;
|
||||
DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,c){this.ui=a;this.page=b;this.previous=c}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
|
||||
function MovePage(a,b,c){this.ui=a;this.oldIndex=b;this.newIndex=c}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};
|
||||
function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))}
|
||||
SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,b=this.ui.editor,c=b.graph,d=b.graph.compress(c.zapGremlins(mxUtils.getXml(b.getGraphXml(!0))));mxUtils.setTextContent(a.node,d);a.viewState=c.getViewState();a.root=c.model.root;c.view.clear(a.root,!0);c.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;c.model.rootChanged(a.root);c.setViewState(a.viewState);
|
||||
b.fireEvent(new mxEventObject("setViewState","change",this));c.gridEnabled=c.gridEnabled&&(!this.ui.editor.chromeless||"1"==urlParams.grid);b.updateGraphComponents();c.view.validate();c.sizeDidChange();this.neverShown&&(this.neverShown=!1,c.selectUnlockedLayer());b.graph.fireEvent(new mxEventObject(mxEvent.ROOT));b.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(a,b,c,d){SelectPage.call(this,a,c);this.relatedPage=b;this.index=d;this.previousIndex=null}
|
||||
mxUtils.extend(ChangePage,SelectPage);ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var a=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(a,1);this.index=a}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;SelectPage.prototype.execute.apply(this,arguments)};
|
||||
|
|
Loading…
Reference in a new issue