Skip to content

Commit 960813c

Browse files
committed
conversions to typescript and type fixes
1 parent 29fff20 commit 960813c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1075
-1200
lines changed

.prettierrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"tabWidth": 2,
33
"trailingComma": "es5",
4-
"singleQuote": true
4+
"singleQuote": true,
5+
"printWidth": 90
56
}

docs/stashed/Schema.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default MYNAMEHERE;
6969

7070
// Defines an icon for creating new connections in the connection handler.
7171
// This will automatically disable the highlighting of the source vertex.
72-
mxConnectionHandler.prototype.connectImage = new Image('images/connector.gif', 16, 16);
72+
ConnectionHandler.prototype.connectImage = new Image('images/connector.gif', 16, 16);
7373

7474
// Prefetches all images that appear in colums
7575
// to avoid problems with the auto-layout

docs/stashed/Scrollbars.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default Scrollbars;
9696
// not a problem here since the preview moves away from the mouse as soon as it connects
9797
// to any given table row. This is because the edge connects to the outside of the row and
9898
// is aligned to the grid during the preview.
99-
mxConnectionHandler.prototype.movePreviewAway = false;
99+
ConnectionHandler.prototype.movePreviewAway = false;
100100

101101
// Disables foreignObjects
102102
mxClient.NO_FO = true;
@@ -105,17 +105,17 @@ export default Scrollbars;
105105
GraphHandler.prototype.htmlPreview = true;
106106

107107
// Enables connect icons to appear on top of HTML
108-
mxConnectionHandler.prototype.moveIconFront = true;
108+
ConnectionHandler.prototype.moveIconFront = true;
109109

110110
// Defines an icon for creating new connections in the connection handler.
111111
// This will automatically disable the highlighting of the source vertex.
112-
mxConnectionHandler.prototype.connectImage = new Image('images/connector.gif', 16, 16);
112+
ConnectionHandler.prototype.connectImage = new Image('images/connector.gif', 16, 16);
113113

114114
// Disables the context menu
115115
mxEvent.disableContextMenu(container);
116116

117117
// Overrides target perimeter point for connection previews
118-
mxConnectionHandler.prototype.getTargetPerimeterPoint = function(state, me)
118+
ConnectionHandler.prototype.getTargetPerimeterPoint = function(state, me)
119119
{
120120
// Determines the y-coordinate of the target perimeter point
121121
// by using the currentRowNode assigned in updateRow
@@ -138,7 +138,7 @@ export default Scrollbars;
138138
};
139139

140140
// Overrides source perimeter point for connection previews
141-
mxConnectionHandler.prototype.getSourcePerimeterPoint = function(state, next, me)
141+
ConnectionHandler.prototype.getSourcePerimeterPoint = function(state, next, me)
142142
{
143143
let y = me.getY();
144144

@@ -159,7 +159,7 @@ export default Scrollbars;
159159
};
160160

161161
// Disables connections to invalid rows
162-
mxConnectionHandler.prototype.isValidTarget = function(cell)
162+
ConnectionHandler.prototype.isValidTarget = function(cell)
163163
{
164164
return this.currentRowNode != null;
165165
};

docs/stashed/Touch.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,13 @@ export default Touch;
265265
(function()
266266
{
267267
// Enables rotation handle
268-
mxVertexHandler.prototype.rotationEnabled = true;
268+
VertexHandler.prototype.rotationEnabled = true;
269269

270270
// Enables managing of sizers
271-
mxVertexHandler.prototype.manageSizers = true;
271+
VertexHandler.prototype.manageSizers = true;
272272

273273
// Enables live preview
274-
mxVertexHandler.prototype.livePreview = true;
274+
VertexHandler.prototype.livePreview = true;
275275

276276
// Sets constants for touch style
277277
mxConstants.HANDLE_SIZE = 16;
@@ -281,7 +281,7 @@ export default Touch;
281281
if (mxClient.IS_TOUCH || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0)
282282
{
283283
Shape.prototype.svgStrokeTolerance = 18;
284-
mxVertexHandler.prototype.tolerance = 12;
284+
VertexHandler.prototype.tolerance = 12;
285285
mxEdgeHandler.prototype.tolerance = 12;
286286
mxGraph.prototype.tolerance = 12;
287287
}
@@ -309,7 +309,7 @@ export default Touch;
309309
};
310310

311311
// On connect the target is selected and we clone the cell of the preview edge for insert
312-
mxConnectionHandler.prototype.selectCells = function(edge, target)
312+
ConnectionHandler.prototype.selectCells = function(edge, target)
313313
{
314314
if (target != null)
315315
{
@@ -337,7 +337,7 @@ export default Touch;
337337

338338
// Rounded edge and vertex handles
339339
let touchHandle = new Image('images/handle-main.png', 17, 17);
340-
mxVertexHandler.prototype.handleImage = touchHandle;
340+
VertexHandler.prototype.handleImage = touchHandle;
341341
mxEdgeHandler.prototype.handleImage = touchHandle;
342342
Outline.prototype.sizerImage = touchHandle;
343343

@@ -347,8 +347,8 @@ export default Touch;
347347
// Adds connect icon to selected vertex
348348
let connectorSrc = 'images/handle-connect.png';
349349

350-
let vertexHandlerInit = mxVertexHandler.prototype.init;
351-
mxVertexHandler.prototype.init = function()
350+
let vertexHandlerInit = VertexHandler.prototype.init;
351+
VertexHandler.prototype.init = function()
352352
{
353353
// TODO: Use 4 sizers, move outside of shape
354354
//this.singleSizer = this.state.width < 30 && this.state.height < 30;
@@ -393,8 +393,8 @@ export default Touch;
393393
this.redrawHandles();
394394
};
395395

396-
let vertexHandlerHideSizers = mxVertexHandler.prototype.hideSizers;
397-
mxVertexHandler.prototype.hideSizers = function()
396+
let vertexHandlerHideSizers = VertexHandler.prototype.hideSizers;
397+
VertexHandler.prototype.hideSizers = function()
398398
{
399399
vertexHandlerHideSizers.apply(this, arguments);
400400

@@ -404,8 +404,8 @@ export default Touch;
404404
}
405405
};
406406

407-
let vertexHandlerReset = mxVertexHandler.prototype.reset;
408-
mxVertexHandler.prototype.reset = function()
407+
let vertexHandlerReset = VertexHandler.prototype.reset;
408+
VertexHandler.prototype.reset = function()
409409
{
410410
vertexHandlerReset.apply(this, arguments);
411411

@@ -415,8 +415,8 @@ export default Touch;
415415
}
416416
};
417417

418-
let vertexHandlerRedrawHandles = mxVertexHandler.prototype.redrawHandles;
419-
mxVertexHandler.prototype.redrawHandles = function()
418+
let vertexHandlerRedrawHandles = VertexHandler.prototype.redrawHandles;
419+
VertexHandler.prototype.redrawHandles = function()
420420
{
421421
vertexHandlerRedrawHandles.apply(this);
422422

@@ -426,7 +426,7 @@ export default Touch;
426426
let s = this.state;
427427

428428
// Top right for single-sizer
429-
if (mxVertexHandler.prototype.singleSizer)
429+
if (VertexHandler.prototype.singleSizer)
430430
{
431431
pt.x = s.x + s.width - this.connectorImg.offsetWidth / 2;
432432
pt.y = s.y - this.connectorImg.offsetHeight / 2;
@@ -453,8 +453,8 @@ export default Touch;
453453
}
454454
};
455455

456-
let vertexHandlerDestroy = mxVertexHandler.prototype.destroy;
457-
mxVertexHandler.prototype.destroy = function(sender, me)
456+
let vertexHandlerDestroy = VertexHandler.prototype.destroy;
457+
VertexHandler.prototype.destroy = function(sender, me)
458458
{
459459
vertexHandlerDestroy.apply(this, arguments);
460460

docs/stashed/grapheditor/www/js/Editor.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2591,8 +2591,8 @@ FilenameDialog.createFileTypes = function(editorUi, nameInput, types)
25912591
};
25922592

25932593
// Overrides to ignore hotspot only for target terminal
2594-
let mxConnectionHandlerCreateMarker = mxConnectionHandler.prototype.createMarker;
2595-
mxConnectionHandler.prototype.createMarker = function()
2594+
let mxConnectionHandlerCreateMarker = ConnectionHandler.prototype.createMarker;
2595+
ConnectionHandler.prototype.createMarker = function()
25962596
{
25972597
let marker = mxConnectionHandlerCreateMarker.apply(this, arguments);
25982598

docs/stashed/grapheditor/www/js/EditorUi.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ EditorUi = function(editor, container, lightbox)
3434
}
3535

3636
// Pre-fetches connect image
37-
if (!mxClient.IS_SVG && mxConnectionHandler.prototype.connectImage != null)
37+
if (!mxClient.IS_SVG && ConnectionHandler.prototype.connectImage != null)
3838
{
39-
new Image().src = mxConnectionHandler.prototype.connectImage.src;
39+
new Image().src = ConnectionHandler.prototype.connectImage.src;
4040
}
4141

4242
// Disables graph and forced panning in chromeless mode
@@ -4100,7 +4100,7 @@ EditorUi.prototype.ctrlEnter = function()
41004100
try
41014101
{
41024102
let cells = graph.getSelectionCells();
4103-
let lookup = new mxDictionary();
4103+
let lookup = new Dictionary();
41044104
let newCells = [];
41054105

41064106
for (let i = 0; i < cells.length; i++)

0 commit comments

Comments
 (0)