Skip to content

Commit

Permalink
Version 2.1.0
Browse files Browse the repository at this point in the history
- Fixed problems with partial scanning #60
- Fixed not working notification
- Improved import and export of folders #63 #64
- Added possibility to drag and drop bookmarks, folders, links and web pages #65
- Added German language (thanks to Omnibrain007) #68
- Added possibility to sort pages #45
- Minor changes #59
- Fixed bugs
  • Loading branch information
WaldiPL committed Jul 3, 2021
1 parent f72fbdb commit 6a65d81
Show file tree
Hide file tree
Showing 25 changed files with 1,515 additions and 325 deletions.
620 changes: 620 additions & 0 deletions src/_locales/de/messages.json

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@
"exportBtn": {
"message": "Export pages to the bookmark folder"
},
"exporting": {
"message": "Exporting - $1"
},
"exportOK": {
"message": "Completed export pages to the bookmark folder (Web Pages Scanner)"
},
Expand Down Expand Up @@ -592,5 +595,26 @@
},
"defaultSaveOnlyPart":{
"message": "By default, save only the selected element"
},
"dropHere":{
"message": "Drop here to add to the scan list"
},
"h3sort": {
"message": "Sorting"
},
"sort": {
"message": "Sort"
},
"descDate": {
"message": "By newest"
},
"ascDate": {
"message": "By oldest"
},
"az": {
"message": "From A to Z"
},
"za": {
"message": "From Z to A"
}
}
24 changes: 24 additions & 0 deletions src/_locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@
"exportBtn": {
"message": "Exporter les pages vers le dossier de marque-pages"
},
"exporting": {
"message": "Exportation - $1"
},
"exportOK": {
"message": "Exportation des pages vers le dossier de marque-pages terminée (Web Pages Scanner)"
},
Expand Down Expand Up @@ -592,5 +595,26 @@
},
"defaultSaveOnlyPart":{
"message": "Par défaut, sauvegarder uniquement l'élément sélectionné"
},
"dropHere":{
"message": "Déposez ici pour ajouter à la liste de scan"
},
"h3sort": {
"message": "Tri"
},
"sort": {
"message": "Trier"
},
"descDate": {
"message": "Du plus récent"
},
"ascDate": {
"message": "Du plus ancien"
},
"az": {
"message": "De A à Z"
},
"za": {
"message": "De Z à A"
}
}
26 changes: 25 additions & 1 deletion src/_locales/pl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,11 @@
"exportBtn": {
"message": "Eksportuj strony do folderu zakładek"
},
"exporting": {
"message": "Eksportowanie - $1"
},
"exportOK": {
"message": "Zakończono eksport stron do folderu zakładek (Skaner Stron)"
"message": "Zakończono eksportowanie stron do folderu zakładek (Skaner Stron)"
},
"importError": {
"message": "Nie odnaleziono folderu o nazwie $1. Sprawdź, czy nazwa jest poprawna. Wielkość liter ma znaczenie."
Expand Down Expand Up @@ -592,5 +595,26 @@
},
"defaultSaveOnlyPart":{
"message": "Domyślnie zapisuj tylko wybrany element"
},
"dropHere":{
"message": "Upuść tutaj, aby dodać do listy skanowania"
},
"h3sort": {
"message": "Sortowanie"
},
"sort": {
"message": "Sortuj"
},
"descDate": {
"message": "Od najnowszych"
},
"ascDate": {
"message": "Od najstarszych"
},
"az": {
"message": "Od A do Z"
},
"za": {
"message": "Od Z do A"
}
}
106 changes: 55 additions & 51 deletions src/bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function handleInstalled(details) {
init();
if(!details.temporary){
browser.tabs.create({
url:"options.html#changelog",
url:`${extURL}options.html#changelog`,
active:true
});
}
Expand All @@ -69,7 +69,7 @@ function handleInstalled(details) {
browser.storage.local.set({settings}).then(()=>{
if(!details.temporary&&settings.changelog){
browser.tabs.create({
url:"options.html#changelog",
url:`${extURL}options.html#changelog`,
active:true
});
}
Expand Down Expand Up @@ -102,7 +102,7 @@ browser.runtime.onUpdateAvailable.addListener(()=>{
browser.storage.local.get("settings").then(result=>{
if(result.settings.warnBeforeUpdating){
browser.tabs.create({
url:"options.html?update#management",
url:`${extURL}options.html?update#management`,
active:true
});
}
Expand All @@ -115,7 +115,7 @@ browser.notifications.onClicked.addListener(e=>{
switch(e){
case "webpagesScannerScanned":
getSettings("autoOpen").then(s=>{
if(s){openSite();}
if(!s){openSite();}
});
break;
case "webpagesScannerDuplicates":
Expand Down Expand Up @@ -170,7 +170,7 @@ let delayCurrentId,

browser.runtime.onMessage.addListener(run);
function run(m,s,r){
if(m.addThis)rqstAdd(m.url,m.title,m.favicon,m.mode,m.freq,m.addBookmark,m.cssSelector,m.ignoreNumbers,m.deleteScripts,m.deleteComments,m.ignoreHrefs,m.charset,m.pageSettings,m.ignoreStyles,m.ignoreAllAttributes,m.saveOnlyPart);
if(m.addThis)rqstAdd(m.url,m.title,m.favicon,m.mode,m.freq,m.addBookmark,m.cssSelector,m.ignoreNumbers,m.deleteScripts,m.deleteComments,m.ignoreHrefs,m.charset,m.pageSettings,m.ignoreStyles,m.ignoreAllAttributes,m.saveOnlyPart,m.folder);
if(m.scanSites)scanSites(m.force);
if(m.openSites)openSite();
if(m.addToContextMenu!==undefined)showContext(m.addToContextMenu);
Expand All @@ -197,56 +197,58 @@ function run(m,s,r){
});
}
if(m.inspectTab){
if(m.again){
browser.tabs.sendMessage(s.tab.id,{
"initInspect":true,
"inspectMode":"onPageTab",
"fadeOut":true
}).then(()=>{},err=>{
console.warn(err);
});
browser.tabs.executeScript(s.tab.id,{
code:`document.getElementById("__wps_pageSettings").style.visibility="hidden";`
}).then(()=>{},err=>{
console.error(err);
});
}else{
browser.tabs.executeScript(s.tab.id,{
file: "/inspect.js",
runAt:"document_end"
browser.tabs.create({url:`${extURL}inspectView.html`}).then(tab=>{
browser.tabs.executeScript(tab.id,{
file: "/inspectView.js",
runAt:"document_start"
}).then(()=>{
browser.tabs.sendMessage(s.tab.id,{
"initInspect":true,
"inspectMode":"onPageTab",
"fadeOut":true
});
browser.tabs.executeScript(s.tab.id,{
code:`document.getElementById("__wps_pageSettings").style.visibility="hidden";`
browser.tabs.sendMessage(tab.id,{
"inspectUrl":m.inspectUrl,
"loadXHR":true,
"dialogTabId":s.tab.id,
}).then(()=>{},err=>{
console.error(err);
console.warn(err);
});
},err=>{
console.error(err);
browser.tabs.sendMessage(s.tab.id,{
"initInspect":true,
"inspectMode":"onPageTab",
"fadeOut":true
browser.tabs.sendMessage(tab.id,{
"inspectUrl":m.inspectUrl,
"loadXHR":true,
"dialogTabId":s.tab.id,
}).then(()=>{},err=>{
console.warn(err);
});
browser.tabs.executeScript(s.tab.id,{
code:`document.getElementById("__wps_pageSettings").style.visibility="hidden";`
}).then(()=>{},err=>{
console.error(err);
});
});
browser.tabs.insertCSS(s.tab.id,{
file: "/inspect.css",
runAt:"document_end"
},err=>{
console.warn(err);
});
}
if(m.inspectMe){
browser.tabs.executeScript(s.tab.id,{
file: "/inspect.js",
runAt:"document_end"
}).then(()=>{
browser.tabs.sendMessage(s.tab.id,{
"initInspect":true,
"dialogTabId":m.dialogTabId
}).then(()=>{},err=>{
console.error(err);
console.warn(err);
});
}
},err=>{
console.error(err);
browser.tabs.sendMessage(s.tab.id,{
"initInspect":true,
"dialogTabId":m.dialogTabId
}).then(()=>{},err=>{
console.warn(err);
});
});
browser.tabs.insertCSS(s.tab.id,{
file: "/inspect.css",
runAt:"document_end"
}).then(()=>{},err=>{
console.error(err);
});
}
if(m.returnToDialogTab){
browser.tabs.remove(s.tab.id).then(()=>{
Expand All @@ -272,7 +274,7 @@ function run(m,s,r){
if(m.byBG){
browser.tabs.sendMessage(s.tab.id,m).then(()=>{},err=>{console.warn(err);});
}
if(m.openViewPage){browser.tabs.create({url:"/view.html?"+m.viewId});}
if(m.openViewPage){browser.tabs.create({url:`${extURL}view.html?${m.viewId}`});}
}

function showContext(e){
Expand Down Expand Up @@ -312,7 +314,7 @@ function openSitesDelay(openWindow){
});
}else if(lastWindowId>=0){
browser.tabs.create({
url:"view.html?"+delayLinksId[delayCurrentId],
url:`${extURL}view.html?${delayLinksId[delayCurrentId]}`,
active:false,
windowId:lastWindowId
}).then(tab=>{
Expand All @@ -323,7 +325,7 @@ function openSitesDelay(openWindow){
});
}else{
browser.tabs.create({
url:"view.html?"+delayLinksId[delayCurrentId],
url:`${extURL}view.html?${delayLinksId[delayCurrentId]}`,
active:false
}).then(tab=>{
delayCurrentId++;
Expand Down Expand Up @@ -375,13 +377,13 @@ function showPopup(mode="add",editId){
browser.tabs.query({currentWindow:true,active:true}).then(tabs=>{
const tab=tabs[0];
if(tab.url.startsWith("http")){
browser.tabs.create({url:`${browser.extension.getURL("")}dialog.html?onEmptyTab&add&tabId=${tab.id}`});
browser.tabs.create({url:`${extURL}dialog.html?onEmptyTab&add&tabId=${tab.id}`});
}else{
browser.tabs.create({url:`${browser.extension.getURL("")}dialog.html?onEmptyTab&add`});
browser.tabs.create({url:`${extURL}dialog.html?onEmptyTab&add`});
}
});
}else{
browser.tabs.create({url:`${browser.extension.getURL("")}dialog.html?onEmptyTab&edit&editId=${editId}`});
browser.tabs.create({url:`${extURL}dialog.html?onEmptyTab&edit&editId=${editId}`});
}
});
}
Expand Down Expand Up @@ -436,7 +438,9 @@ function editSite(id,url,title,mode,freq,charset,cssSelector,ignoreNumbers,ignor
browser.runtime.sendMessage({
"statusbar":true,
"statusbarArg":i18n("savedWebpage",sites[id].title),
"listSite":true
"listSite":true,
"reload":true,
"reloadId":id,
}).then(()=>{},err=>{
console.warn(err);
});
Expand Down
4 changes: 4 additions & 0 deletions src/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ function generateChangelog(){
changelogGenerated=true;

let changelog=`[
{"version":"2.1.0",
"changes":["Fixed problems with partial scanning","#60","Fixed not working notification","Improved import and export of folders","#63","#64","Added possibility to drag and drop bookmarks, folders, links and web pages","#65","Added German language (thanks to Omnibrain007)","#68","Added possibility to sort pages","#45","Minor changes","#59","Fixed bugs"],
"changesPL":["Naprawiono problemy ze skanowaniem częściowym","#60","#69","Naprawiono niedziałające powiadomienie","Poprawiono importowanie i eksportowanie folderów","#63","#64","Dodano możliwość przeciągania i upuszczania zakładek, folderów, odnośników i stron","#65","Dodano język niemiecki (dzięki Omnibrain007)","#68","Dodano możliwość sortowania stron","#45","Drobne zmiany","#59","Naprawiono błędy"]
},
{"version":"2.0.1",
"changes":["Added possibility to save only a selected element of a page in the database","Fixed bug","#58"],
"changesPL":["Dodano możliwość zapisywania w bazie danych tylko wybranego elementu strony","Naprawiono błąd","#58"]
Expand Down
8 changes: 4 additions & 4 deletions src/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
const mode=this.getAttribute("mode");
const editId=this.getAttribute("editId");
const selector=this.getAttribute("selector");
const inspectMode=this.getAttribute("inspectMode");
const dialogTabId=this.getAttribute("dialogTabId");
const extURL=browser.runtime.getURL("");
if(mode==="edit"){
iframe.src=`${browser.extension.getURL("")}dialog.html?onViewTab&edit&editId=${editId}`;
iframe.src=`${extURL}dialog.html?onViewTab&edit&editId=${editId}`;
}else if(mode==="add"){
iframe.src=`${browser.extension.getURL("")}dialog.html?add&charset=${document.charset}`;
iframe.src=`${extURL}dialog.html?add&charset=${document.charset}`;
} if(mode==="inspect"){
iframe.src=`${browser.extension.getURL("")}inspectDialog.html?inspectMode=${inspectMode}&dialogTabId=${dialogTabId}&selector=${selector}`;
iframe.src=`${extURL}inspectDialog.html?dialogTabId=${dialogTabId}&selector=${selector}`;
}
this.shadowRoot.appendChild(iframe);
}
Expand Down
Loading

0 comments on commit 6a65d81

Please sign in to comment.