diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index fa9f7fc9..1d10825e 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -33,6 +33,7 @@ import { environment } from 'src/environments/environment';
import { AppConfigService } from './app-config.service';
import { AngularSplitModule } from 'angular-split';
import { HfMarkdownComponent } from './hf-markdown/hf-markdown.component';
+import { CopyToClipboardComponent } from './hf-markdown/copy-to-clipboard/copy-to-clipboard.component';
import { PrintableComponent } from './printable/printable.component';
import { GargantuaClientFactory } from './services/gargantua.service';
import { QuizCheckboxComponent } from './quiz/quiz-checkbox.component';
@@ -77,6 +78,7 @@ import {
eyeIcon,
eyeHideIcon,
clockIcon,
+ copyIcon,
} from '@cds/core/icon';
import { QuizLabelComponent } from './quiz/quiz-label.component';
@@ -108,6 +110,7 @@ ClarityIcons.addIcons(
eyeIcon,
eyeHideIcon,
clockIcon,
+ copyIcon,
);
export function tokenGetter() {
@@ -162,6 +165,7 @@ export function jwtOptionsFactory() {
VMClaimComponent,
AtobPipe,
HfMarkdownComponent,
+ CopyToClipboardComponent,
PrintableComponent,
IdeWindowComponent,
TaskProgressComponent,
@@ -189,6 +193,7 @@ export function jwtOptionsFactory() {
{ component: CtrComponent },
{ component: SingleTaskVerificationMarkdownComponent },
{ component: QuizComponent },
+ { component: CopyToClipboardComponent },
],
}),
JwtModule.forRoot({
diff --git a/src/app/hf-markdown/copy-to-clipboard/copy-to-clipboard.component.html b/src/app/hf-markdown/copy-to-clipboard/copy-to-clipboard.component.html
new file mode 100644
index 00000000..5b41cc34
--- /dev/null
+++ b/src/app/hf-markdown/copy-to-clipboard/copy-to-clipboard.component.html
@@ -0,0 +1,4 @@
+
${fileName}
` - : `${language}
`; + ? `${fileName} ${copyCodeDiv}
` + : `${language} ${copyCodeDiv}
`; const classAttr = `language-${language}`; if (Prism.languages[language]) { diff --git a/src/app/scenario/ctr.service.ts b/src/app/scenario/ctr.service.ts index 7a04d44b..cf0ee953 100644 --- a/src/app/scenario/ctr.service.ts +++ b/src/app/scenario/ctr.service.ts @@ -24,6 +24,10 @@ export class CtrService { this.ctrstream.next(exec); } + public getCodeById(id: string) { + return this.ctrCodes.get(id) ?? ''; + } + public sendCode(ctr: CodeExec) { if (!ctr) return; this.ctrstream.next(ctr);