Skip to content

Commit

Permalink
Add My Notes
Browse files Browse the repository at this point in the history
  • Loading branch information
penge committed Nov 17, 2019
0 parents commit 508f211
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Pavel Bucka

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# My Notes

**Chrome Extension** that turns your **"New Tab"** into **a note taking tool.**

- Great for Notes, Todos, and sharing text (Copy/Paste)

- It works immediately after you open a **"New Tab"**

- Every edit and paste is saved (and waiting for you once you come back)

- And! It is Synchronized across every Chrome window you have open


## Install

1. Click on **"Clone or download"** and then **"Download ZIP"**
2. Extract the downloaded **ZIP**
3. In Chrome, go to **Extensions** from the menu or visit [chrome://extensions](chrome://extensions) from a new tab
4. In Chrome Extensions, click the **"Load unpacked"** button
5. Navigate to the plugin folder (from the second step) and click the **"Open"** button
10 changes: 10 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"manifest_version": 2,
"name": "My Notes",
"description": "Chrome Extension that turns your \"New Tab\" into a note taking tool.",
"version": "1.0",
"permissions": ["storage"],
"chrome_url_overrides" : {
"newtab": "newtab.html"
}
}
14 changes: 14 additions & 0 deletions newtab.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>

<head>
<title>My Notes</title>
<link rel="stylesheet" href="notes.css">
</head>

<body>
<textarea id="textarea" placeholder="Type your notes here."></textarea>
<script src="notes.js"></script>
</body>

</html>
17 changes: 17 additions & 0 deletions notes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
body {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
}

#textarea {
width: 100%;
height: 100%;
font-size: 200%;
border: 0;
outline: none;
resize: none;
box-sizing: border-box;
}
16 changes: 16 additions & 0 deletions notes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* global chrome */

var initialized = false;
var textarea = document.getElementById("textarea");

chrome.storage.sync.get(["newtab"], function (result) {
textarea.value = result.newtab || '';
initialized = true;
});

textarea.addEventListener("input", function () {
if (!initialized) {
return;
}
chrome.storage.sync.set({ newtab: textarea.value });
});

0 comments on commit 508f211

Please sign in to comment.