Skip to content

Commit

Permalink
Merge branch 'master' into feature/env-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
liyasthomas authored Feb 24, 2020
2 parents c21bbf1 + 0cfe87e commit 4f7f2ba
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ See the [CHANGELOG](CHANGELOG.md) file for details.
### Lead Developers

* **[Liyas Thomas](https://github.com/liyasthomas)** - *Author*
* **[Caneco](https://twitter.com/caneco)** - *Designer*
* **[John Harker](https://github.com/NBTX)** - *Lead developer*
* **[Andrew Bastin](https://github.com/andrewbastin)** - *Lead developer*
* **[James George](https://github.com/jamesgeorge007)** - *Lead maintainer*
* **[Caneco](https://twitter.com/caneco)** - *Logo and banner designer*

### Testing and Debugging

Expand Down
11 changes: 11 additions & 0 deletions functions/editorutils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const mimeToMode = {
"text/plain": "plain_text",
"text/html": "html",
"application/xml": "xml",
"application/hal+json": "json",
"application/json": "json"
}

export function getEditorLangForMimeType(mimeType) {
return mimeToMode[mimeType] || "plain_text";
}
6 changes: 5 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
<label for="rawBody">{{ $t("raw_request_body") }}</label>
<Editor
v-model="rawParams"
:lang="'json'"
:lang="rawInputEditorLang"
:options="{
maxLines: '16',
minLines: '8',
Expand Down Expand Up @@ -1390,6 +1390,7 @@ import AceEditor from "../components/ace-editor";
import { tokenRequest, oauthRedirect } from "../assets/js/oauth";
import { sendNetworkRequest } from "../functions/network";
import { fb } from "../functions/fb";
import { getEditorLangForMimeType } from "~/functions/editorutils";
const statusCategories = [
{
Expand Down Expand Up @@ -1814,6 +1815,9 @@ export default {
this.$store.commit("setState", { value, attribute: "rawInput" });
}
},
rawInputEditorLang() {
return getEditorLangForMimeType(this.contentType);
},
requestType: {
get() {
return this.$store.state.request.requestType;
Expand Down

0 comments on commit 4f7f2ba

Please sign in to comment.