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); var element = $('#'+id);
changeVisibility(id, storageID);
element.on('change', function(){ element.on('change', function(){
core(function (ref){ core(function (ref){
ref.setData(storageID, element.is(':checked')); ref.setData(storageID, element.is(':checked'));
if(storageID == "globalStatus") ref.changeIcon(); if(storageID == "globalStatus") ref.changeIcon();
changeVisibility(id, storageID);
ref.saveOnExit(); 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. * Set the value of a switch button.
* @param {string} id HTML id * @param {string} id HTML id
@ -122,17 +158,31 @@ function resetGlobalCounter(){
}); });
} }
getData(); if(!browser.extension.inIncognitoContext)
{
getData();
}
$(document).ready(function(){ $(document).ready(function(){
init(); if(!browser.extension.inIncognitoContext)
$('#reset_counter_btn').on("click", resetGlobalCounter); {
changeSwitchButton("globalStatus", "globalStatus"); init();
changeSwitchButton("tabcounter", "badgedStatus"); $('#reset_counter_btn').on("click", resetGlobalCounter);
changeSwitchButton("logging", "loggingStatus"); changeSwitchButton("globalStatus", "globalStatus");
changeSwitchButton("statistics", "statisticsStatus"); changeSwitchButton("tabcounter", "badgedStatus");
$('#loggingPage').attr('href', browser.extension.getURL('./html/log.html')); changeSwitchButton("logging", "loggingStatus");
$('#settings').attr('href', browser.extension.getURL('./html/settings.html')); changeSwitchButton("statistics", "statisticsStatus");
setText(); $('#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){ core(function (ref){
ref.setData('badged_color', $('input[name=badged_color]').val());
ref.setBadgedStatus();
ref.setData('ruleURL', $('input[name=rule_url]').val()); ref.setData('ruleURL', $('input[name=rule_url]').val());
ref.setData('hashURL', $('input[name=hash_url]').val()); ref.setData('hashURL', $('input[name=hash_url]').val());
ref.saveOnExit(); ref.saveOnExit();

View File

@ -32,7 +32,18 @@
</nav> </nav>
</div> </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"> <div class="col-sm-1">
<a id="settings" target="_blank"><span class="pull-right glyphicon glyphicon-cog"></span></a> <a id="settings" target="_blank"><span class="pull-right glyphicon glyphicon-cog"></span></a>
<h5><b id="configs_head"></b></h5> <h5><b id="configs_head"></b></h5>
@ -64,7 +75,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row" id="statistic_section">
<div class="col-sm-1"> <div class="col-sm-1">
<h5><b id="statistics_head"></b></h5> <h5><b id="statistics_head"></b></h5>
@ -106,7 +117,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row" id="status_section">
<div class="col-sm-1"> <div class="col-sm-1">
<h5><b id="rules_status_head"></b></h5> <h5><b id="rules_status_head"></b></h5>
<div class="text-center"> <div class="text-center">
@ -118,7 +129,7 @@
</div> </div>
</div> </div>
<br /> <br />
<div class="row"> <div class="row" id="log_section">
<div class="col-sm-1"> <div class="col-sm-1">
<div class="text-center"> <div class="text-center">
<a type="button" id="loggingPage" target="_blank" <a type="button" id="loggingPage" target="_blank"

View File

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