diff --git a/src/js/gui.js b/src/js/gui.js index a8897b9b5a..0b4e27566c 100644 --- a/src/js/gui.js +++ b/src/js/gui.js @@ -69,17 +69,7 @@ class GuiControl { this.operating_system = GUI_checkOperatingSystem(); // Check the method of execution - this.nwGui = null; - try { - this.nwGui = require('nw.gui'); - this.Mode = GUI_MODES.NWJS; - } catch (ex) { - if (typeof cordovaApp !== 'undefined') { - this.Mode = GUI_MODES.Cordova; - } else { - this.Mode = GUI_MODES.Other; - } - } + this.nwGui = GUI_MODES.Other; } // Timer managing methods // name = string diff --git a/src/js/main.js b/src/js/main.js index 14851ee959..5315f1b8e9 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -20,7 +20,6 @@ import { isExpertModeEnabled } from './utils/isExportModeEnabled.js'; import { updateTabList } from './utils/updateTabList.js'; import { checkForConfiguratorUpdates } from './utils/checkForConfiguratorUpdates.js'; import * as THREE from 'three'; -import * as d3 from 'd3'; if (typeof String.prototype.replaceAll === "undefined") { String.prototype.replaceAll = function(match, replace) { @@ -188,36 +187,6 @@ function startProcess() { gui_log(i18n.getMessage('infoVersionOs', { operatingSystem: GUI.operating_system })); gui_log(i18n.getMessage('infoVersionConfigurator', { configuratorVersion: CONFIGURATOR.getDisplayVersion() })); - if (GUI.isNWJS()) { - const nwWindow = GUI.nwGui.Window.get(); - nwWindow.on('new-win-policy', function(frame, url, policy) { - // do not open the window - policy.ignore(); - // and open it in external browser - GUI.nwGui.Shell.openExternal(url); - }); - nwWindow.on('close', closeHandler); - const config = getConfig('showDevToolsOnStartup'); - if (CONFIGURATOR.isDevVersion() && !!config.showDevToolsOnStartup) { - nwWindow.showDevTools(); - } - } else if (GUI.isCordova()) { - window.addEventListener('beforeunload', closeHandler); - document.addEventListener('backbutton', function(e) { - e.preventDefault(); - navigator.notification.confirm( - i18n.getMessage('cordovaExitAppMessage'), - function(stat) { - if (stat === 1) { - navigator.app.exitApp(); - } - }, - i18n.getMessage('cordovaExitAppTitle'), - [i18n.getMessage('yes'),i18n.getMessage('no')], - ); - }); - } - $('.connect_b a.connect').removeClass('disabled'); // with Vue reactive system we don't need to call these, // our view is reactive to model changes diff --git a/src/js/utils/checkForConfiguratorUpdates.js b/src/js/utils/checkForConfiguratorUpdates.js index 0703e1d67c..1c149c12c2 100644 --- a/src/js/utils/checkForConfiguratorUpdates.js +++ b/src/js/utils/checkForConfiguratorUpdates.js @@ -4,6 +4,7 @@ import CONFIGURATOR from "../data_storage"; import { i18n } from "../localization"; import { gui_log } from "../gui_log"; import $ from 'jquery'; +import semver from "semver-min"; function notifyOutdatedVersion(data) { @@ -12,7 +13,7 @@ function notifyOutdatedVersion(data) { return false; } - if (data.isCurrent === false && data.updatedVersion !== undefined) { + if (data.isCurrent === false && data.updatedVersion !== undefined && semver.gt(data.updatedVersion.version, CONFIGURATOR.version)) { CONFIGURATOR.latestVersion = data.updatedVersion.version; CONFIGURATOR.latestVersionReleaseUrl = data.updatedVersion.url;