Skip to content

Commit 1d833af

Browse files
GeslainGeslain Dahan
andauthored
Add local support and add rollup (#4)
* feat: Change implementation to add locales Also - Replace server implementation to add a rollup configuration to embed all code and avoid API calls * feat: update gitignore file to ignore rollup's build files * feat: Add package.json and package-lock.json Also - update .gitignore for IDE file * feat: update .gitignore for options js file * feat: Add option page for handling locales * feat: update watch and build scripts for options file * feat: update current scripts with new locales configuration * feat: remove irrelevant options from lang select * feat: Update readme page * feat: replace npm by yarn lock file * feat: bump version and update author, description and license * fix: remove console.log irrelevant instruction * fix: apply changes after pull request review * fix: update `yarn build` script --------- Co-authored-by: Geslain Dahan <geslain.dahan@spaceable.org>
1 parent 18ce3c4 commit 1d833af

21 files changed

+527
-509
lines changed

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*.crx
22

3+
# IDE
4+
.idea
5+
36
# Logs
47
logs
58
*.log
@@ -104,7 +107,6 @@ dist
104107

105108
# vuepress v2.x temp and cache directory
106109
.temp
107-
.cache
108110

109111
# Docusaurus cache and generated files
110112
.docusaurus
@@ -130,3 +132,8 @@ dist
130132
.yarn/build-state.yml
131133
.yarn/install-state.gz
132134
.pnp.*
135+
136+
chrome-extension/background.js
137+
chrome-extension/popup.js
138+
chrome-extension/options.js
139+

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@ Quick Add was a Google Calendar feature that enabled creating calendar events fr
1414

1515
Events can be created by either highlighting date information and selecting the extension in the context menu or by clicking the extension icon and entering event info into the text field.
1616

17+
## Language
18+
19+
User can choose the language in which they would like to parse the input text in extension options page.
20+
21+
Currently supported languages are:
22+
* English
23+
* French
24+
* Dutch
25+
* Japanese
26+
* Russian
27+
* Portuguese
28+
* Ukrainian
29+
* Chinese
30+
* German
31+
* Spanish
32+
33+
Supported languages depends on the [chrono-node](https://github.com/wanasit/chrono) node module locales.
34+
1735
## Usage
1836

1937
### Chrome Extension
@@ -23,18 +41,22 @@ Install the Chrome extension from [Chrome Web Store][webstore].
2341
Alternatively, I have a running implementation [on my website][max]. This is useful when you're on a device without Chrome extensions, like a phone.
2442

2543
#### Local
26-
If you want to run the webapp locally:
44+
If you want to develop locally:
2745

2846
```
2947
yarn install
30-
yarn start
3148
```
3249

50+
This app uses rollup transpiling to use the Javascript modules pattern.
51+
Then you can you the following commands for transpile scripts into `chrome-extension` directory:
52+
* `yarn build`: transpile all scripts into `chrome-extension` directory
53+
* `yarn watch`: transpile all scripts into `chrome-extension` directory and continuously watches on changes to re-transpile
54+
3355
## Documentation
3456

3557
The "API" this app is using is documented [here][docs].
3658

37-
# Author
59+
## Author
3860

3961
Max Timkovich
4062

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{
22
"name": "Rip Quick Add",
33
"description": "Quickly create Google calendar events from natural language.",
4-
"version": "1.2",
4+
"version": "1.3",
55
"manifest_version": 3,
66
"permissions": [
7-
"contextMenus"
8-
],
9-
"host_permissions": [
10-
"https://timkovi.ch/*"
7+
"contextMenus",
8+
"storage"
119
],
1210
"background": {
1311
"service_worker": "background.js"
1412
},
13+
"options_ui": {
14+
"page": "options.html",
15+
"open_in_tab": false
16+
},
1517
"icons": {
1618
"16": "images/icon_16.png",
1719
"32": "images/icon_32.png",

chrome-extension/options.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en-EN">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>RIP Quick Add Options</title>
6+
</head>
7+
<body>
8+
<label for="lang">Language</label>
9+
<select id="lang">
10+
</select>
11+
12+
<div id="status"></div>
13+
<button id="save">Save</button>
14+
15+
<script src="options.js"></script>
16+
</body>
17+
</html>

chrome-extension/popup.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en-EN">
3+
<head>
4+
<meta charset="utf-8">
5+
</head>
6+
<body>
7+
<textarea id="input" rows="6" cols="30" placeholder="E.g. dinner friday 7pm"></textarea>
8+
<br>
9+
<button type="button" id="add">Add</button>
10+
<div id="error" style="color: red"></div>
11+
<a href="#" id="go-to-options">Go to options</a>
12+
<script src="popup.js"></script>
13+
</body>
14+
</html>

chrome/background.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)