-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from BUAA-SE-Compiling/test-groups
Test groups
- Loading branch information
Showing
31 changed files
with
418 additions
and
164 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
authors = ["Rynco Maekawa <[email protected]>", "Rami3L Li <rami3l@>"] | ||
edition = "2018" | ||
name = "rurikawa-judger" | ||
version = "0.2.0-beta.3" | ||
version = "0.2.0-beta.4" | ||
|
||
[[bin]] | ||
name = "rurikawa" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
web/src/components/base-components/collapse-box/collapse-box.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<div class="collapse-box"> | ||
<div class="title row text"> | ||
<h2>{{ title }}</h2> | ||
<ng-content select="[title]"></ng-content> | ||
<div class="row-spacer"></div> | ||
<a class="expand-btn" (click)="toggle()">{{ | ||
collapsed ? "展开" : "折叠" | ||
}}</a> | ||
</div> | ||
<div class="content" *ngIf="!collapsed"> | ||
<ng-content></ng-content> | ||
<ng-content select="[body]"></ng-content> | ||
</div> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
web/src/components/base-components/toggle-button/toggle-button.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div | ||
class="toggle-btn btn" | ||
[class.secondary]="!active" | ||
[class.dark]="!active" | ||
[class.info]="active" | ||
(click)="toggle()" | ||
> | ||
<ng-content></ng-content> | ||
</div> |
25 changes: 25 additions & 0 deletions
25
web/src/components/base-components/toggle-button/toggle-button.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ToggleButtonComponent } from './toggle-button.component'; | ||
|
||
describe('ToggleButtonComponent', () => { | ||
let component: ToggleButtonComponent; | ||
let fixture: ComponentFixture<ToggleButtonComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ ToggleButtonComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ToggleButtonComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Empty file.
21 changes: 21 additions & 0 deletions
21
web/src/components/base-components/toggle-button/toggle-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-toggle-button', | ||
templateUrl: './toggle-button.component.html', | ||
styleUrls: ['./toggle-button.component.styl'], | ||
}) | ||
export class ToggleButtonComponent implements OnInit { | ||
constructor() {} | ||
|
||
@Input() | ||
active: boolean = false; | ||
@Output() activeChanged = new EventEmitter<boolean>(); | ||
|
||
toggle() { | ||
this.active = !this.active; | ||
this.activeChanged.emit(this.active); | ||
} | ||
|
||
ngOnInit(): void {} | ||
} |
2 changes: 1 addition & 1 deletion
2
web/src/components/item-components/job-test-item/job-test-item.component.styl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { Injectable } from '@angular/core'; | ||
|
||
export function startWatchingDarkMode() { | ||
if ( | ||
window.matchMedia && | ||
window.matchMedia('(prefers-color-scheme: dark)').matches | ||
) { | ||
onDarkMode(); | ||
} else { | ||
onLightMode(); | ||
} | ||
window | ||
.matchMedia('(prefers-color-scheme: dark)') | ||
.addEventListener('change', (event) => { | ||
if (event.matches) { | ||
onDarkMode(); | ||
} else { | ||
onLightMode(); | ||
} | ||
}); | ||
} | ||
|
||
export let darkModeWatcherInstance: DarkModeWatcher; | ||
|
||
@Injectable({ providedIn: 'root' }) | ||
export class DarkModeWatcher { | ||
constructor() { | ||
darkModeWatcherInstance = this; | ||
} | ||
} | ||
|
||
const lightModeAssets = { | ||
appleTouchIcon: 'assets/apple-touch-icon.png', | ||
icon32: 'assets/favicon-32x32.png', | ||
icon16: 'assets/favicon-16x16.png', | ||
iconIco: 'assets/favicon.ico', | ||
}; | ||
|
||
const darkModeAssets = { | ||
appleTouchIcon: 'assets/darkmode/apple-touch-icon.png', | ||
icon32: 'assets/darkmode/favicon-32x32.png', | ||
icon16: 'assets/darkmode/favicon-16x16.png', | ||
iconIco: 'assets/darkmode/favicon.ico', | ||
}; | ||
|
||
function onLightMode() { | ||
document.getElementsByTagName('body')[0].classList.add('default-palette'); | ||
document.getElementsByTagName('body')[0].classList.remove('inverted-palette'); | ||
(document.getElementById('apple-touch-icon') as HTMLLinkElement).href = | ||
lightModeAssets.appleTouchIcon; | ||
(document.getElementById('icon-32') as HTMLLinkElement).href = | ||
lightModeAssets['icon32']; | ||
(document.getElementById('icon-16') as HTMLLinkElement).href = | ||
lightModeAssets['icon16']; | ||
(document.getElementById('icon-ico') as HTMLLinkElement).href = | ||
lightModeAssets['iconIco']; | ||
} | ||
|
||
function onDarkMode() { | ||
document.getElementsByTagName('body')[0].classList.remove('default-palette'); | ||
document.getElementsByTagName('body')[0].classList.add('inverted-palette'); | ||
(document.getElementById('apple-touch-icon') as HTMLLinkElement).href = | ||
darkModeAssets.appleTouchIcon; | ||
(document.getElementById('icon-32') as HTMLLinkElement).href = | ||
darkModeAssets['icon32']; | ||
(document.getElementById('icon-16') as HTMLLinkElement).href = | ||
darkModeAssets['icon16']; | ||
(document.getElementById('icon-ico') as HTMLLinkElement).href = | ||
darkModeAssets['iconIco']; | ||
} |
Oops, something went wrong.