From ec12171e803f3bb80f9c3eba7e3b10d1320fccfb Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 2 Oct 2019 15:11:43 +0200 Subject: [PATCH 1/7] style embed overlay --- webapp/components/Editor/Editor.vue | 33 ++++++++++++++++ webapp/components/Editor/nodes/Embed.js | 50 +++++++++++-------------- 2 files changed, 54 insertions(+), 29 deletions(-) diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index 8d3ce281b..2cdff0814 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -342,4 +342,37 @@ li > p { margin: 0 0 $space-x-small; } } + +.embed-container { + position: relative; + border-radius: $border-radius-base; + border: 1px solid $color-neutral-70; + padding: $space-x-small; + overflow: hidden; +} + +.embed-overlay { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + + padding: $space-large; + background-color: $color-neutral-100; +} + +.embed-buttons { + button { + margin-right: $space-small; + } +} + +.embed-checkbox { + display: flex; + + input { + margin-right: $space-small; + } +} diff --git a/webapp/components/Editor/nodes/Embed.js b/webapp/components/Editor/nodes/Embed.js index 4be49ee0c..92aee59fc 100644 --- a/webapp/components/Editor/nodes/Embed.js +++ b/webapp/components/Editor/nodes/Embed.js @@ -4,35 +4,28 @@ import { compileToFunctions } from 'vue-template-compiler' import { mapGetters, mapMutations } from 'vuex' import { allowEmbedIframesMutation } from '~/graphql/User.js' -const template = ` - - - - Deine Daten sind noch nicht weitergegeben. Wenn Du die das jetzt ansiehst dann werden auch Daten mit dem Anbieter ({{embedPublisher}}) ausgetauscht! - Du verlässt jetzt Human Connection! Du wirst zu ({{embedPublisher}}) weitergeleitet! - jetzt ansehen - Webseite aufrufen -

- - - - automatisches Einbinden zulassen? | - - - automatisches Einbinden zugelassen | - -

- - dataEmbedUrl -
-

-

{{ embedTitle }}
-
{{ embedDescription }}
- - {{ dataEmbedUrl }} - - +const template = ` + + + dataEmbedUrl +
+

+

{{ embedTitle }}
+
{{ embedDescription }}
+ + {{ dataEmbedUrl }} + ` const compiledTemplate = compileToFunctions(template) @@ -166,7 +159,6 @@ export default class Embed extends Node { } else { this.submit(false) } - this.showOverlay = false }, allowEmbedTemporar(xx) { if (!this.isOnlyLink) { From 99629991d090814b09fb37fff7067e982ea726e4 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 2 Oct 2019 15:49:23 +0200 Subject: [PATCH 2/7] style embed preview --- webapp/components/Editor/Editor.vue | 27 +++++++++++++++++++++++-- webapp/components/Editor/nodes/Embed.js | 20 +++++++++--------- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index 2cdff0814..ca632aa16 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -345,10 +345,33 @@ li > p { .embed-container { position: relative; + padding: 0; + margin: $space-small auto; + overflow: hidden; border-radius: $border-radius-base; border: 1px solid $color-neutral-70; - padding: $space-x-small; - overflow: hidden; + background-color: $color-neutral-90; +} + +.embed-content { + width: 100%; + height: 100%; + cursor: pointer; + + h4 { + margin: $space-small 0 0 $space-small; + } + + p, + a { + display: block; + margin: 0 0 0 $space-small; + } +} + +.embed-preview-image { + width: 100%; + height: auto; } .embed-overlay { diff --git a/webapp/components/Editor/nodes/Embed.js b/webapp/components/Editor/nodes/Embed.js index 92aee59fc..3513b6c41 100644 --- a/webapp/components/Editor/nodes/Embed.js +++ b/webapp/components/Editor/nodes/Embed.js @@ -6,25 +6,25 @@ import { allowEmbedIframesMutation } from '~/graphql/User.js' const template = ` +
+ +
+

{{embedTitle}}

+

{{embedDescription}}

+ {{dataEmbedUrl}} +
- dataEmbedUrl -
-

-

{{ embedTitle }}
-
{{ embedDescription }}
- - {{ dataEmbedUrl }} - ` From c46c13dbdf175ca42543d93ad8c10adef9d40009 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 2 Oct 2019 16:37:52 +0200 Subject: [PATCH 3/7] toggle overlay with methods --- webapp/components/Editor/Editor.vue | 8 ++++++++ webapp/components/Editor/nodes/Embed.js | 18 ++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index ca632aa16..73ca5fcde 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -374,6 +374,14 @@ li > p { height: auto; } +.embed-html { + width: 100%; + + iframe { + width: 100%; + } +} + .embed-overlay { position: absolute; top: 0; diff --git a/webapp/components/Editor/nodes/Embed.js b/webapp/components/Editor/nodes/Embed.js index 3513b6c41..bbac8fad5 100644 --- a/webapp/components/Editor/nodes/Embed.js +++ b/webapp/components/Editor/nodes/Embed.js @@ -6,9 +6,9 @@ import { allowEmbedIframesMutation } from '~/graphql/User.js' const template = ` -
- -
+
+
+

{{embedTitle}}

{{embedDescription}}

{{dataEmbedUrl}} @@ -18,7 +18,7 @@ const template = ` Deine Daten sind noch nicht weitergegeben. Wenn Du die das jetzt ansiehst dann werden auch Daten mit dem Anbieter ({{embedPublisher}}) ausgetauscht!
jetzt ansehen - Abbrechen + Abbrechen