implement Demo App sections: Dialogs, Menu, Tray, Shell, CrashHang, Notification, Shortcuts etc. Fix some API bugs and implement GlobalShortcut-, Shell- and WebContents-API.

This commit is contained in:
Gregor Biswanger
2017-10-21 04:37:01 +02:00
parent 9046f6ca25
commit 248ddde82b
61 changed files with 2505 additions and 57 deletions

View File

@@ -0,0 +1,44 @@
"use strict";
exports.__esModule = true;
var electron_1 = require("electron");
module.exports = function (socket) {
socket.on('shell-showItemInFolder', function (fullPath) {
var success = electron_1.shell.showItemInFolder(fullPath);
socket.emit('shell-showItemInFolderCompleted', success);
});
socket.on('shell-openItem', function (fullPath) {
var success = electron_1.shell.openItem(fullPath);
socket.emit('shell-openItemCompleted', success);
});
socket.on('shell-openExternal', function (url, options, callback) {
var success = false;
if (options && callback) {
success = electron_1.shell.openExternal(url, options, function (error) {
socket.emit('shell-openExternalCallback', [url, error]);
});
}
else if (options) {
success = electron_1.shell.openExternal(url, options);
}
else {
success = electron_1.shell.openExternal(url);
}
socket.emit('shell-openExternalCompleted', success);
});
socket.on('shell-moveItemToTrash', function (fullPath) {
var success = electron_1.shell.moveItemToTrash(fullPath);
socket.emit('shell-moveItemToTrashCompleted', success);
});
socket.on('shell-beep', function () {
electron_1.shell.beep();
});
socket.on('shell-writeShortcutLink', function (shortcutPath, operation, options) {
var success = electron_1.shell.writeShortcutLink(shortcutPath, operation, options);
socket.emit('shell-writeShortcutLinkCompleted', success);
});
socket.on('shell-readShortcutLink', function (shortcutPath) {
var shortcutDetails = electron_1.shell.readShortcutLink(shortcutPath);
socket.emit('shell-readShortcutLinkCompleted', shortcutDetails);
});
};
//# sourceMappingURL=shell.js.map