Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
# read-later
# Read-Later

[![Join the chat at https://gitter.im/kshitij10496/Read-Later](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kshitij10496/Read-Later?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A Chrome Extension to bookmark a page and, more importantly, read it later

**What** : A productivity Chrome extension to bookmark a page and, more importantly, to "Read Later".

**Why**
Too busy to read an article/blog now ?
Are you too lazy to read your bookmarks ?

This is an extension that might work for you.

Refer the Wiki to know more !

##Installation

Since, this project is under heavy development, it has not yet been published.
In order to try this out you will need to either `clone` it or zip it.

**Using `git clone`**
Open your Terminal and type
`git clone https://github.com/kshitij10496/Read-Later.git`

**Download as zip**
Download the repo as a zip.
Unzip it.

##Contributing

Fork the project.
Clone it.
Work on a new feature or fix a bug on a **separate** branch.
Send your Pull Request.
Binary file added alarm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions background.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html>
<head>
<script src="background.js">
</script>
</head>
</html>
46 changes: 46 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*function printBookmarks(id) {
chrome.bookmarks.getChildren(id, function(children) {
children.forEach(function(bookmark) {

chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) {
if(tabs[0].url === bookmark.url )
{
console.log("Chirag");
}
});
printBookmarks(bookmark.id);
});
});
}

printBookmarks('0');
*/
var options = {
type: "basic",
title: "Read-Later",
message: "You are scheduled to read an article",
iconUrl: "icon.png",

buttons: [{
title: "Open Bookmark"
}],
//imageUrl: "icon.png"
};
chrome.alarms.onAlarm.addListener(function(e){
if(e.name== "notification_delay")
{
chrome.notifications.create(options);
chrome.notifications.onButtonClicked.addListener(function(){
window.open("https://www.facebook.com/"); //needs to be replaced by url of site...
});



}

});

/*chrome.notifications.create(options);
chrome.notifications.onButtonClicked.addListener(function(){
window.open("https://www.facebook.com/"); //needs to be replaced by url of site...
});*/
Binary file added desk.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fav.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 30 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
{
"manifest_version": 2,
"manifest_version": 6,

"name": "Read Later",
"version": "0.1"
}
"description": "This extension notifies you to view a page later",
"version": "0.1",
"icons": {
"16": "icon.png",
"48": "icon.png",
"128": "icon.png"
},

"browser_action": {
"default_title": "ReadLater",
"default_icon": "icon.png",
"default_popup": "popup.html"
},

"background": {
"scripts": ["background.js"],
"persistent": false
},

"permissions": [
"bookmarks",
"activeTab",
"alarms",
"tabs",
"notifications",
"storage"
]
}
32 changes: 32 additions & 0 deletions popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@


<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
<a href = "settings.html" target="_blank" ><img src="settings.png" width="30" height="30" ></a>
<hr/>
<input type="text" id="title" size="15" maxlength="25" name="title">
<br/>
<hr/
<p>Please enter the date for the reminder:</p>
<input type="date" id="date" />
<br/>
<hr/>
<p>Please enter the time for the reminder:</p>
<input type="time" id="time" />
<br/>
<hr/>
<p>Comments:</p>
<textarea cols="20" rows="5" placeholder="Add your Comments"></textarea>
<button id="submit"><img src="alarm.png" width="50" height="50" >SUMBIT
</button>

</form>
<script src="popup.js">

</script>
</body>
</html>
75 changes: 75 additions & 0 deletions popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*document.getElementById("submit").addEventListener("keyup", function(event) {
event.preventDefault();
if (event.keyCode == 13) {
document.getElementById("submit").click();
}
});

*/
var count=0;
var storage = chrome.storage.sync;
var sumbit = document.getElementById("submit");

submit.addEventListener("click", function(){
chrome.tabs.getSelected(null, function(tab){
var date = document.getElementById("date").value;
var time = document.getElementById("time").value;
var title = document.getElementById("title").value;
var url = tab.url;
var newlink;
var i =0;
/*for (i=0;i<5;i++)
{
newlink = {"count":i, "url": url ,"title":title,"time":time,"date":date};
localStorage.setItem(i, JSON.stringify(newlink));
}*/
var dl = date.split("-");
var tl = time.split(":");
var g = new Date();
var f = new Date();
var currentTimeZoneOffsetInHours = f.getTimezoneOffset()*60000;

g = Date.UTC(+dl[0], dl[1]-1, +dl[2], +tl[0], +tl[1], +0, +0);
//alert(Date(f.getTime()));
var lapse = (g - Date.now() + currentTimeZoneOffsetInHours);
chrome.alarms.create("notification_delay",{
"when": Date.now() + lapse

})
alert("Success");

});
});


window.onload = function(){
chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) {
document.getElementById("title").value = (tabs[0].title);
});
/*var date = new Date();
dateFormat(date, "mm, dd, yyyy, hh:MM ");
document.getElementById("time").value = date.setTime(date.getTime());
document.getElementById("date").value = date.setDate(date.getDate() + 1);
*/

};

/*function myFunction(url,title) {
chrome.bookmarks.create({url: url, title: title});
console.log(url);
}*/















27 changes: 27 additions & 0 deletions settings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html>
<head>
<title>ReadLater</title>

</head>
<body>
<table id="links">
<thead>
<tr>
<th></th>
<th>Title</th>

<th>URL</th>
<th>Date</th>
<th>Time</th>
</tr>

</thead>
<tbody>

</tbody>

</table>
<script src="settings.js"></script>
</body>
</html>
30 changes: 30 additions & 0 deletions settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

window.onload = function(){
var newlink;
var i;
var table = document.getElementById("links");
var tr = document.createElement('tr');
for (i=0;i<5;i++)
{
var newlink = JSON.parse(localStorage.getItem(i));
var title = newlink.title;
var url = newlink.url;
var date = newlink.date;
var time = newlink.time;
tr = document.createElement('tr');
tr.appendChild(document.createElement('td'));
tr.appendChild(document.createElement('td'));
tr.appendChild(document.createElement('td'));
tr.appendChild(document.createElement('td'));
tr.appendChild(document.createElement('td'));
var checkbox = document.createElement("INPUT");
checkbox.type = "checkbox";
tr.cells[0].appendChild(checkbox);
tr.cells[1].appendChild(document.createTextNode(title));
tr.cells[2].appendChild(document.createTextNode(url));
tr.cells[3].appendChild(document.createTextNode(date));
tr.cells[4].appendChild( document.createTextNode(time));

table.appendChild(tr);
}
};
Binary file added settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html>
<head>
<script src="background.js">
</script>
</head>
</html>