Stop using deprecated Electron API

This commit is contained in:
Yuya Ochiai
2015-11-20 18:04:20 +09:00
parent 9d7a8845cb
commit 07f42063e6
4 changed files with 9 additions and 9 deletions

View File

@@ -32,10 +32,10 @@ webView.addEventListener('page-title-set', function(e) {
// Open external link in default browser.
webView.addEventListener('new-window', function(e) {
var currentUrl = url.parse(webView.getUrl());
var destUrl = url.parse(e.url);
var currentURL = url.parse(webView.getURL());
var destURL = url.parse(e.url);
// Open in browserWindow. for exmaple, attached files.
if (currentUrl.host === destUrl.host) {
if (currentURL.host === destURL.host) {
window.open(e.url, 'Mattermost');
}
else {

View File

@@ -4,7 +4,7 @@ var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
var Menu = require('menu');
var Tray = require('tray');
var ipc = require('ipc');
var ipc = require('ipcMain');
var appMenu = require('./menus/app');
var client = null;
@@ -56,10 +56,10 @@ app.on('ready', function() {
trayIcon.setToolTip(app.getName());
var tray_menu = require('./menus/tray').createDefault();
trayIcon.setContextMenu(tray_menu);
trayIcon.on('clicked', function() {
trayIcon.on('click', function() {
mainWindow.focus();
});
trayIcon.on('balloon-clicked', function() {
trayIcon.on('balloon-click', function() {
mainWindow.focus();
});
ipc.on('notified', function(event, arg) {
@@ -79,7 +79,7 @@ app.on('ready', function() {
});
// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.loadURL('file://' + __dirname + '/index.html');
// Open the DevTools.
// mainWindow.openDevTools();

View File

@@ -14,7 +14,7 @@ var createTemplate = function(mainWindow) {
}, {
label: 'Settings',
click: function(item, focusedWindow) {
mainWindow.loadUrl('file://' + __dirname + '/../settings.html');
mainWindow.loadURL('file://' + __dirname + '/../settings.html');
}
}, {
label: 'Quit',

View File

@@ -1,6 +1,6 @@
'use strict';
var ipc = require('ipc');
var ipc = require('ipcRenderer');
ipc.on('retrieveUnreadCount', function() {
var unreadCount = document.getElementsByClassName('unread-title').length;