@aarhus-university/au-lib-react-components 9.11.17 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +44 -0
- package/README.md +19 -20
- package/babel.config.js +7 -6
- package/build/umd/all.css +1 -1
- package/build/umd/all.css.map +1 -1
- package/build/umd/all.js +1 -1
- package/build/umd/all.js.map +1 -1
- package/build/umd/alphabox.js +1 -1
- package/build/umd/alphabox.js.map +1 -1
- package/build/umd/databox.js +1 -2
- package/build/umd/databox.js.map +1 -1
- package/build/umd/diagramme.js +1 -1
- package/build/umd/diagramme.js.map +1 -1
- package/build/umd/flowbox.js +1 -1
- package/build/umd/flowbox.js.map +1 -1
- package/build/umd/universe.js +1 -1
- package/build/umd/universe.js.map +1 -1
- package/package.json +66 -60
- package/src/components/{delphinus/AUAlertComponent.js → AUAlertComponent.tsx} +70 -85
- package/src/components/{AutoSuggestComponent.js → AUAutoSuggestComponent.js} +45 -19
- package/src/components/AUCalendarComponent.tsx +493 -0
- package/src/components/AUContentToggleComponent.tsx +33 -0
- package/src/components/AUDatepickerComponent.tsx +117 -0
- package/src/components/AUMobilePrefixComponent.tsx +15 -0
- package/src/components/{delphinus/AUModalComponent.js → AUModalComponent.tsx} +78 -94
- package/src/components/{form/AUReceiptComponent.js → AUReceiptComponent.tsx} +33 -40
- package/src/components/AUSpinnerComponent.tsx +67 -0
- package/src/components/{delphinus/AUSubNavComponent.js → AUSubNavComponent.tsx} +38 -53
- package/src/components/{form/AUSubmitButtonContainerComponent.js → AUSubmitButtonContainerComponent.tsx} +31 -39
- package/src/components/{delphinus/AUTabbedContentComponent.js → AUTabbedContentComponent.tsx} +145 -150
- package/src/components/{delphinus/AUTableComponent.js → AUTableComponent.tsx} +24 -28
- package/src/components/{delphinus/AUToastComponent.js → AUToastComponent.tsx} +104 -91
- package/src/components/{delphinus/AUToolbarComponent.js → AUToolbarComponent.tsx} +45 -48
- package/src/components/profile/AUProfileActions.js +128 -128
- package/src/components/profile/AUProfileAvatarComponent.js +83 -83
- package/src/components/profile/AUProfileAvatarV2Component.js +91 -91
- package/src/components/profile/AUProfileAvatarV3Component.tsx +42 -0
- package/src/components/profile/AUProfileContainerComponent.js +283 -283
- package/src/components/profile/AUProfileHooks.js +30 -30
- package/src/components/profile/AUProfileItemComponent.js +54 -54
- package/src/components/profile/AUProfileLanguageComponent.js +131 -131
- package/src/components/profile/{AUProfileLoginComponent.js → AUProfileLoginComponent.tsx} +3 -18
- package/src/components/profile/AUProfileMailComponent.js +307 -307
- package/src/components/profile/AUProfileMobileComponent.js +164 -164
- package/src/components/profile/AUProfileNameComponent.js +253 -253
- package/src/components/profile/AUProfileNextOfKinComponent.js +216 -216
- package/src/components/profile/AUProfileReducer.js +230 -230
- package/src/components/profile/AUProfileWidgetComponent.js +95 -95
- package/src/components/profile/AUProfileWidgetV2Component.js +116 -116
- package/src/components/profile/{AUProfileWidgetV3Component.js → AUProfileWidgetV3Component.tsx} +122 -130
- package/src/components/wrapping/AUEmbedComponent.js +47 -47
- package/src/{components → layout-2016/components}/alphabox/AlphaBoxComponent.js +28 -25
- package/src/{components → layout-2016/components}/alphabox/AlphaBoxContentComponent.js +25 -14
- package/src/{components → layout-2016/components/common}/AUCollapsibleComponent.js +1 -22
- package/src/{components → layout-2016/components/common}/AUSpinnerComponent.js +2 -24
- package/src/{components → layout-2016/components}/databox/DataBoxAlphabetComponent.js +1 -1
- package/src/{components → layout-2016/components}/databox/DataBoxAssociationComponent.js +2 -2
- package/src/{components → layout-2016/components}/databox/DataBoxButtonComponent.js +7 -3
- package/src/{components → layout-2016/components}/databox/DataBoxComponent.js +2 -2
- package/src/{components → layout-2016/components}/databox/DataBoxGroupingComponent.js +2 -0
- package/src/{components → layout-2016/components}/databox/DataBoxSearchResultComponent.js +1 -5
- package/src/{components → layout-2016/components}/databox/DataBoxStackedAssociationComponent.js +1 -5
- package/src/{components → layout-2016/components}/databox/DataBoxSuggestionComponent.js +0 -0
- package/src/{components → layout-2016/components/diagramme}/AUDiagrammeComponent.js +5 -6
- package/src/{components → layout-2016/components}/flowbox/FlowBoxComponent.js +8 -8
- package/src/{components → layout-2016/components}/flowbox/FlowBoxPhoneComponent.js +3 -5
- package/src/{components → layout-2016/components}/profile/AUProfileAvatar2016Component.js +6 -2
- package/src/{components → layout-2016/components}/universe/StaffTopComponent.js +4 -3
- package/src/{components → layout-2016/components}/universe/StudentTopComponent.js +0 -0
- package/src/{components → layout-2016/components}/universe/UniverseContainerComponent.js +11 -8
- package/src/layout-2016/lib/all.js +3 -0
- package/src/{lib → layout-2016/lib}/au-alphabox.js +1 -3
- package/src/{lib → layout-2016/lib}/au-databox.js +6 -9
- package/src/{lib → layout-2016/lib}/au-diagramme.js +2 -4
- package/src/{lib → layout-2016/lib}/au-flowbox.js +1 -3
- package/src/{lib → layout-2016/lib}/universe.js +0 -0
- package/src/lib/{helpers.js → helpers.ts} +44 -66
- package/src/{components/delphinus/hooks.js → lib/hooks.ts} +33 -28
- package/src/lib/{i18n.js → i18n.ts} +600 -601
- package/src/lib/{tracking.js → tracking.ts} +69 -65
- package/src/lib/{wrapping.js → wrapping.ts} +21 -16
- package/src/styles/_settings.scss +10 -10
- package/src/styles/alphabox.scss +222 -208
- package/src/styles/app.scss +7 -13
- package/src/styles/autosuggest.scss +57 -57
- package/src/styles/databox.scss +563 -563
- package/src/styles/diagramme.scss +119 -119
- package/src/styles/flowbox.scss +72 -72
- package/src/styles/maps.scss +395 -395
- package/tsconfig.json +47 -0
- package/types/common/interfaces/gui.d.ts +52 -0
- package/types/common/interfaces/model.d.ts +29 -0
- package/types/common/main.d.ts +5 -0
- package/types/common/package.json +5 -0
- package/types/common/payloads.d.ts +0 -0
- package/types/common/props.d.ts +165 -0
- package/{src/config/webpack.umd.config.js → webpack.config.js} +20 -16
- package/.eslintrc +0 -19
- package/build/dev.html +0 -329
- package/build/umd/auAuth.js +0 -2
- package/build/umd/auAuth.js.map +0 -1
- package/build/umd/databox.js.LICENSE.txt +0 -5
- package/build/umd/news.js +0 -2
- package/build/umd/news.js.map +0 -1
- package/src/all.js +0 -3
- package/src/app.js +0 -263
- package/src/components/AUAlertComponent.js +0 -158
- package/src/components/AUAmountComponent.js +0 -84
- package/src/components/AUBannerComponent.js +0 -99
- package/src/components/AUCalendarComponent.js +0 -393
- package/src/components/AUDatepickerComponent.js +0 -105
- package/src/components/AUFilterCheckboxComponent.js +0 -122
- package/src/components/AUFocusComponent.js +0 -55
- package/src/components/AUModalComponent.js +0 -94
- package/src/components/AUPaginationComponent.js +0 -103
- package/src/components/context/AUUserContextComponent.js +0 -91
- package/src/components/context/ImpersonateComponent.js +0 -54
- package/src/components/delphinus/AUCalendarComponent.js +0 -487
- package/src/components/delphinus/AUContentToggleComponent.js +0 -32
- package/src/components/delphinus/AUDatepickerComponent.js +0 -164
- package/src/components/delphinus/AULoginComponent.js +0 -65
- package/src/components/delphinus/AUSpinnerComponent.js +0 -114
- package/src/components/form/AUMobilePrefixComponent.js +0 -18
- package/src/components/news/EventLayout1Component.js +0 -94
- package/src/components/news/EventLayout2Component.js +0 -90
- package/src/components/news/EventLayout3Component.js +0 -68
- package/src/components/news/NewsCategoriesComponent.js +0 -21
- package/src/components/news/NewsCollageBannerComponent.js +0 -71
- package/src/components/news/NewsCollageBannerRSSComponent.js +0 -79
- package/src/components/news/NewsColumnsComponent.js +0 -125
- package/src/components/news/NewsLanguageChangeComponent.js +0 -74
- package/src/components/news/NewsLayout1Component.js +0 -80
- package/src/components/news/NewsLayout2Component.js +0 -80
- package/src/components/news/NewsLayout3Component.js +0 -81
- package/src/components/news/NewsLayout4Component.js +0 -80
- package/src/components/news/NewsLayout5Component.js +0 -61
- package/src/components/news/NewsLayout6Component.js +0 -55
- package/src/components/news/NewsLayout7Component.js +0 -58
- package/src/components/news/NewsLayout8Component.js +0 -57
- package/src/components/news/NewsListComponent.js +0 -291
- package/src/components/news/NewsPopUpComponent.js +0 -591
- package/src/components/news/NewsRSSComponent.js +0 -74
- package/src/components/news/NewsSocialComponent.js +0 -104
- package/src/components/news/NewsSubHeaderComponent.js +0 -19
- package/src/components/password/AUChangePasswordComponent.js +0 -177
- package/src/components/password/AUCurrentPasswordComponent.js +0 -72
- package/src/components/password/AUNewPasswordComponent.js +0 -143
- package/src/components/password/AUPasswordActions.js +0 -101
- package/src/components/password/AUPasswordHooks.js +0 -47
- package/src/components/password/AUPasswordReducer.js +0 -78
- package/src/components/password/AUPasswordRequirementsComponent.js +0 -29
- package/src/components/profile/AUProfileAvatarV3Component.js +0 -80
- package/src/config/webpack.dev.config.js +0 -47
- package/src/index.js +0 -6
- package/src/lib/au-auth.js +0 -227
- package/src/lib/au-news.js +0 -371
- package/src/lib/menu.js +0 -10
- package/src/lib/urlHandler.js +0 -63
- package/src/lib/validation.js +0 -181
- package/src/styles/alert.scss +0 -39
- package/src/styles/calendar.scss +0 -112
- package/src/styles/filtercheckbox.scss +0 -5
- package/src/styles/modal.scss +0 -35
- package/src/styles/pagination.scss +0 -11
- package/src/styles/spinner.scss +0 -30
|
@@ -1,591 +0,0 @@
|
|
|
1
|
-
/* eslint-env browser */
|
|
2
|
-
/* eslint jsx-a11y/no-noninteractive-tabindex: 0 */
|
|
3
|
-
/* eslint jsx-a11y/control-has-associated-label: 0 */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import NewsLanguageChangeComponent from './NewsLanguageChangeComponent';
|
|
7
|
-
import NewsSocialComponent from './NewsSocialComponent';
|
|
8
|
-
import { newsLabels as labels } from '../../lib/i18n';
|
|
9
|
-
import { AUNewsHelpers, AUNewsConfig } from '../../lib/au-news';
|
|
10
|
-
|
|
11
|
-
const setFade = () => {
|
|
12
|
-
const fade = document.getElementById('fade');
|
|
13
|
-
if (fade) {
|
|
14
|
-
fade.style.display = 'block';
|
|
15
|
-
fade.style.opacity = 0.7;
|
|
16
|
-
fade.style.zIndex = 101;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
class NewsPopUpComponent extends React.Component {
|
|
21
|
-
static getItem(id, lang, callback) {
|
|
22
|
-
const url = `${AUNewsConfig.server}/index.php?eID=getAuNewsFeed&mode=id&key=${id}&lang=${lang}&callback=?`;
|
|
23
|
-
// Axios does not support JSONP requests!
|
|
24
|
-
$.ajax({
|
|
25
|
-
url,
|
|
26
|
-
dataType: 'json',
|
|
27
|
-
jsonpCallback: url.hashCode(),
|
|
28
|
-
jsonp: true,
|
|
29
|
-
cache: true,
|
|
30
|
-
success: (data) => {
|
|
31
|
-
if (data && data.length === 1) {
|
|
32
|
-
if (typeof callback === 'function' && data[0].hidden !== '1') {
|
|
33
|
-
callback(data[0]);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static calculateHeight() {
|
|
41
|
-
if (document.querySelector('.au_news_popup') && !AU.helpers.isMobileDevice()) {
|
|
42
|
-
const element = document.querySelector('.au_news_popup');
|
|
43
|
-
const viewPortHeight = Math.max(
|
|
44
|
-
document.documentElement.clientHeight, window.innerHeight || 0,
|
|
45
|
-
);
|
|
46
|
-
const popupTop = getComputedStyle(element).top.replace('px', '');
|
|
47
|
-
const popupBottom = getComputedStyle(element).bottom.replace('px', '');
|
|
48
|
-
element.querySelector('.au_news_popup_inner').style.height = `${viewPortHeight - popupTop - popupBottom}px`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
constructor(props) {
|
|
53
|
-
super(props);
|
|
54
|
-
|
|
55
|
-
const { item } = props;
|
|
56
|
-
this.state = {
|
|
57
|
-
item,
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
this.posBeforeShow = 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
componentDidMount() {
|
|
64
|
-
const {
|
|
65
|
-
item,
|
|
66
|
-
id,
|
|
67
|
-
lang,
|
|
68
|
-
print,
|
|
69
|
-
} = this.props;
|
|
70
|
-
const { item: sItem } = this.state;
|
|
71
|
-
if (item == null) {
|
|
72
|
-
NewsPopUpComponent.getItem(id, lang, (_item) => {
|
|
73
|
-
const trackerLink = `/virtual/news/${AUNewsHelpers.typeIdToText(_item.type)}/open-single/id-${_item.id}/${_item.permalink}`;
|
|
74
|
-
AU.tracking.trackSingle(trackerLink);
|
|
75
|
-
this.setState({
|
|
76
|
-
item: _item,
|
|
77
|
-
}, () => {
|
|
78
|
-
if (print) {
|
|
79
|
-
window.print();
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
setFade();
|
|
86
|
-
document.querySelector('.au_news_popup_inner').focus();
|
|
87
|
-
NewsPopUpComponent.calculateHeight();
|
|
88
|
-
if (sItem != null) {
|
|
89
|
-
// this.setDisqus();
|
|
90
|
-
NewsPopUpComponent.setLightBox();
|
|
91
|
-
}
|
|
92
|
-
this.posBeforeShow = document.documentElement.scrollTop === 0
|
|
93
|
-
? document.body.scrollTop : document.documentElement.scrollTop;
|
|
94
|
-
document.querySelector('body').classList.add('news-overlay-open');
|
|
95
|
-
AU.resize.push(() => {
|
|
96
|
-
NewsPopUpComponent.calculateHeight();
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
componentDidUpdate() {
|
|
101
|
-
const { item } = this.state;
|
|
102
|
-
if (item != null) {
|
|
103
|
-
// this.setDisqus();
|
|
104
|
-
NewsPopUpComponent.setLightBox();
|
|
105
|
-
setFade();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
componentWillUnmount() {
|
|
110
|
-
const fade = document.getElementById('fade');
|
|
111
|
-
if (fade) {
|
|
112
|
-
fade.style.display = 'none';
|
|
113
|
-
document.querySelector('body').style.overflowY = 'visible';
|
|
114
|
-
document.documentElement.scrollTop = this.posBeforeShow;
|
|
115
|
-
document.body.scrollTop = this.posBeforeShow;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
setDisqus() {
|
|
120
|
-
const { item } = this.state;
|
|
121
|
-
window.disqus_url = item.permalink;
|
|
122
|
-
if (window.disqus_url !== '' && !item.comments_closed && item.id > 0) {
|
|
123
|
-
if (!window.disqus_loaded) {
|
|
124
|
-
$.getScript('//disqus.com/forums/rapexegesis/embed.js', () => {
|
|
125
|
-
window.disqus_loaded = true;
|
|
126
|
-
});
|
|
127
|
-
} else {
|
|
128
|
-
window.DISQUS.reset({
|
|
129
|
-
reload: true,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
static setLightBox() {
|
|
136
|
-
$('.au_news_popup a[rel="lightbox"]').magnificPopup({
|
|
137
|
-
type: 'image',
|
|
138
|
-
gallery: {
|
|
139
|
-
enabled: true,
|
|
140
|
-
},
|
|
141
|
-
modal: false,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
render() {
|
|
146
|
-
const { item } = this.state;
|
|
147
|
-
const { lang } = this.props;
|
|
148
|
-
|
|
149
|
-
let outerClassName = 'au_news_popup social';
|
|
150
|
-
if (AUNewsHelpers.isiPad()) {
|
|
151
|
-
outerClassName += ' ipad';
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (!item) {
|
|
155
|
-
return (
|
|
156
|
-
<div className={outerClassName}>
|
|
157
|
-
<div className="au_news_popup_inner" tabIndex="0" />
|
|
158
|
-
</div>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const additionalInfo = item.links.length > 0
|
|
163
|
-
|| item.related.length > 0
|
|
164
|
-
|| item.files.length > 0;
|
|
165
|
-
const renderCategories = null; /* item.categories ? item.categories.map(
|
|
166
|
-
(c, j) => (
|
|
167
|
-
<span key={c.category}>
|
|
168
|
-
{`${j === 0 ? '' : ', '} ${c.category}`}
|
|
169
|
-
</span>
|
|
170
|
-
),
|
|
171
|
-
) : ''; */
|
|
172
|
-
|
|
173
|
-
const printUrl = window.location.href.replace(window.location.hash, `?newsprint=true${window.location.hash}`);
|
|
174
|
-
|
|
175
|
-
return (
|
|
176
|
-
<div className="au_news_popup social">
|
|
177
|
-
<div className="au_news_popup_inner" tabIndex="0">
|
|
178
|
-
<div className="au_news_overlay">
|
|
179
|
-
<span className="au_news-single-print">
|
|
180
|
-
<a
|
|
181
|
-
href={printUrl}
|
|
182
|
-
onClick={(e) => {
|
|
183
|
-
e.preventDefault();
|
|
184
|
-
window.open(printUrl, '', 'width=1025,height=600');
|
|
185
|
-
}}
|
|
186
|
-
>
|
|
187
|
-
Print
|
|
188
|
-
</a>
|
|
189
|
-
</span>
|
|
190
|
-
<NewsLanguageChangeComponent
|
|
191
|
-
getItem={NewsPopUpComponent.getItem}
|
|
192
|
-
item={item}
|
|
193
|
-
lang={lang}
|
|
194
|
-
/>
|
|
195
|
-
</div>
|
|
196
|
-
<div className="au_news_overlay_wrapper">
|
|
197
|
-
<h1
|
|
198
|
-
className="au_news_overlay_header"
|
|
199
|
-
dangerouslySetInnerHTML={{
|
|
200
|
-
__html: item.header,
|
|
201
|
-
}}
|
|
202
|
-
/>
|
|
203
|
-
<div className="header_bg" />
|
|
204
|
-
<div className="au_news-single-item au_news-single2-item">
|
|
205
|
-
<p
|
|
206
|
-
className="au_news-single-subheader"
|
|
207
|
-
dangerouslySetInnerHTML={{
|
|
208
|
-
__html: item.subheader,
|
|
209
|
-
}}
|
|
210
|
-
/>
|
|
211
|
-
{(() => {
|
|
212
|
-
if (item.event_from == null) {
|
|
213
|
-
return (
|
|
214
|
-
<p className="au_news-legend">
|
|
215
|
-
<span className="au_news-single-date">{item.date}</span>
|
|
216
|
-
<span>
|
|
217
|
-
<span className="au_news-date-author-separator"> | </span>
|
|
218
|
-
<span className="aunews-single-author">
|
|
219
|
-
<a href={`mailto:${item.author.email}`}>{item.author.name}</a>
|
|
220
|
-
</span>
|
|
221
|
-
</span>
|
|
222
|
-
</p>
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
return null;
|
|
226
|
-
})()}
|
|
227
|
-
{(() => {
|
|
228
|
-
if (item.image.src !== '' && item.layout === 'Standard') {
|
|
229
|
-
return (
|
|
230
|
-
<div className="news-set1-img1all">
|
|
231
|
-
<a href={item.image.href} title={item.image.title} rel="lightbox">
|
|
232
|
-
<img
|
|
233
|
-
src={item.image.src}
|
|
234
|
-
alt={item.image.title}
|
|
235
|
-
width={item.image.width}
|
|
236
|
-
height={item.image.height}
|
|
237
|
-
/>
|
|
238
|
-
</a>
|
|
239
|
-
<p className="au_news-single2-imgcaption">{item.image.title}</p>
|
|
240
|
-
</div>
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
return null;
|
|
244
|
-
})()}
|
|
245
|
-
{(() => {
|
|
246
|
-
if (item.event_from) {
|
|
247
|
-
const fromDateSplit = item.event_from.date.split('.');
|
|
248
|
-
const toDateSplit = item.event_to.date.split('.');
|
|
249
|
-
let fromDate;
|
|
250
|
-
let toDate;
|
|
251
|
-
|
|
252
|
-
if (lang === 'en') {
|
|
253
|
-
fromDate = new Date(
|
|
254
|
-
parseInt(fromDateSplit[0], 10),
|
|
255
|
-
parseInt(fromDateSplit[1], 10) - 1,
|
|
256
|
-
parseInt(fromDateSplit[2], 10),
|
|
257
|
-
);
|
|
258
|
-
toDate = new Date(
|
|
259
|
-
parseInt(toDateSplit[0], 10),
|
|
260
|
-
parseInt(toDateSplit[1], 10) - 1,
|
|
261
|
-
parseInt(toDateSplit[2], 10),
|
|
262
|
-
);
|
|
263
|
-
} else {
|
|
264
|
-
fromDate = new Date(
|
|
265
|
-
parseInt(fromDateSplit[2], 10),
|
|
266
|
-
parseInt(fromDateSplit[1], 10) - 1,
|
|
267
|
-
parseInt(fromDateSplit[0], 10),
|
|
268
|
-
);
|
|
269
|
-
toDate = new Date(
|
|
270
|
-
parseInt(toDateSplit[2], 10),
|
|
271
|
-
parseInt(toDateSplit[1], 10) - 1,
|
|
272
|
-
parseInt(toDateSplit[0], 10),
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
const differentDays = !(
|
|
277
|
-
toDate.getFullYear() === fromDate.getFullYear()
|
|
278
|
-
&& toDate.getMonth() === fromDate.getMonth()
|
|
279
|
-
&& toDate.getDate() === fromDate.getDate()
|
|
280
|
-
);
|
|
281
|
-
|
|
282
|
-
return (
|
|
283
|
-
<div>
|
|
284
|
-
<table className="au_newsevent-event">
|
|
285
|
-
<colgroup>
|
|
286
|
-
<col className="first-col" />
|
|
287
|
-
<col className="second-col" />
|
|
288
|
-
</colgroup>
|
|
289
|
-
<tbody>
|
|
290
|
-
<tr className="au_newsevent_date_wrap">
|
|
291
|
-
<td className="au_newsevent-date-text">{labels[lang].news.eventDate}</td>
|
|
292
|
-
<td>
|
|
293
|
-
<span className="au_newsevent-from-date">
|
|
294
|
-
<span className="au_news_events_weekday">
|
|
295
|
-
{`${labels[lang].news.weekdays[fromDate.getDay()]} `}
|
|
296
|
-
</span>
|
|
297
|
-
<span className="au_news_events_date">
|
|
298
|
-
{`${fromDate.getDate() + (lang === 'da' ? '.' : '')} `}
|
|
299
|
-
</span>
|
|
300
|
-
<span className="au_news_events_month">
|
|
301
|
-
{`${labels[lang].news.months[fromDate.getMonth()]} ${fromDate.getFullYear()}`}
|
|
302
|
-
</span>
|
|
303
|
-
</span>
|
|
304
|
-
{(() => {
|
|
305
|
-
if (differentDays) {
|
|
306
|
-
return (
|
|
307
|
-
<span>
|
|
308
|
-
<span className="au_newsevent-to-text"> — </span>
|
|
309
|
-
<span className="au_newsevent-to-date">
|
|
310
|
-
<span className="au_news_events_weekday">
|
|
311
|
-
{`${labels[lang].news.weekdays[toDate.getDay()]} `}
|
|
312
|
-
</span>
|
|
313
|
-
<span className="au_news_events_date">
|
|
314
|
-
{`${toDate.getDate() + (lang === 'da' ? '.' : '')} `}
|
|
315
|
-
</span>
|
|
316
|
-
<span className="au_news_events_month">
|
|
317
|
-
{`${labels[lang].news.months[toDate.getMonth()]} ${toDate.getFullYear()}`}
|
|
318
|
-
</span>
|
|
319
|
-
</span>
|
|
320
|
-
</span>
|
|
321
|
-
);
|
|
322
|
-
}
|
|
323
|
-
return null;
|
|
324
|
-
})()}
|
|
325
|
-
|
|
326
|
-
</td>
|
|
327
|
-
</tr>
|
|
328
|
-
<tr className="au_newsevent-row-even">
|
|
329
|
-
<td className="au_newsevent-time-text">{labels[lang].news.eventTime}</td>
|
|
330
|
-
<td>
|
|
331
|
-
<span className="au_newsevent-from-time">{item.event_from.time}</span>
|
|
332
|
-
{(() => {
|
|
333
|
-
if (!differentDays) {
|
|
334
|
-
return (
|
|
335
|
-
<span>
|
|
336
|
-
<span className="au_newsevent-to-text"> — </span>
|
|
337
|
-
<span className="au_newsevent-to-time">{item.event_to.time}</span>
|
|
338
|
-
</span>
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
return null;
|
|
342
|
-
})()}
|
|
343
|
-
</td>
|
|
344
|
-
</tr>
|
|
345
|
-
<tr className="au_newsevent_where_wrap">
|
|
346
|
-
<td className="au_newsevent-where-text">{labels[lang].news.eventWhere}</td>
|
|
347
|
-
<td className="au_newsevent-where">{item.event_where}</td>
|
|
348
|
-
</tr>
|
|
349
|
-
</tbody>
|
|
350
|
-
</table>
|
|
351
|
-
{(() => {
|
|
352
|
-
if (item.event_regurl !== '') {
|
|
353
|
-
if (lang === 'da' && item.event_regfrom && item.event_regto) {
|
|
354
|
-
const regFromDateSplit = item.event_regfrom.date.split('.');
|
|
355
|
-
item.event_regfrom.date = `${regFromDateSplit[2]}.${regFromDateSplit[1]}.${regFromDateSplit[0]}`;
|
|
356
|
-
const regToDateSplit = item.event_regto.date.split('.');
|
|
357
|
-
item.event_regto.date = `${regToDateSplit[2]}.${regToDateSplit[1]}.${regToDateSplit[0]}`;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
if (!(item.event_regfrom && item.event_regto) || (new Date() > new Date(item.event_regfrom.date.replace(/\./g, '-')) && new Date() < new Date(item.event_regto.date.replace(/\./g, '-')))) {
|
|
361
|
-
return (
|
|
362
|
-
<span className="au_newsevent_register">
|
|
363
|
-
<a className="button" href={(item.event_regurl.indexOf('@') > -1 ? 'mailto:' : '') + item.event_regurl}>{labels[lang].news.eventRegistration}</a>
|
|
364
|
-
</span>
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
return null;
|
|
369
|
-
})()}
|
|
370
|
-
</div>
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
return null;
|
|
374
|
-
})()}
|
|
375
|
-
{(() => {
|
|
376
|
-
const renderSubImages = item.subimages.map((s) => (
|
|
377
|
-
<div key={s.href}>
|
|
378
|
-
<a href={s.href} title={s.title} rel="lightbox">
|
|
379
|
-
<img src={s.src} alt={s.title} width={s.width} height={s.height} />
|
|
380
|
-
</a>
|
|
381
|
-
<p className="au_news-single-imgcaption">
|
|
382
|
-
{s.title}
|
|
383
|
-
</p>
|
|
384
|
-
</div>
|
|
385
|
-
));
|
|
386
|
-
|
|
387
|
-
if (item.image.src !== '' && item.image.layout5 !== '' && item.layout === 'Alternativ 1') {
|
|
388
|
-
return (
|
|
389
|
-
<div className="au_news-single-sub-images">
|
|
390
|
-
<div>
|
|
391
|
-
<a href={item.image.href} title={item.image.title} rel="lightbox">
|
|
392
|
-
<img src={item.image.layout5} alt={item.image.title} />
|
|
393
|
-
</a>
|
|
394
|
-
<p className="au_news-single-imgcaption">
|
|
395
|
-
{item.image.title}
|
|
396
|
-
</p>
|
|
397
|
-
</div>
|
|
398
|
-
{renderSubImages}
|
|
399
|
-
</div>
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
if (item.subimages.length > 0 && item.image.src !== '' && item.layout === 'Standard') {
|
|
404
|
-
return (
|
|
405
|
-
<div className="au_news-single-sub-images">
|
|
406
|
-
{renderSubImages}
|
|
407
|
-
</div>
|
|
408
|
-
);
|
|
409
|
-
}
|
|
410
|
-
return null;
|
|
411
|
-
})()}
|
|
412
|
-
<div
|
|
413
|
-
className="au_news_content"
|
|
414
|
-
dangerouslySetInnerHTML={{
|
|
415
|
-
__html: item.content,
|
|
416
|
-
}}
|
|
417
|
-
/>
|
|
418
|
-
{(() => {
|
|
419
|
-
if (item.event_from) {
|
|
420
|
-
return (
|
|
421
|
-
<p className="au_news-legend">
|
|
422
|
-
<span className="au_news-single-date">{item.date}</span>
|
|
423
|
-
<span>
|
|
424
|
-
<span className="au_news-date-author-separator"> | </span>
|
|
425
|
-
<span className="aunews-single-author">
|
|
426
|
-
<a href={`mailto:${item.author.email}`}>{item.author.name}</a>
|
|
427
|
-
</span>
|
|
428
|
-
</span>
|
|
429
|
-
</p>
|
|
430
|
-
);
|
|
431
|
-
}
|
|
432
|
-
return null;
|
|
433
|
-
})()}
|
|
434
|
-
<div className="au_news-single-news-category">
|
|
435
|
-
<strong>{renderCategories}</strong>
|
|
436
|
-
</div>
|
|
437
|
-
<div className="au_news-single-news-permalink">
|
|
438
|
-
<strong><a href={item.permalink}>{item.permalink}</a></strong>
|
|
439
|
-
</div>
|
|
440
|
-
{(() => {
|
|
441
|
-
if (additionalInfo) {
|
|
442
|
-
const renderLinks = item.links.map((l) => <a href={l.href}>{l.text}</a>);
|
|
443
|
-
|
|
444
|
-
const renderRelated = item.related.map((r) => (
|
|
445
|
-
<span>
|
|
446
|
-
<a className="au_news-related-link" href={`${AUNewsConfig.newsUrl}${r.id}`}>{r.text}</a>
|
|
447
|
-
{` ${r.date}`}
|
|
448
|
-
</span>
|
|
449
|
-
));
|
|
450
|
-
|
|
451
|
-
const renderFiles = item.files.map((f) => <a href={f.href}>{f.text}</a>);
|
|
452
|
-
|
|
453
|
-
return (
|
|
454
|
-
<div className="au_bt_dark au_bb_dark au_news-single-additional-info">
|
|
455
|
-
{(() => {
|
|
456
|
-
if (item.links.length > 0) {
|
|
457
|
-
return (
|
|
458
|
-
<dl className="au_news-single-links">
|
|
459
|
-
<dt>Links</dt>
|
|
460
|
-
<dd>
|
|
461
|
-
{renderLinks}
|
|
462
|
-
</dd>
|
|
463
|
-
</dl>
|
|
464
|
-
);
|
|
465
|
-
}
|
|
466
|
-
return null;
|
|
467
|
-
})()}
|
|
468
|
-
{(() => {
|
|
469
|
-
if (item.related.length > 0) {
|
|
470
|
-
return (
|
|
471
|
-
<dl className="au_news-single-related">
|
|
472
|
-
<dt>{lang === 'da' ? 'Læs også' : 'Read more'}</dt>
|
|
473
|
-
<dd>
|
|
474
|
-
{renderRelated}
|
|
475
|
-
</dd>
|
|
476
|
-
</dl>
|
|
477
|
-
);
|
|
478
|
-
}
|
|
479
|
-
return null;
|
|
480
|
-
})()}
|
|
481
|
-
{(() => {
|
|
482
|
-
if (item.files.length > 0) {
|
|
483
|
-
return (
|
|
484
|
-
<dl className="au_news-single-files">
|
|
485
|
-
<dt>Download</dt>
|
|
486
|
-
<dd>
|
|
487
|
-
{renderFiles}
|
|
488
|
-
</dd>
|
|
489
|
-
</dl>
|
|
490
|
-
);
|
|
491
|
-
}
|
|
492
|
-
return null;
|
|
493
|
-
})()}
|
|
494
|
-
</div>
|
|
495
|
-
);
|
|
496
|
-
}
|
|
497
|
-
return null;
|
|
498
|
-
})()}
|
|
499
|
-
</div>
|
|
500
|
-
{(() => {
|
|
501
|
-
if (!item.comments_closed) {
|
|
502
|
-
return <div id="disqus_thread" />;
|
|
503
|
-
}
|
|
504
|
-
return null;
|
|
505
|
-
})()}
|
|
506
|
-
</div>
|
|
507
|
-
<NewsSocialComponent item={item} lang={lang} />
|
|
508
|
-
</div>
|
|
509
|
-
<button
|
|
510
|
-
type="button"
|
|
511
|
-
className="au_news_overlay_close"
|
|
512
|
-
onClick={() => {
|
|
513
|
-
window.location.hash = '';
|
|
514
|
-
}}
|
|
515
|
-
/>
|
|
516
|
-
</div>
|
|
517
|
-
);
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
NewsPopUpComponent.propTypes = {
|
|
522
|
-
lang: PropTypes.string.isRequired,
|
|
523
|
-
print: PropTypes.bool.isRequired,
|
|
524
|
-
item: PropTypes.shape({
|
|
525
|
-
type: PropTypes.number.isRequired,
|
|
526
|
-
id: PropTypes.number.isRequired,
|
|
527
|
-
header: PropTypes.string.isRequired,
|
|
528
|
-
subheader: PropTypes.string.isRequired,
|
|
529
|
-
url: PropTypes.string.isRequired,
|
|
530
|
-
permalink: PropTypes.string.isRequired,
|
|
531
|
-
comments_closed: PropTypes.bool.isRequired,
|
|
532
|
-
links: PropTypes.arrayOf(PropTypes.shape({
|
|
533
|
-
href: PropTypes.string.isRequired,
|
|
534
|
-
text: PropTypes.string.isRequired,
|
|
535
|
-
})).isRequired,
|
|
536
|
-
categories: PropTypes.arrayOf(PropTypes.shape({
|
|
537
|
-
category: PropTypes.string.isRequired,
|
|
538
|
-
})).isRequired,
|
|
539
|
-
files: PropTypes.arrayOf(PropTypes.shape({
|
|
540
|
-
href: PropTypes.string.isRequired,
|
|
541
|
-
text: PropTypes.string.isRequired,
|
|
542
|
-
})).isRequired,
|
|
543
|
-
related: PropTypes.arrayOf(PropTypes.shape({
|
|
544
|
-
id: PropTypes.number.isRequired,
|
|
545
|
-
text: PropTypes.string.isRequired,
|
|
546
|
-
})).isRequired,
|
|
547
|
-
event_from: PropTypes.shape({
|
|
548
|
-
date: PropTypes.string,
|
|
549
|
-
time: PropTypes.string,
|
|
550
|
-
}),
|
|
551
|
-
event_to: PropTypes.shape({
|
|
552
|
-
date: PropTypes.string,
|
|
553
|
-
time: PropTypes.string,
|
|
554
|
-
}),
|
|
555
|
-
event_where: PropTypes.string.isRequired,
|
|
556
|
-
event_regfrom: PropTypes.shape({
|
|
557
|
-
date: PropTypes.string,
|
|
558
|
-
time: PropTypes.string,
|
|
559
|
-
}),
|
|
560
|
-
event_regto: PropTypes.shape({
|
|
561
|
-
date: PropTypes.string,
|
|
562
|
-
time: PropTypes.string,
|
|
563
|
-
}),
|
|
564
|
-
event_regurl: PropTypes.string.isRequired,
|
|
565
|
-
date: PropTypes.string.isRequired,
|
|
566
|
-
autor: PropTypes.shape({
|
|
567
|
-
email: PropTypes.string.isRequired,
|
|
568
|
-
name: PropTypes.string.isRequired,
|
|
569
|
-
}).isRequired,
|
|
570
|
-
image: PropTypes.shape({
|
|
571
|
-
src: PropTypes.string.isRequired,
|
|
572
|
-
href: PropTypes.string.isRequired,
|
|
573
|
-
title: PropTypes.string.isRequired,
|
|
574
|
-
width: PropTypes.string.isRequired,
|
|
575
|
-
height: PropTypes.string.isRequired,
|
|
576
|
-
layout5: PropTypes.string.isRequired,
|
|
577
|
-
}),
|
|
578
|
-
subimages: PropTypes.arrayOf(PropTypes.shape({
|
|
579
|
-
href: PropTypes.string.isRequired,
|
|
580
|
-
title: PropTypes.string.isRequired,
|
|
581
|
-
width: PropTypes.string.isRequired,
|
|
582
|
-
height: PropTypes.string.isRequired,
|
|
583
|
-
})),
|
|
584
|
-
layout: PropTypes.string.isRequired,
|
|
585
|
-
content: PropTypes.string.isRequired,
|
|
586
|
-
}).isRequired,
|
|
587
|
-
id: PropTypes.number.isRequired,
|
|
588
|
-
};
|
|
589
|
-
|
|
590
|
-
NewsPopUpComponent.displayName = 'NewsPopUpComponent';
|
|
591
|
-
export default NewsPopUpComponent;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/* eslint jsx-a11y/click-events-have-key-events: 0 */
|
|
2
|
-
/* eslint jsx-a11y/no-noninteractive-element-interactions: 0 */
|
|
3
|
-
/* eslint jsx-a11y/interactive-supports-focus: 0 */
|
|
4
|
-
/* eslint jsx-a11y/control-has-associated-label: 0 */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import { newsLabels as labels } from '../../lib/i18n';
|
|
8
|
-
|
|
9
|
-
class NewsRSSComponent extends React.Component {
|
|
10
|
-
constructor(props) {
|
|
11
|
-
super(props);
|
|
12
|
-
|
|
13
|
-
this.state = {
|
|
14
|
-
wide: false,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
render() {
|
|
19
|
-
const { wide } = this.state;
|
|
20
|
-
const { url, lang } = this.props;
|
|
21
|
-
return (
|
|
22
|
-
<ul>
|
|
23
|
-
<li
|
|
24
|
-
className={`rss header-click-btn${wide ? ' wide' : ''}`}
|
|
25
|
-
title={labels[lang].news.rssAdd}
|
|
26
|
-
onClick={() => {
|
|
27
|
-
this.setState((prevState) => ({
|
|
28
|
-
wide: !prevState.wide,
|
|
29
|
-
}));
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
{(() => {
|
|
33
|
-
if (wide) {
|
|
34
|
-
return (
|
|
35
|
-
<div
|
|
36
|
-
role="button"
|
|
37
|
-
onClick={(e) => {
|
|
38
|
-
e.stopPropagation();
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<div
|
|
42
|
-
role="button"
|
|
43
|
-
className="close"
|
|
44
|
-
onClick={(e) => {
|
|
45
|
-
e.stopPropagation();
|
|
46
|
-
this.setState({
|
|
47
|
-
wide: false,
|
|
48
|
-
});
|
|
49
|
-
}}
|
|
50
|
-
/>
|
|
51
|
-
<h2>
|
|
52
|
-
{'RSS '}
|
|
53
|
-
<strong>feed</strong>
|
|
54
|
-
</h2>
|
|
55
|
-
<p>{labels[lang].news.rssCopy}</p>
|
|
56
|
-
<input type="text" value={url} readOnly />
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
})()}
|
|
62
|
-
</li>
|
|
63
|
-
</ul>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
NewsRSSComponent.propTypes = {
|
|
69
|
-
url: PropTypes.string.isRequired,
|
|
70
|
-
lang: PropTypes.string.isRequired,
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
NewsRSSComponent.displayName = 'NewsRSSComponent';
|
|
74
|
-
export default NewsRSSComponent;
|