Update nwjs API for later version (#1246)

This commit is contained in:
whales 2019-03-10 01:57:44 +10:30 committed by Guangcong Luo
parent d843455588
commit 6a38e809bc
3 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
"version": "0.3.0",
"main": "index.html",
"node-remote": "play.pokemonshowdown.com",
"node-remote": "*://play.pokemonshowdown.com/*",
"no-edit-menu": false,
"window": {
"icon": "icons/icon_32x32.png",

View File

@ -147,7 +147,7 @@
sideBuf += this.renderRoomTab(room);
}
if (window.nodewebkit) {
if (nwWindow.setBadgeLabel) nwWindow.setBadgeLabel(notificationCount || '');
if (nwWindow.setBadgeLabel) nwWindow.setBadgeLabel('' + notificationCount || '');
} else {
var $favicon = $('#dynamic-favicon');
if (!!$favicon.data('on') !== !!notificationCount) {

View File

@ -1594,7 +1594,7 @@ Storage.nwSaveTeam = function (team) {
this.nwDeleteTeam(team);
}
team.filename = filename;
fs.writeFile(this.dir + 'Teams/' + filename, Storage.exportTeam(team.team).replace(/\n/g, '\r\n'));
fs.writeFile(this.dir + 'Teams/' + filename, Storage.exportTeam(team.team).replace(/\n/g, '\r\n'), function () {});
};
Storage.nwSaveTeams = function () {
@ -1630,7 +1630,7 @@ Storage.nwDoSaveAllTeams = function () {
filename = $.trim(filename).replace(/[\\\/]+/g, '');
team.filename = filename;
fs.writeFile(this.dir + 'Teams/' + filename, Storage.exportTeam(team.team).replace(/\n/g, '\r\n'));
fs.writeFile(this.dir + 'Teams/' + filename, Storage.exportTeam(team.team).replace(/\n/g, '\r\n'), function () {});
}
};