Skip to content

Commit

Permalink
Tweaking layout
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed May 16, 2017
1 parent 5b65f4a commit 7185072
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 41 deletions.
5 changes: 5 additions & 0 deletions www/assets/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion www/assets/css/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions www/assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,16 @@ pre {
font-size: 1em;
}

.spaced {
margin-bottom: $ten * 2.5;
}

.footer {
.logo {
width: $ten * 16;
}

a {
color: $blue !important;
}
}
15 changes: 14 additions & 1 deletion www/assets/js/app.es6
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
window.requestAnimationFrame(() => {
// Hiding the request tab if read-only
if (!(/(PATCH|PUT|POST)/).test(document.querySelector("#allow").innerText)) {
//document.querySelector("li.request").classList.add("dr-hidden");
document.querySelector("li.request").classList.add("dr-hidden");
}

// Resetting format selection (back button)
Expand All @@ -42,4 +42,17 @@
document.querySelector("#formats").onchange = function (ev) {
window.location = window.location.pathname + "?format=" + ev.target.options[ev.target.selectedIndex].value;
};

// Wiring up JSON validation
document.querySelector("textarea").onchange = function (ev) {
try {
JSON.parse(JSON.stringify(ev.target.value));
ev.target.classList.remove("is-danger");
document.querySelector(".button.is-primary").classList.remove("is-disabled");
} catch (e) {
ev.target.classList.add("is-danger");
document.querySelector(".button.is-primary").classList.add("is-disabled");
console.log(e);
}
}
})();
19 changes: 16 additions & 3 deletions www/assets/js/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion www/assets/js/app.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 42 additions & 35 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="title">
</section>

<section class="section">
<div class="container">
<div class="container spaced">
<div class="tabs">
<ul>
<li class="response">
Expand All @@ -33,12 +33,11 @@ <h1 class="title">
</div>
</div>
<div class="content">
<section class="section">
<div class="container">
<div id="response" class="dr-hidden">
<div class="field">
<label class="label">Formats</label>
<p class="control">
<p class="control spaced">
<span class="select">
<select id="formats">
{{formats}}
Expand All @@ -48,50 +47,58 @@ <h1 class="title">
</div>
<div class="columns">
<div class="column">
<div class="panel">
<div class="panel-block">
<table class="table">
<thead>
<tr>
<th>Header</th>
<th>Value</th>
</tr>
</thead>
<tbody>
{{headers}}
</tbody>
</table>
</div>
<div class="box">
<table class="table">
<thead>
<tr>
<th>Header</th>
<th>Value</th>
</tr>
</thead>
<tbody>
{{headers}}
</tbody>
</table>
</div>
</div>
<div class="column">
<code class="is-marginless is-paddingless">
<pre>{{body}}</pre>
</code>
<div class="box">
<code class="is-marginless is-paddingless">
<pre>{{body}}</pre>
</code>
</div>
</div>
</div>
</div>
<div id="request" class="dr-hidden">
<div class="container">
<div class="field">
<label class="label">Body</label>
<p class="control">
<textarea class="textarea" placeholder="Enter JSON request body here"></textarea>
</p>
</div>
<form>
<div class="field">
<label class="label">Method</label>
<p class="control spaced">
<span class="select">
<select id="methods">
{{methods}}
</select>
</span>
</p>
</div>
<div class="field">
<label class="label">Body</label>
<p class="control">
<textarea class="textarea" placeholder="Enter JSON request body here"></textarea>
</p>
</div>

<div class="field is-grouped">
<p class="control">
<button class="button is-primary">Submit</button>
</p>
<p class="control">
<button class="button is-link">Cancel</button>
</p>
</div>
<div class="field is-grouped">
<p class="control">
<button type="submit" class="button is-primary is-disabled">Submit</button>
</p>
</div>
</form>
</div>
</div>
</div>
</section>
</div>
</section>

Expand Down

0 comments on commit 7185072

Please sign in to comment.