Skip to content

Commit

Permalink
Version 1.9.2
Browse files Browse the repository at this point in the history
- Added possibility to hide changes outside the scanned element #35 #41
- Fixed bugs
- Minor changes
  • Loading branch information
WaldiPL committed Aug 2, 2019
1 parent 08af1ed commit 219e9cc
Show file tree
Hide file tree
Showing 16 changed files with 146 additions and 94 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Features:
- notifications about detected changes
- easily add pages to scan list
- preview old and new version of page
- sidebar (Firefox 54+)
- sidebar
and a lot more...

## Screenshot
![](screenshots/2.png)

## Requirements
- Firefox 48+
- Firefox 60+

## Permissions
- Tabs
Expand Down
6 changes: 6 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@
"skipMinorChanges": {
"message": "Skip minor changes"
},
"highlightOutsideChanges": {
"message": "Highlight changes outside the scanned element"
},
"subHighlightOutside": {
"message": "Applies to partially scanned pages"
},
"changeOf": {
"message": "Change $1 of $2"
},
Expand Down
6 changes: 6 additions & 0 deletions src/_locales/pl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@
"skipMinorChanges": {
"message": "Pomiń drobne zmiany"
},
"highlightOutsideChanges": {
"message": "Podświetl zmiany poza skanowanym elementem"
},
"subHighlightOutside": {
"message": "Dotyczy stron skanowanych częściowo"
},
"changeOf": {
"message": "Zmiana $1 z $2"
},
Expand Down
20 changes: 15 additions & 5 deletions src/bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function handleInstalled(details) {
"period":60,
"paused":false,
"search":true,
"delay":0
"delay":0,
"highlightOutsideChanges":false
}});
}
if(!details.temporary){
Expand All @@ -55,7 +56,8 @@ function handleInstalled(details) {
"period":60,
"paused":false,
"search":true,
"delay":0
"delay":0,
"highlightOutsideChanges":false
});
browser.storage.local.set({settings:result.settings});
}else if(result.settings.addToContextMenu===undefined){
Expand All @@ -66,7 +68,8 @@ function handleInstalled(details) {
"period":60,
"paused":false,
"search":true,
"delay":0
"delay":0,
"highlightOutsideChanges":false
});
browser.storage.local.set({settings:result.settings});
}else if(result.settings.charset===undefined){
Expand All @@ -75,15 +78,22 @@ function handleInstalled(details) {
"period":60,
"paused":false,
"search":true,
"delay":0
"delay":0,
"highlightOutsideChanges":false
});
browser.storage.local.set({settings:result.settings});
}else if(result.settings.period===undefined){
result.settings=Object.assign(result.settings,{
"period":60,
"paused":false,
"search":true,
"delay":0
"delay":0,
"highlightOutsideChanges":false
});
browser.storage.local.set({settings:result.settings});
}else if(result.settings.highlightOutsideChanges===undefined){
result.settings=Object.assign(result.settings,{
"highlightOutsideChanges":false
});
browser.storage.local.set({settings:result.settings});
}
Expand Down
4 changes: 4 additions & 0 deletions src/changelog.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
"use strict";

let changelog=`[
{"version":"1.9.2",
"changes":["Added possibility to hide changes outside the scanned element #35 #41","Fixed bugs","Minor changes"],
"changesPL":["Dodano możliwość ukrycia zmian poza skanowanym elementem #35 #41","Naprawiono błędy","Drobne zmiany"]
},
{"version":"1.9.1",
"changes":["Added dark theme for 'preview' and 'popup'","Fixed bugs"],
"changesPL":["Dodano ciemny motyw dla 'podglądu' oraz 'wyskakującego okna'","Naprawiono błędy"]
Expand Down
4 changes: 2 additions & 2 deletions src/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ function diffString2(o,n){
}else{
if(!reg[5].test(v)){
if(!openSpan)
ns+="<span class='changes10153'>";
ns+="<span class='__wps_changes'>";
openSpan=true;
}else if(reg[6].test(v)){
if(openSpan)
ns+="</span>";
openSpan=false;
if(!openA)
ns+="<span class='changes10153'>";
ns+="<span class='__wps_changes'>";
openA=true;
}else if(reg[4].test(v)){
if(openSpan)
Expand Down
2 changes: 1 addition & 1 deletion src/diffOld.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function diffString2old(o,n){
if(v.text!=null){
ns+=v.text;
}else{
ns+=`<span class="changes10153">${v}</span>`;
ns+=`<span class="__wps_changes">${v}</span>`;
cs+=v;
}
});
Expand Down
11 changes: 7 additions & 4 deletions src/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ let wpsView=(document.URL==="about:blank")?true:false;
init();

function init(){
overlay=document.createElement("div");
overlay.id="__wps";
document.body.appendChild(overlay);
addEvent();
overlay=document.getElementById("__wps");
if(!overlay){
overlay=document.createElement("div");
overlay.id="__wps";
document.body.appendChild(overlay);
addEvent();
}
}

function addEvent(){
Expand Down
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.9.1",
"version": "1.9.2",
"default_locale": "en",
"icons": {
"48": "icons/icon.svg",
Expand All @@ -15,7 +15,7 @@
"applications": {
"gecko": {
"id": "[email protected]",
"strict_min_version": "48.0a1"
"strict_min_version": "60.0a1"
}
},
"permissions": [
Expand Down
27 changes: 16 additions & 11 deletions src/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,20 @@ button{
margin: 0;
-moz-appearance: none;
min-height: 30px;
border: 1px solid #d7d7db;
border: 1px solid transparent;
border-radius: 2px;
background-color:#f9f9fa;
background-color:#0c0c0d1a;
font-family:Segoe UI,Tahoma,Helvetica Neue,Lucida Grande,Ubuntu,sans-serif;
font-size:13px;
box-sizing:border-box;
}

button:hover,select:hover,#fileInput:hover,button:focus,select:focus{
background-color:#ebebeb;
background-color:#0c0c0d33;
}

button:active,select:active,#fileInput:active{
background-color:#dadada;
background-color:#0c0c0d4d;
}

.row{
Expand Down Expand Up @@ -218,9 +219,9 @@ select {
-moz-appearance: none;
min-height: 30px;
min-width: 100px;
border: 1px solid #d7d7db;
border: 1px solid transparent;
border-radius: 2px;
background-color:#f9f9fa;
background-color:#0c0c0d1a;
background-image:url("icons/dropdown.svg#d");
background-repeat:no-repeat;
background-position:right 8px center;
Expand All @@ -238,9 +239,9 @@ input[type="number"],input[type="text"]{
padding:4px 4px 4px 10px;
-moz-appearance:none;
min-height:30px;
border:1px solid #d7d7db;
border:1px solid transparent;
border-radius:2px;
background-color:#fff;
background-color:#0c0c0d1a ;
}

input[type="number"]{
Expand Down Expand Up @@ -306,9 +307,9 @@ article:hover{
height:28px;
margin:0 8px;
display:inline-block;
border:1px solid #d7d7db;
border:1px solid transparent;
background-color:#0c0c0d1a;
border-radius:2px;
background-color:#f9f9fa;
font-size:13px;
cursor:context-menu;
overflow:hidden;
Expand All @@ -320,7 +321,7 @@ article:hover{
}

#file{
height:28px;
height:30px;
width:200px;
opacity:0;
margin-right:-200px;
Expand Down Expand Up @@ -384,6 +385,10 @@ a.extLink::after{
margin:0;
}

label + .subLabel{
padding:5px 0 0 28px;
}

#alertToolbar{
position:fixed;
top:0;
Expand Down
10 changes: 9 additions & 1 deletion src/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h3 id="thGeneral"></h3>
<label id="labelDelay"></label><input type="number" id="delay" min="0" placeholder="0" value="0">
<p id="sublabelDelay" class="subLabel"></p>
</div>
<div class="row none" id="shortcut">
<div class="row" id="shortcut">
<label id="labelShortcut"></label
><select id="shortcut1">
<option value="Ctrl">Ctrl</option>
Expand All @@ -66,6 +66,10 @@ <h3 id="thGeneral"></h3>
</select>+<select id="shortcut2">
<option value=""></option>
<option value="Shift">Shift</option>
<option value="Ctrl">Ctrl</option>
<option value="Alt">Alt</option>
<option value="Command">Command</option>
<option value="MacCtrl">MacCtrl</option>
</select>+<input type="text" id="shortcut3" placeholder="Q" pattern="([A-Za-z0-9]|Comma|Period|Home|End|PageUp|PageDown|Space|Insert|Delete|Up|Down|Left|Right|([Ff][1-9]|[Ff]1[0-2]))\s*$">
</div>
<h3 id="h3pageView"></h3>
Expand All @@ -92,6 +96,10 @@ <h3 id="h3pageView"></h3>
<div class="sub">
<input type="checkbox" id="skipMinorChanges"><label id="labelSkipMinorChanges" for="skipMinorChanges"></label>
</div>
<div class="row">
<input type="checkbox" id="highlightOutsideChanges"><label id="labelHighlightOutsideChanges" for="highlightOutsideChanges"></label>
<p id="sublabelOutside" class="subLabel"></p>
</div>
<h3 id="thChangedPages"></h3>
<div class="row">
<input type="checkbox" id="autoOpen"><label id="labelAutoOpen" for="autoOpen"></label>
Expand Down
36 changes: 19 additions & 17 deletions src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ function saveOptions(){
period: period>5?period<1440?period:1440:5,
paused: document.getElementById("autoScanPause").checked,
search: document.getElementById("showSearchbar").checked,
delay: !(document.getElementById("delay").value>0)?0:document.getElementById("delay").value
delay: !(document.getElementById("delay").value>0)?0:document.getElementById("delay").value,
highlightOutsideChanges: document.getElementById("highlightOutsideChanges").checked
};
browser.storage.local.set({settings:settings});
if(!settings.popupList)browser.browserAction.setPopup({popup:"/popup.html"});
Expand Down Expand Up @@ -141,6 +142,7 @@ function restoreOptions(){
document.getElementById("alertToolbar").className=s.paused?"":"none";
document.getElementById("showSearchbar").checked=s.search;
document.getElementById("delay").value=s.delay;
document.getElementById("highlightOutsideChanges").checked=s.highlightOutsideChanges;
});
restoreShortcut();
}
Expand Down Expand Up @@ -251,6 +253,8 @@ function translate(){
document.getElementById("labelDelay").textContent=i18n("delay");
document.getElementById("sublabelDelay").textContent=i18n("subDelay");
document.getElementById("labelShortcut").textContent=i18n("shortcutLabel");
document.getElementById("labelHighlightOutsideChanges").textContent=i18n("highlightOutsideChanges");
document.getElementById("sublabelOutside").textContent=i18n("subHighlightOutside");
}

function i18n(e,s1){
Expand Down Expand Up @@ -669,22 +673,16 @@ function changePermission(e){
}

function restoreShortcut(){
browser.runtime.getBrowserInfo().then(e=>{
const version=+e.version.substr(0,2);
if(version>=60){
document.getElementById("shortcut").classList.remove("none");
browser.commands.getAll().then(commands=>{
const shortcut=commands[0].shortcut.split("+");
if(shortcut.length===2){
document.getElementById("shortcut1").value=shortcut[0];
document.getElementById("shortcut2").value="";
document.getElementById("shortcut3").value=shortcut[1];
}else{
document.getElementById("shortcut1").value=shortcut[0];
document.getElementById("shortcut2").value=shortcut[1];
document.getElementById("shortcut3").value=shortcut[2];
}
});
browser.commands.getAll().then(commands=>{
const shortcut=commands[0].shortcut.split("+");
if(shortcut.length===2){
document.getElementById("shortcut1").value=shortcut[0];
document.getElementById("shortcut2").value="";
document.getElementById("shortcut3").value=shortcut[1];
}else{
document.getElementById("shortcut1").value=shortcut[0];
document.getElementById("shortcut2").value=shortcut[1];
document.getElementById("shortcut3").value=shortcut[2];
}
});
}
Expand All @@ -693,6 +691,10 @@ function updateShortcut(){
let [s1,s2,s3]=[document.getElementById("shortcut1").value,document.getElementById("shortcut2").value,document.getElementById("shortcut3").value];
if(!s3)s3="Q";
else if(s3.length<=2)s3=s3.toUpperCase();
if(s1===s2){
s2="";
document.getElementById("shortcut2").value="";
}
try{
browser.commands.update({
name: "_execute_sidebar_action",
Expand Down
6 changes: 5 additions & 1 deletion src/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ let prevContext;
document.getElementById("editSaveF").addEventListener("click",e=>{editFolder(e.target.dataset.id);});
document.getElementById("deleteSaveF").addEventListener("click",e=>{deleteFolder(e.target.dataset.id);});
document.getElementById("search").addEventListener("input",search);
document.documentElement.addEventListener("click",e=>{
document.addEventListener("click",e=>{
if(e.target.id!=="filter"&&e.target.parentElement.id!=="popupFilter"){
document.getElementById("filter").classList.remove("open");
document.getElementById("popupFilter").classList.add("hidden");
}
});
document.addEventListener("blur",()=>{
document.getElementById("filter").classList.remove("open");
document.getElementById("popupFilter").classList.add("hidden");
});
document.getElementById("filter").addEventListener("click",()=>{
document.getElementById("filter").classList.toggle("open");
document.getElementById("popupFilter").classList.toggle("hidden");
Expand Down
2 changes: 1 addition & 1 deletion src/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="view.css"/>
<link rel="icon" type="image/png" href="data:image/png;base64," id="favicon"/>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAElEQVQ" id="favicon"/>
</head>
<body>
<div id="content"></div>
Expand Down
Loading

0 comments on commit 219e9cc

Please sign in to comment.