Skip to content

Commit

Permalink
master:Updated icons and fixed paste stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
DKunin committed Apr 25, 2017
1 parent 5648a80 commit f6b3c45
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 5 deletions.
Binary file modified assets/images/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/icon-128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/icon-16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/icon.icns
Binary file not shown.
Binary file modified assets/images/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/screen-0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/screen-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/screen-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "menubar-helper",
"version": "1.0.1",
"version": "1.1.0",
"description": "Simple menubar app to help open files in editor",
"author": "Dmitri Kunin",
"license": "MIT",
Expand Down
27 changes: 24 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,43 @@
<button class="close-btn" type="button">Close</button>
</form>
<script>
const remote = require('electron').remote;
const electron = require('electron');
const remote = electron.remote;
const { clipboard } = electron;
const { Menu, MenuItem } = remote;

window.addEventListener('contextmenu', (e) => {
e.preventDefault();
menu.popup(remote.getCurrentWindow());
}, false);
const port = document.querySelector('.port');
const editorPath = document.querySelector('.editorPath');
const closeBtn = document.querySelector('.close-btn');
const config = remote.getGlobal('config');
const restartServer = remote.getGlobal('restartServer');

function onSubmit(event) {
event.preventDefault();
event ? event.preventDefault() : null;
config.set({
port: port.value,
editorPath: escape(editorPath.value)
});
restartServer(true);
event ? restartServer(true) : null;
}

const menu = new Menu();
menu.append(new MenuItem({label: 'paste', click() {
editorPath.value = clipboard.readText();
onSubmit();
}}));

document.addEventListener('keydown', (event) => {
if (event.key === 'v' && event.metaKey) {
editorPath.value = clipboard.readText();
onSubmit();
}
});

port.value = config.get('port');
editorPath.value = config.get('editorPath');
closeBtn.addEventListener('click', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ app.on('ready', function() {
show: false,
width: 350,
height: 180,
closable: true,
closable: false,
minimizable: false,
resizable: true,
vibrancy: 'dark',
Expand Down

0 comments on commit f6b3c45

Please sign in to comment.