diff --git a/angular.json b/angular.json index b86db1fe77dbe8a155c3701b0d3e410507b46ec8..d109071a53ca7e13a25df694b60b47c3543dc1a9 100644 --- a/angular.json +++ b/angular.json @@ -23,11 +23,17 @@ ], "styles": [ "src/styles.scss", - "./node_modules/material-design-icons/iconfont/material-icons.css" + "./node_modules/material-design-icons/iconfont/material-icons.css", + "node_modules/prismjs/themes/prism-okaidia.css", + "node_modules/prismjs/plugins/line-highlight/prism-line-highlight.css", + "node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css" ], "scripts": [ "node_modules/marked/lib/marked.js", "node_modules/emoji-toolkit/lib/js/joypixels.min.js", + "node_modules/prismjs/prism.js", + "node_modules/prismjs/components/prism-csharp.min.js", + "node_modules/prismjs/components/prism-css.min.js", "node_modules/prismjs/plugins/line-highlight/prism-line-highlight.js", "node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js", "node_modules/katex/dist/katex.min.js" diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9aaf493fdb9fc8651a9ae96330a5a316b9fd1b2e..67cd297df6add9d93a47f3730bc367ad699fc1d7 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -125,7 +125,13 @@ export function initializeApp(appConfig: AppConfig) { markedOptions: { provide: MarkedOptions, useValue: { - sanitize: true + pedantic: false, + gfm: true, + breaks: true, + sanitize: false, + smartLists: true, + smartypants: true, + xhtml: false } } }), diff --git a/src/app/components/creator/_dialogs/room-edit/room-edit.component.html b/src/app/components/creator/_dialogs/room-edit/room-edit.component.html index cbcd9da2b489fd76e74b7071f7180d3bf1535717..734041e4ef037c6bd716d4339057061f64f4852b 100644 --- a/src/app/components/creator/_dialogs/room-edit/room-edit.component.html +++ b/src/app/components/creator/_dialogs/room-edit/room-edit.component.html @@ -51,7 +51,8 @@ </mat-tab> <mat-tab label="{{'session.preview' | translate}}" [disabled]="!editRoom.description"> - <markdown [data]="editRoom.description"></markdown> + <markdown class="images" katex emoji lineNumbers lineHighlight + [data]="editRoom.description"></markdown> </mat-tab> </mat-tab-group> <div fxLayoutAlign="center center"> diff --git a/src/app/components/creator/room-creator-page/room-creator-page.component.html b/src/app/components/creator/room-creator-page/room-creator-page.component.html index eaf734408eedda04f6bed6c3183f3e7ef30b34f3..951a099f107ff2a811c2ba3c8f14304046b9eecf 100644 --- a/src/app/components/creator/room-creator-page/room-creator-page.component.html +++ b/src/app/components/creator/room-creator-page/room-creator-page.component.html @@ -77,7 +77,8 @@ </div> <mat-card-content *ngIf="room.description" fxLayoutAlign="center"> - <markdown [data]="room.description.trim()"></markdown> + <markdown class="images" katex emoji lineNumbers lineHighlight + [data]="room.description.trim()"></markdown> </mat-card-content> <div fxLayout="column" fxLayoutAlign="center" diff --git a/src/app/components/moderator/room-moderator-page/room-moderator-page.component.html b/src/app/components/moderator/room-moderator-page/room-moderator-page.component.html index d03cf13b0f4c93b402da3d05acb9fd0d134df896..77eaf139ae0c0d7f96958b6a16c82b1647f1b80e 100644 --- a/src/app/components/moderator/room-moderator-page/room-moderator-page.component.html +++ b/src/app/components/moderator/room-moderator-page/room-moderator-page.component.html @@ -35,7 +35,8 @@ <mat-divider></mat-divider> <mat-card-content *ngIf="room.description" fxLayoutAlign="center"> - <markdown [data]="room.description.trim()"></markdown> + <markdown class="images" katex emoji lineNumbers lineHighlight + [data]="room.description.trim()"></markdown> </mat-card-content> <div fxLayout="column" fxLayoutAlign="center" diff --git a/src/app/components/participant/room-participant-page/room-participant-page.component.html b/src/app/components/participant/room-participant-page/room-participant-page.component.html index ee603de0bd35c49bba5823dd808d170899af145d..b7d127ee8643824e54ea2d6cb07e4d443894c93a 100644 --- a/src/app/components/participant/room-participant-page/room-participant-page.component.html +++ b/src/app/components/participant/room-participant-page/room-participant-page.component.html @@ -21,7 +21,8 @@ </div> <mat-divider></mat-divider> <mat-card-content *ngIf="room.description" fxLayoutAlign="center"> - <markdown [data]="room.description.trim()"></markdown> + <markdown class="images" katex emoji lineNumbers lineHighlight + [data]="room.description.trim()"></markdown> </mat-card-content> <mat-grid-list cols="1" rowHeight="2:1"> <mat-grid-tile> diff --git a/src/app/components/shared/_dialogs/motd-temp-dialog/motd-temp-dialog.component.html b/src/app/components/shared/_dialogs/motd-temp-dialog/motd-temp-dialog.component.html index d8186fd8951735d03dff44ba551c933aca2c9a98..fa5fdaa2349aaab8f2c9fdd448b9154c16d47cd2 100644 --- a/src/app/components/shared/_dialogs/motd-temp-dialog/motd-temp-dialog.component.html +++ b/src/app/components/shared/_dialogs/motd-temp-dialog/motd-temp-dialog.component.html @@ -7,7 +7,8 @@ </ars-row> <mat-dialog-content class="container" ars-flex-box> <ars-row ars-flex-box> - <markdown class="images" [data]="content"></markdown> + <markdown class="images" katex emoji lineNumbers lineHighlight + [data]="content"></markdown> </ars-row> <ars-row [height]="32"></ars-row> <ars-fill></ars-fill> diff --git a/src/app/components/shared/comment-answer/comment-answer.component.html b/src/app/components/shared/comment-answer/comment-answer.component.html index fdd4f031a9a4786508e2311f34e51e3ff401bfb8..e96bc84b6a25d5cb7bc5c7f4b48b67822a3bfa75 100644 --- a/src/app/components/shared/comment-answer/comment-answer.component.html +++ b/src/app/components/shared/comment-answer/comment-answer.component.html @@ -11,7 +11,8 @@ <mat-card class="answer border-answer" *ngIf="!isStudent || answer"> <div *ngIf="(isStudent || !edit) && answer"> - <markdown [data]="answer"></markdown> + <markdown class="images" katex emoji lineNumbers lineHighlight + [data]="answer"></markdown> <div fxLayout="row" fxLayoutAlign="end"> <button mat-raised-button @@ -52,7 +53,8 @@ </mat-tab> <mat-tab label="{{'session.preview' | translate}}" [disabled]="!answer"> - <markdown [data]="answer"></markdown> + <markdown class="images" katex emoji lineNumbers lineHighlight + [data]="answer"></markdown> </mat-tab> </mat-tab-group> <div fxLayout="row" diff --git a/src/app/components/shared/header/header.component.html b/src/app/components/shared/header/header.component.html index 6184ca014676f48aed356782fb14c9ad409a02e3..cefb9bee83800eb9406d4879bc42ee8663df3e19 100644 --- a/src/app/components/shared/header/header.component.html +++ b/src/app/components/shared/header/header.component.html @@ -17,9 +17,7 @@ </h2> - <ng-container *ngIf="room && room.closed"> - <h1>{{'header.questions-blocked'|translate}}</h1> - </ng-container> + <ars-style-btn-material [ngClass]="{'noOfQuestions': deviceType === 'desktop'}" @@ -122,15 +120,7 @@ <!-- Question board --> <ng-container *ngIf="router.url.endsWith('/comments')"> - <button mat-menu-item - *ngIf="user && !router.url.endsWith('moderator/comments') && ((user.role > 0) || ((user.role == 0) && room && !room.closed))" - tabindex="0" - (click)="navigateCreateQuestion();"> - <mat-icon> - add - </mat-icon> - <span>{{'header.create-question' | translate}}</span> - </button> + <ng-container> @@ -348,15 +338,7 @@ <span>{{'header.delete-account' | translate}}</span> </button> - <ng-container *ngIf="shortId && user && user.role > 0"> - <button mat-menu-item - (click)="blockQuestions()" - [ngClass]="{'color-warn': room.closed}" - tabindex="0"> - <mat-icon class="color-warn">block</mat-icon> - <span>{{'header.block' | translate}}</span> - </button> - </ng-container> + <button mat-menu-item (click)="logout()" diff --git a/src/app/components/shared/questionwall/question-wall/question-wall.component.html b/src/app/components/shared/questionwall/question-wall/question-wall.component.html index e4bfc4f2e959fb31d928027c15fa373ef57a6281..cae420d7988319960459a8bc665ea6d3da7a765b 100644 --- a/src/app/components/shared/questionwall/question-wall/question-wall.component.html +++ b/src/app/components/shared/questionwall/question-wall/question-wall.component.html @@ -115,7 +115,8 @@ </ars-row> <ars-row> <ars-row class="bound" style="padding:16px 32px 16px 32px;box-sizing:border-box;max-width:100%;"> - <markdown [ngStyle]="{'font-size':fontSize+'%'}" class="questionwall-present-markdown" [data]="commentFocus.comment.body"></markdown> + <markdown [ngStyle]="{'font-size':fontSize+'%'}" class="questionwall-present-markdown" class="images" katex emoji lineNumbers lineHighlight + [data]="commentFocus.comment.body"></markdown> </ars-row> </ars-row> <ars-row [height]="50"> @@ -220,7 +221,8 @@ (click)="focusComment(comment)" style="box-sizing:border-box;padding:0 16px;cursor:pointer"> <p class="questionwall-comment-body"> - <markdown [data]="comment.comment.body"></markdown> + <markdown class="images" katex emoji lineNumbers lineHighlight + [data]="comment.comment.body"></markdown> </p> </ars-row> <ars-row [height]="50"> diff --git a/src/app/components/shared/questionwall/question-wall/question-wall.component.scss b/src/app/components/shared/questionwall/question-wall/question-wall.component.scss index df024156e568c7d7ce0bf2726e503f730ddb5f0c..61c7abdadfd35de1f6accdad80415db75d6f93ec 100644 --- a/src/app/components/shared/questionwall/question-wall/question-wall.component.scss +++ b/src/app/components/shared/questionwall/question-wall/question-wall.component.scss @@ -181,6 +181,7 @@ justify-content: center; hyphens: auto; word-break: break-word; + color: yellow; } &-inner { diff --git a/src/app/components/shared/questionwall/question-wall/question-wall.component.ts b/src/app/components/shared/questionwall/question-wall/question-wall.component.ts index 8148af8a71b5aeea0174ddd555730624f52af07c..a7f95f09f38f7b7d25c48d4f13023486b0801b80 100644 --- a/src/app/components/shared/questionwall/question-wall/question-wall.component.ts +++ b/src/app/components/shared/questionwall/question-wall/question-wall.component.ts @@ -47,7 +47,7 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy { userList = []; userSelection = false; tags; - fontSize = 250; + fontSize = 180; periodsList = Object.values(Period); period: Period = Period.ALL;