Revision 60926
Added by Konstantinos Triantafyllou over 2 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/connect/connectHelper.ts | ||
---|---|---|
5 | 5 |
|
6 | 6 |
public static getCommunityFromDomain(domain: string): string{ |
7 | 7 |
if(properties.environment == "development") { |
8 |
domain = "beta.enermaps.openaire.eu"; //for testing
|
|
8 |
domain = "beta.egi.openaire.eu"; //for testing
|
|
9 | 9 |
} |
10 | 10 |
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix |
11 | 11 |
if (domain.indexOf('openaire.eu') === -1) { |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/dataProvider/dataProvider.component.ts | ||
---|---|---|
161 | 161 |
} |
162 | 162 |
}); |
163 | 163 |
} |
164 |
|
|
165 |
HelperFunctions.scroll(); |
|
166 | 164 |
})); |
167 | 165 |
} |
168 | 166 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/organization/organization.component.ts | ||
---|---|---|
156 | 156 |
"page_type": "organization" |
157 | 157 |
} |
158 | 158 |
}); |
159 |
//this.warningMessage = "No valid organization id"; |
|
160 | 159 |
} |
161 |
|
|
162 |
HelperFunctions.scroll(); |
|
163 |
|
|
164 | 160 |
this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))'; |
165 |
|
|
166 | 161 |
})); |
167 | 162 |
|
168 | 163 |
this.downloadURLAPI = this.properties.csvAPIURL; |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/project/project.component.ts | ||
---|---|---|
189 | 189 |
this.downloadURLAPI = this.properties.csvAPIURL; |
190 | 190 |
|
191 | 191 |
this.createClipboard(); |
192 |
HelperFunctions.scroll(); |
|
193 | 192 |
})); |
194 | 193 |
} |
195 | 194 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/publishedIn.component.ts | ||
---|---|---|
1 |
import {Component, Input} from '@angular/core'; |
|
2 |
import {HelperFunctions} from "../../utils/HelperFunctions.class"; |
|
3 |
|
|
4 |
// NOT USED |
|
5 |
@Component({ |
|
6 |
selector: 'publishedIn', |
|
7 |
template: ` |
|
8 |
<dl [class]="'uk-description-list-line' + ((publishedIn && publishedIn.size > threshold) ? ' uk-margin-remove-bottom' : '')"> |
|
9 |
<dt class="title">Published in</dt> |
|
10 |
<dd class="line" *ngFor="let key of getKeys(publishedIn) let i=index"> |
|
11 |
<div *ngIf="i<5 || showAll" class="{{publishedIn.get(key)['bestAccessMode']}}"> |
|
12 |
<span [class]="publishedIn.get(key)['url'].length > 0 ? 'custom-external custom-icon' : ''"> |
|
13 |
<span *ngIf="publishedIn.get(key)['url'].length > 1"> |
|
14 |
{{key}} |
|
15 |
<span *ngFor="let url of publishedIn.get(key)['url']; let i=index"> |
|
16 |
<a href="{{url}}" target="_blank" |
|
17 |
[attr.uk-tooltip]="publishedIn.get(key)['accessMode'][i] ? 'pos:right; delay:10' : 'cls: uk-invisible'" |
|
18 |
[title]="publishedIn.get(key)['accessMode'][i]"> |
|
19 |
[{{i+1}}] |
|
20 |
</a> |
|
21 |
</span> |
|
22 |
</span> |
|
23 |
<a *ngIf="publishedIn.get(key)['url'].length == 1" |
|
24 |
href="{{publishedIn.get(key)['url']}}" |
|
25 |
target="_blank" |
|
26 |
[attr.uk-tooltip]="publishedIn.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'" |
|
27 |
[title]="publishedIn.get(key)['bestAccessMode']"> |
|
28 |
{{key}} |
|
29 |
</a> |
|
30 |
<span *ngIf="publishedIn.get(key)['url'].length == 0" |
|
31 |
[attr.uk-tooltip]="publishedIn.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'" |
|
32 |
[title]="publishedIn.get(key)['bestAccessMode']"> |
|
33 |
{{key}} |
|
34 |
</span> |
|
35 |
</span> |
|
36 |
</div> |
|
37 |
</dd> |
|
38 |
<dd *ngIf="showAll" class="uk-text-right uk-margin-bottom"> |
|
39 |
<a class="uk-text-muted" (click)="showAll = !showAll; scroll()"> |
|
40 |
View less |
|
41 |
</a> |
|
42 |
</dd> |
|
43 |
<!-- <dd *ngIf="!showAll && publishedIn.size > 5">...</dd>--> |
|
44 |
<dd *ngIf="!showAll && publishedIn.size > 5" class="uk-text-right uk-margin-bottom"> |
|
45 |
<a class="uk-text-muted" (click)="showAll = !showAll;"> |
|
46 |
View more |
|
47 |
</a> |
|
48 |
</dd> |
|
49 |
</dl> |
|
50 |
` |
|
51 |
}) |
|
52 |
|
|
53 |
// NOT USED |
|
54 |
export class PublishedInComponent { |
|
55 |
public threshold: number = 5; |
|
56 |
public showNum: number = 5; |
|
57 |
|
|
58 |
//key is name |
|
59 |
@Input() publishedIn: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; |
|
60 |
|
|
61 |
public showAll: boolean = false; |
|
62 |
|
|
63 |
constructor () {} |
|
64 |
|
|
65 |
ngOnInit() {} |
|
66 |
|
|
67 |
public scroll() { |
|
68 |
HelperFunctions.scroll(); |
|
69 |
} |
|
70 |
public getKeys( map) { |
|
71 |
return Array.from(map.keys()); |
|
72 |
} |
|
73 |
} |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/availableOn.component.ts | ||
---|---|---|
54 | 54 |
</span> |
55 | 55 |
</a> |
56 | 56 |
</div> |
57 |
<!-- <div *ngIf="showNum == threshold && availableOn && availableOn.length > 5">...</div>--> |
|
58 | 57 |
<div *ngIf="showNum == threshold && availableOn && availableOn.length > 5" class="uk-margin-bottom"> |
59 | 58 |
<a (click)="showNum = availableOn.length;" class="uk-flex uk-flex-middle uk-flex-center"> |
60 | 59 |
<span>View more</span> |
... | ... | |
70 | 69 |
|
71 | 70 |
export class AvailableOnComponent { |
72 | 71 |
@Input() availableOn: HostedByCollectedFrom[]; |
73 |
// { |
|
74 |
// "downloadName": string, "downloadUrl": string[], |
|
75 |
// "collectedName": string, "collectedId": string, |
|
76 |
// "accessMode": string[], "bestAccessMode": string, |
|
77 |
// "type": string, "year": string, icon: string |
|
78 |
// }[]; |
|
79 |
// public open = 'assets/common-assets/unlock.svg'; |
|
80 |
// public closed = 'assets/common-assets/lock.svg'; |
|
81 |
// public unknown = 'assets/common-assets/question.svg'; |
|
82 | 72 |
public threshold: number = 4; |
83 | 73 |
public showNum: number = 4; |
84 | 74 |
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0]; |
... | ... | |
86 | 76 |
constructor() { |
87 | 77 |
} |
88 | 78 |
|
89 |
ngOnInit() { |
|
90 |
// this.availableOn.forEach(available => { |
|
91 |
// if (available.bestAccessMode) { |
|
92 |
// if (available.bestAccessMode.toLowerCase().indexOf('open') !== -1) { |
|
93 |
// available.icon = this.open; |
|
94 |
// } else if (available.bestAccessMode.toLowerCase().indexOf('not available') !== -1) { |
|
95 |
// available.icon = this.unknown; |
|
96 |
// } else { |
|
97 |
// available.icon = this.closed; |
|
98 |
// } |
|
99 |
// } else { |
|
100 |
// available.icon = this.unknown; |
|
101 |
// } |
|
102 |
// } |
|
103 |
// ); |
|
104 |
} |
|
79 |
ngOnInit() {} |
|
105 | 80 |
|
106 | 81 |
public removeUnknown(value: string): string { |
107 | 82 |
if (value.toLowerCase() === 'unknown') { |
... | ... | |
109 | 84 |
} |
110 | 85 |
return value; |
111 | 86 |
} |
112 |
|
|
113 |
public scroll() { |
|
114 |
HelperFunctions.scroll(); |
|
115 |
} |
|
116 | 87 |
} |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/resultLandingUtils.module.ts | ||
---|---|---|
7 | 7 |
import {ShowIdentifiersComponent} from './showIdentifiers.component'; |
8 | 8 |
import {ShowSubjectsComponent} from './showSubjects.component'; |
9 | 9 |
import {FundedByComponent} from './fundedBy.component'; |
10 |
import {PublishedInComponent} from './publishedIn.component'; |
|
11 | 10 |
import {AvailableOnComponent} from './availableOn.component'; |
12 | 11 |
import {TabTableComponent} from './tabTable.component'; |
13 | 12 |
import {ShowPublisherComponent} from "./showPublisher.component"; |
... | ... | |
21 | 20 |
], |
22 | 21 |
declarations: [ |
23 | 22 |
ShowIdentifiersComponent,ShowSubjectsComponent, |
24 |
FundedByComponent,PublishedInComponent,AvailableOnComponent,TabTableComponent,
|
|
23 |
FundedByComponent,AvailableOnComponent,TabTableComponent, |
|
25 | 24 |
RelatedToComponent |
26 | 25 |
], |
27 | 26 |
providers:[ |
28 | 27 |
], |
29 | 28 |
exports: [ |
30 | 29 |
ShowIdentifiersComponent, ShowSubjectsComponent, |
31 |
FundedByComponent, PublishedInComponent, AvailableOnComponent, TabTableComponent, ShowPublisherComponent,
|
|
30 |
FundedByComponent,AvailableOnComponent, TabTableComponent, ShowPublisherComponent, |
|
32 | 31 |
RelatedToComponent |
33 | 32 |
] |
34 | 33 |
}) |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/authors/showAuthors.component.ts | ||
---|---|---|
114 | 114 |
} |
115 | 115 |
} |
116 | 116 |
|
117 |
public scroll() { |
|
118 |
HelperFunctions.scroll(); |
|
119 |
} |
|
120 |
|
|
121 | 117 |
public onClick() { |
122 | 118 |
if (this.modal) { |
123 | 119 |
this.modal.cancel(); |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/svg-background/svg.ts | ||
---|---|---|
1 |
export const search = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 532"><defs><style>.cls-1{isolation:isolate;}.cls-2{fill:{{color}};mix-blend-mode:multiply;}</style></defs><title>Asset 3</title><g class="cls-1"><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-2" d="M0,431s362,109,841,62,632,68,1159-9V0H0Z"/><path class="cls-2" d="M0,514s1401,71,2000-69V0H0Z"/></g></g></g></svg>' |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/svg-background/svg-background.module.ts | ||
---|---|---|
1 |
import {NgModule} from "@angular/core"; |
|
2 |
import {CommonModule} from "@angular/common"; |
|
3 |
import {SvgBackgroundDirective} from "./svg-background.directive"; |
|
4 |
|
|
5 |
@NgModule({ |
|
6 |
imports: [CommonModule], |
|
7 |
declarations: [SvgBackgroundDirective], |
|
8 |
exports: [SvgBackgroundDirective] |
|
9 |
}) |
|
10 |
export class SvgBackgroundModule { |
|
11 |
|
|
12 |
} |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/svg-background/svg-background.directive.ts | ||
---|---|---|
1 |
import {Directive, ElementRef, Input, OnInit, Renderer2} from "@angular/core"; |
|
2 |
|
|
3 |
@Directive({ |
|
4 |
selector: '[svg-background]', |
|
5 |
}) |
|
6 |
export class SvgBackgroundDirective implements OnInit{ |
|
7 |
@Input() |
|
8 |
private color: string; |
|
9 |
@Input() |
|
10 |
private svg: string; |
|
11 |
@Input() |
|
12 |
private svgColor: string; |
|
13 |
@Input() |
|
14 |
private position: string = null; |
|
15 |
private readonly element: any; |
|
16 |
|
|
17 |
constructor(private elementRef: ElementRef, |
|
18 |
private renderer: Renderer2,) { |
|
19 |
this.element = this.elementRef.nativeElement; |
|
20 |
} |
|
21 |
|
|
22 |
ngOnInit() { |
|
23 |
let svg = this.encodeSvg(); |
|
24 |
if(this.position && svg) { |
|
25 |
this.renderer.setStyle(this.element, 'background', "url(" + svg + ") " + (this.color?this.color + " ":"") + "no-repeat " + this.position); |
|
26 |
} |
|
27 |
} |
|
28 |
|
|
29 |
private encodeSvg(): string { |
|
30 |
if(this.svg && this.svgColor) { |
|
31 |
return 'data:image/svg+xml,' + encodeURIComponent(this.svg.replace('{{color}}', this.svgColor)); |
|
32 |
} |
|
33 |
return null; |
|
34 |
} |
|
35 |
} |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/reload/reload.component.ts | ||
---|---|---|
15 | 15 |
} |
16 | 16 |
|
17 | 17 |
public ngOnInit() { |
18 |
HelperFunctions.scroll(); |
|
19 | 18 |
let URL = Session.getReloadUrl(); |
20 | 19 |
if (URL && URL["path"] && URL["path"] != "") { |
21 | 20 |
let url: string = URL["path"]; |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/claims/claim-utils/claimHelper.class.ts | ||
---|---|---|
158 | 158 |
this.basketShowLinksTo = false; |
159 | 159 |
this.basketShowSources = true; |
160 | 160 |
HelperFunctions.scroll(); |
161 |
|
|
162 | 161 |
} |
163 | 162 |
|
164 | 163 |
showLinkTo() { |
Also available in: Unified diff
[Library | Trunk]: Remove scroll to top from pages initiliazation