Init commit

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "frontend"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets/fonts",
"assets/i18n",
"assets/icons",
"manifest.json"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"serviceWorker": false,
"styles": [
"styles.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {
}
}
}
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
.editorconfig
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
# System Files
.DS_Store
Thumbs.db
# Frontend
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.2.0.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
import { FrontendPage } from './app.po';
describe('frontend App', () => {
let page: FrontendPage;
beforeEach(() => {
page = new FrontendPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!!');
});
});
import { browser, by, element } from 'protractor';
export class FrontendPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/dist" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="piwik" level="application" />
</component>
</module>
\ No newline at end of file
{
"pattern": "/**/*",
"options": {
"UseMinExt": false,
"MinifyOptions": {
"screw-ie8": true,
"compress": true,
"mangle": true
},
"OutDir": "dist",
"RootDir": "dist",
"RemoveSource": true,
"Debug": false
}
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
This diff is collapsed.
{
"name": "frontend",
"version": "1.0.0",
"license": "MIT",
"repository": "git@git.thm.de:arsnova/arsnova.click-v2.git",
"description": "Version 2 of arsnova.click (Frontend WebApp)",
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --port 4200 --disable-host-check --aot",
"build:DEV": "ng serve --host 0.0.0.0 --port 4200 --disable-host-check --prod --aot --build-optimizer",
"build:PROD": "ng build --output-path=dist/ --no-sourcemap --prod --aot --build-optimizer",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"compress": "gzip dist/** -r",
"prod-test": "npm run prod && npm run compress && http-server dist/ -p 4711 --gzip",
"prod": "npm run build:PROD",
"postprod": "npm run cleanup-sass && npm run imagemin && npm run cache",
"cleanup-sass": "rimraf dist/assets/fonts/font-awesome-4.7.0/scss",
"imagemin": "find dist/assets/icons/ -type d -exec imagemin {}/* --out-dir={} --plugin=pngquant \\;",
"cache": "sw-precache --config=sw-precache.config.js",
"postcache": "uglifyjs dist/service-worker.js --screw-ie8 --compress --mangle --output dist/service-worker.js"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.0.1",
"@angular/common": "^5.0.1",
"@angular/compiler": "^5.0.1",
"@angular/core": "^5.0.1",
"@angular/forms": "^5.0.1",
"@angular/http": "^5.0.1",
"@angular/platform-browser": "^5.0.1",
"@angular/platform-browser-dynamic": "^5.0.1",
"@angular/router": "^5.0.1",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.5",
"@ngx-translate/core": "^8.0.0",
"@ngx-translate/http-loader": "^2.0.0",
"@techiediaries/ngx-qrcode": "0.0.5",
"bootstrap": "^4.0.0-beta.2",
"enhanced-resolve": "^3.4.1",
"highlight.js": "^9.12.0",
"intro.js": "^2.8.0-alpha.1",
"jquery": "^3.2.1",
"marked": "^0.3.6",
"messageformat": "^1.0.2",
"ngx-qrcode2": "0.0.5",
"ngx-translate-messageformat-compiler": "^2.0.1",
"popper.js": "^1.12.8",
"rxjs": "^5.5.2",
"zone.js": "^0.8.18"
},
"devDependencies": {
"@angular/cli": "1.5.0",
"@angular/compiler-cli": "^5.0.1",
"@angular/language-service": "^5.0.1",
"@types/jasmine": "~2.8.1",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.0.52",
"codelyzer": "~4.0.1",
"uglify-js": "^3.1.9",
"imagemin-pngquant": "^5.0.1",
"rimraf": "^2.6.2",
"http-server": "^0.10.0",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.6.1",
"protractor": "~5.2.0",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.6",
"sw-precache": "^5.2.0",
"ts-node": "~3.3.0",
"tslint": "~5.8.0",
"typescript": "2.4.2"
}
}
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
@import "assets/fonts/font-awesome-4.7.0/scss/font-awesome";
@import "~bootstrap/scss/bootstrap";
@import "~intro.js/introjs.css";
@import "~intro.js/themes/introjs-nassim.css";
<nav *ngIf="footerElements.length"
class="nav navbar-footer flex-nowrap flex-sm-column justify-content-sm-start p-1"
role="navigation">
<input class="hidden" id="upload-session" type="file" (change)="fileChange($event)" accept="application/json" multiple="multiple"/>
<div *ngFor="let elem of footerElements"
[class]="'footerElement py-sm-2 px-sm-1 justify-content-center justify-content-sm-start ' + (elem.selectable ? elem.isActive ? 'success' : 'error' : '')"
[id]="elem.id"
[routerLink]="getLinkTarget(elem)"
[attr.data-intro]="elem.showIntro ? (('region.footer.footer_bar.description.' + elem.id) | translate) : null"
(click)="toggleSetting(elem);elem.onClickCallback(elem)">
<p class="footerElemIcon"><i [class]="elem.iconClass" aria-hidden="true"></i></p>
<p class="footerElemText text-left ml-2"><span [class]="elem.textClass" [innerHTML]="elem.textName | translate"></span></p>
</div>
</nav>
@import "../../../styles_vendor";
.navbar-footer {
position: absolute;
left: 0;
z-index: 1040;
@include media-breakpoint-up(sm) {
@include border-right-radius($border-radius);
&:hover {
opacity: 0.95;
.footerElement {
.footerElemText {
display: block;
}
}
}
}
@include media-breakpoint-down(xs) {
overflow: scroll;
justify-content: left;
width: 100%;
}
@include media-breakpoint-up(sm) {
justify-content: center;
}
.footerElement {
cursor: pointer;
display: flex;
align-items: center;
flex-shrink: 0;
@include media-breakpoint-down(xs) {
padding: 10px;
flex-grow: 1;
}
@include media-breakpoint-up(sm) {
padding: 0;
flex-grow: 0;
}
.footerElemText {
flex-shrink: 0;
@include media-breakpoint-up(sm) {
display: none;
}
}
p {
margin: 0;
line-height: 25px;
}
}
}
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {FooterBarComponent} from './footer-bar.component';
describe('FooterBarComponent', () => {
let component: FooterBarComponent;
let fixture: ComponentFixture<FooterBarComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [FooterBarComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FooterBarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import {FooterbarElement, FooterBarService} from '../../service/footer-bar.service';
import {Router} from '@angular/router';
import {Subscription} from 'rxjs/Subscription';
import {FileUploadService} from '../../service/file-upload.service';
import {CurrentQuizService} from '../../service/current-quiz.service';
@Component({
selector: 'app-footer-bar',
templateUrl: './footer-bar.component.html',
styleUrls: ['./footer-bar.component.scss']
})
export class FooterBarComponent implements OnInit, OnDestroy {
get _footerElements(): Array<FooterbarElement> {
return this.footerElements;
}
@Input() footerElements: Array<FooterbarElement> = [];
private _routerSubscription: Subscription;
constructor(
private router: Router,
private footerBarService: FooterBarService,
private currentQuizService: CurrentQuizService,
private fileUploadService: FileUploadService) {
}
ngOnInit() {
this._routerSubscription = this.router.events.subscribe((val) => {
if (val.hasOwnProperty('url')) {
this.footerBarService.footerElemTheme.linkTarget = val['url'].indexOf('lobby') > -1 ? '/quiz/flow/theme' : '/themes';
}
});
}
ngOnDestroy() {
this._routerSubscription.unsubscribe();
}
getLinkTarget(elem: FooterbarElement): void {
return typeof elem.linkTarget === 'function' ? elem.linkTarget(elem) : elem.linkTarget;
}
toggleSetting(elem: FooterbarElement) {
this.currentQuizService.toggleSetting(elem);
}
public fileChange(event: any) {
const fileList: FileList = event.target.files;
if (!fileList.length) {
return;
}
const formData: FormData = new FormData();
for (let i = 0; i < fileList.length; i++) {
const file: File = fileList[i];
formData.append('uploadFiles[]', file, file.name);
}
this.fileUploadService.uploadFile(formData);
}
}
import {NgModule} from '@angular/core';
import {FooterBarComponent} from './footer-bar/footer-bar.component';
import {SharedModule} from '../shared/shared.module';
import {HttpModule} from '@angular/http';
@NgModule({
imports: [
SharedModule,
HttpModule
],
declarations: [FooterBarComponent],
providers: [SharedModule],
bootstrap: [FooterBarComponent],
exports: [
FooterBarComponent
]
})
export class FooterModule {
}
import {NgModule} from '@angular/core';
import {HeaderComponent} from './header/header.component';
import {SharedModule} from '../shared/shared.module';
import {HeaderLabelService} from '../service/header-label.service';
@NgModule({
imports: [
SharedModule
],
exports: [
HeaderComponent
],
declarations: [HeaderComponent],
providers: [HeaderLabelService],
bootstrap: [HeaderComponent]
})
export class HeaderModule {
}
<nav class="navbar navbar-header" id="header">
<div class="arsnova-logo d-flex align-items-center pointer">
<!--suppress HtmlUnknownAttribute -->
<svg [routerLink]="['/']" version="1.1" id="arsnova-logo-image" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 1024 1024" xml:space="preserve">
<!--suppress HtmlUnknownAttribute -->
<g id="text">
<text transform="translate(512 200)" class="arsnova-logo-origin" [innerHTML]="origin"></text>
<text transform="matrix(1 0 0 1 69 500)" class="arsnova-logo-ars">ars</text>
<text transform="matrix(1 0 0 1 420 500)" class="arsnova-logo-nova">nova</text>
<text transform="matrix(1 0 0 1 512 820)" class="arsnova-logo-click">.click</text>