Skip to content

Commit

Permalink
chore(octra): update ngx-jodit to stable v3
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoemp committed Jan 8, 2024
1 parent 370c1b8 commit 457ff75
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 53 deletions.
1 change: 1 addition & 0 deletions apps/octra/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
],
"styles": [
"node_modules/video.js/dist/video-js.min.css",
"node_modules/jodit/es2021/jodit.min.css",
"apps/octra/src/styles.scss"
],
"scripts": [
Expand Down
4 changes: 2 additions & 2 deletions apps/octra/src/app/app.shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { OctraUtilitiesModule } from '@octra/ngx-utilities';
import { SignupComponent } from './core/component/authentication-component/signup/signup.component';
import { TranslocoModule } from '@ngneat/transloco';
import { TranscrOverviewComponent } from './core/component/transcr-overview';
import { NgxJoditModule } from 'ngx-jodit';
import { NgxJoditComponent } from 'ngx-jodit';
import { ValidationPopoverComponent } from './core/component/transcr-editor/validation-popover/validation-popover.component';

@NgModule({
Expand All @@ -49,7 +49,7 @@ import { ValidationPopoverComponent } from './core/component/transcr-editor/vali
OctraUtilitiesModule,
TranslocoModule,
NgbToast,
NgxJoditModule,
NgxJoditComponent,
],
exports: [
AsrOptionsComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ import { Subscription, timer } from 'rxjs';
import { NgxJoditComponent } from 'ngx-jodit';
import { DefaultComponent } from '../default.component';
import { Config } from 'jodit/types/config';
import { IControlType } from 'jodit/src/types';
import { IJodit, IToolbarButton } from 'jodit/types/types';
import { IControlType, IJodit, IToolbarButton } from 'jodit/types/types';
import { OctraAnnotationSegment } from '@octra/annotation';
import { AnnotationStoreService } from '../../store/login-mode/annotation/annotation.store.service';
import { OctraGuidelines } from '@octra/assets';
Expand Down Expand Up @@ -424,9 +423,6 @@ export class TranscrEditorComponent

this.joditOptions = {
...this.joditDefaultOptions,
showCharsCounter: false,
showWordsCounter: false,
showXPathInStatusbar: false,
disablePlugins:
'add-new-line,image-processor,image-properties,image,video,media,file,resize-cells,select-cells,' +
'table-keyboard-navigation,table,preview,print,about,drag-and-drop,iframe,indent,inline-popup,' +
Expand Down Expand Up @@ -780,33 +776,30 @@ export class TranscrEditorComponent
data: {
active: false,
},
getContent: (a, b, c) => {
if (!this.initialized) {
const content = getContent();

const button = document.createElement('span');
button.setAttribute('class', 'me-2 align-items-center px-1 h-100');
if (typeof content === 'string') {
button.innerHTML = getContent();
if (events?.onClick) {
button.addEventListener('click', (event: MouseEvent) => {
events!.onClick!(event, button);
});
}
} else {
button.appendChild(content);
getContent: (a: IJodit, b: IToolbarButton) => {
const content = getContent();

const button = document.createElement('span');
button.setAttribute('class', 'me-2 align-items-center px-1 h-100');
if (typeof content === 'string') {
button.innerHTML = getContent();
if (events?.onClick) {
button.addEventListener('click', (event: MouseEvent) => {
events!.onClick!(event, button);
});
}

return button;
} else {
button.appendChild(content);
}
return c.container.children[0];

return button;
},
isActive: function (editor, btn) {
/* isActive: function (editor, btn) {
if (btn.data) {
return btn.data['active'];
}
return false;
},
},*/
tooltip,
hotkeys,
};
Expand Down
1 change: 0 additions & 1 deletion apps/octra/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import 'bootstrap/scss/bootstrap';
@import 'bootstrap-icons/font/bootstrap-icons';
@import 'jodit/build/jodit.min.css';

.btn.btn-success {
color: #fff;
Expand Down
35 changes: 12 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@
"hammerjs": "^2.0.8",
"hotkeys-js": "^3.12.0",
"immer": "^9.0.21",
"jodit": "^3.24.9",
"jodit": "^4.0.1",
"konva": "^9.2.2",
"luxon": "^3.0.4",
"modernizr": "^3.12.0",
"ngrx-wieder": "^11.0.0",
"ngx-jodit": "^1.0.8",
"ngx-jodit": "^3.0.1",
"ngx-webstorage": "^12.0.0",
"node-ssh": "^13.0.0",
"platform": "^1.3.6",
Expand Down

0 comments on commit 457ff75

Please sign in to comment.