mirror of
https://github.com/Findus23/devicedetector.net.git
synced 2024-09-19 15:43:46 +02:00
minor style improvements
This commit is contained in:
parent
cabd5161b8
commit
a94e4bf547
4 changed files with 7 additions and 7 deletions
|
@ -45,6 +45,9 @@
|
|||
<script lang="ts">
|
||||
import Vue from "vue";
|
||||
import {Version} from "@/interfaces";
|
||||
// @ts-ignore
|
||||
import Navbar from "bootstrap-vue/es/components/navbar";
|
||||
Vue.use(Navbar);
|
||||
|
||||
const versionJSON = "/version.json";
|
||||
|
||||
|
|
|
@ -4,9 +4,6 @@
|
|||
</template>
|
||||
<script lang="ts">
|
||||
import Vue from "vue";
|
||||
// @ts-ignore
|
||||
import Navbar from "bootstrap-vue/es/components/navbar";
|
||||
Vue.use(Navbar);
|
||||
|
||||
export default Vue.extend({
|
||||
props: ["icon", "title"],
|
||||
|
@ -18,6 +15,5 @@ export default Vue.extend({
|
|||
.icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
const regex = /("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g;
|
||||
// tslint:disable-next-line
|
||||
const regex = "/(\"(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\\"])*\"(\s*:)?|\b(tru./e|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g\"";
|
||||
|
||||
export function syntaxHighlight(jsonstring: string): string {
|
||||
// from https://stackoverflow.com/a/7220510/
|
||||
jsonstring = jsonstring.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
||||
return jsonstring.replace(regex, (match) => {
|
||||
return jsonstring.replace(regex, (match: string) => {
|
||||
let cls = "number";
|
||||
if (/^"/.test(match)) {
|
||||
if (/:$/.test(match)) {
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div v-if="gotData">
|
||||
<b-button variant="primary" :aria-expanded="showJSON ? true : false"
|
||||
<b-button variant="primary" :aria-expanded="showJSON"
|
||||
@click="showJSON=!showJSON">
|
||||
Show Device Detector response
|
||||
</b-button>
|
||||
|
|
Loading…
Reference in a new issue