-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
24 changed files
with
819 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/frontend/app/ui/gallery/search/AutoCompleteRenderItem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {SearchQueryTypes} from '../../../../../common/entities/SearchQueryDTO'; | ||
|
||
export class AutoCompleteRenderItem { | ||
public preText = ''; | ||
public highLightText = ''; | ||
public postText = ''; | ||
public type: SearchQueryTypes; | ||
public queryHint: string; | ||
public notSearchable: boolean; | ||
|
||
constructor(public text: string, searchText: string, type: SearchQueryTypes, queryHint: string, notSearchable = false) { | ||
const preIndex = text.toLowerCase().indexOf(searchText.toLowerCase()); | ||
if (preIndex > -1) { | ||
this.preText = text.substring(0, preIndex); | ||
this.highLightText = text.substring(preIndex, preIndex + searchText.length); | ||
this.postText = text.substring(preIndex + searchText.length); | ||
} else { | ||
this.postText = text; | ||
} | ||
this.type = type; | ||
this.queryHint = queryHint; | ||
this.notSearchable = notSearchable; | ||
} | ||
} |
11 changes: 6 additions & 5 deletions
11
src/frontend/app/ui/gallery/search/query-builder/query-builder.gallery.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/frontend/app/ui/gallery/search/search-field-base/search-field-base.gallery.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
.autocomplete-list { | ||
position: absolute; | ||
left: 0; | ||
top: 34px; | ||
background-color: white; | ||
width: 100%; | ||
border: 1px solid #ccc; | ||
border-bottom-left-radius: 4px; | ||
border-bottom-right-radius: 4px; | ||
padding: 5px 0; | ||
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); | ||
box-shadow: 0 6px 12px rgba(0, 0, 0, .175); | ||
z-index: 7; | ||
} | ||
|
||
.insert-button { | ||
margin-right: -15px; | ||
display: none; | ||
margin-top: 2px; | ||
} | ||
|
||
.autocomplete-item-selected .insert-button { | ||
display: block; | ||
} | ||
@media (hover: none) { | ||
.insert-button { | ||
display: block; | ||
} | ||
} | ||
|
||
.autocomplete-item-selected .insert-button:hover { | ||
color: black; | ||
} | ||
|
||
.autocomplete-item { | ||
cursor: pointer; | ||
padding-top: 2px; | ||
padding-bottom: 2px; | ||
font-size: 17px; | ||
} | ||
|
||
.autocomplete-item { | ||
color: #333; | ||
padding: 0 20px; | ||
line-height: 1.42857143; | ||
font-weight: 400; | ||
display: block; | ||
} | ||
|
||
.autocomplete-item-selected { | ||
background-color: #007bff; | ||
color: #FFF; | ||
} | ||
|
||
|
||
.search-text { | ||
z-index: 6; | ||
width: 100%; | ||
background: transparent; | ||
} | ||
|
||
.search-hint { | ||
left: 0; | ||
z-index: 1; | ||
width: 100%; | ||
position: absolute; | ||
margin-left: 0 !important; | ||
} | ||
|
60 changes: 60 additions & 0 deletions
60
...frontend/app/ui/gallery/search/search-field-base/search-field-base.gallery.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<div class="input-group"> | ||
<input type="text" | ||
class="form-control search-text" | ||
[placeholder]="placeholder" | ||
(keyup)="onSearchChange($event)" | ||
(blur)="onFocusLost()" | ||
[(ngModel)]="rawSearchText" | ||
(ngModelChange)="onChange()" | ||
(keydown.enter)="OnEnter($event)" | ||
(keydown.arrowRight)="applyHint($event)" | ||
(keydown.arrowUp)="selectAutocompleteUp()" | ||
(keydown.arrowDown)="selectAutocompleteDown()" | ||
(scroll)="Scrolled()" | ||
(selectionchange)="Scrolled()" | ||
#name="ngModel" | ||
size="30" | ||
ngControl="search" | ||
name="srch-term" | ||
id="srch-term" | ||
#SearchField | ||
autocomplete="off"> | ||
<input type="text" | ||
class="form-control search-hint" | ||
[ngModel]="SearchHint" | ||
size="30" | ||
name="srch-term-hint" | ||
id="srch-term-hint" | ||
#SearchHintField | ||
autocomplete="off"> | ||
|
||
|
||
<div class="autocomplete-list" *ngIf="autoCompleteRenders.length > 0" | ||
(mouseover)="setMouseOverAutoComplete(true)" (mouseout)="setMouseOverAutoComplete(false)"> | ||
<div class="autocomplete-item" | ||
[ngClass]="{'autocomplete-item-selected': highlightedAutoCompleteItem === i}" | ||
(mouseover)="setMouseOverAutoCompleteItem(i)" | ||
(click)="searchAutoComplete(item)" | ||
*ngFor="let item of autoCompleteRenders; let i = index"> | ||
<div> | ||
<span [ngSwitch]="item.type"> | ||
<span *ngSwitchCase="SearchQueryTypes.caption" class="oi oi-image"></span> | ||
<span *ngSwitchCase="SearchQueryTypes.directory" class="oi oi-folder"></span> | ||
<span *ngSwitchCase="SearchQueryTypes.file_name" class="oi oi-image"></span> | ||
<span *ngSwitchCase="SearchQueryTypes.keyword" class="oi oi-tag"></span> | ||
<span *ngSwitchCase="SearchQueryTypes.person" class="oi oi-person"></span> | ||
<span *ngSwitchCase="SearchQueryTypes.position" class="oi oi-map-marker"></span> | ||
<span *ngSwitchCase="SearchQueryTypes.distance" class="oi oi-map-marker"></span> | ||
</span> | ||
{{item.preText}}<strong>{{item.highLightText}}</strong>{{item.postText}} | ||
<span class="oi oi-chevron-right insert-button float-right" (click)="applyAutoComplete(item)" | ||
title="Insert" | ||
i18n-title> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
|
Oops, something went wrong.