Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edd076fade | ||
|
|
0ce354ea09 | ||
|
|
19813b6917 | ||
|
|
97a7747933 | ||
|
|
92f1a36bcb | ||
|
|
31364bdfec |
11
CHANGELOG.md
11
CHANGELOG.md
@@ -2,7 +2,13 @@
|
|||||||
|
|
||||||
- All notable changes to this project will be documented in this file.
|
- All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [Unreleased]
|
## Unreleased
|
||||||
|
|
||||||
|
## [0.4.1] - 2020-01-11
|
||||||
|
|
||||||
|
- Fixed & improved search
|
||||||
|
- Hiding grouping while searching
|
||||||
|
- Showing search queries when searching
|
||||||
|
|
||||||
## [0.4.0] - 2020-01-11
|
## [0.4.0] - 2020-01-11
|
||||||
|
|
||||||
@@ -33,7 +39,8 @@
|
|||||||
|
|
||||||
## All releases
|
## All releases
|
||||||
|
|
||||||
- [Unreleased] : https://github.com/undergroundwires/privacy.sexy/compare/v0.4.0...HEAD
|
- [Unreleased] : https://github.com/undergroundwires/privacy.sexy/compare/v0.4.1...HEAD
|
||||||
|
- [v0.4.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.4.0...v0.4.1
|
||||||
- [v0.4.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.3.0...v0.4.0
|
- [v0.4.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.3.0...v0.4.0
|
||||||
- [v0.3.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.2.0...v0.3.0
|
- [v0.3.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.2.0...v0.3.0
|
||||||
- [v0.2.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.1.0...v0.2.0
|
- [v0.2.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.1.0...v0.2.0
|
||||||
|
|||||||
@@ -16,12 +16,13 @@ export class UserFilter implements IUserFilter {
|
|||||||
if (!filter) {
|
if (!filter) {
|
||||||
throw new Error('Filter must be defined and not empty. Use removeFilter() to remove the filter');
|
throw new Error('Filter must be defined and not empty. Use removeFilter() to remove the filter');
|
||||||
}
|
}
|
||||||
|
const filterLowercase = filter.toLocaleLowerCase();
|
||||||
const filteredScripts = this.application.getAllScripts().filter(
|
const filteredScripts = this.application.getAllScripts().filter(
|
||||||
(script) =>
|
(script) =>
|
||||||
script.name.toLowerCase().includes(filter.toLowerCase()) ||
|
script.name.toLowerCase().includes(filterLowercase) ||
|
||||||
script.code.toLowerCase().includes(filter.toLowerCase()));
|
script.code.toLowerCase().includes(filterLowercase));
|
||||||
const filteredCategories = this.application.getAllCategories().filter(
|
const filteredCategories = this.application.getAllCategories().filter(
|
||||||
(script) => script.name.toLowerCase().includes(filter.toLowerCase()));
|
(script) => script.name.toLowerCase().includes(filterLowercase));
|
||||||
|
|
||||||
const matches = new FilterResult(
|
const matches = new FilterResult(
|
||||||
filteredScripts,
|
filteredScripts,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: privacy.sexy
|
name: privacy.sexy
|
||||||
version: 0.4.0
|
version: 0.4.1
|
||||||
repositoryUrl: https://github.com/undergroundwires/privacy.sexy
|
repositoryUrl: https://github.com/undergroundwires/privacy.sexy
|
||||||
actions:
|
actions:
|
||||||
-
|
-
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
@Prop() public initialNodes?: ReadonlyArray<INode>;
|
@Prop() public initialNodes?: ReadonlyArray<INode>;
|
||||||
|
|
||||||
public initialLiquourTreeNodes?: ILiquorTreeNewNode[] = null;
|
public initialLiquourTreeNodes?: ILiquorTreeNewNode[] = null;
|
||||||
public liquorTreeOptions = DefaultOptions;
|
public liquorTreeOptions = this.getDefaults();
|
||||||
public convertExistingToNode = convertExistingToNode;
|
public convertExistingToNode = convertExistingToNode;
|
||||||
|
|
||||||
public mounted() {
|
public mounted() {
|
||||||
@@ -98,6 +98,27 @@
|
|||||||
}
|
}
|
||||||
return (this.$refs.treeElement as any).tree;
|
return (this.$refs.treeElement as any).tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getDefaults(): ILiquorTreeOptions {
|
||||||
|
return {
|
||||||
|
multiple: true,
|
||||||
|
checkbox: true,
|
||||||
|
checkOnSelect: true,
|
||||||
|
autoCheckChildren: true,
|
||||||
|
parentSelect: false,
|
||||||
|
keyboardNavigation: true,
|
||||||
|
deletion: (node) => !node.children || node.children.length === 0,
|
||||||
|
filter: {
|
||||||
|
matcher: (query: string, node: ILiquorTreeExistingNode) => {
|
||||||
|
if (!this.filterPredicate) {
|
||||||
|
throw new Error('Cannot filter as predicate is null');
|
||||||
|
}
|
||||||
|
return this.filterPredicate(convertExistingToNode(node));
|
||||||
|
},
|
||||||
|
emptyText: '🕵️Hmm.. Can not see one 🧐',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function recurseDown(
|
function recurseDown(
|
||||||
@@ -132,25 +153,6 @@
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultOptions: ILiquorTreeOptions = {
|
|
||||||
multiple: true,
|
|
||||||
checkbox: true,
|
|
||||||
checkOnSelect: true,
|
|
||||||
autoCheckChildren: true,
|
|
||||||
parentSelect: false,
|
|
||||||
keyboardNavigation: true,
|
|
||||||
deletion: (node) => !node.children || node.children.length === 0,
|
|
||||||
filter: {
|
|
||||||
matcher: (query: string, node: ILiquorTreeExistingNode) => {
|
|
||||||
if (!this.filterPredicate) {
|
|
||||||
throw new Error('Cannot filter as predicate is null');
|
|
||||||
}
|
|
||||||
return this.filterPredicate(convertExistingToNode(node));
|
|
||||||
},
|
|
||||||
emptyText: '🕵️Hmm.. Can not see one 🧐',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,20 @@
|
|||||||
<div class="help-container">
|
<div class="help-container">
|
||||||
<TheSelector class="left" />
|
<TheSelector class="left" />
|
||||||
<TheGrouper class="right"
|
<TheGrouper class="right"
|
||||||
v-on:groupingChanged="onGroupingChanged($event)" />
|
v-on:groupingChanged="onGroupingChanged($event)"
|
||||||
|
v-show="!this.isSearching" />
|
||||||
</div>
|
</div>
|
||||||
<div class="scripts">
|
<div class="scripts">
|
||||||
<div v-if="!isSearching || searchHasMatches">
|
<div v-if="!isSearching || searchHasMatches">
|
||||||
<CardList v-if="showCards" />
|
<CardList v-if="this.showCards" />
|
||||||
<div v-else-if="showList" class="tree">
|
<div v-else-if="this.showList" class="tree">
|
||||||
|
<div v-if="this.isSearching" class="search-query">
|
||||||
|
Searching for "{{this.searchQuery | threeDotsTrim}}"</div>
|
||||||
<ScriptsTree />
|
<ScriptsTree />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="search-no-matches">
|
<div v-else class="search-no-matches">
|
||||||
Search has no matches 😞
|
Sorry, no matches for "{{this.searchQuery | threeDotsTrim}}" 😞
|
||||||
Feel free to extend the scripts <a :href="repositoryUrl" target="_blank" class="child github" >here</a>.
|
Feel free to extend the scripts <a :href="repositoryUrl" target="_blank" class="child github" >here</a>.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -40,11 +43,21 @@
|
|||||||
ScriptsTree,
|
ScriptsTree,
|
||||||
CardList,
|
CardList,
|
||||||
},
|
},
|
||||||
|
filters: {
|
||||||
|
threeDotsTrim(query: string) {
|
||||||
|
const threshold = 30;
|
||||||
|
if (query.length <= threshold - 3) {
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
return `${query.substr(0, threshold)}...`;
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
export default class TheScripts extends StatefulVue {
|
export default class TheScripts extends StatefulVue {
|
||||||
public showCards = false;
|
public showCards = false;
|
||||||
public showList = false;
|
public showList = false;
|
||||||
public repositoryUrl = '';
|
public repositoryUrl = '';
|
||||||
|
private searchQuery = '';
|
||||||
private isSearching = false;
|
private isSearching = false;
|
||||||
private searchHasMatches = false;
|
private searchHasMatches = false;
|
||||||
|
|
||||||
@@ -58,6 +71,7 @@
|
|||||||
this.updateGroups();
|
this.updateGroups();
|
||||||
});
|
});
|
||||||
state.filter.filtered.on((result: IFilterResult) => {
|
state.filter.filtered.on((result: IFilterResult) => {
|
||||||
|
this.searchQuery = result.query;
|
||||||
this.isSearching = true;
|
this.isSearching = true;
|
||||||
this.searchHasMatches = result.hasAnyMatches();
|
this.searchHasMatches = result.hasAnyMatches();
|
||||||
this.updateGroups();
|
this.updateGroups();
|
||||||
@@ -96,8 +110,13 @@
|
|||||||
}
|
}
|
||||||
.tree {
|
.tree {
|
||||||
padding-left: 3%;
|
padding-left: 3%;
|
||||||
margin-top: 15px; // Card margin
|
padding-top: 15px;
|
||||||
margin-bottom: 15px; // Card margin
|
padding-bottom: 15px;
|
||||||
|
.search-query {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
color: $gray;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.help-container {
|
.help-container {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<input type="text" class="searchTerm" placeholder="Search"
|
<input type="search" class="searchTerm" placeholder="Search"
|
||||||
@input="updateFilterAsync($event.target.value)" >
|
@input="updateFilterAsync($event.target.value)" >
|
||||||
<div class="iconWrapper">
|
<div class="iconWrapper">
|
||||||
<font-awesome-icon :icon="['fas', 'search']" />
|
<font-awesome-icon :icon="['fas', 'search']" />
|
||||||
|
|||||||
Reference in New Issue
Block a user