WaldiPL / webpageScanner

Extension for Firefox
GNU General Public License v2.0
27 stars 3 forks source link

Sort #45

Closed SaintJason closed 3 years ago

SaintJason commented 4 years ago

I love the extension! I used to use it for work, but now use it for job hunting. :(

One little niggle: Is it possible to get a way to sort entries? My OCD goes off when I see all the non-alphabetized entries. I know it's not a big thing...

WaldiPL commented 4 years ago

Do you mean a sidebar elements? If yes, I have prepared a script that sorts the pages and folders in the sidebar. Before running the script it is necessary to make a backup copy of a database.

  1. Open the extension options
  2. Open the console (ctrl+shift+k)
  3. Paste the script below and run it.
  4. Open the sidebar, the pages should be sorted.
browser.storage.local.get(["sort","sites"]).then(({sites,sort})=>{
    let folders=sort.filter(value=>{
        return value[2]==="folder";
    }).sort((a,b)=>{
        return a[3].toLowerCase()>b[3].toLowerCase();
    });
    folders.push(["root"]);

    let items=[];
    folders.forEach((e,i)=>{
        items[i]=sort.filter(value=>{
            return (value[1]===e[0]&&value[2]==="item");
        });
        items[i].sort((a,b)=>{
            return sites[a[0].substring(4)*1].title.toLowerCase()>sites[b[0].substring(4)*1].title.toLowerCase()
        });
    });
    folders.pop();
    let az=[];
    folders.forEach((e,i)=>{
        az.push(e);
        az=az.concat(items[i]);
    });
    az=az.concat(items[items.length-1]);
    browser.storage.local.set({sort:az});
});
SaintJason commented 4 years ago

That's fine. But it'd sure be handy to have something built in. Just press a button et voila.

SaintJason commented 4 years ago

Also, you can export to (firefox) folder, delete everything, go to the FF library, hit sort folder, and re-import. But that's not really saving any time or effort.

WaldiPL commented 3 years ago

The feature is now available in version 2.1.0. It can be found in Options > Management > Sorting.

SaintJason commented 2 years ago

Thank you, thank you, thank you! This is awesome.

Quick question: is "sort by date" the date they were added to the list, or date of last update?