diff --git a/package-lock.json b/package-lock.json index f140234..a1bf785 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "rxjs": "~7.8.1", "sse.js": "^2.4.1", "tslib": "^2.6.2", + "uuid": "^9.0.1", "zone.js": "~0.14.5" }, "devDependencies": { @@ -13050,6 +13051,15 @@ "websocket-driver": "^0.7.4" } }, + "node_modules/sockjs/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/socks": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", @@ -14007,10 +14017,13 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } diff --git a/package.json b/package.json index afaa066..dcd6964 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "rxjs": "~7.8.1", "sse.js": "^2.4.1", "tslib": "^2.6.2", + "uuid": "^9.0.1", "zone.js": "~0.14.5" }, "devDependencies": { diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 0157bb2..9f60cad 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,24 +1,22 @@ -import {NgModule} from '@angular/core'; -import {RouterModule, Routes} from '@angular/router'; -import {EditorComponent} from './components/editor/editor.component'; -import {LandingPageComponent} from './components/landing-page/landing-page.component'; -import {DocumentationComponent} from './components/documentation/documentation.component'; -import {FormComponent} from './components/form/form.component'; -import {TermsOfServiceComponent} from './components/terms-of-service/terms-of-service.component'; -import {OurStoryComponent} from './components/our-story/our-story.component'; -import {PrivacyPolicyComponent} from './components/privacy-policy/privacy-policy.component'; -import {WorksListComponent} from "./components/works-list/works-list.component"; +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { WorkComponent } from './components/work/work.component'; +import { EditorComponent } from './components/editor/editor.component'; +import { LandingPageComponent } from './components/landing-page/landing-page.component'; +import { DocumentationComponent } from './components/documentation/documentation.component'; +import { FormComponent } from './components/form/form.component'; +import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component'; +import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component'; // Toutes les routes de l'application sont définies ici const routes: Routes = [ - {path: '', component: LandingPageComponent}, - {path: 'editor', component: EditorComponent}, - {path: 'documentation', component: DocumentationComponent}, - {path: 'contact', component: FormComponent}, - {path: 'our-story', component: OurStoryComponent}, - {path: 'terms-of-service', component: TermsOfServiceComponent}, - {path: 'privacy-policy', component: PrivacyPolicyComponent}, - {path: 'works', component: WorksListComponent}, + { path: '', component: LandingPageComponent }, + { path: 'work', component: WorkComponent }, + { path: 'editor', component: EditorComponent }, + { path: 'documentation', component: DocumentationComponent }, + { path: 'contact', component: FormComponent }, + { path: 'terms-of-service', component: TermsOfServiceComponent }, + { path: 'privacy-policy', component: PrivacyPolicyComponent }, ]; @NgModule({ diff --git a/src/app/components/editor/editor.component.html b/src/app/components/editor/editor.component.html index a4cc5fd..f7a6898 100644 --- a/src/app/components/editor/editor.component.html +++ b/src/app/components/editor/editor.component.html @@ -1,112 +1,133 @@
-
-
-
- - -
+
+
+
+ + +
-
- -
-
- -
-
-
- @if (errorMessage) { -
-

{{ errorMessage }}

-
- } +
+ +
+
+ +
+
+ +
- + +
+ +
+
+
+ @if (errorMessage) { +
+

{{ errorMessage }}

+
+ } -
- -
-
-
+ -
-
- - -
-
-

-		
-
+
+ +
+
+
+ +
+
+ + +
+
+

+    
+
+Propulsé par Gitea Version: 1.18.0 Page: 34ms Modèle: 1ms Licences API diff --git a/src/app/components/editor/editor.component.scss b/src/app/components/editor/editor.component.scss index 0836334..67b2c54 100644 --- a/src/app/components/editor/editor.component.scss +++ b/src/app/components/editor/editor.component.scss @@ -72,3 +72,26 @@ select { ::ng-deep .codemirror6-editor { height: 100%; } + + +// @mixin btn-styles($bg-color, $font-color) { + +// background-color: $bg-color; +// color: $font-color; +// border: none; +// color: white; +// padding: 12px 16px; +// font-size: 16px; +// width: 100px; +// cursor: pointer; +// border-radius: 10px; +// } + +// .btn-save { +// @include btn-styles(green, white); + +// } + +// .btn-save { +// @include btn-styles(red, white); +// } \ No newline at end of file diff --git a/src/app/components/editor/editor.component.ts b/src/app/components/editor/editor.component.ts index 09cb48c..ea1d0b1 100644 --- a/src/app/components/editor/editor.component.ts +++ b/src/app/components/editor/editor.component.ts @@ -5,6 +5,7 @@ import {CodeMirrorComponent} from '@sandkasten/codemirror6-editor'; import {LanguageDescription} from '@codemirror/language'; import {CODE_DEFAULTS, LANGUAGES} from '../languages'; import {SafeHTMLPipe} from '../../safe-html.pipe'; +import { TranslateModule } from '@ngx-translate/core'; import {ReactiveFormsModule, FormsModule} from '@angular/forms'; import { keymap, @@ -36,7 +37,7 @@ import { closeBracketsKeymap, } from '@codemirror/autocomplete'; import {lintKeymap} from '@codemirror/lint'; -import {WorksService} from "../../services/works.service"; +import {WorkService} from "../../services/work.service"; const basicSetup: Extension = (() => [ highlightActiveLineGutter(), @@ -76,6 +77,7 @@ const basicSetup: Extension = (() => [ ReactiveFormsModule, FormsModule, SafeHTMLPipe, + TranslateModule ], }) export class EditorComponent { @@ -135,7 +137,7 @@ export class EditorComponent { this.languageCompartment.of(this.selectedLanguage.support!), ]; - constructor(private codeExecutionService: CodeExecutionService, protected workService: WorksService) { + constructor(private codeExecutionService: CodeExecutionService, protected workService: WorkService) { } // Efface le contenu de l'éditeur @@ -173,7 +175,7 @@ export class EditorComponent { this.errorMessage = `Unsupported language. Please select one of the following languages: ${extensions.join(', ')}.`; console.error(this.errorMessage); } - + saveToFile() { const blob = new Blob([this.editorContent], {type: 'text/plain'}); const a = document.createElement('a'); @@ -186,5 +188,8 @@ export class EditorComponent { this.workService.postWorkCode(this.editorContent); } + shareButtonClicked(){} + saveButtonClicked(){} + protected readonly console = console; } diff --git a/src/app/components/footer/footer.component.html b/src/app/components/footer/footer.component.html index c8b304d..54c4da4 100644 --- a/src/app/components/footer/footer.component.html +++ b/src/app/components/footer/footer.component.html @@ -5,11 +5,27 @@ diff --git a/src/app/components/footer/footer.component.scss b/src/app/components/footer/footer.component.scss index 5213b63..c644145 100644 --- a/src/app/components/footer/footer.component.scss +++ b/src/app/components/footer/footer.component.scss @@ -19,6 +19,8 @@ a { cursor: pointer; + text-decoration: none; + color: $color-gray; } } } diff --git a/src/app/components/header/header.component.html b/src/app/components/header/header.component.html index d0a7a58..d7db694 100644 --- a/src/app/components/header/header.component.html +++ b/src/app/components/header/header.component.html @@ -27,6 +27,14 @@