Skip to content

Commit

Permalink
added source code of extension
Browse files Browse the repository at this point in the history
  • Loading branch information
alefranzoni committed Jan 7, 2024
1 parent 1a7c340 commit cd3d797
Show file tree
Hide file tree
Showing 21 changed files with 340 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# basecamp-booster-plus
Change the boost characters limit and boooost like never before! 🚀
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![Donate][donate-shield]][donate-url]

# 🚀 Basecamp Booster+
Loving boost in Basecamp, but hate having only 16 characters to do it with? Then **Booster+** is for you.
With this simple tool, you can change the boost character limit and boooost like never before.

## Installation
Download the extension from the [Add-ons for Firefox](#todo) or [Chrome Web Store](#todo).

## Install from GitHub
To install the extension from GitHub directly (off-store), download the latest release as a zip file from the [Releases](https://github.com/alefranzoni/basecamp-booster-plus/releases) page and add it to your browser.
- For **Firefox**, using the `Load Temporary Add-on` option in developer mode
- For **Chromium**, using the `Load unpacked extension` option in developer mode.

## Usage
Just install the extension and that's all! However, if you need to increase the character limit, which is 100 by default, just click on the extension icon and set the options as you wish.

In the settings floating menu you will see that there is a *Delay* option, this is the waiting time (in milliseconds) before searching for the component to be edited. Adjust this time **only if** the extension is not working properly.

![Basecamp Booster+](https://github.com/alefranzoni/basecamp-booster-plus/assets/12649187/24b37d71-747f-4caa-ad17-984b7ada858c)

## Donate
You can support me through [**Cafecito**](https://cafecito.app/alefranzoni) (🇦🇷) or [**PayPal**](https://www.paypal.com/donate/?hosted_button_id=9LR86UDHEKM3Q) (Worldwide). Thank you ❤️

[stars-shield]: https://img.shields.io/github/stars/alefranzoni/basecamp-booster-plus
[stars-url]: https://github.com/alefranzoni/basecamp-booster-plus/stargazers
[issues-shield]: https://img.shields.io/github/issues/alefranzoni/basecamp-booster-plus
[issues-url]: https://github.com/alefranzoni/basecamp-booster-plus/issues
[donate-shield]: https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat
[donate-url]: https://github.com/alefranzoni/basecamp-booster-plus#donate
14 changes: 14 additions & 0 deletions chromium/content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
document.addEventListener('click', function () {
chrome.storage.local.get(['delay', 'maxLength'], function(result) {
let maxLength = result.maxLength || 100;
let delay = result.delay || 500;

setTimeout(function () {
let elements = document.getElementsByClassName('input input--borderless input--unpadded input--boost');

Array.from(elements).forEach(element => {
element.setAttribute('maxlength', maxLength);
});
}, delay);
});
});
Binary file added chromium/icons/icon128.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 chromium/icons/icon16.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 chromium/icons/icon24.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 chromium/icons/icon32.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 chromium/icons/icon48.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: 33 additions & 0 deletions chromium/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"manifest_version": 3,
"name": "Basecamp Booster+",
"version": "1.0.0",
"description": "Change the boost characters limit and boooost like never before!",
"icons": {
"16": "./icons/icon16.png",
"24": "./icons/icon24.png",
"32": "./icons/icon32.png",
"48": "./icons/icon48.png",
"128": "./icons/icon128.png"
},
"permissions": [
"activeTab",
"storage"
],
"action": {
"default_popup": "./settings/settings.html"
},
"content_scripts": [
{
"matches": [
"*://*.basecamp.com/*"
],
"js": [
"content.js"
]
}
],
"host_permissions": [
"*://*.basecamp.com/*"
]
}
28 changes: 28 additions & 0 deletions chromium/settings/settings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basecamp Booster+ Settings</title>
<link rel="stylesheet" href="../src/styles.css">
</head>
<body>
<h1>Basecamp Booster+</h1>
<div class="option">
<div>
<div class="option-title"><span title="Set desired Boost limit (maximum length).">🚀 Boost Max Length</span></div>
</div>
<input type="number" id="max-length">
</div>
<div class="option">
<div>
<div class="option-title" title="Waiting time (in milliseconds) before searching for the component to be edited (Boost). Adjust this time if the extension is not working properly.">⏱️ Delay (ms)</div>
</div>
<input type="number" id="delay">
</div>
<button id="save">Save</button>
<div class="footer">
Enjoying <b>Booster+</b>? Star the project on <a href="https://github.com/alefranzoni/basecamp-booster-plus" target="_blank"><b>GitHub</b></a> ❤️
</div>
<script src="settings.js"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions chromium/settings/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
document.addEventListener('DOMContentLoaded', function () {
chrome.storage.local.get(['maxLength', 'delay'], function(result) {
document.getElementById('max-length').value = result.maxLength || 100;
document.getElementById('delay').value = result.delay || 500;
});
});

document.getElementById('save').addEventListener('click', function () {
let maxLength = document.getElementById('max-length').value;
let delay = document.getElementById('delay').value;

if (maxLength) {
chrome.storage.local.set({ maxLength: maxLength });
}

if (delay) {
chrome.storage.local.set({ delay: delay });
}

this.textContent = "Saved";
this.style.backgroundColor = "#bf9cf0";

setTimeout(function () {
window.close();
}, 300);
});
56 changes: 56 additions & 0 deletions chromium/src/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
padding: 10px;
background-color: #f9f9f9;
width: max-content;
}
h1 {
margin-top: 0px;
margin-bottom: 15px;
color: #333;
font-size: xx-large;
}
.option {
display: flex;
align-items: center;
margin-top: 5px;
}
.option-icon {
margin-right: 10px;
}
.option-title {
font-weight: 400;
font-size: medium;
}
.option-description {
font-size: 0.9em;
color: #666;
}
input {
margin-top: 5px;
width: 80px;
margin-left: auto;
}
button {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #6200ee;
color: white;
border: none;
padding: 8px 20px;
text-decoration: none;
font-weight: 600;
display: inline-block;
font-size: 16px;
margin: 20px 0px 0px 0px;
cursor: pointer;
border-radius: 5px;
width: 100%;
}
.footer {
margin-top: 10px;
margin-bottom: 0px;
font-size: 0.9em;
color: #888;
text-align: center;
}

14 changes: 14 additions & 0 deletions firefox/content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
document.addEventListener('click', function () {
browser.storage.local.get(['delay', 'maxLength']).then((result) => {
let maxLength = result.maxLength || 100;
let delay = result.delay || 500;

setTimeout(function () {
let elements = document.getElementsByClassName('input input--borderless input--unpadded input--boost');

Array.from(elements).forEach(element => {
element.setAttribute('maxlength', maxLength);
});
}, delay);
});
});
Binary file added firefox/icons/icon128.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 firefox/icons/icon16.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 firefox/icons/icon24.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 firefox/icons/icon32.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 firefox/icons/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"manifest_version": 2,
"name": "Basecamp Booster+",
"version": "1.0.0",
"description": "Change the boost characters limit and boooost like never before!",
"icons": {
"16": "./icons/icon16.png",
"24": "./icons/icon24.png",
"32": "./icons/icon32.png",
"48": "./icons/icon48.png",
"128": "./icons/icon128.png"
},
"permissions": [
"activeTab",
"storage"
],
"browser_action": {
"default_popup": "./settings/settings.html"
},
"content_scripts": [
{
"matches": [
"*://*.basecamp.com/*"
],
"js": [
"content.js"
]
}
]
}
28 changes: 28 additions & 0 deletions firefox/settings/settings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basecamp Booster+ Settings</title>
<link rel="stylesheet" href="../src/styles.css">
</head>
<body>
<h1>Basecamp Booster+</h1>
<div class="option">
<div>
<div class="option-title"><span title="Set desired Boost limit (maximum length).">🚀 Boost Max Length</span></div>
</div>
<input type="number" id="max-length">
</div>
<div class="option">
<div>
<div class="option-title" title="Waiting time (in milliseconds) before searching for the component to be edited (Boost). Adjust this time if the extension is not working properly.">⏱️ Delay (ms)</div>
</div>
<input type="number" id="delay">
</div>
<button id="save">Save</button>
<div class="footer">
Enjoying <b>Booster+</b>? Star the project on <a href="https://github.com/alefranzoni/basecamp-booster-plus" target="_blank"><b>GitHub</b></a> ❤️
</div>
<script src="settings.js"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions firefox/settings/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
document.addEventListener('DOMContentLoaded', function () {
browser.storage.local.get(['maxLength', 'delay']).then((result) => {
document.getElementById('max-length').value = result.maxLength || 100;
document.getElementById('delay').value = result.delay || 500;
});
});

document.getElementById('save').addEventListener('click', function () {
let maxLength = document.getElementById('max-length').value;
let delay = document.getElementById('delay').value;

if (maxLength) {
browser.storage.local.set({ maxLength: maxLength });
}

if (delay) {
browser.storage.local.set({ delay: delay });
}

this.textContent = "Saved";
this.style.backgroundColor = "#bf9cf0";

setTimeout(function () {
window.close();
}, 300);
});
53 changes: 53 additions & 0 deletions firefox/src/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
padding: 10px;
background-color: #f9f9f9;
width: auto;
}
h1 {
margin-top: 0px;
color: #333;
}
.option {
display: flex;
align-items: center;
margin-top: 5px;
}
.option-icon {
margin-right: 10px;
}
.option-title {
font-weight: 500;
}
.option-description {
font-size: 0.9em;
color: #666;
}
input {
margin-top: 5px;
width: 80px;
margin-left: auto;
}
button {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #6200ee;
color: white;
border: none;
padding: 8px 20px;
text-decoration: none;
font-weight: 600;
display: inline-block;
font-size: 16px;
margin: 20px 0px 0px 0px;
cursor: pointer;
border-radius: 5px;
width: 100%;
}
.footer {
margin-top: 10px;
margin-bottom: 0px;
font-size: 0.8em;
color: #888;
text-align: center;
}

0 comments on commit cd3d797

Please sign in to comment.