-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpublication.html
More file actions
234 lines (212 loc) · 8.88 KB
/
Copy pathpublication.html
File metadata and controls
234 lines (212 loc) · 8.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!DOCTYPE html><!-- This site was created in Webflow. https://webflow.com --><!-- Last Published: Tue Jan 14 2025 14:37:21 GMT+0000 (Coordinated Universal Time) -->
<html data-wf-page="66e84be48d3cb4d76ee3f0ba" data-wf-site="66e84be48d3cb4d76ee3f042">
<head>
<meta charset="utf-8">
<title>Publications</title>
<meta content="NTU - CompHydroMet Lab" name="description">
<meta content="Publications" property="og:title">
<meta content="Publications" property="twitter:title">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="Webflow" name="generator">
<link href="css/normalize.css" rel="stylesheet" type="text/css">
<link href="css/webflow.css" rel="stylesheet" type="text/css">
<link href="css/wangsite-ntu.webflow.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com" rel="preconnect">
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js" type="text/javascript"></script>
<script type="text/javascript">
WebFont.load({
google: {
families: ["PT Sans:400,400italic,700,700italic", "Oswald:200,300,400,500,600,700", "Montserrat:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic", "Open Sans:300,300italic,400,400italic,600,600italic,700,700italic,800,800italic", "Exo:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic", "Ubuntu:300,300italic,400,400italic,500,500italic,700,700italic", "Source Sans Pro:200,300,regular,italic,600,700,900"]
}
});
</script>
<script type="text/javascript">
! function(o, c) {
var n = c.documentElement,
t = " w-mod-";
n.className += t + "js", ("ontouchstart" in o || o.DocumentTouch && c instanceof DocumentTouch) && (n.className += t + "touch")
}(window, document);
</script>
<!-- <link href="images/favicon.png" rel="shortcut icon" type="image/x-icon"> -->
<link href="images/favicon3.ico" rel="shortcut icon" type="image/x-icon">
<link href="images/webclip.png" rel="apple-touch-icon">
<style>
.publication-section {
margin: 2rem 0;
}
.publication-section h3 {
color: #333;
margin-bottom: 1.5rem;
font-family: "Montserrat", sans-serif;
font-weight: 600;
}
.csl-bib-body {
padding-left: 2em;
text-indent: -2em;
}
.csl-entry {
margin-bottom: 1.5em;
font-family: "Source Sans Pro", sans-serif;
line-height: 1.6;
color: #333;
}
.csl-entry i {
color: #444;
}
.csl-entry a {
color: #0066cc;
text-decoration: none;
word-wrap: break-word;
transition: color 0.3s ease;
}
.csl-entry a:hover {
color: #004499;
text-decoration: underline;
}
.loading {
text-align: center;
color: #666;
font-style: italic;
padding: 2rem;
font-family: "Source Sans Pro", sans-serif;
}
.error {
color: #dc3545;
text-align: center;
padding: 1rem;
margin: 1rem 0;
background-color: #fff3f3;
border-radius: 4px;
font-family: "Source Sans Pro", sans-serif;
}
</style>
</head>
<body>
<div data-collapse="medium" data-animation="default" data-duration="400" data-no-scroll="1" data-easing="ease" data-easing2="ease" role="banner" class="navbar w-nav">
<div class="w-container">
<a href="index.html" class="logo-block w-nav-brand"></a><img src="images/logo_white1-03.png" alt="" class="logo">
<nav role="navigation" class="nav-menu w-nav-menu">
<a href="index.html" class="nav-link light w-nav-link">Home</a>
<a href="members.html" class="nav-link light w-nav-link">members</a>
<a href="publication.html" aria-current="page" class="nav-link light w-nav-link w--current">publication</a>
<a href="projects.html" class="nav-link light w-nav-link">projects</a>
<a href="knowledge-hub.html" class="nav-link light w-nav-link">knowledge hub</a>
</nav>
<div class="transparant-menu-button w-nav-button">
<div class="w-icon-nav-menu"></div>
</div>
</div>
</div>
<div class="subpage-header blog-2">
<h2 class="subpage-title">Publication</h2>
</div>
<div class="section">
<div class="w-container">
<div class="publication-section">
<h3>Journal Publication</h3>
<div id="publications" class="csl-bib-body">
<div class="loading">Loading publications...</div>
</div>
</div>
<div class="publication-section">
<h3>Conference Paper</h3>
<div id="conferences" class="csl-bib-body">
<div class="loading">Loading conference papers...</div>
</div>
</div>
</div>
</div>
<script src="https://d3e54v103j8qbb.cloudfront.net/js/jquery-3.5.1.min.dc5e7f18c8.js?site=66e84be48d3cb4d76ee3f042" type="text/javascript" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="js/webflow.js" type="text/javascript"></script>
<script>
const URLS = {
conferences: '/assests/publication/Conference.html',
publications: '/assests/publication/Publications.html'
};
// Cache mechanism for local files
async function fetchLocalData(type) {
const cacheKey = `local_${type}`;
const cacheExpiryKey = `${cacheKey}_expiry`;
const now = Date.now();
const cacheExpiry = localStorage.getItem(cacheExpiryKey);
const cacheData = localStorage.getItem(cacheKey);
// if (cacheData && cacheExpiry && now < parseInt(cacheExpiry)) {
// console.log(`Using cached data for ${type}`);
// return cacheData;
// }
try {
const response = await fetch(URLS[type]);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.text();
// localStorage.setItem(cacheKey, data);
// localStorage.setItem(cacheExpiryKey, (now + 60 * 60 * 1000).toString());
return data;
} catch (error) {
console.error(`Error fetching ${type}:`, error);
document.getElementById(type).innerHTML = `
<div class="error">Failed to load ${type}. Please try again later.</div>
`;
return null;
}
}
function extractYear(citation) {
const yearMatch = citation.match(/\((\d{4})\)/);
return yearMatch ? parseInt(yearMatch[1]) : 0;
}
function sortCitationsByYear(htmlContent) {
if (!htmlContent) return '';
// Create a temporary div to parse HTML
const tempDiv = document.createElement('div');
tempDiv.innerHTML = htmlContent;
// Get all citation entries
const citations = Array.from(tempDiv.getElementsByClassName('csl-entry'));
const citationsWithSpans = [];
// Group citations with their following span elements
for (let i = 0; i < citations.length; i++) {
const citation = citations[i];
const nextElement = citation.nextElementSibling;
const year = extractYear(citation.textContent);
citationsWithSpans.push({
year: year,
elements: [citation.outerHTML]
});
if (nextElement && nextElement.tagName.toLowerCase() === 'span') {
citationsWithSpans[citationsWithSpans.length - 1].elements.push(nextElement.outerHTML);
}
}
// Sort by year in descending order
citationsWithSpans.sort((a, b) => b.year - a.year);
// Combine all elements back together
return citationsWithSpans
.map(item => item.elements.join('\n'))
.join('\n');
}
function displayEntries(htmlContent, containerId) {
const container = document.getElementById(containerId);
if (!htmlContent) {
container.innerHTML = '<div class="loading">No entries found</div>';
return;
}
// Sort and display the citations
const sortedContent = sortCitationsByYear(htmlContent);
container.innerHTML = sortedContent;
}
async function loadAllData() {
try {
const [publicationsData, conferencesData] = await Promise.all([
fetchLocalData('publications'),
fetchLocalData('conferences')
]);
displayEntries(publicationsData, 'publications');
displayEntries(conferencesData, 'conferences');
} catch (error) {
console.error('Error loading local data:', error);
}
}
document.addEventListener('DOMContentLoaded', loadAllData);
</script>
</body>
</html>