From b475134be1ffa20d3569e1b55bbdbe44b17a5831 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Tue, 5 Sep 2017 11:50:59 +0900 Subject: [PATCH] Upgrade wrt_support for electron v1.6.7 The electron has been upgraded from v0.35.4 to v1.6.7. So, this applies the API changes to wrt_support. Change-Id: Iee51a807d048f69d9ed67915dc2377b6fdb9e95f Signed-off-by: Youngsoo Choi --- wrt/wrt_support/apps_repo/database.json | 2 +- .../extensions_settings/src/extension_manager.js | 10 +++++----- .../extensions_settings/src/was_key_event_handler.js | 6 +++--- .../sample/installer/assets/js/was_key_event_handler.js | 6 +++--- wrt/wrt_support/sample/launcher/assets/js/launcher.js | 16 ++++++++-------- .../sample/launcher/assets/js/was_key_event_handler.js | 6 +++--- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/wrt/wrt_support/apps_repo/database.json b/wrt/wrt_support/apps_repo/database.json index 02c2359..618a3ea 100644 --- a/wrt/wrt_support/apps_repo/database.json +++ b/wrt/wrt_support/apps_repo/database.json @@ -1 +1 @@ -[{"app_id":"0123456789.ANYTHING","version":"1.0.0","content":"index.html","icon":"icon.png","name":"installer","type":"packaged","localeInfo":[{"locale":"default","name":"installer"}],"_id":"73dcc29053524fd3b6512061eccea2e1"},{"app_id":"0123456789.ANYTHING","version":"1.0.0","content":"index.html","icon":"icon.png","name":"webgl","type":"packaged","localeInfo":[{"locale":"default","name":"webgl"},{"locale":"en-us","name":"Web GL"},{"locale":"ko-kr","name":"웹 지엘"},{"locale":"jp-jp","name":"ウェブ GL"}],"_id":"9692aaf7360d4c09b4011a4bc0f2a521"},{"app_id":"0123456789.ANYTHING","version":"1.0.0","content":"index.html","icon":"icon.png","name":"extensions_settings","type":"packaged","localeInfo":[{"locale":"default","name":"extensions_settings"}],"_id":"00ddf6ddab574372b68a2b48db17f088"}] \ No newline at end of file +[{"app_id":"0123456789.ANYTHING","version":"1.0.0","content":"index.html","icon":"icon.png","name":"webgl","type":"packaged","localeInfo":[{"locale":"default","name":"webgl"},{"locale":"en-us","name":"Web GL"},{"locale":"ko-kr","name":"웹 지엘"},{"locale":"jp-jp","name":"ウェブ GL"}],"_id":"9692aaf7360d4c09b4011a4bc0f2a521"},{"app_id":"0123456789.ANYTHING","version":"1.0.0","content":"index.html","icon":"icon.png","name":"installer","type":"packaged","localeInfo":[{"locale":"default","name":"installer"}],"_id":"b6cdf3f84b564691b3bc1e203d02f547"},{"app_id":"0123456789.ANYTHING","version":"1.0.0","content":"index.html","icon":"icon.png","name":"extensions_settings","type":"packaged","localeInfo":[{"locale":"default","name":"extensions_settings"}],"_id":"6359f8d65f074abfa15a220a240e7c64"}] \ No newline at end of file diff --git a/wrt/wrt_support/extensions_settings/src/extension_manager.js b/wrt/wrt_support/extensions_settings/src/extension_manager.js index dca4291..1920e5c 100755 --- a/wrt/wrt_support/extensions_settings/src/extension_manager.js +++ b/wrt/wrt_support/extensions_settings/src/extension_manager.js @@ -11,7 +11,7 @@ var util = require('util'); var mkdirp = require('mkdirp'); - var ipc = require('ipc'); + var {ipcRenderer} = require('electron'); var IPC_EXTENSIONS_INSTALLED = 'ipc:extensions:installed'; var IPC_EXTENSIONS_UNINSTALLED = 'ipc:extensions:uninstalled'; var IPC_EXTENSIONS_ACTIVATE = 'ipc:extensions:activate'; @@ -169,7 +169,7 @@ } ext_manager.saveJsonDB(); - ipc.send(IPC_EXTENSIONS_INSTALLED, extension.name); + ipcRenderer.send(IPC_EXTENSIONS_INSTALLED, extension.name); } else { console.log('InstallRepoItem - error : extension = ' + extension + ' extensions_list_=' + ext_manager.extensions_list_); } @@ -190,7 +190,7 @@ } this.saveJsonDB(); - ipc.send(IPC_EXTENSIONS_UNINSTALLED, extension.name); + ipcRenderer.send(IPC_EXTENSIONS_UNINSTALLED, extension.name); } /* installer - get manifest info from path */ @@ -380,11 +380,11 @@ }; ExtensionManager.prototype.activate = function(name) { - ipc.send(IPC_EXTENSIONS_ACTIVATE, name); + ipcRenderer.send(IPC_EXTENSIONS_ACTIVATE, name); }; ExtensionManager.prototype.deactivate = function(name) { - ipc.send(IPC_EXTENSIONS_DEACTIVATE, name); + ipcRenderer.send(IPC_EXTENSIONS_DEACTIVATE, name); }; ExtensionManager.getManifestFile = function() { diff --git a/wrt/wrt_support/extensions_settings/src/was_key_event_handler.js b/wrt/wrt_support/extensions_settings/src/was_key_event_handler.js index 48c127f..47bbf1d 100644 --- a/wrt/wrt_support/extensions_settings/src/was_key_event_handler.js +++ b/wrt/wrt_support/extensions_settings/src/was_key_event_handler.js @@ -3,7 +3,7 @@ if (e.keyCode == 27) { e.preventDefault(); e.stopPropagation(); - var launcher = require('remote').getCurrentWindow(); + var launcher = require('electron').remote.getCurrentWindow(); launcher.close(); } }) @@ -11,8 +11,8 @@ if (e.which == 3) { e.preventDefault(); e.stopPropagation(); - var launcher = require('remote').getCurrentWindow(); + var launcher = require('electron').remote.getCurrentWindow(); launcher.close(); } }) -})() \ No newline at end of file +})() diff --git a/wrt/wrt_support/sample/installer/assets/js/was_key_event_handler.js b/wrt/wrt_support/sample/installer/assets/js/was_key_event_handler.js index 48c127f..47bbf1d 100644 --- a/wrt/wrt_support/sample/installer/assets/js/was_key_event_handler.js +++ b/wrt/wrt_support/sample/installer/assets/js/was_key_event_handler.js @@ -3,7 +3,7 @@ if (e.keyCode == 27) { e.preventDefault(); e.stopPropagation(); - var launcher = require('remote').getCurrentWindow(); + var launcher = require('electron').remote.getCurrentWindow(); launcher.close(); } }) @@ -11,8 +11,8 @@ if (e.which == 3) { e.preventDefault(); e.stopPropagation(); - var launcher = require('remote').getCurrentWindow(); + var launcher = require('electron').remote.getCurrentWindow(); launcher.close(); } }) -})() \ No newline at end of file +})() diff --git a/wrt/wrt_support/sample/launcher/assets/js/launcher.js b/wrt/wrt_support/sample/launcher/assets/js/launcher.js index 1f9cf86..af7961e 100755 --- a/wrt/wrt_support/sample/launcher/assets/js/launcher.js +++ b/wrt/wrt_support/sample/launcher/assets/js/launcher.js @@ -2,9 +2,9 @@ $ = require('./bower_components/jquery/dist/jquery.min.js'); $(function() { var launcher = {}, path = require('path'), - ipc = require('ipc'), - remote = require('remote'), - WAS_EVENT = remote.require('./event_define'), + {ipcRenderer} = require('electron'), + remote = require('electron').remote, + IPC_MESSAGE = remote.require('./ipc_message'), InstallManager = require('../../installer/manager.js'), installManager = new InstallManager(); Backbone.$ = $; @@ -87,7 +87,7 @@ $(function() { e.stopPropagation(); var options = {}; options.packageName = this.model.get('name'); - ipc.send('open', options); + ipcRenderer.send('open', options); } }); launcher.WasMenuView = Backbone.View.extend({ @@ -122,7 +122,7 @@ $(function() { launcher.close(); } // options.packageName = this.model.get('name'); - // ipc.send('open', options); + // ipcRenderer.send('open', options); } }); launcher.WebAppView = Backbone.View.extend({ @@ -198,7 +198,7 @@ $(function() { options.type = this.model.get('type'); options.content = this.model.get('content'); - ipc.send('open', options); + ipcRenderer.send('open', options); } }); launcher.PopOverView = Backbone.View.extend({ @@ -360,8 +360,8 @@ $(function() { // console.log(method + ":" + JSON.stringify(model)); // }; var launcherApp = new launcher.LauncherView(); - ipc.on(WAS_EVENT.LAUNCHER.UPDATE, function() { - console.log(WAS_EVENT.LAUNCHER.UPDATE); + ipcRenderer.on(IPC_MESSAGE.LAUNCHER.UPDATE, function() { + console.log(IPC_MESSAGE.LAUNCHER.UPDATE); launcherApp.webAppListUpdate() }) }); diff --git a/wrt/wrt_support/sample/launcher/assets/js/was_key_event_handler.js b/wrt/wrt_support/sample/launcher/assets/js/was_key_event_handler.js index 83d5d6c..80f45d6 100644 --- a/wrt/wrt_support/sample/launcher/assets/js/was_key_event_handler.js +++ b/wrt/wrt_support/sample/launcher/assets/js/was_key_event_handler.js @@ -3,7 +3,7 @@ if (e.keyCode == 27) { e.preventDefault(); e.stopPropagation(); - var launcher = require('remote').getCurrentWindow(); + var launcher = require('electron').remote.getCurrentWindow(); launcher.close(); } }) @@ -12,8 +12,8 @@ e.preventDefault(); e.stopPropagation(); console.log("F5"); - var launcher = require('remote').getCurrentWindow(); + var launcher = require('electron').remote.getCurrentWindow(); launcher.reload(); } }) -})() \ No newline at end of file +})() -- 2.7.4