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">
|
<script lang="ts">
|
||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
import {Version} from "@/interfaces";
|
import {Version} from "@/interfaces";
|
||||||
|
// @ts-ignore
|
||||||
|
import Navbar from "bootstrap-vue/es/components/navbar";
|
||||||
|
Vue.use(Navbar);
|
||||||
|
|
||||||
const versionJSON = "/version.json";
|
const versionJSON = "/version.json";
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
// @ts-ignore
|
|
||||||
import Navbar from "bootstrap-vue/es/components/navbar";
|
|
||||||
Vue.use(Navbar);
|
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
props: ["icon", "title"],
|
props: ["icon", "title"],
|
||||||
|
@ -18,6 +15,5 @@ export default Vue.extend({
|
||||||
.icon {
|
.icon {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
vertical-align: middle;
|
|
||||||
}
|
}
|
||||||
</style>
|
</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 {
|
export function syntaxHighlight(jsonstring: string): string {
|
||||||
// from https://stackoverflow.com/a/7220510/
|
// from https://stackoverflow.com/a/7220510/
|
||||||
jsonstring = jsonstring.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
jsonstring = jsonstring.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
||||||
return jsonstring.replace(regex, (match) => {
|
return jsonstring.replace(regex, (match: string) => {
|
||||||
let cls = "number";
|
let cls = "number";
|
||||||
if (/^"/.test(match)) {
|
if (/^"/.test(match)) {
|
||||||
if (/:$/.test(match)) {
|
if (/:$/.test(match)) {
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="gotData">
|
<div v-if="gotData">
|
||||||
<b-button variant="primary" :aria-expanded="showJSON ? true : false"
|
<b-button variant="primary" :aria-expanded="showJSON"
|
||||||
@click="showJSON=!showJSON">
|
@click="showJSON=!showJSON">
|
||||||
Show Device Detector response
|
Show Device Detector response
|
||||||
</b-button>
|
</b-button>
|
||||||
|
|
Loading…
Reference in a new issue