File tree Expand file tree Collapse file tree 4 files changed +30
-9
lines changed
Expand file tree Collapse file tree 4 files changed +30
-9
lines changed Original file line number Diff line number Diff line change 1- # Stackoverflow View
1+ # Stack Overflow View
2+
3+
4+ [ ![ MIT license] ( https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square )] ( https://lbesson.mit-license.org/ )
5+ [ ![ made-for-VSCode] ( https://img.shields.io/badge/Made%20for-VSCode-1f425f.svg?logo=visual-studio-code&style=flat-square )] ( https://code.visualstudio.com/ )
6+ [ ![ made-with-svelte] ( https://img.shields.io/badge/Made%20With-svelte-orange?style=flat-square )] ( https://github.com/sveltejs/svelte )
7+
8+ Visual Studio Code extension for access to Stack Overflow inside of the editor.
9+
10+ Supports internationalization (Set in configuration)
11+ - English : 🇬🇧 (default)
12+ - Russian : 🇷🇺
13+ - Portuguese : 🇵🇹
14+ - Japanese : 🇯🇵
15+ - Spanish : 🇪🇸
16+
Original file line number Diff line number Diff line change 5656 }
5757
5858 // Search by selected tag
59- function handleTagSearch (tag ) {
60- console .log (" tag" , tag .detail .tag );
61-
62- if (tag .detail .tag ) {
63- const selectedTag = tag .detail .tag ;
59+ function handleTagSearch (event ) {
60+ const selectedTag = event .detail .tag ;
61+ if (selectedTag) {
6462 const baseUri = " https://api.stackexchange.com/2.2" ;
6563 const filter = " !Fu4hf8)e-ZPMLisJD6KbEP37j-" ;
6664 const key = " VP5SbX4dbH8MJUft7hjoaA((" ;
8886 }
8987 }
9088
89+ function handleInputSearch (event ) {
90+ searchQuery = event .detail .query ;
91+ search ();
92+ }
93+
9194 // Main search functionality
9295 function search () {
9396 const baseUri = " https://api.stackexchange.com/2.2" ;
130133{:else if section === ' search' }
131134 <Search
132135 on:gotoQuestion ={handleGotoQuestion }
133- on:searchByTag ={handleTagSearch }
134136 on:gotoTag ={handleGotoTag }
137+ on:searchByTag ={handleTagSearch }
138+ on:searchInput ={handleInputSearch }
135139 {searchQuery }
136140 {vscode }
137141 {searchData }
Original file line number Diff line number Diff line change 1515
1616<SearchTitle {tagData } on:gotoTag />
1717{#if ! tagData }
18- <SearchInput {searchQuery } />
18+ <SearchInput {searchQuery } on:searchInput />
1919{/if }
2020<SearchResultsActions {totalResults } />
2121{#if isLoading }
Original file line number Diff line number Diff line change 11<script >
2+ import { createEventDispatcher } from " svelte" ;
23 export let searchQuery = " " ;
34
5+ const dispatch = createEventDispatcher ();
46 function search (event ) {
5- // TODO: if advanced search tips is open then close it.
7+ dispatch ( " searchInput " , { query : searchQuery });
68 }
79 </script >
810
You can’t perform that action at this time.
0 commit comments