Skip to content

Commit

Permalink
Merge pull request #27 from avwo/dev
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
avwo committed Mar 10, 2024
2 parents 27ae962 + 4f66795 commit c3311f0
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 12 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# v1.1.0
1. feat: 修改 Dock 及托盘图标,感谢 @22dm 建议及素材:https://github.com/avwo/whistle-client/issues/26
2. feat: update whistle@2.9.66

# v1.0.9
1. feat: update whistle@2.9.65

# v1.0.8
1. feat: update whistle@2.9.64

# v1.0.7
1. feat: update whistle@2.9.63

# v1.0.6
1. feat: update whistle@2.9.61

# v1.0.5
# v1.0.4
1. feat: update whistle
1. feat: update whistle@2.9.60

# v1.0.3
1. feat: 更新 Whistle 版本 [v2.9.59](https://github.com/avwo/whistle/blob/master/CHANGELOG.md#v2959)
2. feat: 更新 electron 版本
Expand Down
5 changes: 2 additions & 3 deletions lib/dialog.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const path = require('path');
const { dialog, nativeImage, app } = require('electron');
const { getWin } = require('./context');
const { getErrorMsg } = require('./util');
const { getErrorMsg, ICON } = require('./util');

const isFunction = (fn) => typeof fn === 'function';

Expand Down Expand Up @@ -38,7 +37,7 @@ exports.showMessageBox = async (message, callback, showSettings, handleCancel) =
noLink: true,
textWidth: 320,
defaultId: 0,
icon: nativeImage.createFromPath(path.join(__dirname, '../public/whistle.png')),
icon: nativeImage.createFromPath(ICON),
buttons,
});
if (!response) {
Expand Down
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {
} = require('electron');
const { writeLogSync } = require('whistle/lib/util/common');
const {
noop, ICON, showWin, getErrorStack, getErrorMsg, isMac,
noop, DOCK_ICON, showWin, getErrorStack, getErrorMsg, isMac,
} = require('./util');
const ctx = require('./context');
const { showMessageBox } = require('./dialog');
Expand Down Expand Up @@ -90,7 +90,7 @@ const updateDock = () => {

(() => {
if (isMac) {
app.dock.setIcon(ICON);
app.dock.setIcon(DOCK_ICON);
systemPreferences.setUserDefault('NSDisabledDictationMenuItem', 'boolean', true);
systemPreferences.setUserDefault('NSDisabledCharacterPaletteMenuItem', 'boolean', true);
}
Expand Down
6 changes: 4 additions & 2 deletions lib/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const {
} = require('./proxy');
const { showMessageBox } = require('./dialog');
const {
getJson, getString, requireW2, LOCALHOST,
getJson, getString, requireW2, LOCALHOST, ICON, TRAY_ICON,
} = require('./util');
const { getOptions, sendMsg, getWin } = require('./context');
const { showWindow, restart } = require('./window');
Expand Down Expand Up @@ -254,7 +254,9 @@ module.exports = async () => {
},
];
Menu.setApplicationMenu(Menu.buildFromTemplate(menus));
tray = new Tray(getIcon(path.join(__dirname, '../public/whistle.png')));
const trayIcon = getIcon(TRAY_ICON);
trayIcon.setTemplateImage(true);
tray = new Tray(trayIcon);
tray.on('click', showWindow);
tray.setContextMenu(Menu.buildFromTemplate(trayMenus));
let autoSet = isAutoSetProxy();
Expand Down
5 changes: 3 additions & 2 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const noop = () => {};
const USERNAME = config.name;
const PROC_PATH = path.join(homedir(), '.whistle_client.pid');
const SCRIPT = path.join(__dirname, 'whistle.js');
const ICON = path.join(__dirname, '../public/whistle.png');
const HTTPS_RE = /^https:\/\//;
const LOCALHOST = '127.0.0.1';
const isMac = process.platform === 'darwin';
Expand All @@ -24,12 +23,14 @@ exports.VERSION = config.version;
exports.BASE_DIR = path.join(WHISTLE_PATH, '.whistle_client');
exports.CLIENT_PLUGINS_PATH = path.join(WHISTLE_PATH, '.whistle_client_plugins');
exports.CUSTOM_PLUGINS_PATH = path.join(WHISTLE_PATH, 'custom_plugins');
exports.ICON = path.join(__dirname, '../public/whistle.png');
exports.DOCK_ICON = path.join(__dirname, '../public/dock.png');
exports.TRAY_ICON = path.join(__dirname, '../public/tray.png');
exports.noop = noop;
exports.USERNAME = USERNAME;
exports.requireW2 = requireW2;
exports.PROC_PATH = PROC_PATH;
exports.SCRIPT = SCRIPT;
exports.ICON = ICON;

const existsFile = (file) => new Promise((resolve) => {
fs.stat(file, (err, stat) => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Whistle",
"version": "1.0.9",
"version": "1.1.0",
"description": "Whistle Web Debugging Proxy",
"main": "./lib/index.js",
"author": "avenwu <avwu@qq.com>",
Expand Down Expand Up @@ -73,7 +73,7 @@
"fs-extra": "^11.1.1",
"npminstall": "^7.9.0",
"sudo-prompt": "^9.2.1",
"whistle": "^2.9.65",
"whistle": "^2.9.66",
"whistle.proxyauth": "^1.1.1"
}
}
Binary file added public/dock.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tray.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tray@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c3311f0

Please sign in to comment.