diff --git a/README.md b/README.md index 0ac5bce..914e762 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/alarm.png b/alarm.png new file mode 100644 index 0000000..28d9313 Binary files /dev/null and b/alarm.png differ diff --git a/background.html b/background.html new file mode 100644 index 0000000..937033b --- /dev/null +++ b/background.html @@ -0,0 +1,6 @@ + + + + + diff --git a/background.js b/background.js new file mode 100644 index 0000000..734566a --- /dev/null +++ b/background.js @@ -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... +});*/ diff --git a/desk.PNG b/desk.PNG new file mode 100644 index 0000000..deea5ab Binary files /dev/null and b/desk.PNG differ diff --git a/fav.png b/fav.png new file mode 100644 index 0000000..b5b63f2 Binary files /dev/null and b/fav.png differ diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..d0ab75d Binary files /dev/null and b/icon.png differ diff --git a/manifest.json b/manifest.json index d850133..fb55c9a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,32 @@ { - "manifest_version": 2, + "manifest_version": 6, + "name": "Read Later", - "version": "0.1" -} \ No newline at end of file + "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" + ] +} diff --git a/popup.html b/popup.html new file mode 100644 index 0000000..f51fc01 --- /dev/null +++ b/popup.html @@ -0,0 +1,32 @@ + + + + + + + +
+ +
+ +
+
Please enter the date for the reminder:

+ +
+
+

Please enter the time for the reminder:

+ +
+
+

Comments:

+ + + +
+ + + \ No newline at end of file diff --git a/popup.js b/popup.js new file mode 100644 index 0000000..2f9f9c3 --- /dev/null +++ b/popup.js @@ -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); +}*/ + + + + + + + + + + + + + + + diff --git a/settings.html b/settings.html new file mode 100644 index 0000000..1df4d7d --- /dev/null +++ b/settings.html @@ -0,0 +1,27 @@ + + + + ReadLater + + + + + + + + + + + + + + + + + + + + + + + diff --git a/settings.js b/settings.js new file mode 100644 index 0000000..804f2aa --- /dev/null +++ b/settings.js @@ -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); + } +}; \ No newline at end of file diff --git a/settings.png b/settings.png new file mode 100644 index 0000000..30f1ede Binary files /dev/null and b/settings.png differ diff --git a/test.html b/test.html new file mode 100644 index 0000000..937033b --- /dev/null +++ b/test.html @@ -0,0 +1,6 @@ + + + + +