diff --git a/src/Squidex/Squidex.csproj b/src/Squidex/Squidex.csproj index bc47b99f5..a7ffd5aa4 100644 --- a/src/Squidex/Squidex.csproj +++ b/src/Squidex/Squidex.csproj @@ -22,10 +22,6 @@ - - - - PreserveNewest @@ -85,10 +81,6 @@ - - - - <_DocumentationFile Include="$(DocumentationFile)" /> diff --git a/src/Squidex/app/shared/components/declarations.ts b/src/Squidex/app/shared/components/declarations.ts deleted file mode 100644 index 40c8b1d87..000000000 --- a/src/Squidex/app/shared/components/declarations.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Squidex Headless CMS - * - * @license - * Copyright (c) Sebastian Stehle. All rights reserved - */ - -export * from './angular/animations'; -export * from './angular/autocomplete.component'; -export * from './angular/can-deactivate.guard'; -export * from './angular/confirm-click.directive'; -export * from './angular/control-errors.component'; -export * from './angular/copy.directive'; -export * from './angular/date-time-editor.component'; -export * from './angular/date-time.pipes'; -export * from './angular/dialog-renderer.component'; -export * from './angular/dropdown.component'; -export * from './angular/file-drop.directive'; -export * from './angular/focus-on-init.directive'; -export * from './angular/geolocation-editor.component'; -export * from './angular/http-extensions-impl'; -export * from './angular/image-source.directive'; -export * from './angular/indeterminate-value.directive'; -export * from './angular/jscript-editor.component'; -export * from './angular/json-editor.component'; -export * from './angular/lowercase-input.directive'; -export * from './angular/markdown-editor.component'; -export * from './angular/modal-target.directive'; -export * from './angular/modal-view.directive'; -export * from './angular/money.pipe'; -export * from './angular/name.pipe'; -export * from './angular/numbers.pipes'; -export * from './angular/onboarding-tooltip.component'; -export * from './angular/panel.component'; -export * from './angular/panel-container.directive'; -export * from './angular/parent-link.directive'; -export * from './angular/popup-link.directive'; -export * from './angular/progress-bar.component'; -export * from './angular/rich-editor.component'; -export * from './angular/root-view.directive'; -export * from './angular/router-utils'; -export * from './angular/scroll-active.directive'; -export * from './angular/shortcut.component'; -export * from './angular/slider.component'; -export * from './angular/sorted.directive'; -export * from './angular/stars.component'; -export * from './angular/tag-editor.component'; -export * from './angular/template-wrapper.directive'; -export * from './angular/title.component'; -export * from './angular/toggle.component'; -export * from './angular/user-report.component'; -export * from './angular/validators'; -export * from './configurations'; - -export * from './services/analytics.service'; -export * from './services/clipboard.service'; -export * from './services/dialog.service'; -export * from './services/local-store.service'; -export * from './services/local-cache.service'; -export * from './services/message-bus.service'; -export * from './services/onboarding.service'; -export * from './services/resource-loader.service'; -export * from './services/root-view.service'; -export * from './services/shortcut.service'; -export * from './services/title.service'; - -export * from './utils/date-helper'; -export * from './utils/date-time'; -export * from './utils/duration'; -export * from './utils/immutable-array'; -export * from './utils/math-helper'; -export * from './utils/modal-view'; -export * from './utils/pager'; -export * from './utils/string-helper'; -export * from './utils/types'; -export * from './utils/version'; \ No newline at end of file diff --git a/src/Squidex/app/shared/components/rich-editor.component.html b/src/Squidex/app/shared/components/rich-editor.component.html index 2a0f03b4b..413c8e708 100644 --- a/src/Squidex/app/shared/components/rich-editor.component.html +++ b/src/Squidex/app/shared/components/rich-editor.component.html @@ -7,20 +7,31 @@ diff --git a/src/Squidex/app/shared/components/rich-editor.component.ts b/src/Squidex/app/shared/components/rich-editor.component.ts index ed8714654..b88b56988 100644 --- a/src/Squidex/app/shared/components/rich-editor.component.ts +++ b/src/Squidex/app/shared/components/rich-editor.component.ts @@ -8,9 +8,9 @@ import { AfterViewInit, Component, forwardRef, ElementRef, OnDestroy, ViewChild } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormBuilder } from '@angular/forms'; -import { Types, ResourceLoaderService } from 'framework'; import { AppComponentBase } from './app.component-base'; -import { ModalView, AppsStoreService, AssetDto, AssetsService, ImmutableArray, DialogService, AuthService, Pager } from './../declarations-base'; +import { AssetUrlPipe } from './pipes'; +import { ApiUrlConfig, ModalView, AppsStoreService, AssetDto, AssetsService, ImmutableArray, DialogService, AuthService, Pager, Types, ResourceLoaderService } from './../declarations-base'; declare var tinymce: any; @@ -31,8 +31,10 @@ export class RichEditorComponent extends AppComponentBase implements ControlValu private tinyInitTimer: any; private value: string; private isDisabled = false; + private assetSelectorClickHandler: any = null; public assetsItems: ImmutableArray; public assetsPager = new Pager(0, 0, 12); + private assetUrlGenerator: AssetUrlPipe; @ViewChild('editor') public editor: ElementRef; @@ -45,9 +47,11 @@ export class RichEditorComponent extends AppComponentBase implements ControlValu constructor(dialogs: DialogService, apps: AppsStoreService, authService: AuthService, private readonly resourceLoader: ResourceLoaderService, private readonly formBuilder: FormBuilder, - private readonly assetsService: AssetsService + private readonly assetsService: AssetsService, + private readonly apiUrlConfig: ApiUrlConfig ) { super(dialogs, apps, authService); + this.assetUrlGenerator = new AssetUrlPipe(this.apiUrlConfig); } private load() { @@ -61,6 +65,18 @@ export class RichEditorComponent extends AppComponentBase implements ControlValu }); } + public goNext() { + this.assetsPager = this.assetsPager.goNext(); + + this.load(); + } + + public goPrev() { + this.assetsPager = this.assetsPager.goPrev(); + + this.load(); + } + public ngOnDestroy() { clearTimeout(this.tinyInitTimer); @@ -98,6 +114,10 @@ export class RichEditorComponent extends AppComponentBase implements ControlValu removed_menuitems: 'newdocument', plugins: 'code,image', target: this.editor.nativeElement, file_picker_types: 'image', file_picker_callback: (cb: any, value: any, meta: any) => { self.load(); self.assetsDialog.show(); + self.assetSelectorClickHandler = { + cb: cb, + meta: meta + }; } }); }); @@ -127,17 +147,19 @@ export class RichEditorComponent extends AppComponentBase implements ControlValu this.callTouched = fn; } - public selecteAsset() { - console.log('Selecting asset ' + this.assetsForm.controls['name'].value); - } - - public cancelSelectAsset() { - console.log('asset selection canceled'); + public closeAssetDialog() { this.assetsDialog.hide(); + this.assetSelectorClickHandler = null; } public onAssetClicked(asset: AssetDto) { - console.log('Asset clicked on'); - console.log(asset); + if (this.assetSelectorClickHandler != null) { + this.assetSelectorClickHandler.cb(this.assetUrlGenerator.transform(asset), { + description: asset.fileName, + width: asset.pixelWidth, + height: asset.pixelHeight + }); + this.closeAssetDialog(); + } } } \ No newline at end of file