From 4bf3322ad623cc2b14bb8756efab95845ff34278 Mon Sep 17 00:00:00 2001 From: Gaudenz Alder Date: Tue, 7 Mar 2017 17:00:06 +0100 Subject: [PATCH] 6.2.6 release --- ChangeLog | 4 ++ VERSION | 2 +- war/cache.manifest | 2 +- war/electron.js | 80 +++++++++++++++++++++++++++++++-- war/js/app.min.js | 8 ++-- war/js/atlas.min.js | 2 +- war/js/diagramly/DriveClient.js | 2 +- war/js/embed-static.min.js | 2 +- war/js/reader.min.js | 2 +- war/package.json | 62 ++++++++++++------------- 10 files changed, 121 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1724e168..1c67384d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +07-MAR-2017: 6.2.6 + +- Adds support for Google Team Drives + 07-MAR-2017: 6.2.5 - Adds remote JPEG export option diff --git a/VERSION b/VERSION index 03825cde..417c0202 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.2.5 \ No newline at end of file +6.2.6 \ No newline at end of file diff --git a/war/cache.manifest b/war/cache.manifest index 7e42a7f1..88b0f1a6 100644 --- a/war/cache.manifest +++ b/war/cache.manifest @@ -1,7 +1,7 @@ CACHE MANIFEST # THIS FILE WAS GENERATED. DO NOT MODIFY! -# 03/07/2017 08:44 AM +# 03/07/2017 04:56 PM app.html index.html?offline=1 diff --git a/war/electron.js b/war/electron.js index ddb3cbc0..da61ef32 100644 --- a/war/electron.js +++ b/war/electron.js @@ -1,11 +1,21 @@ const fs = require('fs') const path = require('path') +const url = require('url') const electron = require('electron') const ipcMain = electron.ipcMain const dialog = electron.dialog const app = electron.app const BrowserWindow = electron.BrowserWindow +const autoUpdater = require('electron-updater').autoUpdater +const log = require('electron-log') +autoUpdater.logger = log +autoUpdater.logger.transports.file.level = 'info' +// autoUpdater.autoDownload = false +autoUpdater.autoDownload = true + +const __DEV__ = process.env.NODE_ENV === 'development' + let windowsRegistry = [] function createWindow (opt = {}) { @@ -13,6 +23,9 @@ function createWindow (opt = {}) { width: 1600, height: 1200, 'web-security': false, + webPreferences: { + // preload: path.resolve('./preload.js'), + }, }, opt) let mainWindow = new BrowserWindow(options) @@ -20,9 +33,27 @@ function createWindow (opt = {}) { console.log('createWindow', opt) + let wurl = url.format({ + pathname: `${__dirname}/index.html`, + protocol: 'file:', + query: { + 'dev': __DEV__ ? 1 : 0, + 'test': 1, + 'db': 0, + 'gapi': 0, + 'od': 0, + 'analytics': 0, + 'picker': 0, + 'mode': 'device', + 'browser': 0, + 'p': 'electron', + }, + slashes: true, + }) + +//`file://${__dirname}/index.html?dev=1&test=1&db=0&gapi=0&od=0&analytics=0&picker=0&mode=device&browser=0&p=electron` // and load the index.html of the app. - mainWindow.loadURL( - `file://${__dirname}/index.html?dev=1&test=1&db=0&gapi=0&od=0&analytics=0&picker=0&mode=device&browser=0&p=electron`) + mainWindow.loadURL(wurl) // Open the DevTools. mainWindow.webContents.openDevTools() @@ -85,6 +116,8 @@ app.on('ready', e => { event.returnValue = 'pong' }) createWindow() + // checkUpdate() + autoUpdater.checkForUpdates() }) // Quit when all windows are closed. @@ -106,5 +139,44 @@ app.on('activate', function () { } }) -// In this file you can include the rest of your app's specific main process -// code. You can also put them in separate files and require them here. +function checkUpdate () { + autoUpdater.checkForUpdates().then(UpdateCheckResult => { + if (UpdateCheckResult) { + let idx = dialog.showMessageBox({ + type: 'question', + buttons: ['Ok', 'Cancel'], + title: 'Confirm Update', + message: 'Update available.\n\nWould you like to download and install new version?', + detail: 'Application will automatically restart to apply update after download', + }) + if (idx === 0) return autoUpdater.downloadUpdate() + } + }).then((a, b) => { + log.info('@cfu update-downloaded@\n', a, b) + }).catch(e => { + log.error('@cfu then error@\n', e) + }) +} + +autoUpdater.on('error', e => log.error('@error@\n', e)) + +autoUpdater.on('update-available', + (a, b) => log.info('@update-available@\n', a, b)) + +/**/ +autoUpdater.on('update-downloaded', (event, info) => { + log.info('@update-downloaded@\n', info, event) + // Ask user to update the app + dialog.showMessageBox({ + type: 'question', + buttons: ['Install and Relaunch', 'Later'], + defaultId: 0, + message: 'A new version of ' + app.getName() + ' has been downloaded', + detail: 'It will be installed the next time you restart the application', + }, response => { + if (response === 0) { + setTimeout(() => autoUpdater.quitAndInstall(), 1) + } + }) +}) +/**/ \ No newline at end of file diff --git a/war/js/app.min.js b/war/js/app.min.js index 4b1ec18a..658ab6f2 100644 --- a/war/js/app.min.js +++ b/war/js/app.min.js @@ -7298,7 +7298,7 @@ c);while(c++';EditorUi.prototype.emptyLibraryXml="[]";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;"; +[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var b=null;null!=a&&0';EditorUi.prototype.emptyLibraryXml="[]";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;"; EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.enableLogging=!0;EditorUi.prototype.pdfPageExport=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),b=new Image;b.onload=function(){try{a.getContext("2d").drawImage(b, 0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=c&&6
')))}catch(n){}try{a=document.createElement("canvas");a.width=a.height=1;var c= a.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==c.match("image/jpeg")}catch(n){}})();EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,c){localStorage.setItem(a,b);c()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))}; @@ -7692,9 +7692,9 @@ DriveClient.prototype.checkToken=function(a){var c=0';EditorUi.prototype.emptyLibraryXml="[]";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;"; +(function(){EditorUi.VERSION="6.2.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.isElectronApp=window&&window.process&&window.process.type;EditorUi.prototype.emptyDiagramXml='';EditorUi.prototype.emptyLibraryXml="[]";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;"; EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.enableLogging=!0;EditorUi.prototype.pdfPageExport=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),b=new Image;b.onload=function(){try{a.getContext("2d").drawImage(b, 0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=c&&6
')))}catch(n){}try{a=document.createElement("canvas");a.width=a.height=1;var c= a.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==c.match("image/jpeg")}catch(n){}})();EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,c){localStorage.setItem(a,b);c()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))}; diff --git a/war/js/diagramly/DriveClient.js b/war/js/diagramly/DriveClient.js index e8d61a25..d3db673d 100644 --- a/war/js/diagramly/DriveClient.js +++ b/war/js/diagramly/DriveClient.js @@ -626,7 +626,7 @@ DriveClient.prototype.getFile = function(id, success, error, readXml, readLibrar } else { - this.executeRequest(gapi.client.drive.files.get({'fileId': id}), mxUtils.bind(this, function(resp) + this.executeRequest(gapi.client.drive.files.get({'fileId': id, 'supportsTeamDrives': true}), mxUtils.bind(this, function(resp) { if (this.user != null) { diff --git a/war/js/embed-static.min.js b/war/js/embed-static.min.js index 0802d58e..71856665 100644 --- a/war/js/embed-static.min.js +++ b/war/js/embed-static.min.js @@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+x.join(",")+"}";f=t;return l}}"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;enavigator.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.2.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/")|| diff --git a/war/js/reader.min.js b/war/js/reader.min.js index f67fc69e..eb6a03c1 100644 --- a/war/js/reader.min.js +++ b/war/js/reader.min.js @@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+x.join(",")+"}";f=t;return l}}"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;enavigator.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.2.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/")|| diff --git a/war/package.json b/war/package.json index 71184675..d06004c8 100644 --- a/war/package.json +++ b/war/package.json @@ -1,32 +1,32 @@ { - "name": "draw.io", - "version": "1.0.0", - "description": "draw.io desktop", - "main": "electron.js", - "scripts": - { - "start": "electron ." - }, - "repository": - { - "type": "git", - "url": "git+https://github.com/jgraph/draw.io.git" - }, - "keywords": [ - "draw.io", - "diagram", - "flowchart", - "UML" - ], - "author": "JGraph", - "license": "GPL-3.0", - "bugs": - { - "url": "https://github.com/jgraph/draw.io/issues" - }, - "homepage": "https://github.com/jgraph/draw.io", - "devDependencies": - { - "electron": "^1.4.13" - } -} + "name": "draw.io", + "version": "6.2.4", + "description": "draw.io desktop", + "main": "electron.js", + "scripts": { + "start": "electron ." + }, + "repository": { + "type": "git", + "url": "git+https://github.com/jgraph/draw.io.git" + }, + "keywords": [ + "draw.io", + "diagram", + "flowchart", + "UML" + ], + "author": "JGraph", + "license": "GPL-3.0", + "bugs": { + "url": "https://github.com/jgraph/draw.io/issues" + }, + "homepage": "https://github.com/jgraph/draw.io", + "dependencies": { + "electron-log": "^1.3.0", + "electron-updater": "^1.8.2" + }, + "devDependencies": { + "electron": "^1.6.2" + } +} \ No newline at end of file