Skip to content

Commit

Permalink
Merge pull request #13 from Sav22999/new-release
Browse files Browse the repository at this point in the history
2.1.2
  • Loading branch information
Sav22999 committed Oct 8, 2023
2 parents e9de7bc + c638089 commit 42141d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions js/all-websites.js
Expand Up @@ -482,6 +482,17 @@ function getTHeadTable(websites, last_seven_days) {
return tableTHeadElement;
}

function getWebsiteToShow(website) {
let website_to_return = website;

let length_to_check = website_to_return.length;
const length_to_short = 46;
if (length_to_check > length_to_short) {
website_to_return = website_to_return.substring(0, length_to_short / 2) + "…" + website_to_return.substring(length_to_check - length_to_short / 2, length_to_check);
}
return website_to_return;
}

function getTBodyTable(websites, last_seven_days) {
let tableTBodyElement = document.createElement("tbody");
tableTBodyElement.id = "tbody-table-all-websites";
Expand All @@ -491,12 +502,13 @@ function getTBodyTable(websites, last_seven_days) {
//console.log(websites[website]);

let currentWebsiteElement = document.createElement("h2");
currentWebsiteElement.textContent = "https://" + websites[website]["website"];
let current_full_url = "https://" + websites[website]["website"];
currentWebsiteElement.textContent = getWebsiteToShow(current_full_url);
currentWebsiteElement.classList.add("link", "go-to-external");
currentWebsiteElement.onclick = function () {
browser.tabs.create({url: "https://" + websites[website]["website"]});
browser.tabs.create({url: current_full_url});
}
currentWebsiteElement.title = currentWebsiteElement.textContent;
currentWebsiteElement.title = current_full_url;

let buttonDelete = document.createElement("input");
buttonDelete.type = "button";
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Limite",
"version": "2.1.1",
"version": "2.1.2",
"author": "Saverio Morelli (Sav22999)",
"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": {
Expand Down

0 comments on commit 42141d5

Please sign in to comment.