Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor HTML fixes #197

Open
wants to merge 3 commits into
base: master-node
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions backend/src/database/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ const stmtUpdateSession: string = 'UPDATE users.Session SET idProfile = ? WHERE
const stmtSelExperiments: string = `
SELECT ers.idSession, ers.role, e.experiment, e.idExperiment, e.active, err.randrole
FROM (
SELECT *
SELECT *
FROM users.Experiment e
WHERE e.active = 1
) e
LEFT JOIN (
SELECT er.idExperiment, er.role, ers.idSession
SELECT er.idExperiment, er.role, ers.idSession
FROM users.Experiment_Role_Session ers
INNER JOIN users.ExperimentRole er ON er.idExperimentRole = ers.idExperimentRole
INNER JOIN users.ExperimentRole er ON er.idExperimentRole = ers.idExperimentRole
WHERE ers.idSession = ?
) ers ON ers.idExperiment = e.idExperiment
LEFT JOIN (
Expand Down Expand Up @@ -227,4 +227,4 @@ export async function updateSession(idProfile: number, idSession: number) {
logDbErr(error, 'error during updating session', 'warn');
return [error];
}
}
}
4 changes: 2 additions & 2 deletions backend/src/public/css/main_trimmed.css
Original file line number Diff line number Diff line change
Expand Up @@ -13277,7 +13277,7 @@ nav .nav-item #navbar-user:after,
.clickable, nav .navbar-nav-sm li, nav .nav-item, #table-container > div #table-column-sort-panel .column-sorter .column-sorter-order, #table-container > div #table-column-sort-panel .column-sorter .column-sorter-delete, #account-container #editor-identifier {
cursor: pointer; }

.font-size-small, #homepage-container section#description-section .spreadsheet-related-content, #homepage-container section#description-section .publication-link + p, #homepage-container section#description-section .footer, #form-container #login-component form label[for="password"] a, #form-container #signup-component form label[for="password"] a, #form-container #forget-component form label[for="password"] a, #form-container #info-section p, #table-container > div #table-cell-input-form #locate-cell #locate-cell-row-col, #table-container > div #table-cell-input-form #input-form-legend, #table-container > div #table-cell-input-form #input-form-legend-orange {
.font-size-small, #homepage-container section#description-section li p, #homepage-container section#description-section .footer, #form-container #login-component form label[for="password"] a, #form-container #signup-component form label[for="password"] a, #form-container #forget-component form label[for="password"] a, #form-container #info-section p, #table-container > div #table-cell-input-form #locate-cell #locate-cell-row-col, #table-container > div #table-cell-input-form #input-form-legend, #table-container > div #table-cell-input-form #input-form-legend-orange {
font-size: small; }

.font-size-large, #table-container table tfoot tr:nth-child(2).cellcopy th, #table-container table tfoot tr:nth-child(2).columncopy th, #table-container table tfoot tr:nth-child(2).celleditor-help th, #table-container table tfoot tr:nth-child(2).insertion-verification th, #table-container table tfoot tr:nth-child(2).insertion-success th, #table-container table tfoot tr:nth-child(2).insertion-failure th, #table-container table tfoot tr:nth-child(2).delete-success th, #table-container table tfoot tr:nth-child(2).delete-failure th {
Expand Down Expand Up @@ -14053,4 +14053,4 @@ span.dyk-col-search {

#cursor-pointer {
cursor: pointer;
}
}
9 changes: 3 additions & 6 deletions backend/src/public/css_sass/pages/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
}

section#thumbnail-section {
@extend .d-none;
@extend .d-md-flex;
@extend .d-none;
@extend .d-md-flex;
min-width: $img-width;
min-height: 350px;
background-image: linear-gradient(45deg,#003aff 0%,#00b9ff 100%);
Expand Down Expand Up @@ -76,10 +76,7 @@
@extend .mt-4;
}
}
.spreadsheet-related-content {
@extend %aside-text;
}
.publication-link + p {
li p {
@extend %aside-text;
}
.footer {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/public/js/modules/components/sheet/databaits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ function closeModal() {

function escKeyListener(event: KeyboardEvent) {
if(event.key === 'Escape'){
closeModal();
}
closeModal();
}
}

function activateKeyListener() {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/public/js/modules/components/sheet/delete-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function escKeyListener(event: KeyboardEvent) {
if(event.key === 'Escape'){
// eslint-disable-next-line @typescript-eslint/no-use-before-define
modalsClose();
}
}
}

function activateKeyListener() {
Expand All @@ -36,7 +36,7 @@ function deactivateKeyListener() {
function modalsClose() {
deactivateKeyListener();
deleteRowModal.style.display = 'none';
deleteRowModalError.style.display = 'none';
deleteRowModalError.style.display = 'none';
}

deleteModalClose.addEventListener('click', function(event: MouseEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* This module provide instantiations of Abstraction class:
*
* + ForwardingInstantiation: allows access/modification to registered properties to be resolved with a registered target `forwardingTo_`. More, specifically, these operations are regulated by a ForwardingPropertyDescriptor, a descriptor which could contain callbacks that receives additional arguments including `forwardingTo_` and the Instantiation instance.
* + DOMForwardingInstantiation: extends ForwardingInstantiation with default descriptor that treat registered properties as a DOM attribute or JS property of the forwarding target.
* + ForwardingInstantiation: allows access/modification to registered properties to be resolved with a registered target `forwardingTo_`. More, specifically, these operations are regulated by a ForwardingPropertyDescriptor, a descriptor which could contain callbacks that receives additional arguments including `forwardingTo_` and the Instantiation instance.
* + DOMForwardingInstantiation: extends ForwardingInstantiation with default descriptor that treat registered properties as a DOM attribute or JS property of the forwarding target.
*/

import { Abstraction, Prop } from './Abstraction';
Expand Down Expand Up @@ -67,25 +67,25 @@ export class ForwardingInstantiation extends Abstraction {

/**
* Transform a ForwardingPropertyDescriptor into a PropertyDescriptor. More specifically, it creates wrapper getter and setter that invoke the ForwardingPropertyDescriptor's getter and setter by supplying additional arguments through scoping.
* @example
* To transform into an empty property descriptor, simply pass `{}` as `descriptor`.
* @example
* To transform into an empty property descriptor, simply pass `{}` as `descriptor`.
*
* @param {Partial<ForwardingPropertyDescriptor>} descriptor - An object containing partial implementation of a ForwardingPropertyDescriptor.
* @param {ForwardingInstantiation} thisArgument - The invoking context: an ForwardingInstantiation which provides a forwarding target.
* @return {Partial<PropertyDescriptor>} A partial implementation of a property descriptor.
*/
private static __transformPropertyDescriptor(descriptor: Partial<ForwardingPropertyDescriptor>, thisArgument: ForwardingInstantiation): Partial<PropertyDescriptor> {
const accessFunctions: AccessFunctions = { };
if ('get' in descriptor) {
if ('get' in descriptor) {
accessFunctions.get = () => {
return descriptor.get(thisArgument.forwardingTo_, thisArgument);
};
}
if ('set' in descriptor) {
accessFunctions.set = (v: any) => {
}
if ('set' in descriptor) {
accessFunctions.set = (v: any) => {
return descriptor.set(v, thisArgument.forwardingTo_, thisArgument);
};
}
};
}
return Object.assign({}, descriptor, accessFunctions);
}

Expand All @@ -100,7 +100,7 @@ export class ForwardingInstantiation extends Abstraction {
private static __transformPropertyDescriptors(props: Record<Prop, Partial<ForwardingPropertyDescriptor>>, thisArgument: ForwardingInstantiation): Record<Prop, Partial<PropertyDescriptor>> {
const _props: Record<Prop, Partial<PropertyDescriptor>> = {};
for (const property in props) {
const descriptor = props[property];
const descriptor = props[property];
_props[property] = this.__transformPropertyDescriptor(descriptor, thisArgument);
}
return _props;
Expand Down Expand Up @@ -145,19 +145,19 @@ export class ForwardingInstantiation extends Abstraction {
*
* The property will be resolved in the following order:
*
* 1. a HTML attribute like `class` for a `<div class="active></div>`
* 2. a JS property like `classList`, `textContent`
* 3. a custom property
* 1. a HTML attribute like `class` for a `<div class="active></div>`
* 2. a JS property like `classList`, `textContent`
* 3. a custom property
*
* Some caveats:
*
* + The property has to be a string.
* + If the element does not have the DOM property {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttribute}, the operation will not stop, rather it will try to resolve the property as a JS property then a custom property. But suppose this DOM attribute comes into existence because of user action or script execution, next operation will resolve this property as a DOM attribute even if a same-named JS property or custom property exists. The opposite is also true where a DOM attribute no longer exists. To avoid such situations, you are recommended to
* + predefine the DOM attribute,
* @example `element.class = ""`
* + use the JS property equivalent
* @example `class` can be substituted with `className`
* + If you need to define a custom property, you should avoid clashing with potential HTML attributes and JS properties
* + The property has to be a string.
* + If the element does not have the DOM property {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttribute}, the operation will not stop, rather it will try to resolve the property as a JS property then a custom property. But suppose this DOM attribute comes into existence because of user action or script execution, next operation will resolve this property as a DOM attribute even if a same-named JS property or custom property exists. The opposite is also true where a DOM attribute no longer exists. To avoid such situations, you are recommended to
* + predefine the DOM attribute,
* @example `element.class = ""`
* + use the JS property equivalent
* @example `class` can be substituted with `className`
* + If you need to define a custom property, you should avoid clashing with potential HTML attributes and JS properties
*
* @augments ForwardingInstantiation
*/
Expand All @@ -181,9 +181,9 @@ export class DOMForwardingInstantiation extends ForwardingInstantiation {

/**
* Creates a default access descriptor that
*
* + for a [[GET]] operation, attempts to query same-named property from the HTML element that is the forward target {@link getProperty}
* + for a [[SET]] operation, attempts to modify same-named property from the HTML element that is the forward target {@link setProperty}
*
* + for a [[GET]] operation, attempts to query same-named property from the HTML element that is the forward target {@link getProperty}
* + for a [[SET]] operation, attempts to modify same-named property from the HTML element that is the forward target {@link setProperty}
*
* @public
* @param {string} property - Name of property.
Expand All @@ -192,31 +192,31 @@ export class DOMForwardingInstantiation extends ForwardingInstantiation {
static defaultForwardingDescriptor__(property: string): Partial<ForwardingPropertyDescriptor> {
return {
get(forwardingTo: HTMLElement): any {
return getProperty(forwardingTo, property);
return getProperty(forwardingTo, property);
},
set(newValue: any, forwardingTo: HTMLElement) {
setProperty(forwardingTo, property, newValue);
setProperty(forwardingTo, property, newValue);
}
};
}

/**
* For each property, supplies default access descriptor if none has been provided.
*
* More specifically, it iterates through each property, descriptor pair and replace falsy descriptor value with default descriptor.
*
* @see {@link DOMForwardingInstantiation.defaultForwardingDescriptor__}
* @param {Record<string, Partial<ForwardingPropertyDescriptor>>} props - An object containing mapping from properties to their descriptors.
* @return An object containing mapping from properties to their descriptors where default descriptor has replaced falsy descriptor value.
*/
private static __fillDefaultDescriptor(props: Record<string, Partial<ForwardingPropertyDescriptor>>): Record<string, Partial<ForwardingPropertyDescriptor>> {
/**
* For each property, supplies default access descriptor if none has been provided.
*
* More specifically, it iterates through each property, descriptor pair and replace falsy descriptor value with default descriptor.
*
* @see {@link DOMForwardingInstantiation.defaultForwardingDescriptor__}
* @param {Record<string, Partial<ForwardingPropertyDescriptor>>} props - An object containing mapping from properties to their descriptors.
* @return An object containing mapping from properties to their descriptors where default descriptor has replaced falsy descriptor value.
*/
private static __fillDefaultDescriptor(props: Record<string, Partial<ForwardingPropertyDescriptor>>): Record<string, Partial<ForwardingPropertyDescriptor>> {
const _props: Record<Prop, Partial<ForwardingPropertyDescriptor>> = {};
for (const property in props) {
const descriptor = props[property];
_props[property] = descriptor ? descriptor : this.defaultForwardingDescriptor__(property);
const descriptor = props[property];
_props[property] = descriptor ? descriptor : this.defaultForwardingDescriptor__(property);
}
return _props;
}
}

/**
* @override
Expand Down
4 changes: 2 additions & 2 deletions backend/src/public/js/modules/utils/length.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function getTextWidthMeasureElement(): HTMLElement {
// initialize text width measure
textWidthMeasureElement = document.createElement('span');
textWidthMeasureElement.id = 'text-width-measure';
const bodyElement = document.body;
bodyElement.prepend(textWidthMeasureElement);
const bodyElement = document.body;
bodyElement.prepend(textWidthMeasureElement);
}
return textWidthMeasureElement;
}
Expand Down
16 changes: 8 additions & 8 deletions backend/views/pages/home.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@
<a class="spreadsheet-link" href="/csprofessors">
Computer Science Professors
</a>
<p>
Used for an <a href="https://jeffhuang.com/computer_science_professors.html" target="_blank">analysis of computer science hiring trends <i class="fa fa-external-link-alt" aria-hidden="true"></i></a>
</p>
</li>
<div class="spreadsheet-related-content">
<p>Used for an <a href="https://jeffhuang.com/computer_science_professors.html" target="_blank">analysis of computer science hiring trends <i class="fa fa-external-link-alt" aria-hidden="true"></i></a></p>
</div>
<!-- CS Open Rankings -->
<li class="spreadsheet">
<a class="spreadsheet-link" href="/csopenrankings">
CS Open Rankings
</a>
<p>
A new approach to computer science rankings. A meta ranker using real-time data from CS Professors as one of its sources.
</p>
</li>
<div class="spreadsheet-related-content">
<p>A new approach to computer science rankings. A meta ranker using real-time data from CS Professors as one of its sources.</p>
</div>
</ul>
</div>
<div id="articles">
<ul>
{{#each publications}}
<li class="publication">
<a class="publication-link" href="{{link}}">{{name}}</a>
<a href="{{link}}">{{name}}</a>
<p>{{description}}
{{#if source}}
<a href="https://github.com/brownhci/drafty" target="_blank">[source code] <i class="fa fa-external-link-alt" aria-hidden="true"></i></a>
<a href="https://github.com/brownhci/drafty" target="_blank">[source code] <i class="fa fa-external-link-alt" aria-hidden="true"></i></a>
{{/if}}
</p>
</li>
Expand Down
6 changes: 3 additions & 3 deletions backend/views/pages/home500.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<div id="articles">
<ul>
{{#each publications}}
<li class="publication">
<a class="publication-link" href="{{link}}">{{name}}</a>
<li>
<a href="{{link}}">{{name}}</a>
<p>{{description}} <a href="https://github.com/brownhci/drafty" target="_blank">[source code]</a></p>
</li>
{{/each}}
Expand All @@ -46,4 +46,4 @@
</p>
</div>
</section>
</main>
</main>
Loading