', { id: 'notifications'}).appendTo($('body'));
}
function loadAllCSS() {
var cssList = [
"codemirror/codemirror.css",
"tooltipster/tooltipster.css",
"tooltipster/tooltipster-survis.css",
"style.css",
"selector.css",
"sparkline.css",
"timeline.css",
"entries.css"
];
$.each(cssList, function (i, css) {
loadCSS(stylesDir + css);
});
if (customStyle) {
loadCSS(customStyle);
}
function loadCSS(href) {
$('head').append($('
', {
rel: 'stylesheet',
type: 'text/css',
href: href
}));
}
}
function initTitle() {
document.title = title;
}
function initHeader() {
var headerDiv = $('#header');
var titleDiv = $('
', {
id: 'title'
});
if (!electron) {
titleDiv.append($('
', {
text: title
}));
if (paper) {
var paperDiv = $('
' + paper.html + '
');
if (paper.id) {
var showPaperButton = $('', {
class: 'button',
text: 'select'
});
showPaperButton.click(function (event) {
selectors.toggleSelector('search', paper.id, event);
if (showPaperButton.text() == 'select') {
showPaperButton.text('deselect');
} else {
showPaperButton.text('select');
}
});
paperDiv.append(showPaperButton)
}
titleDiv.append(paperDiv);
}
} else {
headerDiv.addClass('electron');
}
titleDiv.append($(`

`));
headerDiv.append(titleDiv);
$('
').appendTo(headerDiv);
headerDiv.append($('
'));
}
function initControl() {
var controlDiv = $('#control');
var timelineContainerDiv = $('
', {
id: 'timeline-container'
}).appendTo(controlDiv);
var timelineHeading = $('
/Timeline
').appendTo(timelineContainerDiv);
timelineHeading.click(function () {
uiUtil.toggleControl(timelineHeading);
page.updateTimeline();
});
$('
', {
id: 'timeline',
class: 'toggle-container'
}).appendTo(timelineContainerDiv);
$('
', {
id: 'tag_clouds'
}).appendTo(controlDiv);
var clustersDiv = $('
', {
id: 'clusters',
class: 'tag_cloud'
}).appendTo(controlDiv);
var clusterHeading = $('
/Clusters
').appendTo(clustersDiv);
clusterHeading.click(function () {
uiUtil.toggleControl(clusterHeading);
page.updateTimeline();
});
$('
', {
id: 'clusterings',
class: 'toggle-container'
}).appendTo(clustersDiv);
var clusteringControls = $('
', {
id: 'clustering_controls',
class: 'toggle-container'
}).appendTo(clustersDiv);
$('
', {
class: 'label',
text: 'new clustering:'
}).appendTo(clusteringControls);
var nClusterDiv = $('', {
class: 'n_clusters',
text: 'number of clusters'
}).appendTo(clusteringControls);
var nClusterSpan = $('
', {
text: Math.max(1, clustering.nClusters)
});
var buttonDec = $('', {
class: 'button dec small',
text: '-'
}).appendTo(nClusterDiv);
buttonDec.click(function (event) {
if (clustering.nClusters > 1) {
clustering.nClusters--;
nClusterSpan.text(clustering.nClusters);
}
});
if (clustering.nClusters < 1) {
clustering.nClusters = 1
}
nClusterSpan.appendTo(nClusterDiv);
var buttonInc = $('
', {
class: 'button inc small',
text: '+'
}).appendTo(nClusterDiv);
buttonInc.click(function (event) {
clustering.nClusters++;
nClusterSpan.text(clustering.nClusters);
});
var checkboxDiv = $('
', {
class: 'clustering_criteria'
}).appendTo(clusteringControls);
$('
', {
id: 'keywords_checkbox',
type: 'checkbox',
checked: ''
}).appendTo(checkboxDiv);
$('
', {
text: 'keywords'
}).appendTo(checkboxDiv);
$('', {
id: 'author_checkbox',
type: 'checkbox'
}).appendTo(checkboxDiv);
$('', {
text: 'authors'
}).appendTo(checkboxDiv);
var createClusteringButton = $('', {
id: 'create_clustering',
class: 'button tooltip',
title: 'create a new clustering to automatically group publications',
text: 'create clustering'
}).appendTo(clusteringControls);
createClusteringButton.click(function () {
clustering.createClustering();
page.update();
});
}
function initResult() {
var resultHeaderDiv = $('
', {
id: 'result_header'
}).appendTo('#result');
$('
', {
id: 'stats'
}).appendTo(resultHeaderDiv);
$('
', {
id: 'sorting_description',
text: 'sorted by selector agreement and publication key'
}).appendTo(resultHeaderDiv);
$('
', {
id: 'result_body',
class: 'ui-layout-content'
}).appendTo('#result');
}
function initFooter() {
var footer = $('#footer');
var menuDiv = ($('