-
  1. Stylesheet verlinken. +
  2. {{ res.strings('city_code_dialog_stylesheet') }}
    - <link - href="https://www.mowesta.com/app/weather-forecast-today/weather-forecast-today.css" - rel="stylesheet"> + <link + href= + "https://www.mowesta.com/app/weather-forecast-today/weather-forecast-today.css" + rel= + "stylesheet" + >
  3. -
  4. Skripte einbetten. +
  5. {{ res.strings('city_code_dialog_scripts') }}
    - <script - src="https://www.mowesta.com/app/weather-forecast-today/weather-forecast-today-es2015.js" - type="module"></script> + <script + src= + "https://www.mowesta.com/app/weather-forecast-today/weather-forecast-today-es2015.js" + type= + "module" + ></script>
    - <script - src="https://www.mowesta.com/app/weather-forecast-today/weather-forecast-today-es5.js" - nomodule="" - defer=""></script> + <script + src= + "https://www.mowesta.com/app/weather-forecast-today/weather-forecast-today-es5.js" + nomodule= + "" + defer= + "" + ></script>
  6. -
  7. Web Component auf der Webseite einfügen. Hierbei kann für das Attribut "lang-code", entweder "de" für Deutsch oder "en" für Englisch eingesetzt werden. +
  8. {{ res.strings('city_code_dialog_web_component') }}
    - <weather-forecast-today - lang-code="de" - city-id="{{ data.city.id }}" - day-time="true" - no-header="false" - no-footer="false"></weather-forecast-today> + <weather-forecast-today + lang-code= + "de" + city-id= + "{{ data.city.id }}" + day-time= + "true" + no-header= + "false" + no-footer= + "false" + ></weather-forecast-today>
  9. diff --git a/web-angular/src/app/dialogs/code-dialog.component.ts b/web-angular/src/app/dialogs/code-dialog.component.ts index f9381cdb..4eb39622 100644 --- a/web-angular/src/app/dialogs/code-dialog.component.ts +++ b/web-angular/src/app/dialogs/code-dialog.component.ts @@ -2,11 +2,26 @@ import { Component, OnInit, Inject } from '@angular/core'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { Observable } from 'rxjs'; import { ResourceService } from '../services'; -import { City } from 'src/api/model/city'; +import { City } from '../../api/model/city'; @Component({ selector: 'app-code-dialog', - templateUrl: './code-dialog.component.html' + templateUrl: './code-dialog.component.html', + styles: [ + ` + ol li { margin-bottom: 32px; } + .main-content { padding-left: 10px; padding-bottom: 20px; } + .code-snippet { + background: lightgrey; + margin: 10px; + padding: 20px; + border-radius: 5px; + } + .tag { color: #9c27b0; } + .attr { color: #3b78e8; } + .attr-value { color: #0d904f; } + ` + ] }) export class CodeDialogComponent implements OnInit { diff --git a/web-angular/src/app/services/resource.service.ts b/web-angular/src/app/services/resource.service.ts index 4c373b7c..f4847bc8 100644 --- a/web-angular/src/app/services/resource.service.ts +++ b/web-angular/src/app/services/resource.service.ts @@ -117,6 +117,11 @@ export class ResourceService { 'label_yesterday' : 'Gestern', 'label_today' : 'Heute', 'label_tomorrow' : 'Morgen', + 'city_code_dialog_title': 'Web Component einbetten', + 'city_code_dialog_stylesheet': 'Das Stylesheet verlinken.', + 'city_code_dialog_scripts': 'Die Skripte einbetten.', + 'city_code_dialog_web_component': 'Web Component auf Ihrer Webseite einfügen. Um zwischen deutscher oder' + + ' englischer Sprache zu wählen, kann das "lang-code" Attribut auf "de" oder "en" gesetzt werden.', 'station_title': 'Station', 'station_latest_report' : 'Letzte Messung', @@ -538,6 +543,11 @@ export class ResourceService { 'label_yesterday' : 'Yesterday', 'label_today' : 'Today', 'label_tomorrow' : 'Tomorrow', + 'city_code_dialog_title': 'Embed Web Component', + 'city_code_dialog_stylesheet': 'Link the stylesheet.', + 'city_code_dialog_scripts': 'Embed the scripts.', + 'city_code_dialog_web_component': 'Insert the Web Component on your website. To choose between German or' + + ' English language, the "lang-code" attribute can be set to "de" or "en".', 'station_title': 'Station', 'station_latest_report' : 'Latest Measurement',