[Library Trunk]
Cite this: fix issue with titles fix issue with authors (given name for surname and vice versa) add ISSN and issue add frontiers and ama csl git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57809 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
9d3aad3bd1
commit
90c1ef5c41
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,7 @@
|
|||
import {Component, ElementRef, Input} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {Citation, CitationData} from './citation.class';
|
||||
import {ResultLandingInfo} from "../../../utils/entities/resultLandingInfo";
|
||||
declare var CSL:any;
|
||||
declare var Sys:any;
|
||||
//<addThis ></addThis>
|
||||
|
@ -16,7 +17,7 @@ declare var Sys:any;
|
|||
<option value="0">select a citation style</option>
|
||||
<option *ngFor=" let style of this.citation.templates let i = index" [value]="style">{{style}}</option>
|
||||
</select>
|
||||
<div *ngIf="selectedStyle!='0'" id="citation" class="box-content uk-padding-small" [innerHTML]=citationText></div>
|
||||
<div *ngIf="selectedStyle!='0'" id="citation" class="box-content uk-padding-small uk-overflow-auto" [innerHTML]=citationText></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
@ -28,7 +29,7 @@ export class CiteThisComponent {
|
|||
public citationText:string;
|
||||
public citation:Citation = new Citation();
|
||||
// public cite: any;
|
||||
@Input() result: any;
|
||||
@Input() result: ResultLandingInfo;
|
||||
@Input() id: string;
|
||||
@Input() type: string="article";
|
||||
public citeproc;
|
||||
|
@ -65,14 +66,9 @@ export class CiteThisComponent {
|
|||
citationData.id = this.id;
|
||||
if(this.result.types != undefined && this.result.types.length > 0 && this.result.types[0]){
|
||||
citationData.type = this.result.types[0].toLowerCase();
|
||||
}else if(this.result.type != undefined ){
|
||||
citationData.type = this.result.type.toLowerCase();
|
||||
}
|
||||
if(this.result.title && this.result.title.name){
|
||||
citationData.title = this.result.title.name;
|
||||
}
|
||||
if(this.result.journal && this.result.journal.journal){
|
||||
citationData["container-title"] = this.result.journal.journal;
|
||||
if(this.result.title){
|
||||
citationData.title = this.result.title;
|
||||
}
|
||||
if(this.result.publisher){
|
||||
citationData.publisher = this.result.publisher;
|
||||
|
@ -82,7 +78,7 @@ export class CiteThisComponent {
|
|||
var max_length = (this.result.authors.length > 10)?10:this.result.authors.length;
|
||||
for (var i =0 ;i < max_length; i++){
|
||||
if(this.result.authors[i] && this.result.authors[i].fullName && this.result.authors[i].fullName.indexOf(", ") !== -1){
|
||||
citationData.author.push({given:this.result.authors[i].fullName.split(", ")[0], family:this.result.authors[i].fullName.split(", ")[1], 'parse-names':true});
|
||||
citationData.author.push({given:this.result.authors[i].fullName.split(", ")[1], family:this.result.authors[i].fullName.split(", ")[0], 'parse-names':true});
|
||||
}else{
|
||||
citationData.author.push({given:"", family:this.result.authors[i].fullName, 'parse-names':true});
|
||||
}
|
||||
|
@ -102,6 +98,15 @@ export class CiteThisComponent {
|
|||
citationData.date = this.result.date ;
|
||||
}
|
||||
if(this.result.journal ){
|
||||
if(this.result.journal.journal){
|
||||
citationData["container-title"] = this.result.journal.journal;
|
||||
}
|
||||
if(this.result.journal.issn){
|
||||
citationData.ISSN = this.result.journal.issn;
|
||||
}
|
||||
if(this.result.journal.issue){
|
||||
citationData.issue = this.result.journal.issue;
|
||||
}
|
||||
citationData.type = "article-journal"; // in case of APA volume and pages appear only in specific types not just article
|
||||
if(this.result.journal.volume){
|
||||
citationData.volume = this.result.journal.volume ;
|
||||
|
@ -114,6 +119,7 @@ export class CiteThisComponent {
|
|||
|
||||
|
||||
this.data = citationData;
|
||||
console.log(this.data)
|
||||
// console.log(this.data);
|
||||
|
||||
}
|
||||
|
|
|
@ -12,19 +12,19 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
|||
<span *ngIf="journal['journal']">{{journal['journal']}}</span
|
||||
><span *ngIf="journal['journal'] && (journal['volume'] || journal['issue'])">,</span>
|
||||
<span *ngIf="journal['volume']"
|
||||
>volume
|
||||
> volume
|
||||
<span *ngIf="journal['volume'] > 0">{{journal['volume'] | number}}</span
|
||||
><span *ngIf="!(journal['volume'] > 0)">{{journal['volume']}}</span
|
||||
><span *ngIf="journal['issue'] || journal['start_page'] || journal['end_page']">,</span>
|
||||
</span>
|
||||
<span *ngIf="journal['issue']"
|
||||
>issue
|
||||
> issue
|
||||
<span *ngIf="journal['issue'] > 0">{{journal['issue'] | number}}</span
|
||||
><span *ngIf="!(journal['issue'] > 0)">{{journal['issue']}}</span
|
||||
><span *ngIf="journal['start_page'] || journal['end_page']">,</span>
|
||||
</span>
|
||||
<span *ngIf="(journal['volume'] || journal['issue']) &&
|
||||
(journal['start_page'] && journal['end_page'])">pages</span>
|
||||
(journal['start_page'] && journal['end_page'])"> pages </span>
|
||||
<span *ngIf="(journal['volume'] || journal['issue']) &&
|
||||
((journal['start_page'] && !journal['end_page']) ||
|
||||
(!journal['start_page'] && journal['end_page']))">page</span>
|
||||
|
@ -41,9 +41,9 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
|||
><span *ngIf="journal['issn']">issn: {{journal['issn']}}<span
|
||||
*ngIf="journal['eissn'] || journal['lissn']">, </span
|
||||
></span
|
||||
><span *ngIf="journal['eissn']">eissn: {{journal['eissn']}}<span *ngIf="journal['lissn']">, </span
|
||||
><span *ngIf="journal['eissn']"> eissn: {{journal['eissn']}}<span *ngIf="journal['lissn']">, </span
|
||||
></span
|
||||
><span *ngIf="journal && journal['lissn']">lissn: {{journal['lissn']}}
|
||||
><span *ngIf="journal && journal['lissn']"> lissn: {{journal['lissn']}}
|
||||
></span
|
||||
><span *ngIf=" journal['journal'] && (journal['issn'] || journal['eissn'] || journal['lissn'])">)</span>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue