Skip to content

Commit

Permalink
#31 Darkmode improvements (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
austin48 authored Oct 4, 2023
1 parent 6b31e94 commit 8a129ca
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
public class GradebookItemTableRenderer extends Renderer {

private static final String CURSOR = "cursor:pointer";
private static final String EXP_COL_STYLE_CLASS = "expColIcon";
private static final String EXPANDED_IMG = "/images/expand.gif";
private static final String COLLAPSED_IMG = "/images/collapse.gif";

Expand Down Expand Up @@ -113,11 +114,13 @@ public void encodeBegin(FacesContext context, UIComponent component) throws IOEx
image.setValue(path + EXPANDED_IMG);
image.setAlt(imgExpandAlt);
image.setTitle(imgExpandTitle);
image.setStyleClass(EXP_COL_STYLE_CLASS);
}
else {
image.setValue(path + COLLAPSED_IMG);
image.setAlt(imgCollapseAlt);
image.setTitle(imgCollapseTitle);
image.setStyleClass(EXP_COL_STYLE_CLASS);
}

// Render the header facets (if any)
Expand Down Expand Up @@ -158,6 +161,7 @@ public void encodeBegin(FacesContext context, UIComponent component) throws IOEx
writer.writeURIAttribute("src", image.getValue(), null);
writer.writeURIAttribute("onclick", onclickText, null);
writer.writeURIAttribute("style", CURSOR, null);
writer.writeURIAttribute("class", EXP_COL_STYLE_CLASS, null);
writer.writeURIAttribute("alt", image.getAlt(), null);
writer.writeURIAttribute("title", image.getTitle(), null);
writer.writeURIAttribute("id", "expandCollapseAll", null);
Expand Down Expand Up @@ -398,6 +402,7 @@ else if (nextItem instanceof AssignmentGradeRow) {
writer.writeURIAttribute("src", image.getValue(), null);
writer.writeURIAttribute("onclick", hideTr, null);
writer.writeURIAttribute("style", CURSOR, null);
writer.writeURIAttribute("class", EXP_COL_STYLE_CLASS, null);
writer.writeURIAttribute("alt", image.getAlt(), null);
writer.writeURIAttribute("title", image.getTitle(), null);
writer.writeURIAttribute("id", imgId, null);
Expand Down
22 changes: 22 additions & 0 deletions app/ui/src/webapp/css/gradebook.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ td.gbMessageAboveNumber {vertical-align:top; text-align:right; padding-right:2em
background-repeat: no-repeat;
background-position: center center;
text-decoration: none;
filter: var(--sakai-image-invert);
}

.sortDown {
Expand All @@ -207,6 +208,7 @@ td.gbMessageAboveNumber {vertical-align:top; text-align:right; padding-right:2em
background-repeat: no-repeat;
background-position: center center;
text-decoration: none !important;
filter: var(--sakai-image-invert);
}

#exportPrefsLink {
Expand Down Expand Up @@ -243,3 +245,23 @@ td.gbMessageAboveNumber {vertical-align:top; text-align:right; padding-right:2em
vertical-align: middle;
visibility: hidden;
}

table.listHier tr.external:nth-child(even) {
color: var(--sakai-color-gray--darker-4);
}

table.listHier tr.external:nth-child(even) a[href] {
color: var(--sakai-primary-color-1);
}

table.listHier tr.external:nth-child(even) .sortUp, tr.external:nth-child(even) .sortDown {
filter: none;
}

.expColIcon {
filter: var(--sakai-image-invert);
}

.currentSort > img {
filter: var(--sakai-image-invert);
}
6 changes: 6 additions & 0 deletions app/ui/src/webapp/css/gradebookStandalone.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,17 @@ td.subItemSummary table tr td {
font-weight:bold;
text-decoration:none;
}
.currentSort img {
filter: var(--sakai-image-invert);
}

.notCurrentSort {
font-weight:normal;
text-decoration:none;
}
.notCurrentSort img {
filter: var(--sakai-image-invert);
}

/*
Standard item list tables.
Expand Down
4 changes: 2 additions & 2 deletions app/ui/src/webapp/css/spreadsheetUI.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ div#mainwrap {
position: relative;
}
div#headers {
background-color: #ddd;
background-color: var(--sakai-background-color-3);
border: 1px solid #afafaf;
border-bottom: 4px solid #afafaf;
overflow: hidden;
Expand Down Expand Up @@ -33,7 +33,7 @@ ul#q1 {
}

ul#q1 li {
background-color: #ddd;
background-color: var(--sakai-background-color-3);
border: 1px solid #a3a3a3;
bottom: 0;
display: block;
Expand Down
8 changes: 7 additions & 1 deletion app/ui/src/webapp/js/gradebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ function showHideDiv(hideDivisionNo, context, expandAlt, collapseAlt, expandTitl
imgNo.src = context + "/images/collapse.gif";
imgNo.alt = collapseAlt;
imgNo.title = collapseTitle;
imgNo.classList.add("expColIcon");
}
}
else
Expand All @@ -226,6 +227,7 @@ function showHideDiv(hideDivisionNo, context, expandAlt, collapseAlt, expandTitl
imgNo.src = context + "/images/expand.gif";
imgNo.alt = expandAlt;
imgNo.title = expandTitle;
imgNo.classList.add("expColIcon");
}
}
}
Expand Down Expand Up @@ -257,11 +259,13 @@ function showHideAll(numToggles, context, expandAlt, collapseAlt, expandTitle, c
imgNo.src = context + "/images/collapse.gif";
imgNo.alt = collapseAlt;
imgNo.title = collapseTitle;
imgNo.classList.add("expColIcon");
}
if (imgAll) {
imgAll.src = context + "/images/collapse.gif";
imgAll.alt = collapseAlt;
imgAll.title = collapseTitle;
imgAll.classList.add("expColIcon");
}
}
else {
Expand All @@ -272,12 +276,14 @@ function showHideAll(numToggles, context, expandAlt, collapseAlt, expandTitle, c
imgNo.src = context + "/images/expand.gif";
imgNo.alt = expandAlt;
imgNo.title = expandTitle;
imgNo.classList.add("expColIcon");
}

if (imgAll) {
imgAll.src = context + "/images/expand.gif";
imgAll.alt = expandAlt;
imgAll.title = expandTitle;
imgAll.title = expandTitle;
imgAll.classList.add("expColIcon");
}
}
}
Expand Down

0 comments on commit 8a129ca

Please sign in to comment.