Skip to content

Commit

Permalink
fix(#191): search add drag
Browse files Browse the repository at this point in the history
  • Loading branch information
xjh22222228 committed Feb 3, 2022
1 parent 903c4fb commit 4f7f5bf
Show file tree
Hide file tree
Showing 43 changed files with 49 additions and 44 deletions.
2 changes: 1 addition & 1 deletion data/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "发现导航 - 精选实用导航网站",
"keywords": "导航,前端资源,社区站点,设计师,实用工具,学习资源,运营,网络安全,node.js",
"theme": "Light",
"footerContent": "<div style=\"font-weight: bold;\">共收录${total}个网站</div><div>Copyright © 2018-2021 nav3.cn, All Rights Reserved</div>",
"footerContent": "<div style=\"font-weight: bold;\">共收录${total}个网站</div><div>Copyright © 2018-2022 nav3.cn, All Rights Reserved</div>",
"iconfontUrl": "//at.alicdn.com/t/font_2522843_wl70o31sy6.js",
"baiduStatisticsUrl": "https://hm.baidu.com/hm.js?4582be7af7e7c95ef75351e07c6c32ba",
"cnzzStatisticsUrl": "",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import fs from 'fs'
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { BrowserModule } from '@angular/platform-browser'
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, OnInit, Input, ViewChildren, QueryList } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/create-web/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/ellipsis/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, Input, ViewChild, ElementRef } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/fixbar/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, Output, EventEmitter, Input, ChangeDetectionStrategy } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/footer/footer.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, Input } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/icon-git/icon-git.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import { Component, OnInit } from '@angular/core';
import config from '../../../nav.config';
Expand Down
2 changes: 1 addition & 1 deletion src/components/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/move-site/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, Input, Output, EventEmitter } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/no-data/no-data.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import { Component } from '@angular/core'
import { $t } from 'src/locale';
Expand Down
2 changes: 1 addition & 1 deletion src/components/search-engine/search-engine.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import hotkeys from 'hotkeys-js'
import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/toolbar-title/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/upload/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, EventEmitter, Output } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/components/web-list/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component, OnInit, Input } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { getCDN } from '../services'
Expand Down
2 changes: 1 addition & 1 deletion src/dark.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

// <html>
Expand Down
2 changes: 1 addition & 1 deletion src/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import config from '../../nav.config'
import http from '../utils/http'
Expand Down
2 changes: 1 addition & 1 deletion src/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import { websiteList as w } from '../utils'
import * as __settings from '../../data/settings.json'
Expand Down
2 changes: 1 addition & 1 deletion src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

@import "./dark.scss";
Expand Down
2 changes: 1 addition & 1 deletion src/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

export type ThemeType =
Expand Down
2 changes: 1 addition & 1 deletion src/utils/bookmark.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { INavProps } from '../types'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/http.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import axios from 'axios'
import NProgress from 'nprogress'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import qs from 'qs'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ripple.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import { annotate } from 'rough-notation'
import { queryString } from './index'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

export function getToken() {
Expand Down
2 changes: 1 addition & 1 deletion src/view/admin/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/view/app/default/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import { Component } from '@angular/core'
import { Router, ActivatedRoute } from '@angular/router'
Expand Down
2 changes: 1 addition & 1 deletion src/view/index/light/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/view/index/shortcut/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import { Component } from '@angular/core'
import { isDark as isDarkFn } from 'src/utils'
Expand Down
2 changes: 1 addition & 1 deletion src/view/index/side/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/view/index/sim/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.

import config from '../../../../nav.config'
import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/view/system/about/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/view/system/bookmark/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/view/system/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/view/system/info/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
4 changes: 2 additions & 2 deletions src/view/system/search/index.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<th>{{ $t('_action') }}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of searchList; index as idx">
<tbody cdkDropList (cdkDropListDropped)="onDrop($event)">
<tr *ngFor="let data of searchList; index as idx" cdkDrag>
<td width="150px">
<input nz-input [(ngModel)]="data.name" maxlength="10" />
</td>
Expand Down
7 changes: 6 additions & 1 deletion src/view/system/search/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand All @@ -10,6 +10,7 @@ import { updateFileContent } from 'src/services'
import { NzModalService } from 'ng-zorro-antd/modal'
import { SEARCH_PATH } from 'src/constants'
import { searchEngineList } from 'src/store'
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'

@Component({
selector: 'system-tag',
Expand Down Expand Up @@ -86,4 +87,8 @@ export default class SystemSearchComponent {
onChangeUpload(path, idx: number) {
this.searchList[idx].icon = path.cdn
}

onDrop(event: CdkDragDrop<string[]>): void {
moveItemInArray(this.searchList, event.previousIndex, event.currentIndex)
}
}
2 changes: 1 addition & 1 deletion src/view/system/setting/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/view/system/tag/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down
2 changes: 1 addition & 1 deletion src/view/system/web/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// Copyright @ 2018-2022 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav

import { Component } from '@angular/core'
Expand Down

0 comments on commit 4f7f5bf

Please sign in to comment.