Commit dcb29b44 authored by ValentinG's avatar ValentinG
Browse files

- Update version number to 2.0.1.0;

- Fix bug on populateTime;
- Fix bug on firefox picture-in-picture button on youtube #1;
- Create common.js;
- Add ignore list and button for current tab;
- Add comments;
- Add bootstrap configuration file and change version;
- Add translations (for options.html and disable for current tab button);
- Add italian language support;
- Add options page;
- Update copyrights;
- Move popup/lib to common/lib;
parent db8c72ae
# Firelux 2 - Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
......@@ -6,10 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## *[2.0.1.0] - 2020-06-02*
### Added
- Create common.js.
- Add options page.
- Ignore list support and button to ignore current tab.
- Comments on object and method.
- Add bootstrap configuration file and change version.
- Add translations (for options.html and disable for current tab button).
- Add italian language support.
### Changed
- Update version number to 2.0.1.0.
- Move popup/lib to common/lib.
- Update copyrights.
- Update [README.md](README.md).
### Fixed
- Fix bug on populate time options.
- Fix bug on firefox picture-in-picture button on youtube [#1](https://framagit.org/ValentinG/firelux2/-/issues/1).
## *[2.0.0.5] - 2020-05-22*
### Added
- Add AMO to the list of known issues in the [README.md](./README.md).
- Add AMO to the list of known issues in the [README.md](README.md).
- Beat to detect panel closing.
- Add [mix-blend-mode](https://developer.mozilla.org/fr/docs/Web/CSS/mix-blend-mode) to overlay.
......
......@@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
firelux2
Copyright (C) 2017 ValentinG
Copyright (C) 2020 ValentinG
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
firelux2 Copyright (C) 2017 ValentinG
firelux2 Copyright (C) 2020 ValentinG
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
......
......@@ -7,23 +7,24 @@ You can configure:
* Filter intensity
* Automatic activation of the filter (Interval of hours)
* Firefox Sync usage
* Deactivation by website
## Third party
## [Permissions requirement](https://support.mozilla.org/kb/permission-request-messages-firefox-extensions)
* **Access your data for all websites:** In order to add the filter to the page (adding <div> with style).
* **Access browser tabs:** In order to manage the list of ignored pages (URL reading).
## Third party
* [jscolor](https://github.com/EastDesire/jscolor) - A modified version of this color picker
* [Bootstrap](https://getbootstrap.com/docs/3.3/customize/) - A customized Bootstrap 3
## Known issues
* The plugin cannot work on some pages due to restrictions of the WebExtensions APIs.
* about:
* moz-extension://
* [AMO](https://addons.mozilla.org/firefox/addon/firelux/)
## License
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details
## Donate
Bitcoin: 13t3cZRXoHHNRY8hTzF1drGuZdeecoTs2S
\ No newline at end of file
......@@ -7,36 +7,67 @@
"message": "Reduziert die Farbtemperatur Browser.",
"description": "Description of the extension."
},
"noColorTitle": {
"panel_disableCurrentTabDisabledLabel": {
"message": "Deaktivieren für diese Website",
"description": "Title of the button which deactivates the current tab when the site can be disabled."
},
"panel_disableCurrentTabEnabledLabel": {
"message": "Aktivieren für diese Website",
"description": "Title of the button which deactivates the current tab when the site can be enabled."
},
"panel_disableCurrentTabNotSupportedLabel": {
"message": "Nicht unterstützte Website",
"description": "Title of the button which deactivates the current tab when the site is not supported."
},
"panel_noColorTitle": {
"message": "Keine Filter",
"description": "Title of the no color button"
},
"customColorLabel": {
"panel_customColorLabel": {
"message": "Verwenden Custom Color",
"description": "Label of the custom color checkbox"
},
"opacityLabel": {
"panel_opacityLabel": {
"message": "Aktuelle Filter",
"description": "Label of the opacity range"
},
"changeAutoLabel": {
"panel_changeAutoLabel": {
"message": "Aktivieren Sie nur in der Nacht",
"description": "Label of the change auto check box"
},
"sunriseLabel": {
"panel_sunriseLabel": {
"message": "Sonnenaufgang",
"description": "Label of the sunrise select"
},
"sunsetLabel": {
"panel_sunsetLabel": {
"message": "Sonnenuntergang",
"description": "Label of the sunset select"
},
"syncLabel": {
"panel_syncLabel": {
"message": "Mit Firefox Sync",
"description": "Label of the sync checkbox"
},
"saveLabel": {
"common_saveLabel": {
"message": "Speichern",
"description": "Label of the save button"
},
"options_ignoreListLabel": {
"message": "Liste der ignorierten Websites",
"description": "Label of the ignore list textarea."
},
"options_infoLabel": {
"message": "Ein Domain-Name pro Zeile.",
"description": "Text of the info part."
},
"options_exampleLabel": {
"message": "Beispiel :",
"description": "Label of the example text."
},
"options_exampleListLabel": {
"message": "google.com\nyoutube.com",
"description": "Content of the example text."
}
}
\ No newline at end of file
......@@ -7,36 +7,67 @@
"message": "Reduces the color temperature of browser.",
"description": "Description of the extension."
},
"noColorTitle": {
"panel_disableCurrentTabDisabledLabel": {
"message": "Deactivate for this website",
"description": "Title of the button which deactivates the current tab when the site can be disabled."
},
"panel_disableCurrentTabEnabledLabel": {
"message": "Activate for this website",
"description": "Title of the button which deactivates the current tab when the site can be enabled."
},
"panel_disableCurrentTabNotSupportedLabel": {
"message": "Unsupported website",
"description": "Title of the button which deactivates the current tab when the site is not supported."
},
"panel_noColorTitle": {
"message": "No filter",
"description": "Title of the no color button"
},
"customColorLabel": {
"panel_customColorLabel": {
"message": "Using a Custom Color",
"description": "Label of the custom color checkbox"
},
"opacityLabel": {
"message": "Filter Intensity",
"panel_opacityLabel": {
"message": "Filter intensity",
"description": "Label of the opacity range"
},
"changeAutoLabel": {
"panel_changeAutoLabel": {
"message": "Activate only at night",
"description": "Label of the change auto check box"
},
"sunriseLabel": {
"panel_sunriseLabel": {
"message": "Sunrise",
"description": "Label of the sunrise select"
},
"sunsetLabel": {
"panel_sunsetLabel": {
"message": "Sunset",
"description": "Label of the sunset select"
},
"syncLabel": {
"panel_syncLabel": {
"message": "Using Firefox Sync",
"description": "Label of the sync checkbox"
},
"saveLabel": {
"common_saveLabel": {
"message": "Save",
"description": "Label of the save button"
},
"options_ignoreListLabel": {
"message": "List of ignored websites",
"description": "Label of the ignore list textarea."
},
"options_infoLabel": {
"message": "One domain name per line.",
"description": "Text of the info part."
},
"options_exampleLabel": {
"message": "Example :",
"description": "Label of the example text."
},
"options_exampleListLabel": {
"message": "google.com\nyoutube.com",
"description": "Content of the example text."
}
}
\ No newline at end of file
......@@ -7,36 +7,67 @@
"message": "Reduce el navegador temperatura de color.",
"description": "Description of the extension."
},
"noColorTitle": {
"panel_disableCurrentTabDisabledLabel": {
"message": "Desactivar para este sitio web",
"description": "Title of the button which deactivates the current tab when the site can be disabled."
},
"panel_disableCurrentTabEnabledLabel": {
"message": "Activar para este sitio web",
"description": "Title of the button which deactivates the current tab when the site can be enabled."
},
"panel_disableCurrentTabNotSupportedLabel": {
"message": "Sitio web sin apoyo",
"description": "Title of the button which deactivates the current tab when the site is not supported."
},
"panel_noColorTitle": {
"message": "No hay filtros",
"description": "Title of the no color button"
},
"customColorLabel": {
"panel_customColorLabel": {
"message": "Utilizar color personalizado",
"description": "Label of the custom color checkbox"
},
"opacityLabel": {
"panel_opacityLabel": {
"message": "Filtro actual",
"description": "Label of the opacity range"
},
"changeAutoLabel": {
"panel_changeAutoLabel": {
"message": "Habilitar sólo por la noche",
"description": "Label of the change auto check box"
},
"sunriseLabel": {
"panel_sunriseLabel": {
"message": "Salida del sol",
"description": "Label of the sunrise select"
},
"sunsetLabel": {
"panel_sunsetLabel": {
"message": "Puesta de sol",
"description": "Label of the sunset select"
},
"syncLabel": {
"panel_syncLabel": {
"message": "El uso de Firefox Sync",
"description": "Label of the sync checkbox"
},
"saveLabel": {
"common_saveLabel": {
"message": "Guardar",
"description": "Label of the save button"
},
"options_ignoreListLabel": {
"message": "Lista de sitios web ignorados",
"description": "Label of the ignore list textarea."
},
"options_infoLabel": {
"message": "Un nombre de dominio por línea.",
"description": "Text of the info part."
},
"options_exampleLabel": {
"message": "Ejemplo :",
"description": "Label of the example text."
},
"options_exampleListLabel": {
"message": "google.com\nyoutube.com",
"description": "Content of the example text."
}
}
\ No newline at end of file
......@@ -7,36 +7,67 @@
"message": "Réduit la température de couleur du navigateur.",
"description": "Description of the extension."
},
"noColorTitle": {
"panel_disableCurrentTabDisabledLabel": {
"message": "Désactiver pour ce site",
"description": "Title of the button which deactivates the current tab when the site can be disabled."
},
"panel_disableCurrentTabEnabledLabel": {
"message": "Activer pour ce site",
"description": "Title of the button which deactivates the current tab when the site can be enabled."
},
"panel_disableCurrentTabNotSupportedLabel": {
"message": "Site non supporté",
"description": "Title of the button which deactivates the current tab when the site is not supported."
},
"panel_noColorTitle": {
"message": "Aucun filtre",
"description": "Title of the no color button"
"description": "Title of the no color button."
},
"customColorLabel": {
"panel_customColorLabel": {
"message": "Utiliser une couleur personnalisée",
"description": "Label of the custom color checkbox"
"description": "Label of the custom color checkbox."
},
"opacityLabel": {
"panel_opacityLabel": {
"message": "Intensité du filtre",
"description": "Label of the opacity range"
},
"changeAutoLabel": {
"panel_changeAutoLabel": {
"message": "Activer uniquement de nuit",
"description": "Label of the change auto check box"
"description": "Label of the change auto check box."
},
"sunriseLabel": {
"panel_sunriseLabel": {
"message": "Levé du soleil",
"description": "Label of the sunrise select"
"description": "Label of the sunrise select."
},
"sunsetLabel": {
"panel_sunsetLabel": {
"message": "Couché du soleil",
"description": "Label of the sunset select"
"description": "Label of the sunset select."
},
"syncLabel": {
"panel_syncLabel": {
"message": "Utiliser Firefox Sync",
"description": "Label of the sync checkbox"
"description": "Label of the sync checkbox."
},
"saveLabel": {
"common_saveLabel": {
"message": "Sauvegarder",
"description": "Label of the save button"
"description": "Label of the save button."
},
"options_ignoreListLabel": {
"message": "Liste des sites ignorés",
"description": "Label of the ignore list textarea."
},
"options_infoLabel": {
"message": "Un nom de domaine par ligne.",
"description": "Text of the info part."
},
"options_exampleLabel": {
"message": "Exemple :",
"description": "Label of the example text."
},
"options_exampleListLabel": {
"message": "google.fr\nyoutube.com",
"description": "Content of the example text."
}
}
\ No newline at end of file
{
"extensionName": {
"message": "Firelux",
"description": "Name of the extension."
},
"extensionDescription": {
"message": "Riduce la temperatura del colore del browser.",
"description": "Description of the extension."
},
"panel_disableCurrentTabDisabledLabel": {
"message": "Disattivare per questo sito web",
"description": "Title of the button which deactivates the current tab when the site can be disabled."
},
"panel_disableCurrentTabEnabledLabel": {
"message": "Attivare per questo sito web",
"description": "Title of the button which deactivates the current tab when the site can be enabled."
},
"panel_disableCurrentTabNotSupportedLabel": {
"message": "Sito web non supportato",
"description": "Title of the button which deactivates the current tab when the site is not supported."
},
"panel_noColorTitle": {
"message": "Nessun filtro",
"description": "Title of the no color button"
},
"panel_customColorLabel": {
"message": "Utilizzo di un colore personalizzato",
"description": "Label of the custom color checkbox"
},
"panel_opacityLabel": {
"message": "Intensità del filtro",
"description": "Label of the opacity range"
},
"panel_changeAutoLabel": {
"message": "Attivare solo di notte",
"description": "Label of the change auto check box"
},
"panel_sunriseLabel": {
"message": "Alba",
"description": "Label of the sunrise select"
},
"panel_sunsetLabel": {
"message": "Tramonto",
"description": "Label of the sunset select"
},
"panel_syncLabel": {
"message": "Utilizzo di Firefox Sync",
"description": "Label of the sync checkbox"
},
"common_saveLabel": {
"message": "Salva",
"description": "Label of the save button"
},
"options_ignoreListLabel": {
"message": "Elenco dei siti web ignorati",
"description": "Label of the ignore list textarea."
},
"options_infoLabel": {
"message": "Un nome di dominio per riga.",
"description": "Text of the info part."
},
"options_exampleLabel": {
"message": "Esempio :",
"description": "Label of the example text."
},
"options_exampleListLabel": {
"message": "google.com\nyoutube.com",
"description": "Content of the example text."
}
}
\ No newline at end of file
/**
* firelux2
* Copyright (C) 2020 ValentinG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @license GPLv3
* @author ValentinG
* @version 2.0.1.0
* @link https://framagit.org/ValentinG/firelux2
*/
var fireluxUtils = (function() {
const minDate = new Date(0, 0, 0, 0, 0, 0, 0);
const syncStorageAvailable = browser.storage.sync != null;
const notSuppported = ["about", "addons.mozilla.org"];
//Predefined color
const black_colorCode = "000000";
const orange_colorCode = "FF9329";
//Local data
const defaultTemperature = {
enabled: false,
enabledByTimer: false,
color: orange_colorCode,
alpha: 0.3,
starthour: "01",
startminute: "00",
endhour: "01",
endminute: "00",
timerEnabled: false,
iscustom: false
};
const defaultUseSync = {
value: false,
date: minDate
};
const defaultStorage = {
temperature: defaultTemperature,
useSync: defaultUseSync,
ignoreList: []
};
/**
* Choose data.
* @param {object} syncStorage - Sync storage data.
* @param {object} storage - Local storage data.
* @returns {object} Chosen storage.
*/
var chooseDataToRestore = function(syncStorage, storage) {
if (syncStorage.useSync.value && storage.useSync.date < syncStorage.useSync.date)
return syncStorage;
else
return storage;
};
/**
* Clean url.
* @param {URL} url - Url to clean.
* @returns {string} Host name.
*/
var cleanUrl = function(url) {
if (url == null || (url.protocol != "http:" && url.protocol != "https:"))
return null;
var host = url.host;
var result = host.replace(/^www\./g, "");
return result;
};
/**
* Check if object is empty.
* @param {object} obj - Object to test.
*/
var isEmptyObject = function(obj) {
for (var name in obj)
return false;
return true;
};
/**
* Check the storage object and add defaults if necessary.
* @param {object} storageObject - Storage object to check.
* @returns {boolean} Storage object have been modified.
*/
var checkStorageObject = function(storageObject) {
if (storageObject == null || isEmptyObject(storageObject)) {
Object.assign(storageObject, defaultStorage);
return true;
}
var nullDetected = false;
nullDetected = checkTemperatureObject(storageObject.temperature);
nullDetected = nullDetected || checkUseSyncObject(storageObject.useSync);
if (storageObject.ignoreList == null)
storageObject.ignoreList = [];
cleanStorageObject(storageObject);
return nullDetected;
};
/**
* Check the temperature object and add defaults if necessary.
* @param {object} temperatureObject - Temperature object to check.
* @returns {boolean} Temperature object have been modified.
*/
var checkTemperatureObject = function(temperatureObject) {
if (temperatureObject != null) {
// Done: temperature.timerenabled renamed to temperature.timerEnabled in version 2.0.1.0
if (temperatureObject.hasOwnProperty("timerenabled")) {
temperatureObject.timerEnabled = temperatureObject.timerenabled;
}
if (temperatureObject.hasOwnProperty("color") &&
temperatureObject.hasOwnProperty("alpha") &&
temperatureObject.hasOwnProperty("starthour") &&
temperatureObject.hasOwnProperty("startminute") &&
temperatureObject.hasOwnProperty("endhour") &&
temperatureObject.hasOwnProperty("endminute") &&
temperatureObject.hasOwnProperty("timerEnabled") &&
temperatureObject.hasOwnProperty("iscustom"))
return false;