1
0
Fork 0
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:
Lukas Winkler 2019-04-20 22:08:53 +02:00
parent cabd5161b8
commit a94e4bf547
Signed by: lukas
GPG key ID: 54DE4D798D244853
4 changed files with 7 additions and 7 deletions

View file

@ -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";

View file

@ -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>

View file

@ -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, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); jsonstring = jsonstring.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
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)) {

View file

@ -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>