From 6c94d56bf0e696b0100491e74d381eeab2d3fa8b Mon Sep 17 00:00:00 2001 From: Monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Sun, 26 May 2024 17:03:17 +0330 Subject: [PATCH 1/3] feat: Home button clear search query (#916) * click on home will clear searchbox * clearHome when mounted * clearHomePage just when you are in homepage * check clearHomePage signal out of clearHomePage method * fix style --- bun.lockb | Bin 18693 -> 18693 bytes internal/view/assets/js/component/eventBus.js | 4 ++++ internal/view/assets/js/page/home.js | 10 ++++++++++ internal/view/index.html | 5 +++++ 4 files changed, 19 insertions(+) create mode 100644 internal/view/assets/js/component/eventBus.js diff --git a/bun.lockb b/bun.lockb index be93a5ff0ca087880603bcbaf3607f47d86b1667..f1294b59ecfb172f1e78b7483c381f6c82e45395 100755 GIT binary patch delta 322 zcmW;AD-42Q07c>b!x1Sc_{0ZjG#Z`BNQ6ct5{Wj92H1>7B4cwS(j*d%Mx(PxWO8r$ zc6OpzM6t+!st`$|x}A0(rnIHb04JlehW2Pd6&=T?CDn#F0j;Pp!U<_jH)EU=ebVg& z=S*L8H^sToH{H*0uJl8X2F{H()Sly{w584hC!_Kb?a_iND;%GeR5Nh`T2aHo32AM) PNiONhSL)pl>xcOVpSx9l delta 322 zcmW;AD-42Q07YRLjz~d&eBuK%8ja3mBtjz+i9{Pl18hbkk?GusG>Jr`(daA^nciEz zot-F_qFB0oHK~=EdKm5onL*RMl~OT2Rr$31~@;K2At0x*Xu_>4UC@ zI0yQq>k-b8zUXF*bE0p$GjPtdruGCUr44naI2l!DXpiPpo#Xhlpu)rnXh{tVC#03- PCRbTcK63lEUEIwde~nd5 diff --git a/internal/view/assets/js/component/eventBus.js b/internal/view/assets/js/component/eventBus.js new file mode 100644 index 000000000..91d0b9344 --- /dev/null +++ b/internal/view/assets/js/component/eventBus.js @@ -0,0 +1,4 @@ +// Create a new Vue instance as the EventBus +const EventBus = new Vue(); + +export default EventBus; diff --git a/internal/view/assets/js/page/home.js b/internal/view/assets/js/page/home.js index 1a4755b14..da26d6afc 100644 --- a/internal/view/assets/js/page/home.js +++ b/internal/view/assets/js/page/home.js @@ -90,6 +90,9 @@ import paginationBox from "../component/pagination.js"; import bookmarkItem from "../component/bookmark.js"; import customDialog from "../component/dialog.js"; import basePage from "./base.js"; +import EventBus from "../component/eventBus.js"; + +Vue.prototype.$bus = EventBus; export default { template: template, @@ -153,6 +156,10 @@ export default { }, }, methods: { + clearHomePage() { + this.search = ""; + this.searchBookmarks(); + }, reloadData() { if (this.loading) return; this.page = 1; @@ -999,6 +1006,9 @@ export default { }, }, mounted() { + this.$bus.$on("clearHomePage", () => { + this.clearHomePage(); + }); // Prepare history state watcher var stateWatcher = (e) => { var state = e.state || {}, diff --git a/internal/view/index.html b/internal/view/index.html index 0f120d794..387d634ab 100644 --- a/internal/view/index.html +++ b/internal/view/index.html @@ -42,6 +42,8 @@ import pageHome from "./assets/js/page/home.js"; import pageSetting from "./assets/js/page/setting.js"; import customDialog from "./assets/js/component/dialog.js"; + import EventBus from "../assets/js/component/eventBus.js"; + Vue.prototype.$bus = EventBus; var app = new Vue({ el: '#main-scene', @@ -69,6 +71,9 @@ state = { activePage: page }, url = new Url; + if (page === 'page-home' && this.activePage === 'page-home') { + Vue.prototype.$bus.$emit('clearHomePage', {}); + } url.hash = pageName; this.activePage = page; history.pushState(state, page, url); From a815003b1c6bd5eb82c0a507ac8cfd7084e779d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 23:19:24 +0200 Subject: [PATCH 2/3] chore(deps): bump codecov/codecov-action in the all group (#922) Bumps the all group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `codecov/codecov-action` from 4.4.0 to 4.4.1 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/6d798873df2b1b8e5846dba6fb86631229fbcb17...125fc84a9a348dbcf27191600683ec096ec9021c) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index 331c7426b..26105ce49 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -61,7 +61,7 @@ jobs: - run: go build -tags osusergo,netgo -ldflags="-s -w -X main.version=$(git describe --tags) -X main.date=$(date --iso-8601=seconds)" - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@6d798873df2b1b8e5846dba6fb86631229fbcb17 # 4.4.0 + uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # 4.4.1 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 75395c6793c2fafeedcf7c3108b78e06329019dd Mon Sep 17 00:00:00 2001 From: Monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Thu, 30 May 2024 01:00:28 +0330 Subject: [PATCH 3/3] chore: check for avx2 processor feature when trying to run bun (#920) * check avx2 when use bun * change enviroment variable to just BUN * better massage Co-authored-by: Mario Rugiero * simpler method * add missing reverse if * patch with @fmartingr to check that in linux only --------- Co-authored-by: Mario Rugiero Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com> --- scripts/styles.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/styles.sh b/scripts/styles.sh index acd8dcee9..475d44c01 100755 --- a/scripts/styles.sh +++ b/scripts/styles.sh @@ -6,14 +6,26 @@ OUTPUT_STYLECSS=internal/view/assets/css/style.css INPUT_ARCHIVECSS=internal/view/assets/less/archive.less OUTPUT_ARCHIVECSS=internal/view/assets/css/archive.css +# Detect support of avx2 +BUN="bun" +case `uname -o` in + GNU/Linux) + # Detect support of avx2 in linux hosts + if ! grep -q avx2 /proc/cpuinfo; then + BUN="sde -chip-check-disable -- bun" + echo "Your CPU does not support avx2 so we use sde, for more information please look at https://github.com/oven-sh/bun/issues/762#issuecomment-1186505847" + fi + ;; +esac + # Use bun is installled if [ -x "$(command -v bun)" ]; then - bun install - bun x prettier internal/view/ --write - bun x lessc $INPUT_STYLECSS $OUTPUT_STYLECSS - bun x lessc $INPUT_ARCHIVECSS $OUTPUT_ARCHIVECSS - bun x clean-css-cli $CLEANCSS_OPTS -o $OUTPUT_STYLECSS $OUTPUT_STYLECSS - bun x clean-css-cli $CLEANCSS_OPTS -o $OUTPUT_ARCHIVECSS $OUTPUT_ARCHIVECSS + $BUN install + $BUN x prettier internal/view/ --write + $BUN x lessc $INPUT_STYLECSS $OUTPUT_STYLECSS + $BUN x lessc $INPUT_ARCHIVECSS $OUTPUT_ARCHIVECSS + $BUN x clean-css-cli $CLEANCSS_OPTS -o $OUTPUT_STYLECSS $OUTPUT_STYLECSS + $BUN x clean-css-cli $CLEANCSS_OPTS -o $OUTPUT_ARCHIVECSS $OUTPUT_ARCHIVECSS exit 0 fi