[Library | Trunk]: Show authors create a copy to clipboard function and change orcid field from code to input with name=code.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58027 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
0e8aec9eac
commit
b510d104d2
|
@ -1,35 +1,41 @@
|
|||
import {Component, Inject, Input, PLATFORM_ID} from '@angular/core';
|
||||
import {ActivatedRoute} from "@angular/router";
|
||||
import {HelperFunctions} from '../HelperFunctions.class';
|
||||
import {RouterHelper} from "../routerHelper.class";
|
||||
import {EnvProperties} from '../properties/env-properties';
|
||||
import {ActivatedRoute} from "@angular/router";
|
||||
import {HelperFunctions} from '../HelperFunctions.class';
|
||||
import {RouterHelper} from "../routerHelper.class";
|
||||
import {EnvProperties} from '../properties/env-properties';
|
||||
import {isPlatformBrowser} from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: 'showAuthors',
|
||||
template: `
|
||||
<div *ngIf="authors != undefined" class="uk-height-max-small uk-overflow-auto">
|
||||
<!--div *ngIf="showAll && numberOfAuthors > authorsLimit">
|
||||
<a (click)="numberOfAuthors = authorsLimit;">View less authors</a>
|
||||
</div-->
|
||||
<div *ngIf="authors != undefined" class="uk-height-max-small uk-overflow-auto">
|
||||
<!--div *ngIf="showAll && numberOfAuthors > authorsLimit">
|
||||
<a (click)="numberOfAuthors = authorsLimit;">View less authors</a>
|
||||
</div-->
|
||||
|
||||
<span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index">
|
||||
<span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index">
|
||||
<i *ngIf="!author.orcid || (properties.environment == 'production') || !testBrowser">{{author.fullName}}</i
|
||||
><a *ngIf="author.orcid && (properties.environment != 'production') && testBrowser" class="cursor-default"> <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}<i>{{author.fullName}}</i></a
|
||||
><div *ngIf="author.orcid && (properties.environment != 'production')" class=" default-dropdown uk-margin-remove-top uk-padding-medium"
|
||||
uk-dropdown="pos: bottom-left; mode:click" style="min-width: 70px !important;">
|
||||
><a *ngIf="author.orcid && (properties.environment != 'production') && testBrowser"
|
||||
class="cursor-default"> <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}
|
||||
<i>{{author.fullName}}</i></a
|
||||
><div *ngIf="author.orcid && (properties.environment != 'production')"
|
||||
class=" default-dropdown uk-margin-remove-top uk-padding-medium"
|
||||
uk-dropdown="pos: bottom-left; mode:click" style="min-width: 70px !important;">
|
||||
<b class="uk-margin-top">{{author.fullName}}</b>
|
||||
|
||||
<div>
|
||||
<div class="uk-text-muted uk-margin-small-bottom uk-margin-small-top">ORCID</div>
|
||||
<span><code class="uk-padding-small" [id]="'orcid_clipboard_auhtor_'+i">{{author.orcid}}</code></span>{{" "}}
|
||||
<span><input #element class="uk-padding-small uk-disabled" name="code"
|
||||
[value]="author.orcid"></span>{{" "}}
|
||||
<span>
|
||||
<button [class]="'uk-icon-clipboard uk-button uk-button-primary uk-button-small orcid_clipboard_btn_auhtor_'+i"
|
||||
[attr.data-clipboard-target]="'#orcid_clipboard_auhtor_'+i" title="Copy to clipboard">
|
||||
<button
|
||||
[class]="'uk-icon-clipboard uk-button uk-button-primary uk-button-small orcid_clipboard_btn_auhtor_'+i"
|
||||
(click)="copyToClipboard(element)" title="Copy to clipboard">
|
||||
Copy
|
||||
</button>{{" "}}
|
||||
</button>
|
||||
{{" "}}
|
||||
<a class="uk-button uk-button-primary uk-button-small" title="Visit author in Orcid"
|
||||
[href]="properties.orcidURL+author.orcid" target="_blank">
|
||||
[href]="properties.orcidURL+author.orcid" target="_blank">
|
||||
Visit
|
||||
</a>
|
||||
</span>
|
||||
|
@ -41,46 +47,50 @@ import {isPlatformBrowser} from "@angular/common";
|
|||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/publications">
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/publications">
|
||||
Publications
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/datasets">
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/datasets">
|
||||
Research Data
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/software">
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/software">
|
||||
Software
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/other">
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/other">
|
||||
Other Research Products
|
||||
</a>
|
||||
</div>
|
||||
</div
|
||||
><span>;{{" "}}</span>
|
||||
</span>
|
||||
<span *ngIf="numberOfAuthors == authorsLimit && authors.length > authorsLimit"> ... </span>
|
||||
<span *ngIf="showAll && numberOfAuthors == authorsLimit && authors.length > authorsLimit">
|
||||
<span *ngIf="numberOfAuthors == authorsLimit && authors.length > authorsLimit"> ... </span>
|
||||
<span *ngIf="showAll && numberOfAuthors == authorsLimit && authors.length > authorsLimit">
|
||||
<a (click)="numberOfAuthors = authors.length;">
|
||||
view all {{authors.length | number}} authors
|
||||
</a>
|
||||
</span>
|
||||
<!--span *ngIf="showAll && numberOfAuthors > authorsLimit">
|
||||
<a (click)="numberOfAuthors = authorsLimit; scroll()">View less authors</a>
|
||||
</span-->
|
||||
</div>
|
||||
<div *ngIf="authors != undefined && showAll && numberOfAuthors > authorsLimit" class="uk-width-1-1 uk-text-right">
|
||||
<!--scroll()-->
|
||||
<a (click)="numberOfAuthors = authorsLimit;">View less authors</a>
|
||||
</div>
|
||||
`
|
||||
<!--span *ngIf="showAll && numberOfAuthors > authorsLimit">
|
||||
<a (click)="numberOfAuthors = authorsLimit; scroll()">View less authors</a>
|
||||
</span-->
|
||||
</div>
|
||||
<div *ngIf="authors != undefined && showAll && numberOfAuthors > authorsLimit" class="uk-width-1-1 uk-text-right">
|
||||
<!--scroll()-->
|
||||
<a (click)="numberOfAuthors = authorsLimit;">View less authors</a>
|
||||
</div>
|
||||
`
|
||||
|
||||
})
|
||||
|
||||
|
@ -104,18 +114,12 @@ export class ShowAuthorsComponent {
|
|||
this.properties = data.envSpecific;
|
||||
});
|
||||
this.numberOfAuthors = this.authorsLimit;
|
||||
|
||||
if(typeof window !== 'undefined') {
|
||||
let orcid_clipboard;
|
||||
let Clipboard;
|
||||
Clipboard = require('clipboard');
|
||||
if(this.authors) {
|
||||
this.authors.forEach((author, index) => {
|
||||
if (author && author.orcid) {
|
||||
orcid_clipboard = new Clipboard('.orcid_clipboard_btn_auhtor_' + index);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
copyToClipboard(element: HTMLInputElement){
|
||||
element.select();
|
||||
if(typeof document !== 'undefined') {
|
||||
document.execCommand('copy');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue