Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andryou committed Jun 6, 2016
1 parent c54ce72 commit 5b4ef2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion html/updated.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ <h1>Updated to v<span id="versionno"></span>! (Sunday, June 5, 2016)</h1>
<li><b>v1.0.7.8:</b><ul>
<li>Updated list searching to eliminate noticeable lag when browsing if you have a large whitelist/blacklist</li>
<li>Reverted update change to "Respect Same-Domain" behaviour; while I had good intentions, it required you to allow a page to load which would allow it globally</li>
<li>Panel should open more consistently and entirely</li>
<li>If experienced issues with panel opening previously, it should now open more consistently and entirely</li>
<li>Improved IPv6 compatibility</li>
<li>Updated unwanted content providers list</li>
</ul></li>
</ul>
Expand Down
21 changes: 10 additions & 11 deletions js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function init() {
var responseBlockedCount = response.blockeditems.length;
var responseAllowedCount = response.alloweditems.length;
var tabInTemp = bkg.in_array(tabdomain, response.temp);
var tabdomainfriendly = tabdomain.replace(/[.\[\]:]/g,"_");
$("#currentdomain").html('<span title="'+tabdomain+'">'+tabdomain+'</span>');
if ((responseBlockedCount == 0 && responseAllowedCount == 0) || response.status == 'false') {
if (response.status == 'false') {
Expand Down Expand Up @@ -170,8 +171,8 @@ function init() {
$("#blocked").append($('.thirditem:not(*>:has(.choices))'));
$("#blocked").append($("#blocked [rel='x_web_bug']"));
$("#blocked").append($("#blocked [rel='x_no_script']"));
$("#blocked [rel='x_"+tabdomain+"']").children().first().css("font-weight", "bold");
$("#blocked").prepend($("#blocked [rel='x_"+tabdomain+"']"));
$("#blocked [rel='x_"+tabdomainfriendly+"']").children().first().css("font-weight", "bold");
$("#blocked").prepend($("#blocked [rel='x_"+tabdomainfriendly+"']"));
}
if (responseAllowedCount != 0) {
if (response.domainsort == 'true') response.alloweditems = bkg.domainSort(response.alloweditems);
Expand Down Expand Up @@ -227,8 +228,8 @@ function init() {
}
}
}
$("#allowed [rel='x_"+itemdomainfriendly+"']").children().first().css("font-weight", "bold");
$("#allowed").prepend($("#allowed [rel='x_"+itemdomainfriendly+"']"));
$("#allowed [rel='x_"+tabdomainfriendly+"']").children().first().css("font-weight", "bold");
$("#allowed").prepend($("#allowed [rel='x_"+tabdomainfriendly+"']"));
}
var blockedCount = blocked.length;
var allowedCount = allowed.length;
Expand Down Expand Up @@ -257,19 +258,18 @@ function init() {
$(".prevoke").bind("click", bulkhandle);
}
}
if (typeof response.temp === 'undefined' || response.temp.length) {
if (typeof response.temp !== 'undefined' && response.temp.length) {
$("#parent").append('<hr><div class="box box5 clearglobaltemp" title="Revoke all temporary permissions given in this entire browsing session">Revoke All Temp.</div>');
$(".clearglobaltemp").bind("click", revokealltemp);
}
$("#parent").prepend('<div class="box box1 pallow" rel="0" title="Allow Current Domain">Allow</div><div class="box box1 ptrust" rel="3" title="Trust Entire Domain">Trust</div><div class="box box2 pdeny" rel="1" title="Deny">Deny</div><div class="box box2 ptrust" rel="4" title="Distrust Entire Domain">Distrust</div><div class="box box3 pbypass" rel="2" title="Temp.">Temp.</div><div class="box box4 pclear" title="Clear Domain from List">Clear</div>').attr("sn_list",response.enable);
$(".pallow,.pdeny,.pbypass,.ptrust").bind("click", savehandle);
$(".pclear").bind("click", removehandle).hide();
if (tabdomain[0] == '[') $(".ptrust").hide();
var tabdomainfriendly = tabdomain.replace(/[.\[\]:]/g,"_");
if (response.enable == '1' || response.enable == '4') {
if (tabInTemp) {
$(".pbypass, #blocked [rel=x_'"+tabdomainfriendly+"'] .x_bypass").addClass('selected');
$("#blocked [rel=x_'"+tabdomainfriendly+"'] .x_blacklist").removeClass('selected').bind("click", x_savehandle);
$(".pbypass, #blocked [rel='x_"+tabdomainfriendly+"'] .x_bypass").addClass('selected');
$("#blocked [rel='x_"+tabdomainfriendly+"'] .x_blacklist").removeClass('selected').bind("click", x_savehandle);
$("#blocked .x_"+tabdomainfriendly).hide();
} else {
$(".pbypass").hide();
Expand All @@ -293,8 +293,8 @@ function init() {
}
} else if (response.enable == '0' || response.enable == '3') {
if (tabInTemp) {
$(".pbypass, #allowed [rel=x_'"+tabdomainfriendly+"'] .x_bypass").addClass('selected');
$("#allowed [rel=x_'"+tabdomainfriendly+"'] .x_whitelist").removeClass('selected').bind("click", x_savehandle);
$(".pbypass, #allowed [rel='x_"+tabdomainfriendly+"'] .x_bypass").addClass('selected');
$("#allowed [rel='x_"+tabdomainfriendly+"'] .x_whitelist").removeClass('selected').bind("click", x_savehandle);
$("#allowed .x_"+tabdomainfriendly).hide();
} else {
$(".pbypass").hide();
Expand Down Expand Up @@ -343,7 +343,6 @@ function remove(url, el, type) {
var urlfriendly = url.replace(/[.\[\]:]/g,"_");
if (el.parent().attr("sn_list") == '0') {
$("[rel='x_"+urlfriendly+"'] .choices, #parent").attr("sn_list", "-1");
$("[rel='x_"+urlfriendly+"'] .x_bypass").show();
}
el.hide();
if (type == '0') {
Expand Down

0 comments on commit 5b4ef2e

Please sign in to comment.