-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix open url, add delete buttons to recent list items and fix help se…
…ction links
- Loading branch information
1 parent
7ceff72
commit e980bab
Showing
16 changed files
with
177 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
|
||
# Electron Todo | ||
# Europa - Feature rich wrapper around Jupyter Lab | ||
|
||
A simple todo app made with Electron. | ||
|
||
[See the tutorial here](https://medium.com/@codedraken) | ||
|
||
If something doesn't work in the future check the [Electron Breaking Changes page](https://github.com/electron/electron/blob/master/docs/api/breaking-changes.md). | ||
## Screenshot | ||
![Screenshot of Europa's welcome page](github-assets/img/welcomescreen.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,15 @@ | |
<head> | ||
<meta charset="UTF-8"> | ||
<title>Jupytron</title> | ||
<!-- <link rel="stylesheet" href="../node_modules/spectre.css/dist/spectre.min.css"> --> | ||
<link rel="stylesheet" href="style.css"> | ||
<!-- <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/bootstrap-material-design.min.css" integrity="sha384-wXznGJNEXNG1NFsbm0ugrLFMQPWswR3lds2VeinahP8N0zJw9VWSopbjv2x7WCvX" crossorigin="anonymous"> --> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="jumbotron vertical-center"> | ||
<div class="container"> | ||
<h1>Jupytron</h1> | ||
<h3>Editing evolved</h3> | ||
<h1>Europa</h1> | ||
<h3>Jupyter Lab's Moon</h3> | ||
|
||
<div class="main-section"> | ||
<h4 class="section-header">Start</h4> | ||
|
@@ -34,11 +32,11 @@ <h4 class="section-header">Recent</h4> | |
<div class="main-section"> | ||
<h4 class="section-header">Help</h4> | ||
<ul class="compact-list"> | ||
<li class="compact-list-item"><a href="#">Keyboard shortcuts</a></li> | ||
<li class="compact-list-item"><a href="#">Tips and tricks</a></li> | ||
<li class="compact-list-item"><a href="#">Product documentation</a></li> | ||
<li class="compact-list-item"><a href="#">Report an issue</a></li> | ||
<li class="compact-list-item"><a href="#">GitHub repository</a></li> | ||
<li class="compact-list-item"><a href="#" id="helpKeyboardShortcuts">Keyboard shortcuts</a></li> | ||
<li class="compact-list-item"><a href="#" id="helpTipsAndTricks">Tips and tricks</a></li> | ||
<li class="compact-list-item"><a href="#" id="helpProductDocumentation">Product documentation</a></li> | ||
<li class="compact-list-item"><a href="#" id="helpReportIssue">Report an issue</a></li> | ||
<li class="compact-list-item"><a href="#" id="helpGitHubRepo">GitHub repository</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
'use strict' | ||
|
||
const { ipcRenderer, shell } = require('electron') | ||
|
||
// delete todo by its text value ( used below in event listener) | ||
const recentItemClicked = (e) => { | ||
console.log(e.target.textContent); | ||
// ipcRenderer.send('delete-todo', e.target.textContent) | ||
ipcRenderer.send('open-url', e.target.textContent); | ||
} | ||
const deleteRecentItemClicked = (e) => { | ||
console.log(e.target.getAttribute('id')); | ||
ipcRenderer.send('delete-todo', e.target.getAttribute('id')) | ||
} | ||
|
||
document.getElementById('openUrlBtn').addEventListener('click', () => { | ||
ipcRenderer.send('open-url-window') | ||
}) | ||
document.getElementById('newServerBtn').addEventListener('click', () => { | ||
ipcRenderer.send('new-server-window') | ||
}) | ||
|
||
// Listeners for help links | ||
document.getElementById('helpReportIssue').addEventListener('click', () => { | ||
shell.openExternal('https://github.com/suyashmahar/jupytron/issues') | ||
}) | ||
document.getElementById('helpGitHubRepo').addEventListener('click', () => { | ||
shell.openExternal('https://github.com/suyashmahar/jupytron') | ||
}) | ||
document.getElementById('helpProductDocumentation').addEventListener('click', () => { | ||
shell.openExternal('https://github.com/suyashmahar/jupytron/wiki') | ||
}) | ||
document.getElementById('helpTipsAndTricks').addEventListener('click', () => { | ||
shell.openExternal('https://github.com/suyashmahar/jupytron/wiki/TipsAndTricks') | ||
}) | ||
document.getElementById('helpKeyboardShortcuts').addEventListener('click', () => { | ||
shell.openExternal('https://github.com/suyashmahar/jupytron/wiki/KeyboardShortcuts') | ||
}) | ||
|
||
|
||
https://github.com/suyashmahar/jupytron/wiki | ||
|
||
// on receive todos | ||
ipcRenderer.on('todos', (event, todos) => { | ||
// get the todoList ul | ||
const todoList = document.getElementById('todoList') | ||
|
||
// create html string | ||
const todoItems = todos.reduce((html, todo) => { | ||
var itemDeleteBtnHtml = `<a id="${todo}" href="javascript:void" class="inline-btn-link-delete">✕</a>` | ||
html += `<li class="recent-item"><a class="recent-item-link" href="javascript:void" id="${todo}">${todo}</a>${itemDeleteBtnHtml}</li>` | ||
|
||
return html | ||
}, '') | ||
|
||
// set list html to the todo items | ||
todoList.innerHTML = todoItems | ||
|
||
// Add click handlers to the link | ||
todoList.querySelectorAll('.recent-item-link').forEach(item => { | ||
item.addEventListener('click', recentItemClicked) | ||
}) | ||
|
||
// Add click handlers to the delete button | ||
todoList.querySelectorAll('.inline-btn-link-delete').forEach(item => { | ||
item.addEventListener('click', deleteRecentItemClicked) | ||
}) | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters