Skip to content

Commit 478bad7

Browse files
committed
major refactor, add new sidebar functionality and refreshed styles
1 parent bf0fc06 commit 478bad7

17 files changed

+541
-210
lines changed
Lines changed: 43 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,43 @@
1-
name: Release new version
2-
3-
on:
4-
push:
5-
tags:
6-
- "v*.*.*"
7-
# release:
8-
# types: [published]
9-
10-
jobs:
11-
build-release:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Build
20-
id: web-ext-build
21-
uses: kewisch/action-web-ext@v1
22-
with:
23-
cmd: build
24-
filename: "{name}-{version}.xpi"
25-
ignoreFiles: '[
26-
"package.json",
27-
"package-lock.json",
28-
"yarn.lock",
29-
".github",
30-
".gitattributes",
31-
"LICENSE",
32-
"README.md"]'
33-
34-
- name: Sign
35-
id: web-ext-sign
36-
uses: kewisch/action-web-ext@v1
37-
with:
38-
cmd: sign
39-
channel: listed
40-
source: ${{ steps.web-ext-build.outputs.target }}
41-
apiKey: ${{ secrets.FIREFOX_JWT_ISSUER }}
42-
apiSecret: ${{ secrets.FIREFOX_JWT_SECRET }}
43-
timeout: 900000
44-
45-
- name: Release
46-
uses: softprops/action-gh-release@v2
47-
env:
48-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
with:
50-
files: ${{ steps.web-ext-sign.outputs.target }}
1+
name: Release new version
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
# release:
8+
# types: [published]
9+
10+
jobs:
11+
build-release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Build
20+
id: web-ext-build
21+
uses: kewisch/action-web-ext@v1
22+
with:
23+
cmd: build
24+
filename: '{name}-{version}.xpi'
25+
ignoreFiles: '[ "package.json", "package-lock.json", "yarn.lock", ".github", ".gitattributes", "LICENSE", "README.md"]'
26+
27+
- name: Sign
28+
id: web-ext-sign
29+
uses: kewisch/action-web-ext@v1
30+
with:
31+
cmd: sign
32+
channel: listed
33+
source: ${{ steps.web-ext-build.outputs.target }}
34+
apiKey: ${{ secrets.FIREFOX_JWT_ISSUER }}
35+
apiSecret: ${{ secrets.FIREFOX_JWT_SECRET }}
36+
timeout: 900000
37+
38+
- name: Release
39+
uses: softprops/action-gh-release@v2
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
with:
43+
files: ${{ steps.web-ext-sign.outputs.target }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
node_modules

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock

.prettierrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc.json",
3+
"printWidth": 80,
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"semi": false,
7+
"singleQuote": true,
8+
"quoteProps": "consistent",
9+
"trailingComma": "none",
10+
"bracketSpacing": false,
11+
"bracketSameLine": true,
12+
"arrowParens": "always",
13+
"proseWrap": "never",
14+
"endOfLine": "lf",
15+
"embeddedLanguageFormatting": "auto",
16+
"singleAttributePerLine": false,
17+
"overrides": [
18+
{
19+
"files": ".prettierrc",
20+
"options": {
21+
"parser": "json"
22+
}
23+
}
24+
]
25+
}

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# 📝 New Tab Notes
22

3-
![Mozilla Add-on](https://img.shields.io/amo/v/newtab-notes@semanticdata)
4-
![Add-on rating](https://img.shields.io/amo/rating/newtab-notes@semanticdata)
5-
![Add-on downloads](https://img.shields.io/amo/dw/newtab-notes@semanticdata)
6-
![Add-on users](https://img.shields.io/amo/users/newtab-notes@semanticdata)
7-
![License](https://img.shields.io/github/license/semanticdata/firefox-new-tab-notes)
3+
![Mozilla Add-on](https://img.shields.io/amo/v/newtab-notes@semanticdata) ![Add-on rating](https://img.shields.io/amo/rating/newtab-notes@semanticdata) ![Add-on downloads](https://img.shields.io/amo/dw/newtab-notes@semanticdata) ![Add-on users](https://img.shields.io/amo/users/newtab-notes@semanticdata) ![License](https://img.shields.io/github/license/semanticdata/firefox-new-tab-notes)
84

95
Firefox extension that transforms the New Tab into a minimalist, auto-saving text editor.
106

@@ -20,11 +16,9 @@ Firefox extension that transforms the New Tab into a minimalist, auto-saving tex
2016

2117
## 🖼 Screenshots
2218

23-
![screenshot light theme](screenshot.png)
24-
*Light mode*
19+
![screenshot light theme](screenshot.png) _Light mode_
2520

26-
![screenshot dark theme](screenshot-dark.png)
27-
*Dark mode*
21+
![screenshot dark theme](screenshot-dark.png) _Dark mode_
2822

2923
## TODO
3024

manifest.json

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,33 @@
1919
"newtab": "src/newtab.html"
2020
},
2121
"browser_action": {
22-
"browser_style": true,
2322
"default_title": "New Tab Notes",
24-
"default_popup": "src/newtab.html"
23+
"default_icon": {
24+
"48": "src/icon48.png",
25+
"512": "src/icon512.png"
26+
}
27+
},
28+
"background": {
29+
"scripts": ["src/background.js"]
30+
},
31+
"options_ui": {
32+
"page": "src/options/options.html",
33+
"browser_style": true
34+
},
35+
"sidebar_action": {
36+
"default_icon": {
37+
"48": "src/icon48.png",
38+
"512": "src/icon512.png"
39+
},
40+
"default_title": "Sidebar Notes",
41+
"default_panel": "src/sidebar/panel.html"
42+
},
43+
"commands": {
44+
"_execute_sidebar_action": {
45+
"suggested_key": {
46+
"default": "Alt+Shift+N"
47+
},
48+
"description": "Toggle the Sidebar Notes."
49+
}
2550
}
2651
}

src/background.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const sidebarToggle = '_execute_sidebar_action'
2+
3+
// Update UI and set value of textbox
4+
async function updateUI() {
5+
let commands = await browser.commands.getAll()
6+
for (command of commands) {
7+
if (command.name === sidebarToggle) {
8+
document.querySelector('#shortcut').value = command.shortcut
9+
}
10+
}
11+
}
12+
13+
// Toggles Sidebar with new Action Button
14+
function openSidebar() {
15+
browser.sidebarAction.toggle()
16+
}
17+
18+
browser.browserAction.onClicked.addListener(openSidebar)
19+
20+
document.addEventListener('DOMContentLoaded', updateUI)

src/icon48light.png

989 Bytes
Loading

src/newtab.html

Lines changed: 53 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,59 @@
11
<!DOCTYPE html>
22

33
<html lang="en" data-theme="light">
4-
5-
<head>
6-
<meta charset="UTF-8" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
9-
<title>New Tab Notes</title>
10-
<link rel="icon" type="image/png" sizes="48x48" href="icon48.png">
11-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
12-
<link rel="stylesheet" href="styles.css">
13-
<link rel="preconnect" href="https://fonts.googleapis.com">
14-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
15-
<link
16-
href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Fira+Mono:wght@400;500;700&display=swap"
17-
rel="stylesheet">
18-
<!-- <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600|Source+Code+Pro"> -->
19-
<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bitter:400,700&display=swap" /> -->
20-
<!-- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.5.1/css/all.css"> -->
21-
</head>
22-
23-
<body>
24-
<nav class="navbar container">
25-
<div class="navbar-brand">
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
8+
<title>New Tab Notes</title>
9+
<link rel="icon" type="image/png" sizes="48x48" href="icon48.png" />
10+
<link
11+
rel="stylesheet"
12+
href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css" />
13+
<link rel="stylesheet" href="./styles.css" />
14+
<link rel="preconnect" href="https://fonts.googleapis.com" />
15+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
16+
<link
17+
href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Fira+Mono:wght@400;500;700&display=swap"
18+
rel="stylesheet" />
19+
<!-- <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600|Source+Code+Pro"> -->
20+
<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bitter:400,700&display=swap" /> -->
21+
<!-- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.5.1/css/all.css"> -->
22+
</head>
23+
24+
<body>
25+
<header>
2626
<h1 class="nav-title">📝 New Tab Notes</h1>
27-
</div>
2827

29-
<div class="navbar-end">
30-
<button type="button" data-theme-toggle aria-label="Change to light theme">Change to light theme
28+
<button
29+
type="button"
30+
data-theme-toggle
31+
aria-label="Change to light theme">
32+
Change to light theme
3133
</button>
32-
</div>
33-
</nav>
34-
35-
<main class="container">
36-
<textarea class="textarea" id="notes" rows="" placeholder="Write something..."></textarea>
37-
</main>
38-
39-
<footer class="footer container">
40-
<p>Made with <a class="heart" href="https://github.com/semanticdata/firefox-new-tab-notes"></a> by <a
41-
href="https://github.com/semanticdata">semanticdata</a>.
42-
</p>
43-
</footer>
44-
45-
<script type="text/javascript" src="tabnotes.js"></script>
46-
<script type="text/javascript" src="toggle.js"></script>
47-
</body>
48-
49-
</html>
34+
</header>
35+
36+
<main>
37+
<textarea
38+
class="textarea"
39+
id="notes"
40+
rows=""
41+
placeholder="Write something..."></textarea>
42+
</main>
43+
44+
<footer>
45+
<p>
46+
Made with
47+
<a
48+
class="heart"
49+
href="https://github.com/semanticdata/firefox-new-tab-notes"
50+
></a
51+
>
52+
by <a href="https://github.com/semanticdata">Miguel Pimentel</a>.
53+
</p>
54+
</footer>
55+
56+
<script type="text/javascript" src="tabnotes.js"></script>
57+
<script type="text/javascript" src="toggle.js"></script>
58+
</body>
59+
</html>

src/options/options.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
* {
2+
transition: all 750ms;
3+
text-align: center;
4+
overflow-y: hidden !important;
5+
}
6+
7+
section {
8+
padding-top: 1rem !important;
9+
}
10+
11+
h1 {
12+
line-height: 1.5 !important;
13+
}
14+
15+
p {
16+
padding-top: 4rem;
17+
}
18+
19+
input {
20+
margin: 0.5rem 0;
21+
max-width: 10rem !important;
22+
}
23+
24+
input,
25+
button {
26+
border-radius: 5px !important;
27+
}
28+
29+
.site-author {
30+
color: rebeccapurple;
31+
}
32+
33+
.site-author:hover {
34+
color: red;
35+
}
36+
37+
.fa-heart {
38+
color: rebeccapurple;
39+
}
40+
41+
.fa-heart:hover {
42+
color: red;
43+
}
44+
45+
::selection {
46+
background: rebeccapurple;
47+
color: #ffffff;
48+
}

0 commit comments

Comments
 (0)