Revision 60944
Added by Konstantinos Triantafyllou almost 3 years ago
modules/uoa-aggregator-portal/trunk/src/app/app.component.ts | ||
---|---|---|
11 | 11 |
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service"; |
12 | 12 |
import {Subscriber} from "rxjs"; |
13 | 13 |
import {DOCUMENT} from "@angular/common"; |
14 |
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll"; |
|
14 | 15 |
|
15 | 16 |
@Component({ |
16 | 17 |
selector: 'app-root', |
... | ... | |
53 | 54 |
agg: AggregatorInfo = null; |
54 | 55 |
subscriptions = []; |
55 | 56 |
|
56 |
constructor(private userManagementService: UserManagementService, private configurationService: ConfigurationService, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) { |
|
57 |
constructor(private userManagementService: UserManagementService, |
|
58 |
private configurationService: ConfigurationService, private smoothScroll: SmoothScroll, |
|
59 |
@Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) { |
|
57 | 60 |
this.id = ConnectHelper.getCommunityFromDomain(this.properties.domain); |
58 | 61 |
this.agg = PortalAggregators.getFilterInfoByMenuId(this.id); |
59 | 62 |
this.setStyles(); |
60 | 63 |
this.configurationService.initStaticCommunityInformation(PortalAggregators.getCommunityInfoByMenuId(this.id)); |
61 | 64 |
} |
62 |
ngOnDestroy() { |
|
63 |
this.subscriptions.forEach(subscription => { |
|
64 |
if (subscription instanceof Subscriber) { |
|
65 |
subscription.unsubscribe(); |
|
66 |
} |
|
67 |
}); |
|
68 |
this.configurationService.clearSubscriptions(); |
|
69 |
this.userManagementService.clearSubscriptions(); |
|
70 |
} |
|
65 |
|
|
71 | 66 |
ngOnInit() { |
72 | 67 |
if (typeof document !== 'undefined') { |
73 | 68 |
this.isClient = true; |
... | ... | |
97 | 92 |
})); |
98 | 93 |
} |
99 | 94 |
|
95 |
ngOnDestroy() { |
|
96 |
this.subscriptions.forEach(subscription => { |
|
97 |
if (subscription instanceof Subscriber) { |
|
98 |
subscription.unsubscribe(); |
|
99 |
} |
|
100 |
}); |
|
101 |
this.configurationService.clearSubscriptions(); |
|
102 |
this.userManagementService.clearSubscriptions(); |
|
103 |
this.smoothScroll.clearSubscriptions(); |
|
104 |
} |
|
105 |
|
|
100 | 106 |
private buildMenu() { |
101 | 107 |
this.menuItems = [ |
102 | 108 |
{rootItem: new MenuItem("home", "Home", "", "/", false, [], null, {}), items: []}, |
modules/uoa-aggregator-portal/trunk/src/app/app-routing.module.ts | ||
---|---|---|
1 | 1 |
import {NgModule} from '@angular/core'; |
2 |
import {Routes, RouterModule} from '@angular/router'; |
|
2 |
import {Routes, RouterModule, PreloadAllModules} from '@angular/router';
|
|
3 | 3 |
import {OpenaireErrorPageComponent} from './error/errorPage.component'; |
4 | 4 |
|
5 | 5 |
const routes: Routes = [ |
... | ... | |
96 | 96 |
]; |
97 | 97 |
|
98 | 98 |
@NgModule({ |
99 |
imports: [RouterModule.forRoot(routes)], |
|
99 |
imports: [RouterModule.forRoot(routes, { |
|
100 |
preloadingStrategy: PreloadAllModules, |
|
101 |
onSameUrlNavigation: "reload", |
|
102 |
relativeLinkResolution: 'corrected' |
|
103 |
})], |
|
100 | 104 |
exports: [RouterModule] |
101 | 105 |
}) |
102 | 106 |
export class AppRoutingModule { |
modules/uoa-aggregator-portal/trunk/src/index.beta.html | ||
---|---|---|
41 | 41 |
<meta name="theme-color" content="#ffffff"> |
42 | 42 |
<link id="customCss" rel="stylesheet" href=""> |
43 | 43 |
<title>Search OpenAIRE</title> |
44 |
|
|
45 |
</head> |
|
46 |
<body class="" style=""> |
|
47 |
|
|
48 |
<div class="uk-offcanvas-content uk-height-viewport"> |
|
49 |
|
|
50 |
<app-root></app-root> |
|
51 |
</div> |
|
52 |
|
|
53 |
<script type="text/javascript" > |
|
54 |
function loadAltmetrics(e,t,n){ |
|
55 |
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e); |
|
56 |
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png") |
|
57 |
}; |
|
58 |
</script> |
|
59 |
|
|
44 |
</head> |
|
45 |
<body> |
|
46 |
<div class="uk-offcanvas-content uk-height-viewport"> |
|
47 |
<app-root></app-root> |
|
48 |
</div> |
|
60 | 49 |
</body> |
50 |
<script type="text/javascript" > |
|
51 |
function loadAltmetrics(e,t,n){ |
|
52 |
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e); |
|
53 |
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png") |
|
54 |
} |
|
55 |
</script> |
|
56 |
<script src="https://unpkg.com/smoothscroll-polyfill@0.4.3/dist/smoothscroll.min.js"></script> |
|
61 | 57 |
</html> |
modules/uoa-aggregator-portal/trunk/src/index.html | ||
---|---|---|
1 | 1 |
<!DOCTYPE html> |
2 | 2 |
<html lang="en" dir="ltr" vocab="http://schema.org/"> |
3 |
<head> |
|
3 |
<head>
|
|
4 | 4 |
<meta charset="utf-8"> |
5 | 5 |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
6 | 6 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
... | ... | |
41 | 41 |
<meta name="theme-color" content="#ffffff"> |
42 | 42 |
<link id="customCss" rel="stylesheet" href=""> |
43 | 43 |
<title>Search OpenAIRE</title> |
44 |
|
|
45 |
</head> |
|
46 |
<body class="" style=""> |
|
47 |
|
|
48 |
<div class="uk-offcanvas-content uk-height-viewport"> |
|
49 |
|
|
50 |
<app-root></app-root> |
|
51 |
</div> |
|
52 |
|
|
53 |
<script type="text/javascript" > |
|
54 |
function loadAltmetrics(e,t,n){ |
|
55 |
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e); |
|
56 |
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png") |
|
57 |
}; |
|
58 |
</script> |
|
59 |
|
|
44 |
</head> |
|
45 |
<body> |
|
46 |
<div class="uk-offcanvas-content uk-height-viewport"> |
|
47 |
<app-root></app-root> |
|
48 |
</div> |
|
60 | 49 |
</body> |
50 |
<script type="text/javascript"> |
|
51 |
function loadAltmetrics(e,t,n){ |
|
52 |
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e); |
|
53 |
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png") |
|
54 |
} |
|
55 |
</script> |
|
56 |
<script src="https://unpkg.com/smoothscroll-polyfill@0.4.3/dist/smoothscroll.min.js"></script> |
|
61 | 57 |
</html> |
modules/uoa-aggregator-portal/trunk/src/index.prod.html | ||
---|---|---|
41 | 41 |
<meta name="theme-color" content="#ffffff"> |
42 | 42 |
<link id="customCss" rel="stylesheet" href=""> |
43 | 43 |
<title>Search OpenAIRE</title> |
44 |
|
|
45 |
</head> |
|
46 |
<body class="" style=""> |
|
47 |
|
|
48 |
<div class="uk-offcanvas-content uk-height-viewport"> |
|
49 |
|
|
50 |
<app-root></app-root> |
|
51 |
</div> |
|
52 |
|
|
53 |
<script type="text/javascript" > |
|
54 |
function loadAltmetrics(e,t,n){ |
|
55 |
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e); |
|
56 |
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png") |
|
57 |
}; |
|
58 |
</script> |
|
59 |
|
|
44 |
</head> |
|
45 |
<body> |
|
46 |
<div class="uk-offcanvas-content uk-height-viewport"> |
|
47 |
<app-root></app-root> |
|
48 |
</div> |
|
60 | 49 |
</body> |
50 |
<script type="text/javascript"> |
|
51 |
function loadAltmetrics(e,t,n){ |
|
52 |
var d="createElement",c="getElementsByTagName",m="setAttribute",n=document.getElementById(e); |
|
53 |
return n&&n.parentNode&&n.parentNode.removeChild(n),n=document[d+"NS"]&&document.documentElement.namespaceURI,n=n?document[d+"NS"](n,"script"):document[d]("script"),n[m]("id",e),n[m]("src",t),(document[c]("head")[0]||document[c]("body")[0]).appendChild(n),n=new Image,void n[m]("src","https://d1uo4w7k31k5mn.cloudfront.net/donut/0.png") |
|
54 |
} |
|
55 |
</script> |
|
56 |
<script src="https://unpkg.com/smoothscroll-polyfill@0.4.3/dist/smoothscroll.min.js"></script> |
|
61 | 57 |
</html> |
Also available in: Unified diff
[Aggregator | Trunk]: Add smooth scroll