Browse Source

6.2.6 release

Gaudenz Alder 8 years ago
parent
commit
4bf3322ad6
10 changed files with 121 additions and 45 deletions
  1. 4 0
      ChangeLog
  2. 1 1
      VERSION
  3. 1 1
      war/cache.manifest
  4. 76 4
      war/electron.js
  5. 4 4
      war/js/app.min.js
  6. 1 1
      war/js/atlas.min.js
  7. 1 1
      war/js/diagramly/DriveClient.js
  8. 1 1
      war/js/embed-static.min.js
  9. 1 1
      war/js/reader.min.js
  10. 31 31
      war/package.json

+ 4 - 0
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

+ 1 - 1
VERSION

@@ -1 +1 @@
-6.2.5
+6.2.6

+ 1 - 1
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

+ 76 - 4
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)
+		}
+	})
+})
+/**/

File diff suppressed because it is too large
+ 4 - 4
war/js/app.min.js


File diff suppressed because it is too large
+ 1 - 1
war/js/atlas.min.js


+ 1 - 1
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)
 			{

File diff suppressed because it is too large
+ 1 - 1
war/js/embed-static.min.js


File diff suppressed because it is too large
+ 1 - 1
war/js/reader.min.js


+ 31 - 31
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"
+  }
+}