Skip to content

Commit

Permalink
7.5.3 release
Browse files Browse the repository at this point in the history
Former-commit-id: 8d1ed99
  • Loading branch information
alderg committed Oct 6, 2017
1 parent af82812 commit 35d2bb0
Show file tree
Hide file tree
Showing 18 changed files with 1,537 additions and 1,502 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
06-OCT-2017: 7.5.3

- Fixes Trello integration
- Fixes image cropping dialog

05-OCT-2017: 7.5.2

- Ready for new Trello integration
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.5.2
7.5.3
232 changes: 116 additions & 116 deletions src/com/mxgraph/io/gliffy/importer/gliffyTranslation.properties

Large diffs are not rendered by default.

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

# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 10/05/2017 04:35 PM
# 10/06/2017 02:55 PM

app.html
index.html?offline=1
Expand Down
429 changes: 215 additions & 214 deletions war/js/app.min.js

Large diffs are not rendered by default.

438 changes: 219 additions & 219 deletions war/js/atlas-viewer.min.js

Large diffs are not rendered by default.

1,299 changes: 650 additions & 649 deletions war/js/atlas.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion war/js/diagramly/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ App = function(editor, container, lightbox)
}

// Handles opening files via drag and drop
if (!this.editor.chromeless)
if (!this.editor.chromeless || this.editor.editable)
{
this.addFileDropHandler([document]);
}
Expand Down
74 changes: 46 additions & 28 deletions war/js/diagramly/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3775,15 +3775,16 @@ var ImageDialog = function(editorUi, title, initialValue, fn, ignoreExisting, co
}

// Image cropping (experimental)
if (!!document.createElement('canvas').getContext && linkInput.value.substring(0, 11) == 'data:image/')
if (!!document.createElement('canvas').getContext && linkInput.value.substring(0, 11) == 'data:image/' &&
linkInput.value.substring(0, 14) != 'data:image/svg')
{
var cropBtn = mxUtils.button(mxResources.get('crop'), function()
{
var dlg = new CropImageDialog(editorUi, linkInput.value, function(image)
{
linkInput.value = image;
});
editorUi.showDialog(dlg.container, 200, 160, true, true);
editorUi.showDialog(dlg.container, 200, 180, true, true);
dlg.init();
});

Expand Down Expand Up @@ -6496,6 +6497,15 @@ var CropImageDialog = function(editorUi, image, fn)

var table = document.createElement('table');
var tbody = document.createElement('tbody');

var row = document.createElement('tr');
var size = document.createElement('td');
size.style.whiteSpace = 'nowrap';
size.setAttribute('colspan', '2');
mxUtils.write(size, mxResources.get('loading') + '...');
row.appendChild(size);
tbody.appendChild(row);

var row = document.createElement('tr');
var left = document.createElement('td');
var right = document.createElement('td');
Expand Down Expand Up @@ -6599,42 +6609,50 @@ var CropImageDialog = function(editorUi, image, fn)
editorUi.hideDialog();
});

var imageObj = new Image();

var applyBtn = mxUtils.button(mxResources.get('apply'), function()
{
editorUi.hideDialog();

var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
var imageObj = new Image();
var w = imageObj.width;
var h = imageObj.height;

imageObj.onload = function()
// draw cropped image
var sourceX = parseInt(xInput.value);
var sourceY = parseInt(yInput.value);
var sourceWidth = Math.max(1, w - sourceX - parseInt(wInput.value));
var sourceHeight = Math.max(1, h - sourceY - parseInt(hInput.value));
canvas.width = sourceWidth;
canvas.height = sourceHeight;

if (circleInput.checked)
{
var w = imageObj.width;
var h = imageObj.height;

// draw cropped image
var sourceX = parseInt(xInput.value);
var sourceY = parseInt(yInput.value);
var sourceWidth = Math.max(1, w - sourceX - parseInt(wInput.value));
var sourceHeight = Math.max(1, h - sourceY - parseInt(hInput.value));
canvas.width = sourceWidth;
canvas.height = sourceHeight;

if (circleInput.checked)
{
context.fillStyle = '#000000';
context.arc(sourceWidth / 2, sourceHeight / 2, Math.min(sourceWidth / 2,
sourceHeight / 2), 0, 2 * Math.PI);
context.fill();
context.globalCompositeOperation = 'source-in';
}

context.drawImage(imageObj, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, sourceWidth, sourceHeight);
fn(canvas.toDataURL());
};
imageObj.src = image;
context.fillStyle = '#000000';
context.arc(sourceWidth / 2, sourceHeight / 2, Math.min(sourceWidth / 2,
sourceHeight / 2), 0, 2 * Math.PI);
context.fill();
context.globalCompositeOperation = 'source-in';
}

context.drawImage(imageObj, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, sourceWidth, sourceHeight);
fn(canvas.toDataURL());
});

applyBtn.setAttribute('disabled', 'disabled');

imageObj.onload = function()
{
applyBtn.removeAttribute('disabled');
size.innerHTML = '';
mxUtils.write(size, mxResources.get('width') + ': ' + imageObj.width + ' ' +
mxResources.get('height') + ': ' + imageObj.height);
};

imageObj.src = image;

mxEvent.addListener(div, 'keypress', function(e)
{
if (e.keyCode == 13)
Expand Down
84 changes: 51 additions & 33 deletions war/js/diagramly/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@
}
}

if (!this.editor.chromeless)
if (!this.editor.chromeless || this.editor.editable)
{
this.editor.graph.selectUnlockedLayer();
this.showLayersDialog();
Expand Down Expand Up @@ -1978,8 +1978,8 @@

if (evt.dataTransfer.files.length > 0)
{
this.importFiles(evt.dataTransfer.files, 0, 0, this.maxImageSize, mxUtils.bind(this, function(data, mimeType, x, y, w, h, img, doneFn, file)
{
this.importFiles(evt.dataTransfer.files, 0, 0, this.maxImageSize, mxUtils.bind(this, function(data, mimeType, x, y, w, h, img, doneFn, file)
{
if (data != null && mimeType.substring(0, 6) == 'image/')
{
var style = 'shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image=' +
Expand Down Expand Up @@ -6599,7 +6599,7 @@
printAction.visible = printAction.isEnabled();

// Scales pages/graph to fit available size
if (!this.editor.chromeless)
if (!this.editor.chromeless || this.editor.editable)
{
// Defines additional hotkeys
this.keyHandler.bindAction(70, true, 'find'); // Ctrl+F
Expand Down Expand Up @@ -7039,7 +7039,7 @@

// Installs drag and drop handler for files
// Enables dropping files
if (Graph.fileSupport && !this.editor.chromeless)
if (Graph.fileSupport && (!this.editor.chromeless || this.editor.editable))
{
// Setup the dnd listeners
var dropElt = null;
Expand Down Expand Up @@ -7296,7 +7296,8 @@
/**
* Shows scratchpad if never shown.
*/
if (!this.editor.chromeless && this.sidebar != null && (mxSettings.settings.isNew ||
if ((!this.editor.chromeless || this.editor.editable) &&
this.sidebar != null && (mxSettings.settings.isNew ||
parseInt(mxSettings.settings.version || 0) <= 8))
{
this.toggleScratchpad();
Expand Down Expand Up @@ -8183,7 +8184,7 @@

return data;
};

if (urlParams['proto'] == 'json')
{
try
Expand Down Expand Up @@ -8547,43 +8548,60 @@

return;
}
else if (data.action == 'loadFile' && this.loadFile)
else if (data.action == 'create' && this.createFile)
{
if (data.type == 'T')
// Currently only trello supported
if (data.mode == 'trello')
{
if (this.trello == null)
var doCreateFile = mxUtils.bind(this, function(templateData)
{
this.addListener('clientLoaded', function() {
this.loadFile(data.type + data.file, true);
});
}
else
this.createFile(data.name, templateData ||
this.getFileData(/(\.xml)$/i.test(name) ||
name.indexOf('.') < 0, /(\.svg)$/i.test(name),
/(\.html)$/i.test(name)), null, data.mode,
null, true, data.folder);
});

var resolveTemplate = mxUtils.bind(this, function()
{
this.loadFile(data.type + data.file, true);
}
}
}
else if (data.action == 'newFile' && this.createFile)
{
if (data.type == 'T')
{
if (data.template != null)
{
this.trello.getFile(data.folder + this.trello.SEPARATOR +
data.template, function(file)
{
doCreateFile(file.getData());
}, function()
{
doCreateFile();
});
}
else
{
doCreateFile();
}
});

if (this.trello == null)
{
this.addListener('clientLoaded', function() {
this.createFile(data.name, this.getFileData(/(\.xml)$/i.test(name) ||
name.indexOf('.') < 0, /(\.svg)$/i.test(name),
/(\.html)$/i.test(name)),
null, App.MODE_TRELLO, null, true, data.folderId);
});
var waitForTrello = function()
{
if (this.trello != null)
{
this.removeListener(waitForTrello);
resolveTemplate();
}
};

// Waits for Trello client to load
this.addListener('clientLoaded', waitForTrello);
}
else
{
this.createFile(data.name, this.getFileData(/(\.xml)$/i.test(name) ||
name.indexOf('.') < 0, /(\.svg)$/i.test(name),
/(\.html)$/i.test(name)),
null, App.MODE_TRELLO, null, true, data.folderId);
resolveTemplate();
}
}

return;
}
else if (data.action == 'load')
{
Expand Down
2 changes: 1 addition & 1 deletion war/js/diagramly/GraphViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ GraphViewer.prototype.showLightbox = function(editable, closable, target)

if (editable)
{
param.edit = '_blank';
param.edit = this.graphConfig.edit || '_blank';
}

if (closable)
Expand Down
7 changes: 0 additions & 7 deletions war/js/diagramly/TrelloClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ TrelloClient.prototype.maxFileSize = 10000000 /*10MB*/;
*/
TrelloClient.prototype.extension = '.xml'; //TODO export to png


TrelloFile.prototype.isAutosaveOptional = function()
{
return false;
};

/**
* Authorizes the client, used with methods that can be called without a user click and popup blockers will interfere
* Show the AuthDialog to work around the popup blockers if the file is opened directly
Expand Down Expand Up @@ -75,7 +69,6 @@ TrelloClient.prototype.getLibrary = function(id, success, error)
this.getFile(id, success, error, false, true);
};


/**
*
*/
Expand Down
5 changes: 2 additions & 3 deletions war/js/diagramly/TrelloFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ TrelloFile.prototype.getMode = function()
return App.MODE_TRELLO;
};


/**
* Overridden to enable the autosave option in the document properties dialog.
*/
TrelloFile.prototype.isAutosaveOptional = function()
TrelloFile.prototype.isAutosave = function()
{
return true;
return false;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion war/js/embed-static.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions war/js/mxgraph/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2699,7 +2699,7 @@ EditorUi.prototype.updateActionStates = function()
this.actions.get('openLink').setEnabled(graph.getSelectionCount() == 1 &&
graph.getLinkForCell(graph.getSelectionCell()) != null);
this.actions.get('guides').setEnabled(graph.isEnabled());
this.actions.get('grid').setEnabled(!this.editor.chromeless);
this.actions.get('grid').setEnabled(!this.editor.chromeless || this.editor.editable);

var unlocked = graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent());
this.menus.get('layout').setEnabled(unlocked);
Expand Down Expand Up @@ -3913,7 +3913,7 @@ EditorUi.prototype.createKeyHandler = function(editor)
keyHandler.bindAction(79, true, 'outline', true); // Ctrl+Shift+O
keyHandler.bindAction(112, false, 'about'); // F1

if (!this.editor.chromeless)
if (!this.editor.chromeless || this.editor.editable)
{
keyHandler.bindControlKey(36, function() { if (graph.isEnabled()) { graph.foldCells(true); }}); // Ctrl+Home
keyHandler.bindControlKey(35, function() { if (graph.isEnabled()) { graph.foldCells(false); }}); // Ctrl+End
Expand Down
Loading

0 comments on commit 35d2bb0

Please sign in to comment.