Skip to content

Commit

Permalink
Minor improvements & bug fixes
Browse files Browse the repository at this point in the history
What's new?

* Fixed nepali miti not updating along with new date
* Added more sections in README file
* Gazed over stars thinking about life
  • Loading branch information
sarojbelbase committed May 16, 2020
1 parent d3e1b36 commit dd0fc66
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 86 deletions.
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<p align="center">
<img src="img/logo.svg" width="40%"><br>
<span>
A firefox extension to show distraction free nepali date for your new tab.
A firefox/chrome extension to show distraction free nepali date on your new tab.
</span><br>
</p>

[![HitCount](http://hits.dwyl.com/sidbelbase/undistracted-me.svg)](http://hits.dwyl.com/sidbelbase/undistracted-me)
![GitHub repo size](https://img.shields.io/github/repo-size/sidbelbase/undistracted-me?style=flat-square)
![Mozilla Add-on](https://img.shields.io/amo/users/{1071d037-0f17-4c92-b06c-704050d2e2c3}?style=flat-square)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/sidbelbase/undistracted-me?style=flat-square)
![Mozilla Add-on](https://img.shields.io/amo/rating/{1071d037-0f17-4c92-b06c-704050d2e2c3}?style=flat-square)
[![Visitors](http://hits.dwyl.com/sidbelbase/undistracted-me.svg)](http://hits.dwyl.com/sidbelbase/undistracted-me)
![GitHub Repository Size](https://img.shields.io/github/repo-size/sidbelbase/undistracted-me?style=flat-square)
![Mozilla Add-on Users](https://img.shields.io/amo/users/{1071d037-0f17-4c92-b06c-704050d2e2c3}?style=flat-square)
![GitHub Release](https://img.shields.io/github/v/release/sidbelbase/undistracted-me?style=flat-square)
![Mozilla Add-on Ratings](https://img.shields.io/amo/rating/{1071d037-0f17-4c92-b06c-704050d2e2c3}?style=flat-square)

<img src="img/hero.png" width="100%" height="auto">

Expand All @@ -23,7 +23,9 @@ A firefox extension to show distraction free nepali date for your new tab.

## Chrome Installation:

##### Due to lack of payment gateway, the chrome extension isn't available yet. Though it can be installed indirectly with few steps as guided below.
[Review Pending...](https://sidbelbase.me)

## Offline Installation:

1. First **Clone or Download** this repository.
2. After successfull download, unzip it with your archive manager.
Expand All @@ -35,7 +37,13 @@ If everything goes right, you could see undistracted me working seamlessly on yo

## TODOS:

01. [x] Publish on Firefox
02. [ ] Publish on Chrome
03. [ ] Add Todos Functionality
04. [ ] Integrate Weather Functionality
1. [x] Publish on Firefox
2. [ ] Publish on Chrome
3. [ ] Add Todos Functionality
4. [ ] Integrate Weather Functionality

## FEATURES REQUESTS

1. [ ] Speed Dials like in r/startpages by u/nepmandu
2. [ ] Dewanagiri support by u/pranphy
3. [ ] Toggle between 12/24 hours by u/deeplydark
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script src="lib/js/bootstrap.bundle.min.js?v=1.0.0"></script>
<script src="lib/js/moment.min.js?v=1.0.0"></script>
<script src="lib/js/moment-timezone-with-data.js?v=1.0.0"></script>
<script async src="lib/js/nepali.js?v=1.0.0"></script>
<script async src="lib/js/nepali.js?v=1.0.3"></script>
<script src="lib/js/progressive-image.js?v=1.0.0"></script>
<script src="background.js?v=1.0.1"></script>
</head>
Expand Down
39 changes: 6 additions & 33 deletions lib/js/nepali.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,33 +92,6 @@ const nepali_years_and_days_in_months = [
[2090, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30]
];

let previousDate = null;

function offline() {
const currentDate = new Date();
const timeString = addZero(currentDate.getHours()) + "." +
addZero(currentDate.getMinutes()) + "."
+ addZero(currentDate.getSeconds());
setDataToID('live-time', timeString);

if (!isSameDay(previousDate, currentDate)) {
const year = currentDate.getFullYear();
const month = currentDate.getMonth() + 1;
const day = currentDate.getDate();
const dateString = (convertEnglishDateToNepali(year, month, day));
setDataToID('nepalimiti', dateString[0]);
}
previousDate = currentDate;
}

function setDataToID(id, data) {
try {
document.getElementById(id).innerHTML = data;
} catch (err) {

}
}

function isSameDay(d1, d2) {

if (d1 instanceof Date && d2 instanceof Date) {
Expand Down Expand Up @@ -164,27 +137,27 @@ function getEnglishMonth(month) {

switch (month) {
case 1:
englishMonth = "Baisakh";
englishMonth = "Baishakh";
break;

case 2:
englishMonth = "Jesth";
englishMonth = "Jestha";
break;

case 3:
englishMonth = "Asar";
englishMonth = "Ashadh";
break;

case 4:
englishMonth = "Srawan";
englishMonth = "Shrawan";
break;

case 5:
englishMonth = "Bhadra";
break;

case 6:
englishMonth = "Aaswin";
englishMonth = "Ashwin";
break;

case 7:
Expand All @@ -196,7 +169,7 @@ function getEnglishMonth(month) {
break;

case 9:
englishMonth = "Paush";
englishMonth = "Poush";
break;

case 10:
Expand Down
80 changes: 39 additions & 41 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
{
"background": {
"persistent": true,
"scripts": [
"lib/js/jquery.min.js",
"lib/js/bootstrap.bundle.min.js",
"lib/js/moment.min.js",
"lib/js/moment-timezone-with-data.js",
"lib/js/progressive-image.js",
"lib/js/nepali.js",
"background.js"
]
},
"browser_action": {
"default_icon": {
"128": "favicon/undistractedme-128.png",
"16": "favicon/undistractedme-16.png",
"24": "favicon/undistractedme-24.png",
"32": "favicon/undistractedme-32.png"
},
"default_title": "Undistracted Me"
},
"chrome_url_overrides": {
"newtab": "index.html"
},
"permissions": [
"tabs"
],
"description": "Replaces your new tabs with a distraction free nepali date.",
"homepage_url": "https://whatsthemiti.herokuapp.com/",
"icons": {
"background": {
"persistent": true,
"scripts": [
"lib/js/jquery.min.js",
"lib/js/bootstrap.bundle.min.js",
"lib/js/moment.min.js",
"lib/js/moment-timezone-with-data.js",
"lib/js/progressive-image.js",
"lib/js/nepali.js",
"background.js"
]
},
"browser_action": {
"default_icon": {
"128": "favicon/undistractedme-128.png",
"16": "favicon/undistractedme-16.png",
"32": "favicon/undistractedme-32.png",
"48": "favicon/undistractedme-48.png",
"512": "favicon/undistractedme-512.png"
},
"incognito": "spanning",
"manifest_version": 2,
"name": "Undistracted Me",
"offline_enabled": true,
"short_name": "A distraction-free nepali date for your browser.",
"version": "1.0.0.2",
"author": "Siddharth Belbase"
"24": "favicon/undistractedme-24.png",
"32": "favicon/undistractedme-32.png"
},
"default_title": "Undistracted Me"
},
"chrome_url_overrides": {
"newtab": "index.html"
},
"permissions": ["tabs"],
"description": "Replaces your new tabs with a distraction free nepali date.",
"homepage_url": "https://whatsthemiti.herokuapp.com/",
"icons": {
"128": "favicon/undistractedme-128.png",
"16": "favicon/undistractedme-16.png",
"32": "favicon/undistractedme-32.png",
"48": "favicon/undistractedme-48.png",
"512": "favicon/undistractedme-512.png"
},
"incognito": "spanning",
"manifest_version": 2,
"name": "Undistracted Me",
"offline_enabled": true,
"short_name": "A distraction-free nepali date for your browser.",
"version": "1.0.3",
"author": "Siddharth Belbase"
}

0 comments on commit dd0fc66

Please sign in to comment.