Skip to content

Commit

Permalink
Add tick boxes to enable/disable all artifacts/technical tracks at once
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-bell authored and msridhar committed Apr 4, 2020
1 parent 4cd2ba5 commit 0be07f8
Showing 1 changed file with 44 additions and 8 deletions.
52 changes: 44 additions & 8 deletions ui/js/code.js
Expand Up @@ -309,7 +309,24 @@ var pcminer = function(){
*/
function confSelected(conf){
var selected = document.conferences[conf].checked;
conferences[conf] = selected;
conferences[conf] = selected;
if (currentAuthor != undefined){
authorClicked(currentAuthor);
} else {
resetSelector();
}
};

/**
* invoked when a user selects/unselects a group of conferences using the checkboxes
*/
function confsSelected(group){
var selected = document.conferences[group].checked;
for(var i = 1; i < arguments.length; i++){
var conf = arguments[i];
document.conferences[conf].checked = selected;
conferences[conf] = selected;
}
if (currentAuthor != undefined){
authorClicked(currentAuthor);
} else {
Expand Down Expand Up @@ -698,14 +715,32 @@ var pcminer = function(){
*/
function installCheckboxes(){
var form = "<form name=conferences>\n";
for (confName in conferences){
form += "<label><input type=\"checkbox\" ";
form += "id=\"" + confName + "\" ";
form += "checked onclick='pcminer.confSelected(\"" + confName + "\")'> ";
form += "<font id=\"" + confName + "color\" ";
form += "class=\"conf\">" + confName + "</font>";
form += "</label>\n";
var technicalTracks = "";
var artifactTracks = "";
var techTrackNames ="";
var artifactTrackNames ="";
for (confName in conferences) {
var row = "<label><input type=\"checkbox\" ";
row += "id=\"" + confName + "\" ";
if (!confName.endsWith("-AE")) {
row += " checked ";
}
row += "onclick='pcminer.confSelected(\"" + confName + "\")'> ";
row += "<font id=\"" + confName + "color\" ";
row += "class=\"conf\">" + confName + "</font>";
row += "</label>\n";
if (confName.endsWith("-AE")) {
artifactTracks += row;
artifactTrackNames += ",'" + confName + "'";
} else {
technicalTracks += row;
techTrackNames += ",'" + confName + "'";
}
}

form += '<label><input type="checkbox" id="all-technical" checked onclick="pcminer.confsSelected(\'all-technical\'' + techTrackNames + ')" /> <b>Technical Tracks</b></label><br />' + technicalTracks + "<hr />";
form += '<label><input type="checkbox" id="all-artifacts" onclick="pcminer.confsSelected(\'all-artifacts\'' + artifactTrackNames + ')" /><b>Artifact Tracks</b></label><br />' + artifactTracks + "<br />";

form += "</form>\n";
document.getElementById("checkboxes").innerHTML = form;
for (conf in confColors){
Expand Down Expand Up @@ -737,6 +772,7 @@ var pcminer = function(){
dateFilterChanged : dateFilterChanged,
conditionFilterChanged : conditionFilterChanged,
confSelected : confSelected,
confsSelected: confsSelected,
copyToClipboard : copyToClipboard,
main : main
};
Expand Down

0 comments on commit 0be07f8

Please sign in to comment.