Skip to content

Commit

Permalink
13.6.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Aug 31, 2020
1 parent 59fe649 commit c56eddf
Show file tree
Hide file tree
Showing 125 changed files with 3,070 additions and 2,340 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
31-AUG-2020: 13.6.6

- Removes PWA for www.draw.io
- Improves Gliffy import

24-AUG-2020: 13.6.5

- Corrects classpath for CacheFacade
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
13.6.5
13.6.6
1 change: 1 addition & 0 deletions etc/build/build.xml
Expand Up @@ -138,6 +138,7 @@
<file name="Sidebar-Office.js" />
<file name="Sidebar-PID.js" />
<file name="Sidebar-Rack.js" />
<file name="Sidebar-Signs.js" />
<file name="Sidebar-Sitemap.js" />
<file name="Sidebar-Sysml.js" />
<file name="Sidebar-ThreatModeling.js" />
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/mxgraph/online/AbsAuthServlet.java
Expand Up @@ -16,6 +16,7 @@
import java.security.SecureRandom;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.logging.Level;

import javax.cache.Cache;
import javax.cache.CacheException;
Expand Down Expand Up @@ -127,7 +128,7 @@ protected void doGet(HttpServletRequest request,
String state = new BigInteger(256, random).toString(32);
String key = new BigInteger(256, random).toString(32);
putCacheValue(key, state);
// log.log(Level.INFO, "AUTH-SERVLET: [" + request.getRemoteAddr() + "] Added state (" + key + " -> " + state + ")");
log.log(Level.INFO, "AUTH-SERVLET: [" + request.getRemoteAddr() + "] Added state (" + key + " -> " + state + ")");
response.setStatus(HttpServletResponse.SC_OK);
//Chrome blocks this cookie when draw.io is running in an iframe. The cookie is added to parent frame. TODO FIXME
response.setHeader("Set-Cookie", STATE_COOKIE + "=" + key + "; Max-Age=" + COOKIE_AGE + ";path=" + cookiePath + "; Secure; HttpOnly; SameSite=none"); //10 min to finish auth
Expand Down Expand Up @@ -176,7 +177,7 @@ protected void doGet(HttpServletRequest request,
//Get the cached state based on the cookie key
String cacheKey = cookie.getValue();
cookieToken = (String) tokenCache.get(cacheKey);
// log.log(Level.INFO, "AUTH-SERVLET: [" + request.getRemoteAddr() + "] Found cookie state (" + cacheKey + " -> " + cookieToken + ")");
log.log(Level.INFO, "AUTH-SERVLET: [" + request.getRemoteAddr() + "] Found cookie state (" + cacheKey + " -> " + cookieToken + ")");
//Delete cookie & cache after being used since it is a single use
tokenCache.remove(cacheKey);
response.setHeader("Set-Cookie", STATE_COOKIE + "= ;path=" + cookiePath + "; expires=Thu, 01 Jan 1970 00:00:00 UTC; Secure; HttpOnly; SameSite=none");
Expand Down Expand Up @@ -216,7 +217,7 @@ else if ((code == null && refreshToken == null) || client == null || redirectUri
//Non GAE runtimes are excluded from state check. TODO Change GAE stub to return null from CacheFactory
else if (!"Non".equals(SystemProperty.environment.get()) && (stateToken == null || !stateToken.equals(cookieToken)))
{
// log.log(Level.WARNING, "AUTH-SERVLET: [" + request.getRemoteAddr() + "] STATE MISMATCH (state: " + stateToken + " != cookie: " + cookieToken + ")");
log.log(Level.WARNING, "AUTH-SERVLET: [" + request.getRemoteAddr() + "] STATE MISMATCH (state: " + stateToken + " != cookie: " + cookieToken + ")");
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
}
else
Expand Down
14 changes: 14 additions & 0 deletions src/main/webapp/electron.js
Expand Up @@ -1199,6 +1199,20 @@ function exportDiagram(event, args, directFinalize)
browser.capturePage().then(function(img)
{
//Image is double the given bounds, so resize is needed!
var tScale = 1;

//If user defined width and/or height, enforce it precisely here. Height override width
if (args.h)
{
tScale = args.h / newBounds.height;
}
else if (args.w)
{
tScale = args.w / newBounds.width;
}

newBounds.width *= tScale;
newBounds.height *= tScale;
img = img.resize(newBounds);

var data = args.format == 'png'? img.toPNG() : img.toJPEG(args.jpegQuality || 90);
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/export-fonts.css
@@ -0,0 +1 @@
/* Add any special fonts css for export3.html (mainly PDF export) */
27 changes: 26 additions & 1 deletion src/main/webapp/export3.html
Expand Up @@ -5,6 +5,21 @@
<script>
var isLocalStorage = false;
var mxLoadStylesheets = false;

function getUrlParam(param)
{
var result = (new RegExp(param + '=([^&]*)')).exec(window.location.search);

if (result != null && result.length > 0)
{
return decodeURIComponent(result[1].replace(/\+/g, '%20'));
}

return null;
};

var remoteMath = getUrlParam('remoteMath') == '1';
var fallbackFont = getUrlParam('fallbackFont');
</script>
<!-- CSS for print output is needed for using current window -->
<style type="text/css">
Expand All @@ -13,14 +28,16 @@
hr.mxPageBreak { display: none; }
</style>
<link rel="stylesheet" href="mxgraph/css/common.css" charset="UTF-8" type="text/css">
<link rel="stylesheet" href="export-fonts.css" charset="UTF-8" type="text/css">
<script src="js/app.min.js"></script>
<script>
var mxIsElectron = navigator.userAgent != null &&
navigator.userAgent.toLowerCase().indexOf(' electron/') > -1;
var GOOGLE_APPS_MAX_AREA = 25000000;
var GOOGLE_SHEET_MAX_AREA = 1048576; //1024x1024

Editor.initMath('math/MathJax.js');
//TODO Add support for loading math from a local folder
Editor.initMath((remoteMath? 'https://app.diagrams.net/' : '') + 'math/MathJax.js');

function render(data)
{
Expand Down Expand Up @@ -858,6 +875,14 @@
renderPage();
}

if (fallbackFont)
{
//Add a fallbackFont font to all labels in case the selected font doesn't support the character
//Some systems doesn't have a good fallback fomt that supports all languages
//Use this with a custom font-face in export-fonts.css file
document.querySelectorAll('foreignObject div').forEach(d => d.style.fontFamily = (d.style.fontFamily || '') + ', ' + fallbackFont);
}

renderGrid();
// Includes images in SVG and HTML labels
waitForImages('image', 'xlink:href');
Expand Down

0 comments on commit c56eddf

Please sign in to comment.