Enable fullscreen for iframes. Fix copy to clipboard for links in indicators form.

This commit is contained in:
Konstantinos Triantafyllou 2022-06-06 16:36:23 +03:00
parent d71bd112c8
commit bd63de452b
7 changed files with 18 additions and 20 deletions

View File

@ -178,7 +178,7 @@
<iframe
*ngIf=" !properties.disableFrameLoad && chartsActiveType.get(i + '-' + j).source !== 'image'"
[src]="chartsActiveType.get(i + '-' + j).safeResourceUrl"
class="uk-width-1-1 uk-blend-multiply"
class="uk-width-1-1 uk-blend-multiply" allowfullscreen="true" mozallowfullscreen="true"
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"></iframe>
<div *ngIf="properties.disableFrameLoad && chartsActiveType.get(i + '-' + j).source !== 'image'">
<img class="uk-width-1-1 uk-blend-multiply"

@ -1 +1 @@
Subproject commit 135638ad6364f7cabdcef68e4fadfbc667c75cee
Subproject commit eac367a8727e6abfc9107cba3fc4837e02d10e36

View File

@ -173,6 +173,7 @@
</div>
<iframe *ngIf="!properties.disableFrameLoad && indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source !=='image' &&
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"
[src]="safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
class="uk-width-1-1 uk-blend-multiply" [ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"></iframe>
<div *ngIf="properties.disableFrameLoad && indicator.indicatorPaths[0].source !=='image'">
@ -244,7 +245,7 @@
<div *ngIf="urlParameterizedMessage" warning>{{urlParameterizedMessage}}</div>
</div>
<div class='uk-padding-small'>
<a class="uk-link-reset" (click)="copyToClipboard('numberURL')"><icon [flex]="true" name="content_copy"></icon></a>
<a class="uk-link-reset" (click)="copyToClipboard(indicatorPath.get('url').value)"><icon [flex]="true" name="content_copy"></icon></a>
</div>
</div>
<div *ngIf="showCheckForSchemaEnhancements" class="uk-width-1-1">
@ -353,7 +354,7 @@
<div *ngIf="urlParameterizedMessage" warning>{{urlParameterizedMessage}}</div>
</div>
<div class='uk-padding-small'>
<a class="uk-link-reset" (click)="copyToClipboard('chartURL')"><icon [flex]="true" name="content_copy"></icon></a>
<a class="uk-link-reset" (click)="copyToClipboard(indicatorPath.get('url').value)"><icon [flex]="true" name="content_copy"></icon></a>
</div>
</div>
<div *ngIf="showCheckForSchemaEnhancements" class=" uk-width-1-1 ">
@ -401,7 +402,7 @@
</div>
</div>
<iframe *ngIf="indicator.indicatorPaths[i].source !== 'image'"
[src]="indicator.indicatorPaths[i].safeResourceUrl"
[src]="indicator.indicatorPaths[i].safeResourceUrl" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"
class="uk-width-1-1 uk-height-large uk-blend-multiply"></iframe>
<!-- <div *ngIf="properties.disableFrameLoad && indicator.indicatorPaths[i].source !== 'image'" class="uk-alert uk-alert-danger uk-text-center">I frames-->
<!-- preview is disabled</div>-->

View File

@ -37,6 +37,7 @@ import {NotifyFormComponent} from "../openaireLibrary/notifications/notify-form/
import {NotificationService} from "../openaireLibrary/notifications/notification.service";
import {properties} from "../../environments/environment";
import {response} from "express";
import {NotificationHandler} from "../openaireLibrary/utils/notification-handler";
declare var UIkit;
@ -1418,29 +1419,19 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
});
}
copyToClipboard(val: string) {
if(val === 'numberURL') {
var inputElement = document.getElementById("numberURL").children[1].children[0].children[1].children[0] as HTMLInputElement;
}
if(val === 'chartURL') {
var inputElement = document.getElementById("chartURL").children[1].children[0].children[1].children[0] as HTMLInputElement;
}
copyToClipboard(value) {
const tempBox = document.createElement('textarea');
tempBox.style.position = 'fixed';
tempBox.style.left = '0';
tempBox.style.top = '0';
tempBox.style.opacity = '0';
tempBox.value = inputElement.value;
tempBox.value = value;
document.body.appendChild(tempBox);
tempBox.focus();
tempBox.select();
tempBox.setSelectionRange(0,99999);
document.execCommand('copy');
document.body.removeChild(tempBox);
UIkit.notification('Copied to clipboard', {
status: 'success',
timeout: 5000,
pos: 'bottom-right'
});
NotificationHandler.rise('Copied to clipboard');
}
}

@ -1 +1 @@
Subproject commit 170a0490e6ecf0d2e31d5a4cea3967cc14efa5af
Subproject commit ee3a9a4868bbdeb26d7a9c5ed15dbf8b2b765b39

View File

@ -61,6 +61,12 @@
stop-color: var(--monitor-dark-color)
}
/*TODO check to change in theme*/
iframe.uk-height-medium {
height: 320px;
}
#print_toggle {
top: 320px !important;
}

@ -1 +1 @@
Subproject commit 7cb184f4f8dd1d0e0b75ce414e24c81ef42ed426
Subproject commit 0de97ee578684ce690efe2754fd0018293ce63c9