155
| <![CDATA[<script charset="utf-8">
/* Sorts columns having "sType": "number". It should handle numbers with locale specific separators, e.g. 1,000 */
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"number-pre": function ( a )
{
var x = String(String(a).replace( /<[\s\S]*?>/g, "" )).replace( /,/g, '' );
return parseFloat( x );
},
"number-asc": function ( a, b ) {
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},
"number-desc": function ( a, b ) {
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
} );
// parse a date in yyyy-mm-dd format
function parseDate(input) {
var parts = input.match(/(\d+)/g);
return new Date(parts[0], parts[1]-1, parts[2], parts[3], parts[4], parts[5]); // months are 0-based
}
/* resources list */
var aDataSet = [
[
'<img class="resourceminilogo" src="http://fauna.jbrj.gov.br/fauna/layout/default/imagens/logoFauna.png" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=catalogo_taxonomico_da_fauna_do_brasil'><if>Catálogo Taxonômico da Fauna do Brasil</a>",
'Not registered',
'Checklist',
'Taxonomic Authority',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=catalogo_taxonomico_da_fauna_do_brasil#anchor-dataRecords">178319</a>',
'2023-10-01',
'2023-10-01',
'2023-11-01 00:00',
'Public',
'--',
'catalogo_taxonomico_da_fauna_do_brasil'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=catalogoucs" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=catalogoucs'><if>Catálogo de Plantas das Unidades de Conservação do Brasil</a>",
'JBRJ',
'Checklist',
'Inventory Regional',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=catalogoucs#anchor-dataRecords">19723</a>',
'2023-07-20',
'2023-06-20',
'2023-07-20 18:13',
'Public',
'--',
'catalogoucs'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=jbrj_dna" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=jbrj_dna'><if>RBdna - Rio de Janeiro Botanical Garden DNA Collection - GGBN extensions</a>",
'Not registered',
'Occurrence',
'Specimen',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=jbrj_dna#anchor-dataRecords">11080</a>',
'2023-09-25',
'2023-09-18',
'2023-10-18 21:01',
'Public',
'--',
'jbrj_dna'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=jbrj_rb" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=jbrj_rb'><if>RB - Rio de Janeiro Botanical Garden Herbarium Collection</a>",
'JBRJ',
'Occurrence',
'Specimen',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=jbrj_rb#anchor-dataRecords">797996</a>',
'2023-09-25',
'2023-09-19',
'2023-10-19 17:48',
'Public',
'--',
'jbrj_rb'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=jbrj_seed_bank" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=jbrj_seed_bank'><if>RBsem - Rio de Janeiro Botanical Garden Seed Bank</a>",
'Not registered',
'Occurrence',
'Specimen',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=jbrj_seed_bank#anchor-dataRecords">3904</a>',
'2023-09-25',
'2023-09-09',
'2023-10-09 15:05',
'Public',
'--',
'jbrj_seed_bank'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=jbrj_w" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=jbrj_w'><if>RBw - Rio de Janeiro Botanical Garden Wood Collection</a>",
'Not registered',
'Occurrence',
'Specimen',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=jbrj_w#anchor-dataRecords">10765</a>',
'2023-09-25',
'2022-09-25',
'2022-10-25 12:38',
'Public',
'--',
'jbrj_w'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=lista_especies_flora_brasil" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=lista_especies_flora_brasil'><if>Brazilian Flora 2020 project - Projeto Flora do Brasil 2020</a>",
'JBRJ',
'Checklist',
'Inventory Regional',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=lista_especies_flora_brasil#anchor-dataRecords">151267</a>',
'2023-10-08',
'2023-10-06',
'2023-10-13 23:22',
'Public',
'--',
'lista_especies_flora_brasil'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=lista_oficial_ameacadas_portaria_443" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=lista_oficial_ameacadas_portaria_443'><if>CNCFlora - Lista Oficial de Espécies Ameaçadas - Portaria 443</a>",
'Not registered',
'Checklist',
'--',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=lista_oficial_ameacadas_portaria_443#anchor-dataRecords">2113</a>',
'2022-08-26',
'2022-08-26',
'--',
'Public',
'--',
'lista_oficial_ameacadas_portaria_443'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=rb_caatinga" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=rb_caatinga'><if>Caatinga Biome - RB - Rio de Janeiro Botanical Garden Herbarium Collection</a>",
'JBRJ',
'Occurrence',
'Specimen',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=rb_caatinga#anchor-dataRecords">6051</a>',
'2023-09-18',
'2023-09-18',
'2023-10-18 18:09',
'Public',
'--',
'rb_caatinga'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=rbspirit" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=rbspirit'><if>RBspirit - Rio de Janeiro Botanical Garden fluid-preserved specimens.</a>",
'JBRJ',
'Occurrence',
'Specimen',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=rbspirit#anchor-dataRecords">2800</a>',
'2023-09-25',
'2022-09-23',
'2022-10-23 18:03',
'Public',
'--',
'rbspirit'
]
,
[
'<img class="resourceminilogo" src="http://ipt.jbrj.gov.br/jbrj/logo.do?r=redlist_2013_occs" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=redlist_2013_occs'><if>CNCFlora - Livro Vermelho 2013 - Ocorrências</a>",
'Not registered',
'Occurrence',
'--',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=redlist_2013_occs#anchor-dataRecords">275476</a>',
'2022-08-26',
'2022-08-26',
'--',
'Public',
'--',
'redlist_2013_occs'
]
,
[
'<img class="resourceminilogo" src="http://dados.jbrj.gov.br/ipt/logo.do?r=redlist_2013_taxons" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=redlist_2013_taxons'><if>CNCFlora - Livro Vermelho 2013 - Espécies</a>",
'Not registered',
'Checklist',
'--',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=redlist_2013_taxons#anchor-dataRecords">4617</a>',
'2022-08-26',
'2015-06-09',
'--',
'Public',
'--',
'redlist_2013_taxons'
]
,
[
'<img class="resourceminilogo" src="https://ipt.jbrj.gov.br/jbrj/logo.do?r=seed_collection" />',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=seed_collection'><if>RBcarpo - Rio de Janeiro Botanical Garden Dry Fruits Collection</a>",
'Not registered',
'Occurrence',
'Specimen',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=seed_collection#anchor-dataRecords">8574</a>',
'2023-10-01',
'2023-10-01',
'2023-11-01 00:00',
'Public',
'--',
'seed_collection'
]
,
[
'--',
"<a href='https://ipt.jbrj.gov.br/jbrj/resource?r=vivas'><if>Checklist da Coleção Viva do Inst. Pesq. Jardim Botânico do Rio de Janeiro</a>",
'Not registered',
'Checklist',
'Inventory Thematic',
'<a target="_blank" href="https://ipt.jbrj.gov.br/jbrj/resource?r=vivas#anchor-dataRecords">4672</a>',
'2023-10-01',
'2023-10-01',
'2023-11-01 00:00',
'Public',
'--',
'vivas'
]
];
$(document).ready(function() {
const SEARCH_PARAM = "search";
var urlParams = new URLSearchParams(window.location.search);
var searchParam = urlParams.get(SEARCH_PARAM) ? urlParams.get(SEARCH_PARAM) : "";
$('#tableContainer').html( '<table class="table table-sm" id="rtable"></table>' );
var dt = $('#rtable').DataTable( {
"aaData": aDataSet,
"iDisplayLength": 20,
"bLengthChange": false,
"bAutoWidth": false,
"oLanguage": {
"sEmptyTable": "No resources are currently available",
"sZeroRecords": "No resources were found",
"sInfo": "Showing _START_ to _END_ of _TOTAL_",
"sInfoEmpty": "Showing 0 to 0 of 0",
"sInfoFiltered": "(filtered from _MAX_ total)",
"sSearch": "Filter:",
"oPaginate": {
"sNext": "next",
"sPrevious": "previous"
}
},
"aoColumns": [
{ "sTitle": "Logo", "bSearchable": false, "bVisible": true },
{ "sTitle": "Name"},
{ "sTitle": "Organization"},
{ "sTitle": "Type"},
{ "sTitle": "Subtype"},
{ "sTitle": "Records", "bSearchable": false, "sType": "number"},
{ "sTitle": "Last modified", "bSearchable": false},
{ "sTitle": "Last publication", "bSearchable": false},
{ "sTitle": "Next publication", "bSearchable": false},
{ "sTitle": "Visibility", "bSearchable": false, "bVisible": false},
{ "sTitle": "Author", "bVisible": false},
{ "sTitle": "Shortname", "bVisible": false}
],
"aaSorting": [[ 1, "asc" ]],
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 0 ] }
],
"oSearch": {"sSearch": searchParam},
"fnInitComplete": function(oSettings) {
/* Next published date should never be before today's date, otherwise auto-publication must have failed.
In this case, highlight the row to bring the problem to the resource manager's attention. */
var today = new Date();
for ( var i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ ) {
// warning fragile: index 8 must always equal next published date on both home page and manage page
var nextPublishedDate = (oSettings.aoData[i]._aData[8] == '--') ? today : parseDate(oSettings.aoData[i]._aData[8]);
if (today > nextPublishedDate) {
oSettings.aoData[i].nTr.className += " text-gbif-danger";
}
// warning fragile: index 9 must always equal visibility (only on manage page)
var visibility = oSettings.aoData[i]._aData[9];
if (visibility && visibility.toLowerCase() == 'deleted') {
oSettings.aoData[i].nTr.className += " text-gbif-danger";
}
}
}
} );
dt.on( 'search.dt', function () {
if (history.pushState) {
var searchValue = dt.search();
var searchParams = new URLSearchParams(window.location.search);
searchParams.set(SEARCH_PARAM, searchValue);
var newurl;
if (searchParams.toString() === 'search=') { // remove 'search=' string if search is empty
newurl = window.location.protocol + "//" + window.location.host + window.location.pathname;
} else {
newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?' + searchParams.toString();
}
window.history.pushState({path: newurl}, '', newurl);
}
});
} );
</script>]]>
|