Version 1.3.2.0

+ Fix a problem with the badged_color settings
+ Message for Incognito mode
+ Suggestion #65 implemented
This commit is contained in:
Kevin Röbert 2018-06-19 18:13:44 +02:00
parent d7b30f7f70
commit 71ec21e871
4 changed files with 78 additions and 15 deletions

View File

@ -86,16 +86,52 @@ function changeSwitchButton(id, storageID)
{
var element = $('#'+id);
changeVisibility(id, storageID);
element.on('change', function(){
core(function (ref){
ref.setData(storageID, element.is(':checked'));
if(storageID == "globalStatus") ref.changeIcon();
changeVisibility(id, storageID);
ref.saveOnExit();
});
});
}
/**
* Change the visibility of sections.
*/
function changeVisibility(id, storageID)
{
var element;
switch(storageID)
{
case "loggingStatus":
element = $('#log_section');
break;
case "statisticsStatus":
element = $('#statistic_section');
break;
default:
element = "undefine";
}
if(element != "undefine")
{
if($('#'+id).is(':checked'))
{
element.css('display', '');
element.css('display', '');
}
else {
element.css('display', 'none');
element.css('display', 'none');
}
}
}
/**
* Set the value of a switch button.
* @param {string} id HTML id
@ -122,17 +158,31 @@ function resetGlobalCounter(){
});
}
getData();
if(!browser.extension.inIncognitoContext)
{
getData();
}
$(document).ready(function(){
init();
$('#reset_counter_btn').on("click", resetGlobalCounter);
changeSwitchButton("globalStatus", "globalStatus");
changeSwitchButton("tabcounter", "badgedStatus");
changeSwitchButton("logging", "loggingStatus");
changeSwitchButton("statistics", "statisticsStatus");
$('#loggingPage').attr('href', browser.extension.getURL('./html/log.html'));
$('#settings').attr('href', browser.extension.getURL('./html/settings.html'));
setText();
if(!browser.extension.inIncognitoContext)
{
init();
$('#reset_counter_btn').on("click", resetGlobalCounter);
changeSwitchButton("globalStatus", "globalStatus");
changeSwitchButton("tabcounter", "badgedStatus");
changeSwitchButton("logging", "loggingStatus");
changeSwitchButton("statistics", "statisticsStatus");
$('#loggingPage').attr('href', browser.extension.getURL('./html/log.html'));
$('#settings').attr('href', browser.extension.getURL('./html/settings.html'));
setText();
} else {
$('#config_section').remove();
$('#statistic_section').remove();
$('#status_section').remove();
$('#log_section').remove();
$('#incognito').css('display', '');
}
});
/**

View File

@ -45,6 +45,8 @@ function save()
{
core(function (ref){
ref.setData('badged_color', $('input[name=badged_color]').val());
ref.setBadgedStatus();
ref.setData('ruleURL', $('input[name=rule_url]').val());
ref.setData('hashURL', $('input[name=hash_url]').val());
ref.saveOnExit();

View File

@ -32,7 +32,18 @@
</nav>
</div>
<div class="row">
<div class="row" id="incognito" style="display:none;">
<div class="col-sm-1">
<b class="text-justify word-wrap" style="color: #FF7800;">
The graphical elements of ClearURLs do not work in Incognito mode.<br />
ClearURLs still cleans all URLs.<br />
If you want to change settings, you must do so in a non-private tab.<br />
These changes will then be taken over here.
</b>
</div>
</div>
<div class="row" id="config_section">
<div class="col-sm-1">
<a id="settings" target="_blank"><span class="pull-right glyphicon glyphicon-cog"></span></a>
<h5><b id="configs_head"></b></h5>
@ -64,7 +75,7 @@
</div>
</div>
<div class="row">
<div class="row" id="statistic_section">
<div class="col-sm-1">
<h5><b id="statistics_head"></b></h5>
@ -106,7 +117,7 @@
</div>
</div>
<div class="row">
<div class="row" id="status_section">
<div class="col-sm-1">
<h5><b id="rules_status_head"></b></h5>
<div class="text-center">
@ -118,7 +129,7 @@
</div>
</div>
<br />
<div class="row">
<div class="row" id="log_section">
<div class="col-sm-1">
<div class="text-center">
<a type="button" id="loggingPage" target="_blank"

View File

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "ClearURLs",
"version": "1.3.1.0",
"version": "1.3.2.0",
"author": "Kevin R.",
"description": "Remove tracking elements form URLs.",
"homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",