Refactor UI

This commit is contained in:
Liyas Thomas
2020-12-11 15:59:03 +05:30
parent 1e6773deb5
commit 773423069b
31 changed files with 1005 additions and 1083 deletions

View File

@@ -324,13 +324,12 @@ hr {
}
.info:not(.toasted) {
@apply m-2;
@apply m-4;
@apply text-fgLightColor;
.material-icons {
@apply align-middle;
@apply ml-2;
@apply mr-4;
@apply mr-2;
}
}

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("new_collection") }}</h3>
<div>
@@ -11,20 +9,16 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<label for="selectLabel">{{ $t("label") }}</label>
<input
type="text"
id="selectLabel"
v-model="name"
:placeholder="$t('my_new_collection')"
@keyup.enter="addNewCollection"
/>
</li>
</ul>
</div>
<div slot="footer">
<div class="row-wrapper">

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="show = false">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("new_folder") }}</h3>
<div>
@@ -11,20 +9,16 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<label for="selectLabel">{{ $t("label") }}</label>
<input
type="text"
id="selectLabel"
v-model="name"
:placeholder="$t('my_new_folder')"
@keyup.enter="addFolder"
/>
</li>
</ul>
</div>
<div slot="footer">
<div class="row-wrapper">

View File

@@ -76,7 +76,7 @@
/>
</li>
<li v-if="collection.folders.length === 0 && collection.requests.length === 0">
<label>{{ $t("collection_empty") }}</label>
<p class="info">{{ $t("collection_empty") }}</p>
</li>
</ul>
<ul class="flex-col">

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("edit_collection") }}</h3>
<div>
@@ -11,20 +9,16 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<label for="selectLabel">{{ $t("label") }}</label>
<input
type="text"
id="selectLabel"
v-model="name"
:placeholder="editingCollection.name"
@keyup.enter="saveCollection"
/>
</li>
</ul>
</div>
<div slot="footer">
<div class="row-wrapper">

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="show = false">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("edit_folder") }}</h3>
<div>
@@ -11,15 +9,16 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<input type="text" v-model="name" :placeholder="folder.name" @keyup.enter="editFolder" />
</li>
</ul>
<label for="selectLabel">{{ $t("label") }}</label>
<input
type="text"
id="selectLabel"
v-model="name"
:placeholder="folder.name"
@keyup.enter="editFolder"
/>
</div>
<div slot="footer">
<div class="row-wrapper">

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("edit_request") }}</h3>
<div>
@@ -11,8 +9,6 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<label for="selectLabel">{{ $t("label") }}</label>

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("import_export") }} {{ $t("collections") }}</h3>
<div>
@@ -13,7 +11,7 @@
<template slot="popover">
<div>
<button class="icon" @click="readCollectionGist" v-close-popover>
<i class="material-icons">code</i>
<i class="material-icons">assignment_returned</i>
<span>{{ $t("import_from_gist") }}</span>
</button>
</div>
@@ -28,17 +26,13 @@
>
<button
:disabled="
!fb.currentUser
? true
: fb.currentUser.provider !== 'github.com'
? true
: false
!fb.currentUser ? true : fb.currentUser.provider !== 'github.com' ? true : false
"
class="icon"
@click="createCollectionGist"
v-close-popover
>
<i class="material-icons">code</i>
<i class="material-icons">assignment_turned_in</i>
<span>{{ $t("create_secret_gist") }}</span>
</button>
</div>
@@ -49,7 +43,9 @@
</button>
</div>
</div>
<div class="row-wrapper">
</div>
<div slot="body">
<div class="flex flex-col items-start">
<span
v-tooltip="{
content: !fb.currentUser ? $t('login_first') : $t('replace_current'),
@@ -91,15 +87,17 @@
/>
</button>
</div>
</li>
</ul>
<div v-if="showJsonCode" class="row-wrapper">
<textarea v-model="collectionJson" rows="8" readonly></textarea>
</div>
<div slot="body">
<textarea v-model="collectionJson" rows="8"></textarea>
</div>
<div slot="footer">
<div class="row-wrapper">
<span></span>
<span>
<pw-toggle :on="showJsonCode" @change="showJsonCode = $event">
{{ $t("show_code") }}
</pw-toggle>
</span>
<span>
<button class="icon" @click="hideModal">
{{ $t("cancel") }}
@@ -120,6 +118,7 @@ export default {
data() {
return {
fb,
showJsonCode: false,
}
},
props: {

View File

@@ -89,11 +89,9 @@ TODO:
</li>
</ul>
</div>
<ul class="flex-col" v-if="filterText && filteredCollections.length === 0">
<li>
<label>{{ $t("nothing_found") }} "{{ filterText }}"</label>
</li>
</ul>
<p v-if="filterText && filteredCollections.length === 0" class="info">
{{ $t("nothing_found") }} "{{ filterText }}"
</p>
</pw-section>
</template>

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("save_request_as") }}</h3>
<div>
@@ -11,19 +9,12 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<label for="selectLabel">{{ $t("token_req_name") }}</label>
<input type="text" id="selectLabel" v-model="requestData.name" @keyup.enter="saveRequestAs" />
<ul>
<li>
<label for="selectLabel">{{ $t("token_req_name") }}</label>
<input
type="text"
id="selectLabel"
v-model="requestData.name"
@keyup.enter="saveRequestAs"
/>
<label for="selectCollection">{{ $t("collection") }}</label>
<span class="select-wrapper">
<select type="text" id="selectCollection" v-model="requestData.collectionIndex">
@@ -39,6 +30,8 @@
</option>
</select>
</span>
</li>
</ul>
<label>{{ $t("folder") }}</label>
<autocomplete
:placeholder="$t('search')"
@@ -46,6 +39,8 @@
:spellcheck="false"
v-model="requestData.folderName"
/>
<ul>
<li>
<label for="selectRequest">{{ $t("request") }}</label>
<span class="select-wrapper">
<select type="text" id="selectRequest" v-model="requestData.requestIndex">

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("new_environment") }}</h3>
<div>
@@ -11,20 +9,16 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<label for="selectLabel">{{ $t("label") }}</label>
<input
type="text"
id="selectLabel"
v-model="name"
:placeholder="$t('my_new_environment')"
@keyup.enter="addNewEnvironment"
/>
</li>
</ul>
</div>
<div slot="footer">
<div class="row-wrapper">

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("edit_environment") }}</h3>
<div>
@@ -11,22 +9,16 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<label for="selectLabel">{{ $t("label") }}</label>
<input
type="text"
id="selectLabel"
v-model="name"
:placeholder="editingEnvironment.name"
@keyup.enter="saveEnvironment"
/>
</li>
</ul>
<ul>
<li>
<div class="row-wrapper">
<label for="variableList">{{ $t("env_variable_list") }}</label>
<div>
@@ -35,8 +27,6 @@
</button>
</div>
</div>
</li>
</ul>
<ul v-for="(variable, index) in this.editingEnvCopy.variables" :key="index">
<li>
<input

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("import_export") }} {{ $t("environments") }}</h3>
<div>
@@ -13,7 +11,7 @@
<template slot="popover">
<div>
<button class="icon" @click="readEnvironmentGist" v-close-popover>
<i class="material-icons">code</i>
<i class="material-icons">assignment_returned</i>
<span>{{ $t("import_from_gist") }}</span>
</button>
</div>
@@ -28,17 +26,13 @@
>
<button
:disabled="
!fb.currentUser
? true
: fb.currentUser.provider !== 'github.com'
? true
: false
!fb.currentUser ? true : fb.currentUser.provider !== 'github.com' ? true : false
"
class="icon"
@click="createEnvironmentGist"
v-close-popover
>
<i class="material-icons">code</i>
<i class="material-icons">assignment_turned_in</i>
<span>{{ $t("create_secret_gist") }}</span>
</button>
</div>
@@ -49,7 +43,9 @@
</button>
</div>
</div>
<div class="row-wrapper">
</div>
<div slot="body">
<div class="flex flex-col items-start">
<span
v-tooltip="{
content: !fb.currentUser ? $t('login_first') : $t('replace_current'),
@@ -91,15 +87,17 @@
/>
</button>
</div>
</li>
</ul>
<div v-if="showJsonCode" class="row-wrapper">
<textarea v-model="environmentJson" rows="8" readonly></textarea>
</div>
<div slot="body">
<textarea v-model="environmentJson" rows="8"></textarea>
</div>
<div slot="footer">
<div class="row-wrapper">
<span></span>
<span>
<pw-toggle :on="showJsonCode" @change="showJsonCode = $event">
{{ $t("show_code") }}
</pw-toggle>
</span>
<span>
<button class="icon" @click="hideModal">
{{ $t("cancel") }}
@@ -120,6 +118,7 @@ export default {
data() {
return {
fb,
showJsonCode: false,
}
},
props: {

View File

@@ -1,8 +1,6 @@
<template>
<div>
<ul class="flex-col">
<div class="flex-col">
<div class="show-on-large-screen">
<li>
<input
:aria-label="$t('label')"
type="text"
@@ -11,10 +9,8 @@
:placeholder="$t('paste_a_note')"
@keyup.enter="formPost"
/>
</li>
</div>
<div class="show-on-large-screen">
<li>
<input
:aria-label="$t('label')"
type="text"
@@ -23,18 +19,11 @@
:placeholder="$t('label')"
@keyup.enter="formPost"
/>
</li>
<button
class="icon"
:disabled="!(this.message || this.label)"
value="Save"
@click="formPost"
>
<button class="icon" :disabled="!(this.message || this.label)" value="Save" @click="formPost">
<i class="material-icons">add</i>
<span>Add</span>
</button>
</div>
</ul>
</div>
</template>

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("generate_code") }}</h3>
<div>
@@ -11,12 +9,8 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<label for="requestType">{{ $t("request_type") }}</label>
<span class="select-wrapper">
<v-popover>
@@ -39,10 +33,6 @@
</template>
</v-popover>
</span>
</li>
</ul>
<ul>
<li>
<div class="row-wrapper">
<label for="generatedCode">{{ $t("generated_code") }}</label>
<div>
@@ -65,8 +55,6 @@
v-model="requestCode"
readonly
></textarea>
</li>
</ul>
</div>
</modal>
</template>

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("import_curl") }}</h3>
<div>
@@ -11,15 +9,9 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<textarea id="import-curl" autofocus rows="8" :placeholder="$t('enter_curl')"></textarea>
</li>
</ul>
</div>
<div slot="footer">
<div class="row-wrapper">

View File

@@ -5,14 +5,8 @@
<feeds />
</div>
<div v-else>
<ul>
<li>
<label>{{ $t("login_first") }}</label>
<p>
<p class="info">{{ $t("login_first") }}</p>
<login />
</p>
</li>
</ul>
</div>
</pw-section>
</template>

View File

@@ -1,8 +1,6 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("manage_token") }}</h3>
<div>
@@ -11,12 +9,8 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<div class="row-wrapper">
<label for="token-list">{{ $t("token_list") }}</label>
<div v-if="tokens.length != 0">
@@ -29,8 +23,6 @@
</button>
</div>
</div>
</li>
</ul>
<ul id="token-list" v-for="(token, index) in tokens" :key="index">
<li>
<input

View File

@@ -129,11 +129,9 @@
</transition>
</ul>
</div>
<ul :class="{ hidden: filteredHistory.length != 0 || history.length === 0 }">
<li>
<label>{{ $t("nothing_found") }} "{{ filterText }}"</label>
</li>
</ul>
<p :class="{ hidden: filteredHistory.length != 0 || history.length === 0 }" class="info">
{{ $t("nothing_found") }} "{{ filterText }}"
</p>
<p v-if="history.length === 0" class="info">
<i class="material-icons">schedule</i> {{ $t("history_empty") }}
</p>

View File

@@ -124,167 +124,15 @@
</v-popover>
</span>
</div>
<modal v-if="showExtensions" @close="showExtensions = false">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("extensions") }}</h3>
<div>
<button class="icon" @click="showExtensions = false">
<i class="material-icons">close</i>
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<p class="info">
{{ $t("extensions_info1") }}
</p>
<div>
<a
href="https://addons.mozilla.org/en-US/firefox/addon/hoppscotch"
target="_blank"
rel="noopener"
>
<button class="icon">
<svg class="material-icons" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path
d="M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm8.003 8.657c-1.276-3.321-4.46-4.605-5.534-4.537 3.529 1.376 4.373 6.059 4.06 7.441-.307-1.621-1.286-3.017-1.872-3.385 3.417 8.005-4.835 10.465-7.353 7.687.649.168 1.931.085 2.891-.557.898-.602.983-.638 1.56-.683.686-.053-.041-1.406-1.539-1.177-.616.094-1.632.819-2.88.341-1.508-.576-1.46-2.634.096-2.015.337-.437.088-1.263.088-1.263.452-.414 1.022-.706 1.37-.911.228-.135.829-.507.795-1.23-.123-.096-.32-.219-.766-.193-1.736.11-1.852-.518-1.967-.808.078-.668.524-1.534 1.361-1.931-1.257-.193-2.28.397-2.789 1.154-.809-.174-1.305-.183-2.118-.031-.316-.24-.666-.67-.878-1.181C6.36 3.312 9.027 2 12 2c5.912 0 8.263 4.283 8.003 6.657z"
/>
</svg>
<span>Firefox</span>
<span class="icon" v-if="hasFirefoxExtInstalled" v-tooltip="$t('installed')">
<i class="material-icons">done</i>
</span>
</button>
</a>
</div>
<div>
<a
href="https://chrome.google.com/webstore/detail/hoppscotch-browser-extens/amknoiejhlmhancpahfcfcfhllgkpbld"
target="_blank"
rel="noopener"
>
<button class="icon">
<svg class="material-icons" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path
d="M2.897 4.181A11.87 11.87 0 0111.969 0c4.288 0 8.535 2.273 10.717 6.554h-9.293c-1.674.001-2.755-.037-3.926.579-1.376.724-2.415 2.067-2.777 3.644L2.897 4.181zM8.007 12c0 2.2 1.789 3.99 3.988 3.99s3.988-1.79 3.988-3.99-1.789-3.991-3.988-3.991S8.007 9.8 8.007 12zm5.536 5.223c-2.238.666-4.858-.073-6.293-2.549-1.095-1.891-3.989-6.933-5.305-9.225A11.856 11.856 0 000 11.956c0 5.448 3.726 10.65 9.673 11.818l3.87-6.551zm2.158-9.214a5.463 5.463 0 011.007 6.719 1815.43 1815.43 0 01-5.46 9.248C18.437 24.419 24 18.616 24 12.004c0-1.313-.22-2.66-.69-3.995h-7.609z"
/>
</svg>
<span>Chrome</span>
<span class="icon" v-if="hasChromeExtInstalled" v-tooltip="$t('installed')">
<i class="material-icons">done</i>
</span>
</button>
</a>
</div>
</div>
<div slot="footer"></div>
</modal>
<modal v-if="showShortcuts" @close="showShortcuts = false">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("shortcuts") }}</h3>
<div>
<button class="icon" @click="showShortcuts = false">
<i class="material-icons">close</i>
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<div>
<kbd>{{ getSpecialKey() }}</kbd>
+
<kbd>G</kbd>
<label>{{ $t("send_request") }}</label>
</div>
<div>
<kbd>{{ getSpecialKey() }}</kbd
>+<kbd>S</kbd>
<label>{{ $t("save_to_collections") }}</label>
</div>
<div>
<kbd>{{ getSpecialKey() }}</kbd
>+<kbd>K</kbd>
<label>{{ $t("copy_request_link") }}</label>
</div>
<div>
<kbd>{{ getSpecialKey() }}</kbd
>+<kbd>I</kbd>
<label>{{ $t("reset_request") }}</label>
</div>
<hr />
<div>
<kbd>Alt</kbd>+<kbd>▲</kbd>
<label>{{ $t("select_next_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd>▼</kbd>
<label>{{ $t("select_previous_method") }}</label>
</div>
<hr />
<div>
<kbd>Alt</kbd>+<kbd>G</kbd>
<label>{{ $t("select_get_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd>H</kbd>
<label>{{ $t("select_head_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd>P</kbd>
<label>{{ $t("select_post_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd>U</kbd>
<label>{{ $t("select_put_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd>X</kbd>
<label>{{ $t("select_delete_method") }}</label>
</div>
</div>
<div slot="footer"></div>
</modal>
<modal v-if="showSupport" @close="showSupport = false">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("support_us") }}</h3>
<div>
<button class="icon" @click="showSupport = false">
<i class="material-icons">close</i>
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<contributors />
</div>
<div slot="footer"></div>
</modal>
<extensions :show="showExtensions" @hide-modal="showExtensions = false" />
<shortcuts :show="showShortcuts" @hide-modal="showShortcuts = false" />
<support :show="showSupport" @hide-modal="showSupport = false" />
</header>
</template>
<style scoped lang="scss">
$responsiveWidth: 768px;
kbd {
@apply inline-flex;
@apply resize-none;
}
@keyframes slideIn {
0% {
@apply opacity-0;
@@ -316,12 +164,7 @@ kbd {
<script>
import intializePwa from "~/helpers/pwa"
import {
hasExtensionInstalled,
hasChromeExtensionInstalled,
hasFirefoxExtensionInstalled,
} from "~/helpers/strategies/ExtensionStrategy"
import { getPlatformSpecialKey } from "~/helpers/platformutils"
import { hasExtensionInstalled } from "~/helpers/strategies/ExtensionStrategy"
import { fb } from "~/helpers/fb"
export default {
@@ -332,19 +175,23 @@ export default {
// prompt.
showInstallPrompt: null,
showExtensions: false,
hasChromeExtInstalled: hasChromeExtensionInstalled(),
hasFirefoxExtInstalled: hasFirefoxExtensionInstalled(),
showShortcuts: false,
showSupport: false,
fb,
navigatorShare: navigator.share,
fb,
}
},
async mounted() {
this._keyListener = function (e) {
if (e.key === "Escape") {
e.preventDefault()
this.showExtensions = this.showShortcuts = this.showSupport = false
}
}
document.addEventListener("keydown", this._keyListener.bind(this))
mounted() {
// Initializes the PWA code - checks if the app is installed,
// etc.
;(async () => {
this.showInstallPrompt = await intializePwa()
let cookiesAllowed = localStorage.getItem("cookiesAllowed") === "yes"
if (!cookiesAllowed) {
@@ -394,7 +241,6 @@ export default {
}
let showExtensionsToast = localStorage.getItem("showExtensionsToast") === "yes"
// Just return if showExtensionsToast is "no"
if (!showExtensionsToast) return
@@ -428,19 +274,8 @@ export default {
})
}
}, 5000)
this._keyListener = function (e) {
if (e.key === "Escape") {
e.preventDefault()
this.showExtensions = this.showShortcuts = this.showSupport = false
}
}
document.addEventListener("keydown", this._keyListener.bind(this))
})()
},
methods: {
getSpecialKey: getPlatformSpecialKey,
nativeShare() {
if (navigator.share) {
navigator
@@ -457,5 +292,8 @@ export default {
}
},
},
beforeDestroy() {
document.removeEventListener("keydown", this._keyListener)
},
}
</script>

View File

@@ -1,10 +1,8 @@
<template>
<div>
<ul v-for="(value, key) in headers" :key="key">
<li>
<p v-for="(value, key) in headers" :key="key">
<input :value="`${key} → ${value}`" :name="key" class="bg-transparent" readonly />
</li>
</ul>
</p>
</div>
</template>

View File

@@ -1,6 +1,5 @@
<template>
<ul>
<li>
<div>
<div class="row-wrapper">
<label for="body">{{ $t("response") }}</label>
<div>
@@ -70,8 +69,7 @@
src="about:blank"
></iframe>
</div>
</li>
</ul>
</div>
</template>
<script>

View File

@@ -1,6 +1,5 @@
<template>
<ul>
<li>
<div>
<div class="row-wrapper">
<label for="body">{{ $t("response") }}</label>
<div>
@@ -18,8 +17,7 @@
<div id="response-details-wrapper">
<img class="max-w-full" :src="imageSource" />
</div>
</li>
</ul>
</div>
</template>
<script>

View File

@@ -1,6 +1,5 @@
<template>
<ul>
<li>
<div>
<div class="row-wrapper">
<label for="body">{{ $t("response") }}</label>
<div>
@@ -55,8 +54,7 @@
}"
/>
</div>
</li>
</ul>
</div>
</template>
<script>

View File

@@ -1,6 +1,5 @@
<template>
<ul>
<li>
<div>
<div class="row-wrapper">
<label for="body">{{ $t("response") }}</label>
<div>
@@ -52,8 +51,7 @@
}"
/>
</div>
</li>
</ul>
</div>
</template>
<script>

View File

@@ -1,6 +1,5 @@
<template>
<ul>
<li>
<div>
<div class="row-wrapper">
<label for="body">{{ $t("response") }}</label>
<div>
@@ -52,8 +51,7 @@
}"
/>
</div>
</li>
</ul>
</div>
</template>
<script>

View File

@@ -0,0 +1,82 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<div class="row-wrapper">
<h3 class="title">{{ $t("extensions") }}</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
</button>
</div>
</div>
</div>
<div slot="body">
<p class="info">
{{ $t("extensions_info1") }}
</p>
<div>
<a
href="https://addons.mozilla.org/en-US/firefox/addon/hoppscotch"
target="_blank"
rel="noopener"
>
<button class="icon">
<svg class="material-icons" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path
d="M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm8.003 8.657c-1.276-3.321-4.46-4.605-5.534-4.537 3.529 1.376 4.373 6.059 4.06 7.441-.307-1.621-1.286-3.017-1.872-3.385 3.417 8.005-4.835 10.465-7.353 7.687.649.168 1.931.085 2.891-.557.898-.602.983-.638 1.56-.683.686-.053-.041-1.406-1.539-1.177-.616.094-1.632.819-2.88.341-1.508-.576-1.46-2.634.096-2.015.337-.437.088-1.263.088-1.263.452-.414 1.022-.706 1.37-.911.228-.135.829-.507.795-1.23-.123-.096-.32-.219-.766-.193-1.736.11-1.852-.518-1.967-.808.078-.668.524-1.534 1.361-1.931-1.257-.193-2.28.397-2.789 1.154-.809-.174-1.305-.183-2.118-.031-.316-.24-.666-.67-.878-1.181C6.36 3.312 9.027 2 12 2c5.912 0 8.263 4.283 8.003 6.657z"
/>
</svg>
<span>Firefox</span>
<span class="icon" v-if="hasFirefoxExtInstalled" v-tooltip="$t('installed')">
<i class="material-icons">done</i>
</span>
</button>
</a>
</div>
<div>
<a
href="https://chrome.google.com/webstore/detail/hoppscotch-browser-extens/amknoiejhlmhancpahfcfcfhllgkpbld"
target="_blank"
rel="noopener"
>
<button class="icon">
<svg class="material-icons" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path
d="M2.897 4.181A11.87 11.87 0 0111.969 0c4.288 0 8.535 2.273 10.717 6.554h-9.293c-1.674.001-2.755-.037-3.926.579-1.376.724-2.415 2.067-2.777 3.644L2.897 4.181zM8.007 12c0 2.2 1.789 3.99 3.988 3.99s3.988-1.79 3.988-3.99-1.789-3.991-3.988-3.991S8.007 9.8 8.007 12zm5.536 5.223c-2.238.666-4.858-.073-6.293-2.549-1.095-1.891-3.989-6.933-5.305-9.225A11.856 11.856 0 000 11.956c0 5.448 3.726 10.65 9.673 11.818l3.87-6.551zm2.158-9.214a5.463 5.463 0 011.007 6.719 1815.43 1815.43 0 01-5.46 9.248C18.437 24.419 24 18.616 24 12.004c0-1.313-.22-2.66-.69-3.995h-7.609z"
/>
</svg>
<span>Chrome</span>
<span class="icon" v-if="hasChromeExtInstalled" v-tooltip="$t('installed')">
<i class="material-icons">done</i>
</span>
</button>
</a>
</div>
</div>
<div slot="footer"></div>
</modal>
</template>
<script>
import {
hasChromeExtensionInstalled,
hasFirefoxExtensionInstalled,
} from "~/helpers/strategies/ExtensionStrategy"
export default {
props: {
show: Boolean,
},
data() {
return {
hasChromeExtInstalled: hasChromeExtensionInstalled(),
hasFirefoxExtInstalled: hasFirefoxExtensionInstalled(),
}
},
methods: {
hideModal() {
this.$emit("hide-modal")
},
},
}
</script>

View File

@@ -0,0 +1,91 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<div class="row-wrapper">
<h3 class="title">{{ $t("shortcuts") }}</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
</button>
</div>
</div>
</div>
<div slot="body">
<div>
<kbd>{{ getSpecialKey() }}</kbd>
+
<kbd>G</kbd>
<label>{{ $t("send_request") }}</label>
</div>
<div>
<kbd>{{ getSpecialKey() }}</kbd
>+<kbd>S</kbd>
<label>{{ $t("save_to_collections") }}</label>
</div>
<div>
<kbd>{{ getSpecialKey() }}</kbd
>+<kbd>K</kbd>
<label>{{ $t("copy_request_link") }}</label>
</div>
<div>
<kbd>{{ getSpecialKey() }}</kbd
>+<kbd>I</kbd>
<label>{{ $t("reset_request") }}</label>
</div>
<hr />
<div>
<kbd>Alt</kbd>+<kbd></kbd>
<label>{{ $t("select_next_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd></kbd>
<label>{{ $t("select_previous_method") }}</label>
</div>
<hr />
<div>
<kbd>Alt</kbd>+<kbd>G</kbd>
<label>{{ $t("select_get_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd>H</kbd>
<label>{{ $t("select_head_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd>P</kbd>
<label>{{ $t("select_post_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd>U</kbd>
<label>{{ $t("select_put_method") }}</label>
</div>
<div>
<kbd>Alt</kbd>+<kbd>X</kbd>
<label>{{ $t("select_delete_method") }}</label>
</div>
</div>
<div slot="footer"></div>
</modal>
</template>
<style scoped lang="scss">
kbd {
@apply inline-flex;
@apply resize-none;
}
</style>
<script>
import { getPlatformSpecialKey } from "~/helpers/platformutils"
export default {
props: {
show: Boolean,
},
methods: {
getSpecialKey: getPlatformSpecialKey,
hideModal() {
this.$emit("hide-modal")
},
},
}
</script>

View File

@@ -0,0 +1,31 @@
<template>
<modal v-if="show" @close="hideModal">
<div slot="header">
<div class="row-wrapper">
<h3 class="title">{{ $t("support_us") }}</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
</button>
</div>
</div>
</div>
<div slot="body">
<contributors />
</div>
<div slot="footer"></div>
</modal>
</template>
<script>
export default {
props: {
show: Boolean,
},
methods: {
hideModal() {
this.$emit("hide-modal")
},
},
}
</script>

View File

@@ -89,7 +89,7 @@
class="icon"
@click="createDocsGist"
>
<i class="material-icons">code</i>
<i class="material-icons">assignment</i>
<span>{{ $t("create_secret_gist") }}</span>
</button>
</div>

View File

@@ -724,8 +724,6 @@
<modal v-if="showTokenRequestList" @close="showTokenRequestList = false">
<div slot="header">
<ul>
<li>
<div class="row-wrapper">
<h3 class="title">{{ $t("manage_token_req") }}</h3>
<div>
@@ -734,12 +732,8 @@
</button>
</div>
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<div class="row-wrapper">
<label for="token-req-list">{{ $t("token_req_list") }}</label>
<div>
@@ -761,6 +755,8 @@
</button>
</div>
</div>
<ul>
<li>
<span class="select-wrapper">
<select
id="token-req-list"
@@ -775,20 +771,12 @@
</span>
</li>
</ul>
<ul>
<li>
<label for="token-req-name">{{ $t("token_req_name") }}</label>
<input v-model="tokenReqName" />
</li>
</ul>
<ul>
<li>
<label for="token-req-details">
{{ $t("token_req_details") }}
</label>
<textarea id="token-req-details" readonly rows="7" v-model="tokenReqDetails"></textarea>
</li>
</ul>
</div>
<div slot="footer">
<div class="row-wrapper">