Skip to content

Commit

Permalink
Updated to 1.2.1
Browse files Browse the repository at this point in the history
- Fixed some bugs
- Increased the width of the "all spent time" page
- Added "delete" button for each website
- Fixed the order of the dates (now is from the most recent to the most remote)
  • Loading branch information
Sav22999 committed Aug 3, 2021
2 parents 290fcca + 35eed0d commit e9de18b
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -39,4 +39,4 @@ You can open an issue and there you must describe the feedback, the bug or the n

See folder <code>screenshots</code> to see screenshots also of the older versions.

<img src="screenshots/1.0/1.png" width="400px"></img>
<img src="screenshots/1.2/1.png" width="400px"></img><img src="screenshots/1.2/2.png" width="400px"></img><img src="screenshots/1.2/3.png" width="400px"></img>
28 changes: 26 additions & 2 deletions css/style.css
Expand Up @@ -37,6 +37,7 @@ body {
font-family: open-sans, sans-serif;
margin: 0px;
padding: 0px;
border-radius: 0px;
}

#popup-content {
Expand Down Expand Up @@ -68,7 +69,7 @@ body {
color: #ffffff;
}

.section-boder-bottom {
.section-border-bottom {
border-bottom: 1px solid #eeeeee;
}

Expand Down Expand Up @@ -278,11 +279,12 @@ textarea {
#all-websites-dedication-section {
background-color: #eeeeee;
padding: 5px;
width: 70%;
width: 100%;
height: 100%;
margin-left: auto;
margin-right: auto;
overflow: auto;
border-radius: 0px;
}

.section, .sub-section, .section-empty {
Expand Down Expand Up @@ -406,6 +408,15 @@ tr:hover {
font-size: 13px;
}

.button-delete {
min-width: 50px;
}


.padding-left-55-px {
padding-left: 55px;
}

.small-button {
font-size: 12px;
height: 27px;
Expand Down Expand Up @@ -433,6 +444,7 @@ h2, th {
padding-left: 10px;
font-family: open-sans;
height: 35px;
white-space: nowrap;
}

th {
Expand Down Expand Up @@ -510,6 +522,10 @@ h3 {
float: right;
}

.float-left {
float: left;
}

.margin-right-5-px {
margin-right: 5px;
}
Expand All @@ -518,6 +534,14 @@ h3 {
margin-top: 5px;
}

.margin-left-5-px {
margin-left: 5px;
}

.margin-left-minus-50-px {
margin-left: -50px;
}

.overflow-auto {
overflow: auto;
}
Expand Down
29 changes: 22 additions & 7 deletions js/all-websites.js
Expand Up @@ -47,15 +47,15 @@ function loadDataFromBrowser(generate_section = true) {
}

function deleteAllData() {
let confirmationClearAllNotes = confirm("Are you sure you want to clear all notes?\nYou can cancel this process once started.");
if (confirmationClearAllNotes) {
let confirmation = confirm("Are you sure you want to clear all data?\nYou can cancel this process once started.");
if (confirmation) {
let clearStorage = browser.storage.local.clear();
clearStorage.then(onCleared, onError);
}
}

function deleteAWebsite(url) {
let confirmation = confirm("Are you sure you want to clear the selected notes?\nYou can cancel this process once started.");
let confirmation = confirm("Are you sure you want to clear the selected website (https://" + url + ") and the time spent on it?\nYou can cancel this process once started.");
if (confirmation) {
//delete the selected page
delete websites_json[url];
Expand All @@ -67,7 +67,7 @@ function deleteAWebsite(url) {
}

function onCleared() {
//all notes clear || successful
//all websites clear || successful
loadDataFromBrowser(true);
}

Expand Down Expand Up @@ -165,12 +165,15 @@ function loadAllWebsites() {
}

all_dates = getAllDates(smallest_date, getToday());
all_dates.reverse();

let section = document.createElement("div");
section.classList.add("section", "overflow-auto", "no-padding");
section.id = "table-section";

let tableElement = document.createElement("table");

let tableTHeadElement = document.createElement("thead");
let tableRowElement = document.createElement("tr");

let tableHeaderElement = document.createElement("th");
Expand All @@ -192,8 +195,10 @@ function loadAllWebsites() {
tableRowElement.append(tableHeaderElement);
}

tableElement.append(tableRowElement);
tableTHeadElement.append(tableRowElement);
tableElement.append(tableTHeadElement);

let tableTBodyElement = document.createElement("tbody");
for (let index in websites_json_by_domain) {
tableRowElement = document.createElement("tr");

Expand All @@ -206,8 +211,17 @@ function loadAllWebsites() {
browser.tabs.create({url: "https://" + current_website});
}

let buttonDelete = document.createElement("input");
buttonDelete.type = "button";
buttonDelete.value = "Delete";
buttonDelete.classList.add("button", "button-delete", "very-small-button", "float-left", "margin-left-minus-50-px", "margin-top-5-px", "text-align-center");
buttonDelete.onclick = function () {
deleteAWebsite(current_website);
}

let tableDataElement = document.createElement("td");
tableDataElement.append(currentWebsiteElement);
tableDataElement.classList.add("padding-left-55-px");
tableDataElement.append(buttonDelete, currentWebsiteElement);
tableRowElement.append(tableDataElement);

let status_to_show = true;
Expand Down Expand Up @@ -265,8 +279,9 @@ function loadAllWebsites() {
tableRowElement.append(tableDataElement);
}

tableElement.append(tableRowElement);
tableTBodyElement.append(tableRowElement);
}
tableElement.append(tableTBodyElement);

section.append(tableElement);
document.getElementById("all-websites-sections").append(section);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Limite",
"version": "1.2",
"version": "1.2.1",
"description": "Check how much time you spend on each website every day.\nOptimise your productivity, your time and your life as well.\nDon't lose precious time!",
"icons": {
"16": "./img/icon-16.png",
Expand Down
4 changes: 2 additions & 2 deletions popup.html
Expand Up @@ -32,8 +32,8 @@
</div>
</div>
<div id="open-all-websites"
class="section-popup no-border-radius background-primary section-link section-boder-bottom">
See more details
class="section-popup no-border-radius background-primary section-link section-border-bottom">
See all spent time
</div>
<div id="buy-me-a-coffee-section" class="section-popup border-radius-bottom background-primary section-link">
☕ Buy me a coffee on PayPal
Expand Down
Binary file added screenshots/1.2/1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/1.2/1.xcf
Binary file not shown.
Binary file added screenshots/1.2/2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/1.2/2.xcf
Binary file not shown.
Binary file added screenshots/1.2/3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/1.2/3.xcf
Binary file not shown.

0 comments on commit e9de18b

Please sign in to comment.