-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
489 lines (467 loc) · 24.5 KB
/
index.html
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<!DOCTYPE html>
<!-- Bu yazılım Dr. Zafer Akçalı tarafından oluşturulmuştur -->
<!-- Programmed by Zafer Akçalı, MD-->
<!-- wos2-converter V2.84, deals with directly exported txt file from WOS, prints only relevant institute address-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Display Authors Quartiles of Web of Science Publications</title>
<!-- https://github.com/mholt/PapaParse-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.2.0/papaparse.min.js"></script>
<!-- // https://github.com/eligrey/FileSaver.js-->
<script src="https://cdn.jsdelivr.net/g/filesaver.js"></script>
<script src="eissnq1.txt"></script>
<script src="eissnq2.txt"></script>
<script src="eissnq3.txt"></script>
<script src="eissnq4.txt"></script>
<script src="issnq1.txt"></script>
<script src="issnq2.txt"></script>
<script src="issnq3.txt"></script>
<script src="issnq4.txt"></script>
<script src="issnahci.txt"></script>
<script src="eissnahci.txt"></script>
<script src="wosq1.txt"></script>
<script src="wosq2.txt"></script>
<script src="wosq3.txt"></script>
<script src="wosq4.txt"></script>
<script src="woses.txt"></script>
<script src="namedict.txt"></script>
<script src="addresslist.txt"></script>
</head>
<body>
<label for="myfile">Select a directly exported Full Content "Tab delimited file" from wos:</label>
<input type="file" id="csvfile" name="Csv File">
<button id="readBtn" onclick="readFunction()">Read</button> <br/>
<a href="Tab delimited file.png" target="_blank"> Show me how to export in Web of Science </a><br/><br/>
Publications:                         
WOS numbers line by line<br />
<textarea rows = "30" cols = "60" name = "Publications" id="publicationsArea"></textarea>
<textarea rows = "30" cols = "40" name = "Woses" id="wosesArea"></textarea><br/>
<label id = "infoTextFile" ></label> <label id = "infoTextOutput" ></label><br/>
<button id="convBtn" disabled onclick="convertFunction()">Convert</button>
<button id="copyBtn" disabled onclick="copyFunction()">Copy</button>
<button id="saveCsvBtn" disabled onclick="saveCsvFunction()">Save csv</button>
<button id="wosBtn" disabled onclick="wosFunction()">WOS List</button>
<button id="saveTxtBtn" disabled onclick="saveTxtFunction()">Save txt</button>
           
<button id="findQuartilesBtn" onclick="findQuartilesFunction()">Find quartiles</button>
<button id="delWOSesBtn" onclick="delWOSesFunction()">Delete WOSes</button>
<br/>
Split Authors <input type="checkbox" id="sAuthors"><br>
Include Q1 <input type="checkbox" id="q1Box" checked="true">
Q2 <input type="checkbox" id="q2Box" checked="true">
Q3 <input type="checkbox" id="q3Box" checked="true">
AHCI <input type="checkbox" id="ahBox" checked="true"><br/>
Q4 <input type="checkbox" id="q4Box" checked="true">
Q? <input type="checkbox" id="qxBox" checked="true">
ESCI <input type="checkbox" id="esBox" checked="true"><br/> <br/>
Document Types <br/>
Check ALL <input type="checkbox" id="allDocumentsBox" checked="true" onclick="selectAllDocuments()"> <br/>
Include Article: <input type="checkbox" id="articleBox" checked="true">
Article-EA <input type="checkbox" id="articleEABox" checked="true">
Article-PP <input type="checkbox" id="articlePPBox" checked="true"> <br/>
Include Biographical: <input type="checkbox" id="biographicalBox" checked="true">
Editorial Material <input type="checkbox" id="editorialBox" checked="true"> <br/>
Include Letter: <input type="checkbox" id="letterBox" checked="true">
Letter-EA <input type="checkbox" id="letterEABox" checked="true"> <br/>
Include Meeting Abstract: <input type="checkbox" id="meetingBox" checked="true">
Proceedings Paper <input type="checkbox" id="proceedingsBox" checked="true"><br/>
Include Retraction: <input type="checkbox" id="retractionBox" checked="true">
Correction: <input type="checkbox" id="correctionBox" checked="true"> <br/>
Include Review: <input type="checkbox" id="reviewBox" checked="true">
Review-EA <input type="checkbox" id="reviewEABox" checked="true">
Book Review <input type="checkbox" id="bookReviewBox" checked="true"><br/>
WOS #
<input type="text" name="WOSnumber" id="WOSnumber">
<button id="gotoWOS" onclick="displayWOSdocument()">Show article</button>
<button id="deleteWOSnumber" onclick="deleteWOSnumber()">Delete WOS #</button>
<script>
// global scope
var authorArray = new Array ([]); // an array, which contains authors with their publication, a row in the output
var author = new Array ([]); // a group of authors sharing same addresses
var addressOfAuthor ='';
var splitAuthors=false;
var includeAddress=false;
var atLeastOneAddress=false;
var nauthor=0;
var csvtext="";
var delimit='\t'; // =document.getElementById('delimitValue').value
const wosPrefix = 'https://gateway.webofknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=Publons&SrcAuth=Publons_CEL&KeyUT='
const wosPostfix = '&DestLinkType=FullRecord&DestApp=WOS_CPL'
const doiPrefix = 'https://doi.org/'
const parseError = 'error parsing csv file, try to change delimiter: comma(,) versus semicolon(;)'
const eissnq1List = eissnq1.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n'); // text to array
const eissnq2List = eissnq2.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const eissnq3List = eissnq3.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const eissnq4List = eissnq4.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const issnq1List = issnq1.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const issnq2List = issnq2.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const issnq3List = issnq3.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const issnq4List = issnq4.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const issnahList = issnah.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const eissnahList = eissnah.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const wosq1List = wosq1.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const wosq2List = wosq2.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const wosq3List = wosq3.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const wosq4List = wosq4.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
const wosesList = woses.toString().replace(/[^\x00-\x7F]/g,'').replace(/\r/g, '').split('\n')
function delWOSesFunction() {
document.getElementById('wosesArea').value = "";
}
function deleteWOSnumber() {
document.getElementById('WOSnumber').value = "";
}
function findQuartilesFunction() {
var quartile="";
var source="";
var pubtext =""
pubtext=document.getElementById('wosesArea').value
arrayOfWOSes = pubtext.split("\n");
pubtext = "";
document.getElementById('wosesArea').value='';
for (var i=0; i<arrayOfWOSes.length; i++) {
wos= arrayOfWOSes [i].trim();
quartile = 'Q?'; // unknown, not in the list
if (wos.startsWith("WOS:") == false) {continue;}
if (wos.length != 19 ) {continue;}
if ( wosq1List.indexOf(wos) > -1)
{ quartile = 'Q1'; source='incites';}
else if (wosq2List.indexOf(wos) > -1)
{ quartile = 'Q2'; source='incites';}
else if (wosq3List.indexOf(wos) > -1)
{ quartile = 'Q3'; source='incites';}
else if (wosq4List.indexOf(wos) > -1 )
{ quartile = 'Q4'; source='incites';}
else if (wosesList.indexOf(wos) > -1 )
{ quartile = 'ES'; source='woslist';}
pubtext = pubtext+ wos + ' ' + quartile + ' kaynak=' + source + "\n"
}
document.getElementById('wosesArea').value=pubtext; // clear textarea
}
function displayWOSdocument() {
w=document.getElementById('WOSnumber').value.replace(" ","");
urlText = "http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/"+w;
window.open(urlText,"_blank");
}
function readFunction() {
document.getElementById('publicationsArea').value=''; // clear textarea
document.getElementById('copyBtn').disabled = true; // disable copy button
document.getElementById('convBtn').disabled = true; // disable convert button
document.getElementById('saveCsvBtn').disabled = true; // disable save button
document.getElementById('saveTxtBtn').disabled = true; // disable save button
document.getElementById('wosBtn').disabled = true; // disable wos button
document.getElementById('readBtn').disabled = true; // disable read button
var file = document.getElementById('csvfile').files[0]; //get filename
var reader = new FileReader(); // html5
reader.onload = (function(file) {
return function(e) {
csvtext = this.result; //read from csv file
document.getElementById('publicationsArea').value=csvtext; // show in textarea
document.getElementById('convBtn').disabled = false; // enable convert button
document.getElementById('readBtn').disabled = false; // enable read button
document.getElementById('infoTextFile').innerHTML = ''; // delete any previous information about row counts
document.getElementById('infoTextOutput').innerHTML = ''; // delete any previous information about row counts
}
})(file);
reader.readAsText(file);
}
function convertFunction() {
if (document.getElementById('sAuthors').checked) {
splitAuthors=true;}
else {
splitAuthors=false;}
var pubtext='NS'+delimit+'Author name'+delimit+'Author address'+delimit+'Quartile'+delimit+'Source'+delimit+'Times cited'+delimit+'Article type'+delimit+'Authors'+delimit+'Article title'+delimit+'Article source'
+delimit+'Year'+delimit+'Volume (issue): pages-article#'+delimit+'WOS number'+delimit+'WOS link'+delimit+'Doi link\n';
var pubArray= new Array ([]); // an array, which contains publications
var addresses="";
var department = "";
nauthor = 0; // number of authors
var quartile="";
var source="";
document.getElementById('publicationsArea').value=""; // clear textarea
document.getElementById('copyBtn').disabled = true; // disable copy button
document.getElementById('saveCsvBtn').disabled = true; // disable save button
document.getElementById('saveTxtBtn').disabled = true; // disable save button
document.getElementById('wosBtn').disabled = true; // disable wos button
document.getElementById('convBtn').disabled = true; // disable convert button
document.getElementById('readBtn').disabled = true; // disable read button
results = Papa.parse(csvtext, { //parse from csv text
header: true,
delimiter: delimit,
fastMode: true, // for not to delete quoted parts in "Aricle Title"
skipEmptyLines: true
});
nrows = results.data.length; // number of rows in csv file
// console.log (nrows);
document.getElementById('infoTextFile').innerHTML = 'Number of publications in the csv file = '+nrows+'.';
// initialise every row of a multidimentional array
for (var i=0; i<nrows; i++) {
pubArray.push([0]); // create rows of multidimentional array
pubArray[i][0]="0"; // initialise first member of the row
}
for (var i=0; i<nrows; i++) { // for each publication
atLeastOneAddress = false;
wos = results.data[i]['UT'] // ['UT (Unique WOS ID)'];
issn = results.data[i]['SN']//['ISSN'];
eissn = results.data[i]['EI']//['eISSN'];
reprintAddress=results.data[i]['RP']//['Reprint Addresses'];
if (issn=='') {issn ='NULL'}
if (eissn=='') {eissn ='NULL'} // danger!! empty eissn causes quartile to be Q1
quartile = 'Q?'; // unknown, not in the list
source= '??';
if ( wosq1List.indexOf(wos) > -1)
{ quartile = 'Q1'; source='incites';}
else if (wosq2List.indexOf(wos) > -1)
{ quartile = 'Q2'; source='incites';}
else if (wosq3List.indexOf(wos) > -1)
{ quartile = 'Q3'; source='incites';}
else if (wosq4List.indexOf(wos) > -1 )
{ quartile = 'Q4'; source='incites';}
else if (wosesList.indexOf(wos) > -1 )
{ quartile = 'ES'; source='woslist';}
else if (issnq1List.indexOf(issn) > -1 || eissnq1List.indexOf(eissn) > -1)
{ quartile = 'Q1'; source='i/eissn';}
else if (issnq2List.indexOf(issn) > -1 || eissnq2List.indexOf(eissn) > -1)
{ quartile = 'Q2'; source='i/eissn';}
else if (issnq3List.indexOf(issn) > -1 || eissnq3List.indexOf(eissn) > -1)
{ quartile = 'Q3'; source='i/eissn';}
else if (issnq4List.indexOf(issn) > -1 || eissnq4List.indexOf(eissn) > -1)
{ quartile = 'Q4'; source='i/eissn';}
else if (issnahList.indexOf(issn) > -1 || eissnahList.indexOf(eissn) > -1)
{ quartile = 'AH'; source='i/eissn';}
if (document.getElementById('q1Box').checked == false && quartile == 'Q1') { continue; }
if (document.getElementById('q2Box').checked == false && quartile == 'Q2') { continue; }
if (document.getElementById('q3Box').checked == false && quartile == 'Q3') { continue; }
if (document.getElementById('q4Box').checked == false && quartile == 'Q4') { continue; }
if (document.getElementById('qxBox').checked == false && quartile == 'Q?') { continue; }
if (document.getElementById('ahBox').checked == false && quartile == 'AH') { continue; }
if (document.getElementById('esBox').checked == false && quartile == 'ES') { continue; }
documentType=results.data[i]['DT']//['Document Type']
if (document.getElementById('articleBox').checked == false && documentType == 'Article') { continue; }
if (document.getElementById('articleEABox').checked == false && documentType == 'Article; Early Access') { continue; }
if (document.getElementById('articlePPBox').checked == false && documentType == 'Article; Proceedings Paper') { continue; }
if (document.getElementById('biographicalBox').checked == false && documentType == 'Biographical-Item') { continue; }
if (document.getElementById('editorialBox').checked == false && documentType == 'Editorial Material') { continue; }
if (document.getElementById('letterBox').checked == false && documentType == 'Letter') { continue; }
if (document.getElementById('letterEABox').checked == false && documentType == 'Letter; Early Access') { continue; }
if (document.getElementById('meetingBox').checked == false && documentType == 'Meeting Abstract') { continue; }
if (document.getElementById('proceedingsBox').checked == false && documentType == 'Proceedings Paper') { continue; }
if (document.getElementById('retractionBox').checked == false && documentType == 'Retraction') { continue; }
if (document.getElementById('correctionBox').checked == false && documentType == 'Correction') { continue; }
if (document.getElementById('reviewBox').checked == false && documentType == 'Review') { continue; }
if (document.getElementById('reviewEABox').checked == false && documentType == 'Review; Early Access') { continue; }
if (document.getElementById('bookReviewBox').checked == false && documentType == 'Book Review') { continue; }
weird = '' // assume each article in shape of normal address format and author format
if (splitAuthors==false) {
addressOfAuthor = '';
author[0]='';
author.length=1;
addRow();
includeAddress = true;
continue; // add a row without author name and his/her address
}
addresses = results.data[i].C1 //Addresses // deal with this text
if (addresses === undefined ) {
document.getElementById('publicationsArea').value = parseError;
return;
}
if (addresses == '') { // if Addresses field is empty
addresses = '[' + results.data[i]['AU'] + '] ' +'Unknown'; // ['Authors']
weird = '*' // check output
}
if (addresses.indexOf("[")==-1) { // if Addresses field doesn't contain names
tempAuthor = results.data[i]['AU'].replace(/;/g, '-') // regexp for all // ['Authors']
// print only relevant (home institute) addresses
allAdresses = addresses.split(";")
tempAddresses = ""
for (c=0; c<allAdresses.length; c++) {
for (d=0; d<addressList.length;d++) {
if (allAdresses[c].toLowerCase().includes(addressList[d].toLowerCase())) { // a relevant address (home institute)
tempAddresses = tempAddresses + allAdresses[c].trim() + " ";
}
}
}
// tempAddresses = addresses.replace(/;/g, '-') //regexp for all
weird = '*' // someting weird in Addresses column, check them by marking with (*)
addresses = '['+tempAuthor+'] '+ tempAddresses
}
if (addresses.substring(0,1) != '[' ) {// if Addresses field doesn't start with [
addresses ='[unknown] ' + addresses
weird = '*' // someting weird in Addresses column, check them by marking with (*)
}
authors = addresses.slice(1).split("; [") //delete [, then go to first author of next address
for (j=0;j<authors.length;j++) { // for each address
department = authors[j].split ("] ") // department[0] contains authors, department[1] contains address
author = department[0].split ("; ") //
includeAddress=false;
if (department[1] === undefined) {
department[1] = addressList[0]+'?'; // one of authors seems to be in address list
weird = '*'; // someting weird in Addresses column, check them by marking with (*)
}
addressOfAuthor=department[1];
for (d=0; d<addressList.length;d++) {
if (addressOfAuthor.toLowerCase().includes(addressList[d].toLowerCase())) { //department[1] contains current address
includeAddress = true; // current address is in the addresses list, a relevant (home) institute
break;}
}
if (includeAddress) {
atLeastOneAddress=true;
addRow();
}
} // for each address
if ((atLeastOneAddress == false) && (reprintAddress !=='') ) { // didn't find a suitable address, check for reprint Address
for (d=0; d<addressList.length;d++)
if (reprintAddress.toLowerCase().includes(addressList[d].toLowerCase())) {
let reprintArray = reprintAddress.split(' (corresponding author), ')
addressOfAuthor = reprintArray[1];
author[0]=reprintArray[0];
author.length=1;
includeAddress = true;
// console.log(wos)
// console.log (reprintArray)
addRow();
}
}
} // for each publication
function addRow () { // if Address is in the Addresses list
for (k=0;k<author.length;k++) { // for each author
// if (author[k] === '') {
// break; } // skip creating an author named ''
authorArray.push ([0]); // create rows of multidimentional array
for (var c=0; c<nameDict.length; c+=2) { // first item to last item
if ( author[k]==nameDict[c]) { // if author name is misspelled, then correct it
author[k]=nameDict[c+1]
break; } // don't continue to search
}
authorArray[nauthor][0]= author[k]; // name of author
authorArray[nauthor][1]= addressOfAuthor; // address of author
if (splitAuthors == false) {
authorArray[nauthor][0]='';
authorArray[nauthor][1]='';
}
authorArray[nauthor][2] = quartile
authorArray[nauthor][3] = source
authorArray[nauthor][4] = results.data[i]['TC'] //['Times Cited, WoS Core']
authorArray[nauthor][5] = results.data[i]['DT'] // ['Document Type']
authorArray[nauthor][6] = results.data[i]['AU'] // ['Authors']
authorArray[nauthor][7] = results.data[i]['TI'] // ['Article Title']
authorArray[nauthor][8] = results.data[i]['SO'] // ['Source Title']
pyear = results.data[i]['PY'] // ['Publication Year']
if (pyear == '') {
accessdate = results.data[i]['EA'].split(' ') // ['Early Access Date'] // seperate month and year
pyear = accessdate[1] // second part of accessdate is year
}
authorArray[nauthor][9] = pyear
authorArray[nauthor][10] = results.data[i]['VL'] // ['Volume']
issue = results.data[i]['IS'] // ['Issue']
if (issue != '') {
issue = '('+issue+'):' // display (issue) if really exists
}
else if (results.data[i]['VL'] != '') { // if volume exists, but issue is not // ['Volume']
issue = ':'
}
authorArray[nauthor][11] = issue
authorArray[nauthor][12] = results.data[i]['BP'] // ['Start Page']
authorArray[nauthor][13] = results.data[i]['EP']// ['End Page']
authorArray[nauthor][14] = results.data[i]['AR'] //['Article Number']
authorArray[nauthor][15] = results.data[i]['UT'] // ['UT (Unique WOS ID)']
authorArray[nauthor][16] = results.data[i]['DI']// ['DOI']
doiLink = results.data[i]['DL'] // ['DOI Link']
{ // add publication to text area
pubtext = pubtext+weird
+delimit+"\""+authorArray[nauthor][0]+"\""
+delimit+"\""+authorArray[nauthor][1]+"\"" // address of author, between " and "
+delimit+ authorArray[nauthor][2] // quartile
+delimit+ authorArray[nauthor][3] // source
+delimit+ authorArray[nauthor][4] // times cited
+delimit+"\""+authorArray[nauthor][5]+"\"" // Document type between " " not to confuse csv
+delimit+"\""+authorArray[nauthor][6]+"\"" // Authors displayed between " and " not to confuse csv
+delimit+"\""+authorArray[nauthor][7]+"\"" // Article title between " and "not to confuse csv
+delimit+"\""+authorArray[nauthor][8]+"\"" // source title
+delimit+authorArray[nauthor][9] // publication year
+delimit+"\""+authorArray[nauthor][10]+authorArray[nauthor][11]+authorArray[nauthor][12]+'-'+authorArray[nauthor][13]+' '+authorArray[nauthor][14]+"\"" // Volume, Issue, page numbers or article number displayed between " and "
+delimit+authorArray[nauthor][15] //WOS number
+delimit+wosPrefix+authorArray[nauthor][15]+wosPostfix // WOS link
+delimit+doiLink //DOI link
+"\n"
} // add publication to text area
nauthor++;
}
} // if Address is in the Addresses list
document.getElementById('publicationsArea').value=pubtext;
document.getElementById('copyBtn').disabled = false; // enable copy button
document.getElementById('saveCsvBtn').disabled = false; // enable save button
document.getElementById('saveTxtBtn').disabled = false; // enable save button
document.getElementById('wosBtn').disabled = false; // enable wos button
document.getElementById('convBtn').disabled = false; // enable convert button
document.getElementById('readBtn').disabled = false; // enable read button
document.getElementById('infoTextOutput').innerHTML = 'Number of authors/publications in output = '+nauthor+'.';
}
function selectAllDocuments() {
var checkBox = document.getElementById('allDocumentsBox');
if (checkBox.checked == true) {
document.getElementById('articleBox').checked = true;
document.getElementById('articleEABox').checked = true;
document.getElementById('articlePPBox').checked = true;
document.getElementById('biographicalBox').checked = true;
document.getElementById('editorialBox').checked = true;
document.getElementById('letterBox').checked = true;
document.getElementById('letterEABox').checked = true;
document.getElementById('meetingBox').checked = true;
document.getElementById('proceedingsBox').checked = true;
document.getElementById('retractionBox').checked = true;
document.getElementById('correctionBox').checked = true;
document.getElementById('reviewBox').checked = true;
document.getElementById('reviewEABox').checked = true;
document.getElementById('bookReviewBox').checked = true;
}
else {
document.getElementById('articleBox').checked = false;
document.getElementById('articleEABox').checked = false;
document.getElementById('articlePPBox').checked = false;
document.getElementById('biographicalBox').checked = false;
document.getElementById('editorialBox').checked = false;
document.getElementById('letterBox').checked = false;
document.getElementById('letterEABox').checked = false;
document.getElementById('meetingBox').checked = false;
document.getElementById('proceedingsBox').checked = false;
document.getElementById('retractionBox').checked = false;
document.getElementById('correctionBox').checked = false;
document.getElementById('reviewBox').checked = false;
document.getElementById('reviewEABox').checked = false;
document.getElementById('bookReviewBox').checked = false;
}
}
function wosFunction() {
document.getElementById('publicationsArea').value=''; // clear textarea
let longWOStext='UT=(';
for (let k=0; k<nauthor; k++) {
longWOStext = longWOStext+' '+ authorArray[k][15]+' OR'; // WOS number
}
if (longWOStext.endsWith('OR')) {
longWOStext=longWOStext.slice(0, -2);
}
longWOStext=longWOStext+')';
document.getElementById('publicationsArea').value=longWOStext;
document.getElementById('convBtn').disabled = false; // enable convert button
}
function copyFunction() {
document.getElementById('publicationsArea').select();
document.execCommand("copy");
document.getElementById('convBtn').disabled = false; // enable convert button
}
function saveCsvFunction() {
var blob = new Blob([document.getElementById('publicationsArea').value],
{ type: "text/plain;charset=utf-8" });
saveAs(blob, "output.csv");
document.getElementById('convBtn').disabled = false; // enable convert button
}
function saveTxtFunction() {
var blob = new Blob([document.getElementById('publicationsArea').value],
{ type: "text/plain;charset=utf-8" });
saveAs(blob, "output.txt");
document.getElementById('convBtn').disabled = false; // enable convert button
}
</script>
</body>
</html>