Improve warning and embed block
This commit is contained in:
parent
cefdf76045
commit
d9b5af7388
36
.eslintrc.js
36
.eslintrc.js
|
@ -3,12 +3,42 @@ module.exports = {
|
|||
env: {
|
||||
node: true
|
||||
},
|
||||
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
|
||||
parserOptions: {
|
||||
parser: "babel-eslint"
|
||||
},
|
||||
rules: {
|
||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
|
||||
semi: [
|
||||
'error',
|
||||
'always',
|
||||
],
|
||||
quotes: [
|
||||
2,
|
||||
'single',
|
||||
],
|
||||
'comma-dangle': [
|
||||
'error',
|
||||
{
|
||||
'arrays': 'always-multiline',
|
||||
'objects': 'always-multiline',
|
||||
'imports': 'always-multiline',
|
||||
'exports': 'always-multiline',
|
||||
'functions': 'never'
|
||||
}
|
||||
],
|
||||
'space-before-function-paren': [
|
||||
'error',
|
||||
'never',
|
||||
],
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'max-len': ['warn', {
|
||||
'code': 100,
|
||||
'ignoreStrings': true,
|
||||
}]
|
||||
},
|
||||
|
||||
extends: [
|
||||
'plugin:vue/recommended',
|
||||
'eslint:recommended',
|
||||
],
|
||||
};
|
||||
|
|
2539
dist/block-renderer.common.js
vendored
2539
dist/block-renderer.common.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/block-renderer.common.js.map
vendored
2
dist/block-renderer.common.js.map
vendored
File diff suppressed because one or more lines are too long
2539
dist/block-renderer.umd.js
vendored
2539
dist/block-renderer.umd.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/block-renderer.umd.js.map
vendored
2
dist/block-renderer.umd.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/block-renderer.umd.min.js
vendored
2
dist/block-renderer.umd.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/block-renderer.umd.min.js.map
vendored
2
dist/block-renderer.umd.min.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "block-renderer",
|
||||
"description": "Content renderer for JSON blocks from Editor.js",
|
||||
"version": "0.5.2",
|
||||
"version": "0.6.2",
|
||||
"author": "KingOfDog <info@kingofdog.de>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -1,19 +1,54 @@
|
|||
<template>
|
||||
<figure>
|
||||
<figure class="embed-block">
|
||||
<div class="embed-container">
|
||||
<iframe
|
||||
v-if="accepted"
|
||||
:src="data.embed"
|
||||
:height="data.height"
|
||||
frameborder="0"
|
||||
allowfullscreen
|
||||
class="w-full"
|
||||
></iframe>
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="embed-accept"
|
||||
>
|
||||
<h2>Externer Inhalt</h2>
|
||||
<h3>
|
||||
Originaler Link: <a
|
||||
:href="data.source"
|
||||
target="_blank"
|
||||
>{{ displayUrl }}</a>
|
||||
</h3>
|
||||
<p>
|
||||
An dieser Stelle ist externer Inhalt eingebunden. Um den Datenschutz
|
||||
zu gewährleisten, ist er derzeit ausgeblendet. Deine Privatsphäre kann
|
||||
auf externen Seiten nicht sichergestellt werden. Möchtest du den
|
||||
Inhalt dennoch anzeigen?
|
||||
</p>
|
||||
<button @click="accepted = true">
|
||||
Anzeigen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<figcaption v-html="data.caption"></figcaption>
|
||||
<figcaption v-html="data.caption" />
|
||||
</figure>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ["data"]
|
||||
props: ['data'],
|
||||
data() {
|
||||
return { accepted: false };
|
||||
},
|
||||
computed: {
|
||||
displayUrl() {
|
||||
if (!this.data) {
|
||||
return '';
|
||||
}
|
||||
const url = new URL(this.data.source);
|
||||
return url.hostname;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
<template>
|
||||
<div class="warning-block">
|
||||
<p class="font-semibold mb-4 text-white">{{data.title}}</p>
|
||||
<p v-html="data.message" class="text-white"></p>
|
||||
<b v-html="title"></b>
|
||||
<p v-html="data.message"></p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ["data"],
|
||||
computed: {
|
||||
title() {
|
||||
return this.data.title ? this.data.title.replace(/<br>/g, "") : "";
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user